summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-09 00:41:27 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-06-09 00:41:27 +0200
commit99b88cfb5354337ec55e38ae8d42fb08dc14d25b (patch)
tree19336faadeb27fb06dca63cf47d0d0db4a07729b /pkgs
parent61129e1ee9a37d75f2f26c8eb5de1c984766a461 (diff)
parent8c4a613f3a478c1cb2994fb9df3b0eb92d4c7885 (diff)
downloadnixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar.gz
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar.bz2
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar.lz
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar.xz
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.tar.zst
nixpkgs-99b88cfb5354337ec55e38ae8d42fb08dc14d25b.zip
Merge remote-tracking branch 'origin/master' into multiple-outputs
Conflicts:
	pkgs/development/libraries/acl/default.nix
	pkgs/development/libraries/atk/2.6.x.nix
	pkgs/development/libraries/attr/default.nix
	pkgs/development/libraries/cairo/default.nix
	pkgs/development/libraries/freetype/default.nix
	pkgs/development/libraries/glib/2.34.x.nix
	pkgs/development/libraries/gtk+/2.24.x.nix
	pkgs/development/libraries/libtiff/default.nix
	pkgs/development/libraries/openssl/default.nix
	pkgs/development/libraries/pango/1.30.x.nix
	pkgs/misc/cups/default.nix
	pkgs/os-specific/linux/util-linux/default.nix
	pkgs/servers/x11/xorg/builder.sh
	pkgs/servers/x11/xorg/default.nix
	pkgs/top-level/all-packages.nix
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/abcde/abcde.patch30
-rw-r--r--pkgs/applications/audio/abcde/cd-paranoia.patch16
-rw-r--r--pkgs/applications/audio/abcde/default.nix31
-rw-r--r--pkgs/applications/audio/abcde/install.patch21
-rw-r--r--pkgs/applications/audio/abcde/which.patch16
-rw-r--r--pkgs/applications/audio/amarok/default.nix12
-rw-r--r--pkgs/applications/audio/amarok/find-mysql.patch46
-rw-r--r--pkgs/applications/audio/amarok/live.nix37
-rw-r--r--pkgs/applications/audio/ardour/ardour3.nix43
-rw-r--r--pkgs/applications/audio/ardour/default.nix41
-rw-r--r--pkgs/applications/audio/audacious/default.nix2
-rw-r--r--pkgs/applications/audio/audacity/default.nix26
-rw-r--r--pkgs/applications/audio/bristol/default.nix29
-rw-r--r--pkgs/applications/audio/calf/default.nix15
-rw-r--r--pkgs/applications/audio/caps/default.nix29
-rw-r--r--pkgs/applications/audio/cmus/default.nix12
-rw-r--r--pkgs/applications/audio/csound/default.nix34
-rw-r--r--pkgs/applications/audio/distrho/default.nix54
-rw-r--r--pkgs/applications/audio/drumkv1/default.nix21
-rw-r--r--pkgs/applications/audio/espeak/default.nix8
-rw-r--r--pkgs/applications/audio/espeak/edit.nix31
-rw-r--r--pkgs/applications/audio/flac/default.nix2
-rw-r--r--pkgs/applications/audio/gmpc/default.nix51
-rw-r--r--pkgs/applications/audio/guitarix/default.nix53
-rw-r--r--pkgs/applications/audio/hydrogen/default.nix3
-rw-r--r--pkgs/applications/audio/id3v2/default.nix2
-rw-r--r--pkgs/applications/audio/jack-capture/default.nix28
-rw-r--r--pkgs/applications/audio/jack-oscrolloscope/default.nix26
-rw-r--r--pkgs/applications/audio/jack-rack/default.nix23
-rw-r--r--pkgs/applications/audio/jalv/default.nix29
-rw-r--r--pkgs/applications/audio/lame/default.nix4
-rw-r--r--pkgs/applications/audio/lash/default.nix3
-rw-r--r--pkgs/applications/audio/lash/gcc-47.patch11
-rw-r--r--pkgs/applications/audio/lastwatch/default.nix29
-rw-r--r--pkgs/applications/audio/linuxsampler/default.nix14
-rw-r--r--pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff50
-rw-r--r--pkgs/applications/audio/mda-lv2/default.nix27
-rw-r--r--pkgs/applications/audio/mid2key/default.nix25
-rw-r--r--pkgs/applications/audio/monkeys-audio/buildfix.diff27
-rw-r--r--pkgs/applications/audio/monkeys-audio/default.nix14
-rw-r--r--pkgs/applications/audio/mopidy/default.nix44
-rw-r--r--pkgs/applications/audio/mopidy/git.nix44
-rw-r--r--pkgs/applications/audio/ncmpcpp/default.nix7
-rw-r--r--pkgs/applications/audio/normalize/default.nix17
-rw-r--r--pkgs/applications/audio/opus-tools/default.nix17
-rw-r--r--pkgs/applications/audio/pavucontrol/default.nix8
-rw-r--r--pkgs/applications/audio/picard/default.nix46
-rw-r--r--pkgs/applications/audio/praat/default.nix26
-rw-r--r--pkgs/applications/audio/puredata/default.nix21
-rw-r--r--pkgs/applications/audio/qjackctl/default.nix8
-rw-r--r--pkgs/applications/audio/qmmp/default.nix59
-rw-r--r--pkgs/applications/audio/samplv1/default.nix21
-rw-r--r--pkgs/applications/audio/shntool/default.nix21
-rw-r--r--pkgs/applications/audio/spotify/default.nix55
-rw-r--r--pkgs/applications/audio/swh-lv2/default.nix39
-rw-r--r--pkgs/applications/audio/synthv1/default.nix21
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix2
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix2
-rw-r--r--pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix23
-rw-r--r--pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch13
-rw-r--r--pkgs/applications/display-managers/lightdm/default.nix25
-rw-r--r--pkgs/applications/display-managers/lightdm/lightdm.patch193
-rw-r--r--pkgs/applications/display-managers/slim/default.nix6
-rw-r--r--pkgs/applications/editors/aewan/default.nix19
-rw-r--r--pkgs/applications/editors/eclipse/default.nix39
-rw-r--r--pkgs/applications/editors/ed/default.nix15
-rw-r--r--pkgs/applications/editors/emacs-22/builder.sh27
-rw-r--r--pkgs/applications/editors/emacs-22/default.nix58
-rw-r--r--pkgs/applications/editors/emacs-24/builder.sh2
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/cedet/default.nix8
-rw-r--r--pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix26
-rw-r--r--pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix25
-rw-r--r--pkgs/applications/editors/emacs-modes/haskell/default.nix14
-rw-r--r--pkgs/applications/editors/emacs-modes/htmlize/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/magit/default.nix21
-rw-r--r--pkgs/applications/editors/emacs-modes/nxml/builder.sh7
-rw-r--r--pkgs/applications/editors/emacs-modes/nxml/default.nix8
-rw-r--r--pkgs/applications/editors/emacs-modes/org/default.nix26
-rw-r--r--pkgs/applications/editors/emacs-modes/org2blog/default.nix31
-rw-r--r--pkgs/applications/editors/emacs-modes/prolog/default.nix24
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/default.nix16
-rw-r--r--pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix20
-rw-r--r--pkgs/applications/editors/emacs-modes/xml-rpc/default.nix32
-rw-r--r--pkgs/applications/editors/geany/default.nix51
-rw-r--r--pkgs/applications/editors/gobby/default.nix4
-rw-r--r--pkgs/applications/editors/hexedit/default.nix19
-rw-r--r--pkgs/applications/editors/jedit/default.nix2
-rw-r--r--pkgs/applications/editors/jedit/wrapper.nix18
-rw-r--r--pkgs/applications/editors/kdevelop/default.nix14
-rw-r--r--pkgs/applications/editors/kile/default.nix2
-rw-r--r--pkgs/applications/editors/leksah/default.nix1
-rw-r--r--pkgs/applications/editors/monodevelop/default.nix6
-rw-r--r--pkgs/applications/editors/monodoc/default.nix6
-rw-r--r--pkgs/applications/editors/nano/default.nix17
-rw-r--r--pkgs/applications/editors/nedit/default.nix4
-rw-r--r--pkgs/applications/editors/netbeans/default.nix41
-rw-r--r--pkgs/applications/editors/sublime/default.nix39
-rw-r--r--pkgs/applications/editors/vbindiff/default.nix19
-rw-r--r--pkgs/applications/editors/vim/configurable.nix32
-rw-r--r--pkgs/applications/editors/vim/default.nix2
-rw-r--r--pkgs/applications/editors/zile/default.nix9
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix13
-rw-r--r--pkgs/applications/graphics/alchemy/default.nix30
-rw-r--r--pkgs/applications/graphics/cinepaint/default.nix4
-rw-r--r--pkgs/applications/graphics/darktable/default.nix12
-rw-r--r--pkgs/applications/graphics/darktable/libpng-15.patch22
-rw-r--r--pkgs/applications/graphics/dia/default.nix8
-rw-r--r--pkgs/applications/graphics/dia/glib-top-level-header.patch471
-rw-r--r--pkgs/applications/graphics/digikam/2.nix32
-rw-r--r--pkgs/applications/graphics/digikam/default.nix10
-rw-r--r--pkgs/applications/graphics/djview/default.nix2
-rw-r--r--pkgs/applications/graphics/f-spot/default.nix4
-rw-r--r--pkgs/applications/graphics/fbida/default.nix2
-rw-r--r--pkgs/applications/graphics/feh/default.nix8
-rw-r--r--pkgs/applications/graphics/freecad/cmakeinstall.patch55
-rw-r--r--pkgs/applications/graphics/freecad/default.nix21
-rw-r--r--pkgs/applications/graphics/freecad/pythonpath.patch18
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix4
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix4
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix18
-rw-r--r--pkgs/applications/graphics/gocr/default.nix17
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix2
-rw-r--r--pkgs/applications/graphics/hugin/default.nix2
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix6
-rw-r--r--pkgs/applications/graphics/ipe/default.nix47
-rw-r--r--pkgs/applications/graphics/kipi-plugins/default.nix2
-rw-r--r--pkgs/applications/graphics/kuickshow/builder.sh10
-rw-r--r--pkgs/applications/graphics/kuickshow/default.nix2
-rw-r--r--pkgs/applications/graphics/meshlab/default.nix17
-rw-r--r--pkgs/applications/graphics/mypaint/default.nix35
-rw-r--r--pkgs/applications/graphics/openimageio/default.nix34
-rw-r--r--pkgs/applications/graphics/openscad/default.nix25
-rw-r--r--pkgs/applications/graphics/panotools/default.nix3
-rw-r--r--pkgs/applications/graphics/paraview/default.nix13
-rw-r--r--pkgs/applications/graphics/pinta/default.nix7
-rw-r--r--pkgs/applications/graphics/pqiv/default.nix6
-rw-r--r--pkgs/applications/graphics/qiv/default.nix22
-rw-r--r--pkgs/applications/graphics/rapcad/default.nix26
-rw-r--r--pkgs/applications/graphics/rawtherapee/default.nix14
-rw-r--r--pkgs/applications/graphics/rawtherapee/optional-rawzor.patch83
-rw-r--r--pkgs/applications/graphics/sane/backends-git.nix42
-rw-r--r--pkgs/applications/graphics/sane/backends.nix47
-rw-r--r--pkgs/applications/graphics/sane/frontends.nix26
-rw-r--r--pkgs/applications/graphics/sane/xsane.nix (renamed from pkgs/misc/xsane/default.nix)12
-rw-r--r--pkgs/applications/graphics/sxiv/default.nix22
-rw-r--r--pkgs/applications/graphics/viewnior/default.nix35
-rw-r--r--pkgs/applications/graphics/xara/default.nix2
-rw-r--r--pkgs/applications/graphics/xfig/default.nix16
-rw-r--r--pkgs/applications/graphics/xournal/default.nix2
-rw-r--r--pkgs/applications/misc/adobe-reader/builder.sh27
-rw-r--r--pkgs/applications/misc/adobe-reader/default.nix16
-rw-r--r--pkgs/applications/misc/arbtt/default.nix23
-rw-r--r--pkgs/applications/misc/audio/soxr/default.nix20
-rw-r--r--pkgs/applications/misc/bitcoin/default.nix4
-rw-r--r--pkgs/applications/misc/blender/default.nix29
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/dmenu/default.nix13
-rw-r--r--pkgs/applications/misc/dunst/default.nix39
-rw-r--r--pkgs/applications/misc/eaglemode/default.nix14
-rw-r--r--pkgs/applications/misc/epdfview/default.nix1
-rw-r--r--pkgs/applications/misc/epdfview/glib-top-level-header.patch12
-rw-r--r--pkgs/applications/misc/evtest/default.nix21
-rw-r--r--pkgs/applications/misc/fetchmail/security-fix.patch11
-rw-r--r--pkgs/applications/misc/freicoin/default.nix30
-rw-r--r--pkgs/applications/misc/girara/default.nix27
-rw-r--r--pkgs/applications/misc/gmrun/default.nix39
-rw-r--r--pkgs/applications/misc/gmrun/gcc43.patch51
-rw-r--r--pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch58
-rw-r--r--pkgs/applications/misc/goldendict/default.nix4
-rw-r--r--pkgs/applications/misc/googleearth/default.nix4
-rw-r--r--pkgs/applications/misc/gphoto2/default.nix22
-rw-r--r--pkgs/applications/misc/gphoto2/gphotofs.nix10
-rw-r--r--pkgs/applications/misc/gphoto2/src-for-gphotofs.nix1
-rw-r--r--pkgs/applications/misc/gphoto2/src-info-for-gphotofs.nix8
-rw-r--r--pkgs/applications/misc/grass/default.nix52
-rw-r--r--pkgs/applications/misc/grip/default.nix15
-rw-r--r--pkgs/applications/misc/gv/default.nix4
-rw-r--r--pkgs/applications/misc/ikiwiki/default.nix4
-rw-r--r--pkgs/applications/misc/jbidwatcher/default.nix4
-rw-r--r--pkgs/applications/misc/k3b/default.nix5
-rw-r--r--pkgs/applications/misc/kde-wacomtablet/default.nix2
-rw-r--r--pkgs/applications/misc/krusader/krusader-gcc44.patch10
-rw-r--r--pkgs/applications/misc/librecad/2.0.nix38
-rw-r--r--pkgs/applications/misc/librecad/default.nix22
-rw-r--r--pkgs/applications/misc/lyx/default.nix8
-rw-r--r--pkgs/applications/misc/mathblog/default.nix21
-rw-r--r--pkgs/applications/misc/mupdf/default.nix7
-rw-r--r--pkgs/applications/misc/mysql-workbench/default.nix19
-rw-r--r--pkgs/applications/misc/nut/2.6.3.nix34
-rw-r--r--pkgs/applications/misc/nut/default.nix33
-rw-r--r--pkgs/applications/misc/pitz/default.nix33
-rw-r--r--pkgs/applications/misc/pstree/default.nix4
-rw-r--r--pkgs/applications/misc/qcad/default.nix55
-rw-r--r--pkgs/applications/misc/qcad/qcad-2.0.4.0-1.src-intptr.patch24
-rw-r--r--pkgs/applications/misc/qcad/qcad-2.0.4.0-gcc43.patch45
-rw-r--r--pkgs/applications/misc/qgis/default.nix2
-rw-r--r--pkgs/applications/misc/redshift/default.nix7
-rw-r--r--pkgs/applications/misc/rsibreak/default.nix2
-rw-r--r--pkgs/applications/misc/rxvt_unicode/default.nix10
-rw-r--r--pkgs/applications/misc/semnotes/default.nix2
-rw-r--r--pkgs/applications/misc/st/default.nix22
-rw-r--r--pkgs/applications/misc/surf/default.nix16
-rw-r--r--pkgs/applications/misc/synergy/default.nix43
-rw-r--r--pkgs/applications/misc/tangogps/default.nix8
-rw-r--r--pkgs/applications/misc/taskjuggler/default.nix5
-rw-r--r--pkgs/applications/misc/taskwarrior/default.nix34
-rw-r--r--pkgs/applications/misc/truecrypt/default.nix2
-rw-r--r--pkgs/applications/misc/vanitygen/default.nix38
-rw-r--r--pkgs/applications/misc/wmname/default.nix20
-rw-r--r--pkgs/applications/misc/xfe/default.nix31
-rw-r--r--pkgs/applications/misc/xmobar/add-freeration-variable.patch58
-rw-r--r--pkgs/applications/misc/xmobar/default.nix13
-rw-r--r--pkgs/applications/misc/xpdf/xpdf-3.01pl2.patch471
-rw-r--r--pkgs/applications/misc/xterm/default.nix16
-rw-r--r--pkgs/applications/misc/yakuake/default.nix2
-rw-r--r--pkgs/applications/misc/yate/default.nix2
-rw-r--r--pkgs/applications/misc/yeganesh/default.nix16
-rw-r--r--pkgs/applications/misc/zathura/builder.sh21
-rw-r--r--pkgs/applications/misc/zathura/core/default.nix41
-rw-r--r--pkgs/applications/misc/zathura/default.nix68
-rw-r--r--pkgs/applications/misc/zathura/djvu/default.nix29
-rw-r--r--pkgs/applications/misc/zathura/djvu/gtkflags.patch23
-rw-r--r--pkgs/applications/misc/zathura/icon.xpm120
-rw-r--r--pkgs/applications/misc/zathura/pdf-poppler/default.nix27
-rw-r--r--pkgs/applications/misc/zathura/ps/default.nix29
-rw-r--r--pkgs/applications/misc/zathura/ps/gtkflags.patch25
-rw-r--r--pkgs/applications/networking/bittorrentsync/default.nix47
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix195
-rw-r--r--pkgs/applications/networking/browsers/chromium/enable_seccomp.patch20
-rw-r--r--pkgs/applications/networking/browsers/chromium/pulseaudio_array_bounds.patch12
-rw-r--r--pkgs/applications/networking/browsers/chromium/sandbox_userns.patch292
-rw-r--r--pkgs/applications/networking/browsers/chromium/sources.nix18
-rwxr-xr-xpkgs/applications/networking/browsers/chromium/update.sh16
-rw-r--r--pkgs/applications/networking/browsers/conkeror/default.nix10
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix18
-rw-r--r--pkgs/applications/networking/browsers/firefox/13.0.nix4
-rw-r--r--pkgs/applications/networking/browsers/firefox/20.0.nix (renamed from pkgs/applications/networking/browsers/firefox/12.0.nix)101
-rw-r--r--pkgs/applications/networking/browsers/firefox/21.0.nix180
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix4
-rw-r--r--pkgs/applications/networking/browsers/konq-plugins/default.nix23
-rw-r--r--pkgs/applications/networking/browsers/konq-plugins/qt47.patch11
-rw-r--r--pkgs/applications/networking/browsers/kwebkitpart/default.nix20
-rw-r--r--pkgs/applications/networking/browsers/links2/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/lynx/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh23
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix88
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix29
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh14
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix47
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix12
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix36
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream4
-rw-r--r--pkgs/applications/networking/browsers/netsurf/libnsgif.nix4
-rw-r--r--pkgs/applications/networking/browsers/opera/default.nix14
-rw-r--r--pkgs/applications/networking/browsers/rekonq/default.nix14
-rw-r--r--pkgs/applications/networking/browsers/uzbl/default.nix11
-rw-r--r--pkgs/applications/networking/browsers/vimprobable2/default.nix25
-rw-r--r--pkgs/applications/networking/browsers/w3m/default.nix22
-rw-r--r--pkgs/applications/networking/browsers/w3m/glibc214.patch60
-rw-r--r--pkgs/applications/networking/cluster/hadoop/default.nix4
-rw-r--r--pkgs/applications/networking/dropbox-cli/default.nix36
-rw-r--r--pkgs/applications/networking/dropbox/default.nix34
-rw-r--r--pkgs/applications/networking/esniper/default.nix6
-rw-r--r--pkgs/applications/networking/ftp/filezilla/default.nix30
-rw-r--r--pkgs/applications/networking/ids/bro/default.nix22
-rw-r--r--pkgs/applications/networking/ids/daq/default.nix19
-rw-r--r--pkgs/applications/networking/ids/snort/default.nix19
-rw-r--r--pkgs/applications/networking/instant-messengers/baresip/default.nix45
-rw-r--r--pkgs/applications/networking/instant-messengers/bitlbee/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/centerim/default.nix8
-rw-r--r--pkgs/applications/networking/instant-messengers/gajim/default.nix128
-rw-r--r--pkgs/applications/networking/instant-messengers/hipchat/default.nix65
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/default.nix14
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/disable_some_plugins.patch28
-rw-r--r--pkgs/applications/networking/instant-messengers/linphone/default.nix16
-rw-r--r--pkgs/applications/networking/instant-messengers/linphone/fix-deprecated.patch35
-rw-r--r--pkgs/applications/networking/instant-messengers/mcabber/default.nix12
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix21
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix39
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/default.nix37
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch54
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/linux-headers.patch86
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/psimedia.nix12
-rw-r--r--pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix45
-rw-r--r--pkgs/applications/networking/instant-messengers/silc-client/default.nix37
-rw-r--r--pkgs/applications/networking/instant-messengers/silc-client/server_setup.patch28
-rw-r--r--pkgs/applications/networking/instant-messengers/skype-call-recorder/conference.patch148
-rw-r--r--pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix27
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix40
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix8
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/0.3.1.nix13
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/0.4.0.nix16
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/0.5.3.nix16
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix9
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber/default.nix23
-rw-r--r--pkgs/applications/networking/iptraf/default.nix4
-rw-r--r--pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch11
-rw-r--r--pkgs/applications/networking/irc/bip/default.nix6
-rw-r--r--pkgs/applications/networking/irc/irssi/fish/default.nix31
-rw-r--r--pkgs/applications/networking/irc/irssi/otr/default.nix30
-rw-r--r--pkgs/applications/networking/irc/konversation/default.nix6
-rw-r--r--pkgs/applications/networking/irc/quassel/default.nix4
-rw-r--r--pkgs/applications/networking/irc/weechat/default.nix16
-rw-r--r--pkgs/applications/networking/irc/xchat/default.nix2
-rw-r--r--pkgs/applications/networking/irc/xchat/glib-top-level-header.patch75
-rw-r--r--pkgs/applications/networking/mailreaders/imapfilter.nix15
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix9
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix18
-rw-r--r--pkgs/applications/networking/mailreaders/sylpheed/default.nix28
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix (renamed from pkgs/applications/networking/mailreaders/thunderbird/11.x.nix)50
-rw-r--r--pkgs/applications/networking/msmtp/default.nix21
-rw-r--r--pkgs/applications/networking/mumble/default.nix2
-rw-r--r--pkgs/applications/networking/offrss/default.nix4
-rw-r--r--pkgs/applications/networking/p2p/freenet/default.nix56
-rw-r--r--pkgs/applications/networking/p2p/gnunet/0.8.nix85
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix14
-rw-r--r--pkgs/applications/networking/p2p/gnunet/svn.nix90
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/default.nix6
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/drop-taskmanager-dependency.patch175
-rw-r--r--pkgs/applications/networking/p2p/mldonkey/default.nix8
-rw-r--r--pkgs/applications/networking/p2p/transmission/2.60.nix41
-rw-r--r--pkgs/applications/networking/p2p/transmission/default.nix23
-rw-r--r--pkgs/applications/networking/remote/freerdp/default.nix22
-rw-r--r--pkgs/applications/networking/remote/freerdp/unstable.nix36
-rw-r--r--pkgs/applications/networking/remote/putty/default.nix16
-rw-r--r--pkgs/applications/networking/remote/teamviewer/8.nix49
-rw-r--r--pkgs/applications/networking/remote/teamviewer/default.nix46
-rw-r--r--pkgs/applications/networking/sniffers/etherape/default.nix10
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix36
-rw-r--r--pkgs/applications/networking/sync/rsync/default.nix3
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix2
-rw-r--r--pkgs/applications/networking/umurmur/default.nix20
-rw-r--r--pkgs/applications/networking/vnstat/default.nix8
-rw-r--r--pkgs/applications/networking/yafc/default.nix4
-rw-r--r--pkgs/applications/networking/znc/default.nix33
-rw-r--r--pkgs/applications/office/abiword/default.nix14
-rw-r--r--pkgs/applications/office/basket/default.nix2
-rw-r--r--pkgs/applications/office/calligra/default.nix14
-rw-r--r--pkgs/applications/office/calligra/fix-kde4.10-build.patch36
-rw-r--r--pkgs/applications/office/gnucash/default.nix4
-rw-r--r--pkgs/applications/office/gnumeric/default.nix8
-rw-r--r--pkgs/applications/office/hledger-interest/default.nix4
-rw-r--r--pkgs/applications/office/kmymoney/default.nix2
-rw-r--r--pkgs/applications/office/koffice/default.nix43
-rw-r--r--pkgs/applications/office/koffice/krita-exiv-0.21.diff81
-rw-r--r--pkgs/applications/office/koffice/wpd.patch24
-rw-r--r--pkgs/applications/office/ledger/2.6.3.nix36
-rw-r--r--pkgs/applications/office/ledger/3.0.nix30
-rw-r--r--pkgs/applications/office/ledger/const.patch41
-rw-r--r--pkgs/applications/office/libreoffice/default.nix182
-rw-r--r--pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh20
-rw-r--r--pkgs/applications/office/libreoffice/libreoffice-srcs.nix374
-rw-r--r--pkgs/applications/office/openoffice/builder.sh105
-rw-r--r--pkgs/applications/office/openoffice/default.nix105
-rw-r--r--pkgs/applications/office/openoffice/generate-libreoffice-srcs.sh18
-rw-r--r--pkgs/applications/office/openoffice/libreoffice-srcs.nix370
-rw-r--r--pkgs/applications/office/openoffice/libreoffice.nix165
-rw-r--r--pkgs/applications/office/openoffice/oo.patch72
-rw-r--r--pkgs/applications/office/openoffice/root-required.patch25
-rw-r--r--pkgs/applications/office/openoffice/xlib.patch22
-rw-r--r--pkgs/applications/office/skrooge/default.nix6
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix62
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix22
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix14
-rw-r--r--pkgs/applications/science/biology/slr/default.nix23
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix2
-rw-r--r--pkgs/applications/science/electronics/eagle/default.nix86
-rw-r--r--pkgs/applications/science/electronics/eagle/eagle_fixer.c134
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix16
-rw-r--r--pkgs/applications/science/electronics/ngspice/default.nix8
-rw-r--r--pkgs/applications/science/electronics/qfsm/default.nix24
-rw-r--r--pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch20
-rw-r--r--pkgs/applications/science/electronics/qucs/default.nix7
-rw-r--r--pkgs/applications/science/electronics/qucs/tr1-complex.patch10
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix38
-rw-r--r--pkgs/applications/science/electronics/tkgate/2.x.nix33
-rw-r--r--pkgs/applications/science/electronics/xoscope/default.nix3
-rw-r--r--pkgs/applications/science/electronics/xoscope/gtkdepre.diff58
-rw-r--r--pkgs/applications/science/logic/ekrhyper/default.nix32
-rw-r--r--pkgs/applications/science/logic/ekrhyper/default.upstream3
-rw-r--r--pkgs/applications/science/logic/eprover/default.nix (renamed from pkgs/applications/science/logic/eProver/default.nix)20
-rw-r--r--pkgs/applications/science/logic/eprover/default.upstream3
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix18
-rw-r--r--pkgs/applications/science/logic/iprover/default.nix4
-rw-r--r--pkgs/applications/science/logic/isabelle/default.nix17
-rw-r--r--pkgs/applications/science/logic/leo2/default.nix2
-rw-r--r--pkgs/applications/science/logic/logisim/default.nix32
-rw-r--r--pkgs/applications/science/logic/opensmt/default.nix2
-rw-r--r--pkgs/applications/science/logic/otter/default.nix47
-rw-r--r--pkgs/applications/science/logic/prover9/default.nix2
-rw-r--r--pkgs/applications/science/logic/ssreflect/default.nix15
-rw-r--r--pkgs/applications/science/logic/ssreflect/static.patch40
-rw-r--r--pkgs/applications/science/logic/tptp/default.nix2
-rw-r--r--pkgs/applications/science/math/R/default.nix28
-rw-r--r--pkgs/applications/science/math/ginac/default.nix2
-rw-r--r--pkgs/applications/science/math/maxima/default.nix4
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix8
-rw-r--r--pkgs/applications/science/math/yacas/default.nix2
-rw-r--r--pkgs/applications/science/misc/boinc/default.nix32
-rw-r--r--pkgs/applications/science/misc/golly/src-for-default.nix10
-rw-r--r--pkgs/applications/science/misc/tulip/default.nix2
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix46
-rw-r--r--pkgs/applications/science/spyder/default.nix57
-rw-r--r--pkgs/applications/search/doodle/default.nix20
-rw-r--r--pkgs/applications/search/recoll/default.nix61
-rw-r--r--pkgs/applications/taxes/aangifte-2012/default.nix38
-rw-r--r--pkgs/applications/version-management/bazaar/default.nix4
-rw-r--r--pkgs/applications/version-management/darcs/bash-completion.patch19
-rw-r--r--pkgs/applications/version-management/darcs/default.nix15
-rw-r--r--pkgs/applications/version-management/fossil/default.nix12
-rw-r--r--pkgs/applications/version-management/git-and-tools/cgit/default.nix49
-rw-r--r--pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix79
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix18
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix104
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix55
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/docbook2texi-2.patch28
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/glob-path.patch529
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/symlinks-in-bin.patch13
-rw-r--r--pkgs/applications/version-management/git-and-tools/git2cl/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/github-backup/default.nix21
-rw-r--r--pkgs/applications/version-management/git-and-tools/hub/default.nix28
-rw-r--r--pkgs/applications/version-management/git-and-tools/tig/default.nix17
-rw-r--r--pkgs/applications/version-management/git-and-tools/topgit/default.nix31
-rw-r--r--pkgs/applications/version-management/kdesvn/default.nix2
-rw-r--r--pkgs/applications/version-management/meld/default.nix6
-rw-r--r--pkgs/applications/version-management/mercurial/default.nix16
-rw-r--r--pkgs/applications/version-management/monotone-viz/1.0.1.nix23
-rw-r--r--pkgs/applications/version-management/monotone-viz/graphviz.patch34
-rw-r--r--pkgs/applications/version-management/monotone/default.nix8
-rw-r--r--pkgs/applications/version-management/monotone/glibc-file-handle.patch166
-rw-r--r--pkgs/applications/version-management/mr/default.nix21
-rw-r--r--pkgs/applications/version-management/rcs/default.nix6
-rw-r--r--pkgs/applications/version-management/rcs/no-root.patch23
-rw-r--r--pkgs/applications/version-management/subversion/default.nix4
-rw-r--r--pkgs/applications/version-management/veracity/src-for-default.nix10
-rw-r--r--pkgs/applications/video/MPlayer/default.nix175
-rw-r--r--pkgs/applications/video/RealPlayer/builder.sh20
-rw-r--r--pkgs/applications/video/RealPlayer/default.nix21
-rw-r--r--pkgs/applications/video/avxsynth/default.nix26
-rw-r--r--pkgs/applications/video/bangarang/default.nix9
-rw-r--r--pkgs/applications/video/dvdauthor/build-against-libpng15.patch27
-rw-r--r--pkgs/applications/video/dvdauthor/default.nix18
-rw-r--r--pkgs/applications/video/gpac/default.nix36
-rw-r--r--pkgs/applications/video/kdenlive/default.nix14
-rw-r--r--pkgs/applications/video/key-mon/default.nix30
-rw-r--r--pkgs/applications/video/makemkv/builder.sh38
-rw-r--r--pkgs/applications/video/makemkv/default.nix39
-rw-r--r--pkgs/applications/video/mkvtoolnix/default.nix10
-rw-r--r--pkgs/applications/video/mplayer/default.nix192
-rw-r--r--pkgs/applications/video/mplayer2/default.nix137
-rw-r--r--pkgs/applications/video/mythtv/default.nix2
-rw-r--r--pkgs/applications/video/omxplayer/default.nix84
-rw-r--r--pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch15
-rw-r--r--pkgs/applications/video/vlc/default.nix10
-rw-r--r--pkgs/applications/video/xbmc/default.nix97
-rw-r--r--pkgs/applications/video/xine-ui/default.nix2
-rw-r--r--pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch24
-rw-r--r--pkgs/applications/virtualization/lxc/fix-documentation-build.patch40
-rw-r--r--pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch252
-rw-r--r--pkgs/applications/virtualization/qemu/0.11.0.nix18
-rw-r--r--pkgs/applications/virtualization/qemu/0.13.nix19
-rw-r--r--pkgs/applications/virtualization/qemu/0.15.nix19
-rw-r--r--pkgs/applications/virtualization/qemu/1.0.nix19
-rw-r--r--pkgs/applications/virtualization/qemu/default.nix21
-rw-r--r--pkgs/applications/virtualization/qemu/svn-6642.nix19
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix2
-rw-r--r--pkgs/applications/virtualization/virtinst/default.nix5
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix39
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix33
-rw-r--r--pkgs/applications/virtualization/xen/default.nix22
-rw-r--r--pkgs/applications/virtualization/xen/gcc-4.5.patch39
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix1
-rw-r--r--pkgs/applications/window-managers/compiz/bcop.nix17
-rw-r--r--pkgs/applications/window-managers/compiz/ccsm.nix31
-rw-r--r--pkgs/applications/window-managers/compiz/config-python.nix20
-rw-r--r--pkgs/applications/window-managers/compiz/core.nix40
-rw-r--r--pkgs/applications/window-managers/compiz/default.nix60
-rw-r--r--pkgs/applications/window-managers/compiz/default.upstream1
-rw-r--r--pkgs/applications/window-managers/compiz/gdk-deprecated.patch14
-rw-r--r--pkgs/applications/window-managers/compiz/libcompizconfig.nix22
-rw-r--r--pkgs/applications/window-managers/compiz/plugindir-core.patch39
-rw-r--r--pkgs/applications/window-managers/compiz/plugindir-libcompizconfig.patch39
-rw-r--r--pkgs/applications/window-managers/compiz/plugins-extra.nix30
-rw-r--r--pkgs/applications/window-managers/compiz/plugins-main.nix22
-rw-r--r--pkgs/applications/window-managers/compiz/wallpaper-maxpect.patch58
-rw-r--r--pkgs/applications/window-managers/dwm/confnotify-6.0.patch36
-rw-r--r--pkgs/applications/window-managers/dwm/default.nix7
-rw-r--r--pkgs/applications/window-managers/fvwm/default.nix26
-rw-r--r--pkgs/applications/window-managers/i3/default.nix20
-rw-r--r--pkgs/applications/window-managers/i3/lock.nix1
-rw-r--r--pkgs/applications/window-managers/i3/status.nix5
-rw-r--r--pkgs/applications/window-managers/icewm/default.nix2
-rw-r--r--pkgs/applications/window-managers/icewm/deprecated.patch23
-rw-r--r--pkgs/applications/window-managers/ion-3/default.nix6
-rw-r--r--pkgs/applications/window-managers/openbox/default.nix16
-rw-r--r--pkgs/applications/window-managers/wmii/builder.sh24
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix24
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-contrib.nix9
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-extras.nix12
-rw-r--r--pkgs/build-support/builder-defs/builder-defs.nix26
-rw-r--r--pkgs/build-support/cabal/default.nix62
-rw-r--r--pkgs/build-support/checker/default.nix4
-rw-r--r--pkgs/build-support/clang-wrapper/default.nix10
-rw-r--r--pkgs/build-support/clang-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/fetchbzr/builder.sh2
-rwxr-xr-xpkgs/build-support/fetchbzr/nix-prefetch-bzr7
-rw-r--r--pkgs/build-support/fetchdarcs/builder.sh2
-rw-r--r--pkgs/build-support/fetchhg/builder.sh2
-rw-r--r--pkgs/build-support/fetchhg/default.nix8
-rw-r--r--pkgs/build-support/fetchmtn/default.nix2
-rw-r--r--pkgs/build-support/fetchsvn/builder.sh3
-rw-r--r--pkgs/build-support/fetchsvn/default.nix10
-rw-r--r--pkgs/build-support/fetchurl/builder.sh22
-rw-r--r--pkgs/build-support/fetchurl/default.nix25
-rw-r--r--pkgs/build-support/fetchurl/mirrors.nix20
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/builder.sh2
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/default.nix2
-rw-r--r--pkgs/build-support/gcc-cross-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/add-flags24
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/builder.sh114
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/default.nix43
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/gcc-wrapper.sh139
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/ld-wrapper.sh145
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/setup-hook.sh29
-rw-r--r--pkgs/build-support/gcc-upc-wrapper/utils.sh23
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh4
-rw-r--r--pkgs/build-support/gcc-wrapper/buildergo.sh194
-rw-r--r--pkgs/build-support/gcc-wrapper/default.nix23
-rw-r--r--pkgs/build-support/gcc-wrapper/utils.sh1
-rw-r--r--pkgs/build-support/kdewrapper/default.nix42
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix7
-rw-r--r--pkgs/build-support/kernel/make-initrd.sh2
-rw-r--r--pkgs/build-support/multiple-outputs.nix6
-rw-r--r--pkgs/build-support/release/ant-build.nix4
-rw-r--r--pkgs/build-support/release/debian-build.nix2
-rw-r--r--pkgs/build-support/release/default.nix10
-rw-r--r--pkgs/build-support/release/nix-build.nix18
-rw-r--r--pkgs/build-support/release/rpm-build.nix6
-rw-r--r--pkgs/build-support/release/source-tarball.nix24
-rw-r--r--pkgs/build-support/replace-dependency.nix79
-rw-r--r--pkgs/build-support/setup-hooks/autoreconf.sh11
-rw-r--r--pkgs/build-support/setup-hooks/make-wrapper.sh (renamed from pkgs/build-support/make-wrapper/make-wrapper.sh)0
-rw-r--r--pkgs/build-support/source-from-head-fun.nix6
-rw-r--r--pkgs/build-support/trivial-builders.nix2
-rw-r--r--pkgs/build-support/upstream-updater/update-walker-service-specific.sh9
-rwxr-xr-xpkgs/build-support/upstream-updater/update-walker.sh249
-rwxr-xr-xpkgs/build-support/upstream-updater/urls-from-page.sh4
-rw-r--r--pkgs/build-support/vm/deb/deb-closure.pl50
-rw-r--r--pkgs/build-support/vm/default.nix500
-rw-r--r--pkgs/data/documentation/gnome-user-docs/default.nix2
-rw-r--r--pkgs/data/documentation/man-pages/default.nix8
-rw-r--r--pkgs/data/fonts/andagii/default.nix3
-rw-r--r--pkgs/data/fonts/anonymous-pro/default.nix2
-rw-r--r--pkgs/data/fonts/libertine/default.nix21
-rw-r--r--pkgs/data/misc/cacert/default.nix4
-rw-r--r--pkgs/data/misc/freepats/default.nix24
-rw-r--r--pkgs/data/misc/gsettings-desktop-schemas/default.nix2
-rw-r--r--pkgs/data/misc/shared-desktop-ontologies/default.nix4
-rw-r--r--pkgs/data/misc/shared-mime-info/default.nix4
-rw-r--r--pkgs/data/misc/themes/green.nix5
-rw-r--r--pkgs/data/misc/themes/theme-gnu.nix5
-rw-r--r--pkgs/data/misc/tzdata/default.nix33
-rw-r--r--pkgs/data/misc/xkeyboard-config/default.nix8
-rw-r--r--pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix33
-rw-r--r--pkgs/desktops/e17/default.nix9
-rw-r--r--pkgs/desktops/e17/e_dbus/default.nix6
-rw-r--r--pkgs/desktops/e17/e_dbus/setup-hook.sh8
-rw-r--r--pkgs/desktops/e17/ecore/default.nix11
-rw-r--r--pkgs/desktops/e17/edje/default.nix8
-rw-r--r--pkgs/desktops/e17/eet/default.nix4
-rw-r--r--pkgs/desktops/e17/eeze/default.nix4
-rw-r--r--pkgs/desktops/e17/efreet/default.nix4
-rw-r--r--pkgs/desktops/e17/eina/default.nix4
-rw-r--r--pkgs/desktops/e17/eio/default.nix24
-rw-r--r--pkgs/desktops/e17/elementary/default.nix19
-rw-r--r--pkgs/desktops/e17/embryo/default.nix6
-rw-r--r--pkgs/desktops/e17/emotion/default.nix19
-rw-r--r--pkgs/desktops/e17/enlightenment/default.nix12
-rw-r--r--pkgs/desktops/e17/ethumb/default.nix23
-rw-r--r--pkgs/desktops/e17/evas/default.nix4
-rw-r--r--pkgs/desktops/e17/terminology/default.nix17
-rw-r--r--pkgs/desktops/gnome-2/bindings/gnome-python/default.nix5
-rw-r--r--pkgs/desktops/gnome-2/bindings/python-rsvg/default.nix29
-rw-r--r--pkgs/desktops/gnome-2/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-session/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/desktop/gvfs/default.nix16
-rw-r--r--pkgs/desktops/gnome-2/desktop/zenity/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/GConf/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/ORBit2/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/gconfmm/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libIDL/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libart_lgpl/default.nix8
-rw-r--r--pkgs/desktops/gnome-2/platform/libbonobo/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libbonoboui/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnome/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomecups/default.nix10
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomecups/glib.patch38
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomeprint/default.nix10
-rw-r--r--pkgs/desktops/gnome-2/platform/libgnomeui/default.nix2
-rw-r--r--pkgs/desktops/gnome-2/platform/libunique/default.nix2
-rw-r--r--pkgs/desktops/kde-3/kdelibs/default.nix51
-rw-r--r--pkgs/desktops/kde-3/kdelibs/inotify.patch30
-rw-r--r--pkgs/desktops/kde-3/kdelibs/kdelibs-3.5.10-openssl_1.0.0.patch180
-rw-r--r--pkgs/desktops/kde-4.10/applications/kate.nix11
-rw-r--r--pkgs/desktops/kde-4.10/applications/konsole.nix11
-rw-r--r--pkgs/desktops/kde-4.10/default.nix72
-rw-r--r--pkgs/desktops/kde-4.10/files/kde-wallpapers-buildsystem.patch17
-rw-r--r--pkgs/desktops/kde-4.10/files/polkit-install.patch12
-rw-r--r--pkgs/desktops/kde-4.10/kactivities.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kde-base-artwork.nix14
-rw-r--r--pkgs/desktops/kde-4.10/kde-baseapps/kde-baseapps.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kde-package/4.10.4.nix399
-rw-r--r--pkgs/desktops/kde-4.10/kde-package/default.nix127
-rwxr-xr-xpkgs/desktops/kde-4.10/kde-package/kde-manifest.sh146
-rw-r--r--pkgs/desktops/kde-4.10/kde-package/kde-submodules.xslt22
-rw-r--r--pkgs/desktops/kde-4.10/kde-runtime.nix23
-rw-r--r--pkgs/desktops/kde-4.10/kde-wallpapers.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kde-workspace.nix38
-rw-r--r--pkgs/desktops/kde-4.10/kdeaccessibility/jovie.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeaccessibility/kaccessible.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeaccessibility/kmag.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdeaccessibility/kmousetool.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeaccessibility/kmouth.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeadmin/kcron.nix5
-rw-r--r--pkgs/desktops/kde-4.10/kdeadmin/ksystemlog.nix5
-rw-r--r--pkgs/desktops/kde-4.10/kdeadmin/kuser.nix5
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/ColorSchemes.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/FindXscreensaver.cmake73
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/HighResolutionWallpapers.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/IconThemes.nix13
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/WeatherWallpapers.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/desktopthemes.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/emoticons.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/kscreensaver.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/kwin-styles.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/sounds.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/styles.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeartwork/wallpapers.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/perlqt-include-smokeqt.patch19
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/perlqt-rewrite-FindPerlMore.patch118
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/perlqt-use-site-arch-install-dir.patch454
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/perlqt.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/pykde4-hardcode-lib-python.patch18
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/pykde4.nix34
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/qtruby-include-smokeqt.patch13
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/qtruby-install-prefix.patch15
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/qtruby.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/smokegen-nix.patch46
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/smokegen.nix (renamed from pkgs/desktops/kde-4.7/kdebindings/smokekde.nix)7
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/smokekde.nix16
-rw-r--r--pkgs/desktops/kde-4.10/kdebindings/smokeqt.nix13
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/analitza.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/blinken.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/cantor.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kalgebra.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kalzium.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kanagram.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kbruch.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kgeography.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/khangman.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kig.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kiten.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/klettres.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kmplot.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kstars.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/ktouch.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kturtle.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/kwordquiz.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/libkdeedu.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/marble.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/pairs.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/parley.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/rocs.nix14
-rw-r--r--pkgs/desktops/kde-4.10/kdeedu/step.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/bomber.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/bovo.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/granatier.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kajongg.nix13
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kapman.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/katomic.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kblackbox.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kblocks.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kbounce.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kbreakout.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kdiamond.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kfourinline.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kgoldrunner.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kigo.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/killbots.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kiriki.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kjumpingcube.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/klickety.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/klines.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kmahjongg.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kmines.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/knavalbattle.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/knetwalk.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kolf.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kollision.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/konquest.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kpat.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kreversi.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kshisen.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/ksirk.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/ksnakeduel.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kspaceduel.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/ksquares.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/ksudoku.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/ktuberling.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/kubrick.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/libkdegames.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/libkmahjongg.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/lskat.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/palapeli.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdegames/picmi.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/gwenview.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kamera.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kcolorchooser.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-mobipocket.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-strigi-analyzer.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-thumbnailers.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kgamma.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kolourpaint.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/kruler.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/ksaneplugin.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/ksnapshot.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/libkdcraw.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/libkexiv2.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/libkipi.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/libksane.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/okular.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kdegraphics/svgpart.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdelibs/kdelibs.nix43
-rw-r--r--pkgs/desktops/kde-4.10/kdelibs/nepomuk-core.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdelibs/nepomuk-widgets.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/audiocd-kio.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/dragon.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/ffmpegthumbs.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/juk.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/kmix.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/kscd.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/libkcddb.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/libkcompactdisc.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdemultimedia/mplayerthumbs.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/FindmsiLBC.cmake19
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/filesharing.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kdenetwork.patch24
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kdnssd.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kfile-plugins.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kget.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kopete.nix28
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/kppp.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/krdc.nix8
-rw-r--r--pkgs/desktops/kde-4.10/kdenetwork/krfb.nix7
-rw-r--r--pkgs/desktops/kde-4.10/kdepim-runtime.nix14
-rw-r--r--pkgs/desktops/kde-4.10/kdepim.nix22
-rw-r--r--pkgs/desktops/kde-4.10/kdepimlibs.nix17
-rw-r--r--pkgs/desktops/kde-4.10/kdeplasma-addons.nix22
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/cervisia.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-bazaar.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-git.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-hg.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-svn.nix15
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kapptemplate.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kcachegrind.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kde-dev-scripts.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kde-dev-utils.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kdesdk-strigi-analyzers.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kdesdk-thumbnailers.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kioslave-perldoc.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kioslave-svn.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/kompare.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/lokalize.nix13
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/okteta.nix13
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/poxml.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/thumbnailers-add-subdirectory.patch12
-rw-r--r--pkgs/desktops/kde-4.10/kdesdk/umbrello.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdetoys/amor.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdetoys/kteatime.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdetoys/ktux.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/ark.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/filelight.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kcalc.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kcharselect.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kdf.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kfloppy.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kgpg.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kremotecontrol.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/ktimer.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/kwallet.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/print-manager.nix28
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/superkaramba.nix11
-rw-r--r--pkgs/desktops/kde-4.10/kdeutils/sweeper.nix9
-rw-r--r--pkgs/desktops/kde-4.10/kdewebdev/kfilereplace.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdewebdev/kimagemapeditor.nix10
-rw-r--r--pkgs/desktops/kde-4.10/kdewebdev/klinkstatus.nix12
-rw-r--r--pkgs/desktops/kde-4.10/kdewebdev/kommander.nix9
-rw-r--r--pkgs/desktops/kde-4.10/l10n/default.nix44
-rwxr-xr-xpkgs/desktops/kde-4.10/l10n/l10n-manifest.sh32
-rw-r--r--pkgs/desktops/kde-4.10/l10n/manifest-4.10.4.nix282
-rw-r--r--pkgs/desktops/kde-4.10/oxygen-icons.nix15
-rw-r--r--pkgs/desktops/kde-4.10/support/akonadi/default.nix24
-rw-r--r--pkgs/desktops/kde-4.7/kde-wallpapers.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kde-workspace.nix6
-rw-r--r--pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/perlqt.nix10
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/pykde4-new-sip.patch91
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/pykde4.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/smokegen.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix4
-rw-r--r--pkgs/desktops/kde-4.7/kdegames.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdelibs.nix6
-rw-r--r--pkgs/desktops/kde-4.7/kdenetwork/kopete.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdenetwork/log-feature.diff60
-rw-r--r--pkgs/desktops/kde-4.7/kdeplasma-addons.nix2
-rw-r--r--pkgs/desktops/kde-4.7/kdesdk/optional-docs.diff39
-rw-r--r--pkgs/desktops/kde-4.7/kipi-plugins.nix29
-rw-r--r--pkgs/desktops/kde-4.7/oxygen-icons.nix2
-rw-r--r--pkgs/desktops/kde-4.7/support/akonadi/default.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-package/default.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-runtime.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-wallpapers.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kde-workspace.nix8
-rw-r--r--pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/perlqt.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/pykde4-new-sip.patch91
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/pykde4.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/qtruby.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokegen.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokekde.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix4
-rw-r--r--pkgs/desktops/kde-4.8/kdegames.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdelibs.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdenetwork/kopete.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdeplasma-addons.nix2
-rw-r--r--pkgs/desktops/kde-4.8/kdesdk/okteta.nix2
-rw-r--r--pkgs/desktops/kde-4.8/oxygen-icons.nix2
-rw-r--r--pkgs/desktops/kde-4.8/support/akonadi/default.nix6
-rw-r--r--pkgs/desktops/xfce-4.6/applications/mousepad.nix18
-rw-r--r--pkgs/desktops/xfce-4.6/applications/ristretto.nix24
-rw-r--r--pkgs/desktops/xfce-4.6/applications/terminal.nix23
-rw-r--r--pkgs/desktops/xfce-4.6/applications/xfce4-mixer.nix38
-rw-r--r--pkgs/desktops/xfce-4.6/applications/xfce4-power-manager.nix24
-rw-r--r--pkgs/desktops/xfce-4.6/art/xfce4-icon-theme.nix17
-rw-r--r--pkgs/desktops/xfce-4.6/core/exo.nix21
-rw-r--r--pkgs/desktops/xfce-4.6/core/gtk-xfce-engine.nix19
-rw-r--r--pkgs/desktops/xfce-4.6/core/libxfce4menu.nix18
-rw-r--r--pkgs/desktops/xfce-4.6/core/libxfce4util.nix18
-rw-r--r--pkgs/desktops/xfce-4.6/core/thunar.nix25
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfce-utils.nix20
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfce4-panel.nix24
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfce4-session.nix22
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfce4-settings.nix24
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfconf.nix20
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfdesktop.nix22
-rw-r--r--pkgs/desktops/xfce-4.6/core/xfwm4.nix23
-rw-r--r--pkgs/desktops/xfce-4.6/default.nix66
-rw-r--r--pkgs/desktops/xfce-4.8/applications/mousepad.nix20
-rw-r--r--pkgs/desktops/xfce-4.8/applications/ristretto.nix24
-rw-r--r--pkgs/desktops/xfce-4.8/applications/terminal.nix25
-rw-r--r--pkgs/desktops/xfce-4.8/core/exo.nix19
-rw-r--r--pkgs/desktops/xfce-4.8/core/libxfce4ui.nix24
-rw-r--r--pkgs/desktops/xfce-4.8/core/libxfcegui4.nix31
-rw-r--r--pkgs/desktops/xfce-4.8/core/thunar.nix27
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfce4-panel.nix26
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfce4-session.nix24
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfce4-settings.nix26
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfconf.nix20
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfdesktop.nix26
-rw-r--r--pkgs/desktops/xfce-4.8/core/xfwm4.nix27
-rw-r--r--pkgs/desktops/xfce-4.8/default.nix83
-rw-r--r--pkgs/desktops/xfce-4.8/support/gvfs.nix18
-rw-r--r--pkgs/desktops/xfce-4.8/support/libgdu-only.patch144
-rw-r--r--pkgs/desktops/xfce-4.8/support/libgdu.nix34
-rw-r--r--pkgs/desktops/xfce/applications/gigolo.nix25
-rw-r--r--pkgs/desktops/xfce/applications/mousepad.nix25
-rw-r--r--pkgs/desktops/xfce/applications/ristretto.nix28
-rw-r--r--pkgs/desktops/xfce/applications/terminal.nix23
-rw-r--r--pkgs/desktops/xfce/applications/xfce4-mixer.nix (renamed from pkgs/desktops/xfce-4.8/applications/xfce4-mixer.nix)20
-rw-r--r--pkgs/desktops/xfce/applications/xfce4-notifyd.nix30
-rw-r--r--pkgs/desktops/xfce/applications/xfce4-taskmanager.nix21
-rw-r--r--pkgs/desktops/xfce/art/xfce4-icon-theme.nix (renamed from pkgs/desktops/xfce-4.8/art/xfce4-icon-theme.nix)11
-rw-r--r--pkgs/desktops/xfce/core/exo.nix23
-rw-r--r--pkgs/desktops/xfce/core/garcon.nix (renamed from pkgs/desktops/xfce-4.8/core/garcon.nix)11
-rw-r--r--pkgs/desktops/xfce/core/gtk-xfce-engine.nix (renamed from pkgs/desktops/xfce-4.8/core/gtk-xfce-engine.nix)15
-rw-r--r--pkgs/desktops/xfce/core/libxfce4ui.nix (renamed from pkgs/desktops/xfce-4.6/core/libxfcegui4.nix)15
-rw-r--r--pkgs/desktops/xfce/core/libxfce4util.nix (renamed from pkgs/desktops/xfce-4.8/core/libxfce4util.nix)11
-rw-r--r--pkgs/desktops/xfce/core/libxfcegui4.nix35
-rw-r--r--pkgs/desktops/xfce/core/thunar-volman.nix (renamed from pkgs/desktops/xfce-4.8/core/thunar-volman.nix)14
-rw-r--r--pkgs/desktops/xfce/core/thunar.nix35
-rw-r--r--pkgs/desktops/xfce/core/tumbler.nix21
-rw-r--r--pkgs/desktops/xfce/core/xfce-utils.nix (renamed from pkgs/desktops/xfce-4.8/core/xfce-utils.nix)16
-rw-r--r--pkgs/desktops/xfce/core/xfce4-appfinder.nix (renamed from pkgs/desktops/xfce-4.8/core/xfce4-appfinder.nix)13
-rw-r--r--pkgs/desktops/xfce/core/xfce4-panel-datadir.patch24
-rw-r--r--pkgs/desktops/xfce/core/xfce4-panel.nix35
-rw-r--r--pkgs/desktops/xfce/core/xfce4-power-manager.nix (renamed from pkgs/desktops/xfce-4.8/applications/xfce4-power-manager.nix)12
-rw-r--r--pkgs/desktops/xfce/core/xfce4-session.nix35
-rw-r--r--pkgs/desktops/xfce/core/xfce4-settings.nix31
-rw-r--r--pkgs/desktops/xfce/core/xfconf.nix23
-rw-r--r--pkgs/desktops/xfce/core/xfdesktop.nix30
-rw-r--r--pkgs/desktops/xfce/core/xfwm4.nix31
-rw-r--r--pkgs/desktops/xfce/default.nix68
-rw-r--r--pkgs/desktops/xfce/panel-plugins/xfce4-cpufreq-plugin.nix22
-rw-r--r--pkgs/desktops/xfce/panel-plugins/xfce4-systemload-plugin.nix21
-rw-r--r--pkgs/development/arduino/arduino-core/default.nix42
-rw-r--r--pkgs/development/arduino/ino/default.nix34
-rw-r--r--pkgs/development/compilers/Agda-executable/default.nix1
-rw-r--r--pkgs/development/compilers/bigloo/default.nix5
-rw-r--r--pkgs/development/compilers/ccl/default.nix4
-rw-r--r--pkgs/development/compilers/chicken/default.nix18
-rw-r--r--pkgs/development/compilers/cmucl/binary.nix4
-rw-r--r--pkgs/development/compilers/dev86/default.nix6
-rw-r--r--pkgs/development/compilers/ecl/default.nix59
-rw-r--r--pkgs/development/compilers/ecl/default.upstream4
-rw-r--r--pkgs/development/compilers/ecl/src-for-default.nix7
-rw-r--r--pkgs/development/compilers/ecl/src-info-for-default.nix6
-rw-r--r--pkgs/development/compilers/edk2/default.nix6
-rw-r--r--pkgs/development/compilers/eql/default.nix39
-rw-r--r--pkgs/development/compilers/fpc/lazarus.nix11
-rw-r--r--pkgs/development/compilers/gcc-upc-4.0/builder.sh85
-rw-r--r--pkgs/development/compilers/gcc-upc-4.0/default.nix63
-rw-r--r--pkgs/development/compilers/gcc-upc-4.0/honor-cflags.patch20
-rw-r--r--pkgs/development/compilers/gcc-upc-4.0/no-sys-dirs.patch202
-rw-r--r--pkgs/development/compilers/gcc/2.95/builder.sh72
-rw-r--r--pkgs/development/compilers/gcc/2.95/default.nix17
-rw-r--r--pkgs/development/compilers/gcc/2.95/no-sys-dirs.patch231
-rw-r--r--pkgs/development/compilers/gcc/3.3/builder.sh2
-rw-r--r--pkgs/development/compilers/gcc/3.3/default.nix7
-rw-r--r--pkgs/development/compilers/gcc/3.4/default.nix7
-rw-r--r--pkgs/development/compilers/gcc/4.0/builder.sh85
-rw-r--r--pkgs/development/compilers/gcc/4.0/default.nix51
-rw-r--r--pkgs/development/compilers/gcc/4.0/gcc-4.0.2-cxx.patch12
-rw-r--r--pkgs/development/compilers/gcc/4.0/no-sys-dirs.patch228
-rw-r--r--pkgs/development/compilers/gcc/4.1/builder.sh83
-rw-r--r--pkgs/development/compilers/gcc/4.1/default.nix71
-rw-r--r--pkgs/development/compilers/gcc/4.1/no-sys-dirs.patch177
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple32/builder.sh125
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple32/debug_list.patch30
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple32/default.nix31
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple32/no-sys-dirs.patch126
-rw-r--r--pkgs/development/compilers/gcc/4.2-apple32/pass-cxxcpp.patch21
-rw-r--r--pkgs/development/compilers/gcc/4.3/default.nix13
-rw-r--r--pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch13
-rw-r--r--pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch174
-rw-r--r--pkgs/development/compilers/gcc/4.4/default.nix45
-rw-r--r--pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch174
-rw-r--r--pkgs/development/compilers/gcc/4.5/default.nix34
-rw-r--r--pkgs/development/compilers/gcc/4.6/builder.sh18
-rw-r--r--pkgs/development/compilers/gcc/4.6/default.nix195
-rw-r--r--pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch211
-rw-r--r--pkgs/development/compilers/gcc/4.7/arm-eabi.patch230
-rw-r--r--pkgs/development/compilers/gcc/4.7/builder.sh15
-rw-r--r--pkgs/development/compilers/gcc/4.7/default.nix230
-rw-r--r--pkgs/development/compilers/gcc/4.7/hurd-sigrtmin.patch14
-rw-r--r--pkgs/development/compilers/ghc/6.10.1-binary.nix9
-rw-r--r--pkgs/development/compilers/ghc/6.10.1.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.10.2-binary.nix9
-rw-r--r--pkgs/development/compilers/ghc/6.10.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.10.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.10.4.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.11.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.12.1-binary.nix9
-rw-r--r--pkgs/development/compilers/ghc/6.12.1.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.12.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.12.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.4.2-binary.nix9
-rw-r--r--pkgs/development/compilers/ghc/6.4.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.6.1.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.8.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/6.8.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.0.1.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.0.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.0.3.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.0.4-binary.nix9
-rw-r--r--pkgs/development/compilers/ghc/7.2.1.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.2.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.4.2-binary.nix92
-rw-r--r--pkgs/development/compilers/ghc/7.4.2.nix2
-rw-r--r--pkgs/development/compilers/ghc/7.6.1.nix19
-rw-r--r--pkgs/development/compilers/ghc/7.6.2.nix46
-rw-r--r--pkgs/development/compilers/ghc/7.6.3.nix46
-rw-r--r--pkgs/development/compilers/ghc/head.nix14
-rw-r--r--pkgs/development/compilers/ghc/with-packages.nix24
-rw-r--r--pkgs/development/compilers/ghc/wrapper.nix23
-rw-r--r--pkgs/development/compilers/gnatboot/default.nix4
-rw-r--r--pkgs/development/compilers/go/1.1.nix94
-rw-r--r--pkgs/development/compilers/go/default.nix28
-rw-r--r--pkgs/development/compilers/gprolog/default.nix15
-rw-r--r--pkgs/development/compilers/gwt/2.4.0.nix14
-rw-r--r--pkgs/development/compilers/gwt/builder.sh31
-rw-r--r--pkgs/development/compilers/gwt/default.nix14
-rw-r--r--pkgs/development/compilers/haxe/default.nix159
-rw-r--r--pkgs/development/compilers/hugs/default.nix2
-rw-r--r--pkgs/development/compilers/iasl/default.nix25
-rw-r--r--pkgs/development/compilers/idris/default.nix13
-rw-r--r--pkgs/development/compilers/idris/wrapper.nix10
-rw-r--r--pkgs/development/compilers/jdk/default.nix9
-rw-r--r--pkgs/development/compilers/jdk/jdk6-construct.sh16
-rw-r--r--pkgs/development/compilers/jdk/jdk6-cygwin.nix48
-rw-r--r--pkgs/development/compilers/jdk/jdk6-linux.nix18
-rw-r--r--pkgs/development/compilers/jhc/default.nix30
-rw-r--r--pkgs/development/compilers/julia/default.nix61
-rw-r--r--pkgs/development/compilers/llvm/3.1.nix27
-rw-r--r--pkgs/development/compilers/llvm/clang-include-paths.patch49
-rw-r--r--pkgs/development/compilers/llvm/clang-ld-flags.patch38
-rw-r--r--pkgs/development/compilers/llvm/clang-purity.patch137
-rw-r--r--pkgs/development/compilers/llvm/clang.nix33
-rw-r--r--pkgs/development/compilers/llvm/default.nix13
-rw-r--r--pkgs/development/compilers/llvm/dragonegg.nix7
-rw-r--r--pkgs/development/compilers/mentor/default.nix80
-rw-r--r--pkgs/development/compilers/mit-scheme/default.nix22
-rw-r--r--pkgs/development/compilers/mono/default.nix11
-rw-r--r--pkgs/development/compilers/neko/default.nix95
-rw-r--r--pkgs/development/compilers/neko/disable-modules.patch59
-rw-r--r--pkgs/development/compilers/ocaml/3.12.1.nix2
-rw-r--r--pkgs/development/compilers/ocaml/4.00.1.nix (renamed from pkgs/development/compilers/ocaml/4.00.0.nix)6
-rw-r--r--pkgs/development/compilers/ocaml/cvs.nix31
-rw-r--r--pkgs/development/compilers/opa/default.nix9
-rw-r--r--pkgs/development/compilers/opencxx/default.nix2
-rw-r--r--pkgs/development/compilers/openjdk-darwin/default.nix2
-rw-r--r--pkgs/development/compilers/openjdk/bootstrap.nix21
-rw-r--r--pkgs/development/compilers/openjdk/cppflags-include-fix.patch16
-rw-r--r--pkgs/development/compilers/openjdk/default.nix70
-rw-r--r--pkgs/development/compilers/openjdk/generate-cacerts.pl366
-rw-r--r--pkgs/development/compilers/openjdk/linux-version-check-fix.patch12
-rw-r--r--pkgs/development/compilers/openjdk/make-bootstrap.nix26
-rw-r--r--pkgs/development/compilers/openjdk/no-crypto-restrictions.patch12
-rw-r--r--pkgs/development/compilers/openjdk/printf-fix.patch12
-rw-r--r--pkgs/development/compilers/pakcs/adjust-buildsystem.patch44
-rw-r--r--pkgs/development/compilers/pakcs/default.nix131
-rw-r--r--pkgs/development/compilers/pakcs/pakcs-ghc741.patch1004
-rw-r--r--pkgs/development/compilers/polyml/default.nix11
-rw-r--r--pkgs/development/compilers/sbcl/default.nix16
-rw-r--r--pkgs/development/compilers/sbcl/default.upstream9
-rw-r--r--pkgs/development/compilers/sbcl/newglibc.patch43
-rw-r--r--pkgs/development/compilers/sbcl/src-for-default.nix9
-rw-r--r--pkgs/development/compilers/sbcl/src-info-for-default.nix7
-rw-r--r--pkgs/development/compilers/scala/default.nix4
-rw-r--r--pkgs/development/compilers/sdcc/default.nix34
-rw-r--r--pkgs/development/compilers/strategoxt/0.18.nix14
-rw-r--r--pkgs/development/compilers/swi-prolog/default.nix4
-rw-r--r--pkgs/development/compilers/tiger/builder.sh15
-rw-r--r--pkgs/development/compilers/tiger/default.nix11
-rw-r--r--pkgs/development/compilers/tinycc/default.nix151
-rw-r--r--pkgs/development/compilers/uhc/default.nix1
-rw-r--r--pkgs/development/compilers/urweb/default.nix6
-rw-r--r--pkgs/development/compilers/vala/15.2.nix2
-rw-r--r--pkgs/development/compilers/vala/16.1.nix2
-rw-r--r--pkgs/development/compilers/vala/default.nix6
-rw-r--r--pkgs/development/compilers/yasm/default.nix6
-rw-r--r--pkgs/development/eclipse/ecj/default.nix8
-rw-r--r--pkgs/development/interpreters/clisp/2.44.1.nix12
-rw-r--r--pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch12
-rw-r--r--pkgs/development/interpreters/clisp/default.nix11
-rw-r--r--pkgs/development/interpreters/clojure/default.nix15
-rw-r--r--pkgs/development/interpreters/cython/default.nix1
-rw-r--r--pkgs/development/interpreters/dart/default.nix39
-rw-r--r--pkgs/development/interpreters/erlang/R14B04.nix31
-rw-r--r--pkgs/development/interpreters/erlang/R15B03.nix45
-rw-r--r--pkgs/development/interpreters/erlang/default.nix28
-rw-r--r--pkgs/development/interpreters/guile/1.8.nix4
-rw-r--r--pkgs/development/interpreters/guile/default.nix26
-rw-r--r--pkgs/development/interpreters/guile/eai_system.patch24
-rw-r--r--pkgs/development/interpreters/hiphopvm/default.nix63
-rw-r--r--pkgs/development/interpreters/hiphopvm/tbb.patch13
-rw-r--r--pkgs/development/interpreters/love/default.nix72
-rw-r--r--pkgs/development/interpreters/lua-5/5.1.nix49
-rw-r--r--pkgs/development/interpreters/octave/default.nix6
-rw-r--r--pkgs/development/interpreters/octave/hg.nix8
-rw-r--r--pkgs/development/interpreters/perl/5.16/default.nix63
-rw-r--r--pkgs/development/interpreters/perl/5.16/no-libutil.patch12
-rw-r--r--pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch152
-rw-r--r--pkgs/development/interpreters/perl/5.16/setup-hook.sh5
-rw-r--r--pkgs/development/interpreters/php/5.2.nix172
-rw-r--r--pkgs/development/interpreters/php/5.3.nix125
-rw-r--r--pkgs/development/interpreters/php/5.4.nix225
-rw-r--r--pkgs/development/interpreters/php/fix-5.4.patch68
-rw-r--r--pkgs/development/interpreters/php/fix.patch22
-rw-r--r--pkgs/development/interpreters/plt-scheme/default.nix29
-rw-r--r--pkgs/development/interpreters/pure/default.nix12
-rw-r--r--pkgs/development/interpreters/pure/new-gcc.patch62
-rw-r--r--pkgs/development/interpreters/python/2.6/default.nix14
-rw-r--r--pkgs/development/interpreters/python/2.7/default.nix3
-rw-r--r--pkgs/development/interpreters/python/3.3/default.nix (renamed from pkgs/development/interpreters/python/3.2/default.nix)8
-rw-r--r--pkgs/development/interpreters/python/3.3/setup-hook.sh (renamed from pkgs/development/interpreters/python/3.2/setup-hook.sh)0
-rw-r--r--pkgs/development/interpreters/python/docs/2.6-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.6-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.6-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.6-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.7-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.7-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.7-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/2.7-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.0-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.0-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.0-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.0-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.1-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.1-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.1-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.1-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.2-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.2-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.2-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.2-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.3-html.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.3-pdf-a4.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.3-pdf-letter.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/3.3-text.nix18
-rw-r--r--pkgs/development/interpreters/python/docs/default.nix89
-rwxr-xr-xpkgs/development/interpreters/python/docs/generate.sh59
-rw-r--r--pkgs/development/interpreters/python/docs/template.nix18
-rw-r--r--pkgs/development/interpreters/python/python-linkme-wrapper.nix13
-rw-r--r--pkgs/development/interpreters/python/python-linkme-wrapper.sh33
-rw-r--r--pkgs/development/interpreters/python/pythonhome-wrapper.nix21
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix8
-rw-r--r--pkgs/development/interpreters/racket/default.nix14
-rw-r--r--pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch35
-rw-r--r--pkgs/development/interpreters/ruby/gem.nix2
-rw-r--r--pkgs/development/interpreters/ruby/generated.nix1147
-rw-r--r--pkgs/development/interpreters/ruby/libs.nix4
-rw-r--r--pkgs/development/interpreters/ruby/patches.nix36
-rw-r--r--pkgs/development/interpreters/ruby/ruby-2.0.nix57
-rw-r--r--pkgs/development/interpreters/spidermonkey/builder.sh31
-rw-r--r--pkgs/development/interpreters/tcl/default.nix1
-rw-r--r--pkgs/development/interpreters/toolbus/default.nix17
-rw-r--r--pkgs/development/libraries/GConf/3.x.nix2
-rw-r--r--pkgs/development/libraries/SDL/default.nix2
-rw-r--r--pkgs/development/libraries/SDL_image/default.nix34
-rw-r--r--pkgs/development/libraries/SDL_image/jpeg-linux.diff21
-rw-r--r--pkgs/development/libraries/aacskeys/default.nix10
-rw-r--r--pkgs/development/libraries/acl/default.nix2
-rw-r--r--pkgs/development/libraries/agg/default.nix7
-rw-r--r--pkgs/development/libraries/apache-activemq/default.nix31
-rw-r--r--pkgs/development/libraries/apr-util/default.nix6
-rw-r--r--pkgs/development/libraries/aqbanking/default.nix2
-rw-r--r--pkgs/development/libraries/arts/default.nix31
-rw-r--r--pkgs/development/libraries/asc-support/default.nix2
-rw-r--r--pkgs/development/libraries/asf-support/default.nix2
-rw-r--r--pkgs/development/libraries/aterm/2.5.nix5
-rw-r--r--pkgs/development/libraries/aterm/2.8.nix11
-rw-r--r--pkgs/development/libraries/atk/2.6.x.nix (renamed from pkgs/development/libraries/atk/2.2.x.nix)8
-rw-r--r--pkgs/development/libraries/atkmm/default.nix (renamed from pkgs/development/libraries/atkmm/2.22.x.nix)2
-rw-r--r--pkgs/development/libraries/attica/default.nix8
-rw-r--r--pkgs/development/libraries/attr/default.nix2
-rw-r--r--pkgs/development/libraries/audio/libbs2b/default.nix19
-rw-r--r--pkgs/development/libraries/audio/lilv/default.nix4
-rw-r--r--pkgs/development/libraries/audio/lv2/default.nix4
-rw-r--r--pkgs/development/libraries/audio/sratom/default.nix4
-rw-r--r--pkgs/development/libraries/audio/suil/default.nix8
-rw-r--r--pkgs/development/libraries/avahi/default.nix2
-rw-r--r--pkgs/development/libraries/boehm-gc/default.nix20
-rw-r--r--pkgs/development/libraries/boolstuff/default.nix2
-rw-r--r--pkgs/development/libraries/boost/1.44.nix7
-rw-r--r--pkgs/development/libraries/boost/1.46.nix80
-rw-r--r--pkgs/development/libraries/boost/1.47.nix90
-rw-r--r--pkgs/development/libraries/boost/1.49-headers.nix26
-rw-r--r--pkgs/development/libraries/boost/1.49.nix12
-rw-r--r--pkgs/development/libraries/boost/1.53-headers.nix (renamed from pkgs/development/libraries/boost/1.50-headers.nix)8
-rw-r--r--pkgs/development/libraries/boost/1.53.nix (renamed from pkgs/development/libraries/boost/1.50.nix)25
-rw-r--r--pkgs/development/libraries/boost/boost-149-darwin.patch40
-rw-r--r--pkgs/development/libraries/boost/boost_filesystem.patch24
-rw-r--r--pkgs/development/libraries/boost/time_utc.patch320
-rw-r--r--pkgs/development/libraries/boost/time_utc_144.patch520
-rw-r--r--pkgs/development/libraries/bullet/default.nix19
-rw-r--r--pkgs/development/libraries/bwidget/default.nix16
-rw-r--r--pkgs/development/libraries/c-ares/default.nix20
-rw-r--r--pkgs/development/libraries/c-library/default.nix2
-rw-r--r--pkgs/development/libraries/caelum/default.nix2
-rw-r--r--pkgs/development/libraries/cairo/1.12.2.nix82
-rw-r--r--pkgs/development/libraries/cairo/default.nix31
-rw-r--r--pkgs/development/libraries/celt/0.5.1.nix (renamed from pkgs/development/libraries/liblrdf/default.nix)26
-rw-r--r--pkgs/development/libraries/cil-aterm/atermprinter.patch515
-rw-r--r--pkgs/development/libraries/cil-aterm/cil-aterm-1.3.3.nix12
-rw-r--r--pkgs/development/libraries/cil-aterm/cil-aterm-1.3.4.patch593
-rw-r--r--pkgs/development/libraries/cloog-ppl/default.nix2
-rw-r--r--pkgs/development/libraries/clucene-core/2.x.nix27
-rw-r--r--pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch19
-rw-r--r--pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch20
-rw-r--r--pkgs/development/libraries/clucene-core/Install-contribs-lib.patch49
-rw-r--r--pkgs/development/libraries/clucene-core/default.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/0.10.8.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/default.nix2
-rw-r--r--pkgs/development/libraries/clutter/default.nix2
-rw-r--r--pkgs/development/libraries/cogl/default.nix2
-rw-r--r--pkgs/development/libraries/coin3d/default.nix2
-rw-r--r--pkgs/development/libraries/config-support/default.nix2
-rw-r--r--pkgs/development/libraries/consolekit/0001-Don-t-daemonize-when-activated.patch28
-rw-r--r--pkgs/development/libraries/consolekit/0002-Don-t-take-bus-name-until-ready.patch62
-rw-r--r--pkgs/development/libraries/consolekit/commands.patch33
-rw-r--r--pkgs/development/libraries/consolekit/default.nix29
-rw-r--r--pkgs/development/libraries/cppunit/default.nix2
-rw-r--r--pkgs/development/libraries/cracklib/builder.sh13
-rw-r--r--pkgs/development/libraries/cracklib/default.nix7
-rw-r--r--pkgs/development/libraries/crypto++/default.nix19
-rw-r--r--pkgs/development/libraries/crypto++/pic.patch22
-rw-r--r--pkgs/development/libraries/crypto++/salsa-gcc4.6.patch62
-rw-r--r--pkgs/development/libraries/cyrus-sasl/default.nix20
-rw-r--r--pkgs/development/libraries/cyrus-sasl/missing-size_t.patch13
-rw-r--r--pkgs/development/libraries/dbus-glib/default.nix2
-rw-r--r--pkgs/development/libraries/dbus/default.nix14
-rw-r--r--pkgs/development/libraries/despotify/default.nix34
-rw-r--r--pkgs/development/libraries/directfb/default.nix20
-rw-r--r--pkgs/development/libraries/directfb/ftbfs.patch25
-rw-r--r--pkgs/development/libraries/directfb/src-for-default.nix10
-rw-r--r--pkgs/development/libraries/dxflib/default.nix17
-rw-r--r--pkgs/development/libraries/eigen/2.0.nix23
-rw-r--r--pkgs/development/libraries/eigen/default.nix6
-rw-r--r--pkgs/development/libraries/enginepkcs11/default.nix5
-rw-r--r--pkgs/development/libraries/error-support/default.nix2
-rw-r--r--pkgs/development/libraries/expat/cve-2009-3560.patch18
-rw-r--r--pkgs/development/libraries/expat/default.nix14
-rw-r--r--pkgs/development/libraries/farsight2/default.nix2
-rw-r--r--pkgs/development/libraries/farstream/default.nix12
-rw-r--r--pkgs/development/libraries/ffmpeg/1.x.nix96
-rw-r--r--pkgs/development/libraries/ffmpeg/default.nix4
-rw-r--r--pkgs/development/libraries/ffms/default.nix20
-rw-r--r--pkgs/development/libraries/fftw/default.nix3
-rw-r--r--pkgs/development/libraries/flann/default.nix8
-rw-r--r--pkgs/development/libraries/fltk/fltk13.nix2
-rw-r--r--pkgs/development/libraries/fmod/default.nix4
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix21
-rw-r--r--pkgs/development/libraries/fox/default.nix34
-rw-r--r--pkgs/development/libraries/fox/fox-1.6.nix36
-rw-r--r--pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch13
-rw-r--r--pkgs/development/libraries/freeimage/default.nix6
-rw-r--r--pkgs/development/libraries/freetype/default.nix20
-rw-r--r--pkgs/development/libraries/ftgl/2.1.2.nix2
-rw-r--r--pkgs/development/libraries/funambol/default.nix2
-rw-r--r--pkgs/development/libraries/gamin/deadlock.patch68
-rw-r--r--pkgs/development/libraries/gamin/debian-patches.nix2
-rw-r--r--pkgs/development/libraries/gamin/default.nix4
-rw-r--r--pkgs/development/libraries/gdk-pixbuf/2.26.x.nix (renamed from pkgs/development/libraries/gdk-pixbuf/2.24.x.nix)13
-rw-r--r--pkgs/development/libraries/gegl/default.nix2
-rw-r--r--pkgs/development/libraries/gettext/default.nix4
-rw-r--r--pkgs/development/libraries/gettext/no-gets.patch42
-rw-r--r--pkgs/development/libraries/git2/default.nix22
-rw-r--r--pkgs/development/libraries/glew/default.nix22
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix2
-rw-r--r--pkgs/development/libraries/glib/2.34.x.nix (renamed from pkgs/development/libraries/glib/2.30.x.nix)28
-rw-r--r--pkgs/development/libraries/glibc/2.13/common.nix19
-rw-r--r--pkgs/development/libraries/glibc/2.14/common.nix223
-rw-r--r--pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch43
-rw-r--r--pkgs/development/libraries/glibc/2.14/info.nix26
-rw-r--r--pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch21
-rw-r--r--pkgs/development/libraries/glibc/2.14/rpcgen-path.patch72
-rw-r--r--pkgs/development/libraries/glibc/2.17/builder.sh (renamed from pkgs/development/libraries/glibc/2.14/builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/common.nix194
-rw-r--r--pkgs/development/libraries/glibc/2.17/default.nix (renamed from pkgs/development/libraries/glibc/2.14/default.nix)12
-rw-r--r--pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch45
-rw-r--r--pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch795
-rw-r--r--pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch (renamed from pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch55
-rw-r--r--pkgs/development/libraries/glibc/2.17/info.nix26
-rw-r--r--pkgs/development/libraries/glibc/2.17/locales-builder.sh (renamed from pkgs/development/libraries/glibc/2.14/locales-builder.sh)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/locales.nix (renamed from pkgs/development/libraries/glibc/2.14/locales.nix)0
-rw-r--r--pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch (renamed from pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch)48
-rw-r--r--pkgs/development/libraries/glibc/2.17/rpcgen-path.patch54
-rw-r--r--pkgs/development/libraries/glibc/2.5/binutils-ld.patch27
-rw-r--r--pkgs/development/libraries/glibc/2.5/builder.sh57
-rw-r--r--pkgs/development/libraries/glibc/2.5/default.nix40
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch14
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-inline.patch1822
-rw-r--r--pkgs/development/libraries/glibc/2.5/glibc-pwd.patch74
-rw-r--r--pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch14
-rw-r--r--pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch32
-rw-r--r--pkgs/development/libraries/glibc/2.7/builder.sh60
-rw-r--r--pkgs/development/libraries/glibc/2.7/default.nix57
-rw-r--r--pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch25
-rw-r--r--pkgs/development/libraries/glibc/2.9/binutils-2.20.patch42
-rw-r--r--pkgs/development/libraries/glibc/2.9/binutils-ld.patch33
-rw-r--r--pkgs/development/libraries/glibc/2.9/builder.sh85
-rw-r--r--pkgs/development/libraries/glibc/2.9/default.nix103
-rw-r--r--pkgs/development/libraries/glibc/2.9/headers.nix63
-rw-r--r--pkgs/development/libraries/glibc/2.9/headersbuilder.sh38
-rw-r--r--pkgs/development/libraries/glibc/2.9/info.nix47
-rw-r--r--pkgs/development/libraries/glibc/2.9/locale-override.patch72
-rw-r--r--pkgs/development/libraries/glibc/2.9/locales.nix67
-rw-r--r--pkgs/development/libraries/glibc/2.9/localesbuilder.sh50
-rw-r--r--pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch25
-rw-r--r--pkgs/development/libraries/glibc/2.9/rpcgen-path.patch72
-rw-r--r--pkgs/development/libraries/glibmm/2.30.x.nix24
-rw-r--r--pkgs/development/libraries/glibmm/default.nix24
-rw-r--r--pkgs/development/libraries/gmp/4.3.1.nix27
-rw-r--r--pkgs/development/libraries/gmp/4.3.2.nix2
-rw-r--r--pkgs/development/libraries/gmp/5.0.5.nix9
-rw-r--r--pkgs/development/libraries/gmp/5.1.1.nix54
-rw-r--r--pkgs/development/libraries/gnu-efi/default.nix9
-rw-r--r--pkgs/development/libraries/gnutls/2.12.nix8
-rw-r--r--pkgs/development/libraries/gnutls/default.nix32
-rw-r--r--pkgs/development/libraries/gobject-introspection/default.nix11
-rw-r--r--pkgs/development/libraries/goffice/0.10.nix (renamed from pkgs/development/libraries/goffice/0.9.nix)6
-rw-r--r--pkgs/development/libraries/goffice/default.nix20
-rw-r--r--pkgs/development/libraries/goffice/pcre_info.patch13
-rw-r--r--pkgs/development/libraries/google-perftools/default.nix14
-rw-r--r--pkgs/development/libraries/gperftools/default.nix22
-rw-r--r--pkgs/development/libraries/gperftools/glibc-2.16.patch13
-rw-r--r--pkgs/development/libraries/gpgme/default.nix18
-rw-r--r--pkgs/development/libraries/grantlee/default.nix4
-rw-r--r--pkgs/development/libraries/gsasl/default.nix4
-rw-r--r--pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix9
-rw-r--r--pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix6
-rw-r--r--pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch11
-rw-r--r--pkgs/development/libraries/gstreamer/gstreamer/default.nix8
-rw-r--r--pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix2
-rw-r--r--pkgs/development/libraries/gtk+/2.24.x.nix16
-rw-r--r--pkgs/development/libraries/gtk+/3.2.x.nix8
-rw-r--r--pkgs/development/libraries/gtk+/old-icons.patch270
-rw-r--r--pkgs/development/libraries/gtk-sharp-2/default.nix7
-rw-r--r--pkgs/development/libraries/gtk-sharp-2/dllmap-glue.patch65
-rw-r--r--pkgs/development/libraries/gtkmm/2.x.nix (renamed from pkgs/development/libraries/gtkmm/2.24.x.nix)2
-rw-r--r--pkgs/development/libraries/gtkmm/3.x.nix (renamed from pkgs/development/libraries/gtkmm/3.2.x.nix)2
-rw-r--r--pkgs/development/libraries/gts/default.nix4
-rw-r--r--pkgs/development/libraries/gupnp-igd/default.nix4
-rw-r--r--pkgs/development/libraries/gupnp/default.nix2
-rw-r--r--pkgs/development/libraries/gvfs/default.nix38
-rw-r--r--pkgs/development/libraries/gwenhywfar/default.nix2
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/Agda/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/Boolean/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/Cabal/1.14.0.nix13
-rw-r--r--pkgs/development/libraries/haskell/Cabal/1.16.0.3.nix25
-rw-r--r--pkgs/development/libraries/haskell/ChasingBottoms/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/CouchDB/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/Crypto/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/DAV/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/DSH/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/Diff/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/GLFW/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/GLURaw/1.3.0.0.nix (renamed from pkgs/development/libraries/haskell/GLURaw/default.nix)4
-rw-r--r--pkgs/development/libraries/haskell/GLUT/2.3.1.0.nix (renamed from pkgs/development/libraries/haskell/GLUT/2.3.0.0.nix)4
-rw-r--r--pkgs/development/libraries/haskell/GLUT/2.4.0.0.nix18
-rw-r--r--pkgs/development/libraries/haskell/Glob/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/Graphalyze/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/HDBC/HDBC-odbc.nix6
-rw-r--r--pkgs/development/libraries/haskell/HDBC/HDBC.nix4
-rw-r--r--pkgs/development/libraries/haskell/HFuse/default.nix (renamed from pkgs/development/libraries/haskell/hfuse/default.nix)1
-rw-r--r--pkgs/development/libraries/haskell/HGL/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/HSH/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/HStringTemplate/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.0.6.nix1
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.0.9.nix1
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.1.1.nix1
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.1.2.nix1
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.2.1.nix8
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.2.2.nix8
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.2.3.nix8
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.2.5.nix23
-rw-r--r--pkgs/development/libraries/haskell/HTTP/4000.2.8.nix23
-rw-r--r--pkgs/development/libraries/haskell/HUnit/1.2.5.2.nix (renamed from pkgs/development/libraries/haskell/text/0.11.1.12.nix)10
-rw-r--r--pkgs/development/libraries/haskell/HaXml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/Hipmunk/default.nix3
-rw-r--r--pkgs/development/libraries/haskell/HsOpenSSL/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/IORefCAS/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/JuicyPixels/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/List/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/ListLike/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ListZipper/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/MemoTrie/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/MissingH/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/MonadRandom/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/NumInstances/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/OpenAL/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/OpenGL/2.6.0.1.nix (renamed from pkgs/development/libraries/haskell/OpenGL/2.5.0.0.nix)4
-rw-r--r--pkgs/development/libraries/haskell/OpenGL/2.8.0.0.nix16
-rw-r--r--pkgs/development/libraries/haskell/OpenGLRaw/1.3.0.0.nix (renamed from pkgs/development/libraries/haskell/OpenGLRaw/default.nix)4
-rw-r--r--pkgs/development/libraries/haskell/QuickCheck/2.5.1.1.nix (renamed from pkgs/development/libraries/haskell/QuickCheck/2.5.nix)8
-rw-r--r--pkgs/development/libraries/haskell/QuickCheck/2.6.nix15
-rw-r--r--pkgs/development/libraries/haskell/RSA/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ReadArgs/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/SDL-ttf/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/SDL/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/SHA/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/SMTPClient/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/SafeSemaphore/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/Stream/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/X11/1.5.0.1.nix16
-rw-r--r--pkgs/development/libraries/haskell/X11/default.nix (renamed from pkgs/development/libraries/haskell/X11/1.6.0.nix)9
-rw-r--r--pkgs/development/libraries/haskell/abstract-deque/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/accelerate-cuda/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/accelerate-examples/default.nix25
-rw-r--r--pkgs/development/libraries/haskell/accelerate-fft/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/accelerate-io/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/accelerate/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/acid-state/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/active/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/aeson/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/alsa-core/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/alsa-pcm/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/ansi-terminal/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ansi-wl-pprint/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/appar/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/arithmoi/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/arrows/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/asn1-data/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/asn1-types/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/async/2.0.1.3.nix (renamed from pkgs/development/libraries/haskell/async/default.nix)7
-rw-r--r--pkgs/development/libraries/haskell/async/2.0.1.4.nix16
-rw-r--r--pkgs/development/libraries/haskell/atomic-primops/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/attoparsec-binary/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/attoparsec-conduit/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/attoparsec-enumerator/default.nix (renamed from pkgs/development/libraries/haskell/attoparsec/enumerator.nix)0
-rw-r--r--pkgs/development/libraries/haskell/attoparsec/0.10.4.0.nix20
-rw-r--r--pkgs/development/libraries/haskell/attoparsec/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/authenticate-oauth/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/authenticate/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/base-compat/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/base64-bytestring/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/base64-conduit/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/basic-prelude/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/benchpress/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/bifunctors/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/binary-shared/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/binary/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/blaze-builder/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/blaze-html/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/blaze-markup/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/blaze-svg/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/blaze-textual/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/bloomfilter/default.nix2
-rw-r--r--pkgs/development/libraries/haskell/bmp/1.2.2.1.nix (renamed from pkgs/development/libraries/haskell/bmp/default.nix)4
-rw-r--r--pkgs/development/libraries/haskell/bmp/1.2.5.2.nix16
-rw-r--r--pkgs/development/libraries/haskell/boomerang/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/bson/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/byteorder/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/bytestring-lexing/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/bytestring-nums/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/bytestring-progress/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/c2hs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cabal-file-th/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cairo/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/carray/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/case-insensitive/1.0.0.1.nix (renamed from pkgs/development/libraries/haskell/case-insensitive/default.nix)12
-rw-r--r--pkgs/development/libraries/haskell/case-insensitive/1.0.0.2.nix17
-rw-r--r--pkgs/development/libraries/haskell/cautious-file/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/cereal-conduit/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/certificate/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/cgi/3001.1.7.5.nix14
-rw-r--r--pkgs/development/libraries/haskell/cgi/3001.1.8.4.nix (renamed from pkgs/development/libraries/haskell/cgi/3001.1.8.2.nix)12
-rw-r--r--pkgs/development/libraries/haskell/checkers/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/cipher-aes/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/cipher-rc4/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/circle-packing/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/citeproc-hs/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/classy-prelude/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/clientsession/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/cmdargs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/comonad-transformers/2.1.2.nix19
-rw-r--r--pkgs/development/libraries/haskell/comonad-transformers/default.nix (renamed from pkgs/development/libraries/haskell/comonad-transformers/3.0.nix)4
-rw-r--r--pkgs/development/libraries/haskell/comonad/3.0.0.2.nix14
-rw-r--r--pkgs/development/libraries/haskell/comonad/default.nix (renamed from pkgs/development/libraries/haskell/comonad/1.1.1.6.nix)7
-rw-r--r--pkgs/development/libraries/haskell/comonads-fd/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/concurrent-extra/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/conduit/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/configurator/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/constraints/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/contravariant/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/cookie/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cprng-aes/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/criterion/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/crypto-api/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/crypto-conduit/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/crypto-numbers/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/crypto-pubkey-types/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/crypto-pubkey/default.nix23
-rw-r--r--pkgs/development/libraries/haskell/crypto-random-api/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/cryptocipher/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/cryptohash-cryptoapi/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/cryptohash/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/css-text/default.nix3
-rw-r--r--pkgs/development/libraries/haskell/cuda/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/cufft/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/curl/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/data-accessor/data-accessor-template.nix4
-rw-r--r--pkgs/development/libraries/haskell/data-accessor/data-accessor-transformers.nix14
-rw-r--r--pkgs/development/libraries/haskell/data-accessor/data-accessor.nix4
-rw-r--r--pkgs/development/libraries/haskell/data-binary-ieee754/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/data-default-class/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/data-default-instances-base/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/data-default-instances-containers/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/data-default-instances-dlist/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/data-default-instances-old-locale/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/data-default/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/data-inttrie/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/data-lens-template/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/data-memocombinators/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/dataenc/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/date-cache/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/dbus/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/deepseq-th/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/deepseq/1.3.0.1.nix (renamed from pkgs/development/libraries/haskell/deepseq/1.3.0.0.nix)4
-rw-r--r--pkgs/development/libraries/haskell/dependent-map/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/dependent-sum-template/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/dependent-sum/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/derive/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/diagrams/cairo.nix19
-rw-r--r--pkgs/development/libraries/haskell/diagrams/contrib.nix25
-rw-r--r--pkgs/development/libraries/haskell/diagrams/core.nix20
-rw-r--r--pkgs/development/libraries/haskell/diagrams/diagrams.nix18
-rw-r--r--pkgs/development/libraries/haskell/diagrams/lib.nix19
-rw-r--r--pkgs/development/libraries/haskell/diagrams/svg.nix19
-rw-r--r--pkgs/development/libraries/haskell/dice/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/digest/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors-heist/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors-snap/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/digestive-functors/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/dimensional-tf/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/directory-tree/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/distributed-process-simplelocalnet/default.nix23
-rw-r--r--pkgs/development/libraries/haskell/distributed-process/default.nix32
-rw-r--r--pkgs/development/libraries/haskell/distributed-static/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/distributive/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/dns/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/doctest/default.nix23
-rw-r--r--pkgs/development/libraries/haskell/double-conversion/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/dstring/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/dual-tree/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/dyre/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/edit-distance/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/editline/0.2.1.0.nix (renamed from pkgs/development/libraries/haskell/editline/default.nix)3
-rw-r--r--pkgs/development/libraries/haskell/editline/0.2.1.1.nix14
-rw-r--r--pkgs/development/libraries/haskell/either/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/elerea/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/email-validate/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/encoding/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/entropy/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/errors/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/exception-mtl/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/exception-transformers/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/explicit-exception/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/fast-logger/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/fclabels/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/fgl-visualize/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/file-embed/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/file-location/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/filepath/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/filestore/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/filesystem-conduit/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/fingertree/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/flexible-defaults/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/force-layout/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/fsnotify/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/funcmp/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/generic-deriving/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/geniplate/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/ghc-core/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/ghc-events/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/ghc-heap-view/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/ghc-mod/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/ghc-mtl/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ghc-paths/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/ghc-paths/ghc-paths-nix.patch43
-rw-r--r--pkgs/development/libraries/haskell/ghc-syb-utils/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/ghc-vis/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/gio/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/github/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/gitit/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/glib/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/gloss/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/glpk-hs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/gnuidn/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/gnutls/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/graphviz/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/groupoids/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/gsasl/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/gtk/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/gtk2hs-buildtools/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hS3/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hackage-db/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/hakyll/default.nix36
-rw-r--r--pkgs/development/libraries/haskell/hamlet/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/happstack/happstack-hamlet.nix7
-rw-r--r--pkgs/development/libraries/haskell/happstack/happstack-server.nix19
-rw-r--r--pkgs/development/libraries/haskell/happstack/happstack-util.nix25
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.1.2.5.nix (renamed from pkgs/development/libraries/haskell/hashable/default.nix)7
-rw-r--r--pkgs/development/libraries/haskell/hashable/1.2.0.7.nix22
-rw-r--r--pkgs/development/libraries/haskell/hashed-storage/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/hashtables/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/haskeline/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/haskell-platform/2010.2.0.0.nix3
-rw-r--r--pkgs/development/libraries/haskell/haskell-platform/2012.4.0.0.nix44
-rw-r--r--pkgs/development/libraries/haskell/haskell-platform/2013.2.0.0.nix45
-rw-r--r--pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2012.4.0.0.cabal113
-rw-r--r--pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2013.2.0.0.cabal118
-rw-r--r--pkgs/development/libraries/haskell/haskell-src-exts/1.11.1.nix1
-rw-r--r--pkgs/development/libraries/haskell/haskell-src-exts/1.13.5.nix (renamed from pkgs/development/libraries/haskell/haskell-src-exts/1.13.3.nix)5
-rw-r--r--pkgs/development/libraries/haskell/haskell-src-meta/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/hastache/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/haxr/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/heist/default.nix17
-rw-r--r--pkgs/development/libraries/haskell/hexpat/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/highlighting-kate/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/hinotify/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/hint/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hjsmin/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/hledger-lib/default.nix26
-rw-r--r--pkgs/development/libraries/haskell/hledger-web/default.nix27
-rw-r--r--pkgs/development/libraries/haskell/hledger/default.nix28
-rw-r--r--pkgs/development/libraries/haskell/hoauth/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hoogle/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/hopenssl/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/hp2any-core/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hp2any-graph/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hs-bibutils/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/hscolour/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hsdns/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/hsemail/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/hslogger-template/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hspec-expectations/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/hspec-meta/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/hspec/default.nix28
-rw-r--r--pkgs/development/libraries/haskell/hstatsd/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/hsyslog/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/html-conduit/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/http-conduit/default.nix34
-rw-r--r--pkgs/development/libraries/haskell/http-date/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/http-reverse-proxy/default.nix26
-rw-r--r--pkgs/development/libraries/haskell/http-types/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/hxt-regex-xmlschema/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/hxt/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/idna/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/instant-generics/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/io-choice/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/iproute/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/iteratee/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/ix-shapable/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/json/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/kansas-lava/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/knob/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/lambdabot-utils/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/lambdabot/default.nix28
-rw-r--r--pkgs/development/libraries/haskell/lambdacube-engine/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/language-c-quote/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/language-haskell-extract/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/language-java/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/language-javascript/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/largeword/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/leksah/leksah-server.nix5
-rw-r--r--pkgs/development/libraries/haskell/lens/default.nix35
-rw-r--r--pkgs/development/libraries/haskell/lenses/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/libffi/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/liblastfm/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/libmpd/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/libxml-sax/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/lifted-base/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/lockfree-queue/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/logict/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/lrucache/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/maccatcher/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/mainland-pretty/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/markdown-unlit/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/math-functions/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/mime-mail/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/mime-types/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/minimorph/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/miniutter/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/misfortune/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/mmorph/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/monad-control/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/monad-logger/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/monad-loops/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/monad-par/0.1.0.3.nix1
-rw-r--r--pkgs/development/libraries/haskell/monad-par/0.3.4.2.nix28
-rw-r--r--pkgs/development/libraries/haskell/monad-par/0.3.nix20
-rw-r--r--pkgs/development/libraries/haskell/monad-peel/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/monadcryptorandom/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/monads-tf/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mongoDB/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/monoid-extras/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/mpppc/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/mtl/2.1.nix14
-rw-r--r--pkgs/development/libraries/haskell/mueval/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/multiarg/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/multirec/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/multiset/0.2.1.nix (renamed from pkgs/development/libraries/haskell/multiset/default.nix)0
-rw-r--r--pkgs/development/libraries/haskell/multiset/0.2.2.nix (renamed from pkgs/development/libraries/haskell/time/1.2.0.5.nix)9
-rw-r--r--pkgs/development/libraries/haskell/murmur-hash/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/mwc-random/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/nanospec/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/nat/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/nats/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/naturals/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/netlist-to-vhdl/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/netlist/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/netwire/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/network-conduit-tls/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/network-conduit/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/network-info/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/network-multicast/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/network-protocol-xmpp/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/network-transport-tcp/default.nix25
-rw-r--r--pkgs/development/libraries/haskell/network-transport-tests/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/network-transport/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/network/2.3.0.13.nix3
-rw-r--r--pkgs/development/libraries/haskell/network/2.3.1.0.nix3
-rw-r--r--pkgs/development/libraries/haskell/network/2.4.1.2.nix20
-rw-r--r--pkgs/development/libraries/haskell/newtype/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/numbers/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/numeric-prelude/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/numtype-tf/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/optparse-applicative/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/pandoc-types/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/pandoc/default.nix36
-rw-r--r--pkgs/development/libraries/haskell/pango/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/parallel-io/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/parseargs/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/path-pieces/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/pathtype/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/pem/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/permutation/default.nix1
-rw-r--r--pkgs/development/libraries/haskell/persistent-postgresql/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/persistent-sqlite/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/persistent-template/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/persistent/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/pipes-concurrency/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/pipes-parse/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/pipes-safe/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/pipes/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/polyparse/1.7.nix15
-rw-r--r--pkgs/development/libraries/haskell/polyparse/default.nix (renamed from pkgs/development/libraries/haskell/polyparse/1.8.nix)4
-rw-r--r--pkgs/development/libraries/haskell/pool-conduit/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/pop3-client/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/postgresql-libpq/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/postgresql-simple/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/pretty-show/1.2.nix (renamed from pkgs/development/libraries/haskell/pretty-show/default.nix)1
-rw-r--r--pkgs/development/libraries/haskell/pretty-show/1.5.nix17
-rw-r--r--pkgs/development/libraries/haskell/primitive/0.5.0.1.nix (renamed from pkgs/development/libraries/haskell/primitive/default.nix)6
-rw-r--r--pkgs/development/libraries/haskell/process-extras/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/profunctor-extras/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/profunctors/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/project-template/default.nix24
-rw-r--r--pkgs/development/libraries/haskell/publicsuffixlist/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/punycode/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/pureMD5/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/pwstore-fast/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/quickcheck-io/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/random-fu/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/random-source/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/rank1dynamic/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/reactive-banana-wx/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/reactive-banana/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/readline/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/reflection/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/regex-pcre-builtin/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/regular/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/repa-algorithms/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/repa-examples/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/repa-io/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/repa/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/repr/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/resource-pool/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/resourcet/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/safecopy/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/sample-frame/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/scotty/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/semigroupoid-extras/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/semigroupoids/3.0.nix14
-rw-r--r--pkgs/development/libraries/haskell/semigroupoids/default.nix (renamed from pkgs/development/libraries/haskell/semigroupoids/1.3.4.nix)4
-rw-r--r--pkgs/development/libraries/haskell/semigroups/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/sendfile/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/setenv/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/shake/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-css/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-i18n/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-js/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/shakespeare-text/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/shakespeare/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/shelly/default.nix10
-rw-r--r--pkgs/development/libraries/haskell/show/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/silently/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/simple-reflect/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/simple-sendfile/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/sized-types/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/skein/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/smallcheck/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/smtp-mail/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/snap/core.nix24
-rw-r--r--pkgs/development/libraries/haskell/snap/loader-dynamic.nix4
-rw-r--r--pkgs/development/libraries/haskell/snap/loader-static.nix4
-rw-r--r--pkgs/development/libraries/haskell/snap/server.nix20
-rw-r--r--pkgs/development/libraries/haskell/snap/snap.nix31
-rw-r--r--pkgs/development/libraries/haskell/socks/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/split/0.2.1.1.nix14
-rw-r--r--pkgs/development/libraries/haskell/split/0.2.2.nix (renamed from pkgs/development/libraries/haskell/split/default.nix)7
-rw-r--r--pkgs/development/libraries/haskell/srcloc/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/statistics/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/stm-chans/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/stm-conduit/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/stm/2.4.2.nix (renamed from pkgs/development/libraries/haskell/syb/default.nix)8
-rw-r--r--pkgs/development/libraries/haskell/streamproc/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/string-combinators/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/string-qq/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/stringbuilder/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/stringprep/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/stringsearch/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/strptime/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/stylish-haskell/default.nix24
-rw-r--r--pkgs/development/libraries/haskell/syb/0.4.0.nix (renamed from pkgs/development/libraries/haskell/syb/0.3.5.nix)7
-rw-r--r--pkgs/development/libraries/haskell/syb/syb-with-class.nix4
-rw-r--r--pkgs/development/libraries/haskell/symbol/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/system-fileio/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/system-filepath/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/tabular/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/tagged/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/tagsoup/0.10.1nix16
-rw-r--r--pkgs/development/libraries/haskell/tagsoup/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/tagstream-conduit/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/tar/default.nix (renamed from pkgs/development/tools/haskell/tar/0.3.2.0.nix)8
-rw-r--r--pkgs/development/libraries/haskell/temporary/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/terminal-progress-bar/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/test-framework-hunit/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/test-framework-quickcheck/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/test-framework-th-prime/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/test-framework-th/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/test-framework/0.5.nix22
-rw-r--r--pkgs/development/libraries/haskell/test-framework/default.nix (renamed from pkgs/development/libraries/haskell/test-framework/0.6.nix)4
-rw-r--r--pkgs/development/libraries/haskell/testpack/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/texmath/0.4.nix17
-rw-r--r--pkgs/development/libraries/haskell/texmath/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/text-icu/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.0.5.nix1
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.0.6.nix1
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.1.13.nix9
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.1.5.nix1
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.2.0.nix9
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.2.3.nix9
-rw-r--r--pkgs/development/libraries/haskell/text/0.11.3.1.nix22
-rw-r--r--pkgs/development/libraries/haskell/th-extras/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/th-orphans/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/threads/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/time-compat/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/time/1.1.3.nix14
-rw-r--r--pkgs/development/libraries/haskell/time/1.2.0.3.nix14
-rw-r--r--pkgs/development/libraries/haskell/time/1.4.0.2.nix (renamed from pkgs/development/libraries/haskell/time/1.4.0.1.nix)11
-rw-r--r--pkgs/development/libraries/haskell/tls-extra/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/tls/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/transformers-compat/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/type-equality/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/type-level-natural-number/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/unbounded-delays/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/uniplate/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unix-compat/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unix-process-conduit/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/unix-time/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/unlambda/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/unordered-containers/0.2.3.0.nix21
-rw-r--r--pkgs/development/libraries/haskell/unordered-containers/0.2.3.1.nix21
-rw-r--r--pkgs/development/libraries/haskell/unordered-containers/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/urlencoded/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/utility-ht/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/uu-interleaved/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/uu-options/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/uu-parsinglib/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/uuid/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/uulib/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vacuum/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vault/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vcs-revision/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/vect/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/vector-algorithms/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/vector-binary-instances/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/vector-space-points/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/vector-space/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/vector/0.10.0.1.nix15
-rw-r--r--pkgs/development/libraries/haskell/vector/0.10.nix15
-rw-r--r--pkgs/development/libraries/haskell/vector/0.9.1.nix (renamed from pkgs/development/libraries/haskell/vector/default.nix)0
-rw-r--r--pkgs/development/libraries/haskell/void/default.nix8
-rw-r--r--pkgs/development/libraries/haskell/vty-ui/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/vty/default.nix19
-rw-r--r--pkgs/development/libraries/haskell/wai-app-static/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/wai-extra/default.nix24
-rw-r--r--pkgs/development/libraries/haskell/wai-handler-launch/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/wai-logger/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/wai-test/default.nix21
-rw-r--r--pkgs/development/libraries/haskell/wai/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/warp/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/wl-pprint-extras/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/wl-pprint-terminfo/default.nix18
-rw-r--r--pkgs/development/libraries/haskell/wl-pprint/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/word8/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/wxHaskell/fix-bogus-pointer-assignment.patch13
-rw-r--r--pkgs/development/libraries/haskell/wxHaskell/wxc.nix2
-rw-r--r--pkgs/development/libraries/haskell/wxHaskell/wxcore.nix3
-rw-r--r--pkgs/development/libraries/haskell/wxHaskell/wxdirect.nix3
-rw-r--r--pkgs/development/libraries/haskell/xdg-basedir/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/xdot/default.nix14
-rw-r--r--pkgs/development/libraries/haskell/xml-conduit/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/xml-hamlet/default.nix15
-rw-r--r--pkgs/development/libraries/haskell/xml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/xmlhtml/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/xss-sanitize/default.nix11
-rw-r--r--pkgs/development/libraries/haskell/yaml/default.nix13
-rw-r--r--pkgs/development/libraries/haskell/yesod-auth/default.nix25
-rw-r--r--pkgs/development/libraries/haskell/yesod-core/default.nix34
-rw-r--r--pkgs/development/libraries/haskell/yesod-default/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/yesod-form/default.nix20
-rw-r--r--pkgs/development/libraries/haskell/yesod-json/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/yesod-persistent/default.nix16
-rw-r--r--pkgs/development/libraries/haskell/yesod-platform/default.nix65
-rw-r--r--pkgs/development/libraries/haskell/yesod-routes/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/yesod-static/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/yesod-test/default.nix27
-rw-r--r--pkgs/development/libraries/haskell/yesod/default.nix25
-rw-r--r--pkgs/development/libraries/haskell/yst/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/zeromq-haskell/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/zeromq3-haskell/default.nix22
-rw-r--r--pkgs/development/libraries/haskell/zip-archive/default.nix12
-rw-r--r--pkgs/development/libraries/haskell/zipper/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zlib-bindings/default.nix7
-rw-r--r--pkgs/development/libraries/haskell/zlib-conduit/default.nix9
-rw-r--r--pkgs/development/libraries/haskell/zlib-enum/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/zlib/0.5.3.3.nix1
-rw-r--r--pkgs/development/libraries/haskell/zlib/0.5.4.0.nix14
-rw-r--r--pkgs/development/libraries/haskell/zlib/0.5.4.1.nix14
-rw-r--r--pkgs/development/libraries/hspell/dicts.nix2
-rw-r--r--pkgs/development/libraries/http_parser/build-shared.patch30
-rw-r--r--pkgs/development/libraries/http_parser/default.nix50
-rw-r--r--pkgs/development/libraries/hunspell/default.nix2
-rw-r--r--pkgs/development/libraries/hwloc/default.nix10
-rw-r--r--pkgs/development/libraries/icu/default.nix21
-rw-r--r--pkgs/development/libraries/ilbc/default.nix2
-rw-r--r--pkgs/development/libraries/imlib2/default.nix2
-rw-r--r--pkgs/development/libraries/indilib/default.nix8
-rw-r--r--pkgs/development/libraries/indilib/link-zlib.patch12
-rw-r--r--pkgs/development/libraries/indilib/udev-dir.patch12
-rw-r--r--pkgs/development/libraries/intel-tbb/default.nix29
-rw-r--r--pkgs/development/libraries/iso-codes/default.nix9
-rw-r--r--pkgs/development/libraries/itk/default.nix2
-rw-r--r--pkgs/development/libraries/jansson/default.nix16
-rw-r--r--pkgs/development/libraries/jasper/default.nix2
-rw-r--r--pkgs/development/libraries/java/rhino/default.nix2
-rw-r--r--pkgs/development/libraries/javascript/jquery-ui/default.nix8
-rw-r--r--pkgs/development/libraries/jbig2dec/default.nix12
-rw-r--r--pkgs/development/libraries/json-glib/default.nix6
-rw-r--r--pkgs/development/libraries/kdevplatform/default.nix8
-rw-r--r--pkgs/development/libraries/kerberos/heimdal.nix8
-rw-r--r--pkgs/development/libraries/kerberos/krb5.nix8
-rw-r--r--pkgs/development/libraries/kerberos/no-md2.patch46
-rw-r--r--pkgs/development/libraries/ldns/default.nix11
-rw-r--r--pkgs/development/libraries/leveldb/default.nix27
-rw-r--r--pkgs/development/libraries/levmar/use-atlas.patch37
-rw-r--r--pkgs/development/libraries/libalkimia/default.nix4
-rw-r--r--pkgs/development/libraries/libarchive/default.nix24
-rw-r--r--pkgs/development/libraries/libassuan/default.nix2
-rw-r--r--pkgs/development/libraries/libbluedevil/default.nix13
-rw-r--r--pkgs/development/libraries/libbluray/default.nix3
-rw-r--r--pkgs/development/libraries/libc++/default.nix28
-rw-r--r--pkgs/development/libraries/libcanberra/default.nix4
-rw-r--r--pkgs/development/libraries/libcdr/default.nix22
-rw-r--r--pkgs/development/libraries/libcello/default.nix16
-rw-r--r--pkgs/development/libraries/libchop/default.nix5
-rw-r--r--pkgs/development/libraries/libchop/gets-undeclared.patch71
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/default.nix6
-rw-r--r--pkgs/development/libraries/libdevil/default.nix2
-rw-r--r--pkgs/development/libraries/libdiscid/default.nix10
-rw-r--r--pkgs/development/libraries/libdmtx/default.nix2
-rw-r--r--pkgs/development/libraries/libdrm/default.nix12
-rw-r--r--pkgs/development/libraries/libdwarf/default.nix27
-rw-r--r--pkgs/development/libraries/libeatmydata/default.nix16
-rw-r--r--pkgs/development/libraries/libee/default.nix16
-rw-r--r--pkgs/development/libraries/libestr/default.nix8
-rw-r--r--pkgs/development/libraries/libev/src-for-default.nix11
-rw-r--r--pkgs/development/libraries/libevent/1.4.nix29
-rw-r--r--pkgs/development/libraries/libevent/default.nix1
-rw-r--r--pkgs/development/libraries/libextractor/default.nix10
-rw-r--r--pkgs/development/libraries/libexttextcat/default.nix18
-rw-r--r--pkgs/development/libraries/libexttextcat/memory-leaks.patch37
-rw-r--r--pkgs/development/libraries/libf2c/default.nix4
-rw-r--r--pkgs/development/libraries/libffi/default.nix4
-rw-r--r--pkgs/development/libraries/libftdi/default.nix4
-rw-r--r--pkgs/development/libraries/libgadu/default.nix6
-rw-r--r--pkgs/development/libraries/libgcrypt/default.nix4
-rw-r--r--pkgs/development/libraries/libgcrypt/git.nix48
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix2
-rw-r--r--pkgs/development/libraries/libgnome-keyring/3.x.nix2
-rw-r--r--pkgs/development/libraries/libgnome-keyring/default.nix2
-rw-r--r--pkgs/development/libraries/libgpg-error/default.nix4
-rw-r--r--pkgs/development/libraries/libgphoto2/2.4.nix30
-rw-r--r--pkgs/development/libraries/libgphoto2/default.nix16
-rw-r--r--pkgs/development/libraries/libgpod/default.nix2
-rw-r--r--pkgs/development/libraries/libgsf/default.nix8
-rw-r--r--pkgs/development/libraries/libgtop/default.nix2
-rw-r--r--pkgs/development/libraries/libgweather/default.nix2
-rw-r--r--pkgs/development/libraries/libharu/default.nix2
-rw-r--r--pkgs/development/libraries/libical/default.nix15
-rw-r--r--pkgs/development/libraries/libical/respect-env-tzdir.patch32
-rw-r--r--pkgs/development/libraries/libicns/default.nix8
-rw-r--r--pkgs/development/libraries/libiconv/default.nix26
-rw-r--r--pkgs/development/libraries/libidn/default.nix4
-rw-r--r--pkgs/development/libraries/libimobiledevice/default.nix2
-rw-r--r--pkgs/development/libraries/libinfinity/default.nix8
-rw-r--r--pkgs/development/libraries/libixp/builder.sh32
-rw-r--r--pkgs/development/libraries/libixp_for_wmii/default.nix2
-rw-r--r--pkgs/development/libraries/libjpeg/default.nix6
-rw-r--r--pkgs/development/libraries/libktorrent/default.nix8
-rw-r--r--pkgs/development/libraries/liblastfm/default.nix2
-rw-r--r--pkgs/development/libraries/liblockfile/default.nix30
-rw-r--r--pkgs/development/libraries/libmad/default.nix2
-rw-r--r--pkgs/development/libraries/libmcrypt/default.nix23
-rw-r--r--pkgs/development/libraries/libmemcached/default.nix18
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--pkgs/development/libraries/libmms/default.nix2
-rw-r--r--pkgs/development/libraries/libmng/default.nix2
-rw-r--r--pkgs/development/libraries/libmnl/default.nix25
-rw-r--r--pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch17
-rw-r--r--pkgs/development/libraries/libmspack/default.nix13
-rw-r--r--pkgs/development/libraries/libnatspec/default.nix10
-rw-r--r--pkgs/development/libraries/libnetfilter_conntrack/default.nix26
-rw-r--r--pkgs/development/libraries/libnfnetlink/default.nix27
-rw-r--r--pkgs/development/libraries/libnice/default.nix6
-rw-r--r--pkgs/development/libraries/libnotify/default.nix31
-rw-r--r--pkgs/development/libraries/libnova/default.nix2
-rw-r--r--pkgs/development/libraries/libogg/default.nix2
-rw-r--r--pkgs/development/libraries/liboil/default.nix11
-rw-r--r--pkgs/development/libraries/liboil/x86_64-cpuid.patch38
-rw-r--r--pkgs/development/libraries/libopensc-dnie/default.nix4
-rw-r--r--pkgs/development/libraries/libopus/default.nix18
-rw-r--r--pkgs/development/libraries/libotr/0001-Fix-pass-opdata-when-sending-message-fragment.patch29
-rw-r--r--pkgs/development/libraries/libotr/3.2.nix11
-rw-r--r--pkgs/development/libraries/libotr/default.nix26
-rw-r--r--pkgs/development/libraries/libp11/default.nix5
-rw-r--r--pkgs/development/libraries/libpcap/default.nix6
-rw-r--r--pkgs/development/libraries/libplist/default.nix2
-rw-r--r--pkgs/development/libraries/libpng/12.nix6
-rw-r--r--pkgs/development/libraries/libpng/default.nix4
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix2
-rw-r--r--pkgs/development/libraries/libraw1394/default.nix4
-rw-r--r--pkgs/development/libraries/librdf/default.nix28
-rw-r--r--pkgs/development/libraries/librdf/raptor2.nix6
-rw-r--r--pkgs/development/libraries/librdf/rasqal.nix10
-rw-r--r--pkgs/development/libraries/librdf/redland.nix6
-rw-r--r--pkgs/development/libraries/libre/default.nix23
-rw-r--r--pkgs/development/libraries/librem/default.nix24
-rw-r--r--pkgs/development/libraries/librsvg/default.nix19
-rw-r--r--pkgs/development/libraries/libshout/default.nix30
-rw-r--r--pkgs/development/libraries/libsoup/default.nix8
-rw-r--r--pkgs/development/libraries/libspectre/default.nix8
-rw-r--r--pkgs/development/libraries/libspotify/default.nix61
-rw-r--r--pkgs/development/libraries/libssh/default.nix15
-rw-r--r--pkgs/development/libraries/libssh2/default.nix4
-rw-r--r--pkgs/development/libraries/libtasn1/default.nix4
-rw-r--r--pkgs/development/libraries/libtheora/default.nix2
-rw-r--r--pkgs/development/libraries/libtiff/default.nix16
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix14
-rw-r--r--pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch143
-rw-r--r--pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch50
-rw-r--r--pkgs/development/libraries/libunique/1.1.6-fix-test.patch26
-rw-r--r--pkgs/development/libraries/libunique/1.1.6-include-terminator.patch37
-rw-r--r--pkgs/development/libraries/libunique/default.nix31
-rw-r--r--pkgs/development/libraries/libusb1/default.nix4
-rw-r--r--pkgs/development/libraries/libva/default.nix15
-rw-r--r--pkgs/development/libraries/libvdpau/default.nix4
-rw-r--r--pkgs/development/libraries/libvirt/default.nix6
-rw-r--r--pkgs/development/libraries/libvisio/default.nix21
-rw-r--r--pkgs/development/libraries/libvncserver/default.nix4
-rw-r--r--pkgs/development/libraries/libvorbis/default.nix2
-rw-r--r--pkgs/development/libraries/libvpx/default.nix6
-rw-r--r--pkgs/development/libraries/libwpd/0.8.nix2
-rw-r--r--pkgs/development/libraries/libwpd/default.nix2
-rw-r--r--pkgs/development/libraries/libwpg/default.nix2
-rw-r--r--pkgs/development/libraries/libxcrypt/default.nix17
-rw-r--r--pkgs/development/libraries/libxcrypt/gcc46.patch18
-rw-r--r--pkgs/development/libraries/libxklavier/default.nix4
-rw-r--r--pkgs/development/libraries/libxml2/default.nix35
-rw-r--r--pkgs/development/libraries/libxml2/pthread-once-init.patch35
-rw-r--r--pkgs/development/libraries/libxml2/setup-hook.sh6
-rw-r--r--pkgs/development/libraries/libxslt/default.nix31
-rw-r--r--pkgs/development/libraries/libxtc_dxtn/default.nix15
-rw-r--r--pkgs/development/libraries/libyaml/default.nix2
-rw-r--r--pkgs/development/libraries/lirc/default.nix6
-rw-r--r--pkgs/development/libraries/log4cpp/default.nix16
-rw-r--r--pkgs/development/libraries/loudmouth/default.nix24
-rw-r--r--pkgs/development/libraries/loudmouth/glib-2.32.patch13
-rw-r--r--pkgs/development/libraries/mdds/default.nix16
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix6
-rw-r--r--pkgs/development/libraries/mesa/default.nix16
-rw-r--r--pkgs/development/libraries/mesa/swrast-settexbuffer.patch24
-rw-r--r--pkgs/development/libraries/mlt/default.nix16
-rw-r--r--pkgs/development/libraries/muparser/default.nix10
-rw-r--r--pkgs/development/libraries/mygui/default.nix10
-rw-r--r--pkgs/development/libraries/mythes/default.nix19
-rw-r--r--pkgs/development/libraries/ncbi/default.nix2
-rw-r--r--pkgs/development/libraries/ncurses/default.nix2
-rw-r--r--pkgs/development/libraries/neon/0.26.nix33
-rw-r--r--pkgs/development/libraries/neon/0.28.nix37
-rw-r--r--pkgs/development/libraries/neon/default.nix (renamed from pkgs/development/libraries/neon/0.29.nix)0
-rw-r--r--pkgs/development/libraries/nettle/default.nix14
-rw-r--r--pkgs/development/libraries/npth/default.nix15
-rw-r--r--pkgs/development/libraries/nspr/default.nix8
-rw-r--r--pkgs/development/libraries/nss/default.nix38
-rw-r--r--pkgs/development/libraries/nss/nss-3.14.1-gentoo-fixups-r1.patch (renamed from pkgs/development/libraries/nss/nss-3.12.5-gentoo-fixups.diff)62
-rw-r--r--pkgs/development/libraries/nss/sync-up-with-upstream-softokn-changes.patch406
-rw-r--r--pkgs/development/libraries/ntrack/default.nix2
-rw-r--r--pkgs/development/libraries/ogre/default.nix6
-rw-r--r--pkgs/development/libraries/ogrepaged/default.nix2
-rw-r--r--pkgs/development/libraries/oniguruma/default.nix16
-rw-r--r--pkgs/development/libraries/openal-soft/default.nix9
-rw-r--r--pkgs/development/libraries/openbabel/default.nix2
-rw-r--r--pkgs/development/libraries/opencascade/6.5.nix41
-rw-r--r--pkgs/development/libraries/opencascade/default.nix26
-rw-r--r--pkgs/development/libraries/opencascade/oce.nix26
-rw-r--r--pkgs/development/libraries/opencolorio/default.nix21
-rw-r--r--pkgs/development/libraries/opencv/changeset_r3190.diff20
-rw-r--r--pkgs/development/libraries/opencv/default.nix13
-rw-r--r--pkgs/development/libraries/opencv/default.nix.edited27
-rw-r--r--pkgs/development/libraries/openexr/default.nix2
-rw-r--r--pkgs/development/libraries/openjpeg/default.nix12
-rw-r--r--pkgs/development/libraries/openldap/default.nix11
-rw-r--r--pkgs/development/libraries/openmotif/default.nix32
-rw-r--r--pkgs/development/libraries/openmpi/default.nix11
-rw-r--r--pkgs/development/libraries/openscenegraph/default.nix16
-rw-r--r--pkgs/development/libraries/openscenegraph/xine.patch18
-rw-r--r--pkgs/development/libraries/openssl/darwin-arch.patch30
-rw-r--r--pkgs/development/libraries/openssl/default.nix19
-rw-r--r--pkgs/development/libraries/pango/1.30.x.nix (renamed from pkgs/development/libraries/pango/1.29.x.nix)16
-rw-r--r--pkgs/development/libraries/pangomm/2.28.x.nix2
-rw-r--r--pkgs/development/libraries/pcl/default.nix22
-rw-r--r--pkgs/development/libraries/pcre/8.30.nix38
-rw-r--r--pkgs/development/libraries/pcre/default.nix4
-rw-r--r--pkgs/development/libraries/pdf2htmlex/default.nix27
-rw-r--r--pkgs/development/libraries/pdf2htmlex/pdf2xml.patch48
-rw-r--r--pkgs/development/libraries/pgen/default.nix2
-rw-r--r--pkgs/development/libraries/phat/default.nix21
-rw-r--r--pkgs/development/libraries/phonon-backend-gstreamer/default.nix6
-rw-r--r--pkgs/development/libraries/phonon-backend-vlc/default.nix2
-rw-r--r--pkgs/development/libraries/phonon/default.nix2
-rw-r--r--pkgs/development/libraries/php-xcache/default.nix6
-rw-r--r--pkgs/development/libraries/physfs/default.nix10
-rw-r--r--pkgs/development/libraries/pkcs11helper/default.nix24
-rw-r--r--pkgs/development/libraries/plib/default.nix2
-rw-r--r--pkgs/development/libraries/podofo/default.nix14
-rw-r--r--pkgs/development/libraries/polkit-qt-1/default.nix2
-rw-r--r--pkgs/development/libraries/polkit/default.nix2
-rw-r--r--pkgs/development/libraries/poppler/default.nix6
-rw-r--r--pkgs/development/libraries/ppl/default.nix2
-rw-r--r--pkgs/development/libraries/prison/default.nix2
-rw-r--r--pkgs/development/libraries/protobufc/default.nix22
-rw-r--r--pkgs/development/libraries/pt-support/default.nix2
-rw-r--r--pkgs/development/libraries/ptable-support/default.nix2
-rw-r--r--pkgs/development/libraries/pth/default.nix4
-rw-r--r--pkgs/development/libraries/qca2/default.nix2
-rw-r--r--pkgs/development/libraries/qca2/ossl.nix2
-rw-r--r--pkgs/development/libraries/qhull/default.nix2
-rw-r--r--pkgs/development/libraries/qimageblitz/default.nix2
-rw-r--r--pkgs/development/libraries/qjson/default.nix6
-rw-r--r--pkgs/development/libraries/qoauth/default.nix25
-rw-r--r--pkgs/development/libraries/qt-3/default.nix2
-rw-r--r--pkgs/development/libraries/qt-4.x/4.7/default.nix114
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix67
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff63
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff14
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch12
-rw-r--r--pkgs/development/libraries/rstore-support/default.nix2
-rw-r--r--pkgs/development/libraries/science/biology/bioconductor/bioconductor.nix43
-rw-r--r--pkgs/development/libraries/science/biology/biolib/default.nix2
-rw-r--r--pkgs/development/libraries/science/math/atlas/default.nix69
-rw-r--r--pkgs/development/libraries/science/math/atlas/disable-timing-accuracy-check.patch22
-rw-r--r--pkgs/development/libraries/science/math/blas/default.nix12
-rw-r--r--pkgs/development/libraries/science/math/liblapack/default.nix2
-rw-r--r--pkgs/development/libraries/sdf-support/default.nix2
-rw-r--r--pkgs/development/libraries/serd/default.nix4
-rw-r--r--pkgs/development/libraries/sglr/default.nix2
-rw-r--r--pkgs/development/libraries/simgear/default.nix22
-rw-r--r--pkgs/development/libraries/smpeg/default.nix4
-rw-r--r--pkgs/development/libraries/snappy/default.nix23
-rw-r--r--pkgs/development/libraries/sodium/default.nix28
-rw-r--r--pkgs/development/libraries/sodium/default.upstream1
-rw-r--r--pkgs/development/libraries/sofia-sip/default.nix2
-rw-r--r--pkgs/development/libraries/soprano/default.nix6
-rw-r--r--pkgs/development/libraries/soqt/default.nix4
-rw-r--r--pkgs/development/libraries/sord/default.nix4
-rw-r--r--pkgs/development/libraries/spandsp/default.nix18
-rw-r--r--pkgs/development/libraries/spice-protocol/default.nix19
-rw-r--r--pkgs/development/libraries/spice/default.nix47
-rw-r--r--pkgs/development/libraries/sqlite/3.7.14.nix (renamed from pkgs/development/libraries/sqlite/default.nix)8
-rw-r--r--pkgs/development/libraries/sqlite/3.7.16.nix (renamed from pkgs/development/libraries/sqlite/3.6.x.nix)13
-rw-r--r--pkgs/development/libraries/sqlite/3.7.9-full.nix (renamed from pkgs/development/libraries/sqlite/full.nix)2
-rw-r--r--pkgs/development/libraries/srtp/default.nix8
-rw-r--r--pkgs/development/libraries/stlport/default.nix23
-rw-r--r--pkgs/development/libraries/strigi/default.nix6
-rw-r--r--pkgs/development/libraries/taglib-extras/default.nix2
-rw-r--r--pkgs/development/libraries/taglib/default.nix10
-rw-r--r--pkgs/development/libraries/taglib/live.nix23
-rw-r--r--pkgs/development/libraries/tclgpg/default.nix37
-rw-r--r--pkgs/development/libraries/tcllib/default.nix12
-rw-r--r--pkgs/development/libraries/tcltls/default.nix12
-rw-r--r--pkgs/development/libraries/tcp-wrappers/default.nix74
-rw-r--r--pkgs/development/libraries/tcp-wrappers/have-strerror.patch20
-rw-r--r--pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch27
-rw-r--r--pkgs/development/libraries/telepathy/farstream/default.nix8
-rw-r--r--pkgs/development/libraries/telepathy/glib/default.nix6
-rw-r--r--pkgs/development/libraries/telepathy/qt/default.nix10
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix4
-rw-r--r--pkgs/development/libraries/tide-support/default.nix2
-rw-r--r--pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch13
-rwxr-xr-xpkgs/development/libraries/tinyxml/2.6.2-entity.patch64
-rw-r--r--pkgs/development/libraries/tinyxml/2.6.2.nix65
-rw-r--r--pkgs/development/libraries/tokyo-tyrant/default.nix2
-rw-r--r--pkgs/development/libraries/toolbuslib/default.nix2
-rw-r--r--pkgs/development/libraries/tremor/default.nix2
-rw-r--r--pkgs/development/libraries/tsocks/default.nix22
-rw-r--r--pkgs/development/libraries/ustr/default.nix5
-rw-r--r--pkgs/development/libraries/ustr/va_args.patch23
-rw-r--r--pkgs/development/libraries/v8/default.nix23
-rw-r--r--pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch27
-rw-r--r--pkgs/development/libraries/vaapi-intel/default.nix24
-rw-r--r--pkgs/development/libraries/vaapi-vdpau/default.nix22
-rw-r--r--pkgs/development/libraries/vcdimager/default.nix2
-rw-r--r--pkgs/development/libraries/vmime/default.nix11
-rw-r--r--pkgs/development/libraries/vtk/default.nix34
-rw-r--r--pkgs/development/libraries/vxl/default.nix5
-rw-r--r--pkgs/development/libraries/wayland/default.nix23
-rw-r--r--pkgs/development/libraries/webkit/bison26.patch515
-rw-r--r--pkgs/development/libraries/webkit/default.nix55
-rw-r--r--pkgs/development/libraries/webkit/gtk2.nix52
-rw-r--r--pkgs/development/libraries/webkit/src-for-default.nix11
-rw-r--r--pkgs/development/libraries/webkit/src-for-gtk2.nix11
-rw-r--r--pkgs/development/libraries/wildmidi/default.nix38
-rw-r--r--pkgs/development/libraries/wxGTK-2.8/default.nix2
-rw-r--r--pkgs/development/libraries/wxGTK-2.9/default.nix11
-rw-r--r--pkgs/development/libraries/x264/default.nix6
-rw-r--r--pkgs/development/libraries/xine-lib/default.nix2
-rw-r--r--pkgs/development/libraries/xmlsec/default.nix24
-rw-r--r--pkgs/development/libraries/zeromq/2.x.nix (renamed from pkgs/development/libraries/zeromq/default.nix)0
-rw-r--r--pkgs/development/libraries/zeromq/3.x.nix17
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
-rw-r--r--pkgs/development/misc/avr-gcc-with-avr-libc/default.nix16
-rw-r--r--pkgs/development/mobile/androidenv/addon.xml950
-rw-r--r--pkgs/development/mobile/androidenv/addons.nix198
-rw-r--r--pkgs/development/mobile/androidenv/androidsdk.nix194
-rw-r--r--pkgs/development/mobile/androidenv/build-app.nix45
-rw-r--r--pkgs/development/mobile/androidenv/default.nix62
-rw-r--r--pkgs/development/mobile/androidenv/emulate-app.nix87
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-addons.sh3
-rw-r--r--pkgs/development/mobile/androidenv/generate-addons.xsl38
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-platforms.sh4
-rw-r--r--pkgs/development/mobile/androidenv/generate-platforms.xsl38
-rwxr-xr-xpkgs/development/mobile/androidenv/generate-sysimages.sh3
-rw-r--r--pkgs/development/mobile/androidenv/generate-sysimages.xsl36
-rw-r--r--pkgs/development/mobile/androidenv/platform-tools.nix41
-rw-r--r--pkgs/development/mobile/androidenv/platforms-linux.nix210
-rw-r--r--pkgs/development/mobile/androidenv/platforms-macosx.nix210
-rw-r--r--pkgs/development/mobile/androidenv/repository-7.xml1030
-rw-r--r--pkgs/development/mobile/androidenv/support.nix17
-rw-r--r--pkgs/development/mobile/androidenv/sysimages.nix50
-rw-r--r--pkgs/development/mobile/titaniumenv/build-app.nix130
-rw-r--r--pkgs/development/mobile/titaniumenv/default.nix26
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/default.nix42
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix10
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix25
-rw-r--r--pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix9
-rw-r--r--pkgs/development/mobile/titaniumenv/fixnativelibs.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/fixso.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/fixtiprofiler.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/fixtiverify.sed1
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix60
-rw-r--r--pkgs/development/mobile/titaniumenv/titaniumsdk.nix61
-rw-r--r--pkgs/development/mobile/xcodeenv/build-app.nix98
-rw-r--r--pkgs/development/mobile/xcodeenv/default.nix15
-rw-r--r--pkgs/development/mobile/xcodeenv/simulate-app.nix20
-rw-r--r--pkgs/development/mobile/xcodeenv/xcodewrapper.nix21
-rw-r--r--pkgs/development/ocaml-modules/extlib/default.nix9
-rw-r--r--pkgs/development/ocaml-modules/extlib/hashtable-ocaml4-compat.patch12
-rw-r--r--pkgs/development/ocaml-modules/lablgtkmathview/configure.patch14
-rw-r--r--pkgs/development/ocaml-modules/ocamlnet/default.nix7
-rw-r--r--pkgs/development/ocaml-modules/ounit/default.nix8
-rw-r--r--pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix15
-rw-r--r--pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix8
-rw-r--r--pkgs/development/perl-modules/DBD-Pg/default.nix11
-rw-r--r--pkgs/development/perl-modules/DBD-SQLite/default.nix9
-rw-r--r--pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch12
-rw-r--r--pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch37
-rw-r--r--pkgs/development/perl-modules/generic/builder.sh4
-rw-r--r--pkgs/development/perl-modules/module-pluggable.patch92
-rw-r--r--pkgs/development/perl-modules/starman-dont-change-name.patch23
-rw-r--r--pkgs/development/perl-modules/template-toolkit-nix-store.patch23
-rw-r--r--pkgs/development/python-modules/dbus/default.nix14
-rw-r--r--pkgs/development/python-modules/generic/default.nix60
-rw-r--r--pkgs/development/python-modules/generic/wrap.sh18
-rw-r--r--pkgs/development/python-modules/gyp/no-darwin-cflags.patch53
-rw-r--r--pkgs/development/python-modules/gyp/no-xcode.patch66
-rw-r--r--pkgs/development/python-modules/offline-distutils/default.nix21
-rw-r--r--pkgs/development/python-modules/pil/default.nix8
-rw-r--r--pkgs/development/python-modules/pycairo/default.nix4
-rw-r--r--pkgs/development/python-modules/pycrypto/2.5.nix29
-rw-r--r--pkgs/development/python-modules/pycrypto/default.nix15
-rw-r--r--pkgs/development/python-modules/pygobject/3.nix19
-rw-r--r--pkgs/development/python-modules/pygobject/default.nix20
-rw-r--r--pkgs/development/python-modules/pygtk/default.nix43
-rw-r--r--pkgs/development/python-modules/pyopenssl/default.nix6
-rw-r--r--pkgs/development/python-modules/pyqt/default.nix6
-rw-r--r--pkgs/development/python-modules/python-gudev/default.nix25
-rw-r--r--pkgs/development/python-modules/python-sip/default.nix9
-rw-r--r--pkgs/development/python-modules/recursive-pth-loader/default.nix20
-rw-r--r--pkgs/development/python-modules/recursive-pth-loader/sitecustomize.py46
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix7
-rw-r--r--pkgs/development/python-modules/setuptools/site.nix16
-rw-r--r--pkgs/development/python-modules/virtualenv-change-prefix.patch27
-rw-r--r--pkgs/development/python-modules/zope/default.nix15
-rw-r--r--pkgs/development/python-modules/zope/zope_python-2.4.4.patch12
-rw-r--r--pkgs/development/python-modules/zope/zope_python-readline.patch12
-rw-r--r--pkgs/development/qtcreator/default.nix44
-rw-r--r--pkgs/development/tools/analysis/radare/lua.patch12
-rw-r--r--pkgs/development/tools/analysis/smatch/default.nix33
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix8
-rw-r--r--pkgs/development/tools/analysis/valgrind/glibc-2.17.patch78
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix12
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/core-builder.sh51
-rw-r--r--pkgs/development/tools/build-managers/buildbot-slave/default.nix66
-rw-r--r--pkgs/development/tools/build-managers/buildbot/default.nix50
-rw-r--r--pkgs/development/tools/build-managers/cmake/default.nix4
-rwxr-xr-xpkgs/development/tools/build-managers/cmake/setup-hook.sh4
-rw-r--r--pkgs/development/tools/build-managers/gnumake/3.81.nix1
-rw-r--r--pkgs/development/tools/build-managers/gnumake/MAKEFLAGS-reexec.patch14
-rw-r--r--pkgs/development/tools/build-managers/gnumake/archives-many-objs.patch48
-rw-r--r--pkgs/development/tools/build-managers/gnumake/construct-command-line.patch71
-rw-r--r--pkgs/development/tools/build-managers/gnumake/copy-on-expand.patch58
-rw-r--r--pkgs/development/tools/build-managers/gnumake/darwin-library_search-dylib.patch17
-rw-r--r--pkgs/development/tools/build-managers/gnumake/default.nix16
-rw-r--r--pkgs/development/tools/build-managers/gnumake/glob-speedup.patch104
-rw-r--r--pkgs/development/tools/build-managers/gnumake/impure-dirs.patch12
-rw-r--r--pkgs/development/tools/build-managers/gnumake/intermediate-parallel.patch46
-rw-r--r--pkgs/development/tools/build-managers/gnumake/log-3.81.patch24
-rw-r--r--pkgs/development/tools/build-managers/gnumake/log.patch24
-rw-r--r--pkgs/development/tools/build-managers/gnumake/long-command-line.patch54
-rw-r--r--pkgs/development/tools/build-managers/gnumake/memory-corruption.patch37
-rw-r--r--pkgs/development/tools/build-managers/gnumake/oneshell.patch24
-rw-r--r--pkgs/development/tools/build-managers/gnumake/parallel-remake.patch39
-rw-r--r--pkgs/development/tools/build-managers/leiningen/builder.sh2
-rw-r--r--pkgs/development/tools/build-managers/leiningen/default.nix22
-rw-r--r--pkgs/development/tools/build-managers/leiningen/lein-rlwrap.patch45
-rw-r--r--pkgs/development/tools/build-managers/leiningen/lein.patch35
-rw-r--r--pkgs/development/tools/build-managers/leiningen/lein_2.1.2.patch4
-rw-r--r--pkgs/development/tools/build-managers/ninja/default.nix42
-rw-r--r--pkgs/development/tools/build-managers/sbt/default.nix27
-rw-r--r--pkgs/development/tools/casperjs/default.nix46
-rw-r--r--pkgs/development/tools/documentation/docutils/default.nix4
-rw-r--r--pkgs/development/tools/documentation/doxygen/1.7.nix2
-rw-r--r--pkgs/development/tools/documentation/doxygen/default.nix6
-rw-r--r--pkgs/development/tools/documentation/gnome-doc-utils/default.nix2
-rw-r--r--pkgs/development/tools/documentation/haddock/2.10.0.nix2
-rw-r--r--pkgs/development/tools/documentation/haddock/2.11.0.nix20
-rw-r--r--pkgs/development/tools/documentation/haddock/2.12.0.nix20
-rw-r--r--pkgs/development/tools/documentation/haddock/2.13.2.nix20
-rw-r--r--pkgs/development/tools/documentation/haddock/2.4.2.nix1
-rw-r--r--pkgs/development/tools/documentation/haddock/2.7.2.nix6
-rw-r--r--pkgs/development/tools/documentation/haddock/2.9.2.nix2
-rw-r--r--pkgs/development/tools/documentation/haddock/2.9.4.nix5
-rw-r--r--pkgs/development/tools/documentation/xdoc/builder.sh5
-rw-r--r--pkgs/development/tools/documentation/xdoc/default.nix13
-rw-r--r--pkgs/development/tools/gnulib/default.nix21
-rw-r--r--pkgs/development/tools/haskell/BNFC-meta/default.nix7
-rw-r--r--pkgs/development/tools/haskell/BNFC/default.nix12
-rw-r--r--pkgs/development/tools/haskell/SourceGraph/default.nix4
-rw-r--r--pkgs/development/tools/haskell/alex-meta/default.nix5
-rw-r--r--pkgs/development/tools/haskell/cabal-dev/default.nix21
-rw-r--r--pkgs/development/tools/haskell/cabal2ghci/default.nix21
-rw-r--r--pkgs/development/tools/haskell/cabal2nix/default.nix8
-rw-r--r--pkgs/development/tools/haskell/happy-meta/default.nix4
-rw-r--r--pkgs/development/tools/haskell/haskdogs/default.nix4
-rw-r--r--pkgs/development/tools/haskell/hlint/default.nix6
-rw-r--r--pkgs/development/tools/haskell/hslogger/default.nix4
-rw-r--r--pkgs/development/tools/haskell/jailbreak-cabal/default.nix16
-rw-r--r--pkgs/development/tools/haskell/keter/default.nix28
-rw-r--r--pkgs/development/tools/haskell/packunused/default.nix16
-rw-r--r--pkgs/development/tools/haskell/splot/default.nix21
-rw-r--r--pkgs/development/tools/haskell/tar/0.4.0.0.nix14
-rw-r--r--pkgs/development/tools/haskell/threadscope/default.nix4
-rw-r--r--pkgs/development/tools/haskell/timeplot/default.nix23
-rw-r--r--pkgs/development/tools/haskell/uuagc/cabal.nix4
-rw-r--r--pkgs/development/tools/haskell/uuagc/default.nix12
-rw-r--r--pkgs/development/tools/jq/default.nix28
-rw-r--r--pkgs/development/tools/jq/default.upstream1
-rw-r--r--pkgs/development/tools/misc/autogen/default.nix12
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.11.x.nix4
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.12.x.nix6
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.13.x.nix40
-rw-r--r--pkgs/development/tools/misc/automake/default.nix1
-rw-r--r--pkgs/development/tools/misc/binutils/default.nix11
-rw-r--r--pkgs/development/tools/misc/binutils/dtneeded.patch12
-rw-r--r--pkgs/development/tools/misc/cflow/default.nix3
-rw-r--r--pkgs/development/tools/misc/coccinelle/default.nix19
-rw-r--r--pkgs/development/tools/misc/cpphs/default.nix4
-rw-r--r--pkgs/development/tools/misc/cppi/default.nix4
-rw-r--r--pkgs/development/tools/misc/cscope/default.nix4
-rw-r--r--pkgs/development/tools/misc/ctags/default.nix27
-rw-r--r--pkgs/development/tools/misc/distcc/default.nix103
-rw-r--r--pkgs/development/tools/misc/distcc/masq.nix41
-rw-r--r--pkgs/development/tools/misc/elfutils/default.nix10
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix14
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix2
-rw-r--r--pkgs/development/tools/misc/gnum4/no-gets.patch26
-rw-r--r--pkgs/development/tools/misc/gob2/default.nix9
-rw-r--r--pkgs/development/tools/misc/intltool/default.nix30
-rw-r--r--pkgs/development/tools/misc/intltool/default.upstream2
-rw-r--r--pkgs/development/tools/misc/itstool/default.nix6
-rw-r--r--pkgs/development/tools/misc/libtool/libtool2.nix2
-rw-r--r--pkgs/development/tools/misc/lsof/default.nix6
-rw-r--r--pkgs/development/tools/misc/luarocks/default.nix29
-rw-r--r--pkgs/development/tools/misc/luarocks/default.upstream1
-rw-r--r--pkgs/development/tools/misc/openocd/default.nix45
-rw-r--r--pkgs/development/tools/misc/premake/3.nix26
-rw-r--r--pkgs/development/tools/misc/premake/default.nix16
-rw-r--r--pkgs/development/tools/misc/saleae-logic/default.nix91
-rw-r--r--pkgs/development/tools/misc/saleae-logic/preload.c114
-rw-r--r--pkgs/development/tools/misc/stlink/default.nix27
-rw-r--r--pkgs/development/tools/misc/strace/default.nix2
-rw-r--r--pkgs/development/tools/misc/sysbench/default.nix19
-rw-r--r--pkgs/development/tools/misc/tcptrack/default.nix22
-rw-r--r--pkgs/development/tools/misc/texinfo/4.13a.nix (renamed from pkgs/development/tools/misc/texinfo/default.nix)2
-rw-r--r--pkgs/development/tools/misc/texinfo/5.1.nix41
-rw-r--r--pkgs/development/tools/misc/xxdiff/default.nix13
-rw-r--r--pkgs/development/tools/neoload/default.nix93
-rw-r--r--pkgs/development/tools/node/npm2nix/default.nix26
-rw-r--r--pkgs/development/tools/ocaml/camlp5/default.nix20
-rw-r--r--pkgs/development/tools/ocaml/findlib/default.nix3
-rw-r--r--pkgs/development/tools/ocaml/findlib/install_topfind.patch12
-rw-r--r--pkgs/development/tools/ocaml/opam/default.nix60
-rw-r--r--pkgs/development/tools/parsing/Ebnf2ps/default.nix9
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.1.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.2.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.3.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/2.3.5.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/3.0.1.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/3.0.2.nix1
-rw-r--r--pkgs/development/tools/parsing/alex/3.0.5.nix19
-rw-r--r--pkgs/development/tools/parsing/bison/bison-1.875.nix13
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.3.nix38
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.4.nix40
-rw-r--r--pkgs/development/tools/parsing/bison/bison-2.5.nix44
-rw-r--r--pkgs/development/tools/parsing/bison/default.nix (renamed from pkgs/development/tools/parsing/bison/bison-2.6.nix)6
-rw-r--r--pkgs/development/tools/parsing/flex/flex-2.5.35.nix2
-rw-r--r--pkgs/development/tools/parsing/happy/1.18.10.nix18
-rw-r--r--pkgs/development/tools/parsing/re2c/default.nix13
-rw-r--r--pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.5.1.nix11
-rw-r--r--pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.6.nix11
-rw-r--r--pkgs/development/tools/phantomjs/default.nix63
-rw-r--r--pkgs/development/tools/profiling/oprofile/default.nix7
-rw-r--r--pkgs/development/tools/profiling/sysprof/default.nix34
-rw-r--r--pkgs/development/tools/pydb/default.nix2
-rw-r--r--pkgs/development/tools/selenium/chromedriver/default.nix37
-rw-r--r--pkgs/development/web/nodejs/build-node-package.nix32
-rw-r--r--pkgs/development/web/nodejs/default.nix64
-rw-r--r--pkgs/development/web/nodejs/no-arch-flag.patch21
-rw-r--r--pkgs/development/web/nodejs/no-xcode.patch78
-rw-r--r--pkgs/development/web/nodejs/setup-hook.sh5
-rw-r--r--pkgs/development/web/plone/4.1.6.nix5141
-rw-r--r--pkgs/development/web/plone/4.2.5.nix5394
-rw-r--r--pkgs/development/web/plone/4.3.0.nix5417
-rw-r--r--pkgs/games/LambdaHack/default.nix14
-rw-r--r--pkgs/games/alienarena/default.nix7
-rw-r--r--pkgs/games/andyetitmoves/default.nix2
-rw-r--r--pkgs/games/anki/default.nix68
-rw-r--r--pkgs/games/blobby/default.nix6
-rw-r--r--pkgs/games/bsdgames/default.nix11
-rw-r--r--pkgs/games/d1x-rebirth/default.nix23
-rw-r--r--pkgs/games/d2x-rebirth/default.nix23
-rw-r--r--pkgs/games/dhewm3/default.nix33
-rw-r--r--pkgs/games/eduke32/default.nix10
-rw-r--r--pkgs/games/exult/snapshot.nix44
-rw-r--r--pkgs/games/flightgear/default.nix20
-rw-r--r--pkgs/games/freeciv/default.nix2
-rw-r--r--pkgs/games/freedink/default.nix44
-rw-r--r--pkgs/games/fsg/default.nix5
-rw-r--r--pkgs/games/gnuchess/default.nix49
-rw-r--r--pkgs/games/gnuchess/default.upstream1
-rw-r--r--pkgs/games/gtypist/default.nix2
-rw-r--r--pkgs/games/lincity/ng.nix35
-rw-r--r--pkgs/games/lincity/ng.upstream5
-rw-r--r--pkgs/games/minecraft/default.nix8
-rw-r--r--pkgs/games/minetest/default.nix40
-rw-r--r--pkgs/games/naev/default.nix4
-rw-r--r--pkgs/games/oilrush/default.nix9
-rw-r--r--pkgs/games/openlierox/default.nix81
-rw-r--r--pkgs/games/openttd/default.nix32
-rw-r--r--pkgs/games/pingus/default.nix29
-rw-r--r--pkgs/games/pingus/default.upstream1
-rw-r--r--pkgs/games/prboom/default.nix2
-rw-r--r--pkgs/games/rili/default.nix31
-rw-r--r--pkgs/games/rili/moderinze_cpp.patch391
-rw-r--r--pkgs/games/scid/default.nix55
-rw-r--r--pkgs/games/scorched3d/default.nix2
-rw-r--r--pkgs/games/sgt-puzzles/default.nix5
-rw-r--r--pkgs/games/simutrans/default.nix138
-rw-r--r--pkgs/games/six/default.nix35
-rw-r--r--pkgs/games/six/gcc43-includes.patch38
-rw-r--r--pkgs/games/speed-dreams/default.nix2
-rw-r--r--pkgs/games/spring/default.nix6
-rw-r--r--pkgs/games/spring/springlobby.nix8
-rw-r--r--pkgs/games/stuntrally/default.nix32
-rw-r--r--pkgs/games/super-tux-kart/default.nix23
-rw-r--r--pkgs/games/the-butterfly-effect/default.nix2
-rw-r--r--pkgs/games/torcs/default.nix4
-rw-r--r--pkgs/games/ufoai/default.nix54
-rw-r--r--pkgs/games/unvanquished/default.nix68
-rw-r--r--pkgs/games/uqm/3dovideo.nix64
-rw-r--r--pkgs/games/uqm/default.nix89
-rw-r--r--pkgs/games/urbanterror/default.nix69
-rw-r--r--pkgs/games/urbanterror/l_script.patch21
-rw-r--r--pkgs/games/vdrift/default.nix14
-rw-r--r--pkgs/games/vessel/default.nix84
-rw-r--r--pkgs/games/vessel/isatty.c6
-rw-r--r--pkgs/games/warsow/default.nix40
-rw-r--r--pkgs/games/wesnoth/default.nix4
-rw-r--r--pkgs/games/widelands/boost_and_cmake_die_die_die.patch11
-rw-r--r--pkgs/games/widelands/default.nix21
-rw-r--r--pkgs/games/worldofgoo/default.nix83
-rw-r--r--pkgs/games/xboard/default.nix50
-rw-r--r--pkgs/games/xboard/default.upstream1
-rw-r--r--pkgs/games/xboard/src-for-default.nix9
-rw-r--r--pkgs/games/xboard/src-info-for-default.nix4
-rw-r--r--pkgs/games/xmoto/default.nix4
-rw-r--r--pkgs/games/xmoto/r3402.patch26
-rw-r--r--pkgs/games/xmoto/src-for-default.nix8
-rw-r--r--pkgs/games/xonotic/default.nix16
-rw-r--r--pkgs/games/xsokoban/default.nix5
-rw-r--r--pkgs/games/zdoom/default.nix18
-rw-r--r--pkgs/games/zoom/default.nix6
-rw-r--r--pkgs/lib/attrsets.nix53
-rw-r--r--pkgs/lib/customisation.nix38
-rw-r--r--pkgs/lib/debug.nix2
-rw-r--r--pkgs/lib/licenses.nix79
-rw-r--r--pkgs/lib/lists.nix10
-rw-r--r--pkgs/lib/maintainers.nix13
-rw-r--r--pkgs/lib/meta.nix2
-rw-r--r--pkgs/lib/misc.nix59
-rw-r--r--pkgs/lib/modules.nix36
-rw-r--r--pkgs/lib/options.nix21
-rw-r--r--pkgs/lib/platforms.nix7
-rw-r--r--pkgs/lib/properties.nix98
-rw-r--r--pkgs/lib/strings.nix21
-rw-r--r--pkgs/lib/tests.nix12
-rw-r--r--pkgs/lib/trivial.nix13
-rw-r--r--pkgs/lib/types.nix24
-rw-r--r--pkgs/misc/cups/default.nix10
-rw-r--r--pkgs/misc/cups/drivers/samsung/builder.sh35
-rw-r--r--pkgs/misc/cups/drivers/samsung/default.nix35
-rw-r--r--pkgs/misc/drivers/foomatic-filters/default.nix8
-rw-r--r--pkgs/misc/drivers/gutenprint/bin.nix3
-rw-r--r--pkgs/misc/drivers/hplip/default.nix30
-rw-r--r--pkgs/misc/emulators/dlx/default.nix28
-rw-r--r--pkgs/misc/emulators/hatari/default.nix22
-rw-r--r--pkgs/misc/emulators/mupen64plus/1.5.nix33
-rw-r--r--pkgs/misc/emulators/wine/build_winetricks.sh17
-rw-r--r--pkgs/misc/emulators/wine/default.nix16
-rw-r--r--pkgs/misc/emulators/wine/default.upstream8
-rw-r--r--pkgs/misc/emulators/wine/wine-warcraft.nix49
-rw-r--r--pkgs/misc/emulators/wine/winetricks.nix29
-rw-r--r--pkgs/misc/emulators/wine/winetricks.patch21
-rw-r--r--pkgs/misc/emulators/wxmupen64plus/default.nix28
-rw-r--r--pkgs/misc/ghostscript/default.nix16
-rw-r--r--pkgs/misc/ghostscript/libpng-1.5.patch198
-rw-r--r--pkgs/misc/jackaudio/default.nix15
-rw-r--r--pkgs/misc/lilypond/default.nix14
-rw-r--r--pkgs/misc/maven/3.0.nix15
-rw-r--r--pkgs/misc/maven/default.nix6
-rw-r--r--pkgs/misc/maven/maven-1.0.nix16
-rw-r--r--pkgs/misc/misc.nix4
-rw-r--r--pkgs/misc/my-env/default.nix20
-rw-r--r--pkgs/misc/my-env/loadenv.sh3
-rw-r--r--pkgs/misc/rosegarden/default.nix59
-rw-r--r--pkgs/misc/sane-backends/default.nix33
-rw-r--r--pkgs/misc/sane-backends/snapshot.nix33
-rw-r--r--pkgs/misc/sane-front/default.nix17
-rw-r--r--pkgs/misc/screensavers/rss-glx/builder.sh31
-rw-r--r--pkgs/misc/screensavers/rss-glx/default.nix2
-rw-r--r--pkgs/misc/screensavers/xscreensaver/default.nix6
-rw-r--r--pkgs/misc/solfege/default.nix44
-rw-r--r--pkgs/misc/source-and-tags/default.nix4
-rw-r--r--pkgs/misc/themes/gtk2/oxygen-gtk/default.nix8
-rw-r--r--pkgs/misc/uboot/default.nix17
-rw-r--r--pkgs/misc/uboot/guruplug.nix2
-rw-r--r--pkgs/misc/uboot/sheevaplug-config.patch57
-rw-r--r--pkgs/misc/uboot/sheevaplug-sdio.patch1091
-rw-r--r--pkgs/misc/uboot/sheevaplug.nix2
-rw-r--r--pkgs/os-specific/darwin/native-x11-and-opengl/default.nix12
-rw-r--r--pkgs/os-specific/gnu/default.nix12
-rw-r--r--pkgs/os-specific/gnu/libpthread/default.nix2
-rw-r--r--pkgs/os-specific/gnu/mach/default.nix2
-rw-r--r--pkgs/os-specific/gnu/mig/default.nix4
-rw-r--r--pkgs/os-specific/gnu/unionfs/default.nix2
-rw-r--r--pkgs/os-specific/linux/acpi-call/default.nix10
-rw-r--r--pkgs/os-specific/linux/acpi/default.nix11
-rw-r--r--pkgs/os-specific/linux/acpid/default.nix12
-rw-r--r--pkgs/os-specific/linux/alsa-lib/default.nix22
-rw-r--r--pkgs/os-specific/linux/alsa-oss/default.nix33
-rw-r--r--pkgs/os-specific/linux/alsa-plugins/default.nix9
-rw-r--r--pkgs/os-specific/linux/alsa-utils/default.nix25
-rw-r--r--pkgs/os-specific/linux/apparmor/capability.patch16
-rw-r--r--pkgs/os-specific/linux/apparmor/default.nix39
-rw-r--r--pkgs/os-specific/linux/atheros/0.9.4.nix6
-rw-r--r--pkgs/os-specific/linux/atheros/inj.patch32
-rw-r--r--pkgs/os-specific/linux/atheros/r3867.nix45
-rw-r--r--pkgs/os-specific/linux/ati-drivers/builder.sh23
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix29
-rw-r--r--pkgs/os-specific/linux/atop/default.nix39
-rw-r--r--pkgs/os-specific/linux/aufs-util/2.1.nix42
-rw-r--r--pkgs/os-specific/linux/aufs-util/2.nix6
-rw-r--r--pkgs/os-specific/linux/aufs-util/3.nix9
-rw-r--r--pkgs/os-specific/linux/aufs/2.1.nix48
-rw-r--r--pkgs/os-specific/linux/aufs/2.nix14
-rw-r--r--pkgs/os-specific/linux/aufs/3.nix18
-rw-r--r--pkgs/os-specific/linux/batman-adv/batctl.nix25
-rw-r--r--pkgs/os-specific/linux/batman-adv/default.nix24
-rw-r--r--pkgs/os-specific/linux/bbswitch/default.nix21
-rw-r--r--pkgs/os-specific/linux/blcr/default.nix18
-rw-r--r--pkgs/os-specific/linux/bluez/bluez5.nix71
-rw-r--r--pkgs/os-specific/linux/bluez/default.nix4
-rw-r--r--pkgs/os-specific/linux/broadcom-sta/default.nix10
-rw-r--r--pkgs/os-specific/linux/busybox/default.nix5
-rw-r--r--pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch12
-rw-r--r--pkgs/os-specific/linux/checkpolicy/default.nix13
-rw-r--r--pkgs/os-specific/linux/cifs-utils/default.nix12
-rw-r--r--pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch22
-rw-r--r--pkgs/os-specific/linux/conky/curl-types-h.patch25
-rw-r--r--pkgs/os-specific/linux/conky/default.nix20
-rw-r--r--pkgs/os-specific/linux/conky/stdbool.patch12
-rw-r--r--pkgs/os-specific/linux/consoletools/default.nix33
-rw-r--r--pkgs/os-specific/linux/cpufrequtils/default.nix4
-rw-r--r--pkgs/os-specific/linux/cryptodev/default.nix30
-rw-r--r--pkgs/os-specific/linux/cryptsetup/default.nix4
-rw-r--r--pkgs/os-specific/linux/e1000e/default.nix10
-rw-r--r--pkgs/os-specific/linux/ebtables/default.nix15
-rw-r--r--pkgs/os-specific/linux/eject/default.nix14
-rw-r--r--pkgs/os-specific/linux/exmap/default.nix8
-rw-r--r--pkgs/os-specific/linux/fbterm/default.nix48
-rw-r--r--pkgs/os-specific/linux/fbterm/default.upstream3
-rw-r--r--pkgs/os-specific/linux/fbterm/src-for-default.nix9
-rw-r--r--pkgs/os-specific/linux/fbterm/src-info-for-default.nix4
-rw-r--r--pkgs/os-specific/linux/fbterm/stdenv.nix35
-rw-r--r--pkgs/os-specific/linux/ffado/default.nix22
-rw-r--r--pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch13
-rw-r--r--pkgs/os-specific/linux/firmware/amd-ucode/default.nix4
-rw-r--r--pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix2
-rw-r--r--pkgs/os-specific/linux/firmware/bcm43xx/default.nix4
-rw-r--r--pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix37
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-2030-ucode/default.nix30
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/default.nix3
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/version-2.nix7
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-5000-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-6000-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix12
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix5
-rw-r--r--pkgs/os-specific/linux/firmware/radeon-r700/default.nix2
-rw-r--r--pkgs/os-specific/linux/firmware/raspberrypi/default.nix23
-rw-r--r--pkgs/os-specific/linux/firmware/rtl8168e-2/default.nix3
-rw-r--r--pkgs/os-specific/linux/frandom/default.nix10
-rw-r--r--pkgs/os-specific/linux/fuse/default.nix4
-rw-r--r--pkgs/os-specific/linux/gogoclient/default.nix8
-rw-r--r--pkgs/os-specific/linux/google-authenticator/default.nix24
-rw-r--r--pkgs/os-specific/linux/hal/default.nix63
-rw-r--r--pkgs/os-specific/linux/hal/hal-evt.nix20
-rw-r--r--pkgs/os-specific/linux/hal/info.nix15
-rw-r--r--pkgs/os-specific/linux/hal/synaptics.nix19
-rw-r--r--pkgs/os-specific/linux/hostapd/default.nix18
-rw-r--r--pkgs/os-specific/linux/htop/default.nix6
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix31
-rw-r--r--pkgs/os-specific/linux/iproute/no-werror.patch12
-rw-r--r--pkgs/os-specific/linux/ipsec-tools/default.nix42
-rw-r--r--pkgs/os-specific/linux/ipsec-tools/dont-create-localstatedir-during-install.patch13
-rw-r--r--pkgs/os-specific/linux/iptables/default.nix4
-rw-r--r--pkgs/os-specific/linux/iputils/default.nix43
-rw-r--r--pkgs/os-specific/linux/iscsitarget/default.nix6
-rw-r--r--pkgs/os-specific/linux/iw/default.nix8
-rw-r--r--pkgs/os-specific/linux/iwlwifi/default.nix10
-rw-r--r--pkgs/os-specific/linux/jujuutils/default.nix6
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.6.28.nix2
-rw-r--r--pkgs/os-specific/linux/kernel-headers/2.6.32.nix4
-rw-r--r--pkgs/os-specific/linux/kernel-headers/3.7.nix (renamed from pkgs/os-specific/linux/kernel-headers/3.3.5.nix)25
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix62
-rw-r--r--pkgs/os-specific/linux/kernel/aufs2-35.patch351
-rw-r--r--pkgs/os-specific/linux/kernel/aufs2.patch354
-rw-r--r--pkgs/os-specific/linux/kernel/builder.sh4
-rw-r--r--pkgs/os-specific/linux/kernel/cifs-timeout-2.6.15.patch44
-rw-r--r--pkgs/os-specific/linux/kernel/cifs-timeout-2.6.29.patch47
-rw-r--r--pkgs/os-specific/linux/kernel/cifs-timeout-2.6.35.patch45
-rw-r--r--pkgs/os-specific/linux/kernel/dell-rfkill.patch23
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix23
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.15.nix48
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.32-xen.nix222
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.32.nix215
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.35.nix222
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.0.nix11
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.2.nix12
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.4.nix15
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.7.nix (renamed from pkgs/os-specific/linux/kernel/linux-3.5.nix)32
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.8.nix (renamed from pkgs/os-specific/linux/kernel/linux-3.3.nix)41
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.9.nix (renamed from pkgs/os-specific/linux/kernel/linux-3.1.nix)68
-rw-r--r--pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix44
-rw-r--r--pkgs/os-specific/linux/kernel/linux.upstream.template13
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix61
-rw-r--r--pkgs/os-specific/linux/kernel/mips-ext3-n32.patch17
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix175
-rw-r--r--pkgs/os-specific/linux/kernel/perf-3.5.patch17
-rw-r--r--pkgs/os-specific/linux/kernel/perf.nix12
-rw-r--r--pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch63
-rw-r--r--pkgs/os-specific/linux/klibc/default.nix14
-rw-r--r--pkgs/os-specific/linux/kmod/default.nix8
-rw-r--r--pkgs/os-specific/linux/kqemu/default.nix8
-rw-r--r--pkgs/os-specific/linux/kudzu/builder.sh13
-rw-r--r--pkgs/os-specific/linux/kudzu/default.nix13
-rw-r--r--pkgs/os-specific/linux/kudzu/kudzu-python.patch21
-rw-r--r--pkgs/os-specific/linux/libcap-ng/default.nix22
-rw-r--r--pkgs/os-specific/linux/libcap/default.nix2
-rw-r--r--pkgs/os-specific/linux/libcgroup/default.nix2
-rw-r--r--pkgs/os-specific/linux/libnl/default.nix4
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch11
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch13
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch40
-rw-r--r--pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch80
-rw-r--r--pkgs/os-specific/linux/libnl/v1.nix27
-rw-r--r--pkgs/os-specific/linux/libnl/v2.nix19
-rw-r--r--pkgs/os-specific/linux/libselinux/default.nix31
-rw-r--r--pkgs/os-specific/linux/libselinux/fPIC.patch13
-rw-r--r--pkgs/os-specific/linux/libsemanage/default.nix18
-rw-r--r--pkgs/os-specific/linux/libsepol/default.nix19
-rw-r--r--pkgs/os-specific/linux/lvm2/assume-uevent-generated.patch39
-rw-r--r--pkgs/os-specific/linux/lvm2/default.nix6
-rw-r--r--pkgs/os-specific/linux/lxc/default.nix (renamed from pkgs/applications/virtualization/lxc/default.nix)35
-rw-r--r--pkgs/os-specific/linux/lxc/dont-run-ldconfig.patch22
-rw-r--r--pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch28
-rw-r--r--pkgs/os-specific/linux/lxc/support-db2x.patch29
-rw-r--r--pkgs/os-specific/linux/mcelog/default.nix6
-rw-r--r--pkgs/os-specific/linux/mdadm/default.nix2
-rw-r--r--pkgs/os-specific/linux/microcode/converter.nix4
-rw-r--r--pkgs/os-specific/linux/module-init-tools/default.nix2
-rw-r--r--pkgs/os-specific/linux/modutils/default.nix10
-rw-r--r--pkgs/os-specific/linux/mountall/default.nix6
-rw-r--r--pkgs/os-specific/linux/ndiswrapper/default.nix8
-rw-r--r--pkgs/os-specific/linux/net-tools/config.h11
-rw-r--r--pkgs/os-specific/linux/net-tools/default.nix12
-rw-r--r--pkgs/os-specific/linux/net-tools/net-tools-labels.patch38
-rw-r--r--pkgs/os-specific/linux/netatop/default.nix36
-rw-r--r--pkgs/os-specific/linux/nfs-utils/default.nix6
-rw-r--r--pkgs/os-specific/linux/nss_ldap/crashes.patch104
-rw-r--r--pkgs/os-specific/linux/nss_ldap/default.nix21
-rw-r--r--pkgs/os-specific/linux/nss_ldap/nss_ldap-265-glibc-2.16.patch139
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/acpixf.patch27
-rwxr-xr-xpkgs/os-specific/linux/nvidia-x11/builder-legacy304.sh101
-rwxr-xr-xpkgs/os-specific/linux/nvidia-x11/builder.sh43
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix22
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/generated.patch12
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy173.nix14
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy304.nix51
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy96.nix24
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/patchlevel.patch59
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/switch_to.patch24
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/version-test.patch19
-rw-r--r--pkgs/os-specific/linux/open-iscsi/default.nix6
-rw-r--r--pkgs/os-specific/linux/otpw/default.nix32
-rw-r--r--pkgs/os-specific/linux/ov511/default.nix1
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.30-builder.sh18
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.30-default.nix13
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.32-builder.sh22
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.32-default.nix13
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.32-kdir.patch20
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-2.32.patch13
-rw-r--r--pkgs/os-specific/linux/ov511/ov511-kernel.patch39
-rw-r--r--pkgs/os-specific/linux/pam/default.nix25
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix14
-rw-r--r--pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch338
-rw-r--r--pkgs/os-specific/linux/pam_unix2/default.nix16
-rw-r--r--pkgs/os-specific/linux/plymouth/default.nix56
-rw-r--r--pkgs/os-specific/linux/pm-utils/default.nix17
-rw-r--r--pkgs/os-specific/linux/pmtools/default.nix25
-rw-r--r--pkgs/os-specific/linux/policycoreutils/default.nix36
-rw-r--r--pkgs/os-specific/linux/powertop/default.nix11
-rw-r--r--pkgs/os-specific/linux/procps-ng/default.nix26
-rw-r--r--pkgs/os-specific/linux/pwdutils/default.nix42
-rw-r--r--pkgs/os-specific/linux/pwdutils/sys-stat-h.patch37
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/default.nix40
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/fix-librt-check.patch72
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/fix-usb-passthrough.patch45
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/qemu-img-fix-corrupt-vdi.patch27
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/smb-tmpdir.patch33
-rw-r--r--pkgs/os-specific/linux/reptyr/default.nix17
-rw-r--r--pkgs/os-specific/linux/sepolgen/default.nix22
-rw-r--r--pkgs/os-specific/linux/shadow/default.nix7
-rw-r--r--pkgs/os-specific/linux/spl/default.nix43
-rw-r--r--pkgs/os-specific/linux/spl/install_prefix.patch274
-rw-r--r--pkgs/os-specific/linux/sysfsutils/default.nix2
-rw-r--r--pkgs/os-specific/linux/sysklogd/systemd.patch49
-rw-r--r--pkgs/os-specific/linux/syslinux/default.nix19
-rw-r--r--pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch26
-rw-r--r--pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch25
-rw-r--r--pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch32
-rw-r--r--pkgs/os-specific/linux/systemd/0004-Set-switch-to-configuration-hints-for-some-units.patch74
-rw-r--r--pkgs/os-specific/linux/systemd/0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch33
-rw-r--r--pkgs/os-specific/linux/systemd/0006-Don-t-call-plymouth-quit.patch38
-rw-r--r--pkgs/os-specific/linux/systemd/0007-Ignore-IPv6-link-local-addresses.patch37
-rw-r--r--pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch28
-rw-r--r--pkgs/os-specific/linux/systemd/0009-Start-ctrl-alt-del.target-irreversibly.patch27
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix78
-rw-r--r--pkgs/os-specific/linux/systemd/fail-after-reaching-respawn-limit.patch12
-rw-r--r--pkgs/os-specific/linux/systemd/libc-bug-accept4-arm.patch81
-rw-r--r--pkgs/os-specific/linux/sysvinit/default.nix19
-rw-r--r--pkgs/os-specific/linux/tcp-wrappers/builder.sh (renamed from pkgs/os-specific/linux/tcp-wrapper/builder.sh)0
-rw-r--r--pkgs/os-specific/linux/tcp-wrappers/default.nix (renamed from pkgs/os-specific/linux/tcp-wrapper/default.nix)0
-rw-r--r--pkgs/os-specific/linux/tp_smapi/default.nix12
-rw-r--r--pkgs/os-specific/linux/uclibc/default.nix6
-rw-r--r--pkgs/os-specific/linux/udev/173.nix58
-rw-r--r--pkgs/os-specific/linux/udev/custom-rules.patch91
-rw-r--r--pkgs/os-specific/linux/udev/pre-accept4-kernel.patch43
-rw-r--r--pkgs/os-specific/linux/udisks/1-default.nix (renamed from pkgs/os-specific/linux/udisks/default.nix)9
-rw-r--r--pkgs/os-specific/linux/udisks/2-default.nix42
-rw-r--r--pkgs/os-specific/linux/udisks/force-path.patch13
-rw-r--r--pkgs/os-specific/linux/udisks/no-pci-db.patch13
-rw-r--r--pkgs/os-specific/linux/uml-utilities/builder.sh17
-rw-r--r--pkgs/os-specific/linux/uml-utilities/default.nix13
-rw-r--r--pkgs/os-specific/linux/upower/default.nix8
-rw-r--r--pkgs/os-specific/linux/upstart/cfgdir.patch45
-rw-r--r--pkgs/os-specific/linux/usbutils/default.nix20
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix32
-rw-r--r--pkgs/os-specific/linux/util-linux/linux-specific-header.patch16
-rw-r--r--pkgs/os-specific/linux/v4l-utils/default.nix20
-rw-r--r--pkgs/os-specific/linux/v86d/default.nix10
-rw-r--r--pkgs/os-specific/linux/wis-go7007/default.nix10
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/default.nix62
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/gui.nix2
-rw-r--r--pkgs/os-specific/linux/wpa_supplicant/libnl.patch13
-rw-r--r--pkgs/os-specific/linux/x86info/default.nix35
-rw-r--r--pkgs/os-specific/linux/xf86-input-mtrack/default.nix11
-rw-r--r--pkgs/os-specific/linux/xf86-input-wacom/default.nix10
-rw-r--r--pkgs/os-specific/linux/xf86-video-nested/default.nix29
-rw-r--r--pkgs/os-specific/linux/xf86-video-nouveau/default.nix6
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix48
-rw-r--r--pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch24
-rw-r--r--pkgs/os-specific/linux/zfs/nix-build.patch214
-rw-r--r--pkgs/os-specific/windows/jom/default.nix4
-rw-r--r--pkgs/os-specific/windows/pthread-w32/default.nix8
-rw-r--r--pkgs/os-specific/windows/w32api/default.nix2
-rw-r--r--pkgs/servers/amqp/rabbitmq-server/default.nix20
-rw-r--r--pkgs/servers/dico/default.nix10
-rw-r--r--pkgs/servers/dict/dictd-wiktionary.nix32
-rw-r--r--pkgs/servers/dict/dictd-wordnet.nix36
-rw-r--r--pkgs/servers/dict/wiktionary2dict.py778
-rw-r--r--pkgs/servers/dict/wordnet_structures.py319
-rw-r--r--pkgs/servers/dns/bind/default.nix15
-rw-r--r--pkgs/servers/firebird/default.nix10
-rw-r--r--pkgs/servers/ftp/vsftpd/default.nix16
-rw-r--r--pkgs/servers/gpm/1.99.6.nix23
-rw-r--r--pkgs/servers/gpm/default.nix2
-rw-r--r--pkgs/servers/gpsd/default.nix2
-rw-r--r--pkgs/servers/http/4store/default.nix7
-rw-r--r--pkgs/servers/http/4store/src-for-default.nix8
-rw-r--r--pkgs/servers/http/apache-httpd/2.2.nix4
-rw-r--r--pkgs/servers/http/apache-httpd/2.4.nix10
-rw-r--r--pkgs/servers/http/apache-modules/mod_evasive/default.nix2
-rw-r--r--pkgs/servers/http/couchdb/src-for-default.nix14
-rw-r--r--pkgs/servers/http/jboss/default.nix16
-rw-r--r--pkgs/servers/http/joseki/default.nix4
-rw-r--r--pkgs/servers/http/lighttpd/default.nix20
-rw-r--r--pkgs/servers/http/mini-httpd/default.nix14
-rw-r--r--pkgs/servers/http/myserver/installable-binary.patch14
-rw-r--r--pkgs/servers/http/nginx/default.nix32
-rw-r--r--pkgs/servers/http/yaws/default.nix35
-rw-r--r--pkgs/servers/icecast/default.nix32
-rw-r--r--pkgs/servers/mail/dovecot/1.1.1.nix20
-rw-r--r--pkgs/servers/mail/dovecot/2.x.nix27
-rw-r--r--pkgs/servers/mail/dovecot/default.nix31
-rw-r--r--pkgs/servers/mail/freepops/default.nix2
-rw-r--r--pkgs/servers/mail/petidomo/default.nix27
-rw-r--r--pkgs/servers/mail/popa3d/default.nix29
-rw-r--r--pkgs/servers/mail/popa3d/enable-standalone-mode.patch12
-rw-r--r--pkgs/servers/mail/popa3d/fix-mail-spool-path.patch12
-rw-r--r--pkgs/servers/mail/popa3d/use-glibc-crypt.patch12
-rw-r--r--pkgs/servers/mail/popa3d/use-openssl.patch21
-rw-r--r--pkgs/servers/mail/postfix/default.nix63
-rw-r--r--pkgs/servers/mail/spamassassin/default.nix28
-rw-r--r--pkgs/servers/mediatomb/default.nix4
-rw-r--r--pkgs/servers/mediatomb/zmm_new.patch13
-rw-r--r--pkgs/servers/memcached/default.nix6
-rw-r--r--pkgs/servers/monitoring/munin/default.nix98
-rw-r--r--pkgs/servers/monitoring/net-snmp/default.nix7
-rw-r--r--pkgs/servers/monitoring/zabbix/2.0.nix70
-rw-r--r--pkgs/servers/monitoring/zabbix/default.nix10
-rw-r--r--pkgs/servers/mpd/default.nix92
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix43
-rw-r--r--pkgs/servers/nosql/redis/default.nix11
-rw-r--r--pkgs/servers/openafs-client/default.nix6
-rw-r--r--pkgs/servers/portmap/default.nix4
-rw-r--r--pkgs/servers/prayer/default.nix6
-rw-r--r--pkgs/servers/pulseaudio/default.nix14
-rw-r--r--pkgs/servers/restund/default.nix28
-rw-r--r--pkgs/servers/samba/default.nix14
-rw-r--r--pkgs/servers/search/elasticsearch/default.nix21
-rw-r--r--pkgs/servers/search/elasticsearch/es-home.patch20
-rw-r--r--pkgs/servers/shishi/default.nix18
-rw-r--r--pkgs/servers/shishi/no-gets.patch20
-rw-r--r--pkgs/servers/silc-server/default.nix18
-rw-r--r--pkgs/servers/sip/freeswitch/default.nix19
-rw-r--r--pkgs/servers/sip/sipwitch/default.nix4
-rw-r--r--pkgs/servers/sql/mysql/jdbc/default.nix6
-rw-r--r--pkgs/servers/sql/mysql51/default.nix8
-rw-r--r--pkgs/servers/sql/mysql55/default.nix19
-rw-r--r--pkgs/servers/sql/oracle-xe/default.nix83
-rw-r--r--pkgs/servers/sql/postgresql/8.3.x.nix4
-rw-r--r--pkgs/servers/sql/postgresql/8.4.x.nix4
-rw-r--r--pkgs/servers/sql/postgresql/9.0.x.nix4
-rw-r--r--pkgs/servers/sql/postgresql/9.1.x.nix4
-rw-r--r--pkgs/servers/sql/postgresql/9.2.x.nix33
-rw-r--r--pkgs/servers/sql/postgresql/jdbc/default.nix16
-rw-r--r--pkgs/servers/sql/postgresql/psqlodbc/default.nix20
-rw-r--r--pkgs/servers/sql/virtuoso/default.nix4
-rw-r--r--pkgs/servers/squid/squids.nix12
-rw-r--r--pkgs/servers/unfs3/default.nix2
-rw-r--r--pkgs/servers/varnish/default.nix21
-rw-r--r--pkgs/servers/x11/xorg/builder.sh2
-rw-r--r--pkgs/servers/x11/xorg/default.nix1228
-rw-r--r--pkgs/servers/x11/xorg/extra.list13
-rwxr-xr-xpkgs/servers/x11/xorg/generate-expr-from-tarballs.pl2
-rw-r--r--pkgs/servers/x11/xorg/old.list14
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix137
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.6.list199
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.7.list184
-rw-r--r--pkgs/servers/x11/xorg/unichrome/default.nix7
-rw-r--r--pkgs/servers/x11/xorg/xorgserver-dri-path.patch57
-rw-r--r--pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch2
-rw-r--r--pkgs/servers/x11/xorg/xorgserver.sh9
-rw-r--r--pkgs/servers/x11/xorg/xorgserver12-CVE-1940.patch34
-rw-r--r--pkgs/servers/xinetd/default.nix6
-rw-r--r--pkgs/servers/xmpp/pyMAILt/default.nix2
-rw-r--r--pkgs/shells/bash-completion/default.nix17
-rw-r--r--pkgs/shells/bash/bash-4.2-patches.nix18
-rw-r--r--pkgs/shells/bash/default.nix6
-rw-r--r--pkgs/shells/fish/default.nix22
-rw-r--r--pkgs/shells/ipython/default.nix39
-rw-r--r--pkgs/stdenv/adapters.nix137
-rw-r--r--pkgs/stdenv/default.nix13
-rw-r--r--pkgs/stdenv/generic/default.nix98
-rw-r--r--pkgs/stdenv/generic/setup.sh44
-rw-r--r--pkgs/stdenv/linux/bootstrap/armv6l/default.nix15
-rw-r--r--pkgs/stdenv/linux/bootstrap/loongson2f/default.nix2
-rw-r--r--pkgs/stdenv/linux/default.nix66
-rw-r--r--pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix269
-rw-r--r--pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh28
-rwxr-xr-xpkgs/stdenv/mingw/setup.sh4
-rw-r--r--pkgs/stdenv/native/default.nix36
-rw-r--r--pkgs/stdenv/nix/default.nix10
-rw-r--r--pkgs/tools/X11/autocutsel/default.nix26
-rw-r--r--pkgs/tools/X11/virtualgl/default.nix10
-rw-r--r--pkgs/tools/X11/x11vnc/default.nix3
-rw-r--r--pkgs/tools/X11/xcalib/default.nix25
-rw-r--r--pkgs/tools/X11/xchainkeys/default.nix18
-rw-r--r--pkgs/tools/X11/xdg-utils/default.nix6
-rw-r--r--pkgs/tools/X11/xkb-switch/default.nix22
-rw-r--r--pkgs/tools/X11/xlaunch/default.nix2
-rw-r--r--pkgs/tools/X11/xpra/default.nix56
-rw-r--r--pkgs/tools/admin/tigervnc/default.nix68
-rw-r--r--pkgs/tools/archivers/cabextract/default.nix9
-rw-r--r--pkgs/tools/archivers/cpio/latest.nix45
-rw-r--r--pkgs/tools/archivers/gnutar/default.nix23
-rw-r--r--pkgs/tools/archivers/p7zip/default.nix8
-rw-r--r--pkgs/tools/archivers/sharutils/default.nix11
-rw-r--r--pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch63
-rw-r--r--pkgs/tools/archivers/xarchive/default.nix20
-rw-r--r--pkgs/tools/archivers/zip/default.nix5
-rw-r--r--pkgs/tools/archivers/zpaq/default.nix51
-rw-r--r--pkgs/tools/archivers/zpaq/default.upstream3
-rw-r--r--pkgs/tools/audio/pa-applet/default.nix30
-rw-r--r--pkgs/tools/backup/bacula/default.nix24
-rw-r--r--pkgs/tools/backup/bup/default.nix48
-rw-r--r--pkgs/tools/backup/duplicity/default.nix6
-rw-r--r--pkgs/tools/backup/obnam/default.nix10
-rw-r--r--pkgs/tools/backup/partclone/default.nix26
-rw-r--r--pkgs/tools/backup/partimage/default.nix29
-rw-r--r--pkgs/tools/backup/partimage/gentoos-zlib.patch33
-rw-r--r--pkgs/tools/backup/rsnapshot/default.nix2
-rw-r--r--pkgs/tools/backup/tarsnap/default.nix18
-rw-r--r--pkgs/tools/bluetooth/bluedevil/default.nix22
-rw-r--r--pkgs/tools/bluetooth/kbluetooth/default.nix30
-rw-r--r--pkgs/tools/bluetooth/obexd/default.nix6
-rw-r--r--pkgs/tools/cd-dvd/cuetools/default.nix22
-rw-r--r--pkgs/tools/compression/bzip2/builder.sh2
-rw-r--r--pkgs/tools/compression/gzip/default.nix22
-rw-r--r--pkgs/tools/compression/gzip/gets-undeclared.patch26
-rw-r--r--pkgs/tools/compression/lrzip/default.nix14
-rw-r--r--pkgs/tools/compression/lrzip/default.upstream8
-rw-r--r--pkgs/tools/compression/lzip/default.nix25
-rw-r--r--pkgs/tools/compression/xz/default.nix4
-rw-r--r--pkgs/tools/compression/zsync/default.nix4
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c109
-rw-r--r--pkgs/tools/filesystems/btrfsprogs/default.nix24
-rw-r--r--pkgs/tools/filesystems/davfs2/default.nix26
-rw-r--r--pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch60
-rw-r--r--pkgs/tools/filesystems/dosfstools/default.nix5
-rw-r--r--pkgs/tools/filesystems/e2fsprogs/default.nix14
-rw-r--r--pkgs/tools/filesystems/fuse-zip/default.nix6
-rw-r--r--pkgs/tools/filesystems/fuse-zip/libzip.patch24
-rw-r--r--pkgs/tools/filesystems/glusterfs/default.nix32
-rw-r--r--pkgs/tools/filesystems/glusterfs/default.upstream4
-rw-r--r--pkgs/tools/filesystems/glusterfs/src-for-default.nix8
-rw-r--r--pkgs/tools/filesystems/glusterfs/src-info-for-default.nix6
-rw-r--r--pkgs/tools/filesystems/grive/default.nix10
-rw-r--r--pkgs/tools/filesystems/jfsutils/default.nix6
-rw-r--r--pkgs/tools/filesystems/jfsutils/types.patch12
-rw-r--r--pkgs/tools/filesystems/mtdutils/default.nix9
-rw-r--r--pkgs/tools/filesystems/ntfs-3g/default.nix2
-rw-r--r--pkgs/tools/filesystems/reiserfsprogs/default.nix2
-rw-r--r--pkgs/tools/filesystems/squashfs/default.nix8
-rw-r--r--pkgs/tools/filesystems/unionfs-fuse/default.nix32
-rw-r--r--pkgs/tools/filesystems/xtreemfs/default.nix4
-rw-r--r--pkgs/tools/graphics/argyllcms/default.nix85
-rw-r--r--pkgs/tools/graphics/asymptote/default.nix18
-rw-r--r--pkgs/tools/graphics/asymptote/default.upstream4
-rw-r--r--pkgs/tools/graphics/asymptote/src-for-default.nix7
-rw-r--r--pkgs/tools/graphics/asymptote/src-info-for-default.nix8
-rw-r--r--pkgs/tools/graphics/cfdg/default.nix12
-rw-r--r--pkgs/tools/graphics/cfdg/src-for-default.nix10
-rw-r--r--pkgs/tools/graphics/cuneiform/default.nix6
-rw-r--r--pkgs/tools/graphics/cuneiform/default.upstream8
-rw-r--r--pkgs/tools/graphics/enblend-enfuse/default.nix2
-rw-r--r--pkgs/tools/graphics/glxinfo/default.nix4
-rw-r--r--pkgs/tools/graphics/gnuplot/default.nix27
-rw-r--r--pkgs/tools/graphics/gnuplot/set-gdfontpath-from-fontconfig.sh4
-rw-r--r--pkgs/tools/graphics/graphviz/default.nix11
-rw-r--r--pkgs/tools/graphics/graphviz/fix-broken-memcp-signature.patch15
-rw-r--r--pkgs/tools/graphics/jbig2enc/default.nix19
-rw-r--r--pkgs/tools/graphics/lprof/default.nix46
-rw-r--r--pkgs/tools/graphics/lprof/lcms-1.17.patch13
-rw-r--r--pkgs/tools/graphics/mscgen/default.nix6
-rw-r--r--pkgs/tools/graphics/netpbm/default.nix13
-rw-r--r--pkgs/tools/graphics/pfstools/default.nix2
-rw-r--r--pkgs/tools/graphics/plotutils/debian-patches.nix2
-rw-r--r--pkgs/tools/graphics/pngcrush/default.nix4
-rw-r--r--pkgs/tools/graphics/qrencode/default.nix2
-rw-r--r--pkgs/tools/graphics/zbar/default.nix2
-rw-r--r--pkgs/tools/inputmethods/fcitx/default.nix32
-rw-r--r--pkgs/tools/misc/autojump/default.nix38
-rw-r--r--pkgs/tools/misc/byobu/default.nix32
-rw-r--r--pkgs/tools/misc/cloc/default.nix30
-rw-r--r--pkgs/tools/misc/coreutils-5/default.nix10
-rw-r--r--pkgs/tools/misc/coreutils-5/dietlibc.patch35
-rw-r--r--pkgs/tools/misc/coreutils/8.19.nix70
-rw-r--r--pkgs/tools/misc/coreutils/default.nix127
-rw-r--r--pkgs/tools/misc/cowsay/default.nix11
-rw-r--r--pkgs/tools/misc/debian-devscripts/default.nix36
-rw-r--r--pkgs/tools/misc/debootstrap/default.nix122
-rw-r--r--pkgs/tools/misc/file/511.nix17
-rw-r--r--pkgs/tools/misc/file/default.nix16
-rw-r--r--pkgs/tools/misc/findutils/4.2.27.nix14
-rw-r--r--pkgs/tools/misc/findutils/default.nix7
-rw-r--r--pkgs/tools/misc/findutils/dietlibc-hack.patch58
-rw-r--r--pkgs/tools/misc/g500-control/default.nix35
-rw-r--r--pkgs/tools/misc/gnokii/src-for-default.nix8
-rw-r--r--pkgs/tools/misc/gparted/default.nix19
-rw-r--r--pkgs/tools/misc/grub/2.0x.nix14
-rw-r--r--pkgs/tools/misc/grub/default.nix6
-rw-r--r--pkgs/tools/misc/grub/device-mapper-symlinks.patch28
-rw-r--r--pkgs/tools/misc/grub/fix-bash-completion.patch24
-rw-r--r--pkgs/tools/misc/gsmartcontrol/default.nix23
-rw-r--r--pkgs/tools/misc/gummiboot/default.nix30
-rw-r--r--pkgs/tools/misc/gummiboot/no-usr.patch79
-rw-r--r--pkgs/tools/misc/hddtemp/byteswap.patch28
-rw-r--r--pkgs/tools/misc/hddtemp/default.nix9
-rw-r--r--pkgs/tools/misc/hddtemp/dontwake.patch20
-rw-r--r--pkgs/tools/misc/hddtemp/execinfo.patch21
-rw-r--r--pkgs/tools/misc/hddtemp/satacmds.patch26
-rw-r--r--pkgs/tools/misc/hdf5/default.nix6
-rw-r--r--pkgs/tools/misc/idutils/default.nix7
-rw-r--r--pkgs/tools/misc/ised/default.nix2
-rw-r--r--pkgs/tools/misc/jdiskreport/builder.sh9
-rw-r--r--pkgs/tools/misc/jdiskreport/default.nix14
-rw-r--r--pkgs/tools/misc/lockfile-progs/default.nix29
-rw-r--r--pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch41
-rw-r--r--pkgs/tools/misc/mc/mc-4.6.1-debian_fixes-1.patch12671
-rw-r--r--pkgs/tools/misc/mktorrent/default.nix27
-rw-r--r--pkgs/tools/misc/mmv/default.nix46
-rw-r--r--pkgs/tools/misc/multitail/default.nix22
-rw-r--r--pkgs/tools/misc/ncdu/default.nix1
-rw-r--r--pkgs/tools/misc/parallel/default.nix4
-rw-r--r--pkgs/tools/misc/parcellite/default.nix18
-rw-r--r--pkgs/tools/misc/parted/2.3.nix56
-rw-r--r--pkgs/tools/misc/partition-manager/default.nix25
-rw-r--r--pkgs/tools/misc/picocom/default.nix23
-rw-r--r--pkgs/tools/misc/plowshare/default.nix33
-rw-r--r--pkgs/tools/misc/recutils/default.nix2
-rw-r--r--pkgs/tools/misc/recutils/glibc.patch29
-rw-r--r--pkgs/tools/misc/refind/default.nix8
-rw-r--r--pkgs/tools/misc/renameutils/default.nix19
-rw-r--r--pkgs/tools/misc/renameutils/install-exec.patch24
-rw-r--r--pkgs/tools/misc/screen/default.nix9
-rw-r--r--pkgs/tools/misc/screen/screen-4.0.3-caption-colors.patch25
-rw-r--r--pkgs/tools/misc/screen/screen-4.0.3-long-term.patch29
-rw-r--r--pkgs/tools/misc/sl/default.nix28
-rw-r--r--pkgs/tools/misc/system-config-printer/default.nix24
-rw-r--r--pkgs/tools/misc/testdisk/default.nix12
-rw-r--r--pkgs/tools/misc/timidity/default.nix2
-rw-r--r--pkgs/tools/misc/tmux/default.nix16
-rw-r--r--pkgs/tools/misc/ttf2pt1/default.nix2
-rw-r--r--pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix20
-rw-r--r--pkgs/tools/misc/txt2man/default.nix22
-rw-r--r--pkgs/tools/misc/usbmuxd/default.nix2
-rw-r--r--pkgs/tools/misc/wv2/default.nix21
-rw-r--r--pkgs/tools/misc/wv2/fix-include.patch12
-rw-r--r--pkgs/tools/misc/xburst-tools/default.nix2
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix41
-rw-r--r--pkgs/tools/networking/ahcpd/default.nix21
-rw-r--r--pkgs/tools/networking/aircrack-ng/default.nix18
-rw-r--r--pkgs/tools/networking/babeld/default.nix20
-rw-r--r--pkgs/tools/networking/chrony/default.nix27
-rw-r--r--pkgs/tools/networking/connect/default.nix33
-rw-r--r--pkgs/tools/networking/curl/default.nix44
-rw-r--r--pkgs/tools/networking/dd-agent/default.nix36
-rw-r--r--pkgs/tools/networking/ddclient/ddclient-foreground.patch92
-rw-r--r--pkgs/tools/networking/ddclient/default.nix15
-rw-r--r--pkgs/tools/networking/dhcpcd/default.nix4
-rw-r--r--pkgs/tools/networking/dnsmasq/default.nix8
-rw-r--r--pkgs/tools/networking/filegive/default.nix52
-rw-r--r--pkgs/tools/networking/fping/default.nix15
-rw-r--r--pkgs/tools/networking/gmvault/default.nix34
-rw-r--r--pkgs/tools/networking/gmvault/gmvault.py4
-rw-r--r--pkgs/tools/networking/gvpe/src-for-default.nix11
-rw-r--r--pkgs/tools/networking/hping/default.nix48
-rw-r--r--pkgs/tools/networking/httpie/default.nix22
-rw-r--r--pkgs/tools/networking/iftop/default.nix4
-rw-r--r--pkgs/tools/networking/inetutils/default.nix14
-rw-r--r--pkgs/tools/networking/isync/default.nix6
-rw-r--r--pkgs/tools/networking/lftp/default.nix18
-rw-r--r--pkgs/tools/networking/lftp/no-gets.patch15
-rw-r--r--pkgs/tools/networking/maildrop/default.nix20
-rw-r--r--pkgs/tools/networking/maildrop/maildrop.configure.hack.patch13
-rw-r--r--pkgs/tools/networking/mailutils/default.nix2
-rw-r--r--pkgs/tools/networking/mailutils/no-gets.patch14
-rw-r--r--pkgs/tools/networking/megatools/default.nix30
-rw-r--r--pkgs/tools/networking/minidlna/default.nix26
-rw-r--r--pkgs/tools/networking/miniupnpc/default.nix4
-rw-r--r--pkgs/tools/networking/miniupnpd/default.nix23
-rw-r--r--pkgs/tools/networking/modemmanager/default.nix6
-rw-r--r--pkgs/tools/networking/mosh/default.nix10
-rw-r--r--pkgs/tools/networking/mtr/default.nix6
-rw-r--r--pkgs/tools/networking/mu/default.nix25
-rw-r--r--pkgs/tools/networking/mu0/default.nix25
-rw-r--r--pkgs/tools/networking/nbd/default.nix4
-rw-r--r--pkgs/tools/networking/netboot/default.nix35
-rw-r--r--pkgs/tools/networking/network-manager-applet/default.nix21
-rw-r--r--pkgs/tools/networking/network-manager/default.nix20
-rw-r--r--pkgs/tools/networking/network-manager/openvpn.nix47
-rw-r--r--pkgs/tools/networking/network-manager/pptp-purity.patch26
-rw-r--r--pkgs/tools/networking/network-manager/pptp.nix15
-rw-r--r--pkgs/tools/networking/networkmanagement/default.nix6
-rw-r--r--pkgs/tools/networking/nss-pam-ldapd/default.nix34
-rw-r--r--pkgs/tools/networking/ntop/default.nix2
-rw-r--r--pkgs/tools/networking/nzbget/default.nix12
-rw-r--r--pkgs/tools/networking/offlineimap/default.nix15
-rw-r--r--pkgs/tools/networking/openconnect.nix27
-rw-r--r--pkgs/tools/networking/openresolv/default.nix4
-rw-r--r--pkgs/tools/networking/openssh/default.nix19
-rw-r--r--pkgs/tools/networking/openssh/fix-identity-warnings.patch251
-rw-r--r--pkgs/tools/networking/openvpn/default.nix38
-rw-r--r--pkgs/tools/networking/oslrd/default.nix24
-rw-r--r--pkgs/tools/networking/p2p/tahoe-lafs/default.nix13
-rw-r--r--pkgs/tools/networking/p2p/tahoe-lafs/test-timeout.patch12
-rw-r--r--pkgs/tools/networking/pptp/default.nix5
-rw-r--r--pkgs/tools/networking/pwnat/default.nix24
-rw-r--r--pkgs/tools/networking/reaver-wps/default.nix26
-rw-r--r--pkgs/tools/networking/samplicator/default.nix17
-rw-r--r--pkgs/tools/networking/sitecopy/default.nix6
-rw-r--r--pkgs/tools/networking/snx/default.nix40
-rw-r--r--pkgs/tools/networking/socat/default.nix15
-rw-r--r--pkgs/tools/networking/stunnel/default.nix10
-rw-r--r--pkgs/tools/networking/surfraw/default.nix22
-rw-r--r--pkgs/tools/networking/tcng/default.nix80
-rw-r--r--pkgs/tools/networking/tcpdump/default.nix4
-rw-r--r--pkgs/tools/networking/tinc/default.nix30
-rw-r--r--pkgs/tools/networking/udptunnel/default.nix24
-rw-r--r--pkgs/tools/networking/wbox/default.nix21
-rw-r--r--pkgs/tools/networking/weighttp/default.nix15
-rw-r--r--pkgs/tools/networking/wget/default.nix8
-rw-r--r--pkgs/tools/networking/wicd/default.nix58
-rw-r--r--pkgs/tools/networking/wicd/dhclient.patch101
-rw-r--r--pkgs/tools/networking/wicd/fix-app-icon.patch19
-rw-r--r--pkgs/tools/networking/wicd/fix-gtk-issues.patch47
-rw-r--r--pkgs/tools/networking/wicd/mkdir-networks.patch12
-rw-r--r--pkgs/tools/networking/wicd/no-optimization.patch12
-rw-r--r--pkgs/tools/networking/wicd/no-var-install.patch38
-rw-r--r--pkgs/tools/package-management/cabal-install/0.10.2.nix5
-rw-r--r--pkgs/tools/package-management/cabal-install/0.14.0.nix4
-rw-r--r--pkgs/tools/package-management/cabal-install/0.6.2.nix5
-rw-r--r--pkgs/tools/package-management/cabal-install/0.8.0.nix5
-rw-r--r--pkgs/tools/package-management/cabal-install/0.8.2.nix5
-rw-r--r--pkgs/tools/package-management/cabal-install/1.16.0.2.nix23
-rw-r--r--pkgs/tools/package-management/checkinstall/default.nix9
-rw-r--r--pkgs/tools/package-management/checkinstall/glibc-check.patch2
-rw-r--r--pkgs/tools/package-management/checkinstall/use-old-memcpy.patch12
-rw-r--r--pkgs/tools/package-management/dpkg/cache-arch.patch15
-rw-r--r--pkgs/tools/package-management/dpkg/default.nix32
-rw-r--r--pkgs/tools/package-management/nix/custom.nix68
-rw-r--r--pkgs/tools/package-management/nix/default.nix30
-rw-r--r--pkgs/tools/package-management/nix/unstable.nix30
-rw-r--r--pkgs/tools/security/aespipe/default.nix19
-rw-r--r--pkgs/tools/security/apg/default.nix66
-rw-r--r--pkgs/tools/security/ccid/default.nix13
-rw-r--r--pkgs/tools/security/ccrypt/default.nix2
-rw-r--r--pkgs/tools/security/fprot/default.nix5
-rw-r--r--pkgs/tools/security/gnupg/default.nix13
-rw-r--r--pkgs/tools/security/gnupg1/default.nix4
-rw-r--r--pkgs/tools/security/meo/default.nix34
-rw-r--r--pkgs/tools/security/mkpasswd/default.nix28
-rw-r--r--pkgs/tools/security/munge/default.nix30
-rw-r--r--pkgs/tools/security/nmap/default.nix4
-rw-r--r--pkgs/tools/security/nmap/zenmap.patch15
-rw-r--r--pkgs/tools/security/oath-toolkit/default.nix18
-rw-r--r--pkgs/tools/security/pcsclite/default.nix17
-rw-r--r--pkgs/tools/security/pinentry/default.nix13
-rw-r--r--pkgs/tools/security/pinentry/duplicate-glib-defs.patch20
-rw-r--r--pkgs/tools/security/polkit-gnome/default.nix2
-rw-r--r--pkgs/tools/security/polkit-kde-agent/default.nix2
-rw-r--r--pkgs/tools/security/pwgen/default.nix1
-rw-r--r--pkgs/tools/security/rng-tools/default.nix23
-rw-r--r--pkgs/tools/security/sudo/default.nix50
-rw-r--r--pkgs/tools/security/tor/default.nix13
-rw-r--r--pkgs/tools/security/tor/torsocks.nix4
-rw-r--r--pkgs/tools/security/vidalia/default.nix6
-rw-r--r--pkgs/tools/system/acct/default.nix2
-rw-r--r--pkgs/tools/system/acct/no-gets.patch22
-rw-r--r--pkgs/tools/system/ddrescue/default.nix4
-rw-r--r--pkgs/tools/system/fakeroot/default.nix18
-rw-r--r--pkgs/tools/system/fdisk/default.nix14
-rw-r--r--pkgs/tools/system/hardlink/default.nix34
-rw-r--r--pkgs/tools/system/idle3tools/default.nix22
-rw-r--r--pkgs/tools/system/logcheck/default.nix45
-rw-r--r--pkgs/tools/system/logrotate/default.nix14
-rw-r--r--pkgs/tools/system/monit/src-for-default.nix11
-rw-r--r--pkgs/tools/system/pciutils/default.nix15
-rw-r--r--pkgs/tools/system/rsyslog/default.nix22
-rw-r--r--pkgs/tools/system/safecopy/default.nix30
-rw-r--r--pkgs/tools/system/smartmontools/default.nix16
-rw-r--r--pkgs/tools/system/storebrowse/default.nix45
-rw-r--r--pkgs/tools/system/thinkfan/default.nix29
-rw-r--r--pkgs/tools/system/vboot_reference/default.nix41
-rw-r--r--pkgs/tools/text/ascii/default.nix25
-rw-r--r--pkgs/tools/text/diffutils/default.nix22
-rw-r--r--pkgs/tools/text/diffutils/gets-undeclared.patch71
-rw-r--r--pkgs/tools/text/enca/default.nix29
-rw-r--r--pkgs/tools/text/gawk/cygwin-identifiers.patch75
-rw-r--r--pkgs/tools/text/gawk/default.nix18
-rw-r--r--pkgs/tools/text/gnugrep/default.nix14
-rw-r--r--pkgs/tools/text/gnupatch/darwin-fix.patch60
-rw-r--r--pkgs/tools/text/gnupatch/default.nix17
-rw-r--r--pkgs/tools/text/groff/default.nix12
-rw-r--r--pkgs/tools/text/kdiff3/default.nix2
-rw-r--r--pkgs/tools/text/numdiff/default.nix23
-rw-r--r--pkgs/tools/text/podiff/default.nix24
-rw-r--r--pkgs/tools/text/recode/default.nix49
-rw-r--r--pkgs/tools/text/recode/recode-3.6-as-if.patch19
-rw-r--r--pkgs/tools/text/recode/recode-3.6-gettextfix.diff23
-rw-r--r--pkgs/tools/text/sgml/openjade/default.nix15
-rw-r--r--pkgs/tools/text/sgml/opensp/compat.nix6
-rw-r--r--pkgs/tools/text/sgml/opensp/default.nix2
-rw-r--r--pkgs/tools/text/sgml/opensp/setup-hook.sh22
-rw-r--r--pkgs/tools/text/wdiff/default.nix9
-rw-r--r--pkgs/tools/text/wgetpaste/default.nix1
-rw-r--r--pkgs/tools/typesetting/asciidoc/default.nix10
-rw-r--r--pkgs/tools/typesetting/docbook2x/default.nix4
-rw-r--r--pkgs/tools/typesetting/hevea/builder.sh5
-rw-r--r--pkgs/tools/typesetting/lhs2tex/default.nix4
-rw-r--r--pkgs/tools/typesetting/tex/dblatex/default.nix9
-rw-r--r--pkgs/tools/typesetting/tex/latex2html/default.nix26
-rw-r--r--pkgs/tools/typesetting/tex/nix/default.nix6
-rw-r--r--pkgs/tools/typesetting/tex/tex4ht/default.nix21
-rw-r--r--pkgs/tools/typesetting/tex/texlive/beamer.nix6
-rw-r--r--pkgs/tools/typesetting/tex/texlive/moderncv.nix4
-rw-r--r--pkgs/tools/video/swfmill/default.nix21
-rw-r--r--pkgs/tools/video/vncrec/default.nix3
-rw-r--r--pkgs/tools/virtualization/ec2-ami-tools/default.nix10
-rw-r--r--pkgs/tools/virtualization/ec2-api-tools/default.nix23
-rw-r--r--pkgs/tools/virtualization/euca2ools/default.nix8
-rw-r--r--pkgs/top-level/all-packages.nix2590
-rw-r--r--pkgs/top-level/haskell-defaults.nix79
-rw-r--r--pkgs/top-level/haskell-packages.nix842
-rw-r--r--pkgs/top-level/make-tarball.nix15
-rw-r--r--pkgs/top-level/node-packages-generated.nix2009
-rw-r--r--pkgs/top-level/node-packages.json38
-rw-r--r--pkgs/top-level/node-packages.nix61
-rw-r--r--pkgs/top-level/perl-packages.nix3095
-rw-r--r--pkgs/top-level/platforms.nix122
-rw-r--r--pkgs/top-level/python-packages.nix3672
-rw-r--r--pkgs/top-level/release-cross.nix218
-rw-r--r--pkgs/top-level/release-haskell.nix437
-rw-r--r--pkgs/top-level/release-lib.nix106
-rw-r--r--pkgs/top-level/release-python.nix1999
-rw-r--r--pkgs/top-level/release-small.nix21
-rw-r--r--pkgs/top-level/release.nix893
3310 files changed, 87293 insertions, 47936 deletions
diff --git a/pkgs/applications/audio/abcde/abcde.patch b/pkgs/applications/audio/abcde/abcde.patch
new file mode 100644
index 00000000000..ae187043e6c
--- /dev/null
+++ b/pkgs/applications/audio/abcde/abcde.patch
@@ -0,0 +1,30 @@
+Two changes:
+
+* Add an alias for `which', so abcde can find things in store
+* Choose the right CDROM reader syntax for `cd-paranoia'
+
+--- abcde-2.5.4/abcde~	2012-09-18 06:09:31.000000000 -0700
++++ abcde-2.5.4/abcde	2012-10-27 00:08:48.000862364 -0700
+@@ -17,6 +17,11 @@
+ 
+ VERSION='2.5.4'
+ 
++which ()
++{
++  type -P $1
++}
++
+ usage ()
+ {
+ echo "This is abcde v$VERSION."
+@@ -3497,6 +3502,10 @@
+ 	for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do
+ 		if new_checkexec $DEFAULT_CDROMREADER; then
+ 			CDROMREADERSYNTAX=$DEFAULT_CDROMREADER
++                        case "$DEFAULT_CDROMREADER" in
++			  cd-paranoia)  CDROMREADERSYNTAX=cdparanoia;;
++			  *)            CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;;
++			esac
+ 			break
+ 		fi
+ 	done
diff --git a/pkgs/applications/audio/abcde/cd-paranoia.patch b/pkgs/applications/audio/abcde/cd-paranoia.patch
deleted file mode 100644
index 58cada65fb8..00000000000
--- a/pkgs/applications/audio/abcde/cd-paranoia.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Choose the right CDROM reader syntax for `cd-paranoia'.
-
---- abcde-2.3.99.6/abcde	2006-08-05 21:14:00.000000000 +0200
-+++ abcde-2.3.99.6/abcde	2008-10-29 22:55:38.000000000 +0100
-@@ -3184,7 +3184,10 @@ if [ -n "$DISCID" ] || [ "$CDROMREADERSY
- if [ "$CDROMREADERSYNTAX" = "" ]; then
- 	for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do
- 		if new_checkexec $DEFAULT_CDROMREADER; then
--			CDROMREADERSYNTAX=$DEFAULT_CDROMREADER
-+                        case "$DEFAULT_CDROMREADER" in
-+			  cd-paranoia)  CDROMREADERSYNTAX=cdparanoia;;
-+			  *)            CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;;
-+			esac
- 			break
- 		fi
- 	done
diff --git a/pkgs/applications/audio/abcde/default.nix b/pkgs/applications/audio/abcde/default.nix
index e7da594e4bc..e8c37d25694 100644
--- a/pkgs/applications/audio/abcde/default.nix
+++ b/pkgs/applications/audio/abcde/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame
+{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame, flac, eject, mkcue
+, perl, DigestSHA, MusicBrainz, MusicBrainzDiscID
 , makeWrapper }:
 
-let version = "2.3.99.6";
+let version = "2.5.4";
 in
   stdenv.mkDerivation {
     name = "abcde-${version}";
     src = fetchurl {
       url = "mirror://debian/pool/main/a/abcde/abcde_${version}.orig.tar.gz";
-      sha256 = "1wl4ygj1cf1d6g05gwwygsd5g83l039fzi011r30ma5lnm763lyb";
+      sha256 = "14g5lsgh53hza9848351kwpygc0yqpvvzp3s923aja77f2wpkdl5";
     };
 
     # FIXME: This package does not support MP3 encoding (only Ogg),
     # nor `distmp3', `eject', etc.
 
-    patches = [ ./install.patch ./which.patch ./cd-paranoia.patch ];
+    patches = [ ./abcde.patch ];
 
     configurePhase = ''
       sed -i "s|^[[:blank:]]*prefix *=.*$|prefix = $out|g ;
@@ -29,25 +30,37 @@ in
 
       substituteInPlace "abcde"					\
 	--replace "/etc/abcde.conf" "$out/etc/abcde.conf"
+
     '';
 
+    # no ELFs in this package, only scripts
+    dontStrip = true;
+    dontPatchELF = true;
+
     buildInputs = [ makeWrapper ];
 
     postInstall = ''
-      substituteInPlace "$out/bin/cddb-tool" \
-         --replace '#!/bin/sh' '#!${bash}/bin/sh'
-      substituteInPlace "$out/bin/abcde" \
-         --replace '#!/bin/bash' '#!${bash}/bin/bash'
+    #   substituteInPlace "$out/bin/cddb-tool" \
+    #      --replace '#!/bin/sh' '#!${bash}/bin/sh'
+    #   substituteInPlace "$out/bin/abcde" \
+    #      --replace '#!/bin/bash' '#!${bash}/bin/bash'
+
+      # generic fixup script should be doing this, but it ignores this file for some reason
+      substituteInPlace "$out/bin/abcde-musicbrainz-tool" \
+         --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'
 
       wrapProgram "$out/bin/abcde" --prefix PATH ":" \
         "$out/bin:${libcdio}/bin:${cddiscid}/bin:${wget}/bin:${vorbisTools}/bin:${id3v2}/bin:${lame}/bin"
 
       wrapProgram "$out/bin/cddb-tool" --prefix PATH ":" \
         "${wget}/bin"
+
+      wrapProgram "$out/bin/abcde-musicbrainz-tool" --prefix PATH ":" \
+        "${wget}/bin"
     '';
 
     meta = {
-      homepage = http://www.hispalinux.es/~data/abcde.php;
+      homepage = "http://lly.org/~rcw/abcde/page/";
       licence = "GPLv2+";
       description = "A Better CD Encoder (ABCDE)";
 
diff --git a/pkgs/applications/audio/abcde/install.patch b/pkgs/applications/audio/abcde/install.patch
deleted file mode 100644
index f5ab75f4bb9..00000000000
--- a/pkgs/applications/audio/abcde/install.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- abcde-2.3.3/Makefile~	2005-08-26 00:43:27.000000000 +0200
-+++ abcde-2.3.3/Makefile	2008-05-26 22:20:17.000000000 +0200
-@@ -14,13 +14,13 @@ clean:
- 
- install:
- 	$(INSTALL) -d -m 755 $(bindir)
--	$(INSTALL) -m 755 -o 0 abcde $(bindir)
--	$(INSTALL) -m 755 -o 0 cddb-tool $(bindir)
-+	$(INSTALL) -m 755 abcde $(bindir)
-+	$(INSTALL) -m 755 cddb-tool $(bindir)
- 	$(INSTALL) -d -m 755 $(mandir)
--	$(INSTALL) -m 644 -o 0 abcde.1 $(mandir)
--	$(INSTALL) -m 644 -o 0 cddb-tool.1 $(mandir)
-+	$(INSTALL) -m 644 abcde.1 $(mandir)
-+	$(INSTALL) -m 644 cddb-tool.1 $(mandir)
- 	$(INSTALL) -d -m 755 $(etcdir)
--	$(INSTALL) -m 644 -o 0 abcde.conf $(etcdir)
-+	$(INSTALL) -m 644 abcde.conf $(etcdir)
- 
- tarball:
- 	@cd .. && tar czvf abcde_$(VERSION).orig.tar.gz \
diff --git a/pkgs/applications/audio/abcde/which.patch b/pkgs/applications/audio/abcde/which.patch
deleted file mode 100644
index 70474000ddd..00000000000
--- a/pkgs/applications/audio/abcde/which.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Add an alias for `which'.
-
---- abcde-2.3.99.6/abcde	2006-08-05 21:14:00.000000000 +0200
-+++ abcde-2.3.99.6/abcde	2008-10-29 22:49:16.000000000 +0100
-@@ -15,6 +15,11 @@
- 
- VERSION='2.3.99-$Revision: 222M $'
- 
-+which ()
-+{
-+  type -P $1
-+}
-+
- usage ()
- {
- echo "This is abcde v$VERSION."
diff --git a/pkgs/applications/audio/amarok/default.nix b/pkgs/applications/audio/amarok/default.nix
index ad553c9db34..8a330800b9e 100644
--- a/pkgs/applications/audio/amarok/default.nix
+++ b/pkgs/applications/audio/amarok/default.nix
@@ -1,28 +1,32 @@
 { stdenv, fetchurl, lib, qtscriptgenerator, perl, gettext, curl
 , libxml2, mysql, taglib, taglib_extras, loudmouth , kdelibs
 , qca2, libmtp, liblastfm, libgpod, pkgconfig, automoc4, phonon
-, strigi, soprano }:
+, strigi, soprano, qjson, ffmpeg, libofa }:
 
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   pname = "amarok";
-  version = "2.5.0";
+  version = "2.6.0";
 
   src = fetchurl {
     url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "0jc8fsrhshgfv441b2dgqk0wz3ms5bzjqchcj5ydxphg57dr3l8y";
+    sha256 = "1h6jzl0jnn8g05pz4mw01kz20wjjxwwz6iki7lvgj70qi3jq04m9";
   };
 
   QT_PLUGIN_PATH="${qtscriptgenerator}/lib/qt4/plugins";
+  patches = ./find-mysql.patch;
   buildInputs = [ qtscriptgenerator stdenv.gcc.libc gettext curl
     libxml2 mysql taglib taglib_extras loudmouth kdelibs automoc4 phonon strigi
-    soprano qca2 libmtp liblastfm libgpod pkgconfig ];
+    soprano qca2 libmtp liblastfm libgpod pkgconfig qjson ffmpeg libofa ];
+
+  cmakeFlags = "-DKDE4_BUILD_TESTS=OFF";
 
   postInstall = ''
     mkdir -p $out/nix-support
     echo ${qtscriptgenerator} > $out/nix-support/propagated-user-env-packages
   '';
+
   meta = {
     description = "Popular music player for KDE";
     license = "GPL";
diff --git a/pkgs/applications/audio/amarok/find-mysql.patch b/pkgs/applications/audio/amarok/find-mysql.patch
new file mode 100644
index 00000000000..57a5ec46b84
--- /dev/null
+++ b/pkgs/applications/audio/amarok/find-mysql.patch
@@ -0,0 +1,46 @@
+commit 9979970f05f25329100168d85a5c4cdc8c084b7a
+Author: Yury G. Kudryashov <urkud.urkud@gmail.com>
+Date:   Thu Aug 30 12:32:53 2012 +0400
+
+    FindMySQLAmarok.cmake: use PATH_SUFFIXES
+
+diff --git a/cmake/modules/FindMySQLAmarok.cmake b/cmake/modules/FindMySQLAmarok.cmake
+index 910b434..4c8b8e8 100644
+--- a/cmake/modules/FindMySQLAmarok.cmake
++++ b/cmake/modules/FindMySQLAmarok.cmake
+@@ -13,18 +13,17 @@
+ # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+ 
+ if(NOT WIN32)
+-    find_program(MYSQLCONFIG_EXECUTABLE NAMES mysql_config mysql_config5 PATHS ${BIN_INSTALL_DIR} ~/usr/bin /usr/local/bin)
++    find_program(MYSQLCONFIG_EXECUTABLE NAMES mysql_config mysql_config5 HINTS ${BIN_INSTALL_DIR})
+ endif(NOT WIN32)
+ 
+ find_path(MYSQL_INCLUDE_DIR mysql.h
+-    /opt/local/include/mysql5/mysql
++    PATHS
++    /opt/local/include
+     /opt/mysql/mysql/include
+-    /opt/mysqle/include/mysql
+-    /opt/ports/include/mysql5/mysql
+-    /usr/include/mysql
+-    /usr/local/include/mysql
+-    /usr/mysql/include/mysql
+-    ~/usr/include/mysql
++    /opt/mysqle/include
++    /opt/ports/include
++    /usr/mysql/include
++    PATH_SUFFIXES mysql mysql5/mysql
+ )
+ 
+ if(MYSQLCONFIG_EXECUTABLE)
+@@ -40,8 +39,7 @@ if(MYSQLCONFIG_EXECUTABLE)
+ 
+     find_library(MYSQLD_PIC_SEPARATE
+         mysqld_pic
+-        PATHS
+-        /usr/lib/mysql
++        PATH_SUFFIXES mysql
+     )
+ 
+     if(MYSQLD_PIC_SEPARATE)
diff --git a/pkgs/applications/audio/amarok/live.nix b/pkgs/applications/audio/amarok/live.nix
deleted file mode 100644
index e90ca874827..00000000000
--- a/pkgs/applications/audio/amarok/live.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ 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
index cfa86af3c37..bf2ee04cbce 100644
--- a/pkgs/applications/audio/ardour/ardour3.nix
+++ b/pkgs/applications/audio/ardour/ardour3.nix
@@ -1,50 +1,51 @@
-{ stdenv, fetchsvn, alsaLib, aubio, boost, cairomm, curl, fftw
-, fftwSinglePrec, flac, glib, glibmm, gtk, gtkmm, jackaudio
+{ stdenv, fetchgit, alsaLib, aubio, boost, cairomm, curl, fftw
+, fftwSinglePrec, flac, glibc, glibmm, gtk, gtkmm, jackaudio
 , libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf
 , librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile
 , libusb, libuuid, libxml2, libxslt, lilv, lv2, makeWrapper, pango
 , perl, pkgconfig, python, serd, sord, sratom, suil }:
 
 let
-  # Ardour 3 Beta 5
-  rev = "13072";
+  # Ardour 3.0 tag
+  rev = "79db9422";
 in
 
 stdenv.mkDerivation {
-  name = "ardour3-svn-${rev}";
+  name = "ardour-3.0";
 
-  src = fetchsvn {
-    url = http://subversion.ardour.org/svn/ardour2/branches/3.0;
+  src = fetchgit {
+    url = git://git.ardour.org/ardour/ardour.git;
     inherit rev;
-    sha256 = "17k990kdb5q17z6jcz5b60imvvfbjw9zfxzy9fk0vg8gd6yq7736";
+    sha256 = "cdbe4ca6d4b639fcd66a3d1cf9c2816b4755655c9d81bdd2417263f413aa7096";
   };
 
   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 lilv lv2 pango perl pkgconfig python serd sord
-      sratom suil
+    [ alsaLib aubio boost cairomm curl fftw fftwSinglePrec flac glibc
+      glibmm gtk gtkmm jackaudio libgnomecanvas libgnomecanvasmm liblo
+      libmad libogg librdf librdf_raptor librdf_rasqal libsamplerate
+      libsigcxx libsndfile libusb libuuid libxml2 libxslt lilv lv2
+      makeWrapper pango perl pkgconfig python serd sord sratom suil
     ];
 
   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
+    sed 's|/usr/include/libintl.h|${glibc}/include/libintl.h|' -i wscript
   '';
 
   configurePhase = "python waf configure --prefix=$out";
 
   buildPhase = "python waf";
 
-  installPhase = "python waf install";
-
-  postInstall = ''
-    mkdir -pv $out/gtk-2.0/2.10.0/engines
-    mv lib/ardour3/libclearlooks.so $out/gtk-2.0/2.10.0/engines/
-    wrapProgram $out/bin/ardour3 --prefix GTK_PATH : $out/gtk-2.0
-    '';
+  # For the custom ardour clearlooks gtk-engine to work, it must be
+  # moved to a directory called "engines" and added to GTK_PATH
+  installPhase = ''
+    python waf install
+    mkdir -pv $out/gtk2/engines
+    mv $out/lib/ardour3/libclearlooks.so $out/gtk2/engines/
+    wrapProgram $out/bin/ardour3 --prefix GTK_PATH : $out/gtk2
+  '';
 
   meta = with stdenv.lib; {
     description = "Multi-track hard disk recording software";
diff --git a/pkgs/applications/audio/ardour/default.nix b/pkgs/applications/audio/ardour/default.nix
index 58ed4c61f4b..3ed650d4ae7 100644
--- a/pkgs/applications/audio/ardour/default.nix
+++ b/pkgs/applications/audio/ardour/default.nix
@@ -1,49 +1,42 @@
-{ stdenv, fetchsvn, scons, boost, pkgconfig, fftw, librdf_raptor
+{ stdenv, fetchurl, scons, boost, pkgconfig, fftw, librdf_raptor2
 , librdf_rasqal, jackaudio, flac, libsamplerate, alsaLib, libxml2
+, lilv, lv2, serd, sord, sratom, suil # these are probably optional
 , libxslt, libsndfile, libsigcxx, libusb, cairomm, glib, pango
-, gtk, glibmm, gtkmm, libgnomecanvas,  liblo, aubio
-, fftwSinglePrec, libmad, automake, autoconf, libtool, liblrdf }:
+, gtk, glibmm, gtkmm, libgnomecanvas, libgnomecanvasmm, liblo, aubio
+, fftwSinglePrec, libmad, automake, autoconf, libtool, liblrdf, curl }:
 
 stdenv.mkDerivation rec {
   name = "ardour-${version}";
-  version = "2.8.12";
+  version = "2.8.16";
 
-  # svn is the source to get official releases from their site?
-  # alternative: wget  --data-urlencode 'key=7c4b2e1df903aae5ff5cc4077cda801e' http://ardour.org/downloader
-  # but hash is changing ?
-
-  # TODO: see if this is also true when using a tag (~goibhniu)
-
-  # This version does not run it exits with the following error:
-  # raptor_new_uri_for_rdf_concept called with Raptor V1 world object
-  # raptor_general.c:240:raptor_init: fatal error: raptor_init() failedAborted
-  src = fetchsvn {
-    url = "http://subversion.ardour.org/svn/ardour2/tags/${version}";
-    sha256 = "0d4y8bv12kb0yd2srvxn5388sa4cl5d5rk381saj9f3jgpiciyky";
+  src = fetchurl {
+    url = "mirror://gentoo/distfiles/${name}.tar.bz2";
+    sha256 = "0h2y0x4yznalllja53anjil2gmgcb26f39zshc4gl1d1kc8k5vip";
   };
 
-  patchPhase = ''
-    sed -e "s#/usr/bin/which#type -P#" -i libs/glibmm2/autogen.sh
+  postPatch = ''
+    #sed -e "s#/usr/bin/which#type -P#" -i libs/glibmm2/autogen.sh
     echo '#include "ardour/svn_revision.h"' > libs/ardour/svn_revision.cc
     echo -e 'namespace ARDOUR {\n extern const char* svn_revision = "2.8.12";\n }\n' >> libs/ardour/svn_revision.cc
   '';
 
   buildInputs = [
-    scons boost pkgconfig fftw librdf_raptor librdf_rasqal jackaudio
+    scons boost pkgconfig fftw librdf_raptor2 librdf_rasqal jackaudio
     flac libsamplerate alsaLib libxml2 libxslt libsndfile libsigcxx
-    libusb cairomm glib pango gtk glibmm gtkmm libgnomecanvas liblrdf
-    liblo aubio fftwSinglePrec libmad autoconf automake libtool
+    #lilv lv2 serd sord sratom suil
+    libusb cairomm glib pango gtk glibmm gtkmm libgnomecanvas libgnomecanvasmm liblrdf
+    liblo aubio fftwSinglePrec libmad autoconf automake libtool curl
   ];
 
   buildPhase = ''
     mkdir -p $out
     export CXX=g++
-    scons PREFIX=$out install
+    scons PREFIX=$out SYSLIBS=1 install
   '';
-  
+
   installPhase = ":";
 
-  meta = { 
+  meta = {
     description = "Multi-track hard disk recording software";
     longDescription = ''
       Broken: use ardour3-svn instead
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index 9bd793613c1..9ac62f58570 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
 
       # Then build the plugins.
       (
-        buildNativeInputs="$out $buildNativeInputs" # to find audacious
+        nativeBuildInputs="$out $nativeBuildInputs" # to find audacious
         source $stdenv/setup
         rm -rfv audacious-*
         src=$pluginsSrc
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index 72b58b5b33e..fa392c4e43c 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -1,20 +1,32 @@
 { stdenv, fetchurl, wxGTK, pkgconfig, gettext, gtk, glib, zlib, perl, intltool,
-  libogg, libvorbis, libmad, alsaLib, libsndfile, libsamplerate, flac, lame,
-  expat, id3lib, ffmpeg, portaudio
+  libogg, libvorbis, libmad, alsaLib, libsndfile, soxr, flac, lame,
+  expat, libid3tag, ffmpeg /*, portaudio - given up fighting their portaudio.patch */
   }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.0";
+  version = "2.0.3";
   name = "audacity-${version}";
 
   src = fetchurl {
-    url = "http://audacity.googlecode.com/files/audacity-minsrc-${version}.tar.bz2";
-    sha256 = "0spbib3f86b4qri0g13idyxvysg28hkpsglmjza681zrln62hjfq";
+    url = "http://audacity.googlecode.com/files/audacity-minsrc-${version}.tar.xz";
+    sha256 = "1k4bbxhpfl80vm3gm3jxqly0syqjij5kwziy4xyq2c8aj2miwj1f";
   };
-  buildInputs = [ pkgconfig wxGTK libsndfile expat alsaLib libsamplerate
-                  libvorbis libmad flac id3lib ffmpeg gettext ];
+
+  preConfigure = /* we prefer system-wide libs */ ''
+    mv lib-src lib-src-rm
+    mkdir lib-src
+    mv lib-src-rm/{Makefile*,lib-widget-extra,portaudio-v19,portmixer,portsmf,FileDialog,sbsms} lib-src/
+    rm -r lib-src-rm/
+  '';
+
+  buildInputs = [
+    pkgconfig gettext wxGTK gtk expat alsaLib
+    libsndfile soxr libid3tag
+    ffmpeg libmad lame libvorbis flac
+  ]; #ToDo: soundtouch, detach sbsms
 
   dontDisableStatic = true;
+  doCheck = true;
 
   meta = {
     description = "Sound editor with graphical UI";
diff --git a/pkgs/applications/audio/bristol/default.nix b/pkgs/applications/audio/bristol/default.nix
new file mode 100644
index 00000000000..0978b15bfaf
--- /dev/null
+++ b/pkgs/applications/audio/bristol/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, alsaLib, jackaudio, pkgconfig, pulseaudio, xlibs }:
+
+stdenv.mkDerivation  rec {
+  name = "bristol-${version}";
+  version = "0.60.10";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/bristol/${name}.tar.gz";
+    sha256 = "070rn5zdx6vrqmq7w1rrpxig3bxlylbsw82nlmkjnhjrgm6yx753";
+  };
+
+  buildInputs = [
+    alsaLib jackaudio pkgconfig pulseaudio xlibs.libX11 xlibs.libXext
+    xlibs.xproto
+  ];
+
+  preInstall = ''
+    sed -e "s@\`which bristol\`@$out/bin/bristol@g" -i bin/startBristol
+    sed -e "s@\`which brighton\`@$out/bin/brighton@g" -i bin/startBristol
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A range of synthesiser, electric piano and organ emulations";
+    homepage = http://bristol.sourceforge.net;
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/audio/calf/default.nix b/pkgs/applications/audio/calf/default.nix
index 4b1f6dcd268..6ed4b7cce98 100644
--- a/pkgs/applications/audio/calf/default.nix
+++ b/pkgs/applications/audio/calf/default.nix
@@ -1,22 +1,25 @@
-{ stdenv, fetchurl, cairo, expat, glib, gtk, jackaudio, ladspaH
-, libglade, lv2, pkgconfig }:
+{ stdenv, fetchurl, cairo, expat, fftwSinglePrec, fluidsynth, glib
+, gtk, jackaudio, ladspaH , libglade, lv2, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "calf-${version}";
-  version = "0.0.18.6";
+  version = "0.0.19";
 
   src = fetchurl {
     url = "mirror://sourceforge/calf/${name}.tar.gz";
-    sha256 = "03w6jjkrr6w8da6qzd0x4dlkg295c6jxby500x4cj07wpbpk6irh";
+    sha256 = "1v1cjbxv5wg6rsa2nfz1f8r7cykcpx6jm5ccqmzx866dggiff1hi";
   };
 
-  buildInputs =
-    [ cairo jackaudio gtk glib expat libglade ladspaH lv2 pkgconfig ];
+  buildInputs = [ 
+    cairo expat fftwSinglePrec fluidsynth glib gtk jackaudio ladspaH
+    libglade lv2 pkgconfig
+  ];
 
   meta = with stdenv.lib; {
     homepage = http://calf.sourceforge.net;
     description = "A set of high quality open source audio plugins for musicians";
     license = licenses.lgpl2;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/caps/default.nix b/pkgs/applications/audio/caps/default.nix
new file mode 100644
index 00000000000..81fb77c1c9a
--- /dev/null
+++ b/pkgs/applications/audio/caps/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  name = "caps-${version}";
+  version = "0.9.7";
+  src = fetchurl {
+    url = "http://www.quitte.de/dsp/caps_${version}.tar.bz2";
+    sha256 = "0ks98r3j404s9h88x50lj5lj4l64ijj29fz5i08iyq8jrb7r0zm0";
+  };
+  configurePhase = ''
+    echo "PREFIX = $out" > defines.make
+  '';
+
+  meta = {
+    description = "A selection of LADSPA plugins implementing classic effects";
+    longDescription = ''
+      The C* Audio Plugin Suite is a selection of classic effects,
+      unique filters and signal generators.  The digital guitarist
+      finds in CAPS a range of processors recreating key aspects of
+      the formation of tone in traditional electronic instrument
+      amplification.  Beyond sound quality, central design
+      considerations are latency-free realtime operation, modesty of
+      resource demands and meaningful control interfaces.
+    '';
+    homepage = http://www.quitte.de/dsp/caps.html;
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.astsmtl ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix
index 1bfb2df2745..2ea37e2bd23 100644
--- a/pkgs/applications/audio/cmus/default.nix
+++ b/pkgs/applications/audio/cmus/default.nix
@@ -2,17 +2,17 @@
 
 stdenv.mkDerivation rec {
   name = "cmus-${version}";
-  version = "2.3.3";
-
-  configurePhase = "./configure prefix=$out";
-
-  buildInputs = [ ncurses pkgconfig alsaLib flac libmad ffmpeg libvorbis mpc mp4v2 ];
+  version = "2.5.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/cmus/cmus-v${version}.tar.bz2";
-    sha256 = "13hc5d7h2ayjwnip345hc59rpjj9fgrp1i5spjw3s14prdqr733v";
+    sha256 = "1pwd3jifv12yr0yr77hsv5c9y8ay6kn2b5a3s5i8v2c882vgl890";
   };
 
+  configurePhase = "./configure prefix=$out";
+
+  buildInputs = [ ncurses pkgconfig alsaLib flac libmad ffmpeg libvorbis mpc mp4v2 ];
+
   meta = {
     description = "cmus is a small, fast and powerful console music player for Linux and *BSD";
     homepage = http://cmus.sourceforge.net;
diff --git a/pkgs/applications/audio/csound/default.nix b/pkgs/applications/audio/csound/default.nix
new file mode 100644
index 00000000000..5e3d056f498
--- /dev/null
+++ b/pkgs/applications/audio/csound/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, cmake, libsndfile, flex, bison
+, alsaLib ? null
+, pulseaudio ? null
+, tcltk ? null
+
+# maybe csound can be compiled with support for those, see configure output
+# , ladspa ? null
+# , fluidsynth ? null
+# , jack ? null
+# , gmm ? null
+# , wiiuse ? null
+}:
+
+stdenv.mkDerivation {
+  name = "csound-5.18.02";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = http://netcologne.dl.sourceforge.net/project/csound/csound5/csound5.18/Csound5.18.02.tar.gz;
+    sha256 = "4c461cf3bf60b83671224949dd33805379b7121bf2c0ad6af5e191e7f6f8adc8";
+  };
+
+  buildInputs = [ cmake libsndfile flex bison alsaLib pulseaudio tcltk ];
+
+  meta = {
+    description = "sound design, audio synthesis, and signal processing system, providing facilities for music composition and performance on all major operating systems and platforms";
+    homepage = http://www.csounds.com/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
new file mode 100644
index 00000000000..809a02e1c7a
--- /dev/null
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchgit, alsaLib, fftwSinglePrec, freetype, jackaudio
+, libxslt, lv2, pkgconfig, premake3, xlibs }:
+
+let
+  rev = "99efbf0b";
+in
+stdenv.mkDerivation rec {
+  name = "distrho-${rev}";
+
+  src = fetchgit {
+    url = "https://github.com/falkTX/DISTRHO.git";
+    inherit rev;
+    sha256 = "ed26a6edca19ebb8260b3dc042f69c32162e1d91179fb9d22da42ec7131936f9";
+  };
+
+  patchPhase = ''
+    sed -e "s#@./scripts#sh scripts#" -i Makefile
+  '';
+
+  buildInputs = [
+    alsaLib fftwSinglePrec freetype jackaudio pkgconfig premake3
+    xlibs.libX11 xlibs.libXcomposite xlibs.libXcursor xlibs.libXext
+    xlibs.libXinerama xlibs.libXrender
+  ];
+
+  buildPhase = ''
+    sh ./scripts/premake-update.sh linux
+    make standalone
+    make lv2
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/standalone/* $out/bin/
+    mkdir -p $out/lib/lv2
+    cp -a bin/lv2/* $out/lib/lv2/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://distrho.sourceforge.net;
+    description = "A collection of cross-platform audio effects and plugins";
+    longDescription = ''
+      Includes:
+      3BandEQ bitmangler drowaudio-distortion drowaudio-flanger
+      drowaudio-tremolo eqinox juce_pitcher sDelay TAL-Filter
+      TAL-NoiseMaker TAL-Reverb-2 TAL-Vocoder-2 ThePilgrim
+      Wolpertinger argotlunar capsaicin drowaudio-distortionshaper
+      drowaudio-reverb drumsynth highlife JuceDemoPlugin PingPongPan
+      TAL-Dub-3 TAL-Filter-2 TAL-Reverb TAL-Reverb-3 TheFunction vex
+    '';
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/drumkv1/default.nix b/pkgs/applications/audio/drumkv1/default.nix
new file mode 100644
index 00000000000..7fdd04ce96b
--- /dev/null
+++ b/pkgs/applications/audio/drumkv1/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+
+stdenv.mkDerivation rec {
+  name = "drumkv1-${version}";
+  version = "0.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/drumkv1/${name}.tar.gz";
+    sha256 = "0bafg06iavri9dmg7hpz554kpqf1iv9crcdq46y4n4wyyxd7kajl";
+  };
+
+  buildInputs = [ jackaudio libsndfile lv2 qt4 ];
+
+  meta = with stdenv.lib; {
+    description = "An old-school drum-kit sampler synthesizer with stereo fx";
+    homepage = http://drumkv1.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/audio/espeak/default.nix b/pkgs/applications/audio/espeak/default.nix
index e86177bb53c..e1cf5fee1cc 100644
--- a/pkgs/applications/audio/espeak/default.nix
+++ b/pkgs/applications/audio/espeak/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, unzip, portaudio }:
 
 stdenv.mkDerivation {
-  name = "espeak-1.44.03";
+  name = "espeak-1.46.02";
   src = fetchurl {
-    url = mirror://sourceforge/espeak/espeak-1.44.03-source.zip;
-    sha256 = "0lnv89xmsq3bax0qpabd0z2adaag7mdl973bkw3gdszidafmfyx4";
+    url = mirror://sourceforge/espeak/espeak-1.46.02-source.zip;
+    sha256 = "1fjlv5fm0gzvr5wzy1dp4nspw04k0bqv3jymha2p2qfjbfifp2zg";
   };
 
   buildInputs = [ unzip portaudio ];
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
 
   configurePhase = ''
     cd src
-    makeFlags="PREFIX=$out"
+    makeFlags="PREFIX=$out DATADIR=$out/share/espeak-data"
   '';
 
   meta = {
diff --git a/pkgs/applications/audio/espeak/edit.nix b/pkgs/applications/audio/espeak/edit.nix
new file mode 100644
index 00000000000..eb34335721f
--- /dev/null
+++ b/pkgs/applications/audio/espeak/edit.nix
@@ -0,0 +1,31 @@
+{stdenv, fetchurl, unzip, portaudio, wxGTK}:
+
+stdenv.mkDerivation {
+  name = "espeakedit-1.46.02";
+  src = fetchurl {
+    url = mirror://sourceforge/espeak/espeakedit-1.46.02.zip;
+    sha256 = "1cc5r89sn8zz7b8wj4grx9xb7aqyi0ybj0li9hpy7hd67r56kqkl";
+  };
+
+  buildInputs = [ unzip portaudio wxGTK ];
+
+  patchPhase = if portaudio.api_version == 19 then ''
+    cp src/portaudio19.h src/portaudio.h
+  '' else "";
+
+  buildPhase = ''
+    cd src
+    gcc -o espeakedit *.cpp `wx-config --cxxflags --libs`
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp espeakedit $out/bin
+  '';
+
+  meta = {
+    description = "Phoneme editor for espeak";
+    homepage = http://espeak.sourceforge.net/;
+    license = "GPLv3+";
+  };
+}
diff --git a/pkgs/applications/audio/flac/default.nix b/pkgs/applications/audio/flac/default.nix
index dedd3e0139a..8b31b36858d 100644
--- a/pkgs/applications/audio/flac/default.nix
+++ b/pkgs/applications/audio/flac/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   patches =
     [ # Fix for building on GCC 4.3.
       (fetchurl {
-        url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/media-libs/flac/files/flac-1.2.1-gcc-4.3-includes.patch?rev=1.1";
+        url = "http://sourceforge.net/p/flac/patches/_discuss/thread/9d4c7504/d8ea/attachment/flac-1.2.1-gcc-4.3-includes.patch";
         sha256 = "1m6ql5vyjb2jlp5qiqp6w0drq1m6x6y3i1dnl5ywywl3zd36k0mr";
       })
     ];
diff --git a/pkgs/applications/audio/gmpc/default.nix b/pkgs/applications/audio/gmpc/default.nix
new file mode 100644
index 00000000000..10a2f0dcee9
--- /dev/null
+++ b/pkgs/applications/audio/gmpc/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, libtool, intltool, pkgconfig, glib
+, gtk, curl, mpd_clientlib, libsoup, gob2, vala
+}:
+
+stdenv.mkDerivation rec {
+  name = "gmpc-${version}";
+  version = "11.8.16";
+
+  libmpd = stdenv.mkDerivation {
+    name = "libmpd-11.8.17";
+    src = fetchurl {
+      url = http://download.sarine.nl/Programs/gmpc/11.8/libmpd-11.8.17.tar.gz;
+      sha256 = "10vspwsgr8pwf3qp2bviw6b2l8prgdiswgv7qiqiyr0h1mmk487y";
+    };
+    buildInputs = [ pkgconfig glib ];
+  };
+
+  libunique = stdenv.mkDerivation {
+    name = "libunique-1.1.6";
+    src = fetchurl {
+      url = http://ftp.gnome.org/pub/GNOME/sources/libunique/1.1/libunique-1.1.6.tar.gz;
+      sha256 = "2cb918dde3554228a211925ba6165a661fd782394bd74dfe15e3853dc9c573ea";
+    };
+    buildInputs = [ pkgconfig glib gtk ];
+
+    patches = [
+      (fetchurl {
+        url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/remove_G_CONST_RETURN.patch?h=packages/libunique";
+        sha256 = "0da2qi7cyyax4rr1p25drlhk360h8d3lapgypi5w95wj9k6bykhr";
+      })
+    ];
+  };
+
+  src = fetchurl {
+    url = "http://download.sarine.nl/Programs/gmpc/11.8/gmpc-11.8.16.tar.gz";
+    sha256 = "0b3bnxf98i5lhjyljvgxgx9xmb6p46cn3a9cccrng14nagri9556";
+  };
+
+  buildInputs = [
+    libtool intltool pkgconfig glib gtk curl mpd_clientlib libsoup
+    libunique libmpd gob2 vala
+  ];
+
+  meta = with stdenv.lib; {
+    homepage = http://gmpclient.org;
+    description = "A GTK2 frontend for Music Player Daemon";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.rickynils ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/guitarix/default.nix b/pkgs/applications/audio/guitarix/default.nix
new file mode 100644
index 00000000000..17d53a621ca
--- /dev/null
+++ b/pkgs/applications/audio/guitarix/default.nix
@@ -0,0 +1,53 @@
+{ stdenv, fetchurl, python, gettext, intltool, pkgconfig, jackaudio, libsndfile
+, glib, gtk, glibmm, gtkmm, fftw, librdf, ladspaH, boost }:
+
+stdenv.mkDerivation rec {
+  name = "guitarix-${version}";
+  version = "0.25.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/guitarix/guitarix2-${version}.tar.bz2";
+    sha256 = "1wcg3yc2iy72hj6z9l88393f00by0iwhhn8xrc3q55p4rj0mnrga";
+  };
+
+  buildInputs =
+    [ python gettext intltool pkgconfig jackaudio libsndfile glib gtk glibmm
+      gtkmm fftw librdf ladspaH boost
+    ];
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf build";
+
+  installPhase = "python waf install";
+
+  meta = { 
+    description = "A virtual guitar amplifier for Linux running with JACK";
+    longDescription = ''
+        guitarix is a virtual guitar amplifier for Linux running with
+      JACK (Jack Audio Connection Kit). It is free as in speech and
+      free as in beer. Its free sourcecode allows to build it for
+      other UNIX-like systems also, namely for BSD and for MacOSX.
+
+        It takes the signal from your guitar as any real amp would do:
+      as a mono-signal from your sound card. Your tone is processed by
+      a main amp and a rack-section. Both can be routed separately and
+      deliver a processed stereo-signal via JACK. You may fill the
+      rack with effects from more than 25 built-in modules spanning
+      from a simple noise-gate to brain-slashing modulation-fx like
+      flanger, phaser or auto-wah. Your signal is processed with
+      minimum latency. On any properly set-up Linux-system you do not
+      need to wait for more than 10 milli-seconds for your playing to
+      be delivered, processed by guitarix.
+
+        guitarix offers the range of sounds you would expect from a
+      full-featured universal guitar-amp. You can get crisp
+      clean-sounds, nice overdrive, fat distortion and a diversity of
+      crazy sounds never heard before.
+    '';
+    homepage = http://guitarix.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.astsmtl ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/hydrogen/default.nix b/pkgs/applications/audio/hydrogen/default.nix
index 6b994c7d9ae..bb10f24b90a 100644
--- a/pkgs/applications/audio/hydrogen/default.nix
+++ b/pkgs/applications/audio/hydrogen/default.nix
@@ -20,7 +20,8 @@ stdenv.mkDerivation rec {
   postPatch = ''
     sed -e 's#/usr/lib/ladspa#${ladspaPlugins}/lib/ladspa#' -i libs/hydrogen/src/preferences.cpp
     sed '/\/usr/d' -i libs/hydrogen/src/preferences.cpp
-    '';
+    sed "s#pkg_ver.rstrip().split('.')#pkg_ver.rstrip().split('.')[:3]#" -i Sconstruct
+  '';
 
   # why doesn't scons find librdf?
   buildPhase = ''
diff --git a/pkgs/applications/audio/id3v2/default.nix b/pkgs/applications/audio/id3v2/default.nix
index 8e7f573cc84..8a025ac6843 100644
--- a/pkgs/applications/audio/id3v2/default.nix
+++ b/pkgs/applications/audio/id3v2/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./id3v2-0.1.11-track-bad-free.patch ];
 
-  buildNativeInputs = [ groff ];
+  nativeBuildInputs = [ groff ];
   buildInputs = [ id3lib ];
 
   configurePhase = ''
diff --git a/pkgs/applications/audio/jack-capture/default.nix b/pkgs/applications/audio/jack-capture/default.nix
new file mode 100644
index 00000000000..3b8f0f652a8
--- /dev/null
+++ b/pkgs/applications/audio/jack-capture/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, jackaudio, libsndfile, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "jack_capture-${version}";
+  version = "0.9.69";
+
+  src = fetchurl {
+    url = "http://archive.notam02.no/arkiv/src/${name}.tar.gz";
+    sha256 = "0sk7b92my1v1g7rhkpl1c608rb0rdb28m9zqfll95kflxajd16zv";
+  };
+
+  buildInputs = [ jackaudio libsndfile pkgconfig ];
+
+  buildPhase = "PREFIX=$out make jack_capture";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp jack_capture $out/bin/
+  '';
+
+  meta = with stdenv.lib; { 
+    description = "A program for recording soundfiles with jack";
+    homepage = http://archive.notam02.no/arkiv/src;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/jack-oscrolloscope/default.nix b/pkgs/applications/audio/jack-oscrolloscope/default.nix
new file mode 100644
index 00000000000..dbceb0a336c
--- /dev/null
+++ b/pkgs/applications/audio/jack-oscrolloscope/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, SDL, jackaudio, mesa, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "jack_oscrolloscope-${version}";
+  version = "0.7";
+
+  src = fetchurl {
+    url = "http://das.nasophon.de/download/${name}.tar.gz";
+    sha256 = "1pl55in0sj7h5r06n1v91im7d18pplvhbjhjm1fdl39zwnyxiash";
+  };
+
+  buildInputs = [ SDL jackaudio mesa pkgconfig ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv jack_oscrolloscope $out/bin/
+  '';
+
+  meta = with stdenv.lib; { 
+    description = "A simple waveform viewer for JACK";
+    homepage = http://das.nasophon.de/jack_oscrolloscope;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/jack-rack/default.nix b/pkgs/applications/audio/jack-rack/default.nix
new file mode 100644
index 00000000000..1d1128e663d
--- /dev/null
+++ b/pkgs/applications/audio/jack-rack/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, jackaudio, ladspaH, gtk, alsaLib, libxml2, librdf }:
+stdenv.mkDerivation rec {
+  name = "jack-rack-1.4.7";
+  src = fetchurl {
+    url = "mirror://sourceforge/jack-rack/${name}.tar.bz2";
+    sha256 = "1lmibx9gicagcpcisacj6qhq6i08lkl5x8szysjqvbgpxl9qg045";
+  };
+  buildInputs = [ pkgconfig jackaudio ladspaH gtk alsaLib libxml2 librdf ];
+
+  meta = {
+    description = ''An effects "rack" for the JACK low latency audio API'';
+    longDescription = ''
+      JACK Rack is an effects "rack" for the JACK low latency audio
+      API. The rack can be filled with LADSPA effects plugins and can
+      be controlled using the ALSA sequencer. It's phat; it turns your
+      computer into an effects box.
+    '';
+    homepage = http://jack-rack.sourceforge.net/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.astsmtl ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/jalv/default.nix b/pkgs/applications/audio/jalv/default.nix
new file mode 100644
index 00000000000..5655c7d832b
--- /dev/null
+++ b/pkgs/applications/audio/jalv/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, gtk, jackaudio, lilv, lv2, pkgconfig, python
+, serd, sord , sratom, suil }:
+
+stdenv.mkDerivation  rec {
+  name = "jalv-${version}";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "http://download.drobilla.net/${name}.tar.bz2";
+    sha256 = "1hq968fhiz86428krqhjl3vlw71bigc9bsfcv97zgvsjh0fh6qa0";
+  };
+
+  buildInputs = [
+    gtk jackaudio lilv lv2 pkgconfig python serd sord sratom suil
+  ];
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf";
+
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    description = "A simple but fully featured LV2 host for Jack";
+    homepage = http://drobilla.net/software/jalv;
+    license = licenses.isc;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/lame/default.nix b/pkgs/applications/audio/lame/default.nix
index 46bbf10f357..09b553a099c 100644
--- a/pkgs/applications/audio/lame/default.nix
+++ b/pkgs/applications/audio/lame/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, nasm}:
 
 stdenv.mkDerivation rec {
-  name = "lame-3.98.4";
+  name = "lame-3.99.5";
   src = fetchurl {
     url = "mirror://sourceforge/lame/${name}.tar.gz";
-    sha256 = "1j3jywv6ic2cy0x0q1a1h6rcl6xmcs5f58xawjdkl8hpcv3l8cdc";
+    sha256 = "1zr3kadv35ii6liia0bpfgxpag27xcivp571ybckpbz4b10nnd14";
   };
 
   buildInputs = [ nasm ];
diff --git a/pkgs/applications/audio/lash/default.nix b/pkgs/applications/audio/lash/default.nix
index 3bbc9e4277b..72087c76b05 100644
--- a/pkgs/applications/audio/lash/default.nix
+++ b/pkgs/applications/audio/lash/default.nix
@@ -12,7 +12,8 @@ stdenv.mkDerivation  rec {
     sha256 = "05kc4brcx8mncai0rj2gz4s4bsrsy9q8xlnaddf75i0m8jl7snhh";
   };
 
-  patches = [ ./socket.patch ];
+  # http://permalink.gmane.org/gmane.linux.redhat.fedora.extras.cvs/822346
+  patches = [ ./socket.patch ./gcc-47.patch ];
 
   buildInputs = [ alsaLib gtk jackaudio libuuid libxml2 makeWrapper
     pkgconfig readline ];
diff --git a/pkgs/applications/audio/lash/gcc-47.patch b/pkgs/applications/audio/lash/gcc-47.patch
new file mode 100644
index 00000000000..774add431fa
--- /dev/null
+++ b/pkgs/applications/audio/lash/gcc-47.patch
@@ -0,0 +1,11 @@
+diff -rupN liblash/lash.c lash-0.5.4/liblash/lash.c
+--- a/liblash/lash.c	2007-03-09 10:34:40.000000000 -0500
++++ b/liblash/lash.c	2012-07-22 18:17:46.003963521 -0400
+@@ -22,6 +22,7 @@
+ #include <string.h>
+ #include <strings.h>
+ #include <pthread.h>
++#include <sys/resource.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+ #include <sys/socket.h>
diff --git a/pkgs/applications/audio/lastwatch/default.nix b/pkgs/applications/audio/lastwatch/default.nix
new file mode 100644
index 00000000000..324a0b0bebc
--- /dev/null
+++ b/pkgs/applications/audio/lastwatch/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchgit, pythonPackages }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "lastwatch-${version}";
+  namePrefix = "";
+  version = "0.4.1";
+
+  src = fetchgit {
+    url = "git://github.com/aszlig/LastWatch.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "c43f0fd87e9f3daafc7e8676daf2e89c8e21fbabc278eb1455e28d2997587a92";
+  };
+
+  pythonPath = [
+    pythonPackages.pyinotify
+    pythonPackages.pylast
+    pythonPackages.mutagen
+  ];
+
+  propagatedBuildInputs = pythonPath;
+
+  installCommand = "python setup.py install --prefix=$out";
+
+  meta = {
+    homepage = "https://github.com/aszlig/LastWatch";
+    description = "An inotify-based last.fm audio scrobbler";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/audio/linuxsampler/default.nix b/pkgs/applications/audio/linuxsampler/default.nix
index 1ef081c84d0..1408a1775ee 100644
--- a/pkgs/applications/audio/linuxsampler/default.nix
+++ b/pkgs/applications/audio/linuxsampler/default.nix
@@ -11,9 +11,16 @@ stdenv.mkDerivation rec {
     sha256 = "0zsrvs9dwwhjx733m45vfi11yjkqv33z8qxn2i9qriq5zs1f0kd7";
   };
 
-  patchPhase = "sed -e 's/which/type -P/g' -i scripts/generate_parser.sh";
+  patches = ./linuxsampler_lv2_sfz_fix.diff;
 
-  preConfigure = "make -f Makefile.cvs";
+  # It fails to compile without this option. I'm not sure what the bug
+  # is, but everything works OK for me (goibhniu).
+  configureFlags = [ "--disable-nptl-bug-check" ];
+
+  preConfigure = ''
+    sed -e 's/which/type -P/g' -i scripts/generate_parser.sh
+    make -f Makefile.cvs
+  '';
 
   buildInputs = [ 
    alsaLib asio autoconf automake bison jackaudio libgig libsndfile
@@ -34,7 +41,8 @@ stdenv.mkDerivation rec {
       have questions on the subject, that are not yet covered by the
       FAQ, please contact us.
     ''; 
-    license = licenses.gpl2;
+    license = licenses.unfree;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff b/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff
new file mode 100644
index 00000000000..114726db19d
--- /dev/null
+++ b/pkgs/applications/audio/linuxsampler/linuxsampler_lv2_sfz_fix.diff
@@ -0,0 +1,50 @@
+Index: linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp
+===================================================================
+--- linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp	(revision 2359)
++++ linuxsampler-r2359/src/hostplugins/lv2/PluginLv2.cpp	(working copy)
+@@ -18,6 +18,8 @@
+  *   MA  02110-1301  USA                                                   *
+  ***************************************************************************/
+ 
++#define _BSD_SOURCE 1  /* for realpath() */
++
+ #include <algorithm>
+ #include <cassert>
+ #include <cstdio>
+@@ -118,6 +120,23 @@
+         dmsg(2, ("linuxsampler: Deactivate\n"));
+     }
+ 
++    static String RealPath(const String& path)
++    {
++        String out   = path;
++        char*  cpath = NULL;
++#ifdef _WIN32
++        cpath = (char*)malloc(MAX_PATH);
++        GetFullPathName(path.c_str(), MAX_PATH, cpath, NULL);
++#else
++        cpath = realpath(path.c_str(), NULL);
++#endif
++        if (cpath) {
++            out = cpath;
++            free(cpath);
++        }
++        return out;
++    }
++
+     String PluginLv2::PathToState(const String& path) {
+         if (MapPath) {
+             char* cstr = MapPath->abstract_path(MapPath->handle, path.c_str());
+@@ -131,9 +150,10 @@
+     String PluginLv2::PathFromState(const String& path) {
+         if (MapPath) {
+             char* cstr = MapPath->absolute_path(MapPath->handle, path.c_str());
+-            const String abstract_path(cstr);
++            // Resolve symbolic links so SFZ sample paths load correctly
++            const String absolute_path(RealPath(cstr));
+             free(cstr);
+-            return abstract_path;
++            return absolute_path;
+         }
+         return path;
+     }
diff --git a/pkgs/applications/audio/mda-lv2/default.nix b/pkgs/applications/audio/mda-lv2/default.nix
new file mode 100644
index 00000000000..8b7d5527372
--- /dev/null
+++ b/pkgs/applications/audio/mda-lv2/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, fftwSinglePrec, lv2, pkgconfig, python }:
+
+stdenv.mkDerivation rec {
+  name = "mda-lv2-${version}";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "http://download.drobilla.net/${name}.tar.bz2";
+    sha256 = "1dbgvpz9qvlwsfkq9c0dx45bm223wwrzgiddlyln1agpns3qbf0f";
+  };
+
+  buildInputs = [ fftwSinglePrec lv2 pkgconfig python ];
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf";
+
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    homepage = http://drobilla.net/software/mda-lv2/;
+    description = "An LV2 port of the MDA plugins by Paul Kellett";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/mid2key/default.nix b/pkgs/applications/audio/mid2key/default.nix
new file mode 100644
index 00000000000..1e163391a39
--- /dev/null
+++ b/pkgs/applications/audio/mid2key/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, alsaLib, libX11, libXi, libXtst, xextproto }:
+
+stdenv.mkDerivation rec {
+  name = "mid2key-r1";
+
+  src = fetchurl {
+    url = "http://mid2key.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0j2vsjvdgx51nd1qmaa18mcy0yw9pwrhbv2mdwnf913bwsk4y904";
+  };
+
+  unpackPhase = "tar xvzf $src";
+
+  buildInputs = [ alsaLib libX11 libXi libXtst xextproto ];
+
+  buildPhase = "make";
+
+  installPhase = "mkdir -p $out/bin && mv mid2key $out/bin";
+
+  meta = with stdenv.lib; {
+    homepage = http://code.google.com/p/mid2key/;
+    description = "A simple tool which maps midi notes to simulated keystrokes";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/monkeys-audio/buildfix.diff b/pkgs/applications/audio/monkeys-audio/buildfix.diff
new file mode 100644
index 00000000000..3c48f6ad828
--- /dev/null
+++ b/pkgs/applications/audio/monkeys-audio/buildfix.diff
@@ -0,0 +1,27 @@
+diff -ru monkeys-audio-3.99-u4-b5/src/MACLib/APELink.cpp monkeys-audio-3.99-u4-b5.patched/src/MACLib/APELink.cpp
+--- monkeys-audio-3.99-u4-b5/src/MACLib/APELink.cpp	2006-06-01 11:00:57.000000000 +0200
++++ monkeys-audio-3.99-u4-b5.patched/src/MACLib/APELink.cpp	2012-01-05 14:51:47.000000000 +0100
+@@ -63,10 +63,10 @@
+     if (pData != NULL)
+     {
+         // parse out the information
+-        char * pHeader = strstr(pData, APE_LINK_HEADER);
+-        char * pImageFile = strstr(pData, APE_LINK_IMAGE_FILE_TAG);
+-        char * pStartBlock = strstr(pData, APE_LINK_START_BLOCK_TAG);
+-        char * pFinishBlock = strstr(pData, APE_LINK_FINISH_BLOCK_TAG);
++        const char * pHeader = strstr(pData, APE_LINK_HEADER);
++        const char * pImageFile = strstr(pData, APE_LINK_IMAGE_FILE_TAG);
++        const char * pStartBlock = strstr(pData, APE_LINK_START_BLOCK_TAG);
++        const char * pFinishBlock = strstr(pData, APE_LINK_FINISH_BLOCK_TAG);
+ 
+         if (pHeader && pImageFile && pStartBlock && pFinishBlock)
+         {
+@@ -81,7 +81,7 @@
+                 
+                 // get the path
+                 char cImageFile[MAX_PATH + 1]; int nIndex = 0;
+-                char * pImageCharacter = &pImageFile[strlen(APE_LINK_IMAGE_FILE_TAG)];
++                const char * pImageCharacter = &pImageFile[strlen(APE_LINK_IMAGE_FILE_TAG)];
+                 while ((*pImageCharacter != 0) && (*pImageCharacter != '\r') && (*pImageCharacter != '\n'))
+                     cImageFile[nIndex++] = *pImageCharacter++;
+                 cImageFile[nIndex] = 0;
diff --git a/pkgs/applications/audio/monkeys-audio/default.nix b/pkgs/applications/audio/monkeys-audio/default.nix
new file mode 100644
index 00000000000..48b0b52c5ea
--- /dev/null
+++ b/pkgs/applications/audio/monkeys-audio/default.nix
@@ -0,0 +1,14 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  version = "3.99-u4-b5";
+  pname = "monkeys-audio";
+  name = pname + "-" + version;
+
+  patches = [ ./buildfix.diff ];
+
+  src = fetchurl {
+    url = "http://deb-multimedia.org/pool/main/m/${pname}/${pname}_${version}.orig.tar.gz";
+    sha256 = "0kjfwzfxfx7f958b2b1kf8yj655lp0ppmn0sh57gbkjvj8lml7nz";
+  };
+}
diff --git a/pkgs/applications/audio/mopidy/default.nix b/pkgs/applications/audio/mopidy/default.nix
new file mode 100644
index 00000000000..d79ef44cabe
--- /dev/null
+++ b/pkgs/applications/audio/mopidy/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchgit, pythonPackages, pygobject, gst_python
+, gst_plugins_good, gst_plugins_base
+}:
+
+pythonPackages.buildPythonPackage rec {
+  name = "mopidy-${version}";
+
+  version = "0.14.1";
+
+  src = fetchgit {
+    url = "https://github.com/mopidy/mopidy.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "0lgd8dpiri9m6sigpf1g1qzvz25lkb38lskgwvb8j7x64y104z0v";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [
+   gst_python pygobject pykka pyspotify pylast cherrypy ws4py
+  ];
+
+  # python zip complains about old timestamps
+  preConfigure = ''
+    find -print0 | xargs -0 touch
+  '';
+
+  # There are no tests
+  doCheck = false;
+
+  postInstall = ''
+    for p in $out/bin/mopidy $out/bin/mopidy-scan; do
+      wrapProgram $p \
+        --prefix GST_PLUGIN_PATH : ${gst_plugins_good}/lib/gstreamer-0.10 \
+        --prefix GST_PLUGIN_PATH : ${gst_plugins_base}/lib/gstreamer-0.10
+    done
+  '';
+
+  meta = {
+    homepage = http://www.mopidy.com/;
+    description = ''
+      A music server which can play music from Spotify and from your
+      local hard drive.
+    '';
+    maintainers = [ stdenv.lib.maintainers.rickynils ];
+  };
+}
diff --git a/pkgs/applications/audio/mopidy/git.nix b/pkgs/applications/audio/mopidy/git.nix
new file mode 100644
index 00000000000..2b5e1627ac6
--- /dev/null
+++ b/pkgs/applications/audio/mopidy/git.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchgit, pythonPackages, pygobject, gst_python
+, gst_plugins_good, gst_plugins_base
+}:
+
+pythonPackages.buildPythonPackage rec {
+  name = "mopidy-${version}";
+
+  version = "git-20130226";
+
+  src = fetchgit {
+    url = "https://github.com/mopidy/mopidy.git";
+    rev = "86a7c2d7519680c6b9130795d35c4654958f4c04";
+    sha256 = "00fxcfkpl19nslv4f4bspzw0kvjjp6hhcwag7rknmb8scfinqfac";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [
+   gst_python pygobject pykka pyspotify pylast cherrypy ws4py
+  ];
+
+  # python zip complains about old timestamps
+  preConfigure = ''
+    find -print0 | xargs -0 touch
+  '';
+
+  # There are no tests
+  doCheck = false;
+
+  postInstall = ''
+    for p in $out/bin/mopidy $out/bin/mopidy-scan; do
+      wrapProgram $p \
+        --prefix GST_PLUGIN_PATH : ${gst_plugins_good}/lib/gstreamer-0.10 \
+        --prefix GST_PLUGIN_PATH : ${gst_plugins_base}/lib/gstreamer-0.10
+    done
+  '';
+
+  meta = {
+    homepage = http://www.mopidy.com/;
+    description = ''
+      A music server which can play music from Spotify and from your
+      local hard drive.
+    '';
+    maintainers = [ stdenv.lib.maintainers.rickynils ];
+  };
+}
diff --git a/pkgs/applications/audio/ncmpcpp/default.nix b/pkgs/applications/audio/ncmpcpp/default.nix
index b9d30409711..b6ac7f26d60 100644
--- a/pkgs/applications/audio/ncmpcpp/default.nix
+++ b/pkgs/applications/audio/ncmpcpp/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, ncurses, curl, taglib, fftw, mpd_clientlib, pkgconfig}:
 
 stdenv.mkDerivation rec {
-  version = "0.5.8";
+  version = "0.5.10";
   name = "ncmpcpp-${version}";
 
   src = fetchurl {
-    url = "http://unkart.ovh.org/ncmpcpp/ncmpcpp-${version}.tar.bz2";
-    sha256 = "1kbkngs4fhf9z53awskqiwdl94i5slvxmjiajkrayi99373fallx";
+    url = "http://ncmpcpp.rybczak.net/stable/ncmpcpp-${version}.tar.bz2";
+    sha256 = "ff6d5376a2d9caba6f5bb78e68af77cefbdb2f04cd256f738e39f8ac9a79a4a8";
   };
 
   buildInputs = [ ncurses curl taglib fftw mpd_clientlib pkgconfig ];
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
     homepage = http://unkart.ovh.org/ncmpcpp/;
     license = "GPLv2+";
     maintainers = [ stdenv.lib.maintainers.mornfall ];
+    platforms = stdenv.lib.platforms.all;
   };
 }
 
diff --git a/pkgs/applications/audio/normalize/default.nix b/pkgs/applications/audio/normalize/default.nix
new file mode 100644
index 00000000000..e422eee363c
--- /dev/null
+++ b/pkgs/applications/audio/normalize/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "normalize-${version}";
+  version = "0.7.7";
+
+  src = fetchurl {
+    url = "http://savannah.nongnu.org/download/normalize/normalize-0.7.7.tar.gz";
+    sha256 = "1n5khss10vjjp6w69q9qcl4kqfkd0pr555lgqghrchn6rjms4mb0";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = http://normalize.nongnu.org/;
+    description = "Audio file normalizer";
+    license = licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/audio/opus-tools/default.nix b/pkgs/applications/audio/opus-tools/default.nix
new file mode 100644
index 00000000000..a543aa32eea
--- /dev/null
+++ b/pkgs/applications/audio/opus-tools/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, libogg, libao, pkgconfig, libopus}:
+
+stdenv.mkDerivation rec {
+  name = "opus-tools-0.1.6";
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
+    sha256 = "1hd2ych34y3qy4rj4hd5cp29ixy891afizlsxphsfvfplk1dp1nc";
+  };
+
+  buildInputs = [ libogg libao pkgconfig libopus ];
+
+  meta = {
+    description = "Tools to work with opus encoded audio streams";
+    homepage = http://www.opus-codec.org/;
+    license = "BSD";
+  };
+}
diff --git a/pkgs/applications/audio/pavucontrol/default.nix b/pkgs/applications/audio/pavucontrol/default.nix
index d25cfeb3cd1..a73744ebbe8 100644
--- a/pkgs/applications/audio/pavucontrol/default.nix
+++ b/pkgs/applications/audio/pavucontrol/default.nix
@@ -2,17 +2,17 @@
 , libglademm, libcanberra, intltool, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "pavucontrol-0.9.10";
+  name = "pavucontrol-1.0";
 
   src = fetchurl {
-    url = "http://0pointer.de/lennart/projects/pavucontrol/${name}.tar.gz";
-    sha256 = "0g2sd9smwwpnyq8yc65dl9z0iafj2rrimi8v58wkxx98vhnnvsby";
+    url = "http://freedesktop.org/software/pulseaudio/pavucontrol/${name}.tar.xz";
+    sha256 = "1plcyrc7p6gqxjhxx2xh6162bkb29wixjrqrjnl9b8g3nrjjigix";
   };
 
   buildInputs = [ pkgconfig pulseaudio gtkmm libsigcxx libglademm libcanberra
     intltool gettext ];
 
-  configureFlags = "--disable-lynx";
+  configureFlags = "--disable-lynx --disable-gtk3";
 
   meta = {
     description = "PulseAudio Volume Control";
diff --git a/pkgs/applications/audio/picard/default.nix b/pkgs/applications/audio/picard/default.nix
new file mode 100644
index 00000000000..dccb6571f4d
--- /dev/null
+++ b/pkgs/applications/audio/picard/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, pythonPackages, gettext, pyqt4
+, pkgconfig, libdiscid, libofa, ffmpeg }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "picard-${version}";
+  namePrefix = "";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "http://ftp.musicbrainz.org/pub/musicbrainz/picard/${name}.tar.gz";
+    md5 = "57abb76632a423760f336ac11da5c149";
+  };
+
+  buildInputs = [
+    pkgconfig
+    ffmpeg
+    libofa
+    gettext
+  ];
+
+  propagatedBuildInputs = [
+    pythonPackages.mutagen
+    pyqt4
+    libdiscid
+  ];
+
+  configurePhase = ''
+    python setup.py config
+  '';
+
+  buildPhase = ''
+    python setup.py build
+  '';
+
+  installPhase = ''
+    python setup.py install --prefix="$out"
+  '';
+
+  doCheck = false;
+
+  meta = {
+    homepage = "http://musicbrainz.org/doc/MusicBrainz_Picard";
+    description = "The official MusicBrainz tagger";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/applications/audio/praat/default.nix b/pkgs/applications/audio/praat/default.nix
new file mode 100644
index 00000000000..f2f196acdd8
--- /dev/null
+++ b/pkgs/applications/audio/praat/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, alsaLib, gtk, pkgconfig }:
+
+stdenv.mkDerivation {
+  name = "praat-5323";
+  src = fetchurl {
+    url = http://www.fon.hum.uva.nl/praat/praat5323_sources.tar.gz;
+    sha256 = "1m0m5165h74mw5xhmnnyzh5ans3cn78w5rs9572sa1512cams203";
+  };
+
+  configurePhase = ''
+    cp makefiles/makefile.defs.linux makefile.defs
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp praat $out/bin
+  '';
+
+  buildInputs = [ alsaLib gtk pkgconfig ];
+
+  meta = {
+    description = "Doing phonetics by computer";
+    homepage = http://www.fon.hum.uva.nl/praat/;
+    license = "GPLv2+"; # Has some 3rd-party code in it though
+  };
+}
diff --git a/pkgs/applications/audio/puredata/default.nix b/pkgs/applications/audio/puredata/default.nix
index e2563b8fe06..b1df008398d 100644
--- a/pkgs/applications/audio/puredata/default.nix
+++ b/pkgs/applications/audio/puredata/default.nix
@@ -1,24 +1,31 @@
-{ stdenv, fetchurl, alsaLib, autoconf, automake, fftw, gettext, glib,
-libX11, libtool, tcl, tk }:
+{ stdenv, fetchurl, alsaLib, autoconf, automake, fftw, gettext, glib
+, jackaudio, libX11, libtool, makeWrapper, pkgconfig, tcl, tk
+}:
 
 stdenv.mkDerivation  rec {
   name = "puredata-${version}";
-  version = "0.43-0";
+  version = "0.44-0";
 
   src = fetchurl {
     url = "mirror://sourceforge/pure-data/pd-${version}.src.tar.gz";
-    sha256 = "1qfq7x8vj12kr0cdrnbvmxfhc03flicc6vcc8bz6hwrrakwciyz2";
+    sha256 = "031bvqfnlpfx0y5n0l5rmslziqc6jgmk99x1prgh1rmhjhjdnijw";
   };
 
-  buildInputs = [ alsaLib autoconf automake fftw gettext glib libX11
-    libtool tcl tk ];
+  buildInputs = [
+    alsaLib autoconf automake fftw gettext glib jackaudio libX11
+    libtool makeWrapper pkgconfig tcl tk
+  ];
 
   preConfigure = ''
     ./autogen.sh
   '';
 
+  postInstall = ''
+    wrapProgram $out/bin/pd --prefix PATH : ${tk}/bin
+  '';
+
   meta = with stdenv.lib; {
-    description = ''Real-time graphical programming environment for
+    description = ''A real-time graphical programming environment for
                     audio, video, and graphical processing'';
     homepage = http://puredata.info;
     license = licenses.bsd3;
diff --git a/pkgs/applications/audio/qjackctl/default.nix b/pkgs/applications/audio/qjackctl/default.nix
index 01fa24a065e..e70d51ce857 100644
--- a/pkgs/applications/audio/qjackctl/default.nix
+++ b/pkgs/applications/audio/qjackctl/default.nix
@@ -1,20 +1,22 @@
 { stdenv, fetchurl, qt4, alsaLib, jackaudio, dbus }:
 
 stdenv.mkDerivation rec {
-  version = "0.3.8";
+  version = "0.3.9";
   name = "qjackctl-${version}";
 
   # some dependencies such as killall have to be installed additionally
 
   src = fetchurl {
     url = "mirror://sourceforge/qjackctl/${name}.tar.gz";
-    sha256 = "1rbipbknq7f8qfma33vwfv2ar3vxkz1p1ykp5mx6nirmcn1nj247";
+    sha256 = "0a4s7lwd5b67qbwv1yck8bw6zz8ffx1gza5fwflfqrfcfl3dds2y";
   };
 
   buildInputs = [ qt4 alsaLib jackaudio dbus ];
 
+  configureFlags = "--enable-jack-version";
+
   meta = {
-    description = "qt jackd control gui tool";
+    description = "A Qt application to control the JACK sound server daemon";
     homepage = http://qjackctl.sourceforge.net/;
     license = "GPL";
   };
diff --git a/pkgs/applications/audio/qmmp/default.nix b/pkgs/applications/audio/qmmp/default.nix
new file mode 100644
index 00000000000..8b99988f07b
--- /dev/null
+++ b/pkgs/applications/audio/qmmp/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, fetchurl, cmake, qt4, pkgconfig, x11
+# transports
+, curl, libmms
+# input plugins
+, libmad, taglib, libvorbis, libogg, flac, libmpcdec, libmodplug, libsndfile
+, libcdio, cdparanoia, libcddb, faad2, ffmpeg, wildmidi
+# output plugins
+, alsaLib, pulseaudio
+# effect plugins
+, libsamplerate
+}:
+
+# Additional plugins that can be added:
+#  wavpack (http://www.wavpack.com/)
+#  gme (Game music support)
+#  Ogg Opus support
+#  BS2B effect plugin (http://bs2b.sourceforge.net/)
+#  JACK audio support
+#  ProjectM visualization plugin
+
+# To make MIDI work we must tell Qmmp what instrument configuration to use (and
+# this can unfortunately not be set at configure time):
+# Go to settings (ctrl-p), navigate to the WildMidi plugin and click on
+# Preferences. In the instrument configuration field, type the path to
+# /nix/store/*wildmidi*/etc/wildmidi.cfg (or your own custom cfg file).
+
+# Qmmp installs working .desktop file(s) all by itself, so we don't need to
+# handle that.
+
+stdenv.mkDerivation rec {
+  name = "qmmp-0.7.0";
+
+  src = fetchurl {
+    url = "http://qmmp.ylsoftware.com/files/${name}.tar.bz2";
+    sha256 = "0g8qcs82y3dy06lsgam2w6gh2ccx0frlw9fp4xg947vi3a16g6ig";
+  };
+
+  buildInputs =
+    [ # basic requirements
+      cmake qt4 pkgconfig x11
+      # transports
+      curl libmms
+      # input plugins
+      libmad taglib libvorbis libogg flac libmpcdec libmodplug libsndfile
+      libcdio cdparanoia libcddb faad2 ffmpeg wildmidi
+      # output plugins
+      alsaLib pulseaudio
+      # effect plugins
+      libsamplerate
+    ];
+
+  meta = with stdenv.lib; {
+    description = "Qt-based audio player that looks like Winamp";
+    homepage = http://qmmp.ylsoftware.com/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/applications/audio/samplv1/default.nix b/pkgs/applications/audio/samplv1/default.nix
new file mode 100644
index 00000000000..584b23b6a01
--- /dev/null
+++ b/pkgs/applications/audio/samplv1/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, jackaudio, libsndfile, lv2, qt4 }:
+
+stdenv.mkDerivation rec {
+  name = "samplv1-${version}";
+  version = "0.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/samplv1/${name}.tar.gz";
+    sha256 = "1j6q3ywbdsyhskc60p7k8ph058ylrrmjmri3q1wr2d2akcaqvb7m";
+  };
+
+  buildInputs = [ jackaudio libsndfile lv2 qt4 ];
+
+  meta = with stdenv.lib; {
+    description = "An old-school all-digital polyphonic sampler synthesizer with stereo fx";
+    homepage = http://samplv1.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/audio/shntool/default.nix b/pkgs/applications/audio/shntool/default.nix
new file mode 100644
index 00000000000..12ef79d746e
--- /dev/null
+++ b/pkgs/applications/audio/shntool/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, flac }:
+
+stdenv.mkDerivation rec {
+  version = "3.0.10";
+  name = "shntool-${version}";
+
+  src = fetchurl {
+    url = http://www.etree.org/shnutils/shntool/dist/src/shntool-3.0.10.tar.gz;
+    sha256 = "00i1rbjaaws3drkhiczaign3lnbhr161b7rbnjr8z83w8yn2wc3l";
+  };
+
+  buildInputs = [ flac ];
+
+  meta = {
+    description = "multi-purpose WAVE data processing and reporting utility";
+    homepage = http://www.etree.org/shnutils/shntool/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index a5c7918e4b6..36c6c2ca9cd 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -1,52 +1,79 @@
-{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl }:
+{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng12, GConf, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
-let version = "0.8.3.278"; in
+let
+  version = "0.9.0.133";
+  qt4webkit =
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        name = "libqtwebkit4_2.2_i386.deb";
+        url = http://mirrors.us.kernel.org/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_i386.deb;
+        sha256 = "0hi6cwx2b2cwa4nv5phqqw526lc8p9x7kjkcza9x47ny3npw2924";
+      }
+    else
+      fetchurl {
+        name = "libqtwebkit4_2.2_amd64.deb";
+        url = http://ie.archive.ubuntu.com/ubuntu/pool/main/q/qtwebkit-source/libqtwebkit4_2.2~2011week36-0ubuntu1_amd64.deb;
+        sha256 = "0bvy6qz9y19ck391z8c049v07y4vdyvgykpxi7x1nvn078p1imiw";
+      };
+in
 
 stdenv.mkDerivation {
   name = "spotify-${version}";
 
   src =
-    if stdenv.system == "i686-linux" then 
+    if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g21c7566.632-1_i386.deb";
-        sha256 = "7f587585365498c5182bd7f3beafaf511d883102f5cece66cf84f4f94077765b";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.gd18ed58.259-1_i386.deb";
+        sha256 = "15kbwll63pm99262f7xq1z0c5bwmk5cz46pkh8xd5xsqxlsvvv1n";
       }
-    else if stdenv.system == "x86_64-linux" then 
+    else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g21c7566.632-1_amd64.deb";
-        sha256 = "a37a13b1c1a8088a811054c732d85b9d6ccf0bd92ad4da75bfee6d70dc344b5e";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.gd18ed58.259-1_amd64.deb";
+        sha256 = "0l3nikhf4hyj6z7639s668kd806730va005rwqcxvymxddcbcp03";
       }
     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
+      mv $out/opt/spotify/* $out/
+      rm -rf $out/usr $out/opt
 
       # Work around Spotify referring to a specific minor version of
       # OpenSSL.
       mkdir $out/lib
       ln -s ${openssl}/lib/libssl.so $out/lib/libssl.so.0.9.8
       ln -s ${openssl}/lib/libcrypto.so $out/lib/libcrypto.so.0.9.8
+      ln -s ${nss}/lib/libnss3.so $out/lib/libnss3.so.1d
+      ln -s ${nss}/lib/libnssutil3.so $out/lib/libnssutil3.so.1d
+      ln -s ${nss}/lib/libsmime3.so $out/lib/libsmime3.so.1d
+      ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so.0d
+      ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so.0d
+
+      mkdir -p $out/bin
 
+      ln -s $out/spotify-client/spotify $out/bin/spotify
       patchelf \
         --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-        --set-rpath ${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib openssl stdenv.gcc.gcc ]}:${stdenv.gcc.gcc}/lib64:$out/lib \
-        $out/bin/spotify
+        --set-rpath $out/lib:$out/spotify-client:${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc freetype glib pango cairo atk gdk_pixbuf gtk GConf cups sqlite]}:${stdenv.gcc.gcc}/lib64 \
+        $out/spotify-client/spotify
+
+      dpkg-deb -x ${qt4webkit} ./
+      mkdir -p $out/lib/
+      cp -v usr/lib/*/* $out/lib/
 
       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
+      wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ GConf libpng12 cups libgcrypt sqlite gst_plugins_base gstreamer]}:$out/lib"
     ''; # */
 
   dontStrip = true;
diff --git a/pkgs/applications/audio/swh-lv2/default.nix b/pkgs/applications/audio/swh-lv2/default.nix
new file mode 100644
index 00000000000..9b18ab31abf
--- /dev/null
+++ b/pkgs/applications/audio/swh-lv2/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchgit, fftwSinglePrec, libxslt, lv2, pkgconfig }:
+
+let
+  rev = "ec6b85e19e24ed";
+in
+stdenv.mkDerivation rec {
+  name = "swh-lv2-${rev}";
+
+  src = fetchgit {
+    url = "git://github.com/swh/lv2.git";
+    inherit rev;
+    sha256 = "d0d918ee642cd9649215737fcc008ce2bf55f4ea893a1897138b33775ea60d17";
+  };
+
+  patchPhase = ''
+    sed -e "s#xsltproc#${libxslt}/bin/xsltproc#" -i Makefile
+    sed -e "s#PREFIX = /usr/local#PREFIX = $out#" -i Makefile
+  '';
+
+  buildInputs = [ fftwSinglePrec lv2 pkgconfig ];
+
+  installPhase = "make install-system";
+
+  meta = with stdenv.lib; {
+    homepage = http://plugin.org.uk;
+    description = "LV2 version of Steve Harris' SWH plugins";
+    longDescription = ''
+      SWH plugins include:
+      amp, fast overdrive, overdrive (with colourisation), comb
+      filter, waveshaper, ringmod, divider, diode, decliper, pitch
+      scaler, 16 band equaliser, sinus wavewrapper, hermes filter,
+      chorus, flanger, decimater, oscillator, gverb, phasers, harmonic
+      generators, surround encoders and more.
+    '';
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/synthv1/default.nix b/pkgs/applications/audio/synthv1/default.nix
new file mode 100644
index 00000000000..aadce32dda4
--- /dev/null
+++ b/pkgs/applications/audio/synthv1/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, qt4, jackaudio, lv2 }:
+
+stdenv.mkDerivation rec {
+  name = "synthv1-${version}";
+  version = "0.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/synthv1/${name}.tar.gz";
+    sha256 = "1230yf49qfw540yvp5n7sh6mf3k8590pzwc5mragd3nd6k6apgw9";
+  };
+
+  buildInputs = [ qt4 jackaudio lv2 ];
+
+  meta = with stdenv.lib; {
+    description = "An old-school 4-oscillator subtractive polyphonic synthesizer with stereo fx";
+    homepage = http://synthv1.sourceforge.net/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix
index 082f5dd9ab9..bce7e0ef5ee 100644
--- a/pkgs/applications/audio/yoshimi/default.nix
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation  rec {
 
   buildInputs = [ alsaLib boost fftwSinglePrec fltk jackaudio libsndfile mesa
     minixml zlib ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   preConfigure = "cd src";
 
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
index 08f0f48011c..fcec85b7fe5 100644
--- a/pkgs/applications/audio/zynaddsubfx/default.nix
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [ alsaLib fftw fltk13 minixml zlib ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   patches = [
     (fetchurl {
diff --git a/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix b/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix
new file mode 100644
index 00000000000..501826b82df
--- /dev/null
+++ b/pkgs/applications/display-managers/lightdm-gtk-greeter/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, lightdm, pkgconfig, gtk3, intltool }:
+
+stdenv.mkDerivation {
+  name = "lightdm-gtk-greeter";
+
+  src = fetchurl {
+    url = "https://launchpad.net/lightdm-gtk-greeter/1.6/1.5.1/+download/lightdm-gtk-greeter-1.5.1.tar.gz";
+    sha256 = "ecce7e917a79fa8f2126c3fafb6337f81f2198892159a4ef695016afecd2d621";
+  };
+
+  buildInputs = [ pkgconfig gtk3 lightdm intltool ];
+
+  patches =
+    [ ./lightdm-gtk-greeter.patch
+    ];
+
+  patchFlags = "-p0";
+
+  postInstall = ''
+      substituteInPlace "$out/share/xgreeters/lightdm-gtk-greeter.desktop" \
+        --replace "Exec=lightdm-gtk-greeter" "Exec=$out/sbin/lightdm-gtk-greeter"
+    '';
+}
diff --git a/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch b/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch
new file mode 100644
index 00000000000..5ae5603b4dd
--- /dev/null
+++ b/pkgs/applications/display-managers/lightdm-gtk-greeter/lightdm-gtk-greeter.patch
@@ -0,0 +1,13 @@
+=== modified file 'src/lightdm-gtk-greeter.c'
+--- src/lightdm-gtk-greeter.c	2013-02-09 23:20:39 +0000
++++ src/lightdm-gtk-greeter.c	2013-03-29 12:21:34 +0000
+@@ -1273,7 +1273,7 @@
+     gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (session_combo), renderer, TRUE);
+     gtk_cell_layout_add_attribute (GTK_CELL_LAYOUT (session_combo), renderer, "text", 0);
+     model = gtk_combo_box_get_model (session_combo);
+-    items = lightdm_get_sessions ();
++    items = lightdm_get_sessions (greeter);
+     for (item = items; item; item = item->next)
+     {
+         LightDMSession *session = item->data;
+
diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix
new file mode 100644
index 00000000000..ce1f4400b27
--- /dev/null
+++ b/pkgs/applications/display-managers/lightdm/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, pam, pkgconfig, libxcb, glib, libXdmcp, itstool, libxml2, intltool, x11, libxklavier, libgcrypt, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "lightdm-1.5.1";
+
+  src = fetchurl {
+    url = https://launchpad.net/lightdm/1.6/1.5.1/+download/lightdm-1.5.1.tar.xz;
+    sha256 = "645db2d763cc514d6aecb1838f4a9c33c3dcf0c94567a7ef36c6b23d8aa56c86";
+  };
+
+  buildInputs = [ pkgconfig pam libxcb glib libXdmcp itstool libxml2 intltool libxklavier libgcrypt makeWrapper ];
+
+  configureFlags = [ "--enable-liblightdm-gobject" ];
+
+  patches =
+    [ ./lightdm.patch
+    ];
+
+  patchFlags = "-p0";
+
+  meta = {
+    homepage = http://launchpad.net/lightdm;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/display-managers/lightdm/lightdm.patch b/pkgs/applications/display-managers/lightdm/lightdm.patch
new file mode 100644
index 00000000000..a6e53bafcc7
--- /dev/null
+++ b/pkgs/applications/display-managers/lightdm/lightdm.patch
@@ -0,0 +1,193 @@
+=== modified file 'liblightdm-gobject/greeter.c'
+--- liblightdm-gobject/greeter.c	2013-01-31 20:56:09 +0000
++++ liblightdm-gobject/greeter.c	2013-03-29 14:15:58 +0000
+@@ -567,6 +567,21 @@
+ }
+ 
+ /**
++ * lightdm_greeter_get_config_path
++ * @greeter: A #LightDMGreeter
++ *
++ * Get the config path to LightDM.
++ *
++ * Return value: The path to the current LightDM configuration file.
++ **/
++const gchar *
++lightdm_greeter_get_config_path (LightDMGreeter *greeter)
++{
++    g_return_val_if_fail (LIGHTDM_IS_GREETER (greeter), NULL);
++    return lightdm_greeter_get_hint (greeter, "config-path");
++}
++
++/**
+  * lightdm_greeter_get_hide_users_hint:
+  * @greeter: A #LightDMGreeter
+  *
+
+=== modified file 'liblightdm-gobject/lightdm/greeter.h'
+--- liblightdm-gobject/lightdm/greeter.h	2013-01-31 20:56:09 +0000
++++ liblightdm-gobject/lightdm/greeter.h	2013-03-29 11:56:11 +0000
+@@ -93,6 +93,8 @@
+ 
+ const gchar *lightdm_greeter_get_autologin_user_hint (LightDMGreeter *greeter);
+ 
++const gchar *lightdm_greeter_get_config_path (LightDMGreeter *greeter);
++
+ gboolean lightdm_greeter_get_autologin_guest_hint (LightDMGreeter *greeter);
+ 
+ gint lightdm_greeter_get_autologin_timeout_hint (LightDMGreeter *greeter);
+
+=== modified file 'liblightdm-gobject/lightdm/session.h'
+--- liblightdm-gobject/lightdm/session.h	2013-01-31 20:56:09 +0000
++++ liblightdm-gobject/lightdm/session.h	2013-03-29 11:59:16 +0000
+@@ -12,6 +12,7 @@
+ #define _LIGHTDM_SESSION_H_
+ 
+ #include <glib-object.h>
++#include "greeter.h"
+ 
+ G_BEGIN_DECLS
+ 
+@@ -42,9 +43,9 @@
+ 
+ GType lightdm_session_get_type (void);
+ 
+-GList *lightdm_get_sessions (void);
++GList *lightdm_get_sessions (LightDMGreeter *greeter);
+ 
+-GList *lightdm_get_remote_sessions (void);
++GList *lightdm_get_remote_sessions (LightDMGreeter *greeter);
+ 
+ const gchar *lightdm_session_get_key (LightDMSession *session);
+ 
+
+=== modified file 'liblightdm-gobject/session.c'
+--- liblightdm-gobject/session.c	2013-01-31 20:56:09 +0000
++++ liblightdm-gobject/session.c	2013-03-29 14:16:48 +0000
+@@ -11,6 +11,7 @@
+ #include <string.h>
+ #include <gio/gdesktopappinfo.h>
+ 
++#include "lightdm/greeter.h"
+ #include "lightdm/session.h"
+ 
+ enum {
+@@ -167,7 +168,7 @@
+ }
+ 
+ static void
+-update_sessions (void)
++update_sessions (LightDMGreeter *greeter)
+ {
+     GKeyFile *config_key_file = NULL;
+     gchar *config_path = NULL;
+@@ -183,8 +184,8 @@
+     remote_sessions_dir = g_strdup (REMOTE_SESSIONS_DIR);
+ 
+     /* Use session directory from configuration */
+-    /* FIXME: This should be sent in the greeter connection */
+-    config_path = g_build_filename (CONFIG_DIR, "lightdm.conf", NULL);
++    config_path = g_strdup (lightdm_greeter_get_config_path (greeter));
++
+     config_key_file = g_key_file_new ();
+     result = g_key_file_load_from_file (config_key_file, config_path, G_KEY_FILE_NONE, &error);
+     if (error)
+@@ -228,9 +229,9 @@
+  * Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
+  **/
+ GList *
+-lightdm_get_sessions (void)
++lightdm_get_sessions (LightDMGreeter *greeter)
+ {
+-    update_sessions ();
++    update_sessions (greeter);
+     return local_sessions;
+ }
+ 
+@@ -242,9 +243,9 @@
+  * Return value: (element-type LightDMSession) (transfer none): A list of #LightDMSession
+  **/
+ GList *
+-lightdm_get_remote_sessions (void)
++lightdm_get_remote_sessions (LightDMGreeter *greeter)
+ {
+-    update_sessions ();
++    update_sessions (greeter);
+     return remote_sessions;
+ }
+ 
+
+=== modified file 'src/display.c'
+--- src/display.c	2013-03-26 22:22:49 +0000
++++ src/display.c	2013-03-29 12:12:43 +0000
+@@ -62,6 +62,9 @@
+     /* Program to run sessions through */
+     gchar *session_wrapper;
+ 
++    /* Path to the configuration file that lightdm is running under */
++    gchar *config_path;
++
+     /* TRUE if in a user session */
+     gboolean in_user_session;
+ 
+@@ -213,6 +216,14 @@
+ }
+ 
+ void
++display_set_config_path (Display *display, const gchar *config_path)
++{
++    g_return_if_fail (display != NULL);
++    g_free (display->priv->config_path);
++    display->priv->config_path = g_strdup (config_path);
++}
++
++void
+ display_set_show_remote_login_hint (Display *display, gboolean show_remote_login)
+ {
+     g_return_if_fail (display != NULL);
+@@ -436,6 +447,7 @@
+     greeter_set_hint (display->priv->greeter, "show-remote-login", display->priv->greeter_show_remote_login ? "true" : "false");
+     if (display->priv->greeter_is_lock)
+         greeter_set_hint (display->priv->greeter, "lock-screen", "true");
++    greeter_set_hint (display->priv->greeter, "config-path", display->priv->config_path);
+ 
+     /* Run greeter as unprivileged user */
+     if (getuid () != 0)
+
+=== modified file 'src/display.h'
+--- src/display.h	2013-03-26 22:22:49 +0000
++++ src/display.h	2013-03-29 12:12:37 +0000
+@@ -80,6 +80,8 @@
+ 
+ void display_set_user_session (Display *display, SessionType type, const gchar *session_name);
+ 
++void display_set_config_path (Display *display, const gchar *config_path);
++
+ gboolean display_start (Display *display);
+ 
+ gboolean display_get_is_ready (Display *display);
+
+=== modified file 'src/lightdm.c'
+--- src/lightdm.c	2013-03-07 21:40:31 +0000
++++ src/lightdm.c	2013-03-29 11:48:45 +0000
+@@ -1050,6 +1050,7 @@
+     g_debug ("Starting Light Display Manager %s, UID=%i PID=%i", VERSION, getuid (), getpid ());
+ 
+     g_debug ("Loaded configuration from %s", config_path);
++    config_set_string (config_get_instance (), "LightDM", "config-path", config_path);
+     g_free (config_path);
+ 
+     g_debug ("Using D-Bus name %s", LIGHTDM_BUS_NAME);
+
+=== modified file 'src/seat.c'
+--- src/seat.c	2013-03-26 22:22:49 +0000
++++ src/seat.c	2013-03-29 12:13:00 +0000
+@@ -536,6 +536,7 @@
+     if (!session_name)
+         session_name = seat_get_string_property (seat, "user-session");
+     display_set_user_session (display, SESSION_TYPE_LOCAL, session_name);
++    display_set_config_path (display, config_get_string (config_get_instance (), "LightDM", "config-path"));
+ 
+     seat->priv->displays = g_list_append (seat->priv->displays, display);
+     g_signal_emit (seat, signals[DISPLAY_ADDED], 0, display);
+
diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix
index 0675b02a314..601aa7bf53a 100644
--- a/pkgs/applications/display-managers/slim/default.nix
+++ b/pkgs/applications/display-managers/slim/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, pkgconfig, x11, libjpeg, libpng12, libXmu
-, fontconfig, freetype, pam, consolekit, dbus_libs }:
+, fontconfig, freetype, pam, dbus_libs }:
 
 stdenv.mkDerivation rec {
   name = "slim-1.3.4";
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ cmake pkgconfig x11 libjpeg libpng12 libXmu fontconfig freetype
       pam dbus_libs
-    ] ++ stdenv.lib.optional (consolekit != null) consolekit;
+    ];
 
   preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc";
 
-  cmakeFlags = [ "-DUSE_PAM=1" ] ++ stdenv.lib.optional (consolekit != null) "-DUSE_CONSOLEKIT=1";
+  cmakeFlags = [ "-DUSE_PAM=1" ];
 
   NIX_CFLAGS_LINK = "-lXmu";
 
diff --git a/pkgs/applications/editors/aewan/default.nix b/pkgs/applications/editors/aewan/default.nix
new file mode 100644
index 00000000000..3e11f78e402
--- /dev/null
+++ b/pkgs/applications/editors/aewan/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, zlib, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "aewan-${version}";
+  version = "1.0.01";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/aewan/${name}.tar.gz";
+    sha256 = "5266dec5e185e530b792522821c97dfa5f9e3892d0dca5e881d0c30ceac21817";
+  };
+
+  buildInputs = [ zlib ncurses ];
+
+  meta = {
+    description = "Ascii-art Editor Without A Name";
+    homepage = "http://aewan.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index af71e89a416..a11cbf349c0 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -49,6 +49,8 @@ let
         # Create desktop item.
         mkdir -p $out/share/applications
         cp ${desktopItem}/share/applications/* $out/share/applications
+        mkdir -p $out/share/pixmaps
+        ln -s $out/eclipse/icon.xpm $out/share/pixmaps/eclipse.xpm
       ''; # */
 
       meta = {
@@ -84,12 +86,12 @@ in {
     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;
+          url = http://archive.eclipse.org/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;
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk.tar.gz;
           sha256 = "1bh8ykliqr8wbciv13vpiy50rvm7yszk7y8dslr796dbwhi5b1cj";
         };
   };
@@ -100,12 +102,12 @@ in {
     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;
+          url = http://eclipse.ialto.com/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;
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz;
           sha1 = "1156e4bc0253ae3a3a4e54839e4944dc64d3108f";
         };
   };
@@ -132,12 +134,12 @@ in {
     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;
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz;
           sha256 = "00ig3ww98r8imf32sx5npm6csn5nx288gvdk6w653nijni0di16j";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk.tar.gz;
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk.tar.gz;
           sha256 = "08rgw85cam51l98mzb39fdc3ykb369v8pap93qhknbs6a3f5dnff";
         };
   };
@@ -158,20 +160,35 @@ in {
         };
   };
 
+  eclipse_cpp_42 = buildEclipse {
+    name = "eclipse-cpp-4.2";
+    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/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk-x86_64.tar.gz;
+          sha256 = "1qq04926pf7v9sf3s0z53zvlbl1j0rmmjmbmhqi49473fnjikh7y";
+        }
+      else
+        fetchurl {
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/juno/SR2/eclipse-cpp-juno-SR2-linux-gtk.tar.gz;
+          sha256 = "1a4s9qlhfpfpdhvffyglnfdr3dq5r2ywcxqywhqi95yhq5nmsgyk";
+        };
+  };
+
   eclipse_sdk_42 = buildEclipse {
     name = "eclipse-sdk-4.2";
     description = "Eclipse Classic";
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz;
-          sha256 = "1vcr49qm6rsbgzi9d43ggmby68pdigqcy55l5vy1gmixqks3g6s0";
+          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz;
+          sha256 = "1mlyy90lk08lb2971ynglgi3nqvqfq1k70md2kb39jk160wd1xrk";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk.tar.gz;
-          sha256 = "1zlv80idkkdda05ks4biknbkczp24b2xki81ik5nygrjg29jqgnz";
+          url = http://archive.eclipse.org/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk.tar.gz;
+          sha256 = "1av6qm9wkbyk123qqf38f0jq4jv2bj9wp6fmpnl55zg6qr463c1w";
         };
     };
 }
-
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 1b3e4e27f5b..eb364ec730e 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,14 +1,23 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "ed-1.5";
+  name = "ed-1.7";
 
   src = fetchurl {
     url = "mirror://gnu/ed/${name}.tar.gz";
-    sha256 = "18gvhyhwpabmgv4lh21lg8vl3z7acdyhh2mr2kj9g75wksj39pcp";
+    sha256 = "0c908wb5pm48rjrrfbm5dhrqzys8f1dbvi90dn0vgwjzk80l2hl9";
   };
 
-  doCheck = true;
+  /* FIXME: Tests currently fail on Darwin:
+
+       building test scripts for ed-1.5...
+       testing ed-1.5...
+       *** Output e1.o of script e1.ed is incorrect ***
+       *** Output r3.o of script r3.ed is incorrect ***
+       make: *** [check] Error 127
+
+    */
+  doCheck = !stdenv.isDarwin;
 
   crossAttrs = {
     compileFlags = [ "CC=${stdenv.cross.config}-gcc" ];
diff --git a/pkgs/applications/editors/emacs-22/builder.sh b/pkgs/applications/editors/emacs-22/builder.sh
deleted file mode 100644
index 7a82f6552ef..00000000000
--- a/pkgs/applications/editors/emacs-22/builder.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-source $stdenv/setup
-
-preConfigure() {
-    libc=$(cat ${NIX_GCC}/nix-support/orig-libc)
-    echo "libc: $libc"
-
-    case "${system}" in
-	x86_64-*)	glibclibdir=lib64 ;;
-	*)		glibclibdir=lib ;;
-    esac
-
-    for i in src/s/*.h src/m/*.h; do
-        substituteInPlace $i \
-            --replace /usr/${glibclibdir}/crt1.o $libc/${glibclibdir}/crt1.o \
-            --replace /usr/${glibclibdir}/crti.o $libc/${glibclibdir}/crti.o \
-            --replace /usr/${glibclibdir}/crtn.o $libc/${glibclibdir}/crtn.o \
-            --replace /usr/lib/crt1.o $libc/${glibclibdir}/crt1.o \
-            --replace /usr/lib/crti.o $libc/${glibclibdir}/crti.o \
-            --replace /usr/lib/crtn.o $libc/${glibclibdir}/crtn.o
-    done
-
-    for i in Makefile.in ./src/Makefile.in ./lib-src/Makefile.in ./leim/Makefile.in; do
-        substituteInPlace $i --replace /bin/pwd pwd
-    done
-}
-
-genericBuild
diff --git a/pkgs/applications/editors/emacs-22/default.nix b/pkgs/applications/editors/emacs-22/default.nix
deleted file mode 100644
index 4a8369170ad..00000000000
--- a/pkgs/applications/editors/emacs-22/default.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ xawSupport ? true
-, xpmSupport ? true
-, xaw3dSupport ? false
-, gtkGUI ? false
-, stdenv, fetchurl, x11, libXaw ? null, libXpm ? null, Xaw3d ? null
-, pkgconfig ? null, gtk ? null
-, ncurses
-}:
-
-assert xawSupport && !xaw3dSupport -> libXaw != null;
-assert xawSupport && xaw3dSupport -> Xaw3d != null;
-assert xpmSupport -> libXpm != null;
-assert gtkGUI -> pkgconfig != null && gtk != null;
-
-stdenv.mkDerivation rec {
-  name = "emacs-22.3";
-
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = "mirror://gnu/emacs/${name}.tar.gz";
-    sha256 = "05hd89bchcpwzcx5la0alcp0wb7xywvnf98dxrshrqlfvccvgnbv";
-  };
-
-  buildInputs = [ncurses x11]
-    ++ stdenv.lib.optional xawSupport (if xaw3dSupport then Xaw3d else libXaw)
-    ++ stdenv.lib.optional xpmSupport libXpm
-    ++ stdenv.lib.optionals gtkGUI [pkgconfig gtk];
-
-  configureFlags =
-    stdenv.lib.optional gtkGUI "--with-x-toolkit=gtk";
-
-  postInstall = ''
-    cat >$out/share/emacs/site-lisp/site-start.el <<EOF
-;; nixos specific load-path
-(when (getenv "NIX_PROFILES") (setq load-path
-                      (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
-                                               (split-string (getenv "NIX_PROFILES"))))
-                       load-path)))
-EOF
-  '';
-
-  meta = {
-    description = "GNU Emacs, *the* text editor";
-
-    longDescription = ''
-      GNU Emacs is an extensible, customizable text editor—and more.
-      At its core is an interpreter for Emacs Lisp, a dialect of the
-      Lisp programming language with extensions to support text
-      editing.
-    '';
-
-    homepage = http://www.gnu.org/software/emacs/;
-    license = "GPLv3+";
-
-    platforms = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/applications/editors/emacs-24/builder.sh b/pkgs/applications/editors/emacs-24/builder.sh
index d04e7a4fdd3..c472d2b1a64 100644
--- a/pkgs/applications/editors/emacs-24/builder.sh
+++ b/pkgs/applications/editors/emacs-24/builder.sh
@@ -29,6 +29,4 @@ preConfigure() {
     done
 }
 
-preBuild="make bootstrap"
-
 genericBuild
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index 388972abd01..a781cb37346 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -9,13 +9,13 @@ assert (libXft != null) -> libpng != null;	# probably a bug
 assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise
 
 stdenv.mkDerivation rec {
-  name = "emacs-24.1";
+  name = "emacs-24.3";
 
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = "mirror://gnu/emacs/${name}.tar.bz2";
-    sha256 = "eeea272732146e2be9aee2f8d71d6cf07b8654c0282da62a26b921d433f02b7c";
+    url = "mirror://gnu/emacs/${name}.tar.xz";
+    sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
   };
 
   buildInputs =
diff --git a/pkgs/applications/editors/emacs-modes/cedet/default.nix b/pkgs/applications/editors/emacs-modes/cedet/default.nix
index 46381dfc648..779fc8a146e 100644
--- a/pkgs/applications/editors/emacs-modes/cedet/default.nix
+++ b/pkgs/applications/editors/emacs-modes/cedet/default.nix
@@ -1,14 +1,14 @@
-{ fetchurl, stdenv, emacs }:
+{ fetchurl, stdenv, emacs, python }:
 
 stdenv.mkDerivation rec {
-  name = "cedet-1.0pre6";
+  name = "cedet-1.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/cedet/${name}.tar.gz";
-    sha256 = "0pvd54rjlba12cxgqibm8v4i8x43r5c239z891lgcbafjvkzpdxb";
+    sha256 = "0p2bwlpwwa019axvgj09xkxbr53j0pq23d46s4la9jfhl47nbh22";
   };
 
-  buildInputs = [ emacs ];
+  buildInputs = [ emacs python ];
 
   doCheck = true;
   checkPhase = "make utest";
diff --git a/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
new file mode 100644
index 00000000000..9db6e4cb736
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/emacs-clang-complete-async/default.nix
@@ -0,0 +1,26 @@
+{ clangStdenv, fetchgit, llvm, clangUnwrapped }:
+
+clangStdenv.mkDerivation {
+  name = "emacs-clang-complete-async-20130218";
+  src = fetchgit {
+    url = "git://github.com/Golevka/emacs-clang-complete-async.git";
+    rev = "f01488971ec8b5752780d130fb84de0c16a46f31";
+    sha256 = "1c8zqi6axbsb951azz9iqx3j52j30nd9ypv396hvids3g02cirrf";
+  };
+
+  buildInputs = [ llvm clangUnwrapped ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/emacs/site-lisp
+    install -m 755 clang-complete $out/bin
+    install -m 644 auto-complete-clang-async.el $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    homepage = "https://github.com/Golevka/emacs-clang-complete-async";
+    description = "An emacs plugin to complete C and C++ code using libclang";
+    license = "GPLv3+";
+  };
+}
+
diff --git a/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix b/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
index 751330550f1..5c425326aaa 100644
--- a/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
+++ b/pkgs/applications/editors/emacs-modes/emacs-w3m/default.nix
@@ -1,6 +1,6 @@
 { fetchcvs, stdenv, emacs, w3m, imagemagick, texinfo, autoconf }:
 
-let date = "2012-01-15"; in
+let date = "2013-03-21"; in
 stdenv.mkDerivation rec {
   name = "emacs-w3m-cvs${date}";
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     inherit date;
     cvsRoot = ":pserver:anonymous@cvs.namazu.org:/storage/cvsroot";
     module = "emacs-w3m";
-    sha256 = "7a6d90b9d25f137d5a204cfa29f6c6afa8edb1ee302f969110ffda11f11909cc";
+    sha256 = "1lmcj8rf83w13q8q68hh7sa1abc2m6j2zmfska92xdp7hslhdgc5";
   };
 
   buildInputs = [ emacs w3m texinfo autoconf ];
diff --git a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
index b629186033f..0a26e8fd43d 100644
--- a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
+++ b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, emacs }:
 
 stdenv.mkDerivation rec {
-  name = "flymake-cursor-0.1.4";
+  name = "flymake-cursor-0.1.5";
 
   src = fetchurl {
     url = "http://www.emacswiki.org/emacs/download/flymake-cursor.el";
-    sha256 = "1wxqqmn2fk2b778nksvgn1mi7ajarcpc5lla90xx9jwz47d9hx02";
+    sha256 = "1qqppd1786w8pl1avjb01n23lwihb7m0hr23abjklsxz03gmp4qz";
   };
 
   phases = [ "buildPhase" "installPhase"];
diff --git a/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix b/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix
new file mode 100644
index 00000000000..c1291126a1e
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, emacs }:
+
+stdenv.mkDerivation rec {
+  name = "graphviz-dot-mode-0.3.3";
+
+  src = fetchurl {
+    url = "http://www.graphviz.org/Misc/graphviz-dot-mode.el";
+    sha256 = "6465c18cfaa519a063cf664207613f70b0a17ac5eabcfaa949b3c4c289842953";
+  };
+
+  buildInputs = [ emacs ];
+
+  unpackPhase = ":";
+
+  installPhase = ''
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp -v ${src} "$out/share/emacs/site-lisp/graphviz-dot-mode.el"
+    emacs -batch --eval '(setq load-path (cons "." load-path))' -f batch-byte-compile "$out/share/emacs/site-lisp/graphviz-dot-mode.el"
+  '';
+
+  meta = {
+    homepage = "http://www.graphviz.org/";
+    description = "An emacs mode for the DOT Language, used by graphviz";
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/haskell/default.nix b/pkgs/applications/editors/emacs-modes/haskell/default.nix
index c8de8726284..7e490f253d1 100644
--- a/pkgs/applications/editors/emacs-modes/haskell/default.nix
+++ b/pkgs/applications/editors/emacs-modes/haskell/default.nix
@@ -1,12 +1,12 @@
-{ stdenv, fetchgit, emacs }:
+{ stdenv, fetchurl, emacs }:
 
-stdenv.mkDerivation {
-  name = "haskell-mode-2.8.0.29-gae3e4499d2";
+stdenv.mkDerivation rec {
+  name = "haskell-mode-2.9.1-102-g8d4b965";
 
-  src = fetchgit {
-    url = "http://github.com/haskell/haskell-mode.git";
-    rev = "ae3e4499d27a1468bdf88ffe0ce15cd7e4bb9f2a";
-    sha256 = "29a1725da620c13ff2b3b56906e76dd9f19317eee92bd5750b3aa9a4264effae";
+  src = fetchurl {
+    url = "https://github.com/haskell/haskell-mode/tarball/8d4b9651a69b62fcbedbac63de29a1e87ff0e97f";
+    sha256 = "02sil43885xjbfqakrxkm7bjnjd930lx6845fc2rxmkq5plkq85a";
+    name = "${name}.tar.gz";
   };
 
   buildInputs = [emacs];
diff --git a/pkgs/applications/editors/emacs-modes/htmlize/default.nix b/pkgs/applications/editors/emacs-modes/htmlize/default.nix
index 948beae82d4..d4c428e5a1e 100644
--- a/pkgs/applications/editors/emacs-modes/htmlize/default.nix
+++ b/pkgs/applications/editors/emacs-modes/htmlize/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "htmlize-1.37";
+  name = "htmlize-1.47";
 
   builder = ./builder.sh;
 
   src = fetchurl {
     url = http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi;
-    sha256 = "70cf41a2ea6a478a45143a8cd672381c01ed894448200e602531acbf2b1fd160";
+    sha256 = "0m7lby95w9sj0xlqv39imlbp80x8ajd295cs6079jyhmryf6mr10";
   };
 
   meta = {
diff --git a/pkgs/applications/editors/emacs-modes/magit/default.nix b/pkgs/applications/editors/emacs-modes/magit/default.nix
index f096d3b0057..a9149a0f919 100644
--- a/pkgs/applications/editors/emacs-modes/magit/default.nix
+++ b/pkgs/applications/editors/emacs-modes/magit/default.nix
@@ -1,22 +1,31 @@
 { stdenv, fetchurl, emacs, texinfo }:
 
 let
-  version = "1.1.1";
+  version = "1.2.0";
 in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "magit-${version}";
 
   src = fetchurl {
-    url = "http://github.com/downloads/magit/magit/magit-${version}.tar.gz";
-    sha256 = "0zp5qxippmalin2fr73w2alf2w7ilcahmybzdvgn4ch2s3dgvzcz";
+    url = "https://github.com/downloads/magit/magit/${name}.tar.gz";
+    sha256 = "1a8vvilhd5y5vmlpsh194qpl4qlg0a1brylfscxcacpfp0cmhlzg";
   };
 
-  buildInputs = [emacs texinfo];
+  buildInputs = [ emacs texinfo ];
 
   configurePhase = "makeFlagsArray=( PREFIX=$out SYSCONFDIR=$out/etc )";
 
+  # Add (require 'magit-site-init) to your ~/.emacs file to set-up magit mode.
+  postInstall = ''
+    mv $out/etc/emacs/site-start.d/50magit.el $out/share/emacs/site-lisp/magit-site-init.el
+    sed -i -e 's|50magit|magit-site-init|' $out/share/emacs/site-lisp/magit-site-init.el
+    rmdir $out/etc/emacs/site-start.d $out/etc/emacs $out/etc
+  '';
+
   meta = {
+    homepage = "https://github.com/magit/magit";
     description = "Magit, an Emacs interface to Git";
+    license = "GPLv3+";
 
     longDescription = ''
       With Magit, you can inspect and modify your Git repositories with
@@ -30,8 +39,6 @@ stdenv.mkDerivation {
       save you from learning Git itself.
     '';
 
-    license = "GPLv3+";
-    homepage = "https://github.com/magit/magit";
     platforms = stdenv.lib.platforms.all;
     maintainers = with stdenv.lib.maintainers; [ simons ludo ];
   };
diff --git a/pkgs/applications/editors/emacs-modes/nxml/builder.sh b/pkgs/applications/editors/emacs-modes/nxml/builder.sh
deleted file mode 100644
index d2393362ebb..00000000000
--- a/pkgs/applications/editors/emacs-modes/nxml/builder.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-source $stdenv/setup
-
-mkdir -p $out/emacs/site-lisp
-cd $out/emacs/site-lisp
-tar xvfz $src
-mv nxml-mode-*/* .
-rmdir nxml-mode-*
diff --git a/pkgs/applications/editors/emacs-modes/nxml/default.nix b/pkgs/applications/editors/emacs-modes/nxml/default.nix
deleted file mode 100644
index c8d441475c8..00000000000
--- a/pkgs/applications/editors/emacs-modes/nxml/default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{stdenv, fetchurl}: stdenv.mkDerivation {
-  name = "nxml-mode-20041004";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://nixos.org/tarballs/nxml-mode-20041004.tar.gz;
-    md5 = "ac137024cf337d6f11d8ab278d39b4db";
-  };
-}
diff --git a/pkgs/applications/editors/emacs-modes/org/default.nix b/pkgs/applications/editors/emacs-modes/org/default.nix
index fb4de650ee0..e045b83a74d 100644
--- a/pkgs/applications/editors/emacs-modes/org/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org/default.nix
@@ -1,30 +1,24 @@
-{ fetchurl, stdenv, emacs, texinfo, which }:
+{ fetchurl, stdenv, emacs, texinfo, which, texLive }:
 
 stdenv.mkDerivation rec {
-  name = "org-7.8.03";
+  name = "org-7.9.1";
 
   src = fetchurl {
     url = "http://orgmode.org/${name}.tar.gz";
-    sha256 = "49357cca7d892e70cd2dfcc0b5d96d9fd164ef5a1f251ace3865ecb27dc1e958";
+    sha256 = "0kz1dnzfpmmslwal150z9rxrnddjpaw2glx26qihpxzs0zzpw201";
   };
 
-  buildInputs = [ emacs texinfo ];
-
-  patchPhase =
-    '' sed -i "lisp/org-clock.el" -e's|"which"|"${which}/bin/which"|g'
-    '';
+  buildInputs = [ emacs ];
+  nativeBuildInputs = [ texinfo texLive ];
 
   configurePhase =
-    '' sed -i Makefile \
-           -e "s|^prefix=.*$|prefix=$out|g"
+    '' sed -i mk/default.mk \
+           -e "s|^prefix\t=.*$|prefix=$out|g"
     '';
 
-  #XXX: fails because of missing UTILITIES/manfull.pl, currently not
-  # included in the release tarball, but git.
-
-  #postBuild =
-  #  '' make doc
-  #  '';
+  postBuild =
+    '' make doc
+    '';
 
   installPhase =
     '' make install install-info
diff --git a/pkgs/applications/editors/emacs-modes/org2blog/default.nix b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
new file mode 100644
index 00000000000..c8c538c5cb7
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchgit, emacs, xmlRpc }:
+
+stdenv.mkDerivation rec {
+  name = "org2blog-0.5";
+
+  src = fetchgit {
+    url = https://github.com/punchagan/org2blog.git;
+    rev = "338abe30e9bc89684f8384f8deaf826b63844da6";
+    sha256 = "46ab31e90d0d54071c126b7d5599a3e82062baa79ddf26b988bcb88d306d6827";
+  };
+
+  buildInputs = [ emacs ];
+  propagatedUserEnvPkgs = [ xmlRpc ];
+
+  buildPhase = ''
+    emacs -L . -L ${xmlRpc}/share/emacs/site-lisp --batch -f batch-byte-compile *.el
+  '';
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install *.el* $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "A tool to publish directly from Emacs’ org-mode to WordPress blogs.";
+    homepage = https://github.com/punchagan/org2blog;
+    license = "GPLv3+";
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/prolog/default.nix b/pkgs/applications/editors/emacs-modes/prolog/default.nix
index b89951e6535..237b1ac1483 100644
--- a/pkgs/applications/editors/emacs-modes/prolog/default.nix
+++ b/pkgs/applications/editors/emacs-modes/prolog/default.nix
@@ -1,19 +1,21 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation
-{
-  name = "prolog-mode-1.22";
-  src = fetchurl
-  {
-    url = "http://bruda.ca/emacs-prolog/prolog.el";
-    sha256 = "f46915b2436642bb3302cb38cc457d3c121d0c3e95aecdf128fedc2ae5ea0c87";
+stdenv.mkDerivation {
+  name = "prolog-mode-1.25";
+
+  src = fetchurl {
+    url = "http://bruda.ca/_media/emacs/prolog.el";
+    sha256 = "0hfd2dr3xc5qxgvc08nkb2l5a05hfldahdc6ymi9vd8798cc46yh";
   };
 
-  buildCommand = "install -v -D -m644 $src $out/share/emacs/site-lisp/prolog.el";
+  buildCommand = ''
+    mkdir -p $out/share/emacs/site-lisp/
+    cp $src $out/share/emacs/site-lisp/prolog.el
+  '';
 
   meta = {
-    homepage = "http://turing.ubishops.ca/home/bruda/emacs-prolog/";
+    homepage = "http://bruda.ca/emacs/prolog_mode_for_emacs/";
     description = "Prolog mode for Emacs";
-    license = "GPL";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
index 18c16569cf8..3f974423fd7 100644
--- a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake }:
 
 stdenv.mkDerivation (rec {
-  name = "ProofGeneral-4.1";
+  name = "ProofGeneral-4.2";
 
   src = fetchurl {
-    url = http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.1.tgz;
-    sha256 = "1ivxx8c6j7cfdfj2pj0gzdqac7hpb679bjmwdqdcz1c1ni34s9ia";
+    url = http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.2.tgz;
+    sha256 = "09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm";
   };
 
   sourceRoot = name;
@@ -17,14 +17,18 @@ stdenv.mkDerivation (rec {
            -e "s|^\(\(DEST_\)\?PREFIX\)=.*$|\1=$out|g ; \
                s|/sbin/install-info|install-info|g"
 
+
+       # Workaround for bug #458 
+       # ProofGeneral 4.2 byte-compilation fails with Emacs 24.2.90
+       # http://proofgeneral.inf.ed.ac.uk/trac/ticket/458
+       sed -i "Makefile" \
+       	   -e "s|(setq byte-compile-error-on-warn t)||g"
+
        sed -i "bin/proofgeneral" -e's/which/type -p/g'
 
        # @image{ProofGeneral} fails, so remove it.
        sed -i '94d' doc/PG-adapting.texi
        sed -i '101d' doc/ProofGeneral.texi
-
-       # Emacs 24 compatibility.
-       sed -i 's|interactive-p|called-interactively-p '\'''any|' isar/isabelle-system.el generic/proof-{menu,script,splash}.el lib/scomint.el
     '';
 
   preBuild = ''
diff --git a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
index c15ff6afcb2..a253e25cad4 100644
--- a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
+++ b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
@@ -1,25 +1,23 @@
-{stdenv, fetchurl, emacs}:
+{stdenv, fetchgit, emacs}:
 
 stdenv.mkDerivation rec {
-  name = "sunrise-commander-6";
+  name = "sunrise-commander-6r435";
 
-  src = fetchurl {
-    url = "http://www.emacswiki.org/emacs/download/sunrise-commander.el";
-    sha256 = "1bbpm00nc7ry0f2k4zaqbvp6w9py31asfcr9hddggc138pnfajvq";
+  src = fetchgit {
+    url = https://github.com/escherdragon/sunrise-commander.git;
+    rev = "7a44ca7abd9fe79f87934c78d00dc2a91419a4f1";
+    sha256 = "2909beccc9daaa79e70876ac6547088c2459b624c364dda1886fe4d7adc7708b";
   };
 
-  phases = [ "buildPhase" "installPhase"];
-
   buildInputs = [ emacs ];
 
   buildPhase = ''
-    cp $src sunrise-commander.el
-    emacs --batch -f batch-byte-compile sunrise-commander.el
+    emacs -L . --batch -f batch-byte-compile *.el
   '';
 
   installPhase = ''
-    install -d $out/share/emacs/site-lisp
-    install sunrise-commander.el* $out/share/emacs/site-lisp
+    mkdir -p $out/share/emacs/site-lisp
+    install *.el* $out/share/emacs/site-lisp
   '';
 
   meta = {
diff --git a/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
new file mode 100644
index 00000000000..87a732b5b4c
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchurl, emacs}:
+
+stdenv.mkDerivation rec {
+  name = "xml-rpc-1.6.8";
+
+  src = fetchurl {
+    url = https://launchpadlibrarian.net/40270196/xml-rpc.el;
+    sha256 = "0i8hf90yhrjwqrv7q1f2g1cff6ld8apqkka42fh01wkdys1fbm7b";
+  };
+
+  phases = [ "buildPhase" "installPhase"];
+
+  buildInputs = [ emacs ];
+
+  buildPhase = ''
+    cp $src xml-rpc.el
+    emacs --batch -f batch-byte-compile xml-rpc.el
+  '';
+
+  installPhase = ''
+    install -d $out/share/emacs/site-lisp
+    install xml-rpc.el* $out/share/emacs/site-lisp
+  '';
+
+  meta = {
+    description = "An elisp implementation of clientside XML-RPC.";
+    homepage = https://launchpad.net/xml-rpc-el;
+    license = "GPLv3+";
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix
new file mode 100644
index 00000000000..289cf7ff8d6
--- /dev/null
+++ b/pkgs/applications/editors/geany/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, gtk2, which, pkgconfig, intltool }:
+
+let
+  version = "1.22";
+in
+
+stdenv.mkDerivation rec {
+  name = "geany-${version}";
+
+  src = fetchurl {
+    url = "http://download.geany.org/${name}.tar.gz";
+    md5 = "1cb7f6cea8e301c416211786cec474fa";
+  };
+
+  buildInputs = [ gtk2 which pkgconfig intltool ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  # This file should normally require a gtk-update-icon-cache -q /usr/share/icons/hicolor command
+  # It have no reasons to exist in a redistribuable package
+  postInstall = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    description = "A GTK2 small and ligthweight IDE.";
+    longDescription = ''
+      Geany is a small and lightweight Integrated Development Environment.
+      It was developed to provide a small and fast IDE, which has only a few dependencies from other packages.
+      Another goal was to be as independent as possible from a special Desktop Environment like KDE or GNOME.
+      Geany only requires the GTK2 runtime libraries.
+      Some basic features of Geany:
+      - Syntax highlighting
+      - Code folding
+      - Symbol name auto-completion
+      - Construct completion/snippets
+      - Auto-closing of XML and HTML tags
+      - Call tips
+      - Many supported filetypes including C, Java, PHP, HTML, Python, Perl, Pascal (full list)
+      - Symbol lists
+      - Code navigation
+      - Build system to compile and execute your code
+      - Simple project management
+      - Plugin interface
+    '';
+    homepage = "http://www.geany.org/";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/gobby/default.nix b/pkgs/applications/editors/gobby/default.nix
index badd18b8915..4d48ba69086 100644
--- a/pkgs/applications/editors/gobby/default.nix
+++ b/pkgs/applications/editors/gobby/default.nix
@@ -9,10 +9,10 @@ let
   
 in stdenv.mkDerivation rec {
 
-  name = "gobby-0.4.93";
+  name = "gobby-0.4.94";
   src = fetchurl {
     url = "http://releases.0x539.de/gobby/${name}.tar.gz";
-    sha256 = "1zk6p0kdp9vcvrr3kx0kw106ln309hd7bbsq8li1g0pcnkgrf4q4";
+    sha256 = "b9798808447cd94178430f0fb273d0e45d0ca30ab04560e3790bac469e03bb00";
   };
 
   buildInputs = [ pkgconfig gtkmm gsasl gtksourceview libxmlxx libinf intltool ]
diff --git a/pkgs/applications/editors/hexedit/default.nix b/pkgs/applications/editors/hexedit/default.nix
new file mode 100644
index 00000000000..07985dc214a
--- /dev/null
+++ b/pkgs/applications/editors/hexedit/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "hexedit-${version}";
+  version = "1.2.12";
+
+  src = fetchurl {
+    url = "http://rigaux.org/${name}.src.tgz";
+    sha256 = "bcffbf3d128516cc4e1da64485866fbb5f62754f2af8327e7a527855186ba10f";
+  };
+
+  buildInputs = [ ncurses ];
+
+  meta = {
+    description = "View and edit files in hexadecimal or in ASCII";
+    homepage = "http://prigaux.chez.com/hexedit.html";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/jedit/default.nix b/pkgs/applications/editors/jedit/default.nix
index 194f13a090c..efaf719c7c4 100644
--- a/pkgs/applications/editors/jedit/default.nix
+++ b/pkgs/applications/editors/jedit/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation {
   name = "jedit-4.4.2";
 
   src = fetchurl {
-    url = mirror://sf/jedit/jedit4.4.2source.tar.bz2;
+    url = mirror://sourceforge/jedit/jedit4.4.2source.tar.bz2;
     sha256 = "5e9ad9c32871b77ef0b9fe46dcfcea57ec52558d36113b7280194a33430b8ceb";
   };
 
diff --git a/pkgs/applications/editors/jedit/wrapper.nix b/pkgs/applications/editors/jedit/wrapper.nix
deleted file mode 100644
index 1126a7278d6..00000000000
--- a/pkgs/applications/editors/jedit/wrapper.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-args: with args;
-stdenv.mkDerivation {
-    name = jedit.name+"_startscript";
-
-    java = jre+"/bin/java";
-    jeditjar = jedit+"/lib/jedit.jar";
-
-    phases = "buildPhase";
-
-    buildPhase = "
-mkdir -p \$out/bin
-cat > \$out/bin/${jedit.name} << EOF
-#!/bin/sh
-exec $java -jar $jeditjar \\$*
-EOF
-  chmod +x \$out/bin/${jedit.name}
-";
-}
diff --git a/pkgs/applications/editors/kdevelop/default.nix b/pkgs/applications/editors/kdevelop/default.nix
index 92b4da5280a..14f9c1eb0d4 100644
--- a/pkgs/applications/editors/kdevelop/default.nix
+++ b/pkgs/applications/editors/kdevelop/default.nix
@@ -3,17 +3,25 @@
 
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
-  version = "4.3.0";
+  version = "4.3.1";
   pname = "kdevelop";
 
   src = fetchurl {
     url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "0vb2f5922r1da4va8sx2qn2i1lf2gqg7nfg594kncy98a9b1avnr";
+    sha256 = "0015hv39rqhyq1w6jw65lx7ls4l5pc3a2asvd5zsd65831vrfxxs";
   };
 
   buildInputs = [ kdevplatform kdebase_workspace okteta ];
 
-  buildNativeInputs = [ cmake pkgconfig automoc4 shared_mime_info gettext perl ];
+  nativeBuildInputs = [ cmake pkgconfig automoc4 shared_mime_info gettext perl ];
+
+  patches =
+    [ ( fetchurl {
+        url = https://git.reviewboard.kde.org/r/105211/diff/raw/;
+        name = "okteta-0.9.patch"; # fixes build with KDE-4.9.x
+        sha256 = "1mvqhw7jr1vi66l3jgam3slyfafcvwy4g3iapfi69dpfnzhmcxl0";
+      } )
+    ];
 
   NIX_CFLAGS_COMPILE = "-I${okteta}/include/KDE";
 
diff --git a/pkgs/applications/editors/kile/default.nix b/pkgs/applications/editors/kile/default.nix
index a24c6b18d8c..6b14b40a2c9 100644
--- a/pkgs/applications/editors/kile/default.nix
+++ b/pkgs/applications/editors/kile/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0nx5fmjrxrndnzvknxnybd8qh15jzfxzbny2rljq3amjw02y9lc2";
   };
 
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
   buildInputs = [ kdelibs ];
 
   # for KDE 4.7 the nl translations fail since kile-2.1.2
diff --git a/pkgs/applications/editors/leksah/default.nix b/pkgs/applications/editors/leksah/default.nix
index 81fbf5ad98a..86f0106ed05 100644
--- a/pkgs/applications/editors/leksah/default.nix
+++ b/pkgs/applications/editors/leksah/default.nix
@@ -16,6 +16,7 @@ cabal.mkDerivation (self: {
     QuickCheck regexBase regexTdfa strict text time transformers
     utf8String
   ];
+  testDepends = [ Cabal QuickCheck ];
   noHaddock = true;
   meta = {
     homepage = "http://www.leksah.org";
diff --git a/pkgs/applications/editors/monodevelop/default.nix b/pkgs/applications/editors/monodevelop/default.nix
index e4dc00ff0a1..c823ecfdf83 100644
--- a/pkgs/applications/editors/monodevelop/default.nix
+++ b/pkgs/applications/editors/monodevelop/default.nix
@@ -2,7 +2,7 @@
 , gtkmozembedsharp, monodoc
 , perl, perlXMLParser, pkgconfig
 , glib, gtk, GConf, gnome_vfs, libbonobo, libglade, libgnome
-, mozilla
+, mozilla, makeWrapper
 }:
 
 stdenv.mkDerivation {
@@ -14,8 +14,6 @@ stdenv.mkDerivation {
     md5 = "8c33df5629b0676b7ab552854c1de6fd";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-  
   patches = [./prefix.patch];
   
   buildInputs = [
@@ -24,5 +22,5 @@ stdenv.mkDerivation {
     gtkmozembedsharp monodoc
   ];
   
-  inherit mozilla monodoc gtksharp gtkmozembedsharp gtksourceviewsharp;
+  inherit mozilla monodoc gtksharp gtkmozembedsharp gtksourceviewsharp makeWrapper;
 }
diff --git a/pkgs/applications/editors/monodoc/default.nix b/pkgs/applications/editors/monodoc/default.nix
index db8b2e47884..8f6b6d6024c 100644
--- a/pkgs/applications/editors/monodoc/default.nix
+++ b/pkgs/applications/editors/monodoc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, mono, gtksharp, pkgconfig}:
+{stdenv, fetchurl, mono, gtksharp, pkgconfig, makeWrapper}:
 
 stdenv.mkDerivation {
   name = "monodoc-1.0.6";
@@ -9,9 +9,7 @@ stdenv.mkDerivation {
     md5 = "f2fc27e8e4717d90dc7efa2450625693";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-
   buildInputs = [mono gtksharp pkgconfig];
 
-  inherit gtksharp;
+  inherit gtksharp makeWrapper;
 }
diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix
index 974ced7d2b1..15cdadb04f5 100644
--- a/pkgs/applications/editors/nano/default.nix
+++ b/pkgs/applications/editors/nano/default.nix
@@ -2,27 +2,16 @@
 
 stdenv.mkDerivation (rec {
   pname = "nano";
-  version = "2.2.3";
+  version = "2.2.6";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/nano/${name}.tar.gz";
-    sha256 = "1vpl993xrpj8bqi1ayga8fc0j2jag90xp6rqakzwm3bxw71hmwi2";
+    sha256 = "0yp6pid67k8h7394spzw0067fl2r7rxm2b6kfccg87g8nlry2s5y";
   };
-  
+
   buildInputs = [ ncurses gettext ];
-  
-  configureFlags = ''
-    --disable-browser 
-    --disable-help 
-    --disable-justify 
-    --disable-mouse 
-    --disable-operatingdir
-    --disable-speller
-    --disable-tabcomp
-    --disable-wrapping
-  '';
 
   meta = {
     homepage = http://www.nano-editor.org/;
diff --git a/pkgs/applications/editors/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix
index 41028601da7..bd53f8d81d0 100644
--- a/pkgs/applications/editors/nedit/default.nix
+++ b/pkgs/applications/editors/nedit/default.nix
@@ -1,6 +1,6 @@
 {stdenv, fetchurl, x11, motif, libXpm}:
 
-assert stdenv.system == "i686-linux";
+assert stdenv.isLinux;
 
 stdenv.mkDerivation {
   name = "nedit-5.5";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   inherit motif;
   buildInputs = [x11 motif libXpm];
 
-  buildFlags = if stdenv.system == "i686-linux" then "linux" else "";
+  buildFlags = if stdenv.isLinux then "linux" else "";
 
   meta = {
     homepage = http://www.nedit.org;
diff --git a/pkgs/applications/editors/netbeans/default.nix b/pkgs/applications/editors/netbeans/default.nix
new file mode 100644
index 00000000000..f1fd9adbe86
--- /dev/null
+++ b/pkgs/applications/editors/netbeans/default.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchurl, jdk, unzip, which, makeWrapper, makeDesktopItem}:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "netbeans";
+    exec = "netbeans";
+    comment = "Integrated Development Environment";
+    desktopName = "Netbeans IDE";
+    genericName = "Integrated Development Environment";
+    categories = "Application;Development;";
+  };
+in
+stdenv.mkDerivation {
+  name = "netbeans-7.2";
+  src = fetchurl {
+    url = http://download.netbeans.org/netbeans/7.2/final/zip/netbeans-7.2-201207171143-ml.zip;
+    sha256 = "18ya1w291hdnc35vb12yqnai82wmqm7351wn82fax12kzha5fmci";
+  };
+  buildCommand = ''
+    # Unpack and copy the stuff
+    unzip $src
+    mkdir -p $out
+    cp -a netbeans $out
+    
+    # Create a wrapper capable of starting it
+    mkdir -p $out/bin
+    makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
+      --prefix PATH : ${jdk}/bin:${which}/bin
+      
+    # Create desktop item, so we can pick it from the KDE/GNOME menu
+    mkdir -p $out/share/applications
+    cp ${desktopItem}/share/applications/* $out/share/applications
+  '';
+  
+  buildInputs = [ unzip makeWrapper ];
+  
+  meta = {
+    description = "An integrated development environment for Java, C, C++ and PHP";
+    maintainers = [ stdenv.lib.maintainers.sander ];
+  };
+}
diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix
new file mode 100644
index 00000000000..22fc42c6c59
--- /dev/null
+++ b/pkgs/applications/editors/sublime/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, stdenv, glib, xlibs, cairo, gtk}:
+let
+  libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo];
+in
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "sublimetext-2.0.1";
+  src = 
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        name = "sublimetext-2.0.1.tar.bz2";
+        url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.tar.bz2;
+        sha256 = "1x6vmlfn5mdbf23nyfr7dhhi6y60lnpcmqj59svl3bzvayijsxaf";
+      }
+    else
+      fetchurl {
+        name = "sublimetext-2.0.1.tar.bz2";
+        url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2;
+        sha256 = "0174dnp9zika5as25mcls5y0qzhh8mnc5ajxsxz7qjrk4lrzk3c5";
+      };
+  buildCommand = ''
+    tar xvf ${src}
+    mkdir -p $out/bin
+    mv Sublime* $out/sublime
+    ln -s $out/sublime/sublime_text $out/bin/sublime
+
+    echo ${libPath}
+    patchelf \
+      --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath}:${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+      $out/sublime/sublime_text
+  '';
+
+  meta = {
+    description = "Sublime Text is a sophisticated text editor for code, markup and prose.";
+    license = "unfree";
+  };
+}
diff --git a/pkgs/applications/editors/vbindiff/default.nix b/pkgs/applications/editors/vbindiff/default.nix
new file mode 100644
index 00000000000..a03ce539d50
--- /dev/null
+++ b/pkgs/applications/editors/vbindiff/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "vbindiff-${version}";
+  version = "3.0_beta4";
+
+  buildInputs = [ ncurses ];
+
+  src = fetchurl {
+    url = "http://www.cjmweb.net/vbindiff/${name}.tar.gz";
+    sha256 = "0gcqy4ggp60qc6blq1q1gc90xmhip1m6yvvli4hdqlz9zn3mlpbx";
+  };
+
+  meta = {
+    description = "A terminal visual binary diff viewer";
+    homepage = "http://www.cjmweb.net/vbindiff/";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index 7e03fd6b7b3..9d07121f4cb 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -13,7 +13,7 @@ composableDerivation {} {
 
     configureFlags = ["--enable-gui=auto" "--with-features=${args.features}"];
 
-    buildNativeInputs = [ncurses pkgconfig]
+    nativeBuildInputs = [ncurses pkgconfig]
       ++ [ gtk libX11 libXext libSM libXpm libXt libXaw libXau libXmu glib 
            libICE ];
 
@@ -27,11 +27,11 @@ composableDerivation {} {
       // edf { name = "xsmp"; } #Disable XSMP session management
       // edf { name = "xsmp_interact"; } #Disable XSMP interaction
       // edf { name = "mzscheme"; } #Include MzScheme interpreter.
-      // edf { name = "perl"; feat = "perlinterp"; enable = { buildNativeInputs = [perl]; };} #Include Perl interpreter.
-      // edf { name = "python"; feat = "pythoninterp"; enable = { buildNativeInputs = [python]; }; } #Include Python interpreter.
-      // edf { name = "tcl"; enable = { buildNativeInputs = [tcl]; }; } #Include Tcl interpreter.
-      // edf { name = "ruby"; feat = "rubyinterp"; enable = { buildNativeInputs = [ruby]; };} #Include Ruby interpreter.
-      // edf { name = "lua" ; feat = "luainterp"; enable = { buildNativeInputs = [lua]; configureFlags = ["--with-lua-prefix=${args.lua}"];};}
+      // edf { name = "perl"; feat = "perlinterp"; enable = { nativeBuildInputs = [perl]; };} #Include Perl interpreter.
+      // edf { name = "python"; feat = "pythoninterp"; enable = { nativeBuildInputs = [python]; }; } #Include Python interpreter.
+      // edf { name = "tcl"; enable = { nativeBuildInputs = [tcl]; }; } #Include Tcl interpreter.
+      // edf { name = "ruby"; feat = "rubyinterp"; enable = { nativeBuildInputs = [ruby]; };} #Include Ruby interpreter.
+      // edf { name = "lua" ; feat = "luainterp"; enable = { nativeBuildInputs = [lua]; configureFlags = ["--with-lua-prefix=${args.lua}"];};}
       // edf { name = "cscope"; } #Include cscope interface.
       // edf { name = "workshop"; } #Include Sun Visual Workshop support.
       // edf { name = "netbeans"; } #Disable NetBeans integration support.
@@ -42,18 +42,18 @@ composableDerivation {} {
       // edf { name = "fontset"; } #Include X fontset output support.
       // edf { name = "acl"; } #Don't check for ACL support.
       // edf { name = "gpm"; } #Don't use gpm (Linux mouse daemon).
-      // edf { name = "nls"; enable = {buildNativeInputs = [gettext];}; } #Don't support NLS (gettext()).
+      // edf { name = "nls"; enable = {nativeBuildInputs = [gettext];}; } #Don't support NLS (gettext()).
       ;
 
   cfg = {
-    pythonSupport    = getConfig [ "vim" "python" ] true;
-    darwinSupport    = getConfig [ "vim" "darwin" ] false;
-    nlsSupport       = getConfig [ "vim" "nls" ] false;
-    tclSupport       = getConfig [ "vim" "tcl" ] false;
-    multibyteSupport = getConfig [ "vim" "multibyte" ] false;
-    cscopeSupport    = getConfig [ "vim" "cscope" ] false;
+    pythonSupport    = config.vim.python or true;
+    darwinSupport    = config.vim.darwin or false;
+    nlsSupport       = config.vim.nls or false;
+    tclSupport       = config.vim.tcl or false;
+    multibyteSupport = config.vim.multibyte or false;
+    cscopeSupport    = config.vim.cscope or false;
     # add .nix filetype detection and minimal syntax highlighting support
-    ftNixSupport     = getConfig [ "vim" "ftNix" ] true;
+    ftNixSupport     = config.vim.ftNix or true;
   };
 
   #--enable-gui=OPTS     X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
@@ -70,11 +70,11 @@ composableDerivation {} {
 
   postInstall = "
     rpath=`patchelf --print-rpath \$out/bin/vim`;
-    for i in $\buildNativeInputs; do
+    for i in \$nativeBuildInputs; do
       echo adding \$i/lib
       rpath=\$rpath:\$i/lib
     done
-    echo \$buildNativeInputs
+    echo \$nativeBuildInputs
     echo \$rpath
     patchelf --set-rpath \$rpath \$out/bin/{vim,gvim}
   ";
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index dec93327167..ff8da0e0947 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
  
   buildInputs = [ ncurses pkgconfig ];
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   configureFlags = [
     "--enable-multibyte"
diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index 0d765a0ad5c..5929f4c76c8 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -1,15 +1,18 @@
 { fetchurl, stdenv, ncurses, boehmgc, perl, help2man }:
 
 stdenv.mkDerivation rec {
-  name = "zile-2.4.7";
+  name = "zile-2.4.9";
 
   src = fetchurl {
     url = "mirror://gnu/zile/${name}.tar.gz";
-    sha256 = "1ak7qjb7s4whxg8qpkg7yixfnhinwfmzgav7rzi0kjmm93z35xcc";
+    sha256 = "0j801c28ypm924rw3lqyb6khxyslg6ycrv16wmmwcam0mk3mj6f7";
   };
 
   buildInputs = [ ncurses boehmgc ];
-  buildNativeInputs = [ help2man perl ];
+  nativeBuildInputs = [ help2man perl ];
+
+  # `help2man' wants to run Zile, which fails when cross-compiling.
+  crossAttrs.nativeBuildInputs = [];
 
   # Tests can't be run because most of them rely on the ability to
   # fiddle with the terminal.
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index cbab2da551a..b96d1bc84f7 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -3,7 +3,7 @@
 , bzip2
 , freetype
 , graphviz
-, ghostscript
+, ghostscript ? null
 , libjpeg
 , libpng
 , libtiff
@@ -27,16 +27,17 @@ stdenv.mkDerivation rec {
     sha256 = "0m0sa4jxsvm8pf9nfvkzlbzq13d1lj15lfz6jif12l6ywyh2c1cs";
   };
 
-  configureFlags = ''
+  configureFlags = "" + stdenv.lib.optionalString (ghostscript != null && stdenv.system != "x86_64-darwin") ''
     --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
     --with-gslib
+  '' + ''
     --with-frozenpaths
     ${if librsvg != null then "--with-rsvg" else ""}
   '';
 
   propagatedBuildInputs =
-    [ bzip2 freetype ghostscript libjpeg libpng libtiff libxml2 zlib librsvg
-    libtool jasper libX11 ];
+    [ bzip2 freetype libjpeg libpng libtiff libxml2 zlib librsvg
+    libtool jasper libX11 ] ++ stdenv.lib.optional (ghostscript != null && stdenv.system != "x86_64-darwin") ghostscript;
 
   buildInputs = [ tetex graphviz ];
 
@@ -46,6 +47,8 @@ stdenv.mkDerivation rec {
     '' else "";
 
   meta = {
-    homepage = http://www.imagemagick.org;
+    homepage = http://www.imagemagick.org/;
+    description = "A software suite to create, edit, compose, or convert bitmap images";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/alchemy/default.nix b/pkgs/applications/graphics/alchemy/default.nix
new file mode 100644
index 00000000000..2f31b568e34
--- /dev/null
+++ b/pkgs/applications/graphics/alchemy/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, jre}:
+
+stdenv.mkDerivation {
+  name = "alchemy-007-alpha";
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = http://al.chemy.org/files/Alchemy-007.tar.gz;
+    sha256 = "1pk00m4iajvv9jzv96in10czpcf7zc3d4nmd9biqagpsg28mr70b";
+  };
+
+  installPhase = ''
+    ensureDir $out/bin $out/share
+    cp -a . $out/share/alchemy
+    cat >> $out/bin/alchemy << EOF
+    #!/bin/sh
+    cd $out/share/alchemy
+    ${jre}/bin/java -jar Alchemy.jar "$@"
+    EOF
+    chmod +x $out/bin/alchemy
+  '';
+
+  meta = {
+    description = "Drawing application";
+    homepage = http://al.chemy.org/;
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/cinepaint/default.nix b/pkgs/applications/graphics/cinepaint/default.nix
index bea04f6dc2c..8d88e570f27 100644
--- a/pkgs/applications/graphics/cinepaint/default.nix
+++ b/pkgs/applications/graphics/cinepaint/default.nix
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
 
   patches = [ ./install.patch ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
-  NIX_LDFLAGS = "-llcms -ljpeg";
+  NIX_LDFLAGS = "-llcms -ljpeg -lX11";
 
   # NIX_CFLAGS_COMPILE = "-I.";
 
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 4d3b1a12b62..91c91dc3925 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -3,24 +3,24 @@
 , libgnome_keyring, gphoto2, gtk, ilmbase, intltool, lcms, lcms2
 , lensfun, libXau, libXdmcp, libexif, libglade, libgphoto2, libjpeg
 , libpng, libpthreadstubs, libraw1394, librsvg, libtiff, libxcb
-, openexr, pixman, pkgconfig, sqlite }:
+, openexr, pixman, pkgconfig, sqlite, bash, libxslt }:
 
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.0";
+  version = "1.2";
   name = "darktable-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/darktable/darktable-${version}.tar.gz";
-    sha256 = "0wjv2x62kf25db61ivbn8y8xr9hr8hdlcjq6l1qxfqn2bn8a3qkm";
+    url = "mirror://sourceforge/darktable/darktable/1.2/darktable-${version}.tar.xz";
+    sha256 = "0l2lrly46nda7b2y4gskqqxaajia34g487bgjcpd5ysxbhmmhlnw";
   };
 
   buildInputs =
     [ GConf atk cairo cmake curl dbus_glib exiv2 glib libgnome_keyring gtk
       ilmbase intltool lcms lcms2 lensfun libXau libXdmcp libexif
       libglade libgphoto2 libjpeg libpng libpthreadstubs libraw1394
-      librsvg libtiff libxcb openexr pixman pkgconfig sqlite
+      librsvg libtiff libxcb openexr pixman pkgconfig sqlite libxslt
     ];
 
   preConfigure = ''
@@ -30,6 +30,8 @@ stdenv.mkDerivation rec {
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${atk}/include/atk-1.0"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ilmbase}/include/OpenEXR"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${openexr}/include/OpenEXR"
+
+    substituteInPlace tools/create_preferences.sh.in --replace '#!/usr/bin/env bash' '#!${bash}/bin/bash'
   '';
 
   cmakeFlags = [
diff --git a/pkgs/applications/graphics/darktable/libpng-15.patch b/pkgs/applications/graphics/darktable/libpng-15.patch
deleted file mode 100644
index f817a326448..00000000000
--- a/pkgs/applications/graphics/darktable/libpng-15.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-commit 5803d31ae7704e0349821dcc20a94a1cddda69f1
-Author: Tim Harder <radhermit@gmail.com>
-Date:   Wed Sep 21 14:13:55 2011 -0700
-
-    Fix build with libpng-1.5
-    
-    Explicitly include the zlib.h header for the Z_BEST_COMPRESSION and
-    Z_DEFAULT_STRATEGY macros since >=libpng-1.5 doesn't pull it in anymore
-    via the png.h header.
-
-diff --git a/src/imageio/format/png.c b/src/imageio/format/png.c
-index 40c7d48..c7be566 100644
---- a/src/imageio/format/png.c
-+++ b/src/imageio/format/png.c
-@@ -28,6 +28,7 @@
- #include <stdio.h>
- #include <png.h>
- #include <inttypes.h>
-+#include <zlib.h>
- 
- DT_MODULE(1)
- 
diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix
index f0c666b14ea..ab421cee158 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -16,10 +16,16 @@ stdenv.mkDerivation rec {
       libxslt docbook_xsl libart_lgpl
     ] ++ stdenv.lib.optional withGNOME libgnomeui;
 
-  buildNativeInputs = [ pkgconfig intltool perl ];
+  nativeBuildInputs = [ pkgconfig intltool perl ];
 
   configureFlags = stdenv.lib.optionalString withGNOME "--enable-gnome";
 
+  patches = [ ./glib-top-level-header.patch ];
+
+  # This file should normally require a gtk-update-icon-cache -q /usr/share/icons/hicolor command
+  # It have no reasons to exist in a redistribuable package
+  postInstall = "rm $out/share/icons/hicolor/icon-theme.cache";
+
   meta = {
     description = "Gnome Diagram drawing software";
     homepage = http://live.gnome.org/Dia;
diff --git a/pkgs/applications/graphics/dia/glib-top-level-header.patch b/pkgs/applications/graphics/dia/glib-top-level-header.patch
new file mode 100644
index 00000000000..80460ae9d72
--- /dev/null
+++ b/pkgs/applications/graphics/dia/glib-top-level-header.patch
@@ -0,0 +1,471 @@
+diff -Naur dia-0.97.2-orig/app/app_procs.c dia-0.97.2/app/app_procs.c
+--- dia-0.97.2-orig/app/app_procs.c	2011-03-20 07:18:13.000000000 -0400
++++ dia-0.97.2/app/app_procs.c	2012-07-15 10:49:08.192726306 -0400
+@@ -50,7 +50,7 @@
+ #include <libxml/parser.h>
+ #include <libxml/xmlerror.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "app_procs.h"
+diff -Naur dia-0.97.2-orig/app/dia-win-remote.c dia-0.97.2/app/dia-win-remote.c
+--- dia-0.97.2-orig/app/dia-win-remote.c	2010-08-03 11:35:35.000000000 -0400
++++ dia-0.97.2/app/dia-win-remote.c	2012-07-15 10:49:08.159726316 -0400
+@@ -35,7 +35,7 @@
+ #include <shellapi.h>
+ #include <Shlwapi.h>
+ #include <glib.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ /**
+  * PROTOTYPES:
+diff -Naur dia-0.97.2-orig/app/filedlg.c dia-0.97.2/app/filedlg.c
+--- dia-0.97.2-orig/app/filedlg.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/app/filedlg.c	2012-07-15 10:49:08.227726294 -0400
+@@ -28,7 +28,7 @@
+ #include <unistd.h>
+ #endif
+ #include <stdio.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #undef GTK_DISABLE_DEPRECATED /* gtk_file_chooser_dialog_new_with_backend */
+ #include <gtk/gtk.h>
+diff -Naur dia-0.97.2-orig/app/load_save.c dia-0.97.2/app/load_save.c
+--- dia-0.97.2-orig/app/load_save.c	2011-09-25 07:55:11.000000000 -0400
++++ dia-0.97.2/app/load_save.c	2012-07-15 10:49:08.203726303 -0400
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h> /* g_access() and friends */
++#include <glib.h> /* g_access() and friends */
+ #include <errno.h>
+ 
+ #ifndef W_OK
+diff -Naur dia-0.97.2-orig/app/sheets_dialog_callbacks.c dia-0.97.2/app/sheets_dialog_callbacks.c
+--- dia-0.97.2-orig/app/sheets_dialog_callbacks.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/app/sheets_dialog_callbacks.c	2012-07-15 10:49:08.201726302 -0400
+@@ -44,7 +44,7 @@
+ #endif
+ #endif
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <gmodule.h>
+ 
+ #undef GTK_DISABLE_DEPRECATED /* GtkOptionMenu */
+diff -Naur dia-0.97.2-orig/ChangeLog.pre-git dia-0.97.2/ChangeLog.pre-git
+--- dia-0.97.2-orig/ChangeLog.pre-git	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/ChangeLog.pre-git	2012-07-15 10:49:08.384726247 -0400
+@@ -4137,7 +4137,7 @@
+ 	  plug-ins/vdx/vdx-export.c plug-ins/vdx/vdx-import.c 
+ 	  plug-ins/wmf/wmf.cpp plug-ins/wpg/wpg.c 
+ 	  plug-ins/xfig/xfig-export.c plug-ins/xfig/xfig-import.c
+-	  plug-ins/xslt/xslt.c : use <glib/gstdio.h> to match GLib's filename
++	  plug-ins/xslt/xslt.c : use <glib.h> to match GLib's filename
+ 	encoding to the io functions used, that is: g_open, g_fopen, g_stat, 
+ 	g_unlink, g_mkdir, g_rename (, g_access, g_lstat, g_remove, g_freopen, 
+ 	g_chdir, g_rmdir). Also replace gzopen() with gzdopen(g_open(), ...)
+@@ -5995,7 +5995,7 @@
+ 	Also special case strings starting with \tex - i.e. dont escape them -
+ 	to keep the use-case of direct tex input.
+ 	
+-	* lib/debug.c : #include <glib/gprintf.h> not just <gprintf.h>
++	* lib/debug.c : #include <glib.h>
+ 
+ 
+ 2006-01-14  Hans Breuer  <hans@breuer.org>
+@@ -6207,7 +6207,7 @@
+ 	* lib/makefile.msc : build debug.obj
+ 
+ 	* plug-ins/makefile.msc : building pgf in the right alphabetical order
+-	* plug-ins/pgf/render_pgf.c : include <glib/gprintf.h>
++	* plug-ins/pgf/render_pgf.c : include <glib.h>
+ 	
+ 2005-12-08  Lars Clausen  <lars@raeder.dk>
+ 
+diff -Naur dia-0.97.2-orig/lib/debug.c dia-0.97.2/lib/debug.c
+--- dia-0.97.2-orig/lib/debug.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/lib/debug.c	2012-07-15 10:49:06.813726730 -0400
+@@ -21,7 +21,7 @@
+ #include <config.h>
+ 
+ #include <stdio.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ #include <stdarg.h>
+ 
+ #include "debug.h"
+diff -Naur dia-0.97.2-orig/lib/dia_dirs.c dia-0.97.2/lib/dia_dirs.c
+--- dia-0.97.2-orig/lib/dia_dirs.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/lib/dia_dirs.c	2012-07-15 10:49:06.740726750 -0400
+@@ -30,7 +30,7 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #endif
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /** Get the name of a subdirectory of our data directory.
+  *  This function does not create the subdirectory, just make the correct name.
+diff -Naur dia-0.97.2-orig/lib/dia_xml.c dia-0.97.2/lib/dia_xml.c
+--- dia-0.97.2-orig/lib/dia_xml.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/lib/dia_xml.c	2012-07-15 10:49:06.770726743 -0400
+@@ -25,7 +25,7 @@
+ #include <fcntl.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <libxml/parser.h>
+ #include <libxml/parserInternals.h>
+diff -Naur dia-0.97.2-orig/objects/custom/shape_typeinfo.c dia-0.97.2/objects/custom/shape_typeinfo.c
+--- dia-0.97.2-orig/objects/custom/shape_typeinfo.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/objects/custom/shape_typeinfo.c	2012-07-15 10:49:06.639726783 -0400
+@@ -27,8 +27,8 @@
+ #include "custom_util.h"
+ #include <string.h>
+ #include <stdarg.h>
+-#include <glib/gstrfuncs.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
++#include <glib.h>
+ #include <libxml/parser.h>
+ 
+ /*
+diff -Naur dia-0.97.2-orig/objects/SISSI/sissi.c dia-0.97.2/objects/SISSI/sissi.c
+--- dia-0.97.2-orig/objects/SISSI/sissi.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/objects/SISSI/sissi.c	2012-07-15 10:49:06.570726804 -0400
+@@ -42,7 +42,7 @@
+ #include "dia_xml_libxml.h"
+ 
+ #include <string.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ #define DEFAULT_WIDTH  1.0
+ #define DEFAULT_HEIGHT 1.0
+diff -Naur dia-0.97.2-orig/objects/standard/image.c dia-0.97.2/objects/standard/image.c
+--- dia-0.97.2-orig/objects/standard/image.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/objects/standard/image.c	2012-07-15 10:49:06.683726770 -0400
+@@ -25,7 +25,7 @@
+ #ifdef HAVE_UNIST_H
+ #include <unistd.h>
+ #endif
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/cairo/diacairo.c dia-0.97.2/plug-ins/cairo/diacairo.c
+--- dia-0.97.2-orig/plug-ins/cairo/diacairo.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/cairo/diacairo.c	2012-07-15 10:49:06.433726846 -0400
+@@ -28,7 +28,7 @@
+ #include <errno.h>
+ #define G_LOG_DOMAIN "DiaCairo"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /*
+  * To me the following looks rather suspicious. Why do we need to compile
+diff -Naur dia-0.97.2-orig/plug-ins/cairo/diacairo-renderer.c dia-0.97.2/plug-ins/cairo/diacairo-renderer.c
+--- dia-0.97.2-orig/plug-ins/cairo/diacairo-renderer.c	2011-01-07 06:54:21.000000000 -0500
++++ dia-0.97.2/plug-ins/cairo/diacairo-renderer.c	2012-07-15 10:49:06.435726846 -0400
+@@ -28,7 +28,7 @@
+ #include <errno.h>
+ #define G_LOG_DOMAIN "DiaCairo"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #ifdef HAVE_PANGOCAIRO_H
+ #include <pango/pangocairo.h>
+diff -Naur dia-0.97.2-orig/plug-ins/cgm/cgm.c dia-0.97.2/plug-ins/cgm/cgm.c
+--- dia-0.97.2-orig/plug-ins/cgm/cgm.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/cgm/cgm.c	2012-07-15 10:49:06.425726846 -0400
+@@ -31,7 +31,7 @@
+ #include <glib.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/drs/dia-render-script.c dia-0.97.2/plug-ins/drs/dia-render-script.c
+--- dia-0.97.2-orig/plug-ins/drs/dia-render-script.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/drs/dia-render-script.c	2012-07-15 10:49:06.427726848 -0400
+@@ -54,7 +54,7 @@
+ 
+ #define G_LOG_DOMAIN "DiaRenderScript"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "filter.h"
+diff -Naur dia-0.97.2-orig/plug-ins/dxf/dxf-export.c dia-0.97.2/plug-ins/dxf/dxf-export.c
+--- dia-0.97.2-orig/plug-ins/dxf/dxf-export.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/dxf/dxf-export.c	2012-07-15 10:49:06.421726850 -0400
+@@ -29,7 +29,7 @@
+ #include <math.h>
+ #include <glib.h>
+ #include <errno.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "autocad_pal.h"
+ 
+diff -Naur dia-0.97.2-orig/plug-ins/dxf/dxf-import.c dia-0.97.2/plug-ins/dxf/dxf-import.c
+--- dia-0.97.2-orig/plug-ins/dxf/dxf-import.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/dxf/dxf-import.c	2012-07-15 10:49:06.419726851 -0400
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/hpgl/hpgl.c dia-0.97.2/plug-ins/hpgl/hpgl.c
+--- dia-0.97.2-orig/plug-ins/hpgl/hpgl.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/hpgl/hpgl.c	2012-07-15 10:49:06.487726830 -0400
+@@ -37,7 +37,7 @@
+ #include <errno.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/libart/export_png.c dia-0.97.2/plug-ins/libart/export_png.c
+--- dia-0.97.2-orig/plug-ins/libart/export_png.c	2011-07-03 06:56:08.000000000 -0400
++++ dia-0.97.2/plug-ins/libart/export_png.c	2012-07-15 10:49:06.415726849 -0400
+@@ -29,7 +29,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <gtk/gtk.h>
+ 
+ #include "intl.h"
+diff -Naur dia-0.97.2-orig/plug-ins/metapost/render_metapost.c dia-0.97.2/plug-ins/metapost/render_metapost.c
+--- dia-0.97.2-orig/plug-ins/metapost/render_metapost.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/metapost/render_metapost.c	2012-07-15 10:49:06.396726857 -0400
+@@ -43,7 +43,7 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_metapost.h"
+diff -Naur dia-0.97.2-orig/plug-ins/pgf/render_pgf.c dia-0.97.2/plug-ins/pgf/render_pgf.c
+--- dia-0.97.2-orig/plug-ins/pgf/render_pgf.c	2011-01-07 07:11:34.000000000 -0500
++++ dia-0.97.2/plug-ins/pgf/render_pgf.c	2012-07-15 10:49:06.445726842 -0400
+@@ -61,8 +61,8 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gprintf.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_pgf.h"
+diff -Naur dia-0.97.2-orig/plug-ins/postscript/paginate_psprint.c dia-0.97.2/plug-ins/postscript/paginate_psprint.c
+--- dia-0.97.2-orig/plug-ins/postscript/paginate_psprint.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/postscript/paginate_psprint.c	2012-07-15 10:49:06.451726838 -0400
+@@ -31,7 +31,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/postscript/render_eps.c dia-0.97.2/plug-ins/postscript/render_eps.c
+--- dia-0.97.2-orig/plug-ins/postscript/render_eps.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/postscript/render_eps.c	2012-07-15 10:49:06.451726838 -0400
+@@ -55,7 +55,7 @@
+ #include <locale.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_eps.h"
+diff -Naur dia-0.97.2-orig/plug-ins/pstricks/render_pstricks.c dia-0.97.2/plug-ins/pstricks/render_pstricks.c
+--- dia-0.97.2-orig/plug-ins/pstricks/render_pstricks.c	2011-01-07 07:11:34.000000000 -0500
++++ dia-0.97.2/plug-ins/pstricks/render_pstricks.c	2012-07-15 10:49:06.410726853 -0400
+@@ -50,7 +50,7 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_pstricks.h"
+diff -Naur dia-0.97.2-orig/plug-ins/python/pydia-render.c dia-0.97.2/plug-ins/python/pydia-render.c
+--- dia-0.97.2-orig/plug-ins/python/pydia-render.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/python/pydia-render.c	2012-07-15 10:49:06.503726822 -0400
+@@ -21,7 +21,7 @@
+ 
+ #include <Python.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <locale.h>
+ 
+diff -Naur dia-0.97.2-orig/plug-ins/shape/shape-export.c dia-0.97.2/plug-ins/shape/shape-export.c
+--- dia-0.97.2-orig/plug-ins/shape/shape-export.c	2009-11-08 06:14:56.000000000 -0500
++++ dia-0.97.2/plug-ins/shape/shape-export.c	2012-07-15 10:49:06.489726827 -0400
+@@ -40,7 +40,7 @@
+ #include <unistd.h>
+ #endif
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /* the dots per centimetre to render this diagram at */
+ /* this matches the setting `100%' setting in dia. */
+diff -Naur dia-0.97.2-orig/plug-ins/svg/render_svg.c dia-0.97.2/plug-ins/svg/render_svg.c
+--- dia-0.97.2-orig/plug-ins/svg/render_svg.c	2011-12-17 11:30:38.000000000 -0500
++++ dia-0.97.2/plug-ins/svg/render_svg.c	2012-07-15 10:49:06.392726859 -0400
+@@ -30,7 +30,7 @@
+ #endif
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <libxml/entities.h>
+ #include <libxml/tree.h>
+diff -Naur dia-0.97.2-orig/plug-ins/vdx/vdx-export.c dia-0.97.2/plug-ins/vdx/vdx-export.c
+--- dia-0.97.2-orig/plug-ins/vdx/vdx-export.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/vdx/vdx-export.c	2012-07-15 10:55:17.066579728 -0400
+@@ -32,11 +32,12 @@
+ 
+ #include <string.h>
+ #include <math.h>
++#include <sys/stat.h>
+ #include <glib.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <locale.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/vdx/vdx-import.c dia-0.97.2/plug-ins/vdx/vdx-import.c
+--- dia-0.97.2-orig/plug-ins/vdx/vdx-import.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/vdx/vdx-import.c	2012-07-15 10:49:06.466726836 -0400
+@@ -28,7 +28,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <libxml/tree.h>
+diff -Naur dia-0.97.2-orig/plug-ins/wmf/wmf.cpp dia-0.97.2/plug-ins/wmf/wmf.cpp
+--- dia-0.97.2-orig/plug-ins/wmf/wmf.cpp	2011-03-13 09:07:48.000000000 -0400
++++ dia-0.97.2/plug-ins/wmf/wmf.cpp	2012-07-15 10:49:06.482726831 -0400
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/wpg/wpg.c dia-0.97.2/plug-ins/wpg/wpg.c
+--- dia-0.97.2-orig/plug-ins/wpg/wpg.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/wpg/wpg.c	2012-07-15 10:49:06.406726855 -0400
+@@ -40,7 +40,7 @@
+ #include <errno.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xfig/xfig-export.c dia-0.97.2/plug-ins/xfig/xfig-export.c
+--- dia-0.97.2-orig/plug-ins/xfig/xfig-export.c	2011-12-17 11:30:38.000000000 -0500
++++ dia-0.97.2/plug-ins/xfig/xfig-export.c	2012-07-15 10:49:06.400726856 -0400
+@@ -16,7 +16,7 @@
+ #include <locale.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xfig/xfig-import.c dia-0.97.2/plug-ins/xfig/xfig-import.c
+--- dia-0.97.2-orig/plug-ins/xfig/xfig-import.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/xfig/xfig-import.c	2012-07-15 10:49:06.402726853 -0400
+@@ -40,7 +40,7 @@
+ #include <locale.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xslt/xslt.c dia-0.97.2/plug-ins/xslt/xslt.c
+--- dia-0.97.2-orig/plug-ins/xslt/xslt.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/xslt/xslt.c	2012-07-15 10:49:06.440726844 -0400
+@@ -27,7 +27,7 @@
+ #include <string.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "filter.h"
+ #include "intl.h"
+diff -Naur dia-0.97.2-orig/tests/test-boundingbox.c dia-0.97.2/tests/test-boundingbox.c
+--- dia-0.97.2-orig/tests/test-boundingbox.c	2009-11-07 09:28:35.000000000 -0500
++++ dia-0.97.2/tests/test-boundingbox.c	2012-07-15 10:49:06.986726677 -0400
+@@ -29,7 +29,7 @@
+ #include <glib-object.h>
+ 
+ #if GLIB_CHECK_VERSION(2,16,0)
+-#include <glib/gtestutils.h>
++#include <glib.h>
+ #endif
+ #include "dialib.h"
+ 
+diff -Naur dia-0.97.2-orig/tests/test-objects.c dia-0.97.2/tests/test-objects.c
+--- dia-0.97.2-orig/tests/test-objects.c	2009-11-07 09:28:35.000000000 -0500
++++ dia-0.97.2/tests/test-objects.c	2012-07-15 10:49:06.985726677 -0400
+@@ -29,7 +29,7 @@
+ #include <glib-object.h>
+ 
+ #if GLIB_CHECK_VERSION(2,16,0)
+-#include <glib/gtestutils.h>
++#include <glib.h>
+ #endif
+ 
+ #include "object.h"
diff --git a/pkgs/applications/graphics/digikam/2.nix b/pkgs/applications/graphics/digikam/2.nix
new file mode 100644
index 00000000000..be991772d39
--- /dev/null
+++ b/pkgs/applications/graphics/digikam/2.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, qimageblitz, qca2, eigen,
+lcms, jasper, libgphoto2, kdepimlibs, gettext, soprano, libjpeg, libtiff,
+liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost,
+shared_desktop_ontologies, marble, mysql }:
+
+stdenv.mkDerivation rec {
+  name = "digikam-2.9.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/digikam/${name}.tar.bz2";
+    sha256 = "181vf065j1zz26zahkb7hy3fk4837nvwm61cnykvni7w40w0zpbk";
+  };
+
+  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
+
+  buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
+    jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
+    opencv libkexiv2 libkipi boost shared_desktop_ontologies marble mysql ];
+
+  # Make digikam find some FindXXXX.cmake
+  KDEDIRS="${marble}:${qjson}";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Photo Management Program";
+    license = "GPL";
+    homepage = http://www.digikam.org;
+    maintainers = with stdenv.lib.maintainers; [ viric urkud ];
+    inherit (kdelibs.meta) platforms;
+  };
+}
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index a293311e2a4..713adaffd06 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -4,14 +4,14 @@ liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost
 shared_desktop_ontologies, marble, mysql }:
 
 stdenv.mkDerivation rec {
-  name = "digikam-2.6.0";
+  name = "digikam-3.2.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/digikam/${name}.tar.bz2";
-    sha256 = "1prnaywnbv0xpw6knqagzc4gn1vsj9kw2hvdasjwknc9ljiyl721";
+    url = "http://download.kde.org/stable/digikam/${name}.tar.bz2";
+    sha256 = "06j858d2nvbqh0bw6m60rh1bsws06fm5vfjpwwi3zxsf5ka08wmx";
   };
 
-  buildNativeInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
 
   buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
     jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
   # Make digikam find some FindXXXX.cmake
   KDEDIRS="${marble}:${qjson}";
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Photo Management Program";
     license = "GPL";
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index 0ac499f2681..f832513a824 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
 	buildInputs = [djvulibre qt4];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   patches = [ ./djview4-qt-4.8.patch ];
 
diff --git a/pkgs/applications/graphics/f-spot/default.nix b/pkgs/applications/graphics/f-spot/default.nix
index 17a3cd22a5f..856795ea356 100644
--- a/pkgs/applications/graphics/f-spot/default.nix
+++ b/pkgs/applications/graphics/f-spot/default.nix
@@ -1,14 +1,16 @@
 { stdenv, fetchurl, perl, perlXMLParser, pkgconfig, mono, libexif
 , libgnome, libgnomeui, gtksharp, libjpeg, sqlite, lcms, libgphoto2
 , monoDLLFixer
+, makeWrapper
 }:
 
 stdenv.mkDerivation {
   name = "f-spot-0.0.10";
 
   builder = ./builder.sh;
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
   
+  inherit makeWrapper;
+
   src = fetchurl {
     url = http://nixos.org/tarballs/f-spot-0.0.10.tar.bz2;
     md5 = "19cc6e067ccc261b0502ff6189b79832";
diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix
index 2685aad8cf7..927ca2ab679 100644
--- a/pkgs/applications/graphics/fbida/default.nix
+++ b/pkgs/applications/graphics/fbida/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1riia87v5nsx858xnlvc7sspr1p36adjqrdch1255ikr5xbv6h6x";
   };
 
-  buildNativeInputs = [ pkgconfig which ];
+  nativeBuildInputs = [ pkgconfig which ];
   buildInputs =
     [ libexif libjpeg libpng libungif freetype fontconfig libtiff libwebp
       imagemagick curl saneBackends
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index e19d06927a2..0cd34027966 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, x11, imlib2, libjpeg, libpng, giblib
 , libXinerama, curl }:
 
-stdenv.mkDerivation {
-  name = "feh-2.4";
+stdenv.mkDerivation rec {
+  name = "feh-2.8";
 
   src = fetchurl {
-    url = http://feh.finalrewind.org/feh-2.4.tar.bz2;
-    sha256 = "00liykp0ipmmiggl26wk72iawcff6zpmbniifdr3f5yf0sfanz48";
+    url = "http://feh.finalrewind.org/${name}.tar.bz2";
+    sha256 = "0zmslchnzvi9ydxj2mgci4x8zpv5mdfkf7kyny3nibbpajibqmrx";
   };
 
   buildInputs = [x11 imlib2 giblib libjpeg libpng libXinerama curl ];
diff --git a/pkgs/applications/graphics/freecad/cmakeinstall.patch b/pkgs/applications/graphics/freecad/cmakeinstall.patch
deleted file mode 100644
index 6b8f9fb1a60..00000000000
--- a/pkgs/applications/graphics/freecad/cmakeinstall.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-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
index cfe97e12476..340c9d0a69e 100644
--- a/pkgs/applications/graphics/freecad/default.nix
+++ b/pkgs/applications/graphics/freecad/default.nix
@@ -1,17 +1,14 @@
-{ fetchsvn, stdenv, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts,
+{ fetchurl, 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}";
+  version = "0.13.1830";
 
-  src = fetchsvn {
-    url = https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk;
-    rev = "4184";
-    sha256 = "26bd8407ce38f070b81ef39145aed093eed3c200d165a605b8169162d66568ce";
+  src = fetchurl {
+    url = "mirror://sourceforge/free-cad/${name}.tar.gz";
+    sha256 = "04rgww5y32asn4sx5j4wh79ggvb479pq56xfcfj6gkg44mid23jm";
   };
 
   buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
@@ -19,12 +16,6 @@ stdenv.mkDerivation rec {
 
   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";
@@ -35,7 +26,7 @@ stdenv.mkDerivation rec {
       --set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1
   '';
 
-  patches = [ ./cmakeinstall.patch ./pythonpath.patch ];
+  patches = [ ./pythonpath.patch ];
 
   meta = {
     homepage = http://free-cad.sourceforge.net/;
diff --git a/pkgs/applications/graphics/freecad/pythonpath.patch b/pkgs/applications/graphics/freecad/pythonpath.patch
index 849c778aedb..8b09a574807 100644
--- a/pkgs/applications/graphics/freecad/pythonpath.patch
+++ b/pkgs/applications/graphics/freecad/pythonpath.patch
@@ -1,15 +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 @@
+diff --git a/src/Main/MainGui.cpp b/src/Main/MainGui.cpp
+index 03407c5..b029384 100644
+--- a/src/Main/MainGui.cpp
++++ b/src/Main/MainGui.cpp
+@@ -190,15 +190,15 @@ int main( int argc, char ** argv )
      // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559846

      putenv("LANG=C");

      putenv("LC_ALL=C");

 -    putenv("PYTHONPATH=");

 +    //putenv("PYTHONPATH=");

+ #elif defined(FC_OS_MACOSX)

+     (void)QLocale::system();

+     putenv("LANG=C");

+     putenv("LC_ALL=C");

+-    putenv("PYTHONPATH=");

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

  #else

      setlocale(LC_NUMERIC, "C");

 -    _putenv("PYTHONPATH=");

diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index a166fc7010e..2506b26e238 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -2,11 +2,11 @@
 , intltool, gettext, libchamplain_0_6, fbida }:
 
 stdenv.mkDerivation rec {
-  name = "geeqie-1.0";
+  name = "geeqie-1.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/geeqie/${name}.tar.gz";
-    sha256 = "1p8z47cqdqqkn8b0fr5bqsfinz4dgqk4353s8f8d9ha6cik69bfi";
+    sha256 = "1kzy39z9505xkayyx7rjj2wda76xy3ch1s5z35zn8yli54ffhi2m";
   };
 
   preConfigure =
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index bf29ae13e5e..4a9890720a3 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -4,11 +4,11 @@
 , python, pygtk, libart_lgpl, libexif, gettext, xlibs }:
 
 stdenv.mkDerivation rec {
-  name = "gimp-2.8.0";
+  name = "gimp-2.8.4";
   
   src = fetchurl {
     url = "ftp://ftp.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
-    md5 = "28997d14055f15db063eb92e1c8a7ebb";
+    md5 = "392592e8755d046317878d226145900f";
   };
   
   buildInputs = 
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index 70a27030969..962cb387c73 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -36,7 +36,7 @@ let
  libLQR = pluginDerivation {
     name = "liblqr-1-0.4.1";
     # required by lqrPlugin, you don't havet to install this lib explicitely
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/liblqr-1-0.4.1.tar.bz2;
       sha256 = "02g90wag7xi5rjlmwq8h0qs666b1i2sa90s4303hmym40il33nlz";
@@ -50,7 +50,7 @@ rec {
        Video
     */
     name = "gap-2.6.0";
-    buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgconfig glib pkgs.intltool gimp.gtk ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = ftp://ftp.gimp.org/pub/gimp/plug-ins/v2.6/gap/gimp-gap-2.6.0.tar.bz2;
       sha256 = "1jic7ixcmsn4kx2cn32nc5087rk6g8xsrz022xy11yfmgvhzb0ql";
@@ -74,7 +74,7 @@ rec {
        Filters/Generic/FFT Inverse
     */
     name = "fourier-0.3.3";
-    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgs.fftwSinglePrec  pkgconfig glib] ++ gimp.nativeBuildInputs;
     postInstall = "fail";
     installPhase = "installPlugins fourier";
     src = fetchurl {
@@ -91,7 +91,7 @@ rec {
       Filters/Enhance/Smart remove selection
     */
     name = "resynthesizer-0.16";
-    buildInputs = [ gimp pkgs.fftw ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp pkgs.fftw ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://www.logarithmic.net/pfh-files/resynthesizer/resynthesizer-0.16.tar.gz;
       sha256 = "1k90a1jzswxmajn56rdxa4r60v9v34fmqsiwfdxqcvx3yf4yq96x";
@@ -105,7 +105,7 @@ rec {
 
   texturize = pluginDerivation {
     name = "texturize-2.1";
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://prdownloads.sourceforge.net/gimp-texturize/texturize-2.1_src.tgz;
       sha256 = "0cdjq25g3yfxx6bzx6nid21kq659s1vl9id4wxyjs2dhcv229cg3";
@@ -118,7 +118,7 @@ rec {
       Filters/Enhance/Wavelet sharpen
     */
     name = "wavelet-sharpen-0.1.2";
-    buildInputs = [ gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/wavelet-sharpen-0.1.2.tar.gz;
       sha256 = "0vql1k67i21g5ivaa1jh56rg427m0icrkpryrhg75nscpirfxxqw";
@@ -131,7 +131,7 @@ rec {
        Layer/Liquid Rescale
     */
     name = "lqr-plugin-0.6.1";
-    buildInputs = [ pkgconfig libLQR gimp ] ++ gimp.buildNativeInputs;
+    buildInputs = [ pkgconfig libLQR gimp ] ++ gimp.nativeBuildInputs;
     src = fetchurl {
       url = http://registry.gimp.org/files/gimp-lqr-plugin-0.6.1.tar.bz2;
       sha256 = "00hklkpcimcbpjly4rjhfipaw096cpy768g9wixglwrsyqhil7l9";
@@ -146,7 +146,7 @@ rec {
   let imagemagick = pkgs.imagemagickBig; # maybe the non big version is enough?
   in pluginDerivation {
       name = "gmic-1.3.2.0";
-      buildInputs = [ imagemagick pkgconfig gimp pkgs.fftwSinglePrec ] ++ gimp.buildNativeInputs;
+      buildInputs = [ imagemagick pkgconfig gimp pkgs.fftwSinglePrec ] ++ gimp.nativeBuildInputs;
       src = fetchurl {
         url = http://dfn.dl.sourceforge.net/sourceforge/gmic/gmic_1.3.2.0.tar.gz;
         sha256 = "0mxq664vzzc2l6k6sqm9syp34mihhi262i6fixk1g12lmc28797h";
@@ -172,7 +172,7 @@ rec {
   # or use the binary
   ufraw = pluginDerivation {
     name = "ufraw-0.15";
-    buildInputs = [pkgs.lcms gimp] ++ gimp.buildNativeInputs;
+    buildInputs = [pkgs.lcms gimp] ++ gimp.nativeBuildInputs;
       # --enable-mime - install mime files, see README for more information
       # --enable-extras - build extra (dcraw, nikon-curve) executables
       # --enable-dst-correction - enable DST correction for file timestamps.
diff --git a/pkgs/applications/graphics/gocr/default.nix b/pkgs/applications/graphics/gocr/default.nix
index 4b2ebceda47..0f42ac7743e 100644
--- a/pkgs/applications/graphics/gocr/default.nix
+++ b/pkgs/applications/graphics/gocr/default.nix
@@ -1,14 +1,23 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, tk }:
 
 stdenv.mkDerivation rec {
-  name = "gocr-0.44";
+  name = "gocr-0.49";
 
   src = fetchurl {
-    url = http://prdownloads.sourceforge.net/jocr/gocr-0.44.tar.gz;
-    sha256 = "0kvb7cbk6z5n4g0hhbwpdk2f3819yfamwsmkwanj99yhni6p5mr0";
+    url = http://www-e.uni-magdeburg.de/jschulen/ocr/gocr-0.49.tar.gz;
+    sha256 = "06hpzp7rkkwfr1fvmc8kcfz9v490i9yir7f7imh13gmka0fr6afc";
   };
 
+  postInstall = ''
+    sed -i -e 's|exec wish|exec ${tk}/bin/wish|' $out/bin/gocr.tcl
+  '';
+
   meta = {
+    homepage = "http://jocr.sourceforge.net/";
     description = "GPL Optical Character Recognition";
+    license = "GPLv2";
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index 6caf0f05c51..c02bc6024df 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
       zlib libtool
     ];
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   postInstall = ''
     sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index 27b3c0c9b03..a9ff7ef25c3 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ panotools wxGTK libtiff libpng openexr boost tclap
     exiv2 gettext ilmbase mesa freeglut glew libXmu libXi ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   propagatedUserEnvPackages = [ enblendenfuse autopanosiftc ];
 
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index 9ef5382eaf9..37905f8a73f 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -4,14 +4,14 @@
 , gsl, python, pyxml, lxml, poppler, imagemagick, libwpg }:
 
 stdenv.mkDerivation rec {
-  name = "inkscape-0.48.2";
+  name = "inkscape-0.48.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/inkscape/${name}.tar.bz2";
-    sha256 = "10v7ixdz7f8vgk2wv0m81zli9p0f446cm1f4aqlvni1ndsx44fi2";
+    sha256 = "17aiibgdwjqpjc38f0yr2sdlgwngg5ac9srlybjcx9aspf6ashc7";
   };
 
-  patches = [ ./configure-python-libs.patch ./libpng-1.5.patch ];
+  patches = [ ./configure-python-libs.patch ];
 
   propagatedBuildInputs = [
     # Python is used at run-time to execute scripts, e.g., those from
diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix
new file mode 100644
index 00000000000..df50dd5bd79
--- /dev/null
+++ b/pkgs/applications/graphics/ipe/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, pkgconfig, zlib, qt4, freetype, cairo, lua5, texLive, ghostscriptX
+, makeWrapper }:
+let ghostscript = ghostscriptX; in
+stdenv.mkDerivation rec {
+  name = "ipe-7.1.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ipe7/ipe/7.1.0/${name}-src.tar.gz";
+    sha256 = "04fs5slci3bmpgz8d038h3hnzzdw57xykcpsmisdxci2xrkxx41k";
+  };
+
+  # changes taken from Gentoo portage
+  preConfigure = ''
+    cd src
+    sed -i \
+      -e 's/fpic/fPIC/' \
+      -e 's/moc-qt4/moc/' \
+      config.mak || die
+    sed -i -e 's/install -s/install/' common.mak || die
+  '';
+
+  IPEPREFIX="$$out";
+  URWFONTDIR="${texLive}/texmf-dist/fonts/type1/urw/";
+
+  buildInputs = [
+    pkgconfig zlib qt4 freetype cairo lua5 texLive ghostscript makeWrapper
+  ];
+
+  postInstall = ''
+    for prog in $out/bin/*; do
+      wrapProgram "$prog" --prefix PATH : "${texLive}/bin"
+    done
+  '';
+
+  #TODO: make .desktop entry
+
+  meta = {
+    description = "An editor for drawing figures";
+    homepage = http://ipe7.sourceforge.net;
+    license = "GPLv3+";
+    longDescription = ''
+      Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
+      It supports making small figures for inclusion into LaTeX-documents
+      as well as presentations in PDF.
+    '';
+  };
+}
diff --git a/pkgs/applications/graphics/kipi-plugins/default.nix b/pkgs/applications/graphics/kipi-plugins/default.nix
index e551b152390..61a8380b1c5 100644
--- a/pkgs/applications/graphics/kipi-plugins/default.nix
+++ b/pkgs/applications/graphics/kipi-plugins/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
       libksane libxslt gettext opencv libgpod gdk_pixbuf qjson
     ];
 
-  buildNativeInputs = [ pkgconfig cmake automoc4 ];
+  nativeBuildInputs = [ pkgconfig cmake automoc4 ];
 
   meta = {
     description = "Photo Management Program";
diff --git a/pkgs/applications/graphics/kuickshow/builder.sh b/pkgs/applications/graphics/kuickshow/builder.sh
deleted file mode 100644
index 2283e956f7b..00000000000
--- a/pkgs/applications/graphics/kuickshow/builder.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-source $stdenv/setup
-
-patchPhase=patchPhase
-patchPhase() {
-  sed -e "s@-ljpeg6b@-ljpeg@" -i configure
-}
-
-genericBuild
-
-ln -sv $KDEDIR/share/mimelnk $out/share
diff --git a/pkgs/applications/graphics/kuickshow/default.nix b/pkgs/applications/graphics/kuickshow/default.nix
index b26ac12300b..7a410642958 100644
--- a/pkgs/applications/graphics/kuickshow/default.nix
+++ b/pkgs/applications/graphics/kuickshow/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs imlib ];
 
-  buildNativeInputs = [ cmake gettext pkgconfig ];
+  nativeBuildInputs = [ cmake gettext pkgconfig ];
 }
diff --git a/pkgs/applications/graphics/meshlab/default.nix b/pkgs/applications/graphics/meshlab/default.nix
index 9b39d8e8f1f..7151fc7af5c 100644
--- a/pkgs/applications/graphics/meshlab/default.nix
+++ b/pkgs/applications/graphics/meshlab/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl, qt, bzip2, lib3ds, levmar, muparser, unzip}:
+{stdenv, fetchurl, qt4, bzip2, lib3ds, levmar, muparser, unzip}:
 
 stdenv.mkDerivation rec {
-  name = "meshlab-1.2.3a";
+  name = "meshlab-1.3.2";
 
   src = fetchurl {
-    url = mirror://sourceforge/meshlab/MeshLabSrc_AllInc_v123a.tgz;
-    sha256 = "09w42q0x1yjr7l9ng952lic7vkb1arsvqg1fld5s297zwzfmsl9v";
+    url = "mirror://sourceforge/meshlab/meshlab/MeshLab%20v1.3.2/MeshLabSrc_AllInc_v132.tgz";
+    sha256 = "d57f0a99a55421aac54a66e2475d48f00f7b1752f9587cd69cf9b5b9c1a519b1";
   };
 
   # I don't know why I need this; without this, the rpath set at the beginning of the
@@ -13,13 +13,16 @@ stdenv.mkDerivation rec {
   dontPatchELF = true;
 
   buildPhase = ''
+    mkdir -p "$out/include"
+    cp -r vcglib "$out/include"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$out/include/vcglib"
     export NIX_LDFLAGS="-rpath $out/opt/meshlab $NIX_LDFLAGS"
     cd meshlab/src
     pushd external
     qmake -recursive external.pro
     make
     popd
-    qmake -recursive meshlabv12.pro
+    qmake -recursive meshlab_full.pro
     make
   '';
 
@@ -31,7 +34,9 @@ stdenv.mkDerivation rec {
     ln -s $out/opt/meshlab/meshlab $out/bin/meshlab
   '';
 
-  buildInputs = [ qt unzip ];
+  sourceRoot = ".";
+
+  buildInputs = [ qt4 unzip ];
 
   meta = {
     description = "System for the processing and editing of unstructured 3D triangular meshes";
diff --git a/pkgs/applications/graphics/mypaint/default.nix b/pkgs/applications/graphics/mypaint/default.nix
new file mode 100644
index 00000000000..a59498b8f14
--- /dev/null
+++ b/pkgs/applications/graphics/mypaint/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, gettext, glib, gtk, json_c, lcms2, libpng
+, makeWrapper, pkgconfig, pygtk, python, pythonPackages, scons, swig
+}:
+
+stdenv.mkDerivation rec {
+  name = "mypaint-${version}";
+  version = "1.1.0";
+
+  src = fetchurl {
+    url = "http://download.gna.org/mypaint/${name}.tar.bz2";
+    sha256 = "0f7848hr65h909c0jkcx616flc0r4qh53g3kd1cgs2nr1pjmf3bq";
+  };
+
+  buildInputs = [ 
+    gettext glib gtk json_c lcms2 libpng makeWrapper pkgconfig pygtk
+    python scons swig
+  ];
+ 
+  propagatedBuildInputs = [ pythonPackages.numpy ];
+
+  buildPhase = "scons prefix=$out";
+
+  installPhase = ''
+    scons prefix=$out install
+    wrapProgram $out/bin/mypaint --prefix PYTHONPATH : $PYTHONPATH
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A graphics application for digital painters";
+    homepage = http://mypaint.intilinux.com;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/graphics/openimageio/default.nix b/pkgs/applications/graphics/openimageio/default.nix
new file mode 100644
index 00000000000..fa7d16ccf0a
--- /dev/null
+++ b/pkgs/applications/graphics/openimageio/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, boost, cmake, ilmbase, libjpeg, libpng, libtiff
+, opencolorio, openexr, unzip
+}:
+
+stdenv.mkDerivation rec {
+  name = "oiio-${version}";
+  version = "1.1.8";
+
+  src = fetchurl {
+    url = "https://github.com/OpenImageIO/oiio/archive/Release-${version}.zip";
+    sha256 = "08a6qhplzs8kianqb1gjgrndg81h3il5531jn9g6i4940b1xispg";
+  };
+
+  buildInputs = [ 
+    boost cmake ilmbase libjpeg libpng libtiff opencolorio openexr unzip
+  ];
+
+  configurePhase = "";
+
+  buildPhase = ''
+    make ILMBASE_HOME=${ilmbase} OPENEXR_HOME=${openexr} USE_PYTHON=0 \
+      INSTALLDIR=$out dist_dir=
+  '';
+
+  installPhase = ":";
+
+  meta = with stdenv.lib; {
+    homepage = http://www.openimageio.org;
+    description = "A library and tools for reading and writing images";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/graphics/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index b09a38dcaa4..cf4e7e635d0 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -3,28 +3,41 @@
   }:
 
 stdenv.mkDerivation rec {
-  version = "2011.12";
+  version = "2013.01";
   name = "openscad-${version}";
+
   src = fetchurl {
-    url = "https://github.com/downloads/openscad/openscad/${name}.src.tar.gz";
-    sha256 = "0gaqwzxbbzc21lhb4y26j8g0g28dhrwrgkndizp5ddab5axi4zjh";
+    url = "https://openscad.googlecode.com/files/${name}.src.tar.gz";
+    sha256 = "01r013l8zyfkgmqn05axh3rlfsjwd6j403w5ffl7nby4i2spiw1f";
   };
 
   buildInputs = [qt4 bison flex eigen boost mesa glew opencsg cgal gmp mpfr];
 
   configurePhase = ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I ${eigen}/include/eigen2 "
-    qmake PREFIX="$out"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${eigen}/include/eigen*) "
+    qmake PREFIX="$out" VERSION=${version}
   '';
 
   doCheck = false;
 
   meta = {
     description = "3D parametric model compiler";
+    longDescription = ''
+      OpenSCAD is a software for creating solid 3D CAD objects. It is free
+      software and available for Linux/UNIX, MS Windows and Mac OS X.
+
+      Unlike most free software for creating 3D models (such as the famous
+      application Blender) it does not focus on the artistic aspects of 3D
+      modelling but instead on the CAD aspects. Thus it might be the
+      application you are looking for when you are planning to create 3D models of
+      machine parts but pretty sure is not what you are looking for when you are more
+      interested in creating computer-animated movies.
+    '';
     homepage = "http://openscad.org/";
+    license = stdenv.lib.licenses.gpl2;
     platforms = with stdenv.lib.platforms;
       linux;
     maintainers = with stdenv.lib.maintainers; 
-      [raskin];
+      [raskin bjornfor];
   };
 }
diff --git a/pkgs/applications/graphics/panotools/default.nix b/pkgs/applications/graphics/panotools/default.nix
index e71537f108a..17e1b2e8b14 100644
--- a/pkgs/applications/graphics/panotools/default.nix
+++ b/pkgs/applications/graphics/panotools/default.nix
@@ -10,7 +10,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ perl libjpeg libpng libtiff ];
 
-  doCheck = true;
+  # one of the tests succeeds on my machine but fails on Hydra (no idea why)
+  #doCheck = true;
 
   meta = {
     homepage = http://panotools.sourceforge.net/;
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 2491b93bbc2..b647c07368e 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -7,19 +7,18 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "paraview-3.14.0";
+  name = "paraview-3.98.1";
   src = fetchurl {
-    url = "http://www.paraview.org/files/v3.14/ParaView-3.14.0-Source.tar.gz";
-    sha256 = "168v8zk64pxcd392kb4zqnkbw540d52bx6fs35aqz88i5jc0x9xv";
+    url = "http://paraview.org/files/v3.98/ParaView-3.98.1-source.tar.gz";
+    sha256 = "0i7q3jc4lc40l1zw3fdzv108rpxxfmg3dmmq855fpqyp2g2w9nxp";
   };
 
   # [  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.10 -rpath ../../../bin -rpath ../../bin"
+    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/paraview-3.98 -rpath ../../../../../../lib -rpath ../../../../../lib -rpath ../../../../lib -rpath ../../../lib -rpath ../../lib -rpath ../lib"
   '';
   cmakeFlags = [
-#    "-DPARAVIEW_USE_MPI:BOOL=ON"
     "-DPARAVIEW_USE_SYSTEM_HDF5:BOOL=ON"
     "-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
     "-DPARAVIEW_ENABLE_PYTHON:BOOL=ON"
@@ -28,8 +27,6 @@ stdenv.mkDerivation rec {
     "-DCMAKE_SKIP_BUILD_RPATH=ON"
     "-DVTK_USE_RPATH:BOOL=ON"
     "-DPARAVIEW_INSTALL_DEVELOPMENT=ON"
-#    "-DPYTHON_INCLUDE_DIR=${python}/include"
-#    "-DPYTHON_LIBRARY="
   ];
 
   enableParallelBuilding = true;
@@ -40,7 +37,7 @@ stdenv.mkDerivation rec {
     homepage = "http://www.paraview.org/";
     description = "3D Data analysis and visualization application";
     license = "free";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [viric guibert];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index 349982bc24c..b845abacf7e 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -1,11 +1,12 @@
 {stdenv, fetchurl, mono, gtksharp, pkgconfig}:
 
 stdenv.mkDerivation {
-  name = "pinta-0.5";
+  name = "pinta-1.4";
 
   src = fetchurl {
-    url =  http://github.com/downloads/jpobst/Pinta/pinta-0.5.tar.gz; 
-    sha256 = "0qv95zswi488bkbck9b9yhmczj1sgqc96nzn4f5rwfqz516kilrl";
+    url = "https://github.com/PintaProject/pinta/tarball/3f7ccfa93d";
+    name = "pinta-1.4.tar.gz";
+    sha256 = "1kgb4gy5l6bd0akniwhiqqkvqayr5jgdsvn2pgg1038q9raafnpn";
   };
 
   buildInputs = [mono gtksharp pkgconfig];
diff --git a/pkgs/applications/graphics/pqiv/default.nix b/pkgs/applications/graphics/pqiv/default.nix
index e13ea97cab8..3fd9d47374a 100644
--- a/pkgs/applications/graphics/pqiv/default.nix
+++ b/pkgs/applications/graphics/pqiv/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, getopt, which, pkgconfig, gtk } :
 
 stdenv.mkDerivation (rec {
-  name = "pqiv-0.8";
+  name = "pqiv-0.12";
 
   src = fetchurl {
-    url = "http://www.pberndt.com/raw/Programme/Linux/pqiv/_download/${name}.tbz";
-    sha256 = "365332bab4b13ca56da6935e7155af20658e67d323808942dce23e880466f66d";
+    url = "https://github.com/downloads/phillipberndt/pqiv/${name}.tbz";
+    sha256 = "646c69f2f4e7289913f6b8e8ae984befba9debf0d2b4cc8af9955504a1fccf1e";
   };
 
   buildInputs = [ getopt which pkgconfig gtk ];
diff --git a/pkgs/applications/graphics/qiv/default.nix b/pkgs/applications/graphics/qiv/default.nix
new file mode 100644
index 00000000000..df18c6d1520
--- /dev/null
+++ b/pkgs/applications/graphics/qiv/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, gtk, imlib2, file } :
+
+stdenv.mkDerivation (rec {
+  name = "qiv-2.2.4";
+
+  src = fetchurl {
+    url = "http://spiegl.de/qiv/download/${name}.tgz";
+    sha256 = "ed6078dc550c1dc2fe35c1e0f46463c13589a24b83d4f7101b71a7485e51abb7";
+  };
+
+  buildInputs = [ pkgconfig gtk imlib2 file ];
+
+  preBuild=''
+    substituteInPlace Makefile --replace /usr/local "$out"
+    substituteInPlace Makefile --replace /man/ /share/man/
+  '';
+
+  meta = {
+    description = "qiv (quick image viewer)";
+    homepage = http://spiegl.de/qiv/;
+  };
+})
diff --git a/pkgs/applications/graphics/rapcad/default.nix b/pkgs/applications/graphics/rapcad/default.nix
new file mode 100644
index 00000000000..e83824bd685
--- /dev/null
+++ b/pkgs/applications/graphics/rapcad/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchgit, qt4, cgal, boost, gmp, mpfr, flex, bison, dxflib}: 
+
+stdenv.mkDerivation rec {
+  version = "0.8.0";
+  name = "rapcad-${version}";
+
+  src = fetchgit {
+    url = "git://git.rapcad.org/rapcad";
+    rev = "refs/tags/v${version}";
+    sha256 = "37c7107dc4fcf8942a4ad35377c4e42e6aedfa35296e5fcf8d84882ae35087c7";
+  };
+  
+  buildInputs = [qt4 cgal boost gmp mpfr flex bison dxflib];
+
+  configurePhase = ''
+    qmake;
+    sed -e "s@/usr/@$out/@g" -i $(find . -name Makefile)
+  '';
+
+  meta = {
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    platforms = stdenv.lib.platforms.linux;
+    description = ''Constructive solid geometry package'';
+  };
+}
diff --git a/pkgs/applications/graphics/rawtherapee/default.nix b/pkgs/applications/graphics/rawtherapee/default.nix
index 328181790ac..bf7e2d30420 100644
--- a/pkgs/applications/graphics/rawtherapee/default.nix
+++ b/pkgs/applications/graphics/rawtherapee/default.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, pkgconfig, gtk, cmake, pixman, libpthreadstubs, gtkmm, libXau
-, libXdmcp, lcms2, libiptcdata
+, libXdmcp, lcms2, libiptcdata, libcanberra, fftw
 , mercurial  # Not really needed for anything, but it fails if it does not find 'hg'
 }:
 
 stdenv.mkDerivation rec {
-  name = "rawtherapee-4.0.9";
+  name = "rawtherapee-4.0.10";
   
   src = fetchurl {
-    url = http://rawtherapee.googlecode.com/files/rawtherapee-4.0.9.tar.xz;
-    sha256 = "1ll7n7gzxs00jpw3gp9xfr90lbwqafkgqpps3j5ig6mf79frpm2a";
+    url = http://rawtherapee.googlecode.com/files/rawtherapee-4.0.10.tar.xz;
+    sha256 = "1ibsdm2kqpw796rcdihnnp67vx0wm1d1bnlzq269r9p01w5s102g";
   };
   
   buildInputs = [ pkgconfig gtk cmake pixman libpthreadstubs gtkmm libXau libXdmcp
-    lcms2 libiptcdata mercurial ];
+    lcms2 libiptcdata mercurial libcanberra fftw ];
 
   # Disable the use of the RAWZOR propietary libraries
   cmakeFlags = [ "-DWITH_RAWZOR=OFF" ];
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "RAW converter and digital photo processing software";
     homepage = http://www.rawtherapee.com/;
-    license = "GPLv3+";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = with stdenv.lib.maintainers; [viric jcumming];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/rawtherapee/optional-rawzor.patch b/pkgs/applications/graphics/rawtherapee/optional-rawzor.patch
deleted file mode 100644
index bc0210803a1..00000000000
--- a/pkgs/applications/graphics/rawtherapee/optional-rawzor.patch
+++ /dev/null
@@ -1,83 +0,0 @@
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -1,5 +1,7 @@
- cmake_minimum_required(VERSION 2.6)
- 
-+option (WITH_RAWZOR "Build with Rawzor support" ON)
-+
- add_subdirectory (rtexif)
- add_subdirectory (rtengine)
- add_subdirectory (rtgui)
---- a/rtengine/CMakeLists.txt
-+++ b/rtengine/CMakeLists.txt
-@@ -9,9 +9,13 @@
- IF (WIN32)
-     SET (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/../lib; ${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_win")
-     SET (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../winclude; ${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_win")
--    SET (EXTRA_LIB "ws2_32 ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libiptcdata.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libjpeg.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libpng.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libtiff.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libz.a ${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_win/rwz_sdk_s.a")
-+    SET (EXTRA_LIB "ws2_32 ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libiptcdata.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libjpeg.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libpng.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libtiff.a ${CMAKE_CURRENT_SOURCE_DIR}/../lib/libz.a")
-+    if (WITH_RAWZOR)
-     ADD_DEFINITIONS (-DRAWZOR_SUPPORT)
-+    SET (EXTRA_LIB "${EXTRA_LIB} ${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_win/rwz_sdk_s.a")
-+    endif (WITH_RAWZOR)
- ELSE (WIN32)
-+    if (WITH_RAWZOR)
-     IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
-         SET (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin32")
- 	SET (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin32")
-@@ -19,10 +23,11 @@
-         SET (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin64")
- 	SET (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin64")
-     ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
--    pkg_check_modules (IPTCDATA REQUIRED libiptcdata)
--    pkg_check_modules (LCMS REQUIRED lcms)
-     SET (EXTRA_LIB "-lrwz_sdk")
-     ADD_DEFINITIONS (-DRAWZOR_SUPPORT)
-+    endif (WITH_RAWZOR)
-+    pkg_check_modules (IPTCDATA REQUIRED libiptcdata)
-+    pkg_check_modules (LCMS REQUIRED lcms)
- ENDIF (WIN32)
- 
- include_directories (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/../rtexif ${EXTRA_INCDIR} ${GTHREAD_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS} ${IPTCDATA_INCLUDE_DIRS} ${LCMS_INCLUDE_DIRS})
---- a/rtengine/imagedata.cc
-+++ b/rtengine/imagedata.cc
-@@ -19,7 +19,9 @@
- #include <imagedata.h>
- #include <iptcpairs.h>
- #include <glib/gstdio.h>
-+#ifdef RAWZOR_SUPPORT
- #include <rwz_sdk.h>
-+#endif
- 
- using namespace rtengine;
- 
---- a/rtengine/myfile.cc
-+++ b/rtengine/myfile.cc
-@@ -19,7 +19,9 @@
- #include <myfile.h>

- #include <cstdarg>
- #include <glibmm.h>
-+#ifdef RAWZOR_SUPPORT
- #include <rwz_sdk.h>

-+#endif
- 
- IMFILE* fopen (const char* fname) {

- 
---- a/rtgui/CMakeLists.txt
-+++ b/rtgui/CMakeLists.txt
-@@ -75,6 +75,7 @@
-     if (NOT ZLIB_LIBRARIES)
-         message(SEND_ERROR "libz was not found!")
-     endif (NOT ZLIB_LIBRARIES)
-+    if (WITH_RAWZOR)
-     IF (CMAKE_SIZEOF_VOID_P EQUAL 4)
-         SET (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin32")
- 	    SET (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin32")
-@@ -82,6 +83,7 @@
-         SET (EXTRA_INCDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin64")
- 	    SET (EXTRA_LIBDIR "${CMAKE_CURRENT_SOURCE_DIR}/../rawzor_lin64")
-     ENDIF (CMAKE_SIZEOF_VOID_P EQUAL 4)
-+    endif (WITH_RAWZOR)
- 
- include_directories (/usr/local/lib ${CMAKE_CURRENT_SOURCE_DIR}/../rtengine . ${CMAKE_CURRENT_SOURCE_DIR}/../rtexif ${EXTRA_INCDIR} ${GLIB2_INCLUDE_DIRS} ${GLIBMM_INCLUDE_DIRS}
-     ${GTK_INCLUDE_DIRS} ${GTKMM_INCLUDE_DIRS} ${GIO_INCLUDE_DIRS} ${GIOMM_INCLUDE_DIRS} ${IPTCDATA_INCLUDE_DIRS} ${LCMS_INCLUDE_DIRS} ${GTHREAD_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS} )
diff --git a/pkgs/applications/graphics/sane/backends-git.nix b/pkgs/applications/graphics/sane/backends-git.nix
new file mode 100644
index 00000000000..2455923bbb8
--- /dev/null
+++ b/pkgs/applications/graphics/sane/backends-git.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, fetchgit, hotplugSupport ? true, libusb ? null, gt68xxFirmware ? null }:
+let
+  firmware = gt68xxFirmware { inherit fetchurl; };
+in
+assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
+
+stdenv.mkDerivation {
+  name = "sane-backends-1.0.22.482-g071f226";
+
+  src = fetchgit {
+    url = "http://git.debian.org/git/sane/sane-backends.git";
+    rev = "071f2269cd68d3411cbfa05a3d028b74496db970";
+    sha256 = "178xkv30m6irk4k0gqnfcl5kramm1qyj24dar8gp32428z1444xf";
+  };
+
+  udevSupport = hotplugSupport;
+
+  buildInputs = if libusb != null then [libusb] else [];
+
+  postInstall = ''
+    if test "$udevSupport" = "1"; then
+      mkdir -p $out/etc/udev/rules.d/
+      ./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
+      cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
+    fi
+  '';
+
+  preInstall =
+    if gt68xxFirmware != null then
+      "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
+      " \${out}/share/sane/gt68xx/" + firmware.name
+    else "";
+
+  meta = {
+    homepage = "http://www.sane-project.org/";
+    description = "Scanner Access Now Easy";
+    license = "GPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/sane/backends.nix b/pkgs/applications/graphics/sane/backends.nix
new file mode 100644
index 00000000000..0fcfca74741
--- /dev/null
+++ b/pkgs/applications/graphics/sane/backends.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null, libv4l ? null, pkgconfig ? null , gt68xxFirmware ? null }:
+
+assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
+
+let
+  firmware = gt68xxFirmware { inherit fetchurl; };
+in
+stdenv.mkDerivation rec {
+  version = "1.0.23";
+  name = "sane-backends-${version}";
+
+  src = fetchurl {
+    url = "https://launchpad.net/ubuntu/+archive/primary/+files/sane-backends_${version}.orig.tar.gz";
+    sha256 = "4d4f5b2881615af7fc0ed75fdde7dc623a749e80e40f3f792fe4010163cbb029";
+  };
+
+  udevSupport = hotplugSupport;
+
+  buildInputs = []
+    ++ stdenv.lib.optional (libusb != null) libusb
+    ++ stdenv.lib.optional (libv4l != null) libv4l
+    ++ stdenv.lib.optional (pkgconfig != null) pkgconfig
+    ;
+
+  postInstall = ''
+    if test "$udevSupport" = "1"; then
+      mkdir -p $out/etc/udev/rules.d/
+      ./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
+      cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
+    fi
+  '';
+
+  preInstall =
+    if gt68xxFirmware != null then
+      "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
+      " \${out}/share/sane/gt68xx/" + firmware.name
+    else "";
+
+  meta = {
+    homepage = "http://www.sane-project.org/";
+    description = "Scanner Access Now Easy";
+    license = "GPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/sane/frontends.nix b/pkgs/applications/graphics/sane/frontends.nix
new file mode 100644
index 00000000000..9e73a08e096
--- /dev/null
+++ b/pkgs/applications/graphics/sane/frontends.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, saneBackends, libX11, gtk, pkgconfig, libusb ? null}:
+
+stdenv.mkDerivation rec {
+  name = "sane-frontends-1.0.14";
+
+  src = fetchurl {
+    url = "ftp://ftp.sane-project.org/pub/sane/sane-frontends-1.0.14/${name}.tar.gz";
+    md5 = "c63bf7b0bb5f530cf3c08715db721cd3";
+  };
+
+  preConfigure = ''
+    sed -e '/SANE_CAP_ALWAYS_SETTABLE/d' -i src/gtkglue.c
+  '';
+
+  buildInputs = [saneBackends libX11 gtk pkgconfig] ++
+	(if libusb != null then [libusb] else []);
+
+  meta = {
+    homepage = "http://www.sane-project.org/";
+    description = "Scanner Access Now Easy";
+    license = "GPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/misc/xsane/default.nix b/pkgs/applications/graphics/sane/xsane.nix
index 8dd99c3c74d..de8d4c33652 100644
--- a/pkgs/misc/xsane/default.nix
+++ b/pkgs/applications/graphics/sane/xsane.nix
@@ -1,10 +1,10 @@
-{stdenv, fetchurl, saneBackends, saneFrontends,
-	libX11, gtk, pkgconfig, libpng, libusb ? null}:
-stdenv.mkDerivation {
+{ stdenv, fetchurl, saneBackends, saneFrontends, libX11, gtk, pkgconfig, libpng, libusb ? null }:
+
+stdenv.mkDerivation rec {
   name = "xsane-0.998";
 
   src = fetchurl {
-    url = http://www.xsane.org/download/xsane-0.998.tar.gz;
+    url = "http://www.xsane.org/download/${name}.tar.gz";
     sha256 = "0vn2cj85ijgp2v2j2h9xpqmg2jwlbxmwyb88kxhjjakqay02ybm3";
   };
 
@@ -13,13 +13,13 @@ stdenv.mkDerivation {
   '';
 
   buildInputs = [libpng saneBackends saneFrontends libX11 gtk pkgconfig ] ++
-	(if (libusb != null) then [libusb] else []);
+	(if libusb != null then [libusb] else []);
 
   meta = {
     homepage = http://www.sane-project.org/;
     description = "Graphical scanning frontend for sane";
     license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [viric simons];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/sxiv/default.nix b/pkgs/applications/graphics/sxiv/default.nix
new file mode 100644
index 00000000000..26d910943ef
--- /dev/null
+++ b/pkgs/applications/graphics/sxiv/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libX11, imlib2, giflib }:
+
+stdenv.mkDerivation {
+  name = "sxiv-1.1";
+
+  src = fetchurl {
+    url = "https://github.com/muennich/sxiv/archive/v1.1.tar.gz";
+    name = "sxiv-1.1.tar.gz";
+    sha256 = "0gsqwa1yacsig7ycjrw0sjyrsa9mynfzzbwm1vp2bgk4s9hb08kx";
+  };
+
+  buildInputs = [ libX11 imlib2 giflib ];
+
+  prePatch = ''sed -i "s@/usr/local@$out@" Makefile'';
+
+  meta = {
+    description = "Simple X Image Viewer";
+    homepage = "https://github.com/muennich/sxiv";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/graphics/viewnior/default.nix b/pkgs/applications/graphics/viewnior/default.nix
new file mode 100644
index 00000000000..99e1ec1c169
--- /dev/null
+++ b/pkgs/applications/graphics/viewnior/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, gtk2, libpng, exiv2, lcms
+, intltool, gettext, shared_mime_info, glib, gdk_pixbuf, perl}:
+
+stdenv.mkDerivation rec {
+  name = "viewnior-1.3";
+
+  src = fetchurl {
+    url = "http://cloud.github.com/downloads/xsisqox/Viewnior/${name}.tar.gz";
+    sha256 = "46c97c1a85361519b42fe008cfb8911e66f709f3a3a988c11047ab3726889f10";
+  };
+
+  buildInputs =
+    [ pkgconfig gtk2 libpng exiv2 lcms intltool gettext
+      shared_mime_info glib gdk_pixbuf perl
+    ];
+
+  meta = {
+    description = "Viewnior is a fast and simple image viewer for GNU/Linux";
+    longDescription =
+      '' Viewnior is insipred by big projects like Eye of Gnome, because of it's
+         usability and richness,and by GPicView, because of it's lightweight design and
+         minimal interface. So here comes Viewnior - small and light, with no compromise
+         with the quality of it's functions. The program is made with better integration
+         in mind (follows Gnome HIG2).
+      '';
+
+    license = "GPLv3";
+
+    homepage = http://xsisqox.github.com/Viewnior;
+
+    maintainers = [ stdenv.lib.maintainers.smironov ];
+
+    platforms = stdenv.lib.platforms.gnu;
+  };
+}
diff --git a/pkgs/applications/graphics/xara/default.nix b/pkgs/applications/graphics/xara/default.nix
index 8a6bac4db2b..cd3a09887d0 100644
--- a/pkgs/applications/graphics/xara/default.nix
+++ b/pkgs/applications/graphics/xara/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "05xbzq1i1vw2mdsv7zjqfpxfv3g1j0g5kks0gq6sh373xd6y8lyh";
   };
     
-  buildNativeInputs = [ automake pkgconfig gettext perl zip ];
+  nativeBuildInputs = [ automake pkgconfig gettext perl zip ];
   buildInputs = [ wxGTK gtk libxml2 freetype pango ];
 
   configureFlags = "--disable-svnversion";
diff --git a/pkgs/applications/graphics/xfig/default.nix b/pkgs/applications/graphics/xfig/default.nix
index e4ab5798918..88183c5e5a3 100644
--- a/pkgs/applications/graphics/xfig/default.nix
+++ b/pkgs/applications/graphics/xfig/default.nix
@@ -14,26 +14,26 @@ stdenv.mkDerivation {
 
   buildInputs = [x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
 
-  buildNativeInputs = [ imake makeWrapper ];
+  nativeBuildInputs = [ imake makeWrapper ];
 
   NIX_CFLAGS_COMPILE = "-I${libXpm}/include/X11";
 
   patches =
     let
-      debPrefix = "http://patch-tracker.debian.org/patch/series/dl/xfig/1:3.2.5.b-2";
+      debPrefix = "http://patch-tracker.debian.org/patch/series/dl/xfig/1:3.2.5.b-3";
     in
     [
       (fetchurl {
-        url = "${debPrefix}/35_CVE-2010-4262.dpatch";
-        sha256 = "18741b3dbipgr55fyp5x0296za3336ylln639jw8yjcyd1call22";
+        url = "${debPrefix}/35_CVE-2010-4262.patch";
+        sha256 = "1pj669sz49wzjvvm96gwbnani7wqi0ijh21imqdzqw47qxdv7zp5";
       })
       (fetchurl {
-        url = "${debPrefix}/13_remove_extra_libs.dpatch";
-        sha256 = "0v3k30ib7xq5wfhd3yacnal4gbih7nqw0z0aycvc0hafffl97i46";
+        url = "${debPrefix}/13_remove_extra_libs.patch";
+        sha256 = "1qb14ay0c8xrjzhi21jl7sl8mdzxardldzpnflkzml774bbpn8av";
       })
       (fetchurl {
-        url = "${debPrefix}/36_libpng15.dpatch";
-        sha256 = "0ssmvlcpjn3iqj3l38db8j8qpqbzixlwpczq01m49r5w9l3viy8k";
+        url = "${debPrefix}/36_libpng15.patch";
+        sha256 = "0jd5bqj7sj9bbnxg2d0y6zmv4ka4qif2x4zc84ngdqga5433anvn";
       })
     ];
 
diff --git a/pkgs/applications/graphics/xournal/default.nix b/pkgs/applications/graphics/xournal/default.nix
index 990709c03e5..1f1c26c1152 100644
--- a/pkgs/applications/graphics/xournal/default.nix
+++ b/pkgs/applications/graphics/xournal/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     pango libX11 xproto zlib poppler poppler_data
   ];
 
-  buildNativeInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
 
   # Build with poppler-0.18.x
   patchFlags = "-p0";
diff --git a/pkgs/applications/misc/adobe-reader/builder.sh b/pkgs/applications/misc/adobe-reader/builder.sh
index 174dd70ab04..6024734dc44 100644
--- a/pkgs/applications/misc/adobe-reader/builder.sh
+++ b/pkgs/applications/misc/adobe-reader/builder.sh
@@ -3,35 +3,40 @@ source $stdenv/setup
 echo "unpacking $src..."
 tar xvfa $src
 
-mkdir -p $out/Adobe/Reader9
-
 echo "unpacking reader..."
-set +e
+p=$out/libexec/adobe-reader
+mkdir -p $out/libexec
 tar xvf AdobeReader/COMMON.TAR -C $out
 tar xvf AdobeReader/ILINXR.TAR -C $out
-set -e
+mv $out/Adobe/Reader9 $p
+rmdir $out/Adobe
 
 # Disable this plugin for now (it needs LDAP, and I'm too lazy to add it).
-rm $out/Adobe/Reader*/Reader/intellinux/plug_ins/PPKLite.api
+rm $p/Reader/intellinux/plug_ins/PPKLite.api
+
+# More pointless files.
+rm $p/bin/UNINSTALL
 
 patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
     --set-rpath $libPath \
-    $out/Adobe/Reader*/Reader/intellinux/bin/acroread
+    $p/Reader/intellinux/bin/acroread
 
 # The "xargs -r" is to shut up a warning when Mozilla can't be found.
-substituteInPlace $out/Adobe/Reader*/bin/acroread \
+substituteInPlace $p/bin/acroread \
     --replace /bin/pwd $(type -P pwd) \
     --replace /bin/ls $(type -P ls) \
     --replace xargs "xargs -r"
 
 mkdir -p $out/bin
-ln -s $out/Adobe/Reader*/bin/acroread $out/bin/acroread
+ln -s $p/bin/acroread $out/bin/acroread
 
 mkdir -p $out/share/applications
-mv $out/Adobe/Reader9/Resource/Support/AdobeReader.desktop $out/share/applications/
+mv $p/Resource/Support/AdobeReader.desktop $out/share/applications/
+icon=$p/Resource/Icons/128x128/AdobeReader9.png
+[ -e $icon ]
 sed -i $out/share/applications/AdobeReader.desktop \
-    -e "s|Icon=.*|Icon=$out/Adobe/Reader9/Resource/Icons/128x128/AdobeReader9.png|"
+    -e "s|Icon=.*|Icon=$icon|"
 
 # Not sure if this works.
 mkdir -p $out/share/mimelnk/application
-mv $out/Adobe/Reader9/Resource/Support/vnd*.desktop $out/share/mimelnk/application
+mv $p/Resource/Support/vnd*.desktop $out/share/mimelnk/application
diff --git a/pkgs/applications/misc/adobe-reader/default.nix b/pkgs/applications/misc/adobe-reader/default.nix
index 6eaf976faa4..46ccdb39946 100644
--- a/pkgs/applications/misc/adobe-reader/default.nix
+++ b/pkgs/applications/misc/adobe-reader/default.nix
@@ -3,23 +3,25 @@
 
 assert stdenv.system == "i686-linux";
 
+let version = "9.5.1"; in
+
 stdenv.mkDerivation {
-  name = "adobe-reader-9.4.7-1";
-  
+  name = "adobe-reader-${version}-1";
+
   builder = ./builder.sh;
-  
+
   src = fetchurl {
-    url = http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.7/enu/AdbeRdr9.4.7-1_i486linux_enu.tar.bz2;
-    sha256 = "0bzx1rcwc9bi5jkh8f8hjb354zxlvvx37lhm0l2r0mjxj8fimfb5";
+    url = "http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${version}/enu/AdbeRdr${version}-1_i486linux_enu.tar.bz2";
+    sha256 = "19mwhbfsivb21zmrz2hllf0kh4i225ac697y026bakyysn0vig56";
   };
 
   # !!! Adobe Reader contains copies of OpenSSL, libcurl, and libicu.
   # We should probably remove those and use the regular Nixpkgs
   # versions.
-  
+
   libPath = stdenv.lib.makeLibraryPath
     [ stdenv.gcc.gcc libX11 zlib libxml2 cups pango atk gtk glib gdk_pixbuf ];
-  
+
   meta = {
     description = "Adobe Reader, a viewer for PDF documents";
     homepage = http://www.adobe.com/products/reader;
diff --git a/pkgs/applications/misc/arbtt/default.nix b/pkgs/applications/misc/arbtt/default.nix
new file mode 100644
index 00000000000..92b8cb4f295
--- /dev/null
+++ b/pkgs/applications/misc/arbtt/default.nix
@@ -0,0 +1,23 @@
+{ cabal, binary, bytestringProgress, deepseq, filepath
+, libXScrnSaver, parsec, pcreLight, strict, terminalProgressBar
+, time, transformers, utf8String, X11
+}:
+
+cabal.mkDerivation (self: {
+  pname = "arbtt";
+  version = "0.7";
+  sha256 = "05q31fsyrbkcx0mlf2r91zgmpma5sl2a7100h7qsa882sijc2ybn";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    binary bytestringProgress deepseq filepath parsec pcreLight strict
+    terminalProgressBar time transformers utf8String X11
+  ];
+  extraLibraries = [ libXScrnSaver ];
+  meta = {
+    homepage = "http://www.joachim-breitner.de/projects#arbtt";
+    description = "Automatic Rule-Based Time Tracker";
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/misc/audio/soxr/default.nix b/pkgs/applications/misc/audio/soxr/default.nix
new file mode 100644
index 00000000000..a8dd26ab609
--- /dev/null
+++ b/pkgs/applications/misc/audio/soxr/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "soxr-0.1.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/soxr/${name}-Source.tar.xz";
+    sha256 = "1hmadwqfpg15vhwq9pa1sl5xslibrjpk6hpq2s9hfmx1s5l6ihfw";
+  };
+
+  preConfigure = ''export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/build/src'';
+
+  buildInputs = [ cmake ];
+
+  meta = {
+    description = "An audio resampling library";
+    homepage = http://soxr.sourceforge.net;
+    license = "LGPLv2.1+";
+  };
+}
diff --git a/pkgs/applications/misc/bitcoin/default.nix b/pkgs/applications/misc/bitcoin/default.nix
index 63f4f77942a..a4048e6f40b 100644
--- a/pkgs/applications/misc/bitcoin/default.nix
+++ b/pkgs/applications/misc/bitcoin/default.nix
@@ -1,12 +1,12 @@
 { fetchurl, stdenv, openssl, db4, boost, zlib, miniupnpc, qt4 }:
 
 stdenv.mkDerivation rec {
-  version = "0.6.3";
+  version = "0.8.1";
   name = "bitcoin-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/bitcoin/${name}-linux.tar.gz";
-    sha256 = "722d4209ff4a951a9eb5cae26a33ad62770fdcb5dfb5acf0b5c6a8f6f3a8a0ef";
+    sha256 = "161arfkzpya5anh6vh5i9ydvwqpia7bpqgz83p2kd97iklx04zvd";
   };
 
   buildInputs = [ openssl db4 boost zlib miniupnpc qt4 ];
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index e8307a79cf7..0951340ee94 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -1,26 +1,39 @@
-{ stdenv, fetchurl, SDL, cmake, gettext, ilmbase, libXi, libjpeg,
-libpng, libsamplerate, libtiff, mesa, openal, openexr, openjpeg,
-python, zlib, boost }:
+{ stdenv, fetchurl, SDL, boost, cmake, ffmpeg, gettext, glew
+, ilmbase, jackaudio, libXi, libjpeg, libpng, libsamplerate, libsndfile
+, libtiff, mesa, openal, opencolorio, openexr, openimageio, openjpeg, python
+, zlib
+}:
 
 stdenv.mkDerivation rec {
-  name = "blender-2.63a";
+  name = "blender-2.67";
 
   src = fetchurl {
     url = "http://download.blender.org/source/${name}.tar.gz";
-    sha256 = "c479b1abfe5fd8a1a5d04b8d21fdbc0fc960d7855b24785b888c09792bca4c1a";
+    sha256 = "066lwrm85455gs187bxr3jhqidc2f6f0791b4216jkagbszd9a8l";
   };
 
-  buildInputs = [ cmake mesa gettext python libjpeg libpng zlib openal
-    SDL openexr libsamplerate libXi libtiff ilmbase openjpeg boost ];
+  buildInputs = [
+    SDL boost cmake ffmpeg gettext glew ilmbase jackaudio libXi
+    libjpeg libpng libsamplerate libsndfile libtiff mesa openal
+    opencolorio openexr openimageio openjpeg python zlib
+  ];
+
 
   cmakeFlags = [
     "-DOPENEXR_INC=${openexr}/include/OpenEXR"
     "-DWITH_OPENCOLLADA=OFF"
+    "-DWITH_CODEC_FFMPEG=ON"
+    "-DWITH_CODEC_SNDFILE=ON"
+    "-DWITH_JACK=ON"
     "-DWITH_INSTALL_PORTABLE=OFF"
+    "-DPYTHON_LIBRARY=python${python.majorVersion}m"    
     "-DPYTHON_LIBPATH=${python}/lib"
+    "-DPYTHON_INCLUDE_DIR=${python}/include/python${python.majorVersion}m"
   ];
 
-  NIX_CFLAGS_COMPILE = "-iquote ${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}";
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}m";
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "3D Creation/Animation/Publishing System";
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index d902fe3ffa1..562a9dd52ad 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -16,13 +16,13 @@ stdenv.mkDerivation rec {
 
   inherit python;
 
-  buildNativeInputs = [ makeWrapper pkgconfig ];
+  nativeBuildInputs = [ makeWrapper pkgconfig ];
 
   buildInputs =
     [ python pyqt4 sip popplerQt4 libpng imagemagick libjpeg
       fontconfig podofo qt4 pil chmlib icu
       pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
-      pythonPackages.cssutils pythonPackages.beautifulsoap
+      pythonPackages.cssutils pythonPackages.beautifulsoup
       pythonPackages.sqlite3 sqlite
     ];
 
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index eae0b0ff233..048514ad4aa 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchurl, libX11, libXinerama}:
+{stdenv, fetchurl, libX11, libXinerama, enableXft, libXft, zlib}:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "dmenu-4.5";
@@ -8,7 +10,14 @@ stdenv.mkDerivation rec {
     sha256 = "0l58jpxrr80fmyw5pgw5alm5qry49aw6y049745wl991v2cdcb08";
   };
 
-  buildInputs = [ libX11 libXinerama ];
+  xftPatch = fetchurl {
+    url = "http://tools.suckless.org/dmenu/patches/${name}-xft.diff";
+    sha256 = "efb4095d65e5e86f9dde97294732174409c24f319bdd4824cc22fa1404972b4f";
+  };
+
+  buildInputs = [ libX11 libXinerama ] ++ optionals enableXft [zlib libXft];
+
+  patches = optional enableXft xftPatch;
 
   preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
 
diff --git a/pkgs/applications/misc/dunst/default.nix b/pkgs/applications/misc/dunst/default.nix
new file mode 100644
index 00000000000..1eb0949aeb4
--- /dev/null
+++ b/pkgs/applications/misc/dunst/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, coreutils , unzip, which, pkgconfig , dbus
+, freetype, xdg_utils , libXext, glib, pango , cairo, libX11, libnotify
+, libxdg_basedir , libXScrnSaver, xproto, libXinerama , perl, gdk_pixbuf
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.0.0";
+  name = "dunst-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/knopwob/dunst/archive/v${version}.zip";
+    sha256 = "1x6k6jrf219v8hmhqhnnfjycldvsnp7ag8a2y8adp5rhfmgyn671";
+  };
+
+  patchPhase = ''
+    substituteInPlace "settings.c" \
+      --replace "xdgConfigOpen(\"dunst/dunstrc\", \"r\", &xdg" "fopen(\"$out/share/dunst/dunstrc\", \"r\""
+  '';
+
+  buildInputs =
+  [ coreutils unzip which pkgconfig dbus freetype libnotify gdk_pixbuf
+    xdg_utils libXext glib pango cairo libX11 libxdg_basedir
+    libXScrnSaver xproto libXinerama perl];
+
+  buildPhase = ''
+    export VERSION=${version};
+    export PREFIX=$out;
+    make dunst;
+  '';
+
+  meta = {
+    description = "lightweight and customizable notification daemon";
+    homepage = http://www.knopwob.org/dunst/;
+    license = stdenv.lib.licenses.bsd3;
+    # NOTE: 'unix' or even 'all' COULD work too, I'm not sure
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.iElectric ];
+  };
+}
diff --git a/pkgs/applications/misc/eaglemode/default.nix b/pkgs/applications/misc/eaglemode/default.nix
index 519db53ea18..b9c8acb0d07 100644
--- a/pkgs/applications/misc/eaglemode/default.nix
+++ b/pkgs/applications/misc/eaglemode/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, perl, libX11, xineLib, libjpeg, libpng, libtiff, pkgconfig,
+{ stdenv, fetchurl, perl, libX11, libjpeg, libpng, libtiff, pkgconfig,
 librsvg, glib, gtk, libXext, libXxf86vm, poppler }:
 
 stdenv.mkDerivation {
   name = "eaglemode-0.84.0";
- 
+
   src = fetchurl {
     url = mirror://sourceforge/eaglemode/eaglemode-0.84.0.tar.bz2;
     sha256 = "0n20b419j0l7h7jr4s3f3n09ka0ysg9nqs8mcwsrx24rcq7nv0cs";
   };
- 
-  buildInputs = [ perl libX11 xineLib libjpeg libpng libtiff pkgconfig 
+
+  buildInputs = [ perl libX11 libjpeg libpng libtiff pkgconfig
     librsvg glib gtk libXxf86vm libXext poppler ];
- 
+
   # The program tries to dlopen both Xxf86vm and Xext, so we use the
   # trick on NIX_LDFLAGS and dontPatchELF to make it find them.
-  # I use 'yes y' to skip a build error linking with xineLib, 
+  # I use 'yes y' to skip a build error linking with xineLib,
   # because xine stopped exporting "_x_vo_new_port"
   #  http://sourceforge.net/projects/eaglemode/forums/forum/808824/topic/5115261
   buildPhase = ''
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
     # Run 'eaglemode.sh', not 'eaglemode'.
     ln -s $out/eaglemode.sh $out/bin/eaglemode.sh
   '';
- 
+
   meta = {
     homepage = "http://eaglemode.sourceforge.net";
     description = "Zoomable User Interface";
diff --git a/pkgs/applications/misc/epdfview/default.nix b/pkgs/applications/misc/epdfview/default.nix
index 3ce652c1a33..6941e8df626 100644
--- a/pkgs/applications/misc/epdfview/default.nix
+++ b/pkgs/applications/misc/epdfview/default.nix
@@ -6,6 +6,7 @@ stdenv.mkDerivation rec {
     sha256 = "1w7qybh8ssl4dffi5qfajq8mndw7ipsd92vkim03nywxgjp4i1ll";
   };
   buildInputs = [ pkgconfig gtk poppler ];
+  patches = [ ./glib-top-level-header.patch ];
   meta = {
     homepage = http://trac.emma-soft.com/epdfview/;
     description = "A lightweight PDF document viewer using Poppler and GTK+";
diff --git a/pkgs/applications/misc/epdfview/glib-top-level-header.patch b/pkgs/applications/misc/epdfview/glib-top-level-header.patch
new file mode 100644
index 00000000000..a321ad3a2b6
--- /dev/null
+++ b/pkgs/applications/misc/epdfview/glib-top-level-header.patch
@@ -0,0 +1,12 @@
+diff -Naur epdfview-0.1.8-orig/src/gtk/StockIcons.h epdfview-0.1.8/src/gtk/StockIcons.h
+--- epdfview-0.1.8-orig/src/gtk/StockIcons.h	2011-05-28 06:24:57.000000000 -0400
++++ epdfview-0.1.8/src/gtk/StockIcons.h	2012-07-15 11:02:43.946339253 -0400
+@@ -18,7 +18,7 @@
+ #if !defined (__STOCK_ICONS_H__)
+ #define __STOCK_ICONS_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
diff --git a/pkgs/applications/misc/evtest/default.nix b/pkgs/applications/misc/evtest/default.nix
new file mode 100644
index 00000000000..58b4f0d01bf
--- /dev/null
+++ b/pkgs/applications/misc/evtest/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchgit, autoconf, automake, pkgconfig, libxml2 }:
+
+stdenv.mkDerivation rec {
+  name = "evtest-1.30";
+
+  preConfigure = "autoreconf -iv";
+
+  buildInputs = [ autoconf automake pkgconfig libxml2 ];
+
+  src = fetchgit {
+    url = "git://anongit.freedesktop.org/evtest";
+    rev = "1a50f2479c4775e047f234a24d95dda82441bfbd";
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple tool for input event debugging";
+    license = "GPLv2";
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/applications/misc/fetchmail/security-fix.patch b/pkgs/applications/misc/fetchmail/security-fix.patch
deleted file mode 100644
index 4d48c7aa055..00000000000
--- a/pkgs/applications/misc/fetchmail/security-fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- old/sink.c	(revision 5118)
-+++ new/sink.c	(revision 5119)
-@@ -262,7 +262,7 @@
-     const char *md1 = "MAILER-DAEMON", *md2 = "MAILER-DAEMON@";
- 
-     /* don't bounce in reply to undeliverable bounces */
--    if (!msg->return_path[0] ||
-+    if (!msg || !msg->return_path[0] ||
- 	strcmp(msg->return_path, "<>") == 0 ||
- 	strcasecmp(msg->return_path, md1) == 0 ||
- 	strncasecmp(msg->return_path, md2, strlen(md2)) == 0)
diff --git a/pkgs/applications/misc/freicoin/default.nix b/pkgs/applications/misc/freicoin/default.nix
new file mode 100644
index 00000000000..bce6d1f639c
--- /dev/null
+++ b/pkgs/applications/misc/freicoin/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, db4, boost, gmp, mpfr, miniupnpc, qt4, unzip }:
+
+stdenv.mkDerivation rec {
+  version = "0.0.2";
+  name = "freicoin-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/freicoin/freicoin/archive/v${version}.zip";
+    sha256 = "09izmm85rb64d5hd0hz9hkfvv3qag55sb3mdyp8z4103icqwd6d7";
+  };
+
+  # I think that openssl and zlib are required, but come through other
+  # packages
+  buildInputs = [ db4 boost gmp mpfr miniupnpc qt4 unzip ];
+
+  configurePhase = "qmake";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp freicoin-qt $out/bin
+  '';
+
+  meta = {
+    description = "Peer-to-peer currency with demurrage fee";
+    homepage = "http://freicoi.in/";
+    license = "MIT";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/girara/default.nix b/pkgs/applications/misc/girara/default.nix
new file mode 100644
index 00000000000..e112427126a
--- /dev/null
+++ b/pkgs/applications/misc/girara/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, gtk, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "girara-0.1.5";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/girara/download/${name}.tar.gz";
+    sha256 = "1hfi3jmx8ydvrqm3h6p6py2csavh7xx0223vxyca51kjl9mfnbld";
+  };
+
+  buildInputs = [ pkgconfig gtk gettext ];
+
+  makeFlags = "PREFIX=$(out)";
+
+  meta = {
+    homepage = http://pwmt.org/projects/girara/;
+    description = "User interface library";
+    longDescription = ''
+      girara is a library that implements a GTK+ based VIM-like user interface
+      that focuses on simplicity and minimalism.
+    '';
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+  };
+}
+
diff --git a/pkgs/applications/misc/gmrun/default.nix b/pkgs/applications/misc/gmrun/default.nix
new file mode 100644
index 00000000000..930df87214a
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, glib, gtk2, pkgconfig, popt }:
+
+let
+  version = "0.9.2";
+in
+
+stdenv.mkDerivation rec {
+  name = "gmrun-${version}";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/gmrun/gmrun/${version}/${name}.tar.gz";
+    md5 = "6cef37a968006d9496fc56a7099c603c";
+  };
+
+  buildInputs = [ glib gtk2 pkgconfig popt ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  patches = [
+      ./gcc43.patch
+      ./gmrun-0.9.2-xdg.patch
+    ];
+
+  meta = {
+    description = "Gnome Completion-Run Utility.";
+    longDescription = ''
+      A simple program which provides a "run program" window, featuring a bash-like TAB completion.
+      It uses GTK+ interface.
+      Also, supports CTRL-R / CTRL-S / "!" for searching through history.
+      Running commands in a terminal with CTRL-Enter. URL handlers.
+    '';
+    homepage = "http://sourceforge.net/projects/gmrun/";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/misc/gmrun/gcc43.patch b/pkgs/applications/misc/gmrun/gcc43.patch
new file mode 100644
index 00000000000..60e4338e893
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/gcc43.patch
@@ -0,0 +1,51 @@
+--- a/src/gtkcompletionline.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/gtkcompletionline.cc	2008-05-08 08:51:22.000000000 +0200
+@@ -29,6 +29,7 @@
+ #include <set>
+ #include <sstream>
+ #include <string>
++#include <cstring>
+ #include <vector>
+ using namespace std;
+ 
+--- a/src/ci_string.h.orig	2001-05-16 16:39:31.000000000 +0200
++++ a/src/ci_string.h	2008-05-08 08:51:33.000000000 +0200
+@@ -7,6 +7,7 @@
+ #define __CI_STRING_H__
+ 
+ #include <string>
++#include <cstring>
+ #include <ctype.h>
+ 
+ struct ci_char_traits : public std::char_traits<char>
+--- a/src/prefs.cc.orig	2002-08-16 12:48:22.000000000 +0200
++++ a/src/prefs.cc	2008-05-08 08:51:54.000000000 +0200
+@@ -13,6 +13,7 @@
+ #include <fstream>
+ #include <iostream>
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ #include <list>
+ 
+--- a/src/main.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/main.cc	2008-05-08 09:03:11.000000000 +0200
+@@ -14,6 +14,7 @@
+ #include <gdk/gdkkeysyms.h>
+ 
+ #include <string>
++#include <cstring>
+ #include <iostream>
+ #include <sstream>
+ #include <vector>
+
+--- a/src/gtkcompletionline.cc.orig	2009-06-19 22:38:14.000000000 +0400
++++ a/src/gtkcompletionline.cc	2009-06-19 22:37:14.000000000 +0400
+@@ -376,7 +377,7 @@
+   return 0;
+ }
+ 
+-int my_alphasort(const void* va, const void* vb) {
++int my_alphasort(const dirent** va, const dirent** vb) {
+   const struct dirent** a = (const struct dirent**)va;
+   const struct dirent** b = (const struct dirent**)vb;
diff --git a/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch b/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
new file mode 100644
index 00000000000..b5cd41a3c5b
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
@@ -0,0 +1,58 @@
+diff -ur a/src/history.cc src/history.cc
+--- a/src/history.cc	2002-08-17 15:19:31.000000000 +0200
++++ a/src/history.cc	2012-06-04 23:42:35.314653414 +0200
+@@ -24,8 +24,15 @@
+ HistoryFile::HistoryFile()
+ {
+   m_file_entries = 0;
+-  m_filename = g_get_home_dir();
+-  m_filename += "/.gmrun_history";
++  const char* filename = getenv("XDG_CACHE_HOME");
++  if (filename != 0 && *filename != '\0') {
++    m_filename = filename;
++    m_filename += "/gmrun_history";
++  }
++  else {
++    m_filename = g_get_home_dir();
++    m_filename += "/.gmrun_history";
++  }
+   m_current = 0;
+   m_default_set = false;
+   read_the_file();
+diff -ur a/src/prefs.cc src/prefs.cc
+--- a/src/prefs.cc	2012-06-04 22:35:00.671949439 +0200
++++ a/src/prefs.cc	2012-06-04 23:24:24.184445962 +0200
+@@ -35,12 +35,29 @@
+   file_name += GMRUNRC;
+   init(file_name);
+ 
+-  file_name = getenv("HOME");
+-  if (!file_name.empty()) {
++  file_name.clear();
++  const char* filename = getenv("XDG_CONFIG_HOME");
++  if (filename != 0 && *filename != '\0') {
++    file_name = filename;
+     string::iterator i = file_name.end() - 1;
+-    if (*i == '/') file_name.erase(i);
+-    file_name += "/.";
++    if (*i != '/') {
++      file_name += '/';
++    }
+     file_name += GMRUNRC;
++  }
++  else {
++    filename = getenv("HOME");
++    if (filename != 0 && *filename != '\0') {
++      file_name = filename;
++      string::iterator i = file_name.end() - 1;
++      if (*i != '/') {
++        file_name += '/';
++      }
++      file_name += '.';
++      file_name += GMRUNRC;
++    }
++  }
++  if (!file_name.empty()) {
+     init(file_name);
+   }
+ }
diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix
index 881f5339bdf..f7b8a511bc6 100644
--- a/pkgs/applications/misc/goldendict/default.nix
+++ b/pkgs/applications/misc/goldendict/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, qt4, libXtst, libvorbis, phonon, hunspell }:
+{ stdenv, fetchurl, pkgconfig, qt4, libXtst, libvorbis, phonon, hunspell }:
 stdenv.mkDerivation rec {
   name = "goldendict-1.0.1";
   src = fetchurl {
     url = "mirror://sourceforge/goldendict/${name}-src.tar.bz2";
     sha256 = "19p99dd5jgs0k66sy30vck7ymqj6dv1lh6w8xw18zczdll2h9yxk";
   };
-  buildInputs = [ qt4 libXtst libvorbis phonon hunspell ];
+  buildInputs = [ pkgconfig qt4 libXtst libvorbis phonon hunspell ];
   unpackPhase = ''
     mkdir ${name}-src
     cd ${name}-src
diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix
index 8da4e9de8fd..08b868bca92 100644
--- a/pkgs/applications/misc/googleearth/default.nix
+++ b/pkgs/applications/misc/googleearth/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     sha256 = "0bcpmnlk03382x577qbnbw3i6y08hr3qmg85pqj35scnl6van74c";
   };
 
-  buildNativeInputs = [
+  nativeBuildInputs = [
     glibc
     glib
     stdenv.gcc.gcc
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
     chmod +x $out/bin/googleearth
 
     fullPath=
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath:$i/lib
     done
           
diff --git a/pkgs/applications/misc/gphoto2/default.nix b/pkgs/applications/misc/gphoto2/default.nix
index 9fff2943d30..cba54bf8013 100644
--- a/pkgs/applications/misc/gphoto2/default.nix
+++ b/pkgs/applications/misc/gphoto2/default.nix
@@ -3,17 +3,27 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gphoto2-2.4.11";
-  
+  name = "gphoto2-2.5.2";
+
   src = fetchurl {
     url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
-    sha256 = "0ah42b7rnqh0z8bb96z7cdycxdh5k19h6lmfc02kdhrhqdr3q81y";
+    sha256 = "16c8k1cxfypg7v5h8xi87grclw7a5ayaamn548ys3zkj727r5fcf";
   };
-  
-  buildNativeInputs = [ pkgconfig gettext ];
+
+  nativeBuildInputs = [ pkgconfig gettext ];
   buildInputs = [ libgphoto2 libexif popt libjpeg readline libtool ];
-  
+
   meta = {
+    description = "a ready to use set of digital camera software applications";
+    longDescription = ''
+
+      A set of command line utilities for manipulating over 1400 different
+      digital cameras. Through libgphoto2, it supports PTP, MTP, and much more..
+
+    '';
     homepage = http://www.gphoto.org/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/applications/misc/gphoto2/gphotofs.nix b/pkgs/applications/misc/gphoto2/gphotofs.nix
index dc760b8e80b..32c95ec147b 100644
--- a/pkgs/applications/misc/gphoto2/gphotofs.nix
+++ b/pkgs/applications/misc/gphoto2/gphotofs.nix
@@ -1,11 +1,11 @@
-a :  
-let 
+a :
+let
   fetchurl = a.fetchurl;
   s = import ./src-info-for-gphotofs.nix;
 
-  version = a.lib.attrByPath ["version"] s.version a; 
+  version = a.lib.attrByPath ["version"] s.version a;
   buildInputs = with a; [
-    libgphoto2 fuse pkgconfig glib
+    libgphoto2 fuse pkgconfig glib libtool
   ];
 in
 rec {
@@ -19,7 +19,7 @@ rec {
 
   /* doConfigure should be removed if not needed */
   phaseNames = ["doConfigure" "doMakeInstall"];
-      
+
   name = "gphoto2fs-" + version;
   meta = {
     description = "Fuse FS to mount a digital camera";
diff --git a/pkgs/applications/misc/gphoto2/src-for-gphotofs.nix b/pkgs/applications/misc/gphoto2/src-for-gphotofs.nix
deleted file mode 100644
index 0967ef424bc..00000000000
--- a/pkgs/applications/misc/gphoto2/src-for-gphotofs.nix
+++ /dev/null
@@ -1 +0,0 @@
-{}
diff --git a/pkgs/applications/misc/gphoto2/src-info-for-gphotofs.nix b/pkgs/applications/misc/gphoto2/src-info-for-gphotofs.nix
index 2e350b9232f..1a4cceb6279 100644
--- a/pkgs/applications/misc/gphoto2/src-info-for-gphotofs.nix
+++ b/pkgs/applications/misc/gphoto2/src-info-for-gphotofs.nix
@@ -1,6 +1,6 @@
 rec {
-  advertisedUrl="http://downloads.sourceforge.net/gphoto/files/gphotofs/0.4.0/gphotofs-0.4.0.tar.bz2";
-  version = "0.4.0";
-  url="http://downloads.sourceforge.net/gphoto/files/gphotofs/0.4.0/gphotofs-0.4.0.tar.bz2";
-  hash = "07zxnawkyzy6np9zas6byp9ksjkbi16d11zqrznqarfkf3fkg3yq";
+  advertisedUrl="mirror://sourceforge/gphoto/gphotofs/0.5.0/gphotofs-0.5.tar.bz2";
+  version = "0.5.0";
+  url="mirror://sourceforge/gphoto/gphotofs/0.5.0/gphotofs-0.5.tar.bz2";
+  hash = "1k23ncbsbh64r7kz050bg31jqamchyswgg9izhzij758d7gc8vk7";
 }
diff --git a/pkgs/applications/misc/grass/default.nix b/pkgs/applications/misc/grass/default.nix
index 067e4354573..6abf6da4a69 100644
--- a/pkgs/applications/misc/grass/default.nix
+++ b/pkgs/applications/misc/grass/default.nix
@@ -1,4 +1,4 @@
-{getConfig, ...}@a:
+{ config, ... }@a:
 
 # You can set gui by exporting GRASS_GUI=..
 # see http://grass.itc.it/gdp/html_grass64/g.gui.html
@@ -36,31 +36,31 @@ a.composableDerivation.composableDerivation {} (fix: {
   ];
 
   cfg = {
-    _64bitSupport = getConfig ["grass" "64bitSupport"] true;
-    cursesSupport = getConfig ["grass" "curses"] true;
-    gdalSupport = getConfig ["grass" "gdal"] true;
-    pythonSupport = getConfig ["grass" "python"] true;
-    wxwidgetsSupport = getConfig ["grass" "wxwidgets"] true;
-    readlineSupport = getConfig ["grass" "readline"] true;
-    jpegSupport = getConfig ["grass" "jpeg"] true;
-    tiffSupport = getConfig ["grass" "tiff"] true;
-    pngSupport = getConfig ["grass" "png"] true;
-    tcltkSupport = getConfig ["grass" "tcltk"] true;
-    postgresSupport = getConfig ["grass" "postgres"] true;
-    mysqlSupport = getConfig ["grass" "mysql"] true;
-    sqliteSupport = getConfig ["grass" "sqlite"] true;
-    ffmpegSupport = getConfig ["grass" "ffmpeg"] true;
-    openglSupport = getConfig ["grass" "opengl"] true;
-    odbcSupport = getConfig ["grass" "odbc"] false; # fails to find libodbc - why ?
-    fftwSupport = getConfig ["grass" "fftw"] true;
-    blasSupport = getConfig ["grass" "blas"] true;
-    lapackSupport = getConfig ["grass" "lapack"] true;
-    cairoSupport = getConfig ["grass" "cairo"] true;
-    motifSupport = getConfig ["grass" "motif"] true;
-    freetypeSupport = getConfig ["grass" "freetype"] true;
-    projSupport = getConfig ["grass" "proj"] true;
-    opendwgSupport = getConfig ["grass" "dwg"] false;
-    largefileSupport = getConfig ["grass" "largefile"] true;
+    _64bitSupport = config.grass."64bitSupport" or true;
+    cursesSupport = config.grass.curses or true;
+    gdalSupport = config.grass.gdal or true;
+    pythonSupport = config.grass.python or true;
+    wxwidgetsSupport = config.grass.wxwidgets or true;
+    readlineSupport = config.grass.readline or true;
+    jpegSupport = config.grass.jpeg or true;
+    tiffSupport = config.grass.tiff or true;
+    pngSupport = config.grass.png or true;
+    tcltkSupport = config.grass.tcltk or true;
+    postgresSupport = config.grass.postgres or true;
+    mysqlSupport = config.grass.mysql or true;
+    sqliteSupport = config.grass.sqlite or true;
+    ffmpegSupport = config.grass.ffmpeg or true;
+    openglSupport = config.grass.opengl or true;
+    odbcSupport = config.grass.odbc or false; # fails to find libodbc - why ?
+    fftwSupport = config.grass.fftw or true;
+    blasSupport = config.grass.blas or true;
+    lapackSupport = config.grass.lapack or true;
+    cairoSupport = config.grass.cairo or true;
+    motifSupport = config.grass.motif or true;
+    freetypeSupport = config.grass.freetype or true;
+    projSupport = config.grass.proj or true;
+    opendwgSupport = config.grass.dwg or false;
+    largefileSupport = config.grass.largefile or true;
   };
 
   # ?? NLS support:                no
diff --git a/pkgs/applications/misc/grip/default.nix b/pkgs/applications/misc/grip/default.nix
index 1eb9ee1186f..0c2b957bc7c 100644
--- a/pkgs/applications/misc/grip/default.nix
+++ b/pkgs/applications/misc/grip/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, gtk, glib, pkgconfig, libgnome, libgnomeui, vte
 , curl, cdparanoia, libid3tag, ncurses, libtool }:
 
-stdenv.mkDerivation {
-  name = "grip-3.2.0";
+stdenv.mkDerivation rec {
+  name = "grip-3.3.1";
 
   src = fetchurl {
-    url = http://prdownloads.sourceforge.net/grip/grip-3.2.0.tar.gz;
-    sha256 = "1jh5x35rq15n8ivlp9wbdx8x9mj6agf5rfdv8sd6gai851zsclas";
+    url = "mirror://sourceforge/grip/${name}.tar.gz";
+    sha256 = "1zb6zpq7qmn6bflbgfwisyg3vrjr23yi1c1kqvwndl1f0shr8qyl";
   };
 
   buildInputs = [ gtk glib pkgconfig libgnome libgnomeui vte curl cdparanoia
@@ -14,9 +14,10 @@ stdenv.mkDerivation {
 
   meta = {
     description = "GTK+-based audio CD player/ripper";
-    homepage = http://nostatic.org/grip;
+    homepage = "http://nostatic.org/grip";
     license = "GPLv2";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    #platforms = args.lib.platforms.linux;
+
+    maintainers = [ stdenv.lib.maintainers.marcweber stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/gv/default.nix b/pkgs/applications/misc/gv/default.nix
index 7a02100b2cb..70e810bb8d7 100644
--- a/pkgs/applications/misc/gv/default.nix
+++ b/pkgs/applications/misc/gv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, Xaw3d, ghostscriptX, perl }:
 
 let
-  name = "gv-3.7.3";
+  name = "gv-3.7.4";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://gnu/gv/${name}.tar.gz";
-    sha256 = "ee01ba96e3a5c319eb4658357372a118dbb0e231891b360edecbdebd449d1c2b";
+    sha256 = "0q8s43z14vxm41pfa8s5h9kyyzk1fkwjhkiwbf2x70alm6rv6qi1";
   };
 
   buildInputs = [ Xaw3d ghostscriptX perl ];
diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix
index d061495b176..de1df426052 100644
--- a/pkgs/applications/misc/ikiwiki/default.nix
+++ b/pkgs/applications/misc/ikiwiki/default.nix
@@ -23,7 +23,7 @@ assert mercurialSupport -> (mercurial != null);
 
 let
   name = "ikiwiki";
-  version = "3.20120629";
+  version = "3.20130212";
 
   lib = stdenv.lib;
 in
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://ftp.de.debian.org/debian/pool/main/i/ikiwiki/${name}_${version}.tar.gz";
-    sha256 = "7e39cdb727f261ce20fde5f0b05966680589a3d028c569780addd4b530382f07";
+    sha256 = "1svajjhrwaq7wwgmhaxc2ld12cla3pdi9i7m8ll2rfa11cdhhf6m";
   };
 
   buildInputs = [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
diff --git a/pkgs/applications/misc/jbidwatcher/default.nix b/pkgs/applications/misc/jbidwatcher/default.nix
index 70cd5d3faf4..9b74b0c93a9 100644
--- a/pkgs/applications/misc/jbidwatcher/default.nix
+++ b/pkgs/applications/misc/jbidwatcher/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "jbidwatcher";
-  version = "2.1.5";
+  version = "2.5.2";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "http://www.jbidwatcher.com/download/JBidwatcher-${version}.jar";
-    sha256 = "0nrs9ly56cqn33dm1sjm53pzj1cf7jncwn4c8v0xyva4jqyz2y5p";
+    sha256 = "07w75ryn8inm5i1829gabr8lifbycz40ynzsyaw22yzqk5if1n9l";
   };
 
   buildInputs = [ java ];
diff --git a/pkgs/applications/misc/k3b/default.nix b/pkgs/applications/misc/k3b/default.nix
index cff71a6a00e..06565065ce5 100644
--- a/pkgs/applications/misc/k3b/default.nix
+++ b/pkgs/applications/misc/k3b/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, cmake, qt4, perl, shared_mime_info, libvorbis, taglib
 , flac, libsamplerate, libdvdread, lame, libsndfile, libmad, gettext
-, kdelibs, kdemultimedia, automoc4, phonon
+, kdelibs, kdemultimedia, automoc4, phonon, libkcddb ? null
 }:
 
 stdenv.mkDerivation rec {
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
       flac libsamplerate libdvdread lame libsndfile
       libmad gettext stdenv.gcc.libc
       kdelibs kdemultimedia automoc4 phonon
+      libkcddb
     ];
 
   enableParallelBuilding = true;
@@ -23,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = with stdenv.lib; {
     description = "CD/DVD Burning Application for KDE";
     license = licenses.gpl2Plus;
-    maintainers = [ maintainers.sander maintainers.urkud ];
+    maintainers = [ maintainers.sander maintainers.urkud maintainers.phreedom ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/kde-wacomtablet/default.nix b/pkgs/applications/misc/kde-wacomtablet/default.nix
index 46730848024..22587a1bae0 100644
--- a/pkgs/applications/misc/kde-wacomtablet/default.nix
+++ b/pkgs/applications/misc/kde-wacomtablet/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = with stdenv.lib; {
     description = "KDE Wacom graphic tablet configuration tool";
diff --git a/pkgs/applications/misc/krusader/krusader-gcc44.patch b/pkgs/applications/misc/krusader/krusader-gcc44.patch
deleted file mode 100644
index f8840d5f33c..00000000000
--- a/pkgs/applications/misc/krusader/krusader-gcc44.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- krusader-2.0.0/krusader/VFS/kiojobwrapper.cpp~	2009-04-29 17:13:43.000000000 +0000
-+++ krusader-2.0.0/krusader/VFS/kiojobwrapper.cpp	2009-04-29 17:14:01.000000000 +0000
-@@ -37,6 +37,7 @@
- #include <kio/jobuidelegate.h>
- #include <kio/job.h>
- #include <qapplication.h>
-+#include <cstdio>
- #include <iostream>
- #include <klocale.h>
- #include "virtualcopyjob.h"
diff --git a/pkgs/applications/misc/librecad/2.0.nix b/pkgs/applications/misc/librecad/2.0.nix
new file mode 100644
index 00000000000..2394d116314
--- /dev/null
+++ b/pkgs/applications/misc/librecad/2.0.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, qt4, muparser, which, boost}:
+
+stdenv.mkDerivation {
+  name = "librecad-2.0.0beta1";
+
+  src = fetchurl {
+    url = https://github.com/LibreCAD/LibreCAD/tarball/2.0.0beta1;
+    name = "librecad-2.0.0beta1.tar.gz";
+    sha256 = "8bf969b79be115f3b3ff72cc030a4c21fe93164dd0cb19ddfb78a7d66b8bc770";
+  };
+
+  patchPhase = ''
+    sed -i -e s,/bin/bash,`type -P bash`, scripts/postprocess-unix.sh
+    sed -i -e s,/usr/share,$out/share, librecad/src/lib/engine/rs_system.cpp
+  '';
+
+  configurePhase = ''
+    qmake librecad.pro PREFIX=$out MUPARSER_DIR=${muparser} BOOST_DIR=${boost}
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin $out/share
+    cp -R unix/librecad $out/bin
+    cp -R unix/resources $out/share/librecad
+  '';
+
+  buildInputs = [ qt4 muparser which boost ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A 2D CAD package based upon Qt";
+    homepage = http://librecad.org;
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/librecad/default.nix b/pkgs/applications/misc/librecad/default.nix
index bcf0f1aee79..59bd4888e4a 100644
--- a/pkgs/applications/misc/librecad/default.nix
+++ b/pkgs/applications/misc/librecad/default.nix
@@ -1,28 +1,34 @@
-{ stdenv, fetchurl, qt4}:
+{ stdenv, fetchurl, qt4, muparser, which}:
 
 stdenv.mkDerivation {
-  name = "librecad-1.0.0";
+  name = "librecad-1.0.2";
 
   src = fetchurl {
-    url = https://github.com/LibreCAD/LibreCAD/tarball/v1.0.0;
-    name = "librecad-1.0.0.tar.gz";
-    sha256 = "0s1ikyvy98zz1vw3xf5la73n3sykib6292cmhh2z738ggwigicc9";
+    url = https://github.com/LibreCAD/LibreCAD/tarball/v1.0.2;
+    name = "librecad-1.0.2.tar.gz";
+    sha256 = "13ee7e401e4f5fbc68c2e017b7189bec788038f4f6e77f559861ceb8cfb1907d";
   };
 
   patchPhase = ''
     sed -i -e s,/bin/bash,`type -P bash`, scripts/postprocess-unix.sh
+    sed -i -e s,/usr/share,$out/share, src/lib/engine/rs_system.cpp
   '';
 
   configurePhase = "qmake PREFIX=$out";
 
-  # It builds, but it does not install
-  installPhase = "exit 1";
+  installPhase = ''
+    ensureDir $out/bin $out/share
+    cp -R unix/librecad $out/bin
+    cp -R unix/resources $out/share/librecad
+  '';
 
-  buildInputs = [ qt4 ];
+  buildInputs = [ qt4 muparser which ];
 
   meta = {
     description = "A 2D CAD package based upon Qt";
     homepage = http://librecad.org;
     license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/lyx/default.nix b/pkgs/applications/misc/lyx/default.nix
index cb832ed99f5..07de6271289 100644
--- a/pkgs/applications/misc/lyx/default.nix
+++ b/pkgs/applications/misc/lyx/default.nix
@@ -3,19 +3,19 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.4";
+  version = "2.0.6";
   name = "lyx-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/${name}.tar.xz";
-    sha256 = "137dzmz1z6aqz9mdj8gmmi0k60s9sfn6gy916j175cwzq6hpncb8";
+    sha256 = "1llah9d9ymvdk8asmqslcwnicycxrwb27k8si184n5bfxvnjpjx5";
   };
 
   configureFlags = [
     #"--without-included-boost"
     /*  Boost is a huge dependency from which 1.4 MB of libs would be used.
         Using internal boost stuff only increases executable by around 0.2 MB. */
-    #"--without-included-mythes" # such a small library isn't worth a split package
+    #"--without-included-mythes" # such a small library isn't worth a separate package
   ];
 
   buildInputs = [
@@ -23,6 +23,8 @@ stdenv.mkDerivation rec {
     enchant # mythes boost
   ];
 
+  doCheck = true;
+
   meta = {
     description = "WYSIWYM frontend for LaTeX, DocBook, etc.";
     homepage = "http://www.lyx.org";
diff --git a/pkgs/applications/misc/mathblog/default.nix b/pkgs/applications/misc/mathblog/default.nix
deleted file mode 100644
index e5ed53a56a0..00000000000
--- a/pkgs/applications/misc/mathblog/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ cabal, ConfigFile, filepath, HStringTemplate, HUnit, pandoc
-, pandocTypes, SHA, testFramework, testFrameworkHunit, time
-}:
-
-cabal.mkDerivation (self: {
-  pname = "mathblog";
-  version = "0.5";
-  sha256 = "01iyzrwscqirhcr4622d0n16mr4p54qbvg5m2a0ns36j59xfd79g";
-  isLibrary = false;
-  isExecutable = true;
-  buildDepends = [
-    ConfigFile filepath HStringTemplate HUnit pandoc pandocTypes SHA
-    testFramework testFrameworkHunit time
-  ];
-  meta = {
-    description = "A program for creating and managing a static weblog with LaTeX math and function graphs";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix
index 20ded9486f7..eccd11f6041 100644
--- a/pkgs/applications/misc/mupdf/default.nix
+++ b/pkgs/applications/misc/mupdf/default.nix
@@ -1,17 +1,18 @@
 { stdenv, fetchurl, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
 , libX11, libXext }:
 stdenv.mkDerivation rec {
-  name = "mupdf-0.7";
+  name = "mupdf-1.1";
 
   src = fetchurl {
-    url = "http://mupdf.com/download/archive/${name}.tar.gz";
-    sha256 = "e7f6307fa472575d27fe893e787ddb3fc927f03ba4ae23105f917189e81960a6";
+    url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
+    sha256 = "e54666bbe1d9f0a5464349bfbeffcf676c4a0fcad3efb89eba1f20d4ac991f34";
   };
 
   buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];
 
   preBuild = ''
     export makeFlags="prefix=$out"
+    export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) "
   '';
 
   meta = {
diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix
index 6bbc287e6ee..c2f80570673 100644
--- a/pkgs/applications/misc/mysql-workbench/default.nix
+++ b/pkgs/applications/misc/mysql-workbench/default.nix
@@ -1,30 +1,35 @@
-{ stdenv, fetchurl, makeWrapper, boost, file, gettext
+{ stdenv, fetchurl, makeWrapper, autoconf, automake, boost, file, gettext
 , glib, glibc, libgnome_keyring, gnome_keyring, gtk, gtkmm, intltool
 , libctemplate, libglade
+, libiodbc
 , libgnome, libsigcxx, libtool, libuuid, libxml2, libzip, lua, mesa, mysql
 , pango, paramiko, pcre, pexpect, pkgconfig, pycrypto, python, sqlite
 }:
 
 stdenv.mkDerivation rec {
   pname = "mysql-workbench";
-  version = "5.2.39";
+  version = "5.2.47";
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "http://mirror.services.wisc.edu/mysql/Downloads/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
-    sha256 = "0e4e14f1b39dca2b65f924381d82b406dc25a530fbd25631b4cd05bddc4ab5bd";
+    url = "http://mirror.cogentco.com/pub/mysql/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
+    sha256 = "1343fn3msdxqfpxw0kgm0mdx5r7g9ra1cpc8p2xhl7kz2pmqp4p6";
   };
 
-  buildInputs = [ boost file gettext glib glibc libgnome_keyring gtk gtkmm intltool
-    libctemplate libglade libgnome libsigcxx libtool libuuid libxml2 libzip lua makeWrapper mesa
+  buildInputs = [ autoconf automake boost file gettext glib glibc libgnome_keyring gtk gtkmm intltool
+    libctemplate libglade libgnome libiodbc 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"
   '';
 
+  postConfigure = ''
+    autoreconf -fi
+  '';
+
   postInstall = ''
-    wrapProgram "$out/bin/mysql-workbench-bin" \
+    wrapProgram "$out/bin/mysql-workbench" \
       --prefix LD_LIBRARY_PATH : "${python}/lib" \
       --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64" \
       --prefix PATH : "${gnome_keyring}/bin" \
diff --git a/pkgs/applications/misc/nut/2.6.3.nix b/pkgs/applications/misc/nut/2.6.3.nix
deleted file mode 100644
index 471529675db..00000000000
--- a/pkgs/applications/misc/nut/2.6.3.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev, avahi, freeipmi }:
-
-stdenv.mkDerivation {
-  name = "nut-2.6.3";
-  src = fetchurl {
-    url = http://www.networkupstools.org/source/2.6/nut-2.6.3.tar.gz;
-    sha256 = "0fk3bcivv26kw1psxb6sykqp9n5w02j01s1idypzlci0kmr3p49l";
-  };
-
-  buildInputs = [ neon libusb openssl udev avahi freeipmi ];
-  buildNativeInputs = [ pkgconfig ];
-
-  configureFlags = [
-    "--with-all"
-    "--with-ssl"
-    "--without-snmp" # Until we have it ...
-    "--without-powerman" # Until we have it ...
-    "--without-cgi"
-    "--without-hal"
-  ];
-
-  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 ];
-    priority = 10;
-  };
-}
diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix
index 3d4e5136021..157ecc0ffd8 100644
--- a/pkgs/applications/misc/nut/default.nix
+++ b/pkgs/applications/misc/nut/default.nix
@@ -1,20 +1,28 @@
-{stdenv, fetchurl, pkgconfig, neon, libusb, hal, openssl, udev}:
+{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev, avahi, freeipmi }:
+
+stdenv.mkDerivation rec {
+  name = "nut-2.6.5";
 
-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";
+    url = "http://www.networkupstools.org/source/2.6/${name}.tar.gz";
+    sha256 = "0gxrzsblx0jc4g9w0903ybwqbv1d79vq5hnks403fvnay4fgg3b1";
   };
 
-  buildInputs = [pkgconfig neon libusb hal openssl udev];
+  buildInputs = [ neon libusb openssl udev avahi freeipmi ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  configureFlags =
+    [ "--with-all"
+      "--with-ssl"
+      "--without-snmp" # Until we have it ...
+      "--without-powerman" # Until we have it ...
+      "--without-cgi"
+      "--without-hal"
+      "--with-systemdsystemunitdir=$(out)/etc/systemd/systemd"
+    ];
 
-  configureFlags = [
-    "--with-all"
-    "--without-snmp" # Until we have it ...
-    "--without-powerman" # Until we have it ...
-    "--without-cgi"
-  ];
+  enableParallelBuilding = true;
 
   meta = {
     description = "Network UPS Tools";
@@ -26,5 +34,6 @@ stdenv.mkDerivation {
     homepage = http://www.networkupstools.org/;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = with stdenv.lib.maintainers; [ pierron ];
+    priority = 10;
   };
 }
diff --git a/pkgs/applications/misc/pitz/default.nix b/pkgs/applications/misc/pitz/default.nix
new file mode 100644
index 00000000000..355ea9b2033
--- /dev/null
+++ b/pkgs/applications/misc/pitz/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, buildPythonPackage, tempita, jinja2, pyyaml, clepy, mock
+, nose, decorator, docutils }:
+
+# TODO: pitz has a pitz-shell utility that depends on ipython, but it just
+# errors out and dies (it probably depends on an old ipython version):
+#
+#   from IPython.Shell import IPShellEmbed
+#   ImportError: No module named Shell
+#
+# pitz-shell is not the primary interface, so it is not critical to have it
+# working. Concider fixing pitz upstream.
+
+buildPythonPackage rec {
+  name = "pitz-1.2.4";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/p/pitz/${name}.tar.gz";
+    sha256 = "1k7f3h4acllzqy3mjqnjd4w5jskp03s79b7dx3c85vlmd7824smr";
+  };
+
+  # propagatedBuildInputs is needed for pitz to find its dependencies at
+  # runtime. If we use buildInputs it would just build, not run.
+  propagatedBuildInputs = [ tempita jinja2 pyyaml clepy mock nose decorator docutils ];
+
+  meta = with stdenv.lib; {
+    description = "Distributed bugtracker";
+    license = licenses.bsd3;
+    homepage = http://pitz.tplus1.com/;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/applications/misc/pstree/default.nix b/pkgs/applications/misc/pstree/default.nix
index 6f5c775cfb3..0d61d3d74cf 100644
--- a/pkgs/applications/misc/pstree/default.nix
+++ b/pkgs/applications/misc/pstree/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "pstree-2.33";
+  name = "pstree-2.36";
 
   src = fetchurl {
     url = "http://www.sfr-fresh.com/unix/misc/${name}.tar.gz";
-    sha256 = "1469lrhpy6wghlvbjx6lmvh27rakq00x11cpz4n965fg11i121hg";
+    sha256 = "1vx4fndmkkx3bmcv71rpzjjbn24hlfs10pl99dsfhbx16a2d41cx";
   };
 
   unpackPhase = "unpackFile \$src; sourceRoot=.";
diff --git a/pkgs/applications/misc/qcad/default.nix b/pkgs/applications/misc/qcad/default.nix
deleted file mode 100644
index ee8876e6b33..00000000000
--- a/pkgs/applications/misc/qcad/default.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-# translations still misssing
-
-{ stdenv, fetchurl, qt3, libpng, libXext, libX11 }:
-
-stdenv.mkDerivation {
-  name = "qcad-2.0.5.0-1-community";
-
-  src = fetchurl {
-    url = http://www.ribbonsoft.com/archives/qcad/qcad-2.0.5.0-1-community.src.tar.gz;
-    sha256 = "07aiw7zjf1fc04dhgwwp29adwb2qs165n7v04lh09zy0k2aplcl3";
-  };
-
-  # TODO: add translations
-  buildPhase = ''
-    cd scripts
-    sh build_qcad.sh notrans
-    cd ..
-  '';
-
-  buildInputs = [ qt3 libpng libXext libX11 ];
-
-  prePatch = ''
-    sed -i 's/-pedantic//' mkspecs/defs.pro
-    # patch -p1 < ${ ./qcad-2.0.4.0-1.src-intptr.patch }
-  '';
-  patches = [
-    /* taken from gentoo, fixes amd64 compilation issue */
-    ./qcad-2.0.4.0-1.src-intptr.patch
-    /* taken from gentoo, fixes gcc 4.3 or above compilation issue */
-    ./qcad-2.0.4.0-gcc43.patch
-  ];
-
-  # probably there is more to be done. But this seems to work for now (eg see gentoo ebuild)
-  installPhase = ''
-    mkdir -p $out/{bin,share}
-    cp -r qcad $out/share
-
-    # The compilation does not fail with error code. But qcad will not exist
-    # if it failed.
-    test -f $out/share/qcad/qcad
-
-    cat >> $out/bin/qcad << EOF
-    #!/bin/sh
-    cd $out/share/qcad
-    ./qcad "\$@"
-    EOF
-    chmod +x $out/bin/qcad
-  '';
-
-  meta = { 
-    description = "A 2D CAD package based upon Qt";
-    homepage = http://www.ribbonsoft.de/qcad.html;
-    license = "GPLv2"; # community edition
-  };
-}
diff --git a/pkgs/applications/misc/qcad/qcad-2.0.4.0-1.src-intptr.patch b/pkgs/applications/misc/qcad/qcad-2.0.4.0-1.src-intptr.patch
deleted file mode 100644
index 6d8b6acca5b..00000000000
--- a/pkgs/applications/misc/qcad/qcad-2.0.4.0-1.src-intptr.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -Naur qcad-2.0.4.0-1.src.orig/qcadlib/src/engine/rs_entity.cpp qcad-2.0.4.0-1.src.patched/qcadlib/src/engine/rs_entity.cpp
---- qcad-2.0.4.0-1.src.orig/qcadlib/src/engine/rs_entity.cpp	2004-09-14 15:13:02.000000000 -0500
-+++ qcad-2.0.4.0-1.src.patched/qcadlib/src/engine/rs_entity.cpp	2006-06-23 14:21:40.000000000 -0500
-@@ -849,7 +849,7 @@
-         os << " layer: NULL ";
-     } else {
-         os << " layer: " << e.layer->getName().latin1() << " ";
--        os << " layer address: " << (int)(e.layer) << " ";
-+        os << " layer address: " << (intptr_t)(e.layer) << " ";
-     }
- 
-     os << e.pen << "\n";
-diff -Naur qcad-2.0.4.0-1.src.orig/qcadlib/src/engine/rs_layer.cpp qcad-2.0.4.0-1.src.patched/qcadlib/src/engine/rs_layer.cpp
---- qcad-2.0.4.0-1.src.orig/qcadlib/src/engine/rs_layer.cpp	2004-09-14 15:13:02.000000000 -0500
-+++ qcad-2.0.4.0-1.src.patched/qcadlib/src/engine/rs_layer.cpp	2006-06-23 14:21:23.000000000 -0500
-@@ -57,7 +57,7 @@
-     os << " name: " << l.getName().latin1()
-     << " pen: " << l.getPen()
- 	<< " frozen: " << (int)l.isFrozen()
--	<< " address: " << (int)(&l)
-+	<< " address: " << (intptr_t)(&l)
-     << std::endl;
-     return os;
- }
diff --git a/pkgs/applications/misc/qcad/qcad-2.0.4.0-gcc43.patch b/pkgs/applications/misc/qcad/qcad-2.0.4.0-gcc43.patch
deleted file mode 100644
index bc68e81c715..00000000000
--- a/pkgs/applications/misc/qcad/qcad-2.0.4.0-gcc43.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -Naur qcad-2.0.4.0-1.src/dxflib/src/dl_writer_ascii.cpp qcad-2.0.4.0-1.src.new/dxflib/src/dl_writer_ascii.cpp
---- qcad-2.0.4.0-1.src/dxflib/src/dl_writer_ascii.cpp	2004-09-14 16:13:01.000000000 -0400
-+++ qcad-2.0.4.0-1.src.new/dxflib/src/dl_writer_ascii.cpp	2008-04-27 08:35:47.000000000 -0400
-@@ -30,6 +30,7 @@
- #endif // _MSC_VER > 1000
- 
- #include <stdio.h>
-+#include <cstring>
- 
- #include "dl_writer_ascii.h"
- #include "dl_exception.h"
-diff -Naur qcad-2.0.4.0-1.src/dxflib/src/dl_writer.h qcad-2.0.4.0-1.src.new/dxflib/src/dl_writer.h
---- qcad-2.0.4.0-1.src/dxflib/src/dl_writer.h	2004-09-14 16:13:01.000000000 -0400
-+++ qcad-2.0.4.0-1.src.new/dxflib/src/dl_writer.h	2008-04-27 08:35:48.000000000 -0400
-@@ -34,6 +34,7 @@
- 
- 
- #include <iostream>
-+#include <cstring>
- 
- #include "dl_attributes.h"
- 
-diff -Naur qcad-2.0.4.0-1.src/qcadactions/src/rs_actionzoompan.cpp qcad-2.0.4.0-1.src.new/qcadactions/src/rs_actionzoompan.cpp
---- qcad-2.0.4.0-1.src/qcadactions/src/rs_actionzoompan.cpp	2004-09-14 16:13:03.000000000 -0400
-+++ qcad-2.0.4.0-1.src.new/qcadactions/src/rs_actionzoompan.cpp	2008-04-27 08:35:48.000000000 -0400
-@@ -28,6 +28,7 @@
- #include "rs_snapper.h"
- #include "rs_point.h"
- 
-+#include <cstdlib>
- 
- RS_ActionZoomPan::RS_ActionZoomPan(RS_EntityContainer& container,
-                                    RS_GraphicView& graphicView)
-diff -Naur qcad-2.0.4.0-1.src/qcadlib/src/information/rs_information.h qcad-2.0.4.0-1.src.new/qcadlib/src/information/rs_information.h
---- qcad-2.0.4.0-1.src/qcadlib/src/information/rs_information.h	2004-09-14 16:13:02.000000000 -0400
-+++ qcad-2.0.4.0-1.src.new/qcadlib/src/information/rs_information.h	2008-04-27 08:35:48.000000000 -0400
-@@ -31,7 +31,7 @@
- #include "rs_line.h"
- #include "rs_arc.h"
- 
--
-+#include <cstdlib>
- 
- /**
-  * Class for getting information about entities. This includes
diff --git a/pkgs/applications/misc/qgis/default.nix b/pkgs/applications/misc/qgis/default.nix
index 7e27736ee7e..834b3f0cfbe 100644
--- a/pkgs/applications/misc/qgis/default.nix
+++ b/pkgs/applications/misc/qgis/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gdal qt4 flex bison proj geos x11 sqlite gsl pyqt4 qwt
     fcgi ];
 
-  buildNativeInputs = [ cmake python];
+  nativeBuildInputs = [ cmake python];
 
   patches = [ ./r14988.diff ];
 
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index 6d6234b8d3e..feced2f4538 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -3,10 +3,11 @@
   randrproto, xcbutil, xf86vidmodeproto }:
 
 stdenv.mkDerivation rec {
-  name = "redshift";
+  pname = "redshift";
   version = "1.6";
+  name = "${pname}-${version}";
   src = fetchurl {
-    url = "http://launchpad.net/${name}/trunk/${version}/+download/${name}-${version}.tar.bz2";
+    url = "http://launchpad.net/${pname}/trunk/${version}/+download/${pname}-${version}.tar.bz2";
     sha256 = "0g46zhqnx3y2fssmyjgaardzhjw1j29l1dbc2kmccw9wxqfla1wi";
   };
 
@@ -25,4 +26,4 @@ stdenv.mkDerivation rec {
     license = "GPLv3+";
     homepage = "http://jonls.dk/redshift";
   }; 
-}
\ No newline at end of file
+}
diff --git a/pkgs/applications/misc/rsibreak/default.nix b/pkgs/applications/misc/rsibreak/default.nix
index 8aab11beec3..fe8118b1976 100644
--- a/pkgs/applications/misc/rsibreak/default.nix
+++ b/pkgs/applications/misc/rsibreak/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yrf73r8mixskh8b531wb8dfs9z7rrw010xsrflhjhjmqh94h8mw";
   };
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   buildInputs = [ kdelibs kdebase_workspace ];
 
diff --git a/pkgs/applications/misc/rxvt_unicode/default.nix b/pkgs/applications/misc/rxvt_unicode/default.nix
index a1297d64a18..d52fd178165 100644
--- a/pkgs/applications/misc/rxvt_unicode/default.nix
+++ b/pkgs/applications/misc/rxvt_unicode/default.nix
@@ -3,7 +3,7 @@
 
 let 
   name = "rxvt-unicode";
-  version = "9.15";
+  version = "9.16";
   n = "${name}-${version}";
 in
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation (rec {
 
   src = fetchurl {
     url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
-    sha256 = "ec1aa2932da844979ed8140bd92223defb12042aa5e877e05ac31139ca81f2b1";
+    sha256 = "0x28wyslqnhn2q11y4hncqdl07wgh5ypywl92fq0jxycr36ibfvn";
   };
 
   buildInputs =
@@ -23,7 +23,7 @@ stdenv.mkDerivation (rec {
 
   preConfigure =
     ''
-      configureFlags="${if perlSupport then "--enable-perl" else "--disable-perl"}";
+      configureFlags="--with-terminfo=$out/share/terminfo ${if perlSupport then "--enable-perl" else "--disable-perl"}";
       export TERMINFO=$out/share/terminfo # without this the terminfo won't be compiled by tic, see man tic
       NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
       NIX_LDFLAGS="$NIX_LDFLAGS -lfontconfig -lXrender "
@@ -36,10 +36,6 @@ stdenv.mkDerivation (rec {
 
   meta = {
     description = "A clone of the well-known terminal emulator rxvt";
-    longDescription = "
-      You should put this into your ~/.bashrc:
-      export TERMINFO=~/.nix-profile/share/terminfo
-    ";
     homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html";
   };
 })
diff --git a/pkgs/applications/misc/semnotes/default.nix b/pkgs/applications/misc/semnotes/default.nix
index fbc4df3a0b7..52a575130c0 100644
--- a/pkgs/applications/misc/semnotes/default.nix
+++ b/pkgs/applications/misc/semnotes/default.nix
@@ -3,7 +3,7 @@ stdenv.mkDerivation {
   name = "semnotes-0.4.0-1";
 
   src = fetchurl {
-    url = "mirror://sf/semn/0.4.0/semnotes-0.4.0-1-src.tar.bz2";
+    url = "mirror://sourceforge/semn/0.4.0/semnotes-0.4.0-1-src.tar.bz2";
     sha256 = "1zh5jfh7pyhyz5fbzcgzyckdg0ny7sf8s16yy6rjw9n021zz5i7m";
   };
 
diff --git a/pkgs/applications/misc/st/default.nix b/pkgs/applications/misc/st/default.nix
index 5ac2ad6b9ad..41575ce35a6 100644
--- a/pkgs/applications/misc/st/default.nix
+++ b/pkgs/applications/misc/st/default.nix
@@ -1,14 +1,22 @@
-{ stdenv, fetchurl, libX11, ncurses}:
+{ stdenv, fetchurl, writeText, libX11, ncurses, libXext, libXft, fontconfig
+, conf? null}:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "st-0.2.1";
+  name = "st-0.4.1";
   
   src = fetchurl {
-    url = http://hg.suckless.org/st/archive/0.2.1.tar.gz;
-    sha256 = "15yqyys69ifjc4vrzvamrg7x0pwa60mnjpi0kap4y9ykhds83xab";
+    url = "http://dl.suckless.org/st/${name}.tar.gz";
+    sha256 = "0cdzwbm5fxrwz8ryxkh90d3vwx54wjyywgj28ymsb5fdv3396bzf";
   };
+
+  configFile = optionalString (conf!=null) (writeText "config.def.h" conf);
+  preBuild = optionalString (conf!=null) "cp ${configFile} config.def.h";
   
-  buildInputs = [ libX11 ncurses ];
+  buildInputs = [ libX11 ncurses libXext libXft fontconfig ];
+
+  NIX_LDFLAGS = "-lfontconfig";
 
   installPhase = ''
     TERMINFO=$out/share/terminfo make install PREFIX=$out
@@ -17,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://st.suckless.org/;
     license = "MIT";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with maintainers; [viric];
+    platforms = with platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/surf/default.nix b/pkgs/applications/misc/surf/default.nix
index 61d2e6a65bd..d6083da5ce4 100644
--- a/pkgs/applications/misc/surf/default.nix
+++ b/pkgs/applications/misc/surf/default.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl, gtk, webkit, pkgconfig, glib, libsoup, patches ? null}:
+{stdenv, fetchurl, makeWrapper, gtk, webkit, pkgconfig, glib, glib_networking, libsoup, gsettings_desktop_schemas, patches ? null}:
 
 stdenv.mkDerivation rec {
   name = "surf-${version}";
-  version="0.5";
+  version="0.6";
 
   src = fetchurl {
     url = "http://dl.suckless.org/surf/surf-${version}.tar.gz";
-    sha256 = "19qfkwdk6p5hcwnnplscp1kmypz74mga7x6iqy6w3g18s221f2mx";
+    sha256 = "01b8hq8z2wd7ssym5bypx2b15mrs1lhgkrcgxf700kswxvxcrhgx";
   };
 
-  buildInputs = [ gtk webkit pkgconfig glib libsoup ];
+  buildInputs = [ gtk makeWrapper webkit pkgconfig glib libsoup ];
 
   # Allow users set their own list of patches
   inherit patches;
@@ -19,8 +19,14 @@ stdenv.mkDerivation rec {
 # `-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'' ];
+  installPhase = ''
+    make PREFIX=/ DESTDIR=$out install
+    wrapProgram "$out/bin/surf" \
+      --prefix GIO_EXTRA_MODULES : ${glib_networking}/lib/gio/modules \
+      --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share"
+  '';
 
-  meta = { 
+  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";
diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix
index cb79bf592fe..4bb3ef9e64a 100644
--- a/pkgs/applications/misc/synergy/default.nix
+++ b/pkgs/applications/misc/synergy/default.nix
@@ -1,31 +1,30 @@
-{ stdenv, fetchurl, x11, xextproto, libXtst, inputproto, libXi
-, automake, autoconf, sourceFromHead }:
+{ stdenv, fetchurl, cmake, x11, libX11, libXi, libXtst }:
 
-stdenv.mkDerivation {
-  name = "synergy-cvs";
+stdenv.mkDerivation rec {
+  name = "synergy-1.4.10";
 
-  # note: There is a fork:
-  # http://code.google.com/p/synergy-plus
-
-  # REGION AUTO UPDATE:            { name="synergy"; type = "cvs"; cvsRoot = ":pserver:anonymous@synergy2.cvs.sourceforge.net:/cvsroot/synergy2"; module="syngery"; }
-  src= sourceFromHead "synergy-F_23-55-02.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/synergy-F_23-55-02.tar.gz"; sha256 = "ae16a9b59039a32e383e71397405d7b610de6c6902c03177c2496bac440d3e28"; });
-  # END
-
-  buildInputs = [ x11 xextproto libXtst inputproto libXi automake autoconf ];
+  src = fetchurl {
+  	url = "http://synergy.googlecode.com/files/${name}-Source.tar.gz";
+  	sha256 = "1ghgf96gbk4sdw8sqlc3pjschkmmqybihi12mg6hi26gnk7a5m86";
+  };
 
-  preConfigure = "autoreconf";
+  buildInputs = [ cmake x11 libX11 libXi libXtst ];
+  
+  # At this moment make install doesn't work for synergy
+  # http://synergy-foss.org/spit/issues/details/3317/
 
-  patches =
-    [ (fetchurl {
-        url = http://mawercer.de/~nix/synergy-gcc43-r2.patch.gz;
-        sha256 = "0wnj5k93ybj7jg8ml1i1brwsnszfh41117q2qh7r8xr9m37997b7";
-      })
-    ];
+  
+  installPhase = ''
+    ensureDir $out/bin
+    cp ../bin/synergyc $out/bin
+    cp ../bin/synergys $out/bin
+    cp ../bin/synergyd $out/bin
+  '';
 
   meta = { 
     description = "Tool to share the mouse keyboard and the clipboard between computers";
-    homepage = http://synergy2.sourceforge.net;
-    license = "GPL";
+    homepage = http://synergy-foss.org;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/misc/tangogps/default.nix b/pkgs/applications/misc/tangogps/default.nix
index 854ebb1a438..609849166d1 100644
--- a/pkgs/applications/misc/tangogps/default.nix
+++ b/pkgs/applications/misc/tangogps/default.nix
@@ -11,6 +11,12 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pkgconfig gettext gtk gconf curl libexif sqlite libxml2 ];
 
+  # bogus includes fail with newer library version
+  postPatch = ''
+    sed -i -e 's,#include <glib/.*>,#include <glib.h>,g' src/*.c
+    sed -i -e 's,#include <curl/.*>,#include <curl/curl.h>,g' src/*.c src/*.h
+  '';
+
   meta = {
     description = "tangoGPS, a user friendly map and GPS user interface";
 
@@ -30,7 +36,7 @@ stdenv.mkDerivation rec {
       conveniently pre-cache areas with tangoGPS.
     '';
 
-    homepage = http://www.tangogps.org/;
+    #homepage = http://www.tangogps.org/; # no longer valid, I couldn't find any other
 
     license = "GPLv2+";
   };
diff --git a/pkgs/applications/misc/taskjuggler/default.nix b/pkgs/applications/misc/taskjuggler/default.nix
index 652450e510b..b8edd93455d 100644
--- a/pkgs/applications/misc/taskjuggler/default.nix
+++ b/pkgs/applications/misc/taskjuggler/default.nix
@@ -1,7 +1,6 @@
 {stdenv, fetchurl,
 zlib, libpng, libjpeg, perl, expat, qt3,
 libX11, libXext, libSM, libICE,
-withKde, kdelibs, kdebase
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +12,6 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [zlib libpng libX11 libXext libSM libICE perl expat libjpeg]
-    ++ (if withKde then [kdelibs] else [])
     ;
 
   patches = [ ./timezone-glibc.patch ];
@@ -51,7 +49,6 @@ stdenv.mkDerivation rec {
     --x-includes=${libX11}/include
     --x-libraries=${libX11}/lib
     --with-qt-dir=${qt3}
-    --with-kde-support=${if withKde then "yes" else "no"} --with-ical-support=${if withKde then "yes" else "no"}
   ";
 
   preInstall = ''
@@ -61,7 +58,7 @@ stdenv.mkDerivation rec {
 
   installFlags =
     # kde_locale is not defined when installing without kde.
-    if withKde then "" else "kde_locale=\${out}/share/locale";
+    "kde_locale=\${out}/share/locale";
 
   meta = {
     homepage = "http://www.taskjuggler.org";
diff --git a/pkgs/applications/misc/taskwarrior/default.nix b/pkgs/applications/misc/taskwarrior/default.nix
index 95f9de2f42b..dc1fce1d64c 100644
--- a/pkgs/applications/misc/taskwarrior/default.nix
+++ b/pkgs/applications/misc/taskwarrior/default.nix
@@ -1,29 +1,23 @@
-{ stdenv, fetchurl, cmake, lua5 }:
+{stdenv, fetchurl, cmake}:
 
-stdenv.mkDerivation {
-  name = "task-warrior-2.0.0";
+stdenv.mkDerivation rec {
+  name = "taskwarrior-${version}";
+  version = "2.2.0";
 
-  src = fetchurl {
-    url = http://www.taskwarrior.org/download/task-2.0.0.tar.gz;
-    sha256 = "1gbmcynj2n2c9dcykxn27ffk034mvm0zri5hqhfdx593dhv1x5vq";
-  };
-
-  NIX_LDFLAGS = "-ldl";
-
-  buildNativeInputs = [ cmake ];
-  buildInputs = [ lua5 ];
+  enableParallelBuilding = true;
 
-  crossAttrs = {
-    preConfigure = ''
-      export NIX_CROSS_LDFLAGS="$NIX_CROSS_LDFLAGS -ldl"
-    '';
+  src = fetchurl {
+    url = "http://www.taskwarrior.org/download/task-${version}.tar.gz";
+    sha256 = "057fh50qp9bd5s08rw51iybpamn55v5nhn3s6ds89g76hp95vqir";
   };
 
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake ];
 
   meta = {
-    description = "Command-line todo list manager";
-    homepage = http://taskwarrior.org/;
-    license = "GPLv2+";
+    description = "GTD (getting things done) implementation";
+    homepage = http://taskwarrior.org;
+    license = stdenv.lib.licenses.mit;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/truecrypt/default.nix b/pkgs/applications/misc/truecrypt/default.nix
index 40a4f841266..19fa85b279c 100644
--- a/pkgs/applications/misc/truecrypt/default.nix
+++ b/pkgs/applications/misc/truecrypt/default.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ pkgconfig fuse devicemapper wxGTK nasm ]; 
-  makeFlags = if (wxGUI) then "" else "NOGUI=1";
+  makeFlags = if wxGUI then "" else "NOGUI=1";
 
   meta = {
     description = "Free Open-Source filesystem on-the-fly encryption";
diff --git a/pkgs/applications/misc/vanitygen/default.nix b/pkgs/applications/misc/vanitygen/default.nix
new file mode 100644
index 00000000000..1aa3f57ecca
--- /dev/null
+++ b/pkgs/applications/misc/vanitygen/default.nix
@@ -0,0 +1,38 @@
+{ fetchurl, stdenv, openssl, pcre }:
+
+stdenv.mkDerivation rec {
+  version = "0.21";
+  name = "vanitygen-${version}";
+
+  src = fetchurl {
+    name = "vanitygen-${version}.tar.gz";
+    url = "https://github.com/samr7/vanitygen/tarball/0.21";
+    sha256 = "1lj0gi08lg0pcby5pbpi08ysynzy24qa1n1065112shkpasi0kxv";
+  };
+
+  buildInputs = [ openssl pcre ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp vanitygen $out/bin
+    cp keyconv $out/bin/vanitygen-keyconv
+  '';
+
+  meta = {
+      description = "Bitcoin vanity address generator";
+      longDescription= ''
+        Vanitygen can search for exact prefixes or regular expression
+        matches, so you can generate Bitcoin addresses that starts
+        with the needed mnemonic.
+
+        Vanitygen can generate regular bitcoin addresses, namecoin
+        addresses, and testnet addresses.
+
+        When searching for exact prefixes, vanitygen will ensure that
+        the prefix is possible, will provide a difficulty estimate,
+        and will run about 30% faster.
+      '';
+      homepage = "https://github.com/samr7/vanitygen";
+      license = "AGPLv3";
+  };
+}
diff --git a/pkgs/applications/misc/wmname/default.nix b/pkgs/applications/misc/wmname/default.nix
new file mode 100644
index 00000000000..417d4a5ae68
--- /dev/null
+++ b/pkgs/applications/misc/wmname/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "wmname-0.1";
+
+  src = fetchurl {
+    url = "http://dl.suckless.org/tools/${name}.tar.gz";
+    sha256 = "559ad188b2913167dcbb37ecfbb7ed474a7ec4bbcb0129d8d5d08cb9208d02c5";
+  };
+
+  buildInputs = [ libX11 ];
+
+  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+
+  meta = {
+      description = "Prints or set the window manager name property of the root window";
+      homepage = "http://tools.suckless.org/wmname";
+      license = "MIT";
+  };
+}
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
new file mode 100644
index 00000000000..bd00d91e23d
--- /dev/null
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, fox, pkgconfig, gettext, x11, gcc, intltool, file, libpng }:
+
+stdenv.mkDerivation rec {
+  name = "xfe-1.34";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xfe/${name}.tar.gz";
+    sha256 = "0y6gi8vdvw1prz7dv7wadf7v8gl6g75jrlrl5jnsb71l1431ncay";
+  };
+
+  buildInputs = [ fox pkgconfig gettext x11 gcc intltool file libpng ];
+
+  preConfigure = ''
+    sed -i s,/usr/share/xfe,$out/share/xfe, src/xfedefs.h
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "X File Explorer (Xfe) is an MS-Explorer like file manager for X.";
+    longDescription = ''
+      X File Explorer (Xfe) is an MS-Explorer like file manager for X.
+      It is based on the popular, but discontinued, X Win Commander, which was developed by Maxim Baranov.
+      Xfe aims to be the filemanager of choice for all the Unix addicts!
+    '';
+    homepage = "http://sourceforge.net/projects/xfe/";
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/misc/xmobar/add-freeration-variable.patch b/pkgs/applications/misc/xmobar/add-freeration-variable.patch
new file mode 100644
index 00000000000..a8c10e1a30d
--- /dev/null
+++ b/pkgs/applications/misc/xmobar/add-freeration-variable.patch
@@ -0,0 +1,58 @@
+diff --git a/readme.md b/readme.md
+index f4f07e8..de679c7 100644
+--- a/readme.md
++++ b/readme.md
+@@ -645,7 +645,7 @@ something like:
+ - Args: default monitor arguments
+ - Variables that can be used with the `-t`/`--template` argument:
+              `total`, `free`, `buffer`, `cache`, `rest`, `used`,
+-             `usedratio`, `usedbar`, `freebar`
++             `usedratio`, `usedbar`, `freeratio`, `freebar`
+ - Default template: `Mem: <usedratio>% (<cache>M)`
+ 
+ ### `Swap Args RefreshRate`
+diff --git a/src/Plugins/Monitors/Mem.hs b/src/Plugins/Monitors/Mem.hs
+index 5c55ee2..3cf46c7 100644
+--- a/src/Plugins/Monitors/Mem.hs
++++ b/src/Plugins/Monitors/Mem.hs
+@@ -19,8 +19,8 @@ import Plugins.Monitors.Common
+ memConfig :: IO MConfig
+ memConfig = mkMConfig
+        "Mem: <usedratio>% (<cache>M)" -- template
+-       ["usedbar", "freebar", "usedratio", "total",
+-        "free", "buffer", "cache", "rest", "used"]  -- available replacements
++       ["usedbar", "freebar", "usedratio", "freeratio", "total",
++        "free", "buffer", "cache", "rest", "used"] -- available replacements
+ 
+ fileMEM :: IO String
+ fileMEM = readFile "/proc/meminfo"
+@@ -33,7 +33,8 @@ parseMEM =
+            rest = free + buffer + cache
+            used = total - rest
+            usedratio = used / total
+-       return [usedratio, total, free, buffer, cache, rest, used]
++           freeratio = free / total
++       return [usedratio, freeratio, total, free, buffer, cache, rest, used, freeratio]
+ 
+ totalMem :: IO Float
+ totalMem = fmap ((*1024) . (!!1)) parseMEM
+@@ -42,15 +43,16 @@ usedMem :: IO Float
+ usedMem = fmap ((*1024) . (!!6)) parseMEM
+ 
+ formatMem :: [Float] -> Monitor [String]
+-formatMem (r:xs) =
++formatMem (r:fr:xs) =
+     do let f = showDigits 0
+            rr = 100 * r
+        ub <- showPercentBar rr r
+        fb <- showPercentBar (100 - rr) (1 - r)
+        rs <- showPercentWithColors r
++       fs <- showPercentWithColors fr
+        s <- mapM (showWithColors f) xs
+-       return (ub:fb:rs:s)
+-formatMem _ = return $ replicate 9 "N/A"
++       return (ub:fb:rs:fs:s)
++formatMem _ = return $ replicate 10 "N/A"
+ 
+ runMem :: [String] -> Monitor String
+ runMem _ =
diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix
index 73eefef2505..db2b9eb94e3 100644
--- a/pkgs/applications/misc/xmobar/default.nix
+++ b/pkgs/applications/misc/xmobar/default.nix
@@ -1,21 +1,18 @@
-{ cabal, filepath, libXrandr, mtl, parsec, stm, time, utf8String
-, wirelesstools, X11, X11Xft
+{ cabal, filepath, libXrandr, mtl, parsec, regexCompat, stm, time
+, utf8String, wirelesstools, X11, X11Xft
 }:
 
 cabal.mkDerivation (self: {
   pname = "xmobar";
-  version = "0.15";
-  sha256 = "1wa141bf3krzr8qcd9cyix3cflbw1yr1l3299ashjs7skqnjadcl";
+  version = "0.18";
+  sha256 = "08kk0yjx51vjrvvvd34hv8v80dsh8kjv150qf413ikaff0i28v7w";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    filepath mtl parsec stm time utf8String X11 X11Xft
+    filepath mtl parsec regexCompat stm time utf8String X11 X11Xft
   ];
   extraLibraries = [ libXrandr wirelesstools ];
   configureFlags = "-fwith_xft -fwith_iwlib";
-  patchPhase = ''
-    sed -i -e 's|mtl ==.*$|mtl,|' xmobar.cabal
-  '';
   meta = {
     homepage = "http://projects.haskell.org/xmobar/";
     description = "A Minimalistic Text Based Status Bar";
diff --git a/pkgs/applications/misc/xpdf/xpdf-3.01pl2.patch b/pkgs/applications/misc/xpdf/xpdf-3.01pl2.patch
deleted file mode 100644
index 3ea3cb8c923..00000000000
--- a/pkgs/applications/misc/xpdf/xpdf-3.01pl2.patch
+++ /dev/null
@@ -1,471 +0,0 @@
-diff -cr xpdf-3.01.orig/goo/gmem.c xpdf-3.01/goo/gmem.c
-*** xpdf-3.01.orig/goo/gmem.c	Tue Aug 16 22:34:30 2005
---- xpdf-3.01/goo/gmem.c	Tue Jan 17 17:03:57 2006
-***************
-*** 11,16 ****
---- 11,17 ----
-  #include <stdlib.h>
-  #include <stddef.h>
-  #include <string.h>
-+ #include <limits.h>
-  #include "gmem.h"
-  
-  #ifdef DEBUG_MEM
-***************
-*** 63,69 ****
-    int lst;
-    unsigned long *trl, *p;
-  
-!   if (size == 0)
-      return NULL;
-    size1 = gMemDataSize(size);
-    if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
---- 64,70 ----
-    int lst;
-    unsigned long *trl, *p;
-  
-!   if (size <= 0)
-      return NULL;
-    size1 = gMemDataSize(size);
-    if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
-***************
-*** 86,92 ****
-  #else
-    void *p;
-  
-!   if (size == 0)
-      return NULL;
-    if (!(p = malloc(size))) {
-      fprintf(stderr, "Out of memory\n");
---- 87,93 ----
-  #else
-    void *p;
-  
-!   if (size <= 0)
-      return NULL;
-    if (!(p = malloc(size))) {
-      fprintf(stderr, "Out of memory\n");
-***************
-*** 102,108 ****
-    void *q;
-    int oldSize;
-  
-!   if (size == 0) {
-      if (p)
-        gfree(p);
-      return NULL;
---- 103,109 ----
-    void *q;
-    int oldSize;
-  
-!   if (size <= 0) {
-      if (p)
-        gfree(p);
-      return NULL;
-***************
-*** 120,126 ****
-  #else
-    void *q;
-  
-!   if (size == 0) {
-      if (p)
-        free(p);
-      return NULL;
---- 121,127 ----
-  #else
-    void *q;
-  
-!   if (size <= 0) {
-      if (p)
-        free(p);
-      return NULL;
-***************
-*** 140,147 ****
-  void *gmallocn(int nObjs, int objSize) {
-    int n;
-  
-    n = nObjs * objSize;
-!   if (objSize == 0 || n / objSize != nObjs) {
-      fprintf(stderr, "Bogus memory allocation size\n");
-      exit(1);
-    }
---- 141,151 ----
-  void *gmallocn(int nObjs, int objSize) {
-    int n;
-  
-+   if (nObjs == 0) {
-+     return NULL;
-+   }
-    n = nObjs * objSize;
-!   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
-      fprintf(stderr, "Bogus memory allocation size\n");
-      exit(1);
-    }
-***************
-*** 151,158 ****
-  void *greallocn(void *p, int nObjs, int objSize) {
-    int n;
-  
-    n = nObjs * objSize;
-!   if (objSize == 0 || n / objSize != nObjs) {
-      fprintf(stderr, "Bogus memory allocation size\n");
-      exit(1);
-    }
---- 155,168 ----
-  void *greallocn(void *p, int nObjs, int objSize) {
-    int n;
-  
-+   if (nObjs == 0) {
-+     if (p) {
-+       gfree(p);
-+     }
-+     return NULL;
-+   }
-    n = nObjs * objSize;
-!   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
-      fprintf(stderr, "Bogus memory allocation size\n");
-      exit(1);
-    }
-diff -cr xpdf-3.01.orig/xpdf/JBIG2Stream.cc xpdf-3.01/xpdf/JBIG2Stream.cc
-*** xpdf-3.01.orig/xpdf/JBIG2Stream.cc	Tue Aug 16 22:34:31 2005
---- xpdf-3.01/xpdf/JBIG2Stream.cc	Tue Jan 17 17:29:46 2006
-***************
-*** 13,18 ****
---- 13,19 ----
-  #endif
-  
-  #include <stdlib.h>
-+ #include <limits.h>
-  #include "GList.h"
-  #include "Error.h"
-  #include "JArithmeticDecoder.h"
-***************
-*** 681,686 ****
---- 682,691 ----
-    w = wA;
-    h = hA;
-    line = (wA + 7) >> 3;
-+   if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
-+     data = NULL;
-+     return;
-+   }
-    // need to allocate one extra guard byte for use in combine()
-    data = (Guchar *)gmalloc(h * line + 1);
-    data[h * line] = 0;
-***************
-*** 692,697 ****
---- 697,706 ----
-    w = bitmap->w;
-    h = bitmap->h;
-    line = bitmap->line;
-+   if (w <= 0 || h <= 0 || line <= 0 || h >= (INT_MAX - 1) / line) {
-+     data = NULL;
-+     return;
-+   }
-    // need to allocate one extra guard byte for use in combine()
-    data = (Guchar *)gmalloc(h * line + 1);
-    memcpy(data, bitmap->data, h * line);
-***************
-*** 720,726 ****
-  }
-  
-  void JBIG2Bitmap::expand(int newH, Guint pixel) {
-!   if (newH <= h) {
-      return;
-    }
-    // need to allocate one extra guard byte for use in combine()
---- 729,735 ----
-  }
-  
-  void JBIG2Bitmap::expand(int newH, Guint pixel) {
-!   if (newH <= h || line <= 0 || newH >= (INT_MAX - 1) / line) {
-      return;
-    }
-    // need to allocate one extra guard byte for use in combine()
-***************
-*** 2294,2299 ****
---- 2303,2316 ----
-        !readUWord(&stepX) || !readUWord(&stepY)) {
-      goto eofError;
-    }
-+   if (w == 0 || h == 0 || w >= INT_MAX / h) {
-+     error(getPos(), "Bad bitmap size in JBIG2 halftone segment");
-+     return;
-+   }
-+   if (gridH == 0 || gridW >= INT_MAX / gridH) {
-+     error(getPos(), "Bad grid size in JBIG2 halftone segment");
-+     return;
-+   }
-  
-    // get pattern dictionary
-    if (nRefSegs != 1) {
-diff -cr xpdf-3.01.orig/xpdf/JPXStream.cc xpdf-3.01/xpdf/JPXStream.cc
-*** xpdf-3.01.orig/xpdf/JPXStream.cc	Tue Aug 16 22:34:31 2005
---- xpdf-3.01/xpdf/JPXStream.cc	Tue Jan 17 17:14:06 2006
-***************
-*** 12,17 ****
---- 12,18 ----
-  #pragma implementation
-  #endif
-  
-+ #include <limits.h>
-  #include "gmem.h"
-  #include "Error.h"
-  #include "JArithmeticDecoder.h"
-***************
-*** 818,823 ****
---- 819,830 ----
-  	            / img.xTileSize;
-        img.nYTiles = (img.ySize - img.yTileOffset + img.yTileSize - 1)
-  	            / img.yTileSize;
-+       // check for overflow before allocating memory
-+       if (img.nXTiles <= 0 || img.nYTiles <= 0 ||
-+ 	  img.nXTiles >= INT_MAX / img.nYTiles) {
-+ 	error(getPos(), "Bad tile count in JPX SIZ marker segment");
-+ 	return gFalse;
-+       }
-        img.tiles = (JPXTile *)gmallocn(img.nXTiles * img.nYTiles,
-  				      sizeof(JPXTile));
-        for (i = 0; i < img.nXTiles * img.nYTiles; ++i) {
-diff -cr xpdf-3.01.orig/xpdf/Stream.cc xpdf-3.01/xpdf/Stream.cc
-*** xpdf-3.01.orig/xpdf/Stream.cc	Tue Aug 16 22:34:31 2005
---- xpdf-3.01/xpdf/Stream.cc	Tue Jan 17 17:31:52 2006
-***************
-*** 15,20 ****
---- 15,21 ----
-  #include <stdio.h>
-  #include <stdlib.h>
-  #include <stddef.h>
-+ #include <limits.h>
-  #ifndef WIN32
-  #include <unistd.h>
-  #endif
-***************
-*** 406,418 ****
---- 407,432 ----
-    width = widthA;
-    nComps = nCompsA;
-    nBits = nBitsA;
-+   predLine = NULL;
-+   ok = gFalse;
-  
-    nVals = width * nComps;
-+   if (width <= 0 || nComps <= 0 || nBits <= 0 ||
-+       nComps >= INT_MAX / nBits ||
-+       width >= INT_MAX / nComps / nBits ||
-+       nVals * nBits + 7 < 0) {
-+     return;
-+   }
-    pixBytes = (nComps * nBits + 7) >> 3;
-    rowBytes = ((nVals * nBits + 7) >> 3) + pixBytes;
-+   if (rowBytes <= 0) {
-+     return;
-+   }
-    predLine = (Guchar *)gmalloc(rowBytes);
-    memset(predLine, 0, rowBytes);
-    predIdx = rowBytes;
-+ 
-+   ok = gTrue;
-  }
-  
-  StreamPredictor::~StreamPredictor() {
-***************
-*** 1004,1009 ****
---- 1018,1027 ----
-      FilterStream(strA) {
-    if (predictor != 1) {
-      pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+     if (!pred->isOk()) {
-+       delete pred;
-+       pred = NULL;
-+     }
-    } else {
-      pred = NULL;
-    }
-***************
-*** 1259,1264 ****
---- 1277,1285 ----
-    if (columns < 1) {
-      columns = 1;
-    }
-+   if (columns + 4 <= 0) {
-+     columns = INT_MAX - 4;
-+   }
-    rows = rowsA;
-    endOfBlock = endOfBlockA;
-    black = blackA;
-***************
-*** 2899,2904 ****
---- 2920,2930 ----
-    height = read16();
-    width = read16();
-    numComps = str->getChar();
-+   if (numComps <= 0 || numComps > 4) {
-+     error(getPos(), "Bad number of components in DCT stream");
-+     numComps = 0;
-+     return gFalse;
-+   }
-    if (prec != 8) {
-      error(getPos(), "Bad DCT precision %d", prec);
-      return gFalse;
-***************
-*** 2925,2930 ****
---- 2951,2961 ----
-    height = read16();
-    width = read16();
-    numComps = str->getChar();
-+   if (numComps <= 0 || numComps > 4) {
-+     error(getPos(), "Bad number of components in DCT stream");
-+     numComps = 0;
-+     return gFalse;
-+   }
-    if (prec != 8) {
-      error(getPos(), "Bad DCT precision %d", prec);
-      return gFalse;
-***************
-*** 2947,2952 ****
---- 2978,2988 ----
-  
-    length = read16() - 2;
-    scanInfo.numComps = str->getChar();
-+   if (scanInfo.numComps <= 0 || scanInfo.numComps > 4) {
-+     error(getPos(), "Bad number of components in DCT stream");
-+     scanInfo.numComps = 0;
-+     return gFalse;
-+   }
-    --length;
-    if (length != 2 * scanInfo.numComps + 3) {
-      error(getPos(), "Bad DCT scan info block");
-***************
-*** 3041,3046 ****
---- 3077,3083 ----
-  	numACHuffTables = index+1;
-        tbl = &acHuffTables[index];
-      } else {
-+       index &= 0x0f;
-        if (index >= numDCHuffTables)
-  	numDCHuffTables = index+1;
-        tbl = &dcHuffTables[index];
-***************
-*** 3827,3832 ****
---- 3864,3873 ----
-      FilterStream(strA) {
-    if (predictor != 1) {
-      pred = new StreamPredictor(this, predictor, columns, colors, bits);
-+     if (!pred->isOk()) {
-+       delete pred;
-+       pred = NULL;
-+     }
-    } else {
-      pred = NULL;
-    }
-diff -cr xpdf-3.01.orig/xpdf/Stream.h xpdf-3.01/xpdf/Stream.h
-*** xpdf-3.01.orig/xpdf/Stream.h	Tue Aug 16 22:34:31 2005
---- xpdf-3.01/xpdf/Stream.h	Tue Jan 17 17:19:54 2006
-***************
-*** 232,237 ****
---- 232,239 ----
-  
-    ~StreamPredictor();
-  
-+   GBool isOk() { return ok; }
-+ 
-    int lookChar();
-    int getChar();
-  
-***************
-*** 249,254 ****
---- 251,257 ----
-    int rowBytes;			// bytes per line
-    Guchar *predLine;		// line buffer
-    int predIdx;			// current index in predLine
-+   GBool ok;
-  };
-  
-  //------------------------------------------------------------------------
-***************
-*** 527,533 ****
-    short getWhiteCode();
-    short getBlackCode();
-    short lookBits(int n);
-!   void eatBits(int n) { inputBits -= n; }
-  };
-  
-  //------------------------------------------------------------------------
---- 530,536 ----
-    short getWhiteCode();
-    short getBlackCode();
-    short lookBits(int n);
-!   void eatBits(int n) { if ((inputBits -= n) < 0) inputBits = 0; }
-  };
-  
-  //------------------------------------------------------------------------
-diff -cr xpdf-3.01.orig/splash/SplashXPathScanner.cc xpdf-3.01/splash/SplashXPathScanner.cc
-*** xpdf-3.01.orig/splash/SplashXPathScanner.cc	Tue Aug 16 22:34:31 2005
---- xpdf-3.01/splash/SplashXPathScanner.cc	Wed Feb  1 17:01:14 2006
-***************
-*** 186,192 ****
-  }
-  
-  void SplashXPathScanner::computeIntersections(int y) {
-!   SplashCoord ySegMin, ySegMax, xx0, xx1;
-    SplashXPathSeg *seg;
-    int i, j;
-  
---- 186,192 ----
-  }
-  
-  void SplashXPathScanner::computeIntersections(int y) {
-!   SplashCoord xSegMin, xSegMax, ySegMin, ySegMax, xx0, xx1;
-    SplashXPathSeg *seg;
-    int i, j;
-  
-***************
-*** 236,254 ****
-      } else if (seg->flags & splashXPathVert) {
-        xx0 = xx1 = seg->x0;
-      } else {
-!       if (ySegMin <= y) {
-! 	// intersection with top edge
-! 	xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
-        } else {
-! 	// x coord of segment endpoint with min y coord
-! 	xx0 = (seg->flags & splashXPathFlip) ? seg->x1 : seg->x0;
-        }
-!       if (ySegMax >= y + 1) {
-! 	// intersection with bottom edge
-! 	xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
-!       } else {
-! 	// x coord of segment endpoint with max y coord
-! 	xx1 = (seg->flags & splashXPathFlip) ? seg->x0 : seg->x1;
-        }
-      }
-      if (xx0 < xx1) {
---- 236,262 ----
-      } else if (seg->flags & splashXPathVert) {
-        xx0 = xx1 = seg->x0;
-      } else {
-!       if (seg->x0 < seg->x1) {
-! 	xSegMin = seg->x0;
-! 	xSegMax = seg->x1;
-        } else {
-! 	xSegMin = seg->x1;
-! 	xSegMax = seg->x0;
-        }
-!       // intersection with top edge
-!       xx0 = seg->x0 + ((SplashCoord)y - seg->y0) * seg->dxdy;
-!       // intersection with bottom edge
-!       xx1 = seg->x0 + ((SplashCoord)y + 1 - seg->y0) * seg->dxdy;
-!       // the segment may not actually extend to the top and/or bottom edges
-!       if (xx0 < xSegMin) {
-! 	xx0 = xSegMin;
-!       } else if (xx0 > xSegMax) {
-! 	xx0 = xSegMax;
-!       }
-!       if (xx1 < xSegMin) {
-! 	xx1 = xSegMin;
-!       } else if (xx1 > xSegMax) {
-! 	xx1 = xSegMax;
-        }
-      }
-      if (xx0 < xx1) {
diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix
index b4fab591ef4..ef2d846dd2e 100644
--- a/pkgs/applications/misc/xterm/default.nix
+++ b/pkgs/applications/misc/xterm/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, xorg, ncurses, freetype, pkgconfig }:
+{ stdenv, fetchurl, xorg, ncurses, freetype, fontconfig, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "xterm-276";
-  
+  name = "xterm-281";
+
   src = fetchurl {
     url = "ftp://invisible-island.net/xterm/${name}.tgz";
-    sha256 = "1k3k025z3vl91sc8i7f5lmnsb1rsblpbijri9vnxgpynw4wgrc7b";
+    sha256 = "1yrjjya7z5s3fi0iiaxgna35jh0ib2zx1yafyng35jma6qbwhxx7";
   };
-  
+
   buildInputs =
     [ xorg.libXaw xorg.xproto xorg.libXt xorg.libXext xorg.libX11 xorg.libSM xorg.libICE
-      ncurses freetype pkgconfig xorg.libXft xorg.luit
+      ncurses freetype fontconfig pkgconfig xorg.libXft xorg.luit
     ];
-    
+
   configureFlags =
     ''
       --enable-wide-chars --enable-256-color
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     '';
 
   # Work around broken "plink.sh".
-  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11";
+  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig";
 
   # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp',
   # decided by the sysadmin to allow the xterm reporting to /var/run/utmp
diff --git a/pkgs/applications/misc/yakuake/default.nix b/pkgs/applications/misc/yakuake/default.nix
index e06f812a18a..c781a5619ae 100644
--- a/pkgs/applications/misc/yakuake/default.nix
+++ b/pkgs/applications/misc/yakuake/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     homepage = http://yakuake.kde.org;
diff --git a/pkgs/applications/misc/yate/default.nix b/pkgs/applications/misc/yate/default.nix
index b2f4217afb5..e65faeac6c2 100644
--- a/pkgs/applications/misc/yate/default.nix
+++ b/pkgs/applications/misc/yate/default.nix
@@ -3,7 +3,7 @@
 let inherit (composableDerivation) edf wwf; in
 
 composableDerivation.composableDerivation {} ( fixed : {
-  name = "yate2";
+  name = "yate-2.2.0_1";
 
   src = fetchurl {
     url = http://yate.null.ro/tarballs/yate2/yate2.tar.gz;
diff --git a/pkgs/applications/misc/yeganesh/default.nix b/pkgs/applications/misc/yeganesh/default.nix
new file mode 100644
index 00000000000..36a5817772d
--- /dev/null
+++ b/pkgs/applications/misc/yeganesh/default.nix
@@ -0,0 +1,16 @@
+{ cabal, filepath, strict, time, xdgBasedir }:
+
+cabal.mkDerivation (self: {
+  pname = "yeganesh";
+  version = "2.5";
+  sha256 = "1bgw5v1g5n06jj0lyxpf48mdpaa2s49g0lbagf3jf9q01rb92bvf";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ filepath strict time xdgBasedir ];
+  meta = {
+    homepage = "http://dmwit.com/yeganesh";
+    description = "small dmenu wrapper";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/misc/zathura/builder.sh b/pkgs/applications/misc/zathura/builder.sh
new file mode 100644
index 00000000000..149481367b4
--- /dev/null
+++ b/pkgs/applications/misc/zathura/builder.sh
@@ -0,0 +1,21 @@
+source $stdenv/setup
+
+mkdir -pv $out/bin/
+mkdir -pv $out/share/
+mkdir -pv $out/share/applications/
+mkdir -pv $out/share/pixmaps/
+
+cat > $out/bin/zathura <<EOF
+#!/bin/sh
+exec $zathura_core/bin/zathura --plugins-dir=$plugins_path "\$@"
+EOF
+
+cp -rv $zathura_core/share/man $out/share
+cp -rv $zathura_core/share/locale $out/share
+cp -rv $icon $out/share/pixmaps/pwmt.xpm
+
+cat $zathura_core/share/applications/zathura.desktop > $out/share/applications/zathura.desktop
+echo "Icon=pwmt" >> $out/share/applications/zathura.desktop
+
+chmod 755 $out/bin/zathura
+
diff --git a/pkgs/applications/misc/zathura/core/default.nix b/pkgs/applications/misc/zathura/core/default.nix
new file mode 100644
index 00000000000..e5eae771d8b
--- /dev/null
+++ b/pkgs/applications/misc/zathura/core/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, pkgconfig, gtk, girara, gettext, docutils, file, makeWrapper }:
+
+stdenv.mkDerivation rec {
+
+  version = "0.2.2";
+
+  name = "zathura-core-${version}";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/download/zathura-${version}.tar.gz";
+    sha256 = "1ja2j9ygymr259fxf02j1vkvalypac48gpadq8fn3qbclxxj61k5";
+  };
+
+  buildInputs = [ pkgconfig gtk girara gettext makeWrapper ];
+
+  # Bug in zathura build system: we should remove empty manfiles in order them
+  # to be compiled properly
+  preBuild = ''
+    rm zathura.1
+    rm zathurarc.5
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" "RSTTOMAN=${docutils}/bin/rst2man.py" "VERBOSE=1" ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/zathura" --prefix PATH ":" "${file}/bin"
+  '';
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A core component for zathura PDF viewer";
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+
+    # Set lower priority in order to provide user with a wrapper script called
+    # 'zathura' instead of real zathura executable. The wrapper will build
+    # plugin path argument before executing the original.
+    priority = 1;
+  };
+}
diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix
index 2e58a028a30..8bdc7865832 100644
--- a/pkgs/applications/misc/zathura/default.nix
+++ b/pkgs/applications/misc/zathura/default.nix
@@ -1,27 +1,45 @@
-{ stdenv, fetchurl, pkgconfig, gtk, poppler }:
-
-stdenv.mkDerivation rec {
-  name = "zathura-0.0.8.4";
-  
-  src = fetchurl {
-    url = "http://pwmt.org/download/${name}.tar.gz";
-    sha256 = "03iq6n7bpgrkq3l8b2ab3flcfxrqpxc1f3ycn31xr2b6bjwi72qn";
-  };
-  
-  buildInputs = [ pkgconfig gtk poppler ];
-
-  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
-      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 = stdenv.lib.platforms.linux;
+{ callPackage, pkgs, fetchurl }:
+
+rec {
+  inherit (pkgs) stdenv;
+
+  zathura_core = callPackage ./core { };
+
+  zathura_pdf_poppler = callPackage ./pdf-poppler { };
+
+  zathura_djvu = callPackage ./djvu { };
+
+  zathura_ps = callPackage ./ps { };
+
+  zathuraWrapper = stdenv.mkDerivation {
+
+    inherit zathura_core;
+
+    name = "zathura-${zathura_core.version}";
+
+    plugins_path = stdenv.lib.makeSearchPath "lib" [
+      zathura_pdf_poppler
+      zathura_djvu
+      zathura_ps
+    ];
+
+    icon = ./icon.xpm;
+
+    builder = ./builder.sh;
+
+    meta = {
+      homepage = http://pwmt.org/projects/zathura/;
+      description = "A highly customizable and functional PDF viewer";
+      longDescription = ''
+        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 = stdenv.lib.licenses.zlib;
+      platforms = stdenv.lib.platforms.linux;
+      maintainers = [ stdenv.lib.maintainers.garbas stdenv.lib.maintainers.smironov ];
+    };
   };
 }
+
diff --git a/pkgs/applications/misc/zathura/djvu/default.nix b/pkgs/applications/misc/zathura/djvu/default.nix
new file mode 100644
index 00000000000..9486acfef65
--- /dev/null
+++ b/pkgs/applications/misc/zathura/djvu/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, djvulibre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-djvu-0.2.1";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "d8bb3c9e30244a0733e49740ee2dd099ce39fa16f2c320af27a0c09d9a25bcc3";
+  };
+
+  buildInputs = [ pkgconfig djvulibre gettext zathura_core gtk girara ];
+
+  patches = [ ./gtkflags.patch ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura DJVU plugin";
+    longDescription = ''
+	  The zathura-djvu plugin adds DjVu support to zathura by using the
+	  djvulibre library.
+    '';
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+  };
+}
+
diff --git a/pkgs/applications/misc/zathura/djvu/gtkflags.patch b/pkgs/applications/misc/zathura/djvu/gtkflags.patch
new file mode 100644
index 00000000000..2a2fe298a7b
--- /dev/null
+++ b/pkgs/applications/misc/zathura/djvu/gtkflags.patch
@@ -0,0 +1,23 @@
+--- a/config.mk	2012-05-14 01:13:09.009740082 +0400
++++ b/config.mk	2012-05-14 01:13:50.400525700 +0400
+@@ -11,6 +11,9 @@
+ LIBDIR ?= ${PREFIX}/lib
+ 
+ # libs
++GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
++GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0)
++
+ CAIRO_INC ?= $(shell pkg-config --cflags cairo)
+ CAIRO_LIB ?= $(shell pkg-config --libs cairo)
+ 
+@@ -29,8 +32,8 @@
+ PLUGINDIR = ${LIBDIR}/zathura
+ endif
+ 
+-INCS = ${GIRARA_INC} ${GLIB_INC} ${DJVU_INC} ${ZATHURA_INC}
+-LIBS = ${GIRARA_LIB} ${GLIB_LIB} ${DJVU_LIB}
++INCS = ${GIRARA_INC} ${GLIB_INC} ${DJVU_INC} ${ZATHURA_INC} ${GTK_INC}
++LIBS = ${GIRARA_LIB} ${GLIB_LIB} ${DJVU_LIB} ${GTK_LIB}
+ 
+ # flags
+ CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
diff --git a/pkgs/applications/misc/zathura/icon.xpm b/pkgs/applications/misc/zathura/icon.xpm
new file mode 100644
index 00000000000..a863c5ddb09
--- /dev/null
+++ b/pkgs/applications/misc/zathura/icon.xpm
@@ -0,0 +1,120 @@
+/* XPM */
+static char *freeimage[] = {
+/* width height num_colors chars_per_pixel */
+"16 16 96 2",
+/* colors */
+"   c #1e1e1e",
+" . c #222222",
+" X c #212121",
+" o c #535353",
+" O c #a4a4a4",
+" + c #202020",
+" @ c #252525",
+" # c #3c3c3c",
+" $ c #292929",
+" % c #979797",
+" & c #cccccc",
+" * c #303030",
+" = c #1f1f1f",
+" - c #494949",
+" ; c #dddddd",
+" : c #696969",
+" > c #232323",
+" , c #262626",
+" < c #adadad",
+" 1 c #bbbbbb",
+" 2 c #1d1d1d",
+" 3 c #1c1c1c",
+" 4 c #5e5e5e",
+" 5 c #e8e8e8",
+" 6 c #9c9c9c",
+" 7 c #242424",
+" 8 c #b1b1b1",
+" 9 c #b3b3b3",
+" 0 c #090909",
+" q c #161616",
+" w c #131313",
+" e c #4d4d4d",
+" r c #dedede",
+" t c #afafaf",
+" y c #282828",
+" u c #393939",
+" i c #c4c4c4",
+" p c #dcdcdc",
+" a c #9a9a9a",
+" s c #a2a2a2",
+" d c #ababab",
+" f c #313131",
+" g c #a7a7a7",
+" h c #e4e4e4",
+" j c #f2f2f2",
+" k c #eaeaea",
+" l c #e2e2e2",
+" z c #f0f0f0",
+" x c #d5d5d5",
+" c c #737373",
+" v c #323232",
+" b c #808080",
+" n c #7a7a7a",
+" m c #d3d3d3",
+" M c #e5e5e5",
+" N c #8a8a8a",
+" B c #cbcbcb",
+" V c #b5b5b5",
+" C c #b9b9b9",
+" Z c #272727",
+" A c #b4b4b4",
+" S c #bababa",
+" D c #2d2d2d",
+" F c #414141",
+" G c #444444",
+" H c #f4f4f4",
+" J c #838383",
+" K c #cfcfcf",
+" L c #fafafa",
+" P c #efefef",
+" I c #e3e3e3",
+" U c #8d8d8d",
+" Y c #656565",
+" T c #ffffff",
+" R c #fbfbfb",
+" E c #e9e9e9",
+" W c #bdbdbd",
+" Q c #e1e1e1",
+" ! c #dfdfdf",
+" ~ c #646464",
+" ^ c #3a3a3a",
+" / c #a1a1a1",
+" ( c #999999",
+" ) c #c0c0c0",
+" _ c #3b3b3b",
+" ` c #acacac",
+" ' c #050505",
+" ] c #151515",
+" [ c #1b1b1b",
+" { c #1a1a1a",
+" } c #b2b2b2",
+" | c #a5a5a5",
+".  c #c5c5c5",
+".. c #a6a6a6",
+".X c #bfbfbf",
+".o c #747474",
+/* pixels */
+"                                ",
+"   . . . X X X X . o O + X . .  ",
+"   . . X @ # $ . @ % & * = . .  ",
+"   . .   - ; : > , < 1 2 X . .  ",
+"   . . 3 4 5 6 7 7 8 9 0 q q 3  ",
+"   . + w e r t y u i p a s d 4  ",
+"   X f g h j k p l z z x g c v  ",
+"   X f b n m M N c B V 3 , > X  ",
+"   X X   w V C $ Z A S + $ , .  ",
+"   D F G u S H 1 J K L P I U @  ",
+"   Y T T T R E & W Q ! d g ~ 7  ",
+"   ^ / 6 ( ; ) _ 2 ` 8 ' ] [ X  ",
+"   + > 7 { A } 7 @ |.  $ + . .  ",
+"   X X X ].. 8 Z 7 n.X + X . .  ",
+"   . . . { n.o 7 . @ y X X . .  ",
+"                                "
+};
+
diff --git a/pkgs/applications/misc/zathura/pdf-poppler/default.nix b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
new file mode 100644
index 00000000000..faf4e49b968
--- /dev/null
+++ b/pkgs/applications/misc/zathura/pdf-poppler/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, zathura_core, girara, poppler, gettext }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.2";
+  name = "zathura-pdf-poppler-${version}";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "0px59f0bnmb9992n3c9iyzcwd6w7vg8ga069vc8qj4726ljml4c7";
+  };
+
+  buildInputs = [ pkgconfig poppler gettext zathura_core girara ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura PDF plugin";
+    longDescription = ''
+      The zathura-pdf-poppler plugin adds PDF support to zathura by 
+      using the poppler rendering engine.
+    '';
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+  };
+}
diff --git a/pkgs/applications/misc/zathura/ps/default.nix b/pkgs/applications/misc/zathura/ps/default.nix
new file mode 100644
index 00000000000..7c0dd552a66
--- /dev/null
+++ b/pkgs/applications/misc/zathura/ps/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, pkgconfig, gtk, zathura_core, girara, libspectre, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "zathura-ps-0.2.0";
+
+  src = fetchurl {
+    url = "http://pwmt.org/projects/zathura/plugins/download/${name}.tar.gz";
+    sha256 = "717eda01213b162421b6b52f29d6b981edc302fddf351ccb2c093b6842751414";
+  };
+
+  buildInputs = [ pkgconfig libspectre gettext zathura_core gtk girara ];
+
+  patches = [ ./gtkflags.patch ];
+
+  makeFlags = "PREFIX=$(out) PLUGINDIR=$(out)/lib";
+
+  meta = {
+    homepage = http://pwmt.org/projects/zathura/;
+    description = "A zathura PS plugin";
+    longDescription = ''
+      The zathura-ps plugin adds PS support to zathura by using the
+      libspectre library.
+      '';
+    license = stdenv.lib.licenses.zlib;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+  };
+}
+
diff --git a/pkgs/applications/misc/zathura/ps/gtkflags.patch b/pkgs/applications/misc/zathura/ps/gtkflags.patch
new file mode 100644
index 00000000000..7c944a12f0e
--- /dev/null
+++ b/pkgs/applications/misc/zathura/ps/gtkflags.patch
@@ -0,0 +1,25 @@
+diff --git a/config.mk b/config.mk.new
+index c3a7b37..0cbce67 100644
+--- a/config.mk
++++ b/config.mk
+@@ -10,6 +10,9 @@ ZATHURA_VERSION_CHECK ?= $(shell pkg-config --atleast-version=$(ZATHURA_MIN_VERS
+ PREFIX ?= /usr
+ 
+ # libs
++GTK_INC ?= $(shell pkg-config --cflags gtk+-2.0)
++GTK_LIB ?= $(shell pkg-config --libs gtk+-2.0)
++
+ CAIRO_INC ?= $(shell pkg-config --cflags cairo)
+ CAIRO_LIB ?= $(shell pkg-config --libs cairo)
+ 
+@@ -26,8 +29,8 @@ ZATHURA_INC ?= $(shell pkg-config --cflags zathura)
+ PLUGINDIR ?= $(shell pkg-config --variable=plugindir zathura)
+ PLUGINDIR ?= ${PREFIX}/lib/zathura
+ 
+-INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${ZATHURA_INC}
+-LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB}
++INCS = ${GLIB_INC} ${SPECTRE_INC} ${GIRARA_INC} ${ZATHURA_INC} ${GTK_INC}
++LIBS = ${GLIB_LIB} ${SPECTRE_LIB} ${GIRARA_LIB} ${GTK_LIB}
+ 
+ # flags
+ CFLAGS += -std=c99 -fPIC -pedantic -Wall -Wno-format-zero-length $(INCS)
diff --git a/pkgs/applications/networking/bittorrentsync/default.nix b/pkgs/applications/networking/bittorrentsync/default.nix
new file mode 100644
index 00000000000..ae339abb799
--- /dev/null
+++ b/pkgs/applications/networking/bittorrentsync/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, patchelf }:
+
+# this package contains the daemon version of bittorrent sync
+# it's unfortunately closed source.
+
+let
+  # TODO: arm, ppc, osx
+
+  arch = if stdenv.system == "x86_64-linux" then "x64"
+    else if stdenv.system == "i686-linux" then "i386"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+    
+  interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
+    else if stdenv.system == "i686-linux" then "ld-linux.so.2"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+
+  version = "1.0.134";
+  sha256 = if stdenv.system == "x86_64-linux" then "1kyxiqjabqgsg7n0a8snh03axxzpniazp93shb2l1b6x0f7d24n7"
+    else if stdenv.system == "i686-linux" then "02wb8pqcb1rk108r49cqyg7s14grmjnkr6p3068pkiwdwwgi8jak"
+    else throw "Bittorrent Sync for: ${stdenv.system} not supported!";
+
+in stdenv.mkDerivation {
+  name = "btsync-bin-${version}";
+  src = fetchurl {
+    url = "http://syncapp.bittorrent.com/${version}/btsync_${arch}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  sourceRoot = ".";
+
+  installPhase = ''
+    ensureDir "$out/bin/"
+    cp -r "btsync" "$out/bin/"
+
+    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
+      "$out/bin/btsync"
+  '';
+
+  buildInputs = [ patchelf ];
+
+  meta = {
+    homepage = "http://labs.bittorrent.com/experiments/sync.html";
+    description = "Automatically sync files via secure, distributed technology.";
+    license = stdenv.lib.licenses.unfree;
+    maintainers = [ stdenv.lib.maintainers.iElectric ];
+  };
+}
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 84cdf556d02..b0dc8721747 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -1,90 +1,92 @@
-{ stdenv, getConfig, fetchurl, makeWrapper, which
-
-# this is needed in order to build the versions older than 21.x
-, subversion
+{ stdenv, fetchurl, makeWrapper, ninja, which
 
 # default dependencies
 , bzip2, flac, speex
 , libevent, expat, libjpeg
 , libpng, libxml2, libxslt
 , xdg_utils, yasm, zlib
+, libusb1, libexif, pciutils
 
 , python, perl, pkgconfig
 , nspr, udev, krb5
 , utillinux, alsaLib
 , gcc, bison, gperf
 , glib, gtk, dbus_glib
-, libXScrnSaver, libXcursor, mesa
+, libXScrnSaver, libXcursor, libXtst, mesa
+, protobuf, speechd, libXdamage
 
 # optional dependencies
-, libgnome_keyring # config.gnomeKeyring
-, gconf # config.gnome
-, libgcrypt # config.gnome || config.cups
-, nss, openssl # config.openssl
-, pulseaudio # config.pulseaudio
-, libselinux # config.selinux
+, libgcrypt ? null # gnomeSupport || cupsSupport
+
+# package customization
+, channel ? "stable"
+, enableSELinux ? false, libselinux ? null
+, enableNaCl ? false
+, useOpenSSL ? false, nss ? null, openssl ? null
+, gnomeSupport ? false, gconf ? null
+, gnomeKeyringSupport ? false, libgnome_keyring ? null
+, proprietaryCodecs ? true
+, cupsSupport ? false
+, pulseSupport ? false, pulseaudio ? null
 }:
 
-let
-  mkConfigurable = stdenv.lib.mapAttrs (flag: default: getConfig ["chromium" flag] default);
-
-  config = mkConfigurable {
-    channel = "stable";
-    selinux = false;
-    nacl = false;
-    openssl = false;
-    gnome = false;
-    gnomeKeyring = false;
-    proprietaryCodecs = true;
-    cups = false;
-    pulseaudio = getConfig ["pulseaudio"] true;
-  };
+with stdenv.lib;
 
-  sourceInfo = builtins.getAttr config.channel (import ./sources.nix);
+let
+  sourceInfo = builtins.getAttr channel (import ./sources.nix);
 
-  mkGypFlags = with stdenv.lib; let
-    sanitize = value:
-      if value == true then "1"
-      else if value == false then "0"
-      else "${value}";
-    toFlag = key: value: "-D${key}=${sanitize value}";
-  in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
+  mkGypFlags =
+    let
+      sanitize = value:
+        if value == true then "1"
+        else if value == false then "0"
+        else "${value}";
+      toFlag = key: value: "-D${key}=${sanitize value}";
+    in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
 
   gypFlagsUseSystemLibs = {
     use_system_bzip2 = true;
     use_system_flac = true;
     use_system_libevent = true;
     use_system_libexpat = true;
+    use_system_libexif = true;
     use_system_libjpeg = true;
-    use_system_libpng = true;
+    use_system_libpng = false; # PNG dlopen() version conflict
+    use_system_libusb = true;
     use_system_libxml = true;
     use_system_speex = true;
-    use_system_ssl = config.openssl;
+    use_system_ssl = useOpenSSL;
     use_system_stlport = true;
     use_system_xdg_utils = true;
     use_system_yasm = true;
-    use_system_zlib = true;
+    use_system_zlib = false; # http://crbug.com/143623
+    use_system_protobuf = true;
 
     use_system_harfbuzz = false;
     use_system_icu = false;
-    use_system_libwebp = false; # See chromium issue #133161
+    use_system_libwebp = false; # http://crbug.com/133161
     use_system_skia = false;
-    use_system_sqlite = false; # See chromium issue #22208
+    use_system_sqlite = false; # http://crbug.com/22208
     use_system_v8 = false;
   };
 
-  needsSubversion = stdenv.lib.versionOlder sourceInfo.version "21.0.0.0";
-
   defaultDependencies = [
     bzip2 flac speex
     libevent expat libjpeg
     libpng libxml2 libxslt
     xdg_utils yasm zlib
-  ] ++ stdenv.lib.optional needsSubversion subversion;
+    libusb1 libexif
+  ];
+
+  # build paths and release info
+  packageName = "chromium";
+  buildType = "Release";
+  buildPath = "out/${buildType}";
+  libExecPath = "$out/libexec/${packageName}";
 
 in stdenv.mkDerivation rec {
   name = "${packageName}-${version}";
-  packageName = "chromium";
+  inherit packageName;
 
   version = sourceInfo.version;
 
@@ -97,105 +99,108 @@ in stdenv.mkDerivation rec {
     which makeWrapper
     python perl pkgconfig
     nspr udev
-    (if config.openssl then openssl else nss)
+    (if useOpenSSL then openssl else nss)
     utillinux alsaLib
     gcc bison gperf
     krb5
     glib gtk dbus_glib
-    libXScrnSaver libXcursor mesa
-  ] ++ stdenv.lib.optional config.gnomeKeyring libgnome_keyring
-    ++ stdenv.lib.optionals config.gnome [ gconf libgcrypt ]
-    ++ stdenv.lib.optional config.selinux libselinux
-    ++ stdenv.lib.optional config.cups libgcrypt
-    ++ stdenv.lib.optional config.pulseaudio pulseaudio;
+    libXScrnSaver libXcursor libXtst mesa
+    pciutils protobuf speechd libXdamage
+  ] ++ optional gnomeKeyringSupport libgnome_keyring
+    ++ optionals gnomeSupport [ gconf libgcrypt ]
+    ++ optional enableSELinux libselinux
+    ++ optional cupsSupport libgcrypt
+    ++ optional pulseSupport pulseaudio;
 
-  opensslPatches = stdenv.lib.optional config.openssl openssl.patches;
+  opensslPatches = optional useOpenSSL openssl.patches;
 
   prePatch = "patchShebangs .";
 
-  patches = stdenv.lib.optional (!config.selinux) ./enable_seccomp.patch
-         ++ stdenv.lib.optional config.cups ./cups_allow_deprecated.patch
-         ++ stdenv.lib.optional config.pulseaudio ./pulseaudio_array_bounds.patch;
+  patches = [ ./sandbox_userns.patch ]
+         ++ optional cupsSupport ./cups_allow_deprecated.patch;
 
-  postPatch = stdenv.lib.optionalString config.openssl ''
+  postPatch = ''
+    sed -i -r -e 's/-f(stack-protector)(-all)?/-fno-\1/' build/common.gypi
+  '' + optionalString useOpenSSL ''
     cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
+  '' + ''
+    sed -i -e 's|/usr/bin/gcc|gcc|' \
+      third_party/WebKit/Source/${if !versionOlder sourceInfo.version "28.0.0.0"
+                                  then "core/core.gypi"
+                                  else "WebCore/WebCore.gyp/WebCore.gyp"}
   '';
 
   gypFlags = mkGypFlags (gypFlagsUseSystemLibs // {
     linux_use_gold_binary = false;
     linux_use_gold_flags = false;
     proprietary_codecs = false;
-    use_gnome_keyring = config.gnomeKeyring;
-    use_gconf = config.gnome;
-    use_gio = config.gnome;
-    use_pulseaudio = config.pulseaudio;
-    disable_nacl = !config.nacl;
-    use_openssl = config.openssl;
-    selinux = config.selinux;
-    use_cups = config.cups;
-  } // stdenv.lib.optionalAttrs config.proprietaryCodecs {
+    use_gnome_keyring = gnomeKeyringSupport;
+    use_gconf = gnomeSupport;
+    use_gio = gnomeSupport;
+    use_pulseaudio = pulseSupport;
+    disable_nacl = !enableNaCl;
+    use_openssl = useOpenSSL;
+    selinux = enableSELinux;
+    use_cups = cupsSupport;
+    linux_sandbox_path="${libExecPath}/${packageName}_sandbox";
+    linux_sandbox_chrome_path="${libExecPath}/${packageName}";
+  } // optionalAttrs proprietaryCodecs {
     # enable support for the H.264 codec
     proprietary_codecs = true;
     ffmpeg_branding = "Chrome";
-  } // stdenv.lib.optionalAttrs (stdenv.system == "x86_64-linux") {
+  } // optionalAttrs (stdenv.system == "x86_64-linux") {
     target_arch = "x64";
-  } // stdenv.lib.optionalAttrs (stdenv.system == "i686-linux") {
+  } // optionalAttrs (stdenv.system == "i686-linux") {
     target_arch = "ia32";
   });
 
-  buildType = "Release";
-
-  enableParallelBuilding = true;
-
   configurePhase = ''
-    python build/gyp_chromium --depth "$(pwd)" ${gypFlags}
+    GYP_GENERATORS=ninja python build/gyp_chromium --depth "$(pwd)" ${gypFlags}
   '';
 
-  makeFlags = let
+  buildPhase = let
     CC = "${gcc}/bin/gcc";
     CXX = "${gcc}/bin/g++";
-  in [
-    "CC=${CC}"
-    "CXX=${CXX}"
-    "CC.host=${CC}"
-    "CXX.host=${CXX}"
-    "LINK.host=${CXX}"
-  ];
-
-  buildFlags = [
-    "BUILDTYPE=${buildType}"
-    "library=shared_library"
-    "chrome"
-  ];
+  in ''
+    CC="${CC}" CC_host="${CC}"     \
+    CXX="${CXX}" CXX_host="${CXX}" \
+    LINK_host="${CXX}"             \
+      "${ninja}/bin/ninja" -C "out/${buildType}" \
+        -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES    \
+        chrome ${optionalString (!enableSELinux) "chrome_sandbox"}
+  '';
 
   installPhase = ''
-    mkdir -vp "$out/libexec/${packageName}"
-    cp -v "out/${buildType}/"*.pak "$out/libexec/${packageName}/"
-    cp -vR "out/${buildType}/locales" "out/${buildType}/resources" "$out/libexec/${packageName}/"
-    cp -v out/${buildType}/libffmpegsumo.so "$out/libexec/${packageName}/"
+    mkdir -vp "${libExecPath}"
+    cp -v "${buildPath}/"*.pak "${libExecPath}/"
+    cp -vR "${buildPath}/locales" "${buildPath}/resources" "${libExecPath}/"
+    cp -v ${buildPath}/libffmpegsumo.so "${libExecPath}/"
 
-    cp -v "out/${buildType}/chrome" "$out/libexec/${packageName}/${packageName}"
+    cp -v "${buildPath}/chrome" "${libExecPath}/${packageName}"
 
     mkdir -vp "$out/bin"
-    makeWrapper "$out/libexec/${packageName}/${packageName}" "$out/bin/${packageName}"
+    makeWrapper "${libExecPath}/${packageName}" "$out/bin/${packageName}"
+    cp -v "${buildPath}/chrome_sandbox" "${libExecPath}/${packageName}_sandbox"
 
     mkdir -vp "$out/share/man/man1"
-    cp -v "out/${buildType}/chrome.1" "$out/share/man/man1/${packageName}.1"
+    cp -v "${buildPath}/chrome.1" "$out/share/man/man1/${packageName}.1"
 
     for icon_file in chrome/app/theme/chromium/product_logo_*[0-9].png; do
       num_and_suffix="''${icon_file##*logo_}"
       icon_size="''${num_and_suffix%.*}"
-      logo_output_path="$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps"
+      expr "$icon_size" : "^[0-9][0-9]*$" || continue
+      logo_output_prefix="$out/share/icons/hicolor"
+      logo_output_path="$logo_output_prefix/''${icon_size}x''${icon_size}/apps"
       mkdir -vp "$logo_output_path"
       cp -v "$icon_file" "$logo_output_path/${packageName}.png"
     done
   '';
 
-  meta =  with stdenv.lib; {
+  meta = {
     description = "Chromium, an open source web browser";
     homepage = http://www.chromium.org/;
-    maintainers = with stdenv.lib.maintainers; [ goibhniu chaoflow ];
+    maintainers = with maintainers; [ goibhniu chaoflow aszlig ];
     license = licenses.bsd3;
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch b/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch
deleted file mode 100644
index edeee37f19c..00000000000
--- a/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/content/common/seccomp_sandbox.h b/content/common/seccomp_sandbox.h
-index a07d6f3..a622a35 100644
---- a/content/common/seccomp_sandbox.h
-+++ b/content/common/seccomp_sandbox.h
-@@ -29,15 +29,9 @@ static bool SeccompSandboxEnabled() {
-   // TODO(evan): turn on for release too once we've flushed out all the bugs,
-   // allowing us to delete this file entirely and just rely on the "disabled"
-   // switch.
--#ifdef NDEBUG
--  // Off by default; allow turning on with a switch.
--  return CommandLine::ForCurrentProcess()->HasSwitch(
--      switches::kEnableSeccompSandbox);
--#else
-   // On by default; allow turning off with a switch.
-   return !CommandLine::ForCurrentProcess()->HasSwitch(
-       switches::kDisableSeccompSandbox);
--#endif  // NDEBUG
- }
- #endif  // SECCOMP_SANDBOX
- 
diff --git a/pkgs/applications/networking/browsers/chromium/pulseaudio_array_bounds.patch b/pkgs/applications/networking/browsers/chromium/pulseaudio_array_bounds.patch
deleted file mode 100644
index ca78b6959c0..00000000000
--- a/pkgs/applications/networking/browsers/chromium/pulseaudio_array_bounds.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/media/media.gyp b/media/media.gyp
-index 2a8c6c6..66ca767 100644
---- a/media/media.gyp
-+++ b/media/media.gyp
-@@ -399,6 +399,7 @@
-             ['use_pulseaudio == 1', {
-               'cflags': [
-                 '<!@(pkg-config --cflags libpulse)',
-+                '-Wno-array-bounds',
-               ],
-               'link_settings': {
-                 'libraries': [
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox_userns.patch b/pkgs/applications/networking/browsers/chromium/sandbox_userns.patch
new file mode 100644
index 00000000000..694cebe7c14
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/sandbox_userns.patch
@@ -0,0 +1,292 @@
+From a242351d8a32ea33e6337b928969cc9f715e314e Mon Sep 17 00:00:00 2001
+From: aszlig <aszlig@redmoonstudios.org>
+Date: Thu, 16 May 2013 14:17:56 +0200
+Subject: [PATCH] zygote: Add support for user namespaces on Linux.
+
+The implementation is done by patching the Zygote host to execute the sandbox
+binary with CLONE_NEWUSER and setting the uid and gid mapping so that the child
+process is using uid 0 and gid 0 which map to the current user of the parent.
+Afterwards, the sandbox will continue as if it was called as a setuid binary.
+
+In addition, this adds new_user_namespace as an option in process_util in order
+to set the UID and GID mapping correctly. The reason for this is that just
+passing CLONE_NEWUSER to clone_flags doesn't help in LaunchProcess(), because
+without setting the mappings exec*() will clear the process's capability sets.
+
+If the kernel doesn't support unprivileged user namespaces and the sandbox
+binary doesn't have the setuid flag, the Zygote main process will run without a
+sandbox. This is to mimic the behaviour if no SUID sandbox binary path is set.
+
+Signed-off-by: aszlig <aszlig@redmoonstudios.org>
+---
+ base/process_util.h                                |  4 ++
+ base/process_util_posix.cc                         | 71 +++++++++++++++++++++-
+ .../browser/zygote_host/zygote_host_impl_linux.cc  | 28 +++++++--
+ content/zygote/zygote_main_linux.cc                |  7 +++
+ sandbox/linux/suid/client/setuid_sandbox_client.cc |  8 +++
+ sandbox/linux/suid/client/setuid_sandbox_client.h  |  4 ++
+ sandbox/linux/suid/common/sandbox.h                |  1 +
+ 7 files changed, 117 insertions(+), 6 deletions(-)
+
+diff --git a/base/process_util.h b/base/process_util.h
+index 6efc70c..0f0c74c 100644
+--- a/base/process_util.h
++++ b/base/process_util.h
+@@ -261,3 +261,4 @@ struct LaunchOptions {
++        , new_user_namespace(false)
+ #endif  // OS_LINUX
+ #if defined(OS_CHROMEOS)
+         , ctrl_terminal_fd(-1)
+@@ -332,6 +333,9 @@ struct LaunchOptions {
+ #if defined(OS_LINUX)
+   // If non-zero, start the process using clone(), using flags as provided.
+   int clone_flags;
++
++  // If true, start the process in a new user namespace.
++  bool new_user_namespace;
+ #endif  // defined(OS_LINUX)
+ 
+ #if defined(OS_CHROMEOS)
+diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
+index 6f15130..cea07f0 100644
+--- a/base/process_util_posix.cc
++++ b/base/process_util_posix.cc
+@@ -34,6 +34,13 @@
+ #include "base/threading/platform_thread.h"
+ #include "base/threading/thread_restrictions.h"
+ 
++#if defined(OS_LINUX)
++#include <sched.h>
++#if !defined(CLONE_NEWUSER)
++#define CLONE_NEWUSER 0x10000000
++#endif
++#endif
++
+ #if defined(OS_CHROMEOS)
+ #include <sys/ioctl.h>
+ #endif
+@@ -621,8 +628,19 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+ 
+   pid_t pid;
+ #if defined(OS_LINUX)
+-  if (options.clone_flags) {
+-    pid = syscall(__NR_clone, options.clone_flags, 0, 0, 0);
++  int map_pipe_fd[2];
++  int flags = options.clone_flags;
++
++  if (options.new_user_namespace) {
++    flags |= CLONE_NEWUSER;
++    if (pipe(map_pipe_fd) < 0) {
++      DPLOG(ERROR) << "user namespace pipe";
++      return false;
++    }
++  }
++
++  if (options.clone_flags || options.new_user_namespace) {
++    pid = syscall(__NR_clone, flags, 0, 0, 0);
+   } else
+ #endif
+   {
+@@ -635,6 +653,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+   } else if (pid == 0) {
+     // Child process
+ 
++#if defined(OS_LINUX)
++    if (options.new_user_namespace) {
++      // Close the write end of the pipe so we get an EOF when the parent closes
++      // the FD. This is to avoid race conditions when the UID/GID mappings are
++      // written _after_ execvp().
++      close(map_pipe_fd[1]);
++
++      char dummy;
++      if (HANDLE_EINTR(read(map_pipe_fd[0], &dummy, 1)) != 0) {
++        RAW_LOG(ERROR, "Unexpected input in uid/gid mapping pipe.");
++        _exit(127);
++      }
++    }
++#endif
++
+     // DANGER: fork() rule: in the child, if you don't end up doing exec*(),
+     // you call _exit() instead of exit(). This is because _exit() does not
+     // call any previously-registered (in the parent) exit handlers, which
+@@ -749,6 +782,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+     _exit(127);
+   } else {
+     // Parent process
++#if defined(OS_LINUX)
++    if (options.new_user_namespace) {
++      // We need to write UID/GID mapping here to map the current user outside
++      // the namespace to the root user inside the namespace in order to
++      // correctly "fool" the child process.
++      char buf[256];
++      int map_fd, map_len;
++
++      snprintf(buf, sizeof(buf), "/proc/%d/uid_map", pid);
++      map_fd = open(buf, O_RDWR);
++      DPCHECK(map_fd >= 0);
++      snprintf(buf, sizeof(buf), "0 %d 1", geteuid());
++      map_len = strlen(buf);
++      if (write(map_fd, buf, map_len) != map_len) {
++        RAW_LOG(WARNING, "Can't write to uid_map.");
++      }
++      close(map_fd);
++
++      snprintf(buf, sizeof(buf), "/proc/%d/gid_map", pid);
++      map_fd = open(buf, O_RDWR);
++      DPCHECK(map_fd >= 0);
++      snprintf(buf, sizeof(buf), "0 %d 1", getegid());
++      map_len = strlen(buf);
++      if (write(map_fd, buf, map_len) != map_len) {
++        RAW_LOG(WARNING, "Can't write to gid_map.");
++      }
++      close(map_fd);
++
++      // Close the pipe on the parent, so the child can continue doing the
++      // execvp() call.
++      close(map_pipe_fd[1]);
++    }
++#endif
++
+     if (options.wait) {
+       // While this isn't strictly disk IO, waiting for another process to
+       // finish is the sort of thing ThreadRestrictions is trying to prevent.
+diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
+index ba7884f8..2a674a0 100644
+--- a/content/browser/zygote_host/zygote_host_impl_linux.cc
++++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
+@@ -117,6 +117,9 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+ 
+   sandbox_binary_ = sandbox_cmd.c_str();
+ 
++  bool userns_sandbox = false;
++  const std::vector<std::string> cmd_line_unwrapped(cmd_line.argv());
++
+   if (!sandbox_cmd.empty()) {
+     struct stat st;
+     if (stat(sandbox_binary_.c_str(), &st) != 0) {
+@@ -124,16 +127,21 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+                  << sandbox_binary_ << " Aborting now.";
+     }
+ 
+-    if (access(sandbox_binary_.c_str(), X_OK) == 0 &&
+-        (st.st_uid == 0) &&
+-        (st.st_mode & S_ISUID) &&
+-        (st.st_mode & S_IXOTH)) {
++    if (access(sandbox_binary_.c_str(), X_OK) == 0) {
+       using_suid_sandbox_ = true;
++
+       cmd_line.PrependWrapper(sandbox_binary_);
+ 
+       scoped_ptr<sandbox::SetuidSandboxClient>
+           sandbox_client(sandbox::SetuidSandboxClient::Create());
+       sandbox_client->SetupLaunchEnvironment();
++
++      if (!((st.st_uid == 0) &&
++            (st.st_mode & S_ISUID) &&
++            (st.st_mode & S_IXOTH))) {
++        userns_sandbox = true;
++        sandbox_client->SetNoSuid();
++      }
+     } else {
+       LOG(FATAL) << "The SUID sandbox helper binary was found, but is not "
+                     "configured correctly. Rather than run without sandboxing "
+@@ -161,7 +169,19 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+   base::ProcessHandle process = -1;
+   base::LaunchOptions options;
+   options.fds_to_remap = &fds_to_map;
++  if (userns_sandbox)
++    options.new_user_namespace = true;
+   base::LaunchProcess(cmd_line.argv(), options, &process);
++
++  if (process == -1 && userns_sandbox) {
++    LOG(ERROR) << "User namespace sandbox failed to start, running without "
++               << "sandbox! You need at least kernel 3.8.0 with CONFIG_USER_NS "
++               << "enabled in order to use the sandbox without setuid bit.";
++    using_suid_sandbox_ = false;
++    options.new_user_namespace = false;
++    base::LaunchProcess(cmd_line_unwrapped, options, &process);
++  }
++
+   CHECK(process != -1) << "Failed to launch zygote process";
+ 
+   if (using_suid_sandbox_) {
+diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
+index ca75518..d906411 100644
+--- a/content/zygote/zygote_main_linux.cc
++++ b/content/zygote/zygote_main_linux.cc
+@@ -402,6 +402,13 @@ static bool EnterSandbox(sandbox::SetuidSandboxClient* setuid_sandbox,
+       *has_started_new_init = true;
+     }
+ 
++    // Don't set non-dumpable, as it causes trouble when the host tries to find
++    // the zygote process (XXX: Not quite sure why this happens with user
++    // namespaces). Fortunately, we also have the seccomp filter sandbox which
++    // should disallow the use of ptrace.
++    if (setuid_sandbox->IsNoSuid())
++      return true;
++
+ #if !defined(OS_OPENBSD)
+     // Previously, we required that the binary be non-readable. This causes the
+     // kernel to mark the process as non-dumpable at startup. The thinking was
+diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.cc b/sandbox/linux/suid/client/setuid_sandbox_client.cc
+index 7a174ef..633401e 100644
+--- a/sandbox/linux/suid/client/setuid_sandbox_client.cc
++++ b/sandbox/linux/suid/client/setuid_sandbox_client.cc
+@@ -166,6 +166,10 @@ bool SetuidSandboxClient::IsInNewNETNamespace() const {
+   return env_->HasVar(kSandboxNETNSEnvironmentVarName);
+ }
+ 
++bool SetuidSandboxClient::IsNoSuid() const {
++  return env_->HasVar(kSandboxNoSuidVarName);
++}
++
+ bool SetuidSandboxClient::IsSandboxed() const {
+   return sandboxed_;
+ }
+@@ -175,5 +179,9 @@ void SetuidSandboxClient::SetupLaunchEnvironment() {
+   SetSandboxAPIEnvironmentVariable(env_);
+ }
+ 
++void SetuidSandboxClient::SetNoSuid() {
++  env_->SetVar(kSandboxNoSuidVarName, "1");
++}
++
+ }  // namespace sandbox
+ 
+diff --git a/sandbox/linux/suid/client/setuid_sandbox_client.h b/sandbox/linux/suid/client/setuid_sandbox_client.h
+index a9f6536..2e8113a 100644
+--- a/sandbox/linux/suid/client/setuid_sandbox_client.h
++++ b/sandbox/linux/suid/client/setuid_sandbox_client.h
+@@ -39,6 +39,8 @@ class SetuidSandboxClient {
+   bool IsInNewPIDNamespace() const;
+   // Did the setuid helper create a new network namespace ?
+   bool IsInNewNETNamespace() const;
++  // Is sandboxed without SUID binary ?
++  bool IsNoSuid() const;
+   // Are we done and fully sandboxed ?
+   bool IsSandboxed() const;
+ 
+@@ -46,6 +48,8 @@ class SetuidSandboxClient {
+   // helper.
+   void SetupLaunchEnvironment();
+ 
++  void SetNoSuid();
++
+  private:
+   // Holds the environment. Will never be NULL.
+   base::Environment* env_;
+diff --git a/sandbox/linux/suid/common/sandbox.h b/sandbox/linux/suid/common/sandbox.h
+index aad4ff8..bd710d5 100644
+--- a/sandbox/linux/suid/common/sandbox.h
++++ b/sandbox/linux/suid/common/sandbox.h
+@@ -18,6 +18,7 @@ static const char kAdjustLowMemMarginSwitch[] = "--adjust-low-mem";
+ 
+ static const char kSandboxDescriptorEnvironmentVarName[] = "SBX_D";
+ static const char kSandboxHelperPidEnvironmentVarName[] = "SBX_HELPER_PID";
++static const char kSandboxNoSuidVarName[] = "SBX_NO_SUID";
+ 
+ static const long kSUIDSandboxApiNumber = 1;
+ static const char kSandboxEnvironmentApiRequest[] = "SBX_CHROME_API_RQ";
+-- 
+1.8.2.1
+
diff --git a/pkgs/applications/networking/browsers/chromium/sources.nix b/pkgs/applications/networking/browsers/chromium/sources.nix
index a250cda7610..54d9f44f7fb 100644
--- a/pkgs/applications/networking/browsers/chromium/sources.nix
+++ b/pkgs/applications/networking/browsers/chromium/sources.nix
@@ -1,18 +1,18 @@
 # This file is autogenerated from update.sh in the same directory.
 {
   dev = {
-    version = "22.0.1229.8";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1229.8.tar.bz2";
-    sha256 = "0gaa4mqvd0v4y587y6mri2f3b0rc8npmcbs9bfs4wwb8n1cp8kw0";
+    version = "29.0.1516.3";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1516.3.tar.xz";
+    sha256 = "0pdn9c6v0v55d7g4amivxrv132bpj9sfqywk5b8l6kqfjq28mw5k";
   };
   beta = {
-    version = "21.0.1180.79";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.79.tar.bz2";
-    sha256 = "1jscpibv02pyqpcj6djcx0d1qwq8hcxampfqbsz8dicgjprp22c8";
+    version = "28.0.1500.36";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-28.0.1500.36.tar.xz";
+    sha256 = "1bz9w46ps8gj056hfwbcj4myyxyr7y759nagz9idraia8116m3pp";
   };
   stable = {
-    version = "21.0.1180.79";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.79.tar.bz2";
-    sha256 = "1jscpibv02pyqpcj6djcx0d1qwq8hcxampfqbsz8dicgjprp22c8";
+    version = "27.0.1453.110";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-27.0.1453.110.tar.xz";
+    sha256 = "1y61shbzrkcv70x9zyj559g2yyp40hi9y59f7wwx5g076lsaxsw5";
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/update.sh b/pkgs/applications/networking/browsers/chromium/update.sh
index 4721ded385a..0c21213a751 100755
--- a/pkgs/applications/networking/browsers/chromium/update.sh
+++ b/pkgs/applications/networking/browsers/chromium/update.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-channels_url="http://omahaproxy.appspot.com/";
+channels_url="http://omahaproxy.appspot.com/all?csv=1";
 bucket_url="http://commondatastorage.googleapis.com/chromium-browser-official/";
 output_file="$(cd "$(dirname "$0")" && pwd)/sources.nix";
 
@@ -62,7 +62,7 @@ then
             sha256="$(nix_getattr "$output_file" "$channel.sha256")";
         fi;
 
-        sha_insert "$version" "$sha256"
+        sha_insert "$version" "$sha256";
         echo "$sha256";
     }
 else
@@ -78,14 +78,20 @@ get_channel_exprs()
     do
         channel="${chline%%,*}";
         version="${chline##*,}";
-        url="${bucket_url%/}/chromium-$version.tar.bz2";
+
+        # XXX: Remove case after version 26 is stable:
+        if [ "${version%%.*}" -ge 26 ]; then
+            url="${bucket_url%/}/chromium-$version.tar.xz";
+        else
+            url="${bucket_url%/}/chromium-$version.tar.bz2";
+        fi;
 
         echo -n "Checking if sha256 of version $version is cached..." >&2;
         if sha256="$(sha_lookup "$version")";
         then
-            echo "yes: $sha256" >&2;
+            echo " yes: $sha256" >&2;
         else
-            echo "no." >&2;
+            echo " no." >&2;
             sha256="$(get_sha256 "$channel" "$version" "$url")";
         fi;
 
diff --git a/pkgs/applications/networking/browsers/conkeror/default.nix b/pkgs/applications/networking/browsers/conkeror/default.nix
index 0a370701109..b50266e2761 100644
--- a/pkgs/applications/networking/browsers/conkeror/default.nix
+++ b/pkgs/applications/networking/browsers/conkeror/default.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, unzip, xulrunner, makeWrapper }:
 
 stdenv.mkDerivation {
-  name = "conkeror-1.0pre-20120316";
+  name = "conkeror-1.0pre-20130401";
   
   src = fetchurl {
-    url = http://repo.or.cz/w/conkeror.git/snapshot/1264c0dbbefb6d671504a072d4ddb48d62ccead2.zip;
-    sha256 = "1vdxnhqjjvg9cry70byv6d3wib2p4rxhkmv7hs10pq39km1kpj7f";
+    url = http://repo.or.cz/w/conkeror.git/snapshot/0341e791c78653a2f5bbbff9a1dac04bf898dd65.zip;
+    sha256 = "11v7p40lcz6r5z0w54f8pk6hyn9mqjcw44fqszjyz25rkhx951ry";
   };
   
   buildInputs = [ unzip makeWrapper ];
   
-  buildCommand = ''
+  installPhase = ''
     mkdir -p $out/libexec/conkeror
-    unzip $src -d $out/libexec
+    cp -r * $out/libexec/conkeror
 
     makeWrapper ${xulrunner}/bin/xulrunner $out/bin/conkeror \
       --add-flags $out/libexec/conkeror/application.ini
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index 1587a2e3495..1618042364e 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -1,5 +1,8 @@
 { stdenv, fetchurl, python, perl, ncurses, x11, bzip2, zlib, openssl
-, spidermonkey, guile, gpm }:
+, spidermonkey, gpm
+, enableGuile ? true, guile ? null }:
+
+assert enableGuile -> guile != null;
 
 stdenv.mkDerivation rec {
   name = "elinks-0.12pre5";
@@ -11,22 +14,23 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gc-init.patch ];
 
-  buildInputs = [ python perl ncurses x11 bzip2 zlib openssl spidermonkey guile gpm ];
+  buildInputs = [ python perl ncurses x11 bzip2 zlib openssl spidermonkey gpm ]
+    ++ stdenv.lib.optional enableGuile guile;
 
   configureFlags =
     ''
-      --enable-finger --enable-html-highlight --with-guile
+      --enable-finger --enable-html-highlight
       --with-perl --with-python --enable-gopher --enable-cgi --enable-bittorrent
       --enable-nntp --with-openssl=${openssl}
-    '';
+    '' + stdenv.lib.optionalString enableGuile " --with-guile";
 
   crossAttrs = {
-    propagatedBuildInputs = [ ncurses.hostDrv zlib.hostDrv openssl.hostDrv ];
+    propagatedBuildInputs = [ ncurses.crossDrv zlib.crossDrv openssl.crossDrv ];
     configureFlags = ''
       --enable-finger --enable-html-highlight
       --enable-gopher --enable-cgi --enable-bittorrent --enable-nntp
-      --with-openssl=${openssl.hostDrv}
-      --with-bzip2=${bzip2.hostDrv}
+      --with-openssl=${openssl.crossDrv}
+      --with-bzip2=${bzip2.crossDrv}
     '';
   };
 
diff --git a/pkgs/applications/networking/browsers/firefox/13.0.nix b/pkgs/applications/networking/browsers/firefox/13.0.nix
index fbbf3275ad1..1717a476e9c 100644
--- a/pkgs/applications/networking/browsers/firefox/13.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/13.0.nix
@@ -21,8 +21,8 @@ rec {
 
   
   src = fetchurl {
-    url = "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha1 = "3752f13f26a51dd2e42d2805a707a842e6f8d1b1";
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
+    sha256 = "1qwvs3rdmrnkjnjvhi3vh4mjdpxr43zcm7llc6z5qws9n9yx15n1";
   };
   
   commonConfigureFlags =
diff --git a/pkgs/applications/networking/browsers/firefox/12.0.nix b/pkgs/applications/networking/browsers/firefox/20.0.nix
index 97e23d1b8b2..1480a300820 100644
--- a/pkgs/applications/networking/browsers/firefox/12.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/20.0.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
 , libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
-, yasm, mesa, sqlite, unzip
+, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -15,39 +15,45 @@ assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
 rec {
 
-  firefoxVersion = "12.0";
-  
-  xulVersion = "12.0"; # this attribute is used by other packages
+  firefoxVersion = "20.0";
+
+  xulVersion = "20.0"; # this attribute is used by other packages
+
 
-  
   src = fetchurl {
-    url = "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha1 = "0177185e54b7d63dc36bd5bd5c80ba6afd52e199";
+    urls = [
+        # It is better to use this url for official releases, to take load off Mozilla's ftp server.
+        "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
+        # Fall back to this url for versions not available at releases.mozilla.org.
+        "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
+    ];
+    sha1 = "6d776c29da0be0d2a50abeb504d63b06b7861218";
   };
-  
+
   commonConfigureFlags =
     [ "--enable-optimize"
+      #"--enable-profiling"
       "--disable-debug"
       "--enable-strip"
-      "--with-system-jpeg"
+      # "--with-system-jpeg" # Too old in nixpkgs
       "--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" # disabled for the moment because our Cairo is too old
+      # "--enable-system-cairo" # <-- doesn't build
       "--enable-system-sqlite"
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
-      "--disable-installer" 
+      "--disable-installer"
       "--disable-updater"
     ];
 
 
   xulrunner = stdenv.mkDerivation rec {
     name = "xulrunner-${xulVersion}";
-    
+
     inherit src;
 
     buildInputs =
@@ -55,8 +61,8 @@ rec {
         python dbus dbus_glib pango freetype fontconfig xlibs.libXi
         xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
         alsaLib nspr nss libnotify xlibs.pixman yasm mesa
-        xlibs.libXScrnSaver xlibs.scrnsaverproto
-        xlibs.libXext xlibs.xextproto sqlite unzip
+        xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
+        xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
       ];
 
     configureFlags =
@@ -65,49 +71,39 @@ rec {
       ] ++ commonConfigureFlags;
 
     enableParallelBuilding = true;
-      
-    # Hack to work around make's idea of -lbz2 dependency
+
     preConfigure =
       ''
-        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":" 
-            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
-        }' ';'
-
         export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
-      '';
 
-    # !!! Temporary hack.
-    preBuild =
-      ''
-        export NIX_ENFORCE_PURITY=
-      '';
+        mkdir ../objdir
+        cd ../objdir
+        configureScript=../mozilla-release/configure
+      ''; # */
 
-    installFlags = "SKIP_GRE_REGISTRATION=1";
+    #installFlags = "SKIP_GRE_REGISTRATION=1";
 
     postInstall = ''
-      # Fix some references to /bin paths in the Xulrunner shell script.
-      substituteInPlace $out/bin/xulrunner \
-          --replace /bin/pwd "$(type -tP pwd)" \
-          --replace /bin/ls "$(type -tP ls)"
-
       # Fix run-mozilla.sh search
       libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
       echo libDir: $libDir
       test -n "$libDir"
       cd $out/bin
-      mv xulrunner ../lib/$libDir/
+      rm xulrunner
 
-      for i in $out/lib/$libDir/*; do 
+      for i in $out/lib/$libDir/*; do
           file $i;
-          if file $i | grep executable &>/dev/null; then 
-              echo -e '#! /bin/sh\n"'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
+          if file $i | grep executable &>/dev/null; then
+              echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
               chmod a+x "$out/bin/$(basename "$i")";
           fi;
-      done;
-      for i in $out/lib/$libDir/{xpcshell,plugin-container,*.so}; do
-              patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
-      done;
+      done
+      for i in $out/lib/$libDir/*.so; do
+          patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
+      done
+      for i in $out/lib/$libDir/{plugin-container,xulrunner,xulrunner-stub}; do
+          wrapProgram $i --prefix LD_LIBRARY_PATH ':' "$out/lib/$libDir"
+      done
       rm -f $out/bin/run-mozilla.sh
     ''; # */
 
@@ -126,11 +122,11 @@ rec {
     inherit src;
 
     enableParallelBuilding = true;
-      
+
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
         dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
-        xlibs.pixman yasm mesa sqlite file unzip
+        xlibs.pixman yasm mesa sqlite file unzip pysqlite
       ];
 
     propagatedBuildInputs = [xulrunner];
@@ -144,11 +140,15 @@ rec {
       ++ commonConfigureFlags
       ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
+    makeFlags = [
+      "SYSTEM_LIBXUL=1"
+    ];
+
     # Hack to work around make's idea of -lbz2 dependency
     preConfigure =
       ''
         find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":" 
+          stdenv.lib.concatStringsSep ":"
             (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
         }' ';'
       '';
@@ -156,15 +156,10 @@ rec {
     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\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")"
-                chmod a+x "$out/bin/$(basename "$i")"
-            fi;
-        done;
+        cd "$out/lib/"firefox-*
+        rm firefox
+        echo -e '#!${stdenv.shell}\nexec ${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        chmod a+x firefox
       ''; # */
 
     meta = {
diff --git a/pkgs/applications/networking/browsers/firefox/21.0.nix b/pkgs/applications/networking/browsers/firefox/21.0.nix
new file mode 100644
index 00000000000..02766a9ccff
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox/21.0.nix
@@ -0,0 +1,180 @@
+{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
+, libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
+, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
+, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
+
+, # 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 = "21.0";
+
+  xulVersion = "21.0"; # this attribute is used by other packages
+
+
+  src = fetchurl {
+    urls = [
+        # It is better to use this url for official releases, to take load off Mozilla's ftp server.
+        "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
+        # Fall back to this url for versions not available at releases.mozilla.org.
+        "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
+    ];
+    sha1 = "e63b5488eaec1956947f59609d5839332ba7ffe1";
+  };
+
+  commonConfigureFlags =
+    [ "--enable-optimize"
+      #"--enable-profiling"
+      "--disable-debug"
+      "--enable-strip"
+      # "--with-system-jpeg" # Too old in nixpkgs
+      "--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" # <-- doesn't build
+      "--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 pysqlite
+        xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
+      ];
+
+    configureFlags =
+      [ "--enable-application=xulrunner"
+        "--disable-javaxpcom"
+      ] ++ commonConfigureFlags;
+
+    enableParallelBuilding = true;
+
+    preConfigure =
+      ''
+        export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
+
+        mkdir ../objdir
+        cd ../objdir
+        configureScript=../mozilla-release/configure
+      ''; # */
+
+    #installFlags = "SKIP_GRE_REGISTRATION=1";
+
+    postInstall = ''
+      # Fix run-mozilla.sh search
+      libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
+      echo libDir: $libDir
+      test -n "$libDir"
+      cd $out/bin
+      rm xulrunner
+
+      for i in $out/lib/$libDir/*; do
+          file $i;
+          if file $i | grep executable &>/dev/null; then
+              echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
+              chmod a+x "$out/bin/$(basename "$i")";
+          fi;
+      done
+      for i in $out/lib/$libDir/*.so; do
+          patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
+      done
+      for i in $out/lib/$libDir/{plugin-container,xulrunner,xulrunner-stub}; do
+          wrapProgram $i --prefix LD_LIBRARY_PATH ':' "$out/lib/$libDir"
+      done
+      rm -f $out/bin/run-mozilla.sh
+    ''; # */
+
+    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 nss libnotify
+        xlibs.pixman yasm mesa sqlite file unzip pysqlite
+      ];
+
+    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";
+
+    makeFlags = [
+      "SYSTEM_LIBXUL=1"
+    ];
+
+    # Hack to work around make's idea of -lbz2 dependency
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":"
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
+
+    postInstall =
+      ''
+        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
+        cd "$out/lib/"firefox-*
+        rm firefox
+        echo -e '#!${stdenv.shell}\nexec ${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        chmod a+x firefox
+
+        # Put chrome.manifest etc. in the right place.
+        mv browser/* .
+        rmdir browser
+      ''; # */
+
+    meta = {
+      description = "Mozilla Firefox - the browser, reloaded";
+      homepage = http://www.mozilla.com/en-US/firefox/;
+      maintainers = [ stdenv.lib.maintainers.eelco ];
+    };
+
+    passthru = {
+      inherit gtk xulrunner nspr;
+      isFirefox3Like = true;
+    };
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index 2bbff467bc5..f8d2c2d0e8c 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, browser, makeDesktopItem, makeWrapper, plugins, libs
+{ stdenv, browser, makeDesktopItem, makeWrapper, plugins, libs, gtk_modules
 , browserName, desktopName, nameSuffix, icon
 }:
 
@@ -28,6 +28,7 @@ stdenv.mkDerivation {
         "$out/bin/${browserName}${nameSuffix}" \
         --suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
         --suffix-each LD_LIBRARY_PATH ':' "$libs" \
+        --suffix-each GTK_PATH ':' "$gtk_modules" \
         --suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
         --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"
 
@@ -43,6 +44,7 @@ stdenv.mkDerivation {
   # where to find the plugin in its tree.
   plugins = map (x: x + x.mozillaPlugin) plugins;
   libs = map (x: x + "/lib") libs ++ map (x: x + "/lib64") libs;
+  gtk_modules = map (x: x + x.gtkModule) gtk_modules;
 
   meta = {
     description =
diff --git a/pkgs/applications/networking/browsers/konq-plugins/default.nix b/pkgs/applications/networking/browsers/konq-plugins/default.nix
deleted file mode 100644
index 656e24be071..00000000000
--- a/pkgs/applications/networking/browsers/konq-plugins/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl, kdelibs, cmake, qt4, automoc4, phonon, kde_baseapps, gettext  }:
-
-stdenv.mkDerivation rec {
-  name = "konq-plugins-${version}";
-  version = "4.4.0";
-
-  src = fetchurl { 
-    url = http://ftp.riken.go.jp/pub/FreeBSD/distfiles/KDE/extragear/konq-plugins-4.4.0.tar.bz2;
-    sha256 = "1hn722rcdcwmhfnn89rnvp2b4d8gds4nm483ps3jkk83d7f2xmbi";
-  };
-
-  buildInputs = [ cmake kdelibs qt4 automoc4 phonon kde_baseapps gettext ];
-
-  patches = [ ./qt47.patch ];
-
-  meta = with stdenv.lib; {
-    description = "Various plugins for Konqueror";
-    license = "GPL";
-    homepage = http://kde.org/;
-    maintainers = [ maintainers.phreedom ];
-    platforms =  kdelibs.meta.platforms;
-  };
-}
diff --git a/pkgs/applications/networking/browsers/konq-plugins/qt47.patch b/pkgs/applications/networking/browsers/konq-plugins/qt47.patch
deleted file mode 100644
index 2039d293eb3..00000000000
--- a/pkgs/applications/networking/browsers/konq-plugins/qt47.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- konq-plugins/adblock/adblock.cpp	2010-02-11 22:12:41.000000000 +0000
-+++ konq-plugins/adblock/adblock.cpp	2010-07-26 17:12:20.639786002 +0100
-@@ -300,7 +300,7 @@
- // ----------------------------------------------------------------------------
- 
- AdElement::AdElement() :
--  m_url(0), m_category(0), m_type(0), m_blocked(false) {}
-+  m_url(QString()), m_category(QString()), m_type(QString()), m_blocked(false) {}
- 
- AdElement::AdElement(const QString &url, const QString &category,
- 		     const QString &type, bool blocked, const DOM::Node&node) :
diff --git a/pkgs/applications/networking/browsers/kwebkitpart/default.nix b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
new file mode 100644
index 00000000000..e9babf787bd
--- /dev/null
+++ b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchgit, kdelibs }:
+
+stdenv.mkDerivation rec {
+  name = "kwebkitpart-1.3.2";
+
+  src = fetchgit {
+    url = git://anongit.kde.org/kwebkitpart;
+    rev = "292f32fda933b2ead5a61ff1ec457f839fad5c85";
+    sha256 = "1b2jar9b1yb3gy9fnq8dn2n4z8lffb6pfrj9jc4rjzv5b3rwh1ak";
+  };
+
+  buildInputs = [ kdelibs ];
+
+  meta = with stdenv.lib; {
+    platforms = platforms.linux;
+    maintainers = [ maintainers.phreedom ];
+    description = "a WebKit KPart for Konqueror, Akregator and other KDE applications";
+    homepage = https://projects.kde.org/projects/extragear/base/kwebkitpart;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix
index 49bc93b80d2..7efdf7ed015 100644
--- a/pkgs/applications/networking/browsers/links2/default.nix
+++ b/pkgs/applications/networking/browsers/links2/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals enableX11 [ libX11 libXau libXt ]
     ++ stdenv.lib.optional enableDirectFB [ directfb ];
 
-  buildNativeInputs = [ pkgconfig bzip2 ];
+  nativeBuildInputs = [ pkgconfig bzip2 ];
 
   configureFlags = [ "--with-ssl" ]
     ++ stdenv.lib.optional (enableX11 || enableFB || enableDirectFB) "--enable-graphics"
diff --git a/pkgs/applications/networking/browsers/lynx/default.nix b/pkgs/applications/networking/browsers/lynx/default.nix
index c0175fc6a70..63760c94426 100644
--- a/pkgs/applications/networking/browsers/lynx/default.nix
+++ b/pkgs/applications/networking/browsers/lynx/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   configureFlags = if sslSupport then "--with-ssl" else "";
   
   buildInputs = [ ncurses gzip ] ++ stdenv.lib.optional sslSupport openssl;
-  buildNativeInputs = [ ncurses ];
+  nativeBuildInputs = [ ncurses ];
 
   crossAttrs = {
     configureFlags = "--enable-widec" +
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
deleted file mode 100644
index b0f8a2638c1..00000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-source $stdenv/setup
-
-dontStrip=1
-dontPatchELF=1
-sourceRoot=$TMPDIR
-
-unpackPhase() {
-    tar xvzf $src;
-    for a in *; do
-	if [ -d $a ]; then
-		cd $a
-		break
-	fi
-    done
-}
-
-installPhase() {
-    mkdir -p $out/lib/mozilla/plugins
-    cp -pv libflashplayer.so $out/lib/mozilla/plugins
-    patchelf --set-rpath "$rpath" $out/lib/mozilla/plugins/libflashplayer.so
-}
-
-genericBuild
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
deleted file mode 100644
index ad6867ab5be..00000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
+++ /dev/null
@@ -1,88 +0,0 @@
-{ stdenv
-, fetchurl
-, zlib
-, alsaLib
-, curl
-, nss
-, nspr
-, fontconfig
-, freetype
-, expat
-, libX11
-, libXext
-, libXrender
-, libXt
-, gtk 
-, glib
-, pango
-, cairo
-, atk
-, gdk_pixbuf
-, debug ? false
-
-/* you have to add ~/mm.cfg :
-
-    TraceOutputFileEnable=1
-    ErrorReportingEnable=1
-    MaxWarnings=1
-
-  in order to read the flash trace at ~/.macromedia/Flash_Player/Logs/flashlog.txt
-  Then FlashBug (a FireFox plugin) shows the log as well
-*/
-
-}:
-
-let
-
-  src =
-    if stdenv.system == "x86_64-linux" then
-      if debug then
-        # no plans to provide a x86_64 version:
-        # http://labs.adobe.com/technologies/flashplayer10/faq.html
-        throw "no x86_64 debugging version available"
-      else {
-        # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "10.3.181.34";
-        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz;
-        sha256 = "1w2zs2f0q1vpx4ia9pj1k4p830dwz7ypyn302mi48wcpz1wzc1gg";
-      }
-    else if stdenv.system == "i686-linux" then
-      if debug then {
-        # The debug version also contains a player
-        version = "10.2_p2-debug-r092710";
-        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p2_32bit_debug_linux_092710.tar.gz;
-        sha256 = "11w3mxa39l4mnlsqzlwbdh1sald549afyqbx2kbid7in5qzamlcc";
-      } else {
-        version = "10.3.183.10";
-        url = http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz;
-        sha256 = "0fj51dg0aa813b44yn8dvmmvw4qwi8vbi0x8n1bcqrcld3sbpmfz";
-      }
-    else throw "Flash Player is not supported on this platform";
-
-in
-
-stdenv.mkDerivation {
-  name = "flashplayer-${src.version}";
-
-  builder = ./builder.sh;
-  
-  src = fetchurl { inherit (src) url sha256; };
-
-  inherit zlib alsaLib;
-
-  passthru = {
-    mozillaPlugin = "/lib/mozilla/plugins";
-  };
-
-  rpath = stdenv.lib.makeLibraryPath
-    [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
-      libXext libXrender libXt gtk glib pango atk cairo gdk_pixbuf
-    ];
-
-  buildPhase = ":";
-
-  meta = {
-    description = "Adobe Flash Player browser plugin";
-    homepage = http://www.adobe.com/products/flashplayer/;
-  };
-}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
index 260edd360c6..10faa983cc1 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
@@ -3,7 +3,6 @@
 , zlib
 , alsaLib
 , curl
-, nss
 , nspr
 , fontconfig
 , freetype
@@ -11,13 +10,16 @@
 , libX11
 , libXext
 , libXrender
+, libXcursor
 , libXt
-, gtk 
+, libvdpau
+, gtk
 , glib
 , pango
 , cairo
 , atk
 , gdk_pixbuf
+, nss
 , debug ? false
 
 /* you have to add ~/mm.cfg :
@@ -40,11 +42,11 @@ let
         # no plans to provide a x86_64 version:
         # http://labs.adobe.com/technologies/flashplayer10/faq.html
         throw "no x86_64 debugging version available"
-      else {
+      else rec {
         # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "11.1.102.55";
-        url = http://fpdownload.macromedia.com/get/flashplayer/pdc/11.1.102.55/install_flash_player_11_linux.x86_64.tar.gz;
-        sha256 = "09swldv174z23pnixy9fxkw084qkl3bbrxfpf159fbjdgvwihn1l";
+        version = "11.2.202.273";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.x86_64.tar.gz";
+        sha256 = "0c15nszgg7zsv00n2qxha5zf8hmyf8i6byvhalnh5x46mr0rkbv9";
       }
     else if stdenv.system == "i686-linux" then
       if debug then {
@@ -52,10 +54,10 @@ let
         version = "11.1";
         url = http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_plugin_debug.i386.tar.gz;
         sha256 = "1z3649lv9sh7jnwl8d90a293nkaswagj2ynhsr4xmwiy7c0jz2lk";
-      } else {
-        version = "11.1.102.55";
-        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/11.1.102.55/install_flash_player_11_linux.i386.tar.gz";
-        sha256 = "08zdnl06lqyk2k3yq4lgphqd3ci2267448mghlv1p0hjrdq253k7";
+      } else rec {
+        version = "11.2.202.273";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.i386.tar.gz";
+        sha256 = "1gb14xv7gbq57qg1hxmrnryaw6xgmkg54ql5hr7q6szplj65wvmd";
       }
     else throw "Flash Player is not supported on this platform";
 
@@ -65,7 +67,7 @@ stdenv.mkDerivation {
   name = "flashplayer-${src.version}";
 
   builder = ./builder.sh;
-  
+
   src = fetchurl { inherit (src) url sha256; };
 
   inherit zlib alsaLib;
@@ -75,8 +77,9 @@ stdenv.mkDerivation {
   };
 
   rpath = stdenv.lib.makeLibraryPath
-    [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
-      libXext libXrender libXt gtk glib pango atk cairo gdk_pixbuf
+    [ zlib alsaLib curl nspr fontconfig freetype expat libX11
+      libXext libXrender libXcursor libXt gtk glib pango atk cairo gdk_pixbuf
+      libvdpau nss
     ];
 
   buildPhase = ":";
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh
deleted file mode 100644
index 86ecd2c3345..00000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $stdenv/setup
-
-dontStrip=1
-dontPatchELF=1
-
-sourceRoot=.
-
-installPhase() {
-    mkdir -p $out/lib/mozilla/plugins
-    cp -p libflashplayer.so $out/lib/mozilla/plugins
-    patchelf --set-rpath $rpath $out/lib/mozilla/plugins/libflashplayer.so
-}
-
-genericBuild
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix
deleted file mode 100644
index 913aa985583..00000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv
-, fetchurl
-, zlib
-, alsaLib
-, nss
-, nspr
-, fontconfig
-, freetype
-, expat
-, libX11
-, libXext
-, libXrender
-, libXt
-, gtk
-, glib
-, pango
-, atk
-
-, customSrc ? null
-}:
-
-assert stdenv.system == "i686-linux";
-
-stdenv.mkDerivation {
-  name = "flashplayer-9.0.124.0";
-
-  builder = ./builder.sh;
-  src = if customSrc == null then
-    fetchurl {
-      url = http://download.macromedia.com/pub/flashplayer/installers/current/9/install_flash_player_9.tar.gz;
-      sha256 = "1cnsjgmy7rwj3spzb5mmpmvzxjp435jisl0dd8s4rf4xskyy6d6r";
-    }
-  else customSrc;
-
-  inherit zlib alsaLib;
-
-  passthru = {
-    mozillaPlugin = "/lib/mozilla/plugins";
-  };
-
-  rpath = stdenv.lib.makeLibraryPath [zlib alsaLib nss nspr fontconfig freetype expat libX11 libXext libXrender libXt gtk glib pango atk] ;
-
-  meta = {
-    description = "Adobe Flash Player browser plugin";
-    homepage = http://www.adobe.com/products/flashplayer/;
-  };
-}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
index 0ff7c92d3d8..44f191e54f1 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, glib, dbus, dbus_glib, browser, x11
-, GConf, gnome_mplayer, MPlayer, gmtk
+, GConf, gnome_mplayer, mplayer, gmtk
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   # browser's $PATH.
   postInstall =
     ''
-      echo "${gnome_mplayer}/bin:${MPlayer}/bin" > $out/${passthru.mozillaPlugin}/extra-bin-path
+      echo "${gnome_mplayer}/bin:${mplayer}/bin" > $out/${passthru.mozillaPlugin}/extra-bin-path
     '';
 
   passthru.mozillaPlugin = "/lib/mozilla/plugins";
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
index ff199791bba..8cc62aa02db 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, rpm, cpio, mesa, xorg, cairo
 , libpng12, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
-, dbus_glib, alsaLib, pulseaudio, udev
+, dbus_glib, alsaLib, pulseaudio, udev, pango
 }:
 
 with stdenv.lib;
@@ -37,24 +37,28 @@ let
       dbus_glib
       udev
       curl
+      pango
+      cairo
     ];
 
 in
 
 stdenv.mkDerivation rec {
   name = "google-talk-plugin-${version}";
-  version = "3.2.4.0";
+  # Use the following to determine the current upstream version:
+  # curl -s http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-amd64/Packages | sed -nr 's/^Version: *([^ ]+)-1$/\1/p'
+  version = "3.17.0.0";
 
   src =
     if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
-        sha256 = "0hd8iyv092fr4bz760xjawiad581hphddv608d0dvzy2bhnl17g1";
+        sha256 = "1annx2zhxgn3wl468w7sk93k4xhmnx5bbdjr0d1ar7979hvrdl1x";
       }
     else if stdenv.system == "i686-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
-        sha256 = "13vqs4k16a6bzc5i4zpnakh31nkdqp7m9cv7p16r1sq5smv1331i";
+        sha256 = "13fza920vg3qig2pnlr65mzcmmy3izla95zdpa3pk28qlfij0ryc";
       }
     else throw "Google Talk does not support your platform.";
 
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
new file mode 100644
index 00000000000..5587f3b732c
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchurl, which, pkgconfig, file, glib, gtk2, gtk3, curl}:
+let
+  srcData = # Generated upstream information 
+  rec {
+    baseName="nspluginwrapper";
+    version="1.4.4";
+    name="${baseName}-${version}";
+    hash="1fxjz9ifhw0drm12havlsl4jpsq1nv930gqa005kgddv5pa99vgj";
+    url="http://nspluginwrapper.org/download/nspluginwrapper-1.4.4.tar.gz";
+  };
+in
+stdenv.mkDerivation rec {
+  inherit (srcData) name version;
+
+  src = fetchurl{
+    inherit (srcData) url;
+    sha256 = srcData.hash;
+  };
+
+  preConfigure = ''
+    sed -e 's@/usr/bin/@@g' -i configure
+    sed -e '/gthread[.]h/d' -i src/npw-player.c
+    export configureFlags="$configureFlags --target-cpu=$(uname -m)"
+  '';
+
+  buildInputs = [which pkgconfig file glib gtk2 gtk3 curl];
+
+  meta = {
+    description = ''A wrapper to run browser plugins out-of-process'';
+    homepage = "http://nspluginwrapper.org/";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    inherit (srcData) version;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream
new file mode 100644
index 00000000000..62831613a2e
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream
@@ -0,0 +1,4 @@
+name nspluginwrapper
+target default.nix
+url http://nspluginwrapper.org/download/
+version_link /nspluginwrapper-[0-9]+
diff --git a/pkgs/applications/networking/browsers/netsurf/libnsgif.nix b/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
index 2ef8e8ae432..63ae2ef86d4 100644
--- a/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
+++ b/pkgs/applications/networking/browsers/netsurf/libnsgif.nix
@@ -1,6 +1,6 @@
 args: with args;
 stdenv.mkDerivation {
-  name = "libnsbmp-0.0.1";
+  name = "libnsgif-0.0.1";
 
   src = fetchurl {
     url = http://www.netsurf-browser.org/projects/releases/libnsgif-0.0.1-src.tar.gz;
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   installPhase = "make PREFIX=$out install";
   buildInputs = [];
 
-  meta = { 
+  meta = {
     description = "Libnsbmp is a decoding library for gif image file formats"; # used by netsurf
     homepage = http://www.netsurf-browser.org/projects/libnsgif/;
     license = "MIT";
diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix
index 8c3cd9f11cd..80b09bcd8a8 100644
--- a/pkgs/applications/networking/browsers/opera/default.nix
+++ b/pkgs/applications/networking/browsers/opera/default.nix
@@ -13,18 +13,18 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "opera-12.00-1467";
+  name = "opera-12.12-1707";
 
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "${mirror}/linux/1200/${name}.i386.linux.tar.xz";
-        sha256 = "d5683f5a4cf0cfd9ce715359b77909c7923c85bcec98513907c1844285356fdc";
+        url = "${mirror}/linux/1212/${name}.i386.linux.tar.xz";
+        sha256 = "1jkrhxjxa5kz4bhyma0zlnsszdn84sq4pks3x8bfcayn12m6yxkz";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "${mirror}/linux/1200/${name}.x86_64.linux.tar.xz";
-        sha256 = "7c3dbe122b1fd20123f1b48a420dea080cc24ede4183d47d66b383c2b7ca5051";
+        url = "${mirror}/linux/1212/${name}.x86_64.linux.tar.xz";
+        sha256 = "0acizxgyqblcvl91dwmvi937fi1kw6whz5qgxyl1fkygbayji90v";
       }
     else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
 
@@ -73,6 +73,10 @@ stdenv.mkDerivation rec {
   postFixup = ''
     oldRPATH=`patchelf --print-rpath $out/lib/opera/opera`
     patchelf --set-rpath $oldRPATH:${cups}/lib $out/lib/opera/opera
+
+    # This file should normally require a gtk-update-icon-cache -q /usr/share/icons/hicolor command
+    # It have no reasons to exist in a redistribuable package
+    rm $out/share/icons/hicolor/icon-theme.cache
     '';
 
   meta = {
diff --git a/pkgs/applications/networking/browsers/rekonq/default.nix b/pkgs/applications/networking/browsers/rekonq/default.nix
index 791b73c9c78..c8542ad7a52 100644
--- a/pkgs/applications/networking/browsers/rekonq/default.nix
+++ b/pkgs/applications/networking/browsers/rekonq/default.nix
@@ -1,16 +1,18 @@
-{ stdenv, fetchurl, kdelibs, gettext, pkgconfig }:
+{ stdenv, fetchurl, kde4, gettext, pkgconfig, shared_desktop_ontologies, qca2, qoauth }:
+
+assert builtins.compareVersions "4.8.3" kde4.release != 1; # https://bugs.kde.org/show_bug.cgi?id=306077
 
 stdenv.mkDerivation rec {
-  name = "rekonq-0.9.0-1";
+  name = "rekonq-1.70"; # >=1.80 need kde >=4.9.0
 
   src = fetchurl {
-    url = "mirror://sf/rekonq/${name}.tar.bz2";
-    sha256 = "0vri6wdxxi7qkcjpgvscwa7m3ysy62jns924d07arvy8bmg5whc5";
+    url = "mirror://sourceforge/rekonq/${name}.tar.bz2";
+    sha256 = "05zqm329vajsn32l5b5nlbw92gl3irdcx8kifr4y921i9bkzigad";
   };
 
-  buildInputs = [ kdelibs ];
+  buildInputs = [ kde4.kdelibs qca2 qoauth ];
 
-  buildNativeInputs = [ gettext pkgconfig ];
+  nativeBuildInputs = [ gettext pkgconfig shared_desktop_ontologies ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/applications/networking/browsers/uzbl/default.nix b/pkgs/applications/networking/browsers/uzbl/default.nix
index b85ad0e085e..4c6458d909f 100644
--- a/pkgs/applications/networking/browsers/uzbl/default.nix
+++ b/pkgs/applications/networking/browsers/uzbl/default.nix
@@ -3,15 +3,16 @@ let
   fetchgit = a.fetchgit;
 
   buildInputs = with a; [
-    libsoup pkgconfig webkit gtk3 makeWrapper
-    kbproto
+    libsoup pkgconfig webkit gtk makeWrapper
+    kbproto glib pango cairo gdk_pixbuf atk
+    python3
   ];
 in
 rec {
   src = fetchgit {
     url = "https://github.com/Dieterbe/uzbl.git";
-    rev = "dcb3b4e1fcff682b412cfe5875f7054b97380d08";
-    sha256 = "f7b2b2903c01c9cfbd99bd94783002e1580d8092ff6022bb5aed3f999ff6e468";
+    rev = "refs/tags/2012.05.14";
+    sha256 = "1crvikb0qqsx5qb003i4w7ywh72psl37gjslrj5hx2fd2f215l0l";
   };
 
   name = "uzbl-git";
@@ -35,7 +36,7 @@ rec {
       --prefix GIO_EXTRA_MODULES : ${a.glib_networking}/lib/gio/modules
     '';
 
-  installFlags = "PREFIX=$out";
+  installFlags = "PREFIX=$out PYINSTALL_EXTRA=\"--prefix=$out\"";
       
   meta = {
     description = "Tiny externally controllable webkit browser";
diff --git a/pkgs/applications/networking/browsers/vimprobable2/default.nix b/pkgs/applications/networking/browsers/vimprobable2/default.nix
index 2402d2a902b..ee8e4b8434a 100644
--- a/pkgs/applications/networking/browsers/vimprobable2/default.nix
+++ b/pkgs/applications/networking/browsers/vimprobable2/default.nix
@@ -1,17 +1,26 @@
-{ stdenv, fetchurl, makeWrapper, glib_networking, gtk, libsoup, libX11, perl,
-  pkgconfig, webkit }:
+{ stdenv, fetchurl, makeWrapper, glib, glib_networking, gtk, libsoup, libX11, perl,
+  pkgconfig, webkit, gsettings_desktop_schemas }:
 
-stdenv.mkDerivation {
-  name = "vimprobable2-1.0.2";
+stdenv.mkDerivation rec {
+  version = "1.2.1";
+  name = "vimprobable2-${version}";
   src = fetchurl {
-    url = "mirror://sourceforge/vimprobable/vimprobable2_1.0.2.tar.bz2";
-    sha256 = "19gwlfv0lczbns73xg3637q7ixly62y3ijccnv0m1bqaqxjl4v8x";
+    url = "mirror://sourceforge/vimprobable/vimprobable2_${version}.tar.bz2";
+    sha256 = "19zx1k3s2gnhzzd2wpyqsk151w9p52ifl64xaz9a6qkgvrxlli8p";
   };
+
+  # Nixos default ca bundle
+  patchPhase = ''
+    sed -i s,/etc/ssl/certs/ca-certificates.crt,/etc/ca-bundle.crt, config.h
+  '';
+
   buildInputs = [ makeWrapper gtk libsoup libX11 perl pkgconfig webkit ];
+
   installPhase = ''
     make PREFIX=/ DESTDIR=$out install
-    wrapProgram "$out/bin/vimprobable2" --prefix GIO_EXTRA_MODULES : \
-      ${glib_networking}/lib/gio/modules
+    wrapProgram "$out/bin/vimprobable2" \
+      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share"
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix
index 2a05e920d5f..5953111fad5 100644
--- a/pkgs/applications/networking/browsers/w3m/default.nix
+++ b/pkgs/applications/networking/browsers/w3m/default.nix
@@ -1,12 +1,15 @@
 { stdenv, fetchurl
 , sslSupport ? true
 , graphicsSupport ? false
+, mouseSupport ? false
 , ncurses, openssl ? null, boehmgc, gettext, zlib
-, imlib2 ? null, x11 ? null
+, imlib2 ? null, x11 ? null, fbcon ? null
+, gpm ? null
 }:
 
 assert sslSupport -> openssl != null;
-assert graphicsSupport -> x11 != null;
+assert graphicsSupport -> imlib2 != null && (x11 != null || fbcon != null);
+assert mouseSupport -> gpm != null;
 
 stdenv.mkDerivation rec {
   name = "w3m-0.5.3";
@@ -16,21 +19,26 @@ stdenv.mkDerivation rec {
     sha256 = "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579";
   };
 
-  # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
-  # alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
-  patches = stdenv.lib.optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ];
+  patches = [ ./glibc214.patch ]
+    # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
+    # alpha. At the time of writing this, boehm-gc-7.1 is the last stable.
+    ++ stdenv.lib.optional (boehmgc.name != "boehm-gc-7.1") [ ./newgc.patch ];
 
   buildInputs = [ncurses boehmgc gettext zlib]
     ++ stdenv.lib.optional sslSupport openssl
-    ++ stdenv.lib.optionals graphicsSupport [imlib2 x11];
+    ++ stdenv.lib.optional mouseSupport gpm
+    ++ stdenv.lib.optionals graphicsSupport [imlib2 x11 fbcon];
 
-  configureFlags = "--with-ssl=${openssl} --with-gc=${boehmgc}";
+  configureFlags = "--with-ssl=${openssl} --with-gc=${boehmgc}"
+    + stdenv.lib.optionalString graphicsSupport " --enable-image=x11,fb";
 
   preConfigure = ''
     substituteInPlace ./configure --replace "/lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /lib64 /usr/lib64" /no-such-path
     substituteInPlace ./configure --replace /usr /no-such-path
   '';
 
+  enableParallelBuilding = false;
+
   meta = {
     homepage = http://w3m.sourceforge.net/;
     description = "A text-mode web browser";
diff --git a/pkgs/applications/networking/browsers/w3m/glibc214.patch b/pkgs/applications/networking/browsers/w3m/glibc214.patch
new file mode 100644
index 00000000000..37e466e2106
--- /dev/null
+++ b/pkgs/applications/networking/browsers/w3m/glibc214.patch
@@ -0,0 +1,60 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/www-client/w3m/files/w3m-0.5.3-glibc214.patch?revision=1.1
+
+--- a/istream.c.~1.27.~	2011-01-04 18:22:22.000000000 +0900
++++ b/istream.c	2011-06-24 08:15:23.522990618 +0900
+@@ -22,8 +22,8 @@
+ static void basic_close(int *handle);
+ static int basic_read(int *handle, char *buf, int len);
+ 
+-static void file_close(struct file_handle *handle);
+-static int file_read(struct file_handle *handle, char *buf, int len);
++static void file_close(struct afile_handle *handle);
++static int file_read(struct afile_handle *handle, char *buf, int len);
+ 
+ static int str_read(Str handle, char *buf, int len);
+ 
+@@ -114,7 +114,7 @@
+     stream = New(union input_stream);
+     init_base_stream(&stream->base, STREAM_BUF_SIZE);
+     stream->file.type = IST_FILE;
+-    stream->file.handle = New(struct file_handle);
++    stream->file.handle = New(struct afile_handle);
+     stream->file.handle->f = f;
+     if (closep)
+ 	stream->file.handle->close = closep;
+@@ -658,13 +658,13 @@
+ }
+ 
+ static void
+-file_close(struct file_handle *handle)
++file_close(struct afile_handle *handle)
+ {
+     handle->close(handle->f);
+ }
+ 
+ static int
+-file_read(struct file_handle *handle, char *buf, int len)
++file_read(struct afile_handle *handle, char *buf, int len)
+ {
+     return fread(buf, 1, len, handle->f);
+ }
+--- a/istream.h.~1.12.~	2003-10-21 01:41:56.000000000 +0900
++++ b/istream.h	2011-06-24 08:15:54.392991144 +0900
+@@ -20,7 +20,7 @@
+ 
+ typedef struct stream_buffer *StreamBuffer;
+ 
+-struct file_handle {
++struct afile_handle {
+     FILE *f;
+     void (*close) ();
+ };
+@@ -53,7 +53,7 @@
+ 
+ struct file_stream {
+     struct stream_buffer stream;
+-    struct file_handle *handle;
++    struct afile_handle *handle;
+     char type;
+     char iseos;
+     int (*read) ();
diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix
index 7d475a67558..ef2f16e3193 100644
--- a/pkgs/applications/networking/cluster/hadoop/default.nix
+++ b/pkgs/applications/networking/cluster/hadoop/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
 
-  name = "hadoop-2.0.1-alpha";
+  name = "hadoop-2.0.2-alpha";
 
   src = fetchurl {
     url = "mirror://apache/hadoop/common/${name}/${name}.tar.gz";
-    sha256 = "4e5f4fa1574ee58fd6d59a220b66578fc2cf62c229120eeed07f2880c86f0e59";
+    sha256 = "1r7ailmqhny3pl5nb8bcblnhckszy6hb9n58kwa3s4b8qfk87gkb";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/networking/dropbox-cli/default.nix b/pkgs/applications/networking/dropbox-cli/default.nix
new file mode 100644
index 00000000000..b298b3c9df9
--- /dev/null
+++ b/pkgs/applications/networking/dropbox-cli/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, coreutils, fetchurl, python }:
+
+stdenv.mkDerivation {
+  name = "dropbox-cli";
+
+  src = fetchurl {
+    url = "https://linux.dropbox.com/packages/dropbox.py";
+    sha256 = "1x46i0aplah4a2nqglb8byl3c60w7h1cjja62myxj2dpxyv7fydy";
+  };
+
+  buildInputs = [ coreutils python ];
+
+  phases = "installPhase fixupPhase";
+  
+  installPhase = ''
+    mkdir -pv $out/bin/
+    cp $src $out/bin/dropbox-cli
+  '';
+
+  fixupPhase = ''
+    substituteInPlace $out/bin/dropbox-cli \
+      --replace "/usr/bin/python" ${python}/bin/python \
+      --replace "use dropbox help" "use dropbox-cli help"
+    
+    chmod +x $out/bin/dropbox-cli
+  '';
+  
+  meta = {
+    homepage = http://dropbox.com;
+    description = "Command line client for the dropbox daemon.";
+    license = stdenv.lib.licenses.gpl3;
+    # NOTE: Dropbox itself only works on linux, so this is ok.
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index f1a906f9250..4e911bc3345 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -16,13 +16,19 @@
 # replace these libraries with the appropriate ones in
 # nixpkgs.
 
-# note: there is a i686 version available as well
-assert stdenv.system == "x86_64-linux";
-
 let
-
-  version = "1.4.0";
-  sha256 = "93933d95cce5956ed99342fa342d01ce2bde8d2e4339afb97f23e0c0ec98875e";
+  arch = if stdenv.system == "x86_64-linux" then "x86_64"
+    else if stdenv.system == "i686-linux" then "x86"
+    else throw "Dropbox client for: ${stdenv.system} not supported!";
+    
+  interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
+    else if stdenv.system == "i686-linux" then "ld-linux.so.2"
+    else throw "Dropbox client for: ${stdenv.system} not supported!";
+
+  version = "1.4.21";
+  sha256 = if stdenv.system == "x86_64-linux" then "94073842f4a81feee80bca590e1df73fc3cab47ba879407ceba2de48f30d84e2"
+    else if stdenv.system == "i686-linux" then "121v92m20l73xjmzng3vmcp4zsp9mlbcfia73f5py5y74kndb2ap"
+    else throw "Dropbox client for: ${stdenv.system} not supported!";
 
   # relative location where the dropbox libraries are stored
   appdir = "opt/dropbox";
@@ -42,7 +48,7 @@ let
     exec = "dropbox";
     comment = "Online directories";
     desktopName = "Dropbox";
-    genericName = "Online storage";    
+    genericName = "Online storage";
     categories = "Application;Internet;";
   };
 
@@ -52,8 +58,8 @@ in stdenv.mkDerivation {
     name = "dropbox-${version}.tar.gz";
     # using version-specific URL so if the version is no longer available,
     # build will fail without having to finish downloading first
-    # url = "http://www.dropbox.com/download?plat=lnx.x86_64";
-    url = "http://dl-web.dropbox.com/u/17/dropbox-lnx.x86_64-${version}.tar.gz";
+    # url = "http://www.dropbox.com/download?plat=lnx.${arch}";
+    url = "http://dl-web.dropbox.com/u/17/dropbox-lnx.${arch}-${version}.tar.gz";
     inherit sha256;
   };
 
@@ -65,26 +71,26 @@ in stdenv.mkDerivation {
 
   installPhase = ''
     ensureDir "$out/${appdir}"
-    cp -r .dropbox-dist/* "$out/${appdir}/"
+    cp -r ".dropbox-dist/"* "$out/${appdir}/"
     ensureDir "$out/bin"
     ln -s "$out/${appdir}/dropbox" "$out/bin/dropbox"
 
-    patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 \
+    patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} \
       "$out/${appdir}/dropbox"
 
-    RPATH=${ldpath}:${gcc.gcc}/lib64:$out/${appdir}
+    RPATH=${ldpath}:${gcc.gcc}/lib:$out/${appdir}
     echo "updating rpaths to: $RPATH"
     find "$out/${appdir}" -type f -a -perm +0100 \
       -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
 
     ensureDir "$out/share/applications"
-    cp ${desktopItem}/share/applications/* $out/share/applications
+    cp "${desktopItem}/share/applications/"* $out/share/applications
   '';
 
   buildInputs = [ patchelf ];
 
   meta = {
+    homepage = "http://www.dropbox.com";
     description = "Online stored folders (daemon version)";
-    homepage = http://www.dropbox.com;
   };
 }
diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix
index 327e4c4a9c5..8208da621af 100644
--- a/pkgs/applications/networking/esniper/default.nix
+++ b/pkgs/applications/networking/esniper/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, curl, coreutils, gawk, bash, which }:
 
 stdenv.mkDerivation {
-  name = "esniper-2.27.0";
+  name = "esniper-2.28.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/esniper/esniper-2-27-0.tgz";
-    sha256 = "0ca9946395be8958d3eb28c9abc4a1a4d4c9134e4b6b3c3816f4631e3be25c02";
+    url = "mirror://sourceforge/esniper/esniper-2-28-0.tgz";
+    sha256 = "c2b0ccb757616b32f2d6cf54a4a5e367405fa7bcd6e6ed11835fe4f8a06a016b";
   };
 
   buildInputs = [openssl curl];
diff --git a/pkgs/applications/networking/ftp/filezilla/default.nix b/pkgs/applications/networking/ftp/filezilla/default.nix
new file mode 100644
index 00000000000..24fdd105341
--- /dev/null
+++ b/pkgs/applications/networking/ftp/filezilla/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, dbus, gnutls2, wxGTK28, libidn, tinyxml, gettext, pkgconfig, xdg_utils, gtk2, sqlite }:
+
+let version = "3.6.0.2"; in
+stdenv.mkDerivation {
+  name = "filezilla-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/filezilla/FileZilla_Client/${version}/FileZilla_${version}_src.tar.bz2";
+    sha256 = "01n6k1q21i21451rdx3rgc4hhxghdn5b0ldzpjsp44ipgww5wsjk";
+  };
+
+  configureFlags = [
+    "--disable-manualupdatecheck"
+  ];
+
+  buildInputs = [ dbus gnutls2 wxGTK28 libidn tinyxml gettext pkgconfig xdg_utils gtk2 sqlite ];
+
+  meta = {
+    homepage = "http://filezilla-project.org/";
+    description = "Graphical FTP, FTPS and SFTP client";
+    license = "GPLv2";
+
+    longDescription = ''
+      FileZilla Client is a free, open source FTP client. It supports
+      FTP, SFTP, and FTPS (FTP over SSL/TLS). The client is available
+      under many platforms, binaries for Windows, Linux and Mac OS X are
+      provided.
+    '';
+  };
+}
diff --git a/pkgs/applications/networking/ids/bro/default.nix b/pkgs/applications/networking/ids/bro/default.nix
new file mode 100644
index 00000000000..6e70e106d26
--- /dev/null
+++ b/pkgs/applications/networking/ids/bro/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, cmake, flex, bison, openssl, libpcap, perl, zlib, file, curl, geoip, gperftools }:
+
+stdenv.mkDerivation rec {
+  name = "bro-2.1";
+  
+  src = fetchurl {
+    url = "http://www.bro.org/downloads/release/${name}.tar.gz";
+    sha256 = "1q2mm7rbgjcn01na2wm5fdfdm9pggzgljxj0n127s93fip3vg0qd";
+  };
+  
+  buildInputs = [ cmake flex bison openssl libpcap perl zlib file curl geoip gperftools ];
+
+  USER="something";
+
+  enableParallelBuilding = true;
+  
+  meta = {
+    description = "Bro is a powerful network analysis framework that is much different from the typical IDS you may know.";
+    homepage = http://www.bro.org/;
+    license = "BSD";
+  };
+}
diff --git a/pkgs/applications/networking/ids/daq/default.nix b/pkgs/applications/networking/ids/daq/default.nix
new file mode 100644
index 00000000000..92175bb23e9
--- /dev/null
+++ b/pkgs/applications/networking/ids/daq/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, flex, bison, libpcap}:
+
+stdenv.mkDerivation rec {
+  name = "daq-2.0.0";
+  
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = http://www.snort.org/downloads/2311;
+    sha256 = "0f0w5jfmx0n2sms4f2mfg984a27r7qh927vkd7fclvx9cbiwibzv";
+  };
+  
+  buildInputs = [ flex bison libpcap ];
+  
+  meta = {
+    description = "Data AcQuisition library (DAQ), for packet I/O";
+    homepage = http://www.snort.org;
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/applications/networking/ids/snort/default.nix b/pkgs/applications/networking/ids/snort/default.nix
new file mode 100644
index 00000000000..b674f3a83fb
--- /dev/null
+++ b/pkgs/applications/networking/ids/snort/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, libpcap, pcre, libdnet, daq, zlib, flex, bison}:
+
+stdenv.mkDerivation rec {
+  name = "snort-2.9.4.6";
+  
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = http://www.snort.org/downloads/2320;
+    sha256 = "1g5kn36l67a5m95h2shqwqbbjb6rgl3sf1bciakal2l4n6857ang";
+  };
+  
+  buildInputs = [ libpcap pcre libdnet daq zlib flex bison ];
+  
+  meta = {
+    description = "Snort is an open source network intrusion prevention and detection system (IDS/IPS)";
+    homepage = http://www.snort.org;
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/baresip/default.nix b/pkgs/applications/networking/instant-messengers/baresip/default.nix
new file mode 100644
index 00000000000..61cd62fefd4
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/baresip/default.nix
@@ -0,0 +1,45 @@
+{stdenv, fetchurl, zlib, openssl, libre, librem, pkgconfig
+, cairo, mpg123, gstreamer, gst_ffmpeg, gst_plugins_base, gst_plugins_bad
+, gst_plugins_good, alsaLib, SDL, libv4l, celt, libsndfile, srtp, ffmpeg
+, gsm, speex, portaudio, spandsp, libuuid
+}:
+stdenv.mkDerivation rec {
+  version = "0.4.3";
+  name = "baresip-${version}";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/baresip-${version}.tar.gz";
+    sha256 = "03vpzn0c3mybnwn84ha3yci780qsjm669dwja1srj0hbrq81rbil";
+  };
+  buildInputs = [zlib openssl libre librem pkgconfig
+    cairo mpg123 gstreamer gst_ffmpeg gst_plugins_base gst_plugins_bad gst_plugins_good
+    alsaLib SDL libv4l celt libsndfile srtp ffmpeg gsm speex portaudio spandsp libuuid
+    ];
+  makeFlags = [
+    "LIBRE_MK=${libre}/share/re/re.mk"
+    "LIBRE_INC=${libre}/include/re"
+    "LIBRE_SO=${libre}/lib"
+    "LIBREM_PATH=${librem}"
+    ''PREFIX=$(out)''
+    "USE_VIDEO=1"
+
+    "USE_ALSA=1" "USE_AMR=1" "USE_CAIRO=1" "USE_CELT=1" 
+    "USE_CONS=1" "USE_EVDEV=1" "USE_FFMPEG=1"  "USE_GSM=1" "USE_GST=1" 
+    "USE_L16=1" "USE_MPG123=1" "USE_OSS=1" "USE_PLC=1" 
+    "USE_PORTAUDIO=1" "USE_SDL=1" "USE_SNDFILE=1" "USE_SPEEX=1" 
+    "USE_SPEEX_AEC=1" "USE_SPEEX_PP=1" "USE_SPEEX_RESAMP=1" "USE_SRTP=1" 
+    "USE_STDIO=1" "USE_SYSLOG=1" "USE_UUID=1" "USE_V4L2=1" "USE_X11=1"
+
+    "USE_BV32=" "USE_COREAUDIO=" "USE_G711=" "USE_G722=" "USE_G722_1=" 
+    "USE_ILBC=" "USE_OPUS=" "USE_SILK=" 
+  ]
+  ++ stdenv.lib.optional (stdenv.gcc.gcc != null) "SYSROOT_ALT=${stdenv.gcc.gcc}"
+  ++ stdenv.lib.optional (stdenv.gcc.libc != null) "SYSROOT=${stdenv.gcc.libc}"
+  ;
+  NIX_CFLAGS_COMPILE='' -I${librem}/include/rem -I${gsm}/include/gsm '';
+  meta = {
+    homepage = "http://www.creytiv.com/baresip.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; bsd3;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
index 1d49e0d1ff7..457d3441b3a 100644
--- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
+++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gnutls, glib, pkgconfig, check, libotr }:
 
 stdenv.mkDerivation rec {
-  name = "bitlbee-3.0.3";
+  name = "bitlbee-3.2";
 
   src = fetchurl {
     url = "mirror://bitlbee/src/${name}.tar.gz";
-    sha256 = "09dgwfqznd2cnqraksivmh132nnl99gwgplynjmfsyyf6y4pbjl2";
+    sha256 = "1b43828e906f5450993353f2ebecc6c038f0261c4dc3f1722ebafa6ea3e62030";
   };
 
   buildInputs = [ gnutls glib pkgconfig libotr ]
diff --git a/pkgs/applications/networking/instant-messengers/centerim/default.nix b/pkgs/applications/networking/instant-messengers/centerim/default.nix
index 6a608e8d950..d746d54974a 100644
--- a/pkgs/applications/networking/instant-messengers/centerim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/centerim/default.nix
@@ -2,12 +2,18 @@
 , withGpg ? true, gpgme ? null}:
 
 stdenv.mkDerivation rec {
-  name = "centerim-4.22.10";
+  version = "4.22.10";
+  debPatch = "2";
+  name = "centerim-${version}";
 
   src = fetchurl {
     url = "http://centerim.org/download/releases/${name}.tar.gz";
     sha256 = "0viz86jflp684vfginhl6aaw4gh2qvalc25anlwljjl3kkmibklk";
   };
+  patches = fetchurl {
+    url = "mirror://debian/pool/main/c/centerim/centerim_${version}-${debPatch}.diff.gz";
+    sha256 = "18iz3hkvr31jsyznryvyldxm9ckyrpy9sczxikrnw2i2r1xyfj8m";
+  };
 
   buildInputs = [ openssl curl ncurses libjpeg ]
     ++ stdenv.lib.optional withGpg gpgme;
diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix
index bca70d14c00..d5902d14359 100644
--- a/pkgs/applications/networking/instant-messengers/gajim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix
@@ -1,48 +1,92 @@
-a :  
-let 
-  fetchurl = a.fetchurl;
-
-  version = a.lib.attrByPath ["version"] "0.14.1" a; 
-  buildInputs = with a; [
-    python pyGtkGlade gtk perl intltool dbus gettext
-    pkgconfig makeWrapper libglade pyopenssl libXScrnSaver
-    libXt xproto libXext xextproto libX11 gtkspell aspell
-    scrnsaverproto pycrypto pythonDBus pythonSexy 
-    docutils
-  ];
-in
-rec {
+{ stdenv, fetchurl, python, intltool, pkgconfig, libX11, gtk
+, ldns, pyopenssl, pythonDBus, pythonPackages
+
+, enableJingle ? true, farstream ? null, gst_plugins_bad ? null
+,                      libnice ? null
+, enableE2E ? true
+, enableRST ? true
+, enableSpelling ? true, gtkspell ? null
+, enableNotifications ? false
+, enableLaTeX ? false, texLive ? null
+}:
+
+assert enableJingle -> farstream != null && gst_plugins_bad != null
+                    && libnice != null;
+assert enableE2E -> pythonPackages.pycrypto != null;
+assert enableRST -> pythonPackages.docutils != null;
+assert enableSpelling -> gtkspell != null;
+assert enableNotifications -> pythonPackages.notify != null;
+assert enableLaTeX -> texLive != null;
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "gajim-${version}";
+  version = "0.15.4";
+
   src = fetchurl {
-    url = "http://www.gajim.org/downloads/0.14/gajim-${version}.tar.gz";
-    sha256 = "ef757572acf3f3d59408fd95b7ec99bc0e39c5b8c66bc61c78ba65e71c3d8e18";
+    url = "http://www.gajim.org/downloads/0.15/gajim-${version}.tar.gz";
+    sha256 = "1g4m5j777vqqdwqvr2m6l09ljjx65ilag45d5kfc78z7frm0cz7g";
   };
 
-  inherit buildInputs;
-  configureFlags = [];
-
-  preConfigure = a.fullDepEntry (''
-    export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$(toPythonPath ${a.pyGtkGlade})/gtk-2.0"
-    export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$(toPythonPath ${a.pygobject})/gtk-2.0"
-    sed -e '/-L[$]x_libraries/d' -i configure
-  '') ["addInputs" "doUnpack"];
-
-  fixScriptNames = a.fullDepEntry (''
-    mkdir "$out"/bin-wrapped
-    for i in "$out"/bin/.*-wrapped; do
-      name="$i"
-      name="''${name%-wrapped}"
-      name="''${name##*/.}"
-      mv "$i" "$out/bin-wrapped/$name"
-      sed -e 's^'"$i"'^'"$out/bin-wrapped/$name"'^' -i "$out/bin/$name"
-    done
-  '') ["wrapBinContentsPython"];
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["preConfigure" (a.doDump "1") "doConfigure" "doMakeInstall" "wrapBinContentsPython" "fixScriptNames"];
-
-  name = "gajim-" + version;
+  patches = [
+    (fetchurl {
+      name = "gajim-drill-srv.patch";
+      url = "https://projects.archlinux.org/svntogit/packages.git/"
+          + "plain/trunk/gajim-drill.patch?h=packages/gajim";
+      sha256 = "1k8zz3ns0l0kriffq41jgkv5ym6jvyd24171l7s98v9d81prdw1w";
+    })
+    (fetchurl {
+      name = "gajim-icon-index.patch";
+      url = "http://hg.gajim.org/gajim/raw-rev/b9ec78663dfb";
+      sha256 = "0w54hr5dq9y36val55kmh8d6cid7h4fs2nghx09714jylz2nyxxv";
+    })
+  ];
+
+  postPatch = ''
+    sed -i -e '0,/^[^#]/ {
+      /^[^#]/i export \\\
+        PYTHONPATH="'"$PYTHONPATH\''${PYTHONPATH:+:}\$PYTHONPATH"'" \\\
+        GST_PLUGIN_PATH="'"\$GST_PLUGIN_PATH''${GST_PLUGIN_PATH:+:}${""
+        }$GST_PLUGIN_PATH"'"
+    }' scripts/gajim.in
+
+    sed -i -e 's/return helpers.is_in_path('"'"'drill.*/return True/' \
+      src/features_window.py
+    sed -i -e "s|'drill'|'${ldns}/bin/drill'|" src/common/resolver.py
+  '' + optionalString enableSpelling ''
+    sed -i -e 's|=.*find_lib.*|= "${gtkspell}/lib/libgtkspell.so"|'   \
+      src/gtkspell.py
+  '' + optionalString enableLaTeX ''
+    sed -i -e "s|try_run(.'dvipng'|try_run(['${texLive}/bin/dvipng'|" \
+           -e "s|try_run(.'latex'|try_run(['${texLive}/bin/latex'|"   \
+           -e 's/tmpfd.close()/os.close(tmpfd)/'                      \
+           src/common/latex.py
+  '';
+
+  buildInputs = [
+    python intltool pkgconfig libX11
+    pythonPackages.pygobject pythonPackages.pyGtkGlade
+    pythonPackages.sqlite3 pythonPackages.pyasn1
+    pythonPackages.pyxdg
+    pyopenssl pythonDBus
+  ] ++ optionals enableJingle [ farstream gst_plugins_bad libnice ]
+    ++ optional enableE2E pythonPackages.pycrypto
+    ++ optional enableRST pythonPackages.docutils
+    ++ optional enableNotifications pythonPackages.notify
+    ++ optional enableLaTeX texLive;
+
+  postInstall = ''
+    install -m 644 -t "$out/share/gajim/icons/hicolor" \
+                      "icons/hicolor/index.theme"
+  '';
+
+  enableParallelBuilding = true;
+
   meta = {
-    description = "Jabber client with meta-contacts";
-    maintainers = [a.lib.maintainers.raskin];
+    homepage = "http://gajim.org/";
+    description = "Jabber client written in PyGTK";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.raskin maintainers.aszlig ];
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
new file mode 100644
index 00000000000..c0f76602b2b
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
@@ -0,0 +1,65 @@
+{ stdenv
+, fetchurl
+, libtool
+, libXext
+, libSM
+, libICE
+, libX11
+, libXft
+, libXau
+, libXdmcp
+, libXrender
+, freetype
+, fontconfig
+, openssl
+}:
+
+let
+  version = "1.94.407";
+
+  rpath = stdenv.lib.makeSearchPath "lib" [
+    stdenv.glibc
+    stdenv.gcc.gcc
+    libtool
+    libXext
+    libSM
+    libICE
+    libX11
+    libXft
+    libXau
+    libXdmcp
+    libXrender
+    freetype
+    fontconfig
+    openssl
+  ];
+
+  src = fetchurl {
+    url = "http://downloads.hipchat.com/linux/arch/hipchat-${version}-i686.pkg.tar.xz";
+    sha256 = "0kyjpa2ir066zqkvs1zmnx6kvl8v4jfl8h7bw110cgigwmiplk7k";
+  };
+in stdenv.mkDerivation {
+  name = "hipchat-${version}";
+
+  buildCommand = ''
+    tar xf ${src}
+    mkdir -p $out
+    mv opt/HipChat/lib $out
+    mv opt/HipChat/bin $out
+    mv usr/share $out
+    patchShebangs $out/bin
+    for file in $(find $out/lib -type f); do
+        patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $file || true
+        patchelf --set-rpath ${rpath}:$out/lib $file || true
+    done
+    substituteInPlace $out/share/applications/hipchat.desktop \
+      --replace /opt/HipChat/bin $out/bin
+  '';
+
+  meta = {
+    description = "HipChat Desktop Client";
+    homepage = http://www.hipchat.com;
+    license = stdenv.lib.licenses.unfree;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/kadu/default.nix b/pkgs/applications/networking/instant-messengers/kadu/default.nix
index 7dc66886af6..03cbb1ce073 100644
--- a/pkgs/applications/networking/instant-messengers/kadu/default.nix
+++ b/pkgs/applications/networking/instant-messengers/kadu/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation {
 
-  name = "kadu-0.10.1";
+  name = "kadu-0.12.2";
 
   src = fetchurl {
-    url = http://download.kadu.im/stable/kadu-0.10.1.tar.bz2;
-    sha256 = "0j88pyp2nqpc57j38zr135ypfiv4v329gfgiz9rdbqi8j26cyp7g";
+    url = http://download.kadu.im/stable/kadu-0.12.2.tar.bz2;
+    sha256 = "0rqhkiyn8c7jigpxmvwh7daxsgjxlvd16zjdss1azdzd9x2dbym1";
   };
 
   buildInputs = [ cmake qt4 libgadu libXScrnSaver libsndfile libX11 alsaLib aspell libidn qca2 phonon pkgconfig
@@ -21,8 +21,12 @@ stdenv.mkDerivation {
     patchShebangs .
   '';
 
-  # because I was not able to get those working
-  patches = [ ./disable_some_plugins.patch ];
+  # Disable the kadu plugins I wasn't able to get to work
+  patchPhase = ''
+    sed -i -e '/mpd_mediaplayer/d' \
+           -e '/encryption_ng/d'   \
+           -e '/encryption_ng_simlite/d' Plugins.cmake
+  '';
 
   NIX_LDFLAGS="-lX11";
 
diff --git a/pkgs/applications/networking/instant-messengers/kadu/disable_some_plugins.patch b/pkgs/applications/networking/instant-messengers/kadu/disable_some_plugins.patch
deleted file mode 100644
index 0ee06c21382..00000000000
--- a/pkgs/applications/networking/instant-messengers/kadu/disable_some_plugins.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-diff --git a/Plugins.cmake b/Plugins.cmake
-index ad63f20..c14a781 100644
---- a/Plugins.cmake
-+++ b/Plugins.cmake
-@@ -30,9 +30,9 @@ set (COMPILE_PLUGINS
- 
- # encryption
- 	# Encrypted chat support
--	encryption_ng
-+        # encryption_ng
- 	# OpenSSL encrypted chat support
--	encryption_ng_simlite
-+        # encryption_ng_simlite
- 
- # docking
- 	# Tray icon support (common part of all docking modules)
-@@ -104,9 +104,9 @@ if (UNIX)
- 
- 	# mediaplayer
- 		# MPD mediaplayer support
--		mpd_mediaplayer
-+		# mpd_mediaplayer
- 		# MPRIS Media Players support
--		mprisplayer_mediaplayer
-+                # mprisplayer_mediaplayer
- 	)
- endif (UNIX)
- 
diff --git a/pkgs/applications/networking/instant-messengers/linphone/default.nix b/pkgs/applications/networking/instant-messengers/linphone/default.nix
index 04e119afdb1..7bdb6cc1452 100644
--- a/pkgs/applications/networking/instant-messengers/linphone/default.nix
+++ b/pkgs/applications/networking/instant-messengers/linphone/default.nix
@@ -1,17 +1,21 @@
 { stdenv, fetchurl, intltool, pkgconfig, gtk, libglade, libosip, libexosip
-, speex, readline, mediastreamer }:
-        
+, speex, readline, mediastreamer, libsoup }:
+
 stdenv.mkDerivation rec {
-  name = "linphone-3.5.0";
+  name = "linphone-3.5.2";
 
   src = fetchurl {
     url = "mirror://savannah/linphone/3.5.x/sources/${name}.tar.gz";
-    sha256 = "1jrgsyx2mn6y50hjfx79fzqhp42r78cjr63w3bfjdl258zy2f6ix";
+    sha256 = "0830iam7kgqphgk3q6qx93kp5wrf0gnm5air82jamy7377jxadys";
   };
 
-  buildInputs = [ gtk libglade libosip libexosip readline mediastreamer speex ];
+  patches = [ ./fix-deprecated.patch ];
+
+  buildInputs = [ gtk libglade libosip libexosip readline mediastreamer speex libsoup ];
+
+  nativeBuildInputs = [ intltool pkgconfig ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  preConfigure = "rm -r mediastreamer2 oRTP";
 
   configureFlags = "--enable-external-ortp --enable-external-mediastreamer";
 
diff --git a/pkgs/applications/networking/instant-messengers/linphone/fix-deprecated.patch b/pkgs/applications/networking/instant-messengers/linphone/fix-deprecated.patch
new file mode 100644
index 00000000000..8978e6e6652
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/linphone/fix-deprecated.patch
@@ -0,0 +1,35 @@
+diff --git a/gtk/main.c b/gtk/main.c
+index 7079bc8..f076127 100644
+--- a/gtk/main.c
++++ b/gtk/main.c
+@@ -1643,7 +1643,7 @@ int main(int argc, char *argv[]){
+ 	GdkPixbuf *pbuf;
+ 	const char *app_name="Linphone";
+ 
+-	g_thread_init(NULL);
++	g_type_init();
+ 	gdk_threads_init();
+ 	
+ 	progpath = strdup(argv[0]);
+diff --git a/gtk/setupwizard.c b/gtk/setupwizard.c
+index 1c54fca..45c9091 100644
+--- a/gtk/setupwizard.c
++++ b/gtk/setupwizard.c
+@@ -270,7 +270,7 @@ static void account_username_changed(GtkEntry *entry, GtkWidget *w) {
+ 	linphone_account_creator_set_username(creator, gtk_entry_get_text(username));
+ 
+ 	if (g_regex_match_simple("^[a-zA-Z]+[a-zA-Z0-9.\\-_]{3,}$", gtk_entry_get_text(username), 0, 0)) {
+-		g_thread_create(check_username_availability, (void*)w, FALSE, NULL);
++		g_thread_new (NULL, check_username_availability, (void*)w);
+ 	}
+ 	else {
+ 		if (gtk_entry_get_text_length(username) < LOGIN_MIN_SIZE) {
+@@ -534,7 +534,7 @@ GtkWidget * linphone_gtk_create_assistant(void){
+ 	ok = create_pixbuf(linphone_gtk_get_ui_config("ok","ok.png"));
+ 	notok = create_pixbuf(linphone_gtk_get_ui_config("notok","notok.png"));
+ 
+-	g_thread_init (NULL);
++	g_type_init ();
+ 	gdk_threads_init ();
+ 
+ 	GtkWidget *p1=create_intro();
diff --git a/pkgs/applications/networking/instant-messengers/mcabber/default.nix b/pkgs/applications/networking/instant-messengers/mcabber/default.nix
index dd5a3dc8b9e..cae0213c6be 100644
--- a/pkgs/applications/networking/instant-messengers/mcabber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/mcabber/default.nix
@@ -1,19 +1,19 @@
-{stdenv, fetchurl, openssl, ncurses, pkgconfig, glib}:
+{stdenv, fetchurl, openssl, ncurses, pkgconfig, glib, loudmouth}:
 
 stdenv.mkDerivation {
 
-  name = "mcabber-0.9.9";
+  name = "mcabber-0.10.1";
 
   src = fetchurl {
-    url = http://mirror.mcabber.com/files/mcabber-0.9.9.tar.bz2;
-    sha256 = "2a231c9241211d33745f110f35cfa6bdb051b32791461b9579794b6623863bb1";
+    url = "http://mcabber.com/files/mcabber-0.10.1.tar.bz2";
+    sha256 = "1248cgci1v2ypb90wfhyipwdyp1wskn3gzh78af5ai1a4w5rrjq0";
   };
 
-  meta = { homepage = "http://mirror.mcabber.com/";
+  meta = { homepage = "http://mcabber.com/";
            description = "Small Jabber console client";
          };
 
-  buildInputs = [openssl ncurses pkgconfig glib];
+  buildInputs = [openssl ncurses pkgconfig glib loudmouth];
 
   configureFlags = "--with-openssl=${openssl}";
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
index e60d37ed4a2..cf42dd5700b 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/otr/default.nix
@@ -1,18 +1,19 @@
-{ stdenv, fetchurl, libotr, pidgin} :
+{ stdenv, fetchurl, libotr, pidgin, intltool } :
 
-stdenv.mkDerivation {
-  name = "pidgin-otr-3.2.0";
+stdenv.mkDerivation rec {
+  name = "pidgin-otr-4.0.0";
   src = fetchurl {
-    url = http://www.cypherpunks.ca/otr/pidgin-otr-3.2.0.tar.gz;
-    sha256 = "1cp6s565sid657lvmm7jrwl9wnk4ywsl8d9sp4iba36r0s5qaw08";
+    url = "http://www.cypherpunks.ca/otr/${name}.tar.gz";
+    sha256 = "14a6vxvlkm8wazng9aj7p82dr12857fx5is1frcyd7my5l4kysym";
   };
 
+  postInstall = "ln -s \$out/lib/pidgin \$out/share/pidgin-otr";
+
+  buildInputs = [ libotr pidgin intltool ];
+
   meta = {
-    description = "OTR plugin for Pidgin IM.";
     homepage = http://www.cypherpunks.ca/otr;
+    description = "Plugin for Pidgin 2.x which implements OTR Messaging";
+    license = "GPLv2";
   };
-
-  postInstall = "ln -s \$out/lib/pidgin \$out/share/pidgin-otr";
-
-  buildInputs = [libotr pidgin];
 }
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix
new file mode 100644
index 00000000000..544aa06877a
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/skype4pidgin/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, pkgconfig, pidgin, libnotify, gdk_pixbuf, glib, dbus
+, dbus_glib }:
+
+stdenv.mkDerivation rec {
+  name = "skype4pidgin-novas0x2a-20120411-6c53f7c48f";
+  src = fetchurl {
+    url = "https://github.com/novas0x2a/skype4pidgin/tarball/6c53f7c48f";
+    name = "${name}.tar.gz";
+    sha256 = "116jfh5ravaixivqx4a4bz0lbb9c49d5r83nwmripja56zdbpgr0";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${libnotify}/include/libnotify";
+
+  patchPhase = ''
+    sed -i -e 's/ [^ ]*-gcc/ gcc/' -e 's/-march[^ ]*//' \
+        -e 's/GLIB_CFLAGS =.*/GLIB_CFLAGS=`pkg-config --cflags glib-2.0 gdk-pixbuf-2.0 libnotify purple dbus-glib-1`/' Makefile
+    pkg-config --cflags glib-2.0 gdk-pixbuf-2.0 libnotify
+  '';
+
+  buildPhase  = "make libskype.so libskype_dbus.so";
+
+  installPhase = ''
+    ensureDir $out/pixmaps/pidgin/protocols/{16,22,48} $out/bin $out/lib/pidgin
+    cp icons/16/skypeout.png $out/pixmaps/pidgin/protocols/16
+    cp icons/22/skypeout.png $out/pixmaps/pidgin/protocols/22
+    cp icons/48/skypeout.png $out/pixmaps/pidgin/protocols/48
+    cp libskype.so libskype_dbus.so $out/lib/pidgin
+  '';
+
+  postInstall = "ln -s \$out/lib/pidgin \$out/share/pidgin-otr";
+
+  buildInputs = [ pidgin pkgconfig libnotify gdk_pixbuf glib dbus dbus_glib ];
+
+  meta = {
+    homepage = https://github.com/novas0x2a/skype4pidgin;
+    license = "GPLv3+";
+    description = "Plugin to use a running skype account through pidgin";
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index 5e85c4c26b4..00fba657d8a 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -21,10 +21,10 @@
 } :
 
 stdenv.mkDerivation rec {
-  name = "pidgin-2.10.2";
+  name = "pidgin-2.10.7";
   src = fetchurl {
     url = "mirror://sourceforge/pidgin/${name}.tar.bz2";
-    sha256 = "1f1j9pr7zwpxwbv94510brh69pmwn4v3np12h75pfrnkas8d5kg5";
+    sha256 = "14piyx4xpc3l8286x4nh5pna2wfyn9cv0qa29br1q3d2xja2k8zb";
   };
 
   inherit nss ncurses;
diff --git a/pkgs/applications/networking/instant-messengers/psi/default.nix b/pkgs/applications/networking/instant-messengers/psi/default.nix
index 2c6ba36c44f..5750476cc5c 100644
--- a/pkgs/applications/networking/instant-messengers/psi/default.nix
+++ b/pkgs/applications/networking/instant-messengers/psi/default.nix
@@ -1,28 +1,33 @@
-{ stdenv, fetchurl, aspell, qt4, zlib, sox, libX11, xproto, libSM, 
-  libICE, qca2, pkgconfig, qca2_ossl, liboil, speex, callPackage, which, glib }:
+{ stdenv, fetchurl, aspell, qt4, zlib, sox, libX11, xproto, libSM
+, libICE, qca2, pkgconfig, qca2_ossl, liboil, speex, callPackage, which, glib
+, libXScrnSaver, scrnsaverproto
+}:
 
 stdenv.mkDerivation rec {
-  name = "psi-0.14";
-  
+  name = "psi-0.15";
+
   src = fetchurl {
     url = "mirror://sourceforge/psi/${name}.tar.bz2";
-    sha256 = "1h54a1qryfva187sw9qnb4lv1d3h3lysqgw55v727swvslh4l0da";
+    sha256 = "593b5ddd7934af69c245afb0e7290047fd7dedcfd8765baca5a3a024c569c7e6";
   };
 
-  buildInputs = [aspell qt4 zlib sox libX11 xproto libSM libICE 
-    qca2 qca2_ossl pkgconfig which glib];
+  buildInputs =
+    [ aspell qt4 zlib sox libX11 xproto libSM libICE
+      qca2 qca2_ossl pkgconfig which glib scrnsaverproto libXScrnSaver
+    ];
 
   NIX_CFLAGS_COMPILE="-I${qca2}/include/QtCrypto";
-  
-  NIX_LDFLAGS="-lqca";
 
-  configureFlags =
-    [ " --with-zlib-inc=${zlib}/include "
-      " --disable-bundled-qca"
-    ];
+  NIX_LDFLAGS="-lqca";
 
   psiMedia = callPackage ./psimedia.nix { };
 
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-aspell-inc=${aspell}/include"
+    ];
+
   postInstall = ''
     PSI_PLUGINS="$out/lib/psi/plugins"
     mkdir -p "$PSI_PLUGINS"
@@ -34,9 +39,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Psi, an XMPP (Jabber) client";
-    maintainers = with stdenv.lib.maintainers;
-      [raskin];
-    platforms = with stdenv.lib.platforms;
-      linux;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch b/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch
new file mode 100644
index 00000000000..49988c253bd
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch
@@ -0,0 +1,54 @@
+http://sources2.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-im/psimedia/files/psimedia-1.0.3-glib2.32.patch?view=log
+
+Index: psimedia-1.0.3/gstprovider/gstcustomelements/gstcustomelements.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstcustomelements/gstcustomelements.h
++++ psimedia-1.0.3/gstprovider/gstcustomelements/gstcustomelements.h
+@@ -21,7 +21,7 @@
+ #ifndef GSTCUSTOMELEMENTS_H
+ #define GSTCUSTOMELEMENTS_H
+ 
+-#include <glib/gthread.h>
++#include <glib.h>
+ #include <gst/gst.h>
+ #include <gst/base/gstpushsrc.h>
+ #include <gst/video/video.h>
+Index: psimedia-1.0.3/gstprovider/gstelements/static/gstelements.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstelements/static/gstelements.h
++++ psimedia-1.0.3/gstprovider/gstelements/static/gstelements.h
+@@ -21,7 +21,7 @@
+ #ifndef PSI_GSTELEMENTS_H
+ #define PSI_GSTELEMENTS_H
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+Index: psimedia-1.0.3/gstprovider/gstthread.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstthread.h
++++ psimedia-1.0.3/gstprovider/gstthread.h
+@@ -22,7 +22,7 @@
+ #define PSI_GSTTHREAD_H
+ 
+ #include <QThread>
+-#include <glib/gmain.h>
++#include <glib.h>
+ 
+ namespace PsiMedia {
+ 
+Index: psimedia-1.0.3/gstprovider/rwcontrol.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/rwcontrol.h
++++ psimedia-1.0.3/gstprovider/rwcontrol.h
+@@ -28,7 +28,7 @@
+ #include <QMutex>
+ #include <QWaitCondition>
+ #include <QTimer>
+-#include <glib/gmain.h>
++#include <glib.h>
+ #include "psimediaprovider.h"
+ #include "rtpworker.h"
+ 
diff --git a/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch b/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch
new file mode 100644
index 00000000000..a5386b3e111
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/psi/linux-headers.patch
@@ -0,0 +1,86 @@
+http://pkgs.fedoraproject.org/gitweb/?p=psimedia.git;a=blob_plain;f=psimedia-remove-v4l.patch;hb=HEAD
+
+--- a/gstprovider/deviceenum/deviceenum_unix.cpp
++++ b/gstprovider/deviceenum/deviceenum_unix.cpp
+@@ -35,7 +35,7 @@
+ # include <sys/stat.h>
+ # include <dirent.h>
+ # include <sys/ioctl.h>
+-# include <linux/videodev.h>
++# include <linux/videodev2.h>
+ #endif
+ 
+ namespace DeviceEnum {
+@@ -478,72 +478,7 @@
+ // v4l detection scheme adapted from PWLib (used by Ekiga/Gnomemeeting)
+ static QList<Item> get_v4l_items()
+ {
+-#ifdef Q_OS_LINUX
+-	QList<Item> out;
+-
+-	QList<V4LName> list = get_v4l_names("/sys/class/video4linux", true);
+-	if(list.isEmpty())
+-		list = get_v4l_names("/proc/video/dev", false);
+-
+-	// if we can't find anything, then do a raw scan for possibilities
+-	if(list.isEmpty())
+-	{
+-		QStringList possible = scan_for_videodevs("/dev");
+-		foreach(QString str, possible)
+-		{
+-			V4LName v;
+-			v.dev = str;
+-			list += v;
+-		}
+-	}
+-
+-	for(int n = 0; n < list.count(); ++n)
+-	{
+-		V4LName &v = list[n];
+-
+-		// if we already have a friendly name then we'll skip the confirm
+-		//   in order to save resources.  the only real drawback here that
+-		//   I can think of is if the device isn't a capture type.  but
+-		//   what does it mean to have a V4L device that isn't capture??
+-		if(v.friendlyName.isEmpty())
+-		{
+-			int fd = open(QFile::encodeName(v.dev).data(), O_RDONLY | O_NONBLOCK);
+-			if(fd == -1)
+-				continue;
+-
+-			// get video capabilities and close
+-			struct video_capability caps;
+-			memset(&caps, 0, sizeof(caps));
+-			int ret = ioctl(fd, VIDIOCGCAP, &caps);
+-			close(fd);
+-			if(ret == -1)
+-				continue;
+-
+-			if(!(caps.type & VID_TYPE_CAPTURE))
+-				continue;
+-
+-			v.friendlyName = caps.name;
+-		}
+-
+-		Item i;
+-		i.type = Item::Video;
+-		i.dir = Item::Input;
+-		i.name = v.friendlyName;
+-		i.driver = "v4l";
+-		i.id = v.dev;
+-
+-		// HACK
+-		if(v.friendlyName == "Labtec Webcam Notebook")
+-			i.explicitCaptureSize = QSize(640, 480);
+-
+-		out += i;
+-	}
+-
+-	return out;
+-#else
+-	// return empty list if non-linux
+ 	return QList<Item>();
+-#endif
+ }
+ 
+ static QList<Item> get_v4l2_items()
diff --git a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
index df821da42f2..aa54053c67f 100644
--- a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
+++ b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
@@ -1,15 +1,17 @@
-{stdenv, fetchurl, qt4, gstreamer, gst_plugins_base, liboil, speex, which
-, glib, pkgconfig}:
+{ stdenv, fetchurl, qt4, gstreamer, gst_plugins_base, liboil, speex, which
+, glib, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "psimedia";
+  name = "psimedia-1.0.3";
 
   src = fetchurl {
-    url = "http://delta.affinix.com/download/psimedia/psimedia-1.0.3.tar.bz2";
+    url = "http://delta.affinix.com/download/psimedia/${name}.tar.bz2";
     sha256 = "0fxjdz8afh75gfx2msysb1gss6zx578l3224jvc9jhm99w1ii781";
   };
 
-  buildInputs = [qt4 gstreamer gst_plugins_base liboil speex which glib pkgconfig];
+  patches = [ ./glib-2.32.patch ./linux-headers.patch ];
+
+  buildInputs = [ qt4 gstreamer gst_plugins_base liboil speex which glib pkgconfig ];
 
   configurePhase = ''./configure'';
 
diff --git a/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
new file mode 100644
index 00000000000..c35101bb874
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
@@ -0,0 +1,45 @@
+{stdenv, fetchurl, python, pythonPackages, pygobject, pythonDBus}: 
+stdenv.mkDerivation rec {
+  url = "ftp://ftp.goffi.org/sat/sat-0.2.0.tar.bz2";
+  name = stdenv.lib.nameFromURL url ".tar";
+  src = fetchurl {
+    inherit url;
+    sha256 = "14qqgsgqns1xcp97nd3jcxrq54z1x5a6kimqxy029hh7ys813mf1";
+  };
+
+  buildInputs = with pythonPackages; 
+    [
+      python twisted urwid beautifulsoup wxPython distribute pygobject
+      wokkel pythonDBus pyfeed wrapPython
+    ];
+
+  configurePhase = ''
+    sed -e "s@sys.prefix@'$out'@g" -i setup.py
+    sed -e "1aexport PATH=\"\$PATH\":\"$out/bin\":\"${pythonPackages.twisted}/bin\"" -i src/sat.sh
+    sed -e "1aexport PYTHONPATH=\"\$PYTHONPATHPATH\":\"$PYTHONPATH\":"$out/lib/${python.libPrefix}/site-packages"" -i src/sat.sh
+
+    echo 'import wokkel.muc' | python 
+  '';
+
+  buildPhase = ''
+    python setup.py build
+  '';
+
+  installPhase = ''
+    python setup.py install --prefix="$out" 
+
+    for i in "$out/bin"/*; do
+      head -n 1 "$i" | grep -E '[/ ]python( |$)' && {
+        wrapProgram "$i" --prefix PYTHONPATH : "$PYTHONPATH:$out/lib/${python.libPrefix}/site-packages"
+      } || true 
+    done
+  '';
+  
+  meta = {
+    homepage = "http://sat.goffi.org/";
+    description = "A multi-frontend XMPP client";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = stdenv.lib.licenses.gpl3Plus;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/silc-client/default.nix b/pkgs/applications/networking/instant-messengers/silc-client/default.nix
new file mode 100644
index 00000000000..a4035604168
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/silc-client/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, perl, pkgconfig, glib, ncurses
+, enablePlugin ? false }:
+
+# Enabling the plugin and using it with a recent irssi, segafults on join:
+# http://marc.info/?l=silc-devel&m=125610477802211
+
+let
+  basename = "silc-client-1.1.8";
+in
+stdenv.mkDerivation {
+  name = basename + stdenv.lib.optionalString enablePlugin "-irssi-plugin";
+
+  src = fetchurl {
+    url = "http://silcnet.org/download/client/sources/${basename}.tar.bz2";
+    sha256 = "1qnk35g8sbnfps3bq2k9sy0ymlsijh5n8z59m2ccq4pkmqbfqgv2";
+  };
+
+  dontDisableStatic = true;
+
+  patches = [ ./server_setup.patch ];
+
+  configureFlags = "--with-ncurses=${ncurses}";
+
+  preConfigure = stdenv.lib.optionalString enablePlugin ''
+    configureFlags="$configureFlags --with-silc-plugin=$out/lib/irssi"
+  '';
+
+  buildInputs = [ perl pkgconfig glib ncurses ];
+
+  meta = {
+    homepage = http://silcnet.org/;
+    description = "Secure Internet Live Conferencing server";
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/silc-client/server_setup.patch b/pkgs/applications/networking/instant-messengers/silc-client/server_setup.patch
new file mode 100644
index 00000000000..466194c0a8f
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/silc-client/server_setup.patch
@@ -0,0 +1,28 @@
+Add function to replace the behaviour of server_setup_find_port which was removed from irssi on revision 5125. Fixes bug #577501.
+--- a/apps/irssi/src/silc/core/client_ops.c
++++ b/apps/irssi/src/silc/core/client_ops.c
+@@ -2790,6 +2790,15 @@
+   silc_free(a);
+ }
+ 
++/* helper function to emulate server_setup_find_port */
++static SERVER_SETUP_REC *silc_server_setup_find_port(const char *address,
++						     int port) {
++  SERVER_SETUP_REC *rec;
++
++  rec = server_setup_find(address, port, NULL);
++  return (rec == NULL || rec->port != port) ? NULL : rec;
++}
++
+ /* Find authentication data by hostname and port. The hostname may be IP
+    address as well.*/
+ 
+@@ -2811,7 +2820,7 @@
+ 
+   /* Check whether we find the password for this server in our
+      configuration.  If it's set, always send it server. */
+-  setup = server_setup_find_port(hostname, port);
++  setup = silc_server_setup_find_port(hostname, port);
+   if (setup && setup->password) {
+     completion(SILC_AUTH_PASSWORD, setup->password, strlen(setup->password),
+ 	       context);
diff --git a/pkgs/applications/networking/instant-messengers/skype-call-recorder/conference.patch b/pkgs/applications/networking/instant-messengers/skype-call-recorder/conference.patch
new file mode 100644
index 00000000000..8b8ce8fd7bb
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/skype-call-recorder/conference.patch
@@ -0,0 +1,148 @@
+From abd67f1d44eef81baf2e9729f95e002c4ecc7350 Mon Sep 17 00:00:00 2001
+From: jlh <jlh@gmx.ch>
+Date: Fri, 16 Oct 2009 17:40:54 +0200
+Subject: [PATCH] Rudimentary support for recording hosted conference calls
+
+---
+ call.cpp |   37 +++++++++++++++++++++++++++++++++++--
+ call.h   |   11 ++++++++++-
+ 2 files changed, 45 insertions(+), 3 deletions(-)
+
+diff --git a/call.cpp b/call.cpp
+index c2b02f2..663c1c1 100644
+--- a/call.cpp
++++ b/call.cpp
+@@ -90,9 +90,10 @@ void AutoSync::reset() {
+ 
+ // Call class
+ 
+-Call::Call(QObject *p, Skype *sk, CallID i) :
+-	QObject(p),
++Call::Call(CallHandler *h, Skype *sk, CallID i) :
++	QObject(h),
+ 	skype(sk),
++	handler(h),
+ 	id(i),
+ 	status("UNKNOWN"),
+ 	writer(NULL),
+@@ -119,6 +120,13 @@ Call::Call(QObject *p, Skype *sk, CallID i) :
+ 		debug(QString("Call %1: cannot get partner display name").arg(id));
+ 		displayName = "Unnamed Caller";
+ 	}
++
++	// Skype does not properly send updates when the CONF_ID property
++	// changes.  since we need this information, check it now on all calls
++	handler->updateConfIDs();
++	// this call isn't yet in the list of calls, thus we need to
++	// explicitely check its CONF_ID
++	updateConfID();
+ }
+ 
+ Call::~Call() {
+@@ -134,6 +142,10 @@ Call::~Call() {
+ 	// QT takes care of deleting servers and sockets
+ }
+ 
++void Call::updateConfID() {
++	confID = skype->getObject(QString("CALL %1 CONF_ID").arg(id)).toLong();
++}
++
+ bool Call::okToDelete() const {
+ 	// this is used for checking whether past calls may now be deleted.
+ 	// when a past call hasn't been decided yet whether it should have been
+@@ -270,6 +282,11 @@ void Call::startRecording(bool force) {
+ 	if (isRecording)
+ 		return;
+ 
++	if (handler->isConferenceRecording(confID)) {
++		debug(QString("Call %1: call is part of a conference that is already being recorded").arg(id));
++		return;
++	}
++
+ 	if (force) {
+ 		emit showLegalInformation();
+ 	} else {
+@@ -589,6 +606,22 @@ CallHandler::~CallHandler() {
+ 	delete legalInformationDialog;
+ }
+ 
++void CallHandler::updateConfIDs() {
++	QList<Call *> list = calls.values();
++	for (int i = 0; i < list.size(); i++)
++		list.at(i)->updateConfID();
++}
++
++bool CallHandler::isConferenceRecording(CallID id) const {
++	QList<Call *> list = calls.values();
++	for (int i = 0; i < list.size(); i++) {
++		Call *c = list.at(i);
++		if (c->getConfID() == id && c->getIsRecording())
++			return true;
++	}
++	return false;
++}
++
+ void CallHandler::callCmd(const QStringList &args) {
+ 	CallID id = args.at(0).toInt();
+ 
+diff --git a/call.h b/call.h
+index cb8396d..b746f46 100644
+--- a/call.h
++++ b/call.h
+@@ -43,6 +43,8 @@ class QTcpServer;
+ class QTcpSocket;
+ class LegalInformationDialog;
+ 
++class CallHandler;
++
+ typedef int CallID;
+ 
+ class AutoSync {
+@@ -68,18 +70,21 @@ private:
+ class Call : public QObject {
+ 	Q_OBJECT
+ public:
+-	Call(QObject *, Skype *, CallID);
++	Call(CallHandler *, Skype *, CallID);
+ 	~Call();
+ 	void startRecording(bool = false);
+ 	void stopRecording(bool = true);
++	void updateConfID();
+ 	bool okToDelete() const;
+ 	void setStatus(const QString &);
+ 	QString getStatus() const { return status; }
+ 	bool statusDone() const;
+ 	bool statusActive() const;
+ 	CallID getID() const { return id; }
++	CallID getConfID() const { return confID; }
+ 	void removeFile();
+ 	void hideConfirmation(int);
++	bool getIsRecording() const { return isRecording; }
+ 
+ signals:
+ 	void startedCall(int, const QString &);
+@@ -99,10 +104,12 @@ private:
+ 
+ private:
+ 	Skype *skype;
++	CallHandler *handler;
+ 	CallID id;
+ 	QString status;
+ 	QString skypeName;
+ 	QString displayName;
++	CallID confID;
+ 	AudioFileWriter *writer;
+ 	bool isRecording;
+ 	int stereo;
+@@ -140,6 +147,8 @@ class CallHandler : public QObject {
+ public:
+ 	CallHandler(QObject *, Skype *);
+ 	~CallHandler();
++	void updateConfIDs();
++	bool isConferenceRecording(CallID) const;
+ 	void callCmd(const QStringList &);
+ 
+ signals:
+-- 
+1.6.5.GIT
+
diff --git a/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix
new file mode 100644
index 00000000000..2fa82e1251b
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/skype-call-recorder/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, cmake, lame, id3lib, libvorbis, qt4, libogg }:
+
+stdenv.mkDerivation {
+  name = "skype-call-recorder-0.8";
+  src = fetchurl {
+    url = "http://atdot.ch/scr/files/0.8/skype-call-recorder-0.8.tar.gz";
+    sha256 = "1iijkhq3aj9gr3bx6zl8ryvzkqcdhsm9yisimakwq0lnw0lgf5di";
+  };
+
+  # Keep an rpath reference to the used libogg
+  prePatch = ''
+    sed -i -e '/ADD_EXECUTABLE/aSET(LIBRARIES ''${LIBRARIES} ogg)' CMakeLists.txt
+  '';
+
+  # Better support for hosted conferences
+  patches = [ ./conference.patch ];
+
+  buildInputs = [ cmake lame id3lib libvorbis qt4 libogg ];
+
+  meta = {
+    homepage = http://atdot.ch/scr/;
+    description = "Open source tool to record your Skype calls on Linux";
+    license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index ddbba59e145..715f0e5c2de 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -5,21 +5,21 @@
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation rec {
-  name = "skype-4.0.0.7";
+  name = "skype-4.1.0.20";
 
   src = fetchurl {
     url = "http://download.skype.com/linux/${name}.tar.bz2";
-    sha256 = "0mrswawqsv53mfghqlj1bzq0jfswha6b0c06px7snd85pd4gn5fn";
+    sha256 = "1qhcxkfmlpblpy9rqimzdl79rm781swbldkzi6nyw56bbp6lf7n3";
   };
 
-  buildInputs = 
+  buildInputs =
     lib.optional usePulseAudio pulseaudio ++ [
     alsaLib
-    stdenv.glibc 
+    stdenv.glibc
     stdenv.gcc.gcc
     libXv
-    libXext 
-    libX11 
+    libXext
+    libX11
     qt4
     libXScrnSaver
     libSM
@@ -36,38 +36,36 @@ stdenv.mkDerivation rec {
   phases = "unpackPhase installPhase";
 
   installPhase = ''
-    mkdir -p $out/{opt/skype/,bin}
-    cp -r * $out/opt/skype/
+    mkdir -p $out/{libexec/skype/,bin}
+    cp -r * $out/libexec/skype/
 
     fullPath=
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath''${fullPath:+:}$i/lib
     done
 
     dynlinker="$(cat $NIX_GCC/nix-support/dynamic-linker)"
-          
+
     cat > $out/bin/skype << EOF
     #!${stdenv.shell}
     export LD_LIBRARY_PATH=$fullPath:$LD_LIBRARY_PATH
-    $dynlinker $out/opt/skype/skype --resources=$out/opt/skype "\$@"
+    $dynlinker $out/libexec/skype/skype --resources=$out/libexec/skype "\$@"
     EOF
 
     chmod +x $out/bin/skype
 
-    # Desktop icon for Skype
-    patch skype.desktop << EOF
-    5c5
-    < Icon=skype.png
-    ---
-    > Icon=$out/opt/skype/icons/SkypeBlue_48x48.png
-    EOF
+    # Fixup desktop file
+    substituteInPlace skype.desktop --replace \
+      "Icon=skype.png" "Icon=$out/libexec/skype/icons/SkypeBlue_48x48.png"
+    substituteInPlace skype.desktop --replace \
+      "Terminal=0" "Terminal=false"
     mkdir -p $out/share/applications
     mv skype.desktop $out/share/applications
   '';
 
   meta = {
-      description = "A P2P-VoiceIP client";
-      homepage = http://www.skype.com;
-      license = "skype-eula";
+    description = "A proprietary voice-over-IP (VoIP) client";
+    homepage = http://www.skype.com/;
+    license = "unfree";
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
index 25919875bd1..8863af25984 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/gabble/default.nix
@@ -2,18 +2,18 @@
 , sqlite, libsoup, libnice, gnutls }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-gabble-0.16.0";
+  name = "telepathy-gabble-0.17.2";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/telepathy-gabble/${name}.tar.gz";
-    sha256 = "0fk65f7q75z3wm5h4wad7g5sm2j6r8v2845b74ycl29br78ki2hf";
+    sha256 = "137sslbgh0326lmwihcr2ybljgq9mzsx5wnciilpx884si22wpk8";
   };
 
-  buildNativeInputs = [pkgconfig libxslt];
+  nativeBuildInputs = [pkgconfig libxslt];
   buildInputs = [ libxml2 dbus_glib sqlite libsoup libnice telepathy_glib gnutls ];
 
   configureFlags = "--with-ca-certificates=/etc/ca-bundle.crt";
-  
+
   meta = {
     homepage = http://telepathy.freedesktop.org;
   };
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
index 1e2ded5292a..b2fd13837d7 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/haze/default.nix
@@ -2,16 +2,16 @@
 
 stdenv.mkDerivation rec {
   pname = "telepathy-haze";
-  name = "${pname}-0.6.0";
+  name = "${pname}-0.7.0";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "1qrgmcr8ga6nvaz9hhn0mv0p7v799wsawrg3k5l791cgxx5carz2";
+    sha256 = "1gaj8518ilm3gnzqf3lmiqgnwkay8wfbsqngcz15whzji8sl608b";
   };
 
   buildInputs = [ glib telepathy_glib dbus_glib pidgin ];
 
-  buildNativeInputs = [ pkgconfig libxslt ];
+  nativeBuildInputs = [ pkgconfig libxslt ];
 
   meta = {
     description = "A Telepathy connection manager based on libpurple";
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/0.3.1.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/0.3.1.nix
deleted file mode 100644
index 73eda93f7e8..00000000000
--- a/pkgs/applications/networking/instant-messengers/telepathy/kde/0.3.1.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-[
-{name="ktp-accounts-kcm";key="accounts_kcm";sha256="1lkqiwibxabg5p3k8l0zyzjyysi56dvbbcxp1sybd81hmxf6fzxh";}
-{name="ktp-approver";key="approver";sha256="0bw3i8av55n93ac6phvar03b6rz34wbqrzx7l2vd48d0y5ib0j6m";}
-{name="ktp-auth-handler";key="auth_handler";sha256="0kby9935df474b7jvzzg7v3zvrgml5caf96ps4dcrcvyz91ckd1y";}
-{name="ktp-common-internals";key="common_internals";sha256="1g22b0g9g14dsdl0qkdglgkf26c3pjc96q19kj2kai1i644i8k5h";}
-{name="ktp-contact-applet";key="contact_applet";sha256="0iwr202snsm72xjxv1jb9z24j8ikdx6ljaz5v9i0ha8f8rb1vrp5";}
-{name="ktp-contact-list";key="contact_list";sha256="06y1cw2kkn6ig5qnmzl7bdz9nghpv2c83c9vf9glgbxf77qfg3ms";}
-{name="ktp-filetransfer-handler";key="filetransfer_handler";sha256="1cdnl4sn34lmm7h7qv8rrkp7ia5gcg2704fqhvpv8n8gxwwhrc1a";}
-{name="ktp-kded-integration-module";key="kded_integration_module";sha256="1ccihqk0pg28v2q6p9dx37ql7hnwdz2060jf1s6p9yyd27fc4is0";}
-{name="ktp-presence-applet";key="presence_applet";sha256="0zgl8z81kmy2a03kzgvvqlr244cw9gw2kfrph1d6ax8zk4fqvxnz";}
-{name="ktp-send-file";key="send_file";sha256="1d1j0klp8dvmldn5c19zqfsxcm5hbaq5fxikpjg0q3j9ib8yh9la";}
-{name="ktp-text-ui";key="text_ui";sha256="0qikjh8ywlnwkfr4nd4hc9b15b824simhdj3n62yd87pmkk3avw6";}
-]
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/0.4.0.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/0.4.0.nix
deleted file mode 100644
index aadeb3e2a67..00000000000
--- a/pkgs/applications/networking/instant-messengers/telepathy/kde/0.4.0.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-[
-{name="ktp-accounts-kcm";key="accounts_kcm";sha256="1a312cfm1i8ipqp0r09zfhlk7vacp006pbhwwvyf0sgracizr0cp";}
-{name="ktp-approver";key="approver";sha256="0wfpwlk5f3n37xl619jzjxmgrq81qnr9kg9m955zbcad2jsx3z35";}
-{name="ktp-auth-handler";key="auth_handler";sha256="1q5jjj3np3kg7py28jb74q8lpi6camw7907950igpnwzbzmacxwa";}
-{name="ktp-call-ui";key="call_ui";sha256="08k59q0gf6fq0mmz72akiqkldqy6grw1gs7jz44gzmr82jvaqjb3";}
-{name="ktp-common-internals";key="common_internals";sha256="1cmil7wp6rgqzl0bciphqmvdzipm856c45kx2mzrk6n1vnl9l500";}
-{name="ktp-contact-applet";key="contact_applet";sha256="1j42yqq06bkpfb4jgm88qqbwnz9538ys5aghyfg147jr50h9pk8k";}
-{name="ktp-contact-list";key="contact_list";sha256="1ndpr2z99clmy8f7l8l6ws7bljmmqvfrb5f0nrym91lyvcdz7sb2";}
-{name="ktp-contact-runner";key="contact_runner";sha256="1v8mcp8q1cfmxdg65qqh159q9pynz3pc3y0ycr6hn1nrgxncs48k";}
-{name="ktp-filetransfer-handler";key="filetransfer_handler";sha256="0dj2if34wxajwylgfxwd5chvxk63lxmsq52sc039dsj9p174cp3y";}
-{name="ktp-kded-integration-module";key="kded_integration_module";sha256="0p873h6cjdinfinfz1cggyw611v2gllmkvzczszxnl8q2hcprx96";}
-{name="ktp-presence-applet";key="presence_applet";sha256="1y8yhbbjp9qgycn93lqd6ss7jln1hpxa0dnqgirijfjn15c20nfl";}
-{name="ktp-send-file";key="send_file";sha256="0sacvda2xs5g7w2xca9p6z61f2w69sgw0g3sj2fazrsm0x7a0z0d";}
-{name="ktp-text-ui";key="text_ui";sha256="1xsslwaisk90wa45rgps3500wl1fbxq4qp6njljf4qbysyw4wfdb";}
-{name="telepathy-logger-qt";key="telepathy_logger_qt";sha256="1398iyb72grhwwi0idxdwj1qdi2s02cp2wvjv72wvv3vyfwb51kn";}
-]
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/0.5.3.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/0.5.3.nix
new file mode 100644
index 00000000000..eb0543aa5b0
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/telepathy/kde/0.5.3.nix
@@ -0,0 +1,16 @@
+[
+{name="ktp-accounts-kcm";key="accounts_kcm";sha256="0nmjwbm7ycy5awwlx359889am7qbvs64gk0bd1800a9jl2lhvw56";}
+{name="ktp-approver";key="approver";sha256="0n0a2abbz7xvzp3p4l6khgbhbjylppvskcyma440fmfv3j3jdc12";}
+{name="ktp-auth-handler";key="auth_handler";sha256="11vfim3ck60cy22x84bz6cw0267kf884qa00nbm033kpwjbx4zr6";}
+{name="ktp-call-ui";key="call_ui";sha256="0gmppn4f5a9yd3pnzga3sdwz37c7qpmx586914r64jbkii196xg4";}
+{name="ktp-common-internals";key="common_internals";sha256="1lkmaym8bv5ijy7sksbihr63qify9b9vrhrikck6q23n8sk112n9";}
+{name="ktp-contact-applet";key="contact_applet";sha256="0gsf1m276mhvysy30qqw1h7ssdipyyjh43jbf2lx4bb934by9wby";}
+{name="ktp-contact-list";key="contact_list";sha256="19nlzs650lwmzr30lrviv0qw1xd061pdrk17cm512ldvzibc70ab";}
+{name="ktp-contact-runner";key="contact_runner";sha256="0x3zkk11x9npx30w330s8n49ybqlyhgcndvqizg4sbj1lfbrmhn1";}
+{name="ktp-filetransfer-handler";key="filetransfer_handler";sha256="0w90hsypzgakqx96xkf0wk2qqns6v5ji814gvc3rf9ajcwh0d024";}
+{name="ktp-kded-integration-module";key="kded_integration_module";sha256="0sz0d1yfj35q5r1gc4m6v2c8r0cik2vzvkqfx9pqy8g97d7q1nmj";}
+{name="ktp-presence-applet";key="presence_applet";sha256="081jas1vzh6nwj3w60bw3w95gpdbi74pdi9rdxv0wvra5w76s4i6";}
+{name="ktp-send-file";key="send_file";sha256="19nlm4sfa0m0y856nzs3hrncbznc35zwbsxavssd9wrbb8p9cns6";}
+{name="ktp-text-ui";key="text_ui";sha256="0g8114adqyvzsdm8ldhidf2gyxkv0bnky71zg70gmhkdmzcfssyn";}
+{name="telepathy-logger-qt";key="telepathy_logger_qt";sha256="17bfkbxc7gfcspmjd5w6vn9a75f36qinj7illqafb7k0jqqz2nq6";}
+]
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
index 70e6293c9a3..d41db2e4498 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
@@ -3,7 +3,7 @@
 
 let
   pkgconfig = pkgconfigUpstream;
-  version = "0.4.0";
+  version = "0.5.3";
   manifest = import (./. + "/${version}.nix");
 
   overrides = {
@@ -20,7 +20,7 @@ let
     text_ui = [ ktp.telepathy_logger_qt qt_gstreamer telepathy_logger ];
   };
 
-  extraBuildNativeInputs = {
+  extraNativeBuildInputs = {
     telepathy_logger_qt = [ flex bison ];
   };
 
@@ -37,7 +37,7 @@ let
           inherit sha256;
         };
 
-        buildNativeInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraBuildNativeInputs);
+        nativeBuildInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraNativeBuildInputs);
         buildInputs = [ kdelibs telepathy_qt ]
           ++ stdenv.lib.optional (name != "ktp-common-internals") ktp.common_internals
           ++ (stdenv.lib.attrByPath [ key ] [] extraBuildInputs);
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
index a820e0f8a99..527642348d2 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/logger/default.nix
@@ -3,16 +3,16 @@
 
 stdenv.mkDerivation rec {
   project = "telepathy-logger";
-  name = "${project}-0.4.0";
+  name = "${project}-0.8.0";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${project}/${name}.tar.bz2";
-    sha256 = "1rb58ipz56c9bac8b31md5gk1fw7jim8x9dx3cm5gmxg2q3apd86";
+    sha256 = "18i00l8lnp5dghqmgmpxnn0is2a20pkisxy0sb78hnd2dz0z6xnl";
   };
 
   buildInputs = [ dbus_glib libxml2 sqlite telepathy_glib pkgconfig intltool ];
 
-  buildNativeInputs = [ libxslt ];
+  nativeBuildInputs = [ libxslt ];
 
   configureFlags = "--enable-call";
 
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
index 4d79f0c89d8..56abf34e1b3 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/mission-control/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, pkgconfig, telepathy_glib, libxslt }:
 
 stdenv.mkDerivation rec {
-  name = "${pname}-5.12.0";
+  name = "${pname}-5.14.0";
   pname = "telepathy-mission-control";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "0xsycjk2l19h026adqms8ik7c2xj9j9rba76znfh46ryaijyn2k6";
+    sha256 = "0c4asjgk7pk39i8njf0q1df0mhisif83lq716ln6r0wja9zh9q2q";
   };
 
   buildInputs = [ telepathy_glib ];
 
-  buildNativeInputs = [ pkgconfig libxslt ];
+  nativeBuildInputs = [ pkgconfig libxslt ];
 }
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
index e8b120b9331..a60e207b752 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/rakia/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "11cmmdq31kivm6nsv61hxy3hxnnmbd8sj55xqwx9hyqzybh70dyf";
   };
 
-  buildNativeInputs = [pkgconfigUpstream libxslt python];
+  nativeBuildInputs = [pkgconfigUpstream libxslt python];
   buildInputs = [ libxml2 dbus_glib telepathy_glib sofia_sip];
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
index 3c100282aa4..4300ac15c99 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/salut/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ glib libxml2 telepathy_glib avahi libsoup libuuid gnutls
     sqlite ];
 
-  buildNativeInputs = [ libxslt pkgconfigUpstream ];
+  nativeBuildInputs = [ libxslt pkgconfigUpstream ];
 
   configureFlags = "--disable-avahi-tests";
 
diff --git a/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix b/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix
index c361f3270e6..b46133e433e 100644
--- a/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix
+++ b/pkgs/applications/networking/instant-messengers/tkabber-plugins/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, tkabber}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "tkabber-plugins-${version}";
@@ -10,9 +10,12 @@ stdenv.mkDerivation rec {
   };
 
   configurePhase = ''
-    mkdir -p $out/bin
     sed -e "s@/usr/local@$out@" -i Makefile
   '';
 
-  buildInputs = [tkabber];
+  meta = {
+    homepage = "http://tkabber.jabber.ru/tkabber-plugins";
+    description = "Plugins for the Tkabber instant messenger";
+    license = stdenv.lib.licenses.gpl2;
+  };
 }
diff --git a/pkgs/applications/networking/instant-messengers/tkabber/default.nix b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
index 30c91d3d905..fd989739c94 100644
--- a/pkgs/applications/networking/instant-messengers/tkabber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
@@ -1,6 +1,15 @@
-{ stdenv, fetchurl, tcl, tk, tcllib, tcltls, bwidget, cacert, makeWrapper, x11 }:
+{ stdenv, fetchurl, tcl, tk, tcllib, tcltls, tclgpg
+, bwidget, makeWrapper, x11 }:
 
-stdenv.mkDerivation rec {
+let
+  tclLibraries = [ bwidget tcllib tcltls tclgpg ];
+
+  getTclLibPath = p: "${p}/lib/${p.libPrefix}";
+
+  tclLibPaths = stdenv.lib.concatStringsSep " "
+    (map getTclLibPath tclLibraries);
+
+in stdenv.mkDerivation rec {
   name = "tkabber-0.11.1";
 
   src = fetchurl {
@@ -13,7 +22,7 @@ stdenv.mkDerivation rec {
   patchPhase = ''
     substituteInPlace login.tcl --replace \
       "custom::defvar loginconf(sslcacertstore) \"\"" \
-      "custom::defvar loginconf(sslcacertstore) \"${cacert}/etc/ca-bundle.crt\""
+      "custom::defvar loginconf(sslcacertstore) \$env(OPENSSL_X509_CERT_FILE)"
 
     sed -i '/^if.*load_default_xrdb/,/^}$/ {
         s@option readfile \(\[fullpath [^]]*\]\)@option readfile "'"$out/share/doc/tkabber/examples/xrdb/${defaultTheme}.xrdb"'"@
@@ -26,13 +35,17 @@ stdenv.mkDerivation rec {
   '';
 
   postInstall = ''
-    wrapProgram $out/bin/tkabber --set TCLLIBPATH "${bwidget}/tcltk\ ${tcllib}/lib/tcllib${tcllib.version}\ ${tcltls}/lib/tls${tcltls.version}"
+    wrapProgram $out/bin/tkabber \
+      --prefix PATH : "${tk}/bin" \
+      --set TCLLIBPATH '"${tclLibPaths}"' \
+      --set TKABBER_SITE_PLUGINS '$HOME/.nix-profile/share/tkabber-plugins'
   '';
 
-  buildInputs = [tcl tk tcllib tcltls bwidget x11 makeWrapper];
+  buildInputs = [ tcl tk x11 makeWrapper ] ++ tclLibraries;
 
   meta = {
     homepage = "http://tkabber.jabber.ru/";
     description = "A GUI client for the XMPP (Jabber) instant messaging protocol";
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/networking/iptraf/default.nix b/pkgs/applications/networking/iptraf/default.nix
index 8ddf784adc0..1d4c772d6f7 100644
--- a/pkgs/applications/networking/iptraf/default.nix
+++ b/pkgs/applications/networking/iptraf/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "0qsi5f8d84mgdszvz22acyv6mjnbrpk55d54km9i5mkkapck7r4y";
   };
 
+  patchPhase = ''
+    sed -i -e 's,#include <linux/if_tr.h>,#include <netinet/if_tr.h>,' src/*
+  '';
+
   preConfigure = "cd src";
 
   installPhase = ''
diff --git a/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch b/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch
new file mode 100644
index 00000000000..5d48fc99a0d
--- /dev/null
+++ b/pkgs/applications/networking/irc/bip/bip-0.8.8-yyparse.patch
@@ -0,0 +1,11 @@
+--- bip-0.8.8/src/lex.l.orig
++++ bip-0.8.8/src/lex.l
+@@ -16,7 +16,7 @@
+ int linec;
+ #include "util.h"
+ extern list_t *root_list;
+-void yyparse(void);
++int yyparse(void);
+ void free_conf(list_t*);
+ int conf_error;
+ typedef struct bip bip_t;
diff --git a/pkgs/applications/networking/irc/bip/default.nix b/pkgs/applications/networking/irc/bip/default.nix
index eaee36b9711..89fdf0d8df8 100644
--- a/pkgs/applications/networking/irc/bip/default.nix
+++ b/pkgs/applications/networking/irc/bip/default.nix
@@ -36,6 +36,10 @@ in stdenv.mkDerivation {
     }
   ];
 
+  postPatch = ''
+    patch -p1 < ${./bip-0.8.8-yyparse.patch}
+  '';
+
   configureFlags = [ "--disable-pie" ];
 
   buildInputs = [ bison flex autoconf automake openssl ];
@@ -45,4 +49,4 @@ in stdenv.mkDerivation {
     homepage = http://bip.milkypond.org/;
     license = stdenv.lib.licenses.gpl2;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/applications/networking/irc/irssi/fish/default.nix b/pkgs/applications/networking/irc/irssi/fish/default.nix
new file mode 100644
index 00000000000..98d5afa0ba9
--- /dev/null
+++ b/pkgs/applications/networking/irc/irssi/fish/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, irssi, gmp, automake, autoconf, libtool, openssl, glib, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "fish-irssi-20130413-e98156bebd";
+  
+  src = fetchurl {
+    url = https://github.com/falsovsky/FiSH-irssi/tarball/e98156bebd;
+    name = "${name}.tar.gz";
+    sha256 = "1ndr51qrg66h1mfzacwzl1vd6lj39pdc4p4z5iihrj4r2f6gk11a";
+  };
+
+  preConfigure = ''
+    tar xf ${irssi.src}
+    configureFlags="$configureFlags --with-irssi-source=`pwd`/${irssi.name}"
+
+    ./regen.sh
+  '';
+
+  installPhase = ''
+    ensureDir $out/lib/irssi/modules
+    cp src/.libs/libfish.so $out/lib/irssi/modules
+  '';
+  
+  buildInputs = [ gmp automake autoconf libtool openssl glib pkgconfig ];
+  
+  meta = {
+    homepage = https://github.com/falsovsky/FiSH-irssi;
+    license = "unfree"; # I can't find any mention of license
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/applications/networking/irc/irssi/otr/default.nix b/pkgs/applications/networking/irc/irssi/otr/default.nix
new file mode 100644
index 00000000000..ba3a56e642e
--- /dev/null
+++ b/pkgs/applications/networking/irc/irssi/otr/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, libotr, automake, autoconf, libtool, glib, pkgconfig, irssi }:
+
+let
+  rev = "59ddcbe66a";
+in
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "irssi-otr-20130315-${rev}";
+  
+  src = fetchurl {
+    url = "https://github.com/cryptodotis/irssi-otr/tarball/${rev}";
+    name = "${name}.tar.gz";
+    sha256 = "095dak0d10j6cpkwlqmk967p1wypwzvqr4wdqvb30w14dbn8dy0d";
+  };
+
+  patchPhase = ''
+    sed -i 's,/usr/include/irssi,${irssi}/include/irssi,' src/Makefile.am
+    sed -i "s,/usr/lib/irssi,$out/lib/irssi," configure.ac
+    sed -i "s,/usr/share/irssi,$out/share/irssi," help/Makefile.am
+  '';
+
+  preConfigure = "sh ./bootstrap";
+
+  buildInputs = [ libotr automake autoconf libtool glib pkgconfig irssi ];
+  
+  meta = {
+    homepage = https://github.com/cryptodotis/irssi-otr;
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/applications/networking/irc/konversation/default.nix b/pkgs/applications/networking/irc/konversation/default.nix
index 938a26fd785..c4d2f4b3782 100644
--- a/pkgs/applications/networking/irc/konversation/default.nix
+++ b/pkgs/applications/networking/irc/konversation/default.nix
@@ -3,15 +3,15 @@
 
 let
   pn = "konversation";
-  v = "1.3.1";
+  v = "1.4";
 in
 
 stdenv.mkDerivation rec {
   name = "${pn}-${v}";
 
   src = fetchurl {
-    url = "mirror://kde/stable/${pn}/${v}/src/${name}.tar.bz2";
-    sha256 = "0wigcvi6lscy14dhm5nh1mkhfx7xxdq9g163pwpd0xndvybrfhfl";
+    url = "mirror://kde/stable/${pn}/${v}/src/${name}.tar.xz";
+    sha256 = "030vsbb18dlzsnjl3fzyd1m9wvvksiyc1lm45abi4q6x4xd60knv";
   };
 
   buildInputs = [ cmake qt4 perl gettext libXScrnSaver kdelibs kdepimlibs
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 8dcde90e538..16aaf3d9f3b 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.7.1";
+  name = "quassel-0.7.4";
 
   src = fetchurl {
     url = "http://quassel-irc.org/pub/${name}.tar.bz2";
-    sha256 = "1kby1yikiv5bpzkdri5dq39pxnsj9gjrcv1gigvy2jzy3g99qjli";
+    sha256 = "08f4m35bkmp9p1n560a3fg711s9izb25ddx2az03xzf1jl8qdrg7";
   };
 
   buildInputs = [ cmake qt4 ]
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix
index a891c145b76..e583551bcf1 100644
--- a/pkgs/applications/networking/irc/weechat/default.nix
+++ b/pkgs/applications/networking/irc/weechat/default.nix
@@ -1,20 +1,28 @@
 { stdenv, fetchurl, ncurses, openssl, perl, python, aspell, gnutls
-, zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile }:
+, zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile
+, pythonPackages, cacert, cmake, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  version = "0.3.8";
+  version = "0.4.0";
   name = "weechat-${version}";
 
   src = fetchurl {
     url = "http://weechat.org/files/src/${name}.tar.gz";
-    sha256 = "4293eb9d29f11b8ee8c301049d57e535acbea677bc1dc41ab12fe1bb8af0f10e";
+    sha256 = "17jxknam1bbakmdfqy1b2cfc8l9ag90l3z1gcxdvwg358wasv9dc";
   };
 
   buildInputs = 
     [ ncurses perl python openssl aspell gnutls zlib curl pkgconfig
-      libgcrypt ruby lua5 tcl guile
+      libgcrypt ruby lua5 tcl guile pythonPackages.pycrypto makeWrapper
+      cacert cmake
     ];
 
+  postInstall = ''
+       wrapProgram "$out/bin/weechat-curses" \
+         --prefix PYTHONPATH : "$PYTHONPATH" \
+         --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages"
+  '';
+
   meta = {
     homepage = http://http://www.weechat.org/;
     description = "A fast, light and extensible chat client";
diff --git a/pkgs/applications/networking/irc/xchat/default.nix b/pkgs/applications/networking/irc/xchat/default.nix
index 4b9cef2d501..1999bd030cb 100644
--- a/pkgs/applications/networking/irc/xchat/default.nix
+++ b/pkgs/applications/networking/irc/xchat/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation {
   buildInputs = [pkgconfig tcl gtk];
   configureFlags = "--disable-nls";
 
+  patches = [ ./glib-top-level-header.patch ];
+
   meta = {
     description = "IRC client using GTK";
     homepage = http://www.xchat.org;
diff --git a/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch b/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch
new file mode 100644
index 00000000000..b1413b35753
--- /dev/null
+++ b/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch
@@ -0,0 +1,75 @@
+diff -Naur xchat-2.8.8-orig/src/common/dbus/dbus-plugin.c xchat-2.8.8/src/common/dbus/dbus-plugin.c
+--- xchat-2.8.8-orig/src/common/dbus/dbus-plugin.c	2009-08-16 05:40:15.000000000 -0400
++++ xchat-2.8.8/src/common/dbus/dbus-plugin.c	2012-07-15 23:07:33.678948703 -0400
+@@ -24,7 +24,7 @@
+ #include <config.h>
+ #include <dbus/dbus-glib.h>
+ #include <dbus/dbus-glib-lowlevel.h>
+-#include <glib/gi18n.h>
++#include <glib.h>
+ #include "../xchat-plugin.h"
+ 
+ #define PNAME _("remote access")
+diff -Naur xchat-2.8.8-orig/src/common/modes.c xchat-2.8.8/src/common/modes.c
+--- xchat-2.8.8-orig/src/common/modes.c	2010-05-29 21:52:18.000000000 -0400
++++ xchat-2.8.8/src/common/modes.c	2012-07-15 23:07:33.654948723 -0400
+@@ -20,7 +20,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <glib.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ #include "xchat.h"
+ #include "xchatc.h"
+diff -Naur xchat-2.8.8-orig/src/common/servlist.c xchat-2.8.8/src/common/servlist.c
+--- xchat-2.8.8-orig/src/common/servlist.c	2010-05-16 03:24:26.000000000 -0400
++++ xchat-2.8.8/src/common/servlist.c	2012-07-15 23:07:33.643948732 -0400
+@@ -24,7 +24,7 @@
+ #include <unistd.h>
+ 
+ #include "xchat.h"
+-#include <glib/ghash.h>
++#include <glib.h>
+ 
+ #include "cfgfiles.h"
+ #include "fe.h"
+diff -Naur xchat-2.8.8-orig/src/common/text.c xchat-2.8.8/src/common/text.c
+--- xchat-2.8.8-orig/src/common/text.c	2010-05-29 22:14:41.000000000 -0400
++++ xchat-2.8.8/src/common/text.c	2012-07-15 23:07:33.671948706 -0400
+@@ -28,7 +28,7 @@
+ #include <sys/mman.h>
+ 
+ #include "xchat.h"
+-#include <glib/ghash.h>
++#include <glib.h>
+ #include "cfgfiles.h"
+ #include "chanopt.h"
+ #include "plugin.h"
+diff -Naur xchat-2.8.8-orig/src/common/util.c xchat-2.8.8/src/common/util.c
+--- xchat-2.8.8-orig/src/common/util.c	2009-08-16 05:40:16.000000000 -0400
++++ xchat-2.8.8/src/common/util.c	2012-07-15 23:07:33.649948724 -0400
+@@ -39,7 +39,7 @@
+ #include <errno.h>
+ #include "xchat.h"
+ #include "xchatc.h"
+-#include <glib/gmarkup.h>
++#include <glib.h>
+ #include <ctype.h>
+ #include "util.h"
+ #include "../../config.h"
+diff -Naur xchat-2.8.8-orig/src/common/xchat.h xchat-2.8.8/src/common/xchat.h
+--- xchat-2.8.8-orig/src/common/xchat.h	2009-08-16 05:40:16.000000000 -0400
++++ xchat-2.8.8/src/common/xchat.h	2012-07-15 23:08:20.855910521 -0400
+@@ -1,10 +1,6 @@
+ #include "../../config.h"
+ 
+-#include <glib/gslist.h>
+-#include <glib/glist.h>
+-#include <glib/gutils.h>
+-#include <glib/giochannel.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <time.h>			/* need time_t */
+ 
+ #ifndef XCHAT_H
diff --git a/pkgs/applications/networking/mailreaders/imapfilter.nix b/pkgs/applications/networking/mailreaders/imapfilter.nix
new file mode 100644
index 00000000000..821de027d28
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/imapfilter.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, openssl, lua, pcre }:
+
+stdenv.mkDerivation rec {
+  name = "imapfilter-2.5.4";
+  
+  src = fetchurl {
+    url = "https://github.com/lefcha/imapfilter/archive/v2.5.4.tar.gz";
+    sha256 = "e5a9ee0e57e16d02ff2cbb37b67202a514121d2eb7fc63863174644ca8248769";
+  };
+
+  makeFlagsArray = "PREFIX=$(out)";
+  
+  propagatedBuildInputs = [ openssl pcre lua ];
+}
+
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index 5364bd445e6..fa006dc5f0d 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -14,6 +14,13 @@ assert headerCache -> gdbm != null;
 assert sslSupport -> openssl != null;
 assert saslSupport -> cyrus_sasl != null;
 
+let
+  gpgmePatch = fetchurl {
+    # Solution for gpgme >= 1.2: http://dev.mutt.org/trac/ticket/3300
+    url = "http://dev.mutt.org/trac/raw-attachment/ticket/3300/mutt-1.5.21-gpgme-init.patch";
+    sha256 = "1qa1c8gns4q3as1h2lk3x4di2k3hr804ar7xlc6xh9r0zjhzmlk4";
+  };
+in
 stdenv.mkDerivation rec {
   name = "mutt-1.5.21";
   
@@ -22,6 +29,8 @@ stdenv.mkDerivation rec {
     sha256 = "1864cwz240gh0zy56fb47qqzwyf6ghg01037rb4p2kqgimpg6h91";
   };
 
+  patches = [ (if gpgmeSupport then gpgmePatch else null) ];
+
   buildInputs = [
     ncurses which perl
     (if headerCache then gdbm else null)
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index 266035aa1bd..ebab3a42af6 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -1,16 +1,16 @@
-{ fetchurl, stdenv, bash, emacs, gdb, glib, gmime, gnupg1,
+{ fetchurl, stdenv, bash, emacs, gdb, glib, gmime, gnupg,
   pkgconfig, talloc, xapian
 }:
 
 stdenv.mkDerivation rec {
-  name = "notmuch-0.13.2";
+  name = "notmuch-0.15.2";
 
   src = fetchurl {
     url = "http://notmuchmail.org/releases/${name}.tar.gz";
-    sha256 = "75ec5f5d04bb7e3a8cc6224859b691f704a2a35f2f6027ffb674e829268f1d68";
+    sha256 = "03cwylm0y9xld0hn753v0hn62f96nagdmzxv8jlz8vdbh9iszs56";
   };
 
-  buildInputs = [ bash emacs gdb glib gmime gnupg1 pkgconfig talloc xapian ];
+  buildInputs = [ bash emacs gdb glib gmime gnupg pkgconfig talloc xapian ];
 
   patchPhase = ''
     (cd test && for prg in \
@@ -55,6 +55,14 @@ stdenv.mkDerivation rec {
       substituteInPlace "$prg" \
         --replace "#!/usr/bin/env bash" "#!${bash}/bin/bash"
     done)
+
+    for src in \
+      crypto.c \
+      emacs/notmuch-crypto.el
+    do
+      substituteInPlace "$src" \
+        --replace \"gpg\" \"${gnupg}/bin/gpg2\"
+    done
   '';
 
   # XXX: emacs tests broken
@@ -65,7 +73,7 @@ stdenv.mkDerivation rec {
     description = "Notmuch -- The mail indexer";
     longDescription = "";
     license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ chaoflow ];
+    maintainers = with stdenv.lib.maintainers; [ chaoflow garbas ];
     platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/networking/mailreaders/sylpheed/default.nix b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
index de046562274..bf9e19642b8 100644
--- a/pkgs/applications/networking/mailreaders/sylpheed/default.nix
+++ b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
@@ -5,25 +5,31 @@
 , gpgme ? null
 }:
 
+with stdenv.lib;
+
 assert sslSupport -> openssl != null;
 assert gpgSupport -> gpgme != null;
 
 stdenv.mkDerivation {
-  name = "sylpheed-2.7.1";
+  name = "sylpheed-3.2";
 
   src = fetchurl {
-    url = http://sylpheed.sraoss.jp/sylpheed/v2.7/sylpheed-2.7.1.tar.bz2;
-    sha256 = "08sfz159y8hi3lky98m6p4nkfiima749lza8gf3s3vp2niylbdlb";
+    url = http://sylpheed.sraoss.jp/sylpheed/v3.2/sylpheed-3.2.0.tar.bz2;
+    sha256 = "1cdjwn1f8rgcxzfxj7j7qvacmaw4zfhnip81q4n5lj5d6rj7rssa";
   };
 
-  buildInputs = [
-    pkgconfig gtk
-    (if sslSupport then openssl else null)
-    (if gpgSupport then gpgme else null)
-  ];
+  buildInputs =
+    [ pkgconfig gtk ]
+    ++ optional sslSupport openssl
+    ++ optional gpgSupport gpgme;
 
-  configureFlags = [
-    (if sslSupport then "--enable-ssl" else null)
-  ];
+  configureFlags = optionalString sslSupport "--enable-ssl";
 
+  meta = {
+    homepage = http://sylpheed.sraoss.jp/en/;
+    description = "A lightweight and user-friendly e-mail client";
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.linux;
+    license = "GPL";
+  };
 }
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 0c8ba4b05ff..95ae70810a1 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -2,6 +2,7 @@
 , libIDL, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss
 , libnotify, cairo, pixman, fontconfig
 , libjpeg
+, pythonPackages
 
 , # If you want the resulting program to call itself "Thunderbird"
   # instead of "Shredder", enable this option.  However, those
@@ -9,47 +10,26 @@
   # Mozilla Foundation, see
   # http://www.mozilla.org/foundation/trademarks/.
   enableOfficialBranding ? false
-
 }:
 
-let version = "11.0.1";
-
-    # This patch may become necessary when we use a more recent version of libpng
-    # for now, it's actually not needed
-    # pngPatch = fetchurl {
-    #   url = http://www.linuxfromscratch.org/patches/blfs/svn/thunderbird-9.0.1-libpng-1.5-1.patch;
-    #   sha256 = "8454bdde3be8dc37c9f5e6f597914f0a585ff4b357d3fc86c6c9f80208b6068d";
-    # };
-in
+let version = "17.0.6"; in
 
 stdenv.mkDerivation {
   name = "thunderbird-${version}";
 
   src = fetchurl {
-    url = "http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
-    sha1 = "037344b451b1c031472d92f96d401b15d8e3e7d3";
+    url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
+    sha1 = "cb5cb5dbfe77179b5853345c826eaa2bc634d48c";
   };
 
-  enableParallelBuilding = true;
+  enableParallelBuilding = false;
 
   buildInputs =
     [ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr
-      libnotify cairo pixman fontconfig yasm mesa /* nss */
-      libjpeg
+      libnotify cairo pixman fontconfig yasm mesa nss
+      libjpeg pythonPackages.sqlite3
     ];
 
-  # fix some paths in pngPatch
-  # prePatch = ''
-  #   substitute ${pngPatch} png.patch --replace "mozilla-release/modules/" "comm-release/mozilla/modules/"
-  #   '';
-
-  patches = [
-    # "png.patch" # produced by postUnpack
-
-    # Fix weird dependencies such as a so file which depends on "-lpthread".
-    # ./thunderbird-build-deps.patch
-  ];
-
   configureFlags =
     [ "--enable-application=mail"
       "--enable-optimize"
@@ -58,16 +38,19 @@ stdenv.mkDerivation {
       "--enable-strip"
       "--with-pthreads"
       "--with-system-jpeg"
-      # "--with-system-png"  # png 1.5.x not merged in nixpkgs yet
+      #"--with-system-png"
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
-      "--enable-system-cairo"
+      "--with-system-nss"
+      # Broken: https://bugzilla.mozilla.org/show_bug.cgi?id=722975
+      #"--enable-system-cairo"
       "--disable-crashreporter"
       "--disable-necko-wifi"
       "--disable-webm"
       "--disable-tests"
       "--enable-calendar"
+      "--disable-ogg"
     ]
     ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
@@ -84,10 +67,7 @@ stdenv.mkDerivation {
 
   postInstall =
     ''
-      # Fix some references to /bin paths in the Xulrunner shell script.
-      substituteInPlace $out/lib/thunderbird-*/thunderbird \
-          --replace /bin/pwd "$(type -tP pwd)" \
-          --replace /bin/ls "$(type -tP ls)"
+      rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
 
       # Create a desktop item.
       mkdir -p $out/share/applications
@@ -109,7 +89,7 @@ stdenv.mkDerivation {
       # Official branding implies thunderbird name and logo cannot be reuse,
       # see http://www.mozilla.org/foundation/licensing.html
       if enableOfficialBranding then licenses.proprietary else licenses.mpl11;
-    maintainers = with maintainers; [ pierron ];
-    platforms = with platforms; linux;
+    maintainers = [ maintainers.pierron maintainers.eelco ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/msmtp/default.nix b/pkgs/applications/networking/msmtp/default.nix
index 098d06bd077..bf0ca68177b 100644
--- a/pkgs/applications/networking/msmtp/default.nix
+++ b/pkgs/applications/networking/msmtp/default.nix
@@ -1,17 +1,18 @@
-{stdenv, fetchurl, openssl}:
-stdenv.mkDerivation {
-  name = "msmtp-1.4.21";
+{ stdenv, fetchurl, openssl, pkgconfig, gnutls, gsasl, libidn }:
+stdenv.mkDerivation rec {
+  name = "msmtp-1.4.30";
 
   src = fetchurl {
-    url = mirror://sourceforge/msmtp/msmtp-1.4.21.tar.bz2;
-    sha256 = "1yjgy56n02qs25728psg296amhbdkxq2pv1q3l484f3r9pjrpcrg";
+    url = "mirror://sourceforge/msmtp/${name}.tar.bz2";
+    sha256 = "11lq82byx9xyfkf4nrcfjjfv5k8gk3bf8zlw0kml1qrndqlvjlpi";
   };
 
-  buildInputs = [ openssl ];
+  buildInputs = [ openssl pkgconfig gnutls gsasl libidn ];
 
-  meta = { 
+  meta = {
       description = "a MUA";
-      homepage = http://msmtp.sourceforge.net/;
-      license = "GPL";
-    }; 
+      homepage = "http://msmtp.sourceforge.net/";
+      license = stdenv.lib.licenses.gpl3;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
 }
diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix
index de78e897575..9befe98399d 100644
--- a/pkgs/applications/networking/mumble/default.nix
+++ b/pkgs/applications/networking/mumble/default.nix
@@ -41,5 +41,7 @@ stdenv.mkDerivation rec {
     homepage = http://mumble.sourceforge.net/;
     description = "Low-latency, high quality voice chat software";
     license = "BSD";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
   };
 }
diff --git a/pkgs/applications/networking/offrss/default.nix b/pkgs/applications/networking/offrss/default.nix
index 5166e8795d5..fd1406127ad 100644
--- a/pkgs/applications/networking/offrss/default.nix
+++ b/pkgs/applications/networking/offrss/default.nix
@@ -9,6 +9,10 @@ stdenv.mkDerivation {
   '';
 
   crossAttrs = {
+    propagatedBuildInputs = [ curl.crossDrv libmrss.crossDrv ];
+    preConfigure = ''
+      sed 's/^PDF/#PDF/' -i Makefile
+    '';
     makeFlags = "CC=${stdenv.cross.config}-gcc";
   };
 
diff --git a/pkgs/applications/networking/p2p/freenet/default.nix b/pkgs/applications/networking/p2p/freenet/default.nix
new file mode 100644
index 00000000000..67037a07132
--- /dev/null
+++ b/pkgs/applications/networking/p2p/freenet/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, apacheAntOpenJDK, jre }:
+
+let
+  # The .gitmodules in freenet-official-20130413-eccc9b3198
+  # points to freenet-contrib-staging-ce3b7d5
+  freenet_ext = fetchurl {
+    url = https://downloads.freenetproject.org/latest/freenet-ext.jar;
+    sha1 = "507ab3f6ee91f47c187149136fb6d6e98f9a8c7f";
+  };
+
+  bcprov = fetchurl {
+    url = http://www.bouncycastle.org/download/bcprov-jdk15on-148.jar;
+    sha256 = "12129q8rmqwlvj6z4j0gc3w0hq5ccrkf2gdlsggp3iws7cp7wjw0";
+  };
+in
+stdenv.mkDerivation {
+  name = "freenet-official-20130413-eccc9b3198";
+
+  src = fetchurl {
+    url = https://github.com/freenet/fred-official/tarball/eccc9b3198;
+    name = "freenet-official-eccc9b3198.tar.gz";
+    sha256 = "0x0s8gmb95770l7968r99sq0588vf0n1687ivc2hixar19cw620y";
+  };
+
+  patchPhase = ''
+    cp ${freenet_ext} lib/freenet/freenet-ext.jar
+    cp ${bcprov} lib/bcprov.jar
+
+    sed '/antcall.*-ext/d' -i build.xml
+  '';
+
+  buildInputs = [ apacheAntOpenJDK jre ];
+
+  buildPhase = "ant package-only";
+
+  installPhase = ''
+    ensureDir $out/share/freenet $out/bin
+    cp lib/bcprov.jar $out/share/freenet
+    cp lib/freenet/freenet-ext.jar $out/share/freenet
+    cp dist/freenet.jar $out/share/freenet
+
+    cat <<EOF > $out/bin/freenet
+    #!${stdenv.shell}
+    ${jre}/bin/java -cp $out/share/freenet/bcprov.jar:$out/share/freenet/freenet-ext.jar:$out/share/freenet/freenet.jar \\
+      -Xmx1024M freenet.node.NodeStarter
+    EOF
+    chmod +x $out/bin/freenet
+  '';
+
+  meta = { 
+    description = "Decentralised and censorship-resistant network";
+    homepage = https://freenetproject.org/;
+    license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/gnunet/0.8.nix b/pkgs/applications/networking/p2p/gnunet/0.8.nix
deleted file mode 100644
index 586146bdd9d..00000000000
--- a/pkgs/applications/networking/p2p/gnunet/0.8.nix
+++ /dev/null
@@ -1,85 +0,0 @@
-{ stdenv, fetchurl, libextractor, libmicrohttpd, libgcrypt
-, zlib, gmp, curl, libtool, guile, adns, sqlite, pkgconfig
-, libxml2, ncurses, gettext, findutils
-, gtkSupport ? false, gtk ? null, libglade ? null
-, makeWrapper }:
-
-assert gtkSupport -> (gtk != null) && (libglade != null);
-
-let version = "0.8.1b";
-in
-  stdenv.mkDerivation {
-    name = "gnunet-${version}";
-
-    src = fetchurl {
-      url = "mirror://gnu/gnunet/GNUnet-${version}.tar.gz";
-      sha256 = "0k6nrsxz5s52z6hlahb7d3sj1z0gidm79n04pf9j2ngfylp4v1bw";
-    };
-
-    buildInputs = [
-      libextractor libmicrohttpd libgcrypt gmp curl libtool
-      zlib guile adns sqlite libxml2 ncurses
-      pkgconfig gettext findutils
-      makeWrapper
-    ] ++ (if gtkSupport then [ gtk libglade ] else []);
-
-    preConfigure = ''
-      # Brute force: since nix-worker chroots don't provide
-      # /etc/{resolv.conf,hosts}, replace all references to `localhost'
-      # by their IPv4 equivalent.
-      for i in $(find . \( -name \*.c -or -name \*.conf \) \
-                      -exec grep -l localhost {} \;)
-      do
-        echo "$i: substituting \`127.0.0.1' to \`localhost'..."
-        substituteInPlace "$i" --replace "localhost" "127.0.0.1"
-      done
-
-      # Make sure the tests don't rely on `/tmp', for the sake of chroot
-      # builds.
-      for i in $(find . \( -iname \*test\*.c -or -name \*.conf \) \
-                      -exec grep -l /tmp {} \;)
-      do
-        echo "$i: replacing references to \`/tmp' by \`$TMPDIR'..."
-        substituteInPlace "$i" --replace "/tmp" "$TMPDIR"
-      done
-    '';
-
-    doCheck = false;
-
-    # 1. Run tests have once GNUnet is installed.
-    # 2. Help programs find the numerous modules that sit under
-    #    `$out/lib/GNUnet'.
-
-    # FIXME: `src/transports/test_udp' hangs forever.
-    postInstall = ''
-      #GNUNET_PREFIX="$out" make check
-      wrapProgram "$out/bin/gnunetd" \
-        --prefix LTDL_LIBRARY_PATH ":" "$out/lib/GNUnet"
-    '';
-
-    meta = {
-      description = "GNUnet, GNU's decentralized anonymous and censorship-resistant P2P framework";
-
-      longDescription = ''
-        GNUnet is a framework for secure peer-to-peer networking that
-        does not use any centralized or otherwise trusted services.  A
-        first service implemented on top of the networking layer
-        allows anonymous censorship-resistant file-sharing.  Anonymity
-        is provided by making messages originating from a peer
-        indistinguishable from messages that the peer is routing.  All
-        peers act as routers and use link-encrypted connections with
-        stable bandwidth utilization to communicate with each other.
-        GNUnet uses a simple, excess-based economic model to allocate
-        resources.  Peers in GNUnet monitor each others behavior with
-        respect to resource usage; peers that contribute to the
-        network are rewarded with better service.
-      '';
-
-      homepage = http://gnunet.org/;
-
-      license = "GPLv2+";
-
-      maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = stdenv.lib.platforms.gnu;
-    };
-  }
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index f2fbf704649..704dd5719c7 100644
--- a/pkgs/applications/networking/p2p/gnunet/default.nix
+++ b/pkgs/applications/networking/p2p/gnunet/default.nix
@@ -1,19 +1,19 @@
 { stdenv, fetchurl, libextractor, libmicrohttpd, libgcrypt
 , zlib, gmp, curl, libtool, adns, sqlite, pkgconfig
-, libxml2, ncurses, gettext, libunistring
+, libxml2, ncurses, gettext, libunistring, libidn
 , makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "gnunet-0.9.3";
+  name = "gnunet-0.9.5a";
 
   src = fetchurl {
     url = "mirror://gnu/gnunet/${name}.tar.gz";
-    sha256 = "0ppirvwjb7w7270g0w83z6wyk984cnxv2ydxj7qr0j1cz2j6nn2h";
+    sha256 = "1mxy1ikv44fia3cybpmiw298x5371a2qh8hr7pi55yg1xqbhfq0x";
   };
 
   buildInputs = [
     libextractor libmicrohttpd libgcrypt gmp curl libtool
-    zlib adns sqlite libxml2 ncurses
+    zlib adns sqlite libxml2 ncurses libidn
     pkgconfig gettext libunistring makeWrapper
   ];
 
@@ -36,6 +36,10 @@ stdenv.mkDerivation rec {
       echo "$i: replacing references to \`/tmp' by \`$TMPDIR'..."
       substituteInPlace "$i" --replace "/tmp" "$TMPDIR"
     done
+
+    # Ensure NSS installation works fine
+    configureFlags="$configureFlags --with-nssdir=$out/lib"
+    patchShebangs src/gns/nss/install-nss-plugin.sh
   '';
 
   doCheck = false;
@@ -72,7 +76,7 @@ stdenv.mkDerivation rec {
 
     license = "GPLv2+";
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = with stdenv.lib.maintainers; [ ludo viric ];
     platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/networking/p2p/gnunet/svn.nix b/pkgs/applications/networking/p2p/gnunet/svn.nix
new file mode 100644
index 00000000000..4bff8239adf
--- /dev/null
+++ b/pkgs/applications/networking/p2p/gnunet/svn.nix
@@ -0,0 +1,90 @@
+{ stdenv, fetchsvn, libextractor, libmicrohttpd, libgcrypt
+, zlib, gmp, curl, libtool, adns, sqlite, pkgconfig
+, libxml2, ncurses, gettext, libunistring, libidn
+, makeWrapper, autoconf, automake }:
+
+let
+  rev = "27317";
+in
+stdenv.mkDerivation rec {
+  name = "gnunet-svn-${rev}";
+
+  src = fetchsvn {
+    url =  https://gnunet.org/svn/gnunet;
+    rev = "27317";
+    sha256 = "1l7jypm57wjhzlwdj8xzhfppjdpy6wbph4nqgwxxb9q056wwf9zy";
+  };
+
+  buildInputs = [
+    libextractor libmicrohttpd libgcrypt gmp curl libtool
+    zlib adns sqlite libxml2 ncurses libidn
+    pkgconfig gettext libunistring makeWrapper
+    autoconf automake
+  ];
+
+  preConfigure = ''
+    # Brute force: since nix-worker chroots don't provide
+    # /etc/{resolv.conf,hosts}, replace all references to `localhost'
+    # by their IPv4 equivalent.
+    for i in $(find . \( -name \*.c -or -name \*.conf \) \
+                    -exec grep -l '\<localhost\>' {} \;)
+    do
+      echo "$i: substituting \`127.0.0.1' to \`localhost'..."
+      sed -i "$i" -e's/\<localhost\>/127.0.0.1/g'
+    done
+
+    # Make sure the tests don't rely on `/tmp', for the sake of chroot
+    # builds.
+    for i in $(find . \( -iname \*test\*.c -or -name \*.conf \) \
+                    -exec grep -l /tmp {} \;)
+    do
+      echo "$i: replacing references to \`/tmp' by \`$TMPDIR'..."
+      substituteInPlace "$i" --replace "/tmp" "$TMPDIR"
+    done
+
+    # Ensure NSS installation works fine
+    configureFlags="$configureFlags --with-nssdir=$out/lib"
+    patchShebangs src/gns/nss/install-nss-plugin.sh
+
+    sh contrib/pogen.sh
+    sh bootstrap
+  '';
+
+  doCheck = false;
+
+  /* FIXME: Tests must be run this way, but there are still a couple of
+     failures.
+
+  postInstall =
+    '' export GNUNET_PREFIX="$out"
+       export PATH="$out/bin:$PATH"
+       make -k check
+    '';
+  */
+
+  meta = {
+    description = "GNUnet, GNU's decentralized anonymous and censorship-resistant P2P framework";
+
+    longDescription = ''
+      GNUnet is a framework for secure peer-to-peer networking that
+      does not use any centralized or otherwise trusted services.  A
+      first service implemented on top of the networking layer
+      allows anonymous censorship-resistant file-sharing.  Anonymity
+      is provided by making messages originating from a peer
+      indistinguishable from messages that the peer is routing.  All
+      peers act as routers and use link-encrypted connections with
+      stable bandwidth utilization to communicate with each other.
+      GNUnet uses a simple, excess-based economic model to allocate
+      resources.  Peers in GNUnet monitor each others behavior with
+      respect to resource usage; peers that contribute to the
+      network are rewarded with better service.
+    '';
+
+    homepage = http://gnunet.org/;
+
+    license = "GPLv2+";
+
+    maintainers = with stdenv.lib.maintainers; [ ludo viric ];
+    platforms = stdenv.lib.platforms.gnu;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/ktorrent/default.nix b/pkgs/applications/networking/p2p/ktorrent/default.nix
index 5f15cbc495f..b408f20b711 100644
--- a/pkgs/applications/networking/p2p/ktorrent/default.nix
+++ b/pkgs/applications/networking/p2p/ktorrent/default.nix
@@ -5,14 +5,14 @@ stdenv.mkDerivation rec {
   name = pname + "-" + version;
 
   pname = "ktorrent";
-  version = "4.1.3";
+  version = "4.2.1";
 
   src = fetchurl {
     url = "${meta.homepage}/downloads/${version}/${name}.tar.bz2";
-    sha256 = "0ih68bml6ic3mxk5l4ypgmxwyg9mglp57gw5igrnm5yszm7jz19g";
+    sha256 = "1b6w7i1vvq8mlw9yrlxvb51hvaj6rpl8lv9b9zagyl3wcanz73zd";
   };
 
-  patches = [ ./find-workspace.diff ./drop-taskmanager-dependency.patch ];
+  patches = [ ./find-workspace.diff ];
 
   KDEDIRS = libktorrent;
 
diff --git a/pkgs/applications/networking/p2p/ktorrent/drop-taskmanager-dependency.patch b/pkgs/applications/networking/p2p/ktorrent/drop-taskmanager-dependency.patch
deleted file mode 100644
index 2998b392679..00000000000
--- a/pkgs/applications/networking/p2p/ktorrent/drop-taskmanager-dependency.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-commit 6d4a6ae51692966862ccb20d17cb217717519d40
-Author: Joris Guisson <joris.guisson@gmail.com>
-Date:   Wed Nov 23 20:17:08 2011 +0100
-
-    Use dbus to show ktorrent window from plasma applet. This removes the dependency on libtaskmanager.
-    
-    BUG: 287309
-Changelog removed by Yury G. Kudryashov
-
-diff --git a/plasma/applet/CMakeLists.txt b/plasma/applet/CMakeLists.txt
-index 3a72241..4307cf2 100644
---- a/plasma/applet/CMakeLists.txt
-+++ b/plasma/applet/CMakeLists.txt
-@@ -5,25 +5,15 @@ if(NOT QT_VERSION_OK)
- 
- else(NOT QT_VERSION_OK)
- 	
--	set(TASKMANAGER_FOUND FALSE)
--	FIND_PATH(TASKMANAGER_INCLUDE_DIR NAMES taskmanager.h  PATHS ${KDE4_INCLUDE_DIR}/taskmanager ${INCLUDE_INSTALL_DIR}/taskmanager.h)
--	FIND_LIBRARY(TASKMANAGER_LIBRARY NAMES taskmanager PATHS ${KDE4_LIB_DIR} ${LIB_INSTALL_DIR})
--
--	if(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
--		set(TASKMANAGER_FOUND TRUE)
--		message(STATUS "Found libtaskmanager: ${TASKMANAGER_LIBRARY} ")
--		include_directories(${TASKMANAGER_INCLUDE_DIR})
--		set(ktapplet_SRCS applet.cpp chunkbar.cpp fadingitem.cpp fadingnavigationwidget.cpp)
--		
--		kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
--		
--		kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
--		target_link_libraries(plasma_applet_ktorrent  ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${TASKMANAGER_LIBRARY} ${LIBKTORRENT_LIBRARIES} ktcore)
--		
--		install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
--		install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
--	endif(TASKMANAGER_INCLUDE_DIR AND TASKMANAGER_LIBRARY)
--
--	macro_log_feature(TASKMANAGER_FOUND "libtaskmanager" "libtaskmanager library and header files" "http://www.kde.org/" FALSE "" "libtaskmanager is needed for KTorrent Plasmoid")
-+	
-+	set(ktapplet_SRCS applet.cpp chunkbar.cpp fadingitem.cpp fadingnavigationwidget.cpp)
-+	
-+	kde4_add_ui_files(ktapplet_SRCS appletconfig.ui)
-+	
-+	kde4_add_plugin(plasma_applet_ktorrent ${ktapplet_SRCS})
-+	target_link_libraries(plasma_applet_ktorrent  ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS} ${LIBKTORRENT_LIBRARIES} ktcore)
-+	
-+	install(TARGETS plasma_applet_ktorrent DESTINATION ${PLUGIN_INSTALL_DIR})
-+	install(FILES plasma-applet-ktorrent.desktop DESTINATION ${SERVICES_INSTALL_DIR})
- 
- endif(NOT QT_VERSION_OK)
-diff --git a/plasma/applet/applet.cpp b/plasma/applet/applet.cpp
-index 59e7191..bf09479 100644
---- a/plasma/applet/applet.cpp
-+++ b/plasma/applet/applet.cpp
-@@ -21,6 +21,9 @@
- #include "applet.h"
- #include <QFile>
- #include <QGraphicsLinearLayout>
-+#include <QDBusConnection>
-+#include <QDBusConnectionInterface>
-+#include <QDBusMessage>
- #include <KConfigDialog>
- #include <KLocale>
- #include <KRun>
-@@ -31,12 +34,11 @@
- #include <Plasma/IconWidget>
- #endif
- #include <Plasma/Label>
--#include <taskmanager/taskmanager.h>
--#include <taskmanager/task.h>
- #include <util/functions.h>
- #include "chunkbar.h"
- #include "fadingnavigationwidget.h"
- 
-+
- using namespace bt;
- 
- namespace ktplasma
-@@ -174,7 +176,8 @@ namespace ktplasma
- 		}
- 	}
- 
--	void Applet::updateNavigation() {
-+	void Applet::updateNavigation() 
-+	{
- 		navigation->setEnabled(connected_to_app && !sources.empty()
- 			&& (sources.count() > 1 || !sources.contains(current_source)));
- 	}
-@@ -193,12 +196,14 @@ namespace ktplasma
- 		}
- 	}
- 	
--	void Applet::updateSources() {
-+	void Applet::updateSources() 
-+	{
- 		sources = engine->sources();
- 		sources.removeOne("core");
- 	}
- 
--	void Applet::setSource(QString source) {
-+	void Applet::setSource(QString source) 
-+	{
- 		if (!current_source.isEmpty())
- 			engine->disconnectSource(current_source,this);
- 		clearData();
-@@ -340,20 +345,39 @@ namespace ktplasma
- 
- 	void Applet::iconClicked()
- 	{
--		TaskManager::TaskDict tasks = TaskManager::TaskManager::self()->tasks();
--		for (TaskManager::TaskDict::iterator i = tasks.begin();i != tasks.end();i ++)
-+		QDBusConnection session_bus = QDBusConnection::sessionBus();
-+		QDBusConnectionInterface* dbus_service = session_bus.interface();
-+		if (!session_bus.isConnected() || !dbus_service || !dbus_service->isServiceRegistered("org.ktorrent.ktorrent"))
- 		{
--			if (i.value()->className() == "ktorrent")
--			{
--				KWindowSystem::activateWindow(i.key());
--				return;
--			}
-+			// can't find the window, try launching it
-+			KUrl::List empty;
-+			KRun::run("ktorrent", empty, 0);
-+		}
-+		else
-+		{
-+			QDBusMessage msg = QDBusMessage::createMethodCall("org.ktorrent.ktorrent", "/ktorrent/MainWindow_1", "org.kde.KMainWindow", "winId");
-+			QDBusPendingCall call = session_bus.asyncCall(msg, 5000);
-+			QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher(call ,this);
-+			connect(watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(dbusCallFinished(QDBusPendingCallWatcher*)));
- 		}
--
--		// can't find the window, try launching it
--		KUrl::List empty;
--		KRun::run("ktorrent", empty, 0);
- 	}
-+	
-+	void Applet::dbusCallFinished(QDBusPendingCallWatcher* self)
-+	{
-+		if (self->isError())
-+		{
-+			// call failed, try launching it
-+			KUrl::List empty;
-+			KRun::run("ktorrent", empty, 0);
-+		}
-+		else
-+		{
-+			QDBusPendingReply<qlonglong> reply = *self;
-+			KWindowSystem::activateWindow(reply.value());		
-+		}
-+		self->deleteLater();
-+	}
-+
- 
- 	void Applet::clearData()
- 	{		
-diff --git a/plasma/applet/applet.h b/plasma/applet/applet.h
-index 29b3265..d396118 100644
---- a/plasma/applet/applet.h
-+++ b/plasma/applet/applet.h
-@@ -27,6 +27,7 @@
- #include "fadingnavigationwidget.h"
- 
- class QGraphicsLinearLayout;
-+class QDBusPendingCallWatcher;
- 
- namespace Plasma
- {
-@@ -68,6 +69,7 @@ namespace ktplasma
- 		void iconClicked();
- 		void selectPrev();
- 		void selectNext();
-+		void dbusCallFinished(QDBusPendingCallWatcher* self);
- 		
- 	private:
- 		void updateTorrentCombo();
diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix
index f86901d5dde..2f739b056d4 100644
--- a/pkgs/applications/networking/p2p/mldonkey/default.nix
+++ b/pkgs/applications/networking/p2p/mldonkey/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }:
 
 stdenv.mkDerivation (rec {
-  name = "mldonkey-3.1.1";
+  name = "mldonkey-3.1.3";
   
   src = fetchurl {
     url = "mirror://sourceforge/mldonkey/${name}.tar.bz2";
-    sha256 = "1cj0xvfx03jnpifcqxcgfjhkl3f70r86d8zn2flj9wvlnam98qlr";
+    sha256 = "1qnr0qzliw4aynf2zhmm5hmrc9bd5vhdq3bi8n88j4nc86gry9bw";
   };
   
   meta = {
@@ -15,9 +15,9 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ ocaml zlib ncurses bzip2 file gd libpng ];
   configureFlags = [ "--disable-gui" ];
-} // (if (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux") then
+} // (if !ocaml.nativeCompilers then
 {
-  # Byte code compilation (the ocaml opt compiler is not supported in many platforms)
+  # Byte code compilation (the ocaml opt compiler is not supported in some platforms)
   buildPhase = "make mlnet.byte";
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/networking/p2p/transmission/2.60.nix b/pkgs/applications/networking/p2p/transmission/2.60.nix
new file mode 100644
index 00000000000..c59fddf6364
--- /dev/null
+++ b/pkgs/applications/networking/p2p/transmission/2.60.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent,
+  file, inotifyTools, gtk ? null }:
+
+stdenv.mkDerivation rec {
+  name = "transmission-2.60"; # transmission >= 2.61 requires gtk3
+
+  src = fetchurl {
+    url = "http://download.transmissionbt.com/files/${name}.tar.xz";
+    sha256 = "1ramdliyy8j7qqpkxg643lda11ynxwfhq6qcs31fr3h9x72l0rg4";
+  };
+
+  buildInputs = [ pkgconfig openssl curl intltool libevent
+                  file inotifyTools gtk ];
+
+  preConfigure = ''
+    sed -i -e 's|/usr/bin/file|${file}/bin/file|g' configure
+  '';
+
+  postInstall = ''
+    rm -f $out/share/icons/hicolor/icon-theme.cache
+  '';
+
+  meta = {
+    description = "A fast, easy and free BitTorrent client";
+    longDescription = ''
+      Transmission is a BitTorrent client which features a simple interface
+      on top of a cross-platform back-end.
+      Feature spotlight:
+        * Uses fewer resources than other clients
+        * Native Mac, GTK+ and Qt GUI clients
+        * Daemon ideal for servers, embedded systems, and headless use
+        * All these can be remote controlled by Web and Terminal clients
+        * Bluetack (PeerGuardian) blocklists with automatic updates
+        * Full encryption, DHT, and PEX support
+    '';
+    homepage = http://www.transmissionbt.com/;
+    license = [ "GPLv2" ];
+    maintainers = [ stdenv.lib.maintainers.astsmtl ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix
index 0a86e140347..2c6106d1304 100644
--- a/pkgs/applications/networking/p2p/transmission/default.nix
+++ b/pkgs/applications/networking/p2p/transmission/default.nix
@@ -1,20 +1,29 @@
-{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent, gtkClient ? true, gtk }:
+{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent
+, file, inotifyTools
+, enableGtk ? false, gtk ? null }:
+
+assert enableGtk -> gtk != null;
 
 stdenv.mkDerivation rec {
-  name = "transmission-2.52";
+  name = "transmission-2.77"; # transmission >= 2.61 requires gtk3
 
   src = fetchurl {
     url = "http://download.transmissionbt.com/files/${name}.tar.xz";
-    sha256 = "05sfq5h3731xc9a1k5r1q4gbs9yk0dr229asfxjjgg0lw1xzppdw";
+    sha256 = "1phzhj4wds6r2ziclva1b5l6l9xjsx5ji7s3m4xia44aq4znbcam";
   };
 
-  buildInputs = [ pkgconfig openssl curl intltool libevent ] ++
-                stdenv.lib.optional gtkClient gtk;
+  buildInputs = [ pkgconfig openssl curl intltool libevent
+                  file inotifyTools ]
+    ++ stdenv.lib.optional enableGtk gtk;
+
+  preConfigure = ''
+    sed -i -e 's|/usr/bin/file|${file}/bin/file|g' configure
+  '';
 
-  configureFlags = if gtkClient then "--enable-gtk" else "--disable-gtk";
+  configureFlags = stdenv.lib.optionalString enableGtk "--with-gtk";
 
   postInstall = ''
-    rm $out/share/icons/hicolor/icon-theme.cache
+    rm -f $out/share/icons/hicolor/icon-theme.cache
   '';
 
   meta = {
diff --git a/pkgs/applications/networking/remote/freerdp/default.nix b/pkgs/applications/networking/remote/freerdp/default.nix
index 434d75bce58..d8634e31dad 100644
--- a/pkgs/applications/networking/remote/freerdp/default.nix
+++ b/pkgs/applications/networking/remote/freerdp/default.nix
@@ -10,16 +10,22 @@
 , libXdamage
 , libXext
 , alsaLib
+, ffmpeg
+, libxkbfile
+#, xmlto, docbook_xml_dtd_412, docbook_xml_xslt
+, libXinerama
+, libXv
+, pulseaudioSupport ? true, pulseaudio
 }:
 
 assert printerSupport -> cups != null;
 stdenv.mkDerivation rec {
   name = "freerdp-${version}";
-  version = "1.0.0";
+  version = "1.0.1";
 
   src = fetchurl {
-    url = "https://github.com/downloads/FreeRDP/FreeRDP/FreeRDP-${version}.tar.gz";
-    sha256 = "df9f5f3275436f3e413824ca40f1e41733a95121f45e1ed41ab410701c5764cc";
+    url = "https://github.com/FreeRDP/FreeRDP/archive/${version}.tar.gz";
+    sha256 = "1my8gamvfrn6v9gcqxsa9cgxr42shc0l826zvxj8wpcay6gd321w";
   };
 
   buildInputs = [
@@ -32,11 +38,17 @@ stdenv.mkDerivation rec {
     libXdamage
     libXext
     alsaLib
+    ffmpeg
+    libxkbfile
+#    xmlto docbook_xml_dtd_412 docbook_xml_xslt
+    libXinerama
+    libXv
   ] ++ stdenv.lib.optional printerSupport cups;
 
   configureFlags = [
-    "--with-x"
-  ] ++ stdenv.lib.optional printerSupport "--with-printer=cups";
+    "--with-x" "-DWITH_MANPAGES=OFF"
+  ] ++ stdenv.lib.optional printerSupport "--with-printer=cups"
+    ++ stdenv.lib.optional pulseaudioSupport "-DWITH_PULSEAUDIO=ON";
 
   meta = {
     description = "A Remote Desktop Protocol Client";
diff --git a/pkgs/applications/networking/remote/freerdp/unstable.nix b/pkgs/applications/networking/remote/freerdp/unstable.nix
index 2266f7237f6..ef8ddf8b0e3 100644
--- a/pkgs/applications/networking/remote/freerdp/unstable.nix
+++ b/pkgs/applications/networking/remote/freerdp/unstable.nix
@@ -1,53 +1,63 @@
 { stdenv
 , fetchgit
+, cmake
 , openssl
 , printerSupport ? true, cups
 , pkgconfig
 , zlib
 , libX11
 , libXcursor
+, libXdamage
+, libXext
 , alsaLib
-, cmake
+, ffmpeg
 , libxkbfile
+#, xmlto, docbook_xml_dtd_412, docbook_xml_xslt
 , libXinerama
-, libXext
-, directfb
-, cunit
+#, directfb
+#, cunit
+, libXv
+, pulseaudioSupport ? true, pulseaudio
 }:
 
 assert printerSupport -> cups != null;
 
-let rev = "498b88a1da748a4a2b4dbd12c795ca87fee24bab"; in
+let rev = "ec6effcb1e7759551cf31f5b18d768afc67db97d"; in
 
 stdenv.mkDerivation rec {
-  name = "freerdp-1.0pre${rev}";
+  name = "freerdp-1.1pre${rev}";
 
   src = fetchgit {
     url = git://github.com/FreeRDP/FreeRDP.git;
     inherit rev;
-    sha256 = "91ef562e96db483ada28236e524326a75b6942becce4fd2a65ace386186eccf7";
+    sha256 = "4e5af9a6769c4b34c6b75dffe83a385d1d86068c523ea9f62fabc651a2958455";
   };
 
   buildInputs = [
+    cmake
     openssl
     pkgconfig
     zlib
     libX11
     libXcursor
-    libxkbfile
-    libXinerama
+    libXdamage
     libXext
-    directfb
+#    directfb
+#    cunit
     alsaLib
-    cmake
-    cunit
+    ffmpeg
+    libxkbfile
+#    xmlto docbook_xml_dtd_412 docbook_xml_xslt
+    libXinerama
+    libXv
   ] ++ stdenv.lib.optional printerSupport cups;
 
   doCheck = false;
 
   checkPhase = ''LD_LIBRARY_PATH="libfreerdp-cache:libfreerdp-chanman:libfreerdp-common:libfreerdp-core:libfreerdp-gdi:libfreerdp-kbd:libfreerdp-rail:libfreerdp-rfx:libfreerdp-utils" cunit/test_freerdp'';
 
-  cmakeFlags = [ "-DWITH_DIRECTFB=ON" "-DWITH_CUNIT=ON" ];
+  cmakeFlags = [ "-DWITH_DIRECTFB=OFF" "-DWITH_CUNIT=OFF" "-DWITH_MANPAGES=OFF" 
+  ] ++ stdenv.lib.optional pulseaudioSupport "-DWITH_PULSEAUDIO=ON";
 
   meta = {
     description = "A Remote Desktop Protocol Client";
diff --git a/pkgs/applications/networking/remote/putty/default.nix b/pkgs/applications/networking/remote/putty/default.nix
index 5fa1aefe7b0..e35f8c739c5 100644
--- a/pkgs/applications/networking/remote/putty/default.nix
+++ b/pkgs/applications/networking/remote/putty/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchsvn, ncurses, gtk, pkgconfig, autoconf, automake, perl, halibut }:
+{ stdenv, fetchsvn, ncurses, gtk, pkgconfig, autoconf, automake, perl, halibut
+, libtool }:
  
 let
-  rev = 8934;
+  rev = 9690;
 in
 stdenv.mkDerivation {
   name = "putty-${toString rev}";
@@ -10,10 +11,11 @@ stdenv.mkDerivation {
   preConfigure = ''
     perl mkfiles.pl
     ( cd doc ; make );
+    sed '/AM_PATH_GTK(/d' -i unix/configure.ac
+    sed '/AC_OUTPUT/iAM_PROG_CC_C_O' -i unix/configure.ac
+    sed '/AC_OUTPUT/iAM_PROG_AR' -i unix/configure.ac
+    ./mkauto.sh
     cd unix
-    sed '/AM_PATH_GTK(/d' -i configure.ac
-    cp ${automake}/share/automake-*/install-sh .
-    autoreconf -vf
   '';
   
   # The hash is going to change on new snapshot.
@@ -21,8 +23,8 @@ stdenv.mkDerivation {
   src = fetchsvn {
     url = svn://svn.tartarus.org/sgt/putty;
     rev = rev;
-    sha256 = "f5d9870dde7166afd277f7501914c6515b35ee7bb42965ccd22fe977ee5d1b0d";
+    sha256 = "e1fb49766e0724a12776ec3d6cd0bd420e03ebdc3383a01a12dbfd30983f81ef";
   };
 
-  buildInputs = [ gtk ncurses pkgconfig autoconf automake perl halibut ];
+  buildInputs = [ gtk ncurses pkgconfig autoconf automake perl halibut libtool ];
 }
diff --git a/pkgs/applications/networking/remote/teamviewer/8.nix b/pkgs/applications/networking/remote/teamviewer/8.nix
new file mode 100644
index 00000000000..8113e33e0a7
--- /dev/null
+++ b/pkgs/applications/networking/remote/teamviewer/8.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
+, bash }:
+
+# Work in progress.
+
+# It doesn't want to start unless teamviewerd is running as root.
+# I haven't tried to make the daemon run.
+
+assert stdenv.system == "i686-linux";
+let
+  topath = "${wine}/bin";
+
+  toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
+    [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wine ]);
+in
+stdenv.mkDerivation {
+  name = "teamviewer-8.0.17147";
+  src = fetchurl {
+    url = "http://download.teamviewer.com/download/teamviewer_linux_x64.deb";
+    sha256 = "01iynk954pphl5mq4avs843xyzvdfzng1lpsy7skgwvw0k9cx5ab";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  unpackPhase = ''
+    ar x $src
+    tar xf data.tar.gz
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/teamviewer8 $out/bin
+    cp -a opt/teamviewer8/* $out/share/teamviewer8
+    rm -R $out/share/teamviewer8/tv_bin/wine/{bin,lib,share}
+
+    cat > $out/bin/teamviewer << EOF
+    #!${bash}/bin/sh
+    export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
+    export PATH=${topath}\''${PATH:+:\$PATH}
+    $out/share/teamviewer8/tv_bin/script/teamviewer
+    EOF
+    chmod +x $out/bin/teamviewer
+  '';
+
+  meta = {
+    homepage = "http://www.teamviewer.com";
+    license = "unfree";
+    description = "Desktop sharing application, providing remote support and online meetings";
+  };
+}
diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix
new file mode 100644
index 00000000000..8c629519764
--- /dev/null
+++ b/pkgs/applications/networking/remote/teamviewer/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
+, bash }:
+
+assert stdenv.system == "i686-linux";
+let
+  topath = "${wine}/bin";
+
+  toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
+    [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wine ]);
+in
+stdenv.mkDerivation {
+  name = "teamviewer-7.0.9377";
+  src = fetchurl {
+    url = "http://www.teamviewer.com/download/version_7x/teamviewer_linux.tar.gz";
+    sha256 = "1f8934jqj093m1z56yl6k2ah6njkk6pz1rjvpqnryi29pp5piaiy";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  # I need patching, mainly for it not try to use its own 'wine' (in the tarball).
+  installPhase = ''
+    mkdir -p $out/share/teamviewer $out/bin
+    cp -a .tvscript/* $out/share/teamviewer
+    cp -a .wine/drive_c $out/share/teamviewer
+    sed -i -e 's/^tv_Run//' \
+      -e 's/^  setup_tar_env//' \
+      -e 's/^  setup_env//' \
+      -e 's,^  TV_Wine_dir=.*,  TV_Wine_dir=${wine},' \
+      -e 's,progsrc=.*drive_c,progsrc='$out'"/share/teamviewer/drive_c,' \
+      $out/share/teamviewer/wrapper
+
+    cat > $out/bin/teamviewer << EOF
+    #!${bash}/bin/sh
+    export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
+    export PATH=${topath}\''${PATH:+:\$PATH}
+    $out/share/teamviewer/wrapper wine "c:\Program Files\TeamViewer\Version7\TeamViewer.exe" "\$@"
+    EOF
+    chmod +x $out/bin/teamviewer
+  '';
+
+  meta = {
+    homepage = "http://www.teamviewer.com";
+    license = "unfree";
+    description = "Desktop sharing application, providing remote support and online meetings";
+  };
+}
diff --git a/pkgs/applications/networking/sniffers/etherape/default.nix b/pkgs/applications/networking/sniffers/etherape/default.nix
index e268cdb7bba..3b9b8cce9e7 100644
--- a/pkgs/applications/networking/sniffers/etherape/default.nix
+++ b/pkgs/applications/networking/sniffers/etherape/default.nix
@@ -1,5 +1,5 @@
-{stdenv, fetchurl, pkgconfig, gtk, libpcap, libglade, libgnome, libgnomeui,
-gnomedocutils, scrollkeeper, libxslt}:
+{ stdenv, fetchurl, pkgconfig, libtool, gtk, libpcap, libglade, libgnome, libgnomeui
+, gnomedocutils, scrollkeeper, libxslt }:
 
 stdenv.mkDerivation rec {
   name = "etherape-0.9.12";
@@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
   };
 
   configureFlags = [ "--disable-scrollkeeper" ];
-  buildInputs = [ gtk libpcap pkgconfig libglade libgnome libgnomeui gnomedocutils
-    scrollkeeper libxslt ];
+  buildInputs = [
+    pkgconfig libtool gtk libpcap libglade libgnome libgnomeui gnomedocutils
+    scrollkeeper libxslt
+  ];
 
   meta = {
     homepage = http://etherape.sourceforge.net/;
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index aca0203ca6c..599229753b5 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -1,32 +1,50 @@
 { stdenv, fetchurl, perl, pkgconfig, gtk, libpcap, flex, bison
 , gnutls, libgcrypt, glib, zlib, libxml2, libxslt, adns, geoip
 , heimdal, python, lynx, lua5
+, makeDesktopItem
 }:
 
-let
-  version = "1.6.2";
-in
+let version = "1.8.7"; in
+
 stdenv.mkDerivation {
   name = "wireshark-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/wireshark/wireshark-${version}.tar.bz2";
-    sha256 = "0zqy8ws05xz36y49azf5lrwzgfz26h7f8d27xjc89hlqrqagahsk";
+    sha256 = "0hm8zisy5dg7sfhh7rvgnpffq2qcw0syd8k5kns8j0j13sf44zjw";
   };
 
-  buildInputs = [perl pkgconfig gtk libpcap flex bison gnutls libgcrypt
-    glib zlib libxml2 libxslt adns geoip heimdal python lynx lua5
-  ];
+  buildInputs =
+    [ perl pkgconfig gtk libpcap flex bison gnutls libgcrypt
+      glib zlib libxml2 libxslt adns geoip heimdal python lynx lua5
+    ];
 
   configureFlags = "--disable-usr-local --with-ssl --enable-threads --enable-packet-editor";
 
+  desktopItem = makeDesktopItem {
+    name = "Wireshark";
+    exec = "wireshark";
+    icon = "wireshark";
+    comment = "Powerful network protocol analysis suite";
+    desktopName = "Wireshark";
+    genericName = "Network packet analyzer";
+    categories = "Network;System";
+  };
+
+  postInstall = ''
+    mkdir -p "$out"/share/applications/
+    mkdir -p "$out"/share/icons/
+    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    cp image/wsicon.svg "$out"/share/icons/wireshark.svg
+  '';
+
   meta = {
-    homepage = "http://sourceforge.net/projects/wireshark/";
+    homepage = http://www.wireshark.org/;
     description = "a powerful network protocol analyzer";
     license = stdenv.lib.licenses.gpl2;
 
     longDescription = ''
-      Wireshark (formerly known as "Etherreal") is a powerful network
+      Wireshark (formerly known as "Ethereal") is a powerful network
       protocol analyzer developed by an international team of networking
       experts. It runs on UNIX, OS X and Windows.
     '';
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix
index 09f85b9edfc..5447b21009f 100644
--- a/pkgs/applications/networking/sync/rsync/default.nix
+++ b/pkgs/applications/networking/sync/rsync/default.nix
@@ -22,11 +22,12 @@ stdenv.mkDerivation rec {
   patches = [] ++ stdenv.lib.optional enableCopyDevicesPatch "./patches/copy-devices.diff";
 
   buildInputs = stdenv.lib.optional enableACLs acl;
-  buildNativeInputs = [perl];
+  nativeBuildInputs = [perl];
 
   meta = {
     homepage = http://samba.anu.edu.au/rsync/;
     description = "A fast incremental file transfer utility";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index ea30903fb38..35dd2d2a7d0 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation (rec {
     done
   '' else "";
 
-  dontStrip = if ! ocaml.nativeCompilers then true else false;
+  dontStrip = !ocaml.nativeCompilers;
 
   meta = {
     homepage = http://www.cis.upenn.edu/~bcpierce/unison/;
diff --git a/pkgs/applications/networking/umurmur/default.nix b/pkgs/applications/networking/umurmur/default.nix
new file mode 100644
index 00000000000..715e7fa6998
--- /dev/null
+++ b/pkgs/applications/networking/umurmur/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, openssl, protobufc, libconfig }:
+
+stdenv.mkDerivation rec {
+  name = "umurmur-0.2.12";
+  
+  src = fetchurl {
+    url = "http://umurmur.googlecode.com/files/${name}.tar.gz";
+    sha1 = "5be3c765af3c5f518d1e1bbd828b3582ad4097cd";
+  };
+  
+  buildInputs = [ openssl protobufc libconfig ];
+
+  configureFlags = "--with-ssl=openssl";
+
+  meta = {
+    description = "Minimalistic Murmur (Mumble server)";
+    license = "BSD";
+    homepage = http://code.google.com/p/umurmur/;
+  };
+}
diff --git a/pkgs/applications/networking/vnstat/default.nix b/pkgs/applications/networking/vnstat/default.nix
index 69a0a7efde8..57afefd7dcd 100644
--- a/pkgs/applications/networking/vnstat/default.nix
+++ b/pkgs/applications/networking/vnstat/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, ncurses}:
 
 stdenv.mkDerivation rec {
-  name = "vnstat-1.9";
-  
+  name = "vnstat-1.11";
+
   src = fetchurl {
-    url = http://humdi.net/vnstat/vnstat-1.9.tar.gz;
-    sha256 = "1migym0wig1s3b7d22ipxkd1p78sqc89dwx82qbf5hsb5q2fk4q1";
+    url = "http://humdi.net/vnstat/${name}.tar.gz";
+    sha256 = "09p0mlf49zzmh6jzwyvzd9k3jv7bl8i6w8xl65ns3dmv2zc7c65p";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/networking/yafc/default.nix b/pkgs/applications/networking/yafc/default.nix
index 9b1c9892cbf..bdbb53d1675 100644
--- a/pkgs/applications/networking/yafc/default.nix
+++ b/pkgs/applications/networking/yafc/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, readline, libssh, intltool}:
 
 stdenv.mkDerivation rec {
-  name = "yafc-1.2.0";
+  name = "yafc-1.2.3";
   src = fetchurl {
     url = "https://github.com/downloads/sebastinas/yafc/${name}.tar.xz";
-    sha256 = "0h5cbvvfkigvzfqqzvgqpn8m0ilyng3rgyh85c0mi48klzv8kb58";
+    sha256 = "11h5r9ragfpil338kq981wxnifacflqfwgydhmy00b3fbdlnxzsi";
   };
 
   buildInputs = [ readline libssh intltool ];
diff --git a/pkgs/applications/networking/znc/default.nix b/pkgs/applications/networking/znc/default.nix
new file mode 100644
index 00000000000..13c3977a979
--- /dev/null
+++ b/pkgs/applications/networking/znc/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl, openssl, pkgconfig
+, withPerl ? false, perl
+, withPython ? false, python3
+, withTcl ? false, tcl
+, withCyrus ? true, cyrus_sasl
+}:
+
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "znc-1.0";
+  src = fetchurl {
+    url = "http://znc.in/releases/${name}.tar.gz";
+    sha256 = "0ah6890ngvj97kah3x7fd8yzi6dpdgrxw1b2skj2cyv98bd3jmd8";
+  };
+
+  buildInputs = [ openssl pkgconfig ]
+    ++ optional withPerl perl
+    ++ optional withPython python3
+    ++ optional withTcl tcl
+    ++ optional withCyrus cyrus_sasl;
+
+  configureFlags = optionalString withPerl "--enable-perl "
+    + optionalString withPython "--enable-python "
+    + optionalString withTcl "--enable-tcl --with-tcl=${tcl}/lib "
+    + optionalString withCyrus "--enable-cyrus ";
+
+  meta = {
+    description = "Advanced IRC bouncer";
+    homepage = http://wiki.znc.in/ZNC;
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    license = "ASL2.0";
+  };
+}
diff --git a/pkgs/applications/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index fdfd60e9837..a500bbaa240 100644
--- a/pkgs/applications/office/abiword/default.nix
+++ b/pkgs/applications/office/abiword/default.nix
@@ -4,12 +4,24 @@
 
 stdenv.mkDerivation {
   name = "abiword-2.8.6";
-  
+
   src = fetchurl {
     url = http://www.abisource.org/downloads/abiword/2.8.6/source/abiword-2.8.6.tar.gz;
     sha256 = "059sd2apxdmcacc4pll880i7vm18h0kyjsq299m1mz3c7ak8k46r";
   };
 
+  prePatch = ''
+    sed -i -e '/#include <glib\/gerror.h>/d' src/af/util/xp/ut_go_file.h
+    sed -i -e 's|#include <glib/gmacros.h>|#include <glib.h>|' \
+      goffice-bits/goffice/app/goffice-app.h
+    sed -i -e 's/ptr->jmpbuf/jmpbuf(png_ptr)/' src/af/util/xp/ut_png.cpp
+    sed -i -e 's/\(m_pPNG\)->\(jmpbuf\)/png_\2(\1)/' \
+      src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp
+    sed -i -e 's/--no-undefined //' src/Makefile*
+  '';
+
+  enableParallelBuilding = true;
+
   buildInputs =
     [ pkgconfig gtk libglade librsvg bzip2 libgnomecanvas fribidi libpng popt
       libgsf enchant wv libjpeg
diff --git a/pkgs/applications/office/basket/default.nix b/pkgs/applications/office/basket/default.nix
index fff93ba9969..023d133b4dd 100644
--- a/pkgs/applications/office/basket/default.nix
+++ b/pkgs/applications/office/basket/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs qimageblitz kdepimlibs gpgme ];
 
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
   
   meta = {
     description = "A multi-purpose note-taking application";
diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/applications/office/calligra/default.nix
index b64338adaf1..1b692586e0c 100644
--- a/pkgs/applications/office/calligra/default.nix
+++ b/pkgs/applications/office/calligra/default.nix
@@ -1,27 +1,29 @@
 { stdenv, fetchurl, cmake, kdelibs, attica, perl, zlib, libpng, boost, mesa
 , kdepimlibs, createresources ? null, eigen, qca2, exiv2, soprano, marble, lcms2
 , fontconfig, freetype, sqlite, icu, libwpd, libwpg, pkgconfig, popplerQt4
-, libkdcraw, libxslt, fftw, glew, gsl, shared_desktop_ontologies }:
+, libkdcraw, libxslt, fftw, glew, gsl, shared_desktop_ontologies, okular }:
 
 stdenv.mkDerivation rec {
-  name = "calligra-2.4.2";
+  name = "calligra-2.5.5";
 
   src = fetchurl {
     url = "mirror://kde/stable/${name}/${name}.tar.bz2";
-    sha256 = "14wi8mr87aas12f75qi6p8x0pij365sbz4c737qhh4302fh8fsqg";
+    sha256 = "0h9idadrcyjvd0mkwri4lg310mzpna6s0pvc7b7r3267wzjbn9kw";
   };
 
-  buildNativeInputs = [ cmake perl pkgconfig ];
+  nativeBuildInputs = [ cmake perl pkgconfig ];
+
+  patches = [ ./fix-kde4.10-build.patch ];
 
   buildInputs = [ kdelibs attica zlib libpng boost mesa kdepimlibs
     createresources eigen qca2 exiv2 soprano marble lcms2 fontconfig freetype
     sqlite icu libwpd libwpg popplerQt4 libkdcraw libxslt fftw glew gsl
-    shared_desktop_ontologies ];
+    shared_desktop_ontologies okular ];
 
   meta = {
     description = "A Qt/KDE office suite, formely known as koffice";
     homepage = http://calligra.org;
-    maintainers = [ stdenv.lib.maintainers.urkud ];
+    maintainers = with stdenv.lib.maintainers; [ urkud phreedom ];
     inherit (kdelibs.meta) platforms;
   };
 }
diff --git a/pkgs/applications/office/calligra/fix-kde4.10-build.patch b/pkgs/applications/office/calligra/fix-kde4.10-build.patch
new file mode 100644
index 00000000000..e41d6a28f9d
--- /dev/null
+++ b/pkgs/applications/office/calligra/fix-kde4.10-build.patch
@@ -0,0 +1,36 @@
+From: Andre Woebbeking <Woebbeking@kde.org>
+Date: Sun, 13 Jan 2013 15:10:38 +0000
+Subject: compile with kdelibs 4.10 (tests are enabled by default)
+X-Git-Url: http://quickgit.kde.org/?p=calligra.git&a=commitdiff&h=39fdda6757cbbb35480dec98eac419eb1879cb31
+---
+compile with kdelibs 4.10 (tests are enabled by default)
+---
+
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -96,11 +96,6 @@
+     set(SHOULD_BUILD_ACTIVE FALSE)
+ ENDIF()
+ 
+-if(KDE4_BUILD_TESTS)
+-    # only with this definition will the FOO_TEST_EXPORT macro do something
+-    add_definitions(-DCOMPILING_TESTS)
+-endif(KDE4_BUILD_TESTS)
+-
+  ########################
+ #########################
+ ## Look for KDE and Qt ##
+@@ -146,6 +141,11 @@
+ endif(NOT ${KDE_VERSION} VERSION_GREATER 4.6.4)
+ 
+ macro_ensure_out_of_source_build("Compiling Calligra inside the source directory is not possible. Please refer to the build instruction http://community.kde.org/Calligra/Building/Building_Calligra")
++
++if(KDE4_BUILD_TESTS)
++    # only with this definition will the FOO_TEST_EXPORT macro do something
++    add_definitions(-DCOMPILING_TESTS)
++endif(KDE4_BUILD_TESTS)
+ 
+  ###########################
+ ############################
+
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix
index a2c3ed5d6ba..26879a6f660 100644
--- a/pkgs/applications/office/gnucash/default.nix
+++ b/pkgs/applications/office/gnucash/default.nix
@@ -9,11 +9,11 @@
  */
 
 stdenv.mkDerivation rec {
-  name = "gnucash-2.4.10";
+  name = "gnucash-2.4.11";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
-    sha256 = "1k76b6hnsmljggxsq5l9w94krfmhx58ij8jcxf72p0ddnlimdrjj";
+    sha256 = "0qbpgd6spclkmwryi66cih0igi5a6pmsnk41mmnscpfpz1mddhwk";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/office/gnumeric/default.nix b/pkgs/applications/office/gnumeric/default.nix
index 6063024c216..1bdc41d1fb5 100644
--- a/pkgs/applications/office/gnumeric/default.nix
+++ b/pkgs/applications/office/gnumeric/default.nix
@@ -3,12 +3,12 @@
 , pango, pkgconfig, scrollkeeper, zlib
 }:
 
-stdenv.mkDerivation {
-  name = "gnumeric-1.11.3";
+stdenv.mkDerivation rec {
+  name = "gnumeric-1.12.0";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gnumeric/1.11/gnumeric-1.11.3.tar.xz;
-    sha256 = "1hblcbba4qzlby094dih6ncclgf2n5ac59lqg9dykpz8ad3hxw72";
+    url = "mirror://gnome/sources/gnumeric/1.12/${name}.tar.xz";
+    sha256 = "037b53d909e5d1454b2afda8c4fb1e7838e260343e36d4e36245f4a5d0e04111";
   };
 
   configureFlags = "--disable-component";
diff --git a/pkgs/applications/office/hledger-interest/default.nix b/pkgs/applications/office/hledger-interest/default.nix
index 5b9aefa182e..d53a8fe63e2 100644
--- a/pkgs/applications/office/hledger-interest/default.nix
+++ b/pkgs/applications/office/hledger-interest/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hledger-interest";
-  version = "1.4.1";
-  sha256 = "05mzqmnr9c4zmss0f2aac4qh4s954nbkimv924d31q2lisdddvw8";
+  version = "1.4.3";
+  sha256 = "1nj50zi4p6rs0nl4656rr0vkbh7kdi49z1l53nypfqs3rmjgicsn";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal hledgerLib mtl time ];
diff --git a/pkgs/applications/office/kmymoney/default.nix b/pkgs/applications/office/kmymoney/default.nix
index da815c5fb6b..d55c66a2624 100644
--- a/pkgs/applications/office/kmymoney/default.nix
+++ b/pkgs/applications/office/kmymoney/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ kdepimlibs perl boost gpgme gmpxx libalkimia libofx libical ];
-  buildNativeInputs = [ cmake automoc4 gettext shared_mime_info pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 gettext shared_mime_info pkgconfig ];
 
   KDEDIRS = libalkimia;
 
diff --git a/pkgs/applications/office/koffice/default.nix b/pkgs/applications/office/koffice/default.nix
deleted file mode 100644
index 784b6007035..00000000000
--- a/pkgs/applications/office/koffice/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ stdenv, fetchurl, lib, cmake, qt4, perl, lcms, exiv2, libxml2, libxslt, boost, glew
-, shared_mime_info, popplerQt4, gsl, gmm, wv2, libwpd, libwpg,  giflib, libgsf
-, fftw, pkgconfig, openjpeg , kdelibs, kdepimlibs, automoc4, phonon
-, qimageblitz, qca2, eigen, soprano , kdegraphics}:
-
-stdenv.mkDerivation rec {
-  name = "koffice-2.2.2";
-  src = fetchurl {
-    url = "mirror://kde/stable/${name}/${name}.tar.bz2";
-    sha256 = "1jzdq7av4vbfkx987yz54431q3bwrsd7wzyinl9wsznx83v61c75";
-  }; 
-
-  patchFlags = "-p0";
-  patches =
-    let
-      urlBase = "http://kexi-project.org/download/patches/2.2.2/";
-    in
-    [
-      (fetchurl {
-        url = "${urlBase}support-large-memo-values-for-msaccess-2.2.2.patch";
-        sha256 = "1jn6na8c0vdf87p0yv9bcff0kd1jmcxndxmm3s0878l5pak9m8rd";
-      })
-      (fetchurl {
-        url = "${urlBase}fix-crash-on-closing-sqlite-connection-2.2.2.patch";
-        sha256 = "11h4rxdrv5vakym5786vr4bysi4627m53qqvk1vhxf3rkawvcafj";
-      })
-      ./wpd.patch
-      ./krita-exiv-0.21.diff
-    ];
-
-  buildInputs = [ cmake qt4 perl lcms exiv2 libxml2 libxslt boost glew
-    shared_mime_info popplerQt4 gsl gmm wv2 libwpd libwpg giflib libgsf
-    stdenv.gcc.libc fftw pkgconfig kdelibs kdepimlibs automoc4 phonon
-    qimageblitz qca2 eigen openjpeg soprano kdegraphics ];
-
-  meta = {
-    description = "KDE integrated Office Suite";
-    license = "GPL";
-    homepage = http://www.koffice.org;
-    maintainers = with stdenv.lib.maintainers; [ sander urkud ];
-    inherit (kdelibs.meta) platforms;
-  };
-}
diff --git a/pkgs/applications/office/koffice/krita-exiv-0.21.diff b/pkgs/applications/office/koffice/krita-exiv-0.21.diff
deleted file mode 100644
index b8da1bd586c..00000000000
--- a/pkgs/applications/office/koffice/krita-exiv-0.21.diff
+++ /dev/null
@@ -1,81 +0,0 @@
-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/koffice/wpd.patch b/pkgs/applications/office/koffice/wpd.patch
deleted file mode 100644
index 56a5b65e50b..00000000000
--- a/pkgs/applications/office/koffice/wpd.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff cmake/modules/FindWPD.cmake cmake/modules/FindWPD.cmake
-index 9bd788c..927785a 100644
---- cmake/modules/FindWPD.cmake
-+++ cmake/modules/FindWPD.cmake
-@@ -19,14 +19,17 @@ if (WPD_INCLUDE_DIR AND WPD_LIBRARIES)
- else (WPD_INCLUDE_DIR AND WPD_LIBRARIES)
- if(NOT WIN32)
-   INCLUDE(FindPkgConfig)
--  pkg_check_modules(WPD libwpd-0.8)
-+  pkg_check_modules(PKG_WPD libwpd-0.8)
- endif(NOT WIN32)
- 
-   FIND_PATH(WPD_INCLUDE_DIR libwpd/libwpd.h
--    ${WPD_INCLUDE_DIR}
-+    ${PKG_WPD_INCLUDE_DIRS}
-     /usr/include/libwpd-0.8
-   )
- 
-+  FIND_LIBRARY(WPD_LIBRARIES wpd-0.8
-+    ${PKG_WPD_LIBRARY_DIRS}
-+  )
- 
-   include(FindPackageHandleStandardArgs)
-   FIND_PACKAGE_HANDLE_STANDARD_ARGS(WPD DEFAULT_MSG WPD_INCLUDE_DIR WPD_LIBRARIES )
diff --git a/pkgs/applications/office/ledger/2.6.3.nix b/pkgs/applications/office/ledger/2.6.3.nix
index c1cd4b42a02..ca71ceeca66 100644
--- a/pkgs/applications/office/ledger/2.6.3.nix
+++ b/pkgs/applications/office/ledger/2.6.3.nix
@@ -1,40 +1,24 @@
-# 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
+{ stdenv, fetchurl, emacs, gmp, pcre, expat }:
+
+stdenv.mkDerivation rec {
   name = "ledger-2.6.3";
-in
-stdenv.mkDerivation {
-  inherit name;
 
   src = fetchurl {
-    url = "https://github.com/downloads/jwiegley/ledger/${name}.tar.gz";
+    url = "https://github.com/downloads/ledger/ledger/${name}.tar.gz";
     sha256 = "05zpnypcwgck7lwk00pbdlcwa347xsqifxh4zsbbn01m98bx1v5k";
   };
 
   buildInputs = [ emacs gmp pcre expat ];
 
   configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3";
-  dontPatchELF = true;
+
   doCheck = true;
 
+  # Patchelf breaks the hard-coded rpath to ledger's libamounts.0.so and
+  # libledger-2.6.3.so. Fortunately, libtool chooses proper rpaths to
+  # begin with, so we can just disable patchelf to avoid the issue.
+  dontPatchELF = true;
+
   meta = {
     homepage = "http://ledger-cli.org/";
     description = "A double-entry accounting system with a command-line reporting interface";
diff --git a/pkgs/applications/office/ledger/3.0.nix b/pkgs/applications/office/ledger/3.0.nix
index 325ab3b0a0f..d564f2f561e 100644
--- a/pkgs/applications/office/ledger/3.0.nix
+++ b/pkgs/applications/office/ledger/3.0.nix
@@ -1,36 +1,22 @@
-{ stdenv, fetchgit, python, autoconf, automake, libtool, gettext, emacs, gmp
-, pcre, expat, boost, mpfr, git, texinfo }:
+{ stdenv, fetchgit, cmake, boost, gmp, mpfr, libedit, python, texinfo }:
 
 let
-  rev = "d2915c66";
+  rev = "2c7ab8be";
 in
 stdenv.mkDerivation {
-  name = "ledger3-2012.01.${rev}";
+  name = "ledger3-2013.04.${rev}";
 
   src = fetchgit {
     url = "git://github.com/jwiegley/ledger.git";
     inherit rev;
-    sha256 = "a489c8b1c48889040d2cebaac1a0019e90acac0b51c9abf7914944dcb4b801e7";
+    sha256 = "1ng5ymzqzbgdrn2ghhr7jvcjv5y7ikhyck5p1yv5j024s17xdyj5";
   };
 
-  buildInputs = [
-    python autoconf automake libtool gettext emacs gmp pcre expat boost mpfr
-    git texinfo
-  ];
+  buildInputs = [ cmake boost gmp mpfr libedit python texinfo ];
 
-  CPPFLAGS = "-I${gmp}/include -I${mpfr}/include";
-
-  LDFLAGS = "-L${gmp}/lib -L${mpfr}/lib";
-
-  buildPhase = ''
-    sed -i acprep \
-      -e 's|search_prefixes = .*|search_prefixes = ["${boost}"]|' \
-      -e 's|/usr/bin/python|${python}/bin/python|'
-    export MAKEFLAGS="-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES"
-    python acprep update --no-pch --prefix=$out
-  '';
-
-  doCheck = !stdenv.isDarwin;
+  # Unit tests fail in the current git snapshot. Try enabling them again
+  # when updating this package!
+  doCheck = false;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/office/ledger/const.patch b/pkgs/applications/office/ledger/const.patch
deleted file mode 100644
index 8565fbfd0d4..00000000000
--- a/pkgs/applications/office/ledger/const.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-diff --git a/gnucash.cc b/gnucash.cc
-index 7d31526..c4edd77 100644
---- a/gnucash.cc
-+++ b/gnucash.cc
-@@ -201,7 +201,7 @@ static amount_t convert_number(const std::string& number,
- {
-   const char * num = number.c_str();
-
--  if (char * p = std::strchr(num, '/')) {
-+  if (const char * p = std::strchr(num, '/')) {
-     std::string numer_str(num, p - num);
-     std::string denom_str(p + 1);
-
-diff --git a/option.cc b/option.cc
-index 10c23a7..8f2fead 100644
---- a/option.cc
-+++ b/option.cc
-@@ -892,7 +892,7 @@ OPT_BEGIN(market, "V") {
- namespace {
-   void parse_price_setting(const char * optarg)
-   {
--    char * equals = std::strchr(optarg, '=');
-+    const char * equals = std::strchr(optarg, '=');
-     if (! equals)
-       return;
-
-diff --git a/textual.cc b/textual.cc
-index 2033106..d897368 100644
---- a/textual.cc
-+++ b/textual.cc
-@@ -298,8 +298,8 @@ transaction_t * parse_transaction(char * line, account_t * account,
-       DEBUG_PRINT("ledger.textual.parse", "line " << linenum << ": " <<
-		  "Parsed a note '" << xact->note << "'");
-
--      if (char * b = std::strchr(xact->note.c_str(), '['))
--	if (char * e = std::strchr(xact->note.c_str(), ']')) {
-+      if (const char * b = std::strchr(xact->note.c_str(), '['))
-+	if (const char * e = std::strchr(xact->note.c_str(), ']')) {
-	  char buf[256];
-	  std::strncpy(buf, b + 1, e - b - 1);
-	  buf[e - b - 1] = '\0';
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
new file mode 100644
index 00000000000..fc5f5058f97
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/default.nix
@@ -0,0 +1,182 @@
+{ stdenv, fetchurl, pam, python, tcsh, libxslt, perl, ArchiveZip
+, CompressZlib, zlib, libjpeg, expat, pkgconfigUpstream, freetype, libwpd
+, libxml2, db4, sablotron, curl, libXaw, fontconfig, libsndfile, neon
+, bison, flex, zip, unzip, gtk, libmspack, getopt, file, cairo, which
+, icu, boost, jdk, ant, libXext, libX11, libXtst, libXi, cups
+, libXinerama, openssl, gperf, cppunit, GConf, ORBit2, poppler
+, librsvg, gnome_vfs, gstreamer, gst_plugins_base, mesa
+, autoconf, automake, openldap, bash, hunspell, librdf_redland, nss, nspr
+, libwpg, dbus_glib, qt4, kde4, clucene_core_2, libcdr, lcms2, vigra
+, libiodbc, mdds, saneBackends, mythes, libexttextcat, libvisio
+, fontsConf
+, langs ? [ "en-US" "en-GB" "ca" "ru" "eo" "fr" "nl" "de" ]
+}:
+
+let
+  langsSpaces = stdenv.lib.concatStringsSep " " langs;
+  major = "3";
+  minor = "6";
+  patch = "6";
+  tweak = "2";
+  subdir = "${major}.${minor}.${patch}";
+  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
+  fetchThirdParty = {name, md5}: fetchurl {
+    inherit name md5;
+    url = "http://dev-www.libreoffice.org/src/${md5}-${name}";
+  };
+  fetchSrc = {name, sha256}: fetchurl {
+    url = "http://download.documentfoundation.org/libreoffice/src/${subdir}/libreoffice-${name}-${version}.tar.xz";
+    inherit sha256;
+  };
+  srcs = {
+    third_party = [ (fetchurl rec {
+        url = "http://dev-www.libreoffice.org/extern/${md5}-${name}";
+        md5 = "185d60944ea767075d27247c3162b3bc";
+        name = "unowinreg.dll";
+      }) ] ++ (map fetchThirdParty (import ./libreoffice-srcs.nix));
+    translations = fetchSrc {
+      name = "translations";
+      sha256 = "1n3yk2077adyxrhs0jpkbm8dg3lxpn3sy63f0dl87ifv7ha1rfpn";
+    };
+
+    help = fetchSrc {
+      name = "help";
+      sha256 = "12rb5mw6sbi41w1zaxrj4qffiis9qcx8ibp5cpmwsz07nsdv5sxk";
+    };
+
+    core = fetchSrc {
+      name = "core";
+      sha256 = "0xw36sa73cgk3k3fv1spv5pavm95bc02lszn8415ay36lcc098pn";
+    };
+  };
+in
+stdenv.mkDerivation rec {
+  name = "libreoffice-${version}";
+
+  src = srcs.core;
+
+  # Openoffice will open libcups dynamically, so we link it directly
+  # to make its dlopen work.
+  NIX_LDFLAGS = "-lcups";
+
+  # If we call 'configure', 'make' will then call configure again without parameters.
+  # It's their system.
+  configureScript = "./autogen.sh";
+  dontUseCmakeConfigure = true;
+
+  postUnpack = ''
+    mkdir -v $sourceRoot/src
+  '' + (stdenv.lib.concatMapStrings (f: "ln -sv ${f} $sourceRoot/src/${f.outputHash}-${f.name}\n") srcs.third_party)
+  + ''
+    ln -sv ${srcs.help} $sourceRoot/src/${srcs.help.name}
+    ln -sv ${srcs.translations} $sourceRoot/src/${srcs.translations.name}
+  '';
+
+  patchPhase = ''
+    find . -type f -print0 | xargs -0 sed -i \
+      -e 's,! */bin/bash,!${bash}/bin/bash,' -e 's,\(!\|SHELL=\) */usr/bin/env bash,\1${bash}/bin/bash,' \
+      -e 's,! */usr/bin/perl,!${perl}/bin/perl,' -e 's,! */usr/bin/env perl,!${perl}/bin/perl,' \
+      -e 's,! */usr/bin/python,!${python}/bin/python,' -e 's,! */usr/bin/env python,!${python}/bin/python,'
+    sed -i 's,ANT_OPTS+="\(.*\)",ANT_OPTS+=\1,' apache-commons/java/*/makefile.mk
+  '';
+
+  QT4DIR = qt4;
+  KDE4DIR = kde4.kdelibs;
+
+  # I set --with-num-cpus=$NIX_BUILD_CORES, as it's the equivalent of
+  # enableParallelBuilding=true in this build system.
+  preConfigure = ''
+    # Needed to find genccode
+    PATH=$PATH:${icu}/sbin
+
+    configureFlagsArray=("--with-lang=${langsSpaces}" "--with-num-cpus=$NIX_BUILD_CORES")
+  '';
+
+  makeFlags = "SHELL=${bash}/bin/bash";
+
+  buildPhase = ''
+    # This is required as some cppunittests require fontconfig configured
+    export FONTCONFIG_FILE=${fontsConf}
+
+    # Fix sysui: wants to create a tar for root
+    sed -i -e 's,--own.*root,,' sysui/desktop/slackware/makefile.mk
+
+    # This to aovid using /lib:/usr/lib at linking
+    sed -i '/gb_LinkTarget_LDFLAGS/{ n; /rpath-link/d;}' solenv/gbuild/platform/unxgcc.mk
+
+    find -name "*.cmd" -exec sed -i s,/lib:/usr/lib,, {} \;
+
+    make
+  '';
+
+  # It installs only things to $out/lib/libreoffice
+  postInstall = ''
+    mkdir -p $out/bin
+    for a in sbase scalc sdraw smath swriter spadmin simpress soffice; do
+      ln -s $out/lib/libreoffice/program/$a $out/bin/$a
+    done
+  '';
+
+  configureFlags = [
+    #"--enable-verbose"
+
+    # Without these, configure does not finish
+    "--without-junit"
+
+    # Without this, it wants to download
+    "--enable-python=system"
+    "--enable-dbus"
+    "--enable-kde4"
+    "--disable-odk"
+    "--with-system-cairo"
+    "--with-system-libs"
+    "--with-boost-libdir=${boost}/lib"
+    "--with-system-db"
+    "--with-openldap" "--enable-ldap"
+    "--without-system-libwps"
+    "--without-doxygen"
+
+    # I imagine this helps. Copied from go-oo.
+    "--disable-epm"
+    "--disable-mathmldtd"
+    "--disable-mozilla"
+    "--disable-kde"
+    "--disable-postgresql-sdbc"
+    "--with-package-format=native"
+    "--with-jdk-home=${jdk}"
+    "--with-ant-home=${ant}"
+    "--without-afms"
+    "--without-fonts"
+    "--without-myspell-dicts"
+    "--without-ppds"
+    "--without-system-beanshell"
+    "--without-system-hsqldb"
+    "--without-system-jars"
+    "--without-system-altlinuxhyph"
+    "--without-system-lpsolve"
+    "--without-system-graphite"
+    "--without-system-mozilla-headers"
+    "--without-system-libcmis"
+
+    "--with-java-target-version=1.6" # The default 1.7 not supported
+  ];
+
+  buildInputs =
+    [ ant ArchiveZip autoconf automake bison boost cairo clucene_core_2
+      CompressZlib cppunit cups curl db4 dbus_glib expat file flex fontconfig
+      freetype GConf getopt gnome_vfs gperf gst_plugins_base gstreamer gtk
+      hunspell icu jdk kde4.kdelibs lcms2 libcdr libexttextcat libiodbc libjpeg
+      libmspack librdf_redland librsvg libsndfile libvisio libwpd libwpg libX11
+      libXaw libXext libXi libXinerama libxml2 libxslt libXtst mdds mesa mythes
+      neon nspr nss openldap openssl ORBit2 pam perl pkgconfigUpstream poppler
+      python sablotron saneBackends tcsh unzip vigra which zip zlib
+    ];
+
+  meta = {
+    description = "Libre-office, variant of openoffice.org";
+    homepage = http://libreoffice.org/;
+    license = "LGPL";
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
new file mode 100644
index 00000000000..fb8cc816114
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/generate-libreoffice-srcs.sh
@@ -0,0 +1,20 @@
+#!/var/run/current-system/bin/bash
+
+# Take the list of files from the main package, ooo.lst.in
+
+cat <<EOF
+[
+EOF
+
+read file
+while read file; do
+  if [[ "$file" == @* ]]; then
+    break
+  fi
+  echo '{'
+  echo "  name = \"${file:33}\";"
+  echo "  md5 = \"${file:0:32}\";"
+  echo '}'
+done
+
+echo ']'
diff --git a/pkgs/applications/office/libreoffice/libreoffice-srcs.nix b/pkgs/applications/office/libreoffice/libreoffice-srcs.nix
new file mode 100644
index 00000000000..7f8f2c089f3
--- /dev/null
+++ b/pkgs/applications/office/libreoffice/libreoffice-srcs.nix
@@ -0,0 +1,374 @@
+[
+{
+  name = "hyphen-2.8.3.tar.gz";
+  md5 = "86261f06c097d3e425a2f6d0b0635380";
+}
+{
+  name = "openssl-0.9.8v.tar.gz";
+  md5 = "51a40a81b3b7abe8a5c33670bd3da0ce";
+}
+{
+  name = "pixman-0.24.4.tar.bz2";
+  md5 = "c63f411b3ad147db2bcce1bf262a0e02";
+}
+{
+  name = "README_apache-commons.txt";
+  md5 = "0b49ede71c21c0599b0cc19b353a6cb3";
+}
+{
+  name = "libexttextcat-3.3.1.tar.bz2";
+  md5 = "6097739c841f671cb21332b9cc593ae7";
+}
+{
+  name = "hsqldb_1_8_0.zip";
+  md5 = "17410483b5b5f267aa18b7e00b65e6e0";
+}
+{
+  name = "Adobe-Core35_AFMs-314.tar.gz";
+  md5 = "1756c4fa6c616ae15973c104cd8cb256";
+}
+{
+  name = "STLport-4.5.tar.gz";
+  md5 = "18f577b374d60b3c760a3a3350407632";
+}
+{
+  name = "xmlsec1-1.2.14.tar.gz";
+  md5 = "1f24ab1d39f4a51faf22244c94a6203f";
+}
+{
+  name = "LICENSE_source-9.0.0.7-bj.html";
+  md5 = "24be19595acad0a2cae931af77a0148a";
+}
+{
+  name = "lp_solve_5.5.tar.gz";
+  md5 = "26b3e95ddf3d9c077c480ea45874b3b8";
+}
+{
+  name = "raptor-1.4.18.tar.gz";
+  md5 = "284e768eeda0e2898b0d5bf7e26a016e";
+}
+{
+  name = "jakarta-tomcat-5.0.30-src.tar.gz";
+  md5 = "2a177023f9ea8ec8bd00837605c5df1b";
+}
+{
+  name = "commons-lang-2.3-src.tar.gz";
+  md5 = "2ae988b339daec234019a7066f96733e";
+}
+{
+  name = "commons-httpclient-3.1-src.tar.gz";
+  md5 = "2c9b0f83ed5890af02c0df1c1776f39b";
+}
+{
+  name = "liberation-fonts-ttf-1.07.1.tar.gz";
+  md5 = "0be45d54cc5e1c2e3102e32b8c190346";
+}
+{
+  name = "liberation-fonts-ttf-2.00.0.tar.gz";
+  md5 = "cfbf1ac6f61bf6cf45342a0cc9381be5";
+}
+{
+  name = "swingExSrc.zip";
+  md5 = "35c94d2df8893241173de1d16b6034c0";
+}
+{
+  name = "gentiumbasic-fonts-1.10.zip";
+  md5 = "35efabc239af896dfb79be7ebdd6e6b9";
+}
+{
+  name = "sacjava-1.3.zip";
+  md5 = "39bb3fcea1514f1369fcfc87542390fd";
+}
+{
+  name = "epm-3.7.tar.gz";
+  md5 = "3ade8cfe7e59ca8e65052644fed9fca4";
+}
+{
+  name = "commons-logging-1.1.1-src.tar.gz";
+  md5 = "3c219630e4302863a9a83d0efde889db";
+}
+{
+  name = "README_source-9.0.0.7-bj.txt";
+  md5 = "48470d662650c3c074e1c3fabbc67bbd";
+}
+{
+  name = "clucene-core-2.3.3.4.tar.gz";
+  md5 = "48d647fbd8ef8889e5a7f422c1bfda94";
+}
+{
+  name = "glibc-2.1.3-stub.tar.gz";
+  md5 = "4a660ce8466c9df01f19036435425c3a";
+}
+{
+  name = "cairo-1.10.2.tar.gz";
+  md5 = "f101a9e88b783337b20b2e26dfd26d5f";
+}
+{
+  name = "xpdf-3.02.tar.gz";
+  md5 = "599dc4cc65a07ee868cf92a667a913d2";
+}
+{
+  name = "libxml2-2.7.6.tar.gz";
+  md5 = "7740a8ec23878a2f50120e1faa2730f2";
+}
+{
+  name = "STLport-4.5-0119.tar.gz";
+  md5 = "7376930b0d3f3d77a685d94c4a3acda8";
+}
+{
+  name = "rhino1_5R5.zip";
+  md5 = "798b2ffdc8bcfe7bca2cf92b62caf685";
+}
+{
+  name = "curl-7.19.7.tar.gz";
+  md5 = "ecb2e37e45c9933e2a963cabe03670ab";
+}
+{
+  name = "stax-api-1.0-2-sources.jar";
+  md5 = "8294d6c42e3553229af9934c5c0ed997";
+}
+{
+  name = "cppunit-1.12.1.tar.gz";
+  md5 = "bd30e9cf5523cdfc019b94f5e1d7fd19";
+}
+{
+  name = "seamonkey-1.1.14.source.tar.gz";
+  md5 = "a169ab152209200a7bad29a275cb0333";
+}
+{
+  name = "LICENSE_stax-api-1.0-2-sources.html";
+  md5 = "a4d9b30810a434a3ed39fc0003bbd637";
+}
+{
+  name = "xsltml_2.1.2.zip";
+  md5 = "a7983f859eafb2677d7ff386a023bc40";
+}
+{
+  name = "source-9.0.0.7-bj.zip";
+  md5 = "ada24d37d8d638b3d8a9985e80bc2978";
+}
+{
+  name = "commons-codec-1.3-src.tar.gz";
+  md5 = "af3c3acf618de6108d65fcdc92b492e1";
+}
+{
+  name = "LICENSE_Python-2.6.1";
+  md5 = "bc702168a2af16869201dbe91e46ae48";
+}
+{
+  name = "STLport-4.0.tar.gz";
+  md5 = "c441926f3a552ed3e5b274b62e86af16";
+}
+{
+  name = "redland-1.0.8.tar.gz";
+  md5 = "ca66e26082cab8bb817185a116db809b";
+}
+{
+  name = "core.zip";
+  md5 = "d4c4d91ab3a8e52a2e69d48d34ef4df4";
+}
+{
+  name = "db-4.7.25.NC-custom.tar.gz";
+  md5 = "d70951c80dabecc2892c919ff5d07172";
+}
+{
+  name = "README_db-4.7.25.NC-custom.txt";
+  md5 = "e0707ff896045731ff99e99799606441";
+}
+{
+  name = "Python-2.6.1.tar.bz2";
+  md5 = "e81c2f0953aa60f8062c05a4673f2be0";
+}
+{
+  name = "libxslt-1.1.26.tar.gz";
+  md5 = "e61d0364a30146aaa3001296f853b2b9";
+}
+{
+  name = "bsh-2.0b1-src.tar.gz";
+  md5 = "ea570af93c284aa9e5621cd563f54f4d";
+}
+{
+  name = "vigra1.4.0.tar.gz";
+  md5 = "ea91f2fb4212a21d708aced277e6e85a";
+}
+{
+  name = "expat-2.1.0.tar.gz";
+  md5 = "dd7dab7a5fea97d2a6a43f511449b7cd";
+}
+{
+  name = "README_stax-api-1.0-2-sources.txt";
+  md5 = "fb7ba5c2182be4e73748859967455455";
+}
+{
+  name = "rasqal-0.9.16.tar.gz";
+  md5 = "fca8706f2c4619e2fa3f8f42f8fc1e9d";
+}
+{
+  name = "dejavu-fonts-ttf-2.33.zip";
+  md5 = "f872f4ac066433d8ff92f5e316b36ff9";
+}
+{
+  name = "mysql-connector-c++-1.1.0.tar.gz";
+  md5 = "0981bda6548a8c8233ffce2b6e4b2a23";
+}
+{
+  name = "postgresql-9.1.1.tar.bz2";
+  md5 = "061a9f17323117c9358ed60f33ecff78";
+}
+{
+  name = "mythes-1.2.2.tar.gz";
+  md5 = "e1e255dc43dbcbb34cb19e8a0eba90ae";
+}
+{
+  name = "libformula-1.1.7.zip";
+  md5 = "3404ab6b1792ae5f16bbd603bd1e1d03";
+}
+{
+  name = "libfonts-1.1.6.zip";
+  md5 = "3bdf40c0d199af31923e900d082ca2dd";
+}
+{
+  name = "librepository-1.1.6.zip";
+  md5 = "8ce2fcd72becf06c41f7201d15373ed9";
+}
+{
+  name = "libloader-1.1.6.zip";
+  md5 = "97b2d4dba862397f446b217e2b623e71";
+}
+{
+  name = "libxml-1.1.7.zip";
+  md5 = "ace6ab49184e329db254e454a010f56d";
+}
+{
+  name = "flute-1.1.6.zip";
+  md5 = "d8bd5eed178db6e2b18eeed243f85aa8";
+}
+{
+  name = "liblayout-0.2.10.zip";
+  md5 = "db60e4fde8dd6d6807523deb71ee34dc";
+}
+{
+  name = "libbase-1.1.6.zip";
+  md5 = "eeb2c7ddf0d302fba4bfc6e97eac9624";
+}
+{
+  name = "libserializer-1.1.6.zip";
+  md5 = "f94d9870737518e3b597f9265f4e9803";
+}
+{
+  name = "flow-engine-0.9.4.zip";
+  md5 = "ba2930200c9f019c2d93a8c88c651a0f";
+}
+{
+  name = "neon-0.29.5.tar.gz";
+  md5 = "ff369e69ef0f0143beb5626164e87ae2";
+}
+{
+  name = "gettext-0.18.1.1.tar.gz";
+  md5 = "3dd55b952826d2b32f51308f2f91aa89";
+}
+{
+  name = "glib-2.28.1.tar.gz";
+  md5 = "9f6e85e1e38490c3956f4415bcd33e6e";
+}
+{
+  name = "gdk-pixbuf-2.23.0.tar.gz";
+  md5 = "a7d6c5f2fe2d481149ed3ba807b5c043";
+}
+{
+  name = "libgsf-1.14.19.tar.gz";
+  md5 = "3a84ac2da37cae5bf7ce616228c6fbde";
+}
+{
+  name = "pango-1.28.3.tar.gz";
+  md5 = "22ad1c8d3fda7e73b0798035f3dd96bc";
+}
+{
+  name = "libcroco-0.6.2.tar.gz";
+  md5 = "0611e099e807210cf738dcb41425d104";
+}
+{
+  name = "librsvg-2.32.1.tar.gz";
+  md5 = "d7a242ca43e33e1b63d3073f9d46a6a8";
+}
+{
+  name = "libpng-1.5.10.tar.gz";
+  md5 = "9e5d864bce8f06751bbd99962ecf4aad";
+}
+{
+  name = "jpeg-8c.tar.gz";
+  md5 = "a2c10c04f396a9ce72894beb18b4e1f9";
+}
+{
+  name = "zlib-1.2.7.tar.bz2";
+  md5 = "2ab442d169156f34c379c968f3f482dd";
+}
+{
+  name = "icu4c-49_1_1-src.tgz";
+  md5 = "7c53f83e0327343f4060c0eb83842daf";
+}
+{
+  name = "ConvertTextToNumber-1.3.2.oxt";
+  md5 = "451ccf439a36a568653b024534669971";
+}
+{
+  name = "JLanguageTool-1.7.0.tar.bz2";
+  md5 = "b63e6340a02ff1cacfeadb2c42286161";
+}
+{
+  name = "ixion-0.2.0.tar.gz";
+  md5 = "0f63ee487fda8f21fafa767b3c447ac9";
+}
+{
+  name = "nss-3.13.5-with-nspr-4.9.1.tar.gz";
+  md5 = "a0a861f539f0e7a91d05e6b9457e4db1";
+}
+{
+  name = "libwpg-0.2.1.tar.bz2";
+  md5 = "9d283e02441d8cebdcd1e5d9df227d67";
+}
+{
+  name = "libwpd-0.9.4.tar.bz2";
+  md5 = "c01351d7db2b205de755d58769288224";
+}
+{
+  name = "libwps-0.2.7.tar.bz2";
+  md5 = "d197bd6211669a2fa4ca648faf04bcb1";
+}
+{
+  name = "mdds_0.6.1.tar.bz2";
+  md5 = "9f9e15966b5624834157fe3d748312bc";
+}
+{
+  name = "boost_1_44_0.tar.bz2";
+  md5 = "f02578f5218f217a9f20e9c30e119c6a";
+}
+{
+  name = "hunspell-1.3.2.tar.gz";
+  md5 = "3121aaf3e13e5d88dfff13fb4a5f1ab8";
+}
+{
+  name = "graphite2-1.0.3.tgz";
+  md5 = "3bf481ca95109b14435125c0dd1f2217";
+}
+{
+  name = "libvisio-0.0.19.tar.bz2";
+  md5 = "94e7f271e38c976462558b4278590178";
+}
+{
+  name = "LinLibertineG-20120116.zip";
+  md5 = "e7a384790b13c29113e22e596ade9687";
+}
+{
+  name = "libcmis-0.2.3.tar.gz";
+  md5 = "0d2dcdfbf28d6208751b33057f5361f0";
+}
+{
+  name = "libcdr-0.0.9.tar.bz2";
+  md5 = "3c0037fb07dea2f0bbae8386fa7c6a9a";
+}
+{
+  name = "lcms2-2.3.tar.gz";
+  md5 = "327348d67c979c88c2dec59a23a17d85";
+}
+]
diff --git a/pkgs/applications/office/openoffice/builder.sh b/pkgs/applications/office/openoffice/builder.sh
deleted file mode 100644
index 2c6e04e049b..00000000000
--- a/pkgs/applications/office/openoffice/builder.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-source $stdenv/setup
-
-export nodep=TRUE
-export NO_HIDS=TRUE
-
-export PATH=$icu/sbin:$PATH
-
-postUnpack() {
-  tar xvjf $src_system
-}
-
-preConfigure() {
-    ./configure --help
-
-    for i in sysui/desktop/share/makefile.mk; do 
-	substituteInPlace $i --replace /bin/bash $shell
-    done
-
-    SRCDIR=
-
-    sed -e '/CURL_NO_OLDIES/d' -i ucb/source/ucp/ftp/makefile.mk
-}
-
-postConfigure() {
-    for i in LinuxX86*Env.Set; do
-	substituteInPlace $i --replace /usr /no-such-path
-    done
-    substituteInPlace solenv/inc/libs.mk \
-	--replace /usr/lib/libjpeg.so $libjpeg/lib/libjpeg.so \
-	--replace /usr/lib64/libjpeg.so $libjpeg/lib/libjpeg.so
-}
-
-buildPhase() {
-    source LinuxX86*Env.Set.sh
-    ./bootstrap
-    # bootstrap defines the alias 'build', that mostly runs this perl script:
-    (cd instsetoo_native; perl ../solenv/bin/build.pl --all) # wait a few hours... add -P4 for quadcores
-}
-
-wrapSOffice() {
-    local fn=$1
-    local arg=$2
-
-    # !!! should use makeWrapper for this.
-
-    cat > $out/bin/$fn <<EOF 
-#! $shell
-# Add fontconfig to the library search path; apparently OpenOffice
-# looks for it at runtime.
-export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH\${LD_LIBRARY_PATH:+:}$fontconfig/lib:$libjpeg/lib:$cups/lib
-export JAVA_HOME=$jdk
-exec $ooFiles/openoffice.org3/program/soffice $arg "\$@"
-EOF
-    chmod +x $out/bin/$fn
-}
-
-installPhase() {
-    ooFiles=$out/lib/openoffice
-
-    # This was all borrowed from ooo-build-2.2.1's bin/ooinstall.
-    # This needs the ./bootstrap having run in the buildPhase to get some env vars.
-    eval $(grep 'BUILD\|LAST_MINOR' $SOLARENV/inc/minor.mk)
-    export PYTHONPATH=$SOLARVERSION/$INPATH/lib:$SRC_ROOT/instsetoo_native/$INPATH/bin:$PYTHONPATH 
-    export OUT=../$INPATH
-    export LOCAL_OUT=../$INPATH
-    export LOCAL_COMMON_OUT=../$INPATH
-
-    # Do the actual installation into $out.
-    (cd $SRC_ROOT/instsetoo_native/util && perl -w $SOLARENV/bin/make_installer.pl \
-	-f openoffice.lst -l en-US -p OpenOffice \
-	-buildid $BUILD -simple $ooFiles)
-
-    mkdir -p $out/bin
-    for i in soffice ooffice; do wrapSOffice $i; done
-    
-    # Create some wrappers to start individual OpenOffice components.
-    for i in writer calc draw impress base math web; do wrapSOffice oo$i -$i; done
-    
-    # Create symlinks to desktop files, so that openoffice.org apps can be picked from
-    # the application menu in KDE and GNOME
-    mkdir -p $out/share
-    ln -s $out/lib/openoffice/openoffice.org3/share/xdg $out/share/applications
-
-    # Apply a minor correction to the *.desktop files in order to correctly address the icons
-    # The openoffice- prefix should be removed from the icon identifiers
-    for appl in $out/share/applications/*.desktop
-    do
-        chmod 644 $appl # What's wrong with the file permissions?
-        sed -i '/Icon/d' $appl
-        echo "Icon=$(echo $(basename $appl) | sed 's/.desktop//')" >> $appl    
-    done
-    
-    # Copy icons so that the menu items in KDE and GNOME will look much nicer
-    (cd $SRC_ROOT/sysui/desktop/icons
-     install -v -d $out/share/icons/{hicolor,locolor} -m 755
-     cp -rv hicolor/*x* $out/share/icons/hicolor
-     cp -rv locolor/*x* $out/share/icons/locolor
-    )
-        
-    # The desktop files expect a openoffice.org3 executable in the PATH, which is a symlink to soffice
-    ln -s $out/bin/soffice $out/bin/openoffice.org3
-}
-
-genericBuild
-
diff --git a/pkgs/applications/office/openoffice/default.nix b/pkgs/applications/office/openoffice/default.nix
deleted file mode 100644
index 5bc5cbf8c9b..00000000000
--- a/pkgs/applications/office/openoffice/default.nix
+++ /dev/null
@@ -1,105 +0,0 @@
-{ stdenv, fetchurl, pam, python, tcsh, libxslt, perl, ArchiveZip
-, CompressZlib, zlib, libjpeg, expat, pkgconfig, freetype, libwpd
-, libxml2, db4, sablotron, curl, libXaw, fontconfig, libsndfile, neon
-, bison, flex, zip, unzip, gtk, libmspack, getopt, file, cairo, which
-, icu, boost, jdk, ant, libXext, libX11, libXtst, libXi, cups
-, libXinerama, openssl, gperf, cppunit, GConf, ORBit2
-}:
-
-let version = "3.2.1"; in
-
-stdenv.mkDerivation rec {
-  name = "openoffice.org-${version}";
-  builder = ./builder.sh;
-
-  downloadRoot = "http://openoffice.mirrorbrain.org/files/stable";
-  versionDirs = true;
-
-  src = fetchurl {
-      url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_core.tar.bz2";
-      sha256 = "0gj2hinhnzkazh44k1an05x5cj7n6721f2grqrkjh31cm38r9p6i";
-    };
-
-  patches = [ ./oo.patch ./root-required.patch ./xlib.patch ];
-
-  postPatch =
-    /* Compiling with GCC 4.5 fails:
-
-         Compiling: cppu/source/AffineBridge/AffineBridge.cxx
-         [...]
-         ../../inc/uno/lbnames.h:67:2: error: #error "Supported gcc majors are 2 , 3 and 4 <= 4.4.  Unsupported gcc major version."
-
-       However, we can't compile with GCC 4.4 because then we'd end up with
-       two different versions of libstdc++ (because the deps are compiled
-       with 4.5), which isn't supported (link time error.)
-
-       Thus, force compilation with 4.5 and hope for the best.  */
-    '' sed -i "cppu/inc/uno/lbnames.h" \
-           -e 's/#[[:blank:]]*error "Supported.*$//g'
-    '';
-
-  src_system = fetchurl {
-      url = "${downloadRoot}/${if versionDirs then version + "/" else ""}OOo_${version}_src_system.tar.bz2";
-      sha256 = "0giy3sza64ij19w7b06rxcrkrb5kq2fvkz486vh3mv08s8xa8zfc";
-    };
-
-  preConfigure = ''
-    PATH=$PATH:${icu}/sbin
-  '';
-
-  configureFlags = "
-    --with-package-format=native
-    --disable-epm
-    --disable-fontooo
-    --disable-gnome-vfs
-    --disable-gnome-vfs
-    --disable-mathmldtd
-    --disable-mozilla
-    --disable-odk
-    --disable-pasf
-    --with-cairo
-    --with-system-libs
-    --with-system-python
-    --with-system-boost
-    --with-system-db
-    --with-jdk-home=${jdk}
-    --with-ant-home=${ant}
-    --without-afms
-    --without-dict
-    --without-fonts
-    --without-myspell-dicts
-    --without-nas
-    --without-ppds
-    --without-system-agg
-    --without-system-beanshell
-    --without-system-hsqldb
-    --without-system-xalan
-    --without-system-xerces
-    --without-system-xml-apis
-    --without-system-xt
-    --without-system-jars
-    --without-system-hunspell
-    --without-system-altlinuxhyph
-    --without-system-lpsolve
-    --without-system-graphite
-  ";
-
-  LD_LIBRARY_PATH = "${libXext}/lib:${libX11}/lib:${libXtst}/lib:${libXi}/lib:${libjpeg}/lib";
-
-  buildInputs = [
-    pam python tcsh libxslt perl ArchiveZip CompressZlib zlib 
-    libjpeg expat pkgconfig freetype libwpd libxml2 db4 sablotron curl 
-    libXaw fontconfig libsndfile neon bison flex zip unzip gtk libmspack 
-    getopt file jdk cairo which icu boost libXext libX11 libXtst libXi
-    cups libXinerama openssl gperf GConf ORBit2
-  ];
-
-  inherit icu fontconfig libjpeg jdk cups;
-
-  meta = {
-    description = "OpenOffice.org is a multiplatform and multilingual office suite";
-    homepage = http://www.openoffice.org/;
-    license = "LGPL";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-  };
-}
diff --git a/pkgs/applications/office/openoffice/generate-libreoffice-srcs.sh b/pkgs/applications/office/openoffice/generate-libreoffice-srcs.sh
deleted file mode 100644
index 1d751ec7049..00000000000
--- a/pkgs/applications/office/openoffice/generate-libreoffice-srcs.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/var/run/current-system/bin/bash
-
-# Take the list of files from the main package, ooo.lst.in
-
-echo '{fetchurl} : ['
-
-while read a; do
-
-  URL=http://dev-www.libreoffice.org/src/$a
-
-  MD5=${a::32}
-  echo '(fetchurl {'
-  echo "  url = \"$URL\";"
-  echo "  md5 = \"$MD5\";"
-  echo '})'
-done
-
-echo ']'
diff --git a/pkgs/applications/office/openoffice/libreoffice-srcs.nix b/pkgs/applications/office/openoffice/libreoffice-srcs.nix
deleted file mode 100644
index 6b98e32e46f..00000000000
--- a/pkgs/applications/office/openoffice/libreoffice-srcs.nix
+++ /dev/null
@@ -1,370 +0,0 @@
-{fetchurl} : [
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/48a9f787f43a09c0a9b7b00cd1fddbbf-hyphen-2.7.1.tar.gz";
-  md5 = "48a9f787f43a09c0a9b7b00cd1fddbbf";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/63ddc5116488985e820075e65fbe6aa4-openssl-0.9.8o.tar.gz";
-  md5 = "63ddc5116488985e820075e65fbe6aa4";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/db5ffcd50064421176e8afb7b85fd1a7-pixman-0.24.0.tar.bz2";
-  md5 = "db5ffcd50064421176e8afb7b85fd1a7";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0b49ede71c21c0599b0cc19b353a6cb3-README_apache-commons.txt";
-  md5 = "0b49ede71c21c0599b0cc19b353a6cb3";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/e1c178b18f130b40494561f02bc1a948-libexttextcat-3.2.0.tar.bz2";
-  md5 = "e1c178b18f130b40494561f02bc1a948";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip";
-  md5 = "17410483b5b5f267aa18b7e00b65e6e0";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/1756c4fa6c616ae15973c104cd8cb256-Adobe-Core35_AFMs-314.tar.gz";
-  md5 = "1756c4fa6c616ae15973c104cd8cb256";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/18f577b374d60b3c760a3a3350407632-STLport-4.5.tar.gz";
-  md5 = "18f577b374d60b3c760a3a3350407632";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/1f24ab1d39f4a51faf22244c94a6203f-xmlsec1-1.2.14.tar.gz";
-  md5 = "1f24ab1d39f4a51faf22244c94a6203f";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/24be19595acad0a2cae931af77a0148a-LICENSE_source-9.0.0.7-bj.html";
-  md5 = "24be19595acad0a2cae931af77a0148a";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz";
-  md5 = "26b3e95ddf3d9c077c480ea45874b3b8";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/284e768eeda0e2898b0d5bf7e26a016e-raptor-1.4.18.tar.gz";
-  md5 = "284e768eeda0e2898b0d5bf7e26a016e";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/2a177023f9ea8ec8bd00837605c5df1b-jakarta-tomcat-5.0.30-src.tar.gz";
-  md5 = "2a177023f9ea8ec8bd00837605c5df1b";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/2ae988b339daec234019a7066f96733e-commons-lang-2.3-src.tar.gz";
-  md5 = "2ae988b339daec234019a7066f96733e";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/2c9b0f83ed5890af02c0df1c1776f39b-commons-httpclient-3.1-src.tar.gz";
-  md5 = "2c9b0f83ed5890af02c0df1c1776f39b";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0be45d54cc5e1c2e3102e32b8c190346-liberation-fonts-ttf-1.07.1.tar.gz";
-  md5 = "0be45d54cc5e1c2e3102e32b8c190346";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip";
-  md5 = "35c94d2df8893241173de1d16b6034c0";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/35efabc239af896dfb79be7ebdd6e6b9-gentiumbasic-fonts-1.10.zip";
-  md5 = "35efabc239af896dfb79be7ebdd6e6b9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/39bb3fcea1514f1369fcfc87542390fd-sacjava-1.3.zip";
-  md5 = "39bb3fcea1514f1369fcfc87542390fd";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3ade8cfe7e59ca8e65052644fed9fca4-epm-3.7.tar.gz";
-  md5 = "3ade8cfe7e59ca8e65052644fed9fca4";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3c219630e4302863a9a83d0efde889db-commons-logging-1.1.1-src.tar.gz";
-  md5 = "3c219630e4302863a9a83d0efde889db";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/48470d662650c3c074e1c3fabbc67bbd-README_source-9.0.0.7-bj.txt";
-  md5 = "48470d662650c3c074e1c3fabbc67bbd";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/48d8169acc35f97e05d8dcdfd45be7f2-lucene-2.3.2.tar.gz";
-  md5 = "48d8169acc35f97e05d8dcdfd45be7f2";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/4a660ce8466c9df01f19036435425c3a-glibc-2.1.3-stub.tar.gz";
-  md5 = "4a660ce8466c9df01f19036435425c3a";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz";
-  md5 = "f101a9e88b783337b20b2e26dfd26d5f";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/599dc4cc65a07ee868cf92a667a913d2-xpdf-3.02.tar.gz";
-  md5 = "599dc4cc65a07ee868cf92a667a913d2";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/7740a8ec23878a2f50120e1faa2730f2-libxml2-2.7.6.tar.gz";
-  md5 = "7740a8ec23878a2f50120e1faa2730f2";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/7376930b0d3f3d77a685d94c4a3acda8-STLport-4.5-0119.tar.gz";
-  md5 = "7376930b0d3f3d77a685d94c4a3acda8";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip";
-  md5 = "798b2ffdc8bcfe7bca2cf92b62caf685";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ecb2e37e45c9933e2a963cabe03670ab-curl-7.19.7.tar.gz";
-  md5 = "ecb2e37e45c9933e2a963cabe03670ab";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/8294d6c42e3553229af9934c5c0ed997-stax-api-1.0-2-sources.jar";
-  md5 = "8294d6c42e3553229af9934c5c0ed997";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/bd30e9cf5523cdfc019b94f5e1d7fd19-cppunit-1.12.1.tar.gz";
-  md5 = "bd30e9cf5523cdfc019b94f5e1d7fd19";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/a169ab152209200a7bad29a275cb0333-seamonkey-1.1.14.source.tar.gz";
-  md5 = "a169ab152209200a7bad29a275cb0333";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/a4d9b30810a434a3ed39fc0003bbd637-LICENSE_stax-api-1.0-2-sources.html";
-  md5 = "a4d9b30810a434a3ed39fc0003bbd637";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip";
-  md5 = "a7983f859eafb2677d7ff386a023bc40";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ada24d37d8d638b3d8a9985e80bc2978-source-9.0.0.7-bj.zip";
-  md5 = "ada24d37d8d638b3d8a9985e80bc2978";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/af3c3acf618de6108d65fcdc92b492e1-commons-codec-1.3-src.tar.gz";
-  md5 = "af3c3acf618de6108d65fcdc92b492e1";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/bc702168a2af16869201dbe91e46ae48-LICENSE_Python-2.6.1";
-  md5 = "bc702168a2af16869201dbe91e46ae48";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/c441926f3a552ed3e5b274b62e86af16-STLport-4.0.tar.gz";
-  md5 = "c441926f3a552ed3e5b274b62e86af16";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ca66e26082cab8bb817185a116db809b-redland-1.0.8.tar.gz";
-  md5 = "ca66e26082cab8bb817185a116db809b";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/d4c4d91ab3a8e52a2e69d48d34ef4df4-core.zip";
-  md5 = "d4c4d91ab3a8e52a2e69d48d34ef4df4";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/d70951c80dabecc2892c919ff5d07172-db-4.7.25.NC-custom.tar.gz";
-  md5 = "d70951c80dabecc2892c919ff5d07172";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/e0707ff896045731ff99e99799606441-README_db-4.7.25.NC-custom.txt";
-  md5 = "e0707ff896045731ff99e99799606441";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/e81c2f0953aa60f8062c05a4673f2be0-Python-2.6.1.tar.bz2";
-  md5 = "e81c2f0953aa60f8062c05a4673f2be0";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/e61d0364a30146aaa3001296f853b2b9-libxslt-1.1.26.tar.gz";
-  md5 = "e61d0364a30146aaa3001296f853b2b9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ea570af93c284aa9e5621cd563f54f4d-bsh-2.0b1-src.tar.gz";
-  md5 = "ea570af93c284aa9e5621cd563f54f4d";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ea91f2fb4212a21d708aced277e6e85a-vigra1.4.0.tar.gz";
-  md5 = "ea91f2fb4212a21d708aced277e6e85a";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ee8b492592568805593f81f8cdf2a04c-expat-2.0.1.tar.gz";
-  md5 = "ee8b492592568805593f81f8cdf2a04c";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/fb7ba5c2182be4e73748859967455455-README_stax-api-1.0-2-sources.txt";
-  md5 = "fb7ba5c2182be4e73748859967455455";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/fca8706f2c4619e2fa3f8f42f8fc1e9d-rasqal-0.9.16.tar.gz";
-  md5 = "fca8706f2c4619e2fa3f8f42f8fc1e9d";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/fdb27bfe2dbe2e7b57ae194d9bf36bab-SampleICC-1.3.2.tar.gz";
-  md5 = "fdb27bfe2dbe2e7b57ae194d9bf36bab";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/f872f4ac066433d8ff92f5e316b36ff9-dejavu-fonts-ttf-2.33.zip";
-  md5 = "f872f4ac066433d8ff92f5e316b36ff9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0981bda6548a8c8233ffce2b6e4b2a23-mysql-connector-c++-1.1.0.tar.gz";
-  md5 = "0981bda6548a8c8233ffce2b6e4b2a23";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/061a9f17323117c9358ed60f33ecff78-postgresql-9.1.1.tar.bz2";
-  md5 = "061a9f17323117c9358ed60f33ecff78";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/067201ea8b126597670b5eff72e1f66c-mythes-1.2.0.tar.gz";
-  md5 = "067201ea8b126597670b5eff72e1f66c";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3404ab6b1792ae5f16bbd603bd1e1d03-libformula-1.1.7.zip";
-  md5 = "3404ab6b1792ae5f16bbd603bd1e1d03";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3bdf40c0d199af31923e900d082ca2dd-libfonts-1.1.6.zip";
-  md5 = "3bdf40c0d199af31923e900d082ca2dd";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/8ce2fcd72becf06c41f7201d15373ed9-librepository-1.1.6.zip";
-  md5 = "8ce2fcd72becf06c41f7201d15373ed9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/97b2d4dba862397f446b217e2b623e71-libloader-1.1.6.zip";
-  md5 = "97b2d4dba862397f446b217e2b623e71";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ace6ab49184e329db254e454a010f56d-libxml-1.1.7.zip";
-  md5 = "ace6ab49184e329db254e454a010f56d";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/d8bd5eed178db6e2b18eeed243f85aa8-flute-1.1.6.zip";
-  md5 = "d8bd5eed178db6e2b18eeed243f85aa8";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/db60e4fde8dd6d6807523deb71ee34dc-liblayout-0.2.10.zip";
-  md5 = "db60e4fde8dd6d6807523deb71ee34dc";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/eeb2c7ddf0d302fba4bfc6e97eac9624-libbase-1.1.6.zip";
-  md5 = "eeb2c7ddf0d302fba4bfc6e97eac9624";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/f94d9870737518e3b597f9265f4e9803-libserializer-1.1.6.zip";
-  md5 = "f94d9870737518e3b597f9265f4e9803";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ba2930200c9f019c2d93a8c88c651a0f-flow-engine-0.9.4.zip";
-  md5 = "ba2930200c9f019c2d93a8c88c651a0f";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/ff369e69ef0f0143beb5626164e87ae2-neon-0.29.5.tar.gz";
-  md5 = "ff369e69ef0f0143beb5626164e87ae2";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3dd55b952826d2b32f51308f2f91aa89-gettext-0.18.1.1.tar.gz";
-  md5 = "3dd55b952826d2b32f51308f2f91aa89";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/9f6e85e1e38490c3956f4415bcd33e6e-glib-2.28.1.tar.gz";
-  md5 = "9f6e85e1e38490c3956f4415bcd33e6e";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/a7d6c5f2fe2d481149ed3ba807b5c043-gdk-pixbuf-2.23.0.tar.gz";
-  md5 = "a7d6c5f2fe2d481149ed3ba807b5c043";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3a84ac2da37cae5bf7ce616228c6fbde-libgsf-1.14.19.tar.gz";
-  md5 = "3a84ac2da37cae5bf7ce616228c6fbde";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/22ad1c8d3fda7e73b0798035f3dd96bc-pango-1.28.3.tar.gz";
-  md5 = "22ad1c8d3fda7e73b0798035f3dd96bc";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0611e099e807210cf738dcb41425d104-libcroco-0.6.2.tar.gz";
-  md5 = "0611e099e807210cf738dcb41425d104";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/d7a242ca43e33e1b63d3073f9d46a6a8-librsvg-2.32.1.tar.gz";
-  md5 = "d7a242ca43e33e1b63d3073f9d46a6a8";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/220035f111ea045a51e290906025e8b5-libpng-1.5.1.tar.gz";
-  md5 = "220035f111ea045a51e290906025e8b5";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/a2c10c04f396a9ce72894beb18b4e1f9-jpeg-8c.tar.gz";
-  md5 = "a2c10c04f396a9ce72894beb18b4e1f9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/c735eab2d659a96e5a594c9e8541ad63-zlib-1.2.5.tar.gz";
-  md5 = "c735eab2d659a96e5a594c9e8541ad63";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/314e582264c36b3735466c522899aa07-icu4c-4_4_2-src.tgz";
-  md5 = "314e582264c36b3735466c522899aa07";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/451ccf439a36a568653b024534669971-ConvertTextToNumber-1.3.2.oxt";
-  md5 = "451ccf439a36a568653b024534669971";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/b99fb620b1324b4ce79ee6998b507146-JLanguageTool-1.4.0.tar.bz2";
-  md5 = "b99fb620b1324b4ce79ee6998b507146";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/debc62758716a169df9f62e6ab2bc634-zlib-1.2.3.tar.gz";
-  md5 = "debc62758716a169df9f62e6ab2bc634";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0f63ee487fda8f21fafa767b3c447ac9-ixion-0.2.0.tar.gz";
-  md5 = "0f63ee487fda8f21fafa767b3c447ac9";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/71474203939fafbe271e1263e61d083e-nss-3.12.8-with-nspr-4.8.6.tar.gz";
-  md5 = "71474203939fafbe271e1263e61d083e";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/9d283e02441d8cebdcd1e5d9df227d67-libwpg-0.2.1.tar.bz2";
-  md5 = "9d283e02441d8cebdcd1e5d9df227d67";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/c01351d7db2b205de755d58769288224-libwpd-0.9.4.tar.bz2";
-  md5 = "c01351d7db2b205de755d58769288224";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/34dd7951abbda99b7a75a09993a37965-libwps-0.2.4.tar.bz2";
-  md5 = "34dd7951abbda99b7a75a09993a37965";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/0ff7d225d087793c8c2c680d77aac3e7-mdds_0.5.3.tar.bz2";
-  md5 = "0ff7d225d087793c8c2c680d77aac3e7";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/f02578f5218f217a9f20e9c30e119c6a-boost_1_44_0.tar.bz2";
-  md5 = "f02578f5218f217a9f20e9c30e119c6a";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3121aaf3e13e5d88dfff13fb4a5f1ab8-hunspell-1.3.2.tar.gz";
-  md5 = "3121aaf3e13e5d88dfff13fb4a5f1ab8";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/3bf481ca95109b14435125c0dd1f2217-graphite2-1.0.3.tgz";
-  md5 = "3bf481ca95109b14435125c0dd1f2217";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/d28864eb2b59bb57b034c0d4662a3cee-libvisio-0.0.15.tar.bz2";
-  md5 = "d28864eb2b59bb57b034c0d4662a3cee";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/e7a384790b13c29113e22e596ade9687-LinLibertineG-20120116.zip";
-  md5 = "e7a384790b13c29113e22e596ade9687";
-})
-(fetchurl {
-  url = "http://dev-www.libreoffice.org/src/7c2549f6b0a8bb604e6c4c729ffdcfe6-libcmis-0.1.0.tar.gz";
-  md5 = "7c2549f6b0a8bb604e6c4c729ffdcfe6";
-})
-]
diff --git a/pkgs/applications/office/openoffice/libreoffice.nix b/pkgs/applications/office/openoffice/libreoffice.nix
deleted file mode 100644
index fb577be0390..00000000000
--- a/pkgs/applications/office/openoffice/libreoffice.nix
+++ /dev/null
@@ -1,165 +0,0 @@
-{ stdenv, fetchurl, pam, python, tcsh, libxslt, perl, ArchiveZip
-, CompressZlib, zlib, libjpeg, expat, pkgconfig, freetype, libwpd
-, libxml2, db4, sablotron, curl, libXaw, fontconfig, libsndfile, neon
-, bison, flex, zip, unzip, gtk, libmspack, getopt, file, cairo, which
-, icu, boost, jdk, ant, libXext, libX11, libXtst, libXi, cups
-, libXinerama, openssl, gperf, cppunit, GConf, ORBit2, poppler
-, librsvg, gnome_vfs, gstreamer, gst_plugins_base, mesa
-, autoconf, automake, openldap, bash
-, fontsConf
-, langs ? [ "en-US" "en-GB" "ca" "ru" "eo" "fr" "nl" "de" ]
-}:
-
-let
-  langsSpaces = stdenv.lib.concatStringsSep " " langs;
-in
-stdenv.mkDerivation rec {
-  name = "libreoffice-3.5.1.2";
-
-  srcs_download = import ./libreoffice-srcs.nix { inherit fetchurl; };
-
-  src_translation = fetchurl {
-    url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-translations-3.5.1.2.tar.xz";
-    sha256 = "cf8ed662f7d0a679bd3a242a7f88cf445b769afdcd8a3d3df655d774f296972a";
-  };
-
-  src_help = fetchurl {
-    url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-help-3.5.1.2.tar.xz";
-    sha256 = "43b07225854b1c8b3195b252453b8e97d2d58d83909bf4b5f920cb08b7f33e30";
-  };
-
-  src = fetchurl {
-    url = "http://download.documentfoundation.org/libreoffice/src/3.5.1/libreoffice-core-3.5.1.2.tar.xz";
-    sha256 = "61cd12e20fb9460178fc6f08100a9a189c2390c21e2e47eb66e07a5b0ce5cd94";
-  };
-
-  # Openoffice will open libcups dynamically, so we link it directly
-  # to make its dlopen work.
-  NIX_LDFLAGS = "-lcups";
-
-  # If we call 'configure', 'make' will then call configure again without parameters.
-  # It's their system.
-  configureScript = "./autogen.sh";
-
-  preConfigure = ''
-    tar xf $src_translation
-    # Libreoffice expects by default the translations in ./translations
-    mv libreoffice-translations-3.5.1.2/translations .
-    tar xf $src_help
-    # Libreoffice expects by default the help in ./helpcontent2
-    mv libreoffice-help-3.5.1.2/helpcontent2 .
-
-    sed -i 's,/bin/bash,${bash}/bin/bash,' sysui/desktop/share/makefile.mk solenv/bin/localize
-    sed -i 's,/usr/bin/env bash,${bash}/bin/bash,' bin/unpack-sources \
-      solenv/bin/install-gdb-printers solenv/bin/striplanguagetags.sh
-
-    sed -i 's,/usr/bin/env perl,${perl}/bin/perl,' solenv/bin/concat-deps.pl solenv/bin/ooinstall
-    sed -i 's,ANT_OPTS+="\(.*\)",ANT_OPTS+=\1,' apache-commons/java/*/makefile.mk
-
-    # Needed to find genccode
-    PATH=$PATH:${icu}/sbin
-
-    configureFlagsArray=("--with-lang=${langsSpaces}")
-  '';
-
-  buildPhase = ''
-    # This is required as some cppunittests require fontconfig configured
-    export FONTCONFIG_FILE=${fontsConf}
-    mkdir src
-    for a in $srcs_download; do
-      FILE=$(basename $a)
-      # take out the hash
-      cp -v $a src/$(echo $FILE | sed 's/[^-]*-//')
-    done
-
-    # Remove an exit 1, ignoring the lack of wget or curl
-    sed '/wget nor curl/{n;d}' -i download
-    ./download
-
-    # Fix sysui: wants to create a tar for root
-    sed -i -e 's,--own.*root,,' sysui/desktop/slackware/makefile.mk
-    # 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
-
-    # This to aovid using /lib:/usr/lib at linking
-    sed -i '/gb_LinkTarget_LDFLAGS/{ n; /rpath-link/d;}' solenv/gbuild/platform/unxgcc.mk
-
-    find -name "*.cmd" -exec sed -i s,/lib:/usr/lib,, {} \;
-
-    make
-  '';
-
-  # It installs only things to $out/lib/libreoffice
-  postInstall = ''
-    mkdir -p $out/bin
-    for a in sbase scalc sdraw smath swriter spadmin simpress soffice; do
-      ln -s $out/lib/libreoffice/program/$a $out/bin/$a
-    done
-  '';
-
-  configureFlags = [
-    "--enable-verbose"
-
-    # Without these, configure does not finish
-    "--without-junit"
-    "--without-system-mythes"
-
-    # Without this, it wants to download
-    "--with-system-cairo"
-    "--with-system-libs"
-    "--enable-python=system"
-    "--with-system-boost"
-    "--with-system-db"
-
-    # I imagine this helps. Copied from go-oo.
-    "--disable-epm"
-    "--disable-mathmldtd"
-    "--disable-mozilla"
-    "--disable-odk"
-    "--disable-dbus"
-    "--disable-kde"
-    "--disable-kde4"
-    "--disable-postgresql-sdbc"
-    "--with-package-format=native"
-    "--with-jdk-home=${jdk}"
-    "--with-ant-home=${ant}"
-    "--without-afms"
-    "--without-fonts"
-    "--without-myspell-dicts"
-    "--without-ppds"
-    "--without-system-beanshell"
-    "--without-system-hsqldb"
-    "--without-system-jars"
-    "--without-system-hunspell"
-    "--without-system-altlinuxhyph"
-    "--without-system-lpsolve"
-    "--without-system-graphite"
-    "--without-system-mozilla"
-    "--without-system-libwps"
-    "--without-system-libwpg"
-    "--without-system-redland"
-    "--without-system-libvisio"
-    "--without-system-libcmis"
-    "--without-system-nss"
-    "--without-system-sampleicc"
-    "--without-system-libexttextcat"
-  ];
-
-  buildInputs = [
-    pam python tcsh libxslt perl ArchiveZip CompressZlib zlib 
-    libjpeg expat pkgconfig freetype libwpd libxml2 db4 sablotron curl 
-    libXaw fontconfig libsndfile neon bison flex zip unzip gtk libmspack 
-    getopt file jdk cairo which icu boost libXext libX11 libXtst libXi mesa
-    cups libXinerama openssl gperf GConf ORBit2 gnome_vfs gstreamer gst_plugins_base
-    ant autoconf openldap cppunit poppler librsvg automake
-  ];
-
-  meta = {
-    description = "Libre-office, variant of openoffice.org";
-    homepage = http://libreoffice.org/;
-    license = "LGPL";
-    maintainers = [ stdenv.lib.maintainers.viric ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/office/openoffice/oo.patch b/pkgs/applications/office/openoffice/oo.patch
deleted file mode 100644
index e759fcdc2d4..00000000000
--- a/pkgs/applications/office/openoffice/oo.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff --git a/libtextcat/makefile.mk b/libtextcat/makefile.mk
-index 74c64bf..fbf8d21 100644
---- a/libtextcat/makefile.mk
-+++ b/libtextcat/makefile.mk
-@@ -57,7 +57,7 @@ ADDITIONAL_FILES= \
- #CONFIGURE_DIR=$(BUILD_DIR)
- 
- #relative to CONFIGURE_DIR
--CONFIGURE_ACTION=configure CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)"
-+CONFIGURE_ACTION=configure CFLAGS="$(ARCH_FLAGS) $(EXTRA_CFLAGS)" --prefix=$(TMPDIR)
- CONFIGURE_FLAGS=$(eq,$(OS),MACOSX CPPFLAGS="$(EXTRA_CDEFS)" $(NULL))
- 
- BUILD_ACTION=make
-diff --git a/redland/raptor/makefile.mk b/redland/raptor/makefile.mk
-index 0d92de9..aae3b4f 100644
---- a/redland/raptor/makefile.mk
-+++ b/redland/raptor/makefile.mk
-@@ -130,7 +130,7 @@ XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config
- CONFIGURE_DIR=
- CONFIGURE_ACTION=.$/configure
- # do not enable grddl parser (#i93768#)
--CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
-+CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
- BUILD_ACTION=$(GNUMAKE)
- BUILD_FLAGS+= -j$(EXTMAXPROCESS)
- BUILD_DIR=$(CONFIGURE_DIR)
-diff --git a/redland/rasqal/makefile.mk b/redland/rasqal/makefile.mk
-index fba6460..fc70419 100644
---- a/redland/rasqal/makefile.mk
-+++ b/redland/rasqal/makefile.mk
-@@ -126,7 +126,7 @@ XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config
- 
- CONFIGURE_DIR=
- CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH"
--CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
-+CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
- BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE)
- BUILD_FLAGS+= -j$(EXTMAXPROCESS)
- BUILD_DIR=$(CONFIGURE_DIR)
-diff --git a/redland/redland/makefile.mk b/redland/redland/makefile.mk
-index 710d7d6..dd60f0d 100644
---- a/redland/redland/makefile.mk
-+++ b/redland/redland/makefile.mk
-@@ -132,7 +132,7 @@ XSLTLIB!:=$(XSLTLIB) # expand dmake variables for xslt-config
- 
- CONFIGURE_DIR=
- CONFIGURE_ACTION=.$/configure PATH="..$/..$/..$/bin:$$PATH"
--CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml
-+CONFIGURE_FLAGS=--disable-static --disable-gtk-doc --with-threads --with-openssl-digests --with-xml-parser=libxml --with-raptor=system --with-rasqual=system --without-bdb --without-sqlite --without-mysql --without-postgresql --without-threestore       --with-regex-library=posix --with-decimal=none --with-www=xml --prefix=$(TMPDIR)
- BUILD_ACTION=$(AUGMENT_LIBRARY_PATH) $(GNUMAKE)
- BUILD_FLAGS+= -j$(EXTMAXPROCESS)
- BUILD_DIR=$(CONFIGURE_DIR)
-diff --git a/hunspell/hunspell-1.2.8.patch b/hunspell/hunspell-1.2.8.patch
-index 37b7964..e6fd962 100644
---- a/hunspell/hunspell-1.2.8.patch
-+++ b/hunspell/hunspell-1.2.8.patch
-@@ -619,3 +619,15 @@
-              p++;
-          }
-          if (i > 0 && buf[i - 1] == '\n') {
-+diff --git a/hunspell/unxlngi6.pro/misc/build/hunspell-1.2.8/tests/test.sh b/hunspell/unxlngi6.pro/misc/build/hunspell-1.1.12/tests/test.sh
-+index 90080f6..f069517 100755
-+--- a/hunspell/unxlngi6.pro/misc/build/hunspell-1.2.8/tests/test.sh
-++++ b/hunspell/unxlngi6.pro/misc/build/hunspell-1.2.8/tests/test.sh
-+--- misc/hunspell-1.2.8/tests/test.sh	Sep  4 01:25:35 2007
-++++ misc/build/hunspell-1.2.8/tests/test.sh	Jun 18 11:53:11 2008
-+@@ -1,4 +1,4 @@
-+-#!/bin/bash
-++#!/bin/sh
-+ export LC_ALL="C"
-+ 
-+ function check_valgrind_log () {
diff --git a/pkgs/applications/office/openoffice/root-required.patch b/pkgs/applications/office/openoffice/root-required.patch
deleted file mode 100644
index b93fd22b4ab..00000000000
--- a/pkgs/applications/office/openoffice/root-required.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-As nix chroot environment does not have the 'root' as owner, we have to disable
-the "owner=root" tar parameters when doing these tar files.
-They are built at openoffice build time.
-diff --git a/sysui/desktop/slackware/makefile.mk b/sysui/desktop/slackware/makefile.mk
-index 3342aca..49679b1 100644
---- a/sysui/desktop/slackware/makefile.mk
-+++ b/sysui/desktop/slackware/makefile.mk
-@@ -100,7 +100,7 @@ $(MISC)/$(TARGET)/usr/share/applications/ :
- 
- $(MISC)/$(TARGET)/empty.tar :
- 	@$(MKDIRHIER) $(@:d)/empty
--	@tar -C $(MISC)/$(TARGET)/empty --owner=root --group=root --same-owner -cf $@ .
-+	@tar -C $(MISC)/$(TARGET)/empty  -cf $@ .
- 
- 
- # --- packaging ---------------------------------------------------
-@@ -112,7 +112,7 @@ $(MENUFILES) : $(MISC)/$(TARGET)/empty.tar
- 	-$(RM) -r $(MISC)$/$(@:b)
- 	dmake $(MISC)$/$(@:b)$/usr/share/applications $(MISC)$/$(@:b)$/install$/slack-desc $(MISC)$/$(@:b)$/install$/doinst.sh
- 	@$(COPY) $(MISC)/$(TARGET)$/empty.tar $@.tmp
--	@tar -C $(MISC)/$(@:b) --owner=root --group=root --same-owner --exclude application.flag -rf $@.tmp install usr opt
-+	@tar -C $(MISC)/$(@:b) --exclude application.flag -rf $@.tmp install usr opt
- 	@gzip < $@.tmp > $@
- 	@$(RM) $@.tmp
- 	$(RM) -r $(MISC)$/$(@:b)
diff --git a/pkgs/applications/office/openoffice/xlib.patch b/pkgs/applications/office/openoffice/xlib.patch
deleted file mode 100644
index d5f0ff9aa20..00000000000
--- a/pkgs/applications/office/openoffice/xlib.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-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/office/skrooge/default.nix b/pkgs/applications/office/skrooge/default.nix
index 9b27a3e2379..dfb4c243c8c 100644
--- a/pkgs/applications/office/skrooge/default.nix
+++ b/pkgs/applications/office/skrooge/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, kdelibs, grantlee, qca2, libofx, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "skrooge-1.3.0";
+  name = "skrooge-1.3.2";
 
   src = fetchurl {
     url = "http://skrooge.org/files/${name}.tar.bz2";
-    sha256 = "1sfzzn9xz01c0095w4scckiiwv2gfbaxx05h7ds5n02a113w53kz";
+    sha256 = "18j36yamxzfwpnnnjiach22q9088c2nlcilzh2p24gjhgnnd0v6r";
   };
 
   buildInputs = [ kdelibs grantlee qca2 libofx ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     inherit (kdelibs.meta) platforms;
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
new file mode 100644
index 00000000000..22180e9a3f7
--- /dev/null
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -0,0 +1,62 @@
+{ stdenv, fetchurl, freeglut, gtk2, gtkglext, libjpeg_turbo, libtheora, libXmu
+, lua, mesa, pkgconfig, perl, automake, autoconf, libtool, gettext
+}:
+
+let
+  name = "celestia-1.6.1";
+
+  gcc46Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-gcc46.patch?h=packages/celestia";
+    sha256 = "1q840ip5h2q93r0d68jwrvf40ns5qzqss9vzd6xnwvs3wa77m5wp";
+    name = "celestia-1.6.1-gcc46.patch";
+  };
+
+  libpng15Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-libpng15.patch?h=packages/celestia";
+    sha256 = "19yqbi5k944d3jm0q2mvcfg52kicy4j347gj62dyaijzj505x4pm";
+    name = "celestia-1.6.1-libpng15.patch";
+  };
+
+  linkingPatch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/celestia-1.6.1-linking.patch?h=packages/celestia";
+    sha256 = "1qzv18b2prqbhy21js5bnf7vwkmrq1dmrq8r0wab7v10axjqdv35";
+    name = "celestia-1.6.1-linking.patch";
+  };
+
+  gcc47Patch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/gcc-4.7-fixes.diff?h=packages/celestia";
+    sha256 = "1jqkafwrg1829cwqvlxxkqbf42zqfsgpqd8a5b2qlzma5napdmg5";
+    name = "gcc-4.7-fixes.diff";
+  };
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/celestia/${name}.tar.gz";
+    sha256 = "1i1lvhbgllsh2z8i6jj4mvrjak4a7r69psvk7syw03s4p7670mfk";
+  };
+
+  buildInputs = [ freeglut gtk2 gtkglext libjpeg_turbo libtheora libXmu mesa pkgconfig lua
+    perl automake autoconf libtool gettext  ];
+
+  patchPhase = ''
+    patch -Np0 -i "${gcc46Patch}"
+    patch -Np0 -i "${libpng15Patch}"
+    patch -Np1 -i "${linkingPatch}"
+    patch -Np1 -i "${gcc47Patch}"
+    autoreconf
+    configureFlagsArray=( --with-gtk --with-lua=${lua} CFLAGS="-O2 -fsigned-char" CXXFLAGS="-O2 -fsigned-char" )
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Free space simulation";
+    homepage = "http://www.shatters.net/celestia/";
+    license = stdenv.lib.licenses.gpl2;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index 388e65c9f75..820b4fb2979 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -1,24 +1,16 @@
-{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_0 }:
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_1, automake, autoconf }:
 
-let
-  name = "gravit-0.4.2";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "gravit-0.5.0";
 
   src = fetchurl {
-    url = "http://gravit.slowchop.com/dist/${name}.tar.gz";
-    sha256 = "f37f3ac256a4acbf575f709addaae8cb01eda4f85537affa28c45f2df6fddb07";
+    url = "http://gravit.slowchop.com/media/downloads/${name}.tgz";
+    sha256 = "0lyw0skrkb04s16vgz7ggswjrdxk1h23v5s85s09gjxzjp1xd3xp";
   };
 
-  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_0];
+  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_1 automake autoconf];
 
-  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3";
-
-  postInstall = ''
-    mv $out/etc/gravit $out/share/gravit/sample-config
-    rmdir $out/etc
-  '';
+  preConfigure = "sh autogen.sh";
 
   meta = {
     homepage = "http://gravit.slowchop.com";
diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
index b651370db21..04c82b21e85 100644
--- a/pkgs/applications/science/astronomy/stellarium/default.nix
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -1,28 +1,24 @@
 {stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv}:
 
 let
-  name = "stellarium-0.11.3";
+  name = "stellarium-0.12.1";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://sourceforge/stellarium/${name}.tar.gz";
-    sha256 = "f7c7eeaefcdc54c0fb8766f09e0c838acb742719adcdf12a6c1e12d55ecd6ac3";
+    sha256 = "02qfp56mkg3bqggv3ndx8v6zfswg51gkczwiqy5c9y4rw28hazla";
   };
 
   buildInputs = [ cmake freetype libpng mesa gettext openssl qt4 perl libiconv ];
 
-  preConfigure = ''
-    sed -i -e '/typedef void (\*__GLXextFuncPtr)(void);/d' src/core/external/GLee.h
-  '';
-
   enableParallelBuilding = true;
 
   meta = {
-    description = "an free open source planetarium";
-    homepage = http://stellarium.org/;
-    license = "GPL2";
+    description = "Free open-source planetarium";
+    homepage = "http://stellarium.org/";
+    license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.linux; # should be mesaPlatforms, but we don't have qt on darwin
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/science/biology/slr/default.nix b/pkgs/applications/science/biology/slr/default.nix
deleted file mode 100644
index 7111d1a854e..00000000000
--- a/pkgs/applications/science/biology/slr/default.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{stdenv, fetchurl, liblapack}:
-
-stdenv.mkDerivation {
-  name = "slr-1.4.2";
-
-  src = fetchurl {
-    url = http://www.ebi.ac.uk/goldman-srv/SLR/download/v1.4.2/slr_source.tgz;
-    sha256 = "03ak7jsz89zism6gx8fr1dwlwjgcmnrr9m6xgqpr0xzikxid02jp";
-  };
-
-  buildInputs = [ liblapack ];
-  preConfigure = "mkdir bin; cd src";
-  makeFlags = "-f Makefile.linux";
-
-  meta = {
-    description     = "Phylogenetic Analysis by Maximum Likelihood (PAML)";
-    longDescription = ''
-SLR is a program to detect sites in coding DNA that are unusually conserved and/or unusually variable (that is, evolving under purify or positive selection) by analysing the pattern of changes for an alignment of sequences on an evolutionary tree.     
-'';
-    license     = "GPL3";
-    homepage    = http://www.ebi.ac.uk/goldman/SLR/;
-  };
-}
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
index b444783ba21..f4b353296fd 100644
--- a/pkgs/applications/science/chemistry/avogadro/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 eigen zlib openbabel mesa libX11 ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   NIX_CFLAGS_COMPILE = "-include ${mesa}/include/GL/glu.h";
 
diff --git a/pkgs/applications/science/electronics/eagle/default.nix b/pkgs/applications/science/electronics/eagle/default.nix
new file mode 100644
index 00000000000..04c9a9b79ec
--- /dev/null
+++ b/pkgs/applications/science/electronics/eagle/default.nix
@@ -0,0 +1,86 @@
+{ stdenv, fetchurl, makeDesktopItem, patchelf, zlib, freetype, fontconfig
+, openssl, libXrender, libXrandr, libXcursor, libX11, libXext, libXi
+}:
+
+let
+
+  libPath = stdenv.lib.makeLibraryPath
+    [ zlib freetype fontconfig openssl libXrender libXrandr libXcursor libX11
+      libXext libXi
+    ];
+
+in
+
+stdenv.mkDerivation rec {
+  name = "eagle-${version}";
+  version = "6.4.0";
+
+  src = fetchurl {
+    url = "ftp://ftp.cadsoft.de/eagle/program/6.4/eagle-lin-${version}.run";
+    sha256 = "0jb44dsq4cl9rx5nam6rxsw9fsmm6fsksv9s544p2zrwnad2x2i8";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "Eagle";
+    exec = "eagle";
+    icon = "eagle";
+    comment = "Schematic capture and PCB layout";
+    desktopName = "Eagle";
+    genericName = "Schematic editor";
+    categories = "Application;Development;";
+  };
+
+  buildInputs =
+    [ patchelf zlib freetype fontconfig openssl libXrender libXrandr libXcursor
+      libX11 libXext libXi
+    ];
+
+  phases = [ "installPhase" ];
+
+  # NOTES:
+  # Eagle for Linux comes as a self-extracting shell script with embedded
+  # tarball. The tarball data (.tar.bz2) starts after a __DATA__ marker.
+  #
+  # Eagle apparently doesn't like binary patching. This is what happens:
+  #   $ ./result/eagle-6.4.0/bin/eagle
+  #   argv[0] (/home/bfo/nixpkgs/result/eagle-6.4.0/bin/eagle) is not the currently executed program version!
+  installPhase = ''
+    # Extract eagle tarball
+    mkdir "$out"
+    sed '1,/^__DATA__$/d' "$src" | tar -xjf - -C "$out"
+
+    # Install manpage
+    mkdir -p "$out"/share/man/man1
+    ln -s "$out"/eagle-${version}/doc/eagle.1 "$out"/share/man/man1/eagle.1
+
+    # Build LD_PRELOAD library that redirects license file access to the home
+    # directory of the user
+    mkdir -p "$out"/lib
+    gcc -shared -fPIC -DEAGLE_PATH=\"$out/eagle-${version}\" ${./eagle_fixer.c} -o "$out"/lib/eagle_fixer.so -ldl
+
+    # Make wrapper script
+    dynlinker="$(cat $NIX_GCC/nix-support/dynamic-linker)"
+    mkdir -p "$out"/bin
+    cat > "$out"/bin/eagle << EOF
+    #!${stdenv.shell}
+    export LD_LIBRARY_PATH="${stdenv.gcc.gcc}/lib:${libPath}"
+    export LD_PRELOAD="$out/lib/eagle_fixer.so"
+    exec "$dynlinker" "$out/eagle-${version}/bin/eagle" "\$@"
+    EOF
+    chmod a+x "$out"/bin/eagle
+
+    # Make desktop item
+    mkdir -p "$out"/share/applications
+    cp "$desktopItem"/share/applications/* "$out"/share/applications/
+    mkdir -p "$out"/share/icons
+    ln -s "$out/eagle-${version}/bin/eagleicon50.png" "$out"/share/icons/eagle.png
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Schematic editor and PCB layout tool from CadSoft";
+    homepage = http://www.cadsoftusa.com/;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/science/electronics/eagle/eagle_fixer.c b/pkgs/applications/science/electronics/eagle/eagle_fixer.c
new file mode 100644
index 00000000000..da9da4dcbd3
--- /dev/null
+++ b/pkgs/applications/science/electronics/eagle/eagle_fixer.c
@@ -0,0 +1,134 @@
+/*
+ * LD_PRELOAD trick to make Eagle (schematic editor and PCB layout tool from
+ * CadSoft) work from a read-only installation directory.
+ *
+ * When Eagle starts, it looks for the license file in <eagle>/bin/eagle.key
+ * (where <eagle> is the install path). If eagle.key is not found, Eagle checks
+ * for write access to <eagle>/bin/, shows a license dialog to the user and
+ * then attempts to write a license file to <eagle>/bin/.
+ *
+ * This will of course fail when Eagle is installed in the read-only Nix store.
+ * Hence this library that redirects accesses to the those paths in the
+ * following way:
+ *
+ *   <eagle>/bin              => $HOME
+ *   <eagle>/bin/eagle.key    => $HOME/.eagle.key
+ *
+ * Also, if copying an example project to ~/eagle/ (in the Eagle GUI), Eagle
+ * chmod's the destination with read-only permission bits (presumably because
+ * the source is read-only) and fails to complete the copy operation.
+ * Therefore, the mode argument in calls to chmod() is OR'ed with the S_IWUSR
+ * bit (write by owner).
+ *
+ * Usage:
+ *   gcc -shared -fPIC -DEAGLE_PATH="$out/eagle-${version}" eagle_fixer.c -o eagle_fixer.so -ldl
+ *   LD_PRELOAD=$PWD/eagle_fixer.so ./result/bin/eagle
+ *
+ * To see the paths that are modified at runtime, set the environment variable
+ * EAGLE_FIXER_DEBUG to 1.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <limits.h>
+#include <sys/stat.h>
+
+#ifndef EAGLE_PATH
+#error Missing EAGLE_PATH, path to the eagle-${version} installation directory.
+#endif
+
+typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
+typedef int (*access_func_t)(const char *pathname, int mode);
+typedef int (*chmod_func_t)(const char *path, mode_t mode);
+
+/*
+ * Map <eagle>/bin to $HOME and <eagle>/bin/eagle.key to $HOME/.eagle.key
+ *
+ * Path is truncated if bigger than PATH_MAX. It's not threadsafe, but that's
+ * OK.
+ */
+static const char *redirect(const char *pathname)
+{
+	static char buffer[PATH_MAX];
+	const char *homepath;
+	const char *new_path;
+	static int have_warned;
+
+	homepath = getenv("HOME");
+	if (!homepath) {
+		homepath = "/";
+		if (!have_warned && getenv("EAGLE_FIXER_DEBUG")) {
+			fprintf(stderr, "eagle_fixer: HOME is unset, using \"/\" (root) instead.\n");
+			have_warned = 1;
+		}
+	}
+
+	new_path = pathname;
+	if (strcmp(EAGLE_PATH "/bin", pathname) == 0) {
+		/* redirect to $HOME */
+		new_path = homepath;
+	} else if (strcmp(EAGLE_PATH "/bin/eagle.key", pathname) == 0) {
+		/* redirect to $HOME/.eagle.key */
+		snprintf(buffer, PATH_MAX, "%s/.eagle.key", homepath);
+		buffer[PATH_MAX-1] = '\0';
+		new_path = buffer;
+	}
+
+	return new_path;
+}
+
+FILE *fopen(const char *pathname, const char *mode)
+{
+	FILE *fp;
+	const char *path;
+	fopen_func_t orig_fopen;
+
+	orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
+	path = redirect(pathname);
+	fp = orig_fopen(path, mode);
+
+	if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: fopen(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
+	}
+
+	return fp;
+}
+
+int access(const char *pathname, int mode)
+{
+	int ret;
+	const char *path;
+	access_func_t orig_access;
+
+	orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
+	path = redirect(pathname);
+	ret = orig_access(path, mode);
+
+	if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: access(\"%s\", %d) => \"%s\": ret=%d\n", pathname, mode, path, ret);
+	}
+
+	return ret;
+}
+
+int chmod(const char *pathname, mode_t mode)
+{
+	int ret;
+	mode_t new_mode;
+	chmod_func_t orig_chmod;
+
+	orig_chmod = (chmod_func_t)dlsym(RTLD_NEXT, "chmod");
+	new_mode = mode | S_IWUSR;
+	ret = orig_chmod(pathname, new_mode);
+
+	if (getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: chmod(\"%s\", %o) => %o: ret=%d\n", pathname, mode, new_mode, ret);
+	}
+
+	return ret;
+}
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 9da45184978..cc53611493d 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -1,18 +1,18 @@
-{stdenv, fetchurl, fetchbzr, unzip, cmake, mesa, wxGTK, zlib, libX11,
-gettext}:
+{ stdenv, fetchurl, fetchbzr, unzip, cmake, mesa, gtk, wxGTK, zlib, libX11, 
+gettext, cups } : 
 
 stdenv.mkDerivation rec {
-  name = "kicad-20110708";
+  name = "kicad-20130325";
 
   src = fetchurl {
-    url = ftp://iut-tice.ujf-grenoble.fr/cao/sources/kicad_sources-2011-07-08-BZR3044.zip;
-    sha256 = "1gr75zcf55p3xpbg1gdkdpbh5x11bawc9rcff4fskwjyc3vfiv6a";
+    url = "http://iut-tice.ujf-grenoble.fr/cao/kicad-sources-stable_2013-03-25_BZR4005.zip";
+    sha256 = "0hg2aiis14am7mmpimcxnxvhy7c7fr5rgzlk6rjv44d9m0f9957m";
   };
 
   srcLibrary = fetchbzr {
     url = "http://bazaar.launchpad.net/~kicad-lib-committers/kicad/library";
-    revision = 112;
-    sha256 = "49fa9ad90759cfaf522c2a62665f033688b9d84d02f31c6b2505c08a217ad312";
+    revision = 220;
+    sha256 = "0l2lblgnm51n2w1p4ifpwdvq04rxgq73zrfxlhqa9zdlyh4rcddb";
   };
 
   cmakeFlags = "-DKICAD_TESTING_VERSION=ON";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Free Software EDA Suite";
-    homepage = http://kicad.sourceforge.net;
+    homepage = "http://www.kicad-pcb.org/";
     license = "GPLv2";
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
diff --git a/pkgs/applications/science/electronics/ngspice/default.nix b/pkgs/applications/science/electronics/ngspice/default.nix
index c7ddceb6b87..70153eee61b 100644
--- a/pkgs/applications/science/electronics/ngspice/default.nix
+++ b/pkgs/applications/science/electronics/ngspice/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, readline, bison, libX11, libICE, libXaw, libXext}:
 
 stdenv.mkDerivation {
-  name = "ng-spice-rework-21";
+  name = "ng-spice-rework-24";
 
   src = fetchurl {
-    url = mirror://sourceforge/ngspice/ng-spice-rework-21.tar.gz;
-    sha256 = "1hmvfl33dszy8xgbixx0zmiz4rdzjhl7lwlwm953jibd4dgx42j5";
+    url = "mirror://sourceforge/ngspice/ngspice-24.tar.gz";
+    sha256 = "0rgh75hbqrsljz767whbj65wi6369yc286v0qk8jxnv2da7p9ll6";
   };
 
   buildInputs = [ readline libX11 bison libICE libXaw libXext ];
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "The Next Generation Spice (Electronic Circuit Simulator).";
-    homepage = http://ngspice.sourceforge.net;
+    homepage = "http://ngspice.sourceforge.net";
     license = ["BSD" "GPLv2"];
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
diff --git a/pkgs/applications/science/electronics/qfsm/default.nix b/pkgs/applications/science/electronics/qfsm/default.nix
new file mode 100644
index 00000000000..0f24784e9e5
--- /dev/null
+++ b/pkgs/applications/science/electronics/qfsm/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, qt4, cmake, graphviz, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "qfsm-0.53.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qfsm/${name}-Source.tar.bz2";
+    sha256 = "1fx99dyai8zhs8s6mbr1i1467mnv1pf0ymh6mr0jm68mzj2jyzx4";
+  };
+
+  buildInputs = [ qt4 cmake graphviz pkgconfig ];
+
+  patches = [ ./drop-hardcoded-prefix.patch ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Graphical editor for finite state machines";
+    homepage = "http://qfsm.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch b/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch
new file mode 100644
index 00000000000..965d67ac552
--- /dev/null
+++ b/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch
@@ -0,0 +1,20 @@
+diff -ubrw qfsm-0.53.0-Source-orig/CMakeLists.txt qfsm-0.53.0-Source-new/CMakeLists.txt
+--- qfsm-0.53.0-Source-orig/CMakeLists.txt	2012-11-11 20:13:01.935856229 +0100
++++ qfsm-0.53.0-Source-new/CMakeLists.txt	2012-11-11 20:13:24.962930007 +0100
+@@ -406,10 +406,6 @@
+ 
+ 
+ IF(UNIX AND NOT WIN32)
+-  SET(CMAKE_INSTALL_PREFIX "/usr")
+-ENDIF(UNIX AND NOT WIN32)
+-
+-IF(UNIX AND NOT WIN32)
+   ADD_DEFINITIONS(-DQFSM_LANGUAGE_DIR="${CMAKE_INSTALL_PREFIX}/share/qfsm/")
+   ADD_DEFINITIONS(-DQFSM_HELP_DIR="${CMAKE_INSTALL_PREFIX}/share/doc/qfsm/")
+ ELSE(UNIX AND NOT WIN32)
+@@ -472,5 +468,3 @@
+     )
+ 
+ ENDIF(UNIX AND NOT WIN32)
+-
+-
diff --git a/pkgs/applications/science/electronics/qucs/default.nix b/pkgs/applications/science/electronics/qucs/default.nix
index 979faa2e597..e434c97db2b 100644
--- a/pkgs/applications/science/electronics/qucs/default.nix
+++ b/pkgs/applications/science/electronics/qucs/default.nix
@@ -1,13 +1,16 @@
 {stdenv, fetchurl, qt3, libX11}:
 
 stdenv.mkDerivation rec {
-  name = "qucs-0.0.15";
+  name = "qucs-0.0.16";
 
   src = fetchurl {
     url = "mirror://sourceforge/qucs/${name}.tar.gz";
-    sha256 = "0ggs2nicj8q270l0rbmzg4jc0d0zdxvfsjh4wgww670ma5855xsp";
+    sha256 = "1h8ba84k06rix5zl5p9p414zj2facbnlf1vxwh4a1sp4h9dbfnzy";
   };
 
+  patches = [ ./tr1-complex.patch ];
+  patchFlags = "-p0";
+
   buildInputs = [ qt3 libX11 ];
 
   meta = {
diff --git a/pkgs/applications/science/electronics/qucs/tr1-complex.patch b/pkgs/applications/science/electronics/qucs/tr1-complex.patch
new file mode 100644
index 00000000000..0be7ae00eb9
--- /dev/null
+++ b/pkgs/applications/science/electronics/qucs/tr1-complex.patch
@@ -0,0 +1,10 @@
+--- qucs-core/configure.orig	2011-07-03 07:34:09.069218113 -0500
++++ qucs-core/configure	2011-07-03 07:34:46.618990497 -0500
+@@ -5884,7 +5884,6 @@
+ 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+-#include <tr1/complex>
+ using namespace std;
+ using namespace std::tr1;
+ int
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
new file mode 100644
index 00000000000..7c04c85fdb7
--- /dev/null
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc, which, yacc, flex, imake, xproto, gccmakedep }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "tkgate-1.8.7";
+
+  src = fetchurl {
+    url = "http://www.tkgate.org/downloads/${name}.tgz";
+    sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
+  };
+
+  buildInputs = [ tcl tk libX11 libiconvOrLibc which yacc flex imake xproto gccmakedep ];
+
+  patchPhase = ''
+    sed -i config.h \
+      -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "8.5"|' \
+      -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvOrLibc}/include ${libX11}/include"|' \
+      -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib ${libX11}/lib"|' \
+      \
+      -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
+      -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
+      -e '20 i #define USE_ICONV 1' \
+      \
+      -e "s|.*#define.*TKGATE_HOMEDIRBASE.*|#define TKGATE_HOMEDIRBASE \\\"$out/lib\\\"|" \
+      -e "s|.*#define.*TKGATE_BINDIR.*|#define TKGATE_BINDIR \\\"$out/bin\\\"|" \
+      -e "s|.*#define.*TKGATE_MANDIR.*|#define TKGATE_MANDIR \\\"$out/share/man/man1\\\"|" \
+      -e "s|file:/usr/X11R6/lib/tkgate-|file://$out/lib/tkgate-|"
+  '';
+
+  meta = {
+    description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
+    homepage = "http://www.tkgate.org/";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/tkgate/2.x.nix b/pkgs/applications/science/electronics/tkgate/2.x.nix
new file mode 100644
index 00000000000..756fe7052d8
--- /dev/null
+++ b/pkgs/applications/science/electronics/tkgate/2.x.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "tkgate-2.0-b10";
+
+  src = fetchurl {
+    url = "http://www.tkgate.org/downloads/${name}.tgz";
+    sha256 = "0mr061xcwjmd8nhyjjcw2dzxqi53hv9xym9xsp0cw98knz2skxjf";
+  };
+
+  buildInputs = [ tcl tk libX11 ];
+
+  dontStrip = true;
+
+  patchPhase = ''
+    sed -i configure \
+      -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvOrLibc}/include"|' \
+      -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib"|'
+    sed -i options.h \
+      -e 's|.* #define TCL_LIBRARY .*|#define TCL_LIBRARY "${tcl}/${tcl.libdir}"|' \
+      -e 's|.* #define TK_LIBRARY .*|#define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"|'
+  '';
+
+  meta = {
+    description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
+    homepage = "http://www.tkgate.org/";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/xoscope/default.nix b/pkgs/applications/science/electronics/xoscope/default.nix
index 61fb615b84d..54aae9e7d3b 100644
--- a/pkgs/applications/science/electronics/xoscope/default.nix
+++ b/pkgs/applications/science/electronics/xoscope/default.nix
@@ -10,6 +10,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gtk pkgconfig ];
 
+  # from: https://aur.archlinux.org/packages.php?ID=12140&detail=1
+  patches = [ ./gtkdepre.diff ];
+
   meta = {
     description = "Oscilloscope through the sound card";
     homepage = http://xoscope.sourceforge.net;
diff --git a/pkgs/applications/science/electronics/xoscope/gtkdepre.diff b/pkgs/applications/science/electronics/xoscope/gtkdepre.diff
new file mode 100644
index 00000000000..993df9cb550
--- /dev/null
+++ b/pkgs/applications/science/electronics/xoscope/gtkdepre.diff
@@ -0,0 +1,58 @@
+diff -ru xoscope-2.0-old//gtkdatabox-0.6.0.0/gtk/gtkdatabox.c xoscope-2.0/gtkdatabox-0.6.0.0/gtk/gtkdatabox.c
+--- xoscope-2.0-old//gtkdatabox-0.6.0.0/gtk/gtkdatabox.c	2010-06-07 10:42:24.000000000 +0200
++++ xoscope-2.0/gtkdatabox-0.6.0.0/gtk/gtkdatabox.c	2010-06-07 10:45:40.000000000 +0200
+@@ -661,7 +661,7 @@
+ static void
+ gtk_databox_calculate_hcanvas (GtkDatabox *box)
+ {
+-   if (!GTK_WIDGET_VISIBLE (box))
++   if (!gtk_widget_get_visible (box))
+       return;
+    
+    if (box->priv->adjX->page_size == 1.0)
+@@ -698,7 +698,7 @@
+ static void
+ gtk_databox_calculate_vcanvas (GtkDatabox *box)
+ {
+-   if (!GTK_WIDGET_VISIBLE (box))
++   if (!gtk_widget_get_visible (box))
+       return;
+    
+    if (box->priv->adjY->page_size == 1.0)
+@@ -780,7 +780,7 @@
+    gtk_databox_draw (box, event);
+ 
+    gdk_draw_drawable (widget->window,
+-                      widget->style->fg_gc[GTK_WIDGET_STATE (widget)],
++                      widget->style->fg_gc[gtk_widget_get_state (widget)],
+                       box->priv->canvas.pixmap, event->area.x, event->area.y,
+                       event->area.x, event->area.y, event->area.width,
+                       event->area.height);
+@@ -940,7 +940,7 @@
+    GtkWidget *widget = GTK_WIDGET (box);
+ 
+    g_return_if_fail (GTK_IS_DATABOX (box));
+-   g_return_if_fail (GTK_WIDGET_VISIBLE (widget));
++   g_return_if_fail (gtk_widget_get_visible (widget));
+ 
+    gdk_draw_rectangle (box->priv->canvas.pixmap, widget->style->bg_gc[0], 
+                        TRUE, 0, 0,
+@@ -1150,7 +1150,7 @@
+    /* Copy a part of the pixmap to the screen */
+    if (pixmapCopyRect)
+       gdk_draw_drawable (widget->window,
+-                         widget->style->fg_gc[GTK_WIDGET_STATE (box)],
++                         widget->style->fg_gc[gtk_widget_get_state (box)],
+                          box->priv->canvas.pixmap,
+                          pixmapCopyRect->x,
+                          pixmapCopyRect->y,
+--- xoscope-2.0-old//gtkdatabox-0.6.0.0/gtk/Makefile.in	2011-09-02 16:43:43.000000000 +0200
++++ xoscope-2.0/gtkdatabox-0.6.0.0/gtk/Makefile.in	2011-09-02 16:43:57.000000000 +0200
+@@ -196,7 +196,6 @@
+ 			-DG_DISABLE_DEPRECATED\
+ 			-DGDK_DISABLE_DEPRECATED\
+ 			-DGDK_PIXBUF_DISABLE_DEPRECATED\
+-			-DGTK_DISABLE_DEPRECATED\
+ 			`pkg-config gtk+-2.0 --cflags`
+ 
+ all: all-am
diff --git a/pkgs/applications/science/logic/ekrhyper/default.nix b/pkgs/applications/science/logic/ekrhyper/default.nix
new file mode 100644
index 00000000000..7ff1acb062b
--- /dev/null
+++ b/pkgs/applications/science/logic/ekrhyper/default.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchurl, ocaml, perl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="ekrhyper";
+    version="1_4_08022013";
+    name="${baseName}-${version}";
+    hash="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb";
+    url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_08022013.tar.gz";
+    sha256="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb";
+  };
+  buildInputs = [
+    ocaml perl
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  setSourceRoot = "export sourceRoot=$(echo */ekrh/src/)";
+  preInstall = "export INSTALLDIR=$out";
+  postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';
+  meta = {
+    inherit (s) version;
+    description = "Automated first-order theorem prover";
+    license = stdenv.lib.licenses.gpl2 ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/logic/ekrhyper/default.upstream b/pkgs/applications/science/logic/ekrhyper/default.upstream
new file mode 100644
index 00000000000..310e93ea53f
--- /dev/null
+++ b/pkgs/applications/science/logic/ekrhyper/default.upstream
@@ -0,0 +1,3 @@
+url http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/
+ensure_choice
+version '.*[^0-9]_([-0-9_]+)[.].*' '\1'
diff --git a/pkgs/applications/science/logic/eProver/default.nix b/pkgs/applications/science/logic/eprover/default.nix
index 327a5d3a623..d36956d1375 100644
--- a/pkgs/applications/science/logic/eProver/default.nix
+++ b/pkgs/applications/science/logic/eprover/default.nix
@@ -1,12 +1,21 @@
 { stdenv, fetchurl, which, texLive }:
-
+let
+  s = # Generated upstream information
+  rec {
+    baseName="eprover";
+    version="1.7";
+    name="${baseName}-${version}";
+    hash="1prkgjpg8lajcylz9nj2hfjxl3l42cqbfvilg30z9b5br14l36rh";
+    url="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_1.7/E.tgz";
+    sha256="1prkgjpg8lajcylz9nj2hfjxl3l42cqbfvilg30z9b5br14l36rh";
+  };
+in
 stdenv.mkDerivation {
-  name = "EProver-1.4";
+  inherit (s) name;
 
   src = fetchurl {
-    name = "E-1.4.tar.gz";
-    url = "http://www4.informatik.tu-muenchen.de/~schulz/WORK/E_DOWNLOAD/V_1.4/E.tgz";
-    sha256 = "1hxkr21xqkkh4bzqip6qf70w9xvvb8p20zzkvyin631ffgvyvr93";
+    name = "E-${s.version}.tar.gz";
+    inherit (s) url sha256;
   };
 
   buildInputs = [which texLive];
@@ -27,6 +36,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
+    inherit (s) version;
     description = "E automated theorem prover";
     maintainers = [stdenv.lib.maintainers.raskin];
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/applications/science/logic/eprover/default.upstream b/pkgs/applications/science/logic/eprover/default.upstream
new file mode 100644
index 00000000000..fb2d80fafae
--- /dev/null
+++ b/pkgs/applications/science/logic/eprover/default.upstream
@@ -0,0 +1,3 @@
+url http://www4.informatik.tu-muenchen.de/~schulz/E/Download.html
+version_link '[.]tgz$'
+version '.*[/]V_([0-9.]+)[/].*' '\1'
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index 5d9866a650b..f9549241a45 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -4,28 +4,20 @@ let
   start_script = ''
     #!/bin/sh
     cd "$out/lib/hol_light"
-    exec ${ocaml}/bin/ocaml -I "$(ocamlfind query camlp5)" -init make.ml
+    exec ${ocaml}/bin/ocaml -I "camlp5 -where" -init make.ml
   '';
 in
 
 stdenv.mkDerivation {
-  name = "hol_light-20120529";
+  name = "hol_light-20130324";
   src = fetchsvn {
     url = http://hol-light.googlecode.com/svn/trunk;
-    rev = "141";
-    sha256 = "a11d7e5db7c6035a2debcf9e73f43c6322389aeac5bc4d123ebf58918052a57f";
+    rev = "157";
+    sha256 = "0d0pbnkw2gb11dn30ggfl91lhdxv86kd1fyiqn170w08n0gi805f";
   };
 
   buildInputs = [ ocaml findlib camlp5 ];
 
-  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
-  '';
-
   installPhase = ''
     mkdir -p "$out/lib/hol_light" "$out/bin"
     cp -a  . $out/lib/hol_light
@@ -45,6 +37,6 @@ can extend it with new theorems and inference rules without compromising its
 soundness.
     '';
     homepage = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
-    license = "BSD";
+    license = stdenv.lib.licenses.bsd2;
   };
 }
diff --git a/pkgs/applications/science/logic/iprover/default.nix b/pkgs/applications/science/logic/iprover/default.nix
index 91d8c122a8d..2fb9678b832 100644
--- a/pkgs/applications/science/logic/iprover/default.nix
+++ b/pkgs/applications/science/logic/iprover/default.nix
@@ -13,7 +13,7 @@ let
     baseName="iprover";
     version="0.8.1";
     name="${baseName}_v${version}";
-    url="${baseName}.googlecode.com/files/${name}.tar.gz";
+    url="http://${baseName}.googlecode.com/files/${name}.tar.gz";
     hash="15qn523w4l296np5rnkwi50a5x2xqz0kaza7bsh9bkazph7jma7w";
   };
 in
@@ -23,7 +23,7 @@ rec {
     sha256 = sourceInfo.hash;
   };
 
-  inherit (sourceInfo) name version;
+  name = "${sourceInfo.baseName}-${sourceInfo.version}";
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
diff --git a/pkgs/applications/science/logic/isabelle/default.nix b/pkgs/applications/science/logic/isabelle/default.nix
index 4a268cac645..a7c1420cb54 100644
--- a/pkgs/applications/science/logic/isabelle/default.nix
+++ b/pkgs/applications/science/logic/isabelle/default.nix
@@ -2,23 +2,22 @@
 # nettools needed for hostname
 
 let
-  pname = "Isabelle";
-  version = "2011";
-  name = "${pname}${version}";
+  dirname = "Isabelle2013";
   theories = ["HOL" "FOL" "ZF"];
 in
 
 stdenv.mkDerivation {
-  inherit name theories;
+  name = "isabelle-2013";
+  inherit dirname theories;
 
   src = fetchurl {
-    url = http://isabelle.in.tum.de/website-Isabelle2011/dist/Isabelle2011.tar.gz;
-    sha256 = "ea85eb2a859891be387f020b2e45f8c9a0bd1d8bbc3902f28a429e9c61cb0b6a";
+    url = http://isabelle.in.tum.de/dist/Isabelle2013_linux.tar.gz;
+    sha256 = "0l17s41hwzma0q2glpxrzic8i6mqd9b7awlpwhz0jkli7fj6ny7b";
   };
 
   buildInputs = [ perl polyml nettools ];
 
-  sourceRoot = name;
+  sourceRoot = dirname;
 
   patches = [ ./settings.patch ];
 
@@ -42,8 +41,8 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p $out/bin
-    mv $TMP/$name $out
-    cd $out/$name
+    mv $TMP/$dirname $out
+    cd $out/$dirname
     bin/isabelle install -p $out/bin
   '';
 
diff --git a/pkgs/applications/science/logic/leo2/default.nix b/pkgs/applications/science/logic/leo2/default.nix
index 6b17d7e8f50..913171827af 100644
--- a/pkgs/applications/science/logic/leo2/default.nix
+++ b/pkgs/applications/science/logic/leo2/default.nix
@@ -23,7 +23,7 @@ rec {
     sha256 = sourceInfo.hash;
   };
 
-  inherit (sourceInfo) name version;
+  name = "${sourceInfo.baseName}-${sourceInfo.version}";
   inherit buildInputs;
 
   phaseNames = ["makeInstallationDir" "doUnpack" "doMake" "doFinalize"];
diff --git a/pkgs/applications/science/logic/logisim/default.nix b/pkgs/applications/science/logic/logisim/default.nix
new file mode 100644
index 00000000000..009bed3ffe2
--- /dev/null
+++ b/pkgs/applications/science/logic/logisim/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, jre }:
+
+let version = "2.7.1"; in
+
+stdenv.mkDerivation {
+  name = "logisim-${version}";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/project/circuit/2.7.x/${version}/logisim-generic-${version}.jar";
+    sha256 = "1hkvc9zc7qmvjbl9579p84hw3n8wl3275246xlzj136i5b0phain";
+  };
+  
+  phases = [ "installPhase" ];
+  
+  installPhase = ''
+    mkdir -pv $out/bin
+    cp -v $src $out/logisim.jar
+    
+    cat > $out/bin/logisim << EOF
+    #!${stdenv.shell}
+    ${jre}/bin/java -jar $out/logisim.jar
+    EOF
+    
+    chmod +x $out/bin/logisim
+  '';
+  
+  meta = {
+    homepage = "http://ozark.hendrix.edu/~burch/logisim";
+    description = "Logisim is an educational tool for designing and simulating digital logic circuits.";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/applications/science/logic/opensmt/default.nix b/pkgs/applications/science/logic/opensmt/default.nix
index 165c8a2f148..430537fd57f 100644
--- a/pkgs/applications/science/logic/opensmt/default.nix
+++ b/pkgs/applications/science/logic/opensmt/default.nix
@@ -15,7 +15,7 @@ let
     version="20101017";
     name="${baseName}-${version}";
     filename="${baseName}_src_${version}";
-    url="${baseName}.googlecode.com/files/${filename}.tgz";
+    url="http://${baseName}.googlecode.com/files/${filename}.tgz";
     hash="0xrky7ixjaby5x026v7hn72xh7d401w9jhccxjn0khhn1x87p2w1";
   };
 in
diff --git a/pkgs/applications/science/logic/otter/default.nix b/pkgs/applications/science/logic/otter/default.nix
new file mode 100644
index 00000000000..653c5dad03f
--- /dev/null
+++ b/pkgs/applications/science/logic/otter/default.nix
@@ -0,0 +1,47 @@
+{stdenv, fetchurl, tcsh, libXaw, libXt, libX11}:
+let
+  s = # Generated upstream information
+  rec {
+    version = "3.3f";
+    name = "otter";
+    url = "http://www.cs.unm.edu/~mccune/otter/otter-${version}.tar.gz";
+    sha256 = "16mc1npl7sk9cmqhrf3ghfmvx29inijw76f1b1lsykllaxjqqb1r";
+  };
+  buildInputs = [
+    tcsh libXaw libXt libX11
+  ];
+in
+stdenv.mkDerivation {
+  name = "${s.name}-${s.version}";
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  buildPhase = ''
+    find . -name Makefile | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g"
+    find . -name Makefile | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g"
+    find . -perm +111 -type f | xargs sed -i -e "s@/bin/csh@$(type -P csh)@g"
+    find . -perm +111 -type f | xargs sed -i -e "s@/bin/rm@$(type -P rm)@g"
+    find . -perm +111 -type f | xargs sed -i -e "s@/bin/mv@$(type -P mv)@g"
+
+    sed -i -e "s/^XLIBS *=.*/XLIBS=-lXaw -lXt -lX11/" source/formed/Makefile 
+
+    make all
+    make -C examples all
+    make -C examples-mace2 all
+    make -C source/formed realclean
+    make -C source/formed formed
+  '';
+  installPhase = ''
+    mkdir -p "$out"/{bin,share/otter}
+    cp bin/* source/formed/formed "$out/bin/"
+    cp -r examples examples-mace2 documents README* Legal Changelog Contents index.html "$out/share/otter/"
+  '';
+  meta = {
+    inherit (s) version;
+    description = "A reliable first-order theorem prover";
+    license = stdenv.lib.licenses.publicDomain ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/logic/prover9/default.nix b/pkgs/applications/science/logic/prover9/default.nix
index 7ac3831f6a5..93b1657aa14 100644
--- a/pkgs/applications/science/logic/prover9/default.nix
+++ b/pkgs/applications/science/logic/prover9/default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "prover9";
+  name = "prover9-2009-11a";
 
   src = fetchurl {
     url = http://www.cs.unm.edu/~mccune/mace4/download/LADR-2009-11A.tar.gz;
diff --git a/pkgs/applications/science/logic/ssreflect/default.nix b/pkgs/applications/science/logic/ssreflect/default.nix
index c554b5dcea1..764954f54f8 100644
--- a/pkgs/applications/science/logic/ssreflect/default.nix
+++ b/pkgs/applications/science/logic/ssreflect/default.nix
@@ -6,7 +6,7 @@
 
 let
   pname = "ssreflect";
-  version = "1.3pl4";
+  version = "1.4";
   name = "${pname}-${version}";
   webpage = http://www.msr-inria.inria.fr/Projects/math-components;
 in
@@ -15,22 +15,16 @@ stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "${webpage}/${name}.tar.gz";
-    sha256 = "1ha3iiqq79pgll5ra9z0xdi3d3dr3wb9f5vsm4amy884l5anva02";
+    url = "${webpage}/${name}-coq8.4.tar.gz";
+    sha256 = "1ysx29xw09i86lq0d92z9cnyx133jfgq4qddy3501000fn7xwi7h";
   };
 
   buildInputs = [ ocaml camlp5 coq makeWrapper ];
 
   patches = [ ./static.patch ];
 
-  postBuild = ''
-    cd src
-    coqmktop -ide -opt ssreflect.cmx -o ../bin/ssrcoqide
-    cd ..
-  '';
-
   installPhase = ''
-    COQLIB=$out/lib/coq make -f Makefile.coq install -e
+    COQLIB=$out/lib/coq/ make -f Makefile.coq install -e
     mkdir -p $out/bin
     cp bin/* $out/bin
     for i in $out/bin/*; do
@@ -39,6 +33,7 @@ stdenv.mkDerivation {
         --add-flags "$out/lib/coq/user-contrib/Ssreflect" \
         --add-flags "Ssreflect"
     done
+    makeWrapper "${coq}/bin/coqide" "$out/bin/ssrcoqide" --add-flags "-coqtop" --add-flags "$out/bin/ssrcoq"
   '';
 
   meta = {
diff --git a/pkgs/applications/science/logic/ssreflect/static.patch b/pkgs/applications/science/logic/ssreflect/static.patch
index edb8a6111f7..2211d880258 100644
--- a/pkgs/applications/science/logic/ssreflect/static.patch
+++ b/pkgs/applications/science/logic/ssreflect/static.patch
@@ -1,33 +1,21 @@
---- ssreflect1.3pl4/Make	(revision 3823)
-+++ ssreflect1.3pl4/Make	(working copy)
-@@ -1,18 +1,18 @@
- ## Uncomment for static linking
- ## <static>
--#
--#-custom "$(COQBIN)coqmktop -opt -o bin/ssrcoq src/ssreflect.cmx" "src/ssreflect.cmx" bin/ssrcoq
--#-custom "$(COQBIN)coqmktop -o bin/ssrcoq.byte src/ssreflect.cmo" "src/ssreflect.cmo bin/ssrcoq" bin/ssrcoq.byte
+--- ssreflect1.4-coq8.4/Make	(revision 3823)
++++ ssreflect1.4-coq8.4/Make	(working copy)
+@@ -1,10 +1,10 @@
+-### Uncomment for static linking
+-##
+-#-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -opt -o bin/ssrcoq src/ssrmatching.cmx src/ssreflect.cmx" "src/ssrmatching.cmx src/ssreflect.cmx" bin/ssrcoq
+-#-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -o bin/ssrcoq.byte src/ssrmatching.cmo src/ssreflect.cmo" "src/ssrmatching.cmo src/ssreflect.cmo" bin/ssrcoq.byte
 -#-custom "$(SSRCOQ) $(COQFLAGS) -compile $*" "%.v $(SSRCOQ)" "%.vo"
 -#SSRCOQ = bin/ssrcoq
--#
-+
-+-custom "$(COQBIN)coqmktop -opt -o bin/ssrcoq src/ssreflect.cmx" "src/ssreflect.cmx" bin/ssrcoq
-+-custom "$(COQBIN)coqmktop -o bin/ssrcoq.byte src/ssreflect.cmo" "src/ssreflect.cmo bin/ssrcoq" bin/ssrcoq.byte
+-##
++## Uncomment for static linking
++#
++-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -opt -o bin/ssrcoq src/ssrmatching.cmx src/ssreflect.cmx" "src/ssrmatching.cmx src/ssreflect.cmx" bin/ssrcoq
++-custom "$(COQBIN)coqmktop -coqlib `$(COQBIN)coqtop -where` -o bin/ssrcoq.byte src/ssrmatching.cmo src/ssreflect.cmo" "src/ssrmatching.cmo src/ssreflect.cmo" bin/ssrcoq.byte
 +-custom "$(SSRCOQ) $(COQFLAGS) -compile $*" "%.v $(SSRCOQ)" "%.vo"
 +SSRCOQ = bin/ssrcoq
-+
- ## </static>
- 
- ## Uncomment for dynamic linking
- ## <dynamic>
--
---I src
--
-+#
-+#-I src
 +#
- ## </dynamic>
  
  ## What follows should be left untouched by the final user of ssreflect
-Common subdirectories: old/src and new/src
-Common subdirectories: old/test and new/test
-Common subdirectories: old/theories and new/theories
+ -R theories Ssreflect
+
diff --git a/pkgs/applications/science/logic/tptp/default.nix b/pkgs/applications/science/logic/tptp/default.nix
index 87a32006713..5c8cb720324 100644
--- a/pkgs/applications/science/logic/tptp/default.nix
+++ b/pkgs/applications/science/logic/tptp/default.nix
@@ -14,7 +14,7 @@ let
     version="5.4.0";
     name="${baseName}-${version}";
     url="http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz";
-    hash="0nyq2kkiphwgj3hczc7zglzqjj6hxxsh6zcygpy4yhxh9a9rpkg1";
+    hash="0rvrmh3vw4bk7mj29bx1pi76g2bsqyc13gsnpa1cbjs5pzyhm780";
   };
 in
 rec {
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
new file mode 100644
index 00000000000..5ceefb87af0
--- /dev/null
+++ b/pkgs/applications/science/math/R/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, blas, bzip2, gfortran, liblapack, libX11, libXmu, libXt
+, libjpeg, libpng, libtiff, ncurses, pango, pcre, perl, readline, tcl
+, texLive, tk, xz, zlib, less, texinfo, graphviz
+}:
+
+stdenv.mkDerivation rec {
+  name = "R-3.0.1";
+
+  src = fetchurl {
+    url = "http://ftp5.gwdg.de/pub/misc/cran/src/base/R-3/${name}.tar.gz";
+    sha256 = "0d3iv382bsyz6ad5fk382x7sy3qzgpqvd0fw26r0648lyf54i45g";
+  };
+
+  buildInputs = [ blas bzip2 gfortran liblapack libX11 libXmu libXt
+    libXt libjpeg libpng libtiff ncurses pango pcre perl readline tcl
+    texLive tk xz zlib less texinfo graphviz ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "a free software environment for statistical computing and graphics";
+    homepage = "http://www.r-project.org/";
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/math/ginac/default.nix b/pkgs/applications/science/math/ginac/default.nix
index 081d2bd6253..9bffc5548dd 100644
--- a/pkgs/applications/science/math/ginac/default.nix
+++ b/pkgs/applications/science/math/ginac/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ cln ];
   buildInputs = [ readline ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--disable-rpath";
 
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index 41c21f94b01..d644a1633cb 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -2,7 +2,7 @@
 
 let
   name    = "maxima";
-  version = "5.27.0";
+  version = "5.29.1";
 
   searchPath =
     stdenv.lib.makeSearchPath "bin"
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "9006803714f1385221c4395697fad53f125a13d29b50b188d045d08e25f8dca7";
+    sha256 = "1p94l28adcn0826nah460r9pz71h7wd5klsg885sl2gzds75bn74";
   };
 
   buildInputs = [sbcl texinfo perl makeWrapper];
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index 52048dc9d19..e9e6ca7bead 100644
--- a/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/pkgs/applications/science/math/wxmaxima/default.nix
@@ -2,14 +2,14 @@
 
 let
   name    = "wxmaxima";
-  version = "12.04.0";
+  version = "13.04.1";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/${name}/wxMaxima-${version}.tar.gz";
-    sha256 = "60110507e0a63738a1f420b22697eaac9bea3866122e072dcd697077e8744824";
+    url = "mirror://sourceforge/${name}/wxMaxima/${version}/wxMaxima-${version}.tar.gz";
+    sha256 = "0irp1m9vr50ym7wfj1c1vbrzd2pip1vmvn9ykqsdf04afkkwkran";
   };
 
   buildInputs = [wxGTK maxima makeWrapper];
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
     description = "Cross platform GUI for the computer algebra system Maxima.";
     license = "GPL2";
     homepage = http://wxmaxima.sourceforge.net;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix
index 7b97e1a82c0..acc4740eb6b 100644
--- a/pkgs/applications/science/math/yacas/default.nix
+++ b/pkgs/applications/science/math/yacas/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # Perl is only for the documentation
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   patches = [ ./gcc43.patch ];
 
diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix
index 5cc79469b76..9d8bc705fa4 100644
--- a/pkgs/applications/science/misc/boinc/default.nix
+++ b/pkgs/applications/science/misc/boinc/default.nix
@@ -1,18 +1,20 @@
-{ fetchsvn, stdenv, autoconf, automake, pkgconfig, m4, curl,
-mesa, libXmu, libXi, freeglut, libjpeg, libtool, wxGTK,
-sqlite, gtk, patchelf, libXScrnSaver, libnotify, libX11 }:
+{ fetchgit, stdenv, autoconf, automake, pkgconfig, m4, curl,
+mesa, libXmu, libXi, freeglut, libjpeg, libtool, wxGTK, xcbutil,
+sqlite, gtk, patchelf, libXScrnSaver, libnotify, libX11, libxcb }:
 
 stdenv.mkDerivation rec {
-  name = "boinc-6.12.39";
+  name = "boinc-7.0.44";
 
-  src = fetchsvn {
-    url = "http://boinc.berkeley.edu/svn/tags/boinc_core_release_6_12_39";
-    rev = 24341;
-    sha256 = "158fkm4mr7wljsy8gav20km8jamf00mxjk1wsiqw6kx62bih37yb";
+  src = fetchgit {
+    url = "git://boinc.berkeley.edu/boinc.git";
+    rev = "7c449b1fb8a681ceb27d6895751b62a2b3adf0f2";
+    sha256 = "0hdramyl9nip3gadp7xiaz8ngyld15i93d8ai1nsd04bmrvdfqia";
   };
 
   buildInputs = [ libtool automake autoconf m4 pkgconfig curl mesa libXmu libXi
-    freeglut libjpeg wxGTK sqlite gtk libXScrnSaver libnotify patchelf libX11 ];
+    freeglut libjpeg wxGTK sqlite gtk libXScrnSaver libnotify patchelf libX11 
+    libxcb xcbutil
+  ];
 
   postConfigure = ''
     sed -i -e s,/etc,$out/etc, client/scripts/Makefile
@@ -27,17 +29,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  configureFlags = "--disable-server --disable-fast-install";
-
-  postInstall = "
-    # Remove a leading rpath to /tmp/... I don't know how it got there
-    # I could not manage to get rid of that through autotools.
-    for a in $out/bin/*; do
-      RPATH=$(patchelf --print-rpath $a)
-      NEWRPATH=$(echo $RPATH | sed 's/^[^:]*://')
-      patchelf --set-rpath $out/lib:$NEWRPATH $a
-    done
-  ";
+  configureFlags = "--disable-server";
 
   meta = {
     description = "Free software for distributed and grid computing";
diff --git a/pkgs/applications/science/misc/golly/src-for-default.nix b/pkgs/applications/science/misc/golly/src-for-default.nix
index bf0d9ddada4..00038373d56 100644
--- a/pkgs/applications/science/misc/golly/src-for-default.nix
+++ b/pkgs/applications/science/misc/golly/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="2.3-src";
-   name="golly-2.3-src";
-   hash="12r1lrrn4c1kafzvz5mmfq3750smqv5dwl1xpj3753h0rl9a9gx1";
-   url="http://downloads.sourceforge.net/project/golly/golly/golly-2.3/golly-2.3-src.tar.gz";
-   advertisedUrl="http://downloads.sourceforge.net/project/golly/golly/golly-2.3/golly-2.3-src.tar.gz";
+   version="2.4-src";
+   name="golly-2.4-src";
+   hash="06vajm019q4q4wfy6pc1669fbjqdb4jaxcc419bk0vzky40anl9w";
+   url="http://downloads.sourceforge.net/project/golly/golly/golly-2.4/golly-2.4-src.tar.gz";
+   advertisedUrl="http://downloads.sourceforge.net/project/golly/golly/golly-2.4/golly-2.4-src.tar.gz";
   
   
 }
diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix
index 52b93c8e174..1402dc9b182 100644
--- a/pkgs/applications/science/misc/tulip/default.nix
+++ b/pkgs/applications/science/misc/tulip/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libxml2 freetype glew mesa qt4 libjpeg ];
 
-  buildNativeInputs = [ cmake makeWrapper ];
+  nativeBuildInputs = [ cmake makeWrapper ];
 
   # FIXME: "make check" needs Docbook's DTD 4.4, among other things.
   doCheck = false;
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
new file mode 100644
index 00000000000..c687fd5908c
--- /dev/null
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -0,0 +1,46 @@
+
+{ stdenv, fetchurl, cmake,
+  singlePrec ? true,
+  fftw
+}:
+
+
+stdenv.mkDerivation {
+  name = "gromacs-4.5.5";
+
+  src = fetchurl {
+    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-4.5.5.tar.gz";
+    md5 = "6a87e7cdfb25d81afa9fea073eb28468";
+  };
+
+  buildInputs = [cmake fftw];
+
+  cmakeFlags = ''
+    ${if singlePrec then "-DGMX_DOUBLE=OFF" else "-DGMX_DOUBLE=ON -DGMX_DEFAULT_SUFFIX=OFF"}
+  '';
+
+  meta = {
+    homepage    = "http://www.gromacs.org";
+    licence     = "GPLv2";
+    description = "The GROMACS molecular dynamics software package";
+    longDescription = ''
+      GROMACS is a versatile package to perform molecular dynamics,
+      i.e. simulate the Newtonian equations of motion for systems
+      with hundreds to millions of particles.
+
+      It is primarily designed for biochemical molecules like
+      proteins, lipids and nucleic acids that have a lot of
+      complicated bonded interactions, but since GROMACS is
+      extremely fast at calculating the nonbonded interactions (that
+      usually dominate simulations) many groups are also using it
+      for research on non-biological systems, e.g. polymers.
+
+      GROMACS supports all the usual algorithms you expect from a
+      modern molecular dynamics implementation, (check the online
+      reference or manual for details), but there are also quite a
+      few features that make it stand out from the competition.
+
+      See: http://www.gromacs.org/About_Gromacs for details.
+    '';
+  };
+}
diff --git a/pkgs/applications/science/spyder/default.nix b/pkgs/applications/science/spyder/default.nix
new file mode 100644
index 00000000000..cd2bd4fecf3
--- /dev/null
+++ b/pkgs/applications/science/spyder/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, unzip, buildPythonPackage, makeDesktopItem
+# mandatory
+, pyside
+# recommended
+, pyflakes ? null, rope ? null, sphinx ? null, numpy ? null, scipy ? null, matplotlib ? null
+# optional
+, ipython ? null, pylint ? null, pep8 ? null
+}:
+
+buildPythonPackage rec {
+  name = "spyder-2.1.13.1";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "https://spyderlib.googlecode.com/files/${name}.zip";
+    sha256 = "1sg88shvw6k2v5428k13mah4pyqng43856rzr6ypz5qgwn0677ya";
+  };
+
+  buildInputs = [ unzip ];
+  propagatedBuildInputs =
+    [ pyside pyflakes rope sphinx numpy scipy matplotlib ipython pylint pep8 ];
+
+  # There is no test for spyder
+  doCheck = false;
+
+  desktopItem = makeDesktopItem {
+    name = "Spyder";
+    exec = "spyder";
+    icon = "spyder";
+    comment = "Scientific Python Development Environment";
+    desktopName = "Spyder";
+    genericName = "Python IDE";
+    categories = "Application;Development;Editor;IDE;";
+  };
+
+  # Create desktop item
+  postInstall = ''
+    mkdir -p $out/share/applications
+    cp $desktopItem/share/applications/* $out/share/applications/
+
+    mkdir -p $out/share/icons
+    cp spyderlib/images/spyder.svg $out/share/icons/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Scientific PYthon Development EnviRonment (SPYDER)";
+    longDescription = ''
+      Spyder (previously known as Pydee) is a powerful interactive development
+      environment for the Python language with advanced editing, interactive
+      testing, debugging and introspection features.
+    '';
+    homepage = https://code.google.com/p/spyderlib/;
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/applications/search/doodle/default.nix b/pkgs/applications/search/doodle/default.nix
new file mode 100644
index 00000000000..a6b3ac7ccfd
--- /dev/null
+++ b/pkgs/applications/search/doodle/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, libextractor, gettext }:
+
+stdenv.mkDerivation rec {
+  name = "doodle-0.7.0";
+
+  buildInputs = [ libextractor gettext ];
+
+  src = fetchurl {
+    url = "http://grothoff.org/christian/doodle/download/${name}.tar.gz";
+    sha256 = "0ayx5q7chzll9sv3miq35xl36r629cvgdzphf379kxzlzhjldy3j";
+  };
+
+  meta = {
+    homepage = http://grothoff.org/christian/doodle/;
+    description = "Tool to quickly index and search documents on a computer";
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/search/recoll/default.nix b/pkgs/applications/search/recoll/default.nix
new file mode 100644
index 00000000000..6bfa7c7905b
--- /dev/null
+++ b/pkgs/applications/search/recoll/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchurl
+, qt4, xapian, file, python
+, djvulibre, groff, libxslt, unzip, xpdf, antiword, catdoc, lyx
+, ghostscript, gawk, gnugrep, gnused, gnutar, gzip, libiconvOrLibc }:
+
+assert stdenv.system != "powerpc-linux";
+
+stdenv.mkDerivation rec {
+  ver = "1.18.1";
+  name = "recoll-${ver}";
+
+  src = fetchurl {
+    url = "http://www.lesbonscomptes.com/recoll/${name}.tar.gz";
+    sha256 = "0cyrkx5aza3485avb2kxc6cbsqqrb32l1kq8ravr9d828331v84f";
+  };
+
+  configureFlags = [ "--with-inotify" ];
+
+  buildInputs = [ qt4 xapian file python ];
+
+  # the filters search through ${PATH} using a sh proc 'checkcmds' for the
+  # filtering utils. Short circuit this by replacing the filtering command with
+  # the absolute path to the filtering command. 
+  postInstall = ''
+    for f in $out/share/recoll/filters/* ; do
+      substituteInPlace  $f --replace antiword      ${antiword}/bin/antiword
+      substituteInPlace  $f --replace awk           ${gawk}/bin/awk
+      substituteInPlace  $f --replace catppt        ${catdoc}/bin/catppt
+      substituteInPlace  $f --replace djvused       ${djvulibre}/bin/djvused
+      substituteInPlace  $f --replace djvutxt       ${djvulibre}/bin/djvutxt
+      substituteInPlace  $f --replace grep          ${gnugrep}/bin/grep
+      substituteInPlace  $f --replace groff         ${groff}/bin/groff
+      substituteInPlace  $f --replace gunzip        ${gzip}/bin/gunzip
+      substituteInPlace  $f --replace iconv         ${libiconvOrLibc}/bin/iconv
+      substituteInPlace  $f --replace lyx           ${lyx}/bin/lyx
+      substituteInPlace  $f --replace pdftotext     ${xpdf}/bin/pdftotext
+      substituteInPlace  $f --replace pstotext      ${ghostscript}/bin/ps2ascii 
+      substituteInPlace  $f --replace sed           ${gnused}/bin/sed
+      substituteInPlace  $f --replace tar           ${gnutar}/bin/tar
+      substituteInPlace  $f --replace unzip         ${unzip}/bin/unzip
+      substituteInPlace  $f --replace xls2csv       ${catdoc}/bin/xls2csv
+      substituteInPlace  $f --replace xsltproc      ${libxslt}/bin/xsltproc
+    done
+  '';
+    # TODO:
+    #substituteInPlace  $f --replace unrtf         ${unrtf}/bin/unrtf 
+    #substituteInPlace  $f --replace untex         ${untex}/bin/untex
+    #substituteInPlace  $f --replace wpd2html      ${wpd2html}/bin/wpd2html
+
+  meta = {
+    description = "finds keywords inside documents as well as file names";
+    longDescription = ''
+      Recoll is an Xapian frontend that can search through files, archive
+      members, email attachments. 
+    '';
+    homepage = http://www.lesbonscomptes.com/recoll/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/applications/taxes/aangifte-2012/default.nix b/pkgs/applications/taxes/aangifte-2012/default.nix
new file mode 100644
index 00000000000..8f36fd485dd
--- /dev/null
+++ b/pkgs/applications/taxes/aangifte-2012/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, makeWrapper, xdg_utils, libX11, libXext, libSM }:
+
+stdenv.mkDerivation {
+  name = "aangifte2012-1";
+
+  src = fetchurl {
+    url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2012_linux.tar.gz;
+    sha256 = "05bahvk514lncgfr9kybcafahyz1rgfpwp5cykchxbbc033zm0xy";
+  };
+
+  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 =
+    ''
+      mkdir -p $out
+      cp -prvd * $out/
+      wrapProgram $out/bin/ib2012ux --prefix PATH : ${xdg_utils}/bin \
+                                    --prefix LD_PRELOAD : $(cat $NIX_GCC/nix-support/orig-gcc)/lib/libgcc_s.so.1
+    '';
+
+  meta = {
+    description = "Elektronische aangifte IB 2012 (Dutch Tax Return Program)";
+    url = http://www.belastingdienst.nl/particulier/aangifte2012/download/;
+  };
+}
diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix
index 856320f0168..1eb114ecd8c 100644
--- a/pkgs/applications/version-management/bazaar/default.nix
+++ b/pkgs/applications/version-management/bazaar/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, pythonPackages }:
 
 stdenv.mkDerivation rec {
-  version = "2.3";
+  version = "2.5";
   release = ".1";
   name = "bazaar-${version}${release}";
 
   src = fetchurl {
     url = "http://launchpad.net/bzr/${version}/${version}${release}/+download/bzr-${version}${release}.tar.gz";
-    sha256 = "07kx41w4gqv68bcykdflsg68wvpmcyqknzyb4vr1zqlf27hahp53";
+    sha256 = "10krjbzia2avn09p0cdlbx2wya0r5v11w5ymvyl72af5dkx4cwwn";
   };
 
   buildInputs = [ pythonPackages.python pythonPackages.wrapPython ];
diff --git a/pkgs/applications/version-management/darcs/bash-completion.patch b/pkgs/applications/version-management/darcs/bash-completion.patch
deleted file mode 100644
index 8944ebeb9cb..00000000000
--- a/pkgs/applications/version-management/darcs/bash-completion.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-diff --git a/darcs-2.0.0/tools/darcs_completion b/darcs-2.0.0/tools/darcs_completion
-index 10628db..e36476e 100644
---- a/tools/darcs_completion
-+++ b/tools/darcs_completion
-@@ -3,7 +3,6 @@
- # darcs command line completion.
- # Copyright 2002 "David Roundy" <droundy@abridgegame.org>
- #
--have darcs &&
- _darcs()
- {
-     local cur
-@@ -48,5 +47,5 @@ _darcs()
-     return 0
- 
- }
--[ "$have" ] && complete -F _darcs -o default darcs
-+complete -F _darcs -o default darcs
- 
diff --git a/pkgs/applications/version-management/darcs/default.nix b/pkgs/applications/version-management/darcs/default.nix
index 53cb4b360a0..468e45fcff1 100644
--- a/pkgs/applications/version-management/darcs/default.nix
+++ b/pkgs/applications/version-management/darcs/default.nix
@@ -1,20 +1,25 @@
 { cabal, curl, extensibleExceptions, filepath, hashedStorage
 , haskeline, html, HTTP, mmap, mtl, network, parsec, random
-, regexCompat, tar, terminfo, text, vector, zlib
+, regexCompat, tar, terminfo, text, utf8String, vector, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "darcs";
-  version = "2.8.1";
-  sha256 = "1fz9k9zihb0fz0w2y55iqa1fd604nxzz48r62sx3ixxn8qqsvrd1";
+  version = "2.8.4";
+  sha256 = "164zclgib9ql4rqykpdhhk2bad0m5v0k0iwzsj0z7nax5nxlvarz";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
     extensibleExceptions filepath hashedStorage haskeline html HTTP
-    mmap mtl network parsec random regexCompat tar terminfo text vector
-    zlib
+    mmap mtl network parsec random regexCompat tar terminfo text
+    utf8String vector zlib
   ];
   extraLibraries = [ curl ];
+  postInstall = ''
+    mkdir -p $out/etc/bash_completion.d
+    mv contrib/darcs_completion $out/etc/bash_completion.d/darcs
+  '';
+  doCheck = false;
   meta = {
     homepage = "http://darcs.net/";
     description = "a distributed, interactive, smart revision control system";
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 325d2e77e1a..368557e3c2c 100644
--- a/pkgs/applications/version-management/fossil/default.nix
+++ b/pkgs/applications/version-management/fossil/default.nix
@@ -1,20 +1,24 @@
 {stdenv, fetchurl, zlib, openssl, tcl, readline, sqlite}:
 
 stdenv.mkDerivation {
-  name = "fossil-1.21";
+  name = "fossil-1.24";
 
   src = fetchurl {
-    url = http://www.fossil-scm.org/download/fossil-src-20111213135356.tar.gz;
-    sha256 = "07g78sf26v7zr4qzcwky4h4zzaaz8apy33d35bhc5ax63z6md1f9";
+    url = http://www.fossil-scm.org/download/fossil-src-20121022124804.tar.gz;
+    sha256 = "0gcvcrd368acxd79gh7p7caicgqd0f076n0i2if63mg3b8ivz9im";
   };
 
   buildInputs = [ zlib openssl readline sqlite ];
-  buildNativeInputs = [ tcl ];
+  nativeBuildInputs = [ tcl ];
 
   doCheck = true;
 
   checkTarget = "test";
 
+  preBuild=''
+    export USER=nonexistent-but-specified-user
+  '';
+
   installPhase = ''
     mkdir -p $out/bin
     INSTALLDIR=$out/bin make install
diff --git a/pkgs/applications/version-management/git-and-tools/cgit/default.nix b/pkgs/applications/version-management/git-and-tools/cgit/default.nix
new file mode 100644
index 00000000000..63dd56d7e33
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/cgit/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, openssl, zlib, asciidoc, libxml2, libxslt, docbook_xml_xslt }:
+
+stdenv.mkDerivation rec {
+  name = "cgit-0.9.2";
+
+  src = fetchurl {
+    url = "http://git.zx2c4.com/cgit/snapshot/${name}.tar.xz";
+    sha256 = "0q177q1r7ssna32c760l4dx6p4aaz6kdv27zn2jb34bx98045h08";
+  };
+
+  # cgit is is tightly coupled with git and needs a git source tree to build.
+  # The cgit-0.9.2 Makefile has GIT_VER = 1.8.3, so use that version.
+  # IMPORTANT: Remember to check which git version cgit needs on every version
+  # bump.
+  gitSrc = fetchurl {
+    url = https://git-core.googlecode.com/files/git-1.8.3.tar.gz;
+    sha256 = "0fn5xdx30dl8dl1cdpqif5hgc3qnxlqfpwyhm0sm1wgqhgbcdlzi";
+  };
+
+  buildInputs = [ openssl zlib asciidoc libxml2 libxslt docbook_xml_xslt ];
+
+  # Give cgit a git source tree and pass configuration parameters (as make
+  # variables).
+  preBuild = ''
+    mkdir -p git
+    tar --strip-components=1 -xf "$gitSrc" -C git
+
+    makeFlagsArray+=(prefix="$out" CGIT_SCRIPT_PATH="$out/cgit/")
+  '';
+
+  # Install manpage.
+  postInstall = ''
+    # xmllint fails:
+    #make install-man
+
+    # bypassing xmllint works:
+    a2x --no-xmllint -f manpage cgitrc.5.txt
+    mkdir -p "$out/share/man/man5"
+    cp cgitrc.5 "$out/share/man/man5"
+  '';
+
+  meta = {
+    homepage = http://git.zx2c4.com/cgit/about/;
+    description = "Web frontend for git repositories";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ bjornfor ];
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix b/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix
new file mode 100644
index 00000000000..115424ac69c
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix
@@ -0,0 +1,79 @@
+{ stdenv, fetchgit, ruby, gnugrep, diffutils, git, darcs }:
+
+stdenv.mkDerivation rec {
+  name = "darcs-to-git-${version}";
+  version = "0.2git";
+
+  src = fetchgit {
+    url = "git://github.com/purcell/darcs-to-git.git";
+    rev = "58a55936899c7e391df5ae1326c307fbd4617a25";
+    sha256 = "366aa691920991e21cfeebd4cbd53a6c42d80e2bc46ff398af482d1d15bac4c3";
+  };
+
+  patchPhase = let
+    matchExecution = ''(\<(output_of|system|run)\([^"%]*("|%w\()|^[^"`]*`)'';
+  in ''
+    sed -r -i \
+      -e '1s|^#!.*|#!${ruby}/bin/ruby|' \
+      -e 's!${matchExecution}git\>!\1${git}/bin/git!' \
+      -e 's!${matchExecution}darcs\>!\1${darcs}/bin/darcs!' \
+      -e 's!${matchExecution}diff\>!\1${diffutils}/bin/diff!' \
+      -e 's!\<egrep\>!${gnugrep}/bin/egrep!g' \
+      -e 's!%w\(darcs init\)!%w(${darcs}/bin/darcs init)!' \
+      darcs-to-git
+  '';
+
+  installPhase = ''
+    install -vD darcs-to-git "$out/bin/darcs-to-git"
+  '';
+
+  doCheck = true;
+
+  checkPhase = ''
+    orig_dir="$(pwd)"
+    darcs_repos="$(pwd)/darcs_test_repos"
+    git_repos="$(pwd)/git_test_repos"
+    test_home="$(pwd)/test_home"
+    mkdir "$darcs_repos" "$git_repos" "$test_home"
+    cd "$darcs_repos"
+    ${darcs}/bin/darcs init
+    echo "this is a test file" > new_file1
+    ${darcs}/bin/darcs add new_file1
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c1 -A none
+    echo "testfile1" > new_file1
+    echo "testfile2" > new_file2
+    ${darcs}/bin/darcs add new_file2
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c2 -A none
+    ${darcs}/bin/darcs mv new_file2 only_one_file
+    rm -f new_file1
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c3 -A none
+    cd "$git_repos"
+    HOME="$test_home" PATH= "$orig_dir/darcs-to-git" "$darcs_repos"
+    assertFileContents() {
+      echo -n "File $1 contains '$2'..." >&2
+      if [ "x$(cat "$1")" = "x$2" ]; then
+        echo " passed." >&2
+        return 0
+      else
+        echo " failed: '$(cat "$1")' != '$2'" >&2
+        return 1
+      fi
+    }
+    echo "Checking if converted repository matches original repository:" >&2
+    assertFileContents only_one_file testfile2
+    ${git}/bin/git reset --hard HEAD^
+    assertFileContents new_file1 testfile1
+    assertFileContents new_file2 testfile2
+    ${git}/bin/git reset --hard HEAD^
+    assertFileContents new_file1 "this is a test file"
+    echo "All checks passed." >&2
+    cd "$orig_dir"
+    rm -rf "$darcs_repos" "$git_repos" "$test_home"
+  '';
+
+  meta = {
+    description = "Converts a Darcs repository into a Git repository";
+    homepage = "http://www.sanityinc.com/articles/converting-darcs-repositories-to-git";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index efe4fcb2d7c..fe5aebeb96e 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -10,7 +10,7 @@ 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
-      cpio tcl tk makeWrapper subversionClient;
+      cpio tcl tk makeWrapper subversionClient gzip;
     svnSupport = false;		# for git-svn support
     guiSupport = false;		# requires tcl/tk
     sendEmailSupport = false;	# requires plenty of perl libraries
@@ -42,12 +42,7 @@ rec {
     sendEmailSupport = !stdenv.isDarwin;
   });
 
-  gitAnnex = lib.makeOverridable (import ./git-annex) {
-    inherit stdenv fetchurl libuuid rsync findutils curl perl git ikiwiki which coreutils openssh;
-    inherit (haskellPackages) ghc MissingH utf8String pcreLight SHA dataenc
-      HTTP testpack hS3 mtl network hslogger hxt json liftedBase monadControl IfElse
-      QuickCheck bloomfilter editDistance stm hinotify;
-  };
+  gitAnnex = pkgs.haskellPackages.gitAnnex;
 
   qgit = import ./qgit {
     inherit fetchurl stdenv;
@@ -66,13 +61,18 @@ rec {
   };
 
   topGit = lib.makeOverridable (import ./topgit) {
-    inherit stdenv fetchurl unzip;
+    inherit stdenv fetchurl;
   };
 
   tig = import ./tig {
     inherit stdenv fetchurl ncurses asciidoc xmlto docbook_xsl;
   };
 
+  hub = import ./hub {
+    inherit (rubyLibs) rake;
+    inherit stdenv fetchgit groff makeWrapper;
+  };
+
   gitFastExport = import ./fast-export {
     inherit fetchgit stdenv mercurial coreutils git makeWrapper subversion;
   };
@@ -91,4 +91,6 @@ rec {
   gitSubtree = import ./git-subtree {
     inherit stdenv fetchurl git asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt;
   };
+
+  darcsToGit = callPackage ./darcs-to-git { };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
index 16f62ad50ec..5086f4f31b3 100644
--- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -1,61 +1,57 @@
-{ stdenv, fetchurl, curl, dataenc, findutils, ghc, git, hS3, hslogger, HTTP, hxt
-, ikiwiki, json, libuuid, MissingH, monadControl, mtl, network, pcreLight, perl
-, QuickCheck, rsync, SHA, testpack, utf8String, which, liftedBase, coreutils
-, IfElse, bloomfilter, editDistance, openssh, stm, hinotify
+{ cabal, aeson, async, blazeBuilder, bloomfilter, bup
+, caseInsensitive, clientsession, cryptoApi, curl, dataDefault
+, dataenc, DAV, dbus, dlist, dns, editDistance
+, extensibleExceptions, filepath, git, gnupg1, gnutls, hamlet
+, hinotify, hS3, hslogger, HTTP, httpConduit, httpTypes, HUnit
+, IfElse, json, lsof, MissingH, MonadCatchIOTransformers
+, monadControl, mtl, network, networkInfo, networkMulticast
+, networkProtocolXmpp, openssh, QuickCheck, random, regexTdfa
+, rsync, SafeSemaphore, SHA, stm, text, time, transformers
+, unixCompat, utf8String, uuid, wai, waiLogger, warp, xmlConduit
+, xmlTypes, yesod, yesodDefault, yesodForm, yesodStatic
 }:
 
-let
-  version = "3.20120629";
-in
-stdenv.mkDerivation {
-  name = "git-annex-${version}";
-
-  src = fetchurl {
-    url = "http://git.kitenet.net/?p=git-annex.git;a=snapshot;sf=tgz;h=refs/tags/${version}";
-    sha256 = "0dajcmx1sn3rqlba5b66lkiwji849gxzcb5d8666in21g7lc1ccs";
-    name = "git-annex-${version}.tar.gz";
-  };
-
-  buildInputs = [
-    curl dataenc findutils ghc git hS3 hslogger HTTP hxt ikiwiki json
-    libuuid MissingH monadControl mtl network pcreLight perl QuickCheck
-    rsync SHA testpack utf8String which liftedBase IfElse bloomfilter
-    editDistance openssh stm hinotify
+cabal.mkDerivation (self: {
+  pname = "git-annex";
+  version = "4.20130601";
+  sha256 = "0l6jbi9r26w5h9hfg9v9qybqvijp4n7c9l1zd4ikxg2nqcc8j8ln";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    aeson async blazeBuilder bloomfilter caseInsensitive clientsession
+    cryptoApi dataDefault dataenc DAV dbus dlist dns editDistance
+    extensibleExceptions filepath gnutls hamlet hinotify hS3 hslogger
+    HTTP httpConduit httpTypes HUnit IfElse json MissingH
+    MonadCatchIOTransformers monadControl mtl network networkInfo
+    networkMulticast networkProtocolXmpp QuickCheck random regexTdfa
+    SafeSemaphore SHA stm text time transformers unixCompat utf8String
+    uuid wai waiLogger warp xmlConduit xmlTypes yesod yesodDefault
+    yesodForm yesodStatic
   ];
-
-  checkTarget = "test";
-  doCheck = true;
-
-  # The 'add_url' test fails because it attempts to use the network.
-  preConfigure = ''
-    makeFlagsArray=( PREFIX=$out )
-    sed -i -e 's|#!/usr/bin/perl|#!${perl}/bin/perl|' mdwn2man
-    sed -i -e 's|"cp |"${coreutils}/bin/cp |' -e 's|"rm -f |"${coreutils}/bin/rm -f |' test.hs
+  buildTools = [ bup curl git gnupg1 lsof openssh rsync ];
+  configureFlags = "-fS3
+                    -fWebDAV
+                    -fInotify
+                    -fDbus
+                    -f-Assistant
+                    -f-Webapp
+                    -fPairing
+                    -fXMPP
+                    -fDNS
+                    -fProduction
+                    -fTDFA";
+  preConfigure = "patchShebangs .";
+  checkPhase = ''
+    export HOME="$NIX_BUILD_TOP/tmp"
+    mkdir "$HOME"
+    cp dist/build/git-annex/git-annex git-annex
+    ./git-annex test
   '';
-
   meta = {
     homepage = "http://git-annex.branchable.com/";
-    description = "Manage files with git without checking them into git";
-    license = stdenv.lib.licenses.gpl3Plus;
-
-    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 ];
+    description = "manage files with git, without checking their contents into git";
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.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 066b5a50913..f042b2e0faa 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -1,15 +1,16 @@
-{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio, gnugrep
+{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, python, gettext, cpio, gnugrep, gzip
 , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_45
 , libxslt, tcl, tk, makeWrapper
 , svnSupport, subversionClient, perlLibs, smtpPerlLibs
 , guiSupport
+, withManual ? true
 , pythonSupport ? true
 , sendEmailSupport
 }:
 
 let
 
-  version = "1.7.11.4";
+  version = "1.8.2.3";
 
   svn = subversionClient.override { perlBindings = true; };
 
@@ -20,17 +21,19 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
-    sha256 = "16a1gm256w82j9ardzyfyqi0f35l3x92xsqz8ghz1pnja8jns7g9";
+    sha1 = "2831f7deec472db4d0d0cdffb4d82d91cecdf295";
   };
 
-  patches = [ ./docbook2texi.patch ];
+  patches = [ ./docbook2texi.patch ./symlinks-in-bin.patch ];
 
   buildInputs = [curl openssl zlib expat gettext cpio makeWrapper]
-    ++ # documentation tools
-       [ asciidoc texinfo xmlto docbook2x
+    ++ stdenv.lib.optionals withManual [ asciidoc texinfo xmlto docbook2x
          docbook_xsl docbook_xml_dtd_45 libxslt ]
     ++ stdenv.lib.optionals guiSupport [tcl tk];
 
+  # required to support pthread_cancel()
+  NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
+
   makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell} "
       + (if pythonSupport then "PYTHON_PATH=${python}/bin/python" else "NO_PYTHON=1");
 
@@ -38,6 +41,8 @@ stdenv.mkDerivation {
   # so that `SPARSE_FLAGS' corresponds to the current architecture...
   #doCheck = true;
 
+  installFlags = "NO_INSTALL_HARDLINKS=1";
+
   postInstall =
     ''
       notSupported() {
@@ -63,6 +68,11 @@ stdenv.mkDerivation {
       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}
+
+      # gzip (and optionally bzip2, xz, zip) are a runtime dependencies for
+      # gitweb.cgi, need to patch so that it's found
+      sed -i -e "s|'compressor' => \['gzip'|'compressor' => ['${gzip}/bin/gzip'|" \
+          $out/share/gitweb/gitweb.cgi
     ''
 
    + (if svnSupport then
@@ -91,7 +101,7 @@ stdenv.mkDerivation {
         notSupported $out/libexec/git-core/git-send-email "reinstall with config git = { sendEmailSupport = true } set"
        '')
 
-   + ''# Install man pages and Info manual
+   + stdenv.lib.optionalString withManual ''# Install man pages and Info manual
        make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \
          -C Documentation ''
 
@@ -108,46 +118,21 @@ stdenv.mkDerivation {
          notSupported "$out/$prog" \
                       "reinstall with config git = { guiSupport = true; } set"
        done
-     '')
-
-   # 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
-      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 -v -s "''\${seen["$sum"]}" "$f"
-        fi
-      done
-     '';
+     '');
 
   enableParallelBuilding = true;
 
   meta = {
-    license = "GPLv2";
     homepage = http://git-scm.com/;
     description = "Git, a popular distributed version control system";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     longDescription = ''
       Git, a popular distributed version control system designed to
       handle very large projects with speed and efficiency.
     '';
 
-    maintainers =
-      [ # Add your name here!
-        stdenv.lib.maintainers.ludo
-        stdenv.lib.maintainers.simons
-      ];
-
     platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/git/docbook2texi-2.patch b/pkgs/applications/version-management/git-and-tools/git/docbook2texi-2.patch
deleted file mode 100644
index 25a76ea3dd2..00000000000
--- a/pkgs/applications/version-management/git-and-tools/git/docbook2texi-2.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-
-make sure `gitman.info' isn't produced since it's broken (duplicate
-node names).
-
-diff --git a/Documentation/Makefile b/Documentation/Makefile
---- a/Documentation/Makefile
-+++ b/Documentation/Makefile
-@@ -84,7 +84,7 @@ man1: $(DOC_MAN1)
- man5: $(DOC_MAN5)
- man7: $(DOC_MAN7)
- 
--info: git.info gitman.info
-+info: git.info
- 
- install: man
- 	$(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
-@@ -96,10 +96,9 @@ install: man
- 
- install-info: info
- 	$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
--	$(INSTALL) -m 644 git.info gitman.info $(DESTDIR)$(infodir)
-+	$(INSTALL) -m 644 git.info $(DESTDIR)$(infodir)
- 	if test -r $(DESTDIR)$(infodir)/dir; then \
- 	  $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\
--	  $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) gitman.info ;\
- 	else \
- 	  echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
- 	fi
diff --git a/pkgs/applications/version-management/git-and-tools/git/glob-path.patch b/pkgs/applications/version-management/git-and-tools/git/glob-path.patch
deleted file mode 100644
index 7515ade5787..00000000000
--- a/pkgs/applications/version-management/git-and-tools/git/glob-path.patch
+++ /dev/null
@@ -1,529 +0,0 @@
-diff --git a/builtin-add.c b/builtin-add.c
-index bf13aa3..02c6751 100644
---- a/builtin-add.c
-+++ b/builtin-add.c
-@@ -123,6 +123,7 @@ int add_files_to_cache(const char *prefix, const char **pathspec, int flags)
- 	init_revisions(&rev, prefix);
- 	setup_revisions(0, NULL, &rev, NULL);
- 	rev.prune_data = pathspec;
-+	rev.glob_paths = 0; /* git-add has its own filename matching machinery */
- 	rev.diffopt.output_format = DIFF_FORMAT_CALLBACK;
- 	rev.diffopt.format_callback = update_callback;
- 	data.flags = flags;
-diff --git a/builtin-blame.c b/builtin-blame.c
-index 9bced3b..237d1fe 100644
---- a/builtin-blame.c
-+++ b/builtin-blame.c
-@@ -343,7 +343,7 @@ static struct origin *find_origin(struct scoreboard *sb,
- 	paths[0] = origin->path;
- 	paths[1] = NULL;
- 
--	diff_tree_setup_paths(paths, &diff_opts);
-+	diff_tree_setup_paths(paths, &diff_opts, 0);
- 	if (diff_setup_done(&diff_opts) < 0)
- 		die("diff-setup");
- 
-@@ -417,7 +417,7 @@ static struct origin *find_rename(struct scoreboard *sb,
- 	diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
- 	diff_opts.single_follow = origin->path;
- 	paths[0] = NULL;
--	diff_tree_setup_paths(paths, &diff_opts);
-+	diff_tree_setup_paths(paths, &diff_opts, 0);
- 	if (diff_setup_done(&diff_opts) < 0)
- 		die("diff-setup");
- 
-@@ -1099,7 +1099,7 @@ static int find_copy_in_parent(struct scoreboard *sb,
- 	diff_opts.output_format = DIFF_FORMAT_NO_OUTPUT;
- 
- 	paths[0] = NULL;
--	diff_tree_setup_paths(paths, &diff_opts);
-+	diff_tree_setup_paths(paths, &diff_opts, 0);
- 	if (diff_setup_done(&diff_opts) < 0)
- 		die("diff-setup");
- 
-@@ -2346,6 +2346,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
- parse_done:
- 	argc = parse_options_end(&ctx);
- 
-+	if (revs.glob_paths) {
-+		error("git blame does not support `--glob-paths'");
-+		usage_with_options(blame_opt_usage, options);
-+	}
-+
- 	if (!blame_move_score)
- 		blame_move_score = BLAME_DEFAULT_MOVE_SCORE;
- 	if (!blame_copy_score)
-diff --git a/builtin-reset.c b/builtin-reset.c
-index 2e5a886..6026b34 100644
---- a/builtin-reset.c
-+++ b/builtin-reset.c
-@@ -128,14 +128,15 @@ static void update_index_from_diff(struct diff_queue_struct *q,
- }
- 
- static int read_from_tree(const char *prefix, const char **argv,
--		unsigned char *tree_sha1)
-+		unsigned char *tree_sha1, int glob_paths)
- {
- 	struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
- 	int index_fd, index_was_discarded = 0;
- 	struct diff_options opt;
- 
- 	memset(&opt, 0, sizeof(opt));
--	diff_tree_setup_paths(get_pathspec(prefix, (const char **)argv), &opt);
-+	diff_tree_setup_paths(get_pathspec(prefix, (const char **)argv),
-+			&opt, glob_paths);
- 	opt.output_format = DIFF_FORMAT_CALLBACK;
- 	opt.format_callback = update_index_from_diff;
- 	opt.format_callback_data = &index_was_discarded;
-@@ -171,6 +172,7 @@ static const char *reset_type_names[] = { "mixed", "soft", "hard", NULL };
- int cmd_reset(int argc, const char **argv, const char *prefix)
- {
- 	int i = 0, reset_type = NONE, update_ref_status = 0, quiet = 0;
-+	int glob_paths = 0;
- 	const char *rev = "HEAD";
- 	unsigned char sha1[20], *orig = NULL, sha1_orig[20],
- 				*old_orig = NULL, sha1_old_orig[20];
-@@ -182,6 +184,8 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
- 		OPT_SET_INT(0, "soft", &reset_type, "reset only HEAD", SOFT),
- 		OPT_SET_INT(0, "hard", &reset_type,
- 				"reset HEAD, index and working tree", HARD),
-+		OPT_BOOLEAN(0, "glob-paths", &glob_paths,
-+				"match paths with fnmatch"),
- 		OPT_BOOLEAN('q', NULL, &quiet,
- 				"disable showing new HEAD in hard reset and progress message"),
- 		OPT_END()
-@@ -246,7 +250,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
- 		else if (reset_type != NONE)
- 			die("Cannot do %s reset with paths.",
- 					reset_type_names[reset_type]);
--		return read_from_tree(prefix, argv + i, sha1);
-+		return read_from_tree(prefix, argv + i, sha1, glob_paths);
- 	}
- 	if (reset_type == NONE)
- 		reset_type = MIXED; /* by default */
-diff --git a/builtin-update-index.c b/builtin-update-index.c
-index 38eb53c..28b09a3 100644
---- a/builtin-update-index.c
-+++ b/builtin-update-index.c
-@@ -23,6 +23,7 @@ static int allow_replace;
- static int info_only;
- static int force_remove;
- static int verbose;
-+static int glob_paths;
- static int mark_valid_only;
- #define MARK_VALID 1
- #define UNMARK_VALID 2
-@@ -534,7 +535,7 @@ static int do_reupdate(int ac, const char **av,
- 		struct cache_entry *old = NULL;
- 		int save_nr;
- 
--		if (ce_stage(ce) || !ce_path_match(ce, pathspec))
-+		if (ce_stage(ce) || !ce_path_match(ce, pathspec, glob_paths))
- 			continue;
- 		if (has_head)
- 			old = read_one_ent(NULL, head_sha1,
-@@ -659,6 +660,10 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
- 				force_remove = 1;
- 				continue;
- 			}
-+			if (!strcmp(path, "--glob-paths")) {
-+				glob_paths = 1;
-+				continue;
-+			}
- 			if (!strcmp(path, "-z")) {
- 				line_termination = 0;
- 				continue;
-@@ -702,6 +707,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
- 				usage(update_index_usage);
- 			die("unknown option %s", path);
- 		}
-+		if (glob_paths)
-+			die("--glob-paths without -g");
- 		p = prefix_path(prefix, prefix_length, path);
- 		update_one(p, NULL, 0);
- 		if (set_executable_bit)
-@@ -712,6 +719,8 @@ int cmd_update_index(int argc, const char **argv, const char *prefix)
- 	if (read_from_stdin) {
- 		struct strbuf buf, nbuf;
- 
-+		if (glob_paths)
-+			die("--glob-paths without -g");
- 		strbuf_init(&buf, 0);
- 		strbuf_init(&nbuf, 0);
- 		while (strbuf_getline(&buf, stdin, line_termination) != EOF) {
-diff --git a/cache.h b/cache.h
-index a779d92..5560195 100644
---- a/cache.h
-+++ b/cache.h
-@@ -387,7 +387,8 @@ extern int ce_same_name(struct cache_entry *a, struct cache_entry *b);
- extern int ie_match_stat(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
- extern int ie_modified(const struct index_state *, struct cache_entry *, struct stat *, unsigned int);
- 
--extern int ce_path_match(const struct cache_entry *ce, const char **pathspec);
-+extern int ce_path_match(const struct cache_entry *ce, const char **pathspec,
-+		int glob_paths);
- extern int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object, enum object_type type, const char *path);
- extern int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object);
- extern int index_path(unsigned char *sha1, const char *path, struct stat *st, int write_object);
-diff --git a/diff-lib.c b/diff-lib.c
-index e7eaff9..87925a2 100644
---- a/diff-lib.c
-+++ b/diff-lib.c
-@@ -77,7 +77,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
- 			DIFF_OPT_TST(&revs->diffopt, HAS_CHANGES))
- 			break;
- 
--		if (!ce_path_match(ce, revs->prune_data))
-+		if (!ce_path_match(ce, revs->prune_data, revs->glob_paths))
- 			continue;
- 
- 		if (ce_stage(ce)) {
-@@ -431,7 +431,7 @@ static int oneway_diff(struct cache_entry **src, struct unpack_trees_options *o)
- 	if (tree == o->df_conflict_entry)
- 		tree = NULL;
- 
--	if (ce_path_match(idx ? idx : tree, revs->prune_data))
-+	if (ce_path_match(idx ? idx : tree, revs->prune_data, revs->glob_paths))
- 		do_oneway_diff(o, idx, tree);
- 
- 	return 0;
-@@ -508,6 +508,7 @@ int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)
- 
- 	init_revisions(&revs, NULL);
- 	revs.prune_data = opt->paths;
-+	revs.glob_paths = opt->glob_paths;
- 	tree = parse_tree_indirect(tree_sha1);
- 	if (!tree)
- 		die("bad tree object %s", sha1_to_hex(tree_sha1));
-diff --git a/diff-no-index.c b/diff-no-index.c
-index f6994cf..ec549a7 100644
---- a/diff-no-index.c
-+++ b/diff-no-index.c
-@@ -240,6 +240,7 @@ void diff_no_index(struct rev_info *revs,
- 	}
- 	else
- 		revs->diffopt.paths = argv + argc - 2;
-+	revs->diffopt.glob_paths = 0;
- 	revs->diffopt.nr_paths = 2;
- 
- 	DIFF_OPT_SET(&revs->diffopt, EXIT_WITH_STATUS);
-diff --git a/diff.h b/diff.h
-index 50fb5dd..56f0857 100644
---- a/diff.h
-+++ b/diff.h
-@@ -102,6 +102,7 @@ struct diff_options {
- 	FILE *file;
- 	int close_file;
- 
-+	int glob_paths;
- 	int nr_paths;
- 	const char **paths;
- 	int *pathlens;
-@@ -128,7 +129,8 @@ const char *diff_get_color(int diff_use_color, enum color_diff ix);
- 
- extern const char mime_boundary_leader[];
- 
--extern void diff_tree_setup_paths(const char **paths, struct diff_options *);
-+extern void diff_tree_setup_paths(const char **paths, struct diff_options *opt,
-+		int glob_paths);
- extern void diff_tree_release_paths(struct diff_options *);
- extern int diff_tree(struct tree_desc *t1, struct tree_desc *t2,
- 		     const char *base, struct diff_options *opt);
-diff --git a/gitk-git/gitk b/gitk-git/gitk
-index fddcb45..18c5cbc 100644
---- a/gitk-git/gitk
-+++ b/gitk-git/gitk
-@@ -1866,6 +1866,7 @@ proc makewindow {} {
-     set gm [tk_optionMenu .tf.lbar.gdttype gdttype \
- 		[mc "containing:"] \
- 		[mc "touching paths:"] \
-+		[mc "touching paths (glob):"] \
- 		[mc "adding/removing string:"]]
-     trace add variable gdttype write gdttype_change
-     pack .tf.lbar.gdttype -side left -fill y
-@@ -3588,6 +3589,11 @@ proc do_file_hl {serial} {
- 	set highlight_paths [makepatterns $paths]
- 	highlight_filelist
- 	set gdtargs [concat -- $paths]
-+    } elseif {$gdttype eq [mc "touching paths (glob):"]} {
-+	if {[catch {set paths [shellsplit $highlight_files]}]} return
-+	set highlight_paths $paths
-+	highlight_filelist
-+	set gdtargs [concat --glob-paths -- $paths]
-     } elseif {$gdttype eq [mc "adding/removing string:"]} {
- 	set gdtargs [list "-S$highlight_files"]
-     } else {
-diff --git a/read-cache.c b/read-cache.c
-index 1648428..c11ded9 100644
---- a/read-cache.c
-+++ b/read-cache.c
-@@ -582,7 +582,8 @@ int ce_same_name(struct cache_entry *a, struct cache_entry *b)
- 	return ce_namelen(b) == len && !memcmp(a->name, b->name, len);
- }
- 
--int ce_path_match(const struct cache_entry *ce, const char **pathspec)
-+static int ce_path_match_standard(const struct cache_entry *ce,
-+		const char **pathspec)
- {
- 	const char *match, *name;
- 	int len;
-@@ -608,6 +609,31 @@ int ce_path_match(const struct cache_entry *ce, const char **pathspec)
- 	return 0;
- }
- 
-+static int ce_path_match_globbed(const struct cache_entry *ce,
-+		const char **pathspec)
-+{
-+	const char *match, *name;
-+
-+	if (!pathspec)
-+		return 1;
-+
-+	name = ce->name;
-+	while ((match = *pathspec++) != NULL) {
-+		if (!fnmatch(match, name, 0))
-+			return 1;
-+	}
-+	return 0;
-+}
-+
-+int ce_path_match(const struct cache_entry *ce,
-+		const char **pathspec, int glob_paths)
-+{
-+	if (glob_paths)
-+		return ce_path_match_globbed(ce, pathspec);
-+	else
-+		return ce_path_match_standard(ce, pathspec);
-+}
-+
- /*
-  * We fundamentally don't like some paths: we don't want
-  * dot or dot-dot anywhere, and for obvious reasons don't
-diff --git a/revision.c b/revision.c
-index 3897fec..0dd1091 100644
---- a/revision.c
-+++ b/revision.c
-@@ -519,6 +519,7 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
- 	if (revs->diffopt.nr_paths) {
- 		ids.diffopts.nr_paths = revs->diffopt.nr_paths;
- 		ids.diffopts.paths = revs->diffopt.paths;
-+		ids.diffopts.glob_paths = revs->diffopt.glob_paths; /* CHECKME */
- 		ids.diffopts.pathlens = revs->diffopt.pathlens;
- 	}
- 
-@@ -826,7 +827,7 @@ static void prepare_show_merge(struct rev_info *revs)
- 		struct cache_entry *ce = active_cache[i];
- 		if (!ce_stage(ce))
- 			continue;
--		if (ce_path_match(ce, revs->prune_data)) {
-+		if (ce_path_match(ce, revs->prune_data, revs->glob_paths)) {
- 			prune_num++;
- 			prune = xrealloc(prune, sizeof(*prune) * prune_num);
- 			prune[prune_num-2] = ce->name;
-@@ -837,6 +838,7 @@ static void prepare_show_merge(struct rev_info *revs)
- 			i++;
- 	}
- 	revs->prune_data = prune;
-+	revs->glob_paths = 0;
- 	revs->limited = 1;
- }
- 
-@@ -1033,6 +1035,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
- 		revs->min_age = approxidate(arg + 8);
- 	} else if (!strcmp(arg, "--first-parent")) {
- 		revs->first_parent_only = 1;
-+	} else if (!strcmp(arg, "--glob-paths")) {
-+		revs->glob_paths = 1;
- 	} else if (!strcmp(arg, "-g") || !strcmp(arg, "--walk-reflogs")) {
- 		init_reflog_walk(&revs->reflog_info);
- 	} else if (!strcmp(arg, "--default")) {
-@@ -1220,6 +1224,7 @@ void parse_revision_opt(struct rev_info *revs, struct parse_opt_ctx_t *ctx,
- int setup_revisions(int argc, const char **argv, struct rev_info *revs, const char *def)
- {
- 	int i, flags, left, seen_dashdash;
-+	const char **paths = NULL;
- 
- 	/* First, search for "--" */
- 	seen_dashdash = 0;
-@@ -1230,7 +1235,7 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
- 		argv[i] = NULL;
- 		argc = i;
- 		if (argv[i + 1])
--			revs->prune_data = get_pathspec(revs->prefix, argv + i + 1);
-+			paths = argv + i + 1;
- 		seen_dashdash = 1;
- 		break;
- 	}
-@@ -1290,6 +1295,9 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
- 			if (seen_dashdash || *arg == '^')
- 				die("bad revision '%s'", arg);
- 
-+			if (revs->glob_paths)
-+				die("--glob-paths without --");
-+
- 			/* If we didn't have a "--":
- 			 * (1) all filenames must exist;
- 			 * (2) all rev-args must not be interpretable
-@@ -1301,10 +1309,19 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
- 
- 			revs->prune_data = get_pathspec(revs->prefix,
- 							argv + i);
-+			revs->glob_paths = 0;
- 			break;
- 		}
- 	}
- 
-+	/* Third, handle paths listed after -- */
-+	if (paths != NULL) {
-+		if (revs->glob_paths)
-+			revs->prune_data = paths;
-+		else
-+			revs->prune_data = get_pathspec(revs->prefix, paths);
-+	}
-+
- 	if (revs->def == NULL)
- 		revs->def = def;
- 	if (revs->show_merge)
-@@ -1333,12 +1350,14 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
- 		revs->limited = 1;
- 
- 	if (revs->prune_data) {
--		diff_tree_setup_paths(revs->prune_data, &revs->pruning);
-+		diff_tree_setup_paths(revs->prune_data, &revs->pruning,
-+				revs->glob_paths);
- 		/* Can't prune commits with rename following: the paths change.. */
- 		if (!DIFF_OPT_TST(&revs->diffopt, FOLLOW_RENAMES))
- 			revs->prune = 1;
- 		if (!revs->full_diff)
--			diff_tree_setup_paths(revs->prune_data, &revs->diffopt);
-+			diff_tree_setup_paths(revs->prune_data, &revs->diffopt,
-+				revs->glob_paths);
- 	}
- 	if (revs->combine_merges) {
- 		revs->ignore_merges = 0;
-diff --git a/revision.h b/revision.h
-index fa68c65..a68cdb8 100644
---- a/revision.h
-+++ b/revision.h
-@@ -32,6 +32,9 @@ struct rev_info {
- 	void *prune_data;
- 	unsigned int early_output;
- 
-+	/* whether prune_data contains fnmatch() patterns */
-+	unsigned int	glob_paths:1;
-+
- 	/* Traversal flags */
- 	unsigned int	dense:1,
- 			prune:1,
-diff --git a/tree-diff.c b/tree-diff.c
-index bbb126f..0aa1e9b 100644
---- a/tree-diff.c
-+++ b/tree-diff.c
-@@ -82,6 +82,11 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
- 	return 0;
- }
- 
-+static int tree_entry_interesting_globbed(struct tree_desc *, const char *,
-+		int, struct diff_options *);
-+static int tree_entry_interesting_standard(struct tree_desc *, const char *,
-+		int, struct diff_options *);
-+
- /*
-  * Is a tree entry interesting given the pathspec we have?
-  *
-@@ -91,7 +96,19 @@ static int compare_tree_entry(struct tree_desc *t1, struct tree_desc *t2, const
-  *  - zero for no
-  *  - negative for "no, and no subsequent entries will be either"
-  */
--static int tree_entry_interesting(struct tree_desc *desc, const char *base, int baselen, struct diff_options *opt)
-+static int tree_entry_interesting(struct tree_desc *desc,
-+		const char *base, int baselen, struct diff_options *opt)
-+{
-+	if (opt->glob_paths)
-+		return tree_entry_interesting_globbed(desc, base,
-+				baselen, opt);
-+	else
-+		return tree_entry_interesting_standard(desc, base,
-+				baselen, opt);
-+}
-+
-+static int tree_entry_interesting_standard(struct tree_desc *desc,
-+		const char *base, int baselen, struct diff_options *opt)
- {
- 	const char *path;
- 	const unsigned char *sha1;
-@@ -190,6 +207,41 @@ static int tree_entry_interesting(struct tree_desc *desc, const char *base, int
- 	return never_interesting; /* No matches */
- }
- 
-+static int tree_entry_interesting_globbed(struct tree_desc *desc,
-+		const char *base, int baselen, struct diff_options *opt)
-+{
-+	const char *path;
-+	char *fullpath;
-+	const unsigned char *sha1;
-+	unsigned mode;
-+	int i;
-+	int pathlen;
-+	int result;
-+
-+	if (!opt->nr_paths)
-+		return 1;
-+	sha1 = tree_entry_extract(desc, &path, &mode);
-+	if (S_ISDIR(mode))
-+		return 1;
-+	pathlen = tree_entry_len(path, sha1);
-+
-+	fullpath = xmalloc(pathlen + baselen + 1);
-+	memcpy(fullpath, base, baselen);
-+	memcpy(fullpath + baselen, path, pathlen + 1);
-+
-+	result = 0;
-+	for (i = 0; i < opt->nr_paths; i++) {
-+		const char *match = opt->paths[i];
-+		if (!fnmatch(match, fullpath, 0)) {
-+			result = 1;
-+			break;
-+		}
-+	}
-+
-+	free(fullpath);
-+	return result;
-+}
-+
- /* A whole sub-tree went away or appeared */
- static void show_tree(struct diff_options *opt, const char *prefix, struct tree_desc *desc, const char *base, int baselen)
- {
-@@ -338,7 +390,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
- 	diff_opts.single_follow = opt->paths[0];
- 	diff_opts.break_opt = opt->break_opt;
- 	paths[0] = NULL;
--	diff_tree_setup_paths(paths, &diff_opts);
-+	diff_tree_setup_paths(paths, &diff_opts, 0);
- 	if (diff_setup_done(&diff_opts) < 0)
- 		die("unable to set up diff options to follow renames");
- 	diff_tree(t1, t2, base, &diff_opts);
-@@ -362,7 +414,7 @@ static void try_to_follow_renames(struct tree_desc *t1, struct tree_desc *t2, co
- 			/* Update the path we use from now on.. */
- 			diff_tree_release_paths(opt);
- 			opt->paths[0] = xstrdup(p->one->path);
--			diff_tree_setup_paths(opt->paths, opt);
-+			diff_tree_setup_paths(opt->paths, opt, 0);
- 			break;
- 		}
- 	}
-@@ -440,11 +492,13 @@ void diff_tree_release_paths(struct diff_options *opt)
- 	free(opt->pathlens);
- }
- 
--void diff_tree_setup_paths(const char **p, struct diff_options *opt)
-+void diff_tree_setup_paths(const char **p, struct diff_options *opt,
-+		int glob_paths)
- {
- 	opt->nr_paths = 0;
- 	opt->pathlens = NULL;
- 	opt->paths = NULL;
-+	opt->glob_paths = glob_paths;
- 
- 	if (p) {
- 		int i;
diff --git a/pkgs/applications/version-management/git-and-tools/git/symlinks-in-bin.patch b/pkgs/applications/version-management/git-and-tools/git/symlinks-in-bin.patch
new file mode 100644
index 00000000000..29d537db25f
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git/symlinks-in-bin.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' git-1.8.2.1-orig/Makefile git-1.8.2.1/Makefile
+--- git-1.8.2.1-orig/Makefile	2013-04-08 00:52:04.000000000 +0200
++++ git-1.8.2.1/Makefile	2013-04-22 15:46:42.906026940 +0200
+@@ -2319,8 +2319,7 @@
+ 	{ test "$$bindir/" = "$$execdir/" || \
+ 	  for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
+ 		$(RM) "$$execdir/$$p" && \
+-		test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
+-		ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
++		ln -s "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
+ 		cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
+ 	  done; \
+ 	} && \
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 f3fc8c9b6e9..1e372c928f8 100644
--- a/pkgs/applications/version-management/git-and-tools/git2cl/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git2cl/default.nix
@@ -1,7 +1,7 @@
 { fetchgit, stdenv, perl }:
 
 stdenv.mkDerivation {
-  name = "git2cl";
+  name = "git2cl-20080827";
 
   src = fetchgit {
     url = "git://repo.or.cz/git2cl.git";
diff --git a/pkgs/applications/version-management/git-and-tools/github-backup/default.nix b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
new file mode 100644
index 00000000000..5f0df6c8ead
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
@@ -0,0 +1,21 @@
+{ cabal, extensibleExceptions, filepath, github, hslogger, IfElse
+, MissingH, mtl, network, prettyShow, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "github-backup";
+  version = "1.20130414";
+  sha256 = "1s8s1kv4kj086kzq8iq28zyrlg65hrzg3563fw3dazfik73cmlcp";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    extensibleExceptions filepath github hslogger IfElse MissingH mtl
+    network prettyShow text
+  ];
+  meta = {
+    homepage = "https://github.com/joeyh/github-backup";
+    description = "backs up everything github knows about a repository, to the repository";
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/applications/version-management/git-and-tools/hub/default.nix b/pkgs/applications/version-management/git-and-tools/hub/default.nix
new file mode 100644
index 00000000000..e545d2bc6f4
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/hub/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchgit, groff, rake, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "hub-${version}";
+  version = "1.10.3";
+
+  src = fetchgit {
+    url = "git://github.com/defunkt/hub.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "0j0krmf0sf09hhw3nsn0w1y97d67762g4qrc8080bwcx38lbyvbg";
+  };
+
+  buildInputs = [ rake makeWrapper ];
+
+  installPhase = ''
+    rake install "prefix=$out"
+  '';
+
+  fixupPhase = ''
+    wrapProgram $out/bin/hub --prefix PATH : ${groff}/bin
+  '';
+
+  meta = {
+    description = "A GitHub specific wrapper for git";
+    homepage = "http://defunkt.io/hub/";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/tig/default.nix b/pkgs/applications/version-management/git-and-tools/tig/default.nix
index d567e20d732..20644d09dd7 100644
--- a/pkgs/applications/version-management/git-and-tools/tig/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/tig/default.nix
@@ -1,19 +1,22 @@
 { stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl }:
 
-stdenv.mkDerivation {
-  name = "tig-1.0";
+stdenv.mkDerivation rec {
+  name = "tig-1.1";
   src = fetchurl {
-    url = "http://jonas.nitro.dk/tig/releases/tig-1.0.tar.gz";
-    md5 = "a2d414d1cebbc9cd4f3d545bc6f225c6";
+    url = "http://jonas.nitro.dk/tig/releases/${name}.tar.gz";
+    md5 = "adeb797a8320962eeb345a615257cbac";
   };
   buildInputs = [ncurses asciidoc xmlto docbook_xsl];
   installPhase = ''
     make install
     make install-doc
+    mkdir -p $out/etc/bash_completion.d/
+    cp contrib/tig-completion.bash $out/etc/bash_completion.d/
   '';
-  meta = {
-    description = "Tig is a git repository browser that additionally can act as a pager for output from various git commands";
+  meta = with stdenv.lib; {
     homepage = "http://jonas.nitro.dk/tig/";
-    license = "GPLv2";
+    description = "Tig is a git repository browser that additionally can act as a pager for output from various git commands";
+    maintainers = [ maintainers.garbas maintainers.bjornfor ];
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/topgit/default.nix b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
index 4b192605182..5290a12a54a 100644
--- a/pkgs/applications/version-management/git-and-tools/topgit/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
@@ -1,33 +1,26 @@
-{ stdenv, fetchurl, unzip }:
+{ stdenv, fetchurl }:
 
-let
-  version = "0.8-45-gd279e29";
-  lib = stdenv.lib;
-in
-stdenv.mkDerivation {
-  name = "topgit-${version}";
+stdenv.mkDerivation rec {
+  name = "topgit-0.9";
 
   src = fetchurl {
-    url = "http://repo.or.cz/w/topgit.git/snapshot/topgit-${version}.zip";
-    sha256 = "0vzrng1w2k7m4z0x9h6zbrcf33dx08ly8fnbxzz3ms2k2dbsmpl6";
+    url = "https://github.com/greenrd/topgit/archive/${name}.tar.gz";
+    sha256 = "1z9x42a0cmn8n2n961qcfl522nd6j9a3dpx1jbqfp24ddrk5zd94";
   };
 
-  buildInputs = [unzip];
-  configurePhase = "export prefix=$out";
+  configurePhase = "makeFlags=prefix=$out";
 
   postInstall = ''
-    mkdir -p "$out/share/doc/topgit-${version}"
-    cp README "$out/share/doc/topgit-${version}/"
-    mkdir -p "$out/etc/bash_completion.d"
-    make prefix="$out" install
-    mv "contrib/tg-completion.bash" "$out/etc/bash_completion.d/"
+    mkdir -p "$out/share/doc/${name}" "$out/etc/bash_completion.d/"
+    mv README "$out/share/doc/${name}/"
+    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;
+    homepage = "https://github.com/greenrd/topgit";
+    description = "TopGit manages large amount of interdependent topic branches";
     license = "GPLv2";
     platforms = stdenv.lib.platforms.unix;
+    maintainers = with stdenv.lib.maintainers; [ marcweber ludo simons ];
   };
 }
diff --git a/pkgs/applications/version-management/kdesvn/default.nix b/pkgs/applications/version-management/kdesvn/default.nix
index 7761c45850e..29b8b306fe5 100644
--- a/pkgs/applications/version-management/kdesvn/default.nix
+++ b/pkgs/applications/version-management/kdesvn/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ apr aprutil subversion db4 kdelibs ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   meta = {
     description = "KDE SVN front-end";
diff --git a/pkgs/applications/version-management/meld/default.nix b/pkgs/applications/version-management/meld/default.nix
index 42650b3afb3..6e099cd5608 100644
--- a/pkgs/applications/version-management/meld/default.nix
+++ b/pkgs/applications/version-management/meld/default.nix
@@ -1,8 +1,8 @@
 {stdenv, fetchurl, pygtk, python, intltool, scrollkeeper, makeWrapper }:
 
 let
-  minor = "1.5";
-  version = "${minor}.2";
+  minor = "1.6";
+  version = "${minor}.1";
 in
 
 stdenv.mkDerivation {
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://ftp.gnome.org/pub/gnome/sources/meld/${minor}/meld-${version}.tar.xz";
-    sha256 = "05rbkqflbqnh2c4682d2fmidhwz2bvlggrhp1p7xbi3z8ci87pdx";
+    sha256 = "00rsff0yl5qwzh0igkdns6ry2xsbxad70avpqpkbd2bldi94v76y";
   };
 
   buildInputs = [ pygtk python intltool scrollkeeper makeWrapper ];
diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix
index 486bebc2531..669aa5713a0 100644
--- a/pkgs/applications/version-management/mercurial/default.nix
+++ b/pkgs/applications/version-management/mercurial/default.nix
@@ -2,14 +2,15 @@
 , guiSupport ? false, tk ? null, curses }:
 
 let
-  name = "mercurial-2.2.3";
+  name = "mercurial-2.6.1";
 in
+
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "http://mercurial.selenic.com/release/${name}.tar.gz";
-    sha256 = "0yv7kn96270fixigry910c1i3zzivimh1xjxywqjn9dshn2y6qbw";
+    sha256 = "0r4fg269xnqgacc82ppm3wxl9wwvvgwz8z6zi1iai4gx76iklhdn";
   };
 
   inherit python; # pass it so that the same version can be used in hg2git
@@ -17,8 +18,6 @@ stdenv.mkDerivation {
 
   buildInputs = [ python makeWrapper docutils unzip ];
 
-  PYTHONPATH = "${python}/lib/python2.6/site-packages:${python}/lib/python2.7/site-packages:${docutils}/lib/python2.5/site-packages:${docutils}/lib/python2.6/site-packages:${docutils}/lib/python2.7/site-packages";
-
   makeFlags = "PREFIX=$(out)";
 
   postInstall = (stdenv.lib.optionalString guiSupport
@@ -41,17 +40,22 @@ stdenv.mkDerivation {
           $WRAP_TK
       done
 
+      mkdir -p $out/etc/mercurial
+      cat >> $out/etc/mercurial/hgrc << EOF
+      [web]
+      cacerts = /etc/ssl/certs/ca-bundle.crt
+      EOF
+
       # copy hgweb.cgi to allow use in apache
       mkdir -p $out/share/cgi-bin
       cp -v hgweb.cgi contrib/hgweb.wsgi $out/share/cgi-bin
       chmod u+x $out/share/cgi-bin/hgweb.cgi
     '';
 
-  doCheck = false;  # The test suite fails, unfortunately. Not sure why.
-
   meta = {
     description = "A fast, lightweight SCM system for very large distributed projects";
     homepage = "http://www.selenic.com/mercurial/";
     license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/applications/version-management/monotone-viz/1.0.1.nix b/pkgs/applications/version-management/monotone-viz/1.0.1.nix
deleted file mode 100644
index dc4816cee51..00000000000
--- a/pkgs/applications/version-management/monotone-viz/1.0.1.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-args : with args; 
-rec {
-  src = fetchurl {
-    name = "monotone-viz-1.0.1-nolablgtk.tar.gz";
-    urls = [
-      http://ftp.debian.org/debian/pool/main/m/monotone-viz/monotone-viz_1.0.1.orig.tar.gz
-      #http://oandrieu.nerim.net/monotone-viz/monotone-viz-1.0.1-nolablgtk.tar.gz
-    ];
-    sha256 = "066qwrknjk5hwk9jblnf0bzvbmfbabq0zhsxkd3nzk469zkpvhl2";
-  };
-
-  buildInputs = [ocaml lablgtk libgnomecanvas gtk graphviz glib pkgconfig];
-  configureFlags = ["--with-lablgtk-dir=${lablgtk}/lib/ocaml/lablgtk2"];
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
-  name = "monotone-viz-" + version;
-  meta = {
-    description = "Monotone commit tree visualizer";
-  };
-}
-
diff --git a/pkgs/applications/version-management/monotone-viz/graphviz.patch b/pkgs/applications/version-management/monotone-viz/graphviz.patch
deleted file mode 100644
index e1f9bfc5f7f..00000000000
--- a/pkgs/applications/version-management/monotone-viz/graphviz.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-# patch "agraph.ml"
-#  from [8ae6c9bb70bbf9fd80e4e62d9f162ac581619b9e]
-#    to [05aa88921481ac9bfe238daeb4374fbc9993caaa]
-#
-============================================================
---- a/agraph.ml	8ae6c9bb70bbf9fd80e4e62d9f162ac581619b9e
-+++ b/agraph.ml	05aa88921481ac9bfe238daeb4374fbc9993caaa
-@@ -50,8 +50,9 @@ let dot_format params agraph =
-       agraph.nodes in
- 
-   !+ "digraph \"monotone-viz\"\n{\n" ;
--  if params.lr_layout then
--    !+ "  graph [rankdir=LR] ;\n" ;
-+  if params.lr_layout
-+  then  !+ "  graph [rankdir=LR] ;\n"
-+  else  !+ "  graph [rankdir=BT] ;\n" ;
-   !+ "  graph [ranksep=\"0.25\"] ;\n" ;
-   !+ "  node [label=\"\"] ;\n" ;
-   
-@@ -222,11 +223,11 @@ let spawn_dot graph status done_cb =
-   let dot_prg = graph.layout_params.dot_program in
-   let cmd = 
-     if Viz_misc.debug "dot"
--    then [ "/bin/sh" ; "-c" ; 
-+    then [ "/bin/sh" ; "-c" ; 
- 	   Printf.sprintf 
- 	     "set -o pipefail ; \
--              tee agraph.in.dot | %s -q -y -s%.0f | tee agraph.out.dot" dot_prg ppi ]
--    else [ dot_prg ; "-q" ; "-y" ; Printf.sprintf "-s%.0f" ppi ] in
-+              tee agraph.in.dot | %s -q -s%.0f | tee agraph.out.dot" dot_prg ppi ]
-+    else [ dot_prg ; "-q" ; Printf.sprintf "-s%.0f" ppi ] in
-   let error fmt =
-     Printf.kprintf (fun s -> done_cb (`LAYOUT_ERROR s)) fmt in
-   try
diff --git a/pkgs/applications/version-management/monotone/default.nix b/pkgs/applications/version-management/monotone/default.nix
index cde31b5cef9..0df1c652761 100644
--- a/pkgs/applications/version-management/monotone/default.nix
+++ b/pkgs/applications/version-management/monotone/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, boost, zlib, botan, libidn
-, lua, pcre, sqlite, perl, pkgconfig }:
+, lua, pcre, sqlite, perl, pkgconfig, expect }:
 
 let
   version = "1.0";
@@ -16,7 +16,9 @@ stdenv.mkDerivation rec {
     sha256 = "5c530bc4652b2c08b5291659f0c130618a14780f075f981e947952dcaefc31dc";
   };
 
-  buildInputs = [boost zlib botan libidn lua pcre sqlite pkgconfig];
+  patches = [ ./glibc-file-handle.patch ];
+
+  buildInputs = [ boost zlib botan libidn lua pcre sqlite pkgconfig expect ];
 
   postInstall = ''
     mkdir -p $out/share/${name}
@@ -25,6 +27,8 @@ stdenv.mkDerivation rec {
     cp -v contrib/Monotone.pm $out/lib/perl5/site_perl/${perlVersion}
   '';
 
+  #doCheck = true; # some tests fail (and they take VERY long)
+
   meta = {
     description = "A free distributed version control system";
     maintainers = [stdenv.lib.maintainers.raskin];
diff --git a/pkgs/applications/version-management/monotone/glibc-file-handle.patch b/pkgs/applications/version-management/monotone/glibc-file-handle.patch
new file mode 100644
index 00000000000..601b6ede0fb
--- /dev/null
+++ b/pkgs/applications/version-management/monotone/glibc-file-handle.patch
@@ -0,0 +1,166 @@
+Revision: da62cad10eda55aa233ac124273f3db4f541137a
+Parent:   65bcb8cf8b32f68a5b48629b328f6d65979e58df
+Author:   Thomas Moschny <thomas.moschny@gmx.de>
+Date:     07.05.2011 13:32:06
+Branch:   net.venge.monotone
+
+Changelog: 
+
+* src/rcs_file.cc: Rename struct "file_handle" to "rcs_file_handle"
+  to avoid a name clash with a struct of same name defined by newer
+  glibc's "fcntl.h". For aesthetic reasons, also rename struct
+  "file_source".
+
+References:
+https://code.monotone.ca/p/monotone/source/commit/da62cad10eda55aa233ac124273f3db4f541137a/
+https://bugs.gentoo.org/396651
+
+============================================================
+--- a/src/rcs_file.cc	885b3fbe7b6cfed78816f0e57cd71d44616213c6
++++ b/src/rcs_file.cc	03cf68912a4a708545ebce3d415c0e970ddead0b
+@@ -42,12 +42,12 @@ struct
+ 
+ #ifdef HAVE_MMAP
+ struct
+-file_handle
++rcs_file_handle
+ {
+   string const & filename;
+   off_t length;
+   int fd;
+-  file_handle(string const & fn) :
++  rcs_file_handle(string const & fn) :
+     filename(fn),
+     length(0),
+     fd(-1)
+@@ -60,13 +60,13 @@ file_handle
+       if (fd == -1)
+         throw oops("open of " + filename + " failed");
+     }
+-  ~file_handle()
++  ~rcs_file_handle()
+     {
+       if (close(fd) == -1)
+         throw oops("close of " + filename + " failed");
+     }
+ };
+-struct file_source
++struct rcs_file_source
+ {
+   string const & filename;
+   int fd;
+@@ -91,7 +91,7 @@ struct file_source
+       ++pos;
+     return good();
+   }
+-  file_source(string const & fn,
++  rcs_file_source(string const & fn,
+               int f,
+               off_t len) :
+     filename(fn),
+@@ -104,7 +104,7 @@ struct file_source
+     if (mapping == MAP_FAILED)
+       throw oops("mmap of " + filename + " failed");
+   }
+-  ~file_source()
++  ~rcs_file_source()
+   {
+     if (munmap(mapping, length) == -1)
+       throw oops("munmapping " + filename + " failed, after reading RCS file");
+@@ -112,12 +112,12 @@ struct
+ };
+ #elif defined(WIN32)
+ struct
+-file_handle
++rcs_file_handle
+ {
+   string const & filename;
+   off_t length;
+   HANDLE fd;
+-  file_handle(string const & fn) :
++  rcs_file_handle(string const & fn) :
+     filename(fn),
+     length(0),
+     fd(NULL)
+@@ -134,7 +134,7 @@ file_handle
+       if (fd == NULL)
+         throw oops("open of " + filename + " failed");
+     }
+-  ~file_handle()
++  ~rcs_file_handle()
+     {
+       if (CloseHandle(fd)==0)
+         throw oops("close of " + filename + " failed");
+@@ -142,7 +142,7 @@ struct
+ };
+ 
+ struct
+-file_source
++rcs_file_source
+ {
+   string const & filename;
+   HANDLE fd,map;
+@@ -167,7 +167,7 @@ file_source
+       ++pos;
+     return good();
+   }
+-  file_source(string const & fn,
++  rcs_file_source(string const & fn,
+               HANDLE f,
+               off_t len) :
+     filename(fn),
+@@ -183,7 +183,7 @@ file_source
+     if (mapping==NULL)
+       throw oops("MapViewOfFile of " + filename + " failed");
+   }
+-  ~file_source()
++  ~rcs_file_source()
+   {
+     if (UnmapViewOfFile(mapping)==0)
+       throw oops("UnmapViewOfFile of " + filename + " failed");
+@@ -193,7 +193,7 @@ file_source
+ };
+ #else
+ // no mmap at all
+-typedef istream file_source;
++typedef istream rcs_file_source;
+ #endif
+ 
+ typedef enum
+@@ -220,7 +220,7 @@ static token_type
+ }
+ 
+ static token_type
+-get_token(file_source & ist,
++get_token(rcs_file_source & ist,
+           string & str,
+           size_t & line,
+           size_t & col)
+@@ -303,14 +303,14 @@ struct parser
+ 
+ struct parser
+ {
+-  file_source & ist;
++  rcs_file_source & ist;
+   rcs_file & r;
+   string token;
+   token_type ttype;
+ 
+   size_t line, col;
+ 
+-  parser(file_source & s,
++  parser(rcs_file_source & s,
+          rcs_file & r)
+     : ist(s), r(r), line(1), col(1)
+   {}
+@@ -489,8 +489,8 @@ parse_rcs_file(string const & filename, 
+ parse_rcs_file(string const & filename, rcs_file & r)
+ {
+ #if defined(HAVE_MMAP) || defined(WIN32)
+-      file_handle handle(filename);
+-      file_source ifs(filename, handle.fd, handle.length);
++      rcs_file_handle handle(filename);
++      rcs_file_source ifs(filename, handle.fd, handle.length);
+ #else
+       ifstream ifs(filename.c_str());
+       ifs.unsetf(ios_base::skipws);
diff --git a/pkgs/applications/version-management/mr/default.nix b/pkgs/applications/version-management/mr/default.nix
index ca272504517..9e8024d7b19 100644
--- a/pkgs/applications/version-management/mr/default.nix
+++ b/pkgs/applications/version-management/mr/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchgit, fetchgitrevision, perl }:
+{ stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
 
-  version = "1.12";
+  version = "1.13";
   name = "mr-" + version;
 
-  src = fetchgit {
-    url = "git://git.kitenet.net/mr.git";
-    rev = "353f63c968368edea9b14261f510c34ce4e0c97f";
+  src = fetchurl {
+    url = "http://ftp.de.debian.org/debian/pool/main/m/mr/mr_${version}.tar.gz";
+    sha256 = "1q3qxk8dwbv30v2xxh852wnwl1msgkvk5cgxyicpqj8kh5b96zlz";
   };
 
   buildInputs = [perl];
@@ -17,12 +17,11 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    ensureDir $out/bin
-    ensureDir $out/share/man/man1
-    cp mr $out/bin
-    cp webcheckout $out/bin
-    cp mr.1 $out/share/man/man1
-    cp webcheckout.1 $out/share/man/man1
+    mkdir -pv $out/bin $out/share/man/man1
+    cp -v mr $out/bin
+    cp -v webcheckout $out/bin
+    cp -v mr.1 $out/share/man/man1
+    cp -v webcheckout.1 $out/share/man/man1
   '';
       
   meta = {
diff --git a/pkgs/applications/version-management/rcs/default.nix b/pkgs/applications/version-management/rcs/default.nix
index 4be4c0c5f69..afc7bca2d1a 100644
--- a/pkgs/applications/version-management/rcs/default.nix
+++ b/pkgs/applications/version-management/rcs/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "rcs-5.8";
+  name = "rcs-5.8.2";
 
   src = fetchurl {
     url = "mirror://gnu/rcs/${name}.tar.gz";
-    sha256 = "0q12nlghv4khxw5lk0y4949caghzg4jg0ripddi2h3q75vmfh6vh";
+    sha256 = "1p4kqqrvc7plc3n6ls4xwp6d3mw1jcx9p36pilwd65q31mgbs07a";
   };
 
   doCheck = true;
diff --git a/pkgs/applications/version-management/rcs/no-root.patch b/pkgs/applications/version-management/rcs/no-root.patch
deleted file mode 100644
index 2fbfc86ff45..00000000000
--- a/pkgs/applications/version-management/rcs/no-root.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-In NixOS chroot builds, there is no root account.  So configure should
-not rely on its existence in deciding whether to use getpwuid().
-
-diff -rc -x '*~' rcs-5.7-orig/src/conf.sh rcs-5.7/src/conf.sh
-*** rcs-5.7-orig/src/conf.sh	1995-06-16 08:19:24.000000000 +0200
---- rcs-5.7/src/conf.sh	2010-02-12 15:22:37.000000000 +0100
-***************
-*** 821,827 ****
-  	a= z=
-  	cat >a.c <<EOF
-  #include "$A_H"
-! int main() { exitmain(!getpwuid(0)); }
-  EOF
-  	$PREPARE_CC || exit
-  	if ($CL a.c $L && $aout) >&2
---- 821,827 ----
-  	a= z=
-  	cat >a.c <<EOF
-  #include "$A_H"
-! int main() { exitmain(!getpwuid(getuid())); }
-  EOF
-  	$PREPARE_CC || exit
-  	if ($CL a.c $L && $aout) >&2
diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix
index 50a5ae8f6c3..9743b73345c 100644
--- a/pkgs/applications/version-management/subversion/default.nix
+++ b/pkgs/applications/version-management/subversion/default.nix
@@ -21,13 +21,13 @@ assert compressionSupport -> neon.compressionSupport;
 
 stdenv.mkDerivation rec {
 
-  version = "1.7.5";
+  version = "1.7.9";
 
   name = "subversion-${version}";
 
   src = fetchurl {
     url = "mirror://apache/subversion//${name}.tar.bz2";
-    sha1 = "05c079762690d5ac1ccd2549742e7ef70fa45cf1";
+    sha1 = "453757bae78a800997559f2232483ab99238ec1e";
   };
 
   buildInputs = [ zlib apr aprutil sqlite ]
diff --git a/pkgs/applications/version-management/veracity/src-for-default.nix b/pkgs/applications/version-management/veracity/src-for-default.nix
index 395dda240b8..5a514e8728d 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="2.0.0.10822";
-   name="veracity-2.0.0.10822";
-   hash="0zgvrsjxfd1p9pflx1kxggmk953jhjk02h1hili9h1vdasvn2188";
-   url="http://download.sourcegear.com/Veracity/release/2.0.0.10822/veracity-source-${version}.tar.gz";
-   advertisedUrl="http://download.sourcegear.com/Veracity/release/2.0.0.10822/veracity-source-2.0.0.10822.tar.gz";
+   version="2.1.0.10979";
+   name="veracity-2.1.0.10979";
+   hash="15x3cwwjv9b0cbjx6insqk190wpnhwcm1z4b570hvw3lix3xnxhl";
+   url="http://download.sourcegear.com/Veracity/release/2.1.0.10979/veracity-source-${version}.tar.gz";
+   advertisedUrl="http://download.sourcegear.com/Veracity/release/2.1.0.10979/veracity-source-2.1.0.10979.tar.gz";
   
   
 }
diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix
deleted file mode 100644
index 566089201cd..00000000000
--- a/pkgs/applications/video/MPlayer/default.nix
+++ /dev/null
@@ -1,175 +0,0 @@
-{ alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
-, xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
-, stdenv, fetchurl, fetchsvn, fetchgit, x11, freetype, fontconfig, zlib
-, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
-, libXinerama ? null, libXrandr ? null, libdvdnav ? null
-, cdparanoia ? null, cddaSupport ? true
-, amrnb ? null, amrwb ? null, amrSupport ? false
-, x11Support ? true, libX11 ? null, libXext ? null
-, jackaudioSupport ? false, jackaudio ? null
-, x264Support ? false, x264 ? null
-, xvidSupport ? false, xvidcore ? null
-, lameSupport ? true, lame ? null
-, speexSupport ? true, speex ? null
-, screenSaverSupport ? true, libXScrnSaver
-, pulseSupport ? false, pulseaudio
-, mesa, pkgconfig, unzip, yasm, freefont_ttf
-, vdpauSupport ? false, libvdpau ? null
-}:
-
-assert alsaSupport -> alsaLib != null;
-assert x11Support -> libX11 != null;
-assert xvSupport -> (libXv != null && x11Support);
-assert theoraSupport -> libtheora != null;
-assert cacaSupport -> libcaca != null;
-assert xineramaSupport -> (libXinerama != null && x11Support);
-assert randrSupport -> (libXrandr != null && x11Support);
-assert dvdnavSupport -> libdvdnav != null;
-assert cddaSupport -> cdparanoia != null;
-assert jackaudioSupport -> jackaudio != null;
-assert amrSupport -> (amrnb != null && amrwb != null);
-assert screenSaverSupport -> libXScrnSaver != null;
-assert vdpauSupport -> libvdpau != null;
-assert speexSupport -> speex != null;
-
-let
-
-  codecs_src =
-    let
-      dir = http://www.mplayerhq.hu/MPlayer/releases/codecs/;
-    in
-    if stdenv.system == "i686-linux" then fetchurl {
-      url = "${dir}/essential-20071007.tar.bz2";
-      sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic";
-    } else if stdenv.system == "x86_64-linux" then fetchurl {
-      url = "${dir}/essential-amd64-20071007.tar.bz2";
-      sha256 = "13xf5b92w1ra5hw00ck151lypbmnylrnznq9hhb0sj36z5wz290x";
-    } else if stdenv.system == "powerpc-linux" then fetchurl {
-      url = "${dir}/essential-ppc-20071007.tar.bz2";
-      sha256 = "18mlj8dp4wnz42xbhdk1jlz2ygra6fbln9wyrcyvynxh96g1871z";
-    } else null;
-
-  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 = "9e53f62be1a171eaf9620958c225d42cf5142a30";
-    sha256 = "be0ef2a394c82a0eee0be66bc0b943d37efb90f74ce1030aa89606109434c943";
-  };
-
-  mplayerRev = "34586";
-
-in
-
-stdenv.mkDerivation rec {
-  name = "mplayer-${mplayerRev}";
-
-  src = fetchsvn {
-    # Old kind of URL:
-    # url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
-    # Snapshot I took on 20110423
-
-    #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 = "5688add3256b5de8e0410194232aaaeb01531bb507459ffe4f07e69cb2d81bd7";
-  };
-
-  prePatch = ''
-    sed -i /^_install_strip/d configure
-  '';
-
-  buildInputs =
-    [ freetype zlib pkgconfig ]
-    ++ stdenv.lib.optionals x11Support [ libX11 libXext mesa ]
-    ++ stdenv.lib.optional alsaSupport alsaLib
-    ++ stdenv.lib.optional xvSupport libXv
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional cacaSupport libcaca
-    ++ stdenv.lib.optional xineramaSupport libXinerama
-    ++ stdenv.lib.optional randrSupport libXrandr
-    ++ stdenv.lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
-    ++ stdenv.lib.optional cddaSupport cdparanoia
-    ++ stdenv.lib.optional jackaudioSupport jackaudio
-    ++ stdenv.lib.optionals amrSupport [ amrnb amrwb ]
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional pulseSupport pulseaudio
-    ++ stdenv.lib.optional screenSaverSupport libXScrnSaver
-    ++ stdenv.lib.optional lameSupport lame
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional speexSupport speex;
-
-  buildNativeInputs = [ yasm ];
-
-  preConfigure = ''
-    cp -r ${ffmpegGit} ffmpeg
-    chmod u+w -R ffmpeg
-    sed -ie '1i#include "libavutil/intreadwrite.h"' ffmpeg/libavcodec/libmp3lame.c
-  '';
-
-  postConfigure = ''
-    echo CONFIG_MPEGAUDIODSP=yes >> config.mak
-  '';
-
-  configureFlags = ''
-    ${if cacaSupport then "--enable-caca" else "--disable-caca"}
-    ${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
-    ${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""}
-    ${if codecs != null then "--codecsdir=${codecs}" else ""}
-    ${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""}
-    ${if x11Support then "--enable-x11" else ""}
-    ${stdenv.lib.optionalString speexSupport "--enable-speex"}
-    --disable-xanim
-    --disable-ivtv
-    --enable-vidix
-    --enable-fbdev
-    --disable-ossaudio
-  '';
-
-  NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
-
-  # Provide a reasonable standard font.  Maybe we should symlink here.
-  postInstall =
-    ''
-      mkdir -p $out/share/mplayer
-      cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
-    '';
-
-  crossAttrs = {
-    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/--codecsdir[^ ]\+//' \
-        -e 's/--enable-runtime-cpudetection//' `"
-      configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
-        --enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as
-        --disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc"
-    '';
-  };
-
-  meta = {
-    description = "A movie player that supports many video formats";
-    homepage = "http://mplayerhq.hu";
-    license = "GPL";
-    maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/video/RealPlayer/builder.sh b/pkgs/applications/video/RealPlayer/builder.sh
deleted file mode 100644
index 9929634921c..00000000000
--- a/pkgs/applications/video/RealPlayer/builder.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-source $stdenv/setup
-source $makeWrapper
-
-mkdir -p $out/real
-
-skip=143273 # Look for "BZh91" in the executable. 
-
-(dd bs=1 count=$skip of=/dev/null && dd) < $src | (cd $out/real && tar xvfj -)
-
-rm -rf $out/real/Bin $out/real/postinst
-
-patchelf --interpreter $(cat $NIX_GCC/nix-support/dynamic-linker) $out/real/realplay.bin
-
-mkdir -p $out/bin
-makeWrapper "$out/real/realplay.bin" "$out/bin/realplay" \
-    --set HELIX_LIBS "$out/real" \
-    --suffix-each LD_LIBRARY_PATH ':' "$(addSuffix /lib $libPath)"
-
-#echo "$libstdcpp5/lib" > $out/real/mozilla/extra-library-path # !!! must be updated, use patchelf --rpath
-echo "$out/bin" > $out/real/mozilla/extra-bin-path
diff --git a/pkgs/applications/video/RealPlayer/default.nix b/pkgs/applications/video/RealPlayer/default.nix
deleted file mode 100644
index 12d98bc3362..00000000000
--- a/pkgs/applications/video/RealPlayer/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{stdenv, fetchurl, libstdcpp5, glib, pango, atk, gtk, libX11}:
-
-# Note that RealPlayer 10 need libstdc++.so.5, i.e., GCC 3.3, not 3.4.
-
-assert stdenv.system == "i686-linux";
-
-(stdenv.mkDerivation {
-  name = "RealPlayer-10.0.8.805-GOLD";
-
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://software-dl.real.com/25ae61d70a6855a52c14/unix/RealPlayer10GOLD.bin;
-    md5 = "d28b31261059231a3e93c7466f8153e6";
-  };
-
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-
-  inherit libstdcpp5;
-  libPath = [libstdcpp5 glib pango atk gtk libX11];
-  
-}) // {mozillaPlugin = "/real/mozilla";}
diff --git a/pkgs/applications/video/avxsynth/default.nix b/pkgs/applications/video/avxsynth/default.nix
new file mode 100644
index 00000000000..70dcad49c97
--- /dev/null
+++ b/pkgs/applications/video/avxsynth/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, ffmpeg, autoconf, automake, libtool, pkgconfig, log4cpp
+, pango, cairo, python, libjpeg, ffms
+, enableQt ? true, qt4}:
+
+stdenv.mkDerivation rec {
+  name = "avxsynth-4.0-e153e672bf";
+
+  src = fetchurl {
+    url = https://github.com/avxsynth/avxsynth/tarball/e153e672bf;
+    name = "${name}.tar.gz";
+    sha256 = "16l2ld8k1nfsms6jd9d9r4l247xxbncsak66w87icr20yzyhs14s";
+  };
+
+  buildInputs = [ ffmpeg autoconf automake libtool pkgconfig log4cpp pango cairo python
+    libjpeg ffms ]
+    ++ stdenv.lib.optional enableQt qt4;
+
+  preConfigure = "autoreconf -vfi";
+
+  meta = {
+    homepage = https://github.com/avxsynth/avxsynth/wiki;
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/video/bangarang/default.nix b/pkgs/applications/video/bangarang/default.nix
index 2fe4b4d0bdc..5dde88076a1 100644
--- a/pkgs/applications/video/bangarang/default.nix
+++ b/pkgs/applications/video/bangarang/default.nix
@@ -1,13 +1,14 @@
 { stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, soprano, shared_desktop_ontologies, kdemultimedia, taglib, glibc, gettext }:
 stdenv.mkDerivation rec {
-  name = "bangarang-2.0";
+  name = "bangarang-2.1";
 
   src = fetchurl {
     url = "http://bangarangissuetracking.googlecode.com/files/${name}.tar.gz";
-    sha256 = "1fixqx56k0mk0faz35rzpdg6zaa0mvm4548rg0g7fhafl35fxzlz";
+    sha256 = "1g4pap79k8qaqi0py34xqvisxln1nc5hbvph692ah3af06n6cly1";
   };
 
-  buildInputs = [ cmake qt4 kdelibs automoc4 phonon soprano shared_desktop_ontologies kdemultimedia taglib glibc gettext ];
+  buildInputs = [ kdelibs phonon soprano shared_desktop_ontologies kdemultimedia taglib gettext ];
+  nativeBuildInputs = [ cmake ];
 
   meta = with stdenv.lib; {
     description = "A media player for KDE based on Nepomuk and Phonon";
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://bangarangkde.wordpress.com/;
     license = "GPLv3";
-    maintainers = [ maintainers.phreedom ];
+    maintainers = [ maintainers.phreedom maintainers.urkud ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/video/dvdauthor/build-against-libpng15.patch b/pkgs/applications/video/dvdauthor/build-against-libpng15.patch
deleted file mode 100644
index 8e62cef35af..00000000000
--- a/pkgs/applications/video/dvdauthor/build-against-libpng15.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit c82aaa4eb1a1c36bf7e2b7ae3c9140d0bf8000b5
-Author: Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
-Date:   Wed Jan 26 00:48:37 2011 +0000
-
-    fix to build against png-1.5 (thanks to Thomas Klausner)
-
-diff --git a/src/spuunmux.c b/src/spuunmux.c
-index 5e565d1..9ad2371 100644
---- a/src/spuunmux.c
-+++ b/src/spuunmux.c
-@@ -39,6 +39,7 @@
- #include <netinet/in.h>
- 
- #include <png.h>
-+#include <zlib.h>
- 
- #include "rgb.h"
- #include "common.h"
-@@ -610,7 +611,7 @@ static int write_png
-         png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
-         return -1;
-       } /*if*/
--    if (setjmp(png_ptr->jmpbuf))
-+    if (setjmp(png_jmpbuf(png_ptr)))
-       {
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         fclose(fp);
diff --git a/pkgs/applications/video/dvdauthor/default.nix b/pkgs/applications/video/dvdauthor/default.nix
index c72e9b892db..6889e4d9ef8 100644
--- a/pkgs/applications/video/dvdauthor/default.nix
+++ b/pkgs/applications/video/dvdauthor/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchurl, imagemagick, libdvdread, libxml2, freetype, fribidi, libpng, zlib }:
+{ stdenv, fetchurl, imagemagick, libdvdread, libxml2, freetype, fribidi, libpng, zlib, pkgconfig }:
 
-stdenv.mkDerivation {
-  name = "dvdauthor-0.7.0";
+stdenv.mkDerivation rec{
+  name = "dvdauthor-0.7.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/dvdauthor/dvdauthor-0.7.0.tar.gz;
-    sha256 = "1l1l5zya7lirwa1783pa7h22wrfcq8hibbf5kpx8z8zbk5xsz9mf";
+    url = "mirror://sourceforge/dvdauthor/${name}.tar.gz";
+    sha256 = "1s8zqlim0s3hk5sbdsilip3qqh0yv05l1jwx49d9rsy614dv27sh";
   };
 
-  buildInputs = [ imagemagick libdvdread libxml2 freetype fribidi libpng zlib ];
+  buildInputs = [ libpng freetype libdvdread libxml2 zlib fribidi imagemagick ];
+  nativeBuildInputs = [ pkgconfig ];
 
-  # Does not build against recent versions of libpng without patch.
-  patches = [ ./build-against-libpng15.patch ];
-
-  meta = { 
+  meta = {
     description = "Tools for generating DVD files to be played on standalone DVD players";
     homepage = http://dvdauthor.sourceforge.net/;
     license = ["GPLv2"];
diff --git a/pkgs/applications/video/gpac/default.nix b/pkgs/applications/video/gpac/default.nix
new file mode 100644
index 00000000000..6a863a5e2c4
--- /dev/null
+++ b/pkgs/applications/video/gpac/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchsvn, pkgconfig, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "gpac-0.5.0-svn";
+
+  src = fetchsvn {
+    url = "https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac";
+    rev = "4253";
+    sha256 = "0z4bd63c805q53hpb09gq0m0apy12z5a90zxx4jjx3ln64xq0pnn";
+  };
+
+  # this is the bare minimum configuration, as I'm only interested in MP4Box
+  # For most other functionality, this should probably be extended
+  nativeBuildInputs = [ pkgconfig zlib ];
+
+  meta = {
+    description = "Open Source multimedia framework for research and academic purposes";
+    longDescription = ''
+      GPAC is an Open Source multimedia framework for research and academic purposes.
+      The project covers different aspects of multimedia, with a focus on presentation
+      technologies (graphics, animation and interactivity) and on multimedia packaging
+      formats such as MP4.
+
+      GPAC provides three sets of tools based on a core library called libgpac:
+
+      A multimedia player, called Osmo4 / MP4Client,
+      A multimedia packager, called MP4Box,
+      And some server tools included in MP4Box and MP42TS applications.
+    '';
+    homepage = http://gpac.wp.mines-telecom.fr;
+    license = stdenv.lib.licenses.lgpl21;
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/video/kdenlive/default.nix b/pkgs/applications/video/kdenlive/default.nix
index d8620eb33cd..d7fab74e6ca 100644
--- a/pkgs/applications/video/kdenlive/default.nix
+++ b/pkgs/applications/video/kdenlive/default.nix
@@ -1,21 +1,23 @@
 { stdenv, fetchurl, lib, cmake, qt4, perl, kdelibs, automoc4, phonon
 , mlt, gettext , qimageblitz, qjson, shared_mime_info, soprano
-, pkgconfig }:
+, pkgconfig, shared_desktop_ontologies, libv4l }:
 
 stdenv.mkDerivation rec {
   name = "kdenlive-${version}";
-  version = "0.9.2";
+  version = "0.9.6";
 
   src = fetchurl {
-    url = "mirror://kde/stable/kdenlive/0.9.2/src/${name}.tar.bz2";
-    sha256 = "1h240s0c10z8sgvwmrfzam33qlx7j2a5b12lw1mk02ihs9hl43j1";
+    url = "mirror://kde/stable/kdenlive/${version}/src/${name}.tar.bz2";
+    sha256 = "1rw2cbzy5mabwijvryyzbhpgldn2zy5jy4j87hl4m1i8ah9lgi7x";
   };
 
-  buildInputs = 
+  buildInputs =
     [ cmake qt4 perl kdelibs automoc4 phonon mlt gettext qimageblitz
-      qjson shared_mime_info soprano pkgconfig 
+      qjson shared_mime_info soprano pkgconfig shared_desktop_ontologies libv4l
     ];
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Free and open source video editor";
     license = "GPLv2+";
diff --git a/pkgs/applications/video/key-mon/default.nix b/pkgs/applications/video/key-mon/default.nix
new file mode 100644
index 00000000000..7d0256ae455
--- /dev/null
+++ b/pkgs/applications/video/key-mon/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, buildPythonPackage, gnome, librsvg, makeWrapper, pygtk
+, pythonPackages }:
+
+buildPythonPackage rec {
+  name = "key-mon-${version}";
+  version = "1.13";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://key-mon.googlecode.com/files/${name}.tar.gz";
+    sha256 = "02h7lcnyqwyqsycd1vlvl11ms81v0zmr9p0pfyl5gmzry9dj7imj";
+  };
+
+  propagatedBuildInputs =
+    [ gnome.python_rsvg librsvg makeWrapper pygtk pythonPackages.xlib ];
+
+  doCheck = false;
+
+  postInstall = ''
+      wrapProgram $out/bin/key-mon --prefix GDK_PIXBUF_MODULE_FILE : \
+      ${librsvg}/lib/gdk-pixbuf/loaders.cache
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://code.google.com/p/key-mon;
+    description = "Utility to show live keyboard and mouse status for teaching and screencasts";
+    license = licenses.asl20;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/video/makemkv/builder.sh b/pkgs/applications/video/makemkv/builder.sh
new file mode 100644
index 00000000000..0e1898a4556
--- /dev/null
+++ b/pkgs/applications/video/makemkv/builder.sh
@@ -0,0 +1,38 @@
+source $stdenv/setup
+set -x
+
+lib=" \
+  makemkv-oss-${ver}/out/libdriveio.so.0 \
+  makemkv-oss-${ver}/out/libmakemkv.so.1 \
+  "
+
+bin=" \
+  makemkv-oss-${ver}/out/makemkv \
+  makemkv-bin-${ver}/bin/amd64/makemkvcon \
+  "
+
+tar xzf ${src_bin}
+tar xzf ${src_oss}
+
+(
+  cd makemkv-oss-${ver}
+  make -f makefile.linux
+)
+
+chmod +x ${bin}
+
+libPath="${libPath}:${out}/lib" # XXX: der. This should be in the nix file?
+
+for i in ${bin} ; do
+  patchelf \
+    --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+    --set-rpath $libPath \
+    ${i}
+done 
+
+ensureDir $out/bin
+ensureDir $out/lib
+ensureDir $out/share/MakeMKV
+cp ${lib} ${out}/lib
+cp ${bin} ${out}/bin
+cp makemkv-bin-${ver}/src/share/* $out/share/MakeMKV
diff --git a/pkgs/applications/video/makemkv/default.nix b/pkgs/applications/video/makemkv/default.nix
new file mode 100644
index 00000000000..43482bd9762
--- /dev/null
+++ b/pkgs/applications/video/makemkv/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl
+, openssl, qt4, mesa, zlib
+}:
+
+stdenv.mkDerivation rec {
+  name = "makemkv-${ver}";
+  ver = "1.8.0";
+  builder = ./builder.sh;
+
+  src_bin = fetchurl {
+    url = "http://www.makemkv.com/download/makemkv-bin-${ver}.tar.gz";
+    sha256 = "1f465rdv5ibnh5hnfmvmlid0yyzkansjw8l1mi5qd3bc6ca4k30c";
+  };
+
+  src_oss = fetchurl { 
+    url = "http://www.makemkv.com/download/makemkv-oss-${ver}.tar.gz";
+    sha256 = "0kj1mpkzz2cvi0ibdgdzfwbh9k2jfj3ra5m3hd7iyc5ng21v4sk3";
+  };
+
+  buildInputs = [openssl qt4 mesa zlib];
+
+  libPath = stdenv.lib.makeLibraryPath [stdenv.gcc.gcc openssl mesa qt4 zlib ] 
+          + ":" + stdenv.gcc.gcc + "/lib64";
+
+  meta = {
+    description = "convert blu-ray and dvd to mkv";
+    longDescription = ''
+      makemkv is a one-click QT application that transcodes an encrypted
+      blu-ray or DVD disc into a more portable set of mkv files, preserving
+      subtitles, chapter marks, all video and audio tracks.
+
+      Program is time-limited -- it will stop functioning after 60 days. You
+      can always download the latest version from makemkv.com that will reset the
+      expiration date.
+    '';
+    license = "unfree";
+    homepage = http://makemkv.com;
+  };
+}
diff --git a/pkgs/applications/video/mkvtoolnix/default.nix b/pkgs/applications/video/mkvtoolnix/default.nix
index 812826d7ec2..7d2eb514c94 100644
--- a/pkgs/applications/video/mkvtoolnix/default.nix
+++ b/pkgs/applications/video/mkvtoolnix/default.nix
@@ -4,7 +4,6 @@
 , libvorbis
 , file
 , boost
-, lzo
 , xdg_utils
 , expat
 , wxGTK
@@ -16,14 +15,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "mkvtoolnix-5.6.0";
+  name = "mkvtoolnix-6.2.0";
 
   src = fetchurl {
-    url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.bz2";
-    sha256 = "1hzwf4zaamny3qzmd6hyhy4hy9l67s3fjvznbi0avw0ad7g05i89";
+    url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.xz";
+    sha256 = "0864vmdcnfwk5cb2fv1y60yvp9kqcyaqxwbvy4nsj7bzwv1iqysn";
   };
 
-  buildInputs = [ libmatroska flac libvorbis file boost lzo xdg_utils expat wxGTK zlib ruby gettext pkgconfig curl ];
+  buildInputs = [ libmatroska flac libvorbis file boost xdg_utils expat wxGTK zlib ruby gettext pkgconfig curl ];
 
   configureFlags = "--with-boost-libdir=${boost}/lib";
   buildPhase = ''
@@ -39,4 +38,3 @@ stdenv.mkDerivation rec {
     homepage = http://www.bunkus.org/videotools/mkvtoolnix/;
   };
 }
-
diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
new file mode 100644
index 00000000000..a1ec200aaf0
--- /dev/null
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -0,0 +1,192 @@
+{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf
+, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
+, xineramaSupport ? true, libXinerama ? null
+, xvSupport ? true, libXv ? null
+, alsaSupport ? true, alsaLib ? null
+, screenSaverSupport ? true, libXScrnSaver ? null
+, vdpauSupport ? false, libvdpau ? null
+, cddaSupport ? true, cdparanoia ? null
+, dvdnavSupport ? true, libdvdnav ? null
+, bluraySupport ? true, libbluray ? null
+, amrSupport ? false, amrnb ? null, amrwb ? null
+, cacaSupport ? true, libcaca ? null
+, lameSupport ? true, lame ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, x264Support ? false, x264 ? null
+, jackaudioSupport ? false, jackaudio ? null
+, pulseSupport ? false, pulseaudio ? null
+, bs2bSupport ? false, libbs2b ? null
+# For screenshots
+, libpngSupport ? true, libpng ? null
+, useUnfreeCodecs ? false
+}:
+
+assert x11Support -> (libX11 != null && libXext != null && mesa != null);
+assert xineramaSupport -> (libXinerama != null && x11Support);
+assert xvSupport -> (libXv != null && x11Support);
+assert alsaSupport -> alsaLib != null;
+assert screenSaverSupport -> libXScrnSaver != null;
+assert vdpauSupport -> libvdpau != null;
+assert cddaSupport -> cdparanoia != null;
+assert dvdnavSupport -> libdvdnav != null;
+assert bluraySupport -> libbluray != null;
+assert amrSupport -> (amrnb != null && amrwb != null);
+assert cacaSupport -> libcaca != null;
+assert lameSupport -> lame != null;
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert x264Support -> x264 != null;
+assert jackaudioSupport -> jackaudio != null;
+assert pulseSupport -> pulseaudio != null;
+assert bs2bSupport -> libbs2b != null;
+assert libpngSupport -> libpng != null;
+
+let
+
+  codecs_src =
+    let
+      dir = http://www.mplayerhq.hu/MPlayer/releases/codecs/;
+    in
+    if stdenv.system == "i686-linux" then fetchurl {
+      url = "${dir}/essential-20071007.tar.bz2";
+      sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic";
+    } else if stdenv.system == "x86_64-linux" then fetchurl {
+      url = "${dir}/essential-amd64-20071007.tar.bz2";
+      sha256 = "13xf5b92w1ra5hw00ck151lypbmnylrnznq9hhb0sj36z5wz290x";
+    } else if stdenv.system == "powerpc-linux" then fetchurl {
+      url = "${dir}/essential-ppc-20071007.tar.bz2";
+      sha256 = "18mlj8dp4wnz42xbhdk1jlz2ygra6fbln9wyrcyvynxh96g1871z";
+    } else null;
+
+  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;
+
+in
+
+stdenv.mkDerivation rec {
+  name = "mplayer-1.1";
+
+  src = fetchurl {
+    # Old kind of URL:
+    # url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
+    # Snapshot I took on 20110423
+
+    #Transient
+    #url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
+    #sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
+
+    url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz";
+    sha256 = "173cmsfz7ckzy1hay9mpnc5as51127cfnxl20b521d2jvgm4gjvn";
+  };
+
+  prePatch = ''
+    sed -i /^_install_strip/d configure
+  '';
+
+  buildInputs = with stdenv.lib;
+    [ freetype pkgconfig ]
+    ++ optionals x11Support [ libX11 libXext mesa ]
+    ++ optional alsaSupport alsaLib
+    ++ optional xvSupport libXv
+    ++ optional theoraSupport libtheora
+    ++ optional cacaSupport libcaca
+    ++ optional xineramaSupport libXinerama
+    ++ optional dvdnavSupport libdvdnav
+    ++ optional bluraySupport libbluray
+    ++ optional cddaSupport cdparanoia
+    ++ optional jackaudioSupport jackaudio
+    ++ optionals amrSupport [ amrnb amrwb ]
+    ++ optional x264Support x264
+    ++ optional pulseSupport pulseaudio
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional lameSupport lame
+    ++ optional vdpauSupport libvdpau
+    ++ optional speexSupport speex
+    ++ optional libpngSupport libpng
+    ++ optional bs2bSupport libbs2b
+    ;
+
+  nativeBuildInputs = [ yasm ];
+
+  postConfigure = ''
+    echo CONFIG_MPEGAUDIODSP=yes >> config.mak
+  '';
+
+  configureFlags = with stdenv.lib;
+    ''
+      ${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"}
+      ${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"}
+      ${if xvSupport then "--enable-xv" else "--disable-xv"}
+      ${if alsaSupport then "--enable-alsa" else "--disable-alsa"}
+      ${if screenSaverSupport then "--enable-xss" else "--disable-xss"}
+      ${if vdpauSupport then "--enable-vdpau" else "--disable-vdpau"}
+      ${if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia"}
+      ${if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav"}
+      ${if bluraySupport then "--enable-bluray" else "--disable-bluray"}
+      ${if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb"}
+      ${if cacaSupport then "--enable-caca" else "--disable-caca"}
+      ${if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc"}
+      ${if speexSupport then "--enable-speex" else "--disable-speex"}
+      ${if theoraSupport then "--enable-theora" else "--disable-theora"}
+      ${if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc"}
+      ${if jackaudioSupport then "--enable-jack" else "--disable-jack"}
+      ${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
+      ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
+      ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
+      --enable-freetype
+      --disable-xanim
+      --disable-ivtv
+      --disable-xvid --disable-xvid-lavc
+      --enable-vidix
+      --enable-fbdev
+      --disable-ossaudio
+    '';
+
+  NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
+
+  installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui";
+
+  enableParallelBuilding = true;
+
+  # Provide a reasonable standard font.  Maybe we should symlink here.
+  postInstall =
+    ''
+      mkdir -p $out/share/mplayer
+      cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
+      if test -f $out/share/applications/mplayer.desktop ; then
+        echo "NoDisplay=True" >> $out/share/applications/mplayer.desktop
+      fi
+    '';
+
+  crossAttrs = {
+    dontSetConfigureCross = true;
+    # Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
+    preConfigure = ''
+      configureFlags="`echo $configureFlags |
+        sed -e 's/--codecsdir[^ ]\+//' \
+        -e 's/--enable-runtime-cpudetection//' `"
+      configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
+        --enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as
+        --disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc"
+    '';
+  };
+
+  meta = {
+    description = "A movie player that supports many video formats";
+    homepage = "http://mplayerhq.hu";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.urkud ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/mplayer2/default.nix b/pkgs/applications/video/mplayer2/default.nix
new file mode 100644
index 00000000000..24f53884e39
--- /dev/null
+++ b/pkgs/applications/video/mplayer2/default.nix
@@ -0,0 +1,137 @@
+{ stdenv, fetchurl, fetchgit, freetype, pkgconfig, yasm, freefont_ttf, ffmpeg, libass
+, python3, docutils, which
+, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null, libXxf86vm ? null
+, xineramaSupport ? true, libXinerama ? null
+, xvSupport ? true, libXv ? null
+, alsaSupport ? true, alsaLib ? null
+, screenSaverSupport ? true, libXScrnSaver ? null
+, vdpauSupport ? true, libvdpau ? null
+, dvdnavSupport ? true, libdvdnav ? null
+, bluraySupport ? true, libbluray ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, jackaudioSupport ? false, jackaudio ? null
+, pulseSupport ? true, pulseaudio ? null
+, bs2bSupport ? false, libbs2b ? null
+# For screenshots
+, libpngSupport ? true, libpng ? null
+, useUnfreeCodecs ? false
+}:
+
+assert x11Support -> (libX11 != null && libXext != null && mesa != null && libXxf86vm != null);
+assert xineramaSupport -> (libXinerama != null && x11Support);
+assert xvSupport -> (libXv != null && x11Support);
+assert alsaSupport -> alsaLib != null;
+assert screenSaverSupport -> libXScrnSaver != null;
+assert vdpauSupport -> libvdpau != null;
+assert dvdnavSupport -> libdvdnav != null;
+assert bluraySupport -> libbluray != null;
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert jackaudioSupport -> jackaudio != null;
+assert pulseSupport -> pulseaudio != null;
+assert bs2bSupport -> libbs2b != null;
+assert libpngSupport -> libpng != null;
+
+let
+
+  codecs_src =
+    let
+      dir = http://www.mplayerhq.hu/MPlayer/releases/codecs/;
+    in
+    if stdenv.system == "i686-linux" then fetchurl {
+      url = "${dir}/essential-20071007.tar.bz2";
+      sha256 = "18vls12n12rjw0mzw4pkp9vpcfmd1c21rzha19d7zil4hn7fs2ic";
+    } else if stdenv.system == "x86_64-linux" then fetchurl {
+      url = "${dir}/essential-amd64-20071007.tar.bz2";
+      sha256 = "13xf5b92w1ra5hw00ck151lypbmnylrnznq9hhb0sj36z5wz290x";
+    } else if stdenv.system == "powerpc-linux" then fetchurl {
+      url = "${dir}/essential-ppc-20071007.tar.bz2";
+      sha256 = "18mlj8dp4wnz42xbhdk1jlz2ygra6fbln9wyrcyvynxh96g1871z";
+    } else null;
+
+  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;
+
+in
+
+stdenv.mkDerivation rec {
+  name = "mplayer2-20130130";
+
+  src = fetchgit {
+    url = "git://git.mplayer2.org/mplayer2.git";
+    rev = "d3c580156c0b8777ff082426ebd61bb7ffe0c225";
+    sha256 = "1akf2mb2zklz609ks555vjvcs1gw8nwg5kbb9jwra8c4v1dfyhys";
+  };
+
+  prePatch = ''
+    sed -i /^_install_strip/d configure
+
+    sed -i '/stdlib/a#include <ctype.h>/' sub/sub*.c
+  '';
+
+  buildInputs = with stdenv.lib;
+    [ freetype pkgconfig ffmpeg libass docutils which ]
+    ++ optionals x11Support [ libX11 libXext mesa libXxf86vm ]
+    ++ optional alsaSupport alsaLib
+    ++ optional xvSupport libXv
+    ++ optional theoraSupport libtheora
+    ++ optional xineramaSupport libXinerama
+    ++ optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
+    ++ optional bluraySupport libbluray
+    ++ optional jackaudioSupport jackaudio
+    ++ optional pulseSupport pulseaudio
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional vdpauSupport libvdpau
+    ++ optional speexSupport speex
+    ++ optional bs2bSupport libbs2b
+    ++ optional libpngSupport libpng
+    ;
+
+  nativeBuildInputs = [ yasm python3 ];
+
+  postConfigure = ''
+    patchShebangs TOOLS
+  '';
+
+  configureFlags = with stdenv.lib;
+    ''
+      ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
+      ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
+      ${optionalString dvdnavSupport "--extra-ldflags=-ldvdread"}
+      ${if xvSupport then "--enable-xv" else "--disable-xv"}
+      ${if x11Support then "--enable-x11 --enable-gl --extra-cflags=-I{libx11}/include"
+		else "--disable-x11 --disable-gl"}
+      --disable-xvid
+      --disable-ossaudio
+    '';
+
+  NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
+
+  enableParallelBuilding = true;
+
+  # Provide a reasonable standard font.  Maybe we should symlink here.
+  postInstall =
+    ''
+      mkdir -p $out/share/mplayer
+      cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
+    '';
+
+  meta = {
+    description = "A movie player that supports many video formats (MPlayer fork)";
+    homepage = "http://mplayer2.org";
+    license = "GPLv3+";
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/mythtv/default.nix b/pkgs/applications/video/mythtv/default.nix
index 59a2519edb4..a4fe07b2d05 100644
--- a/pkgs/applications/video/mythtv/default.nix
+++ b/pkgs/applications/video/mythtv/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     libX11 libXv libXrandr libXvMC libXmu libXinerama libXxf86vm libXmu
   ];
 
-  buildNativeInputs = [ pkgconfig which ];
+  nativeBuildInputs = [ pkgconfig which ];
 
   patches = [ ./settings.patch ];
 }
diff --git a/pkgs/applications/video/omxplayer/default.nix b/pkgs/applications/video/omxplayer/default.nix
new file mode 100644
index 00000000000..b3880067cac
--- /dev/null
+++ b/pkgs/applications/video/omxplayer/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, fetchurl, raspberrypifw, pcre, boostHeaders, freetype, zlib }:
+
+let
+  ffmpeg = stdenv.mkDerivation rec {
+    name = "ffmpeg-1.1.3";
+    
+    src = fetchurl {
+      url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
+      sha256 = "03s1zsprz5p6gjgwwqcf7b6cvzwwid6l8k7bamx9i0f1iwkgdm0j";
+    };
+    
+    configureFlags = [
+      "--arch=arm"
+      "--cpu=arm1176jzf-s"
+      "--disable-muxers"
+      "--enable-muxer=spdif"
+      "--enable-muxer=adts"
+      "--disable-encoders"
+      "--enable-encoder=ac3"
+      "--enable-encoder=aac"
+      "--disable-decoder=mpeg_xvmc"
+      "--disable-devices"
+      "--disable-ffprobe"
+      "--disable-ffplay"
+      "--disable-ffserver"
+      "--disable-ffmpeg"
+      "--enable-shared"
+      "--disable-doc"
+      "--enable-postproc"
+      "--enable-gpl"
+      "--enable-protocol=http"
+      "--enable-pthreads"
+      "--disable-runtime-cpudetect"
+      "--enable-pic"
+      "--disable-armv5te"
+      "--disable-neon"
+      "--enable-armv6t2"
+      "--enable-armv6"
+      "--enable-hardcoded-tables"
+      "--disable-runtime-cpudetect"
+      "--disable-debug"
+    ];
+
+    enableParallelBuilding = true;
+      
+    crossAttrs = {
+      dontSetConfigureCross = true;
+      configureFlags = configureFlags ++ [
+        "--cross-prefix=${stdenv.cross.config}-"
+        "--enable-cross-compile"
+        "--target_os=linux"
+        "--arch=${stdenv.cross.arch}"
+        ];
+    };
+
+    meta = {
+      homepage = http://www.ffmpeg.org/;
+      description = "A complete, cross-platform solution to record, convert and stream audio and video";
+    };
+  };
+in
+stdenv.mkDerivation rec {
+  name = "omxplayer-20130328-fbee325dc2";
+  src = fetchurl {
+    url = https://github.com/huceke/omxplayer/tarball/fbee325dc2;
+    name = "${name}.tar.gz";
+    sha256 = "0fkvv8il7ffqxki2gp8cxa5shh6sz9jsy5vv3f4025g4gss6afkg";
+  };
+  patchPhase = ''
+    sed -i 1d Makefile
+    export INCLUDES="-I${raspberrypifw}/include/interface/vcos/pthreads -I${raspberrypifw}/include/interface/vmcs_host/linux/"
+  '';
+  installPhase = ''
+    ensureDir $out/bin
+    cp omxplayer.bin $out/bin
+  '';
+  buildInputs = [ raspberrypifw ffmpeg pcre boostHeaders freetype zlib ];
+
+  meta = {
+    homepage = https://github.com/huceke/omxplayer;
+    description = "Commandline OMX player for the Raspberry Pi";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch b/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch
deleted file mode 100644
index b1cfd49f1ba..00000000000
--- a/pkgs/applications/video/tvtime/tvtime-1.0.2+linux-headers-2.6.18.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Index: tvtime-1.0.2/src/videoinput.c
-===================================================================
---- tvtime-1.0.2.orig/src/videoinput.c
-+++ tvtime-1.0.2/src/videoinput.c
-@@ -35,8 +35,8 @@
- #ifdef HAVE_CONFIG_H
- # include "config.h"
- #endif
--#include "videodev.h"
--#include "videodev2.h"
-+#include <linux/videodev.h>
-+#include <linux/videodev2.h>
- #include "videoinput.h"
- #include "mixer.h"
- 
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 65357acf00f..3c96cd13418 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -5,16 +5,16 @@
 , 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, libdvbpsi, libdc1394, libraw1394
+, libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
 }:
 
 stdenv.mkDerivation rec {
   name = "vlc-${version}";
-  version = "2.0.3";
+  version = "2.0.6";
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/vlc/${version}/${name}.tar.xz";
-    sha256 = "1lnjfpizgp8slj6i4fgk5wld6nfw08wfhkb1i1dvzbhmfigq1agv";
+    sha256 = "0qqrpry41vawihhggcx00vibbn73hxdal1gim1qnrqrcbq1rik1i";
   };
 
   buildInputs =
@@ -24,10 +24,10 @@ stdenv.mkDerivation rec {
       udev gnutls avahi libcddb jackaudio SDL SDL_image libmtp unzip taglib
       libkate libtiger libv4l samba liboggz libass libdvbpsi libva
       xlibs.xlibs xlibs.libXv xlibs.libXvMC xlibs.libXpm xlibs.xcbutilkeysyms
-      libdc1394 libraw1394
+      libdc1394 libraw1394 libopus
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags =
     [ "--enable-alsa"
diff --git a/pkgs/applications/video/xbmc/default.nix b/pkgs/applications/video/xbmc/default.nix
new file mode 100644
index 00000000000..55734e49539
--- /dev/null
+++ b/pkgs/applications/video/xbmc/default.nix
@@ -0,0 +1,97 @@
+{ stdenv, lib, fetchurl, makeWrapper
+, pkgconfig, cmake, gnumake, yasm, python
+, boost, avahi, libdvdcss, lame
+, gettext, pcre, yajl, fribidi
+, openssl, gperf, tinyxml2, taglib, libssh, swig, jre
+, libX11, xproto, inputproto
+, libXt, libXmu, libXext, xextproto
+, libXinerama, libXrandr, randrproto
+, libXtst, libXfixes, fixesproto
+, SDL, SDL_image, SDL_mixer, alsaLib
+, mesa, glew, fontconfig, freetype, ftgl
+, libjpeg, jasper, libpng, libtiff
+, ffmpeg, libmpeg2, libsamplerate, libmad
+, libogg, libvorbis, flac
+, lzo, libcdio, libmodplug, libass
+, sqlite, mysql, nasm
+, curl, bzip2, zip, unzip, glxinfo, xdpyinfo
+, dbus_libs ? null, dbusSupport ? true
+, udev, udevSupport ? true
+, libusb ? null, usbSupport ? false
+, samba ? null, sambaSupport ? true
+# TODO: would be nice to have nfsSupport (needs libnfs library)
+# TODO: librtmp
+, libvdpau ? null, vdpauSupport ? true
+, pulseaudio ? null, pulseSupport ? false
+}:
+
+assert dbusSupport  -> dbus_libs != null;
+assert udevSupport  -> udev != null;
+assert usbSupport   -> libusb != null && ! udevSupport; # libusb won't be used if udev is avaliable
+assert sambaSupport -> samba != null;
+assert vdpauSupport -> libvdpau != null && ffmpeg.vdpauSupport;
+assert pulseSupport -> pulseaudio != null;
+
+stdenv.mkDerivation rec {
+    name = "xbmc-12.2";
+
+    src = fetchurl {
+      url = "http://mirrors.xbmc.org/releases/source/${name}.tar.gz";
+      sha256 = "077apkq9sx6wlwkwmiz63w5dcqbbrbjbn6qk9fj2fgaizhs0ccxj";
+    };
+
+    buildInputs = [
+      makeWrapper
+      pkgconfig cmake gnumake yasm python
+      boost
+      gettext pcre yajl fribidi
+      openssl gperf tinyxml2 taglib libssh swig jre
+      libX11 xproto inputproto
+      libXt libXmu libXext xextproto
+      libXinerama libXrandr randrproto
+      libXtst libXfixes fixesproto
+      SDL SDL_image SDL_mixer alsaLib
+      mesa glew fontconfig freetype ftgl
+      libjpeg jasper libpng libtiff
+      ffmpeg libmpeg2 libsamplerate libmad
+      libogg libvorbis flac
+      lzo libcdio libmodplug libass
+      sqlite mysql nasm avahi libdvdcss lame
+      curl bzip2 zip unzip glxinfo xdpyinfo
+    ]
+    ++ lib.optional dbusSupport dbus_libs
+    ++ lib.optional udevSupport udev
+    ++ lib.optional usbSupport libusb
+    ++ lib.optional sambaSupport samba
+    ++ lib.optional vdpauSupport libvdpau
+    ++ lib.optional pulseSupport pulseaudio;
+
+    dontUseCmakeConfigure = true;
+
+    configureFlags = [
+      "--enable-external-libraries"
+      "--disable-webserver"
+    ]
+    ++ lib.optional (! sambaSupport) "--disable-samba"
+    ++ lib.optional vdpauSupport "--enable-vdpau"
+    ++ lib.optional pulseSupport "--enable-pulse";
+
+    postInstall = ''
+      for p in $(ls $out/bin/) ; do
+        wrapProgram $out/bin/$p \
+          --prefix PATH ":" "${python}/bin" \
+          --prefix PATH ":" "${glxinfo}/bin" \
+          --prefix PATH ":" "${xdpyinfo}/bin" \
+          --prefix LD_LIBRARY_PATH ":" "${curl}/lib" \
+          --prefix LD_LIBRARY_PATH ":" "${libvdpau}/lib"
+      done
+    '';
+
+    meta = {
+      homepage = http://xbmc.org/;
+      description = "XBMC Media Center";
+      license = "GPLv2";
+      platforms = stdenv.lib.platforms.linux; 
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+}
diff --git a/pkgs/applications/video/xine-ui/default.nix b/pkgs/applications/video/xine-ui/default.nix
index 821e1c7bb0c..9307b9e1d1b 100644
--- a/pkgs/applications/video/xine-ui/default.nix
+++ b/pkgs/applications/video/xine-ui/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1i3byriqav06b55kwzs4dkzrjw7mmmcv0rc7jzb52hn8qp8xz34x";
   };
   
-  buildNativeInputs = [ pkgconfig shared_mime_info ];
+  nativeBuildInputs = [ pkgconfig shared_mime_info ];
 
   buildInputs =
     [ xineLib libpng readline ncurses curl lirc libjpeg
diff --git a/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch b/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch
deleted file mode 100644
index e72ac0250f5..00000000000
--- a/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ubr lxc-0.7.5-orig/src/lxc/Makefile.am lxc-0.7.5/src/lxc/Makefile.am
---- lxc-0.7.5-orig/src/lxc/Makefile.am	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/src/lxc/Makefile.am	2011-09-26 09:58:03.479916848 +0200
-@@ -115,7 +115,7 @@
- 
- install-exec-local: install-soPROGRAMS
- 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
--	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
-+	: /sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
- 	cd $(DESTDIR)$(libdir); \
- 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
- 
-diff -ubr lxc-0.7.5-orig/src/lxc/Makefile.in lxc-0.7.5/src/lxc/Makefile.in
---- lxc-0.7.5-orig/src/lxc/Makefile.in	2011-08-11 19:02:19.000000000 +0200
-+++ lxc-0.7.5/src/lxc/Makefile.in	2011-09-26 09:58:18.812685181 +0200
-@@ -1322,7 +1322,7 @@
- 
- install-exec-local: install-soPROGRAMS
- 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
--	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
-+	: /sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
- 	cd $(DESTDIR)$(libdir); \
- 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
- 
diff --git a/pkgs/applications/virtualization/lxc/fix-documentation-build.patch b/pkgs/applications/virtualization/lxc/fix-documentation-build.patch
deleted file mode 100644
index 0189b35a33e..00000000000
--- a/pkgs/applications/virtualization/lxc/fix-documentation-build.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -ubr '--exclude=*sgml*' lxc-0.7.5-orig/doc/Makefile.am lxc-0.7.5/doc/Makefile.am
---- lxc-0.7.5-orig/doc/Makefile.am	2011-02-14 09:14:07.000000000 +0100
-+++ lxc-0.7.5/doc/Makefile.am	2011-09-26 09:53:02.192817940 +0200
-@@ -30,13 +30,13 @@
- 
- 
- %.1 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- %.5 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- %.7 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- lxc-%.sgml : common_options.sgml see_also.sgml
- 
-diff -ubr '--exclude=*sgml*' lxc-0.7.5-orig/doc/Makefile.in lxc-0.7.5/doc/Makefile.in
---- lxc-0.7.5-orig/doc/Makefile.in	2011-08-11 19:02:18.000000000 +0200
-+++ lxc-0.7.5/doc/Makefile.in	2011-09-26 09:53:13.835401448 +0200
-@@ -786,13 +786,13 @@
- 
- 
- @ENABLE_DOCBOOK_TRUE@%.1 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@%.5 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@%.7 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@lxc-%.sgml : common_options.sgml see_also.sgml
- 
diff --git a/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch b/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch
deleted file mode 100644
index 4d2cce0dd62..00000000000
--- a/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch
+++ /dev/null
@@ -1,252 +0,0 @@
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-cgroup.sgml.in lxc-0.7.5/doc/lxc-cgroup.sgml.in
---- lxc-0.7.5-orig/doc/lxc-cgroup.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-cgroup.sgml.in	2011-09-26 10:05:01.753873426 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-checkpoint.sgml.in lxc-0.7.5/doc/lxc-checkpoint.sgml.in
---- lxc-0.7.5-orig/doc/lxc-checkpoint.sgml.in	2011-02-17 10:07:44.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-checkpoint.sgml.in	2011-09-26 10:05:01.753873426 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc.conf.sgml.in lxc-0.7.5/doc/lxc.conf.sgml.in
---- lxc-0.7.5-orig/doc/lxc.conf.sgml.in	2011-08-09 16:51:01.000000000 +0200
-+++ lxc-0.7.5/doc/lxc.conf.sgml.in	2011-09-26 10:05:01.754873476 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-console.sgml.in lxc-0.7.5/doc/lxc-console.sgml.in
---- lxc-0.7.5-orig/doc/lxc-console.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-console.sgml.in	2011-09-26 10:05:01.754873476 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-create.sgml.in lxc-0.7.5/doc/lxc-create.sgml.in
---- lxc-0.7.5-orig/doc/lxc-create.sgml.in	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-create.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-destroy.sgml.in lxc-0.7.5/doc/lxc-destroy.sgml.in
---- lxc-0.7.5-orig/doc/lxc-destroy.sgml.in	2010-10-08 11:54:53.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-destroy.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-execute.sgml.in lxc-0.7.5/doc/lxc-execute.sgml.in
---- lxc-0.7.5-orig/doc/lxc-execute.sgml.in	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-execute.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-freeze.sgml.in lxc-0.7.5/doc/lxc-freeze.sgml.in
---- lxc-0.7.5-orig/doc/lxc-freeze.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-freeze.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-kill.sgml.in lxc-0.7.5/doc/lxc-kill.sgml.in
---- lxc-0.7.5-orig/doc/lxc-kill.sgml.in	2010-10-08 11:54:53.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-kill.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-ls.sgml.in lxc-0.7.5/doc/lxc-ls.sgml.in
---- lxc-0.7.5-orig/doc/lxc-ls.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-ls.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-monitor.sgml.in lxc-0.7.5/doc/lxc-monitor.sgml.in
---- lxc-0.7.5-orig/doc/lxc-monitor.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-monitor.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-ps.sgml.in lxc-0.7.5/doc/lxc-ps.sgml.in
---- lxc-0.7.5-orig/doc/lxc-ps.sgml.in	2011-08-11 17:54:57.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-ps.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-restart.sgml.in lxc-0.7.5/doc/lxc-restart.sgml.in
---- lxc-0.7.5-orig/doc/lxc-restart.sgml.in	2011-02-17 10:07:44.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-restart.sgml.in	2011-09-26 10:05:01.757873626 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc.sgml.in lxc-0.7.5/doc/lxc.sgml.in
---- lxc-0.7.5-orig/doc/lxc.sgml.in	2010-10-26 18:07:35.000000000 +0200
-+++ lxc-0.7.5/doc/lxc.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-@@ -280,7 +280,7 @@
-       </para>
- 
-       <programlisting>
--
-+<![CDATA[
-    ---------
-   | STOPPED |<---------------
-    ---------                 |
-@@ -305,7 +305,7 @@
-    ----------                |
-        |                     |
-         ---------------------
--
-+]]>
-       </programlisting>
-     </refsect2>
- 
-@@ -570,7 +570,7 @@
- 	to the background.
- 
- 	<programlisting>
--
-+<![CDATA[
- 	  # launch lxc-wait in background
- 	  lxc-wait -n foo -s STOPPED &
- 	  LXC_WAIT_PID=$!
-@@ -583,7 +583,7 @@
- 	  # is STOPPED
- 	  wait $LXC_WAIT_PID
- 	  echo "'foo' is finished"
--
-+]]>
- 	</programlisting>
-       </para>
-     </refsect2>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-start.sgml.in lxc-0.7.5/doc/lxc-start.sgml.in
---- lxc-0.7.5-orig/doc/lxc-start.sgml.in	2011-02-01 15:12:40.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-start.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-stop.sgml.in lxc-0.7.5/doc/lxc-stop.sgml.in
---- lxc-0.7.5-orig/doc/lxc-stop.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-stop.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-unfreeze.sgml.in lxc-0.7.5/doc/lxc-unfreeze.sgml.in
---- lxc-0.7.5-orig/doc/lxc-unfreeze.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-unfreeze.sgml.in	2011-09-26 10:05:01.759873726 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-wait.sgml.in lxc-0.7.5/doc/lxc-wait.sgml.in
---- lxc-0.7.5-orig/doc/lxc-wait.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-wait.sgml.in	2011-09-26 10:05:01.759873726 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
diff --git a/pkgs/applications/virtualization/qemu/0.11.0.nix b/pkgs/applications/virtualization/qemu/0.11.0.nix
deleted file mode 100644
index bbcf1806452..00000000000
--- a/pkgs/applications/virtualization/qemu/0.11.0.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{stdenv, fetchurl, SDL, zlib, which}:
-
-stdenv.mkDerivation {
-  name = "qemu-0.11.0";
-
-  src = fetchurl {
-    url = http://download.savannah.gnu.org/releases/qemu/qemu-0.11.0.tar.gz;
-    sha256 = "1w3n61lzwvqg1ygn0vs8syybbmbcbk7lfyya098k201lp5rpwamw";
-  };
-
-  patchFlags = "-p2";
-  
-  buildInputs = [SDL zlib which];
-  
-  meta = {
-    description = "QEmu processor emulator";
-  };
-}
diff --git a/pkgs/applications/virtualization/qemu/0.13.nix b/pkgs/applications/virtualization/qemu/0.13.nix
deleted file mode 100644
index e1b63674969..00000000000
--- a/pkgs/applications/virtualization/qemu/0.13.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, fetchurl, SDL, zlib, which, ncurses }:
-
-stdenv.mkDerivation rec {
-  name = "qemu-0.13.0";
-
-  src = fetchurl {
-    url = "mirror://savannah/releases/qemu/${name}.tar.gz";
-    sha256 = "0xyqbwy78218ja6r9ya5p37j8hcd81l4cpw3ghvnxsjwn18mhvqy";
-  };
-
-  buildInputs = [ SDL zlib which ncurses ];
-
-  meta = {
-    description = "QEmu processor emulator";
-    license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/applications/virtualization/qemu/0.15.nix b/pkgs/applications/virtualization/qemu/0.15.nix
deleted file mode 100644
index f75b2129243..00000000000
--- a/pkgs/applications/virtualization/qemu/0.15.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, fetchurl, python, zlib, pkgconfig, glib, SDL, ncurses }:
-
-stdenv.mkDerivation rec {
-  name = "qemu-0.15.1";
-
-  src = fetchurl {
-    url = "http://wiki.qemu.org/download/${name}.tar.gz";
-    sha256 = "1fmm7l7hm0vsmahp41pgvbl62hh833k802brn6hg8kcfkd6v21bp";
-  };
-
-  buildInputs = [ python zlib pkgconfig glib SDL ncurses ];
-
-  meta = {
-    description = "QEmu processor emulator";
-    license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/applications/virtualization/qemu/1.0.nix b/pkgs/applications/virtualization/qemu/1.0.nix
deleted file mode 100644
index daa0b74ee32..00000000000
--- a/pkgs/applications/virtualization/qemu/1.0.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, fetchurl, python, zlib, pkgconfig, glib, SDL, ncurses }:
-
-stdenv.mkDerivation rec {
-  name = "qemu-1.0.1";
-
-  src = fetchurl {
-    url = "http://wiki.qemu.org/download/${name}.tar.gz";
-    sha256 = "0y43v5ls3j7iqczfswxkksiqww77nllydncygih7ylc20zhh528r";
-  };
-
-  buildInputs = [ python zlib pkgconfig glib SDL ncurses ];
-
-  meta = {
-    description = "QEmu processor emulator";
-    license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
new file mode 100644
index 00000000000..b1165b3535b
--- /dev/null
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, python, zlib, pkgconfig, glib, SDL, ncurses, perl, pixman }:
+
+stdenv.mkDerivation rec {
+  name = "qemu-1.4.0";
+
+  src = fetchurl {
+    url = "http://wiki.qemu.org/download/${name}.tar.bz2";
+    sha256 = "1a7d11vjs1p6i1ck2ff9annmkhpkbjl73hl9i1cbg3s0fznrfqh6";
+  };
+
+  buildInputs = [ python zlib pkgconfig glib SDL ncurses perl pixman ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "QEmu processor emulator";
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [ viric shlevy ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/virtualization/qemu/svn-6642.nix b/pkgs/applications/virtualization/qemu/svn-6642.nix
deleted file mode 100644
index 32d67234ba7..00000000000
--- a/pkgs/applications/virtualization/qemu/svn-6642.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv, fetchsvn, SDL, zlib, which}:
-
-stdenv.mkDerivation {
-  name = "qemu-svn-6642";
-
-  src = fetchsvn {
-  	url = "svn://svn.sv.gnu.org/qemu/trunk";
-	rev = "6642";
-	sha256 = "12445ad91feb72eecd1db0d4319a8fa5d7dc971b89228bd0e121b49c5da9705e";
-  };
-
-  patchFlags = "-p2";
-  
-  buildInputs = [SDL zlib which];
-  
-  meta = {
-    description = "QEmu processor emulator";
-  };
-}
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index 79ea777eead..195ee5d45c0 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = "make";
   
-  buildNativeInputs = [ makeWrapper pythonPackages.wrapPython ];
+  nativeBuildInputs = [ makeWrapper pythonPackages.wrapPython ];
 
   # patch the runner script in order to make wrapPythonPrograms work and run the program using a syscall
   # example code: /etc/nixos/nixpkgs/pkgs/development/interpreters/spidermonkey/1.8.0-rc1.nix
diff --git a/pkgs/applications/virtualization/virtinst/default.nix b/pkgs/applications/virtualization/virtinst/default.nix
index 2bb2adaa00a..26b16375e65 100644
--- a/pkgs/applications/virtualization/virtinst/default.nix
+++ b/pkgs/applications/virtualization/virtinst/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
       distutils_extra simplejson readline glance cheetah lockfile httplib2
       # !!! should libvirt be a build-time dependency?  Note that
       # libxml2Python is a dependency of libvirt.py. 
-      libvirt libxml2Python
+      libvirt libxml2Python urlgrabber
     ];
 
   buildInputs =
@@ -31,8 +31,9 @@ stdenv.mkDerivation rec {
   buildPhase = "python setup.py build";
 
   installPhase =
-    ''    
+    ''
        python setup.py install --prefix="$out";
+       wrapPythonPrograms
     '';
 
   meta = {
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 1067300a2ef..3dd020dfa10 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
-, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernel
+, libXcursor, libXmu, qt4, libIDL, SDL, libcap, zlib, libpng, glib, kernelDev, lvm2
 , which, alsaLib, curl, gawk
 , xorriso, makeself, perl, pkgconfig
 , javaBindings ? false, jdk ? null
 , pythonBindings ? false, python ? null
+, enableExtensionPack ? false, requireFile ? null, patchelf ? null
 }:
 
 with stdenv.lib;
 
 let
 
-  version = "4.1.20";
+  version = "4.2.12";
+  extpackRevision = "84980";
 
   forEachModule = action: ''
     for mod in \
@@ -29,24 +31,32 @@ let
     done
   '';
 
+  extensionPack = requireFile {
+    name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}"
+         + ".vbox-extpack";
+    # Has to be base16 because it's used as an input to VBoxExtPackHelperApp!
+    sha256 = "ad15a92e49095c2115bd1793b3b957d3eaf44af0f5d24bb53d6b4fc81c3e2fc4";
+    url = "https://www.virtualbox.org/wiki/Downloads";
+  };
+
 in stdenv.mkDerivation {
-  name = "virtualbox-${version}-${kernel.version}";
+  name = "virtualbox-${version}-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
-    sha256 = "b132dbc5c6e9ed77aba737ec35b488ac152aa362c3ad49d466897bc410324aeb";
+    sha256 = "eb65ecac94f63d6292a967d39cb5e28326404c10d0e8c2c50399eedb59c17ee6";
   };
 
   buildInputs =
     [ iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL
-      libcap glib kernel python alsaLib curl pam xorriso makeself perl
+      libcap glib kernelDev lvm2 python alsaLib curl pam xorriso makeself perl
       pkgconfig which libXmu ]
     ++ optional javaBindings jdk
     ++ optional pythonBindings python;
 
-  patchPhase = ''
+  prePatch = ''
     set -x
-    MODULES_BUILD_DIR=`echo ${kernel}/lib/modules/*/build`
+    MODULES_BUILD_DIR=`echo ${kernelDev}/lib/modules/*/build`
     sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
         -e 's@MKISOFS --version@MKISOFS -version@' \
         -e 's@PYTHONDIR=.*@PYTHONDIR=${if pythonBindings then python else ""}@' \
@@ -106,10 +116,25 @@ in stdenv.mkDerivation {
         ln -s "$libexec/$file" $out/bin/$file
     done
 
+    ${optionalString enableExtensionPack ''
+      "$libexec/VBoxExtPackHelperApp" install \
+        --base-dir "$libexec/ExtensionPacks" \
+        --cert-dir "$libexec/ExtPackCertificates" \
+        --name "Oracle VM VirtualBox Extension Pack" \
+        --tarball "${extensionPack}" \
+        --sha-256 "${extensionPack.outputHash}"
+    ''}
+
     # Create and fix desktop item
     mkdir -p $out/share/applications
     sed -i -e "s|Icon=VBox|Icon=$libexec/VBox.png|" $libexec/virtualbox.desktop
     ln -sfv $libexec/virtualbox.desktop $out/share/applications
+    # Icons
+    mkdir -p $out/share/icons/hicolor
+    for size in `ls -1 $libexec/icons`; do
+      mkdir -p $out/share/icons/hicolor/$size/apps
+      ln -s $libexec/icons/$size/*.png $out/share/icons/hicolor/$size/apps
+    done
   '';
 
   meta = {
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index 5b207e2e799..f3d7c18a2c6 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,16 +1,20 @@
-{ stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
-, libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor}:
+{ stdenv, fetchurl, lib, patchelf, cdrkit, kernelDev, which, makeWrapper
+, libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor
+, dbus }:
 
-let version = "4.1.18"; in
+let version = "4.2.12"; in
 
 stdenv.mkDerivation {
-  name = "VirtualBox-GuestAdditions-${version}";
+  name = "VirtualBox-GuestAdditions-${version}-${kernelDev.version}";
+
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "1zsjh4q71ny10s2zaxnaw4w3bs961c21xv6dd6zpwhnbimlhlrqb";
+    sha256 = "aed4730b643aca8daa0829e1122b7c8d592b9f6cea902a98e390c4d22373dfb8";
   };
-  KERN_DIR = "${kernel}/lib/modules/*/build";
-  buildInputs = [ patchelf cdrkit makeWrapper ];
+
+  KERN_DIR = "${kernelDev}/lib/modules/*/build";
+
+  buildInputs = [ patchelf cdrkit makeWrapper dbus ];
 
   installPhase = ''
     mkdir -p $out
@@ -53,7 +57,7 @@ stdenv.mkDerivation {
     cd ..
 
     # Change the interpreter for various binaries
-    for i in sbin/VBoxService bin/{VBoxClient,VBoxControl}
+    for i in sbin/VBoxService bin/{VBoxClient,VBoxControl} lib/VBoxGuestAdditions/mount.vboxsf
     do
         ${if stdenv.system == "i686-linux" then ''
           patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 $i
@@ -63,14 +67,12 @@ stdenv.mkDerivation {
         ''
         else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
         }
+        patchelf --set-rpath ${stdenv.gcc.gcc}/lib:${dbus}/lib:${libX11}/lib:${libXt}/lib:${libXext}/lib:${libXmu}/lib:${libXfixes}/lib:${libXrandr}/lib:${libXcursor}/lib $i
     done
 
-    # Change rpath for various binaries and libraries
-    patchelf --set-rpath ${stdenv.gcc.gcc}/lib:${libX11}/lib:${libXt}/lib:${libXext}/lib:${libXmu}/lib:${libXfixes}/lib:${libXrandr}/lib:${libXcursor}/lib bin/VBoxClient
-
     for i in lib/VBoxOGL*.so
     do
-        patchelf --set-rpath $out/lib $i
+        patchelf --set-rpath $out/lib:${dbus}/lib $i
     done
 
     # Remove references to /usr from various scripts and files
@@ -79,6 +81,7 @@ stdenv.mkDerivation {
 
     # Install binaries
     mkdir -p $out/sbin
+    install -m 4755 lib/VBoxGuestAdditions/mount.vboxsf $out/sbin/mount.vboxsf
     install -m 755 sbin/VBoxService $out/sbin
 
     mkdir -p $out/bin
@@ -101,9 +104,7 @@ stdenv.mkDerivation {
 
     # Install Xorg drivers
     mkdir -p $out/lib/xorg/modules/{drivers,input}
-    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_19.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
-    # There doesn't appear to be a vboxmouse driver for Xorg 1.9. Was there ever?
-    #install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_19.so $out/lib/xorg/modules/input/vboxmouse_drv.so
+    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_112.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
 
     # Install kernel modules
     cd src
@@ -111,7 +112,7 @@ stdenv.mkDerivation {
     for i in *
     do
         cd $i
-        kernelVersion=$(cd ${kernel}/lib/modules; ls)
+        kernelVersion=$(cd ${kernelDev}/lib/modules; ls)
         export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
         find . -type f | xargs sed -i -e "s|-o root||g" \
                                       -e "s|-g root||g"
diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix
index d898daad2a7..3cb16a6b442 100644
--- a/pkgs/applications/virtualization/xen/default.nix
+++ b/pkgs/applications/virtualization/xen/default.nix
@@ -6,7 +6,7 @@ with stdenv.lib;
 
 let
 
-  version = "4.1.2";
+  version = "4.0.3";
 
   libDir = if stdenv.is64bit then "lib64" else "lib";
 
@@ -30,24 +30,23 @@ let
       }
     ];
 
-  ipxeSrc =
-      { url = http://xenbits.xensource.com/xen-extfiles/ipxe-git-v1.0.0.tar.gz;
-        sha256 = "d3128bfda9a1542049c278755f85bbcbb8441da7bfd702d511ce237fcf86a723";
-      };
-in
+in 
 
 stdenv.mkDerivation {
   name = "xen-${version}";
 
   src = fetchurl {
     url = "http://bits.xensource.com/oss-xen/release/${version}/xen-${version}.tar.gz";
-    sha256 = "7d9c93057cf480d3f1efa792b19285a84fa3c06060ea5c5c453be00887389b0d";
+    sha256 = "0p4i7mm8cdsr8i9z3dij6nriyvz6la2rhm7jkyk2n8h62nnxi1b5";
   };
 
   patches =
     [ # Xen looks for headers in /usr/include and for libraries using
       # ldconfig.  Don't do that.
       ./has-header.patch
+
+      # GCC 4.5 compatibility.
+      ./gcc-4.5.patch
     ];
 
   buildInputs =
@@ -80,6 +79,9 @@ stdenv.mkDerivation {
       substituteInPlace tools/xenstat/Makefile \
         --replace /usr/include/curses.h ${ncurses}/include/curses.h
 
+      substituteInPlace tools/ioemu-qemu-xen/xen-hooks.mak \
+        --replace /usr/include/pci ${pciutils}/include/pci
+
       # Work around a bug in our GCC wrapper: `gcc -MF foo -v' doesn't
       # print the GCC version number properly.
       substituteInPlace xen/Makefile \
@@ -103,18 +105,12 @@ stdenv.mkDerivation {
         --replace 'XENDOM_CONFIG=/etc/sysconfig/xendomains' "" \
         --replace /bin/ls ls
 
-      grep -rl /etc/xen * | xargs sed -i 's|/etc/xen|$out/etc/xen|g'
-
       # Xen's stubdoms need various sources that it usually fetches at
       # build time using wget.  We can't have that.
       ${flip concatMapStrings stubdomSrcs (x: let src = fetchurl x; in ''
         cp ${src} stubdom/${src.name}
       '')}
 
-      ${let src = fetchurl ipxeSrc; in ''
-        cp ${src} tools/firmware/etherboot/ipxe.tar.gz
-      ''}
-
       # Hack to get `gcc -m32' to work without having 32-bit Glibc headers.
       mkdir -p tools/include/gnu
       touch tools/include/gnu/stubs-32.h
diff --git a/pkgs/applications/virtualization/xen/gcc-4.5.patch b/pkgs/applications/virtualization/xen/gcc-4.5.patch
new file mode 100644
index 00000000000..a8412d69fd3
--- /dev/null
+++ b/pkgs/applications/virtualization/xen/gcc-4.5.patch
@@ -0,0 +1,39 @@
+http://lists.xensource.com/archives/html/xen-devel/2010-07/msg01276.html
+
+diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c xen-4.0.1//extras/mini-os/arch/x86/mm.c
+--- xen-4.0.1-orig//extras/mini-os/arch/x86/mm.c	2010-08-25 12:22:07.000000000 +0200
++++ xen-4.0.1//extras/mini-os/arch/x86/mm.c	2010-12-22 20:10:05.000000000 +0100
+@@ -281,7 +281,7 @@
+ /*
+  * Mark portion of the address space read only.
+  */
+-extern void shared_info;
++extern char shared_info[PAGE_SIZE]; 
+ static void set_readonly(void *text, void *etext)
+ {
+     unsigned long start_address =
+diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/minios.mk xen-4.0.1//extras/mini-os/minios.mk
+--- xen-4.0.1-orig//extras/mini-os/minios.mk	2010-08-25 12:22:07.000000000 +0200
++++ xen-4.0.1//extras/mini-os/minios.mk	2010-12-22 20:03:11.000000000 +0100
+@@ -10,6 +10,7 @@
+ DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
+ DEF_CFLAGS += $(call cc-option,$(CC),-fgnu89-inline)
+ DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
++DEF_CFLAGS += -Wno-uninitialized
+ DEF_CPPFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
+ 
+ DEF_ASFLAGS += -D__ASSEMBLY__
+diff -ru -x '*~' xen-4.0.1-orig//extras/mini-os/netfront.c xen-4.0.1//extras/mini-os/netfront.c
+--- xen-4.0.1-orig//extras/mini-os/netfront.c	2010-08-25 12:22:07.000000000 +0200
++++ xen-4.0.1//extras/mini-os/netfront.c	2010-12-22 19:56:59.000000000 +0100
+@@ -25,8 +25,8 @@
+ 
+ 
+ 
+-#define NET_TX_RING_SIZE __RING_SIZE((struct netif_tx_sring *)0, PAGE_SIZE)
+-#define NET_RX_RING_SIZE __RING_SIZE((struct netif_rx_sring *)0, PAGE_SIZE)
++#define NET_TX_RING_SIZE __CONST_RING_SIZE(netif_tx, PAGE_SIZE)
++#define NET_RX_RING_SIZE __CONST_RING_SIZE(netif_rx, PAGE_SIZE)
+ #define GRANT_INVALID_REF 0
+ 
+ 
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index 5e24a42d3a7..61f2145ff33 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -48,3 +48,4 @@ stdenv.mkDerivation rec {
     platforms = with stdenv.lib.platforms; linux;
   };
 }
+
diff --git a/pkgs/applications/window-managers/compiz/bcop.nix b/pkgs/applications/window-managers/compiz/bcop.nix
deleted file mode 100644
index 254393d4c7f..00000000000
--- a/pkgs/applications/window-managers/compiz/bcop.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, libxslt }:
-
-stdenv.mkDerivation rec {
-  name = "compiz-bcop-0.8.4";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/components/compiz-bcop/${name}.tar.bz2";
-    sha256 = "0kwcvalmx2aab7j3x7s0xqm102i3kr5gh1z8mfws9q4qkqdclnfk";
-  };
-
-  buildInputs = [ pkgconfig libxslt ];
-    
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Code generator for Compiz plugins";
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/ccsm.nix b/pkgs/applications/window-managers/compiz/ccsm.nix
deleted file mode 100644
index 0406a170d19..00000000000
--- a/pkgs/applications/window-managers/compiz/ccsm.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ stdenv, fetchurl, makeWrapper, intltool, gtk
-, python, pygtk, pygobject, pycairo, compizconfig_python }:
-
-stdenv.mkDerivation rec {
-  name = "ccsm-0.8.4";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/components/ccsm/${name}.tar.bz2";
-    sha256 = "0vf16a2nmb0qwwxymvgl86nkfscj3n39jdw2q2p737pj5h1xmfa6";
-  };
-
-  buildInputs = [ makeWrapper python intltool gtk ];
-
-  buildPhase = "python setup.py build --prefix=$out";
-
-  pythonDeps = [ pygtk pygobject pycairo compizconfig_python ];
-
-  installPhase =
-    ''
-      python setup.py install --prefix=$out
-
-      wrapProgram $out/bin/ccsm --prefix PYTHONPATH ":" \
-          "$(toPythonPath "$pythonDeps $out")"
-    '';
-    
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Compiz settings manager";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/config-python.nix b/pkgs/applications/window-managers/compiz/config-python.nix
deleted file mode 100644
index 4de7fb41a48..00000000000
--- a/pkgs/applications/window-managers/compiz/config-python.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, xlibs, libcompizconfig, glib
-, python, pyrex }:
-
-stdenv.mkDerivation rec {
-  name = "compizconfig-python-0.8.4";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/components/compizconfig-python/${name}.tar.bz2";
-    sha256 = "0nkgqxddjw324aymzcy5nx6ilhfbpk9rra4qbzrq3l39xqsswd37";
-  };
-
-  buildInputs = [ pkgconfig libcompizconfig glib python pyrex xlibs.xlibs ];
-
-  NIX_LDFLAGS = "-lcompizconfig";
-
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Python interface to the Compiz configuration";
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/core.nix b/pkgs/applications/window-managers/compiz/core.nix
deleted file mode 100644
index d4a5b79b7fb..00000000000
--- a/pkgs/applications/window-managers/compiz/core.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, intltool, pkgconfig, xlibs, mesa, libxml2, libxslt
-, libstartup_notification, libpng, glib, gtk, gnome, dbus_glib, librsvg, bzip2 }:
-
-let version = "0.8.6"; in
-
-stdenv.mkDerivation {
-  name = "compiz-${version}";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/${version}/compiz-${version}.tar.bz2";
-    sha256 = "132gmdawjmrmvazm31h3r3wwq97h58hz17yyc9sa6q2nkfsnkpy4";
-  };
-
-  patches =
-    [ # Allow the path to the Compiz plugin library and metadata
-      # directories to be overriden through $COMPIZ_PLUGINDIR and
-      # $COMPIZ_METADATADIR, respectively.
-      ./plugindir-core.patch
-
-      # Fix compilation with recent GTK versions.
-      ./gdk-deprecated.patch
-    ];
-
-  buildInputs =
-    [ intltool pkgconfig libpng glib
-      gtk gnome.libwnck gnome.GConf dbus_glib librsvg bzip2
-    ];
-
-  propagatedBuildInputs =
-    [ xlibs.xlibs xlibs.libXfixes xlibs.libXrandr xlibs.libXrender
-      xlibs.libXdamage xlibs.libXcomposite xlibs.libXinerama
-      libstartup_notification mesa libxml2 libxslt 
-    ];
-
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "A compositing window manager";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/default.nix b/pkgs/applications/window-managers/compiz/default.nix
new file mode 100644
index 00000000000..46aa6e4d77e
--- /dev/null
+++ b/pkgs/applications/window-managers/compiz/default.nix
@@ -0,0 +1,60 @@
+{stdenv, fetchurl, cmake, pkgconfig
+, libXrender, renderproto, gtk, libwnck, pango, cairo
+, GConf, libXdamage, damageproto, libxml2, libxslt, glibmm
+, metacity
+, libstartup_notification, libpthreadstubs, libxcb, intltool
+, ORBit2, libXau
+, dbus, dbus_glib, librsvg, mesa
+, libXdmcp, libnotify, python
+, hicolor_icon_theme, libjpeg_turbo, libsigcxx, protobuf, pygtk, pythonDBus
+, xdg_utils
+, gettext, boost, pyrex
+, makeWrapper
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="compiz";
+    version="0.9.9.0";
+    name="compiz-${version}";
+    url="https://launchpad.net/compiz/0.9.9/${version}/+download/${name}.tar.bz2";
+    sha256="0nxv9lv0zwzs82p2d5g38sbvzbqgfs837xdgwc26lh5wdv31d93s";
+  };
+  buildInputs = [cmake pkgconfig
+    libXrender renderproto gtk libwnck pango cairo
+    GConf libXdamage damageproto libxml2 libxslt glibmm libstartup_notification
+    metacity
+    libpthreadstubs libxcb intltool
+    ORBit2 libXau
+    dbus dbus_glib librsvg mesa
+    libXdmcp libnotify python
+    hicolor_icon_theme libjpeg_turbo libsigcxx protobuf pygtk pythonDBus
+    xdg_utils
+    gettext boost pyrex
+    makeWrapper 
+    ];
+  in
+stdenv.mkDerivation rec {
+  inherit (s) name version;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  inherit buildInputs;
+
+  NIX_CFLAGS_COMPILE = " -Wno-error ";
+  NIX_CFLAGS_LINK = "-lm -ldl -pthread -lutil";
+  postInstall = ''
+    wrapProgram "$out/bin/ccsm" \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages"
+  '';
+
+  meta = {
+    description = "Compoziting window manager";
+    homepage = "http://launchpad.net/compiz/";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    inherit (s) version;
+  };
+}
diff --git a/pkgs/applications/window-managers/compiz/default.upstream b/pkgs/applications/window-managers/compiz/default.upstream
new file mode 100644
index 00000000000..b7fc98bd126
--- /dev/null
+++ b/pkgs/applications/window-managers/compiz/default.upstream
@@ -0,0 +1 @@
+url https://launchpad.net/compiz/+download
diff --git a/pkgs/applications/window-managers/compiz/gdk-deprecated.patch b/pkgs/applications/window-managers/compiz/gdk-deprecated.patch
deleted file mode 100644
index d80a5514ee9..00000000000
--- a/pkgs/applications/window-managers/compiz/gdk-deprecated.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-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/compiz/libcompizconfig.nix b/pkgs/applications/window-managers/compiz/libcompizconfig.nix
deleted file mode 100644
index 51d459e7a36..00000000000
--- a/pkgs/applications/window-managers/compiz/libcompizconfig.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl,intltool, pkgconfig, xlibs, libxml2, libxslt, compiz }:
-
-stdenv.mkDerivation rec {
-  name = "libcompizconfig-0.8.4";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/components/libcompizconfig/${name}.tar.bz2";
-    sha256 = "0adhl2nc2zrswl5n4a8ipymffq6yjwnxgpkv6rsk7sqvby9kwca1";
-  };
-
-  patches =
-    [ # See ./core.nix.
-      ./plugindir-libcompizconfig.patch
-    ];
-
-  buildInputs = [ pkgconfig intltool xlibs.libX11 compiz libxml2 libxslt ];
-
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Compiz configuration library";
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/plugindir-core.patch b/pkgs/applications/window-managers/compiz/plugindir-core.patch
deleted file mode 100644
index 5a242e66088..00000000000
--- a/pkgs/applications/window-managers/compiz/plugindir-core.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -ru -x '*~' compiz-0.8.6-orig/src/metadata.c compiz-0.8.6/src/metadata.c
---- compiz-0.8.6-orig/src/metadata.c	2010-03-28 14:15:35.000000000 +0200
-+++ compiz-0.8.6/src/metadata.c	2010-10-20 00:22:47.000000000 +0200
-@@ -146,7 +146,7 @@
- compAddMetadataFromFile (CompMetadata *metadata,
- 			 const char   *file)
- {
--    char *home;
-+    char *home, *metadatadir;
-     Bool status = FALSE;
- 
-     home = getenv ("HOME");
-@@ -163,7 +163,10 @@
- 	}
-     }
- 
--    status |= addMetadataFromFilename (metadata, METADATADIR, file);
-+    metadatadir = getenv("COMPIZ_METADATADIR");
-+    if (!metadatadir) metadatadir = METADATADIR;
-+
-+    status |= addMetadataFromFilename (metadata, metadatadir, file);
-     if (!status)
-     {
- 	compLogMessage ("core", CompLogLevelWarn,
-diff -ru -x '*~' compiz-0.8.6-orig/src/plugin.c compiz-0.8.6/src/plugin.c
---- compiz-0.8.6-orig/src/plugin.c	2010-03-28 14:15:35.000000000 +0200
-+++ compiz-0.8.6/src/plugin.c	2010-10-20 00:25:16.000000000 +0200
-@@ -579,7 +579,10 @@
- 	}
-     }
- 
--    status = (*loaderLoadPlugin) (p, PLUGINDIR, name);
-+    plugindir = getenv("COMPIZ_PLUGINDIR");
-+    if (!plugindir) plugindir = PLUGINDIR;
-+
-+    status = (*loaderLoadPlugin) (p, plugindir, name);
-     if (status)
- 	return p;
- 
diff --git a/pkgs/applications/window-managers/compiz/plugindir-libcompizconfig.patch b/pkgs/applications/window-managers/compiz/plugindir-libcompizconfig.patch
deleted file mode 100644
index 207816a3c51..00000000000
--- a/pkgs/applications/window-managers/compiz/plugindir-libcompizconfig.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -ru -x '*~' libcompizconfig-0.8.4-orig/src/compiz.cpp libcompizconfig-0.8.4/src/compiz.cpp
---- libcompizconfig-0.8.4-orig/src/compiz.cpp	2009-10-14 02:36:04.000000000 +0200
-+++ libcompizconfig-0.8.4/src/compiz.cpp	2010-10-20 00:35:28.000000000 +0200
-@@ -3004,7 +3004,10 @@
- 	    }
- 	}
- 
--	loadPluginFromXMLFile (context, xmlName, (char *) METADATADIR);
-+        char *metadatadir = getenv("COMPIZ_METADATADIR");
-+        if (!metadatadir) metadatadir = METADATADIR;
-+
-+	loadPluginFromXMLFile (context, xmlName, metadatadir);
- 	free (xmlName);
-     }
- 
-@@ -3031,7 +3034,10 @@
- 	    free (homeplugins);
- 	}
-     }
--    loadPluginsFromXMLFiles (context, (char *)METADATADIR);
-+    
-+    char *metadatadir = getenv("COMPIZ_METADATADIR");
-+    if (!metadatadir) metadatadir = METADATADIR;
-+    loadPluginsFromXMLFiles (context, metadatadir);
- 
-     if (home && strlen (home))
-     {
-@@ -3043,7 +3049,10 @@
- 	    free (homeplugins);
- 	}
-     }
--    loadPluginsFromName (context, (char *)PLUGINDIR);
-+
-+    char *plugindir = getenv("COMPIZ_PLUGINDIR");
-+    if (!plugindir) plugindir = PLUGINDIR;
-+    loadPluginsFromName (context, plugindir);
- }
- 
- static void
diff --git a/pkgs/applications/window-managers/compiz/plugins-extra.nix b/pkgs/applications/window-managers/compiz/plugins-extra.nix
deleted file mode 100644
index 8852ebd474e..00000000000
--- a/pkgs/applications/window-managers/compiz/plugins-extra.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ stdenv, fetchurl, intltool, pkgconfig, compiz, compiz_bcop
-, compiz_plugins_main, getopt, libjpeg, cairo, pango, gnome }:
-
-let version = "0.8.6"; in
-
-stdenv.mkDerivation rec {
-  name = "compiz-plugins-extra-${version}";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/${version}/${name}.tar.bz2";
-    sha256 = "1qbxfi332bbadm0ah48frnrl9dkczl111s5a91a0cqz5v7nbw4g1";
-  };
-
-  patches =
-    [ # Support scaling wallpapers to the maximum size while still
-      # respecting the aspect ratio.
-      ./wallpaper-maxpect.patch
-    ];
-
-  NIX_CFLAGS_COMPILE = "-I${compiz_plugins_main}/include/compiz";
-
-  buildInputs =
-    [ intltool pkgconfig compiz compiz_bcop compiz_plugins_main getopt gnome.GConf ];
-
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Extra plugins for Compiz";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/plugins-main.nix b/pkgs/applications/window-managers/compiz/plugins-main.nix
deleted file mode 100644
index ea1c01e7414..00000000000
--- a/pkgs/applications/window-managers/compiz/plugins-main.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl, intltool, pkgconfig, compiz, compiz_bcop
-, getopt, libjpeg, cairo, pango, gnome }:
-
-let version = "0.8.6"; in
-
-stdenv.mkDerivation rec {
-  name = "compiz-plugins-main-${version}";
-
-  src = fetchurl {
-    url = "http://releases.compiz.org/${version}/${name}.tar.bz2";
-    sha256 = "1nfn3r4q7wvzfkdh9hrm5zc816xa8cs2s7cliz0fmnqikcs4zp36";
-  };
-
-  buildInputs =
-    [ intltool pkgconfig compiz compiz_bcop getopt libjpeg cairo pango gnome.GConf ];
-
-  meta = {
-    homepage = http://www.compiz.org/;
-    description = "Main plugins for Compiz";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/window-managers/compiz/wallpaper-maxpect.patch b/pkgs/applications/window-managers/compiz/wallpaper-maxpect.patch
deleted file mode 100644
index 8130dff1dba..00000000000
--- a/pkgs/applications/window-managers/compiz/wallpaper-maxpect.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -x '*~' -ru compiz-plugins-extra-0.8.6-orig/metadata/wallpaper.xml.in compiz-plugins-extra-0.8.6/metadata/wallpaper.xml.in
---- compiz-plugins-extra-0.8.6-orig/metadata/wallpaper.xml.in	2010-03-29 16:09:17.000000000 +0200
-+++ compiz-plugins-extra-0.8.6/metadata/wallpaper.xml.in	2010-10-21 00:23:18.000000000 +0200
-@@ -24,7 +24,7 @@
- 					<_long>Image position.</_long>
- 					<type>int</type>
- 					<min>0</min>
--					<max>4</max>
-+					<max>5</max>
- 					<desc>
- 						<value>0</value>
- 						<_name>Scale and Crop</_name>
-@@ -45,6 +45,10 @@
- 						<value>4</value>
- 						<_name>Center Tiled</_name>
- 					</desc>
-+					<desc>
-+						<value>5</value>
-+						<_name>Centered Maxpect</_name>
-+					</desc>
- 				</option>
- 				<option name="bg_fill_type" type="list">
- 					<_short>Fill type</_short>
-diff -x '*~' -ru compiz-plugins-extra-0.8.6-orig/src/wallpaper/wallpaper.c compiz-plugins-extra-0.8.6/src/wallpaper/wallpaper.c
---- compiz-plugins-extra-0.8.6-orig/src/wallpaper/wallpaper.c	2010-03-29 16:09:18.000000000 +0200
-+++ compiz-plugins-extra-0.8.6/src/wallpaper/wallpaper.c	2010-10-21 01:09:10.000000000 +0200
-@@ -697,12 +697,12 @@
- 	    tmpMatrix = back->imgTex.matrix;
- 
- 
--	    if (back->imagePos == BgImagePosScaleAndCrop)
-+	    if ((back->imagePos == BgImagePosScaleAndCrop) || (back->imagePos == BgImagePosCenteredMaxpect))
- 	    {
- 		s1 = (float) s->width / back->width;
- 		s2 = (float) s->height / back->height;
- 		
--		s1 = MAX (s1, s2);
-+		s1 = back->imagePos == BgImagePosScaleAndCrop ? MAX (s1, s2) : MIN (s1, s2);
- 
- 		tmpMatrix.xx /= s1;
- 		tmpMatrix.yy /= s1;
-@@ -711,6 +711,16 @@
- 		tmpMatrix.x0 -= x * tmpMatrix.xx;
- 		y = (s->height - ((int)back->height * s1)) / 2.0;
- 		tmpMatrix.y0 -= y * tmpMatrix.yy;
-+
-+                if (back->imagePos == BgImagePosCenteredMaxpect)
-+                {
-+                    reg = &tmpRegion;
-+		
-+                    tmpRegion.extents.x1 = MAX (0, x);
-+                    tmpRegion.extents.y1 = MAX (0, y);
-+                    tmpRegion.extents.x2 = MIN (s->width, x + ((int) back->width * s1));
-+                    tmpRegion.extents.y2 = MIN (s->height, y + ((int) back->height * s1));
-+                }
- 	    }
- 	    else if (back->imagePos == BgImagePosScaled)
- 	    {
diff --git a/pkgs/applications/window-managers/dwm/confnotify-6.0.patch b/pkgs/applications/window-managers/dwm/confnotify-6.0.patch
new file mode 100644
index 00000000000..5b5e2ebb68a
--- /dev/null
+++ b/pkgs/applications/window-managers/dwm/confnotify-6.0.patch
@@ -0,0 +1,36 @@
+Fix SDL fullscreen problems when the resolution changes:
+https://groups.google.com/d/msg/wmii/nJBrSjrnnq8/ZEYWOWE5pj4J
+
+diff -r ec4baab78314 dwm.c
+--- a/dwm.c	Mon Dec 19 15:38:30 2011 +0100
++++ b/dwm.c	Sat Jan 14 12:35:50 2012 +0100
+@@ -397,9 +397,10 @@
+ 		showhide(m->stack);
+ 	else for(m = mons; m; m = m->next)
+ 		showhide(m->stack);
+-	if(m)
++	if(m) {
+ 		arrangemon(m);
+-	else for(m = mons; m; m = m->next)
++		restack(m);
++	} else for(m = mons; m; m = m->next)
+ 		arrangemon(m);
+ }
+ 
+@@ -408,7 +409,6 @@
+ 	strncpy(m->ltsymbol, m->lt[m->sellt]->symbol, sizeof m->ltsymbol);
+ 	if(m->lt[m->sellt]->arrange)
+ 		m->lt[m->sellt]->arrange(m);
+-	restack(m);
+ }
+ 
+ void
+@@ -1827,6 +1827,8 @@
+ 		.event_mask = ButtonPressMask|ExposureMask
+ 	};
+ 	for(m = mons; m; m = m->next) {
++		if (m->barwin)
++			continue;
+ 		m->barwin = XCreateWindow(dpy, root, m->wx, m->by, m->ww, bh, 0, DefaultDepth(dpy, screen),
+ 		                          CopyFromParent, DefaultVisual(dpy, screen),
+ 		                          CWOverrideRedirect|CWBackPixmap|CWEventMask, &wa);
diff --git a/pkgs/applications/window-managers/dwm/default.nix b/pkgs/applications/window-managers/dwm/default.nix
index db469268350..82eb9e56935 100644
--- a/pkgs/applications/window-managers/dwm/default.nix
+++ b/pkgs/applications/window-managers/dwm/default.nix
@@ -1,7 +1,10 @@
 {stdenv, fetchurl, libX11, libXinerama, patches ? []}:
 
-stdenv.mkDerivation rec {
+let
   name = "dwm-6.0";
+in
+stdenv.mkDerivation {
+  inherit name;
  
   src = fetchurl {
     url = "http://dl.suckless.org/dwm/${name}.tar.gz";
@@ -13,7 +16,7 @@ stdenv.mkDerivation rec {
   prePatch = ''sed -i "s@/usr/local@$out@" config.mk'';
 
   # Allow users set their own list of patches
-  inherit patches;
+  patches = [ ./confnotify-6.0.patch ] ++ patches;
 
   buildPhase = " make ";
  
diff --git a/pkgs/applications/window-managers/fvwm/default.nix b/pkgs/applications/window-managers/fvwm/default.nix
new file mode 100644
index 00000000000..33acd000270
--- /dev/null
+++ b/pkgs/applications/window-managers/fvwm/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, pkgconfig
+, cairo, fontconfig, freetype, libXft, libXcursor, libXinerama
+, libXpm, librsvg, libpng, fribidi, perl
+}:
+
+stdenv.mkDerivation rec {
+  name = "fvwm-2.6.5";
+
+  src = fetchurl {
+    url = "ftp://ftp.fvwm.org/pub/fvwm/version-2/${name}.tar.bz2";
+    sha256 = "1ks8igvmzm0m0sra05k8xzc8vkqy3gv1qskl6davw1irqnarjm11";
+  };
+
+  buildInputs = [
+    pkgconfig cairo fontconfig freetype
+    libXft libXcursor libXinerama libXpm
+    librsvg libpng fribidi perl
+  ];
+
+  meta = {
+    homepage = "http://fvwm.org";
+    description = "A multiple large virtual desktop window manager";
+    license = "GPLv2+";
+  };
+}
+
diff --git a/pkgs/applications/window-managers/i3/default.nix b/pkgs/applications/window-managers/i3/default.nix
index 14fd6ce4193..9f9aaa5d665 100644
--- a/pkgs/applications/window-managers/i3/default.nix
+++ b/pkgs/applications/window-managers/i3/default.nix
@@ -1,19 +1,22 @@
-{ fetchurl, stdenv, which, pkgconfig, libxcb, xcbutilkeysyms, xcbutil, bison,
-  xcbutilwm, libstartup_notification, libX11, pcre, libev, yajl, flex,
-  libXcursor, coreutils, perl }:
+{ fetchurl, stdenv, which, pkgconfig, libxcb, xcbutilkeysyms, xcbutil,
+  xcbutilwm, libstartup_notification, libX11, pcre, libev, yajl,
+  libXcursor, coreutils, perl, pango }:
 
 stdenv.mkDerivation rec {
-  name = "i3-4.2";
+  name = "i3-${version}";
+  version = "4.5.1";
 
   src = fetchurl {
     url = "http://i3wm.org/downloads/${name}.tar.bz2";
-    sha256 = "e02c832820e8922a44e744e555294f8580c2f8e218c5c1029e52f1bde048732b";
+    sha256 = "bae55f1c7c4a21d71aae182e4fab6038ba65ba4be5d1ceff9e269f4f74b823f2";
   };
 
-  buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil bison xcbutilwm
-    libstartup_notification libX11 pcre libev yajl flex libXcursor perl ];
+  buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil xcbutilwm
+    libstartup_notification libX11 pcre libev yajl libXcursor perl pango ];
 
-  patchPhase = "patchShebangs .";
+  patchPhase = ''
+    patchShebangs .
+  '';
 
   configurePhase = "makeFlags=PREFIX=$out";
 
@@ -22,6 +25,7 @@ stdenv.mkDerivation rec {
     homepage = "http://i3wm.org";
     maintainers = [ stdenv.lib.maintainers.garbas ];
     license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.all;
   };
 
 }
diff --git a/pkgs/applications/window-managers/i3/lock.nix b/pkgs/applications/window-managers/i3/lock.nix
index 12e4c91e24d..2331b1eaf81 100644
--- a/pkgs/applications/window-managers/i3/lock.nix
+++ b/pkgs/applications/window-managers/i3/lock.nix
@@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
     homepage = http://i3wm.org;
     maintainers = [ stdenv.lib.maintainers.garbas ];
     license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.all;
   };
 
 }
diff --git a/pkgs/applications/window-managers/i3/status.nix b/pkgs/applications/window-managers/i3/status.nix
index 549cfc5d20d..7317f17bb8b 100644
--- a/pkgs/applications/window-managers/i3/status.nix
+++ b/pkgs/applications/window-managers/i3/status.nix
@@ -2,11 +2,11 @@
   }:
 
 stdenv.mkDerivation rec {
-  name = "i3status-2.5.1";
+  name = "i3status-2.7";
 
   src = fetchurl {
     url = "http://i3wm.org/i3status/${name}.tar.bz2";
-    sha256 = "7734efdf79a77617023f1e6d80080251eab3a05defb67313283568511d3e58f2";
+    sha256 = "0cm6fhsc7hzsqni8pwhjl2l0rfd458paabn54cgzqnmwwdflwgq7";
   };
 
   buildInputs = [ confuse yajl alsaLib wirelesstools ];
@@ -19,6 +19,7 @@ stdenv.mkDerivation rec {
     homepage = http://i3wm.org;
     maintainers = [ stdenv.lib.maintainers.garbas ];
     license = stdenv.lib.licenses.bsd3;
+    platforms = stdenv.lib.platforms.all;
   };
 
 }
diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix
index 0b541d8104d..3b1c3b4ad37 100644
--- a/pkgs/applications/window-managers/icewm/default.nix
+++ b/pkgs/applications/window-managers/icewm/default.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
     sha256 = "0yw813d8amrl0n1fvdiyznxah92wcylj9kj1qhjc6h73d827h6na";
   };
 
+  patches = [ ./deprecated.patch ];
+
   NIX_LDFLAGS = "-lfontconfig";
 
   # The fuloong2f is not supported by 1.3.6 still
diff --git a/pkgs/applications/window-managers/icewm/deprecated.patch b/pkgs/applications/window-managers/icewm/deprecated.patch
new file mode 100644
index 00000000000..7d22dfe719b
--- /dev/null
+++ b/pkgs/applications/window-managers/icewm/deprecated.patch
@@ -0,0 +1,23 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-wm/icewm/files/icewm-1.2.37-libX11-1.5.0-deprecated.patch?revision=1.1
+
+Description: Don't use "deprecated" as identifier, will FTBFS if another
+ library defines functions as deprecated.
+Author: Andreas Moog <amoog@ubuntu.com>
+Bug: https://sourceforge.net/tracker/?func=detail&aid=3494034&group_id=31&atid=100031
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/935179
+Forwarded: Yes
+
+--- icewm-1.3.7.orig/src/base.h
++++ icewm-1.3.7/src/base.h
+@@ -2,9 +2,9 @@
+ #define __BASE_H
+ 
+ #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+-#define deprecated __attribute__((deprecated))
++#define ICEWM_deprecated __attribute__((deprecated))
+ #else
+-#define deprecated
++#define ICEWM_deprecated
+ #endif
+ 
+ /*** Atomar Data Types ********************************************************/
diff --git a/pkgs/applications/window-managers/ion-3/default.nix b/pkgs/applications/window-managers/ion-3/default.nix
index e6714536cad..b4dabb300c1 100644
--- a/pkgs/applications/window-managers/ion-3/default.nix
+++ b/pkgs/applications/window-managers/ion-3/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, x11, lua, gettext, groff }:
 
 stdenv.mkDerivation {
-  name = "ion-3rc-20070902";
+  name = "ion-3-20090110";
   meta = {
     description = "Ion is a tiling tabbed window manager designed with keyboard users in mind.";
     homepage = http://modeemi.fi/~tuomov/ion;
   };
   src = fetchurl {
-    url = http://iki.fi/tuomov/dl/ion-3rc-20070902.tar.gz;
-    sha256 = "062a0rgxzz4h1hih5lp7l2nfvhz095brag9fmnanzqc4dac228xl";
+    url = http://tuomov.iki.fi/software/dl/ion-3-20090110.tar.gz;
+    sha256 = "1nkks5a95986nyfkxvg2rik6zmwx0lh7szd5fji7yizccwzc9xns";
   };
   buildInputs = [ x11 lua gettext groff ];
   buildFlags = "LUA_DIR=${lua} X11_PREFIX=/no-such-path PREFIX=\${out}";
diff --git a/pkgs/applications/window-managers/openbox/default.nix b/pkgs/applications/window-managers/openbox/default.nix
index 016325140e0..e8314ef1b43 100644
--- a/pkgs/applications/window-managers/openbox/default.nix
+++ b/pkgs/applications/window-managers/openbox/default.nix
@@ -1,13 +1,19 @@
-{ stdenv, fetchurl, pkgconfig, glib, pango, libxml2, libXau }:
+{ stdenv, fetchurl, pkgconfig
+, libxml2, libXinerama, libXcursor, libXau, libXrandr
+, imlib2, pango, libstartup_notification }:
 
 stdenv.mkDerivation rec {
-  name = "openbox-3-4-11-2";
+  name = "openbox-3.5.0";
 
-  buildInputs = [ pkgconfig glib pango libxml2 libXau ];
+  buildInputs = [
+    pkgconfig libxml2
+    libXinerama libXcursor libXau libXrandr
+    imlib2 pango libstartup_notification
+  ];
 
   src = fetchurl {
-    url = http://openbox.org/dist/openbox/openbox-3.4.11.2.tar.gz;
-    sha256 = "2e7579389c30e6bb08cc721a2c1af512e049fec2670e71715aa1c4e129ec349d";
+    url = "http://openbox.org/dist/openbox/${name}.tar.gz";
+    sha256 = "02pa1wa2rzvnq1z3xchzafc96hvp3537jh155q8acfhbacb01abg";
   };
 
   meta = {
diff --git a/pkgs/applications/window-managers/wmii/builder.sh b/pkgs/applications/window-managers/wmii/builder.sh
deleted file mode 100644
index be21a9c9fad..00000000000
--- a/pkgs/applications/window-managers/wmii/builder.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-source $stdenv/setup
-
-postUnpack() {
-cd $sourceRoot
-
-cat >> config.mk << EOF
-PREFIX=
-DESTDIR=${out}
-
-CFLAGS = -DVERSION=\\"\${VERSION}\\"
-
-LDFLAGS = -lm -lX11 -lixp
-
-AWKPATH=${gawk}/bin/gawk
-CONFPREFIX = /etc
-MANPREFIX = /share/man
-EOF
-
-cd ..
-}
-
-postUnpack=postUnpack
-
-genericBuild
diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix
index a490bc8018d..0b8b71db7e9 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -1,25 +1,23 @@
-{ cabal, extensibleExceptions, mtl, utf8String, X11, xmessage }:
+{ cabal, extensibleExceptions, filepath, mtl, utf8String, X11 }:
 
 cabal.mkDerivation (self: {
   pname = "xmonad";
-  version = "0.10";
-  sha256 = "19z5y36pybsm93x6hlj5hzyys9r4ag7hkdib5spsnryk2mv72xj6";
+  version = "0.11";
+  sha256 = "1nsv88y2b206n3s5hrsp5ginvz1bj818ns7jmikavb2g33akdgg5";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ extensibleExceptions mtl utf8String X11 ];
+  buildDepends = [
+    extensibleExceptions filepath mtl utf8String X11
+  ];
+  postInstall = ''
+    mkdir -p $out/share/man/man1
+    mv $out/share/xmonad-*/man/*.1 $out/share/man/man1/
+  '';
   meta = {
     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
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
-
-  preConfigure = ''
-    substituteInPlace XMonad/Core.hs --replace \
-      '"xmessage"' '"${xmessage}/bin/xmessage"'
-  '';
 })
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
index 11c8531ad17..218e2126a15 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xmonad-contrib";
-  version = "0.10";
-  sha256 = "0lp7qr69rpjy4s3knhdgh2bp6zs81xp0az1lisv4a2i7i1ys7hfq";
+  version = "0.11.1";
+  sha256 = "1356dn8ipw7fgn2xijppn69f64zg36gcxbw9qndxbbmml5gq0zrl";
   buildDepends = [
     extensibleExceptions mtl random utf8String X11 X11Xft xmonad
   ];
@@ -14,6 +14,9 @@ cabal.mkDerivation (self: {
     description = "Third party extensions for xmonad";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
index 42ffeae6f9c..f4aed5a1850 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
@@ -4,18 +4,22 @@
 
 cabal.mkDerivation (self: {
   pname = "xmonad-extras";
-  version = "0.10.1.1";
-  sha256 = "1pkp9z58w2x8yhxhvm5nifxb1qcajv52ji53n77rjhpysvrgq5m7";
+  version = "0.11";
+  sha256 = "09r64z09mfdz86k7v5c6zds9ng0fjcp44kd8f5qg1sz40yblrny5";
   buildDepends = [
     hint libmpd mtl network parsec random regexPosix split X11 xmonad
     xmonadContrib
   ];
-  configureFlags = "-f-with_hlist";
+  configureFlags = "-f-with_hlist -fwith_split -fwith_parsec";
+  jailbreak = 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 ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/build-support/builder-defs/builder-defs.nix b/pkgs/build-support/builder-defs/builder-defs.nix
index 7d0f138880d..3c5d7af621c 100644
--- a/pkgs/build-support/builder-defs/builder-defs.nix
+++ b/pkgs/build-support/builder-defs/builder-defs.nix
@@ -20,21 +20,21 @@ let inherit (builtins) head tail trace; in
                 else if (hasSuffixHack ".tar.gz" s) || (hasSuffixHack ".tgz" s) then "tgz" 
                 else if (hasSuffixHack ".tar.bz2" s) || (hasSuffixHack ".tbz2" s) || 
 			(hasSuffixHack ".tbz" s) then "tbz2"
-                else if (hasSuffixHack ".tar.Z" s) then "tZ" 
-                else if (hasSuffixHack ".tar.lzma" s) then "tar.lzma"
-                else if (hasSuffixHack ".tar.xz" s) then "tar.xz"
+                else if hasSuffixHack ".tar.Z" s then "tZ" 
+                else if hasSuffixHack ".tar.lzma" s then "tar.lzma"
+                else if hasSuffixHack ".tar.xz" s then "tar.xz"
                 else if (hasSuffixHack ".zip" s) || (hasSuffixHack ".ZIP" s) then "zip"
-                else if (hasSuffixHack "-cvs-export" s) then "cvs-dir"
-                else if (hasSuffixHack "-git-export" s) then "git-dir"
-                else if (hasSuffixHack ".nar.bz2" s) then "narbz2"
-                else if (hasSuffixHack ".rpm" s) then "rpm"
+                else if hasSuffixHack "-cvs-export" s then "cvs-dir"
+                else if hasSuffixHack "-git-export" s then "git-dir"
+                else if hasSuffixHack ".nar.bz2" s then "narbz2"
+                else if hasSuffixHack ".rpm" s then "rpm"
 
                 # Mostly for manually specified directories..
-                else if (hasSuffixHack "/" s) then "dir"
+                else if hasSuffixHack "/" s then "dir"
 
                 # Last block - for single files!! It should be always after .tar.*
-                else if (hasSuffixHack ".bz2" s) then "plain-bz2"
-                else if (hasSuffixHack ".gz" s) then "plain-gz"
+                else if hasSuffixHack ".bz2" s then "plain-bz2"
+                else if hasSuffixHack ".gz" s then "plain-gz"
 
 		# For bootstrap calls
 		else if (s ==("" + (substring 0 0 s))) then "empty"
@@ -391,7 +391,7 @@ let inherit (builtins) head tail trace; in
 
         cmakeFlags = attrByPath ["cmakeFlags"] [] args;
 
-        cmakeRPathFlag = if (attrByPath ["cmakeSkipRpath "] true args) then " -DCMAKE_SKIP_BUILD_RPATH=ON " else "";
+        cmakeRPathFlag = if attrByPath ["cmakeSkipRpath "] true args then " -DCMAKE_SKIP_BUILD_RPATH=ON " else "";
 
         cmakeBuildDir = attrByPath ["cmakeBuildDir"] "build" args;
 
@@ -508,7 +508,7 @@ let inherit (builtins) head tail trace; in
         );
 
 	builderDefsPackage = bd: func:
-	  if (builtins.isFunction func) then 
+	  if builtins.isFunction func then 
 	    (foldArgs 
 	      (x: y: ((func (bd // x // y)) // y))
               (innerBuilderDefsPackage bd)
@@ -588,7 +588,7 @@ let inherit (builtins) head tail trace; in
      url = srcInfo.url;
      sha256 = srcInfo.hash;
    } // 
-   (if (srcInfo ? downloadName) then {name = srcInfo.downloadName;} else {}));
+   (if srcInfo ? downloadName then {name = srcInfo.downloadName;} else {}));
 
    fetchGitFromSrcInfo = srcInfo: fetchgit {
      url = srcInfo.url;
diff --git a/pkgs/build-support/cabal/default.nix b/pkgs/build-support/cabal/default.nix
index 8ae8c06d513..ca985181a53 100644
--- a/pkgs/build-support/cabal/default.nix
+++ b/pkgs/build-support/cabal/default.nix
@@ -1,6 +1,13 @@
 # generic builder for Cabal packages
 
-{stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, enableLibraryProfiling ? false} :
+{ stdenv, fetchurl, lib, pkgconfig, ghc, Cabal, jailbreakCabal
+, enableLibraryProfiling ? false
+, enableCheckPhase ? true
+}:
+
+# The Cabal library shipped with GHC versions older than 7.x doesn't accept the --enable-tests configure flag.
+assert enableCheckPhase -> stdenv.lib.versionOlder "7" ghc.ghcVersion;
+
 {
   mkDerivation =
     args : # arguments for the individual package, can modify the defaults
@@ -8,7 +15,7 @@
         # environment overly, but also to keep hash-backwards-compatible with the old cabal.nix.
         internalAttrs = [
           "internalAttrs" "buildDepends" "buildTools" "extraLibraries" "pkgconfigDepends"
-          "isLibrary" "isExecutable"
+          "isLibrary" "isExecutable" "testDepends"
         ];
 
         # Stuff happening after the user preferences have been processed. We remove
@@ -18,6 +25,7 @@
           x : (removeAttrs x internalAttrs) // {
                 buildInputs           = stdenv.lib.filter (y : ! (y == null)) x.buildInputs;
                 propagatedBuildInputs = stdenv.lib.filter (y : ! (y == null)) x.propagatedBuildInputs;
+                doCheck               = enableCheckPhase && x.doCheck;
               };
 
         defaults =
@@ -44,7 +52,9 @@
             # the default download location for Cabal packages is Hackage,
             # you still have to specify the checksum
             src = fetchurl {
-              url = "http://hackage.haskell.org/packages/archive/${self.pname}/${self.version}/${self.fname}.tar.gz";
+              # cannot use mirrors system because of subtly different directory structures
+              urls = ["http://hackage.haskell.org/packages/archive/${self.pname}/${self.version}/${self.fname}.tar.gz"
+                      "http://hdiff.luite.com/packages/archive/${self.pname}/${self.fname}.tar.gz"];
               inherit (self) sha256;
             };
 
@@ -53,6 +63,7 @@
             # but often propagatedBuildInputs is preferable anyway
             buildInputs = [ghc Cabal] ++ self.extraBuildInputs;
             extraBuildInputs = self.buildTools ++
+                               (stdenv.lib.optionals self.doCheck self.testDepends) ++
                                (if self.pkgconfigDepends == [] then [] else [pkgconfig]) ++
                                (if self.isLibrary then [] else self.buildDepends ++ self.extraLibraries ++ self.pkgconfigDepends);
 
@@ -66,6 +77,9 @@
             # build-depends Cabal field
             buildDepends = [];
 
+            # build-depends Cabal fields stated in test-suite stanzas
+            testDepends = [];
+
             # build-tools Cabal field
             buildTools = [];
 
@@ -78,30 +92,46 @@
             isLibrary = ! self.isExecutable;
             isExecutable = false;
 
-            libraryProfiling =
-              if enableLibraryProfiling then ["--enable-library-profiling"]
-                                        else ["--disable-library-profiling"];
+            # ignore version restrictions on the build inputs that the cabal file might specify
+            jailbreak = false;
+
+            # pass the '--enable-split-objs' flag to cabal in the configure stage
+            enableSplitObjs = !(  stdenv.isDarwin         # http://hackage.haskell.org/trac/ghc/ticket/4013
+                               || stdenv.lib.versionOlder "7.6.99" ghc.ghcVersion  # -fsplit-ojbs is broken in 7.7 snapshot
+                               );
+
+            # pass the '--enable-tests' flag to cabal in the configure stage
+            # and run any regression test suites the package might have
+            doCheck = enableCheckPhase;
+
+            extraConfigureFlags = [
+              (stdenv.lib.enableFeature enableLibraryProfiling "library-profiling")
+              (stdenv.lib.enableFeature self.enableSplitObjs "split-objs")
+            ] ++ stdenv.lib.optional (stdenv.lib.versionOlder "7" ghc.ghcVersion) (stdenv.lib.enableFeature self.doCheck "tests");
 
             # compiles Setup and configures
             configurePhase = ''
               eval "$preConfigure"
 
+              ${lib.optionalString self.jailbreak "${jailbreakCabal}/bin/jailbreak-cabal ${self.pname}.cabal"}
+
               for i in Setup.hs Setup.lhs; do
                 test -f $i && ghc --make $i
               done
 
-              for p in $extraBuildInputs $propagatedBuildNativeInputs; do
+              for p in $extraBuildInputs $propagatedNativeBuildInputs; do
                 if [ -d "$p/include" ]; then
-                  extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
+                  extraConfigureFlags+=" --extra-include-dir=$p/include"
                 fi
                 for d in lib{,64}; do
                   if [ -d "$p/$d" ]; then
-                    extraLibDirs="$extraLibDirs --extra-lib-dir=$p/$d"
+                    extraConfigureFlags+=" --extra-lib-dir=$p/$d"
                   fi
                 done
               done
 
-              ./Setup configure --verbose --prefix="$out" $libraryProfiling $extraLibDirs $configureFlags
+              echo "configure flags: $extraConfigureFlags $configureFlags"
+              ./Setup configure --verbose --prefix="$out" $extraConfigureFlags $configureFlags
 
               eval "$postConfigure"
             '';
@@ -118,6 +148,14 @@
               eval "$postBuild"
             '';
 
+            checkPhase = stdenv.lib.optional self.doCheck ''
+              eval "$preCheck"
+
+              ./Setup test
+
+              eval "$postCheck"
+            '';
+
             # installs via Cabal; creates a registration file for nix-support
             # so that the package can be used in other Haskell-builds; also
             # adds all propagated build inputs to the user environment packages
@@ -142,8 +180,8 @@
             '';
 
             postFixup = ''
-              if test -f $out/nix-support/propagated-build-native-inputs; then
-                ln -s $out/nix-support/propagated-build-native-inputs $out/nix-support/propagated-user-env-packages
+              if test -f $out/nix-support/propagated-native-build-inputs; then
+                ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
               fi
             '';
 
diff --git a/pkgs/build-support/checker/default.nix b/pkgs/build-support/checker/default.nix
index 4f95c3b95ee..66f8c45e37b 100644
--- a/pkgs/build-support/checker/default.nix
+++ b/pkgs/build-support/checker/default.nix
@@ -8,14 +8,14 @@ with lib;
 
 let 
   findInList = p: list: default:
-       if (list == []) then default else
+       if list == [] then default else
        if (p (head list)) then (head list) else
        findInList p (tail list) default;
   
 
   checkAttrInclusion = s: a: b:
 	(
-	if (! isAttrs b) then s else
+	if ! isAttrs b then s else
 	if (lib.attrByPath ["_type"] "" b) == "option" then "" else
 	findInList (x : x != "") 
 		( map (x: if (x == "servicesProposal") # this attr will be checked at another place ( -> upstart-jobs/default.nix )
diff --git a/pkgs/build-support/clang-wrapper/default.nix b/pkgs/build-support/clang-wrapper/default.nix
index 165e3bace90..9f560d0d2fb 100644
--- a/pkgs/build-support/clang-wrapper/default.nix
+++ b/pkgs/build-support/clang-wrapper/default.nix
@@ -47,11 +47,11 @@ stdenv.mkDerivation {
     else shell;
 
   crossAttrs = {
-    shell = shell.hostDrv + shell.hostDrv.shellPath;
-    libc = libc.hostDrv;
-    coreutils = coreutils.hostDrv;
-    binutils = binutils.hostDrv;
-    clang = clang.hostDrv;
+    shell = shell.crossDrv + shell.crossDrv.shellPath;
+    libc = libc.crossDrv;
+    coreutils = coreutils.crossDrv;
+    binutils = binutils.crossDrv;
+    clang = clang.crossDrv;
     #
     # This is not the best way to do this. I think the reference should be
     # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
diff --git a/pkgs/build-support/clang-wrapper/utils.sh b/pkgs/build-support/clang-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/clang-wrapper/utils.sh
+++ b/pkgs/build-support/clang-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/fetchbzr/builder.sh b/pkgs/build-support/fetchbzr/builder.sh
index 88aab7891b4..17567fdadd2 100644
--- a/pkgs/build-support/fetchbzr/builder.sh
+++ b/pkgs/build-support/fetchbzr/builder.sh
@@ -4,6 +4,6 @@ header "exporting \`$url' (revision $revision) into \`$out'"
 
 # Perform a lightweight checkout so that we don't end up importing
 # all the repository's history.
-bzr checkout --lightweight "$url" -r "$revision" "$out"
+bzr -Ossl.cert_reqs=none export -r "$revision" --format=dir "$out" "$url"
 
 stopNest
diff --git a/pkgs/build-support/fetchbzr/nix-prefetch-bzr b/pkgs/build-support/fetchbzr/nix-prefetch-bzr
index 167892fbb79..9ff86c20ae3 100755
--- a/pkgs/build-support/fetchbzr/nix-prefetch-bzr
+++ b/pkgs/build-support/fetchbzr/nix-prefetch-bzr
@@ -50,12 +50,7 @@ if test -z "$finalPath"; then
     trap "rm -rf $tmpPath" EXIT
 
     # Perform the checkout.
-    if test "$NIX_PREFETCH_BZR_LEAVE_DOT_BZR" != 1
-    then
-        bzr export $revarg "$tmpFile" "$url" >&2
-    else
-        bzr checkout --lightweight $revarg "$url" "$tmpFile" >&2
-    fi
+    bzr -Ossl.cert_reqs=none export $revarg --format=dir "$tmpFile" "$url"
 
     # Compute the hash.
     hash=$(nix-hash --type $hashType $hashFormat $tmpFile)
diff --git a/pkgs/build-support/fetchdarcs/builder.sh b/pkgs/build-support/fetchdarcs/builder.sh
index a211de42da4..efff5ff5ebf 100644
--- a/pkgs/build-support/fetchdarcs/builder.sh
+++ b/pkgs/build-support/fetchdarcs/builder.sh
@@ -12,7 +12,7 @@ fi
 
 header "getting $url $partial ${tagtext} into $out"
 
-darcs get --lazy --ephemeral $tagflags "$url" "$out"
+darcs get --lazy $tagflags "$url" "$out"
 # remove metadata, because it can change
 rm -rf "$out/_darcs"
 
diff --git a/pkgs/build-support/fetchhg/builder.sh b/pkgs/build-support/fetchhg/builder.sh
index fbdd12b4f05..73ec7ec0b36 100644
--- a/pkgs/build-support/fetchhg/builder.sh
+++ b/pkgs/build-support/fetchhg/builder.sh
@@ -2,7 +2,7 @@ source $stdenv/setup
 
 header "getting $url${tag:+ ($tag)} into $out"
 
-hg clone ${tag:+-r "$tag"} "$url" "$out"
+hg clone --insecure ${tag:+-r "$tag"} "$url" "$out"
 
 rm -rf "$out/.hg"
 
diff --git a/pkgs/build-support/fetchhg/default.nix b/pkgs/build-support/fetchhg/default.nix
index bc27516f46d..1aebb7ecc87 100644
--- a/pkgs/build-support/fetchhg/default.nix
+++ b/pkgs/build-support/fetchhg/default.nix
@@ -2,16 +2,16 @@
 
 # TODO: statically check if mercurial as the https support if the url starts woth https.
 stdenv.mkDerivation {
-  name = "hg-archive" + (if (name != null) then "-${name}" else "");
+  name = "hg-archive" + (if name != null then "-${name}" else "");
   builder = ./builder.sh;
-  buildInputs = [mercurial nix];
+  buildInputs = [mercurial];
 
   # Nix <= 0.7 compatibility.
   id = md5;
 
-  outputHashAlgo = if (md5 != null) then "md5" else "sha256";
+  outputHashAlgo = if md5 != null then "md5" else "sha256";
   outputHashMode = "recursive";
-  outputHash = if (md5 != null) then md5 else sha256;
+  outputHash = if md5 != null then md5 else sha256;
   
   inherit url tag;
   preferLocalBuild = true;
diff --git a/pkgs/build-support/fetchmtn/default.nix b/pkgs/build-support/fetchmtn/default.nix
index 80d9091e01d..daead9ad6d2 100644
--- a/pkgs/build-support/fetchmtn/default.nix
+++ b/pkgs/build-support/fetchmtn/default.nix
@@ -10,7 +10,7 @@
 
 stdenv.mkDerivation {
   builder = ./builder.sh;
-  buildNativeInputs = [monotone];
+  nativeBuildInputs = [monotone];
 
   outputHashAlgo = "sha256";
   outputHashMode = "recursive";
diff --git a/pkgs/build-support/fetchsvn/builder.sh b/pkgs/build-support/fetchsvn/builder.sh
index 09358aa694b..ea52ca19fa6 100644
--- a/pkgs/build-support/fetchsvn/builder.sh
+++ b/pkgs/build-support/fetchsvn/builder.sh
@@ -22,6 +22,7 @@ fi;
 # server's certificate.  This is perfectly safe: we don't care
 # whether the server is being spoofed --- only the cryptographic
 # hash of the output matters.
-echo 'p' | svn export -r "$rev" "$url" $out
+echo 'p' | svn export ${ignoreExternals:+--ignore-externals} \
+    -r "$rev" "$url" "$out"
 
 stopNest
diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix
index ae8aabf858c..30625a758f8 100644
--- a/pkgs/build-support/fetchsvn/default.nix
+++ b/pkgs/build-support/fetchsvn/default.nix
@@ -1,5 +1,5 @@
-{stdenv, subversion, sshSupport ? false, openssh ? null}: 
-{url, rev ? "HEAD", md5 ? "", sha256 ? ""}:
+{stdenv, subversion, sshSupport ? false, openssh ? null}:
+{url, rev ? "HEAD", md5 ? "", sha256 ? "", ignoreExternals ? false, name ? null}:
 
 let
   repoName = with stdenv.lib;
@@ -18,10 +18,12 @@ let
       else if snd path == "tags" then     "${trd path}-${fst path}"
       # ../repo (no trunk) -> repo
       else fst path;
+
+  name_ = if name == null then "${repoName}-r${toString rev}" else name;
 in
 
 stdenv.mkDerivation {
-  name = "${repoName}-r${toString rev}";
+  name = name_;
   builder = ./builder.sh;
   buildInputs = [subversion];
 
@@ -29,7 +31,7 @@ stdenv.mkDerivation {
   outputHashMode = "recursive";
   outputHash = if sha256 == "" then md5 else sha256;
   
-  inherit url rev sshSupport openssh;
+  inherit url rev sshSupport openssh ignoreExternals;
 
   impureEnvVars = [
     # We borrow these environment variables from the caller to allow
diff --git a/pkgs/build-support/fetchurl/builder.sh b/pkgs/build-support/fetchurl/builder.sh
index 808bf9f7cde..402fe0cba5b 100644
--- a/pkgs/build-support/fetchurl/builder.sh
+++ b/pkgs/build-support/fetchurl/builder.sh
@@ -6,13 +6,14 @@ source $mirrorsFile
 # Curl flags to handle redirects, not use EPSV, handle cookies for
 # servers to need them during redirects, and work on SSL without a
 # certificate (this isn't a security problem because we check the
-# cryptographic hash of the output anyway). 
+# cryptographic hash of the output anyway).
 curl="curl \
  --location --max-redirs 20 \
  --retry 3
  --disable-epsv \
  --cookie-jar cookies \
  --insecure \
+ $curlOpts \
  $NIX_CURL_FLAGS"
 
 
@@ -29,20 +30,6 @@ tryDownload() {
 
 
 finish() {
-    # On old versions of Nix, verify the hash of the output.  On newer
-    # versions, Nix verifies the hash itself.
-    if test "$NIX_OUTPUT_CHECKED" != "1"; then
-        if test "$outputHashAlgo" != "md5"; then
-            echo "hashes other than md5 are unsupported in Nix <= 0.7, upgrade to Nix 0.8"
-            exit 1
-        fi
-        actual=$(md5sum -b "$out" | cut -c1-32)
-        if test "$actual" != "$id"; then
-            echo "hash is $actual, expected $id"
-            exit 1
-        fi
-    fi
-
     stopNest
     exit 0
 }
@@ -52,10 +39,11 @@ tryHashedMirrors() {
     if test -n "$NIX_HASHED_MIRRORS"; then
         hashedMirrors="$NIX_HASHED_MIRRORS"
     fi
-    
+
     for mirror in $hashedMirrors; do
         url="$mirror/$outputHashAlgo/$outputHash"
-        if $curl --fail --silent --show-error --head "$url" \
+        if $curl --retry 0 --connect-timeout "${NIX_CONNECT_TIMEOUT:-15}" \
+            --fail --silent --show-error --head "$url" \
             --write-out "%{http_code}" --output /dev/null > code 2> log; then
             tryDownload "$url"
             if test -n "$success"; then finish; fi
diff --git a/pkgs/build-support/fetchurl/default.nix b/pkgs/build-support/fetchurl/default.nix
index cc59dd7fab1..6c981229531 100644
--- a/pkgs/build-support/fetchurl/default.nix
+++ b/pkgs/build-support/fetchurl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, curl}: # Note that `curl' may be `null', in case of the native stdenv.
+{ stdenv, curl }: # Note that `curl' may be `null', in case of the native stdenv.
 
 let
 
@@ -17,10 +17,7 @@ let
 
   # Names of the master sites that are mirrored (i.e., "sourceforge",
   # "gnu", etc.).
-  sites =
-    if builtins ? attrNames
-    then builtins.attrNames mirrors
-    else [] /* backwards compatibility */;
+  sites = builtins.attrNames mirrors;
 
   impureEnvVars = [
     # We borrow these environment variables from the caller to allow
@@ -35,10 +32,14 @@ let
     # This variable allows the user to override hashedMirrors from the
     # command-line.
     "NIX_HASHED_MIRRORS"
+
+    # This variable allows overriding the timeout for connecting to
+    # the hashed mirrors.
+    "NIX_CONNECT_TIMEOUT"
   ] ++ (map (site: "NIX_MIRRORS_${site}") sites);
 
 in
-      
+
 { # URL to fetch.
   url ? ""
 
@@ -46,6 +47,9 @@ in
   # locations.  They are tried in order.
   urls ? []
 
+, # Additional curl options needed for the download to succeed.
+  curlOpts ? ""
+
 , # Name of the file.  If empty, use the basename of `url' (or of the
   # first element of `urls').
   name ? ""
@@ -79,9 +83,9 @@ stdenv.mkDerivation {
     if showURLs then "urls"
     else if name != "" then name
     else baseNameOf (toString (builtins.head urls_));
-    
+
   builder = ./builder.sh;
-  
+
   buildInputs = [curl];
 
   urls = urls_;
@@ -90,16 +94,13 @@ stdenv.mkDerivation {
   # (http://nixos.org/tarballs) over the original URLs.
   preferHashedMirrors = true;
 
-  # Compatibility with Nix <= 0.7.
-  id = md5;
-
   # New-style output content requirements.
   outputHashAlgo = if outputHashAlgo != "" then outputHashAlgo else
       if sha256 != "" then "sha256" else if sha1 != "" then "sha1" else "md5";
   outputHash = if outputHash != "" then outputHash else
       if sha256 != "" then sha256 else if sha1 != "" then sha1 else md5;
 
-  inherit showURLs mirrorsFile impureEnvVars;
+  inherit curlOpts showURLs mirrorsFile impureEnvVars;
 
   # Doing the download on a remote machine just duplicates network
   # traffic, so don't do that.
diff --git a/pkgs/build-support/fetchurl/mirrors.nix b/pkgs/build-support/fetchurl/mirrors.nix
index dd81692b5f2..d6ad25afbad 100644
--- a/pkgs/build-support/fetchurl/mirrors.nix
+++ b/pkgs/build-support/fetchurl/mirrors.nix
@@ -20,8 +20,6 @@ rec {
     http://kent.dl.sourceforge.net/sourceforge/
   ];
 
-  sf = sourceforge;
-
   # GNU (http://www.gnu.org/prep/ftp.html).
   gnu = [
     # This one redirects to a (supposedly) nearby and (supposedly) up-to-date
@@ -120,7 +118,6 @@ rec {
   ];
 
   savannah = [
-    ftp://ftp.twaren.net/Unix/NonGNU/
     ftp://mirror.csclub.uwaterloo.ca/nongnu/
     ftp://mirror.publicns.net/pub/nongnu/
     ftp://savannah.c3sl.ufpr.br/
@@ -157,6 +154,7 @@ rec {
     ftp://ftp.nl.uu.net/pub/CPAN/
     http://ftp.funet.fi/pub/CPAN/
     http://cpan.perl.org/
+    http://backpan.perl.org/  # for old releases
   ];
 
   # Debian.
@@ -226,6 +224,20 @@ rec {
     ftp://ftp.nara.wide.ad.jp/pub/X11/GNOME/
   ];
 
+  xfce = [
+    http://archive.xfce.org/
+    http://mirror.netcologne.de/xfce/
+    http://archive.se.xfce.org/xfce/
+    http://archive.be.xfce.org/xfce/
+    http://mirror.perldude.de/archive.xfce.org/
+    http://archive.be2.xfce.org/
+    http://ftp.udc.es/xfce/
+    http://archive.al-us.xfce.org/
+    http://mirror.yongbok.net/X11/xfce-mirror/
+    http://mirrors.tummy.com/pub/archive.xfce.org/
+    http://xfce.mirror.uber.com.au/
+  ];
+
   # X.org.
   xorg = [
     http://xorg.freedesktop.org/releases/
@@ -248,8 +260,6 @@ rec {
   ];
 
   postgresql = [
-    http://ftp2.nl.postgresql.org/
-    ftp://ftp.nl.postgresql.org/pub/mirror/postgresql/
     ftp://ftp.postgresql.org/pub/
     ftp://ftp-archives.postgresql.org/pub/
   ];
diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh
index fae37342940..5a5bd45a8f8 100644
--- a/pkgs/build-support/gcc-cross-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh
@@ -28,7 +28,7 @@ if test -z "$nativeLibc"; then
 
     echo "$cflagsCompile -B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
 
-    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
+    echo "-L$libc/lib -rpath $libc/lib -rpath-link $libc/lib" > $out/nix-support/libc-ldflags
 
     # The dynamic linker is passed in `ldflagsBefore' to allow
     # explicit overrides of the dynamic linker by callers to gcc/ld
diff --git a/pkgs/build-support/gcc-cross-wrapper/default.nix b/pkgs/build-support/gcc-cross-wrapper/default.nix
index be071607d8b..b2e30be10ef 100644
--- a/pkgs/build-support/gcc-cross-wrapper/default.nix
+++ b/pkgs/build-support/gcc-cross-wrapper/default.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
   utils = ./utils.sh;
   addFlags = ./add-flags;
   inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
-  crossConfig = if (cross != null) then cross.config else null;
+  crossConfig = if cross != null then cross.config else null;
   gccLibs = if gcc != null then gccLibs else null;
   name = chosenName;
   langC = if nativeTools then true else gcc.langC;
diff --git a/pkgs/build-support/gcc-cross-wrapper/utils.sh b/pkgs/build-support/gcc-cross-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/gcc-cross-wrapper/utils.sh
+++ b/pkgs/build-support/gcc-cross-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/gcc-upc-wrapper/add-flags b/pkgs/build-support/gcc-upc-wrapper/add-flags
deleted file mode 100644
index ace0a789628..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/add-flags
+++ /dev/null
@@ -1,24 +0,0 @@
-# `-B@out@/bin' forces gcc to use ld-wrapper.sh when calling ld.
-export NIX_CFLAGS_COMPILE="-B@out@/bin/ $NIX_CFLAGS_COMPILE"
-
-if test -e @out@/nix-support/libc-cflags; then
-    export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/libc-cflags) $NIX_CFLAGS_COMPILE"
-fi
-
-if test -e @out@/nix-support/libc-ldflags; then
-    export NIX_LDFLAGS="$(cat @out@/nix-support/libc-ldflags) $NIX_LDFLAGS"
-fi
-
-if test -e @out@/nix-support/gcc-cflags; then
-    export NIX_CFLAGS_COMPILE="$(cat @out@/nix-support/gcc-cflags) $NIX_CFLAGS_COMPILE"
-fi
-
-if test -e @out@/nix-support/gcc-ldflags; then
-    export NIX_LDFLAGS="$(cat @out@/nix-support/gcc-ldflags) $NIX_LDFLAGS"
-fi
-
-if test -e @out@/nix-support/libc-ldflags-before; then
-    export NIX_LDFLAGS_BEFORE="$(cat @out@/nix-support/libc-ldflags-before) $NIX_LDFLAGS_BEFORE"
-fi
-
-export NIX_GCC_WRAPPER_FLAGS_SET=1
diff --git a/pkgs/build-support/gcc-upc-wrapper/builder.sh b/pkgs/build-support/gcc-upc-wrapper/builder.sh
deleted file mode 100644
index af121afe155..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/builder.sh
+++ /dev/null
@@ -1,114 +0,0 @@
-source $stdenv/setup
-
-
-mkdir -p $out/bin
-mkdir -p $out/nix-support
-
-
-if test -z "$nativeLibc"; then
-    dynamicLinker="$libc/lib/$dynamicLinker"
-    echo $dynamicLinker > $out/nix-support/dynamic-linker
-
-    # The "-B$libc/lib/" flag is a quick hack to force gcc to link
-    # against the crt1.o from our own glibc, rather than the one in
-    # /usr/lib.  (This is only an issue when using an `impure'
-    # compiler/linker, i.e., one that searches /usr/lib and so on.)
-    echo "-B$libc/lib/ -isystem $libc/include" > $out/nix-support/libc-cflags
-    
-    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
-
-    # The dynamic linker is passed in `ldflagsBefore' to allow
-    # explicit overrides of the dynamic linker by callers to gcc/ld
-    # (the *last* value counts, so ours should come first).
-    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
-fi
-
-if test -n "$nativeTools"; then
-    gccPath="$nativePrefix/bin"
-    ldPath="$nativePrefix/bin"
-else
-    if test -e "$gcc/lib64"; then
-        gccLDFlags="$gccLDFlags -L$gcc/lib64"
-    fi
-    gccLDFlags="$gccLDFlags -L$gcc/lib"
-    echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
-
-    # GCC shows $gcc/lib in `gcc -print-search-dirs', but not
-    # $gcc/lib64 (even though it does actually search there...)..
-    # This confuses libtool.  So add it to the compiler tool search
-    # path explicitly.
-    if test -e "$gcc/lib64"; then
-        gccCFlags="$gccCFlags -B$gcc/lib64"
-    fi
-    echo "$gccCFlags" > $out/nix-support/gcc-cflags
-    
-    gccPath="$gcc/bin"
-    ldPath="$binutils/bin"
-fi
-
-
-doSubstitute() {
-    local src=$1
-    local dst=$2
-    # Can't use substitute() here, because replace may not have been
-    # built yet (in the bootstrap).
-    sed \
-        -e "s^@out@^$out^g" \
-        -e "s^@shell@^$shell^g" \
-        -e "s^@gcc@^$gcc^g" \
-        -e "s^@gccProg@^$gccProg^g" \
-        -e "s^@binutils@^$binutils^g" \
-        -e "s^@libc@^$libc^g" \
-        -e "s^@ld@^$ldPath/ld^g" \
-        < "$src" > "$dst" 
-}
-
-
-# Make wrapper scripts around gcc, g++, and g77.  Also make symlinks
-# cc, c++, and f77.
-mkGccWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return
-    fi
-
-    gccProg="$src"
-    doSubstitute "$gccWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-mkGccWrapper $out/bin/upc $gccPath/upc
-
-
-# Create a symlink to as (the assembler).  This is useful when a
-# gcc-wrapper is installed in a user environment, as it ensures that
-# the right assembler is called.
-ln -s $ldPath/as $out/bin/as
-
-
-# Make a wrapper around the linker.
-doSubstitute "$ldWrapper" "$out/bin/ld"
-chmod +x "$out/bin/ld"
-
-
-# Emit a setup hook.  Also store the path to the original GCC and
-# Glibc.
-test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
-test -n "$libc" && echo $libc > $out/nix-support/orig-libc
-
-doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
-
-doSubstitute "$setupHook" "$out/nix-support/setup-hook"
-
-cp -p $utils $out/nix-support/utils.sh
-
-
-# Propagate the wrapped gcc so that if you install the wrapper, you get
-# tools like gcov, the manpages, etc. as well (including for binutils
-# and Glibc).
-if test -z "$nativeTools"; then
-    echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
-fi
diff --git a/pkgs/build-support/gcc-upc-wrapper/default.nix b/pkgs/build-support/gcc-upc-wrapper/default.nix
deleted file mode 100644
index 6e67bbf74e6..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-# The Nix `gcc' stdenv.mkDerivation is not directly usable, since it doesn't
-# know where the C library and standard header files are.  Therefore
-# the compiler produced by that package cannot be installed directly
-# in a user environment and used from the command line.  This
-# stdenv.mkDerivation provides a wrapper that sets up the right environment
-# variables so that the compiler and the linker just "work".
-
-{ name ? "", stdenv, nativeTools, nativeLibc, nativePrefix ? ""
-, gcc ? null, libc ? null, binutils ? null, shell ? ""
-}:
-
-assert nativeTools -> nativePrefix != "";
-assert !nativeTools -> gcc != null && binutils != null;
-assert !nativeLibc -> libc != null;
-
-stdenv.mkDerivation {
-  builder = ./builder.sh;
-  setupHook = ./setup-hook.sh;
-  gccWrapper = ./gcc-wrapper.sh;
-  ldWrapper = ./ld-wrapper.sh;
-  utils = ./utils.sh;
-  addFlags = ./add-flags;
-  
-  inherit nativeTools nativeLibc nativePrefix gcc libc binutils;
-  name = if name == "" then gcc.name else name;
-  langC = if nativeTools then true else gcc.langC;
-  langCC = if nativeTools then true else gcc.langCC;
-  langF77 = if nativeTools then false else gcc.langF77;
-  shell = if shell == "" then stdenv.shell else shell;
-  
-  meta = if gcc != null && (gcc ? meta) then removeAttrs gcc.meta ["priority"] else
-    { description = "System C compiler wrapper";
-    };
-
-  # The dynamic linker has different names on different Linux platforms.
-  dynamicLinker =
-    if !nativeLibc then
-      (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
-       if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
-       if stdenv.system == "powerpc-linux" then "ld.so.1" else
-       abort "don't know the name of the dynamic linker for this platform")
-    else "";
-}
diff --git a/pkgs/build-support/gcc-upc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-upc-wrapper/gcc-wrapper.sh
deleted file mode 100644
index 23117694767..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/gcc-wrapper.sh
+++ /dev/null
@@ -1,139 +0,0 @@
-#! @shell@ -e
-
-if test -n "$NIX_GCC_WRAPPER_START_HOOK"; then
-    source "$NIX_GCC_WRAPPER_START_HOOK"
-fi
-
-if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
-    source @out@/nix-support/add-flags.sh
-fi
-
-source @out@/nix-support/utils.sh
-
-
-# Figure out if linker flags should be passed.  GCC prints annoying
-# warnings when they are not needed.
-dontLink=0
-getVersion=0
-nonFlagArgs=0
-
-for i in "$@"; do
-    if test "$i" = "-c"; then
-        dontLink=1
-    elif test "$i" = "-S"; then
-        dontLink=1
-    elif test "$i" = "-E"; then
-        dontLink=1
-    elif test "$i" = "-E"; then
-        dontLink=1
-    elif test "$i" = "-M"; then
-        dontLink=1
-    elif test "$i" = "-MM"; then
-        dontLink=1
-    elif test "${i:0:1}" != "-"; then
-        nonFlagArgs=1
-    fi
-done
-
-# If we pass a flag like -Wl, then gcc will call the linker unless it
-# can figure out that it has to do something else (e.g., because of a
-# "-c" flag).  So if no non-flag arguments are given, don't pass any
-# linker flags.  This catches cases like "gcc" (should just print
-# "gcc: no input files") and "gcc -v" (should print the version).
-if test "$nonFlagArgs" = "0"; then
-    dontLink=1
-fi
-
-
-# Optionally filter out paths not refering to the store.
-params=("$@")
-if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE"; then
-    rest=()
-    n=0
-    while test $n -lt ${#params[*]}; do
-        p=${params[n]}
-        p2=${params[$((n+1))]}
-        if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
-            skip $p
-        elif test "$p" = "-L" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        elif test "${p:0:3}" = "-I/" && badPath "${p:2}"; then
-            skip $p
-        elif test "$p" = "-I" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        elif test "$p" = "-isystem" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        else
-            rest=("${rest[@]}" "$p")
-        fi
-        n=$((n + 1))
-    done
-    params=("${rest[@]}")
-fi
-
-
-# Add the flags for the C compiler proper.
-extraAfter=($NIX_CFLAGS_COMPILE)
-extraBefore=()
-
-if test "$dontLink" != "1"; then
-
-    # Add the flags that should only be passed to the compiler when
-    # linking.
-    extraAfter=(${extraAfter[@]} $NIX_CFLAGS_LINK)
-
-    # Add the flags that should be passed to the linker (and prevent
-    # `ld-wrapper' from adding NIX_LDFLAGS again).
-    for i in $NIX_LDFLAGS_BEFORE; do
-        extraBefore=(${extraBefore[@]} "-Wl,$i")
-    done
-    for i in $NIX_LDFLAGS; do
-	if test "${i:0:3}" = "-L/"; then
-	    extraAfter=(${extraAfter[@]} "$i")
-	else
-	    extraAfter=(${extraAfter[@]} "-Wl,$i")
-	fi
-    done
-    export NIX_LDFLAGS_SET=1
-fi
-
-# As a very special hack, if the arguments are just `-v', then don't
-# add anything.  This is to prevent `gcc -v' (which normally prints
-# out the version number and returns exit code 0) from printing out
-# `No input files specified' and returning exit code 1.
-if test "$*" = "-v"; then
-    extraAfter=()
-    extraBefore=()
-fi    
-
-# Optionally print debug info.
-if test "$NIX_DEBUG" = "1"; then
-  echo "original flags to @gccProg@:" >&2
-  for i in "${params[@]}"; do
-      echo "  $i" >&2
-  done
-  echo "extraBefore flags to @gccProg@:" >&2
-  for i in ${extraBefore[@]}; do
-      echo "  $i" >&2
-  done
-  echo "extraAfter flags to @gccProg@:" >&2
-  for i in ${extraAfter[@]}; do
-      echo "  $i" >&2
-  done
-fi
-
-if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then
-    source "$NIX_GCC_WRAPPER_EXEC_HOOK"
-fi
-
-
-# Call the real `gcc'.  Filter out warnings from stderr about unused
-# `-B' flags, since they confuse some programs.  Deep bash magic to
-# apply grep to stderr (by swapping stdin/stderr twice).
-if test -z "$NIX_GCC_NEEDS_GREP"; then
-    @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
-else
-    (@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 3>&2 2>&1 1>&3- \
-        | (grep -v 'file path prefix' || true); exit ${PIPESTATUS[0]}) 3>&2 2>&1 1>&3-
-    exit $?
-fi    
diff --git a/pkgs/build-support/gcc-upc-wrapper/ld-wrapper.sh b/pkgs/build-support/gcc-upc-wrapper/ld-wrapper.sh
deleted file mode 100644
index 94241e42ce9..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/ld-wrapper.sh
+++ /dev/null
@@ -1,145 +0,0 @@
-#! @shell@ -e
-
-if test -n "$NIX_LD_WRAPPER_START_HOOK"; then
-    source "$NIX_LD_WRAPPER_START_HOOK"
-fi
-
-if test -z "$NIX_GCC_WRAPPER_FLAGS_SET"; then
-    source @out@/nix-support/add-flags.sh
-fi
-
-source @out@/nix-support/utils.sh
-
-
-# Optionally filter out paths not refering to the store.
-params=("$@")
-if test "$NIX_ENFORCE_PURITY" = "1" -a -n "$NIX_STORE" \
-        -a \( -z "$NIX_IGNORE_LD_THROUGH_GCC" -o -z "$NIX_LDFLAGS_SET" \); then
-    rest=()
-    n=0
-    while test $n -lt ${#params[*]}; do
-        p=${params[n]}
-        p2=${params[$((n+1))]}
-        if test "${p:0:3}" = "-L/" && badPath "${p:2}"; then
-            skip $p
-        elif test "$p" = "-L" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        elif test "$p" = "-rpath" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        elif test "$p" = "-dynamic-linker" && badPath "$p2"; then
-            n=$((n + 1)); skip $p2
-        elif test "${p:0:1}" = "/" && badPath "$p"; then
-            # We cannot skip this; barf.
-            echo "impure path \`$p' used in link" >&2
-            exit 1
-        else
-            rest=("${rest[@]}" "$p")
-        fi
-        n=$((n + 1))
-    done
-    params=("${rest[@]}")
-fi
-
-
-extra=()
-extraBefore=()
-
-if test -z "$NIX_LDFLAGS_SET"; then
-    extra=(${extra[@]} $NIX_LDFLAGS)
-    extraBefore=(${extraBefore[@]} $NIX_LDFLAGS_BEFORE)
-fi
-
-
-# Add all used dynamic libraries to the rpath.
-if test "$NIX_DONT_SET_RPATH" != "1"; then
-
-    # First, find all -L... switches.
-    allParams=("${params[@]}" ${extra[@]})
-    libPath=""
-    addToLibPath() {
-        local path="$1"
-        if test "${path:0:1}" != "/"; then return 0; fi
-        case "$path" in
-            *..*|*./*|*/.*|*//*)
-                local path2
-                if path2=$(readlink -f "$path"); then
-                    path="$path2"
-                fi
-                ;;
-        esac
-        case $libPath in
-            *\ $path\ *) return 0 ;;
-        esac
-        libPath="$libPath $path "
-    }
-    n=0
-    while test $n -lt ${#allParams[*]}; do
-        p=${allParams[n]}
-        p2=${allParams[$((n+1))]}
-        if test "${p:0:3}" = "-L/"; then
-            addToLibPath ${p:2}
-        elif test "$p" = "-L"; then
-            addToLibPath ${p2}
-            n=$((n + 1))
-        fi
-        n=$((n + 1))
-    done
-
-    # Second, for each -l... switch, find the directory containing the
-    # library and add it to the rpath.
-    rpath=""
-    addToRPath() {
-        # If the path is not in the store, don't add it to the rpath.
-        # This typically happens for libraries in /tmp that are later
-        # copied to $out/lib.  If not, we're screwed.
-        if test "${1:0:${#NIX_STORE}}" != "$NIX_STORE"; then return 0; fi
-        case $rpath in
-            *\ $1\ *) return 0 ;;
-        esac
-        rpath="$rpath $1 "
-    }
-    findLib() {
-        for i in $libPath; do
-            if test -f $i/lib$1.so; then
-                addToRPath $i
-            fi
-        done
-    }
-    n=0
-    while test $n -lt ${#allParams[*]}; do
-        p=${allParams[n]}
-        p2=${allParams[$((n+1))]}
-        if test "${p:0:2}" = "-l"; then
-            findLib ${p:2}
-        elif test "$p" = "-l"; then
-            # I haven't seen `-l foo', but you never know...
-            findLib ${p2}
-            n=$((n + 1))
-        fi
-        n=$((n + 1))
-    done
-
-    # Finally, add `-rpath' switches.
-    for i in $rpath; do
-        extra=(${extra[@]} -rpath $i)
-    done
-fi
-
-
-# Optionally print debug info.
-if test "$NIX_DEBUG" = "1"; then
-  echo "original flags to @ld@:" >&2
-  for i in "${params[@]}"; do
-      echo "  $i" >&2
-  done
-  echo "extra flags to @ld@:" >&2
-  for i in ${extra[@]}; do
-      echo "  $i" >&2
-  done
-fi
-
-if test -n "$NIX_LD_WRAPPER_EXEC_HOOK"; then
-    source "$NIX_LD_WRAPPER_EXEC_HOOK"
-fi
-
-exec @ld@ ${extraBefore[@]} "${params[@]}" ${extra[@]}
diff --git a/pkgs/build-support/gcc-upc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-upc-wrapper/setup-hook.sh
deleted file mode 100644
index 60aad0fe4dc..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/setup-hook.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-addCVars () {
-    if test -d $1/include; then
-        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include"
-    fi
-
-    if test -d $1/lib64; then
-        export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64"
-    fi
-
-    if test -d $1/lib; then
-        export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib"
-    fi
-}
-
-envHooks=(${envHooks[@]} addCVars)
-
-# Note: these come *after* $out in the PATH (see setup.sh).
-
-if test -n "@gcc@"; then
-    PATH=$PATH:@gcc@/bin
-fi
-
-if test -n "@binutils@"; then
-    PATH=$PATH:@binutils@/bin
-fi
-
-if test -n "@libc@"; then
-    PATH=$PATH:@libc@/bin
-fi
diff --git a/pkgs/build-support/gcc-upc-wrapper/utils.sh b/pkgs/build-support/gcc-upc-wrapper/utils.sh
deleted file mode 100644
index 9a664e1d1e6..00000000000
--- a/pkgs/build-support/gcc-upc-wrapper/utils.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-skip () {
-    if test "$NIX_DEBUG" = "1"; then
-        echo "skipping impure path $1" >&2
-    fi
-}
-
-
-# Checks whether a path is impure.  E.g., `/lib/foo.so' is impure, but
-# `/nix/store/.../lib/foo.so' isn't.
-badPath() {
-    local p=$1
-    
-    # Relative paths are okay (since they're presumably relative to
-    # the temporary build directory).
-    if test "${p:0:1}" != "/"; then return 1; fi
-    
-    # Otherwise, the path should refer to the store or some temporary
-    # directory (including the build directory).
-    test \
-        "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
-        "${p:0:4}" != "/tmp" -a \
-        "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
-}
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index ad2b8003f09..ed7ad0a50b7 100644
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -31,7 +31,7 @@ if test -z "$nativeLibc"; then
     # The dynamic linker is passed in `ldflagsBefore' to allow
     # explicit overrides of the dynamic linker by callers to gcc/ld
     # (the *last* value counts, so ours should come first).
-    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
+    echo "-dynamic-linker" $dynamicLinker > $out/nix-support/libc-ldflags-before
 fi
 
 if test -n "$nativeTools"; then
@@ -152,6 +152,8 @@ fi
 
 mkGccWrapper $out/bin/gcj $gccPath/gcj || true
 
+mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true
+
 mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true
 mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
 mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
diff --git a/pkgs/build-support/gcc-wrapper/buildergo.sh b/pkgs/build-support/gcc-wrapper/buildergo.sh
deleted file mode 100644
index cb6bfd7f051..00000000000
--- a/pkgs/build-support/gcc-wrapper/buildergo.sh
+++ /dev/null
@@ -1,194 +0,0 @@
-source $stdenv/setup
-
-
-mkdir -p $out/bin
-mkdir -p $out/nix-support
-
-
-if test -z "$nativeLibc"; then
-    dynamicLinker="$libc/lib/$dynamicLinker"
-    echo $dynamicLinker > $out/nix-support/dynamic-linker
-
-    if test -e $libc/lib/32/ld-linux.so.2; then
-        echo $libc/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
-    fi
-
-    # The "-B$libc/lib/" flag is a quick hack to force gcc to link
-    # against the crt1.o from our own glibc, rather than the one in
-    # /usr/lib.  (This is only an issue when using an `impure'
-    # compiler/linker, i.e., one that searches /usr/lib and so on.)
-    #
-    # Unfortunately, setting -B appears to override the default search
-    # path. Thus, the gcc-specific "../includes-fixed" directory is
-    # now longer searched and glibc's <limits.h> header fails to
-    # compile, because it uses "#include_next <limits.h>" to find the
-    # limits.h file in ../includes-fixed. To remedy the problem,
-    # another -idirafter is necessary to add that directory again.
-    echo "-B$libc/lib/ -idirafter $libc/include -idirafter $gcc/lib/gcc/*/*/include-fixed" > $out/nix-support/libc-cflags
-
-    echo "-L$libc/lib" > $out/nix-support/libc-ldflags
-
-    # The dynamic linker is passed in `ldflagsBefore' to allow
-    # explicit overrides of the dynamic linker by callers to gcc/ld
-    # (the *last* value counts, so ours should come first).
-    echo "-dynamic-linker $dynamicLinker" > $out/nix-support/libc-ldflags-before
-fi
-
-if test -n "$nativeTools"; then
-    gccPath="$nativePrefix/bin"
-    ldPath="$nativePrefix/bin"
-else
-    if test -e "$gcc/lib64"; then
-        gccLDFlags="$gccLDFlags -L$gcc/lib64"
-    fi
-    gccLDFlags="$gccLDFlags -L$gcc/lib"
-    if [ -n "$langVhdl" ]; then
-        gccLDFlags="$gccLDFlags -L$zlib/lib"
-    fi
-    echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
-
-    # GCC shows $gcc/lib in `gcc -print-search-dirs', but not
-    # $gcc/lib64 (even though it does actually search there...)..
-    # This confuses libtool.  So add it to the compiler tool search
-    # path explicitly.
-    if test -e "$gcc/lib64"; then
-        gccCFlags="$gccCFlags -B$gcc/lib64"
-    fi
-
-    # Find the gcc libraries path (may work only without multilib)
-    if [ -n "$langAda" ]; then
-        basePath=`echo $gcc/lib/*/*/*`
-        gccCFlags="$gccCFlags -B$basePath -I$basePath/adainclude"
-
-        gnatCFlags="-aI$basePath/adainclude -aO$basePath/adalib"
-        echo "$gnatCFlags" > $out/nix-support/gnat-cflags
-    fi
-    echo "$gccCFlags" > $out/nix-support/gcc-cflags
-    
-    gccPath="$gcc/bin"
-    ldPath="$binutils/bin"
-fi
-
-
-doSubstitute() {
-    local src=$1
-    local dst=$2
-    # Can't use substitute() here, because replace may not have been
-    # built yet (in the bootstrap).
-    sed \
-        -e "s^@out@^$out^g" \
-        -e "s^@shell@^$shell^g" \
-        -e "s^@gcc@^$gcc^g" \
-        -e "s^@gccProg@^$gccProg^g" \
-        -e "s^@gnatProg@^$gnatProg^g" \
-        -e "s^@gnatlinkProg@^$gnatlinkProg^g" \
-        -e "s^@binutils@^$binutils^g" \
-        -e "s^@coreutils@^$coreutils^g" \
-        -e "s^@libc@^$libc^g" \
-        -e "s^@ld@^$ldPath/ld^g" \
-        < "$src" > "$dst" 
-}
-
-
-# Make wrapper scripts around gcc, g++, and gfortran.  Also make symlinks
-# cc, c++, and f77.
-mkGccWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gccProg="$src"
-    doSubstitute "$gccWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-mkGnatWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gnatProg="$src"
-    doSubstitute "$gnatWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-mkGnatLinkWrapper() {
-    local dst=$1
-    local src=$2
-
-    if ! test -f "$src"; then
-        echo "$src does not exist (skipping)"
-        return 1
-    fi
-
-    gnatlinkProg="$src"
-    doSubstitute "$gnatlinkWrapper" "$dst"
-    chmod +x "$dst"
-}
-
-if mkGccWrapper $out/bin/gcc $gccPath/gcc
-then
-    ln -sv gcc $out/bin/cc
-fi
-
-if mkGccWrapper $out/bin/g++ $gccPath/g++
-then
-    ln -sv g++ $out/bin/c++
-fi
-
-if mkGccWrapper $out/bin/gfortran $gccPath/gfortran
-then
-    ln -sv gfortran $out/bin/g77
-    ln -sv gfortran $out/bin/f77
-fi
-
-mkGccWrapper $out/bin/gcj $gccPath/gcj || true
-
-mkGccWrapper $out/bin/gccgo $gccPath/gccgo || true
-
-mkGccWrapper $out/bin/gnatgcc $gccPath/gnatgcc || true
-mkGnatWrapper $out/bin/gnatmake $gccPath/gnatmake || true
-mkGnatWrapper $out/bin/gnatbind $gccPath/gnatbind || true
-mkGnatLinkWrapper $out/bin/gnatlink $gccPath/gnatlink || true
-
-if [ -f $gccPath/ghdl ]; then
-    ln -sf $gccPath/ghdl $out/bin/ghdl
-fi
-
-# Create a symlink to as (the assembler).  This is useful when a
-# gcc-wrapper is installed in a user environment, as it ensures that
-# the right assembler is called.
-ln -s $ldPath/as $out/bin/as
-
-
-# Make a wrapper around the linker.
-doSubstitute "$ldWrapper" "$out/bin/ld"
-chmod +x "$out/bin/ld"
-
-
-# Emit a setup hook.  Also store the path to the original GCC and
-# Glibc.
-test -n "$gcc" && echo $gcc > $out/nix-support/orig-gcc
-test -n "$libc" && echo $libc > $out/nix-support/orig-libc
-
-doSubstitute "$addFlags" "$out/nix-support/add-flags.sh"
-
-doSubstitute "$setupHook" "$out/nix-support/setup-hook"
-
-cp -p $utils $out/nix-support/utils.sh
-
-
-# Propagate the wrapped gcc so that if you install the wrapper, you get
-# tools like gcov, the manpages, etc. as well (including for binutils
-# and Glibc).
-if test -z "$nativeTools"; then
-    echo $gcc $binutils $libc > $out/nix-support/propagated-user-env-packages
-fi
diff --git a/pkgs/build-support/gcc-wrapper/default.nix b/pkgs/build-support/gcc-wrapper/default.nix
index 5e50a5c7dfb..992c0f9af37 100644
--- a/pkgs/build-support/gcc-wrapper/default.nix
+++ b/pkgs/build-support/gcc-wrapper/default.nix
@@ -25,7 +25,7 @@ let
   langGo = if nativeTools then false else gcc ? langGo && gcc.langGo;
 in
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name =
     (if name != "" then name else gccName + "-wrapper") +
     (if gcc != null && gccVersion != "" then "-" + gccVersion else "");
@@ -50,17 +50,17 @@ stdenv.mkDerivation ({
   langFortran = if nativeTools then false else gcc ? langFortran;
   langAda = if nativeTools then false else gcc ? langAda && gcc.langAda;
   langVhdl = if nativeTools then false else gcc ? langVhdl && gcc.langVhdl;
-  zlib = if (gcc != null && gcc ? langVhdl) then zlib else null;
+  zlib = if gcc != null && gcc ? langVhdl then zlib else null;
   shell = if shell == "" then stdenv.shell else
     if builtins.isAttrs shell then (shell + shell.shellPath)
     else shell;
 
   crossAttrs = {
-    shell = shell.hostDrv + shell.hostDrv.shellPath;
-    libc = libc.hostDrv;
-    coreutils = coreutils.hostDrv;
-    binutils = binutils.hostDrv;
-    gcc = gcc.hostDrv;
+    shell = shell.crossDrv + shell.crossDrv.shellPath;
+    libc = stdenv.gccCross.libc;
+    coreutils = coreutils.crossDrv;
+    binutils = binutils.crossDrv;
+    gcc = gcc.crossDrv;
     #
     # This is not the best way to do this. I think the reference should be
     # the style in the gcc-cross-wrapper, but to keep a stable stdenv now I
@@ -85,15 +85,10 @@ stdenv.mkDerivation ({
     if !nativeLibc then
       (if stdenv.system == "i686-linux" then "ld-linux.so.2" else
        if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2" else
-       if stdenv.isArm then "ld-linux.so.3" else
+       # ARM with a wildcard, which can be "" or "-armhf".
+       if stdenv.isArm then "ld-linux*.so.3" else
        if stdenv.system == "powerpc-linux" then "ld.so.1" else
        if stdenv.system == "mips64el-linux" then "ld.so.1" else
        abort "don't know the name of the dynamic linker for this platform")
     else "";
 }
-#  This go wrapper should be reworked in stdenv-updates.
-// (if langGo then
-{
-  inherit langGo;
-  builder = ./buildergo.sh;
-} else {}))
diff --git a/pkgs/build-support/gcc-wrapper/utils.sh b/pkgs/build-support/gcc-wrapper/utils.sh
index 9a664e1d1e6..753b3772e95 100644
--- a/pkgs/build-support/gcc-wrapper/utils.sh
+++ b/pkgs/build-support/gcc-wrapper/utils.sh
@@ -17,6 +17,7 @@ badPath() {
     # Otherwise, the path should refer to the store or some temporary
     # directory (including the build directory).
     test \
+        "$p" != "/dev/null" -a \
         "${p:0:${#NIX_STORE}}" != "$NIX_STORE" -a \
         "${p:0:4}" != "/tmp" -a \
         "${p:0:${#NIX_BUILD_TOP}}" != "$NIX_BUILD_TOP"
diff --git a/pkgs/build-support/kdewrapper/default.nix b/pkgs/build-support/kdewrapper/default.nix
new file mode 100644
index 00000000000..be90011f493
--- /dev/null
+++ b/pkgs/build-support/kdewrapper/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, kde4, shared_mime_info, extraLibs ? [] }:
+
+/* Supply a KDE program, and it will have the necessary KDE vars to
+  get icons, mime types, etc. working.
+  For example:
+  
+  packageOverrides = pkgs : {
+    kdenliveWrapped = kde4.wrapper kde4.kdenlive;
+  };
+  */
+program:
+
+let
+  libs = with kde4; [ kdelibs kde_runtime oxygen_icons shared_mime_info ]
+    ++ extraLibs;
+in
+stdenv.mkDerivation {
+  name = program.name + "-wrapped";
+
+  inherit libs;
+
+  buildCommand = ''
+    ensureDir $out/bin
+
+    KDEDIRS=${program}
+    QT_PLUGIN_PATH=${program}/lib/qt4/plugins:${program}/lib/kde4/plugins
+    for a in $libs; do
+      KDEDIRS=$a''${KDEDIRS:+:}$KDEDIRS
+      QT_PLUGIN_PATH=$a/lib/qt4/plugins:$a/lib/kde4/plugins''${QT_PLUGIN_PATH:+:}$QT_PLUGIN_PATH
+    done
+    for a in ${program}/bin/*; do 
+      PROG=$out/bin/`basename $a` 
+    cat > $PROG << END
+    #!/bin/sh
+    export KDEDIRS=$KDEDIRS\''${KDEDIRS:+:}\$KDEDIRS
+    export QT_PLUGIN_PATH=$QT_PLUGIN_PATH\''${QT_PLUGIN_PATH:+:}\$QT_PLUGIN_PATH
+    exec $a "\$@"
+    END
+    chmod +x $PROG
+    done
+  '';
+}
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 2c0ca37553d..4ddf0706e03 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -12,7 +12,7 @@
 # `contents = {object = ...; symlink = /init;}' is a typical
 # argument.
 
-{stdenv, perl, cpio, contents, ubootChooser}:
+{stdenv, perl, cpio, contents, ubootChooser, compressor}:
 
 let
   inputsFun = ubootName : [perl cpio]
@@ -22,7 +22,7 @@ in
 stdenv.mkDerivation {
   name = "initrd";
   builder = ./make-initrd.sh;
-  buildNativeInputs = inputsFun stdenv.platform.uboot;
+  nativeBuildInputs = inputsFun stdenv.platform.uboot;
 
   makeUInitrd = makeUInitrdFun stdenv.platform.uboot;
 
@@ -37,7 +37,8 @@ stdenv.mkDerivation {
   pathsFromGraph = ./paths-from-graph.pl;
 
   crossAttrs = {
-    buildNativeInputs = inputsFun stdenv.cross.platform.uboot;
+    nativeBuildInputs = inputsFun stdenv.cross.platform.uboot;
     makeUInitrd = makeUInitrdFun stdenv.cross.platform.uboot;
   };
+  inherit compressor;
 }
diff --git a/pkgs/build-support/kernel/make-initrd.sh b/pkgs/build-support/kernel/make-initrd.sh
index b2c78463569..f6cadaf0281 100644
--- a/pkgs/build-support/kernel/make-initrd.sh
+++ b/pkgs/build-support/kernel/make-initrd.sh
@@ -36,7 +36,7 @@ storePaths=$(perl $pathsFromGraph closure-*)
 
 # Put the closure in a gzipped cpio archive.
 mkdir -p $out
-(cd root && find * -print0 | cpio -o -H newc --null | gzip -9 > $out/initrd)
+(cd root && find * -print0 | cpio -o -H newc --null | $compressor > $out/initrd)
 
 if [ -n "$makeUInitrd" ]; then
     mv $out/initrd $out/initrd.gz
diff --git a/pkgs/build-support/multiple-outputs.nix b/pkgs/build-support/multiple-outputs.nix
index 79bd3fd80d4..5d9dab76968 100644
--- a/pkgs/build-support/multiple-outputs.nix
+++ b/pkgs/build-support/multiple-outputs.nix
@@ -46,10 +46,10 @@ stdenv.mkDerivation (args // {
           echo "$propagatedBuildInputs" > "$dev/nix-support/propagated-build-inputs"
           propagatedBuildInputs=
         fi
-        echo "$out $lib $bin $propagatedBuildNativeInputs" > "$dev/nix-support/propagated-build-native-inputs"
-        propagatedBuildNativeInputs=
+        echo "$out $lib $bin $propagatedNativeBuildInputs" > "$dev/nix-support/propagated-native-build-inputs"
+        propagatedNativeBuildInputs=
       elif [ -n "$out" ]; then
-        propagatedBuildNativeInputs="$lib $propagatedBuildNativeInputs"
+        propagatedNativeBuildInputs="$lib $propagatedNativeBuildsInputs"
       fi
 
       for i in $bin $lib; do
diff --git a/pkgs/build-support/release/ant-build.nix b/pkgs/build-support/release/ant-build.nix
index 696f179a2ed..0cabdf2f7e7 100644
--- a/pkgs/build-support/release/ant-build.nix
+++ b/pkgs/build-support/release/ant-build.nix
@@ -8,8 +8,8 @@
 , antProperties ? []
 , antBuildInputs ? []
 , buildfile ? "build.xml"
-, ant ? pkgs.ant
-, jre ? pkgs.jre
+, ant ? pkgs.apacheAntOpenJDK
+, jre ? pkgs.openjdk
 , hydraAntLogger ? pkgs.hydraAntLogger
 , ... } @ args:
 
diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix
index feb15267f59..ba7be86a6c1 100644
--- a/pkgs/build-support/release/debian-build.nix
+++ b/pkgs/build-support/release/debian-build.nix
@@ -83,7 +83,7 @@ vmTools.runInLinuxImage (stdenv.mkDerivation (
     ''; # */
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = "Build of a Deb package on ${diskImage.fullName} (${diskImage.name})";
+      description = "Deb package for ${diskImage.fullName}";
     };
   }
 
diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix
index 2cf2b1f8d6d..20dcf2fbd0c 100644
--- a/pkgs/build-support/release/default.nix
+++ b/pkgs/build-support/release/default.nix
@@ -39,4 +39,14 @@ rec {
     { inherit stdenv vmTools checkinstall;
     } // args);
 
+  aggregate =
+    { name, members, meta ? { } }:
+    pkgs.runCommand name
+      { inherit members meta;
+        _hydraAggregate = true;
+      }
+      ''
+        echo $members > $out
+      '';
+
 }
diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix
index 336563ae285..88bafd84faa 100644
--- a/pkgs/build-support/release/nix-build.nix
+++ b/pkgs/build-support/release/nix-build.nix
@@ -45,18 +45,18 @@ stdenv.mkDerivation (
               KEEPBUILDDIR="$out/`basename $TMPDIR`"
               header "Copying build directory to $KEEPBUILDDIR"
               mkdir -p $KEEPBUILDDIR
-              cp -R $TMPDIR/* $KEEPBUILDDIR
-              stopNest 
+              cp -R "$TMPDIR/"* $KEEPBUILDDIR
+              stopNest
           fi
       fi
     '';
   }
 
-  // args // 
+  // args //
 
   {
     name = name + (if src ? version then "-" + src.version else "");
-  
+
     postHook = ''
       . ${./functions.sh}
       origSrc=$src
@@ -68,14 +68,18 @@ stdenv.mkDerivation (
           export CFLAGS="-O0"
           export CXXFLAGS="-O0"
       fi
-    ''; # */
+    '';
 
     initPhase = ''
       mkdir -p $out/nix-support
       echo "$system" > $out/nix-support/system
 
       if [ -z "${toString doCoverageAnalysis}" ]; then
-          echo "nix-build none $out" >> $out/nix-support/hydra-build-products
+          for i in $outputs; do
+              if [ "$i" = out ]; then j=none; else j="$i"; fi
+              mkdir -p ''${!i}/nix-support
+              echo "nix-build $j ''${!i}" >> ''${!i}/nix-support/hydra-build-products
+          done
       fi
     '';
 
@@ -107,7 +111,7 @@ stdenv.mkDerivation (
       (stdenv.lib.optional doCoverageAnalysis "coverageReportPhase") ++ ["finalPhase"];
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = if doCoverageAnalysis then "Coverage analysis" else "Native Nix build on ${stdenv.system}";
+      description = if doCoverageAnalysis then "Coverage analysis" else "Nix package for ${stdenv.system}";
     };
 
   }
diff --git a/pkgs/build-support/release/rpm-build.nix b/pkgs/build-support/release/rpm-build.nix
index 708b62302d5..9a1c7eeee62 100644
--- a/pkgs/build-support/release/rpm-build.nix
+++ b/pkgs/build-support/release/rpm-build.nix
@@ -33,21 +33,21 @@ vmTools.buildRPM (
       rpm -Up ''${rpms[*]} --excludepath /nix/store
 
       eval "$postRPMInstall"
-      
+
       echo "uninstalling ''${rpmNames[*]}..."
       rpm -e ''${rpmNames[*]} --nodeps
 
       for i in $out/rpms/*/*.src.rpm; do
         echo "file srpm $i" >> $out/nix-support/hydra-build-products
       done
-      
+
       for rpmdir in $extraRPMs ; do
         echo "file rpm-extra $(ls $rpmdir/rpms/*/*.rpm | grep -v 'src\.rpm' | sort | head -1)" >> $out/nix-support/hydra-build-products
       done
     ''; # */
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = "Build of an RPM package on ${diskImage.fullName} (${diskImage.name})";
+      description = "RPM package for ${diskImage.fullName}";
     };
   }
 
diff --git a/pkgs/build-support/release/source-tarball.nix b/pkgs/build-support/release/source-tarball.nix
index 85d0b29f5b7..b50077975c1 100644
--- a/pkgs/build-support/release/source-tarball.nix
+++ b/pkgs/build-support/release/source-tarball.nix
@@ -6,23 +6,15 @@
 , buildInputs ? []
 , name ? "source-tarball"
 , version ? "0"
-, versionSuffix ? 
+, versionSuffix ?
     if officialRelease
     then ""
-    else if src ? rev then "pre${toString src.rev}" else ""
+    else "pre${toString (src.rev or src.revCount or "")}"
 , src, stdenv, autoconf, automake, libtool
+, # By default, provide all the GNU Build System as input.
+  bootstrapBuildInputs ? [ autoconf automake libtool ]
 , ... } @ args:
 
-let
-
-  # By default, provide all the GNU Build System as input.
-  bootstrapBuildInputs =
-    if (args ? bootstrapBuildInputs)
-    then args.bootstrapBuildInputs
-    else [ autoconf automake libtool ];
-
-in
-
 stdenv.mkDerivation (
 
   # First, attributes that can be overriden by the caller (via args):
@@ -82,17 +74,17 @@ stdenv.mkDerivation (
   }
 
   # Then, the caller-supplied attributes.
-  // args // 
+  // args //
 
   # And finally, our own stuff.
   {
     name = name + "-" + version + versionSuffix;
 
     buildInputs = buildInputs ++ bootstrapBuildInputs;
-    
+
     preUnpack = ''
       mkdir -p $out/nix-support
-    '';  
+    '';
 
     postUnpack = ''
       # Set all source files to the current date.  This is because Nix
@@ -126,7 +118,7 @@ stdenv.mkDerivation (
     };
 
     meta = (if args ? meta then args.meta else {}) // {
-      description = "Build of a source distribution from a checkout";
+      description = "Source distribution";
 
       # Tarball builds are generally important, so give them a high
       # default priority.
diff --git a/pkgs/build-support/replace-dependency.nix b/pkgs/build-support/replace-dependency.nix
new file mode 100644
index 00000000000..098637b4f9b
--- /dev/null
+++ b/pkgs/build-support/replace-dependency.nix
@@ -0,0 +1,79 @@
+{ runCommand, nix, lib }:
+
+# Replace a single dependency in the requisites tree of drv, propagating
+# the change all the way up the tree, without a full rebuild. This can be
+# useful, for example, to patch a security hole in libc and still use your
+# system safely without rebuilding the world. This should be a short term
+# solution, as soon as a rebuild can be done the properly rebuild derivation
+# should be used. The old dependency and new dependency MUST have the same-length
+# name, and ideally should have close-to-identical directory layout.
+#
+# Example: safeFirefox = replaceDependency {
+#   drv = firefox;
+#   oldDependency = glibc;
+#   newDependency = overrideDerivation glibc (attrs: {
+#     patches  = attrs.patches ++ [ ./fix-glibc-hole.patch ];
+#   });
+# };
+# This will rebuild glibc with your security patch, then copy over firefox
+# (and all of its dependencies) without rebuilding further.
+{ drv, oldDependency, newDependency }:
+
+with lib;
+
+let
+  references = import (runCommand "references.nix" { exportReferencesGraph = [ "graph" drv ]; } ''
+    (echo {
+    while read path
+    do
+        echo "  \"$path\" = ["
+        read count
+        read count
+        while [ "0" != "$count" ]
+        do
+            read ref_path
+            if [ "$ref_path" != "$path" ]
+            then
+                echo "    (builtins.storePath $ref_path)"
+            fi
+            count=$(($count - 1))
+        done
+        echo "  ];"
+    done < graph
+    echo }) > $out
+  '').outPath;
+
+  discard = builtins.unsafeDiscardStringContext;
+
+  oldStorepath = builtins.storePath (discard (toString oldDependency));
+
+  referencesOf = drv: getAttr (discard (toString drv)) references;
+
+  dependsOnOld = drv: elem oldStorepath (referencesOf drv) ||
+    any dependsOnOld (referencesOf drv);
+
+  drvName = drv:
+    discard (substring 33 (stringLength (builtins.baseNameOf drv)) (builtins.baseNameOf drv));
+
+  rewriteHashes = drv: hashes: runCommand (drvName drv) { nixStore = "${nix}/bin/nix-store"; } ''
+    $nixStore --dump ${drv} | sed 's|${baseNameOf drv}|'$(basename $out)'|g' | sed -e ${
+      concatStringsSep " -e " (mapAttrsToList (name: value:
+        "'s|${baseNameOf name}|${baseNameOf value}|g'"
+      ) hashes)
+    } | $nixStore --restore $out
+  '';
+
+  rewrittenDeps = listToAttrs [ {name = discard (toString oldDependency); value = newDependency;} ];
+
+  rewrittenDerivations = drv:
+    if dependsOnOld drv
+      then listToAttrs [ {
+        name = discard (toString drv);
+
+        value = rewriteHashes drv (rewrittenDeps // (fold (drv: acc:
+          (rewrittenDerivations drv) // acc
+        ) {} (referencesOf drv)));
+      } ]
+      else {};
+in assert (stringLength (drvName (toString oldDependency)) == stringLength (drvName (toString newDependency)));
+getAttr (discard (toString drv)) (rewrittenDerivations drv)
diff --git a/pkgs/build-support/setup-hooks/autoreconf.sh b/pkgs/build-support/setup-hooks/autoreconf.sh
new file mode 100644
index 00000000000..f70a1087084
--- /dev/null
+++ b/pkgs/build-support/setup-hooks/autoreconf.sh
@@ -0,0 +1,11 @@
+preConfigurePhases+=" autoreconfPhase"
+
+for i in @autoconf@ @automake@ @libtool@; do
+    findInputs $i nativePkgs propagated-native-build-inputs
+done
+
+autoreconfPhase() {
+    runHook preAutoreconf
+    autoreconf ${autoreconfFlags:---install --force}
+    runHook postAutoreconf
+}
diff --git a/pkgs/build-support/make-wrapper/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh
index 41f2a59246d..41f2a59246d 100644
--- a/pkgs/build-support/make-wrapper/make-wrapper.sh
+++ b/pkgs/build-support/setup-hooks/make-wrapper.sh
diff --git a/pkgs/build-support/source-from-head-fun.nix b/pkgs/build-support/source-from-head-fun.nix
index 3281cec5444..c6d6cfcc95b 100644
--- a/pkgs/build-support/source-from-head-fun.nix
+++ b/pkgs/build-support/source-from-head-fun.nix
@@ -9,8 +9,8 @@
    The documentation is availible at http://github.com/MarcWeber/nix-repository-manager/raw/master/README
 
 */
-{ getConfig }:
+{ config }:
   localTarName: publishedSrcSnapshot:
-  if getConfig ["sourceFromHead" "useLocalRepos"] false then
-    "${getConfig ["sourceFromHead" "managedRepoDir"] "/set/sourceFromHead.managedRepoDir/please"}/dist/${localTarName}"
+  if config.sourceFromHead.useLocalRepos or false then
+    "${config.sourceFromHead.managedRepoDir or "/set/sourceFromHead.managedRepoDir/please"}/dist/${localTarName}"
   else publishedSrcSnapshot
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index 474d43c30ff..5ae2e7b4fc9 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -55,7 +55,7 @@ rec {
         mkdir -p $out/nix-support
         cp ${script} $out/nix-support/setup-hook
       '' + stdenv.lib.optionalString (deps != []) ''
-        echo ${toString deps} > $out/nix-support/propagated-build-native-inputs
+        echo ${toString deps} > $out/nix-support/propagated-native-build-inputs
       '' + stdenv.lib.optionalString (substitutions != {}) ''
         substituteAll ${script} $out/nix-support/setup-hook
       '');
diff --git a/pkgs/build-support/upstream-updater/update-walker-service-specific.sh b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh
new file mode 100644
index 00000000000..4f3a7110346
--- /dev/null
+++ b/pkgs/build-support/upstream-updater/update-walker-service-specific.sh
@@ -0,0 +1,9 @@
+SF_redirect () {
+  redirect
+  process 'http://[a-z]+[.]dl[.]sourceforge[.]net/' 'mirror://sourceforge/'
+  process '[?].*' ''
+}
+
+SF_version_dir () {
+  version_link 'http://sourceforge.net/.+/[0-9.]+/$'
+}
diff --git a/pkgs/build-support/upstream-updater/update-walker.sh b/pkgs/build-support/upstream-updater/update-walker.sh
new file mode 100755
index 00000000000..c4dc7713f50
--- /dev/null
+++ b/pkgs/build-support/upstream-updater/update-walker.sh
@@ -0,0 +1,249 @@
+#! /bin/sh
+
+own_dir="$(cd "$(dirname "$0")"; pwd)"
+
+CURRENT_URL=
+NEED_TO_CHOOSE_URL=1
+
+url () {
+  CURRENT_URL="$1"
+}
+
+version_unpack () {
+  sed -re '
+    s/[.]/ /g; 
+    s@/@ / @g
+    s/-(rc|pre)/ -1 \1 /g; 
+    s/-(gamma)/ -2 \1 /g; 
+    s/-(beta)/ -3 \1 /g; 
+    s/-(alpha)/ -4 \1 /g;
+    s/[-]/ - /g; 
+    '
+}
+
+version_repack () {
+  sed -re '
+    s/ - /-/g;
+    s/ -[0-9]+ ([a-z]+) /-\1/g;
+    s@ / @/@g
+    s/ /./g; 
+    '
+}
+
+version_sort () {
+  version_unpack | 
+    sort -t ' ' -n $(for i in $(seq 30); do echo " -k${i}n" ; done) | tac |
+    version_repack
+}
+
+position_choice () {
+  head -n "${1:-1}" | tail -n "${2:-1}"
+}
+
+matching_links () {
+  "$own_dir"/urls-from-page.sh "$CURRENT_URL" | grep -E "$1"
+}
+
+link () {
+  CURRENT_URL="$(matching_links "$1" | position_choice "$2" "$3")"
+  unset NEED_TO_CHOOSE_URL
+  echo "Linked by: $*"
+  echo "URL: $CURRENT_URL" >&2
+}
+
+version_link () {
+  CURRENT_URL="$(matching_links "$1" | version_sort | position_choice "$2" "$3")"
+  unset NEED_TO_CHOOSE_URL
+  echo "Linked version by: $*"
+  echo "URL: $CURRENT_URL" >&2
+}
+
+redirect () {
+  CURRENT_URL="$(curl -I -L --max-redirs "${1:-99}" "$CURRENT_URL" | 
+    grep -E '^Location: ' | position_choice "${2:-999999}" "$3" |
+    sed -e 's/^Location: //; s/\r//')"
+  echo "Redirected: $*"
+  echo "URL: $CURRENT_URL" >&2
+}
+
+replace () {
+  sed -re "s	$1	$2	g"
+}
+
+process () {
+  CURRENT_URL="$(echo "$CURRENT_URL" | replace "$1" "$2")"
+  echo "Processed: $*"
+  echo "URL: $CURRENT_URL" >&2
+}
+
+version () {
+  CURRENT_VERSION="$(echo "$CURRENT_URL" | replace "$1" "$2")"
+  echo "Version: $CURRENT_VERSION" >&2
+}
+
+ensure_version () {
+  echo "Ensuring version. CURRENT_VERSION: $CURRENT_VERSION" >&2
+  [ -z "$CURRENT_VERSION" ] && version '.*-([0-9.]+)[-._].*' '\1'
+}
+
+ensure_target () {
+  echo "Ensuring target. CURRENT_TARGET: $CURRENT_TARGET" >&2
+  [ -z "$CURRENT_TARGET" ] && target "$(basename "$CONFIG_NAME" .upstream).nix"
+}
+
+ensure_name () {
+  echo "Ensuring name. CURRENT_NAME: $CURRENT_NAME" >&2
+  [ -z "$CURRENT_NAME" ] && name "$(basename "$CONFIG_DIR")"
+  echo "Resulting name: $CURRENT_NAME"
+}
+
+ensure_attribute_name () {
+  echo "Ensuring attribute name. CURRENT_ATTRIBUTE_NAME: $CURRENT_ATTRIBUTE_NAME" >&2
+  [ -z "$CURRENT_ATTRIBUTE_NAME" ] && attribute_name "$CURRENT_NAME"
+  echo "Resulting attribute name: $CURRENT_ATTRIBUTE_NAME"
+}
+
+ensure_choice () {
+  echo "Ensuring that choice is made." >&2
+  echo "NEED_TO_CHOOSE_URL: [$NEED_TO_CHOOSE_URL]." >&2
+  echo "CURRENT_URL: $CURRENT_URL" >&2
+  [ -n "$NEED_TO_CHOOSE_URL" ] && {
+    version_link '[.]tar[.]([^./])+$'
+    unset NEED_TO_CHOOSE_URL
+  }
+  [ -z "$CURRENT_URL" ] && {
+    echo "Error: empty CURRENT_URL"
+    echo "Error: empty CURRENT_URL" >&2
+    exit 1
+  }
+}
+
+ensure_hash () {
+  echo "Ensuring hash. CURRENT_HASH: $CURRENT_HASH" >&2
+  [ -z "$CURRENT_HASH" ] && hash
+}
+
+hash () {
+  CURRENT_HASH="$(nix-prefetch-url "$CURRENT_URL")"
+  echo "CURRENT_HASH: $CURRENT_HASH" >&2
+}
+
+name () {
+  CURRENT_NAME="$1"
+  echo "CURRENT_NAME: $CURRENT_NAME" >&2
+}
+
+attribute_name () {
+  CURRENT_ATTRIBUTE_NAME="$1"
+  echo "CURRENT_ATTRIBUTE_NAME: $CURRENT_ATTRIBUTE_NAME" >&2
+}
+
+retrieve_version () {
+  PACKAGED_VERSION="$(nix-instantiate --eval-only '<nixpkgs>' -A "$CURRENT_ATTRIBUTE_NAME".meta.version | xargs)"
+}
+
+directory_of () {
+  cd "$(dirname "$1")"; pwd
+}
+
+full_path () {
+  echo "$(directory_of "$1")/$(basename "$1")"
+}
+
+target () {
+  CURRENT_TARGET="$1"
+  { [ "$CURRENT_TARGET" = "${CURRENT_TARGET#/}" ] && CURRENT_TARGET="$CONFIG_DIR/$CURRENT_TARGET"; }
+  echo "Target set to: $CURRENT_TARGET"
+}
+
+marker () {
+  BEGIN_EXPRESSION="$1"
+}
+
+update_found () {
+  echo "Compare: $CURRENT_VERSION vs $PACKAGED_VERSION"
+  [ "$CURRENT_VERSION" != "$PACKAGED_VERSION" ]
+}
+
+do_write_expression () {
+  echo "${1}rec {"
+  echo "${1}  baseName=\"$CURRENT_NAME\";"
+  echo "${1}  version=\"$CURRENT_VERSION\";"
+  echo "${1}  name=\"\${baseName}-\${version}\";"
+  echo "${1}  hash=\"$CURRENT_HASH\";"
+  echo "${1}  url=\"$CURRENT_URL\";"
+  echo "${1}  sha256=\"$CURRENT_HASH\";"
+  echo "$2"
+}
+
+line_position () {
+  file="$1"
+  regexp="$2"
+  count="${3:-1}"
+  grep -E "$regexp" -m "$count" -B 999999 "$file" | wc -l
+}
+
+replace_once () {
+  file="$1"
+  regexp="$2"
+  replacement="$3"
+  instance="${4:-1}"
+
+  echo "Replacing once:"
+  echo "file: [[$file]]"
+  echo "regexp: [[$regexp]]"
+  echo "replacement: [[$replacement]]"
+  echo "instance: [[$instance]]"
+
+  position="$(line_position "$file" "$regexp" "$instance")"
+  sed -re "${position}s	$regexp	$replacement	" -i "$file"
+}
+
+set_var_value () {
+  var="${1}"
+  value="${2}"
+  instance="${3:-1}"
+  file="${4:-$CURRENT_TARGET}"
+  no_quotes="${5:-0}"
+
+  quote='"'
+  let "$no_quotes" && quote=""
+
+  replace_once "$file" "${var} *= *.*" "${var} = ${quote}${value}${quote};" "$instance"
+}
+
+do_regenerate () {
+  BEFORE="$(cat "$1" | grep -F "$BEGIN_EXPRESSION" -B 999999;)"
+  AFTER_EXPANDED="$(cat "$1" | grep -F "$BEGIN_EXPRESSION" -A 999999 | grep -E '^ *[}] *; *$' -A 999999;)"
+  AFTER="$(echo "$AFTER_EXPANDED" | tail -n +2)"
+  CLOSE_BRACE="$(echo "$AFTER_EXPANDED" | head -n 1)"
+  SPACING="$(echo "$CLOSE_BRACE" | sed -re 's/[^ ].*//')"
+
+  echo "$BEFORE"
+  do_write_expression "$SPACING" "$CLOSE_BRACE"
+  echo "$AFTER"
+}
+
+do_overwrite () {
+  ensure_hash
+  do_regenerate "$1" > "$1.new.tmp"
+  mv "$1.new.tmp" "$1"
+}
+
+process_config () {
+  CONFIG_DIR="$(directory_of "$1")"
+  CONFIG_NAME="$(basename "$1")"
+  BEGIN_EXPRESSION='# Generated upstream information';
+  source "$CONFIG_DIR/$CONFIG_NAME"
+  ensure_name
+  ensure_attribute_name
+  retrieve_version
+  ensure_choice
+  ensure_version
+  ensure_target
+  update_found && do_overwrite "$CURRENT_TARGET"
+}
+
+source "$own_dir/update-walker-service-specific.sh"
+
+process_config "$1"
diff --git a/pkgs/build-support/upstream-updater/urls-from-page.sh b/pkgs/build-support/upstream-updater/urls-from-page.sh
index 065e3faf309..d456794a563 100755
--- a/pkgs/build-support/upstream-updater/urls-from-page.sh
+++ b/pkgs/build-support/upstream-updater/urls-from-page.sh
@@ -9,6 +9,6 @@ relpath="${path#$server}"
  
 echo "URL: $url" >&2
 
-curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]="([^"]*)"/\n+\1\n-/g' | \
+curl -L -k "$url" | sed -re 's/^/-/;s/[hH][rR][eE][fF]=("([^"]*)"|'\''([^'\'']*)'\''|([^"'\'' <>&]+)[ <>&])/\n+\2\3\4\n-/g' | \
   sed -e '/^-/d; s/^[+]//; /^#/d;'"s/^\\//$protocol:\\/\\/$server\\//g" | \
-  sed -re 's~^[^:]*$~'"$protocol://$basepath/&~"
+  sed -re 's`^[^:]*$`'"$protocol://$basepath/&\`"
diff --git a/pkgs/build-support/vm/deb/deb-closure.pl b/pkgs/build-support/vm/deb/deb-closure.pl
index 5e4ea54c43f..bed397d6f07 100644
--- a/pkgs/build-support/vm/deb/deb-closure.pl
+++ b/pkgs/build-support/vm/deb/deb-closure.pl
@@ -1,5 +1,5 @@
 use strict;
-use Dpkg::Cdata;
+use Dpkg::Control;
 use Dpkg::Deps;
 use File::Basename;
 
@@ -7,6 +7,7 @@ my $packagesFile = shift @ARGV;
 my $urlPrefix = shift @ARGV;
 my @toplevelPkgs = @ARGV;
 
+
 my %packages;
 
 
@@ -14,10 +15,10 @@ my %packages;
 open PACKAGES, "<$packagesFile" or die;
 
 while (1) {
-    my $cdata = parsecdata(\*PACKAGES, $packagesFile);
-    last unless defined $cdata;
-    #print $cdata->{Package}, "\n";
+    my $cdata = Dpkg::Control->new(type => CTRL_INFO_PKG);
+    last if not $cdata->parse(\*PACKAGES, $packagesFile);
     die unless defined $cdata->{Package};
+    #print STDERR $cdata->{Package}, "\n";
     $packages{$cdata->{Package}} = $cdata;
 }
 
@@ -45,15 +46,27 @@ sub getDeps {
 }
 
 
-# Process the "Provides" fields to be able to resolve virtual dependencies.
+# Process the "Provides" and "Replaces" fields to be able to resolve
+# virtual dependencies.
 my %provides;
 
 foreach my $cdata (values %packages) {
-    next unless defined $cdata->{Provides};
-    my @provides = getDeps(Dpkg::Deps::parse($cdata->{Provides}));
-    foreach my $name (@provides) {
-        #die "conflicting provide: $name\n" if defined $provides{$name};
-        $provides{$name} = $cdata->{Package};
+    if (defined $cdata->{Provides}) {
+        my @provides = getDeps(Dpkg::Deps::deps_parse($cdata->{Provides}));
+        foreach my $name (@provides) {
+            #die "conflicting provide: $name\n" if defined $provides{$name};
+            #warn "provide by $cdata->{Package} conflicts with package with the same name: $name\n";
+            next if defined $packages{$name};
+            $provides{$name} = $cdata->{Package};
+        }
+    }
+    # Treat "Replaces" like "Provides".
+    if (defined $cdata->{Replaces}) {
+        my @replaces = getDeps(Dpkg::Deps::deps_parse($cdata->{Replaces}));
+        foreach my $name (@replaces) {
+            next if defined $packages{$name};
+            $provides{$name} = $cdata->{Package};
+        }
     }
 }
 
@@ -67,7 +80,7 @@ sub closePackage {
     my $pkgName = shift;
     print STDERR ">>> $pkgName\n";
     my $cdata = $packages{$pkgName};
-    
+
     if (!defined $cdata) {
         die "unknown (virtual) package $pkgName"
             unless defined $provides{$pkgName};
@@ -75,29 +88,29 @@ sub closePackage {
         $pkgName = $provides{$pkgName};
         $cdata = $packages{$pkgName};
     }
-    
+
     die "unknown package $pkgName" unless defined $cdata;
     return if defined $donePkgs{$pkgName};
     $donePkgs{$pkgName} = 1;
 
     if (defined $cdata->{Provides}) {
-        foreach my $name (getDeps(Dpkg::Deps::parse($cdata->{Provides}))) {
+        foreach my $name (getDeps(Dpkg::Deps::deps_parse($cdata->{Provides}))) {
             $provides{$name} = $cdata->{Package};
         }
     }
-    
+
     my @depNames = ();
-    
+
     if (defined $cdata->{Depends}) {
         print STDERR "    $pkgName: $cdata->{Depends}\n";
-        my $deps = Dpkg::Deps::parse($cdata->{Depends});
+        my $deps = Dpkg::Deps::deps_parse($cdata->{Depends});
         die unless defined $deps;
         push @depNames, getDeps($deps);
     }
 
     if (defined $cdata->{'Pre-Depends'}) {
         print STDERR "    $pkgName: $cdata->{'Pre-Depends'}\n";
-        my $deps = Dpkg::Deps::parse($cdata->{'Pre-Depends'});
+        my $deps = Dpkg::Deps::deps_parse($cdata->{'Pre-Depends'});
         die unless defined $deps;
         push @depNames, getDeps($deps);
     }
@@ -141,7 +154,7 @@ foreach my $pkgName (@order) {
     my $origName = basename $cdata->{Filename};
     my $cleanedName = $origName;
     $cleanedName =~ s/~//g;
-    
+
     print "    (fetchurl {\n";
     print "      url = $urlPrefix/$cdata->{Filename};\n";
     print "      sha256 = \"$cdata->{SHA256}\";\n";
@@ -165,4 +178,3 @@ if ($newComponent != 1) {
     print STDERR "argh: ", keys %forward, "\n";
     exit 1;
 }
-    
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 777cc72aa0b..b1eb82ed830 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -1,9 +1,9 @@
 { pkgs
-, linuxKernel ? pkgs.linux
+, linuxKernel ? pkgs.linux_3_9
 , img ? "bzImage"
 , rootModules ?
     [ "cifs" "virtio_net" "virtio_pci" "virtio_blk" "virtio_balloon" "nls_utf8" "ext2" "ext3"
-      "unix" "hmac" "md4" "ecb" "des_generic"
+      "ext4" "unix" "hmac" "md4" "ecb" "des_generic" "sha256"
     ]
 }:
 
@@ -34,56 +34,41 @@ rec {
     ''
       mkdir -p $out/bin
       mkdir -p $out/lib
-      
+
       # Copy what we need from Glibc.
       cp -p ${pkgs.stdenv.glibc}/lib/ld-linux*.so.? $out/lib
       cp -p ${pkgs.stdenv.glibc}/lib/libc.so.* $out/lib
-      cp -p ${pkgs.stdenv.glibc}/lib/librt.so.* $out/lib
-      cp -p ${pkgs.stdenv.glibc}/lib/libdl.so.* $out/lib
-
-      # Copy some utillinux stuff.
-      cp ${utillinux}/bin/mount ${utillinux}/bin/umount $out/bin
-      cp -pd ${utillinux}/lib/libblkid*.so.* $out/lib
-      cp -pd ${utillinux}/lib/libuuid*.so.* $out/lib
-
-      # Copy some coreutils.
-      cp ${coreutils}/bin/basename $out/bin
-      cp ${coreutils}/bin/mkdir $out/bin
-      cp ${coreutils}/bin/mknod $out/bin
-      cp ${coreutils}/bin/cat $out/bin
-      cp ${coreutils}/bin/chroot $out/bin
-      cp ${coreutils}/bin/sleep $out/bin
-      cp ${coreutils}/bin/ln $out/bin
-
-      # Copy some other tools.
-      cp ${bash}/bin/bash $out/bin
-      cp ${module_init_tools}/sbin/insmod $out/bin/insmod
-      cp ${nettools}/sbin/ifconfig $out/bin
-      cp ${sysvinit}/sbin/halt $out/bin
-            
+      cp -p ${pkgs.stdenv.glibc}/lib/libm.so.* $out/lib
+
+      # Copy BusyBox.
+      cp -pd ${pkgs.busybox}/bin/* ${pkgs.busybox}/sbin/* $out/bin
+
       # Run patchelf to make the programs refer to the copied libraries.
       for i in $out/bin/* $out/lib/*; do if ! test -L $i; then nuke-refs $i; fi; done
 
       for i in $out/bin/*; do
-          echo "patching $i..."
-          patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true
+          if [ -f "$i" -a ! -L "$i" ]; then
+              echo "patching $i..."
+              patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib $i || true
+          fi
       done
     ''; # */
 
-    
+
   createDeviceNodes = dev:
     ''
-      mknod ${dev}/null c 1 3
-      mknod ${dev}/zero c 1 5
-      mknod ${dev}/tty  c 5 0
+      mknod ${dev}/null    c 1 3
+      mknod ${dev}/zero    c 1 5
+      mknod ${dev}/random  c 1 8
+      mknod ${dev}/urandom c 1 9
+      mknod ${dev}/tty     c 5 0
       . /sys/class/block/${hd}/uevent
       mknod ${dev}/${hd} b $MAJOR $MINOR
     '';
 
-  
+
   stage1Init = writeScript "vm-run-stage1" ''
-    #! ${initrdUtils}/bin/bash -e
-    echo START
+    #! ${initrdUtils}/bin/ash -e
 
     export PATH=${initrdUtils}/bin
 
@@ -122,7 +107,7 @@ rec {
 
     mount -t tmpfs none /dev
     ${createDeviceNodes "/dev"}
-    
+
     ifconfig eth0 up 10.0.2.15
 
     mkdir /fs
@@ -138,14 +123,14 @@ rec {
 
     echo "mounting Nix store..."
     mkdir -p /fs/nix/store
-    mount -t cifs //10.0.2.4/store /fs/nix/store -o guest,sec=none
+    mount -t cifs //10.0.2.4/store /fs/nix/store -o guest,sec=none,sec=ntlm
 
     mkdir -p /fs/tmp
     mount -t tmpfs -o "mode=755" none /fs/tmp
 
     echo "mounting host's temporary directory..."
     mkdir -p /fs/tmp/xchg
-    mount -t cifs //10.0.2.4/xchg /fs/tmp/xchg -o guest,sec=none
+    mount -t cifs //10.0.2.4/xchg /fs/tmp/xchg -o guest,sec=none,sec=ntlm
 
     mkdir -p /fs/proc
     mount -t proc none /fs/proc
@@ -155,7 +140,7 @@ rec {
 
     mkdir -p /fs/etc
     ln -sf /proc/mounts /fs/etc/mtab
-    
+
     echo "Now running: $command"
     test -n "$command"
 
@@ -165,11 +150,10 @@ rec {
 
     mount -o remount,ro dummy /fs
 
-    echo DONE
-    halt -d -p -f
+    poweroff -f
   '';
 
-  
+
   initrd = makeInitrd {
     contents = [
       { object = stage1Init;
@@ -178,11 +162,11 @@ rec {
     ];
   };
 
-  
+
   stage2Init = writeScript "vm-run-stage2" ''
     #! ${bash}/bin/sh
     source /tmp/xchg/saved-env
-    
+
     export NIX_STORE=/nix/store
     export NIX_BUILD_TOP=/tmp
     export TMPDIR=/tmp
@@ -286,12 +270,12 @@ rec {
 
     chmod +x ./run-vm
     source ./run-vm
-    
+
     if ! test -e xchg/in-vm-exit; then
       echo "Virtual machine didn't produce an exit code."
       exit 1
     fi
-    
+
     eval "$postVM"
 
     exit $(cat xchg/in-vm-exit)
@@ -318,7 +302,7 @@ rec {
     fi
     touch /mnt/.debug
 
-    mkdir /mnt/proc /mnt/dev /mnt/sys /mnt/bin
+    mkdir /mnt/proc /mnt/dev /mnt/sys
     ${createDeviceNodes "/mnt/dev"}
   '';
 
@@ -343,7 +327,7 @@ rec {
      If the build fails and Nix is run with the `-K' option, a script
      `run-vm' will be left behind in the temporary build directory
      that allows you to boot into the VM and debug it interactively. */
-     
+
   runInLinuxVM = drv: lib.overrideDerivation drv (attrs: {
     requiredSystemFeatures = [ "kvm" ];
     builder = "${bash}/bin/sh";
@@ -353,7 +337,7 @@ rec {
     QEMU_OPTS = "-m ${toString (if attrs ? memSize then attrs.memSize else 256)}";
   });
 
-  
+
   extractFs = {file, fs ? null} :
     with pkgs; runInLinuxVM (
     stdenv.mkDerivation {
@@ -379,7 +363,7 @@ rec {
       '';
     });
 
-    
+
   extractMTDfs = {file, fs ? null} :
     with pkgs; runInLinuxVM (
     stdenv.mkDerivation {
@@ -406,7 +390,7 @@ rec {
       '';
     });
 
-    
+
   qemuCommandGeneric = ''
     PATH="${samba}/sbin:$PATH" \
     ${kvm}/bin/qemu-kvm \
@@ -415,7 +399,7 @@ rec {
       $QEMU_OPTS
   '';
 
-  
+
   /* Run a command in an x86 virtual machine image containing an
      arbitrary OS.  The VM should be configured to do the following:
 
@@ -460,8 +444,8 @@ rec {
      the Nix store, but using the tools provided by /bin, /usr/bin
      etc. from the specified filesystem image, which typically is a
      filesystem containing a non-NixOS Linux distribution. */
-     
-  runInLinuxImage = attrs: runInLinuxVM (attrs // {
+
+  runInLinuxImage = drv: runInLinuxVM (lib.overrideDerivation drv (attrs: {
     mountDisk = true;
 
     /* Mount `image' as the root FS, but use a temporary copy-on-write
@@ -486,17 +470,18 @@ rec {
 
     /* Don't run Nix-specific build steps like patchelf. */
     fixupPhase = "true";
-  });
+  }));
 
 
   /* Create a filesystem image of the specified size and fill it with
      a set of RPM packages. */
-    
+
   fillDiskWithRPMs =
     { size ? 4096, rpms, name, fullName, preInstall ? "", postInstall ? ""
     , runScripts ? true, createRootFS ? defaultCreateRootFS
+    , unifiedSystemDir ? false
     }:
-    
+
     runInLinuxVM (stdenv.mkDerivation {
       inherit name preInstall postInstall rpms;
       memSize = 512;
@@ -506,11 +491,26 @@ rec {
         ${createRootFS}
 
         chroot=$(type -tP chroot)
-        
+
+        # Make the Nix store available in /mnt, because that's where the RPMs live.
+        mkdir -p /mnt/nix/store
+        ${utillinux}/bin/mount -o bind /nix/store /mnt/nix/store
+
+        # Newer distributions like Fedora 18 require /lib etc. to be
+        # symlinked to /usr.
+        ${lib.optionalString unifiedSystemDir ''
+          mkdir -p /mnt/usr/bin /mnt/usr/sbin /mnt/usr/lib /mnt/usr/lib64
+          ln -s /usr/bin /mnt/bin
+          ln -s /usr/sbin /mnt/sbin
+          ln -s /usr/lib /mnt/lib
+          ln -s /usr/lib64 /mnt/lib64
+          ${utillinux}/bin/mount -t proc none /mnt/proc
+        ''}
+
         echo "unpacking RPMs..."
         for i in $rpms; do
             echo "$i..."
-            ${rpm}/bin/rpm2cpio "$i" | (cd /mnt && ${cpio}/bin/cpio -i --make-directories)
+            ${rpm}/bin/rpm2cpio "$i" | (chroot /mnt ${cpio}/bin/cpio -i --make-directories)
         done
 
         eval "$preInstall"
@@ -521,23 +521,19 @@ rec {
         PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
           rpm --initdb
 
-        # Make the Nix store available in /mnt, because that's where the RPMs live.
-        mkdir -p /mnt/nix/store
-        ${utillinux}/bin/mount -o bind /nix/store /mnt/nix/store
         ${utillinux}/bin/mount -o bind /tmp /mnt/tmp
-        
+
         echo "installing RPMs..."
         PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
           rpm -iv ${if runScripts then "" else "--noscripts"} $rpms
 
         echo "running post-install script..."
         eval "$postInstall"
-        
+
         rm /mnt/.debug
 
-        ${utillinux}/bin/umount /mnt/nix/store 
-        ${utillinux}/bin/umount /mnt/tmp 
-        ${utillinux}/bin/umount /mnt 
+        ${utillinux}/bin/umount /mnt/nix/store /mnt/tmp ${lib.optionalString unifiedSystemDir "/mnt/proc"}
+        ${utillinux}/bin/umount /mnt
       '';
 
       passthru = { inherit fullName; };
@@ -546,7 +542,7 @@ rec {
 
   /* Generate a script that can be used to run an interactive session
      in the given image. */
-     
+
   makeImageTestScript = image: writeScript "image-test" ''
     #! ${bash}/bin/sh
     if test -z "$1"; then
@@ -571,7 +567,7 @@ rec {
   /* Build RPM packages from the tarball `src' in the Linux
      distribution installed in the filesystem `diskImage'.  The
      tarball must contain an RPM specfile. */
-  
+
   buildRPM = attrs: runInLinuxImage (stdenv.mkDerivation ({
     phases = "prepareImagePhase sysInfoPhase buildPhase installPhase";
 
@@ -584,7 +580,7 @@ rec {
         done
       fi
     '';
-  
+
     sysInfoPhase = ''
       echo "System/kernel: $(uname -a)"
       if test -e /etc/fedora-release; then echo "Fedora release: $(cat /etc/fedora-release)"; fi
@@ -593,7 +589,7 @@ rec {
       rpm -qa --qf "%{Name}-%{Version}-%{Release} (%{Arch}; %{Distribution}; %{Vendor})\n"
       stopNest
     '';
-    
+
     buildPhase = ''
       eval "$preBuild"
 
@@ -610,7 +606,7 @@ rec {
       mkdir $rpmout $rpmout/SPECS $rpmout/BUILD $rpmout/RPMS $rpmout/SRPMS
 
       echo "%_topdir $rpmout" >> $HOME/.rpmmacros
-      
+
       rpmbuild -vv -ta "$srcName"
 
       eval "$postBuild"
@@ -640,7 +636,7 @@ rec {
 
   fillDiskWithDebs =
     { size ? 4096, debs, name, fullName, postInstall ? null, createRootFS ? defaultCreateRootFS }:
-    
+
     runInLinuxVM (stdenv.mkDerivation {
       inherit name postInstall;
 
@@ -656,7 +652,7 @@ rec {
         # Unpack the .debs.  We do this to prevent pre-install scripts
         # (which have lots of circular dependencies) from barfing.
         echo "unpacking Debs..."
-        
+
         for deb in $debs; do
           if test "$deb" != "|"; then
             echo "$deb..."
@@ -669,7 +665,7 @@ rec {
         ${utillinux}/bin/mount -o bind /nix/store /mnt/inst/nix/store
         ${utillinux}/bin/mount -o bind /proc /mnt/proc
         ${utillinux}/bin/mount -o bind /dev /mnt/dev
-        
+
         # Misc. files/directories assumed by various packages.
         echo "initialising Dpkg DB..."
         touch /mnt/etc/shells
@@ -683,7 +679,7 @@ rec {
         echo "installing Debs..."
 
         export DEBIAN_FRONTEND=noninteractive
-        
+
         oldIFS="$IFS"
         IFS="|"
         for component in $debs; do
@@ -698,13 +694,13 @@ rec {
           PATH=/usr/bin:/bin:/usr/sbin:/sbin $chroot /mnt \
             /usr/bin/dpkg --install --force-all $debs < /dev/null || true
         done
-        
+
         echo "running post-install script..."
         eval "$postInstall"
         ln -sf dash /mnt/bin/sh
 
         rm /mnt/.debug
-        
+
         ${utillinux}/bin/umount /mnt/inst/nix/store
         ${utillinux}/bin/umount /mnt/proc
         ${utillinux}/bin/umount /mnt/dev
@@ -718,10 +714,10 @@ rec {
   /* Generate a Nix expression containing fetchurl calls for the
      closure of a set of top-level RPM packages from the
      `primary.xml.gz' file of a Fedora or openSUSE distribution. */
-     
+
   rpmClosureGenerator =
     {name, packagesLists, urlPrefixes, packages, archs ? []}:
-    assert (builtins.length packagesLists) == (builtins.length urlPrefixes) ;
+    assert (builtins.length packagesLists) == (builtins.length urlPrefixes);
     runCommand "${name}.nix" {buildInputs = [perl perlPackages.XMLSimple]; inherit archs;} ''
       ${lib.concatImapStrings (i: pl: ''
         gunzip < ${pl} > ./packages_${toString i}.xml
@@ -735,17 +731,18 @@ rec {
   /* Helper function that combines rpmClosureGenerator and
      fillDiskWithRPMs to generate a disk image from a set of package
      names. */
-     
+
   makeImageFromRPMDist =
     { name, fullName, size ? 4096
     , urlPrefix ? "", urlPrefixes ? [urlPrefix]
     , packagesList ? "", packagesLists ? [packagesList]
     , packages, extraPackages ? []
     , preInstall ? "", postInstall ? "", archs ? ["noarch" "i386"]
-    , runScripts ? true, createRootFS ? defaultCreateRootFS }:
+    , runScripts ? true, createRootFS ? defaultCreateRootFS
+    , unifiedSystemDir ? false }:
 
     fillDiskWithRPMs {
-      inherit name fullName size preInstall postInstall runScripts createRootFS;
+      inherit name fullName size preInstall postInstall runScripts createRootFS unifiedSystemDir;
       rpms = import (rpmClosureGenerator {
         inherit name packagesLists urlPrefixes archs;
         packages = packages ++ extraPackages;
@@ -757,30 +754,34 @@ rec {
      (i.e. generate a closure from a Packages.bz2 file). */
 
   debClosureGenerator =
-    {name, packagesList, urlPrefix, packages}:
-    
-    runCommand "${name}.nix" {} ''
-      bunzip2 < ${packagesList} > ./Packages
+    {name, packagesLists, urlPrefix, packages}:
+
+    runCommand "${name}.nix" { buildInputs = [ perl dpkg ]; } ''
+      for i in ${toString packagesLists}; do
+        echo "adding $i..."
+        bunzip2 < $i >> ./Packages
+      done
 
       # Work around this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=452279
       sed -i ./Packages -e s/x86_64-linux-gnu/x86-64-linux-gnu/g
 
-      ${perl}/bin/perl -I${dpkg} -w ${deb/deb-closure.pl} \
+      perl -w ${deb/deb-closure.pl} \
         ./Packages ${urlPrefix} ${toString packages} > $out
     '';
-  
+
 
   /* Helper function that combines debClosureGenerator and
      fillDiskWithDebs to generate a disk image from a set of package
      names. */
-     
+
   makeImageFromDebDist =
-    { name, fullName, size ? 4096, urlPrefix, packagesList
+    { name, fullName, size ? 4096, urlPrefix
+    , packagesList ? "", packagesLists ? [packagesList]
     , packages, extraPackages ? [], postInstall ? "" }:
 
     let
       expr = debClosureGenerator {
-        inherit name packagesList urlPrefix;
+        inherit name packagesLists urlPrefix;
         packages = packages ++ extraPackages;
       };
     in
@@ -791,7 +792,7 @@ rec {
 
 
   /* The set of supported RPM-based distributions. */
-      
+
   rpmDistros = {
 
     fedora2i386 = {
@@ -818,7 +819,7 @@ rec {
       runScripts = false;
       packages = commonFedoraPackages;
     };
-    
+
     fedora5i386 = {
       name = "fedora-core-5-i386";
       fullName = "Fedora Core 5 (i386)";
@@ -829,7 +830,7 @@ rec {
       urlPrefix = mirror://fedora/linux/core/5/i386/os;
       packages = commonFedoraPackages ++ [ "util-linux" ];
     };
-    
+
     fedora7i386 = {
       name = "fedora-7-i386";
       fullName = "Fedora 7 (i386)";
@@ -840,7 +841,7 @@ rec {
       urlPrefix = mirror://fedora/linux/releases/7/Everything/i386/os;
       packages = commonFedoraPackages;
     };
-    
+
     fedora8i386 = {
       name = "fedora-8-i386";
       fullName = "Fedora 8 (i386)";
@@ -994,6 +995,32 @@ rec {
       packages = commonFedoraPackages ++ [ "cronie" "util-linux" ];
     };
 
+    fedora18i386 = {
+      name = "fedora-18-i386";
+      fullName = "Fedora 18 (i386)";
+      packagesList = fetchurl {
+        url = mirror://fedora/linux/releases/18/Everything/i386/os/repodata/935f57e61365047b6aee346792bc68bfd24de30874ce5d26bf730a992d36678d-primary.xml.gz;
+        sha256 = "935f57e61365047b6aee346792bc68bfd24de30874ce5d26bf730a992d36678d";
+      };
+      urlPrefix = mirror://fedora/linux/releases/18/Everything/i386/os;
+      archs = ["noarch" "i386" "i586" "i686"];
+      packages = commonFedoraPackages ++ [ "cronie" "util-linux" ];
+      unifiedSystemDir = true;
+    };
+
+    fedora18x86_64 = {
+      name = "fedora-18-x86_64";
+      fullName = "Fedora 18 (x86_64)";
+      packagesList = fetchurl {
+        url = mirror://fedora/linux/releases/18/Everything/x86_64/os/repodata/463ac49f2218e404607b2eeb3c04be1a648d90293f4239bbb6a63c2fed672bea-primary.xml.gz;
+        sha256 = "463ac49f2218e404607b2eeb3c04be1a648d90293f4239bbb6a63c2fed672bea";
+      };
+      urlPrefix = mirror://fedora/linux/releases/18/Everything/x86_64/os;
+      archs = ["noarch" "x86_64"];
+      packages = commonFedoraPackages ++ [ "cronie" "util-linux" ];
+      unifiedSystemDir = true;
+    };
+
     opensuse103i386 = {
       name = "opensuse-10.3-i586";
       fullName = "openSUSE 10.3 (i586)";
@@ -1058,9 +1085,9 @@ rec {
 
 
   /* The set of supported Dpkg-based distributions. */
-      
+
   debDistros = {
-  
+
     # Interestingly, the SHA-256 hashes provided by Ubuntu in
     # http://nl.archive.ubuntu.com/ubuntu/dists/{gutsy,hardy}/Release are
     # wrong, but the SHA-1 and MD5 hashes are correct.  Intrepid is fine.
@@ -1075,7 +1102,7 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebianPackages;
     };
-        
+
     ubuntu804i386 = {
       name = "ubuntu-8.04-hardy-i386";
       fullName = "Ubuntu 8.04 Hardy (i386)";
@@ -1086,7 +1113,7 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebianPackages;
     };
-         
+
     ubuntu804x86_64 = {
       name = "ubuntu-8.04-hardy-amd64";
       fullName = "Ubuntu 8.04 Hardy (amd64)";
@@ -1097,7 +1124,7 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebianPackages;
     };
-         
+
     ubuntu810i386 = {
       name = "ubuntu-8.10-intrepid-i386";
       fullName = "Ubuntu 8.10 Intrepid (i386)";
@@ -1108,7 +1135,7 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebianPackages;
     };
- 
+
     ubuntu810x86_64 = {
       name = "ubuntu-8.10-intrepid-amd64";
       fullName = "Ubuntu 8.10 Intrepid (amd64)";
@@ -1130,7 +1157,7 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebianPackages;
     };
- 
+
     ubuntu904x86_64 = {
       name = "ubuntu-9.04-jaunty-amd64";
       fullName = "Ubuntu 9.04 Jaunty (amd64)";
@@ -1152,11 +1179,11 @@ rec {
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diff" "mktemp" ];
     };
- 
+
     ubuntu910x86_64 = {
       name = "ubuntu-9.10-karmic-amd64";
       fullName = "Ubuntu 9.10 Karmic (amd64)";
-      packagesList = fetchurl {
+     packagesList = fetchurl {
         url = mirror://ubuntu/dists/karmic/main/binary-amd64/Packages.bz2;
         sha256 = "3a604fcb0c135eeb8b95da3e90a8fd4cfeff519b858cd3c9e62ea808cb9fec40";
       };
@@ -1167,43 +1194,67 @@ rec {
     ubuntu1004i386 = {
       name = "ubuntu-10.04-lucid-i386";
       fullName = "Ubuntu 10.04 Lucid (i386)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/lucid/main/binary-i386/Packages.bz2;
-        sha256 = "0e46596202a68caa754dfe0883f46047525309880c492cdd5e2d0970fcf626aa";
-      };
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/lucid/main/binary-i386/Packages.bz2;
+            sha256 = "0e46596202a68caa754dfe0883f46047525309880c492cdd5e2d0970fcf626aa";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/lucid/universe/binary-i386/Packages.bz2;
+            sha256 = "13nvsb7na9igps2fdbbfpq4y8ihccmcs6x35pfyfp6rkhjgpzigy";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" "mktemp" ];
     };
- 
+
     ubuntu1004x86_64 = {
       name = "ubuntu-10.04-lucid-amd64";
       fullName = "Ubuntu 10.04 Lucid (amd64)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/lucid/main/binary-amd64/Packages.bz2;
-        sha256 = "74a8f3192b0eda397d65316e0fa6cd34d5358dced41639e07d9f1047971bfef0";
-      };
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/lucid/main/binary-amd64/Packages.bz2;
+            sha256 = "74a8f3192b0eda397d65316e0fa6cd34d5358dced41639e07d9f1047971bfef0";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/lucid/universe/binary-amd64/Packages.bz2;
+            sha256 = "112lbnf8rcsbbh89aci4m6gwac0jy16838aij0av8n076zwkvlj9";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" "mktemp" ];
     };
 
     ubuntu1010i386 = {
-      name = "ubuntu-10.04-maverick-i386";
-      fullName = "Ubuntu 10.04 Maverick (i386)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/maverick/main/binary-i386/Packages.bz2;
-        sha256 = "1qjs4042y03bxbxwjs3pgrs99ba6vqvjaaz6zhaxxaqj1r12dwa0";
-      };
+      name = "ubuntu-10.10-maverick-i386";
+      fullName = "Ubuntu 10.10 Maverick (i386)";
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/maverick/main/binary-i386/Packages.bz2;
+            sha256 = "1qjs4042y03bxbxwjs3pgrs99ba6vqvjaaz6zhaxxaqj1r12dwa0";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/maverick/universe/binary-i386/Packages.bz2;
+            sha256 = "1g5pnhx730wj32221ic8p2q6zcka23knpyg190mvq9x7kflcbfzy";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
- 
+
     ubuntu1010x86_64 = {
-      name = "ubuntu-10.04-maverick-amd64";
-      fullName = "Ubuntu 10.04 Maverick (amd64)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/maverick/main/binary-amd64/Packages.bz2;
-        sha256 = "1p0i4gp1bxd3zvckgnh1hx4vfc23rfgzd19dk5rmi61lzbzzqbgc";
-      };
+      name = "ubuntu-10.10-maverick-amd64";
+      fullName = "Ubuntu 10.10 Maverick (amd64)";
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/maverick/main/binary-amd64/Packages.bz2;
+            sha256 = "1p0i4gp1bxd3zvckgnh1hx4vfc23rfgzd19dk5rmi61lzbzzqbgc";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/maverick/universe/binary-amd64/Packages.bz2;
+            sha256 = "0m26viwah29gh47p8m3jpnx6l84dhpwnms29m9bvqn1vwcrgjh0s";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
@@ -1211,47 +1262,139 @@ rec {
     ubuntu1110i386 = {
       name = "ubuntu-11.10-oneiric-i386";
       fullName = "Ubuntu 11.10 Oneiric (i386)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/oneiric/main/binary-i386/Packages.bz2;
-        sha256 = "11r1s76ppi7rwz08i20d7n4ndaj9lb9wsl9k8ww4s1c6agzpwv8a";
-      };
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/oneiric/main/binary-i386/Packages.bz2;
+            sha256 = "11r1s76ppi7rwz08i20d7n4ndaj9lb9wsl9k8ww4s1c6agzpwv8a";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/oneiric/universe/binary-i386/Packages.bz2;
+            sha256 = "1dr59j8pjdhk07fpc0x73afcd9630kkdsbabx3bj92q71104yigz";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
- 
+
     ubuntu1110x86_64 = {
       name = "ubuntu-11.10-oneiric-amd64";
       fullName = "Ubuntu 11.10 Oneiric (amd64)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/oneiric/main/binary-amd64/Packages.bz2;
-        sha256 = "07k784gxwaqmyggmzczy9hjkgfp6p6dcs8rhkxw5hfzn0jaf8l2s";
-      };
+      packagesLists =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/oneiric/main/binary-amd64/Packages.bz2;
+            sha256 = "07k784gxwaqmyggmzczy9hjkgfp6p6dcs8rhkxw5hfzn0jaf8l2s";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/oneiric/universe/binary-amd64/Packages.bz2;
+            sha256 = "1v3ldxn5jnnfgs863ryd6wl3fsb3glainr1ma2zn2l5vpzhpi2h1";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
 
     ubuntu1204i386 = {
-      name = "ubuntu-12.04-oneiric-i386";
+      name = "ubuntu-12.04-precise-i386";
       fullName = "Ubuntu 12.04 Precise (i386)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/precise/main/binary-i386/Packages.bz2;
-        sha256 = "18ns9h4qhvjfcip9z55grzi371racxavgqkp6b5kfkdq2wwwax2d";
-      };
+      packagesLists =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/precise/main/binary-i386/Packages.bz2;
+            sha256 = "18ns9h4qhvjfcip9z55grzi371racxavgqkp6b5kfkdq2wwwax2d";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/precise/universe/binary-i386/Packages.bz2;
+            sha256 = "085lkzbnzkc74kfdmwdc32sfqyfz8dr0rbiifk8kx9jih3xjw2jk";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
- 
+
     ubuntu1204x86_64 = {
-      name = "ubuntu-12.04-oneiric-amd64";
+      name = "ubuntu-12.04-precise-amd64";
       fullName = "Ubuntu 12.04 Precise (amd64)";
-      packagesList = fetchurl {
-        url = mirror://ubuntu/dists/precise/main/binary-amd64/Packages.bz2;
-        sha256 = "1aabpn0hdih6cbabyn87yvhccqj44q9k03mqmjsb920iqlckl3fc";
-      };
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/precise/main/binary-amd64/Packages.bz2;
+            sha256 = "1aabpn0hdih6cbabyn87yvhccqj44q9k03mqmjsb920iqlckl3fc";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/precise/universe/binary-amd64/Packages.bz2;
+            sha256 = "0x4hz5aplximgb7gnpvrhkw8m7a40s80rkm5b8hil0afblwlg4vr";
+          })
+        ];
+      urlPrefix = mirror://ubuntu;
+      packages = commonDebPackages ++ [ "diffutils" ];
+    };
+
+    ubuntu1210i386 = {
+      name = "ubuntu-12.10-quantal-i386";
+      fullName = "Ubuntu 12.10 Quantal (i386)";
+      packagesLists =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/quantal/main/binary-i386/Packages.bz2;
+            sha256 = "bee3200ac8f037700ccd2311fb8b0de665bd02d46bdb2ae946cf50c5885001c3";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/quantal/universe/binary-i386/Packages.bz2;
+            sha256 = "323036e81c8bf409f71d3bc5cf37cfba72fe1d0fc82e9b5418d4d0cb516646e1";
+          })
+        ];
       urlPrefix = mirror://ubuntu;
       packages = commonDebPackages ++ [ "diffutils" ];
     };
 
+    ubuntu1210x86_64 = {
+      name = "ubuntu-12.10-quantal-amd64";
+      fullName = "Ubuntu 12.10 Quantal (amd64)";
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/quantal/main/binary-amd64/Packages.bz2;
+            sha256 = "ef14073f335ef118ebe1c7d45f5a0c17ef28f72abb57c10b9082ab5e04b5d003";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/quantal/universe/binary-amd64/Packages.bz2;
+            sha256 = "c762bd4ed063326577a62ff783cf9720e772b03d4a2aa38048918ee6287b96ce";
+          })
+        ];
+      urlPrefix = mirror://ubuntu;
+      packages = commonDebPackages ++ [ "diffutils" ];
+    };
+
+    ubuntu1304i386 = {
+      name = "ubuntu-13.04-raring-i386";
+      fullName = "Ubuntu 13.04 Raring (i386)";
+      packagesLists =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/raring/main/binary-i386/Packages.bz2;
+            sha256 = "b7da6802c5302439d9abf05ebe1ab4c3b82d7be9356f51a12c5bf4994f009181";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/raring/universe/binary-i386/Packages.bz2;
+            sha256 = "1db19982fc3689b00a918e2cdbb936dfccebbac2ed82f81bb0164a3d51039012";
+          })
+        ];
+      urlPrefix = mirror://ubuntu;
+      packages = commonDebPackages ++ [ "diffutils" "libc-bin" ];
+    };
+
+    ubuntu1304x86_64 = {
+      name = "ubuntu-13.04-raring-amd64";
+      fullName = "Ubuntu 13.04 Raring (amd64)";
+      packagesList =
+        [ (fetchurl {
+            url = mirror://ubuntu/dists/raring/main/binary-amd64/Packages.bz2;
+            sha256 = "9ee6a67bedbda80b668a868bb81b5b3f30bbabac01f69d2a08961c37c8536356";
+          })
+          (fetchurl {
+            url = mirror://ubuntu/dists/raring/universe/binary-amd64/Packages.bz2;
+            sha256 = "0caf561bad359e8a82a987a076c0f1cb7a43412a5de053c105b160477c192978";
+          })
+        ];
+      urlPrefix = mirror://ubuntu;
+      packages = commonDebPackages ++ [ "diffutils" "libc-bin" ];
+    };
+
     debian40i386 = {
       name = "debian-4.0r9-etch-i386";
       fullName = "Debian 4.0r9 Etch (i386)";
@@ -1262,7 +1405,7 @@ rec {
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;
     };
-        
+
     debian40x86_64 = {
       name = "debian-4.0r9-etch-amd64";
       fullName = "Debian 4.0r9 Etch (amd64)";
@@ -1297,22 +1440,44 @@ rec {
     };
 
     debian60i386 = {
-      name = "debian-6.0.4-squeeze-i386";
-      fullName = "Debian 6.0.4 Squeeze (i386)";
+      name = "debian-6.0.7-squeeze-i386";
+      fullName = "Debian 6.0.7 Squeeze (i386)";
       packagesList = fetchurl {
         url = mirror://debian/dists/squeeze/main/binary-i386/Packages.bz2;
-        sha256 = "1aih4n1iz4gzzm5cy1j14mpx8i25jj1237994j33k7dm0gnqgr2w";
+        sha256 = "a770f26b5fce1a16460b68f135dfe97f4f4a9894b538ece0104a508c83ec65d5";
       };
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;
     };
-        
+
     debian60x86_64 = {
-      name = "debian-6.0.4-squeeze-amd64";
-      fullName = "Debian 6.0.4 Squeeze (amd64)";
+      name = "debian-6.0.7-squeeze-amd64";
+      fullName = "Debian 6.0.7 Squeeze (amd64)";
       packagesList = fetchurl {
         url = mirror://debian/dists/squeeze/main/binary-amd64/Packages.bz2;
-        sha256 = "1gb3im7kl8dwd7z82xj4wb5g58r86fjj8cirvq0ssrvcm9bqaiz7";
+        sha256 = "b2bb561bde59ac67e07c70aa7c86a33f237436e6891796a93c6ed6ffb032080e";
+      };
+      urlPrefix = mirror://debian;
+      packages = commonDebianPackages;
+    };
+
+    debian70i386 = {
+      name = "debian-7.0.0-wheezy-i386";
+      fullName = "Debian 7.0.0 Wheezy (i386)";
+      packagesList = fetchurl {
+        url = mirror://debian/dists/wheezy/main/binary-i386/Packages.bz2;
+        sha256 = "712939639e2cc82615c85bdf81edf31edef0fda003ac2b32998e438aee403ab8";
+      };
+      urlPrefix = mirror://debian;
+      packages = commonDebianPackages;
+    };
+
+    debian70x86_64 = {
+      name = "debian-7.0.0-wheezy-amd64";
+      fullName = "Debian 7.0.0 Wheezy (amd64)";
+      packagesList = fetchurl {
+        url = mirror://debian/dists/wheezy/main/binary-amd64/Packages.bz2;
+        sha256 = "e79132f7db6655013be1f75feb9812b071386525246d8639679b322487d2732a";
       };
       urlPrefix = mirror://debian;
       packages = commonDebianPackages;
@@ -1344,7 +1509,7 @@ rec {
     "unzip"
   ];
 
-  
+
   /* Common packages for openSUSE images. */
   commonOpenSUSEPackages = [
     "aaa_base"
@@ -1381,6 +1546,7 @@ rec {
     "bzip2"
     "tar"
     "grep"
+    "sed"
     "findutils"
     "g++"
     "make"
@@ -1388,7 +1554,7 @@ rec {
     "patch"
     "locales"
     # Needed by checkinstall:
-    "util-linux" 
+    "util-linux"
     "file"
     "dpkg-dev"
     "pkg-config"
@@ -1398,7 +1564,7 @@ rec {
   ];
 
   commonDebianPackages = commonDebPackages ++ [ "sysvinit" "diff" "mktemp" ];
-  
+
 
   /* A set of functions that build the Linux distributions specified
      in `rpmDistros' and `debDistros'.  For instance,
@@ -1412,34 +1578,34 @@ rec {
      `diskImageFuns.ubuntu1004x86_64 { extraPackages = ["firefox"];
      size = 8192; }' builds an 8 GiB image containing Firefox in
      addition to the default packages. */
-  diskImageFuns = 
+  diskImageFuns =
     (lib.mapAttrs (name: as: as2: makeImageFromRPMDist (as // as2)) rpmDistros) //
     (lib.mapAttrs (name: as: as2: makeImageFromDebDist (as // as2)) debDistros);
 
-    
+
   /* Shorthand for `diskImageFuns.<attr> { extraPackages = ... }'. */
   diskImageExtraFuns =
     lib.mapAttrs (name: f: extraPackages: f { inherit extraPackages; }) diskImageFuns;
 
-    
+
   /* Default disk images generated from the `rpmDistros' and
      `debDistros' sets (along with Red Hat 9 and SuSE 9.0 images). */
 
   diskImages =
     lib.mapAttrs (name: f: f {}) diskImageFuns //
-    
+
     { redhat9i386 = fillDiskWithRPMs {
         name = "redhat-9-i386";
         fullName = "Red Hat Linux 9 (i386)";
         size = 1024;
-        rpms = import ./rpm/redhat-9-i386.nix {inherit fetchurl;};
+        rpms = import ./rpm/redhat-9-i386.nix { inherit fetchurl; };
       };
-    
+
       suse90i386 = fillDiskWithRPMs {
         name = "suse-9.0-i386";
         fullName = "SUSE Linux 9.0 (i386)";
         size = 1024;
-        rpms = import ./rpm/suse-9-i386.nix {inherit fetchurl;};
+        rpms = import ./rpm/suse-9-i386.nix { inherit fetchurl; };
         # Urgh.  The /etc/group entries are installed by aaa_base (or
         # something) but due to dependency ordering, that package isn't
         # installed yet by the time some other packages refer to these
@@ -1454,7 +1620,7 @@ rec {
           echo 'video:x:33:' >> /mnt/etc/group
         '';
       };
-      
+
     };
-    
+
 }
diff --git a/pkgs/data/documentation/gnome-user-docs/default.nix b/pkgs/data/documentation/gnome-user-docs/default.nix
index f92882b9a83..9e6639c0a0a 100644
--- a/pkgs/data/documentation/gnome-user-docs/default.nix
+++ b/pkgs/data/documentation/gnome-user-docs/default.nix
@@ -8,5 +8,5 @@ stdenv.mkDerivation {
     sha256 = "1ka0nw2kc85p10y8x31v0wv06a88k7qrgafp4ys04y9fzz0rkcjj";
   };
 
-  buildNativeInputs = [ itstool libxml2 gettext ];
+  nativeBuildInputs = [ itstool libxml2 gettext ];
 }
diff --git a/pkgs/data/documentation/man-pages/default.nix b/pkgs/data/documentation/man-pages/default.nix
index f9e4f1b4371..f1bc98c26cc 100644
--- a/pkgs/data/documentation/man-pages/default.nix
+++ b/pkgs/data/documentation/man-pages/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "man-pages-3.42";
-  
+  name = "man-pages-3.50";
+
   src = fetchurl {
-    url = "mirror://kernel/linux/docs/man-pages/Archive/${name}.tar.xz";
-    sha256 = "11kh0ifzqbxk797lq037ixqhpf6h90w9xxygzh796mddg4rr4s9j";
+    url = "mirror://kernel/linux/docs/man-pages/${name}.tar.xz";
+    sha256 = "04fn7zzi75y79rkg57nkync3hf14m8708iw33s03f0x8ays6fajz";
   };
 
   preBuild =
diff --git a/pkgs/data/fonts/andagii/default.nix b/pkgs/data/fonts/andagii/default.nix
index 742f0bd0b4a..6e59e97171e 100644
--- a/pkgs/data/fonts/andagii/default.nix
+++ b/pkgs/data/fonts/andagii/default.nix
@@ -12,6 +12,7 @@ let
   sourceInfo = rec {
     url="http://www.i18nguy.com/unicode/andagii.zip";
     name="andagii";
+    version="1.0.2";
     hash="0cknb8vin15akz4ahpyayrpqyaygp9dgrx6qw7zs7d6iv9v59ds1";
   };
 in
@@ -21,7 +22,7 @@ rec {
     sha256 = sourceInfo.hash;
   };
 
-  inherit (sourceInfo) name version;
+  name = "${sourceInfo.name}-${sourceInfo.version}";
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
diff --git a/pkgs/data/fonts/anonymous-pro/default.nix b/pkgs/data/fonts/anonymous-pro/default.nix
index 42f32f0ba71..df98d8197f5 100644
--- a/pkgs/data/fonts/anonymous-pro/default.nix
+++ b/pkgs/data/fonts/anonymous-pro/default.nix
@@ -22,7 +22,7 @@ rec {
     sha256 = sourceInfo.hash;
   };
 
-  inherit (sourceInfo) name version;
+  name = "${sourceInfo.name}-${sourceInfo.version}";
   inherit buildInputs;
 
   phaseNames = ["doUnpack" "installFonts"];
diff --git a/pkgs/data/fonts/libertine/default.nix b/pkgs/data/fonts/libertine/default.nix
index a0ed5f75797..b8c0db222d5 100644
--- a/pkgs/data/fonts/libertine/default.nix
+++ b/pkgs/data/fonts/libertine/default.nix
@@ -1,25 +1,24 @@
-args : with args; 
-rec {
+args: with args; rec {
+  name = "linux-libertine-5.3.0";
+
   src = fetchurl {
-    url = http://downloads.sourceforge.net/linuxlibertine/5.0.0/LinLibertineSRC_2011_05_22.tgz;
-    sha256 = "1cr0kvvlqrcmaxfl6szfp3m93mcnhmypx33dxmdm3xdxxkab74vg";
+    url = mirror://sourceforge/linuxlibertine/5.3.0/LinLibertineSRC_5.3.0_2012_07_02.tgz;
+    sha256 = "0x7cz6hvhpil1rh03rax9zsfzm54bh7r4bbrq8rz673gl9h47v0v";
   };
 
-  buildInputs = [fontforge];
-  configureFlags = [];
+  buildInputs = [ fontforge ];
 
   /* doConfigure should be specified separately */
   phaseNames = ["doUnpack" "generateFontsFromSFD" "installFonts"];
-      
+
   extraFontForgeCommands = ''
     ScaleToEm(1000);
   '';
 
-  doUnpack = fullDepEntry ''
-    tar xf ${src}
-  '' ["minInit"];
+  doUnpack = lib.fullDepEntry ''
+      tar xf ${src}
+    '' ["minInit"];
 
-  name = "linux-libertine-5.0.0";
   meta = {
     description = "Linux Libertine Fonts";
     homepage = http://linuxlibertine.sf.net;
diff --git a/pkgs/data/misc/cacert/default.nix b/pkgs/data/misc/cacert/default.nix
index 7349ab3e982..711ebc9e88f 100644
--- a/pkgs/data/misc/cacert/default.nix
+++ b/pkgs/data/misc/cacert/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "cacert-20120628";
+  name = "cacert-20121229";
 
   src = fetchurl {
     url = "http://nixos.org/tarballs/${name}.pem.bz2";
-    sha256 = "0xg9f1w2pmsv221lgc60c07bs0xf2rr189a2yp2y9an95h3gx7ir";
+    sha256 = "031s86pqvn620zkj6w97hqgjvkp6vsvlymzz7rwvkv25zvrjsgif";
   };
 
   unpackPhase = "true";
diff --git a/pkgs/data/misc/freepats/default.nix b/pkgs/data/misc/freepats/default.nix
new file mode 100644
index 00000000000..21f34a607d4
--- /dev/null
+++ b/pkgs/data/misc/freepats/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "freepats-20060219";
+
+  src = fetchurl {
+    url = "http://freepats.zenvoid.org/${name}.tar.bz2";
+    sha256 = "12iw36rd94zirll96cd5k0va7p5hxmf2shvjlhzihcmjaw8flq82";
+  };
+
+  installPhase = ''mkdir "$out"; cp -r . "$out"'';
+
+  meta = with stdenv.lib; {
+    description = "Instrument patches, for MIDI synthesizers";
+    longDescription = ''
+      Freepats is a project to create a free and open set of instrument
+      patches, in any format, that can be used with softsynths.
+    '';
+    homepage = http://freepats.zenvoid.org/;
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/data/misc/gsettings-desktop-schemas/default.nix b/pkgs/data/misc/gsettings-desktop-schemas/default.nix
index 4527b2fec0b..c934863d75d 100644
--- a/pkgs/data/misc/gsettings-desktop-schemas/default.nix
+++ b/pkgs/data/misc/gsettings-desktop-schemas/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) maintainers platforms;
diff --git a/pkgs/data/misc/shared-desktop-ontologies/default.nix b/pkgs/data/misc/shared-desktop-ontologies/default.nix
index 39fcc6d1a68..23a800f6ae0 100644
--- a/pkgs/data/misc/shared-desktop-ontologies/default.nix
+++ b/pkgs/data/misc/shared-desktop-ontologies/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "shared-desktop-ontologies-0.8.1";
+  name = "shared-desktop-ontologies-0.10.0";
   
   src = fetchurl {
     url = "mirror://sourceforge/oscaf/${name}.tar.bz2";
-    sha256 = "0w6rhhfjl5r6gv2jw3nc1sj5l4fxz4s1wv0iclcrak3wa5vyy6h3";
+    sha256 = "00y55bjmxrwiiw8q0n0jcv95l945hp7nglbwj408sk5m2vq026di";
   };
   
   buildInputs = [ cmake ];
diff --git a/pkgs/data/misc/shared-mime-info/default.nix b/pkgs/data/misc/shared-mime-info/default.nix
index a761594d07f..1e424aca46b 100644
--- a/pkgs/data/misc/shared-mime-info/default.nix
+++ b/pkgs/data/misc/shared-mime-info/default.nix
@@ -2,11 +2,11 @@
 , libxml2, glib}:
 
 stdenv.mkDerivation rec {
-  name = "shared-mime-info-1.0";
+  name = "shared-mime-info-1.1";
 
   src = fetchurl {
     url = "http://freedesktop.org/~hadess/${name}.tar.xz";
-    sha256 = "13xf09c4vc4hl5qhk7i4gc6z8knc32b5wjb4ds8ds4z2mbjk1s6j";
+    sha256 = "0v70z5b6340jsjvdhf7brczpzq766wc1lsnjg9hc57ks2m5hjk8q";
   };
 
   buildInputs = [
diff --git a/pkgs/data/misc/themes/green.nix b/pkgs/data/misc/themes/green.nix
deleted file mode 100644
index 945bd3c9a3c..00000000000
--- a/pkgs/data/misc/themes/green.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{fetchurl, ...} : 
-fetchurl {
-  url = http://www.kde-look.org/CONTENT/content-files/58501-green.tar.gz;
-  sha256 = "0sdykpziij1f3w4braq8r8nqg4lnsd7i7gi1k5d7c31m2q3b9a7r";
-}
diff --git a/pkgs/data/misc/themes/theme-gnu.nix b/pkgs/data/misc/themes/theme-gnu.nix
deleted file mode 100644
index 32d1a9256ac..00000000000
--- a/pkgs/data/misc/themes/theme-gnu.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{fetchurl, ...}:
-fetchurl {
-  url = http://dev.gentoo.org/~spock/repos/bootsplash/Theme-GNU.tar.bz2;
-  sha256 = "1pj91nxvwjphc8r6idl4ih3ldyk34j1w9c4p8gzmwnwg3w34xha0";
-}
diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix
new file mode 100644
index 00000000000..c49430935ae
--- /dev/null
+++ b/pkgs/data/misc/tzdata/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl }:
+
+let version = "2012f"; in
+
+stdenv.mkDerivation rec {
+  name = "tzdata-${version}";
+
+  srcs =
+    [ (fetchurl {
+        url = "http://www.iana.org/time-zones/repository/releases/tzdata${version}.tar.gz";
+        sha256 = "1k165i8g23rr0z26k02x1l4immp69g6yqjrd3lwmbvj5li4mmsdg";
+      })
+      (fetchurl {
+        url = "http://www.iana.org/time-zones/repository/releases/tzcode${version}.tar.gz";
+        sha256 = "1m6rg9003mkjyvpv5gg5lcia9fzhy7ndwgs68qlpbipnw5p0k2pk";
+      })
+    ];
+
+  sourceRoot = ".";
+
+  makeFlags = "TOPDIR=$(out) TZDIR=$(out)/share/zoneinfo ETCDIR=$(TMPDIR)/etc LIBDIR=$(TMPDIR)/lib MANDIR=$(TMPDIR)/man AWK=awk";
+
+  postInstall =
+    ''
+      mv $out/share/zoneinfo-posix $out/share/zoneinfo/posix
+      mv $out/share/zoneinfo-leaps $out/share/zoneinfo/right
+    '';
+
+  meta = {
+    homepage = http://www.iana.org/time-zones;
+    description = "Database of current and historical time zones";
+  };
+}
diff --git a/pkgs/data/misc/xkeyboard-config/default.nix b/pkgs/data/misc/xkeyboard-config/default.nix
index fbe8e7ce1f5..15574a1dc36 100644
--- a/pkgs/data/misc/xkeyboard-config/default.nix
+++ b/pkgs/data/misc/xkeyboard-config/default.nix
@@ -1,21 +1,21 @@
 { stdenv, fetchurl, perl, perlXMLParser, xkbcomp, gettext, intltool  }:
 
 stdenv.mkDerivation rec {
-  name = "xkeyboard-config-2.1";
+  name = "xkeyboard-config-2.7";
 
   src = fetchurl {
     url = "mirror://xorg/individual/data/xkeyboard-config/${name}.tar.bz2";
-    sha256 = "0x9hkb4iqz64gcabzkdcfy4p78sdhnpjwh54g8wx5bdgy9087vpr";
+    sha256 = "08c3mjdgp7c2v6lj5bymaczcazklsd7s1lxslxbngzmh5yhphd74";
   };
 
   buildInputs = [ gettext ];
 
-  buildNativeInputs = [ perl perlXMLParser intltool xkbcomp ];
+  nativeBuildInputs = [ perl perlXMLParser intltool xkbcomp ];
 
   patches = [ ./eo.patch ];
 
   preConfigure = ''
-    configureFlags="--with-xkb-base=$out/etc/X11/xkb -with-xkb-rules-symlink=xorg,xfree86"
+    configureFlags="--with-xkb-base=$out/etc/X11/xkb -with-xkb-rules-symlink=xorg,xfree86 --disable-runtime-deps"
     sed -e 's@#!\s*/bin/bash@#! /bin/sh@' -i rules/merge.sh
   '';
 
diff --git a/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix
new file mode 100644
index 00000000000..6f29c78eca6
--- /dev/null
+++ b/pkgs/data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, unzip }:
+
+let 
+
+  src = fetchurl {
+    url = http://www.oasis-open.org/docbook/sgml/3.1/docbk31.zip;
+    sha256 = "0f25ch7bywwhdxb1qa0hl28mgq1blqdap3rxzamm585rf4kis9i0";
+  };
+
+  isoents = fetchurl {
+    url = http://www.oasis-open.org/cover/ISOEnts.zip;
+    sha256 = "1clrkaqnvc1ja4lj8blr0rdlphngkcda3snm7b9jzvcn76d3br6w";
+  };
+
+in
+
+stdenv.mkDerivation {
+  name = "docbook-sgml-3.1";
+
+  unpackPhase = "true";
+
+  buildInputs = [ unzip ];
+
+  installPhase =
+    ''
+      o=$out/sgml/dtd/docbook-3.1
+      mkdir -p $o
+      cd $o
+      unzip ${src}
+      unzip ${isoents}
+      sed -e "s/iso-/ISO/" -e "s/.gml//" -i docbook.cat
+    '';
+}
diff --git a/pkgs/desktops/e17/default.nix b/pkgs/desktops/e17/default.nix
index 6822c641913..648a3577863 100644
--- a/pkgs/desktops/e17/default.nix
+++ b/pkgs/desktops/e17/default.nix
@@ -10,6 +10,8 @@ rec {
 
   ecore = callPackage ./ecore { };
 
+  eio = callPackage ./eio { };
+
   embryo = callPackage ./embryo { };
 
   edje = callPackage ./edje { lua = pkgs.lua5; };
@@ -20,6 +22,12 @@ rec {
 
   eeze = callPackage ./eeze { };
 
+  emotion = callPackage ./emotion { };
+
+  ethumb = callPackage ./ethumb { };
+
+  elementary = callPackage ./elementary { };
+
 
   #### WINDOW MANAGER
 
@@ -28,6 +36,7 @@ rec {
 
   #### APPLICATIONS
 
+  terminology = callPackage ./terminology { };
 
 
 
diff --git a/pkgs/desktops/e17/e_dbus/default.nix b/pkgs/desktops/e17/e_dbus/default.nix
index 1b3ba2c7256..cfc0203b3e0 100644
--- a/pkgs/desktops/e17/e_dbus/default.nix
+++ b/pkgs/desktops/e17/e_dbus/default.nix
@@ -2,18 +2,20 @@
 , dbus_libs }:
 stdenv.mkDerivation rec {
   name = "e_dbus-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1kky76v7yydsjihgi1hbwpyqhdmbxmxj2dw4p7kiqbl67dmsjhxg";
+    sha256 = "16ckrpzzw5x1cs0fwqkk8431al55xil5magihkp9l3s77g0qd26q";
   };
   buildInputs = [ pkgconfig zlib libjpeg expat ecore eina evas ];
   propagatedBuildInputs = [ dbus_libs ];
+  setupHook = ./setup-hook.sh;
   configureFlags = ''
     --disable-edbus-test
     --disable-edbus-test-client
     --disable-edbus-notify-send
     --disable-edbus-notify-test
+    --disable-edbus-async-test
   '';
   meta = {
     description = "Enlightenment's D-Bus wrapping and glue layer library";
diff --git a/pkgs/desktops/e17/e_dbus/setup-hook.sh b/pkgs/desktops/e17/e_dbus/setup-hook.sh
new file mode 100644
index 00000000000..d98f24b4c04
--- /dev/null
+++ b/pkgs/desktops/e17/e_dbus/setup-hook.sh
@@ -0,0 +1,8 @@
+addDbusIncludePath () {
+    if test -d "$1/include/dbus-1.0"
+    then
+        export NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE} -I$1/include/dbus-1.0 -I $1/lib/dbus-1.0/include"
+    fi
+}
+
+envHooks=(${envHooks[@]} addDbusIncludePath)
diff --git a/pkgs/desktops/e17/ecore/default.nix b/pkgs/desktops/e17/ecore/default.nix
index 47e9e05fd65..4a3eef4ec49 100644
--- a/pkgs/desktops/e17/ecore/default.nix
+++ b/pkgs/desktops/e17/ecore/default.nix
@@ -1,13 +1,16 @@
-{ stdenv, fetchurl, pkgconfig, eina, evas, libX11, libXext }:
+{ stdenv, fetchurl, pkgconfig, eina, evas, libX11, libXext, libXrender
+, libXcomposite, libXfixes, libXdamage }:
 stdenv.mkDerivation rec {
   name = "ecore-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1fq3prr2i9n14jppfpns3dg1mkk3iy0ijv2d47pm4krymd7l4hs4";
+    sha256 = "08ljda6p0zj1h5sq3l0js6mihw8cr6ydynn42dnka36vachvmfjb";
   };
   buildInputs = [ pkgconfig eina evas ];
-  propagatedBuildInputs = [ libX11 libXext ];
+  propagatedBuildInputs = [ libX11 libXext libXcomposite libXrender libXfixes
+                            libXdamage
+                          ];
   meta = {
     description = "Enlightenment's core mainloop, display abstraction and utility library";
     longDescription = ''
diff --git a/pkgs/desktops/e17/edje/default.nix b/pkgs/desktops/e17/edje/default.nix
index b48794e147e..62758b2094e 100644
--- a/pkgs/desktops/e17/edje/default.nix
+++ b/pkgs/desktops/e17/edje/default.nix
@@ -2,12 +2,16 @@
 , ecore, embryo }:
 stdenv.mkDerivation rec {
   name = "edje-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "15vh0plb9gb75q0lgbqv4kjz0pyhbfxk39x3inzn87ih567z73xx";
+    sha256 = "1hsyj46bk94yd9ymf9425pf4ygy36h5gdkg9fhf8qds8cnn2kcy7";
   };
   buildInputs = [ pkgconfig expat zlib libjpeg lua eina eet evas ecore embryo ];
+  patchPhase = ''
+    substituteInPlace src/bin/edje_cc_out.c --replace '%s/embryo_cc' '${embryo}/bin/embryo_cc'
+    substituteInPlace src/bin/edje_cc_out.c --replace 'eina_prefix_bin_get(pfx),' ""
+  '';
   meta = {
     description = "Enlightenment's abstract GUI layout and animation object library";
     longDescription = ''
diff --git a/pkgs/desktops/e17/eet/default.nix b/pkgs/desktops/e17/eet/default.nix
index 6ac119161c5..079d07187ff 100644
--- a/pkgs/desktops/e17/eet/default.nix
+++ b/pkgs/desktops/e17/eet/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, eina, zlib, libjpeg }:
 stdenv.mkDerivation rec {
   name = "eet-${version}";
-  version = "1.6.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1cq6i9g020mi5mr069jykx1fvihd18k1y4x49skmhzfh7dv10dfp";
+    sha256 = "0ys2579v45f9x2n47shq0k63g0sdbj1ndhh72dvfajihsgjwd767";
   };
   buildInputs = [ pkgconfig eina zlib libjpeg ];
   meta = {
diff --git a/pkgs/desktops/e17/eeze/default.nix b/pkgs/desktops/e17/eeze/default.nix
index 4931dbf6203..162fbcf1aef 100644
--- a/pkgs/desktops/e17/eeze/default.nix
+++ b/pkgs/desktops/e17/eeze/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, eina, ecore, udev }:
 stdenv.mkDerivation rec {
   name = "eeze-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1v0n6bn3g04bjq0cxp6ixw7hb4kjbqpvywpvgik960xkn4pva76p";
+    sha256 = "0274fs4cxgw6420yyz9frrc8zhj0qqyvwczzslq3kih3sx1nikxr";
   };
   buildInputs = [ pkgconfig eina ecore ];
   propagatedBuildInputs = [ udev ];
diff --git a/pkgs/desktops/e17/efreet/default.nix b/pkgs/desktops/e17/efreet/default.nix
index 960a8694b86..dfe755db597 100644
--- a/pkgs/desktops/e17/efreet/default.nix
+++ b/pkgs/desktops/e17/efreet/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, eina, eet, ecore }:
 stdenv.mkDerivation rec {
   name = "efreet-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1nydy3ahdq7q6b0xxaj79a8kd4b4xy3hzf1fdh117c9pwp4fxhl0";
+    sha256 = "1yw7qjddqcnsz1vb693pa57v9wydvzfy198dc23mz46qfqx08nlg";
   };
   buildInputs = [ pkgconfig eina eet ecore ];
   meta = {
diff --git a/pkgs/desktops/e17/eina/default.nix b/pkgs/desktops/e17/eina/default.nix
index 51b938790ec..77d4829a841 100644
--- a/pkgs/desktops/e17/eina/default.nix
+++ b/pkgs/desktops/e17/eina/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl }:
 stdenv.mkDerivation rec {
   name = "eina-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1vchzb34hd9z8ghh75ch7sdf90gmzzpxryk3yq8hjcdxd0zjx9yj";
+    sha256 = "0kd4116njrbag9h459cmfpg07c4ag04z3yrsg513lpi27amch27w";
   };
   meta = {
     description = "Enlightenment's core data structure library";
diff --git a/pkgs/desktops/e17/eio/default.nix b/pkgs/desktops/e17/eio/default.nix
new file mode 100644
index 00000000000..b56422fd774
--- /dev/null
+++ b/pkgs/desktops/e17/eio/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, eet, eina, ecore }:
+stdenv.mkDerivation rec {
+  name = "eio-${version}";
+  version = "1.7.5";
+  src = fetchurl {
+    url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
+    sha256 = "1bsam5q364kc4xwfv7pql6686gj0byhk42zwjqx9ajf70l23kss6";
+  };
+  buildInputs = [ pkgconfig eet eina ecore ];
+  meta = {
+    description = "A library that integrates with EFL to provide efficient filesystem IO";
+    longDescription = ''
+      Eio integrates with EFL (Ecore, Eina) to provide efficient filesystem Input/Output.
+      It use the best techniques to achieve such purpose, like using at-variants, splice,
+      properly handling errors and doing it in an asynchronous fashion by means of worker
+      threads. It is also ported to Windows, so multi-platform.
+
+      Whenever you need to list a directory, copy, move or delete files, Eio will do that
+      task better than you'd achieve with naive implementations, and it is easy to use. 
+    '';
+    homepage = http://enlightenment.org/;
+    license = stdenv.lib.licenses.lgpl21;
+  };
+}
diff --git a/pkgs/desktops/e17/elementary/default.nix b/pkgs/desktops/e17/elementary/default.nix
new file mode 100644
index 00000000000..b0240d986de
--- /dev/null
+++ b/pkgs/desktops/e17/elementary/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, eina, eet, evas, ecore, edje }:
+stdenv.mkDerivation rec {
+  name = "elementary-${version}";
+  version = "1.7.5";
+  src = fetchurl {
+    url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
+    sha256 = "08cb4x9639xyrb8d4vzvhl6v385qjfswl717sicm7iimh5zlm2l9";
+  };
+  buildInputs = [ pkgconfig eina eet evas ecore edje ];
+  meta = {
+    description = "Enlightenment's core data structure library";
+    longDescription = ''
+      Enlightenment's Eina is a core data structure and common utility
+      library.
+    '';
+    homepage = http://enlightenment.org/;
+    license = stdenv.lib.licenses.lgpl21;
+  };
+}
diff --git a/pkgs/desktops/e17/embryo/default.nix b/pkgs/desktops/e17/embryo/default.nix
index f09bc6b2ded..59b5540f25d 100644
--- a/pkgs/desktops/e17/embryo/default.nix
+++ b/pkgs/desktops/e17/embryo/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, pkgconfig, eina }:
 stdenv.mkDerivation rec {
   name = "embryo-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "0hcjlf0rljz4zs1y5l4h0gn2gyqb1h4msfsaps8flaym4mxrvvd9";
+    sha256 = "104fsa179w2dfg00sfnap7c3b4ixcps4crxa6yav755awssdcim9";
   };
   buildInputs = [ pkgconfig eina ];
   meta = {
@@ -17,6 +17,6 @@ stdenv.mkDerivation rec {
       untouched.
     '';
     homepage = http://enlightenment.org/;
-    license = with stdenv.lib.licenses; [ bsd2 bsd3 ];  # not sure
+    license = with stdenv.lib.licenses; [ bsd2.shortName bsd3.shortName ];  # not sure
   };
 }
diff --git a/pkgs/desktops/e17/emotion/default.nix b/pkgs/desktops/e17/emotion/default.nix
new file mode 100644
index 00000000000..9ec3631b1e7
--- /dev/null
+++ b/pkgs/desktops/e17/emotion/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, ecore, evas, eet, eina, edje, vlc }:
+stdenv.mkDerivation rec {
+  name = "emotion-${version}";
+  version = "1.7.5";
+  src = fetchurl {
+    url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
+    sha256 = "1sfw8kpj2fcqymzd6q7p51xxib1n2arvjl1hnwhqkvwhlsq2b4sw";
+  };
+  buildInputs = [ pkgconfig ecore evas eet eina edje vlc ];
+  meta = {
+    description = "A library to easily integrate media playback into EFL applications";
+    longDescription = ''
+      Emotion is a library to easily integrate media playback into EFL applications,
+      it will take care of using Ecore's main loop and video display is done using Evas.
+    '';
+    homepage = http://enlightenment.org/;
+    license = stdenv.lib.licenses.lgpl21;
+  };
+}
diff --git a/pkgs/desktops/e17/enlightenment/default.nix b/pkgs/desktops/e17/enlightenment/default.nix
index f8c57543f88..1c3edb07ecf 100644
--- a/pkgs/desktops/e17/enlightenment/default.nix
+++ b/pkgs/desktops/e17/enlightenment/default.nix
@@ -1,12 +1,14 @@
-{ stdenv, fetchurl, pkgconfig, eina, eet, evas, ecore, edje, efreet, e_dbus, embryo }:
+{ stdenv, fetchurl, pkgconfig, eina, eet, evas, ecore, edje, efreet, e_dbus
+, embryo, eio, xcbutilkeysyms, libjpeg }:
 stdenv.mkDerivation rec {
   name = "enlightenment-${version}";
-  version = "0.16.999.65643";
+  version = "0.17.1";
   src = fetchurl {
-    url = "http://download.enlightenment.org/snapshots/2011-11-28/${name}.tar.gz";
-    sha256 = "1bb577gbccb1wrifrhv9pzm451zhig2p29mwz55b187ls31p36kz";
+    url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
+    sha256 = "1z2vx9r7yc55rs673jg7d685slgdv9dss45asg50wh5wxp2mfi3y";
   };
-  buildInputs = [ pkgconfig eina eet ecore evas edje efreet e_dbus embryo ];
+  buildInputs = [ pkgconfig eina eet ecore evas edje efreet e_dbus embryo
+                  eio xcbutilkeysyms libjpeg ];
   configureFlags = ''
     --with-profile=FAST_PC
     --disable-illume
diff --git a/pkgs/desktops/e17/ethumb/default.nix b/pkgs/desktops/e17/ethumb/default.nix
new file mode 100644
index 00000000000..344abe1e3f1
--- /dev/null
+++ b/pkgs/desktops/e17/ethumb/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, eina, evas, ecore, edje, eet, e_dbus, emotion, libexif }:
+stdenv.mkDerivation rec {
+  name = "ethumb-${version}";
+  version = "1.7.5";
+  src = fetchurl {
+    url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
+    sha256 = "0prka3knz8p2n46dfrzgwn55khhhrhjny4vvnzkjcwmhvz7kgc9l";
+  };
+  buildInputs = [ pkgconfig eina evas ecore edje eet emotion libexif ];
+  propagatedBuildInputs = [ e_dbus libexif ];
+  meta = {
+    description = "A thumbnail generation library";
+    longDescription = ''
+      Ethumb - thumbnail generation library. Features:
+      * create thumbnails with a predefined frame (possibly an edje frame);
+      * have an option to create fdo-like thumbnails;
+      * have a client/server utility;
+      * TODO: make thumbnails from edje backgrounds, icons and themes;
+    '';
+    homepage = http://enlightenment.org/;
+    license = stdenv.lib.licenses.lgpl21;
+  };
+}
diff --git a/pkgs/desktops/e17/evas/default.nix b/pkgs/desktops/e17/evas/default.nix
index 71b54f502a2..c271caa980d 100644
--- a/pkgs/desktops/e17/evas/default.nix
+++ b/pkgs/desktops/e17/evas/default.nix
@@ -2,10 +2,10 @@
 , libX11, libXext, eina, eet }:
 stdenv.mkDerivation rec {
   name = "evas-${version}";
-  version = "1.2.0-alpha";
+  version = "1.7.5";
   src = fetchurl {
     url = "http://download.enlightenment.org/releases/${name}.tar.bz2";
-    sha256 = "1lyya0nc8p0vs63azkflwq7lqqml94cqzjpg12h43sbvza342rsq";
+    sha256 = "0x3k89q2wxgxjsbhdf4qws7jgpjl7rpqji98ca3nf25jf2lm1cvh";
   };
   buildInputs = [ pkgconfig freetype fontconfig libpng libjpeg
                   libX11 libXext eina eet
diff --git a/pkgs/desktops/e17/terminology/default.nix b/pkgs/desktops/e17/terminology/default.nix
new file mode 100644
index 00000000000..f060d81bd00
--- /dev/null
+++ b/pkgs/desktops/e17/terminology/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, fetchurl, pkgconfig, elementary, eina, eet, evas, edje, emotion, ecore, ethumb, efreet }:
+
+stdenv.mkDerivation rec {
+  name = "terminology-${version}";
+  version = "0.3.0";
+  src = fetchurl {
+    url = "http://download.enlightenment.org/releases/${name}.tar.gz";
+    sha256 = "1dn5bjswqgnqza7bngc6afqza47yh27xfwf5qg2kzfgs008hp1bp";
+  };
+  buildInputs = [ pkgconfig elementary eina eet evas ecore edje emotion ecore ethumb efreet ];
+
+  meta = {
+    description = "Terminology, the E17 terminal emulator";
+    homepage = http://www.enlightenment.org/p.php?p=about/terminology;
+    license = stdenv.lib.licenses.bsd2;  # not sure
+  };
+}
diff --git a/pkgs/desktops/gnome-2/bindings/gnome-python/default.nix b/pkgs/desktops/gnome-2/bindings/gnome-python/default.nix
index c65c8b98c6a..83505dc42fc 100644
--- a/pkgs/desktops/gnome-2/bindings/gnome-python/default.nix
+++ b/pkgs/desktops/gnome-2/bindings/gnome-python/default.nix
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
 
   # WAF is probably the biggest crap on this planet, btw i removed the /gtk-2.0 path thingy
   configurePhase = ''
-    sed -e "s@{PYTHONDIR}/gtk-2.0@{PYTHONDIR}/@" -i gconf/wscript 
-    python waf configure --prefix=$out 
+    sed -e "s@{PYTHONDIR}/gtk-2.0@{PYTHONDIR}/@" -i gconf/wscript
+    python waf configure --prefix=$out
   '';
 
   buildPhase = ''
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     python waf install
+    cp bonobo/*.{py,defs} $out/share/pygtk/2.0/defs/
   '';
 
   buildInputs = [ python pkgconfig pygobject pygtk glib gtk GConf libgnome pythonDBus ];
diff --git a/pkgs/desktops/gnome-2/bindings/python-rsvg/default.nix b/pkgs/desktops/gnome-2/bindings/python-rsvg/default.nix
new file mode 100644
index 00000000000..c09ed74a97c
--- /dev/null
+++ b/pkgs/desktops/gnome-2/bindings/python-rsvg/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, gnome, librsvg, pkgconfig, pygtk, python }:
+
+stdenv.mkDerivation rec {
+  version = "2.32";
+  name = "python-rsvg-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gnome-python-desktop/${version}/gnome-python-desktop-${version}.0.tar.gz";
+    sha256 = "1xhh3h1qdnimydvv55pmqwyzjchhjwfvp951sjlq0180kskqrlj5";
+  };
+
+  configurePhase = ''
+    sed -e "s@{PYTHONDIR}/gtk-2.0@{PYTHONDIR}/@" -i rsvg/wscript 
+    python waf configure --enable-modules=rsvg --prefix=$out 
+  '';
+
+  buildPhase = "python waf build";
+
+  installPhase = "python waf install";
+
+  buildInputs = [ gnome.gnome_python librsvg pkgconfig pygtk python ];
+
+  meta = with stdenv.lib; {
+    homepage = "http://www.pygtk.org";
+    description = "The rsvg python module";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/desktops/gnome-2/default.nix b/pkgs/desktops/gnome-2/default.nix
index 36d0860caa5..38ae4c01534 100644
--- a/pkgs/desktops/gnome-2/default.nix
+++ b/pkgs/desktops/gnome-2/default.nix
@@ -58,6 +58,8 @@
 
   libbonoboui = callPackage ./platform/libbonoboui { };
 
+  python_rsvg = callPackage ./bindings/python-rsvg { };
+
   at_spi = callPackage ./platform/at-spi { };
 
   gtkhtml = callPackage ./platform/gtkhtml { };
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
index a1dbf78bba2..fffffcb0c2d 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-icon-theme/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
     sha256 = "cc7f15e54e2640697b58c26e74cc3f6ebadeb4ef6622bffe9c1e6874cc3478d6";
   };
   
-  buildNativeInputs = [ pkgconfig intltool iconnamingutils gtk ];
+  nativeBuildInputs = [ pkgconfig intltool iconnamingutils gtk ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
index a0c11d1b85e..f31875bed91 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-keyring/default.nix
@@ -13,5 +13,5 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ glib libtasn1 ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
index a1427d82283..6ca2a9142c1 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-panel/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
       libtasn1 libtool libcanberra
     ];
 
-  buildNativeInputs = [ pkgconfig intltool which ];
+  nativeBuildInputs = [ pkgconfig intltool which ];
   configureFlags = "--disable-scrollkeeper";
 
   NIX_CFLAGS_COMPILE="-I${GConf}/include/gconf/2";
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
index 8704d22d2f2..ccabff27549 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-session/default.nix
@@ -13,5 +13,5 @@ stdenv.mkDerivation {
     [ dbus_glib gtk libXau libXtst inputproto libglade startup_notification
       GConf upower
     ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix b/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
index 47ddde9029f..dca3b3a16a2 100644
--- a/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gnome-settings-daemon/default.nix
@@ -14,5 +14,5 @@ stdenv.mkDerivation {
       pulseaudio
     ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/desktops/gnome-2/desktop/gvfs/default.nix b/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
index 5455e95ef3f..9e7949047c7 100644
--- a/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/gvfs/default.nix
@@ -1,19 +1,21 @@
 { stdenv, fetchurl, pkgconfig, dbus_libs, samba, libarchive, fuse, libgphoto2
 , libcdio, libxml2, libtool, glib, intltool, GConf, libgnome_keyring, libsoup
-, udev, avahi}:
+, udev, avahi, libxslt, docbook_xsl }:
 
-stdenv.mkDerivation {
-  name = "gvfs-1.10.1";
+stdenv.mkDerivation rec {
+  name = "gvfs-1.14.1";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gvfs/1.10/gvfs-1.10.1.tar.xz;
-    sha256 = "124jrkph3cqr2pijmzzr6qwzy2vaq3vvndskzkxd0v5dwp7glc6d";
+    url = "mirror://gnome/sources/gvfs/1.14/${name}.tar.xz";
+    sha256 = "0af86cd7ee7b6daca144776bdf12f2f30d3e18fdd70b4da58e1a68cea4f6716a";
   };
 
   buildInputs =
     [ glib dbus_libs udev samba libarchive fuse libgphoto2 libcdio libxml2 GConf
-      libgnome_keyring libsoup avahi libtool
+      libgnome_keyring libsoup avahi libtool libxslt docbook_xsl
     ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
+
+  enableParallelBuilding = true;
 }
diff --git a/pkgs/desktops/gnome-2/desktop/zenity/default.nix b/pkgs/desktops/gnome-2/desktop/zenity/default.nix
index 9e678514689..3ab8838c97b 100644
--- a/pkgs/desktops/gnome-2/desktop/zenity/default.nix
+++ b/pkgs/desktops/gnome-2/desktop/zenity/default.nix
@@ -12,5 +12,5 @@ stdenv.mkDerivation {
   configureFlags = "--disable-scrollkeeper";
   buildInputs = [ gtk libglade libxml2 libxslt libX11 ];
 
-  buildNativeInputs = [ pkgconfig intltool gnome_doc_utils which ];
+  nativeBuildInputs = [ pkgconfig intltool gnome_doc_utils which ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix
index a75e089b508..4769247a516 100644
--- a/pkgs/desktops/gnome-2/platform/GConf/default.nix
+++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   buildInputs = [ ORBit2 dbus_libs dbus_glib libxml2 polkit gtk ];
   propagatedBuildInputs = [ glib ];
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--with-gtk=2.0";
 }
diff --git a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
index e58dd38e369..ec6931724bc 100644
--- a/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
+++ b/pkgs/desktops/gnome-2/platform/ORBit2/default.nix
@@ -9,6 +9,6 @@ stdenv.mkDerivation rec {
     sha256 = "0l3mhpyym9m5iz09fz0rgiqxl2ym6kpkwpsp1xrr4aa80nlh1jam";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libIDL ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/gconfmm/default.nix b/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
index 0597da92e68..8f6075375d6 100644
--- a/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
+++ b/pkgs/desktops/gnome-2/platform/gconfmm/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "a5e0092bb73371a3ca76b2ecae794778f3a9409056fee9b28ec1db072d8e6108";
   };
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ GConf gtkmm glibmm ];
 
diff --git a/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix b/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
index 38b816ccc77..93bb44c54e1 100644
--- a/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
+++ b/pkgs/desktops/gnome-2/platform/gtkglextmm/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gdk.patch ];
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ gtkglext gtkmm gtk mesa gdk_pixbuf ];
 
diff --git a/pkgs/desktops/gnome-2/platform/libIDL/default.nix b/pkgs/desktops/gnome-2/platform/libIDL/default.nix
index 5783976d9a2..64f2b19c3e9 100644
--- a/pkgs/desktops/gnome-2/platform/libIDL/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libIDL/default.nix
@@ -11,5 +11,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib gettext ];
 
-  buildNativeInputs = [ flex bison pkgconfig ];
+  nativeBuildInputs = [ flex bison pkgconfig ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libart_lgpl/default.nix b/pkgs/desktops/gnome-2/platform/libart_lgpl/default.nix
index 320372786a5..7b1ccb97dc4 100644
--- a/pkgs/desktops/gnome-2/platform/libart_lgpl/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libart_lgpl/default.nix
@@ -1,9 +1,9 @@
 {stdenv, fetchurl}:
 
-stdenv.mkDerivation {
-  name = "libart_lgpl-2.3.20";
+stdenv.mkDerivation rec {
+  name = "libart_lgpl-2.3.21";
   src = fetchurl {
-    url = mirror://gnome/sources/libart_lgpl/2.3/libart_lgpl-2.3.20.tar.bz2;
-    sha256 = "0iyqsc517lj8xnidchnk0fxa6aqvss4hv8p9fk6bba86lbiillym";
+    url = "mirror://gnome/sources/libart_lgpl/2.3/${name}.tar.bz2";
+    sha256 = "1yknfkyzgz9s616is0l9gp5aray0f2ry4dw533jgzj8gq5s1xhgx";
   };
 }
diff --git a/pkgs/desktops/gnome-2/platform/libbonobo/default.nix b/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
index bd268e5ec43..79c41f924d3 100644
--- a/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libbonobo/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   preConfigure = "export USER=`whoami`";
-  buildNativeInputs = [ flex bison pkgconfig intltool procps ];
+  nativeBuildInputs = [ flex bison pkgconfig intltool procps ];
   buildInputs = [ libxml2 ];
   propagatedBuildInputs = [ popt glib ORBit2 ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix b/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
index 6eefd42b38d..55a4ecec695 100644
--- a/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libbonoboui/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1kbgqh7bw0fdx4f1a1aqwpff7gp5mwhbaz60c6c98bc4djng5dgs";
   };
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs = [ bison popt gtk libxml2 GConf libglade libtool ];
   propagatedBuildInputs = [ libbonobo libgnomecanvas libgnome ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnome/default.nix b/pkgs/desktops/gnome-2/platform/libgnome/default.nix
index 76f213b5fa8..37dbfd12961 100644
--- a/pkgs/desktops/gnome-2/platform/libgnome/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnome/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "197pnq8y0knqjhm2fg4j6hbqqm3qfzfnd0irhwxpk1b4hqb3kimj";
   };
   
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ popt zlib intltool GConf gnome_vfs libcanberra libtool ];
   propagatedBuildInputs = [ glib libbonobo ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix b/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
index bf2c0360aa2..dd6ebbb9174 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomecanvas/default.nix
@@ -10,6 +10,6 @@ stdenv.mkDerivation rec {
   };
   
   buildInputs = [ libglade ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   propagatedBuildInputs = [ libart_lgpl gtk ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomecups/default.nix b/pkgs/desktops/gnome-2/platform/libgnomecups/default.nix
index 0521ce9058f..9a0afd1275d 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomecups/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomecups/default.nix
@@ -1,16 +1,16 @@
-{stdenv, fetchurl, pkgconfig, gtk, gettext, libxml2, intltool, libart_lgpl }:
+{ stdenv, fetchurl, pkgconfig, gtk, gettext, libxml2, intltool, libart_lgpl }:
 
-let
+stdenv.mkDerivation rec {
   name = "libgnomecups-0.2.3";
-in
-stdenv.mkDerivation {
-  inherit name;
 
   src = fetchurl {
     url = "mirror://gnome/sources/libgnomecups/0.2/${name}.tar.bz2";
     sha256 = "0a8xdaxzz2wc0n1fjcav65093gixzyac3948l8cxx1mk884yhc71";
   };
 
+  patches = [ ./glib.patch ];
+
   buildInputs = [ pkgconfig gtk gettext intltool libart_lgpl ];
+
   propagatedBuildInputs = [ libxml2 ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomecups/glib.patch b/pkgs/desktops/gnome-2/platform/libgnomecups/glib.patch
new file mode 100644
index 00000000000..3f73af861c0
--- /dev/null
+++ b/pkgs/desktops/gnome-2/platform/libgnomecups/glib.patch
@@ -0,0 +1,38 @@
+From d84eee9450b3b6f6155074915efc61bedcc8d446 Mon Sep 17 00:00:00 2001
+From: Dominique Leuenberger <dimstar@opensuse.org>
+Date: Sun, 27 Nov 2011 21:36:41 +0100
+Subject: [PATCH] Fix: Only glib.h can be included
+
+---
+ libgnomecups/gnome-cups-i18n.c |    2 +-
+ libgnomecups/gnome-cups-init.h |    3 +--
+ 2 files changed, 2 insertions(+), 3 deletions(-)
+
+diff --git a/libgnomecups/gnome-cups-i18n.c b/libgnomecups/gnome-cups-i18n.c
+index 8987c5c..127756d 100644
+--- a/libgnomecups/gnome-cups-i18n.c
++++ b/libgnomecups/gnome-cups-i18n.c
+@@ -1,5 +1,5 @@
+ #include <config.h>
+-#include <glib/gmacros.h>
++#include <glib.h>
+ #include "gnome-cups-i18n.h"
+ 
+ #ifdef ENABLE_NLS
+diff --git a/libgnomecups/gnome-cups-init.h b/libgnomecups/gnome-cups-init.h
+index 22b682a..c4600fc 100644
+--- a/libgnomecups/gnome-cups-init.h
++++ b/libgnomecups/gnome-cups-init.h
+@@ -1,8 +1,7 @@
+ #ifndef GNOME_CUPS_INIT
+ #define GNOME_CUPS_INIT
+ 
+-#include <glib/gtypes.h>
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+-- 
+1.7.7
+
diff --git a/pkgs/desktops/gnome-2/platform/libgnomeprint/default.nix b/pkgs/desktops/gnome-2/platform/libgnomeprint/default.nix
index 410e408baa3..0b6d3e25e2e 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomeprint/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomeprint/default.nix
@@ -1,11 +1,8 @@
-{stdenv, fetchurl, pkgconfig, gtk, gettext, libxml2, intltool, libart_lgpl, libgnomecups, bison,
-flex }:
+{ stdenv, fetchurl, pkgconfig, gtk, gettext, libxml2, intltool, libart_lgpl
+, libgnomecups, bison, flex }:
 
-let
+stdenv.mkDerivation rec {
   name = "libgnomeprint-2.18.8";
-in
-stdenv.mkDerivation {
-  inherit name;
 
   src = fetchurl {
     url = "mirror://gnome/sources/libgnomeprint/2.18/${name}.tar.bz2";
@@ -15,5 +12,6 @@ stdenv.mkDerivation {
   patches = [ ./bug653388.patch ];
 
   buildInputs = [ pkgconfig gtk gettext intltool libart_lgpl libgnomecups bison flex ];
+
   propagatedBuildInputs = [ libxml2 ];
 }
diff --git a/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix b/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
index 379602c6ea3..cc8db43ad13 100644
--- a/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libgnomeui/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "03rwbli76crkjl6gp422wrc9lqpl174k56cp9i96b7l8jlj2yddf";
   };
   
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   buildInputs =
     [ xlibs.xlibs libxml2 GConf pango glib libgnome_keyring libglade libtool ];
 
diff --git a/pkgs/desktops/gnome-2/platform/libunique/default.nix b/pkgs/desktops/gnome-2/platform/libunique/default.nix
index 2661307c9d2..6b9cee80042 100644
--- a/pkgs/desktops/gnome-2/platform/libunique/default.nix
+++ b/pkgs/desktops/gnome-2/platform/libunique/default.nix
@@ -9,6 +9,6 @@ stdenv.mkDerivation rec {
     sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ gtk ];
 }
diff --git a/pkgs/desktops/kde-3/kdelibs/default.nix b/pkgs/desktops/kde-3/kdelibs/default.nix
deleted file mode 100644
index 2c9e8e3563a..00000000000
--- a/pkgs/desktops/kde-3/kdelibs/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ stdenv, fetchurl, xlibs, zlib, perl, qt3, openssl, pcre
-, pkgconfig, libtiff, libxml2, libxslt, libtool, expat
-, freetype, bzip2, cups, attr, acl
-}:
-
-let version = "3.5.10"; in
-
-stdenv.mkDerivation {
-  name = "kdelibs-${version}";
-  
-  src = fetchurl {
-    url = "mirror://kde/stable/${version}/src/kdelibs-${version}.tar.bz2";
-    sha256 = "0wjw51r96h6rngbsrzndw890xggzvrakydsbaldlrvbh3jq9qzk1";
-  };
-
-  patches = [
-    # We're not supposed to use linux/inotify.h, use sys/inotify.h instead.
-    # Adapted from Gentoo.
-    ./inotify.patch
-    
-    # Fixes compilation issues with openssl-1.0.0
-    ./kdelibs-3.5.10-openssl_1.0.0.patch
-  ];
-
-  buildInputs = [
-    zlib perl qt3 openssl pcre pkgconfig libtiff libxml2
-    libxslt expat libtool freetype bzip2 cups
-    xlibs.libX11 xlibs.libXt xlibs.libXext xlibs.libXrender xlibs.libXft
-  ];
-
-  propagatedBuildInputs = [attr acl];
-
-  # Prevent configure from looking for pkg-config and freetype-config
-  # in the wrong location (it looks in /usr/bin etc. *before* looking
-  # in $PATH).
-  preConfigure = ''
-    substituteInPlace configure \
-      --replace /usr/bin /no-such-path \
-      --replace /usr/local/bin /no-such-path \
-      --replace /opt/local/bin /no-such-path
-  '';
-
-  configureFlags = ''
-    --without-arts 
-    --with-ssl-dir=${openssl}
-    --x-includes=${xlibs.libX11}/include
-    --x-libraries=${xlibs.libX11}/lib
-  '';
-
-  meta.platforms = stdenv.lib.platforms.linux;
-}
diff --git a/pkgs/desktops/kde-3/kdelibs/inotify.patch b/pkgs/desktops/kde-3/kdelibs/inotify.patch
deleted file mode 100644
index 3d0b470811a..00000000000
--- a/pkgs/desktops/kde-3/kdelibs/inotify.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -rc kdelibs-3.5.10-orig/kio/kio/kdirwatch.cpp kdelibs-3.5.10/kio/kio/kdirwatch.cpp
-*** kdelibs-3.5.10-orig/kio/kio/kdirwatch.cpp	2006-07-22 10:16:37.000000000 +0200
---- kdelibs-3.5.10/kio/kio/kdirwatch.cpp	2009-04-01 13:26:48.000000000 +0200
-***************
-*** 64,74 ****
-  // debug
-  #include <sys/ioctl.h>
-  
-! #ifdef HAVE_INOTIFY
-  #include <unistd.h>
-  #include <fcntl.h>
-  #include <sys/syscall.h>
-- #include <linux/types.h>
-  // Linux kernel headers are documented to not compile
-  #define _S390_BITOPS_H
-  #include <linux/inotify.h>
---- 64,76 ----
-  // debug
-  #include <sys/ioctl.h>
-  
-! #if 1
-! #include <sys/inotify.h>
-! #include <fcntl.h>
-! #elif HAVE_INOTIFY
-  #include <unistd.h>
-  #include <fcntl.h>
-  #include <sys/syscall.h>
-  // Linux kernel headers are documented to not compile
-  #define _S390_BITOPS_H
-  #include <linux/inotify.h>
diff --git a/pkgs/desktops/kde-3/kdelibs/kdelibs-3.5.10-openssl_1.0.0.patch b/pkgs/desktops/kde-3/kdelibs/kdelibs-3.5.10-openssl_1.0.0.patch
deleted file mode 100644
index 7a3a96e972f..00000000000
--- a/pkgs/desktops/kde-3/kdelibs/kdelibs-3.5.10-openssl_1.0.0.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-diff -Naur kdelibs-3.5.10-old/kio/kssl/kopenssl.cc kdelibs-3.5.10-new/kio/kssl/kopenssl.cc
---- kdelibs-3.5.10-old/kio/kssl/kopenssl.cc	2006-07-22 01:16:39.000000000 -0700
-+++ kdelibs-3.5.10-new/kio/kssl/kopenssl.cc	2010-03-31 09:34:38.000000000 -0700
-@@ -96,9 +96,14 @@
- static int (*K_PEM_ASN1_write_bio) (int (*)(),const char *,BIO *,char *,
-                                    const EVP_CIPHER *,unsigned char *,int ,
-                                             pem_password_cb *, void *) = 0L;
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+static int (*K_ASN1_item_i2d_fp)(ASN1_ITEM *,FILE *,unsigned char *) = 0L;
-+static ASN1_ITEM *K_NETSCAPE_X509_it = 0L;
-+#else
- static ASN1_METHOD* (*K_X509_asn1_meth) (void) = 0L;
- static int (*K_ASN1_i2d_fp)(int (*)(),FILE *,unsigned char *) = 0L;
- static int (*K_i2d_ASN1_HEADER)(ASN1_HEADER *, unsigned char **) = 0L;
-+#endif
- static int (*K_X509_print_fp)  (FILE *, X509*) = 0L;
- static int (*K_i2d_PKCS12)  (PKCS12*, unsigned char**) = 0L;
- static int (*K_i2d_PKCS12_fp)  (FILE *, PKCS12*) = 0L;
-@@ -404,9 +409,14 @@
-       K_BIO_ctrl = (long (*) (BIO *,int,long,void *)) _cryptoLib->symbol("BIO_ctrl");
-       K_BIO_write = (int (*) (BIO *b, const void *data, int len)) _cryptoLib->symbol("BIO_write");
-       K_PEM_ASN1_write_bio = (int (*)(int (*)(), const char *,BIO*, char*, const EVP_CIPHER *, unsigned char *, int, pem_password_cb *, void *)) _cryptoLib->symbol("PEM_ASN1_write_bio");
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+      K_ASN1_item_i2d_fp = (int (*)(ASN1_ITEM *, FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_item_i2d_fp");
-+      K_NETSCAPE_X509_it = (ASN1_ITEM *) _cryptoLib->symbol("NETSCAPE_X509_it");
-+#else
-       K_X509_asn1_meth = (ASN1_METHOD* (*)(void)) _cryptoLib->symbol("X509_asn1_meth");
-       K_ASN1_i2d_fp = (int (*)(int (*)(), FILE*, unsigned char *)) _cryptoLib->symbol("ASN1_i2d_fp");
-       K_i2d_ASN1_HEADER = (int (*)(ASN1_HEADER *, unsigned char **)) _cryptoLib->symbol("i2d_ASN1_HEADER");
-+#endif
-       K_X509_print_fp = (int (*)(FILE*, X509*)) _cryptoLib->symbol("X509_print_fp");
-       K_i2d_PKCS12 = (int (*)(PKCS12*, unsigned char**)) _cryptoLib->symbol("i2d_PKCS12");
-       K_i2d_PKCS12_fp = (int (*)(FILE *, PKCS12*)) _cryptoLib->symbol("i2d_PKCS12_fp");
-@@ -568,7 +578,7 @@
-       K_SSL_set_session = (int (*)(SSL*,SSL_SESSION*)) _sslLib->symbol("SSL_set_session");
-       K_d2i_SSL_SESSION = (SSL_SESSION* (*)(SSL_SESSION**,unsigned char**, long)) _sslLib->symbol("d2i_SSL_SESSION");
-       K_i2d_SSL_SESSION = (int (*)(SSL_SESSION*,unsigned char**)) _sslLib->symbol("i2d_SSL_SESSION");
--      K_SSL_get_ciphers = (STACK *(*)(const SSL*)) _sslLib->symbol("SSL_get_ciphers");
-+      K_SSL_get_ciphers = (STACK_OF(SSL_CIPHER) *(*)(const SSL*)) _sslLib->symbol("SSL_get_ciphers");
- #endif
- 
- 
-@@ -956,7 +966,13 @@
-    else return -1;
- }
- 
--
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+int KOpenSSLProxy::ASN1_i2d_fp(FILE *out,unsigned char *x) {
-+   if (K_ASN1_item_i2d_fp && K_NETSCAPE_X509_it)
-+        return (K_ASN1_item_i2d_fp)(K_NETSCAPE_X509_it, out, x);
-+   else return -1;
-+}
-+#else
- ASN1_METHOD *KOpenSSLProxy::X509_asn1_meth(void) {
-    if (K_X509_asn1_meth) return (K_X509_asn1_meth)();
-    else return 0L;
-@@ -968,7 +984,7 @@
-         return (K_ASN1_i2d_fp)((int (*)())K_i2d_ASN1_HEADER, out, x);
-    else return -1;
- }
--
-+#endif
- 
- int KOpenSSLProxy::X509_print(FILE *fp, X509 *x) {
-    if (K_X509_print_fp) return (K_X509_print_fp)(fp, x);
-diff -Naur kdelibs-3.5.10-old/kio/kssl/kopenssl.h kdelibs-3.5.10-new/kio/kssl/kopenssl.h
---- kdelibs-3.5.10-old/kio/kssl/kopenssl.h	2006-07-22 01:16:39.000000000 -0700
-+++ kdelibs-3.5.10-new/kio/kssl/kopenssl.h	2010-03-31 09:35:20.000000000 -0700
-@@ -48,6 +48,9 @@
- #include <openssl/stack.h>
- #include <openssl/bn.h>
- #undef crypt
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+#define STACK _STACK
-+#endif
- #endif
- 
- #include <kstaticdeleter.h>
-@@ -446,12 +449,12 @@
-     */
-    int PEM_write_bio_X509(BIO *bp, X509 *x);
- 
--
-+#if OPENSSL_VERSION_NUMBER < 0x10000000L
-    /*
-     *   X509_asn1_meth - used for netscape output
-     */
-    ASN1_METHOD *X509_asn1_meth();
--
-+#endif
- 
-    /*
-     *   ASN1_i2d_fp - used for netscape output
-@@ -531,6 +534,9 @@
-     */
-    void sk_free(STACK *s);
- 
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+   void sk_free(void *s) { return sk_free(reinterpret_cast<STACK*>(s)); }
-+#endif
- 
-    /* 
-     *  Number of elements in the stack
-@@ -543,6 +549,9 @@
-     */
-    char *sk_value(STACK *s, int n);
- 
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+   char *sk_value(void *s, int n) { return sk_value(reinterpret_cast<STACK*>(s), n); }
-+#endif
- 
-    /* 
-     *  Create a new stack
-@@ -555,6 +564,9 @@
-     */
-    int sk_push(STACK *s, char *d);
- 
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+   int sk_push(void *s, void *d) { return sk_push(reinterpret_cast<STACK*>(s), reinterpret_cast<char*>(d)); }
-+#endif
- 
-    /* 
-     *  Duplicate the stack
-diff -Naur kdelibs-3.5.10-old/kio/kssl/ksmimecrypto.cc kdelibs-3.5.10-new/kio/kssl/ksmimecrypto.cc
---- kdelibs-3.5.10-old/kio/kssl/ksmimecrypto.cc	2005-10-10 08:05:44.000000000 -0700
-+++ kdelibs-3.5.10-new/kio/kssl/ksmimecrypto.cc	2010-03-31 09:34:38.000000000 -0700
-@@ -87,7 +87,7 @@
- 
- 
- STACK_OF(X509) *KSMIMECryptoPrivate::certsToX509(QPtrList<KSSLCertificate> &certs) {
--    STACK_OF(X509) *x509 = sk_new(NULL);
-+    STACK_OF(X509) *x509 = reinterpret_cast<STACK_OF(X509)*>(sk_new(NULL));
-     KSSLCertificate *cert = certs.first();
-     while(cert) {
- 	sk_X509_push(x509, cert->getCert());
-diff -Naur kdelibs-3.5.10-old/kio/kssl/ksslcertificate.cc kdelibs-3.5.10-new/kio/kssl/ksslcertificate.cc
---- kdelibs-3.5.10-old/kio/kssl/ksslcertificate.cc	2006-01-19 09:06:12.000000000 -0800
-+++ kdelibs-3.5.10-new/kio/kssl/ksslcertificate.cc	2010-03-31 09:34:38.000000000 -0700
-@@ -1003,17 +1003,31 @@
- QByteArray KSSLCertificate::toNetscape() {
- QByteArray qba;
- #ifdef KSSL_HAVE_SSL
--ASN1_HEADER ah;
--ASN1_OCTET_STRING os;
--KTempFile ktf;
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+	NETSCAPE_X509 nx;
-+	ASN1_OCTET_STRING hdr;
-+#else
-+   ASN1_HEADER ah;
-+   ASN1_OCTET_STRING os;
-+#endif
-+	KTempFile ktf;
- 
--	os.data = (unsigned char *)NETSCAPE_CERT_HDR;
--	os.length = strlen(NETSCAPE_CERT_HDR);
--	ah.header = &os;
--	ah.data = (char *)getCert();
--	ah.meth = d->kossl->X509_asn1_meth();
-+#if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+	hdr.data = (unsigned char *)NETSCAPE_CERT_HDR;
-+	hdr.length = strlen(NETSCAPE_CERT_HDR);
-+	nx.header = &hdr;
-+	nx.cert = getCert();
-+
-+	d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&nx);
-+#else
-+   os.data = (unsigned char *)NETSCAPE_CERT_HDR;
-+   os.length = strlen(NETSCAPE_CERT_HDR);
-+   ah.header = &os;
-+   ah.data = (char *)getCert();
-+   ah.meth = d->kossl->X509_asn1_meth();
- 
--	d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&ah);
-+   d->kossl->ASN1_i2d_fp(ktf.fstream(),(unsigned char *)&ah);
-+#endif
- 
- 	ktf.close();
- 
diff --git a/pkgs/desktops/kde-4.10/applications/kate.nix b/pkgs/desktops/kde-4.10/applications/kate.nix
new file mode 100644
index 00000000000..e8efc87775a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/applications/kate.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, kactivities, qjson, pyqt4, sip, python, pykde4 }:
+
+kde {
+
+  buildInputs = [ kdelibs kactivities qjson pyqt4 sip python pykde4];
+
+  meta = {
+    description = "Kate, the KDE Advanced Text Editor, as well as KWrite";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/applications/konsole.nix b/pkgs/desktops/kde-4.10/applications/konsole.nix
new file mode 100644
index 00000000000..0db47fb2d7c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/applications/konsole.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, kde_baseapps }:
+
+kde {
+
+  buildInputs = [ kdelibs kde_baseapps ];
+
+  meta = {
+    description = "Konsole, the KDE terminal emulator";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/default.nix b/pkgs/desktops/kde-4.10/default.nix
new file mode 100644
index 00000000000..9fbb58fe242
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/default.nix
@@ -0,0 +1,72 @@
+{ callPackage, callPackageOrig, stdenv, qt48 }:
+
+let
+  release = "4.10.4";
+
+  # Need callPackageOrig to avoid infinite cycle
+  kde = callPackageOrig ./kde-package {
+    inherit release ignoreList extraSubpkgs callPackage;
+  };
+
+  # The list of igored individual modules
+  ignoreList = {
+    # Doesn't work yet
+    kdeutils = [ "ksecrets" ];
+    # kdeadmin/strigi-analyzer has no real code
+    kdeadmin = [ "strigi-analyzer" ];
+    # fake package to make things just work
+    kdesdk = [ "fake" ];
+    # Most of kdebindings do not compile due to a bug in the buildsystem
+    kdebindings = [ "kimono" "korundum" "kross-interpreters" "perlkde" "qyoto" ];
+  };
+
+  # Extra subpackages in the manifest format
+  extraSubpkgs = {
+    kdesdk = [
+      { name="cervisia"; }
+      { name="lokalize"; }
+      { name = "kioslave-svn"; sane = "kioslave_svn"; subdir = "kdesdk-kioslaves"; }
+      { name = "kioslave-perldoc"; sane = "kioslave_perldoc"; subdir = "kdesdk-kioslaves"; }
+      { name="dolphin-plugins-svn"; sane="dolphin_plugins_svn";subdir="dolphin-plugins"; }
+      { name="dolphin-plugins-git"; sane="dolphin_plugins_git";subdir="dolphin-plugins"; }
+      { name="dolphin-plugins-hg"; sane="dolphin_plugins_hg";subdir="dolphin-plugins"; }
+      { name="dolphin-plugins-bazaar"; sane="dolphin_plugins_bazaar";subdir="dolphin-plugins"; }
+      { name="kcachegrind"; }
+      { name="kapptemplate"; }
+      { name="kdesdk-strigi-analyzers"; sane="kdesdk_strigi_analyzers";}
+      { name="kdesdk-thumbnailers"; sane="kdesdk_thumbnailers";}
+      { name="okteta"; }
+      { name="kompare"; }
+      { name="poxml"; }
+      { name="kde-dev-scripts"; sane = "kde_dev_scripts"; }
+      { name="kde-dev-utils"; sane="kde_dev_utils";}
+      #{ name="kprofilemethod"; subdir = "kde-dev-utils/kprofilemethod";}
+      #{ name="kstartperf"; }
+      #{ name="kmtrace"; subdir = "kde-dev-utils/kmtrace"; }
+      #{ name="kpartloader"; }
+      #{ name="kuiviewer"; }
+      { name="umbrello"; }
+    ];
+  };
+
+in
+
+kde.modules // kde.individual //
+{
+  inherit (kde) manifest modules individual splittedModuleList;
+
+  akonadi = callPackage ./support/akonadi { };
+
+  qt4 = qt48;
+
+  kdebase_workspace = kde.modules.kde_workspace;
+
+  inherit release;
+
+  full = stdenv.lib.attrValues kde.modules;
+
+  l10n = callPackage ./l10n {
+    inherit release;
+    inherit (kde.manifest) stable;
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/files/kde-wallpapers-buildsystem.patch b/pkgs/desktops/kde-4.10/files/kde-wallpapers-buildsystem.patch
new file mode 100644
index 00000000000..378cdb64694
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/files/kde-wallpapers-buildsystem.patch
@@ -0,0 +1,17 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3d3e247..f78db67 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,5 +1,10 @@
+-find_package(KDE4 REQUIRED)
+-include(KDE4Defaults)
++project(kde-wallpapers NONE)
++if( WALLPAPER_INSTALL_DIR )
++  message(STATUS "Installing wallpapers to user-supplied directory ${WALLPAPER_INSTALL_DIR}")
++else()
++  find_package(KDE4 REQUIRED)
++  include(KDE4Defaults)
++endif()
+ 
+ install(DIRECTORY Air DESTINATION ${WALLPAPER_INSTALL_DIR} PATTERN .svn EXCLUDE)
+ 
diff --git a/pkgs/desktops/kde-4.10/files/polkit-install.patch b/pkgs/desktops/kde-4.10/files/polkit-install.patch
new file mode 100644
index 00000000000..d2ecac663ec
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/files/polkit-install.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake
+--- kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake	2011-05-20 22:24:54.000000000 +0200
++++ kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake	2011-07-12 14:03:00.000000000 +0200
+@@ -139,7 +139,7 @@
+         ${CMAKE_INSTALL_PREFIX} _KDE4_AUTH_POLICY_FILES_INSTALL_DIR
+         ${POLKITQT-1_POLICY_FILES_INSTALL_DIR})
+ 
+-    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${_KDE4_AUTH_POLICY_FILES_INSTALL_DIR} CACHE STRING 
++    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions" CACHE STRING 
+         "Where policy files generated by KAuth will be installed" FORCE)
+ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
+     set (KAUTH_COMPILING_FAKE_BACKEND TRUE)
diff --git a/pkgs/desktops/kde-4.10/kactivities.nix b/pkgs/desktops/kde-4.10/kactivities.nix
new file mode 100644
index 00000000000..06381bb13d7
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kactivities.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, nepomuk_core }:
+
+kde {
+  propagatedBuildInputs = [ kdelibs nepomuk_core ];
+
+  meta = {
+    description = "KDE activities library and daemon";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kde-base-artwork.nix b/pkgs/desktops/kde-4.10/kde-base-artwork.nix
new file mode 100644
index 00000000000..3f416cebddc
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-base-artwork.nix
@@ -0,0 +1,14 @@
+{ kde, kdelibs }:
+
+kde {
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = "0mrd3w7rhsj0v92c8rh9zjxyifq7wyvwszksf2gyn53dzd06blk8";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE Base artwork";
+    license = "GPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kde-baseapps/kde-baseapps.nix b/pkgs/desktops/kde-4.10/kde-baseapps/kde-baseapps.nix
new file mode 100644
index 00000000000..b564e339eb1
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-baseapps/kde-baseapps.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, shared_desktop_ontologies, glib, htmlTidy, kactivities
+, nepomuk_core, nepomuk_widgets, libXt }:
+
+kde {
+  buildInputs = [ kdelibs nepomuk_core nepomuk_widgets htmlTidy kactivities libXt ];
+
+  meta = {
+    description = "Base KDE applications, including the Dolphin file manager and Konqueror web browser";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kde-package/4.10.4.nix b/pkgs/desktops/kde-4.10/kde-package/4.10.4.nix
new file mode 100644
index 00000000000..a2dafe03f58
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-package/4.10.4.nix
@@ -0,0 +1,399 @@
+{stable=true;
+hashes=builtins.listToAttrs[
+  {name="analitza";value="1ikja551kp2i4x6mw64i12yf84vx0g5rfmqcq93lj2z4gii17nlq";}
+  {name="ark";value="06ymghs1rflhij7skw3hnk2w8kjmmaigh31raq690vbnpa9w8isb";}
+  {name="audiocd-kio";value="1pxza8v5gb34hzbky5jwm2fw3b4bynpzcrggw6vvhnb0gqrfm7x6";}
+  {name="blinken";value="12rl2jl91mkvls7lh38hxxc8qfrw9lq56syb2k5v81x0gxzgz7gx";}
+  {name="bomber";value="13qi8q3jyk9dn2pnljrgh00qp5k4dimdfj5z8r6gb05cvzn1g5zw";}
+  {name="bovo";value="1j180rm5wr1yy2wn76g3s6v7hl54rhahna32lll8dv9srrpqry12";}
+  {name="cantor";value="1406bkky7pglck0vad9id02w5gyfcva9slmy5gb06iwi9rcvl13y";}
+  {name="dragon";value="1zc14x60rcmgiim5wlss0pva1mc89r00xasic55zkb9w1xl2ymrd";}
+  {name="ffmpegthumbs";value="03hyypzdaf1v7hczbmhnkw3fc1va1mfmhl3kdzm40cak2wf3fd89";}
+  {name="filelight";value="0snjk95jmw3f5v21jwld8ywxpa65zayq9n9bsryipg5i7swa9ylk";}
+  {name="granatier";value="0qsxgs11caccz695a7lcrhrm3awdm390fa1hmxs6ijrfj9wx3qkf";}
+  {name="gwenview";value="0b00cvgh1f6abj9ijg32yk1l8mfb0ph5iwqnbwj86z95v0i9kwhl";}
+  {name="jovie";value="0g07d9zdfjpscc8y4nhfsy869iy2h4vin7inlfk59jih4zbh2yss";}
+  {name="juk";value="01nxn50nxdkg87fljiz7y6s02wxbbbifv84p8hp1rswi5mx929a4";}
+  {name="kaccessible";value="0biygax3c5hcqhfgmggn3gbg4skhr75bix8swdj1mp8ypbk7cwn5";}
+  {name="kactivities";value="07f38qxbd1ads5v912759da6b6hxq9jhiphjlq7ja04130h5425l";}
+  {name="kajongg";value="0mp329yqxjvi4rzfam0dxjx0gacpgvzcnd5dbbw43f0bdi28r6xg";}
+  {name="kalgebra";value="139n44rvxdhph1bpvj8x83d4qslhjqwxpw09pj76qskdda0bw1ga";}
+  {name="kalzium";value="0j5dhaffvi825jbgr4vbi3k4ykk7ha8gv2sas1garqfrqbc30p7n";}
+  {name="kamera";value="06ny4af8071bd22kgvfx0vw37arvzmv0vimci17glp1v37qfafl5";}
+  {name="kanagram";value="1nzchi9sjphkh1rsg42jfn2xia9fcjcwihkgan01wd82hrim34bd";}
+  {name="kapman";value="1hgifdlzhrxabn4ywpxmwqikfms8ihnjz0dwbrfwdji84aij9kxf";}
+  {name="kate";value="0m9j7a42vzkdzhcd7hhvswyi7rwvicnb9wjs5ff01lg7zdnbyqxx";}
+  {name="katomic";value="1fj06n77krwyxvjmqwbhfsmi6vii36smifrpzd0yd1f0g3yihiaf";}
+  {name="kblackbox";value="1irnlwagxsik35n6zkdg6vqvydvhka3yq6p3najdav1hbs7liav6";}
+  {name="kblocks";value="0b5n3sil6llnryfns5cff07ckids65pz99swkkcgpalpqvhg5xva";}
+  {name="kbounce";value="0mqaxkgnylirrcip70b330q56c4j31pb2f7c5j65gvzxlk7n1kh9";}
+  {name="kbreakout";value="1c4ycncf21br0ywdbx91gia62k5kkrgnaj38qclfljhzqx83pr3q";}
+  {name="kbruch";value="143wfqjpnwcd51zr14mgn2ak38szbr24k1phv5lmlc3whgz7q15v";}
+  {name="kcalc";value="18jcr6mzasrbs4zbilxhqdsb03965bzm30f74clh5czsyv8s5129";}
+  {name="kcharselect";value="0hj9ax570qpgkj666qab6bdnz0irzlzynsq28dw64sdmjcxs28k4";}
+  {name="kcolorchooser";value="00pr0sgq8s008lc0a22nmavsqap8dk00y6wd56a8zv2fpnrys5gn";}
+  {name="kdeadmin";value="1m5svs6wq393i2ja2z8vivbiw05z41r8nq07j0qypcgzm8a801ks";}
+  {name="kdeartwork";value="1ax5m70zb8jfil2llia5ph8ykz3xm1xnz0irp5ivp69hixnrrp09";}
+  {name="kde-baseapps";value="067a2s8kw26yjsm8lmn9xg3nw80yyfbkz2x96pj4qx1qxv4qviil";}
+  {name="kde-base-artwork";value="0rjxk5qbr15vi4vrd2x9ypqpbam3jbgiylzgk3bx5v367ldrrsbs";}
+  {name="kdegraphics-mobipocket";value="0fky12546bywjng8vab4nr7ih3zrmskp6kz49hqqbhpcxrnlihpf";}
+  {name="kdegraphics-strigi-analyzer";value="0g2zf9fmn6720j29pxsq9hw424p1p1pgz4smz1gb8casfrpc2mqa";}
+  {name="kdegraphics-thumbnailers";value="19nplbwhv0mdg6iawwm8vbmincccyabq9k8ywd8icr8vgj4ikvd4";}
+  {name="kdelibs";value="08249hp7q8ck1sgihia1idxllp7qb85xw9xv21snhccgdv3p1rd1";}
+  {name="kdenetwork";value="1fm9f7nln3735frlcrqvwpg10b31dgr4gf6xiyq068sixh4cv0g6";}
+  {name="kdepim";value="0v9mp548nbqvd03krq6z1djsvr5a6p21bz5dspqy6kp6xymblwzz";}
+  {name="kdepimlibs";value="09p60h7m41495664ijab33dc5n64spynnjqay1allx0mcldqnapq";}
+  {name="kdepim-runtime";value="1d47byk057jdgyvzjyhv7px39dl6qcg26i5r12p3q8y2lslnz5wr";}
+  {name="kdeplasma-addons";value="001yfb324wb7fpi57dz6rnnbjrip9n14bxa7yv20fpq8i6ngv8hl";}
+  {name="kde-runtime";value="065jhs3ajg3c6k25g5cwbxpp6wxmrd6qg0aza3lxfm87fb1v255n";}
+  {name="kdesdk";value="1bvmfaddvpgh5kx4nv4c3z33bka6m7wlsw1nzyip9gw1ghac6a2s";}
+  {name="kdetoys";value="1frkz6k7q99y2nn0j2xw00zsq4dbsmwyvq7jbh7y4wyzanbyxh0f";}
+  {name="kde-wallpapers";value="0gspx1xld9da4ppcgr20rvkbhy3jh4yqjzfvhsfi1qhh61jgfcks";}
+  {name="kdewebdev";value="178sq7r584qlkphzwdqhkjaq2h87vjjghq3ialmahzsas3qihkbs";}
+  {name="kde-workspace";value="1l927wa1qlj0vcahqb0h8vx23fyg9nwv07lmacb7igpv56ccgfam";}
+  {name="kdf";value="18b623q0p3sh5y69i6likknh90h85imgr2glddsjz4p38f575kis";}
+  {name="kdiamond";value="0smq3333k5qiny3663yj9h8j0smgybjxr0qpf2m139amr45qcyn4";}
+  {name="kfloppy";value="0xv1nsnv105b9dr2vdlns1vwq25963fgl130lhg31dafkiyn3ivr";}
+  {name="kfourinline";value="0d721glmhjp9dr6y60gv299jnjf96n8rkws759kizlq2x3ggn1gx";}
+  {name="kgamma";value="1hmw7pbsxclws57saha7s253172b61lvqxcqp2vpgvdgjdrraik5";}
+  {name="kgeography";value="1vnrm7rva467z582qppqryz0671b1bcmgxcxlc2f223kp9g0k8d5";}
+  {name="kgoldrunner";value="1d2sl02c2ys6vnxxy1rh9lsz3aj5rlzjmpx39dbvap5qqjsan58b";}
+  {name="kgpg";value="0k1ni2xb4p5p5r8vmnpxm77jqa4176apy7047dxc3w3v0qgqvj9n";}
+  {name="khangman";value="0bq0bdrx761fyaxfv43sfq68hfcwzhvagxm66jzk4wzd6pb1m6ky";}
+  {name="kig";value="0jmax8a357iqa3nggpmpbzk9vdnisdmilyqxgkrd1n43cs4cbc9h";}
+  {name="kigo";value="029xn39sxp2dpj8isq1gmis1858iya0bc758jy8d1rq4c046zmxj";}
+  {name="killbots";value="0arvfbzsax61nn3hz8nk82l3in802866fqsxhz2zrwh03dbrl30i";}
+  {name="kimono";value="1ic2xbgd8xwadrvc7qfq1ihkpnh4dx2pjrm5zbjgycyfvsmvl6sh";}
+  {name="kiriki";value="1dp1dp8s4r4501ldn0v5phkk3fj2kfrncz6h4pfylx27lhpbjbn0";}
+  {name="kiten";value="0jd17nvk6vqniqs8rzmzsnc5hr05i3fwmmvf44g35gpqmr88kb5b";}
+  {name="kjumpingcube";value="0z6a8iaprdaqpif054a6glbgcgwaxm2w4i1r9077k91nnsnwrmp3";}
+  {name="klettres";value="10jc56ll0cgaqkb2xf1gh0k75l90al046syj2q2dqsnaa7lazxp7";}
+  {name="klickety";value="0afb8llrx30zajsy2k0i22xf8ll9lrlmwzrqn4qq7s9wxzwy291v";}
+  {name="klines";value="0mkwb4d60zxalv0asw4qnvml6jf153ghzqcxgbac40nhzl2abdyz";}
+  {name="kmag";value="0pjq6nax82x3ldknld25xrx4adc2i7jcy0x4l343m83f5c79xyn6";}
+  {name="kmahjongg";value="1sx8yplpc70z1vdp9j1shmhc8cqbwmshdhl23hxpl1jydd36q1wj";}
+  {name="kmines";value="0qpcnp0hfhwybqfxgqvbwhin8lb50gca2kwvms10cayqmjafj9j8";}
+  {name="kmix";value="1k67gygq1j13p8nxk50n9q01yfkrv0safvxrbq5f70yvka1jdyj7";}
+  {name="kmousetool";value="17sylfp5zicq36c812jy9h6s4qprwwad05zbbj9701ax40iwrvlr";}
+  {name="kmouth";value="1bpqq919rzcaaqxp3md4w1lrhf5mxfjp07z5v7ii8mgji8wrq1g5";}
+  {name="kmplot";value="0dhdpx79klqc5xb9h4dcgriqivppcrw2ib2piqbqs882mi3pdzx2";}
+  {name="knavalbattle";value="07x4vh2h0d62kwwai5j0d6a2zf615y4mp3iacp5rz8j9pdkhqn52";}
+  {name="knetwalk";value="151cj33kfyjf5xxgw0q00l5jbvx5kb893y2mv9ydc9xmwgcd4szz";}
+  {name="kolf";value="1ibrf01vzpr5dyy2hjb6jq6i9hk7w4kw1iffkyh6w5z40nphs2dx";}
+  {name="kollision";value="1fgs793v36j27z76ik50wz466r3wrga5pq8ibqy3cinvh7blk7cb";}
+  {name="kolourpaint";value="1wxja4xd3jhxib2vpa5289f80hfcd2idpvzz4ap71ca0bzkvknq3";}
+  {name="konquest";value="0aga5yzv5jqbgzp6dp11mgjvfjzrs4csaa5pppwbld81573vldmp";}
+  {name="konsole";value="0kvv4ccc76swxzsw3z7dis8lbmnf6mbzj4b0n9l4zcmmw2iphvd4";}
+  {name="korundum";value="03djf01c6rm76dzswnlccwr81p5qyzccv2zxmbycclp8lp6w4vgg";}
+  {name="kpat";value="1vlyya0yiizrd9c1d4pl1dn6nw7g14rzvwhny12qls7ssrj40zzc";}
+  {name="kremotecontrol";value="0i6jz6m2a2ff97hkqpjy2qhdagx82jwcsnafl2cv0kddszxdabni";}
+  {name="kreversi";value="0ci6aampxq6l6sc8m8gxqrzhws56fbhp2xil0qzgab93xn7mmp1c";}
+  {name="kross-interpreters";value="1iypzm9rwszw1walylq6fa16s4hw84zqpyvmd7aik2dz59fmmvlx";}
+  {name="kruler";value="0841j4001v7497xa6nzdlprnhx8whp0rq24z2yblqnjf1wi5d07y";}
+  {name="ksaneplugin";value="10x1shs2cfa4331qymwafpm3hm45n3aqrhiriyl7vsnk1cc2agin";}
+  {name="kscd";value="0ih7zwyvrgsfd4sqj1g5m5hv71sqdzfhmfn6p3crdnnssbvnfhzd";}
+  {name="kshisen";value="1pxqz390mr066kni1gxa0jay00mgm1r0dmxydrg6mbfyw4qqw554";}
+  {name="ksirk";value="0rf5hj19bfc8mgm810rwvj1173nk93npgbsd17vsj1rqskdi57zy";}
+  {name="ksnakeduel";value="0q02nbcl71h6kqs3mdgq51g4y66p5p62mm70j55cfwjq70i8abbw";}
+  {name="ksnapshot";value="1rlq34j5ay3vyp1vpxxfpzyap26dcwg4ii10ql5bl28z2m1xv8ba";}
+  {name="kspaceduel";value="1nhxcmrn42gfkifxfikldha9045ffq5xzbb95wwvwp478jcqi4xk";}
+  {name="ksquares";value="06kxr8v70ygk2bwcvnfp4l4kjj3yhm5f5wgmzfww8h7kxg87lhg7";}
+  {name="kstars";value="0hhi2vfvv5dzr82gg2p34nsclis0hswkgvh9q21zg2nj2g4byblh";}
+  {name="ksudoku";value="1jglf83shv3p3kn71i0lbga9mil54cs2m4xr0dd113961c2fnylf";}
+  {name="ktimer";value="0kqavcxrxly15az0h0yn8cn6mksvka12yc8fywr029drnr70hs0i";}
+  {name="ktouch";value="1b8612a6pcsaamdq9hpkxr71vvmd0mxrnb0hl8iy05q61cv71i0b";}
+  {name="ktuberling";value="1zqzs86ricqwvj6ragxj4rxhddr92a34z8jwdp7qqqjdafzq57c8";}
+  {name="kturtle";value="0nslszpkacbdwsq8l2phzls5qbfm76r32yiynnd35qjfh94dpilf";}
+  {name="kubrick";value="1qlysx8kvz6r80rm0szq7pk007d57ddv77qy7d3gmpijwa9giybj";}
+  {name="kwallet";value="1pw7wgfjfa553kdc8z91amg18zhr5c51nhklr7kpqgp1yj0hwp6a";}
+  {name="kwordquiz";value="016l2yv461w6liqnkszprlr22nyyy7wi9f3fqblqq5xbps8wr6b4";}
+  {name="libkcddb";value="0qjdxxwj0hw6ykya6npfq2kp21sspwxf79pklz3w7q3gnl98rlbb";}
+  {name="libkcompactdisc";value="1jql8hqsb5jl73c22ssv0ddmhipjpgqxhwnyw362djdxifvrybhi";}
+  {name="libkdcraw";value="0w9h9a69wz7m0hg486jcw7vxkzrr3nfjkgqgr40i3cmxpnnjjvp9";}
+  {name="libkdeedu";value="0ai6vr33wcphimgbznmi8arh9fa9xpcpkjq8hq07svdgmbxjd44m";}
+  {name="libkdegames";value="0ifpxwpfh79gh5qs8wl0i951kab3ppmri0h99hi0idj96xhkznpf";}
+  {name="libkexiv2";value="1w9k4c38ziyfnh9byjszg6aw1mbjii06ladgiwx1q397layd7qhx";}
+  {name="libkipi";value="1a4kqhsvpcly6mlr9w8g8gb2wyyrfbi89pwb3i1ky3w9wxk87pi4";}
+  {name="libkmahjongg";value="1rr5z04af5kswcn6pjpd9ryp1zwp3znhwb97xgvppni88cwawyff";}
+  {name="libksane";value="1sv0ba5p0m8d621vykhayblk6lsys4c80474b7d7vgh9xbcxhhgc";}
+  {name="lskat";value="0bimy8wng95mpkssssmfm2779qyjsw5f1i9wh695k0jq6j25dscy";}
+  {name="marble";value="1z90p25fgvwg35pxap1yd3k2i2qrsv9d2057lixv03ymbj0l93aq";}
+  {name="mplayerthumbs";value="1m83pglqgi6dwbbnm4djybki11f2s6q2lhbqa6v1kq12133fhkc4";}
+  {name="nepomuk-core";value="14sfvizfwnarcidmj74v1rsix85sn9hvs6wm4xnyv7d4xw7mgqv3";}
+  {name="nepomuk-widgets";value="02wm1ghsf8mxv24y1d1b5j4nq8jwi6dwlbzlqdl2hhjqxfc60sxw";}
+  {name="okular";value="15aydihdfd5hzkgchxi2xpfy96bm90jcn07lmmp5xcdng3jj520h";}
+  {name="oxygen-icons";value="0rwdp44nkigs0v449l90mjw7ngs21a0jx17biascjhq1kxrh0vmp";}
+  {name="pairs";value="009qpwhy64xfad4ch4l4dh5dn5cj9g9jg0b3384k6wjvx6k61fqq";}
+  {name="palapeli";value="0g03r8f1z2jxyh2hl6l21s292240d2dbcqi0lndjyfsz322i55wc";}
+  {name="parley";value="1xn5na30xabzp8lhbmq5ajv08rl1s7zsn08ffwd2vq8ac1nwi0k6";}
+  {name="perlkde";value="0088hbqdjqdfyf1pqksppbq1xzpgc49rqsnpgjikgdh9nqssnipd";}
+  {name="perlqt";value="1jgiicjknkfiavnq9jw2mdmsqbqb4ch5caxfhx1v6azj4s95ldpj";}
+  {name="picmi";value="0ckfcmbivkbkl9akb20ih2k4sz221ygqi51wmir3p5ryvk2dlq2a";}
+  {name="print-manager";value="0wszjqf42c3mb8c9iq5ngjz21424zjl9j0g3pwgdfj0i8iv1lcd2";}
+  {name="pykde4";value="18j9fh1w3n9yrrzgsq3pqj2pi53wp58kbwkfwb3hn3a2ksw569qb";}
+  {name="qtruby";value="0zc0if1c8c0ddfm2f6w4zp6dizxqd3z6dnr1iwydw7mdac205j38";}
+  {name="qyoto";value="1cgkpr68wh5rq3kbkv0zjylmyfg1ld4qh8r5azrq25y4qiisxmax";}
+  {name="rocs";value="1ak19mjsniwqzybjawigqg8a04kpv6jhx53mkvlm3wjdnsxi1jis";}
+  {name="smokegen";value="09liqidf5a862l6a4cz4wghhmfsjay647q2q3h17s8iwwid7k373";}
+  {name="smokekde";value="1xl56ygpc0ca7smxiagm7ch45w6m415i9nbzin08i4p017vvx0df";}
+  {name="smokeqt";value="0rk31vd45xraihhb3nmx0mkynlq3wwvdsn0460jfi30m72zpmkyc";}
+  {name="step";value="00vxnybi6q7lw6w22gmd5jmai8ysgyh9sy1cnn6jj4difn1x8zcr";}
+  {name="superkaramba";value="1rkbrifkvhl2zajr96kk63lc3r5s43acfih6m499hgwxg8g9z0cf";}
+  {name="svgpart";value="0892krp78wq731wdr5ipsgx10w45xsrr8jx00qyjsci7qsmpfz4w";}
+  {name="sweeper";value="1i151jzqabfs72c8rl5hh401nmwp9abpa6nfq3m8qyh4d8gn0fig";}
+];
+modules=[
+{
+  module="kdemultimedia";
+  split=true;
+  pkgs=[
+    { name="audiocd-kio"; sane="audiocd_kio"; }
+    { name="dragon";  }
+    { name="ffmpegthumbs";  }
+    { name="juk";  }
+    { name="kmix";  }
+    { name="kscd";  }
+    { name="libkcddb";  }
+    { name="libkcompactdisc";  }
+    { name="mplayerthumbs";  }
+  ];
+}
+{
+  module="kdegraphics";
+  split=true;
+  pkgs=[
+    { name="gwenview";  }
+    { name="kamera";  }
+    { name="kcolorchooser";  }
+    { name="kdegraphics-mobipocket"; sane="kdegraphics_mobipocket"; }
+    { name="kdegraphics-strigi-analyzer"; sane="kdegraphics_strigi_analyzer"; }
+    { name="kdegraphics-thumbnailers"; sane="kdegraphics_thumbnailers"; }
+    { name="kgamma";  }
+    { name="kolourpaint";  }
+    { name="kruler";  }
+    { name="ksaneplugin";  }
+    { name="ksnapshot";  }
+    { name="libkdcraw";  }
+    { name="libkexiv2";  }
+    { name="libkipi";  }
+    { name="libksane";  }
+    { name="okular";  }
+    { name="svgpart";  }
+  ];
+}
+{
+  module="kdelibs";
+  split=true;
+  pkgs=[
+    { name="kdelibs";  }
+    { name="nepomuk-core"; sane="nepomuk_core"; }
+    { name="nepomuk-widgets"; sane="nepomuk_widgets"; }
+  ];
+}
+{
+  module="kdeutils";
+  split=true;
+  pkgs=[
+    { name="ark";  }
+    { name="filelight";  }
+    { name="kcalc";  }
+    { name="kcharselect";  }
+    { name="kdf";  }
+    { name="kfloppy";  }
+    { name="kgpg";  }
+    { name="kremotecontrol";  }
+    { name="ktimer";  }
+    { name="kwallet";  }
+    { name="print-manager"; sane="print_manager"; }
+    { name="superkaramba";  }
+    { name="sweeper";  }
+  ];
+}
+{
+  module="applications";
+  split=true;
+  pkgs=[
+    { name="kate";  }
+    { name="konsole";  }
+  ];
+}
+{
+  module="kdegames";
+  split=true;
+  pkgs=[
+    { name="bomber";  }
+    { name="bovo";  }
+    { name="granatier";  }
+    { name="kajongg";  }
+    { name="kapman";  }
+    { name="katomic";  }
+    { name="kblackbox";  }
+    { name="kblocks";  }
+    { name="kbounce";  }
+    { name="kbreakout";  }
+    { name="kdiamond";  }
+    { name="kfourinline";  }
+    { name="kgoldrunner";  }
+    { name="kigo";  }
+    { name="killbots";  }
+    { name="kiriki";  }
+    { name="kjumpingcube";  }
+    { name="klickety";  }
+    { name="klines";  }
+    { name="kmahjongg";  }
+    { name="kmines";  }
+    { name="knavalbattle";  }
+    { name="knetwalk";  }
+    { name="kolf";  }
+    { name="kollision";  }
+    { name="konquest";  }
+    { name="kpat";  }
+    { name="kreversi";  }
+    { name="kshisen";  }
+    { name="ksirk";  }
+    { name="ksnakeduel";  }
+    { name="kspaceduel";  }
+    { name="ksquares";  }
+    { name="ksudoku";  }
+    { name="ktuberling";  }
+    { name="kubrick";  }
+    { name="libkdegames";  }
+    { name="libkmahjongg";  }
+    { name="lskat";  }
+    { name="palapeli";  }
+    { name="picmi";  }
+  ];
+}
+{
+  module="kdeedu";
+  split=true;
+  pkgs=[
+    { name="analitza";  }
+    { name="blinken";  }
+    { name="cantor";  }
+    { name="kalgebra";  }
+    { name="kalzium";  }
+    { name="kanagram";  }
+    { name="kbruch";  }
+    { name="kgeography";  }
+    { name="khangman";  }
+    { name="kig";  }
+    { name="kiten";  }
+    { name="klettres";  }
+    { name="kmplot";  }
+    { name="kstars";  }
+    { name="ktouch";  }
+    { name="kturtle";  }
+    { name="kwordquiz";  }
+    { name="libkdeedu";  }
+    { name="marble";  }
+    { name="pairs";  }
+    { name="parley";  }
+    { name="rocs";  }
+    { name="step";  }
+  ];
+}
+{
+  module="kdebindings";
+  split=true;
+  pkgs=[
+    { name="kimono";  }
+    { name="korundum";  }
+    { name="kross-interpreters"; sane="kross_interpreters"; }
+    { name="perlkde";  }
+    { name="perlqt";  }
+    { name="pykde4";  }
+    { name="qtruby";  }
+    { name="qyoto";  }
+    { name="smokegen";  }
+    { name="smokekde";  }
+    { name="smokeqt";  }
+  ];
+}
+{
+  module="kdeaccessibility";
+  split=true;
+  pkgs=[
+    { name="jovie";  }
+    { name="kaccessible";  }
+    { name="kmag";  }
+    { name="kmousetool";  }
+    { name="kmouth";  }
+  ];
+}
+{
+  module="kde-baseapps";
+sane="kde_baseapps";  split=true;
+  pkgs=[
+    { name="kde-baseapps"; sane="kde_baseapps"; }
+  ];
+}
+{ module="kactivities";  split=false;}
+{ module="kdeadmin";  split=false;
+  pkgs=[
+    { name="strigi-analyzer"; sane="strigi_analyzer";}
+    { name="kuser"; }
+    { name="kcron"; }
+    { name="ksystemlog"; }
+  ];
+
+}
+{ module="kdeartwork";  split=false;
+  pkgs=[
+    { name="ColorSchemes"; }
+    { name="IconThemes"; }
+    { name="emoticons"; }
+    { name="kscreensaver"; }
+    { name="kwin-styles"; sane="kwin_styles";}
+    { name="sounds"; }
+    { name="styles"; }
+    { name="wallpapers"; }
+    { name="HighResolutionWallpapers"; }
+    { name="WeatherWallpapers"; }
+    { name="desktopthemes"; }
+  ];
+
+}
+{ module="kde-base-artwork"; sane="kde_base_artwork"; split=false;}
+{ module="kdenetwork";  split=false;
+  pkgs=[
+    { name="kfile-plugins"; sane="kfile_plugins";}
+    { name="kget"; }
+    { name="kopete"; }
+    { name="krdc"; }
+    { name="kppp"; }
+    { name="krfb"; }
+    { name="kdnssd"; }
+    { name="filesharing"; }
+  ];
+
+}
+{ module="kdepim";  split=false;}
+{ module="kdepimlibs";  split=false;}
+{ module="kdepim-runtime"; sane="kdepim_runtime"; split=false;}
+{ module="kdeplasma-addons"; sane="kdeplasma_addons"; split=false;}
+{ module="kde-runtime"; sane="kde_runtime"; split=false;}
+#had to add fake pkgs to kdesdk to get it to be treated like a split module
+{ module="kdesdk";  split=false; pkgs = [{ name="fake"; }]; }
+{ module="kdetoys";  split=false;
+  pkgs=[
+    { name="kteatime"; }
+    { name="ktux"; }
+    { name="amor"; }
+  ];
+
+}
+{ module="kde-wallpapers"; sane="kde_wallpapers"; split=false;}
+{ module="kdewebdev";  split=false;
+  pkgs=[
+    { name="klinkstatus"; }
+    { name="kfilereplace"; }
+    { name="kimagemapeditor"; }
+    { name="kommander"; }
+  ];
+
+}
+{ module="kde-workspace"; sane="kde_workspace"; split=false;}
+{ module="oxygen-icons"; sane="oxygen_icons"; split=false;}
+];
+}
diff --git a/pkgs/desktops/kde-4.10/kde-package/default.nix b/pkgs/desktops/kde-4.10/kde-package/default.nix
new file mode 100644
index 00000000000..cd2860920d6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-package/default.nix
@@ -0,0 +1,127 @@
+{ callPackage, runCommand, stdenv, fetchurl, qt4, cmake, automoc4
+, release, ignoreList, extraSubpkgs
+}:
+
+let
+  inherit (stdenv.lib) filter fold;
+  inherit (builtins) getAttr hasAttr remoteAttrs listToAttrs tail head;
+in
+rec {
+  manifest = import (./. + "/${release}.nix");
+
+  # src attribute for $name tarball
+  kdesrc = name: fetchurl {
+    url = "mirror://kde/" + (if manifest.stable then "" else "un")
+      + "stable/${release}/src/${name}-${release}.tar.xz";
+    sha256 = getAttr name manifest.hashes;
+  };
+
+  # Default meta attribute
+  defMeta = {
+    homepage = http://www.kde.org;
+    inherit (qt4.meta) platforms maintainers;
+  };
+
+  # KDE package built from the whole tarball
+  # This function is used both for monolithic modules and modules which are
+  # released as individual tarballs
+  kdeMonoPkg = name: let n_ = name; in a@{meta, name ? n_, ...}:
+    stdenv.mkDerivation ({
+      name = "${name}-${release}";
+      src = kdesrc name;
+      meta = defMeta // meta;
+      enableParallelBuilding = true;
+    } // (removeAttrs a [ "meta" "name" ]));
+
+  # kdeMonoPkg wrapper for modules splitted upstream compatible with combinePkgs
+  # API.
+  kdeSplittedPkg = module: {name, sane ? name}: kdeMonoPkg name;
+
+  # Build subdirectory ${subdir} of tarball ${module}-${release}.tar.xz
+  kdeSubdirPkg = module:
+    {name, subdir ? name, sane ? name}:
+    let name_ = name; in
+    a@{cmakeFlags ? [], name ? name_, meta ? {}, ...}:
+    stdenv.mkDerivation ({
+      name = "${name}-${release}";
+      src = kdesrc module;
+      cmakeFlags =
+        [ "-DDISABLE_ALL_OPTIONAL_SUBDIRECTORIES=TRUE"
+          "-DBUILD_doc=TRUE"
+          "-DBUILD_${subdir}=TRUE"
+        ] ++ cmakeFlags;
+      meta = defMeta // meta;
+      enableParallelBuilding = module.enableParallelBuilding or true;
+    } // (removeAttrs a [ "meta" "name" "cmakeFlags" ]));
+
+  # A KDE monolithic module
+  kdeMonoModule = name: path: callPackage path { kde = kdeMonoPkg name; };
+
+  # Combine packages in one module.
+  # Arguments:
+  #  * pkgFun --- a function of the following signature:
+  #               module: manifest_attrs: manual_attrs: derivation;
+  #  * module --- name of the module
+  #  * pkgs --- list of packages in manifest format
+  combinePkgs = pkgFun: module: pkgs:
+    let
+      f = p@{name, ...}:
+        callPackage (./.. + "/${module}/${name}.nix") { kde = pkgFun module p; };
+      list = map f pkgs;
+      attrs = listToAttrs (map
+        ({name, sane ? name, ...}@p: { name = sane; value = f p; })
+        pkgs);
+    in
+      runCommand "${module}-${release}"
+      ({passthru = attrs // {
+         propagatedUserEnvPackages = list;
+         projects = attrs;
+       };})
+        ''
+          mkdir -pv $out/nix-support
+          echo "${toString list}" | tee $out/nix-support/propagated-user-env-packages
+        '';
+
+  # Given manifest module data, return the module
+  kdeModule = { module, sane ? module, split, pkgs ? [] }:
+    let
+      pkgs_ = filterPkgs module pkgs;
+    in
+    # Module is splitted by upstream
+    if split then combinePkgs kdeSplittedPkg module pkgs_
+    # Monolithic module
+    else if pkgs == [] then kdeMonoModule module (./.. + "/${module}.nix")
+    # Module is splitted by us
+    else combinePkgs kdeSubdirPkg module pkgs_;
+
+  # The same, as nameValuePair with sane name
+  kdeModuleNV = a@{ module, sane ? module, ... }:
+    { name = sane; value = kdeModule a; };
+
+  filterPkgs = module: (p:
+      removeNames (stdenv.lib.attrByPath [module] [] ignoreList) p
+      ++ (stdenv.lib.attrByPath [module] [] extraSubpkgs));
+
+  # Remove attrsets with x.name in subst. Optimized for empty subst.
+  removeNames = subst: big:
+    fold (s: out: filter (x: x.name != s) out) big subst;
+
+  modules = listToAttrs (map kdeModuleNV manifest.modules);
+
+  splittedModuleList =
+    let
+      splitted = filter (a: a ? pkgs) manifest.modules;
+      names = map ({module, sane ? module, ...}: sane) splitted;
+    in
+    map (m: m.projects) (stdenv.lib.attrVals names modules);
+
+  individual =
+    stdenv.lib.zipAttrsWith
+    (
+      name: list:
+      if tail list == []
+      then head list
+      else abort "Multiple modules define ${name}"
+    )
+    splittedModuleList;
+}
diff --git a/pkgs/desktops/kde-4.10/kde-package/kde-manifest.sh b/pkgs/desktops/kde-4.10/kde-package/kde-manifest.sh
new file mode 100755
index 00000000000..e964ce3ddc1
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-package/kde-manifest.sh
@@ -0,0 +1,146 @@
+#! /bin/sh
+
+# Usage: download kde release to $dir, then run
+# $0 $dir
+
+dir="$1"
+
+# Detect release number & whether it is a stable release
+if [[ ! -d "${dir}" ]]; then
+  echo "${dir} is not a directory (or doesn't exist)!" >&2
+  exit 1
+fi
+
+release=$(ls "${dir}"/kdelibs-*.tar.xz | \
+  sed -e 's/.*kdelibs-//' -e 's/\.tar\.xz//')
+
+if [[ ${release##*.} -gt 50 ]]; then
+  stable="false"
+else
+  stable="true"
+fi
+
+echo "Detected release ${release}" >&2
+
+declare -A hash
+declare -A modules
+declare -a packages
+declare -a top_level
+
+# xsltproc output declares -A module
+if [[ ! -f kde_projects.xml ]]; then
+  curl -O -J http://projects.kde.org/kde_projects.xml
+fi
+eval `xsltproc kde-submodules.xslt kde_projects.xml`
+
+module[kde-baseapps]=kde-baseapps
+unset module[kactivities]
+
+print_sane() {
+  echo "Called print_sane $1" >&2
+  sane="${1//[^a-z0-9_]/_}"
+  if [[ "$sane" != "$1" ]]; then
+    echo "Sane version is $sane" >&2
+    echo -n "sane=\"$sane\";"
+  fi
+}
+
+for i in `cd "${dir}"; ls *-${release}.tar.xz`; do
+  package=${i%-${release}.tar.xz}
+  packages+=( "$package" )
+  echo -n "${package}.. " >&2
+  hash[$package]=$(nix-hash --type sha256 --flat --base32 "${dir}/${i}")
+  echo -n ${hash[$package]} >&2
+
+  if [ -n "${module[$package]}" ]; then
+    m="${module[$package]}"
+    echo " (${m})" >&2
+    modules[$m]=1
+  else
+    top_level+=( "$package" )
+    echo " (top-level)" >&2
+  fi
+  #nix-store --add-fixed sha256 "${dir}/${i}" >&2
+done
+
+
+print_pkg_hash() {
+  echo "  {name=\"${1}\";value=\"${hash[$1]}\";}"
+}
+
+print_hashes(){
+  echo "hashes=builtins.listToAttrs["
+  for p in "${packages[@]}"; do print_pkg_hash "$p"; done
+  echo "];"
+}
+
+print_split_module(){
+  echo -n "$1:" >&2
+  echo -e "{\n  module=\"$1\";"
+  print_sane "$1"
+  echo "  split=true;"
+  echo "  pkgs=["
+  for p in "${packages[@]}"; do
+    if [[ "${module[$p]}" == "$1" ]]; then
+      echo -n "    { name=\"$p\"; "
+      print_sane "$p"
+      echo " }"
+      echo -n " $p" >&2
+    fi
+  done
+  echo "  ];"
+  echo "}"
+  echo >&2
+}
+
+print_mono_module(){
+  echo -en "{ module=\"$1\"; "
+  print_sane "$1"
+  echo -n "$1 ... " >&2
+  echo -n " split=false;"
+  cml="$1-$release/CMakeLists.txt"
+  tar -xf "${dir}/$1-${release}.tar.xz" "$cml"
+  if grep '^[^#]*add_subdirectory' $cml >/dev/null; then
+    if grep '^[^#]*add_subdirectory' $cml | grep -v macro_optional_add_subdirectory >/dev/null; then
+      echo " is monolithic (has unconditionally added subdirs)" >&2
+    else
+      subdirs=( `grep '^[^#]*add_subdirectory' $cml |
+        sed -e 's/[^#]*add_subdirectory *( *\(.*\) *)/\1/' |
+        grep -v '\(doc\|cmake\)'` )
+      echo " seems splittable, subdirs: ${subdirs[*]}" >&2
+      echo -e "\n  pkgs=["
+      for s in "${subdirs[@]}"; do
+        echo -en "    {"
+		echo -n " name=\"${s//\//-}\"; "
+        print_sane "$s"
+        if [[ $s != "${s//\//-}" ]]; then
+          echo -n "subdir=\"$s\"; "
+        fi
+        echo "}"
+      done
+      echo -e "  ];\n"
+    fi
+  else
+    echo " is monolithic (has no subdirs)" >&2
+  fi
+  rm $cml
+  rmdir $1-$release
+  echo "}"
+}
+
+print_modules(){
+  echo "modules=["
+  echo "Printing modules splitted by upstream" >&2
+  for m in "${!modules[@]}"; do print_split_module "$m"; done
+  echo >&2
+  echo "Printing modules not splitted by upstream (${top_level[*]})" >&2
+  for m in "${top_level[@]}"; do print_mono_module "$m"; done
+  echo "];"
+}
+
+echo "Writing ${release}.nix" >&2
+exec > "${release}.nix"
+echo "{stable=${stable};"
+print_hashes
+print_modules
+echo "}"
diff --git a/pkgs/desktops/kde-4.10/kde-package/kde-submodules.xslt b/pkgs/desktops/kde-4.10/kde-package/kde-submodules.xslt
new file mode 100644
index 00000000000..952a05a9d27
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-package/kde-submodules.xslt
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- xslt file for http://projects.kde.org/kde_projects.xml -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+	<xsl:output method="text" />
+	<xsl:template match="/">
+		<xsl:for-each select="kdeprojects/component[@identifier='kde']">
+			<xsl:text>declare -A module
</xsl:text>
+			<xsl:for-each select="module">
+				<xsl:variable name="module" select='@identifier' />
+				<xsl:for-each select=".//project[repo]">
+					<xsl:text>module["</xsl:text>
+					<xsl:value-of select='@identifier' />
+					<xsl:text>"]="</xsl:text>
+					<xsl:value-of select="$module" />
+					<xsl:text>"
</xsl:text>
+				</xsl:for-each>
+			</xsl:for-each>
+		</xsl:for-each>
+	</xsl:template>
+</xsl:stylesheet>
diff --git a/pkgs/desktops/kde-4.10/kde-runtime.nix b/pkgs/desktops/kde-4.10/kde-runtime.nix
new file mode 100644
index 00000000000..b562d8cadd5
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-runtime.nix
@@ -0,0 +1,23 @@
+{ kde, kdelibs, shared_desktop_ontologies, bzip2, libssh, exiv2, attica
+, libcanberra, virtuoso, samba, libjpeg, ntrack, pkgconfig, qca2, xz, pulseaudio
+, networkmanager, kactivities, kdepimlibs, openexr, ilmbase
+}:
+
+kde {
+  buildInputs = [
+    kdelibs attica xz bzip2 libssh libjpeg exiv2 ntrack
+    qca2 samba (libcanberra.override { gtk = null; }) pulseaudio
+    networkmanager kactivities kdepimlibs openexr
+#todo: add openslp
+  ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
+
+  passthru.propagatedUserEnvPackages = [ virtuoso ];
+
+  meta = {
+    license = "LGPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kde-wallpapers.nix b/pkgs/desktops/kde-4.10/kde-wallpapers.nix
new file mode 100644
index 00000000000..6e559ad8a6c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-wallpapers.nix
@@ -0,0 +1,17 @@
+{ kde, cmake }:
+
+kde {
+  nativeBuildInputs = [ cmake ];
+
+  patches = [ ./files/kde-wallpapers-buildsystem.patch ];
+
+  cmakeFlags = "-DWALLPAPER_INSTALL_DIR=share/wallpapers";
+
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = "01k4rr7xkay5j0g8qwmfmvf4d0rjc9sdk121wravsagbidz3s9ci";
+
+  meta = {
+    description = "Wallpapers for KDE";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kde-workspace.nix b/pkgs/desktops/kde-4.10/kde-workspace.nix
new file mode 100644
index 00000000000..a478dc975fe
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kde-workspace.nix
@@ -0,0 +1,38 @@
+{ kde, kdelibs, qimageblitz, libdbusmenu_qt, xorg, shared_desktop_ontologies,
+  lm_sensors, pciutils, libraw1394, libusb, libxklavier, python, libqalculate,
+  xkeyboard_config, kdepimlibs, pam, boost, gpsd, prison, akonadi,
+  libjpeg, pkgconfig, libXft, libXxf86misc, kactivities, qjson, networkmanager
+}:
+
+kde {
+
+#todo: googlegadgets, consolekit, xmms
+  buildInputs =
+    [ kdelibs qimageblitz libdbusmenu_qt libjpeg xorg.libxcb xorg.xcbutilimage
+      xorg.xcbutilrenderutil libXft #libXxf86misc
+      xorg.libxkbfile xorg.libXcomposite  xorg.libXtst #xorg.libXScrnSaver
+      xorg.libXdamage xorg.libXau xorg.libXdmcp xorg.libpthreadstubs
+      boost gpsd lm_sensors pciutils libraw1394
+      libusb python libqalculate kdepimlibs pam prison akonadi qjson networkmanager
+      kactivities
+    ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  preConfigure =
+   ''
+     # Fix incorrect path to kde4-config.
+     substituteInPlace startkde.cmake --replace '$bindir/kde4-config' ${kdelibs}/bin/kde4-config
+
+     # Fix the path to the keyboard configuration files.
+     substituteInPlace kcontrol/keyboard/xkb_rules.cpp \
+       --replace /usr/share/X11 ${xkeyboard_config}/etc/X11
+   '';
+
+  enableParallelBuilding = false; # frequent problems on Hydra
+
+  meta = {
+    description = "KDE workspace components such as Plasma, Kwin and System Settings";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeaccessibility/jovie.nix b/pkgs/desktops/kde-4.10/kdeaccessibility/jovie.nix
new file mode 100644
index 00000000000..d38c80c4c36
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeaccessibility/jovie.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, speechd }:
+
+kde {
+  buildInputs = [ kdelibs speechd ];
+
+  meta = {
+    description = "Text-to-speech synthesis daemon";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeaccessibility/kaccessible.nix b/pkgs/desktops/kde-4.10/kdeaccessibility/kaccessible.nix
new file mode 100644
index 00000000000..98fae7c983f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeaccessibility/kaccessible.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, speechd }:
+
+kde {
+  buildInputs = [ kdelibs speechd ];
+
+  meta = {
+    description = "Bridge that provides accessibility services to applications";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeaccessibility/kmag.nix b/pkgs/desktops/kde-4.10/kdeaccessibility/kmag.nix
new file mode 100644
index 00000000000..606c61cddb6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeaccessibility/kmag.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+#todo: package qaccessibilityclient
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Screen magnifier for KDE";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeaccessibility/kmousetool.nix b/pkgs/desktops/kde-4.10/kdeaccessibility/kmousetool.nix
new file mode 100644
index 00000000000..8e0caa76ed9
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeaccessibility/kmousetool.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libXtst, libXt }:
+
+kde {
+  buildInputs = [ kdelibs libXtst libXt ];
+
+  meta = {
+    description = "A program that clicks the mouse for you";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeaccessibility/kmouth.nix b/pkgs/desktops/kde-4.10/kdeaccessibility/kmouth.nix
new file mode 100644
index 00000000000..4159501967c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeaccessibility/kmouth.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A type-and-say front end for speech synthesizers";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeadmin/kcron.nix b/pkgs/desktops/kde-4.10/kdeadmin/kcron.nix
new file mode 100644
index 00000000000..bada0c1cb10
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeadmin/kcron.nix
@@ -0,0 +1,5 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdeadmin/ksystemlog.nix b/pkgs/desktops/kde-4.10/kdeadmin/ksystemlog.nix
new file mode 100644
index 00000000000..bada0c1cb10
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeadmin/ksystemlog.nix
@@ -0,0 +1,5 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdeadmin/kuser.nix b/pkgs/desktops/kde-4.10/kdeadmin/kuser.nix
new file mode 100644
index 00000000000..571674a461a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeadmin/kuser.nix
@@ -0,0 +1,5 @@
+{ kde, kdelibs, kdepimlibs }:
+
+kde {
+  buildInputs = [ kdelibs kdepimlibs ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/ColorSchemes.nix b/pkgs/desktops/kde-4.10/kdeartwork/ColorSchemes.nix
new file mode 100644
index 00000000000..acccf66976f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/ColorSchemes.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde {
+  name = "kde-color-schemes";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Additional KDE color schemes";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/FindXscreensaver.cmake b/pkgs/desktops/kde-4.10/kdeartwork/FindXscreensaver.cmake
new file mode 100644
index 00000000000..499ed75268e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/FindXscreensaver.cmake
@@ -0,0 +1,73 @@
+#Macro to find xscreensaver directory
+
+# Copyright (c) 2006, Laurent Montel, <montel@kde.org>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+
+if (NOT XSCREENSAVER_FOUND)
+  FIND_PATH(XSCREENSAVER_DIR deco
+    HINTS
+      ${KDE4_INCLUDE_DIR}
+    PATHS
+      /usr
+      /usr/local
+      /opt/local
+      /usr/X11R6
+      /opt/kde
+      /opt/kde3
+      /usr/kde
+      /usr/local/kde
+      /usr/local/xscreensaver
+      /usr/openwin/lib/xscreensaver
+      /etc
+    PATH_SUFFIXES
+      lib${LIB_SUFFIX}/xscreensaver
+      lib${LIB_SUFFIX}/misc/xscreensaver
+      lib/xscreensaver
+      lib64/xscreensaver
+      lib/misc/xscreensaver
+      libexec/xscreensaver
+      bin/xscreensaver-hacks
+      hacks)
+  message(STATUS "XSCREENSAVER_DIR <${XSCREENSAVER_DIR}>")
+
+  FIND_PATH(XSCREENSAVER_CONFIG_DIR deco.xml
+    PATHS
+    ${KDE4_INCLUDE_DIR}
+    /usr/
+    /usr/local/
+    /opt/local/
+    /usr/X11R6/
+    /opt/kde/
+    /opt/kde3/
+    /usr/kde/
+    /usr/local/kde/
+    /usr/openwin/lib/xscreensaver/
+    /etc/
+    PATH_SUFFIXES xscreensaver xscreensaver/config share/xscreensaver/config
+  )
+  MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
+
+endif(NOT XSCREENSAVER_FOUND)
+
+#MESSAGE(STATUS "XSCREENSAVER_CONFIG_DIR :<${XSCREENSAVER_CONFIG_DIR}>")
+#MESSAGE(STATUS "XSCREENSAVER_DIR :<${XSCREENSAVER_DIR}>")
+
+# Need to fix hack
+if(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
+    set(XSCREENSAVER_FOUND TRUE)
+endif(XSCREENSAVER_DIR AND XSCREENSAVER_CONFIG_DIR)
+
+if (XSCREENSAVER_FOUND)
+  if (NOT Xscreensaver_FIND_QUIETLY)
+    message(STATUS "Found XSCREENSAVER_CONFIG_DIR <${XSCREENSAVER_CONFIG_DIR}>")
+  endif (NOT Xscreensaver_FIND_QUIETLY)
+else (XSCREENSAVER_FOUND)
+  if (Xscreensaver_FIND_REQUIRED)
+    message(FATAL_ERROR "XScreenSaver not found")
+  endif (Xscreensaver_FIND_REQUIRED)
+endif (XSCREENSAVER_FOUND)
+
+
+MARK_AS_ADVANCED(XSCREENSAVER_DIR XSCREENSAVER_CONFIG_DIR)
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/HighResolutionWallpapers.nix b/pkgs/desktops/kde-4.10/kdeartwork/HighResolutionWallpapers.nix
new file mode 100644
index 00000000000..edffca1562e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/HighResolutionWallpapers.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde rec {
+  name = "kde-wallpapers-high-resolution";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE wallpapers in high resolution";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/IconThemes.nix b/pkgs/desktops/kde-4.10/kdeartwork/IconThemes.nix
new file mode 100644
index 00000000000..43071e8bd14
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/IconThemes.nix
@@ -0,0 +1,13 @@
+{ kde, kdelibs }:
+
+kde {
+  name = "kdeartwork-icon-themes";
+
+  # Sources contain primary and kdeclassic as well but they're not installed
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE nuvola and mono icon themes";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/WeatherWallpapers.nix b/pkgs/desktops/kde-4.10/kdeartwork/WeatherWallpapers.nix
new file mode 100644
index 00000000000..947e5e17ab0
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/WeatherWallpapers.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde rec {
+  name = "kde-weather-wallpapers";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Additional KDE wallpapers (weather)";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/desktopthemes.nix b/pkgs/desktops/kde-4.10/kdeartwork/desktopthemes.nix
new file mode 100644
index 00000000000..93dd361af73
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/desktopthemes.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde {
+  name = "kde-desktop-themes";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Additional KDE desktop themes";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/emoticons.nix b/pkgs/desktops/kde-4.10/kdeartwork/emoticons.nix
new file mode 100644
index 00000000000..5ef9f78a719
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/emoticons.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde {
+  name = "kde-emotion-icons";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Additional KDE emotion icons (smiles)";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/kscreensaver.nix b/pkgs/desktops/kde-4.10/kdeartwork/kscreensaver.nix
new file mode 100644
index 00000000000..7028b9db228
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/kscreensaver.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, xscreensaver, kde_workspace, eigen, libkexiv2, libXt, pkgconfig }:
+
+kde {
+  buildInputs = [ kdelibs xscreensaver kde_workspace eigen libkexiv2 libXt ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  preConfigure = "cp -v ${./FindXscreensaver.cmake} cmake/modules/FindXscreensaver.cmake";
+
+  cmakeFlags = [ "-DBUILD_asciiquarium:BOOL=ON" ];
+
+  meta = {
+    description = "KDE screensavers";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/kwin-styles.nix b/pkgs/desktops/kde-4.10/kdeartwork/kwin-styles.nix
new file mode 100644
index 00000000000..b5d769b216d
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/kwin-styles.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, kde_workspace }:
+
+kde {
+  buildInputs = [ kdelibs kde_workspace ];
+
+  meta = {
+    description = "Styles for KWin";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/sounds.nix b/pkgs/desktops/kde-4.10/kdeartwork/sounds.nix
new file mode 100644
index 00000000000..e98705da889
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/sounds.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde rec {
+  name = "kde-sounds";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "New login/logout sounds";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/styles.nix b/pkgs/desktops/kde-4.10/kdeartwork/styles.nix
new file mode 100644
index 00000000000..6a1306c3710
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/styles.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde rec {
+  name = "kde-style-phase";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Phase, a widget style for KDE";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeartwork/wallpapers.nix b/pkgs/desktops/kde-4.10/kdeartwork/wallpapers.nix
new file mode 100644
index 00000000000..611c6a70f6b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeartwork/wallpapers.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs }:
+
+kde rec {
+  name = "kde-wallpapers";
+
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Additional KDE wallpapers";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdebindings/perlqt-include-smokeqt.patch b/pkgs/desktops/kde-4.10/kdebindings/perlqt-include-smokeqt.patch
new file mode 100644
index 00000000000..fd67860283b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/perlqt-include-smokeqt.patch
@@ -0,0 +1,19 @@
+commit 48b92b74bc6fd270c33a726257e2879203cf5064
+Author: Yury G. Kudryashov [diff odt] <urkud.urkud@gmail.com>
+Date:   Wed Mar 21 00:47:43 2012 +0400
+
+    Include SMOKE_QTCORE_INCLUDE_DIR
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 48020a1..2263a73 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -14,7 +14,7 @@ find_package(Smoke COMPONENTS QtCore QtGui QtNetwork Qt3Support QtDeclarative Qt
+                               QtOpenGl QtScript QtSql QtSvg QtTest QtUiTools QtWebKit QtXml QtXmlPatterns
+                               Phonon Qwt QSci QImageBlitz)
+                               
+-include_directories(${SMOKE_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/src)
++include_directories(${SMOKE_INCLUDE_DIR} ${SMOKE_QTCORE_INCLUDE_DIR} ${QT_INCLUDES} ${CMAKE_CURRENT_SOURCE_DIR}/src)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${SMOKE_CMAKE_MODULE_DIR})
+ include(MacroOptionalFindPackage)
+ include(MacroOptionalAddBindings)
diff --git a/pkgs/desktops/kde-4.10/kdebindings/perlqt-rewrite-FindPerlMore.patch b/pkgs/desktops/kde-4.10/kdebindings/perlqt-rewrite-FindPerlMore.patch
new file mode 100644
index 00000000000..c7f73815f54
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/perlqt-rewrite-FindPerlMore.patch
@@ -0,0 +1,118 @@
+commit e702abfd16f610e773fb0310d8c6512991794c63
+Author: Yury G. Kudryashov [diff odt] <urkud.urkud@gmail.com>
+Date:   Wed Mar 21 00:50:02 2012 +0400
+
+    Rewrite FindPerlMore.cmake
+    
+    * Ask perl for expanded paths
+    * Move execute_process to a macro
+    * Add PERL_*_INSTALL_DIR variables that point to CMAKE_INSTALL_PREFIX
+    
+    The last change makes it easy to install a file into CMAKE_INSTALL_PREFIX
+    instead of perl install prefix.Add debug message
+
+diff --git a/cmake/FindPerlMore.cmake b/cmake/FindPerlMore.cmake
+index 6412a47..cc8faf8 100644
+--- a/cmake/FindPerlMore.cmake
++++ b/cmake/FindPerlMore.cmake
+@@ -5,54 +5,52 @@
+ #
+ #  PERL_INCLUDE_PATH = path to where perl.h can be found
+ 
+-if(PERL_INCLUDE_PATH)
+-   # Already in cache, be silent
+-   SET(PERL_HEADERS_FOUND TRUE)
+-endif (PERL_INCLUDE_PATH)		
+-
+-IF(PERL_EXECUTABLE)
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{archlib}"
+-   		OUTPUT_VARIABLE PERL_ARCH_LIB_DIR)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{sitearch}"
+-   		OUTPUT_VARIABLE PERL_SITE_ARCH_DIR)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{vendorarch}"
+-   		OUTPUT_VARIABLE PERL_VENDOR_ARCH_DIR)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{sitelib}"
+-   		OUTPUT_VARIABLE PERL_SITE_LIB_DIR)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{vendorlib}"
+-   		OUTPUT_VARIABLE PERL_VENDOR_LIB_DIR)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{version}"
+-   		OUTPUT_VARIABLE PERL_VERSION)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{ccflags}"
+-   		OUTPUT_VARIABLE PERL_CXX_FLAGS)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{ccdlflags}"
+-   		OUTPUT_VARIABLE PERL_CCDL_FLAGS)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -MFile::Spec -e "print '-L' . File::Spec->catdir(\$Config{archlibexp}, 'CORE')"
+-   		OUTPUT_VARIABLE PERL_EXTRA_LIB_PATHS)
+-
+-	EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{perllibs}"
+-   		OUTPUT_VARIABLE PERL_LIBS)
+-
+-	FIND_PATH(PERL_INCLUDE_PATH 
+-  		NAMES perl.h
+-  		PATHS ${PERL_ARCH_LIB_DIR}/CORE
+-  	)
+-
+-	if(PERL_INCLUDE_PATH)
+-		SET(PERL_HEADERS_FOUND TRUE)
+-	endif (PERL_INCLUDE_PATH)
+-
+-	MARK_AS_ADVANCED(
+-	  PERL_INCLUDE_PATH
+-	  )
++if(FIND_PERLMORE_REQUIRED)
++  find_package(Perl REQUIRED)
++else()
++ find_package(Perl)
++endif()
++
++macro(_perl_get_config_var name output)
++  execute_process(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{${name}}"
++                  OUTPUT_VARIABLE PERL_${output})
++endmacro()
++
++macro(_perl_get_config_dir name)
++  string(TOLOWER ${name} _tmp)
++  string(REPLACE "_" "" _tmp ${_tmp})
++  _perl_get_config_var(${_tmp}exp ${name}_DIR)
++  string(REPLACE "${PERL_ROOT_DIR}" "${CMAKE_INSTALL_PREFIX}" PERL_${name}_INSTALL_DIR "${PERL_${name}_DIR}")
++endmacro()
++
++if(PERL_EXECUTABLE)
++  _perl_get_config_var(prefixexp ROOT_DIR)
++
++  _perl_get_config_dir(ARCH_LIB)
++  _perl_get_config_dir(SITE_ARCH)
++  _perl_get_config_dir(VENDOR_ARCH)
++  _perl_get_config_dir(SITE_LIB)
++  _perl_get_config_dir(VENDOR_LIB)
++
++  _perl_get_config_var(version VERSION)
++  _perl_get_config_var(ccflags CXX_FLAGS)
++  _perl_get_config_var(ccdlflags CCDL_FLAGS)
++
++  EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -MFile::Spec -e "print '-L' . File::Spec->catdir(\$Config{archlibexp}, 'CORE')"
++                  OUTPUT_VARIABLE PERL_EXTRA_LIB_PATHS)
++
++  _perl_get_config_var(perllibs LIBS)
++
++  FIND_PATH(PERL_INCLUDE_PATH
++            NAMES perl.h
++            HINTS ${PERL_ARCH_LIB_DIR}/CORE
++  )
++
++  if(PERL_INCLUDE_PATH)
++    SET(PERL_HEADERS_FOUND TRUE)
++  endif (PERL_INCLUDE_PATH)
++
++  MARK_AS_ADVANCED(PERL_INCLUDE_PATH)
+ ENDIF(PERL_EXECUTABLE)
+ 
+ IF(PERL_HEADERS_FOUND)
diff --git a/pkgs/desktops/kde-4.10/kdebindings/perlqt-use-site-arch-install-dir.patch b/pkgs/desktops/kde-4.10/kdebindings/perlqt-use-site-arch-install-dir.patch
new file mode 100644
index 00000000000..04f0c558677
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/perlqt-use-site-arch-install-dir.patch
@@ -0,0 +1,454 @@
+commit c78779fcaff587818ee37bec3ded5e0617625b95
+Author: Yury G. Kudryashov [diff odt] <urkud.urkud@gmail.com>
+Date:   Wed Mar 21 01:01:27 2012 +0400
+
+    Install to PERL_SITE_ARCH_INSTALL_DIR
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 48020a1..16188df 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,7 +36,6 @@ macro_log_feature(Qwt5_Qt4_FOUND "Qwt5 for Qt4" "Qwt5 libraries for Qt4" "http:/
+ add_definitions(-DDEBUG)
+ 
+ include (FindPerlMore)
+-set(CUSTOM_PERL_SITE_ARCH_DIR ${PERL_SITE_ARCH_DIR} CACHE DIR "Custom installation directory for perl binary extension")
+ 
+ # the RPATH to be used when installing, but only if it's not a system directory
+ GET_FILENAME_COMPONENT(SMOKE_LIB_DIR ${SMOKE_BASE_LIBRARY} PATH)
+diff --git a/INSTALL b/INSTALL
+index d19f97e..97cc9f1 100644
+--- a/INSTALL
++++ b/INSTALL
+@@ -36,7 +36,6 @@ ccmake step.
+ The standard options are:
+     CMAKE_BUILD_TYPE = The type of build ('Debug', 'Release', etc)
+     CMAKE_INSTALL_PREFIX = The location for any executables ( e.g. puic4 )
+-    CUSTOM_PERL_SITE_ARCH_DIR = The location for the perl modules themselves.
+     QT_QMAKE_EXECUTABLE = The path to your system's qmake.
+ 
+ cmake looks in your path for a qmake executable.  If it can't find it, it will
+diff --git a/Makefile.PL b/Makefile.PL
+index df9a13c..31dd912 100755
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -3,7 +3,7 @@
+ use strict;
+ use Config;
+ 
+-my ($prefix, $sitearch, $qmake) = ($Config{prefix}, $Config{sitearch});
++my ($prefix, $qmake) = ($Config{prefix});
+ my @cmakeArgs;
+ foreach my $arg (@ARGV) {
+     my $key = $arg;
+@@ -12,7 +12,6 @@ foreach my $arg (@ARGV) {
+     $value =~ s/^[^=]*=//g;
+     if ($key eq 'PREFIX' or $key eq 'INSTALL_BASE') {
+         $prefix = $value;
+-        $sitearch = "$prefix";
+     }
+     elsif ($key eq 'QMAKE') {
+         $qmake = $value;
+@@ -34,7 +33,6 @@ if($^O =~ /win/i){
+ }
+ push @args, "-DCMAKE_INSTALL_PREFIX=$prefix" if $prefix;
+ push @args, "-DQT_QMAKE_EXECUTABLE=$qmake" if $qmake;
+-push @args, "-DCUSTOM_PERL_SITE_ARCH_DIR=$sitearch" if $sitearch;
+ push @args, @cmakeArgs;
+ 
+ if ( eval "require Alien::SmokeQt" ) {
+diff --git a/phonon/lib/CMakeLists.txt b/phonon/lib/CMakeLists.txt
+index f2857c3..78674ea 100644
+--- a/phonon/lib/CMakeLists.txt
++++ b/phonon/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(phononpm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Phonon.pm ${CMAKE_BINARY_DIR}/blib/lib/Phonon.pm)
+-install(FILES Phonon.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES Phonon.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/phonon/src/CMakeLists.txt b/phonon/src/CMakeLists.txt
+index a04db11..9933dfd 100644
+--- a/phonon/src/CMakeLists.txt
++++ b/phonon/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_phonon
+ set_target_properties(perl_phonon PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_phonon PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_phonon DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_phonon DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qimageblitz/lib/CMakeLists.txt b/qimageblitz/lib/CMakeLists.txt
+index 0809ba8..22fc1c0 100644
+--- a/qimageblitz/lib/CMakeLists.txt
++++ b/qimageblitz/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qimageblitzpm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QImageBlitz.pm ${CMAKE_BINARY_DIR}/blib/lib/QImageBlitz.pm)
+-install(FILES QImageBlitz.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QImageBlitz.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qimageblitz/src/CMakeLists.txt b/qimageblitz/src/CMakeLists.txt
+index 02ef494..4f02c1b 100644
+--- a/qimageblitz/src/CMakeLists.txt
++++ b/qimageblitz/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qimageblitz
+ set_target_properties(perl_qimageblitz PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qimageblitz PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qimageblitz DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qimageblitz DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qsci/lib/CMakeLists.txt b/qsci/lib/CMakeLists.txt
+index 63b451f..d22869f 100644
+--- a/qsci/lib/CMakeLists.txt
++++ b/qsci/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qscipm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qsci.pm ${CMAKE_BINARY_DIR}/blib/lib/Qsci.pm)
+-install(FILES Qsci.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES Qsci.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qsci/src/CMakeLists.txt b/qsci/src/CMakeLists.txt
+index 8c1659b..bdcb5a8 100644
+--- a/qsci/src/CMakeLists.txt
++++ b/qsci/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qsci
+ set_target_properties(perl_qsci PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qsci PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qsci DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qsci DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qt3support/lib/CMakeLists.txt b/qt3support/lib/CMakeLists.txt
+index 2f04cfa..dda5afa 100644
+--- a/qt3support/lib/CMakeLists.txt
++++ b/qt3support/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qt3support4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qt3Support4.pm ${CMAKE_BINARY_DIR}/blib/lib/Qt3Support4.pm)
+-install(FILES Qt3Support4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES Qt3Support4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qt3support/src/CMakeLists.txt b/qt3support/src/CMakeLists.txt
+index b24532e..bed99aa 100644
+--- a/qt3support/src/CMakeLists.txt
++++ b/qt3support/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qt3support4
+ set_target_properties(perl_qt3support4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qt3support4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qt3support4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qt3support4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtcore/lib/CMakeLists.txt b/qtcore/lib/CMakeLists.txt
+index ef07d10..1d78196 100644
+--- a/qtcore/lib/CMakeLists.txt
++++ b/qtcore/lib/CMakeLists.txt
+@@ -1,3 +1,3 @@
+ add_subdirectory( QtCore4 )
+ add_custom_target(perlqtcore4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtCore4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtCore4.pm)
+-install( FILES QtCore4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR} )
++install( FILES QtCore4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR} )
+diff --git a/qtcore/lib/QtCore4/CMakeLists.txt b/qtcore/lib/QtCore4/CMakeLists.txt
+index 44c7893..06aef20 100644
+--- a/qtcore/lib/QtCore4/CMakeLists.txt
++++ b/qtcore/lib/QtCore4/CMakeLists.txt
+@@ -1,3 +1,3 @@
+-install( FILES signals.pm slots.pm isa.pm debug.pm classinfo.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/QtCore4 )
++install( FILES signals.pm slots.pm isa.pm debug.pm classinfo.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/QtCore4 )
+ add_custom_target(perlqt4pmlibmkdir ALL ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/blib/lib/QtCore4)
+ add_custom_target(perlqt4pmlibsubdir ALL ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_BINARY_DIR}/blib/lib/QtCore4)
+diff --git a/qtcore/src/CMakeLists.txt b/qtcore/src/CMakeLists.txt
+index 3910636..b5e645c 100644
+--- a/qtcore/src/CMakeLists.txt
++++ b/qtcore/src/CMakeLists.txt
+@@ -53,10 +53,10 @@ target_link_libraries(perlqtcore4
+ set_target_properties(perlqtcore4 PROPERTIES
+     OUTPUT_NAME ${libraryName}
+     PREFIX ""
+-    INSTALL_NAME_DIR ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/
++    INSTALL_NAME_DIR ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/
+ )
+ 
+-install(TARGETS perlqtcore4 EXPORT PerlQtExport DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perlqtcore4 EXPORT PerlQtExport DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+ install(FILES binding.h handlers.h listclass_macros.h marshall_basetypes.h marshall_complex.h
+               marshall.h marshall_macros.h marshall_primitives.h marshall_types.h perlqt.h ppport.h
+               QtCore4.h smokehelp.h smokeperl.h util.h
+diff --git a/qtdbus/lib/CMakeLists.txt b/qtdbus/lib/CMakeLists.txt
+index d03a672..a60d603 100644
+--- a/qtdbus/lib/CMakeLists.txt
++++ b/qtdbus/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtdbus4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtDBus4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtDBus4.pm)
+-install(FILES QtDBus4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtDBus4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtdbus/src/CMakeLists.txt b/qtdbus/src/CMakeLists.txt
+index 9aa05a0..5786ea2 100644
+--- a/qtdbus/src/CMakeLists.txt
++++ b/qtdbus/src/CMakeLists.txt
+@@ -31,4 +31,4 @@ target_link_libraries(perl_qtdbus4
+ set_target_properties(perl_qtdbus4 PROPERTIES OUTPUT_NAME "QtDBus4")
+ set_target_properties(perl_qtdbus4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtdbus4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/QtDBus4/)
++install(TARGETS perl_qtdbus4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/QtDBus4/)
+diff --git a/qtdeclarative/lib/CMakeLists.txt b/qtdeclarative/lib/CMakeLists.txt
+index e8d2847..b458858 100644
+--- a/qtdeclarative/lib/CMakeLists.txt
++++ b/qtdeclarative/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtdeclarative4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtDeclarative4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtDeclarative4.pm)
+-install(FILES QtDeclarative4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtDeclarative4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtdeclarative/src/CMakeLists.txt b/qtdeclarative/src/CMakeLists.txt
+index 1662167..ec2a8fc 100644
+--- a/qtdeclarative/src/CMakeLists.txt
++++ b/qtdeclarative/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtdeclarative4
+ set_target_properties(perl_qtdeclarative4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtdeclarative4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtdeclarative4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtdeclarative4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtgui/lib/CMakeLists.txt b/qtgui/lib/CMakeLists.txt
+index 82626c8..e62a4ac 100644
+--- a/qtgui/lib/CMakeLists.txt
++++ b/qtgui/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtgui4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtGui4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtGui4.pm)
+-install(FILES QtGui4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtGui4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtgui/src/CMakeLists.txt b/qtgui/src/CMakeLists.txt
+index 4cc8b36..44041b6 100644
+--- a/qtgui/src/CMakeLists.txt
++++ b/qtgui/src/CMakeLists.txt
+@@ -38,4 +38,4 @@ target_link_libraries(perl_qtgui4
+ set_target_properties(perl_qtgui4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtgui4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtgui4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtgui4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qthelp/lib/CMakeLists.txt b/qthelp/lib/CMakeLists.txt
+index dcf5ebe..da817d4 100644
+--- a/qthelp/lib/CMakeLists.txt
++++ b/qthelp/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qthelp4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtHelp4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtHelp4.pm)
+-install(FILES QtHelp4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtHelp4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qthelp/src/CMakeLists.txt b/qthelp/src/CMakeLists.txt
+index c00359d..689cb29 100644
+--- a/qthelp/src/CMakeLists.txt
++++ b/qthelp/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qthelp4
+ set_target_properties(perl_qthelp4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qthelp4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qthelp4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qthelp4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtmultimedia/lib/CMakeLists.txt b/qtmultimedia/lib/CMakeLists.txt
+index e55f697..5384539 100644
+--- a/qtmultimedia/lib/CMakeLists.txt
++++ b/qtmultimedia/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtmultimedia4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtMultimedia4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtMultimedia4.pm)
+-install(FILES QtMultimedia4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtMultimedia4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtmultimedia/src/CMakeLists.txt b/qtmultimedia/src/CMakeLists.txt
+index 0728aba..df8e552 100644
+--- a/qtmultimedia/src/CMakeLists.txt
++++ b/qtmultimedia/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtmultimedia4
+ set_target_properties(perl_qtmultimedia4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtmultimedia4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtmultimedia4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtmultimedia4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtnetwork/lib/CMakeLists.txt b/qtnetwork/lib/CMakeLists.txt
+index 12cd5dd..d1fb0e6 100644
+--- a/qtnetwork/lib/CMakeLists.txt
++++ b/qtnetwork/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtnetwork4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtNetwork4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtNetwork4.pm)
+-install(FILES QtNetwork4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtNetwork4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtnetwork/src/CMakeLists.txt b/qtnetwork/src/CMakeLists.txt
+index caf8327..0994d57 100644
+--- a/qtnetwork/src/CMakeLists.txt
++++ b/qtnetwork/src/CMakeLists.txt
+@@ -39,4 +39,4 @@ target_link_libraries(perl_qtnetwork4
+ set_target_properties(perl_qtnetwork4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtnetwork4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtnetwork4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtnetwork4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtopengl/lib/CMakeLists.txt b/qtopengl/lib/CMakeLists.txt
+index f3b5640..d8dc9e4 100644
+--- a/qtopengl/lib/CMakeLists.txt
++++ b/qtopengl/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtopengl4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtOpenGL4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtOpenGL4.pm)
+-install(FILES QtOpenGL4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtOpenGL4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtopengl/src/CMakeLists.txt b/qtopengl/src/CMakeLists.txt
+index 20493a9..777af89 100644
+--- a/qtopengl/src/CMakeLists.txt
++++ b/qtopengl/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtopengl4
+ set_target_properties(perl_qtopengl4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtopengl4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtopengl4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtopengl4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtscript/lib/CMakeLists.txt b/qtscript/lib/CMakeLists.txt
+index d21dbe5..320ff93 100644
+--- a/qtscript/lib/CMakeLists.txt
++++ b/qtscript/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtscript4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtScript4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtScript4.pm)
+-install(FILES QtScript4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtScript4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtscript/src/CMakeLists.txt b/qtscript/src/CMakeLists.txt
+index dd395be..6ff47d8 100644
+--- a/qtscript/src/CMakeLists.txt
++++ b/qtscript/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtscript4
+ set_target_properties(perl_qtscript4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtscript4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtscript4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtscript4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtsql/lib/CMakeLists.txt b/qtsql/lib/CMakeLists.txt
+index 59336d3..d9dd4d5 100644
+--- a/qtsql/lib/CMakeLists.txt
++++ b/qtsql/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtsql4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtSql4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtSql4.pm)
+-install(FILES QtSql4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtSql4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtsql/src/CMakeLists.txt b/qtsql/src/CMakeLists.txt
+index 3ec2028..59096ba 100644
+--- a/qtsql/src/CMakeLists.txt
++++ b/qtsql/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtsql4
+ set_target_properties(perl_qtsql4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtsql4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtsql4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtsql4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtsvg/lib/CMakeLists.txt b/qtsvg/lib/CMakeLists.txt
+index 33f6deb..bf1dc1f 100644
+--- a/qtsvg/lib/CMakeLists.txt
++++ b/qtsvg/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtsvg4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtSvg4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtSvg4.pm)
+-install(FILES QtSvg4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtSvg4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtsvg/src/CMakeLists.txt b/qtsvg/src/CMakeLists.txt
+index 11eccd2..449bf0f 100644
+--- a/qtsvg/src/CMakeLists.txt
++++ b/qtsvg/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtsvg4
+ set_target_properties(perl_qtsvg4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtsvg4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtsvg4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtsvg4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qttest/lib/CMakeLists.txt b/qttest/lib/CMakeLists.txt
+index 3bfa78c..5a8d8da 100644
+--- a/qttest/lib/CMakeLists.txt
++++ b/qttest/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qttest4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtTest4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtTest4.pm)
+-install(FILES QtTest4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtTest4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qttest/src/CMakeLists.txt b/qttest/src/CMakeLists.txt
+index 5492e55..d4662b1 100644
+--- a/qttest/src/CMakeLists.txt
++++ b/qttest/src/CMakeLists.txt
+@@ -38,4 +38,4 @@ target_link_libraries(perl_qttest4
+ set_target_properties(perl_qttest4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qttest4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qttest4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qttest4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtuitools/lib/CMakeLists.txt b/qtuitools/lib/CMakeLists.txt
+index 119e40e..3a5f472 100644
+--- a/qtuitools/lib/CMakeLists.txt
++++ b/qtuitools/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtuitools4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtUiTools4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtUiTools4.pm)
+-install(FILES QtUiTools4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtUiTools4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtuitools/src/CMakeLists.txt b/qtuitools/src/CMakeLists.txt
+index a8ae4a2..ecc079f 100644
+--- a/qtuitools/src/CMakeLists.txt
++++ b/qtuitools/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtuitools4
+ set_target_properties(perl_qtuitools4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtuitools4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtuitools4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtuitools4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtwebkit/lib/CMakeLists.txt b/qtwebkit/lib/CMakeLists.txt
+index a02f7ee..3846227 100644
+--- a/qtwebkit/lib/CMakeLists.txt
++++ b/qtwebkit/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtwebkit4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtWebKit4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtWebKit4.pm)
+-install(FILES QtWebKit4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtWebKit4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtwebkit/src/CMakeLists.txt b/qtwebkit/src/CMakeLists.txt
+index a6e00f8..dbebc44 100644
+--- a/qtwebkit/src/CMakeLists.txt
++++ b/qtwebkit/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtwebkit4
+ set_target_properties(perl_qtwebkit4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtwebkit4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtwebkit4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtwebkit4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtxml/lib/CMakeLists.txt b/qtxml/lib/CMakeLists.txt
+index 5505bc4..7db743c 100644
+--- a/qtxml/lib/CMakeLists.txt
++++ b/qtxml/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtxml4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtXml4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtXml4.pm)
+-install(FILES QtXml4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtXml4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtxml/src/CMakeLists.txt b/qtxml/src/CMakeLists.txt
+index 018508c..a351609 100644
+--- a/qtxml/src/CMakeLists.txt
++++ b/qtxml/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtxml4
+ set_target_properties(perl_qtxml4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtxml4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtxml4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtxml4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qtxmlpatterns/lib/CMakeLists.txt b/qtxmlpatterns/lib/CMakeLists.txt
+index a35f3df..3d86103 100644
+--- a/qtxmlpatterns/lib/CMakeLists.txt
++++ b/qtxmlpatterns/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qtxmlpatterns4pm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/QtXmlPatterns4.pm ${CMAKE_BINARY_DIR}/blib/lib/QtXmlPatterns4.pm)
+-install(FILES QtXmlPatterns4.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES QtXmlPatterns4.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qtxmlpatterns/src/CMakeLists.txt b/qtxmlpatterns/src/CMakeLists.txt
+index 9970a98..563e922 100644
+--- a/qtxmlpatterns/src/CMakeLists.txt
++++ b/qtxmlpatterns/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qtxmlpatterns4
+ set_target_properties(perl_qtxmlpatterns4 PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qtxmlpatterns4 PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qtxmlpatterns4 DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qtxmlpatterns4 DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
+diff --git a/qwt/lib/CMakeLists.txt b/qwt/lib/CMakeLists.txt
+index 0013c4d..d67ffbf 100644
+--- a/qwt/lib/CMakeLists.txt
++++ b/qwt/lib/CMakeLists.txt
+@@ -1,2 +1,2 @@
+ add_custom_target(qwtpm ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Qwt.pm ${CMAKE_BINARY_DIR}/blib/lib/Qwt.pm)
+-install(FILES Qwt.pm DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/)
++install(FILES Qwt.pm DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/)
+diff --git a/qwt/src/CMakeLists.txt b/qwt/src/CMakeLists.txt
+index 869d818..b644e80 100644
+--- a/qwt/src/CMakeLists.txt
++++ b/qwt/src/CMakeLists.txt
+@@ -37,4 +37,4 @@ target_link_libraries(perl_qwt
+ set_target_properties(perl_qwt PROPERTIES OUTPUT_NAME ${libraryName})
+ set_target_properties(perl_qwt PROPERTIES PREFIX "")
+ 
+-install(TARGETS perl_qwt DESTINATION ${CUSTOM_PERL_SITE_ARCH_DIR}/auto/${libraryName}/)
++install(TARGETS perl_qwt DESTINATION ${PERL_SITE_ARCH_INSTALL_DIR}/auto/${libraryName}/)
diff --git a/pkgs/desktops/kde-4.10/kdebindings/perlqt.nix b/pkgs/desktops/kde-4.10/kdebindings/perlqt.nix
new file mode 100644
index 00000000000..73d89155e28
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/perlqt.nix
@@ -0,0 +1,17 @@
+{ kde, cmake, smokeqt, perl }:
+
+kde {
+#todo: qscintilla2, qwt5
+  buildInputs = [ smokeqt perl ];
+  nativeBuildInputs = [ cmake ];
+
+  patches =
+    # The order is important
+    [ ./perlqt-include-smokeqt.patch ./perlqt-rewrite-FindPerlMore.patch
+      ./perlqt-use-site-arch-install-dir.patch
+    ];
+
+  meta = {
+    description = "Perl bindings for Qt library";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdebindings/pykde4-hardcode-lib-python.patch b/pkgs/desktops/kde-4.10/kdebindings/pykde4-hardcode-lib-python.patch
new file mode 100644
index 00000000000..e7a7cb4c661
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/pykde4-hardcode-lib-python.patch
@@ -0,0 +1,18 @@
+diff --git a/kpythonpluginfactory/CMakeLists.txt b/kpythonpluginfactory/CMakeLists.txt
+index 41fa0fe..642d867 100644
+--- a/kpythonpluginfactory/CMakeLists.txt
++++ b/kpythonpluginfactory/CMakeLists.txt
+@@ -3,7 +3,12 @@
+ set(kpythonpluginfactory_SRCS
+     kpythonpluginfactory.cpp)
+ 
+-GET_FILENAME_COMPONENT(LIB_PYTHON ${PYTHON_LIBRARY} NAME)
++option(HARDCODE_LIB_PYTHON_PATH "Whether the path to libpython.so should be hardcoded" OFF)
++if(HARDCODE_LIB_PYTHON_PATH)
++	get_filename_component(LIB_PYTHON ${PYTHON_LIBRARY} REALPATH)
++else(HARDCODE_LIB_PYTHON_PATH)
++    get_filename_component(LIB_PYTHON ${PYTHON_LIBRARY} NAME)
++endif(HARDCODE_LIB_PYTHON_PATH)
+ ADD_DEFINITIONS(-DLIB_PYTHON=\\"${LIB_PYTHON}\\")
+ ADD_DEFINITIONS(-DKDE_DEFAULT_DEBUG_AREA=15000)
+ 
diff --git a/pkgs/desktops/kde-4.10/kdebindings/pykde4.nix b/pkgs/desktops/kde-4.10/kdebindings/pykde4.nix
new file mode 100644
index 00000000000..7f6973c054b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/pykde4.nix
@@ -0,0 +1,34 @@
+{ kde, kdelibs, python, sip, pyqt4, kdepimlibs, shared_desktop_ontologies,
+  polkit_qt_1, boost, lndir, pkgconfig }:
+
+let pydir = "lib/python${python.majorVersion}"; in
+
+kde {
+
+  # todo: polkit isn't found by the build system
+
+  buildInputs = [
+    python kdepimlibs shared_desktop_ontologies
+    boost polkit_qt_1 pkgconfig
+  ];
+
+  propagatedBuildInputs = [ pyqt4 sip ];
+
+#  patches = [ ./pykde4-hardcode-lib-python.patch ];
+#  cmakeFlags = "-DHARDCODE_LIB_PYTHON_PATH=ON ";
+
+  preConfigure =
+    ''
+      # Symlink PyQt into PyKDE.  This is necessary because PyQt looks
+      # in its PyQt4/uic/widget-plugins directory for plugins, and KDE
+      # needs to install a plugin.
+      mkdir -pv $out/${pydir}
+      ${lndir}/bin/lndir ${pyqt4}/${pydir} $out/${pydir}
+      cmakeFlagsArray=( "-DSIP_DEFAULT_SIP_DIR=$prefix/share/sip" )
+    '';
+
+  meta = {
+    description = "Python bindings for KDE";
+    kde.name = "pykde4";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdebindings/qtruby-include-smokeqt.patch b/pkgs/desktops/kde-4.10/kdebindings/qtruby-include-smokeqt.patch
new file mode 100644
index 00000000000..7d20a3c1c0b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/qtruby-include-smokeqt.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 33078b4..1a6ad2e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -5,7 +5,7 @@ set(COMPILE_RUBY FALSE CACHE INTERNAL "")
+ find_package(Ruby REQUIRED)
+ find_package(Qt4 REQUIRED)
+ find_package(Smoke COMPONENTS QtCore QtGui QtXml QtOpenGl QtSql QtNetwork QtDbus QtSvg Phonon QSci QtDeclarative QtScript QtWebkit QtUiTools QtTest Qwt)
+-include_directories(${SMOKE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${QT_INCLUDES})
++include_directories(${SMOKE_INCLUDE_DIR} ${SMOKE_QTCORE_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/src ${QT_INCLUDES})
+ 
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SMOKE_CMAKE_MODULE_DIR})
+ include(MacroOptionalFindPackage)
diff --git a/pkgs/desktops/kde-4.10/kdebindings/qtruby-install-prefix.patch b/pkgs/desktops/kde-4.10/kdebindings/qtruby-install-prefix.patch
new file mode 100644
index 00000000000..bd95a0d8bd3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/qtruby-install-prefix.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 33078b4..30aec0e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -31,8 +31,8 @@ if (NOT COMPILE_RUBY)
+     return()
+ endif (NOT COMPILE_RUBY)
+ 
+-SET(CUSTOM_RUBY_SITE_ARCH_DIR ${RUBY_SITEARCH_DIR} CACHE DIR "custom installation directory for ruby binary extension" )
+-SET(CUSTOM_RUBY_SITE_LIB_DIR ${RUBY_SITELIB_DIR} CACHE DIR "custom installation directory for ruby extension" )
++string(REPLACE "${RUBY_ROOT_DIR}" "${CMAKE_INSTALL_PREFIX}" CUSTOM_RUBY_SITE_ARCH_DIR ${RUBY_SITEARCH_DIR})
++string(REPLACE "${RUBY_ROOT_DIR}" "${CMAKE_INSTALL_PREFIX}" CUSTOM_RUBY_SITE_LIB_DIR ${RUBY_SITELIB_DIR})
+ 
+ # compute an overall version number which can be compared at once
+ MATH(EXPR RUBY_VERSION_NUMBER "${RUBY_VERSION_MAJOR}*10000 + ${RUBY_VERSION_MINOR}*100 + ${RUBY_VERSION_PATCH}")
diff --git a/pkgs/desktops/kde-4.10/kdebindings/qtruby.nix b/pkgs/desktops/kde-4.10/kdebindings/qtruby.nix
new file mode 100644
index 00000000000..29faf2af15c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/qtruby.nix
@@ -0,0 +1,17 @@
+{ kde, cmake, smokeqt, ruby }:
+
+kde {
+#todo: scintilla2, qwt5
+  buildInputs = [ smokeqt ruby ];
+  nativeBuildInputs = [ cmake ];
+
+  # The second patch is not ready for upstream submmission. I should add an
+  # option() instead.
+  patches = [ ./qtruby-include-smokeqt.patch ./qtruby-install-prefix.patch ];
+
+  cmakeFlags="-DRUBY_ROOT_DIR=${ruby}";
+
+  meta = {
+    description = "Ruby bindings for Qt library";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdebindings/smokegen-nix.patch b/pkgs/desktops/kde-4.10/kdebindings/smokegen-nix.patch
new file mode 100644
index 00000000000..03df484b63e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/smokegen-nix.patch
@@ -0,0 +1,46 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 79945c4..a244d0f 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -32,10 +32,6 @@ set(generator_SRC
+     type.cpp
+ )
+ 
+-# force RPATH so that the binary is usable from within the build tree
+-set (CMAKE_SKIP_BUILD_RPATH FALSE)
+-set (CMAKE_SKIP_RPATH FALSE)
+-
+ configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in config.h @ONLY )
+ 
+ add_executable(smokegen ${generator_SRC})
+diff --git a/cmake/SmokeConfig.cmake.in b/cmake/SmokeConfig.cmake.in
+index 947315c..de8d66c 100644
+--- a/cmake/SmokeConfig.cmake.in
++++ b/cmake/SmokeConfig.cmake.in
+@@ -44,21 +44,19 @@ macro (find_smoke_component name)
+         set (SMOKE_${uppercase}_FOUND FALSE CACHE INTERNAL "")
+ 
+         find_path(SMOKE_${uppercase}_INCLUDE_DIR 
+-            ${lowercase}_smoke.h 
+-            PATH ${SMOKE_INCLUDE_DIR}
+-            NO_DEFAULT_PATH
++            ${lowercase}_smoke.h
++            HINTS ${SMOKE_INCLUDE_DIR}
++            PATH_SUFFIXES smoke
+             )
+         if(WIN32)
+ 		    # DLLs are in the bin directory.
+             find_library(SMOKE_${uppercase}_LIBRARY
+                 smoke${lowercase}
+-                PATHS "@CMAKE_INSTALL_PREFIX@/bin"
+-                NO_DEFAULT_PATH)
++                PATHS "@CMAKE_INSTALL_PREFIX@/bin")
+         else(WIN32)
+             find_library(SMOKE_${uppercase}_LIBRARY
+                 smoke${lowercase}
+-                PATHS "@SMOKE_LIBRARY_PREFIX@"
+-                NO_DEFAULT_PATH)
++                PATHS "@SMOKE_LIBRARY_PREFIX@")
+         endif(WIN32)
+ 
+         if (NOT SMOKE_${uppercase}_INCLUDE_DIR OR NOT SMOKE_${uppercase}_LIBRARY)
diff --git a/pkgs/desktops/kde-4.7/kdebindings/smokekde.nix b/pkgs/desktops/kde-4.10/kdebindings/smokegen.nix
index c49a77a48ed..8b5da2a641d 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/smokekde.nix
+++ b/pkgs/desktops/kde-4.10/kdebindings/smokegen.nix
@@ -1,7 +1,10 @@
-{ kde, kdelibs, smokeqt }:
+{ kde, qt4, cmake }:
 
 kde {
-  propagatedBuildInputs = [ kdelibs smokeqt ];
+  buildInputs = [ qt4 ];
+  nativeBuildInputs = [ cmake ];
+
+  patches = [ ./smokegen-nix.patch ];
 
   meta = {
     description = "C++ parser used to generate language bindings for Qt/KDE";
diff --git a/pkgs/desktops/kde-4.10/kdebindings/smokekde.nix b/pkgs/desktops/kde-4.10/kdebindings/smokekde.nix
new file mode 100644
index 00000000000..d129686b2de
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/smokekde.nix
@@ -0,0 +1,16 @@
+{ kde, cmake, smokeqt, kdelibs, akonadi, kdepimlibs, okular
+, shared_desktop_ontologies, attica }:
+
+kde {
+  # attica, akonadi and kdepimlibs are disabled due to smokegen crash
+  # okular is disabled because the code generated is broken
+  buildInputs = [
+    smokeqt kdelibs shared_desktop_ontologies
+  ];
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = "-DQTDEFINES_FILE=${smokeqt}/share/smokegen/qtdefines";
+  meta = {
+    description = "SMOKE bindings for kdelibs";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdebindings/smokeqt.nix b/pkgs/desktops/kde-4.10/kdebindings/smokeqt.nix
new file mode 100644
index 00000000000..e95b686aee2
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdebindings/smokeqt.nix
@@ -0,0 +1,13 @@
+{ kde, qt4, cmake, phonon, qimageblitz, smokegen }:
+
+kde {
+#todo: Qwt5, QScintilla2
+  propagatedBuildInputs = [ qt4 phonon qimageblitz ];
+  nativeBuildInputs = [ cmake ];
+  propagatedNativeBuildInputs = [ smokegen ];
+
+  meta = {
+    description = "C++ parser used to generate language bindings for Qt/KDE";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/analitza.nix b/pkgs/desktops/kde-4.10/kdeedu/analitza.nix
new file mode 100644
index 00000000000..74c3a1ebb20
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/analitza.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, readline }:
+kde {
+  buildInputs = [ kdelibs readline ];
+
+  meta = {
+    description = "Library part of KAlgebra";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/blinken.nix b/pkgs/desktops/kde-4.10/kdeedu/blinken.nix
new file mode 100644
index 00000000000..cdf9728833c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/blinken.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Memory Enhancement Game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/cantor.nix b/pkgs/desktops/kde-4.10/kdeedu/cantor.nix
new file mode 100644
index 00000000000..d2a1b095b82
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/cantor.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, libspectre, analitza, rLang, pkgconfig, gfortran, libqalculate }:
+kde {
+
+  buildInputs = [ kdelibs libspectre analitza rLang gfortran libqalculate];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "KDE Frontend to Mathematical Software";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kalgebra.nix b/pkgs/desktops/kde-4.10/kdeedu/kalgebra.nix
new file mode 100644
index 00000000000..3675c3a225f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kalgebra.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libkdeedu, analitza }:
+kde {
+  buildInputs = [ kdelibs libkdeedu analitza ];
+
+  meta = {
+    description = "2D and 3D Graph Calculator";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kalzium.nix b/pkgs/desktops/kde-4.10/kdeedu/kalzium.nix
new file mode 100644
index 00000000000..78fa8119583
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kalzium.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, facile, ocaml, eigen, openbabel, avogadro, pkgconfig }:
+kde {
+#todo:chemical mime data
+  buildInputs = [ kdelibs facile ocaml eigen openbabel avogadro ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "Periodic Table of Elements";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kanagram.nix b/pkgs/desktops/kde-4.10/kdeedu/kanagram.nix
new file mode 100644
index 00000000000..8759c96d78c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kanagram.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libkdeedu }:
+kde {
+  buildInputs = [ kdelibs libkdeedu ];
+
+  meta = {
+    description = "Letter Order Game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kbruch.nix b/pkgs/desktops/kde-4.10/kdeedu/kbruch.nix
new file mode 100644
index 00000000000..dc50f1e85a3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kbruch.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Practice Fractions";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kgeography.nix b/pkgs/desktops/kde-4.10/kdeedu/kgeography.nix
new file mode 100644
index 00000000000..bd8d27c8d6e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kgeography.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Geography Trainer";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/khangman.nix b/pkgs/desktops/kde-4.10/kdeedu/khangman.nix
new file mode 100644
index 00000000000..997b50e906a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/khangman.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libkdeedu }:
+kde {
+  buildInputs = [ kdelibs libkdeedu ];
+
+  meta = {
+    description = "KDE hangman game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kig.nix b/pkgs/desktops/kde-4.10/kdeedu/kig.nix
new file mode 100644
index 00000000000..bd5ef67529c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kig.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs, boost, python}:
+kde {
+  buildInputs = [ kdelibs boost python ];
+
+  cmakeFlags = ''
+    -DBOOST_PYTHON_INCLUDES:PATH=${boost}/include;${python}/include/${python.libPrefix}
+    -DBOOST_PYTHON_LIBS=boost_python;${python.libPrefix} -DKIG_ENABLE_PYTHON_SCRIPTING=1
+    '';
+  meta = {
+    description = "KDE Interactive Geometry";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kiten.nix b/pkgs/desktops/kde-4.10/kdeedu/kiten.nix
new file mode 100644
index 00000000000..939b7a9f77a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kiten.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Japanese Reference/Study Tool";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/klettres.nix b/pkgs/desktops/kde-4.10/kdeedu/klettres.nix
new file mode 100644
index 00000000000..7a0fa83078e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/klettres.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A KDE alphabet tutorial";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kmplot.nix b/pkgs/desktops/kde-4.10/kdeedu/kmplot.nix
new file mode 100644
index 00000000000..18458cf6f0b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kmplot.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A KDE mathematical function plotter";
+    kde = {
+      name = "kmplot";
+    };
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kstars.nix b/pkgs/desktops/kde-4.10/kdeedu/kstars.nix
new file mode 100644
index 00000000000..ce0a13b969d
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kstars.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, eigen, xplanet, indilib }:
+
+kde {
+#todo:wcslib
+  buildInputs = [ kdelibs eigen xplanet indilib ];
+
+  meta = {
+    description = "A KDE graphical desktop planetarium";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/ktouch.nix b/pkgs/desktops/kde-4.10/kdeedu/ktouch.nix
new file mode 100644
index 00000000000..9e606adde33
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/ktouch.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libxkbfile }:
+
+kde {
+  buildInputs = [ kdelibs libxkbfile ];
+
+  meta = {
+    description = "Touch Typing Tutor";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kturtle.nix b/pkgs/desktops/kde-4.10/kdeedu/kturtle.nix
new file mode 100644
index 00000000000..1e1922b1410
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kturtle.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Educational Programming Environment";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/kwordquiz.nix b/pkgs/desktops/kde-4.10/kdeedu/kwordquiz.nix
new file mode 100644
index 00000000000..1b33ba2e469
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/kwordquiz.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libkdeedu }:
+
+kde {
+  buildInputs = [ kdelibs libkdeedu ];
+
+  meta = {
+    description = "Flash Card Trainer";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/libkdeedu.nix b/pkgs/desktops/kde-4.10/kdeedu/libkdeedu.nix
new file mode 100644
index 00000000000..def6c85fefe
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/libkdeedu.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Libraries used by KDE Education applications";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/marble.nix b/pkgs/desktops/kde-4.10/kdeedu/marble.nix
new file mode 100644
index 00000000000..4f73472f631
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/marble.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, gpsd }:
+
+kde {
+#todo: package QextSerialPort, libshp(shapelib), QtMobility, QtLocation, libwlocate
+  buildInputs = [ kdelibs gpsd ];
+
+  meta = {
+    description = "Marble Virtual Globe";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/pairs.nix b/pkgs/desktops/kde-4.10/kdeedu/pairs.nix
new file mode 100644
index 00000000000..36c4aba9604
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/pairs.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A memory and pairs game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/parley.nix b/pkgs/desktops/kde-4.10/kdeedu/parley.nix
new file mode 100644
index 00000000000..f9f86dde150
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/parley.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libkdeedu, attica }:
+
+kde {
+  buildInputs = [ kdelibs libkdeedu attica ];
+
+  meta = {
+    description = "Vocabulary Trainer";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/rocs.nix b/pkgs/desktops/kde-4.10/kdeedu/rocs.nix
new file mode 100644
index 00000000000..91976b84001
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/rocs.nix
@@ -0,0 +1,14 @@
+{ kde, kdelibs, boost }:
+
+kde {
+  buildInputs = [ kdelibs (boost.override { enableExceptions = true; }) ];
+
+  NIX_CFLAGS_COMPILE = "-fexceptions";
+
+  meta = {
+    description = "A KDE graph theory viewer";
+    kde = {
+      name = "rocs";
+    };
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeedu/step.nix b/pkgs/desktops/kde-4.10/kdeedu/step.nix
new file mode 100644
index 00000000000..fac9974baf1
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeedu/step.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs, gsl, libqalculate, eigen }:
+
+kde {
+  buildInputs = [ kdelibs gsl libqalculate eigen ];
+
+  meta = {
+    description = "A KDE interactive physical simulator";
+    kde = {
+      name = "step";
+    };
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/bomber.nix b/pkgs/desktops/kde-4.10/kdegames/bomber.nix
new file mode 100644
index 00000000000..026227910f2
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/bomber.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a single player arcade game. The player is invading various cities in a plane that is decreasing in height";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/bovo.nix b/pkgs/desktops/kde-4.10/kdegames/bovo.nix
new file mode 100644
index 00000000000..b0e7d99c589
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/bovo.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a Gomoku (from Japanese 五目並㹠- lit. \"five points\") like game for two players, where the opponents alternate in placing their respective pictogram on the game board";
+  };
+
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/granatier.nix b/pkgs/desktops/kde-4.10/kdegames/granatier.nix
new file mode 100644
index 00000000000..9f1ab005309
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/granatier.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a clone of the classic Bomberman game, inspired by the work of the Clanbomber clone";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kajongg.nix b/pkgs/desktops/kde-4.10/kdegames/kajongg.nix
new file mode 100644
index 00000000000..9a6f5e83695
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kajongg.nix
@@ -0,0 +1,13 @@
+{ kde, kdelibs, libkdegames, pythonPackages, sqlite,  pykde4 }:
+kde rec {
+
+  buildInputs = [ kdelibs libkdegames pythonPackages.python pythonPackages.wrapPython sqlite ] ++ pythonPath;
+
+  pythonPath = [ pythonPackages.twisted pykde4 ];
+
+  postInstall = "wrapPythonPrograms";
+
+  meta = {
+    description = "an ancient Chinese board game for 4 players";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kapman.nix b/pkgs/desktops/kde-4.10/kdegames/kapman.nix
new file mode 100644
index 00000000000..f10e099da3c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kapman.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a clone of the well known game Pac-Man";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/katomic.nix b/pkgs/desktops/kde-4.10/kdegames/katomic.nix
new file mode 100644
index 00000000000..a9936c04f0e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/katomic.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a fun and educational puzzle game built around molecular geometry";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kblackbox.nix b/pkgs/desktops/kde-4.10/kdegames/kblackbox.nix
new file mode 100644
index 00000000000..27eeff2f65b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kblackbox.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a game of hide and seek played on an grid of boxes, where the player shoots rays into the grid to deduce the positions of hidden objects";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kblocks.nix b/pkgs/desktops/kde-4.10/kdegames/kblocks.nix
new file mode 100644
index 00000000000..98cf068de09
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kblocks.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a classic single player falling blocks puzzle game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kbounce.nix b/pkgs/desktops/kde-4.10/kdegames/kbounce.nix
new file mode 100644
index 00000000000..77fa0db6352
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kbounce.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a single player arcade game with the elements of puzzle";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kbreakout.nix b/pkgs/desktops/kde-4.10/kdegames/kbreakout.nix
new file mode 100644
index 00000000000..3a484d919bb
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kbreakout.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a Breakout-like game. Its object is to destroy as many bricks as possible without losing the ball";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kdiamond.nix b/pkgs/desktops/kde-4.10/kdegames/kdiamond.nix
new file mode 100644
index 00000000000..06dfcee5ac3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kdiamond.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a single player puzzle game. The object of the game is to build lines of three similar diamonds";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kfourinline.nix b/pkgs/desktops/kde-4.10/kdegames/kfourinline.nix
new file mode 100644
index 00000000000..11b8838e708
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kfourinline.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a board game for two players based on the Connect-Four game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kgoldrunner.nix b/pkgs/desktops/kde-4.10/kdegames/kgoldrunner.nix
new file mode 100644
index 00000000000..6217c47a806
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kgoldrunner.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "an action game where the hero runs through a maze, climbs stairs, dig holes and dodges enemies in order to collect all the gold nuggets and escape to the next level";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kigo.nix b/pkgs/desktops/kde-4.10/kdegames/kigo.nix
new file mode 100644
index 00000000000..32eee67cc1e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kigo.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "an open-source implementation of the popular Go game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/killbots.nix b/pkgs/desktops/kde-4.10/kdegames/killbots.nix
new file mode 100644
index 00000000000..d9c1472495e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/killbots.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple game of evading killer robots";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kiriki.nix b/pkgs/desktops/kde-4.10/kdegames/kiriki.nix
new file mode 100644
index 00000000000..72f7ab67501
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kiriki.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "an addictive and fun dice game, designed to be played by as many as six players";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kjumpingcube.nix b/pkgs/desktops/kde-4.10/kdegames/kjumpingcube.nix
new file mode 100644
index 00000000000..a6d22cff51c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kjumpingcube.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple dice driven tactical game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/klickety.nix b/pkgs/desktops/kde-4.10/kdegames/klickety.nix
new file mode 100644
index 00000000000..b592bc40641
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/klickety.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a puzzle game where the player removes groups of colored marbles to clear the board";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/klines.nix b/pkgs/desktops/kde-4.10/kdegames/klines.nix
new file mode 100644
index 00000000000..90952fe91c0
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/klines.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple but highly addictive one player game. The player has to move the colored balls around the game board, gathering them into the lines of the same color by five";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kmahjongg.nix b/pkgs/desktops/kde-4.10/kdegames/kmahjongg.nix
new file mode 100644
index 00000000000..946b531ff12
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kmahjongg.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames, libkmahjongg }:
+kde {
+  buildInputs = [ kdelibs libkdegames libkmahjongg ];
+  meta = {
+    description = "the tiles are scrambled and staked on top of each other to resemble a certain shape. The player is then expected to remove all the tiles off the game board by locating each tile's matching pair";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kmines.nix b/pkgs/desktops/kde-4.10/kdegames/kmines.nix
new file mode 100644
index 00000000000..538454e9598
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kmines.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a classic Minesweeper game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/knavalbattle.nix b/pkgs/desktops/kde-4.10/kdegames/knavalbattle.nix
new file mode 100644
index 00000000000..42ffd2fcb4d
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/knavalbattle.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a Battle Ship game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/knetwalk.nix b/pkgs/desktops/kde-4.10/kdegames/knetwalk.nix
new file mode 100644
index 00000000000..a16e578ce84
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/knetwalk.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a small game where you have to build up a computer network by rotating the wires to connect the terminals to the server";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kolf.nix b/pkgs/desktops/kde-4.10/kdegames/kolf.nix
new file mode 100644
index 00000000000..78815ee5799
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kolf.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a miniature golf game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kollision.nix b/pkgs/desktops/kde-4.10/kdegames/kollision.nix
new file mode 100644
index 00000000000..3147c7305ea
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kollision.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple ball dodging game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/konquest.nix b/pkgs/desktops/kde-4.10/kdegames/konquest.nix
new file mode 100644
index 00000000000..53ddd64928c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/konquest.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "the KDE version of Gnu-Lactic Konquest";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kpat.nix b/pkgs/desktops/kde-4.10/kdegames/kpat.nix
new file mode 100644
index 00000000000..f8d9bad36dc
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kpat.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a relaxing card sorting game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kreversi.nix b/pkgs/desktops/kde-4.10/kdegames/kreversi.nix
new file mode 100644
index 00000000000..2aed981428e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kreversi.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple one player strategy game played against the computer. If a player's piece is captured by an opposing player, that piece is turned over to reveal the color of that player";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kshisen.nix b/pkgs/desktops/kde-4.10/kdegames/kshisen.nix
new file mode 100644
index 00000000000..9c888034038
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kshisen.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames, libkmahjongg }:
+kde {
+  buildInputs = [ kdelibs libkdegames libkmahjongg ];
+  meta = {
+    description = "a solitaire-like game played using the standard set of Mahjong tiles";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/ksirk.nix b/pkgs/desktops/kde-4.10/kdegames/ksirk.nix
new file mode 100644
index 00000000000..767eb67971a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/ksirk.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames, qca2 }:
+kde {
+  buildInputs = [ kdelibs libkdegames qca2 ];
+  meta = {
+    description = "a computerized version of the well known strategic board game Risk";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/ksnakeduel.nix b/pkgs/desktops/kde-4.10/kdegames/ksnakeduel.nix
new file mode 100644
index 00000000000..ccf1fb551e9
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/ksnakeduel.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple Tron-Clone";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kspaceduel.nix b/pkgs/desktops/kde-4.10/kdegames/kspaceduel.nix
new file mode 100644
index 00000000000..5285f7916ca
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kspaceduel.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "each of two possible players control a satellite spaceship orbiting the sun. As the game progresses players have to eliminate the opponent's spacecraft with bullets or mines";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/ksquares.nix b/pkgs/desktops/kde-4.10/kdegames/ksquares.nix
new file mode 100644
index 00000000000..a17be2da632
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/ksquares.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a game modeled after the well known pen and paper based game of Dots and Boxes";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/ksudoku.nix b/pkgs/desktops/kde-4.10/kdegames/ksudoku.nix
new file mode 100644
index 00000000000..ea4e13a5e4f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/ksudoku.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a logic-based symbol placement puzzle";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/ktuberling.nix b/pkgs/desktops/kde-4.10/kdegames/ktuberling.nix
new file mode 100644
index 00000000000..1a6ba9d653c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/ktuberling.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a simple constructor game suitable for children and adults alike";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/kubrick.nix b/pkgs/desktops/kde-4.10/kdegames/kubrick.nix
new file mode 100644
index 00000000000..9bdc6879db4
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/kubrick.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a game based on the Rubik's Cubeâ„¢ puzzle";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/libkdegames.nix b/pkgs/desktops/kde-4.10/kdegames/libkdegames.nix
new file mode 100644
index 00000000000..3819dcdc9ae
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/libkdegames.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, openal, libsndfile }:
+kde {
+  buildInputs = [ kdelibs openal libsndfile ];
+  meta = {
+    description = "KDE games library";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/libkmahjongg.nix b/pkgs/desktops/kde-4.10/kdegames/libkmahjongg.nix
new file mode 100644
index 00000000000..383b347dc33
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/libkmahjongg.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a library for KMahjongg game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/lskat.nix b/pkgs/desktops/kde-4.10/kdegames/lskat.nix
new file mode 100644
index 00000000000..2a5050cd667
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/lskat.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a fun and engaging card game for two players, where the second player is either live opponent, or a built in artificial intelligence";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/palapeli.nix b/pkgs/desktops/kde-4.10/kdegames/palapeli.nix
new file mode 100644
index 00000000000..555ffe43c45
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/palapeli.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+#todo:package qvoronoi
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a single-player jigsaw puzzle game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegames/picmi.nix b/pkgs/desktops/kde-4.10/kdegames/picmi.nix
new file mode 100644
index 00000000000..165d7422f95
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegames/picmi.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkdegames }:
+kde {
+  buildInputs = [ kdelibs libkdegames ];
+  meta = {
+    description = "a single player logic-based puzzle game";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/gwenview.nix b/pkgs/desktops/kde-4.10/kdegraphics/gwenview.nix
new file mode 100644
index 00000000000..00910ab9d46
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/gwenview.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, exiv2, shared_desktop_ontologies, kde_baseapps, libkipi
+, libjpeg, libtiff, pkgconfig, kactivities, lcms2 }:
+
+kde {
+
+  buildInputs =
+    [ kdelibs exiv2 shared_desktop_ontologies kactivities kde_baseapps libkipi libjpeg lcms2 ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "Gwenview, the KDE image viewer";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kamera.nix b/pkgs/desktops/kde-4.10/kdegraphics/kamera.nix
new file mode 100644
index 00000000000..70904b17c23
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kamera.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libgphoto2 }:
+
+kde {
+  buildInputs = [ kdelibs libgphoto2 ];
+
+  meta = {
+    description = "KDE camera interface library";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kcolorchooser.nix b/pkgs/desktops/kde-4.10/kdegraphics/kcolorchooser.nix
new file mode 100644
index 00000000000..58528cb186b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kcolorchooser.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A small utility to select a color";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-mobipocket.nix b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-mobipocket.nix
new file mode 100644
index 00000000000..2c2ba3796a2
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-mobipocket.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, okular }:
+
+kde {
+  buildInputs = [ kdelibs okular ];
+
+  meta = {
+    description = "A collection of plugins to handle mobipocket files";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-strigi-analyzer.nix b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-strigi-analyzer.nix
new file mode 100644
index 00000000000..35af39aa611
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-strigi-analyzer.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libtiff }:
+
+kde {
+  buildInputs = [ kdelibs libtiff ];
+
+  meta = {
+    description = "Strigi analyzers for various graphics file formats";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-thumbnailers.nix b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-thumbnailers.nix
new file mode 100644
index 00000000000..55bf8309b2a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kdegraphics-thumbnailers.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libkexiv2, libkdcraw }:
+
+kde {
+  buildInputs = [ kdelibs libkexiv2 libkdcraw ];
+
+  meta = {
+    description = "Thumbnailers for various graphics file formats";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kgamma.nix b/pkgs/desktops/kde-4.10/kdegraphics/kgamma.nix
new file mode 100644
index 00000000000..28d9252187e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kgamma.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libXxf86vm }:
+
+kde {
+  buildInputs = [ kdelibs libXxf86vm ];
+
+  meta = {
+    description = "KDE monitor calibration tool";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kolourpaint.nix b/pkgs/desktops/kde-4.10/kdegraphics/kolourpaint.nix
new file mode 100644
index 00000000000..5276ec09f46
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kolourpaint.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, qimageblitz }:
+
+kde {
+  buildInputs = [ kdelibs qimageblitz ];
+
+  meta = {
+    description = "KDE paint program";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/kruler.nix b/pkgs/desktops/kde-4.10/kdegraphics/kruler.nix
new file mode 100644
index 00000000000..c5c2c6e05d7
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/kruler.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE screen ruler";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/ksaneplugin.nix b/pkgs/desktops/kde-4.10/kdegraphics/ksaneplugin.nix
new file mode 100644
index 00000000000..1381ed7dd26
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/ksaneplugin.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libksane }:
+
+kde {
+  buildInputs = [ kdelibs libksane ];
+
+  meta = {
+    description = "A KScan plugin that implements the scanning through libksane";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/ksnapshot.nix b/pkgs/desktops/kde-4.10/kdegraphics/ksnapshot.nix
new file mode 100644
index 00000000000..f01a609e20d
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/ksnapshot.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libkipi }:
+
+kde {
+  buildInputs = [ kdelibs libkipi ];
+
+  meta = {
+    description = "KDE screenshot utility";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/libkdcraw.nix b/pkgs/desktops/kde-4.10/kdegraphics/libkdcraw.nix
new file mode 100644
index 00000000000..e8790205cae
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/libkdcraw.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, libjpeg, lcms1, jasper }:
+
+kde {
+  buildInputs = [ kdelibs libjpeg lcms1 jasper ];
+
+  meta = {
+    description = "Library for decoding RAW images";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/libkexiv2.nix b/pkgs/desktops/kde-4.10/kdegraphics/libkexiv2.nix
new file mode 100644
index 00000000000..096b0a6e957
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/libkexiv2.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, exiv2 }:
+
+kde {
+  buildInputs = [ kdelibs exiv2 ];
+
+  meta = {
+    description = "Exiv2 support library";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/libkipi.nix b/pkgs/desktops/kde-4.10/kdegraphics/libkipi.nix
new file mode 100644
index 00000000000..6b16265e7a3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/libkipi.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Interface library to kipi-plugins";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/libksane.nix b/pkgs/desktops/kde-4.10/kdegraphics/libksane.nix
new file mode 100644
index 00000000000..b539eab3899
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/libksane.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, saneBackends }:
+
+kde {
+  buildInputs = [ kdelibs saneBackends ];
+
+  meta = {
+    description = "An image scanning library that provides a QWidget that contains all the logic needed to interface a sacanner";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/okular.nix b/pkgs/desktops/kde-4.10/kdegraphics/okular.nix
new file mode 100644
index 00000000000..efc1e8f0742
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/okular.nix
@@ -0,0 +1,17 @@
+{ chmlib, djvulibre, ebook_tools, kde, kdelibs, libspectre, popplerQt4, qca2
+, qimageblitz, libtiff, kactivities, pkgconfig }:
+
+kde {
+
+  #todo: package activeapp
+
+  buildInputs =
+    [ chmlib djvulibre ebook_tools kdelibs libspectre popplerQt4 qca2 qimageblitz libtiff kactivities ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "Okular, the KDE document viewer";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdegraphics/svgpart.nix b/pkgs/desktops/kde-4.10/kdegraphics/svgpart.nix
new file mode 100644
index 00000000000..a344cc4b4b4
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdegraphics/svgpart.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "SVG KPart";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdelibs/kdelibs.nix b/pkgs/desktops/kde-4.10/kdelibs/kdelibs.nix
new file mode 100644
index 00000000000..4386317309f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdelibs/kdelibs.nix
@@ -0,0 +1,43 @@
+{ kde, gcc, cmake, perl
+, qt4, bzip2, pcre, fam, libxml2, libxslt, shared_mime_info, giflib, jasper
+, openexr, avahi, kerberos, attr, shared_desktop_ontologies, libXScrnSaver
+, automoc4, strigi, soprano, qca2, attica, enchant, libdbusmenu_qt, grantlee
+, docbook_xml_dtd_42, docbook_xsl, polkit_qt_1
+, getopt, udev, herqq, phonon, libjpeg, xz, ilmbase
+, pkgconfig
+}:
+
+kde {
+  buildInputs =
+    [ pkgconfig attica avahi bzip2 enchant fam giflib grantlee herqq jasper
+      libdbusmenu_qt libXScrnSaver libxslt polkit_qt_1 qca2
+      shared_desktop_ontologies xz udev libjpeg kerberos openexr
+    ];
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
+
+  propagatedBuildInputs = [ qt4 soprano strigi phonon ];
+
+  propagatedNativeBuildInputs = [ automoc4 cmake perl shared_mime_info ];
+
+  # TODO: make sonnet plugins (dictionaries) really work.
+  # There are a few hardcoded paths.
+  # Split plugins from libs?
+
+  patches = [ ../files/polkit-install.patch ];
+
+  # cmake fails to find acl.h because of C++-style comment
+
+  cmakeFlags = [
+    "-DDOCBOOKXML_CURRENTDTD_DIR=${docbook_xml_dtd_42}/xml/dtd/docbook"
+    "-DDOCBOOKXSL_DIR=${docbook_xsl}/xml/xsl/docbook"
+    "-DHUPNP_ENABLED=ON"
+  ];
+
+  passthru.wantsUdisks2 = false;
+
+  meta = {
+    description = "KDE libraries";
+    license = "LGPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdelibs/nepomuk-core.nix b/pkgs/desktops/kde-4.10/kdelibs/nepomuk-core.nix
new file mode 100644
index 00000000000..cd6f3a179c2
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdelibs/nepomuk-core.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, soprano, shared_desktop_ontologies, exiv2, ffmpeg, taglib, popplerQt4 }:
+
+kde {
+
+  buildInputs = [ kdelibs soprano shared_desktop_ontologies taglib exiv2 ffmpeg popplerQt4 ];
+
+  meta = {
+    description = "NEPOMUK core";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdelibs/nepomuk-widgets.nix b/pkgs/desktops/kde-4.10/kdelibs/nepomuk-widgets.nix
new file mode 100644
index 00000000000..0d29a4f97de
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdelibs/nepomuk-widgets.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, nepomuk_core }:
+
+kde {
+
+  buildInputs = [ kdelibs nepomuk_core ];
+
+  meta = {
+    description = "NEPOMUK Widgets";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/audiocd-kio.nix b/pkgs/desktops/kde-4.10/kdemultimedia/audiocd-kio.nix
new file mode 100644
index 00000000000..4c56e7529dd
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/audiocd-kio.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libkcompactdisc, cdparanoia, libkcddb, libvorbis, flac, lame }:
+kde {
+  buildInputs = [ kdelibs libkcompactdisc cdparanoia libkcddb libvorbis flac lame ];
+  meta = {
+    description = "transparent audio CD access for applications using the KDE Platform";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/dragon.nix b/pkgs/desktops/kde-4.10/kdemultimedia/dragon.nix
new file mode 100644
index 00000000000..006300742ec
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/dragon.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+  meta = {
+    description = "a multimedia player with the focus on simplicity";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/ffmpegthumbs.nix b/pkgs/desktops/kde-4.10/kdemultimedia/ffmpegthumbs.nix
new file mode 100644
index 00000000000..45f6c9abcb6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/ffmpegthumbs.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, ffmpeg }:
+kde {
+  buildInputs = [ kdelibs ffmpeg ];
+  meta = {
+    description = "a video thumbnail generator for KDE file managers like Dolphin and Konqueror";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/juk.nix b/pkgs/desktops/kde-4.10/kdemultimedia/juk.nix
new file mode 100644
index 00000000000..7a1aab85ed7
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/juk.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, taglib }:
+kde {
+  buildInputs = [ kdelibs taglib ];
+  meta = {
+    description = "an audio jukebox application";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/kmix.nix b/pkgs/desktops/kde-4.10/kdemultimedia/kmix.nix
new file mode 100644
index 00000000000..1dd8108166f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/kmix.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libcanberra, pulseaudio }:
+kde {
+  buildInputs = [ kdelibs libcanberra pulseaudio ];
+  meta = {
+    description = "sound mixer, an application to allow you to change the volume of your sound card";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/kscd.nix b/pkgs/desktops/kde-4.10/kdemultimedia/kscd.nix
new file mode 100644
index 00000000000..e99ae53935b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/kscd.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libmusicbrainz }:
+kde {
+  buildInputs = [ kdelibs libmusicbrainz ];
+  meta = {
+    description = "KDE CD player";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/libkcddb.nix b/pkgs/desktops/kde-4.10/kdemultimedia/libkcddb.nix
new file mode 100644
index 00000000000..720b01d1861
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/libkcddb.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs }:
+kde {
+#todo: libmusicbrainz5
+  buildInputs = [ kdelibs ];
+  meta = {
+    description = "a library used to retrieve audio CD meta data from the internet";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/libkcompactdisc.nix b/pkgs/desktops/kde-4.10/kdemultimedia/libkcompactdisc.nix
new file mode 100644
index 00000000000..6ed08af89f3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/libkcompactdisc.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+  meta = {
+    description = "KDE library for playing & ripping CDs";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdemultimedia/mplayerthumbs.nix b/pkgs/desktops/kde-4.10/kdemultimedia/mplayerthumbs.nix
new file mode 100644
index 00000000000..c88ebcc2a5a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdemultimedia/mplayerthumbs.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+kde {
+  buildInputs = [ kdelibs ];
+  meta = {
+    description = "a video thumbnail generator for KDE";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/FindmsiLBC.cmake b/pkgs/desktops/kde-4.10/kdenetwork/FindmsiLBC.cmake
new file mode 100644
index 00000000000..c40b0bed310
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/FindmsiLBC.cmake
@@ -0,0 +1,19 @@
+# cmake macro to test msiLBC
+
+# Copyright (c) 2009-2010 Pali Rohár <pali.rohar@gmail.com>
+#
+# MSILBC_FOUND
+# MSILBC_LIBRARY
+
+include ( FindPackageHandleStandardArgs )
+
+if ( MSILBC_LIBRARY )
+	set ( MSILBC_FOUND true )
+	set ( msiLBC_FIND_QUIETLY true )
+else ( MSILBC_LIBRARY )
+	find_library ( MSILBC_LIBRARY NAMES msilbc
+		PATH_SUFFIXES mediastreamer/plugins)
+endif ( MSILBC_LIBRARY )
+
+find_package_handle_standard_args ( msiLBC DEFAULT_MSG MSILBC_LIBRARY )
+mark_as_advanced ( MSILBC_LIBRARY )
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/filesharing.nix b/pkgs/desktops/kde-4.10/kdenetwork/filesharing.nix
new file mode 100644
index 00000000000..2f32f4d6b2c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/filesharing.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kdenetwork.patch b/pkgs/desktops/kde-4.10/kdenetwork/kdenetwork.patch
new file mode 100644
index 00000000000..ebadbfad9ba
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kdenetwork.patch
@@ -0,0 +1,24 @@
+diff -r -u kdenetwork-4.7.1.orig/CMakeLists.txt kdenetwork-4.7.1/CMakeLists.txt
+--- kdenetwork-4.7.1.orig/CMakeLists.txt	2011-03-29 15:25:42.174521812 +0400
++++ kdenetwork-4.7.1/CMakeLists.txt	2011-03-29 15:27:43.268140322 +0400
+@@ -28,7 +28,8 @@
+    set(CMAKE_REQUIRED_INCLUDES  ${KDEWIN_INCLUDES} )
+ endif (WIN32)
+ 
+-find_package(KdepimLibs REQUIRED)
++macro_optional_find_package(KdepimLibs)
++macro_log_feature(KDEPIMLIBS_FOUND "KDEPimLibs" "KDE pim-related libraries" "http://pim.kde.org.org/" FALSE "" "Required for Kopete")
+ # find_package(X11VidMode) not used at this time
+ 
+ # NX support is not ready for KDE 4.2; disabled (uwolfer)
+@@ -79,7 +80,9 @@
+ macro_optional_add_subdirectory(kfile-plugins)
+ macro_optional_add_subdirectory(kget)
+ 
+-macro_optional_add_subdirectory(kopete)
++if(KDEPIMLIBS_FOUND)
++  macro_optional_add_subdirectory(kopete)
++endif(KDEPIMLIBS_FOUND)
+ 
+ if(Q_WS_X11)
+   macro_optional_add_subdirectory(krdc)
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kdnssd.nix b/pkgs/desktops/kde-4.10/kdenetwork/kdnssd.nix
new file mode 100644
index 00000000000..2f32f4d6b2c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kdnssd.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kfile-plugins.nix b/pkgs/desktops/kde-4.10/kdenetwork/kfile-plugins.nix
new file mode 100644
index 00000000000..f90fd356079
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kfile-plugins.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, boost }:
+
+kde {
+  name = "strigi-analyzer-torrent";
+
+  buildInputs = [ kdelibs boost ];
+
+  preConfigure = "mv -v strigi-analyzer kfile-plugins";
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kget.nix b/pkgs/desktops/kde-4.10/kdenetwork/kget.nix
new file mode 100644
index 00000000000..25028ef974e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kget.nix
@@ -0,0 +1,17 @@
+{ kde, kdelibs, libktorrent, kde_workspace, kdepimlibs, sqlite
+, shared_desktop_ontologies, kde_baseapps, gpgme, boost, libmms, qca2 }:
+
+kde {
+  buildInputs =
+    [ kdelibs libktorrent
+#kde_workspace 
+shared_desktop_ontologies 
+#kdepimlibs
+#      kde_baseapps 
+gpgme boost libmms qca2 sqlite
+    ];
+
+  KDEDIRS = libktorrent;
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kopete.nix b/pkgs/desktops/kde-4.10/kdenetwork/kopete.nix
new file mode 100644
index 00000000000..3907b67c42a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kopete.nix
@@ -0,0 +1,28 @@
+{ kde, kdelibs, speex, libmsn, libotr, kdepimlibs, qimageblitz, libktorrent,
+  jasper, libidn, mediastreamer, msilbc, pkgconfig, libxslt, giflib,
+  libgadu, boost, qca2, gpgme, sqlite, telepathy_qt, shared_desktop_ontologies,
+  libjpeg, libmms }:
+
+kde {
+#todo: libmeanwhile, xmms
+  buildInputs = [
+    kdelibs telepathy_qt shared_desktop_ontologies qca2 gpgme libgadu mediastreamer
+    kdepimlibs qimageblitz libktorrent libjpeg sqlite jasper giflib libmsn libotr
+    libxslt libidn speex boost libmms msilbc
+];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  KDEDIRS = libktorrent;
+
+  patchPhase =
+    ''
+      cp -v ${./FindmsiLBC.cmake} kopete/cmake/modules/FindmsiLBC.cmake
+    '';
+
+  cmakeFlags = [ "-DBUILD_skypebuttons=TRUE" ];
+
+  meta = {
+    description = "A KDE multi-protocol IM client";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/kppp.nix b/pkgs/desktops/kde-4.10/kdenetwork/kppp.nix
new file mode 100644
index 00000000000..2f32f4d6b2c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/kppp.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/krdc.nix b/pkgs/desktops/kde-4.10/kdenetwork/krdc.nix
new file mode 100644
index 00000000000..1f3ba36aaa1
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/krdc.nix
@@ -0,0 +1,8 @@
+{ kde, kdelibs, libvncserver, libjpeg }:
+
+kde {
+
+  buildInputs = [ kdelibs libvncserver libjpeg ];
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdenetwork/krfb.nix b/pkgs/desktops/kde-4.10/kdenetwork/krfb.nix
new file mode 100644
index 00000000000..80013f430d3
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdenetwork/krfb.nix
@@ -0,0 +1,7 @@
+{ kde, kdelibs, libvncserver, libXdamage, libXtst }:
+
+kde {
+  buildInputs = [ kdelibs libvncserver libXdamage libXtst];
+
+  patches = [ ./kdenetwork.patch ];
+}
diff --git a/pkgs/desktops/kde-4.10/kdepim-runtime.nix b/pkgs/desktops/kde-4.10/kdepim-runtime.nix
new file mode 100644
index 00000000000..8fdd9fc8fa1
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdepim-runtime.nix
@@ -0,0 +1,14 @@
+{ kde, fetchurl, cmake, kdelibs, libxslt, boost, kdepimlibs, akonadi
+, shared_desktop_ontologies }:
+
+kde {
+  buildInputs = [
+    kdepimlibs akonadi boost shared_desktop_ontologies
+    libxslt
+  ];
+#todo: libkgapi, libkolab, libkolabxml
+  meta = {
+    description = "KDE PIM runtime";
+    license = "GPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdepim.nix b/pkgs/desktops/kde-4.10/kdepim.nix
new file mode 100644
index 00000000000..dca60d3d4b6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdepim.nix
@@ -0,0 +1,22 @@
+{ kde, boost, gpgme, libassuan, libxslt, kdepimlibs, kdepim_runtime
+, akonadi, shared_desktop_ontologies, cyrus_sasl, grantlee, prison
+, nepomuk_widgets, dblatex }:
+
+kde {
+
+  buildInputs =
+    [ kdepimlibs boost akonadi shared_desktop_ontologies nepomuk_widgets
+      libxslt cyrus_sasl gpgme libassuan grantlee prison dblatex
+    ];
+
+  passthru.propagatedUserEnvPackages = [ akonadi kdepimlibs kdepim_runtime ];
+
+  meta = {
+    description = "KDE PIM tools";
+    longDescription = ''
+      Contains various personal information management tools for KDE, such as an organizer.
+    '';
+    license = "GPL";
+    homepage = http://pim.kde.org;
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdepimlibs.nix b/pkgs/desktops/kde-4.10/kdepimlibs.nix
new file mode 100644
index 00000000000..c9813b19f52
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdepimlibs.nix
@@ -0,0 +1,17 @@
+{ kde, boost, cyrus_sasl, gpgme, libical, openldap, shared_mime_info
+, kdelibs, akonadi, libxslt, prison, nepomuk_core
+, shared_desktop_ontologies, qjson }:
+
+kde {
+  buildInputs =
+    [ boost gpgme libical libxslt qjson
+      openldap cyrus_sasl akonadi shared_desktop_ontologies
+    ];
+
+  propagatedBuildInputs = [ kdelibs nepomuk_core ];
+
+  meta = {
+    description = "KDE PIM libraries";
+    license = "LGPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeplasma-addons.nix b/pkgs/desktops/kde-4.10/kdeplasma-addons.nix
new file mode 100644
index 00000000000..2bd6f5037db
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeplasma-addons.nix
@@ -0,0 +1,22 @@
+{ kde, kdelibs, marble, shared_desktop_ontologies, pkgconfig
+, boost, eigen, kde_workspace, attica, python, qca2, qimageblitz
+, kdepimlibs, libkexiv2, libqalculate, libXtst, libdbusmenu_qt
+, qjson, qoauth }:
+# TODO: qwt, scim, ibus
+
+kde {
+
+  KDEDIRS=marble;
+
+  buildInputs = [ kdelibs boost kde_workspace kdepimlibs attica qjson qoauth
+    eigen qca2 libXtst qimageblitz
+    libqalculate shared_desktop_ontologies marble libkexiv2 libdbusmenu_qt
+];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "KDE Plasma Addons";
+    license = "GPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/cervisia.nix b/pkgs/desktops/kde-4.10/kdesdk/cervisia.nix
new file mode 100644
index 00000000000..1dabe46cd42
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/cervisia.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A KDE CVS frontend";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-bazaar.nix b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-bazaar.nix
new file mode 100644
index 00000000000..500dffc809e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-bazaar.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, kde_baseapps }:
+
+kde {
+
+  # Needs kdebase for libkonq
+  buildInputs = [ kdelibs kde_baseapps ];
+
+  patchPhase = ''
+    sed -i 's@macro_optional_add_subdirectory(bazaar)@add_subdirectory(bazaar)@' dolphin-plugins/CMakeLists.txt
+  '';
+
+  meta = {
+    description = "Bazaar plugin for dolphin";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-git.nix b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-git.nix
new file mode 100644
index 00000000000..2da3603c3be
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-git.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, kde_baseapps }:
+
+kde {
+
+  # Needs kdebase for libkonq
+  buildInputs = [ kdelibs kde_baseapps ];
+
+  patchPhase = ''
+    sed -i 's@macro_optional_add_subdirectory(git)@add_subdirectory(git)@' dolphin-plugins/CMakeLists.txt
+  '';
+
+  meta = {
+    description = "Git plugin for dolphin";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-hg.nix b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-hg.nix
new file mode 100644
index 00000000000..20925842a32
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-hg.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, kde_baseapps }:
+
+kde {
+
+  # Needs kdebase for libkonq
+  buildInputs = [ kdelibs kde_baseapps ];
+
+  patchPhase = ''
+    sed -i 's@macro_optional_add_subdirectory(hg)@add_subdirectory(hg)@' dolphin-plugins/CMakeLists.txt
+  '';
+
+  meta = {
+    description = "Mercurial plugin for dolphin";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-svn.nix b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-svn.nix
new file mode 100644
index 00000000000..fafdcc55a1f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/dolphin-plugins-svn.nix
@@ -0,0 +1,15 @@
+{ kde, kdelibs, kde_baseapps }:
+
+kde {
+
+  # Needs kdebase for libkonq
+  buildInputs = [ kdelibs kde_baseapps ];
+
+  patchPhase = ''
+    sed -i 's@macro_optional_add_subdirectory(svn)@add_subdirectory(svn)@' dolphin-plugins/CMakeLists.txt
+  '';
+
+  meta = {
+    description = "Svn plugin for dolphin";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kapptemplate.nix b/pkgs/desktops/kde-4.10/kdesdk/kapptemplate.nix
new file mode 100644
index 00000000000..391536248dd
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kapptemplate.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A KDE 4 project template generator";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kcachegrind.nix b/pkgs/desktops/kde-4.10/kdesdk/kcachegrind.nix
new file mode 100644
index 00000000000..65d410cca48
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kcachegrind.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE Frontend for Callgrind/Cachegrind";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kde-dev-scripts.nix b/pkgs/desktops/kde-4.10/kdesdk/kde-dev-scripts.nix
new file mode 100644
index 00000000000..df81145e5d6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kde-dev-scripts.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Various scripts to ease KDE development";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kde-dev-utils.nix b/pkgs/desktops/kde-4.10/kdesdk/kde-dev-utils.nix
new file mode 100644
index 00000000000..85b6ea6ac00
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kde-dev-utils.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, gcc }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  preConfigure = "export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:${gcc}:${gcc.gcc}";
+
+  meta = {
+    description = "various KDE development utilities";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kdesdk-strigi-analyzers.nix b/pkgs/desktops/kde-4.10/kdesdk/kdesdk-strigi-analyzers.nix
new file mode 100644
index 00000000000..4d579b88ba8
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kdesdk-strigi-analyzers.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Strigi analyzers for diff, po and ts";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kdesdk-thumbnailers.nix b/pkgs/desktops/kde-4.10/kdesdk/kdesdk-thumbnailers.nix
new file mode 100644
index 00000000000..f96b0df2b95
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kdesdk-thumbnailers.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs, gettext }:
+
+kde {
+
+  buildInputs = [ kdelibs gettext ];
+
+  patches = [ ./thumbnailers-add-subdirectory.patch ];
+
+  meta = {
+    description = "PO file format thumbnailer";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kioslave-perldoc.nix b/pkgs/desktops/kde-4.10/kdesdk/kioslave-perldoc.nix
new file mode 100644
index 00000000000..4c45be6b4fe
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kioslave-perldoc.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs, perl }:
+
+kde {
+
+  buildInputs = [ kdelibs perl ];
+
+  cmakeFlags = [ "-DBUILD_perldoc=ON" ];
+
+  meta = {
+    description = "perldoc: kioslave";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kioslave-svn.nix b/pkgs/desktops/kde-4.10/kdesdk/kioslave-svn.nix
new file mode 100644
index 00000000000..0574241353d
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kioslave-svn.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs, subversionClient, apr, aprutil }:
+
+kde {
+
+  buildInputs = [ kdelibs subversionClient apr aprutil ];
+
+  meta = {
+    description = "Subversion kioslave";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/kompare.nix b/pkgs/desktops/kde-4.10/kdesdk/kompare.nix
new file mode 100644
index 00000000000..1ddb4b8ea5b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/kompare.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A program to view the differences between files and optionally generate a diff";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/lokalize.nix b/pkgs/desktops/kde-4.10/kdesdk/lokalize.nix
new file mode 100644
index 00000000000..1565426eb1f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/lokalize.nix
@@ -0,0 +1,13 @@
+{ kde, kdelibs, hunspell }:
+
+kde {
+  buildInputs = [ kdelibs hunspell ];
+
+  meta = {
+    description = "KDE 4 Computer-aided translation system";
+    longDescription = ''
+      Computer-aided translation system.
+      Do not translate what had already been translated.
+    '';
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/okteta.nix b/pkgs/desktops/kde-4.10/kdesdk/okteta.nix
new file mode 100644
index 00000000000..058636596ad
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/okteta.nix
@@ -0,0 +1,13 @@
+{ kde, kdelibs, qca2 }:
+
+kde {
+  buildInputs = [ kdelibs qca2 ];
+
+# TODO: Look what does -DBUILD_mobile add
+
+  enableParallelBuilding = false;
+
+  meta = {
+    description = "KDE byte editor";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/poxml.nix b/pkgs/desktops/kde-4.10/kdesdk/poxml.nix
new file mode 100644
index 00000000000..1ab9ed49df5
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/poxml.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, antlr }:
+
+kde {
+  buildInputs = [ kdelibs antlr ];
+
+  meta = {
+    description = "Po<->xml tools";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdesdk/thumbnailers-add-subdirectory.patch b/pkgs/desktops/kde-4.10/kdesdk/thumbnailers-add-subdirectory.patch
new file mode 100644
index 00000000000..5b4f7643bf4
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/thumbnailers-add-subdirectory.patch
@@ -0,0 +1,12 @@
+diff -Naur kdesdk-4.10.2-upstream/kdesdk-thumbnailers/CMakeLists.txt kdesdk-4.10.2/kdesdk-thumbnailers/CMakeLists.txt
+--- kdesdk-4.10.2-upstream/kdesdk-thumbnailers/CMakeLists.txt	2013-05-02 21:05:56.446226846 -0430
++++ kdesdk-4.10.2/kdesdk-thumbnailers/CMakeLists.txt	2013-05-02 21:09:58.504053136 -0430
+@@ -9,7 +9,7 @@
+ macro_log_feature(GETTEXTPO_FOUND "gettext-po" "A library for processing PO files" "www.gnu.org/software/gettext" FALSE "" "Required to build the PO thumbnailer")
+ 
+ if(GETTEXTPO_FOUND)
+-macro_optional_add_subdirectory(po_thumbnailer)
++add_subdirectory(po_thumbnailer)
+ endif(GETTEXTPO_FOUND)
+ 
+ macro_display_feature_log()
diff --git a/pkgs/desktops/kde-4.10/kdesdk/umbrello.nix b/pkgs/desktops/kde-4.10/kdesdk/umbrello.nix
new file mode 100644
index 00000000000..e83a2d9a901
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdesdk/umbrello.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libxml2, libxslt, boost }:
+
+kde {
+  buildInputs = [ kdelibs libxml2 libxslt boost ];
+
+  meta = {
+    description = "Umbrello UML modeller";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdetoys/amor.nix b/pkgs/desktops/kde-4.10/kdetoys/amor.nix
new file mode 100644
index 00000000000..936d63d544a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdetoys/amor.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE creature for your desktop";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdetoys/kteatime.nix b/pkgs/desktops/kde-4.10/kdetoys/kteatime.nix
new file mode 100644
index 00000000000..dacf54def4b
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdetoys/kteatime.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE utility for making a fine cup of tea";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdetoys/ktux.nix b/pkgs/desktops/kde-4.10/kdetoys/ktux.nix
new file mode 100644
index 00000000000..108f9be7c72
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdetoys/ktux.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, kde_workspace }:
+
+kde {
+  buildInputs = [ kdelibs kde_workspace ];
+
+  meta = {
+    description = "Tux Screen Saver";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/ark.nix b/pkgs/desktops/kde-4.10/kdeutils/ark.nix
new file mode 100644
index 00000000000..eb3e12281d6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/ark.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libarchive, bzip2, kde_baseapps, lzma, qjson }:
+
+kde {
+  buildInputs = [ kdelibs kde_baseapps libarchive bzip2 lzma qjson ];
+
+  meta = {
+    description = "KDE Archiving Tool";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/filelight.nix b/pkgs/desktops/kde-4.10/kdeutils/filelight.nix
new file mode 100644
index 00000000000..25ecabed27c
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/filelight.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Tool to visualise file and directory sizes";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kcalc.nix b/pkgs/desktops/kde-4.10/kdeutils/kcalc.nix
new file mode 100644
index 00000000000..08b202e8f0e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kcalc.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, gmp }:
+
+kde {
+  buildInputs = [ kdelibs gmp ];
+
+  meta = {
+    description = "KDE Calculator";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kcharselect.nix b/pkgs/desktops/kde-4.10/kdeutils/kcharselect.nix
new file mode 100644
index 00000000000..d4c9c06f483
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kcharselect.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE character selection utility";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kdf.nix b/pkgs/desktops/kde-4.10/kdeutils/kdf.nix
new file mode 100644
index 00000000000..3f9da58d0a6
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kdf.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE free disk space utility";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kfloppy.nix b/pkgs/desktops/kde-4.10/kdeutils/kfloppy.nix
new file mode 100644
index 00000000000..2434a4fa671
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kfloppy.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Floppy disk formatting utility";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kgpg.nix b/pkgs/desktops/kde-4.10/kdeutils/kgpg.nix
new file mode 100644
index 00000000000..f3b00a5b968
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kgpg.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, kdepimlibs }:
+
+kde {
+  buildInputs = [ kdelibs kdepimlibs ];
+
+  meta = {
+    description = "Simple KDE GUI for GPG";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kremotecontrol.nix b/pkgs/desktops/kde-4.10/kdeutils/kremotecontrol.nix
new file mode 100644
index 00000000000..70311a789f9
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kremotecontrol.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs, libXtst }:
+
+kde {
+  buildInputs = [ kdelibs libXtst ];
+
+  meta = {
+    description = "KDE remote control";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/ktimer.nix b/pkgs/desktops/kde-4.10/kdeutils/ktimer.nix
new file mode 100644
index 00000000000..5700977349e
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/ktimer.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE Timer";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/kwallet.nix b/pkgs/desktops/kde-4.10/kdeutils/kwallet.nix
new file mode 100644
index 00000000000..9ec0e6c0396
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/kwallet.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "KDE Wallet (password storage) management tool";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/print-manager.nix b/pkgs/desktops/kde-4.10/kdeutils/print-manager.nix
new file mode 100644
index 00000000000..99feaf3e4f9
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/print-manager.nix
@@ -0,0 +1,28 @@
+{ kde, kdelibs
+, pythonPackages, cups, sip, pyqt4, pykde4, pycups, rhpl, system_config_printer
+, pythonDBus, makeWrapper }:
+
+let s_c_p = system_config_printer.override { withGUI = false; }; in
+
+kde rec {
+  buildInputs = [ kdelibs pythonPackages.python pythonPackages.wrapPython
+    ] ++ pythonPath;
+
+  pythonPath = [ cups pyqt4 pykde4 pycups s_c_p ];
+
+  passthru.propagatedUserEnvPackages = [ s_c_p ];
+
+  postInstall =
+    ''
+      wrapPythonPrograms
+
+      # ‘system-config-printer’ supplies some D-Bus policy that we need.
+      mkdir -p $out/nix-support
+      echo ${s_c_p} > $out/nix-support/propagated-user-env-packages
+    '';
+
+  meta = {
+    description = "KDE printer manager";
+    longDescription = "Applet to view current print jobs and configure new printers";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/superkaramba.nix b/pkgs/desktops/kde-4.10/kdeutils/superkaramba.nix
new file mode 100644
index 00000000000..cbe7a285606
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/superkaramba.nix
@@ -0,0 +1,11 @@
+{ kde, kdelibs, qimageblitz, python }:
+
+kde {
+  buildInputs = [ kdelibs qimageblitz python ];
+
+  cmakeFlags = [ "-DBUILD_icons=TRUE" "-DBUILD_plasma=TRUE" ];
+
+  meta = {
+    description = "A KDE Eye-candy Application";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdeutils/sweeper.nix b/pkgs/desktops/kde-4.10/kdeutils/sweeper.nix
new file mode 100644
index 00000000000..78d56c7df30
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdeutils/sweeper.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Helps clean unwanted traces the user leaves on the system";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdewebdev/kfilereplace.nix b/pkgs/desktops/kde-4.10/kdewebdev/kfilereplace.nix
new file mode 100644
index 00000000000..55e37809e07
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdewebdev/kfilereplace.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "Batch search and replace tool";
+    homepage = http://www.kdewebdev.org;
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdewebdev/kimagemapeditor.nix b/pkgs/desktops/kde-4.10/kdewebdev/kimagemapeditor.nix
new file mode 100644
index 00000000000..6d22f72461f
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdewebdev/kimagemapeditor.nix
@@ -0,0 +1,10 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "An HTML imagemap editor";
+    homepage = http://www.nongnu.org/kimagemap/;
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdewebdev/klinkstatus.nix b/pkgs/desktops/kde-4.10/kdewebdev/klinkstatus.nix
new file mode 100644
index 00000000000..21971beb80a
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdewebdev/klinkstatus.nix
@@ -0,0 +1,12 @@
+{ kde, kdelibs, libxml2, libxslt, kdepimlibs, htmlTidy, boost }:
+
+kde {
+#todo: ruby is not found. needed for some example scripts
+  buildInputs =
+    [ kdelibs kdepimlibs htmlTidy boost ];
+
+  meta = {
+    description = "A KDE link checker";
+    homepage = http://klinkstatus.kdewebdev.org;
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/kdewebdev/kommander.nix b/pkgs/desktops/kde-4.10/kdewebdev/kommander.nix
new file mode 100644
index 00000000000..d5f4337f714
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/kdewebdev/kommander.nix
@@ -0,0 +1,9 @@
+{ kde, kdelibs }:
+
+kde {
+  buildInputs = [ kdelibs ];
+
+  meta = {
+    description = "A graphical editor of scripted dialogs";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/l10n/default.nix b/pkgs/desktops/kde-4.10/l10n/default.nix
new file mode 100644
index 00000000000..57d41fb35bf
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/l10n/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, kdelibs, gettext, release, stable }:
+
+let
+
+  inherit (stdenv.lib) attrByPath singleton;
+
+  kdeL10nDerivation =
+    { lang, saneName, sha256 }:
+
+    stdenv.mkDerivation rec {
+      name = "kde-l10n-${saneName}-${release}";
+
+      src = fetchurl {
+        url = "mirror://kde/${if stable then "" else "un"}stable/${release}/src/kde-l10n/kde-l10n-${lang}-${release}.tar.xz";
+        name = "${name}.tar.xz";
+        inherit sha256;
+      };
+
+      buildInputs = [ gettext kdelibs ];
+
+      cmakeFlags = "-Wno-dev";
+
+      meta = {
+        description = "KDE translation for ${lang}";
+        license = "GPL";
+        inherit (kdelibs.meta) maintainers platforms homepage;
+      };
+    };
+
+  kdeL10nRelease =
+    builtins.listToAttrs (
+      map ({lang, saneName, sha256}:
+        {
+          name = saneName;
+          value = kdeL10nDerivation { inherit lang saneName sha256; };
+        }
+      ) (import (./manifest + "-${release}.nix"))
+    );
+
+in
+{
+  inherit kdeL10nDerivation;
+  recurseForDerivations = true;
+} // kdeL10nRelease
diff --git a/pkgs/desktops/kde-4.10/l10n/l10n-manifest.sh b/pkgs/desktops/kde-4.10/l10n/l10n-manifest.sh
new file mode 100755
index 00000000000..ec159a1e204
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/l10n/l10n-manifest.sh
@@ -0,0 +1,32 @@
+#!/bin/sh
+
+# Usage: download kde-l10n to $dir, then run
+# $0 $dir
+
+dir=$1
+
+if [[ ! -d "${dir}" ]]; then
+  echo "${dir} is not a directory (or doesn't exist)!" >&2
+  exit 1
+fi
+
+release=$(ls "${dir}"/kde-l10n-en_GB-*.tar.xz | \
+	sed -e 's/.*en_GB-//' -e 's/\.tar\.xz//')
+
+echo "Detected release ${release}" >&2
+
+exec > "manifest-${release}.nix"
+echo "["
+for i in `cd "${dir}"; ls kde-l10n-*-${release}.tar.xz`; do
+  lang=${i%-${release}.tar.xz}
+  lang=${lang#kde-l10n-}
+  echo -n "${lang}.. " >&2
+  hash=$(nix-hash --type sha256 --flat --base32 "${dir}/${i}")
+  echo "{"
+  echo "  lang = \"${lang}\";"
+  echo "  saneName = \"$(echo $lang | sed s^@^_^g)\";"
+  echo "  sha256 = \"${hash}\";"
+  echo "}"
+  echo $hash >&2
+done
+echo "]"
diff --git a/pkgs/desktops/kde-4.10/l10n/manifest-4.10.4.nix b/pkgs/desktops/kde-4.10/l10n/manifest-4.10.4.nix
new file mode 100644
index 00000000000..67abb386a48
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/l10n/manifest-4.10.4.nix
@@ -0,0 +1,282 @@
+[
+{
+  lang = "ar";
+  saneName = "ar";
+  sha256 = "1pkca1z620pwd8nk53wpbg6490nzd21i71691dmp233mgb8pzwfz";
+}
+{
+  lang = "bg";
+  saneName = "bg";
+  sha256 = "1zsml7q434m5242my2y14b5b708ccrmyrvkbl231mjxdqmy137g8";
+}
+{
+  lang = "bs";
+  saneName = "bs";
+  sha256 = "0qbhix7xxabcgwyjrqhvhqfm2gs72swj2wdbh99csb8y3ms4bhwm";
+}
+{
+  lang = "ca";
+  saneName = "ca";
+  sha256 = "1hfj9ram95fsv4qbjv6mwc01sl15vw8cj0q7vy3jjvamcjlczn4q";
+}
+{
+  lang = "ca@valencia";
+  saneName = "ca_valencia";
+  sha256 = "19vjxcpvbrip18j26sbs4h16wisvpryfdf4v7z6kg716k6pgj0gb";
+}
+{
+  lang = "cs";
+  saneName = "cs";
+  sha256 = "1nvyazb2dv03k68shqj7crx01yiwzh1zs5al84ym3j18drq8b66r";
+}
+{
+  lang = "da";
+  saneName = "da";
+  sha256 = "1pclmjkb7c2c6k62pilgi6r7bxw2clpb5vj46n0rdhhr97vfschn";
+}
+{
+  lang = "de";
+  saneName = "de";
+  sha256 = "15qkm1004mq8g3y7jdhsziabf5c1c57p5h57086ngk9x61r2gfmx";
+}
+{
+  lang = "el";
+  saneName = "el";
+  sha256 = "1il49v54qfc1gy9scqal9fjpkjxk3wpzylcz6n5372n01mgs8ydz";
+}
+{
+  lang = "en_GB";
+  saneName = "en_GB";
+  sha256 = "1c25p3byhlv41b82hlpq6agpnfd5vzfm7a9fb8h7jh8va5ifqwac";
+}
+{
+  lang = "es";
+  saneName = "es";
+  sha256 = "1wa15glj0a11phcm69yaz532j4412vqx1h4cwhddyr2l3d7g135i";
+}
+{
+  lang = "et";
+  saneName = "et";
+  sha256 = "1hsq8213mzxzasydgrmcgid85r9d1p1fgkabb5wd66xz5kgjc5v7";
+}
+{
+  lang = "eu";
+  saneName = "eu";
+  sha256 = "1xw7hnlqq05bfsgb74qhis8dcnr7nllm3vm2mc4n8g5n7h8c0hq4";
+}
+{
+  lang = "fa";
+  saneName = "fa";
+  sha256 = "0z0v9m7z557jmqdngw4km4icaxhzlc5np7rzsnzgsqm2xnapc1cm";
+}
+{
+  lang = "fi";
+  saneName = "fi";
+  sha256 = "0jvy10459fc58d21azbk3jjnq1pb3n4a8v5ynw0f2pcizgivrlm3";
+}
+{
+  lang = "fr";
+  saneName = "fr";
+  sha256 = "15wnqcqz1xrdw33xiff0xfnyd56x3hj9nk4i1sxkkymfay2jkdgk";
+}
+{
+  lang = "ga";
+  saneName = "ga";
+  sha256 = "1n7vzhyph2rr22isnzr7r4yrchkzrgwa1xw00ncpmj4k81gl7yl3";
+}
+{
+  lang = "gl";
+  saneName = "gl";
+  sha256 = "0hqlhl19y9bc262kk0s5grgvg3xy0gvcvkrcwy2casmrsx3p5f1y";
+}
+{
+  lang = "he";
+  saneName = "he";
+  sha256 = "0yh6l1ypy3h1bgs1kbnjj7fbhap4a416zlsbsd7d4g71dq7hsm1p";
+}
+{
+  lang = "hi";
+  saneName = "hi";
+  sha256 = "03j1dvylczy360dndpny9qfijfnacv185qwlji7zj4x83y69zfdc";
+}
+{
+  lang = "hr";
+  saneName = "hr";
+  sha256 = "1257lwczcyh6nbp3s8078l2h6yj04wqxa4iak7k3q79l8x2jhch6";
+}
+{
+  lang = "hu";
+  saneName = "hu";
+  sha256 = "1mvqfmmajgf5iyscalmrsipa9vy5b6ap7bdarl0d1i4nwh1g8mxq";
+}
+{
+  lang = "ia";
+  saneName = "ia";
+  sha256 = "0cq6c2ky8gydzk5rz5yjgb3lp7n2d9h760q7m8skq9f8hks7vlic";
+}
+{
+  lang = "is";
+  saneName = "is";
+  sha256 = "1149l8i96iq195cjzbrrdzxck1zd34w6y8hxs8p6jz49bzf5g5c5";
+}
+{
+  lang = "it";
+  saneName = "it";
+  sha256 = "0n4b7x0xxvmlr55b602pi7bxmrcpsqcc4qk4x58x2kpb9awh896i";
+}
+{
+  lang = "ja";
+  saneName = "ja";
+  sha256 = "1dfy3kzqx0xm52jp7gzph0xm6zrwb9y3mssyw4shmnvhlf13xkki";
+}
+{
+  lang = "kk";
+  saneName = "kk";
+  sha256 = "1gd6vnh2vwn4lj8c0qmq7avaz79zv2ldqyb07d2wmvpljpifz5fk";
+}
+{
+  lang = "km";
+  saneName = "km";
+  sha256 = "0q619ddjj928v376j1ljn2k6br7zlazfkk9q4hndi6kql1712139";
+}
+{
+  lang = "ko";
+  saneName = "ko";
+  sha256 = "1jmfxpz3pf2zglysjnry0ahygvkapk6v844q1nhsmfci6mmpmlqh";
+}
+{
+  lang = "lt";
+  saneName = "lt";
+  sha256 = "01f6krx8ll9jhih5205fxsb0dz3ynwpz43byq7qyi68f1lkaxsd0";
+}
+{
+  lang = "lv";
+  saneName = "lv";
+  sha256 = "0xnl28havz92ar5gid3p2r8wap3yrsg143fghqcdiymbzwy3sb0k";
+}
+{
+  lang = "mr";
+  saneName = "mr";
+  sha256 = "1arc5ksxgwvk2i669nhm2y78qf4zd1z3z8fjpixf6ax9g3bqdghd";
+}
+{
+  lang = "nb";
+  saneName = "nb";
+  sha256 = "1fk0g008pdw4gpbzbycl6xck0m7mf56f27rfa10riy9drmi7bcbj";
+}
+{
+  lang = "nds";
+  saneName = "nds";
+  sha256 = "1g2gwslqk0zfayhd91mbgl3gwznj8npq9637c3wkk3kdnz6hcsw0";
+}
+{
+  lang = "nl";
+  saneName = "nl";
+  sha256 = "1j6dw63jph3dbi0v4rlq3mp98fijynd4n0a6z4dwmzdjzb5ccqrg";
+}
+{
+  lang = "nn";
+  saneName = "nn";
+  sha256 = "0m5i7i6rscqwwx4l0fw0bmg1247hbs3bxbnxmqbz6fv5pp29yh4v";
+}
+{
+  lang = "pa";
+  saneName = "pa";
+  sha256 = "0bn3bf6pkjvr0la5n4s3lb1ij0q2rh4qx8ig6sbkq0j822c84n11";
+}
+{
+  lang = "pl";
+  saneName = "pl";
+  sha256 = "09gw92a41ws5lxapw0160pqrqfhfnk42yshlzmdk3aav88rq1f0q";
+}
+{
+  lang = "pt";
+  saneName = "pt";
+  sha256 = "1lyh8szfwbd3jm3gsndgigz1xhzldh246c2d6f4lsry9w9557gpl";
+}
+{
+  lang = "pt_BR";
+  saneName = "pt_BR";
+  sha256 = "12vgf8qx8244brvfy7mi8ak1nxh9fclj9n2yic5ldf2wfkb7hzjd";
+}
+{
+  lang = "ro";
+  saneName = "ro";
+  sha256 = "0q995rw2bbv8vjnf9h0ywdvq8v24rkmxck1w7bf0wblcp7w4pcpq";
+}
+{
+  lang = "ru";
+  saneName = "ru";
+  sha256 = "014zcdk5kxif17mqb6ivsc44021f4hxr0d2pn2d0jlrhx4dbyvsp";
+}
+{
+  lang = "si";
+  saneName = "si";
+  sha256 = "0y80d8d18di9n0jj8ifxmdc5vgmq6bkc86id5azqrlif4rhs55jj";
+}
+{
+  lang = "sk";
+  saneName = "sk";
+  sha256 = "1q87ixrqqkhzbyb7mlk0xfnxcih057x9w596spr5br8arxr34912";
+}
+{
+  lang = "sl";
+  saneName = "sl";
+  sha256 = "1ykbh8j2x14vq7iszll4lgmg8gbnv6jql686x01896ba504144y4";
+}
+{
+  lang = "sr";
+  saneName = "sr";
+  sha256 = "03f0jjsn4bwysjs8x8iy61z0rnzm8gn3w9k85wfa0br8cjr36cji";
+}
+{
+  lang = "sv";
+  saneName = "sv";
+  sha256 = "1bf3795ddlxk9cz686jlifb18wjxfgjqfv3s45gs9q09i6sq0iv4";
+}
+{
+  lang = "tg";
+  saneName = "tg";
+  sha256 = "11w9ibw8bbkllrf4628rc5zpwwwp5plcapndwp9sb19rsdx0bnvf";
+}
+{
+  lang = "th";
+  saneName = "th";
+  sha256 = "0rv5l7zplhfr7l8a4wh4ngvh0assq97dlvh5d6x9a464k5fgwg7w";
+}
+{
+  lang = "tr";
+  saneName = "tr";
+  sha256 = "15f1rsbzljk120dq2v2wkgn4ym50yzrd9xyzgw9g22hlmy5inmm8";
+}
+{
+  lang = "ug";
+  saneName = "ug";
+  sha256 = "1f924vl3vm20p5hfyzzv6hx6cvb7ym4bf9lbch808k99jwvh6j99";
+}
+{
+  lang = "uk";
+  saneName = "uk";
+  sha256 = "1fv78nvvrd6z62fy3iqqbf77vixadl8s2hg6lkg094f1dc8l3w4n";
+}
+{
+  lang = "vi";
+  saneName = "vi";
+  sha256 = "1k2i818821bls1vqb614jq8pi6cj43rf2x2bcbcibwdmhs1xljx8";
+}
+{
+  lang = "wa";
+  saneName = "wa";
+  sha256 = "0bk9mjir5az1rnxclyijc42mfnpgbw1fzzfvw765wdcs1mkjqrdh";
+}
+{
+  lang = "zh_CN";
+  saneName = "zh_CN";
+  sha256 = "0m3z05zsg2afzfm2ws090rx9214l9zjshfxy7sww3a2nb39f798b";
+}
+{
+  lang = "zh_TW";
+  saneName = "zh_TW";
+  sha256 = "09921r007i23q1dyg9gx8zjaf3da0i2r6r673yhaq584srxivznq";
+}
+]
diff --git a/pkgs/desktops/kde-4.10/oxygen-icons.nix b/pkgs/desktops/kde-4.10/oxygen-icons.nix
new file mode 100644
index 00000000000..373f2c7b5ac
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/oxygen-icons.nix
@@ -0,0 +1,15 @@
+{ kde, cmake }:
+
+kde {
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = "0nl3praln6kfdpr4diln850f29242496p5yrfcyq6xjkpsswq55w";
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "KDE Oxygen theme icons";
+    longDescription = "Icons for KDE's default theme";
+    license = "GPL";
+  };
+}
diff --git a/pkgs/desktops/kde-4.10/support/akonadi/default.nix b/pkgs/desktops/kde-4.10/support/akonadi/default.nix
new file mode 100644
index 00000000000..e1d8a5ef9ae
--- /dev/null
+++ b/pkgs/desktops/kde-4.10/support/akonadi/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, qt4, shared_mime_info, libxslt, boost, automoc4, soprano, sqlite }:
+
+stdenv.mkDerivation rec {
+  name = "akonadi-1.9.2";
+  
+  src = fetchurl {
+    url = "mirror://kde/stable/akonadi/src/${name}.tar.bz2";
+    sha256 = "1ndzc7a1q1hqy4pn9xnihq6ni02zsqfdyy6z6lwn27bkb7pg64p7";
+  };
+
+  buildInputs = [ qt4 soprano libxslt boost sqlite ];
+
+  nativeBuildInputs = [ cmake automoc4 shared_mime_info ];
+
+  enableParallelBuilding = true;
+  
+  meta = with stdenv.lib; {
+    description = "KDE PIM Storage Service";
+    license = "LGPL";
+    homepage = http://pim.kde.org/akonadi;
+    maintainers = [ maintainers.sander maintainers.urkud ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/kde-4.7/kde-wallpapers.nix b/pkgs/desktops/kde-4.7/kde-wallpapers.nix
index 97773ffadcd..57f2b643aa4 100644
--- a/pkgs/desktops/kde-4.7/kde-wallpapers.nix
+++ b/pkgs/desktops/kde-4.7/kde-wallpapers.nix
@@ -1,7 +1,7 @@
 { kde, cmake }:
 
 kde {
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./files/kde-wallpapers-buildsystem.patch ];
 
diff --git a/pkgs/desktops/kde-4.7/kde-workspace.nix b/pkgs/desktops/kde-4.7/kde-workspace.nix
index 8116f4bb6b5..82730702989 100644
--- a/pkgs/desktops/kde-4.7/kde-workspace.nix
+++ b/pkgs/desktops/kde-4.7/kde-workspace.nix
@@ -1,6 +1,6 @@
 { kde, kdelibs, qimageblitz, libdbusmenu_qt, xorg, shared_desktop_ontologies
 , lm_sensors, pciutils, libraw1394, libusb, libxklavier, python, libqalculate
-, consolekit, xkeyboard_config, kdepimlibs, pam, boost, gpsd, prison, akonadi
+, xkeyboard_config, kdepimlibs, pam, boost, gpsd, prison, akonadi
 , pykde4, libjpeg, pkgconfig, libXft, libXxf86misc
 }:
 
@@ -12,10 +12,10 @@ kde {
       xorg.libXcomposite xorg.libXdamage xorg.libXau xorg.libXdmcp
       xorg.libpthreadstubs
       boost gpsd shared_desktop_ontologies lm_sensors pciutils libraw1394
-      libusb python libqalculate consolekit kdepimlibs pam prison akonadi
+      libusb python libqalculate kdepimlibs pam prison akonadi
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure =
    ''
diff --git a/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix b/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
index 72676e35f71..7028b9db228 100644
--- a/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
+++ b/pkgs/desktops/kde-4.7/kdeartwork/kscreensaver.nix
@@ -3,7 +3,7 @@
 kde {
   buildInputs = [ kdelibs xscreensaver kde_workspace eigen libkexiv2 libXt ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure = "cp -v ${./FindXscreensaver.cmake} cmake/modules/FindXscreensaver.cmake";
 
diff --git a/pkgs/desktops/kde-4.7/kdebindings/perlqt.nix b/pkgs/desktops/kde-4.7/kdebindings/perlqt.nix
deleted file mode 100644
index 13c145f3275..00000000000
--- a/pkgs/desktops/kde-4.7/kdebindings/perlqt.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{ kde, cmake, smokeqt, perl }:
-
-kde {
-  buildInputs = [ smokeqt perl ];
-  buildNativeInputs = [ cmake ];
-
-  meta = {
-    description = "Perl bindings for Qt library";
-  };
-}
diff --git a/pkgs/desktops/kde-4.7/kdebindings/pykde4-new-sip.patch b/pkgs/desktops/kde-4.7/kdebindings/pykde4-new-sip.patch
new file mode 100644
index 00000000000..96b3b887a8d
--- /dev/null
+++ b/pkgs/desktops/kde-4.7/kdebindings/pykde4-new-sip.patch
@@ -0,0 +1,91 @@
+commit 017822bd0dfc83fe9a7a483ecc33f4aab839a3c6
+Author: Luca Beltrame <lbeltrame@kde.org>
+Date:   Mon Oct 1 20:47:56 2012 +0200
+
+    Remove duplicated QVector<int> definition, since it's in PyQt now.
+    Simon, if you have time, please review if everything is OK.
+    
+    CCMAIL: simon@simonzone.com
+
+diff --git a/sip/kdecore/typedefs.sip b/sip/kdecore/typedefs.sip
+index 5a0a080..73dad01 100644
+--- a/sip/kdecore/typedefs.sip
++++ b/sip/kdecore/typedefs.sip
+@@ -951,77 +951,3 @@ template <TYPE1>
+ %End
+ };
+ 
+-%MappedType QVector<int>
+-{
+-%TypeHeaderCode
+-#include <qvector.h>
+-%End
+-
+-%ConvertFromTypeCode
+-    // Create the list.
+-    PyObject *l;
+-
+-    if ((l = PyList_New(sipCpp->size())) == NULL)
+-        return NULL;
+-
+-    // Set the list elements.
+-    for (int i = 0; i < sipCpp->size(); ++i)
+-    {
+-        int t = (sipCpp->at(i));
+-
+-#if PY_MAJOR_VERSION >= 3        
+-        PyObject *tobj = PyLong_FromLong(t);
+-#else
+-        PyObject *tobj = PyInt_FromLong(t);
+-#endif
+-
+-        PyList_SET_ITEM(l, i, tobj);
+-    }
+-
+-    return l;
+-%End
+-
+-%ConvertToTypeCode
+-    // Check the type if that is all that is required.
+-    if (sipIsErr == NULL)
+-    {
+-        if (!PyList_Check(sipPy))
+-            return 0;
+-
+-        for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) {
+-            PyObject *tobj = PyList_GET_ITEM(sipPy, i);
+-#if PY_MAJOR_VERSION >= 3
+-            if (!PyNumber_Check(tobj))
+-#else
+-            if (!PyInt_Check(tobj))
+-#endif
+-                return 0;
+-        }
+-        return 1;
+-    }
+-
+-    QVector<int> *qv = new QVector<int>;
+- 
+-    for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
+-    {
+-        PyObject *tobj = PyList_GET_ITEM(sipPy, i);
+- #if PY_MAJOR_VERSION >= 3
+-        int t = PyLong_AsLong (tobj);
+-#else
+-        int t = PyInt_AS_LONG (tobj);
+-#endif
+-
+-        if (*sipIsErr)
+-        {
+-            delete qv;
+-            return 0;
+-        }
+-
+-        qv->append(t);
+-    }
+- 
+-    *sipCppPtr = qv;
+- 
+-    return sipGetState(sipTransferObj);
+-%End
+-};
diff --git a/pkgs/desktops/kde-4.7/kdebindings/pykde4.nix b/pkgs/desktops/kde-4.7/kdebindings/pykde4.nix
index 1ca6efe3b92..030f2fb430a 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/pykde4.nix
+++ b/pkgs/desktops/kde-4.7/kdebindings/pykde4.nix
@@ -10,7 +10,7 @@ kde {
 
 #NIX_CFLAGS_COMPILE = "-I${phonon}/include/phonon";
 
-  patches = [ ./pykde-purity.patch ];
+  patches = [ ./pykde-purity.patch ./pykde4-new-sip.patch ];
 
   cmakeFlags = "-DHARDCODE_LIB_PYTHON_PATH=ON";
 
diff --git a/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix b/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
index df26eb2717e..43f54b552e5 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
+++ b/pkgs/desktops/kde-4.7/kdebindings/smokegen.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patchPhase = "sed -e /RPATH/d -i CMakeLists.txt";
 
diff --git a/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix b/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
index 0d0aa816a94..29e25093d11 100644
--- a/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
+++ b/pkgs/desktops/kde-4.7/kdebindings/smokeqt.nix
@@ -2,8 +2,8 @@
 
 kde {
   propagatedBuildInputs = [ qt4 phonon qimageblitz ];
-  buildNativeInputs = [ cmake ];
-  propagatedBuildNativeInputs = [ smokegen ];
+  nativeBuildInputs = [ cmake ];
+  propagatedNativeBuildInputs = [ smokegen ];
 
   meta = {
     description = "C++ parser used to generate language bindings for Qt/KDE";
diff --git a/pkgs/desktops/kde-4.7/kdegames.nix b/pkgs/desktops/kde-4.7/kdegames.nix
index 03ecfbd88b4..dfca49be12f 100644
--- a/pkgs/desktops/kde-4.7/kdegames.nix
+++ b/pkgs/desktops/kde-4.7/kdegames.nix
@@ -7,7 +7,7 @@ kde rec {
 
   pythonPath = [ pythonPackages.twisted pykde4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # TODO: ggz
 
diff --git a/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix b/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
index b6b659c3947..c03c82469e6 100644
--- a/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
+++ b/pkgs/desktops/kde-4.7/kdegraphics/gwenview.nix
@@ -6,7 +6,7 @@ kde {
   buildInputs =
     [ kdelibs exiv2 shared_desktop_ontologies kde_baseapps libkipi libjpeg ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Gwenview, the KDE image viewer";
diff --git a/pkgs/desktops/kde-4.7/kdelibs.nix b/pkgs/desktops/kde-4.7/kdelibs.nix
index 31df83e5ee9..41a648d1056 100644
--- a/pkgs/desktops/kde-4.7/kdelibs.nix
+++ b/pkgs/desktops/kde-4.7/kdelibs.nix
@@ -1,4 +1,4 @@
-{ kde, gcc, cmake, perl
+{ kde, gcc, cmake, perl, aspell
 , qt4, bzip2, pcre, fam, libxml2, libxslt, shared_mime_info, giflib, jasper
 , openexr, avahi, kerberos, acl, attr, shared_desktop_ontologies, libXScrnSaver
 , automoc4, strigi, soprano, qca2, attica, enchant, libdbusmenu_qt
@@ -10,12 +10,12 @@ kde {
   buildInputs =
     [ acl attr attica avahi bzip2 enchant fam getopt giflib herqq jasper
       libdbusmenu_qt libXScrnSaver libxslt pcre polkit_qt_1 qca2
-      shared_desktop_ontologies xz udev libxml2 libjpeg kerberos
+      shared_desktop_ontologies xz udev libxml2 libjpeg kerberos aspell
     ];
 
   propagatedBuildInputs = [ qt4 soprano strigi phonon ];
 
-  propagatedBuildNativeInputs = [ automoc4 cmake perl shared_mime_info ];
+  propagatedNativeBuildInputs = [ automoc4 cmake perl shared_mime_info ];
 
   # TODO: make sonnet plugins (dictionaries) really work.
   # There are a few hardcoded paths.
diff --git a/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix b/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
index 704f6d04dfe..440e8595704 100644
--- a/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
+++ b/pkgs/desktops/kde-4.7/kdenetwork/kopete.nix
@@ -7,7 +7,7 @@ kde {
     jasper libidn mediastreamer msilbc libxml2 libxslt giflib libgadu boost qca2
     gpgme sqlite ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   KDEDIRS = libktorrent;
 
diff --git a/pkgs/desktops/kde-4.7/kdenetwork/log-feature.diff b/pkgs/desktops/kde-4.7/kdenetwork/log-feature.diff
deleted file mode 100644
index 6770dd399e3..00000000000
--- a/pkgs/desktops/kde-4.7/kdenetwork/log-feature.diff
+++ /dev/null
@@ -1,60 +0,0 @@
---- a/kget/CMakeLists.txt	2010-08-16 19:08:36.000000000 +0400
-+++ b/kget/CMakeLists.txt	2010-08-16 22:04:24.000000000 +0400
-@@ -53,21 +53,20 @@
- add_subdirectory(desktop)
- add_subdirectory(plasma)
- 
--# find kworkspace library to allow the shutdown after downloads completed option
--find_library(KDE4_KWORKSPACE_LIBRARY NAMES kworkspace PATHS ${KDE4_LIB_INSTALL_DIR} NO_DEFAULT_PATH )
--if(KDE4_KWORKSPACE_LIBRARY)
--    set(KDE4_KWORKSPACE_LIBS ${kworkspace_LIB_DEPENDS} ${KDE4_KWORKSPACE_LIBRARY})
-+macro_optional_find_package(KDE4Workspace)
-+macro_log_feature(KDE4WORKSPACE_FOUND "KDE4Workspace" "KDE4 workspace libraries, part of kdebase-workspace" "http://www.kde.org" FALSE "" "Allows 'shutdown after downloads completed' in kget")
-+if(KDE4WORKSPACE_FOUND)
-     add_definitions(-DHAVE_KWORKSPACE)
--    set(KWORKSPACE_FOUND true)
--endif(KDE4_KWORKSPACE_LIBRARY)
-+	include_directories(${KDE4WORKSPACE_INCLUDE_DIR})
-+endif(KDE4WORKSPACE_FOUND)
- 
- # find libkonq to allow actions and open with options in the context menu of a transfer
--find_library(KDE4_KONQUEROR_LIBRARY NAMES konq PATHS ${KDE4_LIB_INSTALL_DIR} NO_DEFAULT_PATH )
--if(KDE4_KONQUEROR_LIBRARY)
--    set(KDE4_KONQUEROR_LIBS ${konq_LIB_DEPENDS} ${KDE4_KONQUEROR_LIBRARY})
-+macro_optional_find_package(LibKonq)
-+macro_log_feature(LIBKONQ_FOUND "libkonq" "KDE4 Konqueror library" "http://www.kde.org" FALSE "" "Needed to build actions and open with options in the context menu of a transfer")
-+if(LIBKONQ_FOUND)
-     add_definitions(-DHAVE_KONQUEROR)
--    set(KONQUEROR_FOUND true)
--endif(KDE4_KONQUEROR_LIBRARY)
-+	include_directories(${LIBKONQ_INCLUDE_DIR})
-+endif(LIBKONQ_FOUND)
- 
- 
- include_directories(
-@@ -142,9 +141,9 @@
- 
- target_link_libraries(kgetcore ${KDE4_KIO_LIBS})
- 
--if (KWORKSPACE_FOUND)
--    target_link_libraries(kgetcore ${KDE4_KWORKSPACE_LIBS})
--endif (KWORKSPACE_FOUND)
-+if (KDE4WORKSPACE_FOUND)
-+    target_link_libraries(kgetcore ${KDE4WORKSPACE_KWORKSPACE_LIBS})
-+endif (KDE4WORKSPACE_FOUND)
- 
- if (HAVE_NEPOMUK)
-   target_link_libraries(kgetcore ${SOPRANO_LIBRARIES} ${NEPOMUK_LIBRARIES})
-@@ -294,9 +293,9 @@
-   target_link_libraries(kget ${SOPRANO_LIBRARIES} ${NEPOMUK_LIBRARIES})
- endif (HAVE_NEPOMUK)
- 
--if (KONQUEROR_FOUND)
--  target_link_libraries(kget ${KDE4_KONQUEROR_LIBS})
--endif (KONQUEROR_FOUND)
-+if (LIBKONQ_FOUND)
-+  target_link_libraries(kget ${LIBKONQ_LIBRARY})
-+endif (LIBKONQ_FOUND)
- 
- if (QGPGME_FOUND)
-   target_link_libraries(kget ${QGPGME_LIBRARIES})
diff --git a/pkgs/desktops/kde-4.7/kdeplasma-addons.nix b/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
index ddffa48dc55..30a32b465b6 100644
--- a/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
+++ b/pkgs/desktops/kde-4.7/kdeplasma-addons.nix
@@ -11,7 +11,7 @@ kde {
     attica python qca2 qimageblitz kdepimlibs
     libqalculate libXtst shared_desktop_ontologies marble libkexiv2];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "KDE Plasma Addons";
diff --git a/pkgs/desktops/kde-4.7/kdesdk/optional-docs.diff b/pkgs/desktops/kde-4.7/kdesdk/optional-docs.diff
deleted file mode 100644
index f67e1f4cdd8..00000000000
--- a/pkgs/desktops/kde-4.7/kdesdk/optional-docs.diff
+++ /dev/null
@@ -1,39 +0,0 @@
-diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
-index 63cdef8..0c5b50a 100644
---- a/doc/CMakeLists.txt
-+++ b/doc/CMakeLists.txt
-@@ -3,22 +3,30 @@ if( UNIX )
-     add_subdirectory(cervisia)
-   endif()
- endif( UNIX )
--add_subdirectory(kapptemplate)
-+if(BUILD_kapptemplate)
-+  add_subdirectory(kapptemplate)
-+endif()
- if(BUILD_kbugbuster)
-   add_subdirectory(kbugbuster)
- endif()
- if(BUILD_kcachegrind)
-   add_subdirectory(kcachegrind)
- endif()
--add_subdirectory(kmtrace)
-+if(BUILD_kmtrace)
-+  add_subdirectory(kmtrace)
-+endif()
- if(BUILD_kompare)
-   add_subdirectory(kompare)
- endif()
- if(BUILD_lokalize)
-   add_subdirectory(lokalize)
- endif()
--add_subdirectory(poxml)
--add_subdirectory(scripts)
-+if(BUILD_poxml)
-+  add_subdirectory(poxml)
-+endif()
-+if(BUILD_scripts)
-+  add_subdirectory(scripts)
-+endif()
- 
- if(LIBXSLT_FOUND AND LIBXML2_FOUND)
-   if(BUILD_umbrello)
diff --git a/pkgs/desktops/kde-4.7/kipi-plugins.nix b/pkgs/desktops/kde-4.7/kipi-plugins.nix
deleted file mode 100644
index ea237a5d718..00000000000
--- a/pkgs/desktops/kde-4.7/kipi-plugins.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl, cmake, kdelibs, qt4, automoc4, phonon, libkexiv2
-, libkdcraw, libkipi, gettext, libxml2, libxslt, qjson, qca2
-, kdepimlibs }:
-
-stdenv.mkDerivation rec {
-  name = "kipi-plugins-1.9.0";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/kipi/${name}.tar.bz2";
-    sha256 = "0k4k9v1rj7129n0s0i5pvv4rabx0prxqs6sca642fj95cxc6c96m";
-  };
-
-  buildInputs =
-    # Some dependencies are missing because they are very big (OpenCV,
-    # GTK).
-    [ cmake kdelibs qt4 automoc4 phonon libkexiv2 libkdcraw libkipi
-      gettext libxml2 libxslt qjson qca2 kdepimlibs
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Photo Management Program";
-    license = "GPL";
-    homepage = http://www.kipi-plugins.org;
-    inherit (kdelibs.meta) platforms;
-    maintainers = with stdenv.lib.maintainers; [ viric urkud ];
-  };
-}
diff --git a/pkgs/desktops/kde-4.7/oxygen-icons.nix b/pkgs/desktops/kde-4.7/oxygen-icons.nix
index f2a5e666232..1f7572b4d8e 100644
--- a/pkgs/desktops/kde-4.7/oxygen-icons.nix
+++ b/pkgs/desktops/kde-4.7/oxygen-icons.nix
@@ -5,7 +5,7 @@ kde {
   outputHashMode = "recursive";
   outputHash = "0c12c72bcf41cfaf03f85fc1ae27e44d8cecac3deb504ab1de4c30f4fc9e3cd0";
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "KDE Oxygen theme icons";
diff --git a/pkgs/desktops/kde-4.7/support/akonadi/default.nix b/pkgs/desktops/kde-4.7/support/akonadi/default.nix
index 38ec7f85907..cf515509602 100644
--- a/pkgs/desktops/kde-4.7/support/akonadi/default.nix
+++ b/pkgs/desktops/kde-4.7/support/akonadi/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 soprano libxslt boost ];
 
-  buildNativeInputs = [ cmake automoc4 shared_mime_info ];
+  nativeBuildInputs = [ cmake automoc4 shared_mime_info ];
 
   enableParallelBuilding = true;
   
diff --git a/pkgs/desktops/kde-4.8/kde-package/default.nix b/pkgs/desktops/kde-4.8/kde-package/default.nix
index da6440b58fa..cd2860920d6 100644
--- a/pkgs/desktops/kde-4.8/kde-package/default.nix
+++ b/pkgs/desktops/kde-4.8/kde-package/default.nix
@@ -51,7 +51,7 @@ rec {
           "-DBUILD_${subdir}=TRUE"
         ] ++ cmakeFlags;
       meta = defMeta // meta;
-      enableParallelBuilding = true;
+      enableParallelBuilding = module.enableParallelBuilding or true;
     } // (removeAttrs a [ "meta" "name" "cmakeFlags" ]));
 
   # A KDE monolithic module
diff --git a/pkgs/desktops/kde-4.8/kde-runtime.nix b/pkgs/desktops/kde-4.8/kde-runtime.nix
index b219bd4599a..f8246190462 100644
--- a/pkgs/desktops/kde-4.8/kde-runtime.nix
+++ b/pkgs/desktops/kde-4.8/kde-runtime.nix
@@ -9,7 +9,7 @@ kde {
       samba (libcanberra.override { gtk = null; }) ntrack libjpeg qca2 pulseaudio
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   passthru.propagatedUserEnvPackages = [ virtuoso ];
 
diff --git a/pkgs/desktops/kde-4.8/kde-wallpapers.nix b/pkgs/desktops/kde-4.8/kde-wallpapers.nix
index 803b027668a..ad4c22c632d 100644
--- a/pkgs/desktops/kde-4.8/kde-wallpapers.nix
+++ b/pkgs/desktops/kde-4.8/kde-wallpapers.nix
@@ -1,7 +1,7 @@
 { kde, cmake }:
 
 kde {
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./files/kde-wallpapers-buildsystem.patch ];
 
diff --git a/pkgs/desktops/kde-4.8/kde-workspace.nix b/pkgs/desktops/kde-4.8/kde-workspace.nix
index 31937d4f1d5..394cd550b96 100644
--- a/pkgs/desktops/kde-4.8/kde-workspace.nix
+++ b/pkgs/desktops/kde-4.8/kde-workspace.nix
@@ -1,6 +1,6 @@
 { kde, kdelibs, qimageblitz, libdbusmenu_qt, xorg, shared_desktop_ontologies,
   lm_sensors, pciutils, libraw1394, libusb, libxklavier, python, libqalculate,
-  consolekit, xkeyboard_config, kdepimlibs, pam, boost, gpsd, prison, akonadi,
+  xkeyboard_config, kdepimlibs, pam, boost, gpsd, prison, akonadi,
   pykde4, libjpeg, pkgconfig, libXft, libXxf86misc, kactivities
 }:
 
@@ -12,11 +12,11 @@ kde {
       xorg.libXcomposite xorg.libXdamage xorg.libXau xorg.libXdmcp
       xorg.libpthreadstubs
       boost gpsd shared_desktop_ontologies lm_sensors pciutils libraw1394
-      libusb python libqalculate consolekit kdepimlibs pam prison akonadi
+      libusb python libqalculate kdepimlibs pam prison akonadi
       kactivities
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure =
    ''
@@ -28,6 +28,8 @@ kde {
        --replace /usr/share/X11 ${xkeyboard_config}/etc/X11
    '';
 
+  enableParallelBuilding = false; # frequent problems on Hydra
+
   meta = {
     description = "KDE workspace components such as Plasma, Kwin and System Settings";
     license = "GPLv2";
diff --git a/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix b/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
index 72676e35f71..7028b9db228 100644
--- a/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
+++ b/pkgs/desktops/kde-4.8/kdeartwork/kscreensaver.nix
@@ -3,7 +3,7 @@
 kde {
   buildInputs = [ kdelibs xscreensaver kde_workspace eigen libkexiv2 libXt ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   preConfigure = "cp -v ${./FindXscreensaver.cmake} cmake/modules/FindXscreensaver.cmake";
 
diff --git a/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix b/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
index 2c1378f1049..f2b5462f33e 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/perlqt.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ smokeqt perl ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches =
     # The order is important
diff --git a/pkgs/desktops/kde-4.8/kdebindings/pykde4-new-sip.patch b/pkgs/desktops/kde-4.8/kdebindings/pykde4-new-sip.patch
new file mode 100644
index 00000000000..96b3b887a8d
--- /dev/null
+++ b/pkgs/desktops/kde-4.8/kdebindings/pykde4-new-sip.patch
@@ -0,0 +1,91 @@
+commit 017822bd0dfc83fe9a7a483ecc33f4aab839a3c6
+Author: Luca Beltrame <lbeltrame@kde.org>
+Date:   Mon Oct 1 20:47:56 2012 +0200
+
+    Remove duplicated QVector<int> definition, since it's in PyQt now.
+    Simon, if you have time, please review if everything is OK.
+    
+    CCMAIL: simon@simonzone.com
+
+diff --git a/sip/kdecore/typedefs.sip b/sip/kdecore/typedefs.sip
+index 5a0a080..73dad01 100644
+--- a/sip/kdecore/typedefs.sip
++++ b/sip/kdecore/typedefs.sip
+@@ -951,77 +951,3 @@ template <TYPE1>
+ %End
+ };
+ 
+-%MappedType QVector<int>
+-{
+-%TypeHeaderCode
+-#include <qvector.h>
+-%End
+-
+-%ConvertFromTypeCode
+-    // Create the list.
+-    PyObject *l;
+-
+-    if ((l = PyList_New(sipCpp->size())) == NULL)
+-        return NULL;
+-
+-    // Set the list elements.
+-    for (int i = 0; i < sipCpp->size(); ++i)
+-    {
+-        int t = (sipCpp->at(i));
+-
+-#if PY_MAJOR_VERSION >= 3        
+-        PyObject *tobj = PyLong_FromLong(t);
+-#else
+-        PyObject *tobj = PyInt_FromLong(t);
+-#endif
+-
+-        PyList_SET_ITEM(l, i, tobj);
+-    }
+-
+-    return l;
+-%End
+-
+-%ConvertToTypeCode
+-    // Check the type if that is all that is required.
+-    if (sipIsErr == NULL)
+-    {
+-        if (!PyList_Check(sipPy))
+-            return 0;
+-
+-        for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i) {
+-            PyObject *tobj = PyList_GET_ITEM(sipPy, i);
+-#if PY_MAJOR_VERSION >= 3
+-            if (!PyNumber_Check(tobj))
+-#else
+-            if (!PyInt_Check(tobj))
+-#endif
+-                return 0;
+-        }
+-        return 1;
+-    }
+-
+-    QVector<int> *qv = new QVector<int>;
+- 
+-    for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
+-    {
+-        PyObject *tobj = PyList_GET_ITEM(sipPy, i);
+- #if PY_MAJOR_VERSION >= 3
+-        int t = PyLong_AsLong (tobj);
+-#else
+-        int t = PyInt_AS_LONG (tobj);
+-#endif
+-
+-        if (*sipIsErr)
+-        {
+-            delete qv;
+-            return 0;
+-        }
+-
+-        qv->append(t);
+-    }
+- 
+-    *sipCppPtr = qv;
+- 
+-    return sipGetState(sipTransferObj);
+-%End
+-};
diff --git a/pkgs/desktops/kde-4.8/kdebindings/pykde4.nix b/pkgs/desktops/kde-4.8/kdebindings/pykde4.nix
index e32b7447aea..eb4d49616c4 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/pykde4.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/pykde4.nix
@@ -8,7 +8,7 @@ kde {
 
   propagatedBuildInputs = [ pyqt4 sip ];
 
-  patches = [ ./pykde4-hardcode-lib-python.patch ];
+  patches = [ ./pykde4-hardcode-lib-python.patch ./pykde4-new-sip.patch ];
 
   cmakeFlags = "-DHARDCODE_LIB_PYTHON_PATH=ON ";
 
diff --git a/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix b/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
index 5dd25899e74..723732f6104 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/qtruby.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ smokeqt ruby ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   # The second patch is not ready for upstream submmission. I should add an
   # option() instead.
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix b/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
index e32ed57c907..8b5da2a641d 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokegen.nix
@@ -2,7 +2,7 @@
 
 kde {
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patches = [ ./smokegen-nix.patch ];
 
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix b/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
index 6f1b7a0b708..0e823a95e3b 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokekde.nix
@@ -3,7 +3,7 @@
 kde {
   # attica, akonadi and kdepimlibs are disabled due to smokegen crash
   buildInputs = [ smokeqt kdelibs shared_desktop_ontologies ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DQTDEFINES_FILE=${smokeqt}/share/smokegen/qtdefines";
   meta = {
diff --git a/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix b/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
index 0d0aa816a94..29e25093d11 100644
--- a/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
+++ b/pkgs/desktops/kde-4.8/kdebindings/smokeqt.nix
@@ -2,8 +2,8 @@
 
 kde {
   propagatedBuildInputs = [ qt4 phonon qimageblitz ];
-  buildNativeInputs = [ cmake ];
-  propagatedBuildNativeInputs = [ smokegen ];
+  nativeBuildInputs = [ cmake ];
+  propagatedNativeBuildInputs = [ smokegen ];
 
   meta = {
     description = "C++ parser used to generate language bindings for Qt/KDE";
diff --git a/pkgs/desktops/kde-4.8/kdegames.nix b/pkgs/desktops/kde-4.8/kdegames.nix
index 03ecfbd88b4..dfca49be12f 100644
--- a/pkgs/desktops/kde-4.8/kdegames.nix
+++ b/pkgs/desktops/kde-4.8/kdegames.nix
@@ -7,7 +7,7 @@ kde rec {
 
   pythonPath = [ pythonPackages.twisted pykde4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # TODO: ggz
 
diff --git a/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix b/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
index b6b659c3947..c03c82469e6 100644
--- a/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
+++ b/pkgs/desktops/kde-4.8/kdegraphics/gwenview.nix
@@ -6,7 +6,7 @@ kde {
   buildInputs =
     [ kdelibs exiv2 shared_desktop_ontologies kde_baseapps libkipi libjpeg ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Gwenview, the KDE image viewer";
diff --git a/pkgs/desktops/kde-4.8/kdelibs.nix b/pkgs/desktops/kde-4.8/kdelibs.nix
index 31df83e5ee9..0e7c9cfdbea 100644
--- a/pkgs/desktops/kde-4.8/kdelibs.nix
+++ b/pkgs/desktops/kde-4.8/kdelibs.nix
@@ -15,7 +15,7 @@ kde {
 
   propagatedBuildInputs = [ qt4 soprano strigi phonon ];
 
-  propagatedBuildNativeInputs = [ automoc4 cmake perl shared_mime_info ];
+  propagatedNativeBuildInputs = [ automoc4 cmake perl shared_mime_info ];
 
   # TODO: make sonnet plugins (dictionaries) really work.
   # There are a few hardcoded paths.
diff --git a/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix b/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
index ec48b96fe19..d1d9f0c8e03 100644
--- a/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
+++ b/pkgs/desktops/kde-4.8/kdenetwork/kopete.nix
@@ -7,7 +7,7 @@ kde {
     jasper libidn mediastreamer msilbc libxml2 libxslt giflib libgadu boost qca2
     gpgme sqlite ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   KDEDIRS = libktorrent;
 
diff --git a/pkgs/desktops/kde-4.8/kdeplasma-addons.nix b/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
index 9d70579d6d2..a69002bff28 100644
--- a/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
+++ b/pkgs/desktops/kde-4.8/kdeplasma-addons.nix
@@ -11,7 +11,7 @@ kde {
     attica python qca2 qimageblitz kdepimlibs libdbusmenu_qt
     libqalculate libXtst shared_desktop_ontologies marble libkexiv2];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "KDE Plasma Addons";
diff --git a/pkgs/desktops/kde-4.8/kdesdk/okteta.nix b/pkgs/desktops/kde-4.8/kdesdk/okteta.nix
index 1b53a0e03dc..058636596ad 100644
--- a/pkgs/desktops/kde-4.8/kdesdk/okteta.nix
+++ b/pkgs/desktops/kde-4.8/kdesdk/okteta.nix
@@ -5,6 +5,8 @@ kde {
 
 # TODO: Look what does -DBUILD_mobile add
 
+  enableParallelBuilding = false;
+
   meta = {
     description = "KDE byte editor";
   };
diff --git a/pkgs/desktops/kde-4.8/oxygen-icons.nix b/pkgs/desktops/kde-4.8/oxygen-icons.nix
index c821e2a7aac..52e5e5f6bb0 100644
--- a/pkgs/desktops/kde-4.8/oxygen-icons.nix
+++ b/pkgs/desktops/kde-4.8/oxygen-icons.nix
@@ -5,7 +5,7 @@ kde {
   outputHashMode = "recursive";
   outputHash = "3984dac79aa7398578bcd9d69d74988bd992807518d46cd1dabc03867044c8a4";
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "KDE Oxygen theme icons";
diff --git a/pkgs/desktops/kde-4.8/support/akonadi/default.nix b/pkgs/desktops/kde-4.8/support/akonadi/default.nix
index db0608ead3f..9a9e8a87066 100644
--- a/pkgs/desktops/kde-4.8/support/akonadi/default.nix
+++ b/pkgs/desktops/kde-4.8/support/akonadi/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, cmake, qt4, shared_mime_info, libxslt, boost, automoc4, soprano }:
 
 stdenv.mkDerivation rec {
-  name = "akonadi-1.7.0";
+  name = "akonadi-1.7.2";
   
   src = fetchurl {
     url = "mirror://kde/stable/akonadi/src/${name}.tar.bz2";
-    sha256 = "105mjr6n1g6kl0djp2l8jr8b7j4s9gy2ls43g1wf3py1hf6j5fdz";
+    sha256 = "07rbhc8aa3d896j2r64ljv3amd6s4xhlbgq7kx99m1f68yl1fwjb";
   };
 
   buildInputs = [ qt4 soprano libxslt boost ];
 
-  buildNativeInputs = [ cmake automoc4 shared_mime_info ];
+  nativeBuildInputs = [ cmake automoc4 shared_mime_info ];
 
   enableParallelBuilding = true;
   
diff --git a/pkgs/desktops/xfce-4.6/applications/mousepad.nix b/pkgs/desktops/xfce-4.6/applications/mousepad.nix
deleted file mode 100644
index 5912b21c766..00000000000
--- a/pkgs/desktops/xfce-4.6/applications/mousepad.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, libxfce4util, libxfcegui4, gtk }:
-
-stdenv.mkDerivation rec {
-  name = "mousepad-0.2.16";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/mousepad/0.2/${name}.tar.bz2";
-    sha1 = "4e63033e0a71578f3ec9a0d2e6a505efd0424ef9";
-  };
-
-  buildInputs = [ pkgconfig intltool libxfce4util libxfcegui4 gtk ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/mousepad/;
-    description = "A simple text editor for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/applications/ristretto.nix b/pkgs/desktops/xfce-4.6/applications/ristretto.nix
deleted file mode 100644
index aefabcb65fb..00000000000
--- a/pkgs/desktops/xfce-4.6/applications/ristretto.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, libexif, gtk, thunar
-, exo, dbus_glib, libxfce4util, libxfcegui4, xfconf }:
-
-stdenv.mkDerivation rec {
-  name = "ristretto-0.0.22";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/ristretto/0.0/${name}.tar.gz";
-    sha1 = "bddbc8618ba67699ccf5ee4ea0b538b1be7fdb0a";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool libexif gtk thunar exo dbus_glib
-      libxfce4util libxfcegui4 xfconf
-    ];
-
-  NIX_LDFLAGS = "-lX11";
-
-  meta = {
-    homepage = http://goodies.xfce.org/projects/applications/ristretto;
-    description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/applications/terminal.nix b/pkgs/desktops/xfce-4.6/applications/terminal.nix
deleted file mode 100644
index bd198a12af4..00000000000
--- a/pkgs/desktops/xfce-4.6/applications/terminal.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl
-, pkgconfig, ncurses
-, intltool, vte
-, exo, libxfce4util
-, gtk
-}:
-
-stdenv.mkDerivation {
-  name = "xfce-terminal-0.4.5";
-  
-  src = fetchurl {
-    url = http://archive.xfce.org/src/apps/terminal/0.4/Terminal-0.4.5.tar.bz2;
-    sha256 = "14w8mhmyrq6dd9574zfvq0pymknljckq6qgcv1r6c1r22jydrzcj";
-  };
-
-  buildInputs = [ pkgconfig intltool exo gtk vte libxfce4util ncurses ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/terminal;
-    description = "A modern terminal emulator primarily for the Xfce desktop environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/applications/xfce4-mixer.nix b/pkgs/desktops/xfce-4.6/applications/xfce4-mixer.nix
deleted file mode 100644
index 76cc5ea028f..00000000000
--- a/pkgs/desktops/xfce-4.6/applications/xfce4-mixer.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, glib, gstreamer, gst_plugins_base
-, gtk, libxfce4util, libxfcegui4, xfce4panel, xfconf, makeWrapper }:
-
-let
-
-  # The usual Gstreamer plugins package has a zillion dependencies
-  # that we don't need for a simple mixer, so build a minimal package.
-  gst_plugins_minimal = gst_plugins_base.override {
-    minimalDeps = true;
-  };
-
-in
-
-stdenv.mkDerivation rec {
-  name = "xfce4-mixer-4.6.1";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/xfce4-mixer/4.6/${name}.tar.bz2";
-    sha1 = "e86163782fc4fc31671c7cb212d23d34106ad3af";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool glib gstreamer gst_plugins_minimal gtk
-      libxfce4util libxfcegui4 xfce4panel xfconf makeWrapper
-    ];
-
-  postInstall =
-    ''
-      mkdir -p $out/nix-support
-      echo ${gst_plugins_minimal} > $out/nix-support/propagated-user-env-packages
-    '';
-
-  meta = {
-    homepage = http://www.xfce.org/projects/xfce4-mixer;
-    description = "A volume control application for the Xfce desktop environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/applications/xfce4-power-manager.nix b/pkgs/desktops/xfce-4.6/applications/xfce4-power-manager.nix
deleted file mode 100644
index 65e906f5d83..00000000000
--- a/pkgs/desktops/xfce-4.6/applications/xfce4-power-manager.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, dbus_glib, xfconf
-, libxfcegui4, libxfce4util, libnotify, xfce4panel }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-power-manager-0.8.5";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/xfce4-power-manager/0.8/${name}.tar.bz2";
-    sha1 = "b1ce0f120733ec1a6267d50ba5c2990bbbbccfd4";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk dbus_glib xfconf libxfcegui4 libxfce4util
-      libnotify xfce4panel
-    ];
-
-  NIX_CFLAGS_COMPILE = "-I${libxfcegui4}/include/xfce4";
-
-  meta = {
-    homepage = http://goodies.xfce.org/projects/applications/xfce4-power-manager;
-    description = "A power manager for the Xfce Desktop Environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/art/xfce4-icon-theme.nix b/pkgs/desktops/xfce-4.6/art/xfce4-icon-theme.nix
deleted file mode 100644
index f42790c6216..00000000000
--- a/pkgs/desktops/xfce-4.6/art/xfce4-icon-theme.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-icon-theme-4.4.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/art/xfce4-icon-theme/4.4/${name}.tar.bz2";
-    sha1 = "0c0d0c45cd4a7f609310db8e9d17c1c4a131a6e7";
-  };
-
-  buildInputs = [ pkgconfig intltool gtk ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Icons for Xfce";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/exo.nix b/pkgs/desktops/xfce-4.6/core/exo.nix
deleted file mode 100644
index 5115a402c0d..00000000000
--- a/pkgs/desktops/xfce-4.6/core/exo.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, URI, glib, gtk, libxfce4util
-, enableHAL ? true, hal, dbus_glib }:
-
-stdenv.mkDerivation rec {
-  name = "exo-0.3.107";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha256 = "18z2xmdl577r60ln2waai10dd7i384k0bxrmf7gchrxd9c9aq4ha";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool URI glib gtk libxfce4util ] ++
-    stdenv.lib.optionals enableHAL [ hal dbus_glib ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/exo;
-    description = "Application library for the Xfce desktop environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/gtk-xfce-engine.nix b/pkgs/desktops/xfce-4.6/core/gtk-xfce-engine.nix
deleted file mode 100644
index 156da1c6483..00000000000
--- a/pkgs/desktops/xfce-4.6/core/gtk-xfce-engine.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk }:
-
-stdenv.mkDerivation rec {
-  name = "gtk-xfce-engine-2.6.0";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "a7be2f330833d150c5fb37f68a4c2138348b5446";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "GTK+ theme engine for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/libxfce4menu.nix b/pkgs/desktops/xfce-4.6/core/libxfce4menu.nix
deleted file mode 100644
index fda09979819..00000000000
--- a/pkgs/desktops/xfce-4.6/core/libxfce4menu.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, glib, intltool, gtk, libxfce4util }:
-
-stdenv.mkDerivation rec {
-  name = "libxfce4menu-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce-4.6.2/src/${name}.tar.bz2";
-    sha1 = "32a85c1ad31360347d5a2f240c4ddc08b444d124";
-  };
-
-  buildInputs = [ pkgconfig glib intltool gtk libxfce4util ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Xfce menu support library";
-    license = "LGPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/libxfce4util.nix b/pkgs/desktops/xfce-4.6/core/libxfce4util.nix
deleted file mode 100644
index ca90822cfd0..00000000000
--- a/pkgs/desktops/xfce-4.6/core/libxfce4util.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, glib, intltool }:
-
-stdenv.mkDerivation rec {
-  name = "libxfce4util-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce-4.6.2/src/${name}.tar.bz2";
-    sha256 = "10wcw7r8cjb0farffic037pcjr5bwrjrm8s3jrcb7c0b038pwbmf";
-  };
-
-  buildInputs = [ pkgconfig glib intltool ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Basic utility non-GUI functions for Xfce";
-    license = "bsd";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/thunar.nix b/pkgs/desktops/xfce-4.6/core/thunar.nix
deleted file mode 100644
index 2fecb7814b1..00000000000
--- a/pkgs/desktops/xfce-4.6/core/thunar.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, exo, gtk, libxfce4util
-, dbus_glib, libstartup_notification, xfconf, hal, xfce4panel
-, gamin }:
-
-stdenv.mkDerivation rec {
-  name = "thunar-1.0.2";
-  
-  src = fetchurl {
-    url = http://archive.xfce.org/xfce/4.6.2/src/Thunar-1.0.2.tar.bz2;
-    sha1 = "f7ae00c32402e4bc502aba15477b78e2c558c7c3";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool exo gtk libxfce4util
-      dbus_glib libstartup_notification xfconf xfce4panel gamin
-    ];
-
-  propagatedBuildInputs = [ hal ];
-
-  meta = {
-    homepage = http://thunar.xfce.org/;
-    description = "Xfce file manager";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfce-utils.nix b/pkgs/desktops/xfce-4.6/core/xfce-utils.nix
deleted file mode 100644
index ed2bfc56108..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfce-utils.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfcegui4 }:
-
-stdenv.mkDerivation rec {
-  name = "xfce-utils-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "6373886c3d70e576859741bde747a235567ffd8e";
-  };
-
-  configureFlags = "--with-xsession-prefix=$(out)/share/xsessions";
-
-  buildInputs = [ pkgconfig intltool gtk libxfce4util libxfcegui4 ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Utilities and scripts for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfce4-panel.nix b/pkgs/desktops/xfce-4.6/core/xfce4-panel.nix
deleted file mode 100644
index 7708d019b90..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfce4-panel.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfcegui4
-, libwnck, exo, libstartup_notification }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-panel-4.6.4";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "d2b310c036be84ed9886c06ae35b7a1a8eabfcb8";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util exo libwnck
-      libstartup_notification
-    ];
-
-  propagatedBuildInputs = [ libxfcegui4 ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Xfce panel";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfce4-session.nix b/pkgs/desktops/xfce-4.6/core/xfce4-session.nix
deleted file mode 100644
index fc56be085c4..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfce4-session.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfcegui4
-, libwnck, dbus_glib, xfconf, libglade, xorg }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-session-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "2a5778a1543f97845f118a186e2dbb8a8ea3ff4b";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util libxfcegui4 libwnck dbus_glib
-      xfconf libglade xorg.iceauth
-    ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Session manager for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfce4-settings.nix b/pkgs/desktops/xfce-4.6/core/xfce4-settings.nix
deleted file mode 100644
index 0935955231e..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfce4-settings.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, exo, gtk, libxfce4util, libxfcegui4
-, libglade, xfconf, xorg, libwnck, libnotify }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-settings-4.6.5";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "c036cc2f3100a46b2649e678dff7c0106b219263";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool exo gtk libxfce4util libxfcegui4 libglade
-      xfconf xorg.libXi xorg.libXcursor libwnck libnotify
-    #gtk libxfce4util libxfcegui4 libwnck dbus_glib
-      #xfconf libglade xorg.iceauth
-    ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Settings manager for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfconf.nix b/pkgs/desktops/xfce-4.6/core/xfconf.nix
deleted file mode 100644
index 2fc88bd1258..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfconf.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, glib, libxfce4util, dbus_glib }:
-
-stdenv.mkDerivation rec {
-  name = "xfconf-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "2b9656a1b7f323d2600ddc929191afb50c8018f8";
-  };
-
-  buildInputs = [ pkgconfig intltool glib libxfce4util ];
-
-  propagatedBuildInputs = [ dbus_glib ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Simple client-server configuration storage and query system for Xfce";
-    license = "GPLv2";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfdesktop.nix b/pkgs/desktops/xfce-4.6/core/xfdesktop.nix
deleted file mode 100644
index 90a69bd8692..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfdesktop.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfcegui4
-, libwnck, xfconf, libglade, libxfce4menu, xfce4panel, thunar, exo }:
-
-stdenv.mkDerivation rec {
-  name = "xfdesktop-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha1 = "cefcd1c1386d34386d4e900cbf88b7c24ef3bafb";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util libxfcegui4 libwnck xfconf
-      libglade libxfce4menu xfce4panel thunar exo
-    ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Xfce desktop manager";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/core/xfwm4.nix b/pkgs/desktops/xfce-4.6/core/xfwm4.nix
deleted file mode 100644
index 6e88ef9cd0d..00000000000
--- a/pkgs/desktops/xfce-4.6/core/xfwm4.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, gtk, intltool, libglade, libxfce4util
-, libxfcegui4, xfconf, libwnck, libstartup_notification, xorg }:
-
-stdenv.mkDerivation rec {
-  name = "xfwm4-4.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/xfce/4.6.2/src/${name}.tar.bz2";
-    sha256 = "0a2q2pr5mzp6hsrd0llr90i9wii2qj2054shkpvkain20gp1ja11";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libglade libxfce4util libxfcegui4 xfconf
-      libwnck libstartup_notification
-      xorg.libXcomposite xorg.libXfixes xorg.libXdamage
-    ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Window manager for Xfce";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.6/default.nix b/pkgs/desktops/xfce-4.6/default.nix
deleted file mode 100644
index 1769c3f7a04..00000000000
--- a/pkgs/desktops/xfce-4.6/default.nix
+++ /dev/null
@@ -1,66 +0,0 @@
-{ callPackage, pkgs }:
-
-rec {
-  inherit (pkgs) gtk glib;
-
-  #### CORE
-
-  exo = callPackage ./core/exo.nix {
-    inherit (pkgs.perlPackages) URI;
-  };
-
-  libxfce4util = callPackage ./core/libxfce4util.nix { };
-
-  libxfcegui4 = callPackage ./core/libxfcegui4.nix {
-    inherit (pkgs.gnome) libglade;
-  };
-
-  libxfce4menu = callPackage ./core/libxfce4menu.nix { };
-
-  xfconf = callPackage ./core/xfconf.nix { };
-
-  xfwm4 = callPackage ./core/xfwm4.nix {
-    inherit (pkgs.gnome) libglade libwnck;
-  };
-
-  xfceutils = callPackage ./core/xfce-utils.nix { };
-
-  xfce4session = callPackage ./core/xfce4-session.nix {
-    inherit (pkgs.gnome) libglade libwnck;
-  };
-
-  xfce4settings = callPackage ./core/xfce4-settings.nix {
-    inherit (pkgs.gnome) libglade libwnck;
-  };
-
-  xfce4panel = callPackage ./core/xfce4-panel.nix {
-    inherit (pkgs.gnome) libwnck;
-  };
-
-  xfdesktop = callPackage ./core/xfdesktop.nix {
-    inherit (pkgs.gnome) libwnck libglade;
-  };
-
-  thunar = callPackage ./core/thunar.nix { };
-
-  gtk_xfce_engine = callPackage ./core/gtk-xfce-engine.nix { };
-
-  #### APPLICATIONS
-  
-  terminal = callPackage ./applications/terminal.nix {
-    inherit (pkgs.gnome) vte;
-  };
-
-  mousepad = callPackage ./applications/mousepad.nix { };
-
-  ristretto = callPackage ./applications/ristretto.nix { };
-
-  xfce4_power_manager = callPackage ./applications/xfce4-power-manager.nix { };
-
-  xfce4mixer = callPackage ./applications/xfce4-mixer.nix { };
-
-  #### ART
-
-  xfce4icontheme = callPackage ./art/xfce4-icon-theme.nix { };
-  
-}
diff --git a/pkgs/desktops/xfce-4.8/applications/mousepad.nix b/pkgs/desktops/xfce-4.8/applications/mousepad.nix
deleted file mode 100644
index 395a5c9f084..00000000000
--- a/pkgs/desktops/xfce-4.8/applications/mousepad.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, libxfce4util, libxfcegui4, gtk }:
-
-stdenv.mkDerivation rec {
-  name = "mousepad-0.2.16";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/mousepad/0.2/${name}.tar.bz2";
-    sha1 = "4e63033e0a71578f3ec9a0d2e6a505efd0424ef9";
-  };
-
-  buildInputs = [ pkgconfig intltool libxfce4util libxfcegui4 gtk ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/mousepad/;
-    description = "A simple text editor for Xfce";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/applications/ristretto.nix b/pkgs/desktops/xfce-4.8/applications/ristretto.nix
deleted file mode 100644
index ce90891bb0b..00000000000
--- a/pkgs/desktops/xfce-4.8/applications/ristretto.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, libexif, gtk, thunar
-, exo, dbus_glib, libxfce4util, libxfce4ui, xfconf }:
-
-stdenv.mkDerivation rec {
-  name = "ristretto-0.2.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/ristretto/0.2/${name}.tar.bz2";
-    sha1 = "5a34b865cb9013b67467b0e8d51970f0a1e977d1";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool libexif gtk dbus_glib libxfce4util
-      libxfce4ui xfconf
-    ];
-
-  meta = {
-    homepage = http://goodies.xfce.org/projects/applications/ristretto;
-    description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/applications/terminal.nix b/pkgs/desktops/xfce-4.8/applications/terminal.nix
deleted file mode 100644
index 44aa72d9d8c..00000000000
--- a/pkgs/desktops/xfce-4.8/applications/terminal.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ stdenv, fetchurl
-, pkgconfig, ncurses
-, intltool, vte
-, exo, libxfce4util
-, gtk
-}:
-
-stdenv.mkDerivation {
-  name = "xfce-terminal-0.4.8";
-  
-  src = fetchurl {
-    url = http://archive.xfce.org/src/apps/terminal/0.4/Terminal-0.4.8.tar.bz2;
-    sha1 = "2f12c3a0fffad18976d47e531d404ee308cb2f05";
-  };
-
-  buildInputs = [ pkgconfig intltool exo gtk vte libxfce4util ncurses ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/terminal;
-    description = "A modern terminal emulator primarily for the Xfce desktop environment";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/exo.nix b/pkgs/desktops/xfce-4.8/core/exo.nix
deleted file mode 100644
index 468132a2a81..00000000000
--- a/pkgs/desktops/xfce-4.8/core/exo.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, URI, glib, gtk, libxfce4util }:
-
-stdenv.mkDerivation rec {
-  name = "exo-0.6.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/exo/0.6/${name}.tar.bz2";
-    sha1 = "2486f12c814630068665e22cdf417f0f0f05dab1";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool URI glib gtk libxfce4util ];
-
-  meta = {
-    homepage = http://www.xfce.org/projects/exo;
-    description = "Application library for the Xfce desktop environment";
-    license = "GPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/libxfce4ui.nix b/pkgs/desktops/xfce-4.8/core/libxfce4ui.nix
deleted file mode 100644
index 76c285ae599..00000000000
--- a/pkgs/desktops/xfce-4.8/core/libxfce4ui.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, xfconf
-, libstartup_notification }:
-
-stdenv.mkDerivation rec {
-  name = "libxfce4ui-4.8.1";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/libxfce4ui/4.8/${name}.tar.bz2";
-    sha1 = "408645581e589135aa03d2e9b84f4eede68596b2";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util xfconf
-      libstartup_notification
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Basic GUI library for Xfce";
-    license = "LGPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/libxfcegui4.nix b/pkgs/desktops/xfce-4.8/core/libxfcegui4.nix
deleted file mode 100644
index 20e82a2c92f..00000000000
--- a/pkgs/desktops/xfce-4.8/core/libxfcegui4.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, xfconf
-, libglade, libstartup_notification }:
-
-stdenv.mkDerivation rec {
-  name = "libxfcegui4-4.8.1";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/libxfcegui4/4.8/${name}.tar.bz2";
-    sha1 = "246fcaa71fc8cf44dae0b4c919411231eedd662f";
-  };
-
-  # By default, libxfcegui4 tries to install into libglade's prefix.
-  # Install into our own prefix instead.
-  preConfigure =
-    ''
-      configureFlags="--with-libglade-module-path=$out/lib/libglade/2.0"
-    '';
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util libglade
-      libstartup_notification
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Basic GUI library for Xfce";
-    license = "LGPLv2+";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/thunar.nix b/pkgs/desktops/xfce-4.8/core/thunar.nix
deleted file mode 100644
index 07fd734a1f2..00000000000
--- a/pkgs/desktops/xfce-4.8/core/thunar.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, exo, gtk, libxfce4util, libxfce4ui
-, dbus_glib, libstartup_notification, xfconf, xfce4panel, udev, libnotify }:
-
-stdenv.mkDerivation rec {
-  version = "1.2.3";
-  name = "thunar-${version}";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/thunar/1.2/Thunar-${version}.tar.bz2";
-    sha1 = "a05d0e14515d70c5ad94cca881822a707d366863";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk exo libxfce4util libxfce4ui
-      dbus_glib libstartup_notification xfconf xfce4panel udev libnotify
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://thunar.xfce.org/;
-    description = "Xfce file manager";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfce4-panel.nix b/pkgs/desktops/xfce-4.8/core/xfce4-panel.nix
deleted file mode 100644
index bb263712962..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfce4-panel.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, garcon
-, libxfce4ui, xfconf, libwnck, exo }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-panel-4.8.6";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfce4-panel/4.8/${name}.tar.bz2";
-    sha1 = "332fc968332e6271e1bb65d6de8de2524b0440ec";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util garcon libxfce4ui xfconf
-      exo libwnck
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Xfce panel";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfce4-session.nix b/pkgs/desktops/xfce-4.8/core/xfce4-session.nix
deleted file mode 100644
index 0e0f1a86939..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfce4-session.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui
-, libwnck, dbus_glib, xfconf, xorg, xfce4panel }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-session-4.8.2";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfce4-session/4.8/${name}.tar.bz2";
-    sha1 = "636c2983552861a959225e554898675152a4d812";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util libxfce4ui libwnck dbus_glib
-      xfconf xorg.iceauth xfce4panel
-    ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Session manager for Xfce";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfce4-settings.nix b/pkgs/desktops/xfce-4.8/core/xfce4-settings.nix
deleted file mode 100644
index dc6e8e555b2..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfce4-settings.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, exo, gtk, libxfce4util, libxfce4ui
-, xfconf, xorg, libnotify, libxklavier }:
-
-stdenv.mkDerivation rec {
-  name = "xfce4-settings-4.8.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfce4-settings/4.8/${name}.tar.bz2";
-    sha1 = "98431633ba3ec2a4a10182bc7266904d9256949b";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool exo gtk libxfce4util libxfce4ui
-      xfconf libnotify xorg.libXcursor libxklavier
-    ];
-
-  configureFlags = "--enable-pluggable-dialogs --enable-sound-settings";
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Settings manager for Xfce";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfconf.nix b/pkgs/desktops/xfce-4.8/core/xfconf.nix
deleted file mode 100644
index e0c61d3a1f5..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfconf.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, glib, libxfce4util, dbus_glib }:
-
-stdenv.mkDerivation rec {
-  name = "xfconf-4.8.1";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfconf/4.8/${name}.tar.bz2";
-    sha1 = "aeab124f7c548e387b37a5476e594ef559515533";
-  };
-
-  buildInputs = [ pkgconfig intltool glib libxfce4util ];
-
-  propagatedBuildInputs = [ dbus_glib ];
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Simple client-server configuration storage and query system for Xfce";
-    license = "GPLv2";
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfdesktop.nix b/pkgs/desktops/xfce-4.8/core/xfdesktop.nix
deleted file mode 100644
index 45c82f1ec02..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfdesktop.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, dbus_glib, libxfce4util
-, libxfce4ui, libwnck, xfconf, garcon, libnotify, exo }:
-
-stdenv.mkDerivation rec {
-  name = "xfdesktop-4.8.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfdesktop/4.8/${name}.tar.bz2";
-    sha1 = "b3af72a69627f860f22b37d021efd81e4e37eb55";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk dbus_glib libxfce4util libxfce4ui libwnck xfconf
-      garcon libnotify exo
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Xfce desktop manager";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/core/xfwm4.nix b/pkgs/desktops/xfce-4.8/core/xfwm4.nix
deleted file mode 100644
index c0f89784bfb..00000000000
--- a/pkgs/desktops/xfce-4.8/core/xfwm4.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, gtk, intltool, libxfce4util
-, libxfce4ui, xfconf, libwnck, libstartup_notification, xorg }:
-
-stdenv.mkDerivation rec {
-  name = "xfwm4-4.8.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfwm4/4.8/${name}.tar.bz2";
-    sha1 = "6d27deca383e0c2fba0cede0bbe0e9aee18e9257";
-  };
-
-  buildInputs =
-    [ pkgconfig intltool gtk libxfce4util libxfce4ui xfconf
-      libwnck libstartup_notification
-      xorg.libXcomposite xorg.libXfixes xorg.libXdamage
-    ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.xfce.org/;
-    description = "Window manager for Xfce";
-    license = "GPLv2+";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/default.nix b/pkgs/desktops/xfce-4.8/default.nix
deleted file mode 100644
index 8e6f7c10234..00000000000
--- a/pkgs/desktops/xfce-4.8/default.nix
+++ /dev/null
@@ -1,83 +0,0 @@
-{ callPackage, pkgs }:
-
-rec {
-  inherit (pkgs) gtk glib;
-
-  #### SUPPORT
-
-  # The useful bits from ‘gnome-disk-utility’.
-  libgdu = callPackage ./support/libgdu.nix { };  
-
-  # Gvfs is required by Thunar for the trash feature and for volume
-  # mounting.  Should use the one from Gnome, but I don't want to mess
-  # with the Gnome packages (or pull in a zillion Gnome dependencies).
-  gvfs = callPackage ./support/gvfs.nix { };
-
-  
-  #### CORE
-
-  libxfce4util = callPackage ./core/libxfce4util.nix { };
-
-  exo = callPackage ./core/exo.nix {
-    inherit (pkgs.perlPackages) URI;
-  };
-
-  xfconf = callPackage ./core/xfconf.nix { };
-  
-  libxfcegui4 = callPackage ./core/libxfcegui4.nix {
-    inherit (pkgs.gnome) libglade;
-  };
-
-  libxfce4ui = callPackage ./core/libxfce4ui.nix { };
-
-  xfwm4 = callPackage ./core/xfwm4.nix {
-    inherit (pkgs.gnome) libwnck;
-  };
-
-  xfceutils = callPackage ./core/xfce-utils.nix { };
-
-  garcon = callPackage ./core/garcon.nix { };
-
-  xfce4panel = callPackage ./core/xfce4-panel.nix {
-    inherit (pkgs.gnome) libwnck;
-  };
-
-  xfce4session = callPackage ./core/xfce4-session.nix {
-    inherit (pkgs.gnome) libwnck;
-  };
-
-  xfce4settings = callPackage ./core/xfce4-settings.nix { };
-
-  xfdesktop = callPackage ./core/xfdesktop.nix {
-    inherit (pkgs.gnome) libwnck;
-  };
-
-  thunar = callPackage ./core/thunar.nix { };
-
-  thunar_volman = callPackage ./core/thunar-volman.nix { };
-
-  gtk_xfce_engine = callPackage ./core/gtk-xfce-engine.nix { };
-
-  xfce4_appfinder = callPackage ./core/xfce4-appfinder.nix { };
-
-
-  #### APPLICATIONS
-  
-  terminal = callPackage ./applications/terminal.nix {
-    inherit (pkgs.gnome) vte;
-  };
-
-  mousepad = callPackage ./applications/mousepad.nix { };
-
-  ristretto = callPackage ./applications/ristretto.nix { };
-
-  xfce4_power_manager = callPackage ./applications/xfce4-power-manager.nix { };
-
-  xfce4mixer = callPackage ./applications/xfce4-mixer.nix { };
-
-  
-  #### ART
-
-  xfce4icontheme = callPackage ./art/xfce4-icon-theme.nix { };
-  
-}
diff --git a/pkgs/desktops/xfce-4.8/support/gvfs.nix b/pkgs/desktops/xfce-4.8/support/gvfs.nix
deleted file mode 100644
index 33f7315a9d9..00000000000
--- a/pkgs/desktops/xfce-4.8/support/gvfs.nix
+++ /dev/null
@@ -1,18 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, glib, dbus, intltool, udev, libgdu, fuse }:
-
-stdenv.mkDerivation rec {
-  name = "gvfs-1.8.2";
-  
-  src = fetchurl {
-    url = "mirror://gnome/sources/gvfs/1.8/${name}.tar.bz2";
-    sha256 = "0895ac8f6d416e1b15433b6b6b68eb119c6e8b04fdb66db665d684355ef89345";
-  };
-
-  buildInputs = [ pkgconfig glib dbus.libs intltool udev libgdu fuse ];
-
-  meta = {
-    description = "Virtual Filesystem support library (for Xfce)";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-  };
-}
diff --git a/pkgs/desktops/xfce-4.8/support/libgdu-only.patch b/pkgs/desktops/xfce-4.8/support/libgdu-only.patch
deleted file mode 100644
index c5873c71681..00000000000
--- a/pkgs/desktops/xfce-4.8/support/libgdu-only.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-diff -ru -x '*~' gnome-disk-utility-2.30.1-orig/configure.ac gnome-disk-utility-2.30.1/configure.ac
---- gnome-disk-utility-2.30.1-orig/configure.ac	2010-03-22 16:54:09.000000000 +0100
-+++ gnome-disk-utility-2.30.1/configure.ac	2011-09-06 02:52:09.000000000 +0200
-@@ -106,17 +106,6 @@
- # GNOME
- # *****
- 
--GNOME_COMMON_INIT
--GNOME_DOC_INIT
--GNOME_DEBUG_CHECK
--GNOME_COMPILE_WARNINGS([maximum])
--GNOME_MAINTAINER_MODE_DEFINES
--
--AC_ARG_ENABLE(gtk-doc, AS_HELP_STRING([--enable-gtk-doc],
--  [use gtk-doc to build documentation [default=yes]]),,
--  enable_gtk_doc=yes)
--GTK_DOC_CHECK([1.3])
--
- # ***************************
- # Check for required packages
- # ***************************
-@@ -130,7 +119,6 @@
- UNIQUE_REQUIRED=1.0
- LIBNOTIFY_REQUIRED=0.3.0
- NAUTILUS_REQUIRED=2.24.0
--AVAHI_UI_REQUIRED=0.6.25
- 
- UDISKS_REQUIRED=1.0.0
- UDISKS_NEXT_ABI_INCOMPATIBLE_VERSION=1.1.0
-@@ -144,13 +132,7 @@
- PKG_CHECK_MODULES(GIO_UNIX2, [gio-unix-2.0 >= $GIO2_REQUIRED])
- PKG_CHECK_MODULES(GTHREAD2, [gthread-2.0 >= $GLIB2_REQUIRED])
- PKG_CHECK_MODULES(DBUS_GLIB, [dbus-glib-1 >= $DBUS_GLIB_REQUIRED])
--PKG_CHECK_MODULES(GTK2, [gtk+-2.0 >= $GTK2_REQUIRED])
--PKG_CHECK_MODULES(UNIQUE, [unique-1.0 >= $UNIQUE_REQUIRED])
--PKG_CHECK_MODULES(LIBNOTIFY, [libnotify  >= $LIBNOTIFY_REQUIRED])
- PKG_CHECK_MODULES(UDISKS, [udisks  >= $UDISKS_REQUIRED udisks < $UDISKS_NEXT_ABI_INCOMPATIBLE_VERSION])
--PKG_CHECK_MODULES(X11, [x11])
--PKG_CHECK_MODULES(LIBATASMART, [libatasmart >= 0.14])
--PKG_CHECK_MODULES(AVAHI_UI, [avahi-ui >= $AVAHI_UI_REQUIRED])
- 
- # *************
- # Remote Access
-@@ -183,21 +165,10 @@
- AC_SUBST(GNOME_KEYRING_CFLAGS)
- AM_CONDITIONAL(ENABLE_GNOME_KEYRING, [test "$have_gnome_keyring" = "yes"])
- 
--# *************
--# Documentation
--# *************
--
--AC_PATH_PROG(SCROLLKEEPER_CONFIG, scrollkeeper-config,no)
--if test x$SCROLLKEEPER_CONFIG = xno; then
--  AC_MSG_ERROR(Couldn't find scrollkeeper-config, please install the scrollkeeper package)
--fi
--
- # ********************
- # Internationalization
- # ********************
- 
--IT_PROG_INTLTOOL([$INTLTOOL_REQUIRED])
--
- GETTEXT_PACKAGE=gnome-disk-utility
- AC_SUBST([GETTEXT_PACKAGE])
- AM_GLIB_GNU_GETTEXT
-diff -ru -x '*~' gnome-disk-utility-2.30.1-orig/doc/Makefile.am gnome-disk-utility-2.30.1/doc/Makefile.am
---- gnome-disk-utility-2.30.1-orig/doc/Makefile.am	2009-12-02 20:52:38.000000000 +0100
-+++ gnome-disk-utility-2.30.1/doc/Makefile.am	2011-09-06 02:17:15.000000000 +0200
-@@ -70,9 +70,7 @@
- 	Makefile.in			\
- 	$(NULL)
- 
--include $(top_srcdir)/gtk-doc.make
--
--CLEANFILES +=   *~						\
-+CLEANFILES =   *~						\
- 		gnome-disk-utility-scan*			\
- 		gnome-disk-utility.args				\
- 		gnome-disk-utility.hierarchy			\
-@@ -91,4 +89,4 @@
- 		$(NULL)
- 
- # Version information for marking the documentation
--EXTRA_DIST += version.xml.in
-+EXTRA_DIST = version.xml.in
-diff -ru -x '*~' gnome-disk-utility-2.30.1-orig/gtk-doc.make gnome-disk-utility-2.30.1/gtk-doc.make
---- gnome-disk-utility-2.30.1-orig/gtk-doc.make	2010-03-16 00:08:20.000000000 +0100
-+++ gnome-disk-utility-2.30.1/gtk-doc.make	2011-09-06 02:15:33.000000000 +0200
-@@ -4,15 +4,9 @@
- # Everything below here is generic #
- ####################################
- 
--if GTK_DOC_USE_LIBTOOL
--GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
--GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
--GTKDOC_RUN = $(LIBTOOL) --mode=execute
--else
- GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
- GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
- GTKDOC_RUN =
--endif
- 
- # We set GPATH here; this gives us semantics for GNU make
- # which are more like other make's VPATH, when it comes to
-@@ -49,22 +43,7 @@
- 
- CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
- 
--if ENABLE_GTK_DOC
--if GTK_DOC_BUILD_HTML
--HTML_BUILD_STAMP=html-build.stamp
--else
--HTML_BUILD_STAMP=
--endif
--if GTK_DOC_BUILD_PDF
--PDF_BUILD_STAMP=pdf-build.stamp
--else
--PDF_BUILD_STAMP=
--endif
--
--all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
--else
- all-local:
--endif
- 
- docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
- 
-diff -ru -x '*~' gnome-disk-utility-2.30.1-orig/help/Makefile.am gnome-disk-utility-2.30.1/help/Makefile.am
---- gnome-disk-utility-2.30.1-orig/help/Makefile.am	2009-09-23 20:35:01.000000000 +0200
-+++ gnome-disk-utility-2.30.1/help/Makefile.am	2011-09-06 02:18:13.000000000 +0200
-@@ -1,4 +1,3 @@
--include $(top_srcdir)/gnome-doc-utils.make
- dist-hook: doc-dist-hook
- 
- DOC_MODULE = palimpsest
-diff -ru -x '*~' gnome-disk-utility-2.30.1-orig/Makefile.am gnome-disk-utility-2.30.1/Makefile.am
---- gnome-disk-utility-2.30.1-orig/Makefile.am	2010-03-16 00:12:39.000000000 +0100
-+++ gnome-disk-utility-2.30.1/Makefile.am	2011-09-06 02:17:34.000000000 +0200
-@@ -1,4 +1,4 @@
--SUBDIRS = src data doc help po
-+SUBDIRS = src data
- 
- EXTRA_DIST = \
- 	autogen.sh		\
diff --git a/pkgs/desktops/xfce-4.8/support/libgdu.nix b/pkgs/desktops/xfce-4.8/support/libgdu.nix
deleted file mode 100644
index 32835f0434a..00000000000
--- a/pkgs/desktops/xfce-4.8/support/libgdu.nix
+++ /dev/null
@@ -1,34 +0,0 @@
-{ stdenv, fetchurl, gnome, pkgconfig, glib, dbus_glib, intltool, udev, gtk
-, libnotify, udisks, libatasmart, avahi
-, autoconf, automake, libtool }:
-
-let version = "2.30.1"; in
-
-stdenv.mkDerivation rec {
-  name = "libgdu-${version}";
-  
-  src = fetchurl {
-    url = "mirror://gnome/sources/gnome-disk-utility/2.30/gnome-disk-utility-${version}.tar.bz2";
-    sha256 = "df9b336c780b5d77ceda54e96f7c37c67645f5e73d48754ba0a8efba7c1836d7";
-  };
-
-  # Only build libgdu, not all that Gnome crap.
-  patches = [ ./libgdu-only.patch ];
-
-  buildInputs =
-    [ pkgconfig glib dbus_glib udisks
-      autoconf automake libtool
-    ];
-
-  preConfigure =
-    ''
-      substituteInPlace src/gdu/Makefile.am --replace /usr/share/dbus-1/interfaces ${udisks}/share/dbus-1/interfaces
-      autoreconf -f -i
-    '';
-
-  postConfigure = "cd src/gdu";
-
-  meta = {
-    description = "Xfce/Gvfs support library for mounting filesystems";
-  };
-}
diff --git a/pkgs/desktops/xfce/applications/gigolo.nix b/pkgs/desktops/xfce/applications/gigolo.nix
new file mode 100644
index 00000000000..b54ea8cc623
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/gigolo.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, python, gettext, intltool, pkgconfig, gtk, gvfs }:
+
+stdenv.mkDerivation rec {
+  p_name  = "gigolo";
+  ver_maj = "0.4";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1y8p9bbv1a4qgbxl4vn6zbag3gb7gl8qj75cmhgrrw9zrvqbbww2";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ python gettext intltool gtk pkgconfig gvfs];
+
+  preConfigure = ''
+    sed -i "waf" -e "1 s^.*/env[ ]*python^#!${python}/bin/python^";
+  '';
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/applications/${p_name}";
+    description = "A frontend to easily manage connections to remote filesystems";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/xfce/applications/mousepad.nix b/pkgs/desktops/xfce/applications/mousepad.nix
new file mode 100644
index 00000000000..9bc9634469c
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/mousepad.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libxfce4util, libxfcegui4
+, gtk, gtksourceview, dbus, dbus_glib }:
+
+stdenv.mkDerivation rec {
+  p_name  = "mousepad";
+  ver_maj = "0.3";
+  ver_min = "0";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0v84zwhjv2xynvisn5vmp7dbxfj4l4258m82ks7hn3adk437bwhh";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [
+    pkgconfig intltool libxfce4util libxfcegui4
+    gtk gtksourceview dbus dbus_glib
+  ];
+
+  meta = {
+    homepage = http://www.xfce.org/;
+    description = "A simple text editor for Xfce";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/desktops/xfce/applications/ristretto.nix b/pkgs/desktops/xfce/applications/ristretto.nix
new file mode 100644
index 00000000000..a42e882710a
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/ristretto.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libexif, gtk
+, exo, dbus_glib, libxfce4util, libxfce4ui, xfconf }:
+
+stdenv.mkDerivation rec {
+  p_name  = "ristretto";
+  ver_maj = "0.6";
+  ver_min = "3";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0y9d8w1plwp4vmxs44y8k8x15i0k0xln89k6jndhv6lf57g1cs1b";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs =
+    [ pkgconfig intltool libexif gtk dbus_glib exo libxfce4util
+      libxfce4ui xfconf
+    ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/applications/${p_name}";
+    description = "A fast and lightweight picture-viewer for the Xfce desktop environment";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/applications/terminal.nix b/pkgs/desktops/xfce/applications/terminal.nix
new file mode 100644
index 00000000000..1c795a5a5fa
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/terminal.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, intltool, ncurses, gtk, vte, dbus_glib
+, exo, libxfce4util, libxfce4ui
+}:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-terminal";
+  ver_maj = "0.6";
+  ver_min = "2";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0d9vbkvbxxhv022mwyihrabmj8y9097bp57n1a412qyji0i454ix";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool exo gtk vte libxfce4util ncurses dbus_glib libxfce4ui ];
+
+  meta = {
+    homepage = http://www.xfce.org/projects/terminal;
+    description = "A modern terminal emulator primarily for the Xfce desktop environment";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/applications/xfce4-mixer.nix b/pkgs/desktops/xfce/applications/xfce4-mixer.nix
index 2f1ab8a8e93..972442dc56b 100644
--- a/pkgs/desktops/xfce-4.8/applications/xfce4-mixer.nix
+++ b/pkgs/desktops/xfce/applications/xfce4-mixer.nix
@@ -1,8 +1,7 @@
-{ stdenv, fetchurl, pkgconfig, intltool, glib, gstreamer, gst_plugins_base
-, gtk, libxfce4util, libxfce4ui, xfce4panel, xfconf }:
+{ stdenv, fetchurl, pkgconfig, intltool, glib, gstreamer, gst_plugins_base, gtk
+, libxfce4util, libxfce4ui, xfce4panel, xfconf, libunique?null }:
 
 let
-
   # The usual Gstreamer plugins package has a zillion dependencies
   # that we don't need for a simple mixer, so build a minimal package.
   gst_plugins_minimal = gst_plugins_base.override {
@@ -12,16 +11,19 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "xfce4-mixer-4.8.0";
-  
+  p_name  = "xfce4-mixer";
+  ver_maj = "4.10";
+  ver_min = "0";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/xfce4-mixer/4.8/${name}.tar.bz2";
-    sha1 = "24f3401a68f10d2c620e354a6de98e09fe808665";
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1pnsd00583l7p5d80rxbh58brzy3jnccwikbbbm730a33c08kid8";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs =
     [ pkgconfig intltool glib gstreamer gst_plugins_minimal gtk
-      libxfce4util libxfce4ui xfce4panel xfconf
+      libxfce4util libxfce4ui xfce4panel xfconf libunique
     ];
 
   postInstall =
@@ -31,7 +33,7 @@ stdenv.mkDerivation rec {
     '';
 
   meta = {
-    homepage = http://www.xfce.org/projects/xfce4-mixer;
+    homepage = http://www.xfce.org/projects/xfce4-mixer; # referenced but inactive
     description = "A volume control application for the Xfce desktop environment";
     license = "GPLv2+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/desktops/xfce/applications/xfce4-notifyd.nix b/pkgs/desktops/xfce/applications/xfce4-notifyd.nix
new file mode 100644
index 00000000000..5873ef9cd68
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/xfce4-notifyd.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libnotify
+, gtk , libxfce4util, libxfce4ui, xfconf }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-notifyd";
+  ver_maj = "0.2";
+  ver_min = "3";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0fx6z89rxs6ypb8bb6l1pg8fdbxn995fgs413sbhnaxjkm6gch6x";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool libnotify gtk libxfce4util libxfce4ui xfconf ];
+
+  preFixup = ''
+    rm $out/share/icons/hicolor/icon-theme.cache
+    # to be able to run the daemon we need it in PATH
+    ln -rs $out/lib/xfce4/notifyd/xfce4-notifyd $out/bin
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/applications/${p_name}";
+    description = "Notification daemon for Xfce";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/desktops/xfce/applications/xfce4-taskmanager.nix b/pkgs/desktops/xfce/applications/xfce4-taskmanager.nix
new file mode 100644
index 00000000000..baef6872848
--- /dev/null
+++ b/pkgs/desktops/xfce/applications/xfce4-taskmanager.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, intltool, pkgconfig, gtk, libwnck }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-taskmanager";
+  ver_maj = "1.0";
+  ver_min = "0";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1vm9gw7j4ngjlpdhnwdf7ifx6xrrn21011almx2vwidhk2f9zvy0";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ intltool pkgconfig gtk libwnck ];
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/applications/${p_name}";
+    description = "Easy to use task manager for Xfce";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/art/xfce4-icon-theme.nix b/pkgs/desktops/xfce/art/xfce4-icon-theme.nix
index afa934b6031..1bd257991c9 100644
--- a/pkgs/desktops/xfce-4.8/art/xfce4-icon-theme.nix
+++ b/pkgs/desktops/xfce/art/xfce4-icon-theme.nix
@@ -1,12 +1,15 @@
 { stdenv, fetchurl, pkgconfig, intltool, gtk }:
 
 stdenv.mkDerivation rec {
-  name = "xfce4-icon-theme-4.4.3";
-  
+  p_name  = "xfce4-icon-theme";
+  ver_maj = "4.4";
+  ver_min = "3";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/art/xfce4-icon-theme/4.4/${name}.tar.bz2";
-    sha1 = "0c0d0c45cd4a7f609310db8e9d17c1c4a131a6e7";
+    url = "mirror://xfce/src/art/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1yk6rx3zr9grm4jwpjvqdkl13pisy7qn1wm5cqzmd2kbsn96cy6l";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs = [ pkgconfig intltool gtk ];
 
diff --git a/pkgs/desktops/xfce/core/exo.nix b/pkgs/desktops/xfce/core/exo.nix
new file mode 100644
index 00000000000..3131ea679b0
--- /dev/null
+++ b/pkgs/desktops/xfce/core/exo.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, intltool, URI, glib, gtk, libxfce4ui, libxfce4util }:
+
+stdenv.mkDerivation rec {
+  p_name  = "exo";
+  ver_maj = "0.10";
+  ver_min = "2";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1kknxiz703q4snmry65ajm26jwjslbgpzdal6bd090m3z25q51dk";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool URI glib gtk libxfce4ui libxfce4util ];
+
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = "http://www.xfce.org/projects/${p_name}";
+    description = "Application library for the Xfce desktop environment";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/core/garcon.nix b/pkgs/desktops/xfce/core/garcon.nix
index 7f5f18173b2..33b64cd878e 100644
--- a/pkgs/desktops/xfce-4.8/core/garcon.nix
+++ b/pkgs/desktops/xfce/core/garcon.nix
@@ -1,12 +1,15 @@
 { stdenv, fetchurl, pkgconfig, intltool, glib, libxfce4util }:
 
 stdenv.mkDerivation rec {
-  name = "garcon-0.1.9";
-  
+  p_name  = "garcon";
+  ver_maj = "0.2";
+  ver_min = "1";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/garcon/0.1/${name}.tar.bz2";
-    sha1 = "2eeab19bc10747a40b44afd4598a2f555eb69952";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1xq14wayk07cil04yhrdkjhacz9dbldcl9i59sbrgrgznaw49dj8";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs = [ pkgconfig intltool glib libxfce4util ];
 
diff --git a/pkgs/desktops/xfce-4.8/core/gtk-xfce-engine.nix b/pkgs/desktops/xfce/core/gtk-xfce-engine.nix
index 4518897cc2f..a97a11c6f12 100644
--- a/pkgs/desktops/xfce-4.8/core/gtk-xfce-engine.nix
+++ b/pkgs/desktops/xfce/core/gtk-xfce-engine.nix
@@ -1,15 +1,18 @@
 { stdenv, fetchurl, pkgconfig, intltool, gtk }:
 
 stdenv.mkDerivation rec {
-  name = "gtk-xfce-engine-2.8.1";
-  
+  p_name  = "gtk-xfce-engine";
+  ver_maj = "3.0";
+  ver_min = "1";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/gtk-xfce-engine/2.8/${name}.tar.bz2";
-    sha1 = "d7779f07cc76585be063bc25fa91e660e1fd9c97";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0vd0ly81540f9133abza56mlqqx1swp0j70ll8kf948sva0wy0zb";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
-  buildInputs =
-    [ pkgconfig intltool gtk ];
+  #TODO: gtk3
+  buildInputs = [ pkgconfig intltool gtk ];
 
   meta = {
     homepage = http://www.xfce.org/;
diff --git a/pkgs/desktops/xfce-4.6/core/libxfcegui4.nix b/pkgs/desktops/xfce/core/libxfce4ui.nix
index 056853f9eb1..4f0e7062e45 100644
--- a/pkgs/desktops/xfce-4.6/core/libxfcegui4.nix
+++ b/pkgs/desktops/xfce/core/libxfce4ui.nix
@@ -2,14 +2,17 @@
 , libglade, libstartup_notification }:
 
 stdenv.mkDerivation rec {
-  name = "libxfcegui4-4.6.4";
-  
+  p_name  = "libxfce4ui";
+  ver_maj = "4.10";
+  ver_min = "0";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/xfce-4.6.2/src/${name}.tar.bz2";
-    sha1 = "a12c79f8fa14c5d1fc0fca5615a451b7d23f8695";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1qm31s6568cz4c8rl9fsfq0xmf7pldxm0ki62gx1cpybihlgmfd2";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
-  # By default, libxfcegui4 tries to install into libglade's prefix.
+  #TODO: gladeui
   # Install into our own prefix instead.
   preConfigure =
     ''
@@ -21,6 +24,8 @@ stdenv.mkDerivation rec {
       libstartup_notification
     ];
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://www.xfce.org/;
     description = "Basic GUI library for Xfce";
diff --git a/pkgs/desktops/xfce-4.8/core/libxfce4util.nix b/pkgs/desktops/xfce/core/libxfce4util.nix
index 7a567d62935..88874722b7d 100644
--- a/pkgs/desktops/xfce-4.8/core/libxfce4util.nix
+++ b/pkgs/desktops/xfce/core/libxfce4util.nix
@@ -1,12 +1,15 @@
 { stdenv, fetchurl, pkgconfig, glib, intltool }:
 
 stdenv.mkDerivation rec {
-  name = "libxfce4util-4.8.2";
-  
+  p_name  = "libxfce4util";
+  ver_maj = "4.10";
+  ver_min = "0";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/libxfce4util/4.8/${name}.tar.bz2";
-    sha1 = "e7498c2e5fca2c89dfef89e0788f10eebbd020c3";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "13k0wwbbqvdmbj4xmk4nxdlgvrdgr5y6r3dk380mzfw053hzwy89";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs = [ pkgconfig glib intltool ];
 
diff --git a/pkgs/desktops/xfce/core/libxfcegui4.nix b/pkgs/desktops/xfce/core/libxfcegui4.nix
new file mode 100644
index 00000000000..e30fcf22357
--- /dev/null
+++ b/pkgs/desktops/xfce/core/libxfcegui4.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk
+, libxfce4util, xfconf, libglade, libstartup_notification }:
+
+stdenv.mkDerivation rec {
+  p_name  = "libxfcegui4";
+  ver_maj = "4.10";
+  ver_min = "0";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0cs5im0ib0cmr1lhr5765yliqjfyxvk4kwy8h1l8bn3mj6bzk0ib";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  #TODO: gladeui
+  # By default, libxfcegui4 tries to install into libglade's prefix.
+  # Install into our own prefix instead.
+  preConfigure =
+    ''
+      configureFlags="--with-libglade-module-path=$out/lib/libglade/2.0"
+    '';
+  #NOTE: missing keyboard library support is OK according to the mailing-list
+
+  buildInputs =
+    [ pkgconfig intltool gtk libxfce4util xfconf libglade
+      libstartup_notification
+    ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = http://www.xfce.org/;
+    description = "Basic GUI library for Xfce";
+    license = "LGPLv2+";
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/core/thunar-volman.nix b/pkgs/desktops/xfce/core/thunar-volman.nix
index 490390d1bac..94fc0e369e5 100644
--- a/pkgs/desktops/xfce-4.8/core/thunar-volman.nix
+++ b/pkgs/desktops/xfce/core/thunar-volman.nix
@@ -2,22 +2,26 @@
 , xfconf, udev, libnotify }:
 
 stdenv.mkDerivation rec {
-  name = "thunar-volman-0.6.0";
-  
+  p_name  = "thunar-volman";
+  ver_maj = "0.8";
+  ver_min = "0";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/thunar-volman/0.6/${name}.tar.bz2";
-    sha1 = "dcda936948623b342b290a78c294f71c038e832e";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1sxw09fwyn5sr6ipxk7r8gqjyf41c2v7vkgl0l6mhy5mcb48f27z";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs =
     [ pkgconfig intltool exo gtk udev libxfce4ui libxfce4util
       xfconf libnotify
     ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
 
   enableParallelBuilding = true;
 
   meta = {
-    homepage = http://thunar.xfce.org/;
+    homepage = http://goodies.xfce.org/projects/thunar-plugins/thunar-volman;
     description = "Thunar extension for automatic management of removable drives and media";
     license = "GPLv2+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/desktops/xfce/core/thunar.nix b/pkgs/desktops/xfce/core/thunar.nix
new file mode 100644
index 00000000000..919d19a2302
--- /dev/null
+++ b/pkgs/desktops/xfce/core/thunar.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, intltool
+, gtk, dbus_glib, libstartup_notification, libnotify, libexif, pcre, udev
+, exo, libxfce4util,  xfconf, xfce4panel
+}:
+
+stdenv.mkDerivation rec {
+  p_name  = "thunar";
+  ver_maj = "1.6";
+  ver_min = "3";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/Thunar-${ver_maj}.${ver_min}.tar.bz2";
+    sha256 = "17api7nc3h93k2mzrfmw6ygc0fqmg78ja0qbkzd9rhhsi3v0c9ws";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [
+    pkgconfig intltool
+    gtk dbus_glib libstartup_notification libnotify libexif pcre udev
+    exo libxfce4util xfconf xfce4panel
+  ];
+  # TODO: optionality?
+
+  enableParallelBuilding = true;
+
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = http://thunar.xfce.org/;
+    description = "Xfce file manager";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/core/tumbler.nix b/pkgs/desktops/xfce/core/tumbler.nix
new file mode 100644
index 00000000000..1e7c3c5127e
--- /dev/null
+++ b/pkgs/desktops/xfce/core/tumbler.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pkgconfig, intltool, dbus_glib, gdk_pixbuf }:
+
+stdenv.mkDerivation rec {
+  p_name  = "tumbler";
+  ver_maj = "0.1";
+  ver_min = "29";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "14zw69x5979d19brjbyq81wvbikb13vgv901gxnbw8lyc3pc9fn3";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool dbus_glib gdk_pixbuf ];
+
+  meta = {
+    homepage = http://git.xfce.org/xfce/tumbler/;
+    description = "A D-Bus thumbnailer service";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/core/xfce-utils.nix b/pkgs/desktops/xfce/core/xfce-utils.nix
index fde8a2c3953..625780adb31 100644
--- a/pkgs/desktops/xfce-4.8/core/xfce-utils.nix
+++ b/pkgs/desktops/xfce/core/xfce-utils.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui }:
+{ v, h, stdenv, fetchXfce, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui, dbus_glib }:
 
 stdenv.mkDerivation rec {
-  name = "xfce-utils-4.8.3";
-  
-  src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfce-utils/4.8/${name}.tar.bz2";
-    sha1 = "159d445b689ebbf73462a4b4baf5cce4e04afaab";
-  };
+  name = "xfce-utils-${v}";
+  src = fetchXfce.core name h;
 
   configureFlags = "--with-xsession-prefix=$(out)/share/xsessions --with-vendor-info=NixOS.org";
 
-  buildInputs = [ pkgconfig intltool gtk libxfce4util libxfce4ui ];
+  buildInputs = [ pkgconfig intltool gtk libxfce4util libxfce4ui dbus_glib ];
+
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
 
   meta = {
-    homepage = http://www.xfce.org/;
+    homepage = http://www.xfce.org/projects/xfce-utils;
     description = "Utilities and scripts for Xfce";
     license = "GPLv2+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/desktops/xfce-4.8/core/xfce4-appfinder.nix b/pkgs/desktops/xfce/core/xfce4-appfinder.nix
index b8165ebb178..b4c9c790ac1 100644
--- a/pkgs/desktops/xfce-4.8/core/xfce4-appfinder.nix
+++ b/pkgs/desktops/xfce/core/xfce4-appfinder.nix
@@ -2,12 +2,15 @@
 , libxfce4ui, garcon, xfconf }:
 
 stdenv.mkDerivation rec {
-  name = "xfce4-appfinder-4.8.0";
-  
+  p_name  = "xfce4-appfinder";
+  ver_maj = "4.9"; # no 4.10 (stable) release yet
+  ver_min = "4";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/xfce/xfce4-appfinder/4.8/${name}.tar.bz2";
-    sha1 = "444bbcbded8d2346f9b9beb57ec7adaf556811c9";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "12lgrbd1n50w9n8xkpai98s2aw8vmjasrgypc57sp0x0qafsqaxq";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs =
     [ pkgconfig intltool glib gtk libxfce4util libxfce4ui garcon xfconf ];
@@ -15,7 +18,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    homepage = http://www.xfce.org/;
+    homepage = http://docs.xfce.org/xfce/xfce4-appfinder/;
     description = "Xfce application finder, a tool to locate and launch programs on your system";
     license = "GPLv2+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/desktops/xfce/core/xfce4-panel-datadir.patch b/pkgs/desktops/xfce/core/xfce4-panel-datadir.patch
new file mode 100644
index 00000000000..ed9df9ef36f
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfce4-panel-datadir.patch
@@ -0,0 +1,24 @@
+diff --git a/panel/panel-module-factory.c b/panel/panel-module-factory.c
+index 529fe85..8c792b7 100644
+--- a/panel/panel-module-factory.c
++++ b/panel/panel-module-factory.c
+@@ -39,6 +39,7 @@
+ #include <panel/panel-module.h>
+ #include <panel/panel-module-factory.h>
+ 
++#define DATADIR "/run/current-system/sw/share/xfce4"
+ #define PANEL_PLUGINS_DATA_DIR     (DATADIR G_DIR_SEPARATOR_S "panel" G_DIR_SEPARATOR_S "plugins")
+ #define PANEL_PLUGINS_DATA_DIR_OLD (DATADIR G_DIR_SEPARATOR_S "panel-plugins")
+ 
+diff --git a/panel/panel-module.c b/panel/panel-module.c
+index ba39320..519440b 100644
+--- a/panel/panel-module.c
++++ b/panel/panel-module.c
+@@ -35,6 +35,7 @@
+ #include <panel/panel-plugin-external-wrapper.h>
+ #include <panel/panel-plugin-external-46.h>
+ 
++#define LIBDIR "/run/current-system/sw/lib/xfce4"
+ #define PANEL_PLUGINS_LIB_DIR (LIBDIR G_DIR_SEPARATOR_S "panel" G_DIR_SEPARATOR_S "plugins")
+ #define PANEL_PLUGINS_LIB_DIR_OLD (LIBDIR G_DIR_SEPARATOR_S "panel-plugins")
+ 
diff --git a/pkgs/desktops/xfce/core/xfce4-panel.nix b/pkgs/desktops/xfce/core/xfce4-panel.nix
new file mode 100644
index 00000000000..a5edb8dd560
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfce4-panel.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui
+, libwnck, exo, garcon, xfconf, libstartup_notification }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-panel";
+  ver_maj = "4.10";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1mkmhhmy70izja6d6di65hay9ybqi8615pwjbx0lgqk53gnm4c2p";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  patches = [ ./xfce4-panel-datadir.patch ];
+  patchFlags = "-p1";
+
+  buildInputs =
+    [ pkgconfig intltool gtk libxfce4util exo libwnck
+      garcon xfconf libstartup_notification
+    ];
+  propagatedBuildInputs = [ libxfce4ui ];
+
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.xfce.org/projects/xfce4-panel;
+    description = "Xfce panel";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce-4.8/applications/xfce4-power-manager.nix b/pkgs/desktops/xfce/core/xfce4-power-manager.nix
index bad3b52a6bb..1e77ba39f8f 100644
--- a/pkgs/desktops/xfce-4.8/applications/xfce4-power-manager.nix
+++ b/pkgs/desktops/xfce/core/xfce4-power-manager.nix
@@ -2,17 +2,21 @@
 , libxfce4ui, libxfce4util, libnotify, xfce4panel }:
 
 stdenv.mkDerivation rec {
-  name = "xfce4-power-manager-1.0.10";
-  
+  p_name  = "xfce4-power-manager";
+  ver_maj = "1.2";
+  ver_min = "0";
+
   src = fetchurl {
-    url = "http://archive.xfce.org/src/apps/xfce4-power-manager/1.0/${name}.tar.bz2";
-    sha1 = "64dd7a8fae9cd1cbcf6403d2f51f2281f38cca05";
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1sc4f4wci5yl3l9lk7vcsbwj6hdjshbxw9qm43s64jr882jriyyp";
   };
+  name = "${p_name}-${ver_maj}.${ver_min}";
 
   buildInputs =
     [ pkgconfig intltool gtk dbus_glib xfconf libxfce4ui libxfce4util
       libnotify xfce4panel
     ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
 
   meta = {
     homepage = http://goodies.xfce.org/projects/applications/xfce4-power-manager;
diff --git a/pkgs/desktops/xfce/core/xfce4-session.nix b/pkgs/desktops/xfce/core/xfce4-session.nix
new file mode 100644
index 00000000000..2f05f521e01
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfce4-session.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui, xfce4panel
+, libwnck, dbus_glib, xfconf, libglade, xorg
+, polkit }:
+
+#TODO: gnome stuff: gconf (assistive?), keyring
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-session";
+  ver_maj = "4.10";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "10zwki7v55a325abr57wczcb5g7ml99cqk1p8ls8qycqqfyzlm01";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs =
+    [ pkgconfig intltool gtk libxfce4util libxfce4ui libwnck dbus_glib
+      xfconf xfce4panel libglade xorg.iceauth
+      polkit
+    ];
+
+  configureFlags = [ "--with-xsession-prefix=$(out)" ];
+
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = http://www.xfce.org/projects/xfce4-session;
+    description = "Session manager for Xfce";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/core/xfce4-settings.nix b/pkgs/desktops/xfce/core/xfce4-settings.nix
new file mode 100644
index 00000000000..d597237e32b
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfce4-settings.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, intltool, exo, gtk, libxfce4util, libxfce4ui
+, libglade, xfconf, xorg, libwnck, libnotify, libxklavier, garcon }:
+
+#TODO: optional packages
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-settings";
+  ver_maj = "4.10";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1m8k9s7qihwkkbjrrkmk103a6iwahxdfq65aswrsbqshx9cnk2hi";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs =
+    [ pkgconfig intltool exo gtk libxfce4util libxfce4ui libglade
+      xfconf xorg.libXi xorg.libXcursor libwnck libnotify libxklavier garcon
+    #gtk libxfce4util libxfcegui4 libwnck dbus_glib
+      #xfconf libglade xorg.iceauth
+    ];
+  configureFlags = "--enable-pluggable-dialogs --enable-sound-settings";
+
+  meta = {
+    homepage = http://www.xfce.org/projects/xfce4-settings;
+    description = "Settings manager for Xfce";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/core/xfconf.nix b/pkgs/desktops/xfce/core/xfconf.nix
new file mode 100644
index 00000000000..e608d459106
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfconf.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, pkgconfig, intltool, glib, libxfce4util, dbus_glib }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfconf";
+  ver_maj = "4.10";
+  ver_min = "0";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0xh520z0qh0ib0ijgnyrgii9h5d4pc53n6mx1chhyzfc86j1jlhp";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  #TODO: no perl bingings yet (ExtUtils::Depends, ExtUtils::PkgConfig, Glib)
+  buildInputs = [ pkgconfig intltool glib libxfce4util ];
+  propagatedBuildInputs = [ dbus_glib ];
+
+  meta = {
+    homepage = http://docs.xfce.org/xfce/xfconf/start;
+    description = "Simple client-server configuration storage and query system for Xfce";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/desktops/xfce/core/xfdesktop.nix b/pkgs/desktops/xfce/core/xfdesktop.nix
new file mode 100644
index 00000000000..8067e1841ca
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfdesktop.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk, libxfce4util, libxfce4ui
+, libwnck, xfconf, libglade, xfce4panel, thunar, exo, garcon, libnotify }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfdesktop";
+  ver_maj = "4.10";
+  ver_min = "2";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0zbrvfj4fxnjz593brxjsjy9pv5bbf12jnbydy4pwc1ya6zf19j9";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs =
+    [ pkgconfig intltool gtk libxfce4util libxfce4ui libwnck xfconf
+      libglade xfce4panel thunar exo garcon libnotify
+    ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.xfce.org/projects/xfdesktop;
+    description = "Xfce desktop manager";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/core/xfwm4.nix b/pkgs/desktops/xfce/core/xfwm4.nix
new file mode 100644
index 00000000000..bb235911ba4
--- /dev/null
+++ b/pkgs/desktops/xfce/core/xfwm4.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, gtk, intltool, libglade, libxfce4util
+, libxfce4ui, xfconf, libwnck, libstartup_notification, xorg }:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfwm4";
+  ver_maj = "4.10";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0h57gwjs3j5f8ly0gmhl620338fg4qvlzs8gpqs9wxzblvxl831q";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  #TODO: kde systray, docs
+  buildInputs =
+    [ pkgconfig intltool gtk libglade libxfce4util libxfce4ui xfconf
+      libwnck libstartup_notification
+      xorg.libXcomposite xorg.libXfixes xorg.libXdamage
+    ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.xfce.org/projects/xfwm4;
+    description = "Window manager for Xfce";
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/desktops/xfce/default.nix b/pkgs/desktops/xfce/default.nix
new file mode 100644
index 00000000000..b63a101b84f
--- /dev/null
+++ b/pkgs/desktops/xfce/default.nix
@@ -0,0 +1,68 @@
+{ pkgs, newScope }: let
+
+callPackage = newScope (deps // xfce_self);
+
+deps = rec { # xfce-global dependency overrides should be here
+  inherit (pkgs.gnome) libglade libwnck vte gtksourceview;
+  inherit (pkgs.perlPackages) URI;
+};
+
+xfce_self = rec { # the lines are very long but it seems better than the even-odd line approach
+
+  #### NixOS support
+
+  inherit (pkgs) gvfs;
+  xinitrc = "${xfce4session}/etc/xdg/xfce4/xinitrc";
+
+  #### CORE                 from "mirror://xfce/src/xfce/${p_name}/${ver_maj}/${name}.tar.bz2"
+
+  exo             = callPackage ./core/exo.nix { };
+  garcon          = callPackage ./core/garcon.nix { };
+  gtk_xfce_engine = callPackage ./core/gtk-xfce-engine.nix { }; # ToDo: when should be used?
+  libxfce4ui      = callPackage ./core/libxfce4ui.nix { };
+  libxfce4util    = callPackage ./core/libxfce4util.nix { };
+  libxfcegui4     = callPackage ./core/libxfcegui4.nix { };
+  thunar          = callPackage ./core/thunar.nix { };
+  thunar_volman   = callPackage ./core/thunar-volman.nix { }; # ToDo: probably inside Thunar now
+  tumbler         = callPackage ./core/tumbler.nix { };
+  xfce4panel      = callPackage ./core/xfce4-panel.nix { }; # ToDo: impure plugins from /run/current-system/sw/lib/xfce4
+  xfce4session    = callPackage ./core/xfce4-session.nix { };
+  xfce4settings   = callPackage ./core/xfce4-settings.nix { };
+  xfce4_power_manager = callPackage ./core/xfce4-power-manager.nix { };
+  xfceutils       = null; # removed in 4.10
+  xfconf          = callPackage ./core/xfconf.nix { };
+  xfdesktop       = callPackage ./core/xfdesktop.nix { };
+  xfwm4           = callPackage ./core/xfwm4.nix { };
+
+  xfce4_appfinder = callPackage ./core/xfce4-appfinder.nix { };
+
+
+  #### APPLICATIONS         from "mirror://xfce/src/apps/${p_name}/${ver_maj}/${name}.tar.bz2"
+
+  gigolo          = callPackage ./applications/gigolo.nix { };
+  mousepad        = callPackage ./applications/mousepad.nix { };
+  ristretto       = callPackage ./applications/ristretto.nix { };
+  terminal        = xfce4terminal; # it has changed its name
+  xfce4mixer      = callPackage ./applications/xfce4-mixer.nix { };
+  xfce4notifyd    = callPackage ./applications/xfce4-notifyd.nix { };
+  xfce4taskmanager= callPackage ./applications/xfce4-taskmanager.nix { };
+  xfce4terminal   = callPackage ./applications/terminal.nix { };
+
+
+  #### ART                  from "mirror://xfce/src/art/${p_name}/${ver_maj}/${name}.tar.bz2"
+
+  xfce4icontheme  = callPackage ./art/xfce4-icon-theme.nix { };
+
+
+  #### PANEL PLUGINS        from "mirror://xfce/src/panel-plugins/${p_name}/${ver_maj}/${name}.tar.bz2"
+
+  xfce4_systemload_plugin = callPackage ./panel-plugins/xfce4-systemload-plugin.nix { };
+  xfce4_cpufreq_plugin    = callPackage ./panel-plugins/xfce4-cpufreq-plugin.nix { };
+
+}; # xfce_self
+
+in xfce_self
+
+
+
+
diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-cpufreq-plugin.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-cpufreq-plugin.nix
new file mode 100644
index 00000000000..18d043c51fd
--- /dev/null
+++ b/pkgs/desktops/xfce/panel-plugins/xfce4-cpufreq-plugin.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libxfce4util, xfce4panel, libxfce4ui, libxfcegui4, xfconf, gtk}:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-cpufreq-plugin";
+  ver_maj = "1.0";
+  ver_min = "0";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/panel-plugins/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "0q2lj8a25iq9w3dynh6qvsmh19y1v7i82g46yza6gvw7fjcrmcz1";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool libxfce4util libxfce4ui xfce4panel libxfcegui4 xfconf gtk ];
+  preFixup = "rm $out/share/icons/hicolor/icon-theme.cache";
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/panel-plugins/${p_name}";
+    description = "CPU Freq load plugin for Xfce panel";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/desktops/xfce/panel-plugins/xfce4-systemload-plugin.nix b/pkgs/desktops/xfce/panel-plugins/xfce4-systemload-plugin.nix
new file mode 100644
index 00000000000..dda5dc89def
--- /dev/null
+++ b/pkgs/desktops/xfce/panel-plugins/xfce4-systemload-plugin.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libxfce4util, xfce4panel, libxfce4ui, gtk}:
+
+stdenv.mkDerivation rec {
+  p_name  = "xfce4-systemload-plugin";
+  ver_maj = "1.1";
+  ver_min = "1";
+
+  src = fetchurl {
+    url = "mirror://xfce/src/panel-plugins/${p_name}/${ver_maj}/${name}.tar.bz2";
+    sha256 = "1bnrr30h6kgb37ixcq7frx2gvj2p99bpa1jyzppwjxp5x7xkxh8s";
+  };
+  name = "${p_name}-${ver_maj}.${ver_min}";
+
+  buildInputs = [ pkgconfig intltool libxfce4util libxfce4ui xfce4panel gtk ];
+
+  meta = {
+    homepage = "http://goodies.xfce.org/projects/panel-plugins/${p_name}";
+    description = "System load plugin for Xfce panel";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix
new file mode 100644
index 00000000000..f1be290b190
--- /dev/null
+++ b/pkgs/development/arduino/arduino-core/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, jdk, jre, ant, coreutils, gnugrep }:
+
+stdenv.mkDerivation rec {
+
+  version = "1.0.2";
+  name = "arduino-core";
+
+  src = fetchurl {
+    url = "http://arduino.googlecode.com/files/arduino-${version}-src.tar.gz";
+    sha256 = "0nszl2hdjjgxk87gyk0xi0ww9grbq83hch3iqmpaf9yp4y9bra0x";
+  };
+
+  buildInputs = [ jdk ant ];
+
+  phases = "unpackPhase patchPhase buildPhase installPhase";
+
+  patchPhase = ''
+  #
+  '';
+
+  buildPhase = ''
+    cd ./core && ant 
+    cd ../build && ant 
+    cd ..
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/arduino
+    cp -r ./build/linux/work/hardware/ $out/share/arduino
+    cp -r ./build/linux/work/libraries/ $out/share/arduino
+    cp -r ./build/linux/work/tools/ $out/share/arduino
+    cp -r ./build/linux/work/lib/ $out/share/arduino
+    echo ${version} > $out/share/arduino/lib/version.txt
+  '';
+
+  meta = {
+    description = "Arduino libraries";
+    homepage = http://arduino.cc/;
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  }; 
+}
diff --git a/pkgs/development/arduino/ino/default.nix b/pkgs/development/arduino/ino/default.nix
new file mode 100644
index 00000000000..100b3aa87f1
--- /dev/null
+++ b/pkgs/development/arduino/ino/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, buildPythonPackage, pythonPackages, minicom
+, avrdude, arduino_core, avrgcclibc }:
+
+buildPythonPackage {
+  name = "ino-0.3.4";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/i/ino/ino-0.3.4.tar.gz";
+    sha256 = "1v7z3da31cv212k28aci269qkg92p377fm7i76rymjjpjra7payv";
+  };
+
+  # TODO: add avrgcclibc, it must be rebuild with C++ support
+  propagatedBuildInputs =
+    [ arduino_core avrdude minicom pythonPackages.configobj
+      pythonPackages.jinja2 pythonPackages.pyserial ];
+
+  patchPhase = ''
+    echo "Patching Arduino distribution path"
+    sed -i 's@/usr/local/share/arduino@${arduino_core}/share/arduino@g' \
+        ino/environment.py
+    sed -i -e 's@argparse@@' -e 's@ordereddict@@' \
+        requirements.txt
+    sed -i -e 's@from ordereddict@from collections@' \
+        ino/environment.py ino/utils.py
+  '';
+ 
+  meta = {
+    description = "Command line toolkit for working with Arduino hardware";
+    homepage = http://inotool.org/;
+    license = "MIT";
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  };
+}
diff --git a/pkgs/development/compilers/Agda-executable/default.nix b/pkgs/development/compilers/Agda-executable/default.nix
index 823a412459f..f9acff43ef7 100644
--- a/pkgs/development/compilers/Agda-executable/default.nix
+++ b/pkgs/development/compilers/Agda-executable/default.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Agda ];
+  jailbreak = true;
   meta = {
     homepage = "http://wiki.portal.chalmers.se/agda/";
     description = "Command-line program for type-checking and compiling Agda programs";
diff --git a/pkgs/development/compilers/bigloo/default.nix b/pkgs/development/compilers/bigloo/default.nix
index fac4a99283a..b7dcb806b01 100644
--- a/pkgs/development/compilers/bigloo/default.nix
+++ b/pkgs/development/compilers/bigloo/default.nix
@@ -1,10 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "bigloo3.7a";
+  name = "bigloo-${version}";
+  version = "3.7a";
 
   src = fetchurl {
-    url = "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/${name}.tar.gz";
+    url = "ftp://ftp-sop.inria.fr/indes/fp/Bigloo/bigloo${version}.tar.gz";
     sha256 = "0y8i87c2bpqzap8rhzgpyfgdzq21py5xq6mgp0w6xv4rjcj9d0v1";
   };
 
diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix
index 54628fa509d..7678c066df2 100644
--- a/pkgs/development/compilers/ccl/default.nix
+++ b/pkgs/development/compilers/ccl/default.nix
@@ -5,13 +5,13 @@ let
   ];
 in
 rec {
-  version = "1.4";
+  version = "1.8";
   name = "ccl-${version}";
 
   /* There are also MacOS and FreeBSD and Windows versions */
   src = a.fetchurl {
     url = "ftp://ftp.clozure.com/pub/release/${version}/${name}-linuxx86.tar.gz";
-    sha256 = "1z4x4kxjj2ligb2vfrx5mjww20gdkxbvgw1ax5l9c8ha802bfyg8";
+    sha256 = "1dgg6a8i2csa6xidsq66hbw7zx62gm2178hpkp88yyzgxylszp01";
   };
   
   inherit buildInputs;
diff --git a/pkgs/development/compilers/chicken/default.nix b/pkgs/development/compilers/chicken/default.nix
new file mode 100644
index 00000000000..deb93257df7
--- /dev/null
+++ b/pkgs/development/compilers/chicken/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "chicken-4.8.1";
+
+  meta = {
+    homepage = http://www.call-cc.org/;
+    description = "Chicken Scheme";
+  };
+
+  src = fetchurl {
+    url = http://code.call-cc.org/dev-snapshots/2013/01/04/chicken-4.8.1.tar.gz;
+    md5 = "bd758ec7abeaeb4f4c92c290fb5f3db7";
+  };
+
+  buildFlags = "PLATFORM=linux PREFIX=$(out) VARDIR=$(out)/var/lib";
+  installFlags = "PLATFORM=linux PREFIX=$(out) VARDIR=$(out)/var/lib";
+}
diff --git a/pkgs/development/compilers/cmucl/binary.nix b/pkgs/development/compilers/cmucl/binary.nix
index 11d0b723ce4..55f64234a32 100644
--- a/pkgs/development/compilers/cmucl/binary.nix
+++ b/pkgs/development/compilers/cmucl/binary.nix
@@ -15,10 +15,6 @@ let
         arch = "x86-linux";
         sha256 = "1s00r1kszk5zhmv7m8z5q2wcqjn2gn7fbqwji3hgnsdvbb1f3jdn";
       }
-    else if system == "i686-darwin" then fetchDist {
-        arch = "x86-darwin";
-        sha256 = "0vd3zbp5zcp0hjd3y03k595hmri8hw884brjpwjiby3jpm3l40np";
-      }
     else throw "Unsupported platform for cmucl.";
 in
 
diff --git a/pkgs/development/compilers/dev86/default.nix b/pkgs/development/compilers/dev86/default.nix
index 0dfb0be96f9..539588ac3ad 100644
--- a/pkgs/development/compilers/dev86/default.nix
+++ b/pkgs/development/compilers/dev86/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "dev86-0.16.18";
+  name = "dev86-0.16.19";
   
   src = fetchurl {
-    url = http://www.debath.co.uk/dev86/Dev86src-0.16.18.tar.gz;
-    sha256 = "1wcg2x8i2fq7kqgazx2il3qfmikyi4kfb23vm45yxlwq72l55604";
+    url = http://www.debath.co.uk/dev86/Dev86src-0.16.19.tar.gz;
+    sha256 = "33398b87ca85e2b69e4062cf59f2f7354af46da5edcba036c6f97bae17b8d00e";
   };
 
   makeFlags = "PREFIX=$(out)";
diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix
index c08fc3ee585..d2c26487c0f 100644
--- a/pkgs/development/compilers/ecl/default.nix
+++ b/pkgs/development/compilers/ecl/default.nix
@@ -1,40 +1,45 @@
-{builderDefsPackage
-  , gmp, mpfr, libffi
-  , ...} @ x:
-builderDefsPackage (a :  
-let 
-  s = import ./src-for-default.nix;
-  propagatedBuildInputs = with a; [
+{stdenv, fetchurl
+, gmp, mpfr, libffi
+, noUnicode ? false, 
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="ecl";
+    version="13.5.1";
+    name="${baseName}-${version}";
+    hash="18ic8w9sdl0dh3kmyc9lsrafikrd9cg1jkhhr25p9saz0v75f77r";
+    url="mirror://sourceforge/project/ecls/ecls/13.5/ecl-13.5.1.tgz";
+    sha256="18ic8w9sdl0dh3kmyc9lsrafikrd9cg1jkhhr25p9saz0v75f77r";
+  };
+  buildInputs = [
+    libffi
+  ];
+  propagatedBuildInputs = [
     gmp mpfr
   ];
-  buildInputs = [ gmp libffi mpfr ];
 in
-rec {
-  src = a.fetchUrlFromSrcInfo s;
-
-  inherit (s) name;
+stdenv.mkDerivation {
+  inherit (s) name version;
   inherit buildInputs propagatedBuildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
   configureFlags = [
     "--enable-threads"
     ]
     ++
-    (a.lib.optional (! (a.lib.attrByPath ["noUnicode"] false a)) 
+    (stdenv.lib.optional (! noUnicode)
       "--enable-unicode")
     ;
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall" "fixEclConfig"];
-
-  fixEclConfig = a.fullDepEntry ''
+  postInstall = ''
     sed -e 's/@[-a-zA-Z_]*@//g' -i $out/bin/ecl-config
-  '' ["minInit"];
-      
+  '';
   meta = {
-    description = "A Lisp implementation aiming to be small and fast";
-    maintainers = [
-      a.lib.maintainers.raskin
-    ];
-    platforms = with a.lib.platforms; 
-      linux;
+    inherit (s) version;
+    description = "Lisp implementation aiming to be small, fast and easy to embed";
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
   };
-}) x
+}
diff --git a/pkgs/development/compilers/ecl/default.upstream b/pkgs/development/compilers/ecl/default.upstream
new file mode 100644
index 00000000000..70dcb1b4344
--- /dev/null
+++ b/pkgs/development/compilers/ecl/default.upstream
@@ -0,0 +1,4 @@
+url http://sourceforge.net/projects/ecls/files/ecls/
+SF_version_dir
+version_link '[.]tgz/download$'
+SF_redirect
diff --git a/pkgs/development/compilers/ecl/src-for-default.nix b/pkgs/development/compilers/ecl/src-for-default.nix
deleted file mode 100644
index 1baaf4bbec4..00000000000
--- a/pkgs/development/compilers/ecl/src-for-default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-rec {
-   version="12.2.1";
-   name="ecl-12.2.1";
-   hash="dbb3f83c27f3d2565ca22c1c6b4ab497bbfdd0d0a7b09dee76338f378621f091";
-   url="http://downloads.sourceforge.net/project/ecls/ecls/12.2/ecl-${version}.tgz";
-   advertisedUrl="http://downloads.sourceforge.net/project/ecls/ecls/12.2/ecl-12.2.1.tgz";
-}
diff --git a/pkgs/development/compilers/ecl/src-info-for-default.nix b/pkgs/development/compilers/ecl/src-info-for-default.nix
deleted file mode 100644
index 1f5f3270f53..00000000000
--- a/pkgs/development/compilers/ecl/src-info-for-default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  downloadPage = "http://sourceforge.net/projects/ecls/files/";
-  baseName = "ecl";
-  choiceCommand = "head -1 | sed -e 's@/download@@;'\"$skipRedirectSF\"";
-  sourceRegexp = ".*[.](tar.gz|tgz|tbz2|tar.bz2)";
-}
diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix
index 53517e853e9..949324ba8b1 100644
--- a/pkgs/development/compilers/edk2/default.nix
+++ b/pkgs/development/compilers/edk2/default.nix
@@ -10,12 +10,12 @@ else
   throw "Unsupported architecture";
 
 edk2 = stdenv.mkDerivation {
-  name = "edk2-2012-03-13";
+  name = "edk2-2013-03-19";
   
   src = fetchsvn {
     url = https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2;
-    rev = "13094";
-    sha256 = "1qfpal0y4sas204ydg3pg3634dm25q1vr94mpgmbdh6yqcviah3h";
+    rev = "14211";
+    sha256 = "1rhrv7cyazb1d4gw3s8fv0c245iankvb9pqx6nngbkkxkcswvnw7";
   };
 
   buildInputs = [ libuuid pythonFull ];
diff --git a/pkgs/development/compilers/eql/default.nix b/pkgs/development/compilers/eql/default.nix
index 4e288824713..5bb0a2e5f64 100644
--- a/pkgs/development/compilers/eql/default.nix
+++ b/pkgs/development/compilers/eql/default.nix
@@ -12,9 +12,9 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     method = "fetchgit";
-    rev = "14f62c94f952104d27d920ea662c8a61b370abe8";
+    rev = "9097bf98446ee33c07bb155d800395775ce0d9b2";
     url = "git://gitorious.org/eql/eql";
-    hash = "1ca31f0ad8cbc45d2fdf7b1e4059b1e612523c043f4688d7147c7e16fa5ba9ca";
+    hash = "1fp88xmmk1sa0iqxahfiv818bp2sbf66vqrd4xq9jb731ybdvsb8";
     version = rev;
     name = "eql-git-${version}";
   };
@@ -30,7 +30,7 @@ rec {
   inherit (sourceInfo) name version;
   inherit buildInputs;
 
-  phaseNames = ["setVars" "fixPaths" "firstMetaTypeId" "buildEQLLib" "doQMake" "doMake" "doDeploy"];
+  phaseNames = ["setVars" "fixPaths" "doQMake" "doMake" "doDeploy"];
 
   setVars = a.fullDepEntry (''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
@@ -40,27 +40,13 @@ rec {
     sed -re 's@[(]in-home "gui/.command-history"[)]@(concatenate '"'"'string (ext:getenv "HOME") "/.eql-gui-command-history")@' -i gui/gui.lisp
   '') ["minInit" "doUnpack"];
 
-  firstMetaTypeId = a.fullDepEntry (''
-    cd src 
-    qmake first_metatype_id.pro
-    make
-    TMP=.
-    TMPDIR=.
-    XKB_BINDIR="${xkbcomp}/bin" Xvfb -once -reset -terminate :2 -xkbdir ${xkeyboard_config}/etc/X11/xkb &
-    sleep 10;
-    DISPLAY=:2 ./first_metatype_id
-  '') ["doUnpack" "addInputs"];
-
-  buildEQLLib = a.fullDepEntry (''
-    ecl -shell make-eql-lib.lisp
-    qmake eql_lib.pro
-    make
-  '') ["doUnpack" "addInputs" "firstMetaTypeId"];
-
   doQMake = a.fullDepEntry (''
+    cd src
     qmake eql_exe.pro
     make
-  '') ["addInputs" "firstMetaTypeId" "buildEQLLib"];
+    cd ..
+    cd src
+  '') ["addInputs" "doUnpack" "buildEQLLib"];
 
   doDeploy = a.fullDepEntry (''
     cd ..
@@ -70,7 +56,16 @@ rec {
     ln -s $out/lib/eql/build-dir/src/*.h $out/include
     ln -s $out/lib/eql/build-dir/src/gen/*.h $out/include/gen
     ln -s $out/lib/eql/build-dir/libeql*.so* $out/lib
-  '') ["minInit" "defEnsureDir"];
+  '') ["minInit"];
+
+  buildEQLLib = a.fullDepEntry (''
+    cd src
+    ecl -shell make-eql-lib.lisp
+    qmake eql_lib.pro
+    make
+    cd ..
+  '') ["doUnpack" "addInputs"];
+
 
   meta = {
     description = "Embedded Qt Lisp (ECL+Qt)";
diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix
index 4278f2c664f..a2863663bea 100644
--- a/pkgs/development/compilers/fpc/lazarus.nix
+++ b/pkgs/development/compilers/fpc/lazarus.nix
@@ -1,9 +1,10 @@
 args : with args; 
 rec {
-  version = "0.9.30.4";
+  version = "1.0.2";
+  versionSuffix = "-0";
   src = fetchurl {
-    url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${version}/lazarus-${version}-src.tar.bz2";
-    sha256 = "0kndg4xf32r6w5hb58d9qvzkyiphhysgnhs2rd9bmlc8sy8c7zmv";
+    url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%20${version}/lazarus-${version}${versionSuffix}.tar.gz";
+    sha256 = "17a94wig8b4yrkq42wng4qbal7n77axkynwh78wday5whsp7div8";
   };
 
   buildInputs = [fpc gtk glib libXi inputproto 
@@ -37,8 +38,8 @@ rec {
   name = "lazarus-${version}";
   meta = {
     description = "Lazarus graphical IDE for FreePascal language";
-    homepage = http://www.lazarus.freepascal.org ;
+    homepage = http://www.lazarus.freepascal.org;
     maintainers = [args.lib.maintainers.raskin];
-    platforms = args.lib.platforms.linux;
+    #platforms = args.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/compilers/gcc-upc-4.0/builder.sh b/pkgs/development/compilers/gcc-upc-4.0/builder.sh
deleted file mode 100644
index 08622c1899e..00000000000
--- a/pkgs/development/compilers/gcc-upc-4.0/builder.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-export CXXCPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_GCC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
-
-        # Use *real* header files, otherwise a limits.h is generated
-        # that does not include Glibc's limits.h (notably missing
-        # SSIZE_MAX, which breaks the build).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
-        
-    else
-        # Hack: support impure environments.
-        extraCFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-    extraCFlags="-g0 $extraCFlags"
-    extraLDFlags="--strip-debug $extraLDFlags"
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    for i in $extraLDFlags; do
-        export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    export CFLAGS=$extraCFlags
-    export CXXFLAGS=$extraCFlags
-    
-    makeFlagsArray=( \
-        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        LIMITS_H_TEST=true \
-        X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        )
-fi
-
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-}
-
-
-if test -z "$profiledCompiler"; then
-    buildFlags="bootstrap"
-else    
-    buildFlags="profiledbootstrap"
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc-upc-4.0/default.nix b/pkgs/development/compilers/gcc-upc-4.0/default.nix
deleted file mode 100644
index b3b458aae1f..00000000000
--- a/pkgs/development/compilers/gcc-upc-4.0/default.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-# Nix expression for GCC-UPC 4.0, based on that of GCC 4.0.
-
-{ stdenv, fetchurl, noSysDirs, bison, autoconf, gnum4
-, profiledCompiler ? false
-, gmp ? null , mpfr ? null
-, texinfo ? null
-}:
-
-with stdenv.lib;
-
-# GCC-UPC apparently doesn't support GCov and friends.
-assert profiledCompiler == false;
-
-stdenv.mkDerivation {
-  name = "gcc-upc-4.0.3.5";
-  
-  builder = ../gcc/4.0/builder.sh;
-  
-  src = fetchurl {
-    url = "ftp://ftp.intrepid.com/pub/upc/rls/upc-4.0.3.5/upc-4.0.3.5.src.tar.gz";
-    sha256 = "0afnz1bz0kknhl18205bbwncyza08983ivfaagj5yl7x3nwy7prv";
-  };
-  
-  patches = [ ./honor-cflags.patch ]
-    ++ optional noSysDirs [ ./no-sys-dirs.patch ];
-    
-  inherit noSysDirs profiledCompiler;
-
-  # Attributes used by `wrapGCC'.
-  langC   = true ;
-  langCC  = false;
-  langF77 = false;
-  langUPC = true;    # unused
-
-  buildInputs =
-    [ gmp mpfr texinfo
-      # Bison is needed to build the parsers.
-      bison
-      # For some reason, `autoheader' and `m4' are needed.
-      autoconf gnum4
-    ];
-
-  # Note: We use `--enable-maintainer-mode' so that `bison' is actually
-  # run when needed.
-  configureFlags = "
-    --disable-multilib
-    --disable-libstdcxx-pch
-    --disable-libmudflap
-    --with-system-zlib
-    ${if stdenv.isi686 then "--with-arch=i686" else ""}
-    --enable-maintainer-mode
-  ";
-
-  meta = {
-    homepage = http://www.intrepid.com/upc.html;
-    license = "GPL/LGPL";
-    longDscription = ''
-      A GCC-based compiler for the Unified Parallel C (UPC) language,
-      a distributed shared memory aware variant of C (see
-      http://upc.gwu.edu/).
-    '';
-  };
-}
diff --git a/pkgs/development/compilers/gcc-upc-4.0/honor-cflags.patch b/pkgs/development/compilers/gcc-upc-4.0/honor-cflags.patch
deleted file mode 100644
index 98628845511..00000000000
--- a/pkgs/development/compilers/gcc-upc-4.0/honor-cflags.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- upc-4.0.3.5/gcc/upc/Make-lang.in	2008-03-03 18:56:13.000000000 +0100
-+++ upc-4.0.3.5/gcc/upc/Make-lang.in	2008-03-03 18:57:27.000000000 +0100
-@@ -70,7 +70,7 @@ xupc$(exeext): $(srcdir)/upc/upc-cmd.c M
- 	    "-DLIB_PATH=\"$${libdir}\"" \
- 	    "-DINC_PATH=\"$${incdir}\"" \
- 	    -c $(srcdir)/upc/upc-cmd.c -o xupc-tmp.o
--	$(CC) xupc-tmp.o -o xupc$(exeext) $(LIBS)
-+	$(CC) xupc-tmp.o $(ALL_CFLAGS) $(LDFLAGS) -o xupc$(exeext) $(LIBS)
- 	rm -f xupc-tmp.o
- 
- upc-cmd$(exeext): $(srcdir)/upc/upc-cmd.c Makefile cc1upc$(exeext) $(LIBDEPS)
-@@ -80,7 +80,7 @@ upc-cmd$(exeext): $(srcdir)/upc/upc-cmd.
- 	    "-DCOMPILER=\"gcc\"" \
- 	    "-DBIN_PATH=\"$(bindir)\"" \
- 	    -c $(srcdir)/upc/upc-cmd.c -o upc-cmd-tmp.o
--	$(CC) upc-cmd-tmp.o -o upc-cmd$(exeext) $(LIBS)
-+	$(CC) upc-cmd-tmp.o $(ALL_CFLAGS) $(LDFLAGS) -o upc-cmd$(exeext) $(LIBS)
- 	rm -f upc-cmd-tmp.o
- 
- # UPC language specific files.
diff --git a/pkgs/development/compilers/gcc-upc-4.0/no-sys-dirs.patch b/pkgs/development/compilers/gcc-upc-4.0/no-sys-dirs.patch
deleted file mode 100644
index dcac5342637..00000000000
--- a/pkgs/development/compilers/gcc-upc-4.0/no-sys-dirs.patch
+++ /dev/null
@@ -1,202 +0,0 @@
-diff -rc gcc-4.0.0-orig/gcc/cppdefault.c gcc-4.0.0/gcc/cppdefault.c
-*** gcc-4.0.0-orig/gcc/cppdefault.c	2004-11-03 04:23:49.000000000 +0100
---- gcc-4.0.0/gcc/cppdefault.c	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 41,46 ****
---- 41,50 ----
-  # undef CROSS_INCLUDE_DIR
-  #endif
-  
-+ #undef LOCAL_INCLUDE_DIR
-+ #undef SYSTEM_INCLUDE_DIR
-+ #undef STANDARD_INCLUDE_DIR
-+ 
-  const struct default_include cpp_include_defaults[]
-  #ifdef INCLUDE_DEFAULTS
-  = INCLUDE_DEFAULTS;
-diff -rc gcc-4.0.0-orig/gcc/Makefile.in gcc-4.0.0/gcc/Makefile.in
-*** gcc-4.0.0-orig/gcc/Makefile.in	2005-04-04 21:45:13.000000000 +0200
---- gcc-4.0.0/gcc/Makefile.in	2005-04-22 10:38:50.000000000 +0200
-***************
-*** 213,219 ****
-  CPPFLAGS = @CPPFLAGS@
-  
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS =
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
---- 213,219 ----
-  CPPFLAGS = @CPPFLAGS@
-  
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS)
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
-***************
-*** 373,379 ****
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! NATIVE_SYSTEM_HEADER_DIR = /usr/include
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
---- 373,383 ----
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-! # `fixinc' from fixing header files in /usr/include.  However,
-! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-! # it to some dummy directory.
-! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
-***************
-*** 385,391 ****
-  STMP_FIXINC = @STMP_FIXINC@
-  
-  # Test to see whether <limits.h> exists in the system header files.
-! LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
-  
-  # Directory for prefix to system directories, for
-  # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
---- 389,395 ----
-  STMP_FIXINC = @STMP_FIXINC@
-  
-  # Test to see whether <limits.h> exists in the system header files.
-! LIMITS_H_TEST = true
-  
-  # Directory for prefix to system directories, for
-  # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
-***************
-*** 2677,2683 ****
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
---- 2681,2687 ----
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
-diff -rc gcc-4.0.0-orig/ltcf-cxx.sh gcc-4.0.0/ltcf-cxx.sh
-*** gcc-4.0.0-orig/ltcf-cxx.sh	2004-10-02 18:33:06.000000000 +0200
---- gcc-4.0.0/ltcf-cxx.sh	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 988,994 ****
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `eval $output_verbose_link_cmd`; do
-  
-      case $p in
-  
---- 988,994 ----
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `true`; do
-  
-      case $p in
-  
-Only in gcc-4.0.0: ltcf-cxx.sh.orig
-diff -rc gcc-4.0.0-orig/ltconfig gcc-4.0.0/ltconfig
-*** gcc-4.0.0-orig/ltconfig	2004-10-02 18:33:06.000000000 +0200
---- gcc-4.0.0/ltconfig	2005-04-22 13:33:33.000000000 +0200
-***************
-*** 2321,2326 ****
---- 2321,2331 ----
-  # A language-specific compiler.
-  CC=$CC
-  
-+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
-+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+ # to Glibc gets lost.  Here we forcibly add it to any invocation.
-+ CC="\$CC $NIX_EXTRA_LDFLAGS"
-+ 
-  # Is the compiler the GNU C compiler?
-  with_gcc=$with_gcc
-  
-Only in gcc-4.0.0: ltconfig~
-diff -rc gcc-4.0.0-orig/Makefile.in gcc-4.0.0/Makefile.in
-*** gcc-4.0.0-orig/Makefile.in	2005-04-21 09:04:10.000000000 +0200
---- gcc-4.0.0/Makefile.in	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 336,342 ****
-  NM = @NM@
-  
-  LD = @LD@
-! LDFLAGS = 
-  
-  RANLIB = @RANLIB@
-  
---- 336,342 ----
-  NM = @NM@
-  
-  LD = @LD@
-! LDFLAGS = $(NIX_EXTRA_LDFLAGS)
-  
-  RANLIB = @RANLIB@
-  
-***************
-*** 387,393 ****
-  # CFLAGS will be just -g.  We want to ensure that TARGET libraries
-  # (which we know are built with gcc) are built with optimizations so
-  # prepend -O2 when setting CFLAGS_FOR_TARGET.
-! CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
-  # If GCC_FOR_TARGET is not overriden on the command line, then this
-  # variable is passed down to the gcc Makefile, where it is used to
-  # build libgcc2.a.  We define it here so that it can itself be
---- 387,393 ----
-  # CFLAGS will be just -g.  We want to ensure that TARGET libraries
-  # (which we know are built with gcc) are built with optimizations so
-  # prepend -O2 when setting CFLAGS_FOR_TARGET.
-! CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(NIX_EXTRA_CFLAGS)
-  # If GCC_FOR_TARGET is not overriden on the command line, then this
-  # variable is passed down to the gcc Makefile, where it is used to
-  # build libgcc2.a.  We define it here so that it can itself be
-***************
-*** 400,406 ****
-  RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
-  CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-  RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
---- 400,406 ----
-  RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
-  CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-  RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(NIX_EXTRA_CFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
-***************
-*** 434,440 ****
-      fi; \
-    fi`
-  
-! LDFLAGS_FOR_TARGET = 
-  
-  NM_FOR_TARGET=@NM_FOR_TARGET@
-  CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
---- 434,440 ----
-      fi; \
-    fi`
-  
-! LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS)
-  
-  NM_FOR_TARGET=@NM_FOR_TARGET@
-  CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
-Only in gcc-4.0.0: Makefile.in.orig
diff --git a/pkgs/development/compilers/gcc/2.95/builder.sh b/pkgs/development/compilers/gcc/2.95/builder.sh
deleted file mode 100644
index 5244d986da0..00000000000
--- a/pkgs/development/compilers/gcc/2.95/builder.sh
+++ /dev/null
@@ -1,72 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test "$noSysDirs" = "1"; then
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        if test -e $NIX_GCC/nix-support/orig-glibc; then
-            glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
-            # Ugh.  Copied from gcc-wrapper/builder.sh.  We can't just
-            # source in $NIX_GCC/nix-support/add-flags, since that
-            # would cause *this* GCC to be linked against the
-            # *previous* GCC.  Need some more modularity there.
-            extraCFlags="-B$glibc/lib -isystem $glibc/include"
-            extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \
-              -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2"
-
-            # Oh, what a hack.  I should be shot for this.
-            # In stage 1, we should link against the previous GCC, but
-            # not afterwards.  Otherwise we retain a dependency.
-            # However, ld-wrapper, which adds the linker flags for the
-            # previous GCC, is also used in stage 2/3.  We can prevent
-            # it from adding them by NIX_GLIBC_FLAGS_SET, but then
-            # gcc-wrapper will also not add them, thereby causing
-            # stage 1 to fail.  So we use a trick to only set the
-            # flags in gcc-wrapper.
-            hook=$(pwd)/ld-wrapper-hook
-            echo "NIX_GLIBC_FLAGS_SET=1" > $hook
-            export NIX_LD_WRAPPER_START_HOOK=$hook
-        fi
-
-        export NIX_EXTRA_CFLAGS=$extraCFlags
-        export NIX_EXTRA_LDFLAGS=$extraLDFlags
-        export CFLAGS=$extraCFlags
-        export CXXFLAGS=$extraCFlags
-        export LDFLAGS=$extraLDFlags
-        export BOOT_LDFLAGS=$extraLDFlags
-    fi
-
-else
-    patches=""
-fi
-
-
-preConfigure() {
-    
-    # Determine the frontends to build.
-    langs="c"
-    if test -n "$langCC"; then
-        langs="$langs,c++"
-    fi
-    if test -n "$langF77"; then
-        langs="$langs,f77"
-    fi
-
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-
-    configureScript=../$sourceRoot/configure
-    configureFlags="--enable-languages=$langs"
-}
-
-
-buildFlags="bootstrap"
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/2.95/default.nix b/pkgs/development/compilers/gcc/2.95/default.nix
deleted file mode 100644
index d1f20dd230f..00000000000
--- a/pkgs/development/compilers/gcc/2.95/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langF77 ? false
-}:
-
-assert langC;
-
-stdenv.mkDerivation {
-  name = "gcc-2.95.3";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = mirror://gnu/gcc/gcc-2.95.3.tar.gz;
-    md5 = "f3ad4f32c2296fad758ed051b5ac8e28";
-  };
-  # !!! apply only if noSysDirs is set
-  patches = [./no-sys-dirs.patch];
-  inherit noSysDirs langC langCC langF77;
-}
diff --git a/pkgs/development/compilers/gcc/2.95/no-sys-dirs.patch b/pkgs/development/compilers/gcc/2.95/no-sys-dirs.patch
deleted file mode 100644
index 886b7cb37c3..00000000000
--- a/pkgs/development/compilers/gcc/2.95/no-sys-dirs.patch
+++ /dev/null
@@ -1,231 +0,0 @@
-diff -rc gcc-orig/config.if gcc-2.95.3/config.if
-*** gcc-orig/config.if	1998-10-18 19:37:10.000000000 +0200
---- gcc-2.95.3/config.if	2004-08-03 12:29:32.000000000 +0200
-***************
-*** 64,70 ****
-    return 0;
-  }
-  EOF
-!       ${CC-cc} $dummy.c -o $dummy 2>/dev/null
-        if [ "$?" = 0 ]
-        then
-  	libc_interface=-libc6.`./$dummy`-
---- 64,70 ----
-    return 0;
-  }
-  EOF
-!       ${CC-cc} $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS $dummy.c -o $dummy 2>/dev/null
-        if [ "$?" = 0 ]
-        then
-  	libc_interface=-libc6.`./$dummy`-
-diff -rc gcc-orig/gcc/cccp.c gcc-2.95.3/gcc/cccp.c
-*** gcc-orig/gcc/cccp.c	2001-01-25 15:03:00.000000000 +0100
---- gcc-2.95.3/gcc/cccp.c	2004-08-03 10:54:39.000000000 +0200
-***************
-*** 373,378 ****
---- 373,382 ----
-      char fname[1];
-    };
-  
-+ #undef LOCAL_INCLUDE_DIR
-+ #undef SYSTEM_INCLUDE_DIR
-+ #undef STANDARD_INCLUDE_DIR
-+ 
-  /* #include "file" looks in source file dir, then stack.  */
-  /* #include <file> just looks in the stack.  */
-  /* -I directories are added to the end, then the defaults are added.  */
-***************
-*** 424,430 ****
---- 428,436 ----
-  #ifndef STANDARD_INCLUDE_COMPONENT
-  #define STANDARD_INCLUDE_COMPONENT 0
-  #endif
-+ #ifdef STANDARD_INCLUDE_DIR
-      { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 0 },
-+ #endif
-  #endif /* not CROSS_COMPILE */
-      { 0, 0, 0, 0, 0 }
-      };
-diff -rc gcc-orig/gcc/gcc.c gcc-2.95.3/gcc/gcc.c
-*** gcc-orig/gcc/gcc.c	2001-01-25 15:03:16.000000000 +0100
---- gcc-2.95.3/gcc/gcc.c	2004-08-03 11:48:09.000000000 +0200
-***************
-*** 1369,1388 ****
-  #undef MD_STARTFILE_PREFIX_1
-  #endif
-  
-- #ifndef STANDARD_EXEC_PREFIX
-- #define STANDARD_EXEC_PREFIX "/usr/local/lib/gcc-lib/"
-- #endif /* !defined STANDARD_EXEC_PREFIX */
-- 
-  static const char *standard_exec_prefix = STANDARD_EXEC_PREFIX;
-- static const char *standard_exec_prefix_1 = "/usr/lib/gcc/";
-  #ifdef MD_EXEC_PREFIX
-  static const char *md_exec_prefix = MD_EXEC_PREFIX;
-  #endif
-  
-- #ifndef STANDARD_STARTFILE_PREFIX
-- #define STANDARD_STARTFILE_PREFIX "/usr/local/lib/"
-- #endif /* !defined STANDARD_STARTFILE_PREFIX */
-- 
-  #ifdef MD_STARTFILE_PREFIX
-  static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
-  #endif
---- 1369,1379 ----
-***************
-*** 1390,1401 ****
-  static const char *md_startfile_prefix_1 = MD_STARTFILE_PREFIX_1;
-  #endif
-  static const char *standard_startfile_prefix = STANDARD_STARTFILE_PREFIX;
-- static const char *standard_startfile_prefix_1 = "/lib/";
-- static const char *standard_startfile_prefix_2 = "/usr/lib/";
-  
-- #ifndef TOOLDIR_BASE_PREFIX
-- #define TOOLDIR_BASE_PREFIX "/usr/local/"
-- #endif
-  static const char *tooldir_base_prefix = TOOLDIR_BASE_PREFIX;
-  static const char *tooldir_prefix;
-  
---- 1381,1387 ----
-***************
-*** 2896,2908 ****
-  		  value = argv[++i];
-  		else
-  		  value = p + 1;
-  		add_prefix (&exec_prefixes, value, NULL_PTR, 1, 0, &warn_B);
-  		add_prefix (&startfile_prefixes, value, NULL_PTR,
-  			    1, 0, &warn_B);
-  		add_prefix (&include_prefixes, concat (value, "include",
-  						       NULL_PTR),
-  			    NULL_PTR, 1, 0, NULL_PTR);
-! 
-  		/* As a kludge, if the arg is "[foo/]stageN/", just add
-  		   "[foo/]include" to the include prefix.  */
-  		{
---- 2882,2897 ----
-  		  value = argv[++i];
-  		else
-  		  value = p + 1;
-+                 if (strlen(value) > 0 && value[strlen(value) - 1] != '/')
-+                     value = concat (value, "/", NULL_PTR);
-+                 add_prefix (&startfile_prefixes, value, "BINUTILS", 0, 0, NULL_PTR);
-  		add_prefix (&exec_prefixes, value, NULL_PTR, 1, 0, &warn_B);
-  		add_prefix (&startfile_prefixes, value, NULL_PTR,
-  			    1, 0, &warn_B);
-  		add_prefix (&include_prefixes, concat (value, "include",
-  						       NULL_PTR),
-  			    NULL_PTR, 1, 0, NULL_PTR);
-!                 
-  		/* As a kludge, if the arg is "[foo/]stageN/", just add
-  		   "[foo/]include" to the include prefix.  */
-  		{
-***************
-*** 3060,3073 ****
-  #ifndef OS2
-    add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS",
-  	      0, 2, warn_std_ptr);
--   add_prefix (&exec_prefixes, standard_exec_prefix_1, "BINUTILS",
-- 	      0, 2, warn_std_ptr);
-  #endif
-  
-    add_prefix (&startfile_prefixes, standard_exec_prefix, "BINUTILS",
-  	      0, 1, warn_std_ptr);
--   add_prefix (&startfile_prefixes, standard_exec_prefix_1, "BINUTILS",
-- 	      0, 1, warn_std_ptr);
-  
-    tooldir_prefix = concat (tooldir_base_prefix, spec_machine, 
-  			   dir_separator_str, NULL_PTR);
---- 3049,3058 ----
-***************
-*** 4865,4874 ****
-  		      NULL_PTR, 0, 0, NULL_PTR);
-  	}		       
-  
--       add_prefix (&startfile_prefixes, standard_startfile_prefix_1,
-- 		  "BINUTILS", 0, 0, NULL_PTR);
--       add_prefix (&startfile_prefixes, standard_startfile_prefix_2,
-- 		  "BINUTILS", 0, 0, NULL_PTR);
-  #if 0 /* Can cause surprises, and one can use -B./ instead.  */
-        add_prefix (&startfile_prefixes, "./", NULL_PTR, 0, 1, NULL_PTR);
-  #endif
---- 4850,4855 ----
-diff -rc gcc-orig/gcc/Makefile.in gcc-2.95.3/gcc/Makefile.in
-*** gcc-orig/gcc/Makefile.in	2001-01-25 15:02:58.000000000 +0100
---- gcc-2.95.3/gcc/Makefile.in	2004-08-03 12:24:39.000000000 +0200
-***************
-*** 74,80 ****
-  BOOT_CFLAGS = -O2 $(CFLAGS)
-  #WARN_CFLAGS = -W -Wall
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS =
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
---- 74,80 ----
-  BOOT_CFLAGS = -O2 $(CFLAGS)
-  #WARN_CFLAGS = -W -Wall
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS)
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
-***************
-*** 218,224 ****
-         && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
-  
-  # Dir to search for system headers.  Overridden by cross-make.
-! SYSTEM_HEADER_DIR = /usr/include
-  
-  # Control whether to run fixproto.
-  STMP_FIXPROTO = stmp-fixproto
---- 218,228 ----
-         && [ -f /usr/bin/ranlib -o -f /bin/ranlib ] )
-  
-  # Dir to search for system headers.  Overridden by cross-make.
-! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-! # `fixinc' from fixing header files in /usr/include.  However,
-! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-! # it to some dummy directory.
-! SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
-  
-  # Control whether to run fixproto.
-  STMP_FIXPROTO = stmp-fixproto
-diff -rc gcc-orig/Makefile.in gcc-2.95.3/Makefile.in
-*** gcc-orig/Makefile.in	1999-06-23 00:44:42.000000000 +0200
---- gcc-2.95.3/Makefile.in	2004-08-03 10:46:42.000000000 +0200
-***************
-*** 87,94 ****
-  CXXFLAGS = -g -O2
-  
-  LIBCFLAGS = $(CFLAGS)
-! CFLAGS_FOR_TARGET = $(CFLAGS)
-! LDFLAGS_FOR_TARGET = 
-  LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
-  PICFLAG = 
-  PICFLAG_FOR_TARGET = 
---- 87,94 ----
-  CXXFLAGS = -g -O2
-  
-  LIBCFLAGS = $(CFLAGS)
-! CFLAGS_FOR_TARGET = $(CFLAGS) $(NIX_EXTRA_CFLAGS)
-! LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS)
-  LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
-  PICFLAG = 
-  PICFLAG_FOR_TARGET = 
-***************
-*** 99,105 ****
-  
-  # Use -O2 to stress test the compiler.
-  LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  RANLIB = ranlib
---- 99,105 ----
-  
-  # Use -O2 to stress test the compiler.
-  LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(NIX_EXTRA_CFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  RANLIB = ranlib
diff --git a/pkgs/development/compilers/gcc/3.3/builder.sh b/pkgs/development/compilers/gcc/3.3/builder.sh
index 5b80215cffb..12e35f88b94 100644
--- a/pkgs/development/compilers/gcc/3.3/builder.sh
+++ b/pkgs/development/compilers/gcc/3.3/builder.sh
@@ -35,7 +35,7 @@ EOF
     cd ../build
 
     configureScript=../$sourceRoot/configure
-    configureFlags="--enable-languages=$langs"
+    configureFlags="--enable-languages=$langs --disable-multilib"
 }
 
 
diff --git a/pkgs/development/compilers/gcc/3.3/default.nix b/pkgs/development/compilers/gcc/3.3/default.nix
index 9aa9e27ac6f..23501489925 100644
--- a/pkgs/development/compilers/gcc/3.3/default.nix
+++ b/pkgs/development/compilers/gcc/3.3/default.nix
@@ -15,7 +15,12 @@ stdenv.mkDerivation {
     url = http://ftp.gnu.org/gnu/gcc/gcc-3.3.6/gcc-3.3.6.tar.bz2;
     md5 = "6936616a967da5a0b46f1e7424a06414";
   };
-  
+
+  # inspiration: https://aur.archlinux.org/packages/g77/
+  postPatch = ''
+    substituteInPlace gcc/config/i386/linux.h --replace 'struct siginfo' siginfo_t
+  '';
+
   inherit noSysDirs langC langCC langFortran;
 
   meta = {
diff --git a/pkgs/development/compilers/gcc/3.4/default.nix b/pkgs/development/compilers/gcc/3.4/default.nix
index 6cadf58d2ce..1595b7f336f 100644
--- a/pkgs/development/compilers/gcc/3.4/default.nix
+++ b/pkgs/development/compilers/gcc/3.4/default.nix
@@ -15,7 +15,12 @@ stdenv.mkDerivation {
     md5 = "4a21ac777d4b5617283ce488b808da7b";
   };
 
-  patches = if noSysDirs then [./no-sys-dirs.patch] else [];
+  patches = stdenv.lib.optional noSysDirs ./no-sys-dirs.patch;
+
+  # inspiration: https://aur.archlinux.org/packages/g77/
+  postPatch = ''
+    substituteInPlace gcc/config/i386/linux.h --replace 'struct siginfo' siginfo_t
+  '';
 
   inherit noSysDirs profiledCompiler;
 
diff --git a/pkgs/development/compilers/gcc/4.0/builder.sh b/pkgs/development/compilers/gcc/4.0/builder.sh
deleted file mode 100644
index 08622c1899e..00000000000
--- a/pkgs/development/compilers/gcc/4.0/builder.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-export CXXCPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_GCC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
-
-        # Use *real* header files, otherwise a limits.h is generated
-        # that does not include Glibc's limits.h (notably missing
-        # SSIZE_MAX, which breaks the build).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
-        
-    else
-        # Hack: support impure environments.
-        extraCFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-    extraCFlags="-g0 $extraCFlags"
-    extraLDFlags="--strip-debug $extraLDFlags"
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    for i in $extraLDFlags; do
-        export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    export CFLAGS=$extraCFlags
-    export CXXFLAGS=$extraCFlags
-    
-    makeFlagsArray=( \
-        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        LIMITS_H_TEST=true \
-        X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        )
-fi
-
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-}
-
-
-if test -z "$profiledCompiler"; then
-    buildFlags="bootstrap"
-else    
-    buildFlags="profiledbootstrap"
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.0/default.nix b/pkgs/development/compilers/gcc/4.0/default.nix
deleted file mode 100644
index 4e51681a533..00000000000
--- a/pkgs/development/compilers/gcc/4.0/default.nix
+++ /dev/null
@@ -1,51 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false
-, profiledCompiler ? false
-, gmp ? null , mpfr ? null
-, texinfo ? null
-, name ? "gcc"
-}:
-
-assert langC;
-
-with stdenv.lib;
-
-stdenv.mkDerivation {
-  name = "${name}-4.0.4";
-  
-  builder = ./builder.sh;
-  
-  src = fetchurl {
-    url = ftp://ftp.nluug.nl/mirror/languages/gcc/releases/gcc-4.0.4/gcc-4.0.4.tar.bz2;
-    sha256 = "0izwr8d69ld3a1yr8z94s7y7k861wi613mplys2c0bvdr58y1zgk";
-  };
-  
-  patches =
-    optional noSysDirs [./no-sys-dirs.patch];
-    
-  inherit noSysDirs langC langCC langFortran profiledCompiler;
-
-  buildInputs = [gmp mpfr texinfo];
-
-  configureFlags = "
-    --disable-multilib
-    --disable-libstdcxx-pch
-    --disable-libmudflap
-    --with-system-zlib
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC       "c"
-        ++ optional langCC      "c++"
-        ++ optional langFortran "f95"
-        )
-      )
-    }
-    ${if stdenv.isi686 then "--with-arch=i686" else ""}
-  ";
-
-  meta = {
-    homepage = "http://gcc.gnu.org/";
-    license = "GPL/LGPL";
-    description = "GNU Compiler Collection, 4.0.x";
-  };
-}
diff --git a/pkgs/development/compilers/gcc/4.0/gcc-4.0.2-cxx.patch b/pkgs/development/compilers/gcc/4.0/gcc-4.0.2-cxx.patch
deleted file mode 100644
index b9d558d5c17..00000000000
--- a/pkgs/development/compilers/gcc/4.0/gcc-4.0.2-cxx.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -ruN gcc-4.0.2/configure gcc-4.0.2.new/configure
---- gcc-4.0.2/configure	2005-09-13 09:01:28.000000000 +0200
-+++ gcc-4.0.2.new/configure	2006-01-20 20:38:09.000000000 +0100
-@@ -3471,7 +3471,7 @@
- # being built; programs in there won't even run.
- if test "${build}" = "${host}" && test -d ${srcdir}/gcc; then
-   # Search for pre-installed headers if nothing else fits.
--  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
-+  FLAGS_FOR_TARGET=$FLAGS_FOR_TARGET' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include $(NIX_EXTRA_CFLAGS)'
- fi
- 
- if test "x${use_gnu_ld}" = x &&
diff --git a/pkgs/development/compilers/gcc/4.0/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.0/no-sys-dirs.patch
deleted file mode 100644
index 74ef6056b1f..00000000000
--- a/pkgs/development/compilers/gcc/4.0/no-sys-dirs.patch
+++ /dev/null
@@ -1,228 +0,0 @@
-diff -rc gcc-4.0.0-orig/gcc/cppdefault.c gcc-4.0.0/gcc/cppdefault.c
-*** gcc-4.0.0-orig/gcc/cppdefault.c	2004-11-03 04:23:49.000000000 +0100
---- gcc-4.0.0/gcc/cppdefault.c	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 41,46 ****
---- 41,50 ----
-  # undef CROSS_INCLUDE_DIR
-  #endif
-  
-+ #undef LOCAL_INCLUDE_DIR
-+ #undef SYSTEM_INCLUDE_DIR
-+ #undef STANDARD_INCLUDE_DIR
-+ 
-  const struct default_include cpp_include_defaults[]
-  #ifdef INCLUDE_DEFAULTS
-  = INCLUDE_DEFAULTS;
-diff -rc gcc-4.0.0-orig/gcc/Makefile.in gcc-4.0.0/gcc/Makefile.in
-*** gcc-4.0.0-orig/gcc/Makefile.in	2005-04-04 21:45:13.000000000 +0200
---- gcc-4.0.0/gcc/Makefile.in	2005-04-22 10:38:50.000000000 +0200
-***************
-*** 213,219 ****
-  CPPFLAGS = @CPPFLAGS@
-  
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS =
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
---- 213,219 ----
-  CPPFLAGS = @CPPFLAGS@
-  
-  # These exists to be overridden by the x-* and t-* files, respectively.
-! X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS)
-  T_CFLAGS =
-  
-  X_CPPFLAGS =
-***************
-*** 373,379 ****
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! NATIVE_SYSTEM_HEADER_DIR = /usr/include
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
---- 373,383 ----
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-! # `fixinc' from fixing header files in /usr/include.  However,
-! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-! # it to some dummy directory.
-! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
-***************
-*** 385,391 ****
-  STMP_FIXINC = @STMP_FIXINC@
-  
-  # Test to see whether <limits.h> exists in the system header files.
-! LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
-  
-  # Directory for prefix to system directories, for
-  # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
---- 389,395 ----
-  STMP_FIXINC = @STMP_FIXINC@
-  
-  # Test to see whether <limits.h> exists in the system header files.
-! LIMITS_H_TEST = true
-  
-  # Directory for prefix to system directories, for
-  # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
-***************
-*** 2677,2683 ****
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
---- 2681,2687 ----
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
-Only in gcc-4.0.0/gcc: Makefile.in~
-diff -rc gcc-4.0.0-orig/libstdc++-v3/include/Makefile.in gcc-4.0.0/libstdc++-v3/include/Makefile.in
-*** gcc-4.0.0-orig/libstdc++-v3/include/Makefile.in	2005-04-01 06:24:31.000000000 +0200
---- gcc-4.0.0/libstdc++-v3/include/Makefile.in	2005-04-22 09:54:27.000000000 +0200
-***************
-*** 959,966 ****
-  	if [ ! -d "${pch_output_builddir}" ]; then \
-  	  mkdir -p ${pch_output_builddir}; \
-  	fi; \
-! 	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
-! 	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
-  
-  # For robustness sake (in light of junk files or in-source
-  # configuration), copy from the build or source tree to the install
---- 959,966 ----
-  	if [ ! -d "${pch_output_builddir}" ]; then \
-  	  mkdir -p ${pch_output_builddir}; \
-  	fi; \
-! 	$(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
-! 	$(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
-  
-  # For robustness sake (in light of junk files or in-source
-  # configuration), copy from the build or source tree to the install
-Only in gcc-4.0.0/libstdc++-v3/include: Makefile.in~
-Only in gcc-4.0.0/libstdc++-v3/include: Makefile.in.orig
-Only in gcc-4.0.0/libstdc++-v3/include: Makefile.in.rej
-diff -rc gcc-4.0.0-orig/ltcf-cxx.sh gcc-4.0.0/ltcf-cxx.sh
-*** gcc-4.0.0-orig/ltcf-cxx.sh	2004-10-02 18:33:06.000000000 +0200
---- gcc-4.0.0/ltcf-cxx.sh	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 988,994 ****
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `eval $output_verbose_link_cmd`; do
-  
-      case $p in
-  
---- 988,994 ----
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `true`; do
-  
-      case $p in
-  
-Only in gcc-4.0.0: ltcf-cxx.sh.orig
-diff -rc gcc-4.0.0-orig/ltconfig gcc-4.0.0/ltconfig
-*** gcc-4.0.0-orig/ltconfig	2004-10-02 18:33:06.000000000 +0200
---- gcc-4.0.0/ltconfig	2005-04-22 13:33:33.000000000 +0200
-***************
-*** 2321,2326 ****
---- 2321,2331 ----
-  # A language-specific compiler.
-  CC=$CC
-  
-+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
-+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+ # to Glibc gets lost.  Here we forcibly add it to any invocation.
-+ CC="\$CC $NIX_EXTRA_LDFLAGS"
-+ 
-  # Is the compiler the GNU C compiler?
-  with_gcc=$with_gcc
-  
-Only in gcc-4.0.0: ltconfig~
-diff -rc gcc-4.0.0-orig/Makefile.in gcc-4.0.0/Makefile.in
-*** gcc-4.0.0-orig/Makefile.in	2005-04-21 09:04:10.000000000 +0200
---- gcc-4.0.0/Makefile.in	2005-04-22 09:53:28.000000000 +0200
-***************
-*** 336,342 ****
-  NM = @NM@
-  
-  LD = @LD@
-! LDFLAGS = 
-  
-  RANLIB = @RANLIB@
-  
---- 336,342 ----
-  NM = @NM@
-  
-  LD = @LD@
-! LDFLAGS = $(NIX_EXTRA_LDFLAGS)
-  
-  RANLIB = @RANLIB@
-  
-***************
-*** 387,393 ****
-  # CFLAGS will be just -g.  We want to ensure that TARGET libraries
-  # (which we know are built with gcc) are built with optimizations so
-  # prepend -O2 when setting CFLAGS_FOR_TARGET.
-! CFLAGS_FOR_TARGET = -O2 $(CFLAGS)
-  # If GCC_FOR_TARGET is not overriden on the command line, then this
-  # variable is passed down to the gcc Makefile, where it is used to
-  # build libgcc2.a.  We define it here so that it can itself be
---- 387,393 ----
-  # CFLAGS will be just -g.  We want to ensure that TARGET libraries
-  # (which we know are built with gcc) are built with optimizations so
-  # prepend -O2 when setting CFLAGS_FOR_TARGET.
-! CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(NIX_EXTRA_CFLAGS)
-  # If GCC_FOR_TARGET is not overriden on the command line, then this
-  # variable is passed down to the gcc Makefile, where it is used to
-  # build libgcc2.a.  We define it here so that it can itself be
-***************
-*** 400,406 ****
-  RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
-  CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-  RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
---- 400,406 ----
-  RAW_CXX_FOR_TARGET = @RAW_CXX_FOR_TARGET@
-  CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-  RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE = @RAW_CXX_FOR_TARGET_FOR_RECURSIVE_MAKE@
-! CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(NIX_EXTRA_CFLAGS)
-  LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
-  
-  DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
-***************
-*** 434,440 ****
-      fi; \
-    fi`
-  
-! LDFLAGS_FOR_TARGET = 
-  
-  NM_FOR_TARGET=@NM_FOR_TARGET@
-  CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
---- 434,440 ----
-      fi; \
-    fi`
-  
-! LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS)
-  
-  NM_FOR_TARGET=@NM_FOR_TARGET@
-  CONFIGURED_NM_FOR_TARGET=@CONFIGURED_NM_FOR_TARGET@
-Only in gcc-4.0.0: Makefile.in.orig
diff --git a/pkgs/development/compilers/gcc/4.1/builder.sh b/pkgs/development/compilers/gcc/4.1/builder.sh
deleted file mode 100644
index f8abca12257..00000000000
--- a/pkgs/development/compilers/gcc/4.1/builder.sh
+++ /dev/null
@@ -1,83 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    if test -e $NIX_GCC/nix-support/orig-libc; then
-
-        # Figure out what extra flags to pass to the gcc compilers
-        # being generated to make sure that they use our glibc.
-        extraCFlags="$(cat $NIX_GCC/nix-support/libc-cflags)"
-        extraLDFlags="$(cat $NIX_GCC/nix-support/libc-ldflags) $(cat $NIX_GCC/nix-support/libc-ldflags-before)"
-
-        # Use *real* header files, otherwise a limits.h is generated
-        # that does not include Glibc's limits.h (notably missing
-        # SSIZE_MAX, which breaks the build).
-        export NIX_FIXINC_DUMMY=$(cat $NIX_GCC/nix-support/orig-libc)/include
-        
-    else
-        # Hack: support impure environments.
-        extraCFlags="-isystem /usr/include"
-        extraLDFlags="-L/usr/lib64 -L/usr/lib"
-        export NIX_FIXINC_DUMMY=/usr/include
-    fi
-
-    extraCFlags="-g0 $extraCFlags"
-    extraLDFlags="--strip-debug $extraLDFlags"
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    for i in $extraLDFlags; do
-        export NIX_EXTRA_LDFLAGS="$NIX_EXTRA_LDFLAGS -Wl,$i"
-    done
-
-    makeFlagsArray=( \
-        NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
-        LIMITS_H_TEST=true \
-        X_CFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        LDFLAGS_FOR_TARGET="$NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS" \
-        )
-fi
-
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-    configureScript=../$sourceRoot/configure
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-
-    # Get rid of some "fixed" header files
-    rm -rf $out/lib/gcc/*/*/include/root
-}
-
-
-if test -z "$staticCompiler"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.1/default.nix b/pkgs/development/compilers/gcc/4.1/default.nix
deleted file mode 100644
index b460ad813f8..00000000000
--- a/pkgs/development/compilers/gcc/4.1/default.nix
+++ /dev/null
@@ -1,71 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langFortran ? false
-, profiledCompiler ? false
-, staticCompiler ? false
-, gmp ? null
-, mpfr ? null
-, texinfo ? null
-, name ? "gcc"
-}:
-
-assert langC || langFortran;
-
-with stdenv.lib;
-
-stdenv.mkDerivation {
-  name = "${name}-4.1.2";
-  
-  builder = ./builder.sh;
-  
-  src =
-    optional /*langC*/ true (fetchurl {
-      url = mirror://gnu/gcc/gcc-4.1.2/gcc-core-4.1.2.tar.bz2;
-      sha256 = "07binc1hqlr0g387zrg5sp57i12yzd5ja2lgjb83bbh0h3gwbsbv";
-    }) ++
-    optional /*langCC*/ true (fetchurl {
-      url = mirror://gnu/gcc/gcc-4.1.2/gcc-g++-4.1.2.tar.bz2;
-      sha256 = "1qm2izcxna10jai0v4s41myki0xkw9174qpl6k1rnrqhbx0sl1hc";
-    }) ++
-    optional langFortran (fetchurl {
-      url = mirror://gnu/gcc/gcc-4.1.2/gcc-fortran-4.1.2.tar.bz2;
-      sha256 = "0772dhmm4gc10420h0d0mfkk2sirvjmjxz8j0ywm8wp5qf8vdi9z";
-    });
-    
-  patches =
-    optional noSysDirs [./no-sys-dirs.patch];
-    
-  inherit noSysDirs profiledCompiler staticCompiler;
-
-  buildInputs = [gmp mpfr texinfo];
-
-  enableParallelBuilding = true;
-  
-  configureFlags = "
-    --disable-multilib
-    --disable-libstdcxx-pch
-    --with-system-zlib
-    --enable-languages=${
-      concatStrings (intersperse ","
-        (  optional langC       "c"
-        ++ optional langCC      "c++"
-        ++ optional langFortran "fortran"
-        )
-      )
-    }
-    ${if stdenv.isi686 then "--with-arch=i686" else ""}
-  ";
-
-  makeFlags = if staticCompiler then "LDFLAGS=-static" else "";
-
-  passthru = { inherit langC langCC langFortran; };
-
-  meta = {
-    homepage = "http://gcc.gnu.org/";
-    license = "GPL/LGPL";
-    description = "GNU Compiler Collection, 4.1.x";
-
-    # Give the real GCC a lower priority than the GCC wrapper so that
-    # both can be installed at the same time.
-    priority = "7";
-  };
-}
diff --git a/pkgs/development/compilers/gcc/4.1/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.1/no-sys-dirs.patch
deleted file mode 100644
index 7872e4901ef..00000000000
--- a/pkgs/development/compilers/gcc/4.1/no-sys-dirs.patch
+++ /dev/null
@@ -1,177 +0,0 @@
-diff -rc gcc-4.1.2-orig/Makefile.in gcc-4.1.2/Makefile.in
-*** gcc-4.1.2-orig/Makefile.in	Tue Apr  4 23:03:05 2006
---- gcc-4.1.2/Makefile.in	Wed May 23 11:35:41 2007
-***************
-*** 213,219 ****
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
---- 213,220 ----
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD)"; export CXX; \
-! 	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-***************
-*** 352,357 ****
---- 353,366 ----
-  @host_makefile_frag@
-  ###
-  
-+ CFLAGS += $(NIX_EXTRA_CFLAGS)
-+ CPPFLAGS_FOR_TARGET += $(NIX_EXTRA_CFLAGS)
-+ CXXFLAGS += $(NIX_EXTRA_CFLAGS)
-+ LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+ LDFLAGS_FOR_TARGET += $(NIX_EXTRA_LDFLAGS)
-+ BOOT_CFLAGS += $(NIX_EXTRA_CFLAGS)
-+ BOOT_LDFLAGS += $(NIX_EXTRA_LDFLAGS)
-+ 
-  # This is the list of directories that may be needed in RPATH_ENVVAR
-  # so that prorgams built for the target machine work.
-  TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(HOST_LIB_PATH_gcc)
-diff -rc gcc-4.1.2-orig/gcc/Makefile.in gcc-4.1.2/gcc/Makefile.in
-*** gcc-4.1.2-orig/gcc/Makefile.in	Wed Nov  1 15:40:44 2006
---- gcc-4.1.2/gcc/Makefile.in	Wed May 23 11:35:41 2007
-***************
-*** 383,389 ****
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! NATIVE_SYSTEM_HEADER_DIR = /usr/include
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
---- 383,393 ----
-  MD5_H	    = $(srcdir)/../include/md5.h
-  
-  # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
-! # Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-! # `fixinc' from fixing header files in /usr/include.  However,
-! # NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-! # it to some dummy directory.
-! NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
-  # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
-  CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
-  
-***************
-*** 3007,3013 ****
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
---- 3011,3017 ----
-    -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-    -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-    -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
-!   -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-    -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-    -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-    @TARGET_SYSTEM_ROOT_DEFINE@
-diff -rc gcc-4.1.2-orig/gcc/cppdefault.c gcc-4.1.2/gcc/cppdefault.c
-*** gcc-4.1.2-orig/gcc/cppdefault.c	Sat Jun 25 04:02:01 2005
---- gcc-4.1.2/gcc/cppdefault.c	Wed May 23 11:35:41 2007
-***************
-*** 41,46 ****
---- 41,50 ----
-  # undef CROSS_INCLUDE_DIR
-  #endif
-  
-+ #undef LOCAL_INCLUDE_DIR
-+ #undef SYSTEM_INCLUDE_DIR
-+ #undef STANDARD_INCLUDE_DIR
-+ 
-  const struct default_include cpp_include_defaults[]
-  #ifdef INCLUDE_DEFAULTS
-  = INCLUDE_DEFAULTS;
-diff -rc gcc-4.1.2-orig/gcc/gcc.c gcc-4.1.2/gcc/gcc.c
-*** gcc-4.1.2-orig/gcc/gcc.c	Tue Nov  7 15:26:21 2006
---- gcc-4.1.2/gcc/gcc.c	Wed May 23 11:35:41 2007
-***************
-*** 1435,1444 ****
-  /* Default prefixes to attach to command names.  */
-  
-  #ifndef STANDARD_STARTFILE_PREFIX_1
-! #define STANDARD_STARTFILE_PREFIX_1 "/lib/"
-  #endif
-  #ifndef STANDARD_STARTFILE_PREFIX_2
-! #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
-  #endif
-  
-  #ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
---- 1435,1444 ----
-  /* Default prefixes to attach to command names.  */
-  
-  #ifndef STANDARD_STARTFILE_PREFIX_1
-! #define STANDARD_STARTFILE_PREFIX_1 ""
-  #endif
-  #ifndef STANDARD_STARTFILE_PREFIX_2
-! #define STANDARD_STARTFILE_PREFIX_2 ""
-  #endif
-  
-  #ifdef CROSS_COMPILE  /* Don't use these prefixes for a cross compiler.  */
-***************
-*** 1459,1466 ****
-  #endif
-  
-  static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-! static const char *const standard_exec_prefix_1 = "/usr/libexec/gcc/";
-! static const char *const standard_exec_prefix_2 = "/usr/lib/gcc/";
-  static const char *md_exec_prefix = MD_EXEC_PREFIX;
-  
-  static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
---- 1459,1466 ----
-  #endif
-  
-  static const char *const standard_exec_prefix = STANDARD_EXEC_PREFIX;
-! static const char *const standard_exec_prefix_1 = "/no-such-path/";
-! static const char *const standard_exec_prefix_2 = "/no-such-path/";
-  static const char *md_exec_prefix = MD_EXEC_PREFIX;
-  
-  static const char *md_startfile_prefix = MD_STARTFILE_PREFIX;
-diff -rc gcc-4.1.2-orig/ltcf-cxx.sh gcc-4.1.2/ltcf-cxx.sh
-*** gcc-4.1.2-orig/ltcf-cxx.sh	Sat Jul 16 04:30:53 2005
---- gcc-4.1.2/ltcf-cxx.sh	Wed May 23 11:35:41 2007
-***************
-*** 989,995 ****
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `eval $output_verbose_link_cmd`; do
-  
-      case $p in
-  
---- 989,995 ----
-    # the conftest object file.
-    pre_test_object_deps_done=no
-  
-!   for p in `true`; do
-  
-      case $p in
-  
-diff -rc gcc-4.1.2-orig/ltconfig gcc-4.1.2/ltconfig
-*** gcc-4.1.2-orig/ltconfig	Tue Jul  4 22:30:34 2006
---- gcc-4.1.2/ltconfig	Wed May 23 11:35:41 2007
-***************
-*** 2322,2327 ****
---- 2322,2332 ----
-  # A language-specific compiler.
-  CC=$CC
-  
-+ # Ugly hack to get libmudflap (and possibly other libraries) to build.
-+ # Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+ # to Glibc gets lost.  Here we forcibly add it to any invocation.
-+ CC="\$CC $NIX_EXTRA_CFLAGS $NIX_EXTRA_LDFLAGS"
-+ 
-  # Is the compiler the GNU C compiler?
-  with_gcc=$with_gcc
-  
diff --git a/pkgs/development/compilers/gcc/4.2-apple32/builder.sh b/pkgs/development/compilers/gcc/4.2-apple32/builder.sh
deleted file mode 100644
index 1e4eccafbb2..00000000000
--- a/pkgs/development/compilers/gcc/4.2-apple32/builder.sh
+++ /dev/null
@@ -1,125 +0,0 @@
-source $stdenv/setup
-
-
-export NIX_FIXINC_DUMMY=$NIX_BUILD_TOP/dummy
-mkdir $NIX_FIXINC_DUMMY
-
-
-# libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
-# Thing.
-export CPP="gcc -E"
-
-
-if test "$noSysDirs" = "1"; then
-
-    # Figure out what extra flags to pass to the gcc compilers being
-    # generated to make sure that they use our glibc.
-    if test -e $NIX_GCC/nix-support/orig-glibc; then
-        glibc=$(cat $NIX_GCC/nix-support/orig-glibc)
-
-        # Ugh.  Copied from gcc-wrapper/builder.sh.  We can't just
-        # source in $NIX_GCC/nix-support/add-flags, since that would
-        # cause *this* GCC to be linked against the *previous* GCC.
-        # Need some more modularity there.
-        extraCFlags="-B$glibc/lib -isystem $glibc/include"
-        extraLDFlags="-B$glibc/lib -L$glibc/lib -Wl,-s \
-          -Wl,-dynamic-linker,$glibc/lib/ld-linux.so.2"
-
-        # Oh, what a hack.  I should be shot for this.  In stage 1, we
-        # should link against the previous GCC, but not afterwards.
-        # Otherwise we retain a dependency.  However, ld-wrapper,
-        # which adds the linker flags for the previous GCC, is also
-        # used in stage 2/3.  We can prevent it from adding them by
-        # NIX_GLIBC_FLAGS_SET, but then gcc-wrapper will also not add
-        # them, thereby causing stage 1 to fail.  So we use a trick to
-        # only set the flags in gcc-wrapper.
-        hook=$(pwd)/ld-wrapper-hook
-        echo "NIX_GLIBC_FLAGS_SET=1" > $hook
-        export NIX_LD_WRAPPER_START_HOOK=$hook
-
-        # Use *real* header files, otherwise a limits.h is generated
-        # that does not include Glibc's limits.h (notably missing
-        # SSIZE_MAX, which breaks the build).
-        export NIX_FIXINC_DUMMY=$glibc/include
-    fi
-
-    export NIX_EXTRA_CFLAGS=$extraCFlags
-    export NIX_EXTRA_LDFLAGS=$extraLDFlags
-    export CFLAGS=$extraCFlags
-    export CXXFLAGS=$extraCFlags
-    export LDFLAGS=$extraLDFlags
-fi
-
-
-preConfigure() {
-    
-    # Determine the frontends to build.
-    langs="c"
-    if test -n "$langCC"; then
-        langs="$langs,c++"
-    fi
-    if test -n "$langF77"; then
-        langs="$langs,f95"
-    fi
-
-    # Perform the build in a different directory.
-    mkdir ../build
-    cd ../build
-
-    configureScript=../$sourceRoot/configure
-    configureFlags="--enable-languages=$langs --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR}"
-}
-
-
-postInstall() {
-    # Remove precompiled headers for now.  They are very big and
-    # probably not very useful yet.
-    find $out/include -name "*.gch" -exec rm -rf {} \; -prune
-
-    # Remove `fixincl' to prevent a retained dependency on the
-    # previous gcc.
-    rm -rf $out/libexec/gcc/*/*/install-tools
-}
-
-postUnpack() {
-  mv libstdcxx-16/libstdcxx $sourceRoot/
-}
-
-STDCXX_INCDIR="$out/include/c++/4.2.1"
-
-genericBuild
-
-
-echo '-------------------------------------------------------------------------------------------------------------------------'
-echo 'libstdcxx-16'
-echo '-------------------------------------------------------------------------------------------------------------------------'
-
-cd ..
-pwd
-
-preConfigure() {
-    # Perform the build in a different directory.
-    mkdir ../build_libstdcxx
-    cd ../build_libstdcxx
-
-    ln -s ../build/gcc gcc
-    
-    configureScript=../$sourceRoot/libstdcxx/configure
-    configureFlags="--disable-libstdcxx-pch --disable-libstdcxx-debug --disable-multilib --with-gxx-include-dir=${STDCXX_INCDIR}"
-}
-
-unpackPhase () {
-  echo '-'
-}
-
-postInstall() {
-  echo '-'
-  echo "cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/"
-  cp -v ${STDCXX_INCDIR}/*/bits/* ${STDCXX_INCDIR}/bits/
-}
-
-patchPhase() {
-  echo '-'
-}
-
-genericBuild
diff --git a/pkgs/development/compilers/gcc/4.2-apple32/debug_list.patch b/pkgs/development/compilers/gcc/4.2-apple32/debug_list.patch
deleted file mode 100644
index b26f15e6512..00000000000
--- a/pkgs/development/compilers/gcc/4.2-apple32/debug_list.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -rc libstdcxx-16-orig/libstdcxx/libstdc++-v3/src/Makefile.in libstdcxx-16/libstdcxx/libstdc++-v3/src/Makefile.in
-*** libstdcxx-16-orig/libstdcxx/libstdc++-v3/src/Makefile.in	Thu Jul 23 19:13:52 2009
---- libstdcxx-16/libstdcxx/libstdc++-v3/src/Makefile.in	Thu Jul 23 19:38:23 2009
-***************
-*** 65,71 ****
-  	numeric_members.lo time_members.lo
-  am__objects_2 = basic_file.lo c++locale.lo
-  am__objects_3 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
-! 	codecvt.lo complex_io.lo ctype.lo debug.lo debug_list.lo \
-  	functexcept.lo globals_locale.lo globals_io.lo ios.lo \
-  	ios_failure.lo ios_init.lo ios_locale.lo limits.lo list.lo \
-  	locale.lo locale_init.lo locale_facets.lo localename.lo \
---- 65,71 ----
-  	numeric_members.lo time_members.lo
-  am__objects_2 = basic_file.lo c++locale.lo
-  am__objects_3 = bitmap_allocator.lo pool_allocator.lo mt_allocator.lo \
-! 	codecvt.lo complex_io.lo ctype.lo debug.lo \
-  	functexcept.lo globals_locale.lo globals_io.lo ios.lo \
-  	ios_failure.lo ios_init.lo ios_locale.lo limits.lo list.lo \
-  	locale.lo locale_init.lo locale_facets.lo localename.lo \
-***************
-*** 315,321 ****
-  	complex_io.cc \
-  	ctype.cc \
-  	debug.cc \
-- 	debug_list.cc \
-  	functexcept.cc \
-  	globals_locale.cc \
-  	globals_io.cc \
---- 315,320 ----
diff --git a/pkgs/development/compilers/gcc/4.2-apple32/default.nix b/pkgs/development/compilers/gcc/4.2-apple32/default.nix
deleted file mode 100644
index 3346a4e327a..00000000000
--- a/pkgs/development/compilers/gcc/4.2-apple32/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ stdenv, fetchurl, noSysDirs
-, langC ? true, langCC ? true, langF77 ? false
-, profiledCompiler ? false
-, gmp ? null, mpfr ? null, bison ? null, flex ? null
-}:
-
-assert langC;
-assert stdenv.isDarwin;
-assert langF77 -> gmp != null;
-
-stdenv.mkDerivation ({
-  name = "gcc-4.2.1-apple-5574";
-  builder = ./builder.sh;
-  src = 
-    stdenv.lib.optional /*langC*/ true (fetchurl {
-      url = http://www.opensource.apple.com/tarballs/gcc_42/gcc_42-5574.tar.gz ;
-      sha256 = "0b76ef3cded7822e3c0ec430f9811b6bb84895055b683acd2df7f7253d745a50";
-    }) ++
-    stdenv.lib.optional langCC (fetchurl {
-      url = http://www.opensource.apple.com/tarballs/libstdcxx/libstdcxx-16.tar.gz ;
-      sha256 = "a7d8041e50e110f5a503e188a05cb217f0c99c51f248a0a1387cc07a0b6f167f";
-    }) ;
-
-  enableParallelBuilding = true;
-
-  sourceRoot = "gcc_42-5574/";
-  patches =
-    [./pass-cxxcpp.patch ./debug_list.patch]
-    ++ (if noSysDirs then [./no-sys-dirs.patch] else []);
-  inherit noSysDirs langC langCC langF77 profiledCompiler;
-} // (if langF77 then {buildInputs = [gmp mpfr bison flex];} else {}))
diff --git a/pkgs/development/compilers/gcc/4.2-apple32/no-sys-dirs.patch b/pkgs/development/compilers/gcc/4.2-apple32/no-sys-dirs.patch
deleted file mode 100644
index b7b93d6944c..00000000000
--- a/pkgs/development/compilers/gcc/4.2-apple32/no-sys-dirs.patch
+++ /dev/null
@@ -1,126 +0,0 @@
-diff -ruN gcc-4.1.0/gcc/cppdefault.c gcc-4.1.0.new/gcc/cppdefault.c
---- gcc-4.1.0/gcc/cppdefault.c	2005-06-25 04:02:01.000000000 +0200
-+++ gcc-4.1.0.new/gcc/cppdefault.c	2006-03-01 18:48:58.000000000 +0100
-@@ -41,6 +41,10 @@
- # undef CROSS_INCLUDE_DIR
- #endif
- 
-+#undef LOCAL_INCLUDE_DIR
-+#undef SYSTEM_INCLUDE_DIR
-+#undef STANDARD_INCLUDE_DIR
-+
- const struct default_include cpp_include_defaults[]
- #ifdef INCLUDE_DEFAULTS
- = INCLUDE_DEFAULTS;
-diff -ruN gcc-4.1.0/gcc/Makefile.in gcc-4.1.0.new/gcc/Makefile.in
---- gcc-4.1.0/gcc/Makefile.in	2006-02-16 16:23:24.000000000 +0100
-+++ gcc-4.1.0.new/gcc/Makefile.in	2006-03-01 18:55:12.000000000 +0100
-@@ -219,7 +219,7 @@
- CPPFLAGS = @CPPFLAGS@
- 
- # These exists to be overridden by the x-* and t-* files, respectively.
--X_CFLAGS =
-+X_CFLAGS = $(NIX_EXTRA_CFLAGS) $(NIX_EXTRA_LDFLAGS)
- T_CFLAGS =
- 
- X_CPPFLAGS =
-@@ -383,7 +383,11 @@
- MD5_H	    = $(srcdir)/../include/md5.h
- 
- # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
--NATIVE_SYSTEM_HEADER_DIR = /usr/include
-+# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
-+# `fixinc' from fixing header files in /usr/include.  However,
-+# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
-+# it to some dummy directory.
-+NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
- # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
- CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
- 
-@@ -395,7 +399,7 @@
- STMP_FIXINC = @STMP_FIXINC@
- 
- # Test to see whether <limits.h> exists in the system header files.
--LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ]
-+LIMITS_H_TEST = true
- 
- # Directory for prefix to system directories, for
- # each of $(system_prefix)/usr/include, $(system_prefix)/usr/lib, etc.
-@@ -3002,7 +3006,7 @@
-   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_noncanonical)\" \
-   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
--  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
-+  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
-   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
-   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-   @TARGET_SYSTEM_ROOT_DEFINE@
-diff -ruN gcc-4.1.0/libstdc++-v3/include/Makefile.in gcc-4.1.0.new/libstdc++-v3/include/Makefile.in
---- gcc-4.1.0/libstdc++-v3/include/Makefile.in	2006-01-10 18:14:00.000000000 +0100
-+++ gcc-4.1.0.new/libstdc++-v3/include/Makefile.in	2006-03-01 18:57:32.000000000 +0100
-@@ -1257,8 +1257,8 @@
- 	if [ ! -d "${pch_output_builddir}" ]; then \
- 	  mkdir -p ${pch_output_builddir}; \
- 	fi; \
--	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
--	$(CXX) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
-+	$(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O0 -g -o ${pch_output_builddir}/O0g.gch; \
-+	$(CXX) $(CFLAGS) $(PCHFLAGS) $(AM_CPPFLAGS) ${pch_source} -O2 -g -o ${pch_output_builddir}/O2g.gch;
- 
- # For robustness sake (in light of junk files or in-source
- # configuration), copy from the build or source tree to the install
-diff -ruN gcc-4.1.0/ltcf-cxx.sh gcc-4.1.0.new/ltcf-cxx.sh
---- gcc-4.1.0/ltcf-cxx.sh	2005-07-16 04:30:53.000000000 +0200
-+++ gcc-4.1.0.new/ltcf-cxx.sh	2006-03-01 18:58:15.000000000 +0100
-@@ -989,7 +989,7 @@
-   # the conftest object file.
-   pre_test_object_deps_done=no
- 
--  for p in `eval $output_verbose_link_cmd`; do
-+  for p in `true`; do
- 
-     case $p in
- 
-diff -ruN gcc-4.1.0/ltconfig gcc-4.1.0.new/ltconfig
---- gcc-4.1.0/ltconfig	2005-07-16 04:30:53.000000000 +0200
-+++ gcc-4.1.0.new/ltconfig	2006-03-01 18:59:58.000000000 +0100
-@@ -2322,6 +2322,11 @@
- # A language-specific compiler.
- CC=$CC
- 
-+# Ugly hack to get libmudflap (and possibly other libraries) to build.
-+# Libtool filters out \`-B' flags when linking (why?), so the \`-B' flag
-+# to Glibc gets lost.  Here we forcibly add it to any invocation.
-+CC="\$CC $NIX_EXTRA_LDFLAGS"
-+
- # Is the compiler the GNU C compiler?
- with_gcc=$with_gcc
- 
-diff -ruN gcc-4.1.0/Makefile.in gcc-4.1.0.new/Makefile.in
---- gcc-4.1.0/Makefile.in	2005-12-15 15:02:02.000000000 +0100
-+++ gcc-4.1.0.new/Makefile.in	2006-03-01 19:41:04.000000000 +0100
-@@ -286,7 +286,7 @@
- WINDRES = @WINDRES@
- 
- CFLAGS = @CFLAGS@
--LDFLAGS = 
-+LDFLAGS = $(NIX_EXTRA_LDFLAGS)
- LIBCFLAGS = $(CFLAGS)
- CXXFLAGS = @CXXFLAGS@
- LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
-@@ -329,12 +329,12 @@
- # CFLAGS will be just -g.  We want to ensure that TARGET libraries
- # (which we know are built with gcc) are built with optimizations so
- # prepend -O2 when setting CFLAGS_FOR_TARGET.
--CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
-+CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS)
- SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
--CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
-+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) $(NIX_EXTRA_CFLAGS)
- LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
- LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
--LDFLAGS_FOR_TARGET = 
-+LDFLAGS_FOR_TARGET = $(NIX_EXTRA_LDFLAGS)
- PICFLAG_FOR_TARGET = 
- 
- # ------------------------------------
diff --git a/pkgs/development/compilers/gcc/4.2-apple32/pass-cxxcpp.patch b/pkgs/development/compilers/gcc/4.2-apple32/pass-cxxcpp.patch
deleted file mode 100644
index 4f9a29ae51b..00000000000
--- a/pkgs/development/compilers/gcc/4.2-apple32/pass-cxxcpp.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -rc gcc-orig/Makefile.in gcc-4.1.1/Makefile.in
-*** gcc-orig/Makefile.in	Wed Jun 21 13:40:23 2006
---- gcc-4.1.1/Makefile.in	Wed Jun 21 14:19:44 2006
-***************
-*** 213,219 ****
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
---- 213,220 ----
-  RAW_CXX_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
-  	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-! 	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
-! 	CXXCPP="$(RAW_CXX_FOR_TARGET) $(CFLAGS_FOR_BUILD) -E"; export CXXCPP;
-  
-  NORMAL_TARGET_EXPORTS = \
-  	$(BASE_TARGET_EXPORTS) \
diff --git a/pkgs/development/compilers/gcc/4.3/default.nix b/pkgs/development/compilers/gcc/4.3/default.nix
index 57fc0f805c4..d17f9f19515 100644
--- a/pkgs/development/compilers/gcc/4.3/default.nix
+++ b/pkgs/development/compilers/gcc/4.3/default.nix
@@ -47,9 +47,9 @@ let
       " --enable-threads=posix" +
       " --enable-nls"
       );
-  stageNameAddon = if (crossStageStatic) then "-stage-static" else
+  stageNameAddon = if crossStageStatic then "-stage-static" else
     "-stage-final";
-  crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+  crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 in
 
 stdenv.mkDerivation ({
@@ -76,15 +76,16 @@ stdenv.mkDerivation ({
     });
     
   patches =
-    [./pass-cxxcpp.patch ./libmudflap-cpp.patch]
+    [ ./pass-cxxcpp.patch ./libmudflap-cpp.patch ./siginfo_t_fix.patch ]
     ++ optional noSysDirs ./no-sys-dirs.patch
     ++ optional (noSysDirs && langFortran) ./no-sys-dirs-fortran.patch
     ++ optional langJava ./java-jvgenmain-link.patch
-    ++ optional langVhdl ./ghdl-ortho-cflags.patch;
+    ++ optional langVhdl ./ghdl-ortho-cflags.patch
+    ++ optional langVhdl ./ghdl-runtime-o2.patch;
     
   inherit noSysDirs profiledCompiler staticCompiler crossStageStatic
     binutilsCross libcCross;
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   buildInputs = [texinfo gmp mpfr]
     ++ (optionals langTreelang [bison flex])
@@ -128,7 +129,7 @@ stdenv.mkDerivation ({
       enableMultilib; };
 
   # ghdl does not build fine with parallel building
-  enableParallelBuilding = if langVhdl then false else true;
+  enableParallelBuilding = !langVhdl;
 
   meta = {
     homepage = "http://gcc.gnu.org/";
diff --git a/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch b/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch
new file mode 100644
index 00000000000..ddc455143c0
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.3/ghdl-runtime-o2.patch
@@ -0,0 +1,13 @@
+diff --git a/gcc/vhdl/Makefile.in b/gcc/vhdl/Makefile.in
+index b8d2ed0..0e8bd55 100644
+--- a/gcc/vhdl/Makefile.in
++++ b/gcc/vhdl/Makefile.in
+@@ -682,7 +682,7 @@ install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \
+ 	PDIR=`pwd` && cd $(DESTDIR)$(VHDL_LIB_DIR) && \
+ 	$(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. \
+ 	 LIBSRC_DIR="src" LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 \
+-	 ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \
++	 ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none -Wc,-O2" \
+ 	 std.v93 std.v87 ieee.v93 ieee.v87 synopsys.v93 synopsys.v87 mentor.v93
+ # Copy std_standard (this is done after libraries, since they remove dirs).
+ 	$(INSTALL_DATA) std87_standard.o \
diff --git a/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch
new file mode 100644
index 00000000000..8b126cd08c3
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.3/siginfo_t_fix.patch
@@ -0,0 +1,174 @@
+https://bugs.gentoo.org/424970
+
+fix from upstream for building with newer glibc versions
+
+From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
+From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 20 Apr 2012 08:14:00 +0000
+Subject: [PATCH] 	struct siginfo vs. siginfo_t
+
+	Backport from trunk (but apply to gcc/):
+
+	2012-04-20  Thomas Schwinge  <thomas@codesourcery.com>
+
+gcc/
+	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
+	siginfo_t instead of struct siginfo.
+	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
+	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
+	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
+	(ia64_handle_unwabi): Likewise.
+	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
+	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
+	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
+	(sh_fallback_frame_state): Likewise.
+	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/ChangeLog                    |   20 ++++++++++++++++++++
+ gcc/config/alpha/linux-unwind.h  |    4 ++--
+ gcc/config/bfin/linux-unwind.h   |    6 +++---
+ gcc/config/i386/linux-unwind.h   |    6 +++---
+ gcc/config/ia64/linux-unwind.h   |    6 +++---
+ gcc/config/mips/linux-unwind.h   |    5 +++--
+ gcc/config/pa/linux-unwind.h     |    4 ++--
+ gcc/config/sh/linux-unwind.h     |    9 +++++----
+ gcc/config/xtensa/linux-unwind.h |    4 ++--
+ 9 files changed, 43 insertions(+), 21 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
+index 4c811dc..8c04b3b 100644
+--- a/gcc/config/alpha/linux-unwind.h
++++ b/gcc/config/alpha/linux-unwind.h
+@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
+index 88c8285..15bb2f1 100644
+--- a/gcc/config/bfin/linux-unwind.h
++++ b/gcc/config/bfin/linux-unwind.h
+@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+ 	char retcode[8];
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+ 
+diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
+index 36ee370..fe0ea3e 100644
+--- a/gcc/config/i386/linux-unwind.h
++++ b/gcc/config/i386/linux-unwind.h
+@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
+index 93f762d..da31259 100644
+--- a/gcc/config/ia64/linux-unwind.h
++++ b/gcc/config/ia64/linux-unwind.h
+@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame_ = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame_->sc;
+@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame->sc;
+diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
+index 02f7cd5..094ff58 100644
+--- a/gcc/config/mips/linux-unwind.h
++++ b/gcc/config/mips/linux-unwind.h
+@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
+       struct rt_sigframe {
+ 	u_int32_t ass[4];  /* Argument save space for o32.  */
+ 	u_int32_t trampoline[2];
+-	struct siginfo info;
++	siginfo_t info;
+ 	_sig_ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
+index a0560e9..38b4eda 100644
+--- a/gcc/config/pa/linux-unwind.h
++++ b/gcc/config/pa/linux-unwind.h
+@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   int i;
+   struct sigcontext *sc;
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *frame;
+ 
+diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
+index 94ed95d..5a78e31 100644
+--- a/gcc/config/sh/linux-unwind.h
++++ b/gcc/config/sh/linux-unwind.h
+@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
+ 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
+     {
+       struct rt_sigframe {
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+ 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
+index 32e9349..2456497 100644
+--- a/gcc/config/xtensa/linux-unwind.h
++++ b/gcc/config/xtensa/linux-unwind.h
+@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+ 
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *rt_;
+ 
+-- 
+1.7.9.7
+
diff --git a/pkgs/development/compilers/gcc/4.4/default.nix b/pkgs/development/compilers/gcc/4.4/default.nix
index d962d4ac347..60e7baa7781 100644
--- a/pkgs/development/compilers/gcc/4.4/default.nix
+++ b/pkgs/development/compilers/gcc/4.4/default.nix
@@ -84,9 +84,9 @@ let version = "4.4.6";
         " --enable-nls" +
         " --disable-decimal-float" # No final libdecnumber (it may work only in 386)
         );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 
 in
 
@@ -104,16 +104,19 @@ stdenv.mkDerivation ({
   };
 
   patches =
-    [./pass-cxxcpp.patch
+    [ ./pass-cxxcpp.patch
 
-     # libmudflap and libstdc++ receive the build CPP,
-     # and not the target.
-     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279
-     ./target-cpp.patch
+      # libmudflap and libstdc++ receive the build CPP,
+      # and not the target.
+      # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42279
+      ./target-cpp.patch
 
-     # Bad mixture of build/target flags
-     ./libstdc++-target.patch
-     ]
+      # Bad mixture of build/target flags
+      ./libstdc++-target.patch
+
+      # Compatibility with newer Glibc.
+      ./siginfo_t_fix.patch
+    ]
     ++ optional noSysDirs ./no-sys-dirs.patch
     # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
     # target libraries and tools.
@@ -124,7 +127,7 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
     libcCross;
 
-  buildNativeInputs = [ texinfo which ];
+  nativeBuildInputs = [ texinfo which ];
 
   buildInputs = [ gmp mpfr gettext ]
     ++ (optional (ppl != null) ppl)
@@ -163,11 +166,11 @@ stdenv.mkDerivation ({
       )
     }
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   # Needed for the cross compilation to work
   AR = "ar";
@@ -189,13 +192,13 @@ stdenv.mkDerivation ({
     configureFlags = "
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -211,7 +214,7 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     ";
@@ -243,7 +246,7 @@ stdenv.mkDerivation ({
       enableMultilib version; };
 
   # ghdl does not build fine with parallel building
-  enableParallelBuilding = if langVhdl then false else true;
+  enableParallelBuilding = !langVhdl;
 
   meta = {
     homepage = http://gcc.gnu.org/;
diff --git a/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch
new file mode 100644
index 00000000000..8b126cd08c3
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.4/siginfo_t_fix.patch
@@ -0,0 +1,174 @@
+https://bugs.gentoo.org/424970
+
+fix from upstream for building with newer glibc versions
+
+From f0cdca2bf2230005025e13e7354fedb612933c96 Mon Sep 17 00:00:00 2001
+From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 20 Apr 2012 08:14:00 +0000
+Subject: [PATCH] 	struct siginfo vs. siginfo_t
+
+	Backport from trunk (but apply to gcc/):
+
+	2012-04-20  Thomas Schwinge  <thomas@codesourcery.com>
+
+gcc/
+	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
+	siginfo_t instead of struct siginfo.
+	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
+	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
+	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
+	(ia64_handle_unwabi): Likewise.
+	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
+	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
+	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
+	(sh_fallback_frame_state): Likewise.
+	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_5-branch@186613 138bc75d-0d04-0410-961f-82ee72b054a4
+---
+ gcc/ChangeLog                    |   20 ++++++++++++++++++++
+ gcc/config/alpha/linux-unwind.h  |    4 ++--
+ gcc/config/bfin/linux-unwind.h   |    6 +++---
+ gcc/config/i386/linux-unwind.h   |    6 +++---
+ gcc/config/ia64/linux-unwind.h   |    6 +++---
+ gcc/config/mips/linux-unwind.h   |    5 +++--
+ gcc/config/pa/linux-unwind.h     |    4 ++--
+ gcc/config/sh/linux-unwind.h     |    9 +++++----
+ gcc/config/xtensa/linux-unwind.h |    4 ++--
+ 9 files changed, 43 insertions(+), 21 deletions(-)
+
+diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
+index 4c811dc..8c04b3b 100644
+--- a/gcc/config/alpha/linux-unwind.h
++++ b/gcc/config/alpha/linux-unwind.h
+@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
+index 88c8285..15bb2f1 100644
+--- a/gcc/config/bfin/linux-unwind.h
++++ b/gcc/config/bfin/linux-unwind.h
+@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+ 	char retcode[8];
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+ 
+diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
+index 36ee370..fe0ea3e 100644
+--- a/gcc/config/i386/linux-unwind.h
++++ b/gcc/config/i386/linux-unwind.h
+@@ -133,9 +133,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
+index 93f762d..da31259 100644
+--- a/gcc/config/ia64/linux-unwind.h
++++ b/gcc/config/ia64/linux-unwind.h
+@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame_ = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame_->sc;
+@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame->sc;
+diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
+index 02f7cd5..094ff58 100644
+--- a/gcc/config/mips/linux-unwind.h
++++ b/gcc/config/mips/linux-unwind.h
+@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
+       struct rt_sigframe {
+ 	u_int32_t ass[4];  /* Argument save space for o32.  */
+ 	u_int32_t trampoline[2];
+-	struct siginfo info;
++	siginfo_t info;
+ 	_sig_ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
+index a0560e9..38b4eda 100644
+--- a/gcc/config/pa/linux-unwind.h
++++ b/gcc/config/pa/linux-unwind.h
+@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   int i;
+   struct sigcontext *sc;
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *frame;
+ 
+diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
+index 94ed95d..5a78e31 100644
+--- a/gcc/config/sh/linux-unwind.h
++++ b/gcc/config/sh/linux-unwind.h
+@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
+ 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
+     {
+       struct rt_sigframe {
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+ 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
+index 32e9349..2456497 100644
+--- a/gcc/config/xtensa/linux-unwind.h
++++ b/gcc/config/xtensa/linux-unwind.h
+@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+ 
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *rt_;
+ 
+-- 
+1.7.9.7
+
diff --git a/pkgs/development/compilers/gcc/4.5/default.nix b/pkgs/development/compilers/gcc/4.5/default.nix
index 9cf38718a47..cb0432b6672 100644
--- a/pkgs/development/compilers/gcc/4.5/default.nix
+++ b/pkgs/development/compilers/gcc/4.5/default.nix
@@ -78,7 +78,7 @@ let version = "4.5.4";
       withArch +
       withCpu +
       withAbi +
-      (if (crossMingw && crossStageStatic) then
+      (if crossMingw && crossStageStatic then
         " --with-headers=${libcCross}/include" +
         " --with-gcc" +
         " --with-gnu-as" +
@@ -115,9 +115,9 @@ let version = "4.5.4";
           " --enable-nls" +
           " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
         );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
 
 in
 
@@ -146,7 +146,7 @@ stdenv.mkDerivation ({
 
   postPatch =
     if (stdenv.system == "i586-pc-gnu"
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (cross != null && cross.config == "i586-pc-gnu"
@@ -189,7 +189,7 @@ stdenv.mkDerivation ({
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -205,7 +205,7 @@ stdenv.mkDerivation ({
   inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which ]
+  nativeBuildInputs = [ texinfo which ]
     ++ optional (perl != null) perl;
     
   buildInputs = [ gmp mpfr mpc libelf gettext ]
@@ -237,7 +237,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -255,11 +255,11 @@ stdenv.mkDerivation ({
     ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
       if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   crossAttrs = {
     AR = "${stdenv.cross.config}-ar";
@@ -277,13 +277,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloogppl != null then "--with-cloog=${cloogppl.hostDrv}" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloogppl != null then "--with-cloog=${cloogppl.crossDrv}" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -299,7 +299,7 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     '';
@@ -391,7 +391,7 @@ stdenv.mkDerivation ({
 
 // optionalAttrs (cross != null || libcCross != null) {
   # `builder.sh' sets $CPP, which leads configure to use "gcc -E" instead of,
-  # say, "i586-pc-gnu-gcc -E" when building `gcc.hostDrv'.
+  # say, "i586-pc-gnu-gcc -E" when building `gcc.crossDrv'.
   # FIXME: Fix `builder.sh' directly in the next stdenv-update.
   postUnpack = "unset CPP";
 }
diff --git a/pkgs/development/compilers/gcc/4.6/builder.sh b/pkgs/development/compilers/gcc/4.6/builder.sh
index 6cd64bc58f2..bdf15be5a99 100644
--- a/pkgs/development/compilers/gcc/4.6/builder.sh
+++ b/pkgs/development/compilers/gcc/4.6/builder.sh
@@ -196,6 +196,15 @@ postConfigure() {
 }
 
 
+preInstall() {
+    # Make ‘lib64’ a symlink to ‘lib’.
+    if [ -n "$is64bit" -a -z "$enableMultilib" ]; then
+        mkdir -p $out/lib
+        ln -s lib $out/lib64
+    fi
+}
+
+
 postInstall() {
     # Remove precompiled headers for now.  They are very big and
     # probably not very useful yet.
@@ -234,13 +243,4 @@ postInstall() {
     eval "$postInstallGhdl"
 }
 
-
-if test -z "$targetConfig" && test -z "$crossConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
 genericBuild
diff --git a/pkgs/development/compilers/gcc/4.6/default.nix b/pkgs/development/compilers/gcc/4.6/default.nix
index c94a9285b29..6713dd12b3c 100644
--- a/pkgs/development/compilers/gcc/4.6/default.nix
+++ b/pkgs/development/compilers/gcc/4.6/default.nix
@@ -51,7 +51,10 @@ let version = "4.6.3";
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
-    patches = [ ]
+    patches =
+      [ # Fix building on Glibc 2.16.
+        ./siginfo_t_fix.patch
+      ]
       ++ optional (cross != null) ./libstdc++-target.patch
       ++ optional noSysDirs ./no-sys-dirs.patch
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
@@ -84,71 +87,95 @@ let version = "4.6.3";
 
     javaAwtGtk = langJava && gtk != null;
 
+    /* Platform flags */
+    platformFlags = let
+        gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
+        gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
+        gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
+        gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
+        gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+      in 
+        (withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat);
+
     /* Cross-gcc settings */
-    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
     crossMingw = (cross != null && cross.libc == "msvcrt");
-
-    crossConfigureFlags =
-      "--target=${cross.config}" +
-      withArch +
-      withCpu +
-      withAbi +
-      (if (crossMingw && crossStageStatic) then
-        " --with-headers=${libcCross}/include" +
-        " --with-gcc" +
-        " --with-gnu-as" +
-        " --with-gnu-ld" +
-        " --with-gnu-ld" +
-        " --disable-shared" +
-        " --disable-nls" +
-        " --disable-debug" +
-        " --enable-sjlj-exceptions" +
-        " --enable-threads=win32" +
-        " --disable-win32-registry"
-        else if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-libquadmath" +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        (if crossMingw then
-          " --enable-threads=win32" +
-          " --enable-sjlj-exceptions" +
-          " --enable-hash-synchronization" +
-          " --disable-libssp" +
+    crossConfigureFlags = let
+        gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
+        gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
+        gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
+        gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+      in
+        "--target=${cross.config}" +
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        (if crossMingw && crossStageStatic then
+          " --with-headers=${libcCross}/include" +
+          " --with-gcc" +
+          " --with-gnu-as" +
+          " --with-gnu-ld" +
+          " --with-gnu-ld" +
+          " --disable-shared" +
           " --disable-nls" +
-          " --with-dwarf2" +
-          # I think noone uses shared gcc libs in mingw, so we better do the same.
-          # In any case, mingw32 g++ linking is broken by default with shared libs,
-          # unless adding "-lsupc++" to any linking command. I don't know why.
+          " --disable-debug" +
+          " --enable-sjlj-exceptions" +
+          " --enable-threads=win32" +
+          " --disable-win32-registry"
+          else if crossStageStatic then
+          " --disable-libssp --disable-nls" +
+          " --without-headers" +
+          " --disable-threads " +
+          " --disable-libmudflap " +
+          " --disable-libgomp " +
+          " --disable-libquadmath" +
           " --disable-shared" +
-          (if cross.config == "x86_64-w64-mingw32" then
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else "")
-          else (if cross.libc == "uclibc" then
-            # In uclibc cases, libgomp needs an additional '-ldl'
-            # and as I don't know how to pass it, I disable libgomp.
-            " --disable-libgomp" else "") +
-          " --enable-threads=posix" +
-          " --enable-nls" +
-          " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-        );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+          " --disable-decimal-float" # libdecnumber requires libc
+          else
+          " --with-headers=${libcCross}/include" +
+          " --enable-__cxa_atexit" +
+          " --enable-long-long" +
+          (if crossMingw then
+            " --enable-threads=win32" +
+            " --enable-sjlj-exceptions" +
+            " --enable-hash-synchronization" +
+            " --disable-libssp" +
+            " --disable-nls" +
+            " --with-dwarf2" +
+            # I think noone uses shared gcc libs in mingw, so we better do the same.
+            # In any case, mingw32 g++ linking is broken by default with shared libs,
+            # unless adding "-lsupc++" to any linking command. I don't know why.
+            " --disable-shared" +
+            (if cross.config == "x86_64-w64-mingw32" then
+              # To keep ABI compatibility with upstream mingw-w64
+              " --enable-fully-dynamic-string"
+              else "")
+            else (if cross.libc == "uclibc" then
+              # In uclibc cases, libgomp needs an additional '-ldl'
+              # and as I don't know how to pass it, I disable libgomp.
+              " --disable-libgomp" else "") +
+            " --enable-threads=posix" +
+            " --enable-nls" +
+            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
+          );
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
+
+  bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
 
 in
 
@@ -165,11 +192,11 @@ stdenv.mkDerivation ({
     inherit langC langCC langFortran langJava langAda langGo;
   };
 
-  inherit patches;
+  inherit patches enableMultilib;
 
   postPatch =
     if (stdenv.isGNU
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (crossGNU && libcCross != null))
@@ -211,7 +238,7 @@ stdenv.mkDerivation ({
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -224,10 +251,10 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
+  inherit noSysDirs staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which gettext ]
+  nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
@@ -251,7 +278,7 @@ stdenv.mkDerivation ({
         [ "--with-host-libstdcxx=-lstdc++ -lgcc_s" ];
 
   configureFlags = "
-    ${if enableMultilib then "" else "--disable-multilib"}
+    ${if enableMultilib then "--disable-libquadmath" else "--disable-multilib"}
     ${if enableShared then "" else "--disable-shared"}
     ${if enablePlugin then "--enable-plugin" else ""}
     ${if ppl != null then "--with-ppl=${ppl}" else ""}
@@ -270,7 +297,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -286,14 +313,18 @@ stdenv.mkDerivation ({
         )
       )
     }
-    ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
-      if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
+    ${if !bootstrap then "--disable-bootstrap" else ""}
+    ${if cross == null then platformFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
+
+  buildFlags = if bootstrap then
+    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
+    else "";
 
   installTargets =
     if stripped
@@ -302,6 +333,7 @@ stdenv.mkDerivation ({
 
   crossAttrs = {
     patches = patches ++ [ ./hurd-sigrtmin.patch ];
+    postPatch = "";
     AR = "${stdenv.cross.config}-ar";
     LD = "${stdenv.cross.config}-ld";
     CC = "${stdenv.cross.config}-gcc";
@@ -317,13 +349,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -340,10 +372,11 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+      ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
       ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
     '';
+    buildFlags = "";
   };
 
 
@@ -399,10 +432,12 @@ stdenv.mkDerivation ({
     else null;
 
   passthru = { inherit langC langCC langAda langFortran langVhdl
-      langGo enableMultilib version; };
+      langGo version; };
 
   enableParallelBuilding = true;
 
+  inherit (stdenv) is64bit;
+
   meta = {
     homepage = http://gcc.gnu.org/;
     license = "GPLv3+";  # runtime support libraries are typically LGPLv3+
diff --git a/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch b/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch
new file mode 100644
index 00000000000..1409c552c7d
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.6/siginfo_t_fix.patch
@@ -0,0 +1,211 @@
+Partly taken from:
+http://gcc.gnu.org/git/?p=gcc.git;a=patch;h=5617a3db5d04630d0bfb71a3578894b4442f266d
+
+Adapted to gcc 4.6.3. Original commit text follows.
+
+From 5617a3db5d04630d0bfb71a3578894b4442f266d Mon Sep 17 00:00:00 2001
+From: tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Fri, 20 Apr 2012 07:44:50 +0000
+Subject: [PATCH] 	struct siginfo vs. siginfo_t
+
+gcc/
+	* config/alpha/linux-unwind.h (alpha_fallback_frame_state): Use
+	siginfo_t instead of struct siginfo.
+	* config/bfin/linux-unwind.h (bfin_fallback_frame_state): Likewise.
+	* config/i386/linux-unwind.h (x86_fallback_frame_state): Likewise.
+	* config/ia64/linux-unwind.h (ia64_fallback_frame_state)
+	(ia64_handle_unwabi): Likewise.
+	* config/mips/linux-unwind.h (mips_fallback_frame_state): Likewise.
+	* config/pa/linux-unwind.h (pa32_fallback_frame_state): Likewise.
+	* config/sh/linux-unwind.h (shmedia_fallback_frame_state)
+	(sh_fallback_frame_state): Likewise.
+	* config/xtensa/linux-unwind.h (xtensa_fallback_frame_state): Likewise.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186610 138bc75d-0d04-0410-961f-82ee72b054a4
+
+diff --git a/gcc/config/alpha/linux-unwind.h b/gcc/config/alpha/linux-unwind.h
+index 4c811dc..8c04b3b 100644
+--- a/gcc/config/alpha/linux-unwind.h
++++ b/gcc/config/alpha/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Alpha Linux.
+-   Copyright (C) 2004, 2005, 2009, 2011 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -49,7 +49,7 @@ alpha_fallback_frame_state (struct _Unwind_Context *context,
+   else if (pc[1] == 0x201f015f)		/* lda $0,NR_rt_sigreturn */
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/bfin/linux-unwind.h b/gcc/config/bfin/linux-unwind.h
+index 88c8285..15bb2f1 100644
+--- a/gcc/config/bfin/linux-unwind.h
++++ b/gcc/config/bfin/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Blackfin.
+-   Copyright (C) 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2007, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -48,10 +48,10 @@ bfin_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+ 	char retcode[8];
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+ 
+diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h
+index ad0ccfa..02b1897 100644
+--- a/gcc/config/i386/linux-unwind.h
++++ b/gcc/config/i386/linux-unwind.h
+@@ -136,9 +136,9 @@ x86_fallback_frame_state (struct _Unwind_Context *context,
+     {
+       struct rt_sigframe {
+ 	int sig;
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/ia64/linux-unwind.h b/gcc/config/ia64/linux-unwind.h
+index 93f762d..da31259 100644
+--- a/gcc/config/ia64/linux-unwind.h
++++ b/gcc/config/ia64/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for IA64 Linux.
+-   Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
+ 
+    This file is part of GCC.
+ 
+@@ -47,7 +47,7 @@ ia64_fallback_frame_state (struct _Unwind_Context *context,
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame_ = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame_->sc;
+@@ -137,7 +137,7 @@ ia64_handle_unwabi (struct _Unwind_Context *context, _Unwind_FrameState *fs)
+       struct sigframe {
+ 	char scratch[16];
+ 	unsigned long sig_number;
+-	struct siginfo *info;
++	siginfo_t *info;
+ 	struct sigcontext *sc;
+       } *frame = (struct sigframe *)context->psp;
+       struct sigcontext *sc = frame->sc;
+diff --git a/gcc/config/mips/linux-unwind.h b/gcc/config/mips/linux-unwind.h
+index 02f7cd5..094ff58 100644
+--- a/gcc/config/mips/linux-unwind.h
++++ b/gcc/config/mips/linux-unwind.h
+@@ -1,5 +1,6 @@
+ /* DWARF2 EH unwinding support for MIPS Linux.
+-   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Free Software
++   Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -75,7 +76,7 @@ mips_fallback_frame_state (struct _Unwind_Context *context,
+       struct rt_sigframe {
+ 	u_int32_t ass[4];  /* Argument save space for o32.  */
+ 	u_int32_t trampoline[2];
+-	struct siginfo info;
++	siginfo_t info;
+ 	_sig_ucontext_t uc;
+       } *rt_ = context->cfa;
+       sc = &rt_->uc.uc_mcontext;
+diff --git a/gcc/config/pa/linux-unwind.h b/gcc/config/pa/linux-unwind.h
+index a0560e9..38b4eda 100644
+--- a/gcc/config/pa/linux-unwind.h
++++ b/gcc/config/pa/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for PA Linux.
+-   Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -63,7 +63,7 @@ pa32_fallback_frame_state (struct _Unwind_Context *context,
+   int i;
+   struct sigcontext *sc;
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *frame;
+ 
+diff --git a/gcc/config/sh/linux-unwind.h b/gcc/config/sh/linux-unwind.h
+index 94ed95d..5a78e31 100644
+--- a/gcc/config/sh/linux-unwind.h
++++ b/gcc/config/sh/linux-unwind.h
+@@ -1,5 +1,6 @@
+ /* DWARF2 EH unwinding support for SH Linux.
+-   Copyright (C) 2004, 2005, 2006, 2007, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2004, 2005, 2006, 2007, 2009, 2012 Free Software Foundation,
++   Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -80,9 +81,9 @@ shmedia_fallback_frame_state (struct _Unwind_Context *context,
+ 	   && (*(unsigned long *) (pc+11)  == 0x6ff0fff0))
+     {
+       struct rt_sigframe {
+-	struct siginfo *pinfo;
++	siginfo_t *pinfo;
+ 	void *puc;
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+@@ -179,7 +180,7 @@ sh_fallback_frame_state (struct _Unwind_Context *context,
+ 		&& (*(unsigned short *) (pc+14)  == 0x00ad))))
+     {
+       struct rt_sigframe {
+-	struct siginfo info;
++	siginfo_t info;
+ 	struct ucontext uc;
+       } *rt_ = context->cfa;
+       /* The void * cast is necessary to avoid an aliasing warning.
+diff --git a/gcc/config/xtensa/linux-unwind.h b/gcc/config/xtensa/linux-unwind.h
+index 32e9349..2456497 100644
+--- a/gcc/config/xtensa/linux-unwind.h
++++ b/gcc/config/xtensa/linux-unwind.h
+@@ -1,5 +1,5 @@
+ /* DWARF2 EH unwinding support for Xtensa.
+-   Copyright (C) 2008, 2009 Free Software Foundation, Inc.
++   Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+@@ -62,7 +62,7 @@ xtensa_fallback_frame_state (struct _Unwind_Context *context,
+   struct sigcontext *sc;
+ 
+   struct rt_sigframe {
+-    struct siginfo info;
++    siginfo_t info;
+     struct ucontext uc;
+   } *rt_;
+ 
+-- 
+1.7.3.4
+
diff --git a/pkgs/development/compilers/gcc/4.7/arm-eabi.patch b/pkgs/development/compilers/gcc/4.7/arm-eabi.patch
new file mode 100644
index 00000000000..63b017062b5
--- /dev/null
+++ b/pkgs/development/compilers/gcc/4.7/arm-eabi.patch
@@ -0,0 +1,230 @@
+Index: gcc-4_7-branch/libstdc++-v3/configure.host
+===================================================================
+--- gcc-4_7-branch/libstdc++-v3/configure.host	(revision 194579)
++++ gcc-4_7-branch/libstdc++-v3/configure.host	(revision 194580)
+@@ -340,7 +340,7 @@
+         fi
+     esac
+     case "${host}" in
+-      arm*-*-linux-*eabi)
++      arm*-*-linux-*eabi*)
+ 	port_specific_symbol_files="\$(srcdir)/../config/os/gnu-linux/arm-eabi-extra.ver"
+ 	;;
+     esac
+Index: gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc
+===================================================================
+--- gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc	(revision 194579)
++++ gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs-2.cc	(revision 194580)
+@@ -1,5 +1,5 @@
+ // { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
+-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ 
+ // 2007-05-03  Benjamin Kosnik  <bkoz@redhat.com>
+ //
+Index: gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc
+===================================================================
+--- gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc	(revision 194579)
++++ gcc-4_7-branch/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs-2.cc	(revision 194580)
+@@ -1,5 +1,5 @@
+ // { dg-options "-std=gnu++0x -funsigned-char -fshort-enums" }
+-// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++// { dg-options "-std=gnu++0x -funsigned-char -fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ 
+ // 2007-05-03  Benjamin Kosnik  <bkoz@redhat.com>
+ //
+Index: gcc-4_7-branch/libjava/configure.ac
+===================================================================
+--- gcc-4_7-branch/libjava/configure.ac	(revision 194579)
++++ gcc-4_7-branch/libjava/configure.ac	(revision 194580)
+@@ -931,7 +931,7 @@
+     # on Darwin -single_module speeds up loading of the dynamic libraries.
+     extra_ldflags_libjava=-Wl,-single_module
+     ;;
+-arm*linux*eabi)
++arm*-*-linux*eabi*)
+     # Some of the ARM unwinder code is actually in libstdc++.  We
+     # could in principle replicate it in libgcj, but it's better to
+     # have a dependency on libstdc++.
+Index: gcc-4_7-branch/libjava/configure
+===================================================================
+--- gcc-4_7-branch/libjava/configure	(revision 194579)
++++ gcc-4_7-branch/libjava/configure	(revision 194580)
+@@ -20542,7 +20542,7 @@
+     # on Darwin -single_module speeds up loading of the dynamic libraries.
+     extra_ldflags_libjava=-Wl,-single_module
+     ;;
+-arm*linux*eabi)
++arm*-*-linux*eabi*)
+     # Some of the ARM unwinder code is actually in libstdc++.  We
+     # could in principle replicate it in libgcj, but it's better to
+     # have a dependency on libstdc++.
+Index: gcc-4_7-branch/libgcc/config.host
+===================================================================
+--- gcc-4_7-branch/libgcc/config.host	(revision 194579)
++++ gcc-4_7-branch/libgcc/config.host	(revision 194580)
+@@ -327,7 +327,7 @@
+ arm*-*-linux*)			# ARM GNU/Linux with ELF
+ 	tmake_file="${tmake_file} arm/t-arm t-fixedpoint-gnu-prefix"
+ 	case ${host} in
+-	arm*-*-linux-*eabi)
++	arm*-*-linux-*eabi*)
+ 	  tmake_file="${tmake_file} arm/t-elf arm/t-bpabi arm/t-linux-eabi t-slibgcc-libgcc"
+ 	  tm_file="$tm_file arm/bpabi-lib.h"
+ 	  unwind_header=config/arm/unwind-arm.h
+Index: gcc-4_7-branch/gcc/doc/install.texi
+===================================================================
+--- gcc-4_7-branch/gcc/doc/install.texi	(revision 194579)
++++ gcc-4_7-branch/gcc/doc/install.texi	(revision 194580)
+@@ -3222,7 +3222,7 @@
+ @heading @anchor{arm-x-eabi}arm-*-eabi
+ ARM-family processors.  Subtargets that use the ELF object format
+ require GNU binutils 2.13 or newer.  Such subtargets include:
+-@code{arm-*-netbsdelf}, @code{arm-*-*linux-gnueabi}
++@code{arm-*-netbsdelf}, @code{arm-*-*linux-gnueabi*}
+ and @code{arm-*-rtemseabi}.
+ 
+ @html
+Index: gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/gcc.target/arm/synchronize.c	(revision 194580)
+@@ -1,4 +1,4 @@
+-/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-*eabi } } } */
++/* { dg-final { scan-assembler "__sync_synchronize|dmb|mcr" { target arm*-*-linux-*eabi* } } } */
+ 
+ void *foo (void)
+ {
+Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.jason/enum6.C	(revision 194580)
+@@ -7,10 +7,10 @@
+ // enum-size attributes should only be emitted if there are values of
+ // enum type that can escape the compilation unit, gcc cannot currently
+ // detect this; if this facility is added then this linker option should
+-// not be needed.  arm-*-linux*eabi should be a good approximation to
++// not be needed.  arm-*-linux*eabi* should be a good approximation to
+ // those platforms where the EABI supplement defines enum values to be
+ // 32 bits wide.
+-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ 
+ #include <limits.h>
+ 
+Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.other/enum4.C	(revision 194580)
+@@ -9,10 +9,10 @@
+ // enum-size attributes should only be emitted if there are values of
+ // enum type that can escape the compilation unit, gcc cannot currently
+ // detect this; if this facility is added then this linker option should
+-// not be needed.  arm-*-linux*eabi should be a good approximation to
++// not be needed.  arm-*-linux*eabi* should be a good approximation to
+ // those platforms where the EABI supplement defines enum values to be
+ // 32 bits wide.
+-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ 
+ enum E { 
+   a = -312
+Index: gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/g++.old-deja/g++.law/enum9.C	(revision 194580)
+@@ -7,10 +7,10 @@
+ // enum-size attributes should only be emitted if there are values of
+ // enum type that can escape the compilation unit, gcc cannot currently
+ // detect this; if this facility is added then this linker option should
+-// not be needed.  arm-*-linux*eabi should be a good approximation to
++// not be needed.  arm-*-linux*eabi* should be a good approximation to
+ // those platforms where the EABI supplement defines enum values to be
+ // 32 bits wide.
+-// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ 
+ // GROUPS passed enums
+   extern "C" int printf (const char *, ...);
+Index: gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/lib/target-supports.exp	(revision 194580)
+@@ -3818,7 +3818,7 @@
+ 		}
+ 	    } ""
+ 	}]
+-    } elseif { [istarget arm*-*-linux-gnueabi] } {
++    } elseif { [istarget arm*-*-linux-gnueabi*] } {
+ 	return [check_runtime sync_longlong_runtime {
+ 	    #include <stdlib.h>
+ 	    int main ()
+@@ -3860,7 +3860,7 @@
+ 	     || [istarget i?86-*-*]
+ 	     || [istarget x86_64-*-*]
+ 	     || [istarget alpha*-*-*] 
+-	     || [istarget arm*-*-linux-gnueabi] 
++	     || [istarget arm*-*-linux-gnueabi*] 
+ 	     || [istarget bfin*-*linux*]
+ 	     || [istarget hppa*-*linux*]
+ 	     || [istarget s390*-*-*] 
+@@ -3890,7 +3890,7 @@
+ 	     || [istarget i?86-*-*]
+ 	     || [istarget x86_64-*-*]
+ 	     || [istarget alpha*-*-*] 
+-	     || [istarget arm*-*-linux-gnueabi] 
++	     || [istarget arm*-*-linux-gnueabi*] 
+ 	     || [istarget hppa*-*linux*]
+ 	     || [istarget s390*-*-*] 
+ 	     || [istarget powerpc*-*-*]
+Index: gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_9.f90	(revision 194580)
+@@ -1,6 +1,6 @@
+ ! { dg-do run }
+ ! { dg-options "-fshort-enums" }
+-! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ ! Program to test enumerations when option -fshort-enums is given
+ 
+ program main
+Index: gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90
+===================================================================
+--- gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90	(revision 194579)
++++ gcc-4_7-branch/gcc/testsuite/gfortran.dg/enum_10.f90	(revision 194580)
+@@ -1,7 +1,7 @@
+ ! { dg-do run }
+ ! { dg-additional-sources enum_10.c }
+ ! { dg-options "-fshort-enums -w" }
+-! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
++! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi* } }
+ ! Make sure short enums are indeed interoperable with the
+ ! corresponding C type.
+ 
+Index: gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in
+===================================================================
+--- gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in	(revision 194579)
++++ gcc-4_7-branch/gcc/ada/gcc-interface/Makefile.in	(revision 194580)
+@@ -1866,7 +1866,7 @@
+   LIBRARY_VERSION := $(LIB_VERSION)
+ endif
+ 
+-ifeq ($(strip $(filter-out arm% linux-gnueabi,$(arch) $(osys)-$(word 4,$(targ)))),)
++ifeq ($(strip $(filter-out arm%-linux,$(arch)-$(osys)) $(if $(findstring eabi,$(word 4,$(targ))),,$(word 4,$(targ)))),)
+   LIBGNAT_TARGET_PAIRS = \
+   a-intnam.ads<a-intnam-linux.ads \
+   s-inmaop.adb<s-inmaop-posix.adb \
+Index: gcc-4_7-branch/gcc/config.gcc
+===================================================================
+--- gcc-4_7-branch/gcc/config.gcc	(revision 194579)
++++ gcc-4_7-branch/gcc/config.gcc	(revision 194580)
+@@ -855,7 +855,7 @@
+ 	esac
+ 	tmake_file="${tmake_file} arm/t-arm"
+ 	case ${target} in
+-	arm*-*-linux-*eabi)
++	arm*-*-linux-*eabi*)
+ 	    tm_file="$tm_file arm/bpabi.h arm/linux-eabi.h"
+ 	    tmake_file="$tmake_file arm/t-arm-elf arm/t-bpabi arm/t-linux-eabi"
+ 	    # Define multilib configuration for arm-linux-androideabi.
diff --git a/pkgs/development/compilers/gcc/4.7/builder.sh b/pkgs/development/compilers/gcc/4.7/builder.sh
index 4ae7a1c193b..37400fba5bf 100644
--- a/pkgs/development/compilers/gcc/4.7/builder.sh
+++ b/pkgs/development/compilers/gcc/4.7/builder.sh
@@ -71,7 +71,7 @@ if test "$noSysDirs" = "1"; then
         unset CPATH
         if test -z "$crossStageStatic"; then
             EXTRA_TARGET_CFLAGS="-B${libcCross}/lib -idirafter ${libcCross}/include"
-            EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib"
+            EXTRA_TARGET_LDFLAGS="-Wl,-L${libcCross}/lib -Wl,-rpath,${libcCross}/lib -Wl,-rpath-link,${libcCross}/lib"
         fi
     else
         if test -z "$NIX_GCC_CROSS"; then
@@ -95,7 +95,9 @@ if test "$noSysDirs" = "1"; then
             NIX_FIXINC_DUMMY_CROSS=$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/include
 
             # The path to the Glibc binaries such as `crti.o'.
-            glibc_libdir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)/lib"
+            glibc_dir="$(cat $NIX_GCC_CROSS/nix-support/orig-libc)"
+            glibc_libdir="$glibc_dir/lib"
+            configureFlags="$configureFlags --with-native-system-header-dir=$glibc_dir/include"
 
             extraFlags="-I$NIX_FIXINC_DUMMY_CROSS $extraFlags"
             extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $extraLDFlags"
@@ -237,13 +239,4 @@ postInstall() {
     eval "$postInstallGhdl"
 }
 
-
-if test -z "$targetConfig" && test -z "$crossConfig"; then
-    if test -z "$profiledCompiler"; then
-        buildFlags="bootstrap $buildFlags"
-    else    
-        buildFlags="profiledbootstrap $buildFlags"
-    fi
-fi
-
 genericBuild
diff --git a/pkgs/development/compilers/gcc/4.7/default.nix b/pkgs/development/compilers/gcc/4.7/default.nix
index 02733d04203..4f260d75afc 100644
--- a/pkgs/development/compilers/gcc/4.7/default.nix
+++ b/pkgs/development/compilers/gcc/4.7/default.nix
@@ -49,19 +49,19 @@ assert langGo -> langCC;
 with stdenv.lib;
 with builtins;
 
-let version = "4.7.1";
+let version = "4.7.3";
 
     # Whether building a cross-compiler for GNU/Hurd.
     crossGNU = cross != null && cross.config == "i586-pc-gnu";
 
-    patches = [ ]
+    patches = []
+      ++ optional stdenv.isArm [ ./arm-eabi.patch ]
       ++ optional (cross != null) ./libstdc++-target.patch
       # ++ optional noSysDirs ./no-sys-dirs.patch
       # The GNAT Makefiles did not pay attention to CFLAGS_FOR_TARGET for its
       # target libraries and tools.
       ++ optional langAda ./gnat-cflags.patch
-      ++ optional langFortran ./gfortran-driving.patch
-      ++ optional (stdenv.isGNU || crossGNU) ./hurd-sigrtmin.patch;
+      ++ optional langFortran ./gfortran-driving.patch;
 
     javaEcj = fetchurl {
       # The `$(top_srcdir)/ecj.jar' file is automatically picked up at
@@ -86,71 +86,104 @@ let version = "4.7.1";
 
     javaAwtGtk = langJava && gtk != null;
 
+    /* Platform flags */
+    platformFlags = let
+        gccArch = stdenv.lib.attrByPath [ "platform" "gcc" "arch" ] null stdenv;
+        gccCpu = stdenv.lib.attrByPath [ "platform" "gcc" "cpu" ] null stdenv;
+        gccAbi = stdenv.lib.attrByPath [ "platform" "gcc" "abi" ] null stdenv;
+        gccFpu = stdenv.lib.attrByPath [ "platform" "gcc" "fpu" ] null stdenv;
+        gccFloat = stdenv.lib.attrByPath [ "platform" "gcc" "float" ] null stdenv;
+        gccMode = stdenv.lib.attrByPath [ "platform" "gcc" "mode" ] null stdenv;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in 
+        (withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode);
+
     /* Cross-gcc settings */
-    gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
-    gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
-    gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
-    withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
-    withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
-    withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
     crossMingw = (cross != null && cross.libc == "msvcrt");
-
-    crossConfigureFlags =
-      "--target=${cross.config}" +
-      withArch +
-      withCpu +
-      withAbi +
-      (if (crossMingw && crossStageStatic) then
-        " --with-headers=${libcCross}/include" +
-        " --with-gcc" +
-        " --with-gnu-as" +
-        " --with-gnu-ld" +
-        " --with-gnu-ld" +
-        " --disable-shared" +
-        " --disable-nls" +
-        " --disable-debug" +
-        " --enable-sjlj-exceptions" +
-        " --enable-threads=win32" +
-        " --disable-win32-registry"
-        else if crossStageStatic then
-        " --disable-libssp --disable-nls" +
-        " --without-headers" +
-        " --disable-threads " +
-        " --disable-libmudflap " +
-        " --disable-libgomp " +
-        " --disable-libquadmath" +
-        " --disable-shared" +
-        " --disable-decimal-float" # libdecnumber requires libc
-        else
-        " --with-headers=${libcCross}/include" +
-        " --enable-__cxa_atexit" +
-        " --enable-long-long" +
-        (if crossMingw then
-          " --enable-threads=win32" +
-          " --enable-sjlj-exceptions" +
-          " --enable-hash-synchronization" +
-          " --disable-libssp" +
+    crossConfigureFlags = let
+        gccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null cross;
+        gccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null cross;
+        gccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null cross;
+        gccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null cross;
+        gccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null cross;
+        gccMode = stdenv.lib.attrByPath [ "gcc" "mode" ] null cross;
+        withArch = if gccArch != null then " --with-arch=${gccArch}" else "";
+        withCpu = if gccCpu != null then " --with-cpu=${gccCpu}" else "";
+        withAbi = if gccAbi != null then " --with-abi=${gccAbi}" else "";
+        withFpu = if gccFpu != null then " --with-fpu=${gccFpu}" else "";
+        withFloat = if gccFloat != null then " --with-float=${gccFloat}" else "";
+        withMode = if gccMode != null then " --with-mode=${gccMode}" else "";
+      in
+        "--target=${cross.config}" +
+        withArch +
+        withCpu +
+        withAbi +
+        withFpu +
+        withFloat +
+        withMode +
+        (if crossMingw && crossStageStatic then
+          " --with-headers=${libcCross}/include" +
+          " --with-gcc" +
+          " --with-gnu-as" +
+          " --with-gnu-ld" +
+          " --with-gnu-ld" +
+          " --disable-shared" +
           " --disable-nls" +
-          " --with-dwarf2" +
-          # I think noone uses shared gcc libs in mingw, so we better do the same.
-          # In any case, mingw32 g++ linking is broken by default with shared libs,
-          # unless adding "-lsupc++" to any linking command. I don't know why.
+          " --disable-debug" +
+          " --enable-sjlj-exceptions" +
+          " --enable-threads=win32" +
+          " --disable-win32-registry"
+          else if crossStageStatic then
+          " --disable-libssp --disable-nls" +
+          " --without-headers" +
+          " --disable-threads " +
+          " --disable-libmudflap " +
+          " --disable-libgomp " +
+          " --disable-libquadmath" +
           " --disable-shared" +
-          (if cross.config == "x86_64-w64-mingw32" then
-            # To keep ABI compatibility with upstream mingw-w64
-            " --enable-fully-dynamic-string"
-            else "")
-          else (if cross.libc == "uclibc" then
-            # In uclibc cases, libgomp needs an additional '-ldl'
-            # and as I don't know how to pass it, I disable libgomp.
-            " --disable-libgomp" else "") +
-          " --enable-threads=posix" +
-          " --enable-nls" +
-          " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
-        );
-    stageNameAddon = if (crossStageStatic) then "-stage-static" else
+          " --disable-decimal-float" # libdecnumber requires libc
+          else
+          " --with-headers=${libcCross}/include" +
+          " --enable-__cxa_atexit" +
+          " --enable-long-long" +
+          (if crossMingw then
+            " --enable-threads=win32" +
+            " --enable-sjlj-exceptions" +
+            " --enable-hash-synchronization" +
+            " --disable-libssp" +
+            " --disable-nls" +
+            " --with-dwarf2" +
+            # I think noone uses shared gcc libs in mingw, so we better do the same.
+            # In any case, mingw32 g++ linking is broken by default with shared libs,
+            # unless adding "-lsupc++" to any linking command. I don't know why.
+            " --disable-shared" +
+            (if cross.config == "x86_64-w64-mingw32" then
+              # To keep ABI compatibility with upstream mingw-w64
+              " --enable-fully-dynamic-string"
+              else "")
+            else (if cross.libc == "uclibc" then
+              # In uclibc cases, libgomp needs an additional '-ldl'
+              # and as I don't know how to pass it, I disable libgomp.
+              " --disable-libgomp" else "") +
+            " --enable-threads=posix" +
+            " --enable-nls" +
+            " --disable-decimal-float") # No final libdecnumber (it may work only in 386)
+          );
+    stageNameAddon = if crossStageStatic then "-stage-static" else
       "-stage-final";
-    crossNameAddon = if (cross != null) then "-${cross.config}" + stageNameAddon else "";
+    crossNameAddon = if cross != null then "-${cross.config}" + stageNameAddon else "";
+
+  bootstrap = cross == null && !stdenv.isArm && !stdenv.isMips;
 
 in
 
@@ -164,14 +197,14 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://gnu/gcc/gcc-${version}/gcc-${version}.tar.bz2";
-    sha256 = "0vs0v89zzgkngkw2p8kdynyk7j8ky4wf6zyrg3rsschpl1pky28n";
+    sha256 = "1hx9h64ivarlzi4hxvq42as5m9vlr5cyzaaq4gzj4i619zmkfz1g";
   };
 
   inherit patches;
 
   postPatch =
     if (stdenv.isGNU
-        || (libcCross != null                  # e.g., building `gcc.hostDrv'
+        || (libcCross != null                  # e.g., building `gcc.crossDrv'
             && libcCross ? crossConfig
             && libcCross.crossConfig == "i586-pc-gnu")
         || (crossGNU && libcCross != null))
@@ -182,7 +215,6 @@ stdenv.mkDerivation ({
       let
         libc = if libcCross != null then libcCross else stdenv.glibc;
         gnu_h = "gcc/config/gnu.h";
-        i386_gnu_h = "gcc/config/i386/gnu.h";
         extraCPPDeps =
              libc.propagatedBuildInputs
           ++ stdenv.lib.optional (libpthreadCross != null) libpthreadCross
@@ -195,8 +227,8 @@ stdenv.mkDerivation ({
           then "-L${libpthreadCross}/lib ${libpthreadCross.TARGET_LDFLAGS}"
           else "-L${libpthread}/lib";
       in
-        '' echo "augmenting \`CPP_SPEC' in \`${i386_gnu_h}' with \`${extraCPPSpec}'..."
-           sed -i "${i386_gnu_h}" \
+        '' echo "augmenting \`CPP_SPEC' in \`${gnu_h}' with \`${extraCPPSpec}'..."
+           sed -i "${gnu_h}" \
                -es'|CPP_SPEC *"\(.*\)$|CPP_SPEC "${extraCPPSpec} \1|g'
 
            echo "augmenting \`LIB_SPEC' in \`${gnu_h}' with \`${extraLibSpec}'..."
@@ -206,14 +238,12 @@ stdenv.mkDerivation ({
            echo "setting \`NATIVE_SYSTEM_HEADER_DIR' and \`STANDARD_INCLUDE_DIR' to \`${libc}/include'..."
            sed -i "${gnu_h}" \
                -es'|#define STANDARD_INCLUDE_DIR.*$|#define STANDARD_INCLUDE_DIR "${libc}/include"|g'
-           sed -i gcc/config/t-gnu \
-               -es'|NATIVE_SYSTEM_HEADER_DIR.*$|NATIVE_SYSTEM_HEADER_DIR = ${libc}/include|g'
         ''
     else if cross != null || stdenv.gcc.libc != null then
       # On NixOS, use the right path to the dynamic linker instead of
       # `/lib/ld*.so'.
       let
-        libc = if (libcCross != null) then libcCross else stdenv.gcc.libc;
+        libc = if libcCross != null then libcCross else stdenv.gcc.libc;
       in
         '' echo "fixing the \`GLIBC_DYNAMIC_LINKER' and \`UCLIBC_DYNAMIC_LINKER' macros..."
            for header in "gcc/config/"*-gnu.h "gcc/config/"*"/"*.h
@@ -226,10 +256,10 @@ stdenv.mkDerivation ({
         ''
     else null;
 
-  inherit noSysDirs profiledCompiler staticCompiler langJava crossStageStatic
+  inherit noSysDirs staticCompiler langJava crossStageStatic
     libcCross crossMingw;
 
-  buildNativeInputs = [ texinfo which gettext ]
+  nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
     ++ (optional javaAwtGtk pkgconfig);
 
@@ -276,7 +306,7 @@ stdenv.mkDerivation ({
     --with-gmp=${gmp}
     --with-mpfr=${mpfr}
     --with-mpc=${mpc}
-    ${if (libelf != null) then "--with-libelf=${libelf}" else ""}
+    ${if libelf != null then "--with-libelf=${libelf}" else ""}
     --disable-libstdcxx-pch
     --without-included-gettext
     --with-system-zlib
@@ -292,23 +322,39 @@ stdenv.mkDerivation ({
         )
       )
     }
-    ${if (stdenv ? glibc) then " --with-native-system-header-dir=${stdenv.glibc}/include" else ""}
-    ${ # Trick that should be taken out once we have a mips64el-linux not loongson2f
-      if cross == null && stdenv.system == "mips64el-linux" then "--with-arch=loongson2f" else ""}
+    ${if (stdenv ? glibc && cross == null)
+      then " --with-native-system-header-dir=${stdenv.glibc}/include"
+      else ""}
     ${if langAda then " --enable-libada" else ""}
-    ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
+    ${if cross == null && stdenv.isi686 then "--with-arch=i686" else ""}
     ${if cross != null then crossConfigureFlags else ""}
+    ${if !bootstrap then "--disable-bootstrap" else ""}
+    ${if cross == null then platformFlags else ""}
   ";
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
+
+  buildFlags = if bootstrap then
+    (if profiledCompiler then "profiledbootstrap" else "bootstrap")
+    else "";
 
   installTargets =
     if stripped
     then "install-strip"
     else "install";
 
-  crossAttrs = {
-    patches = patches ++ [ ./hurd-sigrtmin.patch ];
+  crossAttrs = let
+    xgccArch = stdenv.lib.attrByPath [ "gcc" "arch" ] null stdenv.cross;
+    xgccCpu = stdenv.lib.attrByPath [ "gcc" "cpu" ] null stdenv.cross;
+    xgccAbi = stdenv.lib.attrByPath [ "gcc" "abi" ] null stdenv.cross;
+    xgccFpu = stdenv.lib.attrByPath [ "gcc" "fpu" ] null stdenv.cross;
+    xgccFloat = stdenv.lib.attrByPath [ "gcc" "float" ] null stdenv.cross;
+    xwithArch = if xgccArch != null then " --with-arch=${xgccArch}" else "";
+    xwithCpu = if xgccCpu != null then " --with-cpu=${xgccCpu}" else "";
+    xwithAbi = if xgccAbi != null then " --with-abi=${xgccAbi}" else "";
+    xwithFpu = if xgccFpu != null then " --with-fpu=${xgccFpu}" else "";
+    xwithFloat = if xgccFloat != null then " --with-float=${xgccFloat}" else "";
+  in {
     AR = "${stdenv.cross.config}-ar";
     LD = "${stdenv.cross.config}-ld";
     CC = "${stdenv.cross.config}-gcc";
@@ -324,13 +370,13 @@ stdenv.mkDerivation ({
     configureFlags = ''
       ${if enableMultilib then "" else "--disable-multilib"}
       ${if enableShared then "" else "--disable-shared"}
-      ${if ppl != null then "--with-ppl=${ppl.hostDrv}" else ""}
-      ${if cloog != null then "--with-cloog=${cloog.hostDrv} --enable-cloog-backend=isl" else ""}
-      ${if langJava then "--with-ecj-jar=${javaEcj.hostDrv}" else ""}
+      ${if ppl != null then "--with-ppl=${ppl.crossDrv}" else ""}
+      ${if cloog != null then "--with-cloog=${cloog.crossDrv} --enable-cloog-backend=isl" else ""}
+      ${if langJava then "--with-ecj-jar=${javaEcj.crossDrv}" else ""}
       ${if javaAwtGtk then "--enable-java-awt=gtk" else ""}
-      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.hostDrv}" else ""}
-      --with-gmp=${gmp.hostDrv}
-      --with-mpfr=${mpfr.hostDrv}
+      ${if langJava && javaAntlr != null then "--with-antlr-jar=${javaAntlr.crossDrv}" else ""}
+      --with-gmp=${gmp.crossDrv}
+      --with-mpfr=${mpfr.crossDrv}
       --disable-libstdcxx-pch
       --without-included-gettext
       --with-system-zlib
@@ -347,10 +393,14 @@ stdenv.mkDerivation ({
         )
       }
       ${if langAda then " --enable-libada" else ""}
-      ${if (cross == null && stdenv.isi686) then "--with-arch=i686" else ""}
-      ${if cross != null then crossConfigureFlags else ""}
       --target=${stdenv.cross.config}
+      ${xwithArch}
+      ${xwithCpu}
+      ${xwithAbi}
+      ${xwithFpu}
+      ${xwithFloat}
     '';
+    buildFlags = "";
   };
 
 
diff --git a/pkgs/development/compilers/gcc/4.7/hurd-sigrtmin.patch b/pkgs/development/compilers/gcc/4.7/hurd-sigrtmin.patch
deleted file mode 100644
index dc8236d2b99..00000000000
--- a/pkgs/development/compilers/gcc/4.7/hurd-sigrtmin.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-GNU libc on GNU/Hurd doesn't define `__SIGRTMIN'.
-From <http://patch-tracker.debian.org/patch/series/view/gcc-4.6/4.6.3-1/hurd-fixes.diff>.
-
---- a/libgcc/generic-morestack.c	2011-12-19 21:14:52.000000000 +0100
-+++ b/libgcc/generic-morestack.c	2011-12-19 21:15:35.000000000 +0100
-@@ -507,7 +507,7 @@
-   sigemptyset (&__morestack_initial_sp.mask);
- 
-   sigfillset (&__morestack_fullmask);
--#ifdef __GLIBC__
-+#if defined(__GLIBC__) && defined(__SIGRTMIN)
-   /* In glibc, the first two real time signals are used by the NPTL
-      threading library.  By taking them out of the set of signals, we
-      avoiding copying the signal mask in pthread_sigmask.  More
diff --git a/pkgs/development/compilers/ghc/6.10.1-binary.nix b/pkgs/development/compilers/ghc/6.10.1-binary.nix
index 5a15cc0dff7..dd79ef9c8e7 100644
--- a/pkgs/development/compilers/ghc/6.10.1-binary.nix
+++ b/pkgs/development/compilers/ghc/6.10.1-binary.nix
@@ -1,11 +1,5 @@
 {stdenv, fetchurl, perl, libedit, ncurses, gmp}:
 
-let
-  supportedPlatforms = ["i686-darwin" "x86_64-linux" "i686-linux"];
-in
-
-assert stdenv.lib.elem stdenv.system supportedPlatforms;
-
 stdenv.mkDerivation rec {
   version = "6.10.1";
 
@@ -104,5 +98,6 @@ stdenv.mkDerivation rec {
         [ $(./main) == "yes" ]
       '';
 
-  meta.platforms = supportedPlatforms;
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["i686-darwin" "x86_64-linux" "i686-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/6.10.1.nix b/pkgs/development/compilers/ghc/6.10.1.nix
index b53ce9aced3..ccb9f434230 100644
--- a/pkgs/development/compilers/ghc/6.10.1.nix
+++ b/pkgs/development/compilers/ghc/6.10.1.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 
diff --git a/pkgs/development/compilers/ghc/6.10.2-binary.nix b/pkgs/development/compilers/ghc/6.10.2-binary.nix
index 616c9de7ede..7effff83c69 100644
--- a/pkgs/development/compilers/ghc/6.10.2-binary.nix
+++ b/pkgs/development/compilers/ghc/6.10.2-binary.nix
@@ -1,11 +1,5 @@
 {stdenv, fetchurl, perl, libedit, ncurses, gmp}:
 
-let
-  supportedPlatforms = ["x86_64-linux" "i686-linux"];
-in
-
-assert stdenv.lib.elem stdenv.system supportedPlatforms;
-
 stdenv.mkDerivation rec {
   version = "6.10.2";
 
@@ -103,5 +97,6 @@ stdenv.mkDerivation rec {
         [ $(./main) == "yes" ]
       '';
 
-  meta.platforms = supportedPlatforms;
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["x86_64-linux" "i686-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/6.10.2.nix b/pkgs/development/compilers/ghc/6.10.2.nix
index 2df43a4c7d7..4988734f580 100644
--- a/pkgs/development/compilers/ghc/6.10.2.nix
+++ b/pkgs/development/compilers/ghc/6.10.2.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   passthru = {
diff --git a/pkgs/development/compilers/ghc/6.10.3.nix b/pkgs/development/compilers/ghc/6.10.3.nix
index 2ecf35eedfe..f6683278e45 100644
--- a/pkgs/development/compilers/ghc/6.10.3.nix
+++ b/pkgs/development/compilers/ghc/6.10.3.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 
diff --git a/pkgs/development/compilers/ghc/6.10.4.nix b/pkgs/development/compilers/ghc/6.10.4.nix
index 53fd1c52216..92afc0f4b88 100644
--- a/pkgs/development/compilers/ghc/6.10.4.nix
+++ b/pkgs/development/compilers/ghc/6.10.4.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   passthru = {
diff --git a/pkgs/development/compilers/ghc/6.11.nix b/pkgs/development/compilers/ghc/6.11.nix
index 778b819aa70..914403cdd66 100644
--- a/pkgs/development/compilers/ghc/6.11.nix
+++ b/pkgs/development/compilers/ghc/6.11.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 }
diff --git a/pkgs/development/compilers/ghc/6.12.1-binary.nix b/pkgs/development/compilers/ghc/6.12.1-binary.nix
index a84b75d705b..6f3411da4af 100644
--- a/pkgs/development/compilers/ghc/6.12.1-binary.nix
+++ b/pkgs/development/compilers/ghc/6.12.1-binary.nix
@@ -1,11 +1,5 @@
 {stdenv, fetchurl, perl, ncurses, gmp}:
 
-let
-  supportedPlatforms = ["x86_64-linux" "i686-linux"];
-in
-
-assert stdenv.lib.elem stdenv.system supportedPlatforms;
-
 stdenv.mkDerivation rec {
   version = "6.12.1";
 
@@ -105,5 +99,6 @@ stdenv.mkDerivation rec {
         [ $(./main) == "yes" ]
       '';
 
-  meta.platforms = supportedPlatforms;
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["x86_64-linux" "i686-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/6.12.1.nix b/pkgs/development/compilers/ghc/6.12.1.nix
index 78a000de309..31c763c4505 100644
--- a/pkgs/development/compilers/ghc/6.12.1.nix
+++ b/pkgs/development/compilers/ghc/6.12.1.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   # TODO: requires a comment as to what it does and why it is needed.
diff --git a/pkgs/development/compilers/ghc/6.12.2.nix b/pkgs/development/compilers/ghc/6.12.2.nix
index 1a48d6cf318..5db5fc49fc6 100644
--- a/pkgs/development/compilers/ghc/6.12.2.nix
+++ b/pkgs/development/compilers/ghc/6.12.2.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   # TODO: requires a comment as to what it does and why it is needed.
diff --git a/pkgs/development/compilers/ghc/6.12.3.nix b/pkgs/development/compilers/ghc/6.12.3.nix
index bc2d8967cd4..05ceba030b9 100644
--- a/pkgs/development/compilers/ghc/6.12.3.nix
+++ b/pkgs/development/compilers/ghc/6.12.3.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   # TODO: requires a comment as to what it does and why it is needed.
diff --git a/pkgs/development/compilers/ghc/6.4.2-binary.nix b/pkgs/development/compilers/ghc/6.4.2-binary.nix
index 2ed6f2be4fe..8e4e6c58a3f 100644
--- a/pkgs/development/compilers/ghc/6.4.2-binary.nix
+++ b/pkgs/development/compilers/ghc/6.4.2-binary.nix
@@ -1,11 +1,5 @@
 {stdenv, fetchurl, perl, readline, ncurses, gmp}:
 
-let
-  supportedPlatforms = ["i686-darwin" "x86_64-linux" "i686-linux"];
-in
-
-assert stdenv.lib.elem stdenv.system supportedPlatforms;
-
 stdenv.mkDerivation {
   name = if stdenv.system == "i686-darwin" then "ghc-6.6.1-binary" else "ghc-6.4.2-binary";
 
@@ -68,5 +62,6 @@ stdenv.mkDerivation {
 
   '' else "";
 
-  meta.platforms = supportedPlatforms;
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["i686-darwin" "x86_64-linux" "i686-linux"];
 }
diff --git a/pkgs/development/compilers/ghc/6.4.2.nix b/pkgs/development/compilers/ghc/6.4.2.nix
index c526e5d6cb4..e336d4e83b1 100644
--- a/pkgs/development/compilers/ghc/6.4.2.nix
+++ b/pkgs/development/compilers/ghc/6.4.2.nix
@@ -23,6 +23,6 @@ stdenv.mkDerivation {
 
   meta = {
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 }
diff --git a/pkgs/development/compilers/ghc/6.6.1.nix b/pkgs/development/compilers/ghc/6.6.1.nix
index 994ebc286c3..0f91b9d5052 100644
--- a/pkgs/development/compilers/ghc/6.6.1.nix
+++ b/pkgs/development/compilers/ghc/6.6.1.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation (rec {
 
   meta = {
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   postInstall = ''
diff --git a/pkgs/development/compilers/ghc/6.8.2.nix b/pkgs/development/compilers/ghc/6.8.2.nix
index 2681f325c92..8af15862590 100644
--- a/pkgs/development/compilers/ghc/6.8.2.nix
+++ b/pkgs/development/compilers/ghc/6.8.2.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation (rec {
 
   meta = {
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   configureFlags=[
diff --git a/pkgs/development/compilers/ghc/6.8.3.nix b/pkgs/development/compilers/ghc/6.8.3.nix
index b6900321552..281ff61b700 100644
--- a/pkgs/development/compilers/ghc/6.8.3.nix
+++ b/pkgs/development/compilers/ghc/6.8.3.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "The Glasgow Haskell Compiler";
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   configureFlags=[
diff --git a/pkgs/development/compilers/ghc/7.0.1.nix b/pkgs/development/compilers/ghc/7.0.1.nix
index db696d2b218..da7e81f5730 100644
--- a/pkgs/development/compilers/ghc/7.0.1.nix
+++ b/pkgs/development/compilers/ghc/7.0.1.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
   # TODO: requires a comment as to what it does and why it is needed.
diff --git a/pkgs/development/compilers/ghc/7.0.2.nix b/pkgs/development/compilers/ghc/7.0.2.nix
index 426c8725d0b..6706b99e203 100644
--- a/pkgs/development/compilers/ghc/7.0.2.nix
+++ b/pkgs/development/compilers/ghc/7.0.2.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.0.3.nix b/pkgs/development/compilers/ghc/7.0.3.nix
index ad80dd9e79d..0b422043ae2 100644
--- a/pkgs/development/compilers/ghc/7.0.3.nix
+++ b/pkgs/development/compilers/ghc/7.0.3.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.marcweber
       stdenv.lib.maintainers.andres
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.0.4-binary.nix b/pkgs/development/compilers/ghc/7.0.4-binary.nix
index 0baf9718f85..455d552b91a 100644
--- a/pkgs/development/compilers/ghc/7.0.4-binary.nix
+++ b/pkgs/development/compilers/ghc/7.0.4-binary.nix
@@ -1,11 +1,5 @@
 {stdenv, fetchurl, perl, ncurses, gmp}:
 
-let
-  supportedPlatforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"];
-in
-
-assert stdenv.lib.elem stdenv.system supportedPlatforms;
-
 stdenv.mkDerivation rec {
   version = "7.0.4";
 
@@ -93,5 +87,6 @@ stdenv.mkDerivation rec {
         [ $(./main) == "yes" ]
       '';
 
-  meta.platforms = supportedPlatforms;
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"];
 }
diff --git a/pkgs/development/compilers/ghc/7.2.1.nix b/pkgs/development/compilers/ghc/7.2.1.nix
index 3938d608d33..867df5aae6b 100644
--- a/pkgs/development/compilers/ghc/7.2.1.nix
+++ b/pkgs/development/compilers/ghc/7.2.1.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.andres
       stdenv.lib.maintainers.simons
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.2.2.nix b/pkgs/development/compilers/ghc/7.2.2.nix
index 0450537ad90..c6ec0cb75c4 100644
--- a/pkgs/development/compilers/ghc/7.2.2.nix
+++ b/pkgs/development/compilers/ghc/7.2.2.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.andres
       stdenv.lib.maintainers.simons
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.4.2-binary.nix b/pkgs/development/compilers/ghc/7.4.2-binary.nix
new file mode 100644
index 00000000000..59eb957a45f
--- /dev/null
+++ b/pkgs/development/compilers/ghc/7.4.2-binary.nix
@@ -0,0 +1,92 @@
+{stdenv, fetchurl, perl, ncurses, gmp}:
+
+stdenv.mkDerivation rec {
+  version = "7.4.2";
+
+  name = "ghc-${version}-binary";
+
+  src =
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-unknown-linux.tar.bz2";
+        sha256 = "0gny7knhss0w0d9r6jm1gghrcb8kqjvj94bb7hxf9syrk4fxlcxi";
+      }
+    else if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-unknown-linux.tar.bz2";
+        sha256 = "043jabd0lh6n1zlqhysngbpvlsdznsa2mmsj08jyqgahw9sjb5ns";
+      }
+    else if stdenv.system == "i686-darwin" then
+      fetchurl {
+        url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-i386-apple-darwin.tar.bz2";
+        sha256 = "1vrbs3pzki37hzym1f1nh07lrqh066z3ypvm81fwlikfsvk4djc0";
+      }
+    else if stdenv.system == "x86_64-darwin" then
+      fetchurl {
+        url = "http://haskell.org/ghc/dist/${version}/ghc-${version}-x86_64-apple-darwin.tar.bz2";
+        sha256 = "1imzqc0slpg0r6p40n5a9m18cbcm0m86z8dgyhfxcckksw54mzwf";
+      }
+    else throw "cannot bootstrap GHC on this platform";
+
+  buildInputs = [perl];
+
+  postUnpack =
+    # Strip is harmful, see also below. It's important that this happens
+    # first. The GHC Cabal build system makes use of strip by default and
+    # has hardcoded paths to /usr/bin/strip in many places. We replace
+    # those below, making them point to our dummy script.
+     ''
+      mkdir "$TMP/bin"
+      for i in strip; do
+        echo '#!/bin/sh' >> "$TMP/bin/$i"
+        chmod +x "$TMP/bin/$i"
+        PATH="$TMP/bin:$PATH"
+      done
+     '' +
+    # We have to patch the GMP paths for the integer-gmp package.
+     ''
+      find . -name integer-gmp.buildinfo \
+          -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp}/lib@" {} \;
+     '' +
+    # On Linux, use patchelf to modify the executables so that they can
+    # find editline/gmp.
+    (if stdenv.isLinux then ''
+      find . -type f -perm +100 \
+          -exec patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+          --set-rpath "${ncurses}/lib:${gmp}/lib" {} \;
+      sed -i "s|/usr/bin/perl|perl\x00        |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
+      sed -i "s|/usr/bin/gcc|gcc\x00        |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
+      for prog in ld ar gcc strip ranlib; do
+        find . -name "setup-config" -exec sed -i "s@/usr/bin/$prog@$(type -p $prog)@g" {} \;
+      done
+     '' else "");
+
+  configurePhase = ''
+    ./configure --prefix=$out --with-gmp-libraries=${gmp}/lib --with-gmp-includes=${gmp}/include
+  '';
+
+  # Stripping combined with patchelf breaks the executables (they die
+  # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
+  dontStrip = true;
+
+  # No building is necessary, but calling make without flags ironically
+  # calls install-strip ...
+  buildPhase = "true";
+
+  postInstall =
+      ''
+        # Sanity check, can ghc create executables?
+        cd $TMP
+        mkdir test-ghc; cd test-ghc
+        cat > main.hs << EOF
+          module Main where
+          main = putStrLn "yes"
+        EOF
+        $out/bin/ghc --make main.hs
+        echo compilation ok
+        [ $(./main) == "yes" ]
+      '';
+
+  meta.license = stdenv.lib.licenses.bsd3;
+  meta.platforms = ["x86_64-linux" "i686-linux" "i686-darwin" "x86_64-darwin"];
+}
diff --git a/pkgs/development/compilers/ghc/7.4.2.nix b/pkgs/development/compilers/ghc/7.4.2.nix
index ea44e49cca3..51f3f7f9df4 100644
--- a/pkgs/development/compilers/ghc/7.4.2.nix
+++ b/pkgs/development/compilers/ghc/7.4.2.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.andres
       stdenv.lib.maintainers.simons
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.6.1.nix b/pkgs/development/compilers/ghc/7.6.1.nix
index 203a354c13c..99c93c7a980 100644
--- a/pkgs/development/compilers/ghc/7.6.1.nix
+++ b/pkgs/development/compilers/ghc/7.6.1.nix
@@ -1,18 +1,27 @@
 { stdenv, fetchurl, ghc, perl, gmp, ncurses }:
 
 stdenv.mkDerivation rec {
-  version = "7.6.0.20120810";
+  version = "7.6.1";
 
   name = "ghc-${version}";
 
   src = fetchurl {
-    url = "http://haskell.org/ghc/dist/7.6.1-rc1/${name}-src.tar.bz2";
-    sha256 = "04m8ms3a58590s4p8x6qma25rdanz0iai8rcla78ka798612pvjd";
+    url = "http://haskell.org/ghc/dist/7.6.1/${name}-src.tar.bz2";
+    sha256 = "1q5rqp8z90mq6ysf7h28zkbhfaxlrpva2qy0wnkr43d7214dzp7i";
   };
 
   buildInputs = [ ghc perl gmp ncurses ];
 
-  enableParallelBuilding = true;
+  # My attempts to compile GHC with parallel build support enabled, failed
+  # 4 consecutive times with the following error:
+  #
+  #    building rts/dist/build/AutoApply.debug_o
+  #    building rts/dist/build/AutoApply.thr_o
+  #      rts_dist_HC rts/dist/build/AutoApply.debug_o
+  #    /nix/store/1iigiim5855m8j7pmwf5xrnpf705s4dh-binutils-2.21.1a/bin/ld: cannot find libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers_o_split/gmp-wrappers__1.o
+  #    collect2: ld returned 1 exit status
+  #    make[1]: *** [libraries/integer-gmp/dist-install/build/cbits/gmp-wrappers.p_o] Error 1
+  enableParallelBuilding = false;
 
   buildMK = ''
     libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
@@ -40,7 +49,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.andres
       stdenv.lib.maintainers.simons
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/7.6.2.nix b/pkgs/development/compilers/ghc/7.6.2.nix
new file mode 100644
index 00000000000..ac2810c62b2
--- /dev/null
+++ b/pkgs/development/compilers/ghc/7.6.2.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, ghc, perl, gmp, ncurses }:
+
+stdenv.mkDerivation rec {
+  version = "7.6.2";
+
+  name = "ghc-${version}";
+
+  src = fetchurl {
+    url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
+    sha256 = "d5f45184abeacf7e9c6b4f63c7101a5c1d7b4fe9007901159e2287ecf38de533";
+  };
+
+  buildInputs = [ ghc perl gmp ncurses ];
+
+  enableParallelBuilding = true;
+
+  buildMK = ''
+    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
+    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
+  '';
+
+  preConfigure = ''
+    echo "${buildMK}" > mk/build.mk
+    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+  '';
+
+  configureFlags = [
+    "--with-gcc=${stdenv.gcc}/bin/gcc"
+  ];
+
+  # required, because otherwise all symbols from HSffi.o are stripped, and
+  # that in turn causes GHCi to abort
+  stripDebugFlags=["-S" "--keep-file-symbols"];
+
+  meta = {
+    homepage = "http://haskell.org/ghc";
+    description = "The Glasgow Haskell Compiler";
+    maintainers = [
+      stdenv.lib.maintainers.marcweber
+      stdenv.lib.maintainers.andres
+      stdenv.lib.maintainers.simons
+    ];
+    inherit (ghc.meta) license platforms;
+  };
+
+}
diff --git a/pkgs/development/compilers/ghc/7.6.3.nix b/pkgs/development/compilers/ghc/7.6.3.nix
new file mode 100644
index 00000000000..dc3a912a34a
--- /dev/null
+++ b/pkgs/development/compilers/ghc/7.6.3.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, ghc, perl, gmp, ncurses }:
+
+stdenv.mkDerivation rec {
+  version = "7.6.3";
+
+  name = "ghc-${version}";
+
+  src = fetchurl {
+    url = "http://haskell.org/ghc/dist/${version}/${name}-src.tar.bz2";
+    sha256 = "1669m8k9q72rpd2mzs0bh2q6lcwqiwd1ax3vrard1dgn64yq4hxx";
+  };
+
+  buildInputs = [ ghc perl gmp ncurses ];
+
+  enableParallelBuilding = true;
+
+  buildMK = ''
+    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
+    libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
+  '';
+
+  preConfigure = ''
+    echo "${buildMK}" > mk/build.mk
+    sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
+  '';
+
+  configureFlags = [
+    "--with-gcc=${stdenv.gcc}/bin/gcc"
+  ];
+
+  # required, because otherwise all symbols from HSffi.o are stripped, and
+  # that in turn causes GHCi to abort
+  stripDebugFlags=["-S" "--keep-file-symbols"];
+
+  meta = {
+    homepage = "http://haskell.org/ghc";
+    description = "The Glasgow Haskell Compiler";
+    maintainers = [
+      stdenv.lib.maintainers.marcweber
+      stdenv.lib.maintainers.andres
+      stdenv.lib.maintainers.simons
+    ];
+    inherit (ghc.meta) license platforms;
+  };
+
+}
diff --git a/pkgs/development/compilers/ghc/head.nix b/pkgs/development/compilers/ghc/head.nix
index 566e7d80f86..035ebc8b268 100644
--- a/pkgs/development/compilers/ghc/head.nix
+++ b/pkgs/development/compilers/ghc/head.nix
@@ -1,13 +1,12 @@
 { stdenv, fetchurl, ghc, perl, gmp, ncurses }:
 
 stdenv.mkDerivation rec {
-  version = "7.5.20120714";
-
+  version = "7.7";
   name = "ghc-${version}";
 
   src = fetchurl {
     url = "http://haskell.org/ghc/dist/current/dist/${name}-src.tar.bz2";
-    sha256 = "02jicyqqr18yixf970f1rfrn64bm528aig6s9566galji063p6ah";
+    sha256 = "1f4grj1lw25vb5drn4sn8fc1as3hwhk8dl659spi5fnbrs5k4wgb";
   };
 
   buildInputs = [ ghc perl gmp ncurses ];
@@ -17,6 +16,13 @@ stdenv.mkDerivation rec {
   buildMK = ''
     libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-libraries="${gmp}/lib"
     libraries/integer-gmp_CONFIGURE_OPTS += --configure-option=--with-gmp-includes="${gmp}/include"
+    DYNAMIC_BY_DEFAULT = NO
+  '';
+
+  # The tarball errorneously contains an executable that doesn't work in
+  # Nix. Deleting it will cause the program to be re-built locally.
+  postUnpack = ''
+    rm -v $sourceRoot/libraries/integer-gmp/cbits/mkGmpDerivedConstants
   '';
 
   preConfigure = ''
@@ -40,7 +46,7 @@ stdenv.mkDerivation rec {
       stdenv.lib.maintainers.andres
       stdenv.lib.maintainers.simons
     ];
-    platforms = ghc.meta.platforms;
+    inherit (ghc.meta) license platforms;
   };
 
 }
diff --git a/pkgs/development/compilers/ghc/with-packages.nix b/pkgs/development/compilers/ghc/with-packages.nix
index 9313c54b908..99e91901d00 100644
--- a/pkgs/development/compilers/ghc/with-packages.nix
+++ b/pkgs/development/compilers/ghc/with-packages.nix
@@ -59,6 +59,23 @@ stdenv.mkDerivation rec {
           ln -s $f $out/bin
           echo -n .
         done
+        for f in "$currentPath/etc/bash_completion.d/"*; do
+          mkdir -p $out/etc/bash_completion.d
+          ln -s $f $out/etc/bash_completion.d/
+          echo -n .
+        done
+        for s in 1 2 3 4 5 6 7 8 9; do
+          for f in "$currentPath/share/man/man$s/"*; do
+            mkdir -p $out/share/man/man$s
+            ln -sv $f $out/share/man/man$s/
+            echo -n .
+          done
+        done
+        for f in "$currentPath/share/emacs/site-lisp/"*; do
+          mkdir -p $out/share/emacs/site-lisp
+          ln -s $f $out/share/emacs/site-lisp/
+          echo -n .
+        done
         for f in "$currentPkgDir/"*.conf; do
           ln -s $f $linkedPkgDir
           echo -n .
@@ -74,7 +91,12 @@ stdenv.mkDerivation rec {
     echo -n "Generating wrappers "
 
     for prg in ghc ghci ghc-${ghc.version} ghci-${ghc.version}; do
-      makeWrapper ${ghc}/bin/$prg $out/bin/$prg --add-flags "-B$linkedTopDir"
+      # The NIX env-vars are picked up by our patched version of ghc-paths.
+      makeWrapper ${ghc}/bin/$prg $out/bin/$prg \
+        --add-flags "-B$linkedTopDir" \
+        --set "NIX_GHC"        "$out/bin/ghc"     \
+        --set "NIX_GHCPKG"     "$out/bin/ghc-pkg" \
+        --set "NIX_GHC_LIBDIR" "$linkedTopDir"
       echo -n .
     done
 
diff --git a/pkgs/development/compilers/ghc/wrapper.nix b/pkgs/development/compilers/ghc/wrapper.nix
index 4407f16c9e0..55fd16be5ed 100644
--- a/pkgs/development/compilers/ghc/wrapper.nix
+++ b/pkgs/development/compilers/ghc/wrapper.nix
@@ -1,6 +1,10 @@
-{stdenv, ghc, makeWrapper, coreutils}:
+{ stdenv, ghc, makeWrapper, coreutils, forUserEnv ? false }:
 
-stdenv.mkDerivation {
+let
+  ghc761OrLater = !stdenv.lib.versionOlder ghc.version "7.6.1";
+  packageDBFlag = if ghc761OrLater then "-package-db" else "-package-conf";
+in
+stdenv.mkDerivation ({
   name = "ghc-${ghc.version}-wrapper";
 
   buildInputs = [makeWrapper];
@@ -15,10 +19,10 @@ stdenv.mkDerivation {
       makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\")"
     done
     for prg in runghc runhaskell; do
-      makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" \" -package-conf --ghc-arg=\")"
+      makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" \" ${packageDBFlag} --ghc-arg=\")"
     done
     for prg in ghc-pkg ghc-pkg-${ghc.version}; do
-      makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" --package-conf=)"
+      makeWrapper $ghc/bin/$prg $out/bin/$prg --add-flags "\$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\" -${packageDBFlag}=)"
     done
     for prg in hp2ps hpc hasktags hsc2hs; do
       test -x $ghc/bin/$prg && ln -s $ghc/bin/$prg $out/bin/$prg
@@ -29,7 +33,7 @@ stdenv.mkDerivation {
 
     for arg in \$($out/bin/ghc-get-packages.sh ${ghc.version} \"\$(dirname \$0)\"); do
       case "\$arg" in
-        -package-conf) ;;
+        ${packageDBFlag}) ;;
         *)
           CANONICALIZED="\$(${stdenv.lib.optionalString stdenv.isDarwin "${coreutils}/bin/"}readlink -f "\$arg")"
           GHC_PACKAGES_HASH["\$CANONICALIZED"]= ;;
@@ -50,4 +54,11 @@ stdenv.mkDerivation {
   inherit ghc;
   inherit (ghc) meta;
   ghcVersion = ghc.version;
-}
+} // (stdenv.lib.optionalAttrs ghc761OrLater { preFixup = "sed -i -e 's|-package-conf|${packageDBFlag}|' $out/bin/ghc-get-packages.sh"; })
+  // (stdenv.lib.optionalAttrs forUserEnv {
+       postFixup= ''
+         ln -s $ghc/lib $out/lib;
+         mkdir -p $out/share/doc
+         ln -s $ghc/share/doc/ghc $out/share/doc/ghc-${ghc.version}
+       '';
+     }))
diff --git a/pkgs/development/compilers/gnatboot/default.nix b/pkgs/development/compilers/gnatboot/default.nix
index 79208743ae4..1de0c88a6bc 100644
--- a/pkgs/development/compilers/gnatboot/default.nix
+++ b/pkgs/development/compilers/gnatboot/default.nix
@@ -3,12 +3,12 @@
 stdenv.mkDerivation {
   name = "gentoo-gnatboot-4.1";
 
-  src = if (stdenv.system == "i686-linux") then
+  src = if stdenv.system == "i686-linux" then
     fetchurl {
       url = "mirror://gentoo/distfiles/gnatboot-4.1-i386.tar.bz2";
       sha256 = "0665zk71598204bf521vw68i5y6ccqarq9fcxsqp7ccgycb4lysr";
     }
-    else if (stdenv.system == "x86_64-linux") then
+    else if stdenv.system == "x86_64-linux" then
     fetchurl {
       url = "mirror://gentoo/distfiles/gnatboot-4.1-amd64.tar.bz2";
       sha256 = "1li4d52lmbnfs6llcshlbqyik2q2q4bvpir0f7n38nagp0h6j0d4";
diff --git a/pkgs/development/compilers/go/1.1.nix b/pkgs/development/compilers/go/1.1.nix
new file mode 100644
index 00000000000..39c79e9a3de
--- /dev/null
+++ b/pkgs/development/compilers/go/1.1.nix
@@ -0,0 +1,94 @@
+{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata}:
+
+let
+  loader386 = "${glibc}/lib/ld-linux.so.2";
+  loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
+  loaderArm = "${glibc}/lib/ld-linux.so.3";
+in
+
+stdenv.mkDerivation {
+  name = "go-1.1";
+
+  src = fetchurl {
+    url = http://go.googlecode.com/files/go1.1.src.tar.gz;
+    sha1 = "a464704ebbbdd552a39b5f9429b059c117d165b3";
+  };
+
+  buildInputs = [ bison glibc bash makeWrapper ];
+
+  # I'm not sure what go wants from its 'src', but the go installation manual
+  # describes an installation keeping the src.
+  preUnpack = ''
+    mkdir -p $out/share
+    cd $out/share
+  '';
+
+  prePatch = ''
+    cd ..
+    if [ ! -d go ]; then
+      mv * go
+    fi
+    cd go
+
+    patchShebangs ./ # replace /bin/bash
+    # !!! substituteInPlace does not seems to be effective.
+    sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
+    sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
+    sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
+    sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
+
+    #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
+    #  -e 's,/bin/echo,${coreutils}/bin/echo,' \
+    #  src/pkg/exec/exec_test.go
+
+    # Disabling the 'os/http/net' tests (they want files not available in
+    # chroot builds)
+    rm src/pkg/net/{multicast_test.go,parse_test.go,port_test.go}
+    # The os test wants to read files in an existing path. Just it don't be /usr/bin.
+    sed -i 's,/usr/bin,'"`pwd`", src/pkg/os/os_test.go
+    sed -i 's,/bin/pwd,'"`type -P pwd`", src/pkg/os/os_test.go
+    # Disable the hostname test
+    sed -i '/TestHostname/areturn' src/pkg/os/os_test.go
+    # Disable a failing icmp test (maybe because not being root?)
+    sed -i '/ip[46]:.*icmp.*nil/d' src/pkg/net/ipraw_test.go
+  '';
+
+  patches = [ ./cacert.patch ];
+
+  GOOS = "linux";
+  GOARCH = if stdenv.system == "i686-linux" then "386"
+          else if stdenv.system == "x86_64-linux" then "amd64"
+          else if stdenv.system == "armv5tel-linux" then "arm"
+          else throw "Unsupported system";
+  GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    export GOROOT="$(pwd)/"
+    export GOBIN="$out/bin"
+    export PATH="$GOBIN:$PATH"
+    cd ./src
+    ./all.bash
+    cd -
+
+    # Wrap the tools to define the location of the
+    # libraries.
+    for a in go gofmt godoc; do
+	    wrapProgram "$out/bin/$a" \
+	      --set "GOROOT" $out/share/go \
+        ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
+    done
+
+    # Copy the emacs configuration for Go files.
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp ./misc/emacs/* $out/share/emacs/site-lisp/
+  '';
+
+  meta = {
+    homepage = http://golang.org/;
+    description = "The Go Programming language";
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [ pierron viric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/compilers/go/default.nix b/pkgs/development/compilers/go/default.nix
index 459ce6310bf..9e74643e161 100644
--- a/pkgs/development/compilers/go/default.nix
+++ b/pkgs/development/compilers/go/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper}:
+{ stdenv, fetchurl, bison, glibc, bash, coreutils, makeWrapper, tzdata}:
 
 let
   loader386 = "${glibc}/lib/ld-linux.so.2";
   loaderAmd64 = "${glibc}/lib/ld-linux-x86-64.so.2";
+  loaderArm = "${glibc}/lib/ld-linux.so.3";
 in
 
 stdenv.mkDerivation {
-  name = "go-1.0.2";
+  name = "go-1.0.3";
 
-  # No tarball yet.
   src = fetchurl {
-    url = http://go.googlecode.com/files/go1.0.2.src.tar.gz;
-    sha256 = "1a4mpkb3bd9dwp0r3fgrfcyk5lgw0f0cfrbskg2lrhc7a12zpz3h";
+    url = http://go.googlecode.com/files/go1.0.3.src.tar.gz;
+    sha256 = "1pz31az3icwqfqfy3avms05jnqr0qrbrx9yqsclkdwbjs4rkbfkz";
   };
 
   buildInputs = [ bison glibc bash makeWrapper ];
@@ -24,11 +24,18 @@ stdenv.mkDerivation {
   '';
 
   prePatch = ''
+    cd ..
+    if [ ! -d go ]; then
+      mv * go
+    fi
+    cd go
+
     patchShebangs ./ # replace /bin/bash
     # !!! substituteInPlace does not seems to be effective.
     sed -i 's,/lib/ld-linux.so.2,${loader386},' src/cmd/8l/asm.c
     sed -i 's,/lib64/ld-linux-x86-64.so.2,${loaderAmd64},' src/cmd/6l/asm.c
-    sed -i 's,/usr/share/zoneinfo/,${glibc}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
+    sed -i 's,/lib64/ld-linux-x86-64.so.3,${loaderArm},' src/cmd/5l/asm.c
+    sed -i 's,/usr/share/zoneinfo/,${tzdata}/share/zoneinfo/,' src/pkg/time/zoneinfo_unix.go
 
     #sed -i -e 's,/bin/cat,${coreutils}/bin/cat,' \
     #  -e 's,/bin/echo,${coreutils}/bin/echo,' \
@@ -47,9 +54,11 @@ stdenv.mkDerivation {
   patches = [ ./cacert.patch ];
 
   GOOS = "linux";
-  GOARCH = if (stdenv.system == "i686-linux") then "386"
-          else if (stdenv.system == "x86_64-linux") then "amd64"
+  GOARCH = if stdenv.system == "i686-linux" then "386"
+          else if stdenv.system == "x86_64-linux" then "amd64"
+          else if stdenv.system == "armv5tel-linux" then "arm"
           else throw "Unsupported system";
+  GOARM = stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "5";
 
   installPhase = ''
     mkdir -p "$out/bin"
@@ -64,7 +73,8 @@ stdenv.mkDerivation {
     # libraries.
     for a in go gofmt godoc; do
 	    wrapProgram "$out/bin/$a" \
-	      --set "GOROOT" "$out/share/go/"
+	      --set "GOROOT" $out/share/go \
+        ${if stdenv.system == "armv5tel-linux" then "--set GOARM $GOARM" else ""}
     done
 
     # Copy the emacs configuration for Go files.
diff --git a/pkgs/development/compilers/gprolog/default.nix b/pkgs/development/compilers/gprolog/default.nix
index f7a64da7309..bbc273365b9 100644
--- a/pkgs/development/compilers/gprolog/default.nix
+++ b/pkgs/development/compilers/gprolog/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "gprolog-1.4.0";
+  name = "gprolog-1.4.1";
 
   src = fetchurl {
     urls = [
       "mirror://gnu/gprolog/${name}.tar.gz"
       "http://www.gprolog.org/${name}.tar.gz"
     ];
-    sha256 = "1l66k66ryfw1nfi2wlvsyq4cmr6mm95f4iay1fxdk3hdk3fjyjl0";
+    sha256 = "e2819ed9c426138d3191e4d97ae5121cf97e132eecf102400f87f1e372a05b72";
   };
 
   configurePhase = "cd src ;"
@@ -17,16 +17,17 @@ stdenv.mkDerivation rec {
     + "--with-examples-dir=$out/share/doc/${name}/examples "
     + "--with-doc-dir=$out/share/doc/${name}";
 
-  doCheck = true;
-
   postInstall = ''
     ln -vs "$out/share/${name}/include" "$out/include"
+    ln -vs "$out/share/${name}/lib" "$out/lib"
   '';
 
-  meta = {
-    homepage = http://www.gnu.org/software/gprolog/;
+  doCheck = true;
 
+  meta = {
+    homepage = "http://www.gnu.org/software/gprolog/";
     description = "GNU Prolog, a free Prolog compiler with constraint solving over finite domains";
+    license = "GPLv2+";
 
     longDescription = ''
       GNU Prolog is a free Prolog compiler with constraint solving
@@ -52,8 +53,6 @@ stdenv.mkDerivation rec {
       declarativity of logic programming.
     '';
 
-    license = "GPLv2+";
-
     maintainers = [ stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.gnu;
   };
diff --git a/pkgs/development/compilers/gwt/2.4.0.nix b/pkgs/development/compilers/gwt/2.4.0.nix
index 000b57946f6..c5c7841d72a 100644
--- a/pkgs/development/compilers/gwt/2.4.0.nix
+++ b/pkgs/development/compilers/gwt/2.4.0.nix
@@ -1,12 +1,14 @@
-{stdenv, fetchurl, unzip}:
+{ stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation {
   name = "gwt-java-2.4.0";
-  src = fetchurl { 
-    url=http://google-web-toolkit.googlecode.com/files/gwt-2.4.0.zip; 
-    sha1 = "a91ac20db0ddd5994ac3cbfb0e8061d5bbf66f88"; 
+
+  src = fetchurl {
+    url=http://google-web-toolkit.googlecode.com/files/gwt-2.4.0.zip;
+    sha1 = "a91ac20db0ddd5994ac3cbfb0e8061d5bbf66f88";
   };
-  buildInputs = [unzip]; 
+
+  buildInputs = [ unzip ];
 
   installPhase = ''
     ensureDir $out
@@ -18,4 +20,4 @@ stdenv.mkDerivation {
     homepage = http://code.google.com/webtoolkit/;
     description = "Google Web Toolkit (GWT) is a development toolkit for building and optimizing complex browser-based applications.";
   };
- }
+}
diff --git a/pkgs/development/compilers/gwt/builder.sh b/pkgs/development/compilers/gwt/builder.sh
deleted file mode 100644
index b14a0432ea5..00000000000
--- a/pkgs/development/compilers/gwt/builder.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-source $stdenv/setup
-
-tar xfvj $src
-mkdir -p $out
-cp -av $name $out
-
-# Create wrapper scripts so that the GWT compiler/host work
-
-libPath="$libstdcpp5/lib:$glib/lib:$gtk/lib:$atk/lib:$pango/lib:$libX11/lib:$libXt/lib:$out/$name/mozilla-1.7.12"
-
-mkdir -p $out/bin
-
-cat > $out/bin/gwt-compile <<EOF
-#!/bin/sh
-
-export LD_LIBRARY_PATH=$libPath
-export LIBXCB_ALLOW_SLOPPY_LOCK=1 # Workaround for bug in Java AWT implementation
-
-$jdk/bin/java -Xmx256m -cp "\$CLASSPATH:$out/$name/gwt-user.jar:$out/$name/gwt-dev-linux.jar" com.google.gwt.dev.Compiler \$@
-EOF
-chmod 755 $out/bin/gwt-compile
-
-cat > $out/bin/gwt-shell <<EOF
-#!/bin/sh
-
-export LD_LIBRARY_PATH=$libPath
-export LIBXCB_ALLOW_SLOPPY_LOCK=1 # Workaround for bug in Java AWT implementation
-
-$jdk/bin/java -Xmx256m -cp "\$CLASSPATH:$out/$name/gwt-user.jar:$out/$name/gwt-dev-linux.jar" com.google.gwt.dev.GWTShell \$@
-EOF
-chmod 755 $out/bin/gwt-shell
diff --git a/pkgs/development/compilers/gwt/default.nix b/pkgs/development/compilers/gwt/default.nix
deleted file mode 100644
index f22996a6a67..00000000000
--- a/pkgs/development/compilers/gwt/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{stdenv, fetchurl, glib, gtk, pango, atk, libX11, libXt, libstdcpp5, jdk}:
-
-stdenv.mkDerivation {
-  name = "gwt-linux-1.7.1";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://google-web-toolkit.googlecode.com/files/gwt-linux-1.7.1.tar.bz2;
-    sha256 = "0lgirr9lr0qsfvw61hqzracdllqklb4qkzbk5x3lc4r64mms5b3g";
-  };
-
-  inherit glib gtk pango atk libX11 libXt libstdcpp5 jdk;
-  buildInputs = [glib gtk pango atk libX11 libXt libstdcpp5];
-}
diff --git a/pkgs/development/compilers/haxe/default.nix b/pkgs/development/compilers/haxe/default.nix
index 8018b478e80..b2d69f2ea7d 100644
--- a/pkgs/development/compilers/haxe/default.nix
+++ b/pkgs/development/compilers/haxe/default.nix
@@ -1,141 +1,40 @@
-args: with args;
+{ stdenv, fetchsvn, ocaml, zlib, neko }:
 
-let
+stdenv.mkDerivation {
+  name = "haxe-3.00";
 
-    src_haxe_swflib = {
-      # REGION AUTO UPDATE:                                { name = "haxe_swflib"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/swflib"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe_swflib-F_10-43-46.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_swflib-F_10-43-46.tar.gz"; sha256 = "a63de75e48bf500ef0e8ef715d178d32f0ef113ded8c21bbca698a8cc70e7b58"; });
-      # END
-    }.src;
+  buildInputs = [ocaml zlib neko];
 
-    src_haxe_extc = { 
-      # REGION AUTO UPDATE:                                { name = "haxe_extc"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extc"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe_extc-F_10-43-47.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extc-F_10-43-47.tar.gz"; sha256 = "d0a9980527d62ac6cfe27925ddb0964d334ec382f813fdfb8bd6c59fbbede730"; });
-      # END
-    }.src;
-
-    src_haxe_extlib_dev = { 
-      # REGION AUTO UPDATE:                                { name = "haxe_extlib_dev"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/extlib-dev"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe_extlib_dev-F_10-43-48.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_extlib_dev-F_10-43-48.tar.gz"; sha256 = "6b9037230e2615dd5e22f4e7f4165c84f2816bc526957683afc945394fcdf67e"; });
-      # END
-    }.src;
-
-    src_haxe_xml_light = { 
-      # REGION AUTO UPDATE:                                { name = "haxe_xml_light"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "ocaml/xml-light"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe_xml_light-F_10-43-48.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_xml_light-F_10-43-48.tar.gz"; sha256 = "be29d9e22ad0dbcb3d447cbbc14907aff5f89bb562b8db369659d299f3a5b44f"; });
-      # END
-    }.src;
-
-    src_haxe_neko_include = { 
-      # REGION AUTO UPDATE:                                { name = "haxe_neko_include"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko/libs/include/ocaml"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe_neko_include-F_10-43-49.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe_neko_include-F_10-43-49.tar.gz"; sha256 = "e49efc1b348fa6e0f6fb40079a2d380b947d9ebda31843bc293f3cc77f8453db"; });
-      # END
-    }.src;
-
-    src_haxe = {
-      # REGION AUTO UPDATE:       { name="haxe-read-only"; type="svn"; url="http://haxe.googlecode.com/svn/trunk"; groups = "haxe_group"; }
-      src = sourceFromHead "haxe-read-only-3220.tar.gz"
-                   (fetchurl { url = "http://mawercer.de/~nix/repos/haxe-read-only-3220.tar.gz"; sha256 = "2b6702dca95d0829e539cea07b8224e3848e584a425ce8f8e0984a7a2bf7b1f8"; });
-      # END
-    }.src;
-
-
-    # the HaXe compiler
-    haxe = stdenv.mkDerivation {
-      name = "haxe-cvs";
-
-      buildInputs = [ocaml zlib makeWrapper];
-
-      src = src_haxe;
-
-      inherit zlib;
-
-      buildPhase = ''
-        set -x
-        mkdir -p ocaml/{swflib,extc,extlib-dev,xml-light} neko/libs
-
-        # strange setup. install.ml seems to co the same repo again into haxe directory!
-        mkdir haxe
-        tar xfz $src --strip-components=1 -C haxe
-
-        t(){ tar xfz $1 -C $2 --strip-components=2; }
-        t ${src_haxe_swflib} ocaml/swflib
-        t ${src_haxe_extc} ocaml/extc
-        t ${src_haxe_extlib_dev} ocaml/extlib-dev
-        t ${src_haxe_xml_light} ocaml/xml-light
-        t ${src_haxe_neko_include} neko/libs
-
-        sed -e '/download();/d' \
-            -e "s@/usr/lib/@''${zlib}/lib/@g" \
-            doc/install.ml > install.ml
-        
-        ocaml install.ml
-      '';
-
-      # probably rpath should be set properly
-      installPhase = ''
-        mkdir -p $out/lib/haxe
-        cp -r bin $out/bin
-        wrapProgram "$out/bin/haxe" \
-          --set "LD_LIBRARY_PATH" $zlib/lib \
-          --set HAXE_LIBRARY_PATH "''${HAXE_LIBRARY_PATH}''${HAXE_LIBRARY_PATH:-:}:$out/lib/haxe/std:."
-        cp -r std $out/lib/haxe/
-      '';
-
-      meta = { 
-        description = "programming language targeting JavaScript, Flash, NekVM, PHP, C++";
-        homepage = http://haxe.org;
-        license = ["GPLv2" "BSD2" /*?*/ ];  # -> docs/license.txt
-        maintainers = [args.lib.maintainers.marcweber];
-        platforms = args.lib.platforms.linux;
-      };
-    };
-
-    # build a tool found in std/tools/${name} source directory
-    # the .hxml files contain a recipe  to cerate a binary.
-    tool = { name, description }: stdenv.mkDerivation {
-
-        inherit name;
-
-        src = src_haxe;
-
-        buildPhase = ''
-          cd std/tools/${name};
-          haxe *.hxml
-          mkdir -p $out/bin
-          mv ${name} $out/bin/
-        '';
-
-        buildInputs = [haxe neko];
-
-        dontStrip=1;
-
-        installPhase=":";
+  src = fetchsvn {
+    url = "http://haxe.googlecode.com/svn/trunk";
+    sha256 = "0hg8qailhgrcdk7r4k9kmwfl9d9ds0vy0l7wbv5wdrrc34qzifm4";
+    rev = 6706;
+  };
 
-        meta = {
-          inherit description;
-          homepage = http://haxe.org;
-          # license = "?"; TODO
-          maintainers = [args.lib.maintainers.marcweber];
-          platforms = args.lib.platforms.linux;
-        };
+  prePatch = ''
+    sed -i -e 's|com.class_path <- \[|&"'"$out/lib/haxe/std/"'";|' main.ml
+  '';
 
-      };
+  postBuild = ''
+    find std/tools -name '*.n' -delete
+    rm -f std/tools/haxedoc/haxedoc std/tools/haxelib/haxelib
+  '';
 
-in
+  buildFlags = [ "all" "tools" ];
 
-{
+  installPhase = ''
+    install -vd "$out/bin" "$out/lib/haxe/std"
+    install -vt "$out/bin" haxe haxelib haxedoc
+    cp -vr std "$out/lib/haxe"
+  '';
 
-  inherit haxe;
+  dontStrip = true;
 
-  haxelib = tool {
-    name = "haxelib";
-    description = "haxelib is a HaXe library management tool similar to easyinstall or ruby gems";
+  meta = {
+    description = "Programming language targeting JavaScript, Flash, NekoVM, PHP, C++";
+    homepage = http://haxe.org;
+    license = ["GPLv2" "BSD2" /*?*/ ];  # -> docs/license.txt
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
   };
-
 }
diff --git a/pkgs/development/compilers/hugs/default.nix b/pkgs/development/compilers/hugs/default.nix
index db712b18d3f..c3f14826c8a 100644
--- a/pkgs/development/compilers/hugs/default.nix
+++ b/pkgs/development/compilers/hugs/default.nix
@@ -4,7 +4,7 @@ let edf = composableDerivation.edf;
     wwf = composableDerivation.wwf; in
     
 composableDerivation.composableDerivation {} {
-  name = "hugs98";
+  name = "hugs98-200609";
 
   src = fetchurl {
     url = http://cvs.haskell.org/Hugs/downloads/2006-09/hugs98-Sep2006.tar.gz;
diff --git a/pkgs/development/compilers/iasl/default.nix b/pkgs/development/compilers/iasl/default.nix
index 085c599b969..09245ba6d4b 100644
--- a/pkgs/development/compilers/iasl/default.nix
+++ b/pkgs/development/compilers/iasl/default.nix
@@ -1,27 +1,28 @@
 {stdenv, fetchurl, bison, flex}:
 
 stdenv.mkDerivation {
-  name = "iasl-20120215";
+  name = "iasl-20130117";
+
   src = fetchurl {
-    url = http://www.acpica.org/download/acpica-unix-20120215.tar.gz;
-    sha256 = "13avirbqdnp7whl6ji8ixkhzdwf1cadl5fg8ggzbxp99bx0rgd5j";
+    url = http://www.acpica.org/download/acpica-unix-20130117.tar.gz;
+    sha256 = "1zils7l7gnkbbl8916dlhvij1g625ryb7769zhzffn3flshfdivh";
   };
 
-  buildPhase = "
-    cd source/compiler
-    make
-    cd ..
-  ";
+  NIX_CFLAGS_COMPILE = "-O3";
 
-  installPhase = "
-    install -d $out/bin
-    install compiler/iasl $out/bin
-  ";
+  buildFlags = "iasl";
 
   buildInputs = [ bison flex ];
 
+  installPhase =
+    ''
+      install -d $out/bin
+      install generate/unix/bin*/iasl $out/bin
+    '';
+
   meta = {
     description = "Intel ACPI Compiler";
     homepage = http://www.acpica.org/;
+    license = "iasl"; # FIXME: is this a free software license?
   };
 }
diff --git a/pkgs/development/compilers/idris/default.nix b/pkgs/development/compilers/idris/default.nix
index fe9ce209191..225f8afcd82 100644
--- a/pkgs/development/compilers/idris/default.nix
+++ b/pkgs/development/compilers/idris/default.nix
@@ -1,22 +1,23 @@
-{ cabal, binary, Cabal, epic, filepath, happy, haskeline, mtl
-, parsec, transformers
+{ cabal, binary, Cabal, filepath, gmp, happy, haskeline
+, languageJava, libffi, mtl, parsec, split, text, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "idris";
-  version = "0.9.2.1";
-  sha256 = "16jbmyza57066s3wmkvgwn11kqn0nzkjrrvsinh9xd69a79h2iiy";
+  version = "0.9.8";
+  sha256 = "1mxc6mic3d508ni9pqxw8q31f27shyaxs1rchfl2jg58i9w6iy7h";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    binary Cabal epic filepath haskeline mtl parsec transformers
+    binary Cabal filepath haskeline languageJava libffi mtl parsec
+    split text transformers
   ];
   buildTools = [ happy ];
+  extraLibraries = [ gmp ];
   meta = {
     homepage = "http://www.idris-lang.org/";
     description = "Functional Programming Language with Dependent Types";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/compilers/idris/wrapper.nix b/pkgs/development/compilers/idris/wrapper.nix
new file mode 100644
index 00000000000..427a690234c
--- /dev/null
+++ b/pkgs/development/compilers/idris/wrapper.nix
@@ -0,0 +1,10 @@
+{ gmp, makeWrapper, gcc, runCommand, idris_plain}:
+
+runCommand "idris-wrapper" {} ''
+  source ${makeWrapper}/nix-support/setup-hook
+  mkdir -p $out/bin
+  ln -s ${idris_plain}/bin/idris $out/bin
+      wrapProgram $out/bin/idris \
+        --suffix NIX_CFLAGS_COMPILE : '"-I${gmp}/include -L${gmp}/lib"' \
+        --suffix PATH : ${gcc}/bin
+''
diff --git a/pkgs/development/compilers/jdk/default.nix b/pkgs/development/compilers/jdk/default.nix
deleted file mode 100644
index 8940be7f34d..00000000000
--- a/pkgs/development/compilers/jdk/default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-args:
-
-if args.stdenv.system == "i686-linux" || args.stdenv.system == "x86_64-linux" then
-  (import ./jdk6-linux.nix) ( removeAttrs args ["cabextract"] )
-else if args.stdenv.system == "i686-cygwin" then
-  (import ./jdk6-cygwin.nix) (removeAttrs args ["pluginSupport" "xlibs" "installjdk" "xlibs"])
-else
-  abort "the JDK is not supported on this platform"
-
diff --git a/pkgs/development/compilers/jdk/jdk6-construct.sh b/pkgs/development/compilers/jdk/jdk6-construct.sh
index 3e09d4621d6..16ee0f5a2f0 100644
--- a/pkgs/development/compilers/jdk/jdk6-construct.sh
+++ b/pkgs/development/compilers/jdk/jdk6-construct.sh
@@ -1,9 +1,9 @@
 #!/bin/bash
 # construct.sh
 # example construction of JRE and JDK directories from the DLJ bundles
-# 
+#
 # Copyright © 2006 Sun Microsystems, Inc.
-# 
+#
 # Permission is hereby granted, free of charge, to any person obtaining
 # a copy of this software and associated documentation files (the
 # "Software"), to deal in the Software without restriction, including
@@ -11,10 +11,10 @@
 # distribute, sublicense, and/or sell copies of the Software, and to
 # permit persons to whom the Software is furnished to do so, subject to
 # the following conditions:
-# 
+#
 # The above copyright notice and this permission notice shall be
 # included in all copies or substantial portions of the Software.
-# 
+#
 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
@@ -22,7 +22,7 @@
 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-# 
+#
 # Sun, Sun Microsystems, the Sun logo and Java, Java HotSpot,
 # and JVM  trademarks or registered trademarks of Sun Microsystems,
 # Inc. in the U.S. and other countries.
@@ -43,13 +43,13 @@ getargs() {
     exit 2
   fi
   # make sure javahome is the JDK
-  javahome=`echo $undir/*/demo`
+  javahome=`echo $undir/*/db/demo`
   if [ ! -d $javahome ]; then
     echo "${program}: unbundle directory incorrect: $undir"
     echo "  expecting $undir/jdk1.5.0_xx"
     exit 2
   else
-    javahome=`dirname $javahome`
+    javahome=$(dirname $(dirname $javahome))
   fi
   # verify JDK dir
   jdkdirp=`dirname $jdkdir`
@@ -106,7 +106,7 @@ linkrel() {
   if [ $m -lt $c ]; then
     (( c = m ))
   fi
-  for (( i = 0 ; i < c ; i++ )); do 
+  for (( i = 0 ; i < c ; i++ )); do
     if [ ${targetb[$i]} != ${linkb[$i]} ]; then
       # echo components differ, stopping
       break
diff --git a/pkgs/development/compilers/jdk/jdk6-cygwin.nix b/pkgs/development/compilers/jdk/jdk6-cygwin.nix
deleted file mode 100644
index 31c9c614031..00000000000
--- a/pkgs/development/compilers/jdk/jdk6-cygwin.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ stdenv
-, fetchurl
-, unzip
-, cabextract
-, ...
-}:
-
-assert stdenv.system == "i686-cygwin";
-
-stdenv.mkDerivation rec {
-  name = "jdk-1.6.0_20";
-
-  src = fetchurl {
-    url = file:///tmp/jdk-6u20-windows-i586.exe;
-    sha256 = "0w4afz8a9gi1iyhh47gvhiy59dfrzx0fnmywdff3v5cx696w25fh";
-  };
-
-  buildInputs = [unzip cabextract]; 
-
-  buildCommand = ''
-    cabextract ${src}
-    mkdir -p $out
-    unzip -d $out tools.zip
-    find $out -name '*.exe' | xargs chmod a+x 
-    find $out -name '*.dll' | xargs chmod a+x 
-
-    cd $out
-    $out/bin/unpack200.exe ./jre/lib/jsse.pack ./jre/lib/jsse.jar
-    $out/bin/unpack200.exe ./jre/lib/javaws.pack ./jre/lib/javaws.jar
-    $out/bin/unpack200.exe ./jre/lib/plugin.pack ./jre/lib/plugin.jar
-    $out/bin/unpack200.exe ./jre/lib/charsets.pack ./jre/lib/charsets.jar
-    $out/bin/unpack200.exe ./jre/lib/deploy.pack ./jre/lib/deploy.jar
-    $out/bin/unpack200.exe ./jre/lib/rt.pack ./jre/lib/rt.jar
-    $out/bin/unpack200.exe ./jre/lib/ext/localedata.pack ./jre/lib/ext/localedata.jar
-    $out/bin/unpack200.exe ./lib/tools.pack ./lib/tools.jar
-
-    rm ./jre/lib/jsse.pack \
-       ./jre/lib/javaws.pack \
-       ./jre/lib/plugin.pack \
-       ./jre/lib/charsets.pack \
-       ./jre/lib/deploy.pack \
-       ./jre/lib/rt.pack \
-       ./jre/lib/ext/localedata.pack \
-       ./lib/tools.pack
-  '';
-
-  meta.license = "unfree";
-}
diff --git a/pkgs/development/compilers/jdk/jdk6-linux.nix b/pkgs/development/compilers/jdk/jdk6-linux.nix
index b564d311014..340bbdf91ac 100644
--- a/pkgs/development/compilers/jdk/jdk6-linux.nix
+++ b/pkgs/development/compilers/jdk/jdk6-linux.nix
@@ -1,6 +1,6 @@
 { swingSupport ? true
 , stdenv
-, fetchurl
+, requireFile
 , unzip
 , makeWrapper
 , xlibs ? null
@@ -28,18 +28,20 @@ in
 
 stdenv.mkDerivation {
   name =
-    if installjdk then "jdk-1.6.0_32b03" else "jre-1.6.0_32b03";
+    if installjdk then "jdk-1.6.0_45b06" else "jre-1.6.0_45b06";
 
   src =
     if stdenv.system == "i686-linux" then
-      fetchurl {
-        url = http://www.java.net/download/jdk6/6u32/promoted/b03/binaries/jdk-6u32-ea-bin-b03-linux-i586-29_feb_2012.bin;
-        md5 = "7c009afa399476c7d2791386235b8e3b";
+      requireFile {
+        name = "jdk-6u45-linux-i586.bin";
+        url = http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html;
+        sha256 = "0mx3d2qlal5zyz1a7ld1yk2rs8pf9sjxs2jzasais3nq30jmlfym";
       }
     else if stdenv.system == "x86_64-linux" then
-      fetchurl {
-        url = http://www.java.net/download/jdk6/6u32/promoted/b03/binaries/jdk-6u32-ea-bin-b03-linux-amd64-29_feb_2012.bin;
-        md5 = "7f1a45531a04c372e5660a55c2dfdad8";
+      requireFile {
+        name = "jdk-6u45-linux-x64.bin";
+        url = http://www.oracle.com/technetwork/java/javase/downloads/jdk6downloads-1902814.html;
+        sha256 = "1s0j1pdr6y8c816d9i86rx4zp12nbhmas1rxksp0r53cn7m3ljbb";
       }
     else
       abort "jdk requires i686-linux or x86_64 linux";
diff --git a/pkgs/development/compilers/jhc/default.nix b/pkgs/development/compilers/jhc/default.nix
new file mode 100644
index 00000000000..d36c8c2755a
--- /dev/null
+++ b/pkgs/development/compilers/jhc/default.nix
@@ -0,0 +1,30 @@
+{
+  stdenv, fetchurl, perl, ghc, binary, zlib, utf8String, readline, fgl,
+  regexCompat, HsSyck, random
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "jhc-${version}";
+
+  version = "0.8.0";
+
+  src = fetchurl {
+    url = "http://repetae.net/dist/${name}.tar.gz";
+    sha256 = "0rbv0gpp7glhd9xqy7snbiaiizwnsfg9vzhvyywcvbmb35yivy2a";
+  };
+
+  buildInputs = [
+    perl ghc binary zlib utf8String readline fgl regexCompat HsSyck random
+  ];
+
+  meta = {
+    homepage = "http://repetae.net/computer/jhc/";
+    description = "A Haskell compiler which aims to produce the most efficient programs";
+    license = stdenv.lib.licenses.gpl2;
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.aforemny stdenv.lib.maintainers.simons ];
+  };
+
+}
diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix
index 2484be9ae1f..7fa12d495aa 100644
--- a/pkgs/development/compilers/julia/default.nix
+++ b/pkgs/development/compilers/julia/default.nix
@@ -1,22 +1,25 @@
-{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre
+{ stdenv, fetchgit, gfortran, perl, m4, llvm, gmp, pcre, zlib
  , readline, fftwSinglePrec, fftw, libunwind, suitesparse, glpk, fetchurl
  , ncurses, libunistring, lighttpd, patchelf, openblas, liblapack
+ , tcl, tk, xproto, libX11, git
  } :
 let
   realGcc = stdenv.gcc.gcc;
 in
 stdenv.mkDerivation rec {
   pname = "julia";
-  date = "20120818";
+  date = "20130205";
   name = "${pname}-git-${date}";
 
   grisu_ver = "1.1.1";
-  dsfmt_ver = "2.1";
+  dsfmt_ver = "2.2";
   openblas_ver = "v0.2.2";
   lapack_ver = "3.4.1";
   arpack_ver = "3.1.2";
   clp_ver = "1.14.5";
   lighttpd_ver = "1.4.29";
+  patchelf_ver = "0.6";
+  pcre_ver = "8.31";
 
   grisu_src = fetchurl {
     url = "http://double-conversion.googlecode.com/files/double-conversion-${grisu_ver}.tar.gz";
@@ -25,7 +28,7 @@ stdenv.mkDerivation rec {
   dsfmt_src = fetchurl {
     url = "http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/dSFMT-src-${dsfmt_ver}.tar.gz";
     name = "dsfmt-${dsfmt_ver}.tar.gz";
-    sha256 = "e9d3e04bc984ec3b14033342f5ebdcd5202d8d8e40128dd737f566945612378f";
+    sha256 = "bc3947a9b2253a869fcbab8ff395416cb12958be9dba10793db2cd7e37b26899";
   };
   openblas_src = fetchurl {
     url = "https://github.com/xianyi/OpenBLAS/tarball/${openblas_ver}";
@@ -51,67 +54,65 @@ stdenv.mkDerivation rec {
     url = "http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-${lighttpd_ver}.tar.gz";
     sha256 = "ff9f4de3901d03bb285634c5b149191223d17f1c269a16c863bac44238119c85";
   };
+  patchelf_src = fetchurl {
+    url = "http://hydra.nixos.org/build/1524660/download/2/patchelf-${patchelf_ver}.tar.bz2";
+    sha256 = "00bw29vdsscsili65wcb5ay0gvg1w0ljd00sb5xc6br8bylpyzpw";
+  };
+  pcre_src = fetchurl {
+    url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${pcre_ver}.tar.bz2";
+    sha256 = "0g4c0z4h30v8g8qg02zcbv7n67j5kz0ri9cfhgkpwg276ljs0y2p";
+  };
 
   src = fetchgit {
     url = "git://github.com/JuliaLang/julia.git";
-    rev = "4f692899688f500c77d768f67748f4b7335c90eb";
-    sha256 = "a60e684a5283e80619f28ec8ff16fdc76c549e8463059507b0819db09dae6688";
+    rev = "efc696bf74eec7605b4da19f6f1605ba99959ed3";
+    sha256 = "19if7aj3mrp84dg9g2d3zbhasrq0nz28djl9a01m0y4y9bfymp7s";
   };
 
-  buildInputs = [ gfortran perl m4 gmp pcre llvm readline 
+  buildInputs = [ gfortran perl m4 gmp pcre llvm readline zlib
     fftw fftwSinglePrec libunwind suitesparse glpk ncurses libunistring patchelf
-    openblas liblapack
+    openblas liblapack tcl tk xproto libX11 git
     ];
 
   configurePhase = ''
-    for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD; 
+    for i in GMP LLVM PCRE LAPACK OPENBLAS BLAS READLINE FFTW LIBUNWIND SUITESPARSE GLPK LIGHTTPD ZLIB; 
     do 
-      sed -e "s@USE_SYSTEM_$i=0@USE_SYSTEM_$i=1@" -i Make.inc; 
+      makeFlags="$makeFlags USE_SYSTEM_$i=1 "
     done
-    sed -e 's@-lcurses@@g' -i Make.inc
 
     copy_kill_hash(){
       cp "$1" "$2/$(basename "$1" | sed -e 's/^[a-z0-9]*-//')"
     }
 
-    for i in "${grisu_src}" "${dsfmt_src}" "${arpack_src}" "${clp_src}" ; do
+    for i in "${grisu_src}" "${dsfmt_src}" "${arpack_src}" "${clp_src}" "${patchelf_src}" "${pcre_src}" ; do
       copy_kill_hash "$i" deps
     done
     copy_kill_hash "${dsfmt_src}" deps/random
 
     ${if realGcc ==null then "" else 
-    ''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -llapack -lm -lfftw3f -lfftw3 -lglpk -lunistring "''}
-
-    sed -e 's@ cpp @ gcc -E @g' -i base/Makefile
+    ''export NIX_LDFLAGS="$NIX_LDFLAGS -L${realGcc}/lib -L${realGcc}/lib64 -lpcre -llapack -lm -lfftw3f -lfftw3 -lglpk -lunistring -lz "''}
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC "
 
-    export LDFLAGS="-L${suitesparse}/lib"
+    export LDFLAGS="-L${suitesparse}/lib -L$out/lib/julia -Wl,-rpath,$out/lib/julia"
 
     export GLPK_PREFIX="${glpk}/include"
 
     mkdir -p "$out/lib"
     sed -e "s@/usr/local/lib@$out/lib@g" -i deps/Makefile
     sed -e "s@/usr/lib@$out/lib@g" -i deps/Makefile
-    
-    export makeFlags="$makeFlags PREFIX=$out" 
+
+    export makeFlags="$makeFlags PREFIX=$out SHELL=${stdenv.shell}"
 
     export dontPatchELF=1
+
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PWD/usr/lib:$PWD/usr/lib/julia"
   '';
 
   preBuild = ''
-    make -C test/unicode all
-    make -C extras glpk_h.jl GLPK_PREFIX="$GLPK_PREFIX"
+    mkdir -p usr/lib
   '';
 
-  postInstall = ''
-   ld -E --whole-archive --shared ${suitesparse}/lib/lib*[a-z].a -o "$out"/lib/libsuitesparse-shared.so
-   for i in umfpack cholmod amd camd colamd ; do
-     ln -s "libsuitesparse-shared.so" "$out/lib/lib$i.so"
-   done
-   ln -s "${lighttpd}/sbin/lighttpd" "$out/sbin/"
-   ln -s "${lighttpd}/lib/"* "$out/lib/"
-
-   cp -r test examples "$out/lib/julia"
-   ls -R > "$out/ls-R"
+  preInstall = ''
   '';
 
   meta = {
diff --git a/pkgs/development/compilers/llvm/3.1.nix b/pkgs/development/compilers/llvm/3.1.nix
deleted file mode 100644
index 204c080b871..00000000000
--- a/pkgs/development/compilers/llvm/3.1.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, perl, groff, cmake, python }:
-
-let version = "3.1"; in
-
-stdenv.mkDerivation {
-  name = "llvm-${version}";
-
-  src = fetchurl {
-    url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
-    sha256 = "1ea05135197b5400c1f88d00ff280d775ce778f8f9ea042e25a1e1e734a4b9ab";
-  };
-
-  buildInputs = [ perl groff cmake python ];
-
-  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://llvm.org/;
-    description = "Collection of modular and reusable compiler and toolchain technologies";
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric shlevy raskin];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
-
diff --git a/pkgs/development/compilers/llvm/clang-include-paths.patch b/pkgs/development/compilers/llvm/clang-include-paths.patch
deleted file mode 100644
index 828c554175e..00000000000
--- a/pkgs/development/compilers/llvm/clang-include-paths.patch
+++ /dev/null
@@ -1,49 +0,0 @@
-diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
---- clang-3.0.src-orig/lib/Driver/ToolChains.cpp	2011-11-17 02:40:32.000000000 -0500
-+++ clang-3.0.src/lib/Driver/ToolChains.cpp	2011-12-19 06:29:27.562428830 -0500
-@@ -1926,14 +1926,17 @@
-   if (DriverArgs.hasArg(options::OPT_nostdinc))
-     return;
- 
-+#if 0
-   if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
-     addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
- 
-+#endif
-   if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
-     llvm::sys::Path P(D.ResourceDir);
-     P.appendComponent("include");
-     addSystemInclude(DriverArgs, CC1Args, P.str());
-   }
-+#if 0
- 
-   if (DriverArgs.hasArg(options::OPT_nostdlibinc))
-     return;
-@@ -1998,6 +2001,8 @@
-     return;
- 
-   addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
-+#endif
-+  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + C_INCLUDE_PATH);
- }
- 
- static bool addLibStdCXXIncludePaths(Twine Base, Twine TargetArchDir,
-@@ -2030,6 +2035,7 @@
-   bool IsTarget64Bit = (TargetArch == llvm::Triple::x86_64 ||
-                         TargetArch == llvm::Triple::ppc64);
- 
-+#if 0
-   StringRef CxxIncludeRoot(CXX_INCLUDE_ROOT);
-   if (!CxxIncludeRoot.empty()) {
-     StringRef CxxIncludeArch(CXX_INCLUDE_ARCH);
-@@ -2072,6 +2078,10 @@
-                              GCCInstallation.getTriple() + Suffix,
-                              DriverArgs, CC1Args);
-   }
-+#endif
-+    addLibStdCXXIncludePaths(CPP_INCLUDE_PATH,
-+                             CPP_HOST,
-+                             DriverArgs, CC1Args);
- }
- 
- /// DragonFly - DragonFly tool chain which can call as(1) and ld(1) directly.
diff --git a/pkgs/development/compilers/llvm/clang-ld-flags.patch b/pkgs/development/compilers/llvm/clang-ld-flags.patch
deleted file mode 100644
index 62b8bc763f9..00000000000
--- a/pkgs/development/compilers/llvm/clang-ld-flags.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff -Naur clang-3.0.src-orig/lib/Driver/ToolChains.cpp clang-3.0.src/lib/Driver/ToolChains.cpp
---- clang-3.0.src-orig/lib/Driver/ToolChains.cpp	2011-11-17 02:40:32.000000000 -0500
-+++ clang-3.0.src/lib/Driver/ToolChains.cpp	2011-12-19 05:32:38.695513475 -0500
-@@ -1800,6 +1800,7 @@
- 
-   Linker = GetProgramPath("ld");
- 
-+#if 0
-   LinuxDistro Distro = DetectLinuxDistro(Arch);
- 
-   if (IsOpenSuse(Distro) || IsUbuntu(Distro)) {
-@@ -1882,6 +1883,7 @@
-   addPathIfExists(SysRoot + "/lib", Paths);
-   addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
-   addPathIfExists(SysRoot + "/usr/lib", Paths);
-+#endif
- }
- 
- bool Linux::HasNativeLLVMSupport() const {
-diff -Naur clang-3.0.src-orig/lib/Driver/Tools.cpp clang-3.0.src/lib/Driver/Tools.cpp
---- clang-3.0.src-orig/lib/Driver/Tools.cpp	2011-11-07 05:27:39.000000000 -0500
-+++ clang-3.0.src/lib/Driver/Tools.cpp	2011-12-19 05:34:44.075325534 -0500
-@@ -4306,6 +4306,7 @@
-       ToolChain.getArch() == llvm::Triple::thumb ||
-       (!Args.hasArg(options::OPT_static) &&
-        !Args.hasArg(options::OPT_shared))) {
-+#if 0
-     CmdArgs.push_back("-dynamic-linker");
-     if (ToolChain.getArch() == llvm::Triple::x86)
-       CmdArgs.push_back("/lib/ld-linux.so.2");
-@@ -4318,6 +4319,7 @@
-       CmdArgs.push_back("/lib64/ld64.so.1");
-     else
-       CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
-+#endif
-   }
- 
-   CmdArgs.push_back("-o");
diff --git a/pkgs/development/compilers/llvm/clang-purity.patch b/pkgs/development/compilers/llvm/clang-purity.patch
new file mode 100644
index 00000000000..18c70b56c54
--- /dev/null
+++ b/pkgs/development/compilers/llvm/clang-purity.patch
@@ -0,0 +1,137 @@
+diff -Naur clang-3.2.src-orig/lib/Driver/ToolChains.cpp clang-3.2.src/lib/Driver/ToolChains.cpp
+--- clang-3.2.src-orig/lib/Driver/ToolChains.cpp	2012-12-16 10:59:27.000000000 -0500
++++ clang-3.2.src/lib/Driver/ToolChains.cpp	2013-01-22 14:16:55.787547681 -0500
+@@ -2153,16 +2153,6 @@
+       addPathIfExists(LibPath + "/../" + GCCTriple.str() + "/lib", Paths);
+     }
+   }
+-  addPathIfExists(SysRoot + "/lib/" + MultiarchTriple, Paths);
+-  addPathIfExists(SysRoot + "/lib/../" + Multilib, Paths);
+-  addPathIfExists(SysRoot + "/usr/lib/" + MultiarchTriple, Paths);
+-  addPathIfExists(SysRoot + "/usr/lib/../" + Multilib, Paths);
+-
+-  // Try walking via the GCC triple path in case of multiarch GCC
+-  // installations with strange symlinks.
+-  if (GCCInstallation.isValid())
+-    addPathIfExists(SysRoot + "/usr/lib/" + GCCInstallation.getTriple().str() +
+-                    "/../../" + Multilib, Paths);
+ 
+   // Add the non-multilib suffixed paths (if potentially different).
+   if (GCCInstallation.isValid()) {
+@@ -2176,8 +2166,6 @@
+       addPathIfExists(LibPath, Paths);
+     }
+   }
+-  addPathIfExists(SysRoot + "/lib", Paths);
+-  addPathIfExists(SysRoot + "/usr/lib", Paths);
+ }
+ 
+ bool Linux::HasNativeLLVMSupport() const {
+@@ -2228,9 +2216,6 @@
+   if (DriverArgs.hasArg(options::OPT_nostdinc))
+     return;
+ 
+-  if (!DriverArgs.hasArg(options::OPT_nostdlibinc))
+-    addSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/local/include");
+-
+   if (!DriverArgs.hasArg(options::OPT_nobuiltininc)) {
+     llvm::sys::Path P(D.ResourceDir);
+     P.appendComponent("include");
+@@ -2295,24 +2280,6 @@
+     "/usr/include/powerpc64-linux-gnu"
+   };
+   ArrayRef<StringRef> MultiarchIncludeDirs;
+-  if (getTriple().getArch() == llvm::Triple::x86_64) {
+-    MultiarchIncludeDirs = X86_64MultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::x86) {
+-    MultiarchIncludeDirs = X86MultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::arm) {
+-    if (getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+-      MultiarchIncludeDirs = ARMHFMultiarchIncludeDirs;
+-    else
+-      MultiarchIncludeDirs = ARMMultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::mips) {
+-    MultiarchIncludeDirs = MIPSMultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::mipsel) {
+-    MultiarchIncludeDirs = MIPSELMultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::ppc) {
+-    MultiarchIncludeDirs = PPCMultiarchIncludeDirs;
+-  } else if (getTriple().getArch() == llvm::Triple::ppc64) {
+-    MultiarchIncludeDirs = PPC64MultiarchIncludeDirs;
+-  }
+   for (ArrayRef<StringRef>::iterator I = MultiarchIncludeDirs.begin(),
+                                      E = MultiarchIncludeDirs.end();
+        I != E; ++I) {
+@@ -2324,13 +2291,6 @@
+ 
+   if (getTriple().getOS() == llvm::Triple::RTEMS)
+     return;
+-
+-  // Add an include of '/include' directly. This isn't provided by default by
+-  // system GCCs, but is often used with cross-compiling GCCs, and harmless to
+-  // add even when Clang is acting as-if it were a system compiler.
+-  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/include");
+-
+-  addExternCSystemInclude(DriverArgs, CC1Args, D.SysRoot + "/usr/include");
+ }
+ 
+ /// \brief Helper to add the thre variant paths for a libstdc++ installation.
+diff -Naur clang-3.2.src-orig/lib/Driver/Tools.cpp clang-3.2.src/lib/Driver/Tools.cpp
+--- clang-3.2.src-orig/lib/Driver/Tools.cpp	2012-11-21 02:56:23.000000000 -0500
++++ clang-3.2.src/lib/Driver/Tools.cpp	2013-01-22 14:24:37.167212186 -0500
+@@ -5972,34 +5972,6 @@
+       ToolChain.getArch() == llvm::Triple::thumb ||
+       (!Args.hasArg(options::OPT_static) &&
+        !Args.hasArg(options::OPT_shared))) {
+-    CmdArgs.push_back("-dynamic-linker");
+-    if (isAndroid)
+-      CmdArgs.push_back("/system/bin/linker");
+-    else if (ToolChain.getArch() == llvm::Triple::x86)
+-      CmdArgs.push_back("/lib/ld-linux.so.2");
+-    else if (ToolChain.getArch() == llvm::Triple::arm ||
+-             ToolChain.getArch() == llvm::Triple::thumb) {
+-      if (ToolChain.getTriple().getEnvironment() == llvm::Triple::GNUEABIHF)
+-        CmdArgs.push_back("/lib/ld-linux-armhf.so.3");
+-      else
+-        CmdArgs.push_back("/lib/ld-linux.so.3");
+-    }
+-    else if (ToolChain.getArch() == llvm::Triple::mips ||
+-             ToolChain.getArch() == llvm::Triple::mipsel)
+-      CmdArgs.push_back("/lib/ld.so.1");
+-    else if (ToolChain.getArch() == llvm::Triple::mips64 ||
+-             ToolChain.getArch() == llvm::Triple::mips64el) {
+-      if (hasMipsN32ABIArg(Args))
+-        CmdArgs.push_back("/lib32/ld.so.1");
+-      else
+-        CmdArgs.push_back("/lib64/ld.so.1");
+-    }
+-    else if (ToolChain.getArch() == llvm::Triple::ppc)
+-      CmdArgs.push_back("/lib/ld.so.1");
+-    else if (ToolChain.getArch() == llvm::Triple::ppc64)
+-      CmdArgs.push_back("/lib64/ld64.so.1");
+-    else
+-      CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
+   }
+ 
+   CmdArgs.push_back("-o");
+diff -Naur clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp
+--- clang-3.2.src-orig/lib/Frontend/InitHeaderSearch.cpp	2012-10-24 12:19:39.000000000 -0400
++++ clang-3.2.src/lib/Frontend/InitHeaderSearch.cpp	2013-01-22 14:20:32.803925775 -0500
+@@ -221,8 +221,6 @@
+     case llvm::Triple::Bitrig:
+       break;
+     default:
+-      // FIXME: temporary hack: hard-coded paths.
+-      AddPath("/usr/local/include", System, true, false, false);
+       break;
+     }
+   }
+@@ -330,8 +328,6 @@
+     break;
+   }
+ 
+-  if ( os != llvm::Triple::RTEMS )
+-    AddPath("/usr/include", System, false, false, false);
+ }
+ 
+ void InitHeaderSearch::
diff --git a/pkgs/development/compilers/llvm/clang.nix b/pkgs/development/compilers/llvm/clang.nix
index 663e1bfab28..c2117798666 100644
--- a/pkgs/development/compilers/llvm/clang.nix
+++ b/pkgs/development/compilers/llvm/clang.nix
@@ -1,29 +1,31 @@
-{ stdenv, fetchurl, perl, groff, llvm, cmake }:
+{ stdenv, fetchurl, perl, groff, llvm, cmake, libxml2 }:
 
-let version = "3.0"; in
+let
+  version = "3.2";
+  gccReal = if (stdenv.gcc.gcc or null) == null then stdenv.gcc else stdenv.gcc.gcc;
+in
 
 stdenv.mkDerivation {
   name = "clang-${version}";
 
-  buildInputs = [ perl llvm groff cmake ];
+  buildInputs = [ perl llvm groff cmake libxml2 ];
 
-  patches = stdenv.lib.optionals (stdenv.gcc.libc != null) 
-    [ ./clang-include-paths.patch ./clang-ld-flags.patch ];
+  patches = stdenv.lib.optional (stdenv.gcc.libc != null) ./clang-purity.patch;
 
-  postPatch = stdenv.lib.optionalString (stdenv.gcc.libc != null) ''
-    sed -i -e 's,C_INCLUDE_PATH,"${stdenv.gcc.libc}/include/",' \
-      -e 's,CPP_HOST,"'$(${stdenv.gcc}/bin/cc -dumpmachine)'",' \
-      -e 's,CPP_INCLUDE_PATH,"${stdenv.gcc.gcc}/include/c++/${stdenv.gcc.gcc.version}",' \
-      lib/Driver/ToolChains.cpp
-  '';
-
-  cmakeFlags = [ "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}" "-DCMAKE_BUILD_TYPE=Release" "-DLLVM_TARGETS_TO_BUILD=all"];
+  cmakeFlags = [
+    "-DCLANG_PATH_TO_LLVM_BUILD=${llvm}"
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DLLVM_TARGETS_TO_BUILD=all"
+    "-DGCC_INSTALL_PREFIX=${gccReal}"
+  ] ++ stdenv.lib.optionals (stdenv.gcc.libc != null) [
+    "-DC_INCLUDE_DIRS=${stdenv.gcc.libc}/include/"
+  ];
 
   enableParallelBuilding = true;
 
   src = fetchurl {
-      url = "http://llvm.org/releases/${version}/clang-${version}.tar.gz";
-      sha256 = "0v8j9rgmb7w74ihc44zfxa22q17c946n5b6prwl38z3d6pd74kmn";
+      url = "http://llvm.org/releases/${version}/clang-${version}.src.tar.gz";
+      sha256 = "0n2nzw3pw2v7fk67f2k2qyzd9wibvi3i5j7cjzz1csqgghzz1aia";
   };
 
   passthru = { gcc = stdenv.gcc.gcc; };
@@ -36,4 +38,3 @@ stdenv.mkDerivation {
     platforms = with stdenv.lib.platforms; all;
   };
 }
-
diff --git a/pkgs/development/compilers/llvm/default.nix b/pkgs/development/compilers/llvm/default.nix
index 0fb1cf82cc2..4b5bbdc5258 100644
--- a/pkgs/development/compilers/llvm/default.nix
+++ b/pkgs/development/compilers/llvm/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, perl, groff, cmake }:
+{ stdenv, fetchurl, perl, groff, cmake, python }:
 
-let version = "3.0"; in
+let version = "3.2"; in
 
 stdenv.mkDerivation {
   name = "llvm-${version}";
 
   src = fetchurl {
-    url    = "http://llvm.org/releases/${version}/llvm-${version}.tar.gz";
-    sha256 = "0xq4gi7lflv8ilfckslhfvnja5693xjii1yvzz39kklr6hfv37ji";
+    url    = "http://llvm.org/releases/${version}/llvm-${version}.src.tar.gz";
+    sha256 = "0hv30v5l4fkgyijs56sr1pbrlzgd674pg143x7az2h37sb290l0j";
   };
 
-  buildInputs = [ perl groff cmake ];
+  buildInputs = [ perl groff cmake python ];
 
   cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
 
@@ -20,8 +20,7 @@ stdenv.mkDerivation {
     homepage = http://llvm.org/;
     description = "Collection of modular and reusable compiler and toolchain technologies";
     license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric shlevy];
+    maintainers = with stdenv.lib.maintainers; [viric shlevy raskin];
     platforms = with stdenv.lib.platforms; all;
   };
 }
-
diff --git a/pkgs/development/compilers/llvm/dragonegg.nix b/pkgs/development/compilers/llvm/dragonegg.nix
index 9fd308a7e21..42d337b8eac 100644
--- a/pkgs/development/compilers/llvm/dragonegg.nix
+++ b/pkgs/development/compilers/llvm/dragonegg.nix
@@ -1,11 +1,12 @@
 {stdenv, fetchurl, llvm, gmp, mpfr, mpc}:
 
 stdenv.mkDerivation rec {
-  name = "dragonegg-3.0";
+  version = "3.2";
+  name = "dragonegg-${version}";
 
   src = fetchurl {
-    url = "http://llvm.org/releases/3.0/${name}.tar.gz";
-    sha256 = "09v8bxx676iz93qk39dc2fk52iqhqy9pnphvinmm9ch1x791zpvj";
+    url = "http://llvm.org/releases/${version}/${name}.src.tar.gz";
+    sha256 = "0jfxhqy3177drlvzgp6m0kwnbfyzrd4vzidnxjhck8a7a69a26bg";
   };
 
   # The gcc the plugin will be built for (the same used building dragonegg)
diff --git a/pkgs/development/compilers/mentor/default.nix b/pkgs/development/compilers/mentor/default.nix
new file mode 100644
index 00000000000..b12a197451a
--- /dev/null
+++ b/pkgs/development/compilers/mentor/default.nix
@@ -0,0 +1,80 @@
+# Sourcery CodeBench Lite toolchain(s) (GCC) from Mentor Graphics
+
+{ stdenv, fetchurl, patchelf, ncurses }:
+
+let
+
+  buildToolchain =
+    { name, src, description }:
+
+    stdenv.mkDerivation rec {
+      inherit name src;
+
+      buildInputs = [ patchelf ];
+
+      buildCommand = ''
+        # Unpack tarball
+        mkdir -p "$out"
+        tar --strip-components=1 -xjf "$src" -C "$out"
+
+        # Patch binaries
+        interpreter="$(cat "$NIX_GCC"/nix-support/dynamic-linker)"
+        for file in "$out"/bin/* "$out"/libexec/gcc/*/*/* "$out"/*/bin/*; do
+            # Skip non-executable files
+            case "$file" in
+              *README.txt) echo "skipping $file"; continue;;
+              *liblto_plugin.so*) echo "skipping $file"; continue;;
+            esac
+
+            # Skip directories
+            test -d "$file" && continue
+
+            echo "patchelf'ing $file"
+            patchelf --set-interpreter "$interpreter" "$file"
+
+            # GDB needs ncurses
+            case "$file" in
+              *gdb) patchelf --set-rpath "${ncurses}/lib" "$file";;
+            esac
+        done
+
+        # Manpages
+        mkdir -p "$out/share/man"
+        ln -s "$out"/share/doc/*/man/man1 "$out/share/man/man1"
+        ln -s "$out"/share/doc/*/man/man7 "$out/share/man/man7"
+      '';
+
+      meta = with stdenv.lib; {
+        inherit description;
+        homepage = http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/;
+        license = licenses.gpl3;
+        platforms = platforms.linux;
+        maintainers = [ maintainers.bjornfor ];
+      };
+    };
+
+in
+
+{
+
+  armLinuxGnuEabi = let version = "2013.05-24"; in buildToolchain rec {
+    name = "sourcery-codebench-lite-arm-linux-gnueabi-${version}";
+    description = "Sourcery CodeBench Lite toolchain (GCC) for ARM GNU/Linux, from Mentor Graphics";
+    src = fetchurl {
+      url = "http://sourcery.mentor.com/public/gnu_toolchain/arm-none-linux-gnueabi/arm-${version}-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2";
+      sha256 = "1xb075ia61c59cya2jl8zp4fvqpfnwkkc5330shvgdlg9981qprr";
+    };
+  };
+
+  armEabi = let version = "2013.05-23"; in buildToolchain rec {
+    name = "sourcery-codebench-lite-arm-eabi-${version}";
+    description = "Sourcery CodeBench Lite toolchain (GCC) for ARM EABI, from Mentor Graphics";
+    src = fetchurl {
+      url = "http://sourcery.mentor.com/public/gnu_toolchain/arm-none-eabi/arm-${version}-arm-none-eabi-i686-pc-linux-gnu.tar.bz2";
+      sha256 = "0nbvdwj3kcv9scx808gniqp0ncdiy2i7afmdvribgkz1lsfin923";
+    };
+  };
+
+  # TODO: Sourcery CodeBench is also available for MIPS, Power, SuperH,
+  # ColdFire (and more).
+}
diff --git a/pkgs/development/compilers/mit-scheme/default.nix b/pkgs/development/compilers/mit-scheme/default.nix
index ef11c5b3baf..29950aa9e3d 100644
--- a/pkgs/development/compilers/mit-scheme/default.nix
+++ b/pkgs/development/compilers/mit-scheme/default.nix
@@ -1,8 +1,12 @@
-{ fetchurl, stdenv, gnum4, texinfo, texLive, automake }:
+{ fetchurl, stdenv, makeWrapper, gnum4, texinfo, texLive, automake }:
 
 let
   version = "9.1.1";
   bootstrapFromC = ! (stdenv.isi686 || stdenv.isx86_64);
+
+  arch = if      stdenv.isi686   then "-i386"
+         else if stdenv.isx86_64 then "-x86-64"
+         else                         "";
 in
 stdenv.mkDerivation {
   name = "mit-scheme-${version}";
@@ -25,6 +29,11 @@ stdenv.mkDerivation {
       sha256 = "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j";
     };
 
+  configurePhase =
+    '' (cd src && ./configure)
+       (cd doc && ./configure)
+    '';
+
   buildPhase =
     '' cd src
        ${if bootstrapFromC
@@ -42,11 +51,16 @@ stdenv.mkDerivation {
     '';
 
   installPhase =
-    '' make install -C src
-       make install -C doc
+    '' make prefix=$out install -C src
+       make prefix=$out install -C doc
+    '';
+
+  fixupPhase =
+    '' wrapProgram $out/bin/mit-scheme${arch} --set MITSCHEME_LIBRARY_PATH \
+         $out/lib/mit-scheme${arch}
     '';
 
-  buildNativeInputs = [ gnum4 texinfo texLive automake ];
+  nativeBuildInputs = [ makeWrapper gnum4 texinfo texLive automake ];
 
   # XXX: The `check' target doesn't exist.
   doCheck = false;
diff --git a/pkgs/development/compilers/mono/default.nix b/pkgs/development/compilers/mono/default.nix
index 2f257fccc52..47b13700b8a 100644
--- a/pkgs/development/compilers/mono/default.nix
+++ b/pkgs/development/compilers/mono/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus}:
 
-stdenv.mkDerivation {
-  name = "mono-2.10.8.1";
+stdenv.mkDerivation rec {
+  name = "mono-2.11.4";
   src = fetchurl {
-    url = http://download.mono-project.com/sources/mono/mono-2.10.8.1.tar.gz;
-    sha256 = "0h4hdj99qg0nsg5260izwaybs59wysf7y399kffhg43fidpndz0x";
+    url = "http://download.mono-project.com/sources/mono/${name}.tar.bz2";
+    sha256 = "0wv8pnj02mq012sihx2scx0avyw51b5wb976wn7x86zda0vfcsnr";
   };
 
   buildInputs = [bison pkgconfig glib gettext perl libgdiplus];
@@ -23,7 +23,8 @@ stdenv.mkDerivation {
   # The file /nix/store/xxx-mono-2.4.2.1/lib/mscorlib.dll is an invalid CIL image
   dontStrip = true;
 
-  enableParallelBuilding = true;
+  # Parallel building doesn't work, as shows http://hydra.nixos.org/build/2983601
+  enableParallelBuilding = false;
 
   preBuild = "
     makeFlagsArray=(INSTALL=`type -tp install`)
diff --git a/pkgs/development/compilers/neko/default.nix b/pkgs/development/compilers/neko/default.nix
index 28a98fe1e25..0321ae1f60a 100644
--- a/pkgs/development/compilers/neko/default.nix
+++ b/pkgs/development/compilers/neko/default.nix
@@ -1,69 +1,44 @@
-{ composableDerivation, lib, fetchurl, mysql, apacheHttpd, zlib, sqlite
-, pcre, apr, gtk, boehmgc, pkgconfig, makeWrapper, sourceFromHead }:
+{ stdenv, fetchurl, boehmgc, zlib, sqlite, pcre }:
 
-let
+stdenv.mkDerivation rec {
+  name = "neko-${version}";
+  version = "2.0.0";
 
-  inherit (composableDerivation) edf wwf;
-
-  libs = [ mysql apacheHttpd zlib sqlite pcre apr gtk ];
-
-  includes = lib.concatMapStrings (x: ''"${x}/include",'' ) libs + ''"{gkt}/include/gtk-2.0",'';
-  
-in
-
-composableDerivation.composableDerivation {} ( fixed : {
-
-  name = "neko-cvs";
-
-  # REGION AUTO UPDATE:                        { name="neko"; type="cvs"; cvsRoot = ":pserver:anonymous@cvs.motion-twin.com:/cvsroot"; module = "neko"; groups = "haxe_group"; }
-  src = sourceFromHead "neko-F_16-06-48.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/neko-F_16-06-48.tar.gz"; sha256 = "e952582a26099b7a5568d0798839a6d349331510ffe6d7936b4537d60b6ccf26"; });
-  # END
+  src = fetchurl {
+    url = "http://nekovm.org/_media/neko-${version}.tar.gz";
+    sha256 = "1lcm1ahbklfpd5lnqjwmvyj2vr85jbq57hszk5jgq0x6yx6p3927";
+  };
 
-  # optionally remove apache mysql like gentoo does?
-  # they just remove libs/{apache,mod_neko}
-  buildInputs = [boehmgc pkgconfig makeWrapper] ++ libs;
-  # apr should be in apacheHttpd propagatedBuildInputs
+  prePatch = with stdenv.lib; let
+    libs = concatStringsSep "," (map (lib: "\"${lib}/include\"") buildInputs);
+  in ''
+    sed -i -e '/^search_includes/,/^}/c \
+      search_includes = function(_) { return $array(${libs}) }
+    ' src/tools/install.neko
+    sed -i -e '/allocated = strdup/s|"[^"]*"|"'"$out/lib/neko:$out/bin"'"|' \
+      vm/load.c
+    # temporarily, fixed in 1.8.3
+    sed -i -e 's/^#if defined(_64BITS)/& || defined(__x86_64__)/' vm/neko.h
+
+    for disabled_mod in mod_neko{,2} mod_tora{,2} mysql ui; do
+      sed -i -e '/^libs/,/^}/{/^\s*'"$disabled_mod"'\s*=>/,/^\s*}/d}' \
+        src/tools/install.neko
+    done
+  '';
 
-  preConfigure = ''
-    sed -i \
-      -e 's@"/usr/include",@${includes}@' \
-      src/tools/install.neko
-    sed -i "s@/usr/local@$out@" Makefile vm/load.c
-    # make sure that nekotools boot finds the neko executable and not our wrapper:
-    mkdir -p $out/{bin,lib}
+  makeFlags = "INSTALL_PREFIX=$(out)";
+  buildInputs = [ boehmgc zlib sqlite pcre ];
+  dontStrip = true;
 
-    sed -i "s@\"neko\"@\".neko-wrapped\"@" src/tools/nekoboot.neko
-    ln -s ./neko bin/.neko-wrapped
+  preInstall = ''
+    install -vd "$out/lib" "$out/bin"
   '';
 
-  inherit zlib;
-
-  meta = { 
-    description = "Neko is an high-level dynamicly typed programming language";
+  meta = {
+    description = "A high-level dynamically typed programming language";
     homepage = http://nekovm.org;
-    license = ["GPLv2" ];  # -> docs/license.txt
-    maintainers = [ lib.maintainers.marcweber ];
-    platforms = lib.platforms.linux;
+    license = stdenv.lib.licenses.lgpl21;
+    maintainers = [ stdenv.lib.maintainers.marcweber ];
+    platforms = stdenv.lib.platforms.linux;
   };
-
-  # if stripping was done neko and nekoc would be the same. ?!
-  dontStrip = 1;
-
-  # neko-wrapped: nekotools boot has to find it. So don't prefix wrapped executable by "."
-  postInstall = ''
-    for prog in nekotools nekoc; do
-      wrapProgram "$out/bin/$prog" \
-        --prefix "LD_LIBRARY_PATH" $out/lib/neko
-    done
-  
-    wrapProgram "$out/bin/neko" \
-      --prefix "LD_LIBRARY_PATH" $out/lib/neko
-
-    # create symlink so that nekotools boot finds not wrapped neko-wrapped executable
-    ln -s  ln -s ../../bin/.neko-wrapped $out/lib/neko
-  '';
-
-  # TODO make them optional and make them work 
-  patches = [ ./disable-modules.patch ];
-})
+}
diff --git a/pkgs/development/compilers/neko/disable-modules.patch b/pkgs/development/compilers/neko/disable-modules.patch
deleted file mode 100644
index d4d5a8eb30e..00000000000
--- a/pkgs/development/compilers/neko/disable-modules.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff --git a/src/tools/install.neko b/src/tools/install.neko
-index 4cffa5e..5702add 100644
---- a/src/tools/install.neko
-+++ b/src/tools/install.neko
-@@ -39,26 +39,6 @@ buffer_string = $loader.loadprim("std@buffer_string",1);
- // LIBS DATAS
- 
- libs = {
--	mod_neko => {
--		src => $array("../../vm/stats","mod_neko","cgi"),
--		inc => "httpd.h",
--		incname => "Apache 1.3.x"
--	},
--	mod_neko2 => {
--		src => $array("../../vm/stats","mod_neko","cgi"),
--		inc => $array("httpd.h","apr.h"),
--		incname => "Apache 2.2.x",
--		cflags => "-D_LARGEFILE64_SOURCE",
--		realdir => "mod_neko",
--		apache2 => true,
--	},
--	mysql => {
--		src => $array("mysql"),
--		inc => "mysql.h",
--		incname => "MySQL 4.+"
--		lib => "libmysqlclient_r.a",
--		lparams => "-lz -lssl"
--	},
- 	mysql5 => {
- 		src => $array("../common/sha1","../common/socket","my_proto/my_proto","my_proto/my_api","mysql"),
- 		inc => $array(),
-@@ -83,27 +63,6 @@ libs = {
- 		incname => "Sqlite 3",
- 		lparams => "-lsqlite3",
- 	},
--	ui => {
--		src => $array("ui"),
--		inc => switch system { "Mac" => "Carbon.h" default => "gtk/gtk.h" },
--		incname => switch system { "Mac" => "Carbon" default => "GTK+2.0" },
--		cflags => switch system { "Mac" => "" default => "`pkg-config --cflags gtk+-2.0`" },
--		lparams => switch system { "Mac" => "-framework Carbon" default => "`pkg-config --libs gtk+-2.0` -lgthread-2.0" },
--	},
--	mod_tora => {
--		src => $array("../common/socket","protocol","mod_tora"),
--		inc => "httpd.h",
--		incname => "Apache 1.3.x",
--		cflags => "-I../common",
--	},
--	mod_tora2 => {
--		src => $array("../common/socket","protocol","mod_tora"),
--		inc => $array("httpd.h","apr.h"),
--		incname => "Apache 2.2.x",
--		cflags => "-D_LARGEFILE64_SOURCE -I../common",
--		realdir => "mod_tora",
--		apache2 => true,
--	},
- }
- 
- // PLATFORM
diff --git a/pkgs/development/compilers/ocaml/3.12.1.nix b/pkgs/development/compilers/ocaml/3.12.1.nix
index a70ba649d1f..c719abc4abc 100644
--- a/pkgs/development/compilers/ocaml/3.12.1.nix
+++ b/pkgs/development/compilers/ocaml/3.12.1.nix
@@ -2,7 +2,7 @@
 
 let
    useX11 = !stdenv.isArm && !stdenv.isMips;
-   useNativeCompilers = !stdenv.isArm && !stdenv.isMips;
+   useNativeCompilers = !stdenv.isMips;
    inherit (stdenv.lib) optionals optionalString;
 in
 
diff --git a/pkgs/development/compilers/ocaml/4.00.0.nix b/pkgs/development/compilers/ocaml/4.00.1.nix
index da065356e85..d7c14e031b3 100644
--- a/pkgs/development/compilers/ocaml/4.00.0.nix
+++ b/pkgs/development/compilers/ocaml/4.00.1.nix
@@ -2,17 +2,17 @@
 
 let
    useX11 = !stdenv.isArm && !stdenv.isMips;
-   useNativeCompilers = !stdenv.isArm && !stdenv.isMips;
+   useNativeCompilers = !stdenv.isMips;
    inherit (stdenv.lib) optionals optionalString;
 in
 
 stdenv.mkDerivation rec {
   
-  name = "ocaml-4.00.0";
+  name = "ocaml-4.00.1";
   
   src = fetchurl {
     url = "http://caml.inria.fr/pub/distrib/ocaml-4.00/${name}.tar.bz2";
-    sha256 = "ec886d7bc587ce472fcbdf294feb4b1fa2d8e7ef78ab6a4e66551699435d5cd7";
+    sha256 = "33c3f4acff51685f5bfd7c260f066645e767d4e865877bf1613c176a77799951";
   };
 
   prefixKey = "-prefix ";
diff --git a/pkgs/development/compilers/ocaml/cvs.nix b/pkgs/development/compilers/ocaml/cvs.nix
deleted file mode 100644
index cc40ca9aac5..00000000000
--- a/pkgs/development/compilers/ocaml/cvs.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-args: with args;
-
-stdenv.mkDerivation (rec {
-  
-  name = "ocaml-cvs-2009-09-24";
-  
-  src = fetchcvs {
-    cvsRoot = ":pserver:anoncvs@camlcvs.inria.fr:/caml";
-    module = "ocaml";
-    date = "2009-09-24";
-    sha256 = "3909bffebc9ce36ca51711d7d95596cba94376ebb1975c6ed46b09c9892c3ef1";
-  };
-
-  prefixKey = "-prefix ";
-  configureFlags = ["-no-tk"];
-  buildFlags = "world" +
-    (if !stdenv.isArm then "bootstrap world.opt" else "");
-  buildInputs = [ncurses];
-  installTargets = "install" + (if !stdenv.isArm then "installopt" else "");
-  patchPhase = ''
-    CAT=$(type -tp cat)
-    sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
-  '';
-
-  meta = {
-    homepage = http://caml.inria.fr/ocaml;
-    license = "QPL, LGPL2 (library part)";
-    desctiption = "Most popular variant of the Caml language";
-  };
-
-})
diff --git a/pkgs/development/compilers/opa/default.nix b/pkgs/development/compilers/opa/default.nix
index 2a54b90dda9..68413e3e25d 100644
--- a/pkgs/development/compilers/opa/default.nix
+++ b/pkgs/development/compilers/opa/default.nix
@@ -48,13 +48,12 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Opa is a concise and elegant language for writing distributed web applications. Both client and server sides.";
+    description = "A concise and elegant language for writing distributed web applications";
     longDescription = ''
-    Opa is a new generation of web development platform that lets you write distributed
-    web applications using a single technology. Among the the many features of Opa are these:
-    Opa is concise, simple, concurrent, dynamically distributed, and secure.
+      Opa is a new generation of web development platform that lets you write distributed
+      web applications using a single technology. Among the the many features of Opa are these:
+      Opa is concise, simple, concurrent, dynamically distributed, and secure.
     '';
-
     homepage = http://opalang.org/;
     license = stdenv.lib.licenses.gpl3;
     maintainers = [ stdenv.lib.maintainers.kkallio ];
diff --git a/pkgs/development/compilers/opencxx/default.nix b/pkgs/development/compilers/opencxx/default.nix
index cf000cd3ea5..54eda51353f 100644
--- a/pkgs/development/compilers/opencxx/default.nix
+++ b/pkgs/development/compilers/opencxx/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libtool, gcc, patches ? []}:
+{ stdenv, fetchurl, libtool, gcc, patches ? []}:
 
 stdenv.mkDerivation {
   name = "opencxx-2.8";
diff --git a/pkgs/development/compilers/openjdk-darwin/default.nix b/pkgs/development/compilers/openjdk-darwin/default.nix
index cbd41033bfc..1e74acfae72 100644
--- a/pkgs/development/compilers/openjdk-darwin/default.nix
+++ b/pkgs/development/compilers/openjdk-darwin/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, ...}:
 
 stdenv.mkDerivation {
   name = "openjdk6-b16-24_apr_2009-r1";
diff --git a/pkgs/development/compilers/openjdk/bootstrap.nix b/pkgs/development/compilers/openjdk/bootstrap.nix
new file mode 100644
index 00000000000..2ac2eed117c
--- /dev/null
+++ b/pkgs/development/compilers/openjdk/bootstrap.nix
@@ -0,0 +1,21 @@
+{ runCommand, glibc, fetchurl }:
+
+let
+  # !!! These should be on nixos.org
+  src = if glibc.system == "x86_64-linux" then
+    fetchurl {
+      url = http://nixos.org/tarballs/openjdk-bootstrap-x86_64-linux-2012-08-24.tar.xz;
+      sha256 = "0gla9dxrfq2w1hvgsnn8jg8a60k27im6z43a6iidi0qmwa0wah32";
+    }
+  else if glibc.system == "i686-linux" then
+    fetchurl {
+      url = http://nixos.org/tarballs/openjdk-bootstrap-i686-linux-2012-08-24.tar.xz;
+      sha256 = "184wq212bycwbbq4ix8cc6jwjxkrqw9b01zb86q95kqpa8zy5206";
+    }
+  else throw "No bootstrap for system";
+in
+
+runCommand "openjdk-bootstrap" {} ''
+  xz -dc ${src} | sed "s/e*-glibc-[^/]*/$(basename ${glibc})/g" | tar xv
+  mv openjdk-bootstrap $out
+''
diff --git a/pkgs/development/compilers/openjdk/cppflags-include-fix.patch b/pkgs/development/compilers/openjdk/cppflags-include-fix.patch
index 36fa9054bc6..8931c122538 100644
--- a/pkgs/development/compilers/openjdk/cppflags-include-fix.patch
+++ b/pkgs/development/compilers/openjdk/cppflags-include-fix.patch
@@ -1,9 +1,9 @@
 diff -Naur openjdk-orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.gmk
---- openjdk-orig/jdk/make/sun/awt/mawt.gmk	2011-06-27 13:19:26.000000000 -0400
-+++ openjdk/jdk/make/sun/awt/mawt.gmk	2011-07-31 17:42:11.370026854 -0400
-@@ -223,12 +223,6 @@
-         -I$(PLATFORM_SRC)/native/$(PKGDIR) \
-         $(EVENT_MODEL)
+--- openjdk-orig/jdk/make/sun/awt/mawt.gmk	2012-08-28 19:13:16.000000000 -0400
++++ openjdk/jdk/make/sun/awt/mawt.gmk	2013-01-22 11:56:22.315418708 -0500
+@@ -234,12 +234,6 @@
+ endif # !HEADLESS
+ endif # PLATFORM
  
 -ifeq ($(PLATFORM), linux)
 -  # Checking for the X11/extensions headers at the additional location
@@ -11,6 +11,6 @@ diff -Naur openjdk-orig/jdk/make/sun/awt/mawt.gmk openjdk/jdk/make/sun/awt/mawt.
 -                        $(wildcard /usr/include/X11/extensions))
 -endif
 -
- ifeq ($(PLATFORM), solaris)
-   CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions
- endif
+ ifeq ($(PLATFORM), macosx))
+   CPPFLAGS += -I$(OPENWIN_HOME)/include/X11/extensions \
+               -I$(OPENWIN_HOME)/include 
diff --git a/pkgs/development/compilers/openjdk/default.nix b/pkgs/development/compilers/openjdk/default.nix
index cf85c1706a8..0be36379f33 100644
--- a/pkgs/development/compilers/openjdk/default.nix
+++ b/pkgs/development/compilers/openjdk/default.nix
@@ -17,37 +17,40 @@
 , libXrender
 , libXtst
 , libXi
+, libXinerama
+, libXcursor
+, fontconfig
 , cpio
+, cacert
 , jreOnly ? false
+, perl
 }:
 
-stdenv.mkDerivation rec {
-  name = "openj${if jreOnly then "re" else "dk"}-7b127";
-
-  src = fetchurl {
-    url = http://www.java.net/download/openjdk/jdk7/promoted/b147/openjdk-7-fcs-src-b147-27_jun_2011.zip;
-    sha256 = "1qhwlz9y5qmwmja4qnxg6sn3pgsg1i11fb9j41w8l26acyhk34rs";
-  };
+let
 
-  jaxws_src_name = "jdk7-jaxws2_2_4-b03-2011_05_27.zip";
+  /**
+   * The JRE libraries are in directories that depend on the CPU.
+   */
+  architecture =
+    if stdenv.system == "i686-linux" then
+      "i386"
+    else if stdenv.system == "x86_64-linux" then
+      "amd64"
+    else
+      throw "openjdk requires i686-linux or x86_64 linux";
 
-  jaxws_src = fetchurl {
-    url = "http://download.java.net/glassfish/components/jax-ws/openjdk/jdk7/${jaxws_src_name}";
-    sha256 = "1mpzgr9lnbf2p3x45npcniy47kbzi3hyqqbd4w3j63sxnxcp5bh5";
-  };
+  update = "6";
 
-  jaxp_src_name = "jaxp145_01.zip";
+  build = "24";
 
-  jaxp_src = fetchurl {
-    url = "http://download.java.net/jaxp/1.4.5/${jaxp_src_name}";
-    sha256 = "1js8m1a6lcn95byplmjjs1lja1maisyl6lgfjy1jx3lqi1hlr4n5";
-  };
+in
 
-  jaf_src_name = "jdk7-jaf-2010_08_19.zip";
+stdenv.mkDerivation rec {
+  name = "openj${if jreOnly then "re" else "dk"}-7u${update}b${build}";
 
-  jaf_src = fetchurl {
-    url = "http://java.net/downloads/jax-ws/JDK7/${jaf_src_name}";
-    sha256 = "17n0i5cgvfsd6ric70h3n7hr8aqnzd216gaq3603wrxlvggzxbp6";
+  src = fetchurl {
+    url = "http://www.java.net/download/openjdk/jdk7u6/promoted/b24/openjdk-7u6-fcs-src-b24-28_aug_2012.zip";
+    sha256 = "1x1iq8ga0hqqh0bpcmydzzy19757hknn2yvgzib85p7b7dx0vfx9";
   };
 
 #  outputs = [ "out" ] ++ stdenv.lib.optionals (! jreOnly) [ "jre" ];
@@ -67,15 +70,15 @@ stdenv.mkDerivation rec {
     libXrender
     libXtst
     libXi
+    libXinerama
+    libXcursor
+    fontconfig
+    perl
   ];
 
-  postUnpack = ''
-    mkdir -p drops
-    cp ${jaxp_src} drops/${jaxp_src_name}
-    cp ${jaxws_src} drops/${jaxws_src_name}
-    cp ${jaf_src} drops/${jaf_src_name}
-    export DROPS_PATH=$(pwd)/drops
+  NIX_LDFLAGS = "-lfontconfig -lXcursor -lXinerama";
 
+  postUnpack = ''
     sed -i -e "s@/usr/bin/test@${coreutils}/bin/test@" \
       -e "s@/bin/ls@${coreutils}/bin/ls@" \
       openjdk/hotspot/make/linux/makefiles/sa.make
@@ -89,8 +92,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./cppflags-include-fix.patch
-    ./printf-fix.patch
-    ./linux-version-check-fix.patch
+    ./no-crypto-restrictions.patch
   ];
 
   makeFlags = [
@@ -99,14 +101,13 @@ stdenv.mkDerivation rec {
     "FREETYPE_HEADERS_PATH=${freetype}/include"
     "FREETYPE_LIB_PATH=${freetype}/lib"
     "MILESTONE=release"
-    "BUILD_NUMBER=b127"
+    "BUILD_NUMBER=b${build}"
     "CUPS_HEADERS_PATH=${cups}/include"
     "USRBIN_PATH="
     "COMPILER_PATH="
     "DEVTOOLS_PATH="
     "UNIXCOMMAND_PATH="
     "BOOTDIR=${jdk}"
-    "DROPS_DIR=$(DROPS_PATH)"
   ];
 
   configurePhase = ''
@@ -116,6 +117,10 @@ stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p $out
     cp -av build/*/j2${if jreOnly then "re" else "sdk"}-image/* $out
+    pushd $out/${if ! jreOnly then "jre/" else ""}lib/security
+    rm cacerts
+    perl ${./generate-cacerts.pl} $out/bin/keytool ${cacert}/etc/ca-bundle.crt
+    popd
   '';
 #  '' + (if jreOnly then "" else ''
 #    if [ -z $jre ]; then
@@ -136,5 +141,6 @@ stdenv.mkDerivation rec {
 
     platforms = stdenv.lib.platforms.linux;
   };
-}
 
+  passthru = { inherit architecture; };
+}
diff --git a/pkgs/development/compilers/openjdk/generate-cacerts.pl b/pkgs/development/compilers/openjdk/generate-cacerts.pl
new file mode 100644
index 00000000000..3bdd42f7274
--- /dev/null
+++ b/pkgs/development/compilers/openjdk/generate-cacerts.pl
@@ -0,0 +1,366 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2007, 2008 Red Hat, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# generate-cacerts.pl generates a JKS keystore named 'cacerts' from
+# OpenSSL's certificate bundle using OpenJDK's keytool.
+
+# First extract each of OpenSSL's bundled certificates into its own
+# aliased filename.
+
+# Downloaded from http://cvs.fedoraproject.org/viewvc/rpms/ca-certificates/F-12/generate-cacerts.pl?revision=1.2
+# Check and prevention of duplicate aliases added by Vlastimil Babka <caster@gentoo.org>
+
+$file = $ARGV[1];
+open(CERTS, $file);
+@certs = <CERTS>;
+close(CERTS);
+
+$pem_file_count = 0;
+$in_cert_block = 0;
+$write_current_cert = 1;
+foreach $cert (@certs)
+{
+    if ($cert =~ /Issuer: /)
+    {
+        $_ = $cert;
+        if ($cert =~ /personal-freemail/)
+        {
+            $cert_alias = "thawtepersonalfreemailca";
+        }
+        elsif ($cert =~ /personal-basic/)
+        {
+            $cert_alias = "thawtepersonalbasicca";
+        }
+        elsif ($cert =~ /personal-premium/)
+        {
+            $cert_alias = "thawtepersonalpremiumca";
+        }
+        elsif ($cert =~ /server-certs/)
+        {
+            $cert_alias = "thawteserverca";
+        }
+        elsif ($cert =~ /premium-server/)
+        {
+            $cert_alias = "thawtepremiumserverca";
+        }
+        elsif ($cert =~ /Class 1 Public Primary Certification Authority$/)
+        {
+            $cert_alias = "verisignclass1ca";
+        }
+        elsif ($cert =~ /Class 1 Public Primary Certification Authority - G2/)
+        {
+            $cert_alias = "verisignclass1g2ca";
+        }
+        elsif ($cert =~
+               /VeriSign Class 1 Public Primary Certification Authority - G3/)
+        {
+            $cert_alias = "verisignclass1g3ca";
+        }
+        elsif ($cert =~ /Class 2 Public Primary Certification Authority$/)
+        {
+            $cert_alias = "verisignclass2ca";
+        }
+        elsif ($cert =~ /Class 2 Public Primary Certification Authority - G2/)
+        {
+            $cert_alias = "verisignclass2g2ca";
+        }
+        elsif ($cert =~
+               /VeriSign Class 2 Public Primary Certification Authority - G3/)
+        {
+            $cert_alias = "verisignclass2g3ca";
+        }
+        elsif ($cert =~ /Class 3 Public Primary Certification Authority$/)
+        {
+            $cert_alias = "verisignclass3ca";
+        }
+        # Version 1 of Class 3 Public Primary Certification Authority
+        # - G2 is added.  Version 3 is excluded.  See below.
+        elsif ($cert =~
+               /VeriSign Class 3 Public Primary Certification Authority - G3/)
+        {
+            $cert_alias = "verisignclass3g3ca";
+        }
+        elsif ($cert =~
+               /RSA Data Security.*Secure Server Certification Authority/)
+        {
+            $cert_alias = "verisignserverca";
+        }
+        elsif ($cert =~ /GTE CyberTrust Global Root/)
+        {
+            $cert_alias = "gtecybertrustglobalca";
+        }
+        elsif ($cert =~ /Baltimore CyberTrust Root/)
+        {
+            $cert_alias = "baltimorecybertrustca";
+        }
+        elsif ($cert =~ /www.entrust.net\/Client_CA_Info\/CPS/)
+        {
+            $cert_alias = "entrustclientca";
+        }
+        elsif ($cert =~ /www.entrust.net\/GCCA_CPS/)
+        {
+            $cert_alias = "entrustglobalclientca";
+        }
+        elsif ($cert =~ /www.entrust.net\/CPS_2048/)
+        {
+            $cert_alias = "entrust2048ca";
+        }
+        elsif ($cert =~ /www.entrust.net\/CPS /)
+        {
+            $cert_alias = "entrustsslca";
+        }
+        elsif ($cert =~ /www.entrust.net\/SSL_CPS/)
+        {
+            $cert_alias = "entrustgsslca";
+        }
+        elsif ($cert =~ /The Go Daddy Group/)
+        {
+            $cert_alias = "godaddyclass2ca";
+        }
+        elsif ($cert =~ /Starfield Class 2 Certification Authority/)
+        {
+            $cert_alias = "starfieldclass2ca";
+        }
+        elsif ($cert =~ /ValiCert Class 2 Policy Validation Authority/)
+        {
+            $cert_alias = "valicertclass2ca";
+        }
+        elsif ($cert =~ /GeoTrust Global CA$/)
+        {
+            $cert_alias = "geotrustglobalca";
+        }
+        elsif ($cert =~ /Equifax Secure Certificate Authority/)
+        {
+            $cert_alias = "equifaxsecureca";
+        }
+        elsif ($cert =~ /Equifax Secure eBusiness CA-1/)
+        {
+            $cert_alias = "equifaxsecureebusinessca1";
+        }
+        elsif ($cert =~ /Equifax Secure eBusiness CA-2/)
+        {
+            $cert_alias = "equifaxsecureebusinessca2";
+        }
+        elsif ($cert =~ /Equifax Secure Global eBusiness CA-1/)
+        {
+            $cert_alias = "equifaxsecureglobalebusinessca1";
+        }
+        elsif ($cert =~ /Sonera Class1 CA/)
+        {
+            $cert_alias = "soneraclass1ca";
+        }
+        elsif ($cert =~ /Sonera Class2 CA/)
+        {
+            $cert_alias = "soneraclass2ca";
+        }
+        elsif ($cert =~ /AAA Certificate Services/)
+        {
+            $cert_alias = "comodoaaaca";
+        }
+        elsif ($cert =~ /AddTrust Class 1 CA Root/)
+        {
+            $cert_alias = "addtrustclass1ca";
+        }
+        elsif ($cert =~ /AddTrust External CA Root/)
+        {
+            $cert_alias = "addtrustexternalca";
+        }
+        elsif ($cert =~ /AddTrust Qualified CA Root/)
+        {
+            $cert_alias = "addtrustqualifiedca";
+        }
+        elsif ($cert =~ /UTN-USERFirst-Hardware/)
+        {
+            $cert_alias = "utnuserfirsthardwareca";
+        }
+        elsif ($cert =~ /UTN-USERFirst-Client Authentication and Email/)
+        {
+            $cert_alias = "utnuserfirstclientauthemailca";
+        }
+        elsif ($cert =~ /UTN - DATACorp SGC/)
+        {
+            $cert_alias = "utndatacorpsgcca";
+        }
+        elsif ($cert =~ /UTN-USERFirst-Object/)
+        {
+            $cert_alias = "utnuserfirstobjectca";
+        }
+        elsif ($cert =~ /America Online Root Certification Authority 1/)
+        {
+            $cert_alias = "aolrootca1";
+        }
+        elsif ($cert =~ /DigiCert Assured ID Root CA/)
+        {
+            $cert_alias = "digicertassuredidrootca";
+        }
+        elsif ($cert =~ /DigiCert Global Root CA/)
+        {
+            $cert_alias = "digicertglobalrootca";
+        }
+        elsif ($cert =~ /DigiCert High Assurance EV Root CA/)
+        {
+            $cert_alias = "digicerthighassuranceevrootca";
+        }
+        elsif ($cert =~ /GlobalSign Root CA$/)
+        {
+            $cert_alias = "globalsignca";
+        }
+        elsif ($cert =~ /GlobalSign Root CA - R2/)
+        {
+            $cert_alias = "globalsignr2ca";
+        }
+        elsif ($cert =~ /Elektronik.*Kas.*2005/)
+        {
+            $cert_alias = "extra-elektronikkas2005";
+        }
+        elsif ($cert =~ /Elektronik/)
+        {
+            $cert_alias = "extra-elektronik2005";
+        }
+        # Mozilla does not provide these certificates:
+        #   baltimorecodesigningca
+        #   gtecybertrust5ca
+        #   trustcenterclass2caii
+        #   trustcenterclass4caii
+        #   trustcenteruniversalcai
+        else
+        {
+            # Generate an alias using the OU and CN attributes of the
+            # Issuer field if both are present, otherwise use only the
+            # CN attribute.  The Issuer field must have either the OU
+            # or the CN attribute.
+            $_ = $cert;
+            if ($cert =~ /OU=/)
+            {
+                s/Issuer:.*?OU=//;
+                # Remove other occurrences of OU=.
+                s/OU=.*CN=//;
+                # Remove CN= if there were not other occurrences of OU=.
+                s/CN=//;
+                s/\/emailAddress.*//;
+                s/Certificate Authority/ca/g;
+                s/Certification Authority/ca/g;
+            }
+            elsif ($cert =~ /CN=/)
+            {
+                s/Issuer:.*CN=//;
+                s/\/emailAddress.*//;
+                s/Certificate Authority/ca/g;
+                s/Certification Authority/ca/g;
+            }
+            s/\W//g;
+            tr/A-Z/a-z/;
+            $cert_alias = "extra-$_";
+
+        }
+        while (-e "$cert_alias.pem")
+        {
+            $cert_alias = "$cert_alias" . "_";
+        }
+    }
+    # When it attempts to parse:
+    #
+    # Class 3 Public Primary Certification Authority - G2, Version 3
+    #
+    # keytool says:
+    #
+    # #2: ObjectId: 1.3.6.1.5.5.7.1.1 Criticality=false
+    # Unparseable AuthorityInfoAccess extension due to
+    # java.io.IOException: Invalid encoding of URI
+    #
+    # If we do not exclude this file
+    # openjdk/jdk/test/lib/security/cacerts/VerifyCACerts.java fails
+    # on this cert, printing:
+    #
+    # Couldn't verify: java.security.SignatureException: Signature
+    # does not match.
+    #
+    elsif ($cert =~
+           /A6:0F:34:C8:62:6C:81:F6:8B:F7:7D:A9:F6:67:58:8A:90:3F:7D:36/)
+    {
+        $write_current_cert = 0;
+        $pem_file_count--;
+    }
+    elsif ($cert eq "-----BEGIN CERTIFICATE-----\n")
+    {
+        $_ = $cert;
+        s/\W//g;
+        tr/A-Z/a-z/;
+        $cert_alias = "extra-$_";
+        while (-e "$cert_alias.pem")
+        {
+            $cert_alias = "$cert_alias" . "_";
+        }
+        if ($in_cert_block != 0)
+        {
+            die "$file is malformed.";
+        }
+        $in_cert_block = 1;
+        if ($write_current_cert == 1)
+        {
+            $pem_file_count++;
+            if (-e "$cert_alias.pem")
+            {
+                print "$cert_alias";
+                die "already exists"
+            }
+            open(PEM, ">$cert_alias.pem");
+            print PEM $cert;
+        }
+    }
+    elsif ($cert eq "-----END CERTIFICATE-----\n")
+    {
+        $in_cert_block = 0;
+        if ($write_current_cert == 1)
+        {
+            print PEM $cert;
+            close(PEM);
+        }
+        $write_current_cert = 1
+    }
+    else
+    {
+        if ($in_cert_block == 1 && $write_current_cert == 1)
+        {
+            print PEM $cert;
+        }
+    }
+}
+
+# Check that the correct number of .pem files were produced.
+@pem_files = <*.pem>;
+if (@pem_files != $pem_file_count)
+{
+    print "$pem_file_count";
+    die "Number of .pem files produced does not match".
+        " number of certs read from $file.";
+}
+
+# Now store each cert in the 'cacerts' file using keytool.
+$certs_written_count = 0;
+foreach $pem_file (@pem_files)
+{
+    system "$ARGV[0] -noprompt -import".
+        " -alias `basename $pem_file .pem`".
+        " -keystore cacerts -storepass 'changeit' -file $pem_file";
+    unlink($pem_file);
+    $certs_written_count++;
+}
+
+# Check that the correct number of certs were added to the keystore.
+if ($certs_written_count != $pem_file_count)
+{
+    die "Number of certs added to keystore does not match".
+        " number of certs read from $file.";
+}
diff --git a/pkgs/development/compilers/openjdk/linux-version-check-fix.patch b/pkgs/development/compilers/openjdk/linux-version-check-fix.patch
deleted file mode 100644
index 9d749a198e3..00000000000
--- a/pkgs/development/compilers/openjdk/linux-version-check-fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur openjdk-orig/hotspot/make/linux/Makefile openjdk/hotspot/make/linux/Makefile
---- openjdk-orig/hotspot/make/linux/Makefile	2011-06-27 12:10:07.000000000 -0400
-+++ openjdk/hotspot/make/linux/Makefile	2011-08-10 20:08:40.879752771 -0400
-@@ -230,7 +230,7 @@
- # Solaris 2.5.1, 2.6).
- # Disable this check by setting DISABLE_HOTSPOT_OS_VERSION_CHECK=ok.
- 
--SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7%
-+SUPPORTED_OS_VERSION = 2.4% 2.5% 2.6% 2.7% 3%
- OS_VERSION := $(shell uname -r)
- EMPTY_IF_NOT_SUPPORTED = $(filter $(SUPPORTED_OS_VERSION),$(OS_VERSION))
- 
diff --git a/pkgs/development/compilers/openjdk/make-bootstrap.nix b/pkgs/development/compilers/openjdk/make-bootstrap.nix
new file mode 100644
index 00000000000..090a1479741
--- /dev/null
+++ b/pkgs/development/compilers/openjdk/make-bootstrap.nix
@@ -0,0 +1,26 @@
+{ runCommand, openjdk, nukeReferences }:
+
+let arch = openjdk.architecture; in
+
+runCommand "${openjdk.name}-bootstrap.tar.xz" {} ''
+  mkdir -p openjdk-bootstrap/bin
+  mkdir -p openjdk-bootstrap/lib
+  mkdir -p openjdk-bootstrap/jre/lib/{security,ext,${arch}/{jli,server,client,headless}}
+  cp ${openjdk}/bin/{idlj,ja{va{,c,p,h},r},rmic} openjdk-bootstrap/bin
+  cp ${openjdk}/lib/tools.jar openjdk-bootstrap/lib
+  cp ${openjdk}/jre/lib/{meta-index,{charsets,jce,jsse,rt,resources}.jar,currency.data} openjdk-bootstrap/jre/lib
+  cp ${openjdk}/jre/lib/security/java.security openjdk-bootstrap/jre/lib/security
+  cp ${openjdk}/jre/lib/ext/{meta-index,sunjce_provider.jar} openjdk-bootstrap/jre/lib/ext
+  cp ${openjdk}/jre/lib/${arch}/{jvm.cfg,lib{awt,java,verify,zip,nio,net}.so} openjdk-bootstrap/jre/lib/${arch}
+  cp ${openjdk}/jre/lib/${arch}/jli/libjli.so openjdk-bootstrap/jre/lib/${arch}/jli
+  cp ${openjdk}/jre/lib/${arch}/server/libjvm.so openjdk-bootstrap/jre/lib/${arch}/server
+  cp ${openjdk}/jre/lib/${arch}/client/libjvm.so openjdk-bootstrap/jre/lib/${arch}/client ||
+    rmdir openjdk-bootstrap/jre/lib/${arch}/client
+  cp ${openjdk}/jre/lib/${arch}/headless/libmawt.so openjdk-bootstrap/jre/lib/${arch}/headless
+  cp -a ${openjdk}/include openjdk-bootstrap
+
+  chmod -R +w openjdk-bootstrap
+  find openjdk-bootstrap -print0 | xargs -0 ${nukeReferences}/bin/nuke-refs
+
+  tar cv openjdk-bootstrap | xz > $out
+''
diff --git a/pkgs/development/compilers/openjdk/no-crypto-restrictions.patch b/pkgs/development/compilers/openjdk/no-crypto-restrictions.patch
new file mode 100644
index 00000000000..427ef353466
--- /dev/null
+++ b/pkgs/development/compilers/openjdk/no-crypto-restrictions.patch
@@ -0,0 +1,12 @@
+diff -Naur openjdk-orig/jdk/make/javax/crypto/Makefile openjdk/jdk/make/javax/crypto/Makefile
+--- openjdk-orig/jdk/make/javax/crypto/Makefile	2011-06-27 13:18:45.000000000 -0400
++++ openjdk/jdk/make/javax/crypto/Makefile	2012-11-08 14:12:01.360718616 -0500
+@@ -156,7 +156,7 @@
+ #
+ 
+ ifdef OPENJDK
+-all: build-jar install-jar build-policy install-limited
++all: build-jar install-jar build-policy install-unlimited
+ else  # OPENJDK
+ ifeq ($(strip $(FILES_java)),)
+ all:
diff --git a/pkgs/development/compilers/openjdk/printf-fix.patch b/pkgs/development/compilers/openjdk/printf-fix.patch
deleted file mode 100644
index 3d66962a119..00000000000
--- a/pkgs/development/compilers/openjdk/printf-fix.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -Naur openjdk-orig/make/Defs-internal.gmk openjdk/make/Defs-internal.gmk
---- openjdk-orig/make/Defs-internal.gmk	2011-06-27 11:44:06.000000000 -0400
-+++ openjdk/make/Defs-internal.gmk	2011-07-31 18:30:15.784506762 -0400
-@@ -79,7 +79,7 @@
- # Find all build_time_* files and print their contents in a list sorted
- # on the name of the sub repository.
- define ReportBuildTimes
--$(PRINTF) "-- Build times ----------\nTarget %s\nStart %s\nEnd   %s\n%s\n%s\n-------------------------\n" \
-+$(PRINTF) -- "-- Build times ----------\nTarget %s\nStart %s\nEnd   %s\n%s\n%s\n-------------------------\n" \
- $1 \
- "`$(CAT) $(BUILDTIMESDIR)/build_time_start_TOTAL_human_readable`" \
- "`$(CAT) $(BUILDTIMESDIR)/build_time_end_TOTAL_human_readable`" \
diff --git a/pkgs/development/compilers/pakcs/adjust-buildsystem.patch b/pkgs/development/compilers/pakcs/adjust-buildsystem.patch
new file mode 100644
index 00000000000..4de7683dcdd
--- /dev/null
+++ b/pkgs/development/compilers/pakcs/adjust-buildsystem.patch
@@ -0,0 +1,44 @@
+diff -Naur pakcs-1.11.2-upstream/Makefile pakcs-1.11.2/Makefile
+--- pakcs-1.11.2-upstream/Makefile	2013-03-21 04:58:38.000000000 -0430
++++ pakcs-1.11.2/Makefile	2013-05-09 15:04:48.035646127 -0430
+@@ -55,7 +55,6 @@
+ #
+ .PHONY: install
+ install: installscripts
+-	$(MAKE) frontend
+ 	# pre-compile all libraries:
+ 	@cd lib && $(MAKE) fcy
+ 	# install the Curry2Prolog compiler as a saved system:
+@@ -66,11 +65,6 @@
+ 	@cd lib && $(MAKE) acy
+ 	# prepare for separate compilation by compiling all librariers to Prolog code:
+ 	@if [ -r bin/pakcs ] ; then cd lib && $(MAKE) pl ; fi
+-	# compile the Curry Port Name Server demon:
+-	@if [ -r bin/pakcs ] ; then cd cpns && $(MAKE) ; fi
+-	# compile the event handler demon for dynamic web pages:
+-	@if [ -r bin/pakcs ] ; then cd www && $(MAKE) ; fi
+-	$(MAKE) tools
+ 	$(MAKE) docs
+ 	chmod -R go+rX .
+ 
+diff -Naur pakcs-1.11.2-upstream/scripts/pakcs.sh pakcs-1.11.2/scripts/pakcs.sh
+--- pakcs-1.11.2-upstream/scripts/pakcs.sh	2013-03-21 04:52:59.000000000 -0430
++++ pakcs-1.11.2/scripts/pakcs.sh	2013-05-09 03:14:23.500876628 -0430
+@@ -16,7 +16,7 @@
+ # use readline wrapper rlwrap if it is installed and we have tty as stdin:
+ USERLWRAP=no
+ if tty -s ; then
+-  RLWRAP=`which rlwrap`
++  RLWRAP=`type -P rlwrap`
+   if [ -x "$RLWRAP" ] ; then
+     USERLWRAP=yes
+   fi
+@@ -29,7 +29,7 @@
+ done
+ 
+ if [ $USERLWRAP = yes ] ; then
+-  exec rlwrap -c -f "$PAKCSHOME/tools/rlwrap" "$REPL" ${1+"$@"}
++  exec rlwrap -a -c -f "$PAKCSHOME/tools/rlwrap" "$REPL" ${1+"$@"}
+ else
+   exec "$REPL" ${1+"$@"}
+ fi
diff --git a/pkgs/development/compilers/pakcs/default.nix b/pkgs/development/compilers/pakcs/default.nix
index 35771f6691f..bb4657d8aff 100644
--- a/pkgs/development/compilers/pakcs/default.nix
+++ b/pkgs/development/compilers/pakcs/default.nix
@@ -1,67 +1,106 @@
-{ stdenv, fetchurl, ghc, swiProlog, syb, mtl, makeWrapper, rlwrap, tk }:
+{ stdenv, fetchurl, cabal, swiProlog, mtl, syb, makeWrapper, rlwrap, tk }:
 
-stdenv.mkDerivation {
-  name = "pakcs-1.10.0";
+let
+  fname = "pakcs-1.11.2";
 
-  src = fetchurl {
-    url = "http://www.informatik.uni-kiel.de/~pakcs/download/pakcs_src.tar.gz";
-    sha256 = "6a4a45c9f3d0b61cfec8414943c2a852bec3665a7e2638b039193dd43e9802c4";
+  fsrc = fetchurl {
+    url = "http://www.informatik.uni-kiel.de/~pakcs/download/${fname}-src.tar.gz";
+    sha256 = "1x23kn91v44my4rd8j3247pj8i2myz82rzgbq07asi1x21bpvvmy";
   };
 
-  buildInputs = [ ghc swiProlog syb mtl makeWrapper rlwrap tk ];
+in
+stdenv.mkDerivation rec {
 
-  prePatch = ''
-    # Remove copying pakcsrc into $HOME.
-    sed -i '/update-pakcsrc/d' Makefile
+  name = fname;
 
-    # Remove copying pakcsinitrc into $HOME
-    sed -i '68d' configure-pakcs
-  '';
+  curryBase = cabal.mkDerivation(self: {
+    pname = "curryBase";
+    version = "local";
+    src = fsrc;
+    sourceRoot = "${name}/frontend/curry-base";
+    isLibrary = true;
+    buildDepends = [ mtl syb ];
+  });
+
+  curryFront = cabal.mkDerivation(self: {
+    pname = "curryFront";
+    version = "local";
+    src = fsrc;
+    sourceRoot = "${name}/frontend/curry-frontend";
+    isLibrary = true;
+    isExecutable = true;
+    buildDepends = [ mtl syb curryBase ];
+  });
+
+  src = fsrc;
+
+  buildInputs = [ swiProlog makeWrapper rlwrap tk ];
+
+  patches = [ ./adjust-buildsystem.patch ];
 
-  patches = [ ./pakcs-ghc741.patch ];
+  configurePhase = ''
+    # Phony HOME.
+    mkdir phony-home
+    export HOME=$(pwd)/phony-home
 
-  preConfigure = ''
-    # Path to GHC and SWI Prolog
-    sed -i 's@GHC=@GHC=${ghc}/bin/ghc@' bin/.pakcs_variables
-    sed -i 's@SWIPROLOG=@SWIPROLOG=${swiProlog}/bin/swipl@' bin/.pakcs_variables
+    # SWI Prolog
+    sed -i 's@SWIPROLOG=@SWIPROLOG='${swiProlog}/bin/swipl'@' pakcsinitrc
   '';
 
-  postInstall = ''
-    cp pakcsrc $out/
-    cp update-pakcsrc $out/
-    cp -r bin/ $out/
-    cp -r cpns/ $out/
-    cp -r curry2prolog/ $out/
-    cp -r docs/ $out/
-    cp -r examples/ $out/
-    cp -r include/ $out/
-    cp -r lib/ $out/
-    cp -r mccparser/ $out/
-    cp -r tools/ $out/
-    cp -r www/ $out/
-
-    # The Prolog sources must be built in their final directory.
-    (cd $out/curry2prolog/ ; make)
-
-    mkdir -p $out/share/emacs/site-lisp/curry-pakcs
-    for e in "$out/tools/emacs/"*.el ; do
-      ln -s $e $out/share/emacs/site-lisp/curry-pakcs/;
-    done
+  preBuild = ''
+    # Set up link to cymake, which has been built already.
+    ensureDir bin/.local
+    ln -s ${curryFront}/bin/cymake bin/.local/
+  '';
 
-    sed -i 's@which@type -P@' $out/bin/.pakcs_wrapper
+  installPhase = ''
+    # Prepare PAKCSHOME directory.
+    ensureDir $out/pakcs
+    for d in bin curry2prolog currytools lib tools cpns include www examples docs ; do
+      cp -r $d $out/pakcs ;
+    done
+    cp pakcsrc.default $out/pakcs
+    cp pakcsinitrc $out/pakcs
+
+    # Fixing PAKCSHOME and related paths.
+    sed -i 's@PAKCSHOME=/tmp/.*@PAKCSHOME='$out/pakcs'@' $out/pakcs/bin/{pakcs,makecurrycgi,parsecurry,.makesavedstate}
+
+    # Fix symbolic links into the tmp build dir.
+    ln -s ../currytools/CASS/cass $out/pakcs/bin/cass
+    ln -s ../currytools/currydoc/CurryDoc $out/pakcs/bin/currydoc
+
+    # The Prolog sources must be rebuilt in their final directory,
+    # to switch the embedded references to the tmp build directory.
+    export TEMP=/tmp
+    (cd $out/pakcs/curry2prolog/ ; rm c2p.state ; make)
+    cp Makefile $out/pakcs
+    (cd $out/pakcs ; make tools)
+    (cd $out/pakcs/cpns ; make)
+    (cd $out/pakcs/www ; make)
+
+    # Install bin.
+    ensureDir $out/bin
+    for b in makecurrycgi .makesavedstate pakcs parsecurry cleancurry \
+             addtypes cass currybrowse currycreatemake currydoc currytest \
+             dataToXml erd2curry ; do
+      ln -s $out/pakcs/bin/$b $out/bin/ ;
+    done
 
-    # Get the program name from the environment instead of the calling wrapper (for rlwrap).
-    sed -i 's@progname=`basename "$0"`@progname=$PAKCS_PROGNAME@' $out/bin/.pakcs_wrapper
+    # Place emacs lisp files in expected locations.
+    ensureDir $out/share/emacs/site-lisp/curry-pakcs
+    for e in "tools/emacs/"*.el ; do
+      cp $e $out/share/emacs/site-lisp/curry-pakcs/ ;
+    done
 
-    wrapProgram $out/bin/.pakcs_wrapper \
+    # Wrap for rlwrap and tk support.
+    wrapProgram $out/pakcs/bin/pakcs \
       --prefix PATH ":" "${rlwrap}/bin" \
       --prefix PATH ":" "${tk}/bin" \
-      --run 'export PAKCS_PROGNAME=`basename "$0"`'
   '';
 
   meta = {
     homepage = "http://www.informatik.uni-kiel.de/~pakcs/";
-    description = "an implementation of the multi-paradigm declarative language Curry";
+    description = "An implementation of the multi-paradigm declarative language Curry";
     license = stdenv.lib.licenses.bsd3;
 
     longDescription = ''
@@ -76,7 +115,7 @@ stdenv.mkDerivation {
       with dynamic web pages, prototyping embedded systems).
     '';
 
-    maintainers = [ stdenv.lib.maintainers.kkallio stdenv.lib.maintainers.simons ];
+    maintainers = [ stdenv.lib.maintainers.kkallio ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/compilers/pakcs/pakcs-ghc741.patch b/pkgs/development/compilers/pakcs/pakcs-ghc741.patch
deleted file mode 100644
index 439cb787d67..00000000000
--- a/pkgs/development/compilers/pakcs/pakcs-ghc741.patch
+++ /dev/null
@@ -1,1004 +0,0 @@
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/AbstractCurry.hs pakcs-new/mccparser/src/AbstractCurry.hs
---- pakcs/mccparser/src/AbstractCurry.hs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/AbstractCurry.hs	2012-06-10 23:41:02.278126416 -0430
-@@ -29,7 +29,7 @@
-                       readCurry, writeCurry) where
- 
- import PathUtils (writeModule,readModule)
--import List(intersperse)
-+import Data.List(intersperse)
- 
- ------------------------------------------------------------------------------
- -- Definition of data types for representing abstract Curry programs:
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/AnsiCodes.hs pakcs-new/mccparser/src/AnsiCodes.hs
---- pakcs/mccparser/src/AnsiCodes.hs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/AnsiCodes.hs	2012-06-10 23:41:02.278126416 -0430
-@@ -27,8 +27,8 @@
- 
-   )  where
- 
--import Char
--import List
-+import Data.Char
-+import Data.List
- 
- -- escape character
- esc = chr 27
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Base.lhs pakcs-new/mccparser/src/Base.lhs
---- pakcs/mccparser/src/Base.lhs	2011-11-14 09:23:07.000000000 -0430
-+++ pakcs-new/mccparser/src/Base.lhs	2012-06-10 23:41:02.302127057 -0430
-@@ -22,12 +22,12 @@
- > import FlatWithSrcRefs hiding (SrcRef, Fixity(..), TypeExpr, Expr(..))
- > import Env
- > import TopEnv
--> import List
-+> import Data.List
- > import Map
--> import Monad
-+> import Control.Monad
- > import Set
- > import Utils
--> import Maybe
-+> import Data.Maybe
- 
- > import qualified FlatWithSrcRefs (Fixity(..), TypeExpr)
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Cam.lhs pakcs-new/mccparser/src/Cam.lhs
---- pakcs/mccparser/src/Cam.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/Cam.lhs	2012-06-10 23:41:02.302127057 -0430
-@@ -10,7 +10,7 @@
- \begin{verbatim}
- 
- > module Cam where
--> import Char
-+> import Data.Char
- 
- \end{verbatim}
- An abstract machine code module consists of a list of import, data,
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CamPP.lhs pakcs-new/mccparser/src/CamPP.lhs
---- pakcs/mccparser/src/CamPP.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CamPP.lhs	2012-06-10 23:41:02.303127084 -0430
-@@ -9,7 +9,7 @@
- 
- > module CamPP where
- > import Cam
--> import Char
-+> import Data.Char
- > import Pretty
- 
- > default(Int)
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CaseCompletion.hs pakcs-new/mccparser/src/CaseCompletion.hs
---- pakcs/mccparser/src/CaseCompletion.hs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/CaseCompletion.hs	2012-06-10 23:41:02.280126456 -0430
-@@ -21,7 +21,7 @@
- import Position (SrcRef)
- import OldScopeEnv as ScopeEnv
- import ILScope
--import Maybe
-+import Data.Maybe
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CCode.lhs pakcs-new/mccparser/src/CCode.lhs
---- pakcs/mccparser/src/CCode.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CCode.lhs	2012-06-10 23:41:02.303127084 -0430
-@@ -15,8 +15,8 @@
- \begin{verbatim}
- 
- > module CCode where
--> import List
--> import Maybe
-+> import Data.List
-+> import Data.Maybe
- > infixl 9 `CElem`,`CField`
- > infixr 8 `CCast`
- > infixl 7 `CMul`,`CDiv`,`CMod`
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CGen.lhs pakcs-new/mccparser/src/CGen.lhs
---- pakcs/mccparser/src/CGen.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CGen.lhs	2012-06-10 23:41:02.306127165 -0430
-@@ -13,10 +13,10 @@
- > import CCode
- > import CPS
- > import CElim
--> import Char
--> import List
-+> import Data.Char
-+> import Data.List
- > import Map
--> import Maybe
-+> import Data.Maybe
- > import Set
- > import Utils
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Combined.lhs pakcs-new/mccparser/src/Combined.lhs
---- pakcs/mccparser/src/Combined.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/Combined.lhs	2012-06-10 23:41:02.306127165 -0430
-@@ -19,8 +19,8 @@
- 
- > module Combined where
- > import Error
--> import Monad
--> import IO
-+> import Control.Monad
-+> import System.IO
- > import IORefCompat
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/config.hs pakcs-new/mccparser/src/config.hs
---- pakcs/mccparser/src/config.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/config.hs	2012-06-10 23:41:02.280126456 -0430
-@@ -9,9 +9,9 @@
- -- Martin Engelke (men@informatik.uni-kiel.de)
- --
- 
--import Time
--import System
--import Directory
-+import System.Time
-+import System.Cmd
-+import System.Directory
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CPretty.lhs pakcs-new/mccparser/src/CPretty.lhs
---- pakcs/mccparser/src/CPretty.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CPretty.lhs	2012-06-10 23:41:02.307127192 -0430
-@@ -18,7 +18,7 @@
- 
- > import CCode
- > import Pretty
--> import List
-+> import Data.List
- 
- > ppCFile :: CFile -> Doc
- > ppCFile = vsep . map ppTopDecl
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CPS.lhs pakcs-new/mccparser/src/CPS.lhs
---- pakcs/mccparser/src/CPS.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CPS.lhs	2012-06-10 23:41:02.308127219 -0430
-@@ -12,7 +12,7 @@
- >            cpsFunction, cpsApply, cpsVars, fromCaseBlock, caseBlockTag,
- >            fresh) where
- > import Cam
--> import List
-+> import Data.List
- > import Set
- > import SCC
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryBuilder.hs pakcs-new/mccparser/src/CurryBuilder.hs
---- pakcs/mccparser/src/CurryBuilder.hs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryBuilder.hs	2012-06-10 23:46:43.708361686 -0430
-@@ -18,13 +18,13 @@
- import Ident
- import PathUtils
- import Env
--import System
--import Directory
--import Time
--import Monad
--import Maybe
--import List
--import IO
-+import System.Directory
-+import System.Exit
-+import System.Time
-+import Control.Monad
-+import Data.Maybe
-+import Data.List
-+import System.IO
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryCompiler.hs pakcs-new/mccparser/src/CurryCompiler.hs
---- pakcs/mccparser/src/CurryCompiler.hs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryCompiler.hs	2012-06-10 23:46:11.828499672 -0430
-@@ -13,8 +13,8 @@
- import CurryCompilerOpts
- import CompilerResults
- import Modules
--import System
--import IO
-+import System.Exit
-+import System.IO
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryDeps.lhs pakcs-new/mccparser/src/CurryDeps.lhs
---- pakcs/mccparser/src/CurryDeps.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryDeps.lhs	2012-06-10 23:41:02.309127246 -0430
-@@ -20,11 +20,11 @@
- > import CurryParser(parseHeader)
- > import SCC
- > import Env
--> import List
--> import Maybe
--> import Monad
-+> import Data.List
-+> import Data.Maybe
-+> import Control.Monad
- > import Error
--> import IO
-+> import System.IO
- > import PathUtils
- 
- > data Source = Source FilePath [ModuleIdent]
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryEnv.hs pakcs-new/mccparser/src/CurryEnv.hs
---- pakcs/mccparser/src/CurryEnv.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryEnv.hs	2012-06-10 23:41:02.283126538 -0430
-@@ -15,7 +15,7 @@
- import Ident
- import Base
- import Env
--import Maybe
-+import Data.Maybe
- 
- ------------------------------------------------------------------------------
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryHtml.hs pakcs-new/mccparser/src/CurryHtml.hs
---- pakcs/mccparser/src/CurryHtml.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryHtml.hs	2012-06-10 23:48:58.040993372 -0430
-@@ -2,8 +2,8 @@
- 
- import SyntaxColoring
- import Ident
--import Maybe
--import Char
-+import Data.Maybe
-+import Data.Char hiding (Space)
- import System.Environment
- import CurryDeps(getCurryPath)
- import PathUtils (writeModule)
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurryLexer.lhs pakcs-new/mccparser/src/CurryLexer.lhs
---- pakcs/mccparser/src/CurryLexer.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CurryLexer.lhs	2012-06-10 23:41:02.310127273 -0430
-@@ -15,8 +15,8 @@
- > import LexComb
- > import Position
- > import Map
--> import Char 
--> import List
-+> import Data.Char 
-+> import Data.List
- 
- \end{verbatim}
- \paragraph{Tokens} Note that the equality and ordering instances of
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurrySubdir.hs pakcs-new/mccparser/src/CurrySubdir.hs
---- pakcs/mccparser/src/CurrySubdir.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/CurrySubdir.hs	2012-06-10 23:41:02.283126538 -0430
-@@ -1,9 +1,9 @@
- module CurrySubdir where
- 
--import Directory
-+import System.Directory
- import System.Time (ClockTime)
- import Control.Monad (when)
--import List(intersperse)
-+import Data.List(intersperse)
- 
- -- some definitions from PathUtils
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/CurrySyntaxTools.lhs pakcs-new/mccparser/src/CurrySyntaxTools.lhs
---- pakcs/mccparser/src/CurrySyntaxTools.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/CurrySyntaxTools.lhs	2012-06-10 23:41:02.314127381 -0430
-@@ -2,7 +2,7 @@
- 
- > import CurrySyntax
- > import Ident
--> import Maybe
-+> import Data.Maybe
- 
- >------------------------------------------------------------------------------
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/cycc.hs pakcs-new/mccparser/src/cycc.hs
---- pakcs/mccparser/src/cycc.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/cycc.hs	2012-06-10 23:41:02.283126538 -0430
-@@ -7,9 +7,9 @@
- import PathUtils
- import Options
- import GetOpt
--import Maybe
--import IO
--import System
-+import Data.Maybe
-+import System.IO
-+import System.Cmd
- 
- main :: IO ()
- main =
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/cymake.hs pakcs-new/mccparser/src/cymake.hs
---- pakcs/mccparser/src/cymake.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/cymake.hs	2012-06-10 23:50:08.306892587 -0430
-@@ -14,13 +14,14 @@
- import GetOpt
- import CurryBuilder
- import CurryBuilderOpts
--import System
--import Maybe
--import IO
-+import System.Environment
-+import System.Exit
-+import Data.Maybe
-+import System.IO
- import CurryHtml
--import List
-+import Data.List
- import Control.Monad (unless)
--import Char (isDigit)
-+import Data.Char (isDigit)
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/cymk.hs pakcs-new/mccparser/src/cymk.hs
---- pakcs/mccparser/src/cymk.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/cymk.hs	2012-06-10 23:41:02.284126572 -0430
-@@ -7,11 +7,11 @@
- 
- import CurryDeps
- import GetOpt
--import Maybe
--import Monad
--import IO
-+import Data.Maybe
-+import Control.Monad
-+import System.IO
- import PathUtils
--import System
-+import System.Cmd
- 
- data Options =
-   Options{
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/cyxml.hs pakcs-new/mccparser/src/cyxml.hs
---- pakcs/mccparser/src/cyxml.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/cyxml.hs	2012-06-10 23:41:02.285126603 -0430
-@@ -9,8 +9,8 @@
- -- Martin Engelke (men@informatik.uni-kiel.de)
- --
- 
--import System
--import Directory
-+import System.Cmd
-+import System.Directory
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Desugar.lhs pakcs-new/mccparser/src/Desugar.lhs
---- pakcs/mccparser/src/Desugar.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/Desugar.lhs	2012-06-10 23:41:02.316127435 -0430
-@@ -64,12 +64,12 @@
- > import Base
- > import Combined
- > import TopEnv (qualRebindTopEnv)
--> import List
--> import Monad
-+> import Data.List
-+> import Control.Monad
- > import Typing
- > import Utils
- > import Ident
--> import Maybe
-+> import Data.Maybe
- 
- posE = undefined
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/DTransform.lhs pakcs-new/mccparser/src/DTransform.lhs
---- pakcs/mccparser/src/DTransform.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/DTransform.lhs	2012-06-10 23:41:02.318127490 -0430
-@@ -18,7 +18,7 @@
- 
- > module DTransform(module DTransform) where
- > import Ident
--> import List
-+> import Data.List
- > import IL
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Error.lhs pakcs-new/mccparser/src/Error.lhs
---- pakcs/mccparser/src/Error.lhs	2011-11-14 09:23:08.000000000 -0430
-+++ pakcs-new/mccparser/src/Error.lhs	2012-06-10 23:41:02.318127490 -0430
-@@ -13,7 +13,7 @@
- \begin{verbatim}
- 
- > module Error where
--> import Monad
-+> import Control.Monad
- 
- > data Error a = Ok a | Error String deriving (Eq,Ord,Show)
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Exports.lhs pakcs-new/mccparser/src/Exports.lhs
---- pakcs/mccparser/src/Exports.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Exports.lhs	2012-06-10 23:41:02.319127517 -0430
-@@ -14,9 +14,9 @@
- 
- > module Exports(expandInterface,exportInterface) where
- > import Base
--> import List
-+> import Data.List
- > import Map
--> import Maybe
-+> import Data.Maybe
- > import Set
- > import TopEnv
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/FlatCurry.hs pakcs-new/mccparser/src/FlatCurry.hs
---- pakcs/mccparser/src/FlatCurry.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/FlatCurry.hs	2012-06-10 23:41:02.286126629 -0430
-@@ -24,8 +24,8 @@
- 		  writeFlatCurry) where
- 
- import PathUtils (writeModule,maybeReadModule)
--import Directory
--import List(intersperse)
-+import System.Directory
-+import Data.List(intersperse)
- import Control.Monad (liftM)
- 
- ------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/FlatCurry.lhs pakcs-new/mccparser/src/FlatCurry.lhs
---- pakcs/mccparser/src/FlatCurry.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/FlatCurry.lhs	2012-06-10 23:41:02.320127544 -0430
-@@ -19,9 +19,9 @@
- >                   CaseType(..), CombType(..), Expr(..), BranchExpr(..),
- >                   Pattern(..), Literal(..)) where
- 
--import System
--import Directory
--import Char
-+import System.Cmd
-+import System.Directory
-+import Data.Char
- import ReadShowTerm
- import PathUtils (doesModuleExist)
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/FlatInfo.lhs pakcs-new/mccparser/src/FlatInfo.lhs
---- pakcs/mccparser/src/FlatInfo.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/FlatInfo.lhs	2012-06-10 23:41:02.320127544 -0430
-@@ -6,7 +6,7 @@
- > import CurrySyntax
- > import qualified IL
- > import Ident
--> import Maybe
-+> import Data.Maybe
- 
- ------------------------------------------------------------------------------
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/FlatWithSrcRefs.hs pakcs-new/mccparser/src/FlatWithSrcRefs.hs
---- pakcs/mccparser/src/FlatWithSrcRefs.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/FlatWithSrcRefs.hs	2012-06-10 23:41:02.286126629 -0430
-@@ -27,8 +27,8 @@
- 		  writeFlatCurry,gshowsPrec) where
- 
- import PathUtils (writeModule,maybeReadModule)
--import Directory
--import List(intersperse)
-+import System.Directory
-+import Data.List(intersperse)
- import Control.Monad (liftM)
- import Data.Generics hiding (Fixity)
- import Position (SrcRef)
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Frontend.hs pakcs-new/mccparser/src/Frontend.hs
---- pakcs/mccparser/src/Frontend.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/Frontend.hs	2012-06-10 23:41:02.287126654 -0430
-@@ -33,10 +33,10 @@
- import Position
- import PathUtils
- import Env
--import List
--import Maybe
--import Monad
--import System
-+import Data.List
-+import Data.Maybe
-+import Control.Monad
-+import System.Cmd
- import Prelude hiding (lex)
- 
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/GenAbstractCurry.hs pakcs-new/mccparser/src/GenAbstractCurry.hs
---- pakcs/mccparser/src/GenAbstractCurry.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/GenAbstractCurry.hs	2012-06-10 23:41:02.289126703 -0430
-@@ -18,9 +18,9 @@
- import Position
- import TopEnv
- import Env
--import Maybe
--import List
--import Char
-+import Data.Maybe
-+import Data.List
-+import Data.Char
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/GenFlatCurry.hs pakcs-new/mccparser/src/GenFlatCurry.hs
---- pakcs/mccparser/src/GenFlatCurry.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/GenFlatCurry.hs	2012-06-10 23:41:02.292126785 -0430
-@@ -37,9 +37,9 @@
- import TopEnv
- import Env
- import Map
--import Monad
--import Maybe
--import List
-+import Control.Monad
-+import Data.Maybe
-+import Data.List
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/GetOpt.hs pakcs-new/mccparser/src/GetOpt.hs
---- pakcs/mccparser/src/GetOpt.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/GetOpt.hs	2012-06-10 23:41:02.292126785 -0430
-@@ -19,7 +19,7 @@
- 
- module GetOpt (ArgOrder(..), OptDescr(..), ArgDescr(..), usageInfo, getOpt) where
- 
--import List(isPrefixOf)
-+import Data.List(isPrefixOf)
- 
- data ArgOrder a                        -- what to do with options following non-options:
-    = RequireOrder                      --    no option processing after first non-option
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/HeaderTable.lhs pakcs-new/mccparser/src/HeaderTable.lhs
---- pakcs/mccparser/src/HeaderTable.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/HeaderTable.lhs	2012-06-10 23:41:02.321127571 -0430
-@@ -3,7 +3,7 @@
- > import CurrySyntax
- > import Ident
- > import Env
--> import Maybe
-+> import Data.Maybe
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Ident.lhs pakcs-new/mccparser/src/Ident.lhs
---- pakcs/mccparser/src/Ident.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Ident.lhs	2012-06-10 23:41:02.322127598 -0430
-@@ -49,9 +49,9 @@
- >              addPositionIdent, removePositionIdent, positionOfIdent,
- >              addPositionModuleIdent, removePositionModuleIdent,addRef,addRefId,
- >              positionOfModuleIdent,positionOfQualIdent,updQualIdent ) where
--> import Char
--> import List
--> import Maybe
-+> import Data.Char
-+> import Data.List
-+> import Data.Maybe
- > import Position
- > import Data.Generics
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/ILCompile.lhs pakcs-new/mccparser/src/ILCompile.lhs
---- pakcs/mccparser/src/ILCompile.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/ILCompile.lhs	2012-06-10 23:41:02.323127625 -0430
-@@ -18,10 +18,10 @@
- > import IL
- > import qualified Cam
- > import Env
--> import List
-+> import Data.List
- > import Map
--> import Maybe
--> import Monad
-+> import Data.Maybe
-+> import Control.Monad
- > import SCC
- > import Combined
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/ILLift.lhs pakcs-new/mccparser/src/ILLift.lhs
---- pakcs/mccparser/src/ILLift.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/ILLift.lhs	2012-06-10 23:41:02.323127625 -0430
-@@ -20,8 +20,8 @@
- > import IL
- > import Ident
- > import Combined
--> import List
--> import Monad
-+> import Data.List
-+> import Control.Monad
- > import Utils
- 
- > type LiftState a = St [QualIdent] a
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/ILTrans.lhs pakcs-new/mccparser/src/ILTrans.lhs
---- pakcs/mccparser/src/ILTrans.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/ILTrans.lhs	2012-06-10 23:41:02.325127679 -0430
-@@ -26,8 +26,8 @@
- > import Env
- > import Set
- > import Map
--> import Maybe
--> import List
-+> import Data.Maybe
-+> import Data.List
- 
- \end{verbatim}
- \paragraph{Modules}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/ILxml.lhs pakcs-new/mccparser/src/ILxml.lhs
---- pakcs/mccparser/src/ILxml.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/ILxml.lhs	2012-06-10 23:41:02.326127706 -0430
-@@ -25,8 +25,8 @@
- > import qualified CurrySyntax as CS
- > import CurryEnv
- > import Pretty
--> import Char(chr,ord,isAlphaNum)
--> import Maybe
-+> import Data.Char(chr,ord,isAlphaNum)
-+> import Data.Maybe
- 
- > -- identation level
- > level::Int
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Imports.lhs pakcs-new/mccparser/src/Imports.lhs
---- pakcs/mccparser/src/Imports.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Imports.lhs	2012-06-10 23:41:02.327127733 -0430
-@@ -14,7 +14,7 @@
- > import Base
- > import Env
- > import TopEnv
--> import Maybe
-+> import Data.Maybe
- > import Map
- > import Set
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/InterfaceCheck.hs pakcs-new/mccparser/src/InterfaceCheck.hs
---- pakcs/mccparser/src/InterfaceCheck.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/InterfaceCheck.hs	2012-06-10 23:41:02.293126815 -0430
-@@ -10,7 +10,7 @@
- module InterfaceCheck where
- 
- import FlatWithSrcRefs
--import List
-+import Data.List
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/IntfCheck.lhs pakcs-new/mccparser/src/IntfCheck.lhs
---- pakcs/mccparser/src/IntfCheck.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/IntfCheck.lhs	2012-06-10 23:41:02.328127760 -0430
-@@ -16,8 +16,8 @@
- 
- > module IntfCheck(intfCheck,fixInterface,intfEquiv) where
- > import Base
--> import Maybe
--> import List(deleteFirstsBy)
-+> import Data.Maybe
-+> import Data.List(deleteFirstsBy)
- > import Set
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/KindCheck.lhs pakcs-new/mccparser/src/KindCheck.lhs
---- pakcs/mccparser/src/KindCheck.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/KindCheck.lhs	2012-06-10 23:41:02.329127787 -0430
-@@ -25,7 +25,7 @@
- 
- > module KindCheck(kindCheck,kindCheckGoal) where
- > import Base hiding (bindArity)
--> import Maybe
-+> import Data.Maybe
- > import TopEnv
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/LexComb.lhs pakcs-new/mccparser/src/LexComb.lhs
---- pakcs/mccparser/src/LexComb.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/LexComb.lhs	2012-06-10 23:41:02.329127787 -0430
-@@ -19,7 +19,7 @@
- > module LexComb where
- > import Position
- > import Error
--> import Char
-+> import Data.Char
- 
- > infixl 1 `thenP`, `thenP_`
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Lift.lhs pakcs-new/mccparser/src/Lift.lhs
---- pakcs/mccparser/src/Lift.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Lift.lhs	2012-06-10 23:41:02.330127814 -0430
-@@ -22,8 +22,8 @@
- > import Env
- > import TopEnv
- > import Set
--> import List
--> import Monad
-+> import Data.List
-+> import Control.Monad
- > import Combined
- > import SCC
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/LLParseComb.lhs pakcs-new/mccparser/src/LLParseComb.lhs
---- pakcs/mccparser/src/LLParseComb.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/LLParseComb.lhs	2012-06-10 23:41:02.330127814 -0430
-@@ -29,8 +29,8 @@
- > import Position
- > import Set
- > import Map
--> import Maybe
--> import Monad
-+> import Data.Maybe
-+> import Control.Monad
- > import Error
- > import LexComb
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Map.lhs pakcs-new/mccparser/src/Map.lhs
---- pakcs/mccparser/src/Map.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Map.lhs	2012-06-10 23:41:02.331127841 -0430
-@@ -11,7 +11,7 @@
- 
- > module Map(FM, nullFM, zeroFM, unitFM, addToFM, deleteFromFM,
- >            lookupFM, fromListFM, toListFM) where
--> import List
-+> import Data.List
- 
- \end{verbatim}
- A 2-3 tree is either empty or a node with either two or three children
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Modules.lhs pakcs-new/mccparser/src/Modules.lhs
---- pakcs/mccparser/src/Modules.lhs	2011-11-14 09:23:09.000000000 -0430
-+++ pakcs-new/mccparser/src/Modules.lhs	2012-06-10 23:41:02.333127895 -0430
-@@ -55,10 +55,10 @@
- > import CaseCompletion
- > import PathUtils
- > import TypeSubst
--> import List
--> import IO
--> import Maybe
--> import Monad
-+> import Data.List
-+> import System.IO
-+> import Data.Maybe
-+> import Control.Monad
- > import Pretty
- > import Error
- > import Env
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/newer.lhs pakcs-new/mccparser/src/newer.lhs
---- pakcs/mccparser/src/newer.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/newer.lhs	2012-06-10 23:41:02.333127895 -0430
-@@ -24,10 +24,10 @@
- code 2.
- \begin{verbatim}
- 
--> import IO
--> import Directory
--> import System
--> import Time
-+> import System.IO
-+> import System.Directory
-+> import System.Cmd
-+> import System.Time
- > import PathUtils (getModuleModTime)
- 
- > main =
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/OldScopeEnv.hs pakcs-new/mccparser/src/OldScopeEnv.hs
---- pakcs/mccparser/src/OldScopeEnv.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/OldScopeEnv.hs	2012-06-10 23:41:02.294126843 -0430
-@@ -8,7 +8,7 @@
- 
- import Ident
- import Env
--import Maybe
-+import Data.Maybe
- 
- 
- -------------------------------------------------------------------------------
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/PathUtils.lhs pakcs-new/mccparser/src/PathUtils.lhs
---- pakcs/mccparser/src/PathUtils.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/PathUtils.lhs	2012-06-10 23:41:02.334127922 -0430
-@@ -15,8 +15,8 @@
- >                  listSep, pathList, lookupFile,
- >                  currySubdir,writeModule,readModule,
- >                  doesModuleExist,maybeReadModule,getModuleModTime) where
--> -- import List
--> import Directory
-+> -- import Data.List
-+> import System.Directory
- > import CurrySubdir
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/PrecCheck.lhs pakcs-new/mccparser/src/PrecCheck.lhs
---- pakcs/mccparser/src/PrecCheck.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/PrecCheck.lhs	2012-06-10 23:41:02.335127950 -0430
-@@ -18,7 +18,7 @@
- 
- > module PrecCheck(precCheck,precCheckGoal) where
- > import Base
--> import List
-+> import Data.List
- > import Env
- > import TopEnv
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Pretty.lhs pakcs-new/mccparser/src/Pretty.lhs
---- pakcs/mccparser/src/Pretty.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Pretty.lhs	2012-06-10 23:41:02.337128004 -0430
-@@ -180,7 +180,7 @@
- 
- -- Don't import Util( assertPanic ) because it makes a loop in the module structure
- 
--import Ratio
-+import Data.Ratio
- infixl 6 <> 
- infixl 6 <+>
- infixl 5 $$, $+$
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Set.lhs pakcs-new/mccparser/src/Set.lhs
---- pakcs/mccparser/src/Set.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Set.lhs	2012-06-10 23:41:02.338128031 -0430
-@@ -11,9 +11,9 @@
- \begin{verbatim}
- 
- > module Set where
--> import List
-+> import Data.List
- > import Map
--> import Maybe
-+> import Data.Maybe
- 
- > infixl 8 `addToSet`, `deleteFromSet`
- > infixl 7 `unionSet`, `intersectionSet`
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Simplify.lhs pakcs-new/mccparser/src/Simplify.lhs
---- pakcs/mccparser/src/Simplify.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Simplify.lhs	2012-06-10 23:41:02.339128058 -0430
-@@ -26,10 +26,10 @@
- > import Base
- > import Combined
- > import Env
--> import Monad
-+> import Control.Monad
- > import SCC
- > import Typing
--> import List (partition)
-+> import Data.List (partition)
- 
- > type SimplifyState a = StateT ValueEnv (ReaderT EvalEnv (StateT Int Id)) a
- > type InlineEnv = Env Ident Expression
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/smake.hs pakcs-new/mccparser/src/smake.hs
---- pakcs/mccparser/src/smake.hs	2011-11-14 09:23:12.000000000 -0430
-+++ pakcs-new/mccparser/src/smake.hs	2012-06-10 23:41:02.296126896 -0430
-@@ -22,11 +22,11 @@
- -- Martin Engelke (men@informatik.uni-kiel.de)
- --
- 
--import System
--import Directory
--import Time
--import Monad
--import Maybe
-+import System.Cmd
-+import System.Directory
-+import System.Time
-+import Control.Monad
-+import Data.Maybe
- import PathUtils (getModuleModTime)
- 
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/SyntaxCheck.lhs pakcs-new/mccparser/src/SyntaxCheck.lhs
---- pakcs/mccparser/src/SyntaxCheck.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/SyntaxCheck.lhs	2012-06-10 23:41:02.342128139 -0430
-@@ -24,9 +24,9 @@
- > import Base
- > import Env
- > import NestEnv
--> import List
--> import Maybe
--> import Monad
-+> import Data.List
-+> import Data.Maybe
-+> import Control.Monad
- > import Combined
- > import Utils
- 
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/SyntaxColoring.hs pakcs-new/mccparser/src/SyntaxColoring.hs
---- pakcs/mccparser/src/SyntaxColoring.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/SyntaxColoring.hs	2012-06-10 23:48:14.526817048 -0430
-@@ -10,9 +10,9 @@
- import Frontend
- import Ident
- import CurrySyntax 
--import Char
--import Maybe
--import List
-+import Data.Char hiding (Space)
-+import Data.Maybe
-+import Data.List
- import Debug.Trace
- import Message
- import Control.Exception
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/TopEnv.lhs pakcs-new/mccparser/src/TopEnv.lhs
---- pakcs/mccparser/src/TopEnv.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/TopEnv.lhs	2012-06-10 23:41:02.342128139 -0430
-@@ -41,7 +41,7 @@
- >               allImports,moduleImports,localBindings) where
- > import Env
- > import Ident
--> import Maybe
-+> import Data.Maybe
- > import Utils
- 
- > data Source = Local | Import [ModuleIdent] deriving (Eq,Show)
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/TypeCheck.lhs pakcs-new/mccparser/src/TypeCheck.lhs
---- pakcs/mccparser/src/TypeCheck.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/TypeCheck.lhs	2012-06-10 23:45:05.513706248 -0430
-@@ -33,9 +33,9 @@
- > import SCC
- > import TypeSubst
- > import Utils
--> import List
--> import Monad
--> import Maybe
-+> import Data.List
-+> import Control.Monad
-+> import Data.Maybe
- 
- > infixl 5 $-$
- 
-@@ -1136,9 +1136,6 @@
- >   where tvs = [tv | tv <- nub (typeVars ty), tv `notElemSet` gvs]
- >         tvs' = map TypeVariable [0..]
- 
--> replicateM :: Monad m => Int -> m a -> m [a]
--> replicateM n = sequence . replicate n
--
- \end{verbatim}
- \paragraph{Auxiliary Functions}
- The functions \texttt{constrType}, \texttt{varType}, and
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Types.lhs pakcs-new/mccparser/src/Types.lhs
---- pakcs/mccparser/src/Types.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Types.lhs	2012-06-10 23:41:02.346128247 -0430
-@@ -13,8 +13,8 @@
- 
- > module Types where
- > import Ident
--> import List
--> import Maybe
-+> import Data.List
-+> import Data.Maybe
- 
- \end{verbatim}
- A type is either a type variable, an application of a type constructor
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/TypeSubst.lhs pakcs-new/mccparser/src/TypeSubst.lhs
---- pakcs/mccparser/src/TypeSubst.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/TypeSubst.lhs	2012-06-10 23:41:02.346128247 -0430
-@@ -12,8 +12,8 @@
- > module TypeSubst(module TypeSubst, idSubst,bindSubst,compose) where
- > import Base
- > import TopEnv
--> import Maybe
--> import List
-+> import Data.Maybe
-+> import Data.List
- > import Subst
- 
- > type TypeSubst = Subst Int Type
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Typing.lhs pakcs-new/mccparser/src/Typing.lhs
---- pakcs/mccparser/src/Typing.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Typing.lhs	2012-06-10 23:41:02.347128274 -0430
-@@ -12,10 +12,10 @@
- > import Base
- > import TypeSubst
- > import Combined
--> import Monad
-+> import Control.Monad
- > import TopEnv
- > import Utils
--> import Maybe
-+> import Data.Maybe
- 
- \end{verbatim}
- During the transformation of Curry source code into the intermediate
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/Unlit.lhs pakcs-new/mccparser/src/Unlit.lhs
---- pakcs/mccparser/src/Unlit.lhs	2011-11-14 09:23:10.000000000 -0430
-+++ pakcs-new/mccparser/src/Unlit.lhs	2012-06-10 23:41:02.347128274 -0430
-@@ -27,7 +27,7 @@
- \begin{verbatim}
- 
- > module Unlit(unlit) where
--> import Char
-+> import Data.Char
- > import Position
- 
- \end{verbatim}
-diff -Naur '--exclude=*.o' '--exclude=*.hi' '--exclude=*~' '--exclude=cymake' pakcs/mccparser/src/WarnCheck.hs pakcs-new/mccparser/src/WarnCheck.hs
---- pakcs/mccparser/src/WarnCheck.hs	2011-11-14 09:23:11.000000000 -0430
-+++ pakcs-new/mccparser/src/WarnCheck.hs	2012-06-10 23:41:02.300127003 -0430
-@@ -17,8 +17,8 @@
- import ScopeEnv (ScopeEnv)
- import Message
- import Env
--import Monad
--import List
-+import Control.Monad
-+import Data.List
- 
- 
- -------------------------------------------------------------------------------
diff --git a/pkgs/development/compilers/polyml/default.nix b/pkgs/development/compilers/polyml/default.nix
index 9a3d0a7deb4..dfdc50cd827 100644
--- a/pkgs/development/compilers/polyml/default.nix
+++ b/pkgs/development/compilers/polyml/default.nix
@@ -1,16 +1,15 @@
 {stdenv, fetchurl}:
 
 let
-  pname = "polyml";
-  version = "5.4";
+  version = "5.4.1";
 in
 
 stdenv.mkDerivation {
-  name = "${pname}-${version}";
+  name = "polyml-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/${pname}/${pname}.${version}.tar.gz";
-    sha256 = "1ykbm4zk260dkdr8jl7mjaqxy98h65fq0z82k44b1fp5q8zy5d34";
+    url = "mirror://sourceforge/polyml/polyml.${version}.tar.gz";
+    sha256 = "514d1d07be487b783d4dfa29dbd550b3396640579ce135a9eb5a61f08e7f9cac";
   };
 
   meta = {
@@ -19,7 +18,7 @@ stdenv.mkDerivation {
       Poly/ML is a full implementation of Standard ML.
     '';
     homepage = http://www.polyml.org/;
-    license = "LGPL";
+    license = stdenv.lib.licenses.lgpl21;
     platforms = with stdenv.lib.platforms; linux;
     maintainers = [ #Add your name here!
       stdenv.lib.maintainers.z77z
diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix
index eb3f47a15c0..1e4feff1107 100644
--- a/pkgs/development/compilers/sbcl/default.nix
+++ b/pkgs/development/compilers/sbcl/default.nix
@@ -1,7 +1,15 @@
 a :  
 let 
   fetchurl = a.fetchurl;
-  s= import ./src-for-default.nix;
+  s= # Generated upstream information
+  rec {
+    baseName="sbcl";
+    version="1.1.8";
+    name="${baseName}-${version}";
+    hash="1fmcpsi2bddfpz3impm9i62y9p15r3mc4xgm1dg0k77l33859jip";
+    url="mirror://sourceforge/project/sbcl/sbcl/1.1.8/sbcl-1.1.8-source.tar.bz2";
+    sha256="1fmcpsi2bddfpz3impm9i62y9p15r3mc4xgm1dg0k77l33859jip";
+  };
   buildInputs = with a; [
     clisp makeWrapper
   ];
@@ -13,7 +21,7 @@ rec {
   configureFlags = [];
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "doFixNewer" "doFixTests" "setVersion" "doBuild" "doInstall" "doWrap"];
+  phaseNames = ["setVars" "doFixNewer" "doFixTests" "setVersion" "doPatch" "doBuild" "doInstall" "doWrap"];
 
   setVars = a.fullDepEntry (''
     export INSTALL_ROOT=$out
@@ -73,13 +81,13 @@ rec {
   '') ["doBuild" "minInit" "addInputs"];
 
   inherit(s) name;
+  inherit(s) version;
   meta = {
     description = "Lisp compiler";
     homepage = "http://www.sbcl.org";
     license = "bsd";
     maintainers = [a.lib.maintainers.raskin];
     platforms = with a.lib.platforms; all;
+    inherit(s) version;
   };
 }
-
-
diff --git a/pkgs/development/compilers/sbcl/default.upstream b/pkgs/development/compilers/sbcl/default.upstream
new file mode 100644
index 00000000000..de69a2828c6
--- /dev/null
+++ b/pkgs/development/compilers/sbcl/default.upstream
@@ -0,0 +1,9 @@
+name sbcl
+target default.nix
+url http://sf.net/projects/sbcl/files/sbcl/
+version_link '/sbcl/[0-9.]+/$'
+link "source.tar.bz2"
+version '.*/sbcl-([0-9.]+)-source.*' '\1'
+redirect
+process 'http://[a-z]+[.]dl[.]sourceforge[.]net/' 'mirror://sourceforge/'
+process '[?].*' ''
diff --git a/pkgs/development/compilers/sbcl/newglibc.patch b/pkgs/development/compilers/sbcl/newglibc.patch
new file mode 100644
index 00000000000..dbc94b06d4c
--- /dev/null
+++ b/pkgs/development/compilers/sbcl/newglibc.patch
@@ -0,0 +1,43 @@
+Fixes for glibc 2.17.
+
+linux-os.c is just a missing header (for personality()).
+
+In x86-64-linux-os.c, __USE_GNU is a glibc-internal name that features.h
+defines; _GNU_SOURCE is what it should actually be using to get GNU extensions.
+
+diff -x config.log -x config.status -ru tmp/sbcl-1.1.2/src/runtime/linux-os.c work/sbcl-1.1.2/src/runtime/linux-os.c
+--- tmp/sbcl-1.1.2/src/runtime/linux-os.c	2012-12-01 11:32:38.000000000 +0000
++++ work/sbcl-1.1.2/src/runtime/linux-os.c	2012-12-31 01:20:37.619000000 +0000
+@@ -46,6 +46,7 @@
+ #include <sys/stat.h>
+ #include <unistd.h>
+ #include <linux/version.h>
++#include <sys/personality.h>
+ 
+ #include "validate.h"
+ #include "thread.h"
+diff -x config.log -x config.status -ru tmp/sbcl-1.1.2/src/runtime/x86-64-linux-os.c work/sbcl-1.1.2/src/runtime/x86-64-linux-os.c
+--- tmp/sbcl-1.1.2/src/runtime/x86-64-linux-os.c	2012-12-01 11:32:38.000000000 +0000
++++ work/sbcl-1.1.2/src/runtime/x86-64-linux-os.c	2012-12-31 01:20:25.450000000 +0000
+@@ -14,6 +14,9 @@
+  * files for more information.
+  */
+ 
++/* This is to get REG_RAX etc. from sys/ucontext.h. */
++#define _GNU_SOURCE
++
+ #include <stdio.h>
+ #include <stddef.h>
+ #include <sys/param.h>
+@@ -21,11 +24,7 @@
+ #include <sys/types.h>
+ #include <unistd.h>
+ #include <errno.h>
+-
+-#define __USE_GNU
+ #include <sys/ucontext.h>
+-#undef __USE_GNU
+-
+ 
+ #include "./signal.h"
+ #include "os.h"
diff --git a/pkgs/development/compilers/sbcl/src-for-default.nix b/pkgs/development/compilers/sbcl/src-for-default.nix
deleted file mode 100644
index d56520d2902..00000000000
--- a/pkgs/development/compilers/sbcl/src-for-default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-rec {
-   version="1.0.58";
-   name="sbcl-1.0.58";
-   hash="0ifr96hy5ax5c5iv7igwgkwcqb3pwrc4ism957pkfb5yy39p4yc1";
-   url="http://downloads.sourceforge.net/project/sbcl/sbcl/1.0.58/sbcl-1.0.58-source.tar.bz2";
-   advertisedUrl="http://downloads.sourceforge.net/project/sbcl/sbcl/1.0.58/sbcl-1.0.58-source.tar.bz2";
-  
-  
-}
diff --git a/pkgs/development/compilers/sbcl/src-info-for-default.nix b/pkgs/development/compilers/sbcl/src-info-for-default.nix
deleted file mode 100644
index 597aded1792..00000000000
--- a/pkgs/development/compilers/sbcl/src-info-for-default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-{
-  baseName = "sbcl";
-  downloadPage = "http://sourceforge.net/projects/sbcl/files/sbcl/";
-  choiceCommand = "head -n 1 | sed -re 's%.*/([0-9.]+)/%http://downloads.sourceforge.net/project/sbcl/sbcl/\\1/sbcl-\\1-source.tar.bz2%'";
-  sourceRegexp = "[/][0-9.]+/\$";
-  versionExtractorSedScript = "s/.*-([0-9.rc]+)-.*/\\1/";
-}
diff --git a/pkgs/development/compilers/scala/default.nix b/pkgs/development/compilers/scala/default.nix
index a78ee06f652..a7c9dbc9073 100644
--- a/pkgs/development/compilers/scala/default.nix
+++ b/pkgs/development/compilers/scala/default.nix
@@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out
-    rm "bin/"*.bat
+    rm bin/*.bat
+    rm lib/scalacheck.jar
     mv * $out
   '';
 
@@ -28,5 +29,6 @@ stdenv.mkDerivation rec {
     '';
     homepage = http://www.scala-lang.org/;
     license = "BSD";
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/compilers/sdcc/default.nix b/pkgs/development/compilers/sdcc/default.nix
new file mode 100644
index 00000000000..a22b0d9ea00
--- /dev/null
+++ b/pkgs/development/compilers/sdcc/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, bison, flex, boost, gputils ? null }:
+
+stdenv.mkDerivation rec {
+  version = "3.2.0";
+  name = "sdcc-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sdcc/sdcc-src-${version}.tar.bz2";
+    sha256 = "15gdl04kqpvmwvvplss5nmp3bz8rhz48dhb0wmb2v9v9sn7qj01d";
+  };
+
+  # TODO: remove this comment when gputils != null is tested
+  buildInputs = [ bison flex boost gputils ];
+
+  configureFlags = ''
+    ${if gputils == null then "--disable-pic14-port --disable-pic16-port" else ""}
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Small Device C Compiler";
+    longDescription = ''
+      SDCC is a retargettable, optimizing ANSI - C compiler suite that targets
+      the Intel MCS51 based microprocessors (8031, 8032, 8051, 8052, etc.), Maxim
+      (formerly Dallas) DS80C390 variants, Freescale (formerly Motorola) HC08 based
+      (hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit 2000/3000,
+      Rabbit 3000A). Work is in progress on supporting the Microchip PIC16 and
+      PIC18 targets. It can be retargeted for other microprocessors.
+    '';
+    homepage = http://sdcc.sourceforge.net/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/development/compilers/strategoxt/0.18.nix b/pkgs/development/compilers/strategoxt/0.18.nix
index c467b635423..85d373afa0d 100644
--- a/pkgs/development/compilers/strategoxt/0.18.nix
+++ b/pkgs/development/compilers/strategoxt/0.18.nix
@@ -4,20 +4,6 @@ rec {
 
   inherit aterm;
 
-  atermStatic = stdenv.mkDerivation ( rec {
-    name = "${aterm.name}-static";
-    configureFlags = "--enable-shared=no --enable-static=yes";
-
-    inherit (aterm) src meta patches; 
-  } // ( if stdenv.system == "i686-cygwin" then { inherit (sdf) CFLAGS; } else {} ) ) ;
-  
-  sdfStatic = stdenv.mkDerivation ( rec {
-    name = "${sdf.name}-static";
-    configureFlags = "--enable-shared=no --enable-static=yes";
-
-    inherit (sdf) src buildInputs preConfigure meta; 
-  } // ( if stdenv.system == "i686-cygwin" then { inherit (sdf) CFLAGS; } else {} ) ) ;
-  
   sdf = stdenv.mkDerivation ( rec {
     name = "sdf2-bundle-2.4";
 
diff --git a/pkgs/development/compilers/swi-prolog/default.nix b/pkgs/development/compilers/swi-prolog/default.nix
index de7456bbcf0..a17e104b5bb 100644
--- a/pkgs/development/compilers/swi-prolog/default.nix
+++ b/pkgs/development/compilers/swi-prolog/default.nix
@@ -3,14 +3,14 @@
    fontconfig }:
 
 let
-  version = "5.10.5";
+  version = "6.2.6";
 in
 stdenv.mkDerivation {
   name = "swi-prolog-${version}";
 
   src = fetchurl {
     url = "http://www.swi-prolog.org/download/stable/src/pl-${version}.tar.gz";
-    sha256 = "38d938d6a64e894685aa44bf9ea34b5505764cd084e07e6b4c21a9dd89b579d5";
+    sha256 = "0ii14ghmky91kkh017khahl00s4igkz03b5gy6y0vhv179sz04ll";
   };
 
   buildInputs = [gmp readline openssl libjpeg unixODBC libXinerama
diff --git a/pkgs/development/compilers/tiger/builder.sh b/pkgs/development/compilers/tiger/builder.sh
deleted file mode 100644
index c602b5280f6..00000000000
--- a/pkgs/development/compilers/tiger/builder.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-buildinputs="$aterm $sdf $strategoxt"
-source $stdenv/setup || exit 1
-
-tar zxf $src || exit 1
-cd tiger-* || exit 1
-./configure --prefix=$out \
-	--with-aterm=$aterm \
-	--with-sdf=$sdf \
-	--with-stratego-xt=$strategoxt \
-        --enable-tiger \
-        --enable-ir \
-	--enable-asm \
-    || exit 1
-make || exit 1
-make install || exit 1
diff --git a/pkgs/development/compilers/tiger/default.nix b/pkgs/development/compilers/tiger/default.nix
deleted file mode 100644
index 2fd297b8848..00000000000
--- a/pkgs/development/compilers/tiger/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl, aterm, sdf, strategoxt}: stdenv.mkDerivation {
-  name = "tiger-1.3-4631";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://losser.st-lab.cs.uu.nl/~mbravenb/dailydist/tiger/src/tiger-1.3-4631.tar.gz;
-    md5 = "1ea6070d84134eb6cff7fb32a75ef90a";
-  };
-  aterm = aterm;
-  sdf = sdf;
-  strategoxt = strategoxt;
-}
diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index 058d84a12de..11b0b2ea7b2 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -2,95 +2,62 @@
 
 assert stdenv ? glibc;
 
-let version = "0.9.25"; in
-  stdenv.mkDerivation {
-    name = "tinycc-${version}";
-
-    src = fetchurl {
-      url = "mirror://savannah/tinycc/tcc-${version}.tar.bz2";
-      sha256 = "0dfycf80x73dz67c97j1ry29wrv35393ai5ry46i1x1fzfq6rv8v";
-    };
-
-    buildNativeInputs = [ perl texinfo ];
-
-    patches =
-      [ (fetchurl {
-           # Add support for `alloca' on x86-64.
-           url = "http://repo.or.cz/w/tinycc.git/patch/8ea8305199496ba29b6d0da2de07aea4441844aa";
-           sha256 = "0dz1cm9zihk533hszqql4gxpzbp8c4g9dnvkkh9vs4js6fnz1fl2";
-           name = "x86-64-alloca.patch";
-         })
-
-        (fetchurl {
-           # Fix alignment of the return value of `alloca'.
-           url = "http://repo.or.cz/w/tinycc.git/patch/dca2b15df42c1341794dd412917708416da25594";
-           sha256 = "0617a69gnfdmv8pr6dj3szv97v3zh57439dsbklxrnipx2jv6pq7";
-           name = "x86-64-alloca-align.patch";
-         })
-      ];
-
-    postPatch = ''
-      substituteInPlace "texi2pod.pl" \
-        --replace "/usr/bin/perl" "${perl}/bin/perl"
-
-      # To produce executables, `tcc' needs to know where `crt*.o' are.
-      sed -i "tcc.h" \
-        -e's|define CONFIG_TCC_CRT_PREFIX.*$|define CONFIG_TCC_CRT_PREFIX "${stdenv.glibc}/lib"|g'
-
-      sed -i "libtcc.c" \
-        -e's|tcc_add_library_path(s, CONFIG_SYSROOT "/lib");|tcc_add_library_path(s, "${stdenv.glibc}/lib");|g;
-           s|tcc_add_sysinclude_path(s, CONFIG_SYSROOT "/usr/include");|tcc_add_library_path(s, "${stdenv.glibc}/include");|g ;
-           s|tcc_add_sysinclude_path(s, buf);|tcc_add_sysinclude_path(s, buf); tcc_add_sysinclude_path(s, "${stdenv.glibc}/include");|g'
-
-      # Tell it about the loader's location.
-      sed -i "tccelf.c" \
-        -e's|".*/ld-linux\([^"]\+\)"|"${stdenv.glibc}/lib/ld-linux\1"|g'
-    ''; # "
-
-    postInstall = ''
-      makeinfo --force tcc-doc.texi || true
-
-      mkdir -p "$out/share/info"
-      mv tcc-doc.info* "$out/share/info"
-
-      echo 'int main () { printf ("it works!\n"); exit(0); }' | \
-         "$out/bin/tcc" -run -
-    '';
-
-    doCheck = true;
-    checkTarget = "test";
-
-    meta = {
-      description = "TinyCC, a small, fast, and embeddable C compiler and interpreter";
-
-      longDescription =
-        '' TinyCC (aka TCC) is a small but hyper fast C compiler.  Unlike
-           other C compilers, it is meant to be self-sufficient: you do not
-           need an external assembler or linker because TCC does that for
-           you.
-
-           TCC compiles so fast that even for big projects Makefiles may not
-           be necessary.
-
-           TCC not only supports ANSI C, but also most of the new ISO C99
-           standard and many GNU C extensions.
-
-           TCC can also be used to make C scripts, i.e. pieces of C source
-           that you run as a Perl or Python script.  Compilation is so fast
-           that your script will be as fast as if it was an executable.
-
-           TCC can also automatically generate memory and bound checks while
-           allowing all C pointers operations.  TCC can do these checks even
-           if non patched libraries are used.
-
-           With libtcc, you can use TCC as a backend for dynamic code
-           generation.
-        '';
-
-      homepage = http://www.tinycc.org/;
-      license = "LGPLv2+";
-
-      platforms = stdenv.lib.platforms.unix;
-      maintainers = [ stdenv.lib.maintainers.ludo ];
-    };
-  }
+stdenv.mkDerivation rec {
+  name = "tcc-0.9.26";
+
+  src = fetchurl {
+    url = "mirror://savannah/tinycc/${name}.tar.bz2";
+    sha256 = "0wbdbdq6090ayw8bxnbikiv989kykff3m5rzbia05hrnwhd707jj";
+  };
+
+  nativeBuildInputs = [ perl texinfo ];
+
+  postPatch = ''
+    substituteInPlace "texi2pod.pl" \
+      --replace "/usr/bin/perl" "${perl}/bin/perl"
+  '';
+
+  preConfigure = ''
+    configureFlagsArray+=("--elfinterp=$(cat $NIX_GCC/nix-support/dynamic-linker)")
+    configureFlagsArray+=("--crtprefix=${stdenv.glibc}/lib")
+    configureFlagsArray+=("--sysincludepaths=${stdenv.glibc}/include:{B}/include")
+    configureFlagsArray+=("--libpaths=${stdenv.glibc}/lib")
+  '';
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = {
+    description = "TinyCC, a small, fast, and embeddable C compiler and interpreter";
+
+    longDescription =
+      '' TinyCC (aka TCC) is a small but hyper fast C compiler.  Unlike
+         other C compilers, it is meant to be self-sufficient: you do not
+         need an external assembler or linker because TCC does that for
+         you.
+
+         TCC compiles so fast that even for big projects Makefiles may not
+         be necessary.
+
+         TCC not only supports ANSI C, but also most of the new ISO C99
+         standard and many GNU C extensions.
+
+         TCC can also be used to make C scripts, i.e. pieces of C source
+         that you run as a Perl or Python script.  Compilation is so fast
+         that your script will be as fast as if it was an executable.
+
+         TCC can also automatically generate memory and bound checks while
+         allowing all C pointers operations.  TCC can do these checks even
+         if non patched libraries are used.
+
+         With libtcc, you can use TCC as a backend for dynamic code
+         generation.
+      '';
+
+    homepage = http://www.tinycc.org/;
+    license = "LGPLv2+";
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
diff --git a/pkgs/development/compilers/uhc/default.nix b/pkgs/development/compilers/uhc/default.nix
index 2c812e8842b..fa66306721d 100644
--- a/pkgs/development/compilers/uhc/default.nix
+++ b/pkgs/development/compilers/uhc/default.nix
@@ -44,7 +44,6 @@ in stdenv.mkDerivation {
     platforms = stdenv.lib.platforms.linux;
     maintainers = [
       stdenv.lib.maintainers.andres
-      stdenv.lib.maintainers.simons
     ];
   };
 }
diff --git a/pkgs/development/compilers/urweb/default.nix b/pkgs/development/compilers/urweb/default.nix
index 7dbbe375283..7c0ddde6612 100644
--- a/pkgs/development/compilers/urweb/default.nix
+++ b/pkgs/development/compilers/urweb/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "urweb";
-  version = "20120110";
+  version = "20120807";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "http://www.impredicative.com/ur/${name}.tgz";
-    sha256 = "1f67nj2akji9dh3n2hwmcrrwd61zlrnb0xh841fpb3n20ycjzg6j";
+    sha256 = "15g1cz108dkzlp433cg56x76f20y6zcs9sbgxgdniyfakmn4ld6l";
   };
 
   buildInputs = [ stdenv.gcc file openssl mlton mysql postgresql sqlite ];
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = http://www.impredicative.com/ur/;
-    license = "bsd";
+    license = stdenv.lib.licenses.bsd3;
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/development/compilers/vala/15.2.nix b/pkgs/development/compilers/vala/15.2.nix
index 822102b7bd4..529ccea6bc8 100644
--- a/pkgs/development/compilers/vala/15.2.nix
+++ b/pkgs/development/compilers/vala/15.2.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g71zq6dpqrw2f40wfzdf18fdw41ymr17laqniy2kr622hkxdi8w";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig xz ];
 
   buildInputs = [ glib ];
 
diff --git a/pkgs/development/compilers/vala/16.1.nix b/pkgs/development/compilers/vala/16.1.nix
index 54e6af8798d..f054c59d2e4 100644
--- a/pkgs/development/compilers/vala/16.1.nix
+++ b/pkgs/development/compilers/vala/16.1.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n708n9ixyy9qrzyv1wf4ybvcclx43ib9ki028wwpvkz6kv8zqlb";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig xz ];
 
   buildInputs = [ glib ];
 
diff --git a/pkgs/development/compilers/vala/default.nix b/pkgs/development/compilers/vala/default.nix
index a60a71e3580..13a0081a257 100644
--- a/pkgs/development/compilers/vala/default.nix
+++ b/pkgs/development/compilers/vala/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, yacc, flex, pkgconfig, glib, xz}:
+{ stdenv, fetchurl, yacc, flex, pkgconfig, glib, libintlOrEmpty }:
 
 stdenv.mkDerivation rec {
 
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "09i2s0dwmrk147ind2dx7nq845g12fp6fsjqrphhrr0dbi0zzgh3";
   };
 
-  buildNativeInputs = [ yacc flex pkgconfig xz ];
+  nativeBuildInputs = [ yacc flex pkgconfig ];
 
-  buildInputs = [ glib ];
+  buildInputs = [ glib ] ++ libintlOrEmpty;
 
   meta = {
     description = "Compiler for the GObject type system";
diff --git a/pkgs/development/compilers/yasm/default.nix b/pkgs/development/compilers/yasm/default.nix
index ed97e8f1b28..02614106706 100644
--- a/pkgs/development/compilers/yasm/default.nix
+++ b/pkgs/development/compilers/yasm/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "yasm-1.1.0";
-  
+  name = "yasm-1.2.0";
+
   src = fetchurl {
     url = "http://www.tortall.net/projects/yasm/releases/${name}.tar.gz";
-    sha256 = "e5d56b582f3d0c30ed5c4fc221063e4175602307ea645520889458133671c232";
+    sha256 = "0cfg7ji3ia2in628w42wrfvw2ixmmm4rghwmv2k202mraysgm3vn";
   };
 
   meta = {
diff --git a/pkgs/development/eclipse/ecj/default.nix b/pkgs/development/eclipse/ecj/default.nix
index 53343f00ca5..8d083126e4c 100644
--- a/pkgs/development/eclipse/ecj/default.nix
+++ b/pkgs/development/eclipse/ecj/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, unzip, ant, gcj }:
 
 let
-  version = "3.6.1";
-  date    = "201009090800";
+  version = "3.7.2";
+  date    = "201202080800";
   isGCJ   = stdenv.lib.strings.substring 0 3 gcj.name == "gcj";
   javaExec  = if isGCJ then "gij" else "java";
   javaFlags = if isGCJ then "--cp" else "-cp";
@@ -11,8 +11,8 @@ in
     name = "ecj-${version}";
 
     src = fetchurl {
-      url = "http://eclipse.ialto.org/eclipse/downloads/drops/R-${version}-${date}/ecjsrc-${version}.zip";
-      sha256 = "0xfsig2pzd9wy524wp11s7pc7cj81s28g1485995b44d9qbi17h8";
+      url = "http://eclipse.ialto.org/eclipse/downloads/drops/R-${version}-${date}/ecjsrc-${version}.jar";
+      sha256 = "0swyysbyfmv068x8q1c5jqpwk5zb4xahg17aypx5rwb660f8fpbm";
     };
 
     buildInputs = [ unzip ant gcj ];
diff --git a/pkgs/development/interpreters/clisp/2.44.1.nix b/pkgs/development/interpreters/clisp/2.44.1.nix
index 891fd809bf0..521933b0ed1 100644
--- a/pkgs/development/interpreters/clisp/2.44.1.nix
+++ b/pkgs/development/interpreters/clisp/2.44.1.nix
@@ -14,16 +14,22 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ libsigsegv gettext ncurses readline libX11 libXau libXt pcre
       zlib libXpm xproto libXext xextproto libffi libffcall ];
- 
+
+  patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
+      
   # First, replace port 9090 (rather low, can be used)
   # with 64237 (much higher, IANA private area, not
   # anything rememberable).
-  patchPhase = ''
+  # Also remove reference to a type that disappeared from recent glibc
+  # (seems the correct thing to do, found no reference to any solution)
+  postPatch = ''
     sed -e 's@9090@64237@g' -i tests/socket.tst
     sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in
     find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i
-  '';
 
+    substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
+  '';
+  
   configureFlags =
     ''
       --with-readline builddir --with-dynamic-ffi
diff --git a/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch b/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch
new file mode 100644
index 00000000000..d6163022830
--- /dev/null
+++ b/pkgs/development/interpreters/clisp/bits_ipctypes_to_sys_ipc.patch
@@ -0,0 +1,12 @@
+diff -ru a/modules/bindings/glibc/linux.lisp b/modules/bindings/glibc/linux.lisp
+--- a/modules/bindings/glibc/linux.lisp	2008-10-10 16:15:49.000000000 +0300
++++ b/modules/bindings/glibc/linux.lisp	2012-12-04 01:01:35.000000000 +0200
+@@ -86,7 +86,7 @@
+ 
+ (def-c-type __key_t)            ; int
+ 
+-(c-lines "#include <bits/ipctypes.h>~%")
++(c-lines "#include <sys/ipc.h>~%")
+ (def-c-type __ipc_pid_t)        ; ushort
+ 
+ ; --------------------------- <sys/types.h> -----------------------------------
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index c985da9a5a2..bd19d738860 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -18,14 +18,20 @@ stdenv.mkDerivation rec {
       libXt pcre zlib libXpm xproto libXext xextproto libffi
       libffcall
     ];
- 
+
+  patches = [ ./bits_ipctypes_to_sys_ipc.patch ]; # from Gentoo
+
   # First, replace port 9090 (rather low, can be used)
   # with 64237 (much higher, IANA private area, not
   # anything rememberable).
-  patchPhase = ''
+  # Also remove reference to a type that disappeared from recent glibc
+  # (seems the correct thing to do, found no reference to any solution)
+  postPatch = ''
     sed -e 's@9090@64237@g' -i tests/socket.tst
     sed -i 's@/bin/pwd@${coreutils}&@' src/clisp-link.in
     find . -type f | xargs sed -e 's/-lICE/-lXau &/' -i
+
+    substituteInPlace modules/bindings/glibc/linux.lisp --replace "(def-c-type __swblk_t)" ""
   '';
 
   configureFlags =
@@ -34,6 +40,7 @@ stdenv.mkDerivation rec {
       --with-module=clx/new-clx --with-module=i18n --with-module=bindings/glibc
       --with-module=pcre --with-module=rawsock --with-module=readline
       --with-module=syscalls --with-module=wildcard --with-module=zlib
+      --with-threads=POSIX_THREADS
     '';
 
   preBuild = ''
diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix
index 6c20ca71406..dbbe4a9dcc3 100644
--- a/pkgs/development/interpreters/clojure/default.nix
+++ b/pkgs/development/interpreters/clojure/default.nix
@@ -1,17 +1,22 @@
-{stdenv, fetchurl, unzip, ant}:
+{stdenv, fetchurl, unzip, ant, version ? "1.4.0" }:
 
-stdenv.mkDerivation rec {
-  version = "1.4.0";
+let 
+  src_hashes = {
+    "1.4.0" = "27a5a151d5cc1bc3e52dff47c66111e637fefeb42d9bedfa1284a1a31d080171";
+    "1.5.0-RC1" = "111jm0nxkvqr1vrwcpvr70v5paasp8msrj5h8zm1c144c8zc1vln";
+  };
+in 
+stdenv.mkDerivation {
   name = "clojure-${version}";
 
   src = fetchurl {
     url = "http://repo1.maven.org/maven2/org/clojure/clojure/${version}/clojure-${version}.zip";
-    sha256 = "27a5a151d5cc1bc3e52dff47c66111e637fefeb42d9bedfa1284a1a31d080171";
+    sha256 = (builtins.getAttr version src_hashes); 
   };
 
   buildInputs = [ unzip ant ];
 
-  buildPhase = "ant";
+  buildPhase = "ant jar";
 
   installPhase = "
     mkdir -p $out/lib/java
diff --git a/pkgs/development/interpreters/cython/default.nix b/pkgs/development/interpreters/cython/default.nix
index 42dafcb7f2e..34bd63c29ab 100644
--- a/pkgs/development/interpreters/cython/default.nix
+++ b/pkgs/development/interpreters/cython/default.nix
@@ -16,5 +16,6 @@ stdenv.mkDerivation {
 
   meta = {
     description = "An interpreter to help writing C extensions for Python";
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix
new file mode 100644
index 00000000000..d775b74c903
--- /dev/null
+++ b/pkgs/development/interpreters/dart/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl }:
+ 
+assert stdenv.system == "x86_64-linux" || stdenv.system == "i686-linux";
+
+stdenv.mkDerivation {
+  name = "dart-0.4";
+ 
+  installPhase = ''
+    mkdir -p $out
+    cp -R * $out/
+    echo $libPath
+    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+             --set-rpath $libPath \
+             $out/bin/dart
+    
+    # Hack around weird dart2js resolving bug
+    mv $out/bin/dart2js $out/bin/.dart2js
+    echo "#!/bin/sh" > $out/bin/dart2js
+    echo "$out/bin/.dart2js \$*" >> $out/bin/dart2js
+    chmod +x $out/bin/dart2js
+  '';
+  
+  
+  src =
+    if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url = http://download.zef.s3.amazonaws.com/dartsdk-m4-linux-64.tar.gz;
+        sha256 = "1riwxxczskfsaax7n03m7isnbxf3walky0cac1w8j5apr1xvg5ma";
+      }
+    else
+      fetchurl {
+        url = http://download.zef.s3.amazonaws.com/dartsdk-m4-linux-32.tar.gz;
+        sha256 = "00935c4vxfj2h3x354g75qdazswwissbwc7kj5k05l1m3lizikf6";
+      };
+ 
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc ];
+ 
+  dontStrip = true;
+}
\ No newline at end of file
diff --git a/pkgs/development/interpreters/erlang/R14B04.nix b/pkgs/development/interpreters/erlang/R14B04.nix
index b5133bd7f83..1d5c9ae3d39 100644
--- a/pkgs/development/interpreters/erlang/R14B04.nix
+++ b/pkgs/development/interpreters/erlang/R14B04.nix
@@ -1,23 +1,40 @@
 { stdenv, fetchurl, perl, gnum4, ncurses, openssl }:
 
-let version = "R14B04"; in
+let version = "14B04"; in
 
 stdenv.mkDerivation {
   name = "erlang-" + version;
-  
+
   src = fetchurl {
-    url = "http://www.erlang.org/download/otp_src_" + version + ".tar.gz";
+    url = "http://www.erlang.org/download/otp_src_R${version}.tar.gz";
     sha256 = "0vlvjlg8vzcy6inb4vj00bnj0aarvpchzxwhmi492nv31s8kb6q9";
   };
-  
+
   buildInputs = [ perl gnum4 ncurses openssl ];
-  
+
   patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
-  
+
   preConfigure = ''
     export HOME=$PWD/../
     sed -e s@/bin/pwd@pwd@g -i otp_build
   '';
-  
+
   configureFlags = "--with-ssl=${openssl}";
+
+  meta = {
+    homepage = "http://www.erlang.org/";
+    description = "Programming language used for massively scalable soft real-time systems";
+
+    longDescription = ''
+      Erlang is a programming language used to build massively scalable
+      soft real-time systems with requirements on high availability.
+      Some of its uses are in telecoms, banking, e-commerce, computer
+      telephony and instant messaging. Erlang's runtime system has
+      built-in support for concurrency, distribution and fault
+      tolerance.
+    '';
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
 }
diff --git a/pkgs/development/interpreters/erlang/R15B03.nix b/pkgs/development/interpreters/erlang/R15B03.nix
new file mode 100644
index 00000000000..d282e45dc62
--- /dev/null
+++ b/pkgs/development/interpreters/erlang/R15B03.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, perl, gnum4, ncurses, openssl
+, wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }:
+
+assert wxSupport -> mesa != null && wxGTK != null && xlibs != null;
+
+let version = "15B03"; in
+
+stdenv.mkDerivation {
+  name = "erlang-" + version;
+
+  src = fetchurl {
+    url = "http://www.erlang.org/download/otp_src_R15B03-1.tar.gz";
+    sha256 = "4bccac86dd76aec050252e44276a0283a0df9218e6470cf042a9b9f9dfc9476c";
+  };
+
+  buildInputs =
+    [ perl gnum4 ncurses openssl
+    ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ];
+
+  patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
+
+  preConfigure = ''
+    export HOME=$PWD/../
+    sed -e s@/bin/pwd@pwd@g -i otp_build
+  '';
+
+  configureFlags = "--with-ssl=${openssl}";
+
+  meta = {
+    homepage = "http://www.erlang.org/";
+    description = "Programming language used for massively scalable soft real-time systems";
+
+    longDescription = ''
+      Erlang is a programming language used to build massively scalable
+      soft real-time systems with requirements on high availability.
+      Some of its uses are in telecoms, banking, e-commerce, computer
+      telephony and instant messaging. Erlang's runtime system has
+      built-in support for concurrency, distribution and fault
+      tolerance.
+    '';
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/interpreters/erlang/default.nix b/pkgs/development/interpreters/erlang/default.nix
deleted file mode 100644
index 18cfeca6329..00000000000
--- a/pkgs/development/interpreters/erlang/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, fetchurl, perl, gnum4, ncurses, openssl
-, wxSupport ? false, mesa ? null, wxGTK ? null, xlibs ? null }:
-
-assert wxSupport -> mesa != null && wxGTK != null && xlibs != null;
-
-let version = "R15B01"; in
-
-stdenv.mkDerivation {
-  name = "erlang-" + version;
-  
-  src = fetchurl {
-    url = "http://www.erlang.org/download/otp_src_" + version + ".tar.gz";
-    sha256 = "1pmb3hk51p6dwsspxx40qs7gjfyhxjjc3290qk6w1wwa6bkpskzr";
-  };
-  
-  buildInputs = 
-    [ perl gnum4 ncurses openssl
-    ] ++ stdenv.lib.optional wxSupport [ mesa wxGTK xlibs.libX11 ];
-  
-  patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
-  
-  preConfigure = ''
-    export HOME=$PWD/../
-    sed -e s@/bin/pwd@pwd@g -i otp_build
-  '';
-  
-  configureFlags = "--with-ssl=${openssl}";
-}
diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix
index bf1efbbb1a9..f44f71020b4 100644
--- a/pkgs/development/interpreters/guile/1.8.nix
+++ b/pkgs/development/interpreters/guile/1.8.nix
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   # GCC 4.6 raises a number of set-but-unused warnings.
   configureFlags = [ "--disable-error-on-warning" ];
 
-  buildNativeInputs = [ makeWrapper gawk ];
+  nativeBuildInputs = [ makeWrapper gawk ];
   propagatedBuildInputs = [ readline gmp libtool ];
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index cc49ab87af8..66b5b79083a 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -7,14 +7,14 @@
  else stdenv.mkDerivation)
 
 (rec {
-  name = "guile-2.0.6";
+  name = "guile-2.0.9";
 
   src = fetchurl {
     url = "mirror://gnu/guile/${name}.tar.xz";
-    sha256 = "000ng5qsq3cl1k35jvzvhwxj92wx4q87745n2fppkd4irh58vv5l";
+    sha256 = "0nw9y8vjyz4r61v06p9msks5lm58pd91irmzg4k487vmv743h2pp";
   };
 
-  buildNativeInputs = [ makeWrapper gawk pkgconfig ];
+  nativeBuildInputs = [ makeWrapper gawk pkgconfig ];
   buildInputs = [ readline libtool libunistring libffi ];
   propagatedBuildInputs = [ gmp boehmgc ]
 
@@ -25,13 +25,17 @@
     ++ [ libtool libunistring ];
 
   # A native Guile 2.0 is needed to cross-build Guile.
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
 
-  patches = [ ./disable-gc-sensitive-tests.patch ] ++
+  patches = [ ./disable-gc-sensitive-tests.patch ./eai_system.patch ] ++
     (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch);
 
+  # Explicitly link against libgcc_s, to work around the infamous
+  # "libgcc_s.so.1 must be installed for pthread_cancel to work".
+  LDFLAGS = "-lgcc_s";
+
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
 
@@ -102,10 +106,8 @@
 
 //
 
-(if stdenv.isFreeBSD
- then {
-   # XXX: Thread support is currently broken on FreeBSD and Solaris (namely
-   # the `SCM_I_IS_THREAD' assertion in `scm_spawn_thread' is hit.)
-   configureFlags = [ "--without-threads" ];
- }
- else {}))
+(stdenv.lib.optionalAttrs (!stdenv.isLinux) {
+  # Work around <http://bugs.gnu.org/14201>.
+  SHELL = "/bin/sh";
+  CONFIG_SHELL = "/bin/sh";
+}))
diff --git a/pkgs/development/interpreters/guile/eai_system.patch b/pkgs/development/interpreters/guile/eai_system.patch
new file mode 100644
index 00000000000..b0eb7ac44da
--- /dev/null
+++ b/pkgs/development/interpreters/guile/eai_system.patch
@@ -0,0 +1,24 @@
+Building nixpkgs in non-chroot, NSS modules may fail
+and that will report EAI_SYSTEM in getaddrinfo.
+https://bugzilla.novell.com/show_bug.cgi?id=794696
+
+Index: guile-2.0.7/test-suite/tests/net-db.test
+===================================================================
+--- guile-2.0.7.orig/test-suite/tests/net-db.test
++++ guile-2.0.7/test-suite/tests/net-db.test
+@@ -79,6 +79,7 @@
+                      (and (defined? 'EAI_NODATA)  ; GNU extension
+                           (= errcode EAI_NODATA))
+                      (= errcode EAI_AGAIN)
++                     (= errcode EAI_SYSTEM)
+                      (begin
+                        (format #t "unexpected error code: ~a ~s~%"
+                                errcode (gai-strerror errcode))
+@@ -105,6 +106,7 @@
+             ;; `EAI_NONAME'.)
+             (and (or (= errcode EAI_SERVICE)
+                      (= errcode EAI_NONAME)
++                     (= errcode EAI_SYSTEM)
+                      (and (defined? 'EAI_NODATA)
+                           (= errcode EAI_NODATA)))
+                  (string? (gai-strerror errcode))))))))
diff --git a/pkgs/development/interpreters/hiphopvm/default.nix b/pkgs/development/interpreters/hiphopvm/default.nix
new file mode 100644
index 00000000000..57e3e93c646
--- /dev/null
+++ b/pkgs/development/interpreters/hiphopvm/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, fetchgit, cmake, boost, libunwind, mysql, libmemcached, pcre
+, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
+, expat, libcap, oniguruma, libdwarf, libmcrypt, inteltbb, gperftools
+, bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam
+}:
+assert stdenv.system == "x86_64-linux";
+let
+  src = fetchgit {
+    url = "git://github.com/facebook/hiphop-php.git";
+    rev = "73f1c0ebd9b313f6b3baecd8c8046e0b595b1157";
+    sha256 = "104133c6054bc9ab0288eaa0cea168b6699e537b3ea76ecdc38ee833d93dca09";
+  };
+
+  libxml2_280 = stdenv.lib.overrideDerivation libxml2 (args: rec { 
+    name = "libxml2-2.8.0";
+
+    src = fetchurl {
+      url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
+      sha256 = "0ak2mjwvanz91nwxf1kkgbhrkm85vhhkpj7ymz8r6lb84bix1qpj";
+    };
+
+    patches = [];
+  });
+ 
+  curlFB = stdenv.lib.overrideDerivation curl (args: { patches = [ "${src}/src/third_party/libcurl-7.22.1.fb-changes.diff" ]; });
+
+  fbPatch = "${src}/src/third_party/libevent-1.4.14.fb-changes.diff";
+  libeventFB = stdenv.lib.overrideDerivation libevent (args: { patches = [fbPatch]; });
+in
+stdenv.mkDerivation {
+  name = "hiphop-php-73f1c0ebd9";
+  inherit src;
+  dontUseCmakeBuildDir = true;
+  dontUseCmakeConfigure = true;
+  USE_HHVM=1;
+  preConfigure = ''
+    export HPHP_HOME=$PWD
+    export HPHP_LIB=$PWD/bin
+    export TBB_INSTALL_DIR=${inteltbb}
+    export TBB_ARCH_PLATFORM="intel64/cc4.1.0_libc2.4_kernel2.6.16.21"
+    sed -i 's| DEPRECATED | DEPRECATED_ |' src/runtime/base/runtime_error.h
+  '';
+  NIX_LDFLAGS = "-lpam -L${pam}/lib";
+  MYSQL_DIR=mysql;
+  buildInputs = [ 
+    cmake boost libunwind mysql libmemcached pcre libeventFB gd curlFB
+    libxml2_280 icu flex bison openssl zlib php expat libcap oniguruma
+    libdwarf libmcrypt inteltbb gperftools bzip2 openldap readline
+    libelf uwimap binutils cyrus_sasl pam
+  ];
+  installPhase = ''
+    mkdir -p $out/bin
+    cp src/hhvm/hhvm $out/bin
+    cp bin/systemlib.php $out/bin
+  '';
+  patches = [./tbb.patch];
+
+  meta = {
+    description = "HipHop is a high performance PHP toolchain.";
+    homepage = https://github.com/facebook/hiphop-php;
+    platforms = ["x86_64-linux"];
+  };
+}
diff --git a/pkgs/development/interpreters/hiphopvm/tbb.patch b/pkgs/development/interpreters/hiphopvm/tbb.patch
new file mode 100644
index 00000000000..0dee06d00fd
--- /dev/null
+++ b/pkgs/development/interpreters/hiphopvm/tbb.patch
@@ -0,0 +1,13 @@
+diff --git a/CMake/FindTBB.cmake b/CMake/FindTBB.cmake
+index 6a09c85..977418c 100644
+--- a/CMake/FindTBB.cmake
++++ b/CMake/FindTBB.cmake
+@@ -164,7 +164,7 @@ mark_as_advanced(TBB_INCLUDE_DIR)
+ #-- Look for libraries
+ # GvdB: $ENV{TBB_ARCH_PLATFORM} is set by the build script tbbvars[.bat|.sh|.csh]
+ if (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+-    set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/$ENV{TBB_ARCH_PLATFORM}/lib")
++    set (TBB_LIBRARY_DIR "${_TBB_INSTALL_DIR}/lib/$ENV{TBB_ARCH_PLATFORM}")
+ else (NOT $ENV{TBB_ARCH_PLATFORM} STREQUAL "")
+     # HH: deprecated
+     message(STATUS "[Warning] FindTBB.cmake: The use of TBB_ARCHITECTURE and TBB_COMPILER is deprecated and may not be supported in future versions. Please set $ENV{TBB_ARCH_PLATFORM} (using tbbvars.[bat|csh|sh]).")
diff --git a/pkgs/development/interpreters/love/default.nix b/pkgs/development/interpreters/love/default.nix
index ee68f85725a..318a336faa6 100644
--- a/pkgs/development/interpreters/love/default.nix
+++ b/pkgs/development/interpreters/love/default.nix
@@ -1,58 +1,32 @@
-x@{builderDefsPackage
-  , lua5, mpg123, physfs, freetype, libdevil, openal, SDL, libvorbis
-  , libogg, flac, mesa, libtiff, libpng, libjpeg, libmodplug
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
+{ stdenv, fetchurl, pkgconfig
+, SDL, mesa, openal, lua5
+, libdevil, freetype, physfs
+, libmodplug, mpg123, libvorbis, libogg
+}:
 
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="love";
-    version="0.7.2";
-    name="${baseName}-${version}";
-    url="https://bitbucket.org/rude/love/downloads/${name}-linux-src.tar.gz";
-    hash="0s7jywkvydlshlgy11ilzngrnybmq5xlgzp2v2dhlffwrfqdqym5";
+stdenv.mkDerivation rec {
+  name = "love-0.8.0";
+  src = fetchurl {
+    url = "https://bitbucket.org/rude/love/downloads/${name}-linux-src.tar.gz";
+    sha256 = "1k4fcsa8zzi04ja179bmj24hvqcbm3icfvrvrzyz2gw9qwfclrwi";
   };
-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 = ["setVars" "fixSrc" "doConfigure" "doMakeInstall"];
-      
-  fixSrc  =a.fullDepEntry ''
-    sed -e '/typedef void (\*__GLXextFuncPtr)/d' -i src/modules/graphics/opengl/GLee.h
-  '' ["minInit" "doUnpack"];
+  buildInputs = [
+    pkgconfig SDL mesa openal lua5
+    libdevil freetype physfs libmodplug mpg123 libvorbis libogg
+  ];
 
-  setVars = a.noDepEntry ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${SDL}/include/SDL"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
+  NIX_CFLAGS_COMPILE = ''
+    -I${SDL}/include/SDL
+    -I${freetype}include/freetype2
   '';
 
   meta = {
+    homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = a.lib.licenses.zlib;
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://love2d.org/";
-    };
-  };
-}) x
+    license = "zlib";
 
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+  };
+}
diff --git a/pkgs/development/interpreters/lua-5/5.1.nix b/pkgs/development/interpreters/lua-5/5.1.nix
new file mode 100644
index 00000000000..8b1e1529095
--- /dev/null
+++ b/pkgs/development/interpreters/lua-5/5.1.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, readline}:
+
+let
+  dsoPatch = fetchurl {
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/lua-arch.patch?h=packages/lua51";
+    sha256 = "11fcyb4q55p4p7kdb8yp85xlw8imy14kzamp2khvcyxss4vw8ipw";
+    name = "lua-arch.patch";
+  };
+in
+stdenv.mkDerivation rec {
+  name = "lua-5.1.5";
+
+  src = fetchurl {
+    url = "http://www.lua.org/ftp/${name}.tar.gz";
+    sha256 = "2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333";
+  };
+
+  buildInputs = [ readline ];
+
+  patches = [ dsoPatch ];
+
+  configurePhase = ''
+    makeFlagsArray=( INSTALL_TOP=$out INSTALL_MAN=$out/share/man/man1 PLAT=linux CFLAGS="-O2 -fPIC" LDLAGS="-fPIC" )
+    installFlagsArray=( TO_BIN="lua luac" TO_LIB="liblua.a liblua.so liblua.so.5.1" INSTALL_DATA='cp -d' )
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/share/doc/lua" "$out/lib/pkgconfig"
+    mv "etc/lua.pc" "$out/lib/pkgconfig/"
+    mv "doc/"*.{gif,png,css,html} "$out/share/doc/lua/"
+    rmdir $out/{share,lib}/lua/5.1 $out/{share,lib}/lua
+  '';
+
+  meta = {
+    homepage = "http://www.lua.org";
+    description = "Lua is a powerful, fast, lightweight, embeddable scripting language.";
+    longDescription = ''
+      Lua combines simple procedural syntax with powerful data
+      description constructs based on associative arrays and extensible
+      semantics. Lua is dynamically typed, runs by interpreting bytecode
+      for a register-based virtual machine, and has automatic memory
+      management with incremental garbage collection, making it ideal
+      for configuration, scripting, and rapid prototyping.
+    '';
+    license = "MIT";
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/interpreters/octave/default.nix b/pkgs/development/interpreters/octave/default.nix
index 3ffdc415f88..73f13c11a7d 100644
--- a/pkgs/development/interpreters/octave/default.nix
+++ b/pkgs/development/interpreters/octave/default.nix
@@ -3,14 +3,14 @@ libX11, graphicsmagick, pcre, liblapack, texLive, pkgconfig, mesa, fltk,
 fftw, fftwSinglePrec, zlib, curl, qrupdate }:
 
 stdenv.mkDerivation rec {
-  name = "octave-3.6.2";
+  name = "octave-3.6.4";
   src = fetchurl {
     url = "mirror://gnu/octave/${name}.tar.bz2";
-    sha256 = "1bn48ldhx585iyrylnz59b6mb3wlpvmz2i3ri8q75s5ys29rpdhb";
+    sha256 = "0qn9s7jrjmrn6w3rvp8d7vfnymyv0spnxzrp9l7p8p8zb7wms67s";
   };
 
   buildInputs = [ gfortran readline ncurses perl flex texinfo qhull libX11
-    graphicsmagick pcre liblapack texLive pkgconfig mesa fltk zlib curl
+    graphicsmagick pcre liblapack pkgconfig mesa fltk zlib curl
     fftw fftwSinglePrec qrupdate ];
 
   doCheck = true;
diff --git a/pkgs/development/interpreters/octave/hg.nix b/pkgs/development/interpreters/octave/hg.nix
index a908ddc0fc8..f44efb94358 100644
--- a/pkgs/development/interpreters/octave/hg.nix
+++ b/pkgs/development/interpreters/octave/hg.nix
@@ -1,5 +1,5 @@
 {stdenv, fetchurl, gfortran, readline, ncurses, perl, flex,
- bison, autoconf, automake, sourceFromHead, getConfig, lib, atlas, gperf, python, glibc, gnuplot, texinfo, texLive, qhull, libX11}:
+ bison, autoconf, automake, sourceFromHead, config, lib, atlas, gperf, python, glibc, gnuplot, texinfo, texLive, qhull, libX11}:
 
 let commonBuildInputs = [gfortran readline ncurses perl glibc qhull libX11 texinfo]; in
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation ({
       license = "GPL-3";
     };
 } // (
-  if (getConfig ["octave" "devVersion"] false) then {
+  if config.octave.devVersion or false then {
     name = "octave-hg"; # developement version mercurial repo
     # REGION AUTO UPDATE:   { name="octave"; type = "hg"; url = "http://www.octave.org/hg/octave"; }
     src = sourceFromHead "octave-03b414516dd8.tar.gz"
@@ -27,7 +27,7 @@ stdenv.mkDerivation ({
         export HOME=$TMP
         '';
     buildInputs = commonBuildInputs ++ [ flex bison autoconf automake gperf gnuplot texLive ]
-                  ++ lib.optionals (getConfig ["octave" "atlas"] true) [ python atlas ];
+                  ++ lib.optionals (config.octave.atlas or true) [ python atlas ];
     # it does build, but documentation doesn't.. So just remove that directory
     # from the buildfile
     buildPhase = ''
@@ -44,6 +44,6 @@ stdenv.mkDerivation ({
       sha256 = "1lm4v85kdic4n5yxwzrdb0v6dc6nw06ljgx1q8hfkmi146kpg7s6";
     };
     buildInputs = commonBuildInputs ++ [ flex bison autoconf automake python ]
-                  ++ lib.optionals (getConfig ["octave" "atlas"] true) [ python atlas ];
+                  ++ lib.optionals (config.octave.atlas or true) [ python atlas ];
   }
 ))
diff --git a/pkgs/development/interpreters/perl/5.16/default.nix b/pkgs/development/interpreters/perl/5.16/default.nix
new file mode 100644
index 00000000000..288de63b4ae
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl }:
+
+let
+
+  libc = if stdenv.gcc.libc or null != null then stdenv.gcc.libc else "/usr";
+
+in
+
+stdenv.mkDerivation rec {
+  name = "perl-5.16.2";
+
+  src = fetchurl {
+    url = "mirror://cpan/src/${name}.tar.gz";
+    sha256 = "03nh8bqnjsdd5izjv3n2yfcxw4ck0llwww36jpbjbjgixwpqpy4f";
+  };
+
+  patches =
+    [ # Do not look in /usr etc. for dependencies.
+      ./no-sys-dirs.patch
+    ]
+    ++ stdenv.lib.optional stdenv.isDarwin ./no-libutil.patch;
+
+  # Build a thread-safe Perl with a dynamic libperls.o.  We need the
+  # "installstyle" option to ensure that modules are put under
+  # $out/lib/perl5 - this is the general default, but because $out
+  # contains the string "perl", Configure would select $out/lib.
+  # Miniperl needs -lm. perl needs -lrt.
+  configureFlags =
+    [ "-de"
+      "-Dcc=gcc"
+      "-Uinstallusrbinperl"
+      "-Dinstallstyle=lib/perl5"
+      "-Duseshrplib"
+      "-Dlocincpth=${libc}/include"
+      "-Dloclibpth=${libc}/lib"
+    ]
+    ++ stdenv.lib.optional (stdenv ? glibc) "-Dusethreads";
+
+  configureScript = "${stdenv.shell} ./Configure";
+
+  dontAddPrefix = true;
+
+  enableParallelBuilding = true;
+
+  preConfigure =
+    ''
+      configureFlags="$configureFlags -Dprefix=$out -Dman1dir=$out/share/man/man1 -Dman3dir=$out/share/man/man3"
+
+      ${stdenv.lib.optionalString stdenv.isArm ''
+        configureFlagsArray=(-Dldflags="-lm -lrt")
+      ''}
+    '';
+
+  preBuild = stdenv.lib.optionalString (!(stdenv ? gcc && stdenv.gcc.nativeTools))
+    ''
+      # Make Cwd work on NixOS (where we don't have a /bin/pwd).
+      substituteInPlace dist/Cwd/Cwd.pm --replace "'/bin/pwd'" "'$(type -tP pwd)'"
+    '';
+
+  setupHook = ./setup-hook.sh;
+
+  passthru.libPrefix = "lib/perl5/site_perl";
+}
diff --git a/pkgs/development/interpreters/perl/5.16/no-libutil.patch b/pkgs/development/interpreters/perl/5.16/no-libutil.patch
new file mode 100644
index 00000000000..9b749bccf32
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/no-libutil.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
+--- perl-5.14.2-orig/Configure	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/Configure	2012-02-16 17:24:50.779839039 +0100
+@@ -1368,7 +1368,7 @@
+ : List of libraries we want.
+ : If anyone needs extra -lxxx, put those in a hint file.
+ libswanted="sfio socket bind inet nsl nm ndbm gdbm dbm db malloc dl dld ld sun"
+-libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
++libswanted="$libswanted m crypt sec c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+ glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
diff --git a/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
new file mode 100644
index 00000000000..54ffb28e206
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/no-sys-dirs.patch
@@ -0,0 +1,152 @@
+diff -ru -x '*~' perl-5.14.2-orig/Configure perl-5.14.2/Configure
+--- perl-5.14.2-orig/Configure	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/Configure	2012-01-20 17:05:23.089223129 +0100
+@@ -106,15 +106,7 @@
+ fi
+ 
+ : Proper PATH setting
+-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
+-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
+-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
+-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
+-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
+-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
+-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
+-paths="$paths /sbin /usr/sbin /usr/libexec"
+-paths="$paths /system/gnu_library/bin"
++paths=''
+ 
+ for p in $paths
+ do
+@@ -1311,8 +1303,7 @@
+ archname=''
+ : Possible local include directories to search.
+ : Set locincpth to "" in a hint file to defeat local include searches.
+-locincpth="/usr/local/include /opt/local/include /usr/gnu/include"
+-locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
++locincpth=""
+ :
+ : no include file wanted by default
+ inclwanted=''
+@@ -1328,17 +1319,12 @@
+ archobjs=''
+ libnames=''
+ : change the next line if compiling for Xenix/286 on Xenix/386
+-xlibpth='/usr/lib/386 /lib/386'
++xlibpth=''
+ : Possible local library directories to search.
+-loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib"
+-loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib"
++loclibpth=""
+ 
+ : general looking path for locating libraries
+-glibpth="/lib /usr/lib $xlibpth"
+-glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/local/lib"
+-test -f /usr/shlib/libc.so && glibpth="/usr/shlib $glibpth"
+-test -f /shlib/libc.so     && glibpth="/shlib $glibpth"
+-test -d /usr/lib64         && glibpth="$glibpth /lib64 /usr/lib64 /usr/local/lib64"
++glibpth=""
+ 
+ : Private path used by Configure to find libraries.  Its value
+ : is prepended to libpth. This variable takes care of special
+@@ -1371,8 +1357,6 @@
+ libswanted="$libswanted m crypt sec util c cposix posix ucb bsd BSD"
+ : We probably want to search /usr/shlib before most other libraries.
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist.
+-glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'`
+-glibpth="/usr/shlib $glibpth"
+ : Do not use vfork unless overridden by a hint file.
+ usevfork=false
+ 
+@@ -2380,7 +2364,6 @@
+ zip
+ "
+ pth=`echo $PATH | sed -e "s/$p_/ /g"`
+-pth="$pth /lib /usr/lib"
+ for file in $loclist; do
+ 	eval xxx=\$$file
+ 	case "$xxx" in
+@@ -4785,7 +4768,7 @@
+ : Set private lib path
+ case "$plibpth" in
+ '') if ./mips; then
+-		plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
++		plibpth="$incpath/usr/lib"
+ 	fi;;
+ esac
+ case "$libpth" in
+@@ -8390,13 +8373,8 @@
+ echo " "
+ case "$sysman" in
+ '') 
+-	syspath='/usr/share/man/man1 /usr/man/man1'
+-	syspath="$syspath /usr/man/mann /usr/man/manl /usr/man/local/man1"
+-	syspath="$syspath /usr/man/u_man/man1"
+-	syspath="$syspath /usr/catman/u_man/man1 /usr/man/l_man/man1"
+-	syspath="$syspath /usr/local/man/u_man/man1 /usr/local/man/l_man/man1"
+-	syspath="$syspath /usr/man/man.L /local/man/man1 /usr/local/man/man1"
+-	sysman=`./loc . /usr/man/man1 $syspath`
++	syspath=''
++	sysman=''
+ 	;;
+ esac
+ if $test -d "$sysman"; then
+@@ -19721,9 +19699,10 @@
+ case "$full_ar" in
+ '') full_ar=$ar ;;
+ esac
++full_ar=ar
+ 
+ : Store the full pathname to the sed program for use in the C program
+-full_sed=$sed
++full_sed=sed
+ 
+ : see what type gids are declared as in the kernel
+ echo " "
+diff -ru -x '*~' perl-5.14.2-orig/ext/Errno/Errno_pm.PL perl-5.14.2/ext/Errno/Errno_pm.PL
+--- perl-5.14.2-orig/ext/Errno/Errno_pm.PL	2011-09-26 11:44:34.000000000 +0200
++++ perl-5.14.2/ext/Errno/Errno_pm.PL	2012-01-20 17:02:07.938138311 +0100
+@@ -137,11 +137,7 @@
+ 	if ($dep =~ /(\S+errno\.h)/) {
+ 	     $file{$1} = 1;
+ 	}
+-    } elsif ($^O eq 'linux' &&
+-	      $Config{gccversion} ne '' && 
+-	      $Config{gccversion} !~ /intel/i
+-	      # might be using, say, Intel's icc
+-	     ) {
++    } elsif (0) {
+ 	# Some Linuxes have weird errno.hs which generate
+ 	# no #file or #line directives
+ 	my $linux_errno_h = -e '/usr/include/errno.h' ?
+diff -ru -x '*~' perl-5.14.2-orig/hints/freebsd.sh perl-5.14.2/hints/freebsd.sh
+--- perl-5.14.2-orig/hints/freebsd.sh	2011-09-19 15:18:22.000000000 +0200
++++ perl-5.14.2/hints/freebsd.sh	2012-01-20 17:10:37.267924044 +0100
+@@ -118,21 +118,21 @@
+         objformat=`/usr/bin/objformat`
+         if [ x$objformat = xaout ]; then
+             if [ -e /usr/lib/aout ]; then
+-                libpth="/usr/lib/aout /usr/local/lib /usr/lib"
+-                glibpth="/usr/lib/aout /usr/local/lib /usr/lib"
++                libpth=""
++                glibpth=""
+             fi
+             lddlflags='-Bshareable'
+         else
+-            libpth="/usr/lib /usr/local/lib"
+-            glibpth="/usr/lib /usr/local/lib"
++            libpth=""
++            glibpth=""
+             ldflags="-Wl,-E "
+             lddlflags="-shared "
+         fi
+         cccdlflags='-DPIC -fPIC'
+         ;;
+ *)
+-       libpth="/usr/lib /usr/local/lib"
+-       glibpth="/usr/lib /usr/local/lib"
++       libpth=""
++       glibpth=""
+        ldflags="-Wl,-E "
+         lddlflags="-shared "
+         cccdlflags='-DPIC -fPIC'
diff --git a/pkgs/development/interpreters/perl/5.16/setup-hook.sh b/pkgs/development/interpreters/perl/5.16/setup-hook.sh
new file mode 100644
index 00000000000..6a144a7f780
--- /dev/null
+++ b/pkgs/development/interpreters/perl/5.16/setup-hook.sh
@@ -0,0 +1,5 @@
+addPerlLibPath () {
+    addToSearchPath PERL5LIB $1/lib/perl5/site_perl
+}
+
+envHooks=(${envHooks[@]} addPerlLibPath)
diff --git a/pkgs/development/interpreters/php/5.2.nix b/pkgs/development/interpreters/php/5.2.nix
deleted file mode 100644
index f98d178663f..00000000000
--- a/pkgs/development/interpreters/php/5.2.nix
+++ /dev/null
@@ -1,172 +0,0 @@
-args: with args;
-
-let
-
-  inherit (args.composableDerivation) composableDerivation edf wwf;
-
-in
-
-composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
-
-  version = "5.2.17";
-
-  name = "php-${version}";
-
-  buildInputs = ["flex" "bison" "pkgconfig"];
-
-  flags = {
-
-# much left to do here...
-
-    # SAPI modules:
-    
-      apxs2 = {
-        configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
-        buildInputs = [apacheHttpd];
-      };
-
-      # Extensions
-
-      curl = {
-        configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
-        buildInputs = [curl openssl];
-      };
-      
-      zlib = {
-        configureFlags = ["--with-zlib=${args.zlib}"];
-        buildInputs = [zlib];
-      };
-
-      libxml2 = {
-        configureFlags = [
-          "--with-libxml-dir=${libxml2}"
-          "--with-iconv-dir=${libiconv}"
-          ];
-        buildInputs = [ libxml2 ];
-      };
-
-      readline = {
-        configureFlags = ["--with-readline=${readline}"];
-        buildInputs = [ readline ];
-      };
-    
-      sqlite = {
-        configureFlags = ["--with-pdo-sqlite=${sqlite}"];
-        buildInputs = [ sqlite ];
-      };
-    
-      postgresql = {
-        configureFlags = ["--with-pgsql=${postgresql}"];
-        buildInputs = [ postgresql ];
-      };
-    
-      mysql = {
-        configureFlags = ["--with-mysql=${mysql}"];
-        buildInputs = [ mysql ];
-      };
-
-      mysqli = {
-        configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
-        buildInputs = [ mysql];
-      };
-
-      mysqli_embedded = {
-        configureFlags = ["--enable-embedded-mysqli"];
-        depends = "mysqli";
-        assertion = fixed.mysqliSupport;
-      };
-
-      pdo_mysql = {
-        configureFlags = ["--with-pdo-mysql=${mysql}"];
-        buildInputs = [ mysql ];
-      };
-    
-      bcmath = {
-        configureFlags = ["--enable-bcmath"];
-      };
-
-      gd = {
-        configureFlags = ["--with-gd=${args.gd}"];
-        buildInputs = [gd libpng libjpeg ];
-      };
-
-      soap = {
-        configureFlags = ["--enable-soap"];
-      };
-
-      sockets = {
-        configureFlags = ["--enable-sockets"];
-      };
-
-      openssl = {
-        configureFlags = ["--with-openssl=${args.openssl}"];
-        buildInputs = ["openssl"];
-      };
-
-      mbstring = {
-        configureFlags = ["--enable-mbstring"];
-      };
-
-      /*
-         php is build within this derivation in order to add the xdebug lines to the php.ini.
-         So both Apache and command line php both use xdebug without having to configure anything.
-         Xdebug could be put in its own derivation.
-      * /
-        meta = {
-                description = "debugging support for PHP";
-                homepage = http://xdebug.org;
-                license = "based on the PHP license - as is";
-                };
-      */
-    };
-
-  cfg = {
-    mysqlSupport = getConfig ["php" "mysql"] true;
-    mysqliSupport = getConfig ["php" "mysqli"] true;
-    pdo_mysqlSupport = getConfig ["php" "pdo_mysql"] true;
-    libxml2Support = getConfig ["php" "libxml2"] true;
-    apxs2Support = getConfig ["php" "apxs2"] true;
-    bcmathSupport = getConfig ["php" "bcmath"] true;
-    socketsSupport = getConfig ["php" "sockets"] true;
-    curlSupport = getConfig ["php" "curl"] true;
-    gettextSupport = getConfig ["php" "gettext"] true;
-    postgresqlSupport = getConfig ["php" "postgresql"] true;
-    readlineSupport = getConfig ["php" "readline"] true;
-    sqliteSupport = getConfig ["php" "sqlite"] true;
-    soapSupport = getConfig ["php" "soap"] true;
-    zlibSupport = getConfig ["php" "zlib"] true;
-    opensslSupport = getConfig ["php" "openssl"] true;
-    mbstringSupport = getConfig ["php" "mbstring"] true;
-    gdSupport = getConfig ["php" "gd"] true;
-  };
-
-  configurePhase = ''
-    iniFile=$out/etc/php-recommended.ini
-    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out  $configureFlags
-    echo configurePhase end
-  '';
-
-  installPhase = ''
-    unset installPhase; installPhase;
-    cp php.ini-${ if builtins.lessThan (builtins.compareVersions version "5.3") 0
-        then "recommended" /* < PHP 5.3 */
-        else "production" /* >= PHP 5.3 */
-    } $iniFile
-  '';
-
-  src = args.fetchurl {
-    url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
-    sha256 = "0v0i7zjp1a2c60imn58xjqcczmiglnfnwdkgwl0bfai4xh9yn6z8";
-    name = "php-${version}.tar.bz2";
-  };
-
-  meta = {
-    description = "The PHP language runtime engine";
-    homepage = http://www.php.net/;
-    license = "PHP-3";
-  };
-
-  patches = [./fix.patch];
-
-})
diff --git a/pkgs/development/interpreters/php/5.3.nix b/pkgs/development/interpreters/php/5.3.nix
index b4f00ab1f7d..35508230ebd 100644
--- a/pkgs/development/interpreters/php/5.3.nix
+++ b/pkgs/development/interpreters/php/5.3.nix
@@ -1,25 +1,28 @@
-args: with args;
+{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
+, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
+, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype
+, libxslt, libmcrypt, bzip2, icu }:
 
 let
-
-  inherit (args.composableDerivation) composableDerivation edf wwf;
-
+  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
 in
 
-composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
+composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
 
-  version = "5.3.15";
+  version = "5.3.25";
 
   name = "php-${version}";
 
+  enableParallelBuilding = true;
+
   buildInputs = ["flex" "bison" "pkgconfig"];
 
   flags = {
 
-# much left to do here...
+    # much left to do here...
 
     # SAPI modules:
-    
+
       apxs2 = {
         configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
         buildInputs = [apacheHttpd];
@@ -28,23 +31,23 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
       # Extensions
 
       curl = {
-        configureFlags = ["--with-curl=${args.curl}" "--with-curlwrappers"];
+        configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
         buildInputs = [curl openssl];
       };
-      
+
       zlib = {
-        configureFlags = ["--with-zlib=${args.zlib}"];
+        configureFlags = ["--with-zlib=${zlib}"];
         buildInputs = [zlib];
       };
 
       libxml2 = {
         configureFlags = [
           "--with-libxml-dir=${libxml2}"
-          "--with-iconv-dir=${libiconv}"
+          #"--with-iconv-dir=${libiconv}"
           ];
         buildInputs = [ libxml2 ];
       };
-    
+
       readline = {
         configureFlags = ["--with-readline=${readline}"];
         buildInputs = [ readline ];
@@ -54,12 +57,12 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
         configureFlags = ["--with-pdo-sqlite=${sqlite}"];
         buildInputs = [ sqlite ];
       };
-    
+
       postgresql = {
         configureFlags = ["--with-pgsql=${postgresql}"];
         buildInputs = [ postgresql ];
       };
-    
+
       mysql = {
         configureFlags = ["--with-mysql=${mysql}"];
         buildInputs = [ mysql ];
@@ -80,14 +83,14 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
         configureFlags = ["--with-pdo-mysql=${mysql}"];
         buildInputs = [ mysql ];
       };
-    
+
       bcmath = {
         configureFlags = ["--enable-bcmath"];
       };
 
       gd = {
-        configureFlags = ["--with-gd=${args.gd}"];
-        buildInputs = [gd libpng libjpeg ];
+        configureFlags = ["--with-gd=${gd} --with-freetype-dir=${freetype}"];
+        buildInputs = [gd libpng libjpeg freetype];
       };
 
       soap = {
@@ -99,7 +102,7 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
       };
 
       openssl = {
-        configureFlags = ["--with-openssl=${args.openssl}"];
+        configureFlags = ["--with-openssl=${openssl}"];
         buildInputs = ["openssl"];
       };
 
@@ -107,6 +110,43 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
         configureFlags = ["--enable-mbstring"];
       };
 
+      gettext = {
+        configureFlags = ["--with-gettext=${gettext}"];
+        buildInputs = [gettext];
+      };
+
+      intl = {
+        configureFlags = ["--enable-intl"];
+        buildInputs = [icu];
+      };
+
+      exif = {
+        configureFlags = ["--enable-exif"];
+      };
+
+      xsl = {
+        configureFlags = ["--with-xsl=${libxslt}"];
+        buildInputs = [libxslt];
+      };
+
+      mcrypt = {
+        configureFlags = ["--with-mcrypt=${libmcrypt}"];
+        buildInputs = [libmcryptOverride];
+      };
+
+      bz2 = {
+        configureFlags = ["--with-bz2=${bzip2}"];
+        buildInputs = [bzip2];
+      };
+
+      zip = {
+        configureFlags = ["--enable-zip"];
+      };
+
+      ftp = {
+        configureFlags = ["--enable-ftp"];
+      };
+
       /*
          php is build within this derivation in order to add the xdebug lines to the php.ini.
          So both Apache and command line php both use xdebug without having to configure anything.
@@ -121,29 +161,36 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
     };
 
   cfg = {
-    mysqlSupport = getConfig ["php" "mysql"] true;
-    mysqliSupport = getConfig ["php" "mysqli"] true;
-    pdo_mysqlSupport = getConfig ["php" "pdo_mysql"] true;
-    libxml2Support = getConfig ["php" "libxml2"] true;
-    apxs2Support = getConfig ["php" "apxs2"] true;
-    bcmathSupport = getConfig ["php" "bcmath"] true;
-    socketsSupport = getConfig ["php" "sockets"] true;
-    curlSupport = getConfig ["php" "curl"] true;
-    gettextSupport = getConfig ["php" "gettext"] true;
-    postgresqlSupport = getConfig ["php" "postgresql"] true;
-    readlineSupport = getConfig ["php" "readline"] true;
-    sqliteSupport = getConfig ["php" "sqlite"] true;
-    soapSupport = getConfig ["php" "soap"] true;
-    zlibSupport = getConfig ["php" "zlib"] true;
-    opensslSupport = getConfig ["php" "openssl"] true;
-    mbstringSupport = getConfig ["php" "mbstring"] true;
-    gdSupport = getConfig ["php" "gd"] true;
+    mysqlSupport = config.php.mysql or true;
+    mysqliSupport = config.php.mysqli or true;
+    pdo_mysqlSupport = config.php.pdo_mysql or true;
+    libxml2Support = config.php.libxml2 or true;
+    apxs2Support = config.php.apxs2 or true;
+    bcmathSupport = config.php.bcmath or true;
+    socketsSupport = config.php.sockets or true;
+    curlSupport = config.php.curl or true;
+    gettextSupport = config.php.gettext or true;
+    postgresqlSupport = config.php.postgresql or true;
+    readlineSupport = config.php.readline or true;
+    sqliteSupport = config.php.sqlite or true;
+    soapSupport = config.php.soap or true;
+    zlibSupport = config.php.zlib or true;
+    opensslSupport = config.php.openssl or true;
+    mbstringSupport = config.php.mbstring or true;
+    gdSupport = config.php.gd or true;
+    intlSupport = config.php.intl or true;
+    exifSupport = config.php.exif or true;
+    xslSupport = config.php.xsl or false;
+    mcryptSupport = config.php.mcrypt or false;
+    bz2Support = config.php.bz2 or false;
+    zipSupport = config.php.zip or true;
+    ftpSupport = config.php.ftp or true;
   };
 
   configurePhase = ''
     iniFile=$out/etc/php-recommended.ini
     [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
-    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out  $configureFlags
+    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
     echo configurePhase end
   '';
 
@@ -152,9 +199,9 @@ composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
     cp php.ini-production $iniFile
   '';
 
-  src = args.fetchurl {
+  src = fetchurl {
     url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
-    sha256 = "1vzij845n2akh2lkpacgdc5r0f7nw6pk9l9vi1h8l8k4krjjbdzr";
+    sha256 = "15dwks0823m0vc3qv58yxfvchwx9ydg5gjvjy8kpc5w3syras76m";
     name = "php-${version}.tar.bz2";
   };
 
diff --git a/pkgs/development/interpreters/php/5.4.nix b/pkgs/development/interpreters/php/5.4.nix
new file mode 100644
index 00000000000..3c200f9c5c1
--- /dev/null
+++ b/pkgs/development/interpreters/php/5.4.nix
@@ -0,0 +1,225 @@
+{ stdenv, fetchurl, composableDerivation, autoconf, automake, flex, bison
+, apacheHttpd, mysql, libxml2, readline, zlib, curl, gd, postgresql, gettext
+, openssl, pkgconfig, sqlite, config, libiconv, libjpeg, libpng, freetype
+, libxslt, libmcrypt, bzip2, icu }:
+
+let
+  libmcryptOverride = libmcrypt.override { disablePosixThreads = true; };
+in
+
+composableDerivation.composableDerivation {} ( fixed : let inherit (fixed.fixed) version; in {
+
+  version = "5.4.15";
+
+  name = "php-${version}";
+
+  enableParallelBuilding = true;
+
+  buildInputs = ["flex" "bison" "pkgconfig"];
+
+  flags = {
+
+    # much left to do here...
+
+    # SAPI modules:
+
+      apxs2 = {
+        configureFlags = ["--with-apxs2=${apacheHttpd}/bin/apxs"];
+        buildInputs = [apacheHttpd];
+      };
+
+      # Extensions
+
+      curl = {
+        configureFlags = ["--with-curl=${curl}" "--with-curlwrappers"];
+        buildInputs = [curl openssl];
+      };
+
+      zlib = {
+        configureFlags = ["--with-zlib=${zlib}"];
+        buildInputs = [zlib];
+      };
+
+      libxml2 = {
+        configureFlags = [
+          "--with-libxml-dir=${libxml2}"
+          #"--with-iconv-dir=${libiconv}"
+          ];
+        buildInputs = [ libxml2 ];
+      };
+
+      readline = {
+        configureFlags = ["--with-readline=${readline}"];
+        buildInputs = [ readline ];
+      };
+
+      sqlite = {
+        configureFlags = ["--with-pdo-sqlite=${sqlite}"];
+        buildInputs = [ sqlite ];
+      };
+
+      postgresql = {
+        configureFlags = ["--with-pgsql=${postgresql}"];
+        buildInputs = [ postgresql ];
+      };
+
+      mysql = {
+        configureFlags = ["--with-mysql=${mysql}"];
+        buildInputs = [ mysql ];
+      };
+
+      mysqli = {
+        configureFlags = ["--with-mysqli=${mysql}/bin/mysql_config"];
+        buildInputs = [ mysql];
+      };
+
+      mysqli_embedded = {
+        configureFlags = ["--enable-embedded-mysqli"];
+        depends = "mysqli";
+        assertion = fixed.mysqliSupport;
+      };
+
+      pdo_mysql = {
+        configureFlags = ["--with-pdo-mysql=${mysql}"];
+        buildInputs = [ mysql ];
+      };
+
+      bcmath = {
+        configureFlags = ["--enable-bcmath"];
+      };
+
+      gd = {
+        # FIXME: Our own gd package doesn't work, see https://bugs.php.net/bug.php?id=60108.
+        configureFlags = ["--with-gd --with-freetype-dir=${freetype} --with-png-dir=${libpng}"];
+        buildInputs = [ libpng libjpeg freetype ];
+      };
+
+      soap = {
+        configureFlags = ["--enable-soap"];
+      };
+
+      sockets = {
+        configureFlags = ["--enable-sockets"];
+      };
+
+      openssl = {
+        configureFlags = ["--with-openssl=${openssl}"];
+        buildInputs = ["openssl"];
+      };
+
+      mbstring = {
+        configureFlags = ["--enable-mbstring"];
+      };
+
+      gettext = {
+        configureFlags = ["--with-gettext=${gettext}"];
+        buildInputs = [gettext];
+      };
+
+      intl = {
+        configureFlags = ["--enable-intl"];
+        buildInputs = [icu];
+      };
+
+      exif = {
+        configureFlags = ["--enable-exif"];
+      };
+
+      xsl = {
+        configureFlags = ["--with-xsl=${libxslt}"];
+        buildInputs = [libxslt];
+      };
+
+      mcrypt = {
+        configureFlags = ["--with-mcrypt=${libmcrypt}"];
+        buildInputs = [libmcryptOverride];
+      };
+
+      bz2 = {
+        configureFlags = ["--with-bz2=${bzip2}"];
+        buildInputs = [bzip2];
+      };
+
+      zip = {
+        configureFlags = ["--enable-zip"];
+      };
+
+      ftp = {
+        configureFlags = ["--enable-ftp"];
+      };
+
+      /*
+         php is build within this derivation in order to add the xdebug lines to the php.ini.
+         So both Apache and command line php both use xdebug without having to configure anything.
+         Xdebug could be put in its own derivation.
+      * /
+        meta = {
+                description = "debugging support for PHP";
+                homepage = http://xdebug.org;
+                license = "based on the PHP license - as is";
+                };
+      */
+    };
+
+  cfg = {
+    mysqlSupport = config.php.mysql or true;
+    mysqliSupport = config.php.mysqli or true;
+    pdo_mysqlSupport = config.php.pdo_mysql or true;
+    libxml2Support = config.php.libxml2 or true;
+    apxs2Support = config.php.apxs2 or true;
+    bcmathSupport = config.php.bcmath or true;
+    socketsSupport = config.php.sockets or true;
+    curlSupport = config.php.curl or true;
+    gettextSupport = config.php.gettext or true;
+    postgresqlSupport = config.php.postgresql or true;
+    readlineSupport = config.php.readline or true;
+    sqliteSupport = config.php.sqlite or true;
+    soapSupport = config.php.soap or true;
+    zlibSupport = config.php.zlib or true;
+    opensslSupport = config.php.openssl or true;
+    mbstringSupport = config.php.mbstring or true;
+    gdSupport = config.php.gd or true;
+    intlSupport = config.php.intl or true;
+    exifSupport = config.php.exif or true;
+    xslSupport = config.php.xsl or false;
+    mcryptSupport = config.php.mcrypt or false;
+    bz2Support = config.php.bz2 or false;
+    zipSupport = config.php.zip or true;
+    ftpSupport = config.php.ftp or true;
+  };
+
+  configurePhase = ''
+    # Don't record the configure flags since this causes unnecessary
+    # runtime dependencies.
+    for i in main/build-defs.h.in scripts/php-config.in; do
+      substituteInPlace $i \
+        --replace '@CONFIGURE_COMMAND@' '(omitted)' \
+        --replace '@CONFIGURE_OPTIONS@' "" \
+        --replace '@PHP_LDFLAGS@' ""
+    done
+
+    iniFile=$out/etc/php-recommended.ini
+    [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
+    ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out $configureFlags
+  '';
+
+  installPhase = ''
+    unset installPhase; installPhase;
+    cp php.ini-production $iniFile
+  '';
+
+  src = fetchurl {
+    url = "http://nl.php.net/get/php-${version}.tar.bz2/from/this/mirror";
+    sha256 = "0dh159svdrakvm9nsyg3yyln7cqqzpxgs2163cqxplnc93d8a8id";
+    name = "php-${version}.tar.bz2";
+  };
+
+  meta = {
+    description = "The PHP language runtime engine";
+    homepage = http://www.php.net/;
+    license = "PHP-3";
+  };
+
+  patches = [ ./fix-5.4.patch ];
+
+})
diff --git a/pkgs/development/interpreters/php/fix-5.4.patch b/pkgs/development/interpreters/php/fix-5.4.patch
new file mode 100644
index 00000000000..51d98549eee
--- /dev/null
+++ b/pkgs/development/interpreters/php/fix-5.4.patch
@@ -0,0 +1,68 @@
+diff -ru php-5.4.14/configure php-5.4.14-new/configure
+--- php-5.4.14/configure	2013-04-10 09:53:26.000000000 +0200
++++ php-5.4.14-new/configure	2013-04-22 17:13:55.039043622 +0200
+@@ -6513,7 +6513,7 @@
+ 
+   case $host_alias in
+   *aix*)
+-    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
++    APXS_LIBEXECDIR="$prefix/modules"
+     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
+     PHP_AIX_LDFLAGS="-Wl,-brtl"
+     build_type=shared
+@@ -6706,7 +6706,7 @@
+   if test "$?" != "0"; then
+     APACHE_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option
+   else
+-    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++    APXS_LIBEXECDIR="$prefix/modules"
+     if test -z `$APXS -q SYSCONFDIR`; then
+       APACHE_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -7909,7 +7909,7 @@
+    { (exit 1); exit 1; }; }
+   fi
+ 
+-  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++  APXS_LIBEXECDIR="$prefix/modules"
+   if test -z `$APXS -q SYSCONFDIR`; then
+     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -8779,7 +8779,7 @@
+    { (exit 1); exit 1; }; }
+   fi
+ 
+-  APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++  APXS_LIBEXECDIR="$prefix/modules"
+   if test -z `$APXS -q SYSCONFDIR`; then
+     INSTALL_IT="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+                  $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -9634,7 +9634,7 @@
+ 
+   case $host_alias in
+   *aix*)
+-    APXS_LIBEXECDIR=`$APXS -q LIBEXECDIR`
++    APXS_LIBEXECDIR="$prefix/modules"
+     EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-brtl -Wl,-bI:$APXS_LIBEXECDIR/httpd.exp"
+     PHP_AIX_LDFLAGS="-Wl,-brtl"
+     build_type=shared
+@@ -9827,7 +9827,7 @@
+   if test "$?" != "0"; then
+     APACHE_HOOKS_INSTALL="$APXS -i -a -n php5 $SAPI_SHARED" # Old apxs does not have -S option
+   else
+-    APXS_LIBEXECDIR='$(INSTALL_ROOT)'`$APXS -q LIBEXECDIR`
++    APXS_LIBEXECDIR="$prefix/modules"
+     if test -z `$APXS -q SYSCONFDIR`; then
+       APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
+                        $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+@@ -59657,9 +59657,7 @@
+ 
+ 
+ if test "$PHP_GETTEXT" != "no"; then
+-  for i in $PHP_GETTEXT /usr/local /usr; do
+-    test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
+-  done
++  GETTEXT_DIR=$PHP_GETTEXT
+ 
+   if test -z "$GETTEXT_DIR"; then
+     { { $as_echo "$as_me:$LINENO: error: Cannot locate header file libintl.h" >&5
diff --git a/pkgs/development/interpreters/php/fix.patch b/pkgs/development/interpreters/php/fix.patch
index 1cec8fea0fe..02f2c9c6c93 100644
--- a/pkgs/development/interpreters/php/fix.patch
+++ b/pkgs/development/interpreters/php/fix.patch
@@ -54,3 +54,25 @@
      if test -z `$APXS -q SYSCONFDIR`; then
        APACHE_HOOKS_INSTALL="\$(mkinstalldirs) '$APXS_LIBEXECDIR' && \
                         $APXS -S LIBEXECDIR='$APXS_LIBEXECDIR' \
+diff -rc php-5.3.18/configure php-5.3.18-new/configure
+*** php-5.3.18/configure	2012-10-17 18:29:10.000000000 +0200
+--- php-5.3.18-new/configure	2012-11-13 05:36:24.730136551 +0100
+***************
+*** 45113,45121 ****
+  
+  
+  if test "$PHP_GETTEXT" != "no"; then
+!   for i in $PHP_GETTEXT /usr/local /usr; do
+!     test -r $i/include/libintl.h && GETTEXT_DIR=$i && break
+!   done
+  
+    if test -z "$GETTEXT_DIR"; then
+      { echo "configure: error: Cannot locate header file libintl.h" 1>&2; exit 1; }
+--- 45113,45119 ----
+  
+  
+  if test "$PHP_GETTEXT" != "no"; then
+!   GETTEXT_DIR=$PHP_GETTEXT
+  
+    if test -z "$GETTEXT_DIR"; then
+      { echo "configure: error: Cannot locate header file libintl.h" 1>&2; exit 1; }
diff --git a/pkgs/development/interpreters/plt-scheme/default.nix b/pkgs/development/interpreters/plt-scheme/default.nix
deleted file mode 100644
index f3d68c931e6..00000000000
--- a/pkgs/development/interpreters/plt-scheme/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-args: with args; 
-let version = lib.attrByPath ["version"] "4.2.4" args; in
-rec {
-  src = fetchurl {
-    url = "ftp://infogroep.be/pub/plt/bundles/${version}/plt/plt-${version}-src-unix.tgz";
-    sha256 = "05azb9k0m1sp3qm3all4s39m97xwrbnqcys2vgc888nhxbff4d6g";
-  };
-
-  buildInputs = [cairo fontconfig freetype libjpeg libpng openssl 
-    libXaw libXft perl mesa libX11 libXrender libICE xproto renderproto 
-    pixman libSM libxcb libXext xextproto libXmu libXt zlib which];
-  configureFlags = ["--enable-shared" "--enable-pthreads" "--with-x"];
-  goSrcDir = "cd src";
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];
-
-  preConfigure = fullDepEntry (''
-    sed -e 's@/usr/bin/uname@'"$(which uname)"'@g' -i configure
-  '') ["minInit" "addInputs" "doUnpack"];
-      
-  name = "plt-scheme" + version;
-  meta = {
-    description = "PLT scheme environment";
-    homepage = http://plt-scheme.org/ ;
-    license = "LGPL-2.1";
-    licenses = ["LGPL-2.1"];
-  };
-}
diff --git a/pkgs/development/interpreters/pure/default.nix b/pkgs/development/interpreters/pure/default.nix
index dd1982e836d..83a1c0ac500 100644
--- a/pkgs/development/interpreters/pure/default.nix
+++ b/pkgs/development/interpreters/pure/default.nix
@@ -1,5 +1,5 @@
 x@{builderDefsPackage
-  , llvm, gmp, mpfr, readline
+  , llvm, gmp, mpfr, readline, bison, flex
   , ...}:
 builderDefsPackage
 (a :  
@@ -12,11 +12,11 @@ let
   sourceInfo = rec {
     baseName="pure";
     project="pure-lang";
-    version="0.49";
+    version="0.56";
     name="${baseName}-${version}";
     extension="tar.gz";
     url="http://${project}.googlecode.com/files/${name}.${extension}";
-    hash="0kkrcmmqks82g3qlkvs3cd23v6b5948rw3xsdadd1jidh74jg33x";
+    hash="1ll29j31lp7ymp1kq57328q8md7pkp8jmwsadp67j4cdlzc3zdhj";
   };
 in
 rec {
@@ -29,8 +29,10 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
+  phaseNames = ["doPatch" "doConfigure" "doMakeInstall"];
+
+  patches = [ ./new-gcc.patch ];
+
   meta = {
     description = "A purely functional programming language based on term rewriting";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/interpreters/pure/new-gcc.patch b/pkgs/development/interpreters/pure/new-gcc.patch
new file mode 100644
index 00000000000..ea2cd845059
--- /dev/null
+++ b/pkgs/development/interpreters/pure/new-gcc.patch
@@ -0,0 +1,62 @@
+diff --git a/runtime.cc b/runtime.cc
+index 04cbc40..54a0b43 100644
+--- a/runtime.cc
++++ b/runtime.cc
+@@ -13121,39 +13121,6 @@ unsigned int sleep(unsigned int secs)
+ }
+ #endif
+ 
+-/* Horrible kludge to get round, trunc and the inverse hyperbolic functions
+-   from libmingwex.a (these are in C99, but not in the Windows system
+-   libraries, and LLVM doesn't know how to get them either). */
+-
+-extern "C"
+-double __round(double x)
+-{
+-  return round(x);
+-}
+-
+-extern "C"
+-double __trunc(double x)
+-{
+-  return trunc(x);
+-}
+-
+-extern "C"
+-double __asinh(double x)
+-{
+-  return asinh(x);
+-}
+-
+-extern "C"
+-double __acosh(double x)
+-{
+-  return acosh(x);
+-}
+-
+-extern "C"
+-double __atanh(double x)
+-{
+-  return atanh(x);
+-}
+ 
+ /* File type bits. */
+ 
+diff --git a/util.hh b/util.hh
+index ae95b79..eab3330 100644
+--- a/util.hh
++++ b/util.hh
+@@ -58,13 +58,6 @@ char *default_encoding();
+ double my_strtod(const char  *nptr, char **endptr);
+ char *my_formatd(char *buffer, const char  *format, double d);
+ 
+-/* Windows doesn't have strptime, so we provide a suitable replacement from
+-   GNU libc (see strptime.c). */
+-
+-#ifndef HAVE_STRPTIME
+-extern "C"
+-char *strptime(const char *s, const char *format, struct tm *tm);
+-#endif
+ 
+ /* Windows doesn't have mkstemp, so we provide a suitable replacement. */
+ 
diff --git a/pkgs/development/interpreters/python/2.6/default.nix b/pkgs/development/interpreters/python/2.6/default.nix
index f87e1e3810f..f264e4179e7 100644
--- a/pkgs/development/interpreters/python/2.6/default.nix
+++ b/pkgs/development/interpreters/python/2.6/default.nix
@@ -9,11 +9,13 @@ with stdenv.lib;
 let
 
   majorVersion = "2.6";
-  version = "${majorVersion}.7";
+  version = "${majorVersion}.8";
 
+  # http://www.python.org/download/releases/2.6.8/
+  # md5 taken from webpage, python 2.6 will receive security fixes until Oct 2013
   src = fetchurl {
     url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.bz2";
-    sha256 = "0p0fd8i533zsdm6gc0jmhmdifccx4v064mh0i1hl2s6fcjhc20j5";
+    md5 = "c6e0420a21d8b23dee8b0195c9b9a125";
   };
   
   patches =
@@ -51,6 +53,10 @@ let
         for i in /usr /sw /opt /pkg; do
           substituteInPlace ./setup.py --replace $i /no-such-path
         done
+      '' + optionalString (stdenv ? gcc && stdenv.gcc.libc != null) ''
+        for i in Lib/plat-*/regen; do
+          substituteInPlace $i --replace /usr/include/ ${stdenv.gcc.libc}/include/
+        done
       '';
 
     NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2";
@@ -60,6 +66,10 @@ let
     postInstall =
       ''
         rm -rf "$out/lib/python${majorVersion}/test"
+        ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb
+        ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion}
+        mv $out/share/man/man1/{python.1,python2.6.1}
+        ln -s $out/share/man/man1/{python2.6.1,python.1}
       '';
 
     passthru = {
diff --git a/pkgs/development/interpreters/python/2.7/default.nix b/pkgs/development/interpreters/python/2.7/default.nix
index 09860310541..9fb2ab377df 100644
--- a/pkgs/development/interpreters/python/2.7/default.nix
+++ b/pkgs/development/interpreters/python/2.7/default.nix
@@ -74,6 +74,9 @@ let
     postInstall =
       ''
         rm -rf "$out/lib/python${majorVersion}/test"
+        ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb
+        ln -s $out/lib/python${majorVersion}/pdb.py $out/bin/pdb${majorVersion}
+        ln -s $out/share/man/man1/{python2.7.1.gz,python.1.gz}
       '';
 
     passthru = {
diff --git a/pkgs/development/interpreters/python/3.2/default.nix b/pkgs/development/interpreters/python/3.3/default.nix
index 64442f2e35b..1471abe287a 100644
--- a/pkgs/development/interpreters/python/3.2/default.nix
+++ b/pkgs/development/interpreters/python/3.3/default.nix
@@ -16,8 +16,8 @@ assert readline != null -> ncurses != null;
 with stdenv.lib;
 
 let
-  majorVersion = "3.2";
-  version = "${majorVersion}.3";
+  majorVersion = "3.3";
+  version = "${majorVersion}.1";
 
   buildInputs = filter (p: p != null) [
     zlib bzip2 gdbm sqlite db4 readline ncurses openssl tcl tk libX11 xproto
@@ -28,8 +28,8 @@ stdenv.mkDerivation {
   inherit majorVersion version;
 
   src = fetchurl {
-    url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.bz2";
-    sha256 = "5648ec81f93870fde2f0aa4ed45c8718692b15ce6fd9ed309bfb827ae12010aa";
+    url = "http://www.python.org/ftp/python/3.3.1/Python-${version}.tar.bz2";
+    sha256 = "0mm7nvdd85p6b26jwshy2dhicf0b06mb5lrl564i3c5q7jgs1vll";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/interpreters/python/3.2/setup-hook.sh b/pkgs/development/interpreters/python/3.3/setup-hook.sh
index e6fa34bf54b..e6fa34bf54b 100644
--- a/pkgs/development/interpreters/python/3.2/setup-hook.sh
+++ b/pkgs/development/interpreters/python/3.3/setup-hook.sh
diff --git a/pkgs/development/interpreters/python/docs/2.6-html.nix b/pkgs/development/interpreters/python/docs/2.6-html.nix
new file mode 100644
index 00000000000..2b41f122fa9
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.6-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python26-docs-html-2.6.8";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-html.tar.bz2;
+    sha256 = "09kznik9ahmnrqw9gkr7mjv3b3zr258f2fm27n12hrrwwsaszkni";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python26
+    cp -R ./ $out/share/doc/python26/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.6-pdf-a4.nix b/pkgs/development/interpreters/python/docs/2.6-pdf-a4.nix
new file mode 100644
index 00000000000..ec031821a03
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.6-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python26-docs-pdf-a4-2.6.8";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-pdf-a4.tar.bz2;
+    sha256 = "07k8n9zhd59s1yn8ahsizkaqnv969p0f2c2acxgxrxhhyy842pp8";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python26
+    cp -R ./ $out/share/doc/python26/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.6-pdf-letter.nix b/pkgs/development/interpreters/python/docs/2.6-pdf-letter.nix
new file mode 100644
index 00000000000..7cacf777834
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.6-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python26-docs-pdf-letter-2.6.8";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-pdf-letter.tar.bz2;
+    sha256 = "01r87m8hb7f9ql4j9zcjcrr9150nsk23sj8cy02vygr83sc1ldmq";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python26
+    cp -R ./ $out/share/doc/python26/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.6-text.nix b/pkgs/development/interpreters/python/docs/2.6-text.nix
new file mode 100644
index 00000000000..eb394a3f3e2
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.6-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python26-docs-text-2.6.8";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.6.8/python-2.6.8-docs-text.tar.bz2;
+    sha256 = "05wsdh6ilgkclgak09fq7fsx5kflkmqq8dyxi2rpydx289cw3a8c";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python26
+    cp -R ./ $out/share/doc/python26/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.7-html.nix b/pkgs/development/interpreters/python/docs/2.7-html.nix
new file mode 100644
index 00000000000..3885b43960f
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.7-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python27-docs-html-2.7.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-html.tar.bz2;
+    sha256 = "1hg92n0mzl9w6j33b2h0bf2vy6fsxnpxfdc3qw760vcm0y00155j";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python27
+    cp -R ./ $out/share/doc/python27/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.7-pdf-a4.nix b/pkgs/development/interpreters/python/docs/2.7-pdf-a4.nix
new file mode 100644
index 00000000000..d8dde17ac66
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.7-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python27-docs-pdf-a4-2.7.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-pdf-a4.tar.bz2;
+    sha256 = "13da88panq5b6qfhf8k4dgqgxkg4ydcac5cx69a3f35s1w90xdjr";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python27
+    cp -R ./ $out/share/doc/python27/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.7-pdf-letter.nix b/pkgs/development/interpreters/python/docs/2.7-pdf-letter.nix
new file mode 100644
index 00000000000..32581cd229a
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.7-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python27-docs-pdf-letter-2.7.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-pdf-letter.tar.bz2;
+    sha256 = "0x41phsdrpivhzkchswsliyx3a10n7gzc9irkrw6rz22j81bfydg";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python27
+    cp -R ./ $out/share/doc/python27/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/2.7-text.nix b/pkgs/development/interpreters/python/docs/2.7-text.nix
new file mode 100644
index 00000000000..59019238301
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/2.7-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python27-docs-text-2.7.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/2.7.3/python-2.7.3-docs-text.tar.bz2;
+    sha256 = "1rxlb3jhh3892y65i45nk1y2lx981fr22a5hmfkp9gvjvdykjnzp";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python27
+    cp -R ./ $out/share/doc/python27/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.0-html.nix b/pkgs/development/interpreters/python/docs/3.0-html.nix
new file mode 100644
index 00000000000..fb793da3e5f
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.0-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python30-docs-html-3.0.1";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.0.1/python-3.0.1-docs-html.tar.bz2;
+    sha256 = "0ybjnhg8qfr9kc4axm5xlghkz9dmsg6b1caj6m4gz28q89vggv3c";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python30
+    cp -R ./ $out/share/doc/python30/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.0-pdf-a4.nix b/pkgs/development/interpreters/python/docs/3.0-pdf-a4.nix
new file mode 100644
index 00000000000..e4b185a11c6
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.0-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python30-docs-pdf-a4-3.0.1";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.0.1/python-3.0.1-docs-pdf-a4.tar.bz2;
+    sha256 = "1qgcydqxxhy317lkzzs2v5as4hcwcblir8y3mdr173qsg51iggra";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python30
+    cp -R ./ $out/share/doc/python30/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.0-pdf-letter.nix b/pkgs/development/interpreters/python/docs/3.0-pdf-letter.nix
new file mode 100644
index 00000000000..1373ae21284
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.0-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python30-docs-pdf-letter-3.0.1";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.0.1/python-3.0.1-docs-pdf-letter.tar.bz2;
+    sha256 = "1x59q0k6fv55vvpsgr5xcq66k5zsd0f142cp6aa4rb6c81i31yml";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python30
+    cp -R ./ $out/share/doc/python30/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.0-text.nix b/pkgs/development/interpreters/python/docs/3.0-text.nix
new file mode 100644
index 00000000000..c37fa99f7c5
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.0-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python30-docs-text-3.0.1";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.0.1/python-3.0.1-docs-text.tar.bz2;
+    sha256 = "12qlh9ywbnw50wk5siq7lmhr935dd16q3vjbii6gfv0g80b1byzx";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python30
+    cp -R ./ $out/share/doc/python30/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.1-html.nix b/pkgs/development/interpreters/python/docs/3.1-html.nix
new file mode 100644
index 00000000000..625aa181c63
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.1-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python31-docs-html-3.1.5";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.1.5/python-3.1.5-docs-html.tar.bz2;
+    sha256 = "187shb92218k0i07hj9ak1kqbqjcxkivmwxlzj18v791l7x7qcpz";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python31
+    cp -R ./ $out/share/doc/python31/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.1-pdf-a4.nix b/pkgs/development/interpreters/python/docs/3.1-pdf-a4.nix
new file mode 100644
index 00000000000..564103dd101
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.1-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python31-docs-pdf-a4-3.1.5";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.1.5/python-3.1.5-docs-pdf-a4.tar.bz2;
+    sha256 = "0kbj6b43gnwlb1czkzmirasmc31j10plq0rlb9s9rh8phqnbmhx1";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python31
+    cp -R ./ $out/share/doc/python31/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.1-pdf-letter.nix b/pkgs/development/interpreters/python/docs/3.1-pdf-letter.nix
new file mode 100644
index 00000000000..d6e3009f59c
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.1-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python31-docs-pdf-letter-3.1.5";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.1.5/python-3.1.5-docs-pdf-letter.tar.bz2;
+    sha256 = "0s202vrjfa8dnp3vpfjb21bmqym9wyj8jn2glgwjzk63z6fwb60i";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python31
+    cp -R ./ $out/share/doc/python31/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.1-text.nix b/pkgs/development/interpreters/python/docs/3.1-text.nix
new file mode 100644
index 00000000000..3ce559e3ecc
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.1-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python31-docs-text-3.1.5";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.1.5/python-3.1.5-docs-text.tar.bz2;
+    sha256 = "1jsfgfgdi1i2l3lhdk7ss5gwrcg3qhhh8syfrwz8xrv2klmmmn9b";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python31
+    cp -R ./ $out/share/doc/python31/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.2-html.nix b/pkgs/development/interpreters/python/docs/3.2-html.nix
new file mode 100644
index 00000000000..14690100548
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.2-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python32-docs-html-3.2.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.2.3/python-3.2.3-docs-html.tar.bz2;
+    sha256 = "058pryg0gn0rlpswkj1z0xvpr39s3ymx3dwqfhhf83w0mlysdm0x";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python32
+    cp -R ./ $out/share/doc/python32/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.2-pdf-a4.nix b/pkgs/development/interpreters/python/docs/3.2-pdf-a4.nix
new file mode 100644
index 00000000000..729101b2d01
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.2-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python32-docs-pdf-a4-3.2.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.2.3/python-3.2.3-docs-pdf-a4.tar.bz2;
+    sha256 = "1lw1sbk3nx70k2zxgjc36ryvyzlxndzsvhrxyzdy9sjfhasyd807";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python32
+    cp -R ./ $out/share/doc/python32/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.2-pdf-letter.nix b/pkgs/development/interpreters/python/docs/3.2-pdf-letter.nix
new file mode 100644
index 00000000000..da9b0ce4dcc
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.2-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python32-docs-pdf-letter-3.2.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.2.3/python-3.2.3-docs-pdf-letter.tar.bz2;
+    sha256 = "199ibzslw3zrwjd49582vc5q6ghp5ig8zalvslawz0xkz1226wg2";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python32
+    cp -R ./ $out/share/doc/python32/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.2-text.nix b/pkgs/development/interpreters/python/docs/3.2-text.nix
new file mode 100644
index 00000000000..3ceef2431f7
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.2-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python32-docs-text-3.2.3";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.2.3/python-3.2.3-docs-text.tar.bz2;
+    sha256 = "1jdc9rj2b4vsbvg5mq6vcdfa2b72avhhvjw7rn7k3kl521cvxs09";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python32
+    cp -R ./ $out/share/doc/python32/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.3-html.nix b/pkgs/development/interpreters/python/docs/3.3-html.nix
new file mode 100644
index 00000000000..055224dd740
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.3-html.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python33-docs-html-3.3.0";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-html.tar.bz2;
+    sha256 = "0vv24b9qi7gznv687ik0pa2w1rq9grqivy44znvj2ysjfg7mc2c1";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python33
+    cp -R ./ $out/share/doc/python33/html
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.3-pdf-a4.nix b/pkgs/development/interpreters/python/docs/3.3-pdf-a4.nix
new file mode 100644
index 00000000000..8c6b842d0b9
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.3-pdf-a4.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python33-docs-pdf-a4-3.3.0";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-a4.tar.bz2;
+    sha256 = "1y6n13bxlw8a11khy3ynfbz8z0kpf2lvh32dvy8scyw3hrk6wdxp";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python33
+    cp -R ./ $out/share/doc/python33/pdf-a4
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.3-pdf-letter.nix b/pkgs/development/interpreters/python/docs/3.3-pdf-letter.nix
new file mode 100644
index 00000000000..046abe8f83d
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.3-pdf-letter.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python33-docs-pdf-letter-3.3.0";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-pdf-letter.tar.bz2;
+    sha256 = "0mcj1i47nx81fc9zk1cic4c4p139qjcqlzf4hnnkzvb3jcgy5z6k";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python33
+    cp -R ./ $out/share/doc/python33/pdf-letter
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/3.3-text.nix b/pkgs/development/interpreters/python/docs/3.3-text.nix
new file mode 100644
index 00000000000..4d99c25bf59
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/3.3-text.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "python33-docs-text-3.3.0";
+  src = fetchurl {
+    url = http://docs.python.org/ftp/python/doc/3.3.0/python-3.3.0-docs-text.tar.bz2;
+    sha256 = "10vk2fixg1aglqmsf89kn98rlirrbhnrk1285vzfbynf2iavxw0n";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/python33
+    cp -R ./ $out/share/doc/python33/text
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/docs/default.nix b/pkgs/development/interpreters/python/docs/default.nix
new file mode 100644
index 00000000000..16ade3af3f9
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/default.nix
@@ -0,0 +1,89 @@
+{ stdenv, fetchurl, lib }:
+
+let
+pythonDocs = {
+  html = {
+    recurseForDerivations = true;
+    python33 = import ./3.3-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python32 = import ./3.2-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python31 = import ./3.1-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python30 = import ./3.0-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python27 = import ./2.7-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python26 = import ./2.6-html.nix {
+      inherit stdenv fetchurl lib;
+    };
+  };
+  pdf_a4 = {
+    recurseForDerivations = true;
+    python33 = import ./3.3-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python32 = import ./3.2-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python31 = import ./3.1-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python30 = import ./3.0-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python27 = import ./2.7-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python26 = import ./2.6-pdf-a4.nix {
+      inherit stdenv fetchurl lib;
+    };
+  };
+  pdf_letter = {
+    recurseForDerivations = true;
+    python33 = import ./3.3-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python32 = import ./3.2-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python31 = import ./3.1-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python30 = import ./3.0-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python27 = import ./2.7-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python26 = import ./2.6-pdf-letter.nix {
+      inherit stdenv fetchurl lib;
+    };
+  };
+  text = {
+    recurseForDerivations = true;
+    python33 = import ./3.3-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python32 = import ./3.2-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python31 = import ./3.1-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python30 = import ./3.0-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python27 = import ./2.7-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+    python26 = import ./2.6-text.nix {
+      inherit stdenv fetchurl lib;
+    };
+  };
+}; in pythonDocs
diff --git a/pkgs/development/interpreters/python/docs/generate.sh b/pkgs/development/interpreters/python/docs/generate.sh
new file mode 100755
index 00000000000..bebefc10ccd
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/generate.sh
@@ -0,0 +1,59 @@
+#!/usr/bin/env bash
+
+TYPES="html pdf-a4 pdf-letter text"
+URL=http://docs.python.org/ftp/python/doc/VERSION/python-VERSION-docs-TYPE.tar.bz2
+VERSIONS=$(curl http://www.python.org/download/releases/ 2>/dev/null | grep "releases/[123456789]"| cut -d/ -f4 |grep -v "^[12].[012345]" |grep -v "^1.6.1")
+echo "Generating expressions for:
+${VERSIONS}
+"
+
+
+cat >default.nix <<EOF
+{ stdenv, fetchurl, lib }:
+
+let
+pythonDocs = {
+EOF
+
+for type in $TYPES; do
+    cat >>default.nix <<EOF
+  ${type/-/_} = {
+    recurseForDerivations = true;
+EOF
+
+    for version in $VERSIONS; do
+        major=$(echo -n ${version}| cut -d. -f1)
+        minor=$(echo -n ${version}| cut -d. -f2)
+        outfile=${major}.${minor}-${type}.nix
+        hash=
+        if [ -e ${outfile} ]; then
+            currentversion=$(grep "url =" ${outfile} |cut -d/ -f7)
+            if [ ${version} = ${currentversion} ]; then
+                hash=$(grep sha256 ${outfile} | cut -d'"' -f2)
+            fi
+        fi
+        echo "Generating ${outfile}"
+        url=$(echo -n $URL |sed -e "s,VERSION,${version},g" -e "s,TYPE,${type},")
+        sha=$(nix-prefetch-url ${url} ${hash})
+
+        sed -e "s,VERSION,${version}," \
+            -e "s,MAJOR,${major}," \
+            -e "s,MINOR,${minor}," \
+            -e "s,TYPE,${type}," \
+            -e "s,URL,${url}," \
+            -e "s,SHA,${sha}," < template.nix > ${outfile}
+
+        attrname=python${major}${minor}
+        cat >>default.nix <<EOF
+    ${attrname} = import ./${major}.${minor}-${type}.nix {
+      inherit stdenv fetchurl lib;
+    };
+EOF
+
+        echo "done."
+        echo
+    done
+    echo "  };" >> default.nix
+done
+
+echo "}; in pythonDocs" >> default.nix
diff --git a/pkgs/development/interpreters/python/docs/template.nix b/pkgs/development/interpreters/python/docs/template.nix
new file mode 100644
index 00000000000..cc92f71bc1e
--- /dev/null
+++ b/pkgs/development/interpreters/python/docs/template.nix
@@ -0,0 +1,18 @@
+# This file was generated and will be overwritten by ./generate.sh
+
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  name = "pythonMAJORMINOR-docs-TYPE-VERSION";
+  src = fetchurl {
+    url = URL;
+    sha256 = "SHA";
+  };
+  installPhase = ''
+    mkdir -p $out/share/doc/pythonMAJORMINOR
+    cp -R ./ $out/share/doc/pythonMAJORMINOR/TYPE
+  '';
+  meta = {
+    maintainers = [ lib.maintainers.chaoflow ];
+  };
+}
diff --git a/pkgs/development/interpreters/python/python-linkme-wrapper.nix b/pkgs/development/interpreters/python/python-linkme-wrapper.nix
new file mode 100644
index 00000000000..8d783a8c11e
--- /dev/null
+++ b/pkgs/development/interpreters/python/python-linkme-wrapper.nix
@@ -0,0 +1,13 @@
+{ stdenv }:
+
+stdenv.mkDerivation {
+  name = "python-linkme-wrapper-1.0";
+
+  unpackPhase = "true";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cat ${./python-linkme-wrapper.sh} >  $out/bin/.python-linkme-wrapper
+    chmod +x $out/bin/.python-linkme-wrapper
+  '';
+}
diff --git a/pkgs/development/interpreters/python/python-linkme-wrapper.sh b/pkgs/development/interpreters/python/python-linkme-wrapper.sh
new file mode 100644
index 00000000000..42674aa83b0
--- /dev/null
+++ b/pkgs/development/interpreters/python/python-linkme-wrapper.sh
@@ -0,0 +1,33 @@
+#!/bin/sh
+#
+# Install it into a nix profile and from there build symlink chains.
+# The chain will be followed to set the PYTHONPATH
+# A/bin/foo -> B/bin/bar -> NIXENV/bin/.python-linkme-wrapper.sh
+#
+
+if test ! -L "$0"; then
+   echo "Link me!"
+   exit 1
+fi
+
+PROG=$(basename "$0")
+SITES=
+
+pypath() {
+  BIN=$(realpath -s "$(dirname "$1")")
+  ENV=$(dirname "$BIN")
+  SITE="$ENV/lib/python2.7/site-packages"
+  SITES="$SITES${SITES:+:}$SITE"
+
+  PRG="$BIN"/$(readlink "$1")
+
+  if test -L "$PRG"; then
+    pypath "$PRG"
+  fi
+}
+
+pypath $(realpath -s "$0")
+
+export PYTHONPATH="$PYTHONPATH${PYTHONPATH:+:}$SITES"
+
+exec "$BIN/$PROG" "$@"
diff --git a/pkgs/development/interpreters/python/pythonhome-wrapper.nix b/pkgs/development/interpreters/python/pythonhome-wrapper.nix
deleted file mode 100644
index c9cf6277b24..00000000000
--- a/pkgs/development/interpreters/python/pythonhome-wrapper.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv }:
-
-stdenv.mkDerivation {
-  name = "pythonhome-wrapper";
-
-  unpackPhase = "true";
-  installPhase = ''
-    mkdir -p $out/bin
-    echo '
-#!/bin/sh
-
-BINDIR=`dirname $0`
-PYTHONHOME=`dirname $BINDIR`
-PYTHONHOME=`(cd $PYTHONHOME && pwd)`
-export PYTHONHOME
-
-$BINDIR/python "$@"
-    ' > $out/bin/py
-    chmod +x $out/bin/py
-  '';
-}
diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix
index e8e343976bc..d2783ffb085 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -1,21 +1,21 @@
 # Create a python that knows about additional python packages via
 # PYTHONPATH
 
-{stdenv, python, makeWrapper, extraLibs ? []}:
+{ stdenv, python, makeWrapper, recursivePthLoader, extraLibs ? [] }:
 
 stdenv.mkDerivation {
   name = "python-${python.version}-wrapper";
 
-  propagatedBuildInputs = [python makeWrapper] ++ extraLibs;
+  propagatedBuildInputs = extraLibs ++ [ python makeWrapper recursivePthLoader ];
 
   unpackPhase = "true";
   installPhase = ''
     mkdir -p "$out/bin"
-    for prg in 2to3 idle pydoc python python-config python${python.majorVersion} python${python.majorVersion}-config smtpd.py; do
+    for prg in 2to3 idle pdb pdb${python.majorVersion} pydoc python python-config python${python.majorVersion} python${python.majorVersion}-config smtpd.py; do
       makeWrapper "$python/bin/$prg" "$out/bin/$prg" --suffix PYTHONPATH : "$PYTHONPATH"
     done
     ensureDir "$out/share"
-    ln "$python/share/man" "$out/share/man" -s
+    ln -s "$python/share/man" "$out/share/man"
   '';
 
   inherit python;
diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix
index db92e0fa55b..347647fd87e 100644
--- a/pkgs/development/interpreters/racket/default.nix
+++ b/pkgs/development/interpreters/racket/default.nix
@@ -1,21 +1,21 @@
 { stdenv, fetchurl, cairo, file, pango, glib, gtk
 , which, libtool, makeWrapper, libjpeg, libpng
-, fontconfig, liberation_ttf } :
+, fontconfig, liberation_ttf, sqlite } :
 
 stdenv.mkDerivation rec {
   pname = "racket";
-  version = "5.2.1";
+  version = "5.3.4";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "http://download.racket-lang.org/installers/${version}/${pname}/${name}-src-unix.tgz";
-    sha256 = "1v5kvp7vfi4a4bn08jlaga441amlfxpjw9dm6vc1fazwzd72m539";
+    sha256 = "0yrdmpdvzf092869y6zjjjxl6j2kypgiv7qrfkv7lj8w01pbh7sd";
   };
 
   # Various racket executables do run-time searches for these.
-  ffiSharedLibs = "${glib}/lib:${cairo}/lib:${pango}/lib:${gtk}/lib:${libjpeg}/lib:${libpng}/lib";
+  ffiSharedLibs = "${glib}/lib:${cairo}/lib:${pango}/lib:${gtk}/lib:${libjpeg}/lib:${libpng}/lib:${sqlite}/lib";
 
-  buildInputs = [ file libtool which makeWrapper fontconfig liberation_ttf ];
+  buildInputs = [ file libtool which makeWrapper fontconfig liberation_ttf sqlite ];
 
   preConfigure = ''
     export LD_LIBRARY_PATH=${ffiSharedLibs}:$LD_LIBRARY_PATH
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Racket (formerly called PLT Scheme) is a programming language derived from Scheme.";
+    description = "A programming language derived from Scheme (formerly called PLT Scheme).";
     longDescription = ''
       Racket (formerly called PLT Scheme) is a programming language derived
       from Scheme. The Racket project has four primary components: the
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = http://racket-lang.org/;
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = stdenv.lib.licenses.lgpl2Plus; # and licenses of contained libraries
     maintainers = [ stdenv.lib.maintainers.kkallio ];
     platforms = stdenv.lib.platforms.linux;
   };
diff --git a/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch b/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch
new file mode 100644
index 00000000000..c67eaff2ac5
--- /dev/null
+++ b/pkgs/development/interpreters/ruby/fix-gem-nix-versions.patch
@@ -0,0 +1,35 @@
+diff --git a/lib/nix/gem-nix-command.rb b/lib/nix/gem-nix-command.rb
+index 8d3733e..ba942ff 100644
+--- a/lib/nix/gem-nix-command.rb
++++ b/lib/nix/gem-nix-command.rb
+@@ -108,11 +108,12 @@ class Gem::Commands::NixCommand < Gem::Command
+ 
+       # args to dep informations
+       args.each { |arg|
+-        if arg =~ /(.+)-?(.*)?/ then
++        if arg =~ /(.+)-([0-9][^-]+)/ then
+           gem_name = $1
+-          version =  $2.empty? ?  Gem::Requirement.default : Gem::Version.new($2)
++          version =  Gem::Version.new($2)
+         else
+-          raise Gem::CommandLineError, "couldn't parse arg. expected: name or name-version"
++          gem_name = arg
++          version =  Gem::Requirement.default
+         end
+ 
+         adddep(Gem::Dependency.new gem_name, version)
+@@ -162,7 +163,13 @@ class Gem::Commands::NixCommand < Gem::Command
+     spec, source_uri = find_gem_with_source(dep)
+     full_name = spec.full_name
+ 
+-    return if @gems_with_deps.key?(full_name)
++    if @gems_with_deps.key?(full_name)
++      unless @gems_with_deps[full_name].nil?
++        return @gems_with_deps[full_name][0]
++      else
++        return nil
++      end
++    end
+     @gems_with_deps[full_name] = nil # there maybe circular dependencies. thus mark this gem seen as early as possible
+ 
+     # development deps can't be found. Some are old. Thus only add rutime dependencies
diff --git a/pkgs/development/interpreters/ruby/gem.nix b/pkgs/development/interpreters/ruby/gem.nix
index 124c7cd747f..b4ddd26bb46 100644
--- a/pkgs/development/interpreters/ruby/gem.nix
+++ b/pkgs/development/interpreters/ruby/gem.nix
@@ -44,6 +44,8 @@ let
 
     propagatedUserEnvPkgs = requiredGems;
 
+    passthru.isRubyGem = true;
+
   };
   mb = stdenv.lib.maybeAttr;
   patchedGem = a: stdenv.mkDerivation (removeAttrs (stdenv.lib.mergeAttrsByFuncDefaults
diff --git a/pkgs/development/interpreters/ruby/generated.nix b/pkgs/development/interpreters/ruby/generated.nix
index bc50a08f29a..d4bb7fa4f2d 100644
--- a/pkgs/development/interpreters/ruby/generated.nix
+++ b/pkgs/development/interpreters/ruby/generated.nix
@@ -3,69 +3,106 @@
 g: # Get dependencies from patched gems
 {
   aliases = {
-    ZenTest = g.ZenTest_4_8_1;
-    actionmailer = g.actionmailer_3_2_6;
-    actionpack = g.actionpack_3_2_6;
-    activemodel = g.activemodel_3_2_6;
-    activerecord = g.activerecord_3_2_6;
-    activeresource = g.activeresource_3_2_6;
-    activesupport = g.activesupport_3_2_6;
-    addressable = g.addressable_2_2_8;
+    ZenTest = g.ZenTest_4_9_0;
+    actionmailer = g.actionmailer_3_2_13;
+    actionpack = g.actionpack_3_2_13;
+    activemodel = g.activemodel_3_2_13;
+    activerecord = g.activerecord_3_2_13;
+    activeresource = g.activeresource_3_2_13;
+    activesupport = g.activesupport_3_2_13;
+    addressable = g.addressable_2_3_3;
     arel = g.arel_3_0_2;
-    atoulme_Antwrap = g.atoulme_Antwrap_0_7_2;
+    atoulme_Antwrap = g.atoulme_Antwrap_0_7_4;
     autotest_rails = g.autotest_rails_4_1_2;
-    builder = g.builder_3_0_0;
-    buildr = g.buildr_1_4_7;
-    bundler = g.bundler_1_1_4;
-    childprocess = g.childprocess_0_3_3;
+    aws_sdk = g.aws_sdk_1_8_5;
+    bitbucket_backup = g.bitbucket_backup_0_2_2;
+    builder = g.builder_3_2_0;
+    buildr = g.buildr_1_4_11;
+    bundler = g.bundler_1_3_4;
+    childprocess = g.childprocess_0_3_9;
+    chronic = g.chronic_0_9_1;
+    daemons = g.daemons_1_1_9;
     diff_lcs = g.diff_lcs_1_1_3;
+    dimensions = g.dimensions_1_2_0;
+    em_resolv_replace = g.em_resolv_replace_1_1_3;
     erubis = g.erubis_2_7_0;
+    eventmachine = g.eventmachine_1_0_3;
+    eventmachine_tail = g.eventmachine_tail_0_6_4;
+    execjs = g.execjs_1_4_0;
     fakes3 = g.fakes3_0_1_5;
-    ffi = g.ffi_1_0_11;
-    highline = g.highline_1_6_2;
+    faraday = g.faraday_0_8_7;
+    faraday_middleware = g.faraday_middleware_0_8_8;
+    ffi = g.ffi_1_6_0;
+    file_tail = g.file_tail_1_0_12;
+    foreman = g.foreman_0_62_0;
+    highline = g.highline_1_6_16;
     hike = g.hike_1_2_1;
-    hoe = g.hoe_2_3_3;
-    i18n = g.i18n_0_6_0;
+    hoe = g.hoe_3_1_0;
+    i18n = g.i18n_0_6_4;
     journey = g.journey_1_0_4;
-    json = g.json_1_7_3;
-    json_pure = g.json_pure_1_7_3;
-    libwebsocket = g.libwebsocket_0_1_3;
-    mail = g.mail_2_4_4;
-    mime_types = g.mime_types_1_19;
+    jruby_pageant = g.jruby_pageant_1_1_1;
+    jsduck = g.jsduck_4_7_1;
+    json = g.json_1_7_7;
+    json_pure = g.json_pure_1_7_7;
+    libv8 = g.libv8_3_3_10_4;
+    macaddr = g.macaddr_1_6_1;
+    mail = g.mail_2_5_3;
+    mime_types = g.mime_types_1_21;
     minitar = g.minitar_0_5_3;
-    multi_json = g.multi_json_1_3_6;
+    multi_json = g.multi_json_1_7_2;
+    multipart_post = g.multipart_post_1_2_0;
     net_sftp = g.net_sftp_2_0_5;
-    net_ssh = g.net_ssh_2_5_2;
+    net_ssh = g.net_ssh_2_6_6;
     nix = g.nix_0_1_1;
+    nokogiri = g.nokogiri_1_5_9;
+    papertrail = g.papertrail_0_9_7;
+    papertrail_cli = g.papertrail_cli_0_9_3;
+    parallel = g.parallel_0_6_3;
     polyglot = g.polyglot_0_3_3;
-    rack = g.rack_1_4_1;
+    rack = g.rack_1_5_2;
     rack_cache = g.rack_cache_1_2;
-    rack_ssl = g.rack_ssl_1_3_2;
-    rack_test = g.rack_test_0_6_1;
-    rails = g.rails_3_2_6;
-    railties = g.railties_3_2_6;
-    rake = g.rake_0_9_2_2;
-    rb_fsevent = g.rb_fsevent_0_9_1;
-    rdoc = g.rdoc_3_12;
-    rjb = g.rjb_1_4_0;
-    rspec = g.rspec_2_9_0;
-    rspec_core = g.rspec_core_2_9_0;
-    rspec_expectations = g.rspec_expectations_2_9_1;
-    rspec_mocks = g.rspec_mocks_2_9_0;
+    rack_protection = g.rack_protection_1_5_0;
+    rack_ssl = g.rack_ssl_1_3_3;
+    rack_test = g.rack_test_0_6_2;
+    rails = g.rails_3_2_13;
+    railties = g.railties_3_2_13;
+    rake = g.rake_10_0_4;
+    rb_fsevent = g.rb_fsevent_0_9_3;
+    rdiscount = g.rdiscount_2_0_7_1;
+    rdoc = g.rdoc_3_12_2;
+    remote_syslog = g.remote_syslog_1_6_13;
+    right_aws = g.right_aws_3_0_5;
+    right_http_connection = g.right_http_connection_1_3_0;
+    rjb = g.rjb_1_4_6;
+    rspec = g.rspec_2_11_0;
+    rspec_core = g.rspec_core_2_11_1;
+    rspec_expectations = g.rspec_expectations_2_11_3;
+    rspec_mocks = g.rspec_mocks_2_11_3;
     rubyforge = g.rubyforge_2_0_4;
     rubyzip = g.rubyzip_0_9_9;
-    sass = g.sass_3_1_20;
-    selenium_webdriver = g.selenium_webdriver_2_24_0;
-    sprockets = g.sprockets_2_1_3;
-    thor = g.thor_0_15_4;
-    tilt = g.tilt_1_3_3;
-    treetop = g.treetop_1_4_10;
-    tzinfo = g.tzinfo_0_3_33;
-    xml_simple = g.xml_simple_1_0_12;
+    sass = g.sass_3_2_7;
+    selenium_webdriver = g.selenium_webdriver_2_31_0;
+    servolux = g.servolux_0_10_0;
+    sinatra = g.sinatra_1_3_2;
+    sprockets = g.sprockets_2_2_2;
+    syslog_protocol = g.syslog_protocol_0_9_2;
+    systemu = g.systemu_2_5_2;
+    therubyracer = g.therubyracer_0_10_2;
+    thin = g.thin_1_5_1;
+    thor = g.thor_0_18_0;
+    tilt = g.tilt_1_3_6;
+    tins = g.tins_0_7_2;
+    treetop = g.treetop_1_4_12;
+    tzinfo = g.tzinfo_0_3_37;
+    uuid = g.uuid_2_3_7;
+    uuidtools = g.uuidtools_2_1_3;
+    websocket = g.websocket_1_0_7;
+    xml_simple = g.xml_simple_1_1_1;
+    yajl_ruby = g.yajl_ruby_1_1_0;
   };
-  gem_nix_args = [ ''autotest-rails'' ''buildr'' ''fakes3'' ''nix'' ''rails'' ''rake'' ''rb-fsevent'' ''sass'' ''selenium-webdriver'' ];
+  gem_nix_args = [ ''autotest-rails'' ''aws-sdk'' ''bitbucket-backup'' ''buildr'' ''fakes3'' ''foreman'' ''jsduck'' ''nix'' ''papertrail-cli'' ''rails'' ''rake'' ''rb-fsevent'' ''remote_syslog'' ''right_aws'' ''sass'' ''selenium-webdriver'' ''sinatra-1.3.2'' ''thin'' ''uuid'' ];
   gems = {
-    ZenTest_4_8_1 = {
+    ZenTest_4_9_0 = {
       basename = ''ZenTest'';
       meta = {
         description = ''ZenTest provides 4 different tools: zentest, unit_diff, autotest, and multiruby'';
@@ -92,77 +129,77 @@ multiruby runs anything you want on multiple versions of ruby. Great
 for compatibility checking! Use multiruby_setup to manage your
 installed versions.'';
       };
-      name = ''ZenTest-4.8.1'';
+      name = ''ZenTest-4.9.0'';
       requiredGems = [  ];
-      sha256 = ''0jp86czz16b0wamxvzs8p7pxwagj68h2zch9yjmjk7b069xrsg3v'';
+      sha256 = ''16bp7rwl463m0d213rmwp4rjfwiw1bm529c518v91l18h7hcnb96'';
     };
-    actionmailer_3_2_6 = {
+    actionmailer_3_2_13 = {
       basename = ''actionmailer'';
       meta = {
         description = ''Email composition, delivery, and receiving framework (part of Rails).'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.'';
       };
-      name = ''actionmailer-3.2.6'';
-      requiredGems = [ g.mail_2_4_4 ];
-      sha256 = ''1h9035i9rnh98pc4z073cpcjjkwcswjigg1a3a6ll0s9lb6dnk54'';
+      name = ''actionmailer-3.2.13'';
+      requiredGems = [ g.actionpack_3_2_13 g.mail_2_5_3 ];
+      sha256 = ''0ksw1b5rba8l6400qgc6zjdn14q68n6crjmm76ggg32r4wv3xn06'';
     };
-    actionpack_3_2_6 = {
+    actionpack_3_2_13 = {
       basename = ''actionpack'';
       meta = {
         description = ''Web-flow and rendering framework putting the VC in MVC (part of Rails).'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.'';
       };
-      name = ''actionpack-3.2.6'';
-      requiredGems = [ g.activemodel_3_2_6 g.rack_cache_1_2 g.rack_test_0_6_1 g.journey_1_0_4 g.sprockets_2_1_3 g.erubis_2_7_0 ];
-      sha256 = ''1qwy7p353sp3x3crinfsx873vfrc84bfy61hz95qhy8anq03ay34'';
+      name = ''actionpack-3.2.13'';
+      requiredGems = [ g.activesupport_3_2_13 g.activemodel_3_2_13 g.rack_cache_1_2 g.builder_3_0_4 g.rack_1_4_5 g.rack_test_0_6_2 g.journey_1_0_4 g.sprockets_2_2_2 g.erubis_2_7_0 ];
+      sha256 = ''1m3kd3rwa4z0yik68xi0l9q71lyzq4gdciqaw5w2w9pal1cj8y5w'';
     };
-    activemodel_3_2_6 = {
+    activemodel_3_2_13 = {
       basename = ''activemodel'';
       meta = {
         description = ''A toolkit for building modeling frameworks (part of Rails).'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''A toolkit for building modeling frameworks like Active Record and Active Resource. Rich support for attributes, callbacks, validations, observers, serialization, internationalization, and testing.'';
       };
-      name = ''activemodel-3.2.6'';
-      requiredGems = [  ];
-      sha256 = ''18bvwpfxr6kp66b62n17qgn7bb02va6bvckips36cxrkznafsk6j'';
+      name = ''activemodel-3.2.13'';
+      requiredGems = [ g.activesupport_3_2_13 g.builder_3_0_4 ];
+      sha256 = ''0lpc9ylwm00g66hmgj06iq51m2l234ii7k6qsjiywf9x5fq6khn5'';
     };
-    activerecord_3_2_6 = {
+    activerecord_3_2_13 = {
       basename = ''activerecord'';
       meta = {
         description = ''Object-relational mapper framework (part of Rails).'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''Databases on Rails. Build a persistent domain model by mapping database tables to Ruby classes. Strong conventions for associations, validations, aggregations, migrations, and testing come baked-in.'';
       };
-      name = ''activerecord-3.2.6'';
-      requiredGems = [ g.arel_3_0_2 g.tzinfo_0_3_33 ];
-      sha256 = ''1xc901m3a85j28bn2f96fh9c5y4wq4xivympm32xj4zr2ib20c2m'';
+      name = ''activerecord-3.2.13'';
+      requiredGems = [ g.activesupport_3_2_13 g.activemodel_3_2_13 g.arel_3_0_2 g.tzinfo_0_3_37 ];
+      sha256 = ''1z5rrjy2v27xldr24sd4sxi6k6f5anyg20kwj3qyc0jjn8c0gv85'';
     };
-    activeresource_3_2_6 = {
+    activeresource_3_2_13 = {
       basename = ''activeresource'';
       meta = {
         description = ''REST modeling framework (part of Rails).'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''REST on Rails. Wrap your RESTful web app with Ruby classes and work with them like Active Record models.'';
       };
-      name = ''activeresource-3.2.6'';
-      requiredGems = [  ];
-      sha256 = ''1lyv64rccgrdfhzccxj9qm5dnjy212x4q1nc21mf2xf2nc4zi33a'';
+      name = ''activeresource-3.2.13'';
+      requiredGems = [ g.activesupport_3_2_13 g.activemodel_3_2_13 ];
+      sha256 = ''1r4ph4cqd32d4lq9bfyv1dpfxc4qndcqhqx7h7xg4p0va7dz251l'';
     };
-    activesupport_3_2_6 = {
+    activesupport_3_2_13 = {
       basename = ''activesupport'';
       meta = {
         description = ''A toolkit of support libraries and Ruby core extensions extracted from the Rails framework.'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''A toolkit of support libraries and Ruby core extensions extracted from the Rails framework. Rich support for multibyte strings, internationalization, time zones, and testing.'';
       };
-      name = ''activesupport-3.2.6'';
-      requiredGems = [ g.i18n_0_6_0 g.multi_json_1_3_6 ];
-      sha256 = ''00jlixc7pkifikdgkjmgxypx8rizj3jizhjcpi4v9hd72yw8m7j2'';
+      name = ''activesupport-3.2.13'';
+      requiredGems = [ g.i18n_0_6_1 g.multi_json_1_7_2 ];
+      sha256 = ''1vailj8ja9g3s029p5qbvqdpxcis5gcpkl2d6j7a6d36hxlwlf8y'';
     };
-    addressable_2_2_8 = {
+    addressable_2_3_3 = {
       basename = ''addressable'';
       meta = {
         description = ''URI Implementation'';
@@ -172,9 +209,9 @@ Ruby's standard library. It more closely conforms to the relevant RFCs and
 adds support for IRIs and URI templates.
 '';
       };
-      name = ''addressable-2.2.8'';
+      name = ''addressable-2.3.3'';
       requiredGems = [  ];
-      sha256 = ''1zrwrs5aji7ah2qh4x47f4j85s3sdsrrx4xayyhnrcykcg7s4n49'';
+      sha256 = ''0nn583ba8kq4hhpr4lr2zzpm4r0mga0zfalxxpa6a4v27q71v5hh'';
     };
     arel_3_0_2 = {
       basename = ''arel'';
@@ -194,7 +231,7 @@ database compatibility and query generation.'';
       requiredGems = [  ];
       sha256 = ''158bvrhammpblky9z9dgimjr55bdypfx6w5s1dm4vyj42h49qpkx'';
     };
-    atoulme_Antwrap_0_7_2 = {
+    atoulme_Antwrap_0_7_4 = {
       basename = ''atoulme_Antwrap'';
       meta = {
         description = ''A Ruby module that wraps the Apache Ant build tool. Antwrap can be used to invoke Ant Tasks from a Ruby or a JRuby script.'';
@@ -212,9 +249,9 @@ database compatibility and query generation.'';
 	Ant (http://ant.apache.org/) tasks in a Java project. If you are tired of fighting with Ant or Maven XML files in your Java project, take some time to 
 	check out Buildr!'';
       };
-      name = ''atoulme-Antwrap-0.7.2'';
-      requiredGems = [  ];
-      sha256 = ''0r9l3cn0gjck5q00djas5h43pr64pjvafhz6f7zhki4qqkwbb6j3'';
+      name = ''atoulme-Antwrap-0.7.4'';
+      requiredGems = [ g.rjb_1_4_6 ];
+      sha256 = ''0sh9capkya88qm9mvixwly32fwb2c4nzif9j9vv0f73rqw8kz4j4'';
     };
     autotest_rails_4_1_2 = {
       basename = ''autotest_rails'';
@@ -225,21 +262,48 @@ database compatibility and query generation.'';
 rails support and extra plugins for migrations and fixtures.'';
       };
       name = ''autotest-rails-4.1.2'';
-      requiredGems = [ g.ZenTest_4_8_1 ];
+      requiredGems = [ g.ZenTest_4_9_0 ];
       sha256 = ''1wkb5jayb39yx0i8ly7sibygf9f9c3w24jg2z1qgm135zlb070v4'';
     };
-    builder_2_1_2 = {
+    aws_sdk_1_8_5 = {
+      basename = ''aws_sdk'';
+      meta = {
+        description = ''AWS SDK for Ruby'';
+        homepage = ''http://aws.amazon.com/sdkforruby'';
+        longDescription = ''AWS SDK for Ruby'';
+      };
+      name = ''aws-sdk-1.8.5'';
+      requiredGems = [ g.uuidtools_2_1_3 g.nokogiri_1_5_9 g.json_1_7_7 ];
+      sha256 = ''0rhkkkfsw0qzckn99mnvpbnl7b1kysma3x8bbqwah2x438kwygpb'';
+    };
+    bitbucket_backup_0_2_2 = {
+      basename = ''bitbucket_backup'';
+      meta = {
+        description = ''A tool to backup Bitbucket repos.'';
+        homepage = ''https://bitbucket.org/seth/bitbucket-backup'';
+        longDescription = ''A tool to backup Bitbucket repos.'';
+      };
+      name = ''bitbucket-backup-0.2.2'';
+      requiredGems = [ g.highline_1_6_16 g.json_1_7_7 ];
+      sha256 = ''1kzg6pkzw04n96i6mhb74gpg4c899wly5fc2m1y6m2xvn71qksys'';
+    };
+    builder_3_0_4 = {
       basename = ''builder'';
       meta = {
         description = ''Builders for MarkUp.'';
         homepage = ''http://onestepback.org'';
-        longDescription = ''Builder provides a number of builder objects that make creating structured data simple to do.  Currently the following builder objects are supported:  * XML Markup * XML Events'';
+        longDescription = ''Builder provides a number of builder objects that make creating structured data
+simple to do.  Currently the following builder objects are supported:
+
+* XML Markup
+* XML Events
+'';
       };
-      name = ''builder-2.1.2'';
+      name = ''builder-3.0.4'';
       requiredGems = [  ];
-      sha256 = ''0hp5gsvp63mqqvi7dl95zwci916vj6l1slgz4crip1rijk3v2806'';
+      sha256 = ''0hn41h249v82wj7d9vji2lm568jxv8pzq2czh2v0603hjv21r8x1'';
     };
-    builder_3_0_0 = {
+    builder_3_1_3 = {
       basename = ''builder'';
       meta = {
         description = ''Builders for MarkUp.'';
@@ -251,11 +315,27 @@ simple to do.  Currently the following builder objects are supported:
 * XML Events
 '';
       };
-      name = ''builder-3.0.0'';
+      name = ''builder-3.1.3'';
       requiredGems = [  ];
-      sha256 = ''13k12jii9z1hma4xxk2dl74wsx985idl3cs9svvla8p0bmgf3lzv'';
+      sha256 = ''0w6xsq9vyvzdy0xb52sajgipr9ml2bbpivk6dxm69c6987dk7him'';
     };
-    buildr_1_4_7 = {
+    builder_3_2_0 = {
+      basename = ''builder'';
+      meta = {
+        description = ''Builders for MarkUp.'';
+        homepage = ''http://onestepback.org'';
+        longDescription = ''Builder provides a number of builder objects that make creating structured data
+simple to do.  Currently the following builder objects are supported:
+
+* XML Markup
+* XML Events
+'';
+      };
+      name = ''builder-3.2.0'';
+      requiredGems = [  ];
+      sha256 = ''0f2cpfx6lpazb1wrz3lf06qp6f0qf0gdq5z8xnhkplc3fz3kslb0'';
+    };
+    buildr_1_4_11 = {
       basename = ''buildr'';
       meta = {
         description = ''Build like you code'';
@@ -267,31 +347,53 @@ to do, and it takes care of the rest.  But also something we can easily extend
 for those one-off tasks, with a language that's a joy to use.
 '';
       };
-      name = ''buildr-1.4.7'';
-      requiredGems = [ g.rake_0_9_2_2 g.builder_2_1_2 g.net_ssh_2_3_0 g.net_sftp_2_0_5 g.rubyzip_0_9_4 g.highline_1_6_2 g.json_pure_1_4_3 g.rubyforge_2_0_3 g.hoe_2_3_3 g.rjb_1_4_0 g.atoulme_Antwrap_0_7_2 g.diff_lcs_1_1_3 g.rspec_expectations_2_9_0 g.rspec_mocks_2_9_0 g.rspec_core_2_9_0 g.rspec_2_9_0 g.xml_simple_1_0_12 g.minitar_0_5_3 ];
-      sha256 = ''0ddb71xgdjxvkf485c16kvip8i26wy4l171pjbw04qmy3cank42h'';
+      name = ''buildr-1.4.11'';
+      requiredGems = [ g.rake_0_9_2_2 g.builder_3_1_3 g.net_ssh_2_6_0 g.net_sftp_2_0_5 g.rubyzip_0_9_9 g.highline_1_6_2 g.json_pure_1_7_5 g.rubyforge_2_0_4 g.hoe_3_1_0 g.rjb_1_4_2 g.atoulme_Antwrap_0_7_4 g.diff_lcs_1_1_3 g.rspec_expectations_2_11_3 g.rspec_mocks_2_11_3 g.rspec_core_2_11_1 g.rspec_2_11_0 g.xml_simple_1_1_1 g.minitar_0_5_3 g.bundler_1_3_4 ];
+      sha256 = ''0bdrwl9jvxc5h2wqsyacr688hxvzcqan1bhqyryb5bg9a5gpscb4'';
     };
-    bundler_1_1_4 = {
+    bundler_1_3_4 = {
       basename = ''bundler'';
       meta = {
         description = ''The best way to manage your application's dependencies'';
         homepage = ''http://gembundler.com'';
         longDescription = ''Bundler manages an application's dependencies through its entire life, across many machines, systematically and repeatably'';
       };
-      name = ''bundler-1.1.4'';
+      name = ''bundler-1.3.4'';
       requiredGems = [  ];
-      sha256 = ''13pj4kk01xrdmdvgz1mvvhnbp1vi40gq50n8wdk3lpqp5za26gr0'';
+      sha256 = ''1vgrc71nhnqlrg08zvs63afa1z9kzn2vvn95b14dvy14k2br3qhj'';
     };
-    childprocess_0_3_3 = {
+    childprocess_0_3_9 = {
       basename = ''childprocess'';
       meta = {
         description = ''This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.'';
         homepage = ''http://github.com/jarib/childprocess'';
         longDescription = ''This gem aims at being a simple and reliable solution for controlling external programs running in the background on any Ruby / OS combination.'';
       };
-      name = ''childprocess-0.3.3'';
-      requiredGems = [ g.ffi_1_0_11 ];
-      sha256 = ''0yqlbxnc427lnh1xw71qyzkic1pdpmacqxp8zw0gvx7yzkw3fjr0'';
+      name = ''childprocess-0.3.9'';
+      requiredGems = [ g.ffi_1_6_0 ];
+      sha256 = ''0jbz2ix7ff9ry8717lhcq9w8j8yd45akw48giwgdqccay5mlph7d'';
+    };
+    chronic_0_9_1 = {
+      basename = ''chronic'';
+      meta = {
+        description = ''Natural language date/time parsing.'';
+        homepage = ''http://github.com/mojombo/chronic'';
+        longDescription = ''Chronic is a natural language date/time parser written in pure Ruby.'';
+      };
+      name = ''chronic-0.9.1'';
+      requiredGems = [  ];
+      sha256 = ''0kspaxpfy7yvyk1lvpx31w852qfj8wb9z04mcj5bzi70ljb9awqk'';
+    };
+    daemons_1_1_9 = {
+      basename = ''daemons'';
+      meta = {
+        description = ''A toolkit to create and control daemons in different ways'';
+        homepage = ''http://daemons.rubyforge.org'';
+        longDescription = ''Daemons provides an easy way to wrap existing ruby scripts (for example a self-written server)  to be run as a daemon and to be controlled by simple start/stop/restart commands.  You can also call blocks as daemons and control them from the parent or just daemonize the current process.  Besides this basic functionality, daemons offers many advanced features like exception  backtracing and logging (in case your ruby script crashes) and monitoring and automatic restarting of your processes if they crash.'';
+      };
+      name = ''daemons-1.1.9'';
+      requiredGems = [  ];
+      sha256 = ''1j1m64pirsldhic6x6sg4lcrmp1bs1ihpd49xm8m1b2rc1c3irzy'';
     };
     diff_lcs_1_1_3 = {
       basename = ''diff_lcs'';
@@ -318,6 +420,27 @@ is the MIT license.'';
       requiredGems = [  ];
       sha256 = ''15wqs3md9slif6ag43vp6gw63r3a2zdqiyfapnnzkb7amgg930pv'';
     };
+    dimensions_1_2_0 = {
+      basename = ''dimensions'';
+      meta = {
+        description = ''Pure Ruby dimension measurement for GIF, PNG, JPEG and TIFF images'';
+        homepage = ''https://github.com/sstephenson/dimensions'';
+        longDescription = ''A pure Ruby library for measuring the dimensions and rotation angles of GIF, PNG, JPEG and TIFF images.'';
+      };
+      name = ''dimensions-1.2.0'';
+      requiredGems = [  ];
+      sha256 = ''1pqb7yzjcpbgbyi196ifqbd1wy570cn12bkzcvpcha4xilhajja0'';
+    };
+    em_resolv_replace_1_1_3 = {
+      basename = ''em_resolv_replace'';
+      meta = {
+        description = ''EventMachine-aware DNS lookup for Ruby'';
+        homepage = ''http://github.com/mperham/em-resolv-replace'';
+      };
+      name = ''em-resolv-replace-1.1.3'';
+      requiredGems = [  ];
+      sha256 = ''1w5y4rzmp51ni56v05qwgay5wrs2i6i3q92pvlcrghmhxhgsbqg7'';
+    };
     erubis_2_7_0 = {
       basename = ''erubis'';
       meta = {
@@ -341,6 +464,48 @@ is the MIT license.'';
       requiredGems = [  ];
       sha256 = ''1fj827xqjs91yqsydf0zmfyw9p4l2jz5yikg3mppz6d7fi8kyrb3'';
     };
+    eventmachine_1_0_3 = {
+      basename = ''eventmachine'';
+      meta = {
+        description = ''Ruby/EventMachine library'';
+        homepage = ''http://rubyeventmachine.com'';
+        longDescription = ''EventMachine implements a fast, single-threaded engine for arbitrary network
+communications. It's extremely easy to use in Ruby. EventMachine wraps all
+interactions with IP sockets, allowing programs to concentrate on the
+implementation of network protocols. It can be used to create both network
+servers and clients. To create a server or client, a Ruby program only needs
+to specify the IP address and port, and provide a Module that implements the
+communications protocol. Implementations of several standard network protocols
+are provided with the package, primarily to serve as examples. The real goal
+of EventMachine is to enable programs to easily interface with other programs
+using TCP/IP, especially if custom protocols are required.'';
+      };
+      name = ''eventmachine-1.0.3'';
+      requiredGems = [  ];
+      sha256 = ''09sqlsb6x9ddlgfw5gsw7z0yjg5m2qfjiqkz2fx70zsizj3lqhil'';
+    };
+    eventmachine_tail_0_6_4 = {
+      basename = ''eventmachine_tail'';
+      meta = {
+        description = ''eventmachine tail - a file tail implementation with glob support'';
+        homepage = ''http://code.google.com/p/semicomplete/wiki/EventMachineTail'';
+        longDescription = ''Add file 'tail' implemented with EventMachine. Also includes a 'glob watch' class for watching a directory pattern for new matches, like /var/log/*.log'';
+      };
+      name = ''eventmachine-tail-0.6.4'';
+      requiredGems = [ g.eventmachine_1_0_3 ];
+      sha256 = ''1pvlb34vdzd81kf9f3xyibb4f55xjqm7lqqy28dgyci5cyv50y61'';
+    };
+    execjs_1_4_0 = {
+      basename = ''execjs'';
+      meta = {
+        description = ''Run JavaScript code from Ruby'';
+        homepage = ''https://github.com/sstephenson/execjs'';
+        longDescription = ''ExecJS lets you run JavaScript code from Ruby.'';
+      };
+      name = ''execjs-1.4.0'';
+      requiredGems = [ g.multi_json_1_7_2 ];
+      sha256 = ''0b69ci2afbcdqsri3i89a7s7j7palxsxdb65x6h2wx79kzlc5xcs'';
+    };
     fakes3_0_1_5 = {
       basename = ''fakes3'';
       meta = {
@@ -348,23 +513,77 @@ is the MIT license.'';
         longDescription = ''Use FakeS3 to test basic S3 functionality without actually connecting to S3'';
       };
       name = ''fakes3-0.1.5'';
-      requiredGems = [ g.thor_0_15_4 g.builder_3_0_0 ];
+      requiredGems = [ g.thor_0_18_0 g.builder_3_2_0 ];
       sha256 = ''1na5wrbarla6s414svqmr5spbpv6vmcgpswal444x4clcpmadhib'';
     };
-    ffi_1_0_11 = {
+    faraday_0_8_7 = {
+      basename = ''faraday'';
+      meta = {
+        description = ''HTTP/REST API client library.'';
+        homepage = ''https://github.com/lostisland/faraday'';
+      };
+      name = ''faraday-0.8.7'';
+      requiredGems = [ g.multipart_post_1_2_0 ];
+      sha256 = ''186a9md3ixanl2crdlw37kspw5wiyw16z9mj3aw8rd1yd5q56ddi'';
+    };
+    faraday_middleware_0_8_8 = {
+      basename = ''faraday_middleware'';
+      meta = {
+        description = ''Various middleware for Faraday'';
+        homepage = ''https://github.com/pengwynn/faraday_middleware'';
+        longDescription = ''Various middleware for Faraday'';
+      };
+      name = ''faraday_middleware-0.8.8'';
+      requiredGems = [ g.faraday_0_8_7 ];
+      sha256 = ''1n0g8pm7ynx6ffyqhscc1cqw97zhvd8isr31yfyj15335j1jsncz'';
+    };
+    ffi_1_6_0 = {
       basename = ''ffi'';
       meta = {
-        description = ''Ruby-FFI is a ruby extension for programmatically loading dynamic libraries, binding functions within them, and calling those functions from Ruby code'';
+        description = ''Ruby FFI'';
         homepage = ''http://wiki.github.com/ffi/ffi'';
-        longDescription = ''Ruby-FFI is a ruby extension for programmatically loading dynamic
-libraries, binding functions within them, and calling those functions
-from Ruby code. Moreover, a Ruby-FFI extension works without changes
-on Ruby and JRuby. Discover why should you write your next extension
-using Ruby-FFI here[http://wiki.github.com/ffi/ffi/why-use-ffi].'';
+        longDescription = ''Ruby FFI library'';
+      };
+      name = ''ffi-1.6.0'';
+      requiredGems = [  ];
+      sha256 = ''0jhjzj8gb6cakv32a6czgrx8krb0hx8mmkwh5yv2lhdcv3ak013v'';
+    };
+    file_tail_1_0_12 = {
+      basename = ''file_tail'';
+      meta = {
+        description = ''File::Tail for Ruby'';
+        homepage = ''http://github.com/flori/file-tail'';
+        longDescription = ''Library to tail files in Ruby'';
+      };
+      name = ''file-tail-1.0.12'';
+      requiredGems = [ g.tins_0_7_2 ];
+      sha256 = ''0mzxxnwj7k5pwxs0rdbmb3b41zgvzw7x40sf3qlkch4zdfx91i1j'';
+    };
+    foreman_0_62_0 = {
+      basename = ''foreman'';
+      meta = {
+        description = ''Process manager for applications with multiple components'';
+        homepage = ''http://github.com/ddollar/foreman'';
+        longDescription = ''Process manager for applications with multiple components'';
       };
-      name = ''ffi-1.0.11'';
+      name = ''foreman-0.62.0'';
+      requiredGems = [ g.thor_0_18_0 ];
+      sha256 = ''08i34rgs3bydk52zwpps4p0y2fvcnibp9lvfdhr75ppin7wv7lmr'';
+    };
+    highline_1_6_16 = {
+      basename = ''highline'';
+      meta = {
+        description = ''HighLine is a high-level command-line IO library.'';
+        homepage = ''http://highline.rubyforge.org'';
+        longDescription = ''A high-level IO library that provides validation, type conversion, and more for
+command-line interfaces. HighLine also includes a complete menu system that can
+crank out anything from simple list selection to complete shells with just
+minutes of work.
+'';
+      };
+      name = ''highline-1.6.16'';
       requiredGems = [  ];
-      sha256 = ''177v6bwslyb7n961nw11i8x9j43k796s11bs98kynl58n0a3n99b'';
+      sha256 = ''1v9dps96hryg7c8hqw41vbm1q02d7wpq7fj1c3bkzsd5518idgzi'';
     };
     highline_1_6_2 = {
       basename = ''highline'';
@@ -392,46 +611,47 @@ minutes of work.
       requiredGems = [  ];
       sha256 = ''1c78gja9i9nj76gdj65czhvwam6550l0w9ilnn8vysj9cwv0rg7b'';
     };
-    hoe_2_3_3 = {
+    hoe_3_1_0 = {
       basename = ''hoe'';
       meta = {
         description = ''Hoe is a rake/rubygems helper for project Rakefiles'';
-        homepage = ''http://rubyforge.org/projects/seattlerb/'';
-        longDescription = ''Hoe is a rake/rubygems helper for project Rakefiles. It helps generate
-rubygems and includes a dynamic plug-in system allowing for easy
-extensibility. Hoe ships with plug-ins for all your usual project
-tasks including rdoc generation, testing, packaging, and deployment.
+        homepage = ''http://www.zenspider.com/projects/hoe.html'';
+        longDescription = ''Hoe is a rake/rubygems helper for project Rakefiles. It helps you
+manage, maintain, and release your project and includes a dynamic
+plug-in system allowing for easy extensibility. Hoe ships with
+plug-ins for all your usual project tasks including rdoc generation,
+testing, packaging, deployment, and announcement..
 
-Plug-ins Provided:
+See class rdoc for help. Hint: `ri Hoe` or any of the plugins listed
+below.
 
-* Hoe::Clean
-* Hoe::Debug
-* Hoe::Deps
-* Hoe::Flay
-* Hoe::Flog
-* Hoe::Inline
-* Hoe::Package
-* Hoe::Publish
-* Hoe::RCov
-* Hoe::Signing
-* Hoe::Test
-
-See class rdoc for help. Hint: ri Hoe'';
+For extra goodness, see: http://seattlerb.rubyforge.org/hoe/Hoe.pdf'';
       };
-      name = ''hoe-2.3.3'';
-      requiredGems = [ g.rubyforge_2_0_4 ];
-      sha256 = ''06jlnbhimrn6znimaaxm7kh2269lapkbmnp3wssrjmw06ms7lq9m'';
+      name = ''hoe-3.1.0'';
+      requiredGems = [ g.rake_0_9_6 ];
+      sha256 = ''0i961x0hrd6fs1nsfham87dhn64gqpnai27l14jag7qbnp3a79yp'';
     };
-    i18n_0_6_0 = {
+    i18n_0_6_1 = {
       basename = ''i18n'';
       meta = {
         description = ''New wave Internationalization support for Ruby'';
         homepage = ''http://github.com/svenfuchs/i18n'';
         longDescription = ''New wave Internationalization support for Ruby.'';
       };
-      name = ''i18n-0.6.0'';
+      name = ''i18n-0.6.1'';
       requiredGems = [  ];
-      sha256 = ''1pgmfhmh2wv409g7kla30mkp8jpslvp25vcmmim1figl87wpn3j0'';
+      sha256 = ''0x3lhp1vl1k4dfqx6k93hhxcpjkz57y8cf007ws7p845ywk6ibfl'';
+    };
+    i18n_0_6_4 = {
+      basename = ''i18n'';
+      meta = {
+        description = ''New wave Internationalization support for Ruby'';
+        homepage = ''http://github.com/svenfuchs/i18n'';
+        longDescription = ''New wave Internationalization support for Ruby.'';
+      };
+      name = ''i18n-0.6.4'';
+      requiredGems = [  ];
+      sha256 = ''0wz1rnrs4n21j1rw9a120j2pfdkbikp1yvxaqi3mk30iw6mx4p0f'';
     };
     journey_1_0_4 = {
       basename = ''journey'';
@@ -444,80 +664,125 @@ See class rdoc for help. Hint: ri Hoe'';
       requiredGems = [  ];
       sha256 = ''03y1xidg1rx1yjz8xb50083vfwcsfkgs4zmizc040y1h4mhvhm3l'';
     };
-    json_1_7_3 = {
+    jruby_pageant_1_1_1 = {
+      basename = ''jruby_pageant'';
+      meta = {
+        description = ''jruby-pageant allows Pageant access on JRuby + Windows'';
+        homepage = ''http://github.com/arturaz/jruby-pageant'';
+        longDescription = ''This is a convenience gem packaging required JNA/JSCH jars.'';
+      };
+      name = ''jruby-pageant-1.1.1'';
+      requiredGems = [  ];
+      sha256 = ''1kgqsn0bagr41gf5kbqaxbs38a7s5bm85m0pdx4qz7d70v9nc9cl'';
+    };
+    jsduck_4_7_1 = {
+      basename = ''jsduck'';
+      meta = {
+        description = ''Simple JavaScript Duckumentation generator'';
+        homepage = ''https://github.com/senchalabs/jsduck'';
+        longDescription = ''Documentation generator for Sencha JS frameworks'';
+      };
+      name = ''jsduck-4.7.1'';
+      requiredGems = [ g.rdiscount_2_0_7_1 g.json_1_7_7 g.parallel_0_6_3 g.execjs_1_4_0 g.therubyracer_0_10_2 g.dimensions_1_2_0 ];
+      sha256 = ''0yn568ix4j4xpyrsk07cp5c3migsl7ymlg07fsyn5a65yrwyaiyv'';
+    };
+    json_1_7_7 = {
       basename = ''json'';
       meta = {
         description = ''JSON Implementation for Ruby'';
         homepage = ''http://flori.github.com/json'';
         longDescription = ''This is a JSON implementation as a Ruby extension in C.'';
       };
-      name = ''json-1.7.3'';
+      name = ''json-1.7.7'';
       requiredGems = [  ];
-      sha256 = ''1n969j5k0zb7dqfbnjhqm5hnxpsbi05rhsp5ww3cph7d5z6ycw0h'';
+      sha256 = ''1v5pn3g9ignbgrfl72dbf7bzvxsm90ybp24fa3bm9cv5cpa2ww7x'';
     };
-    json_pure_1_4_3 = {
+    json_pure_1_7_5 = {
       basename = ''json_pure'';
       meta = {
         description = ''JSON Implementation for Ruby'';
         homepage = ''http://flori.github.com/json'';
         longDescription = ''This is a JSON implementation in pure Ruby.'';
       };
-      name = ''json_pure-1.4.3'';
+      name = ''json_pure-1.7.5'';
       requiredGems = [  ];
-      sha256 = ''1xw357gkmk6712c94lhpsrq8j9v91mgc2nxlr1m6n20yl6sz2g9r'';
+      sha256 = ''14nwwf001mh70qnynpb3h8c0kgcfi666yrg2frib4p6lr57jx8ap'';
     };
-    json_pure_1_7_3 = {
+    json_pure_1_7_7 = {
       basename = ''json_pure'';
       meta = {
         description = ''JSON Implementation for Ruby'';
         homepage = ''http://flori.github.com/json'';
         longDescription = ''This is a JSON implementation in pure Ruby.'';
       };
-      name = ''json_pure-1.7.3'';
+      name = ''json_pure-1.7.7'';
       requiredGems = [  ];
-      sha256 = ''0m316halw0l1gd2lx811qhyfs9a98dfgxign8zij0a1wn9wsh2ci'';
+      sha256 = ''0jxp0amx9xhka0ixnhvfgwc5ydr82hkxp81pvw32z31arx7jrwl6'';
     };
-    libwebsocket_0_1_3 = {
-      basename = ''libwebsocket'';
+    libv8_3_3_10_4 = {
+      basename = ''libv8'';
       meta = {
-        description = ''Universal Ruby library to handle WebSocket protocol'';
-        homepage = ''http://github.com/imanel/libwebsocket'';
-        longDescription = ''Universal Ruby library to handle WebSocket protocol'';
+        description = ''Distribution of the V8 JavaScript engine'';
+        homepage = ''http://github.com/fractaloop/libv8'';
+        longDescription = ''Distributes the V8 JavaScript engine in binary and source forms in order to support fast builds of The Ruby Racer'';
+      };
+      name = ''libv8-3.3.10.4'';
+      requiredGems = [  ];
+      sha256 = ''0zy585rs1ihm8nsw525wgmbkcq7aqy1k9dbkk8s6953adl0bpz42'';
+    };
+    macaddr_1_6_1 = {
+      basename = ''macaddr'';
+      meta = {
+        description = ''macaddr'';
+        homepage = ''https://github.com/ahoward/macaddr'';
+        longDescription = ''description: macaddr kicks the ass'';
       };
-      name = ''libwebsocket-0.1.3'';
-      requiredGems = [ g.addressable_2_2_8 ];
-      sha256 = ''12i3lyjd9dqvk9wpnrz9zzj7dgb6660dz8xlc7h1nixhsny1y83n'';
+      name = ''macaddr-1.6.1'';
+      requiredGems = [ g.systemu_2_5_2 ];
+      sha256 = ''1vd9l1d0lc0sq3rn1ya816wrzgxxqdzq6pgq0y0435qm6ikwy7ch'';
     };
-    mail_2_4_4 = {
+    mail_2_5_3 = {
       basename = ''mail'';
       meta = {
         description = ''Mail provides a nice Ruby DSL for making, sending and reading emails.'';
         homepage = ''http://github.com/mikel/mail'';
         longDescription = ''A really Ruby Mail handler.'';
       };
-      name = ''mail-2.4.4'';
-      requiredGems = [ g.mime_types_1_19 g.treetop_1_4_10 ];
-      sha256 = ''0idylz5pnlz34mrxm7gs9jbll2c0k0y9dq2qarhxk30gwyvjaxi3'';
+      name = ''mail-2.5.3'';
+      requiredGems = [ g.mime_types_1_21 g.treetop_1_4_12 g.i18n_0_6_4 ];
+      sha256 = ''1afr3acz7vsvr4gp6wnrkw1iwbjhf14mh8g8mlm40r86wcwzr39k'';
     };
-    mime_types_1_19 = {
+    mime_types_1_21 = {
       basename = ''mime_types'';
       meta = {
         description = ''This library allows for the identification of a file's likely MIME content type'';
         homepage = ''http://mime-types.rubyforge.org/'';
         longDescription = ''This library allows for the identification of a file's likely MIME content
-type. This is release 1.19 with new MIME types. The identification of MIME
+type. This is release 1.21 with new MIME types. The identification of MIME
 content type is based on a file's filename extensions.
 
+MIME types are used in MIME-compliant communications, as in e-mail or
+HTTP traffic, to indicate the type of content which is transmitted.
+MIME::Types provides the ability for detailed information about MIME
+entities (provided as a set of MIME::Type objects) to be determined and
+used programmatically. There are many types defined by RFCs and vendors,
+so the list is long but not complete; don't hesitate to ask to add
+additional information. This library follows the IANA collection of MIME
+types (see below for reference).
+
 MIME::Types for Ruby was originally based on and synchronized with MIME::Types
 for Perl by Mark Overmeer, copyright 2001 - 2009. As of version 1.15, the data
 format for the MIME::Type list has changed and the synchronization will no
 longer happen.
 
-:include: Licence.rdoc'';
+MIME::Types is built to conform to the MIME types of RFCs 2045 and 2231. It
+follows the official {IANA registry}[http://www.iana.org/assignments/media-types/]
+({ftp}[ftp://ftp.iana.org/assignments/media-types]) with some unofficial types
+added from the the {LTSW collection}[http://www.ltsw.se/knbase/internet/mime.htp].'';
       };
-      name = ''mime-types-1.19'';
+      name = ''mime-types-1.21'';
       requiredGems = [  ];
-      sha256 = ''1b44lrzk9v6i0jyajkx106qjyg8ns7siw1k42hmmwqj574ffsn26'';
+      sha256 = ''1qmx53a2kqk0nnhjbfvbc213wsxiprl0wqm7f2xvcsh253ld91iw'';
     };
     minitar_0_5_3 = {
       basename = ''minitar'';
@@ -530,16 +795,27 @@ longer happen.
       requiredGems = [  ];
       sha256 = ''035vs1knnnjsb8arfp8vx75warvwcdpiljjwv38lqljai9v8fq53'';
     };
-    multi_json_1_3_6 = {
+    multi_json_1_7_2 = {
       basename = ''multi_json'';
       meta = {
         description = ''A gem to provide swappable JSON backends.'';
         homepage = ''http://github.com/intridea/multi_json'';
         longDescription = ''A gem to provide easy switching between different JSON backends, including Oj, Yajl, the JSON gem (with C-extensions), the pure-Ruby JSON gem, and OkJson.'';
       };
-      name = ''multi_json-1.3.6'';
+      name = ''multi_json-1.7.2'';
+      requiredGems = [  ];
+      sha256 = ''17mfs58bilkn2b9g3ggh6pz1w4c2a72mqsr6zf0qd8vahw5h158q'';
+    };
+    multipart_post_1_2_0 = {
+      basename = ''multipart_post'';
+      meta = {
+        description = ''A multipart form post accessory for Net::HTTP.'';
+        homepage = ''https://github.com/nicksieger/multipart-post'';
+        longDescription = ''Use with Net::HTTP to do multipart form posts.  IO values that have #content_type, #original_filename, and #local_path will be posted as a binary file.'';
+      };
+      name = ''multipart-post-1.2.0'';
       requiredGems = [  ];
-      sha256 = ''0q2zjfvd2ibds9g9nzf2p1b47fc1wqliwfywv5pw85w15lmy91yr'';
+      sha256 = ''12p7lnmc52di1r4h73h6xrpppplzyyhani9p7wm8l4kgf1hnmwnc'';
     };
     net_sftp_2_0_5 = {
       basename = ''net_sftp'';
@@ -549,30 +825,30 @@ longer happen.
         longDescription = ''A pure Ruby implementation of the SFTP client protocol'';
       };
       name = ''net-sftp-2.0.5'';
-      requiredGems = [ g.net_ssh_2_5_2 ];
+      requiredGems = [ g.net_ssh_2_6_6 ];
       sha256 = ''0lqk735wspm8rbiyxpbil8ikrqcyg00ss1df7fny0761c3as6m0v'';
     };
-    net_ssh_2_3_0 = {
+    net_ssh_2_6_0 = {
       basename = ''net_ssh'';
       meta = {
         description = ''Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'';
         homepage = ''http://github.com/net-ssh/net-ssh'';
-        longDescription = ''Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'';
+        longDescription = ''Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.'';
       };
-      name = ''net-ssh-2.3.0'';
-      requiredGems = [  ];
-      sha256 = ''1q1fznl4nk2963czpzfby4m9jw9rs37k1rzgbjad5r1n7r6dv0sv'';
+      name = ''net-ssh-2.6.0'';
+      requiredGems = [ g.jruby_pageant_1_1_1 ];
+      sha256 = ''18fsgps4a9dfrjszkl3py8j7vw0xwi70bcp59ccj2rlr6i1jv5gw'';
     };
-    net_ssh_2_5_2 = {
+    net_ssh_2_6_6 = {
       basename = ''net_ssh'';
       meta = {
         description = ''Net::SSH: a pure-Ruby implementation of the SSH2 client protocol.'';
-        homepage = ''http://github.com/net-ssh/net-ssh'';
+        homepage = ''https://github.com/net-ssh/net-ssh'';
         longDescription = ''Net::SSH: a pure-Ruby implementation of the SSH2 client protocol. It allows you to write programs that invoke and interact with processes on remote servers, via SSH2.'';
       };
-      name = ''net-ssh-2.5.2'';
+      name = ''net-ssh-2.6.6'';
       requiredGems = [  ];
-      sha256 = ''0kalahmwz9ypglrgg29wlvr4wx381pqwmx9fq3pk600v3j7j018l'';
+      sha256 = ''00fdnwv3jf311jjcc51lq8w26r62vzma91i79h5hj8i1ylrilx51'';
     };
     nix_0_1_1 = {
       basename = ''nix'';
@@ -585,6 +861,53 @@ longer happen.
       requiredGems = [  ];
       sha256 = ''0kwrbkkg0gxibhsz9dpd5zabcf2wqsicg28yiazyb3dc9dslk26k'';
     };
+    nokogiri_1_5_9 = {
+      basename = ''nokogiri'';
+      meta = {
+        description = ''Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser'';
+        homepage = ''http://nokogiri.org'';
+        longDescription = ''Nokogiri (鋸) is an HTML, XML, SAX, and Reader parser.  Among Nokogiri's
+many features is the ability to search documents via XPath or CSS3 selectors.
+
+XML is like violence - if it doesn’t solve your problems, you are not using
+enough of it.'';
+      };
+      name = ''nokogiri-1.5.9'';
+      requiredGems = [  ];
+      sha256 = ''08qx4p3p6dd1yh58c4waz5rjmkzv3v315fr0l6n0dgkg71dczbi9'';
+    };
+    papertrail_0_9_7 = {
+      basename = ''papertrail'';
+      meta = {
+        description = ''Command-line client for Papertrail hosted log management service.'';
+        homepage = ''http://github.com/papertrail/papertrail-cli'';
+        longDescription = ''Command-line client for Papertrail hosted log management service. Tails and searches app server logs and system syslog. Supports Boolean search and works with grep and pipe output (Unix).'';
+      };
+      name = ''papertrail-0.9.7'';
+      requiredGems = [ g.addressable_2_3_3 g.yajl_ruby_1_1_0 g.chronic_0_9_1 g.faraday_0_8_7 g.faraday_middleware_0_8_8 ];
+      sha256 = ''0v0m1v0qabbr9pmyl77znz39qy1m7p0xwvf3lf9hyq6n524f2dwr'';
+    };
+    papertrail_cli_0_9_3 = {
+      basename = ''papertrail_cli'';
+      meta = {
+        description = ''Placeholder gem to point to new papertrail gem'';
+        homepage = ''http://github.com/papertrail/papertrail-cli-gem'';
+        longDescription = ''Placeholder gem to point to new papertrail gem.'';
+      };
+      name = ''papertrail-cli-0.9.3'';
+      requiredGems = [ g.papertrail_0_9_7 ];
+      sha256 = ''1914dcfqsmw5rl4xd1zwjrfbgwglyncxm8km06bgxaqn4wnaq5iv'';
+    };
+    parallel_0_6_3 = {
+      basename = ''parallel'';
+      meta = {
+        description = ''Run any kind of code in parallel processes'';
+        homepage = ''https://github.com/grosser/parallel'';
+      };
+      name = ''parallel-0.6.3'';
+      requiredGems = [  ];
+      sha256 = ''17mg4vfx1c4z7399azf982a3cn522m43kavdqfhfs6i89m7z0l9n'';
+    };
     polyglot_0_3_3 = {
       basename = ''polyglot'';
       meta = {
@@ -599,23 +922,41 @@ augments 'require' to find and load matching files.'';
       requiredGems = [  ];
       sha256 = ''082zmail2h3cxd9z1wnibhk6aj4sb1f3zzwra6kg9bp51kx2c00v'';
     };
-    rack_1_4_1 = {
+    rack_1_4_5 = {
       basename = ''rack'';
       meta = {
         description = ''a modular Ruby webserver interface'';
-        homepage = ''http://rack.rubyforge.org'';
+        homepage = ''http://rack.github.com/'';
         longDescription = ''Rack provides a minimal, modular and adaptable interface for developing
 web applications in Ruby.  By wrapping HTTP requests and responses in
 the simplest way possible, it unifies and distills the API for web
 servers, web frameworks, and software in between (the so-called
 middleware) into a single method call.
 
-Also see http://rack.rubyforge.org.
+Also see http://rack.github.com/.
 '';
       };
-      name = ''rack-1.4.1'';
+      name = ''rack-1.4.5'';
       requiredGems = [  ];
-      sha256 = ''1cx3wzg48pn4sbb6a0iq726fjh3q7y77fly81mfnprrnwp7d0190'';
+      sha256 = ''027k0nbb8d7cl24x2cywdc6lgrr4lwvdwwjk8wkgz8h9ism3zgzp'';
+    };
+    rack_1_5_2 = {
+      basename = ''rack'';
+      meta = {
+        description = ''a modular Ruby webserver interface'';
+        homepage = ''http://rack.github.com/'';
+        longDescription = ''Rack provides a minimal, modular and adaptable interface for developing
+web applications in Ruby.  By wrapping HTTP requests and responses in
+the simplest way possible, it unifies and distills the API for web
+servers, web frameworks, and software in between (the so-called
+middleware) into a single method call.
+
+Also see http://rack.github.com/.
+'';
+      };
+      name = ''rack-1.5.2'';
+      requiredGems = [  ];
+      sha256 = ''19szfw76cscrzjldvw30jp3461zl00w4xvw1x9lsmyp86h1g0jp6'';
     };
     rack_cache_1_2 = {
       basename = ''rack_cache'';
@@ -625,10 +966,21 @@ Also see http://rack.rubyforge.org.
         longDescription = ''Rack::Cache is suitable as a quick drop-in component to enable HTTP caching for Rack-based applications that produce freshness (Expires, Cache-Control) and/or validation (Last-Modified, ETag) information.'';
       };
       name = ''rack-cache-1.2'';
-      requiredGems = [ g.rack_1_4_1 ];
+      requiredGems = [ g.rack_1_5_2 ];
       sha256 = ''073ffpsqmy4nqxz178qisb3a4v3305c49ypj0jw6s9mkz02yvgq2'';
     };
-    rack_ssl_1_3_2 = {
+    rack_protection_1_5_0 = {
+      basename = ''rack_protection'';
+      meta = {
+        description = ''You should use protection!'';
+        homepage = ''http://github.com/rkh/rack-protection'';
+        longDescription = ''You should use protection!'';
+      };
+      name = ''rack-protection-1.5.0'';
+      requiredGems = [ g.rack_1_5_2 ];
+      sha256 = ''10wm67f2mp9pryg0s8qapbyxd2lcrpb8ywsbicg29cv2xprhbl4j'';
+    };
+    rack_ssl_1_3_3 = {
       basename = ''rack_ssl'';
       meta = {
         description = ''Force SSL/TLS in your app.'';
@@ -636,11 +988,11 @@ Also see http://rack.rubyforge.org.
         longDescription = ''    Rack middleware to force SSL/TLS.
 '';
       };
-      name = ''rack-ssl-1.3.2'';
-      requiredGems = [  ];
-      sha256 = ''1h9pfn5c95qigkm1vb5nbla7fwjl86q887w57iiqp4kdvrjh9wrn'';
+      name = ''rack-ssl-1.3.3'';
+      requiredGems = [ g.rack_1_5_2 ];
+      sha256 = ''0rkmj71s87prswa8sqal42kdllgpfd35ir5m9ahhnlmrrpqd0hr5'';
     };
-    rack_test_0_6_1 = {
+    rack_test_0_6_2 = {
       basename = ''rack_test'';
       meta = {
         description = ''Simple testing API built on Rack'';
@@ -650,31 +1002,31 @@ own or as a reusable starting point for Web frameworks and testing libraries
 to build on. Most of its initial functionality is an extraction of Merb 1.0's
 request helpers feature.'';
       };
-      name = ''rack-test-0.6.1'';
-      requiredGems = [  ];
-      sha256 = ''0hq5q8fjhbb7szzrj7k0l21z025c4qsxqzd5qmgivikhymw10ws0'';
+      name = ''rack-test-0.6.2'';
+      requiredGems = [ g.rack_1_5_2 ];
+      sha256 = ''01mk715ab5qnqf6va8k3hjsvsmplrfqpz6g58qw4m3l8mim0p4ky'';
     };
-    rails_3_2_6 = {
+    rails_3_2_13 = {
       basename = ''rails'';
       meta = {
         description = ''Full-stack web application framework.'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''Ruby on Rails is a full-stack web framework optimized for programmer happiness and sustainable productivity. It encourages beautiful code by favoring convention over configuration.'';
       };
-      name = ''rails-3.2.6'';
-      requiredGems = [ g.activesupport_3_2_6 g.actionpack_3_2_6 g.activerecord_3_2_6 g.activeresource_3_2_6 g.actionmailer_3_2_6 g.railties_3_2_6 g.bundler_1_1_4 ];
-      sha256 = ''184ys6yfdclv59x0wk7dxx6ss60bv5vsi89nf8n85sh4mn19sf2m'';
+      name = ''rails-3.2.13'';
+      requiredGems = [ g.activesupport_3_2_13 g.actionpack_3_2_13 g.activerecord_3_2_13 g.activeresource_3_2_13 g.actionmailer_3_2_13 g.railties_3_2_13 g.bundler_1_3_4 ];
+      sha256 = ''1f5w4ivy0jxpjf1gkav064i0gd5x9xqnznwrkbc3slc9savprifz'';
     };
-    railties_3_2_6 = {
+    railties_3_2_13 = {
       basename = ''railties'';
       meta = {
         description = ''Tools for creating, working with, and running Rails applications.'';
         homepage = ''http://www.rubyonrails.org'';
         longDescription = ''Rails internals: application bootup, plugins, generators, and rake tasks.'';
       };
-      name = ''railties-3.2.6'';
-      requiredGems = [ g.rack_ssl_1_3_2 g.rdoc_3_12 ];
-      sha256 = ''1qyb4kcg2ld86qp411njr6cxfhv2ddw3jghk2rbr8d5f1ci7gfdh'';
+      name = ''railties-3.2.13'';
+      requiredGems = [ g.rake_10_0_4 g.rack_ssl_1_3_3 g.thor_0_18_0 g.rdoc_3_12_2 g.activesupport_3_2_13 g.actionpack_3_2_13 ];
+      sha256 = ''01wbqfnlrs9nbs0b97dbxh7aap2bma7my530pcggxdf8ckms8kr9'';
     };
     rake_0_9_2_2 = {
       basename = ''rake'';
@@ -687,18 +1039,50 @@ request helpers feature.'';
       requiredGems = [  ];
       sha256 = ''19n4qp5gzbcqy9ajh56kgwqv9p9w2hnczhyvaqz0nlvk9diyng6q'';
     };
-    rb_fsevent_0_9_1 = {
+    rake_0_9_6 = {
+      basename = ''rake'';
+      meta = {
+        description = ''Ruby based make-like utility.'';
+        homepage = ''http://rake.rubyforge.org'';
+        longDescription = ''Rake is a Make-like program implemented in Ruby. Tasks and dependencies arespecified in standard Ruby syntax.'';
+      };
+      name = ''rake-0.9.6'';
+      requiredGems = [  ];
+      sha256 = ''09kyh351gddn6gjz255hbaza1cw235xvfz9dc15rhyq9phvqdphc'';
+    };
+    rake_10_0_4 = {
+      basename = ''rake'';
+      meta = {
+        description = ''Ruby based make-like utility.'';
+        homepage = ''http://rake.rubyforge.org'';
+        longDescription = ''Rake is a Make-like program implemented in Ruby. Tasks and dependencies arespecified in standard Ruby syntax.'';
+      };
+      name = ''rake-10.0.4'';
+      requiredGems = [  ];
+      sha256 = ''032z0csyi5bjfgzq3winvqvi9fpf3bfx518hzzapkfy90y702ds1'';
+    };
+    rb_fsevent_0_9_3 = {
       basename = ''rb_fsevent'';
       meta = {
         description = ''Very simple &amp; usable FSEvents API'';
         homepage = ''http://rubygems.org/gems/rb-fsevent'';
         longDescription = ''FSEvents API with Signals catching (without RubyCocoa)'';
       };
-      name = ''rb-fsevent-0.9.1'';
+      name = ''rb-fsevent-0.9.3'';
       requiredGems = [  ];
-      sha256 = ''02vgavzfsvzm0p9xvy314nnjixym82f2s58pw2i6d7p81yhvhsyh'';
+      sha256 = ''0bdnxwdxj4r1kdxfi5nszbsb126njrr81p912g64xxs2bgxd1bp1'';
     };
-    rdoc_3_12 = {
+    rdiscount_2_0_7_1 = {
+      basename = ''rdiscount'';
+      meta = {
+        description = ''Fast Implementation of Gruber's Markdown in C'';
+        homepage = ''http://github.com/rtomayko/rdiscount'';
+      };
+      name = ''rdiscount-2.0.7.1'';
+      requiredGems = [  ];
+      sha256 = ''1xjwi99wfyjhn72h8k709kbq2npqmw2zvikszxfg6in83yb8vmxn'';
+    };
+    rdoc_3_12_2 = {
       basename = ''rdoc'';
       meta = {
         description = ''RDoc produces HTML and command-line documentation for Ruby projects'';
@@ -709,11 +1093,101 @@ documentation.
 
 See RDoc for a description of RDoc's markup and basic use.'';
       };
-      name = ''rdoc-3.12'';
-      requiredGems = [ g.json_1_7_3 ];
-      sha256 = ''0cd4hrkba7zr675m62yb87l7hpf0sp2qw8ccc2s0y2fa2fxdxdkp'';
+      name = ''rdoc-3.12.2'';
+      requiredGems = [ g.json_1_7_7 ];
+      sha256 = ''1v9k4sp5yzj2bshngckdvivj6bszciskk1nd2r3wri2ygs7vgqm8'';
     };
-    rjb_1_4_0 = {
+    remote_syslog_1_6_13 = {
+      basename = ''remote_syslog'';
+      meta = {
+        description = ''Monitor plain text log file(s) for new entries and send to remote syslog collector'';
+        homepage = ''http://github.com/papertrail/remote_syslog'';
+        longDescription = ''Lightweight daemon to tail one or more log files and transmit UDP syslog messages to a remote syslog host (centralized log aggregation). Generates UDP packets itself instead of depending on a system syslog daemon, so it doesn't affect system-wide logging configuration.'';
+      };
+      name = ''remote_syslog-1.6.13'';
+      requiredGems = [ g.servolux_0_10_0 g.file_tail_1_0_12 g.eventmachine_1_0_3 g.eventmachine_tail_0_6_4 g.syslog_protocol_0_9_2 g.em_resolv_replace_1_1_3 ];
+      sha256 = ''0q35j02k2l3fw3fdzq0i3rd6chsqr982gj13f3m3lsxm7kms03nw'';
+    };
+    right_aws_3_0_5 = {
+      basename = ''right_aws'';
+      meta = {
+        description = ''The RightScale AWS gems have been designed to provide a robust, fast, and secure interface to Amazon EC2, EBS, S3, SQS, SDB, and CloudFront.'';
+        longDescription = ''== DESCRIPTION:
+
+The RightScale AWS gems have been designed to provide a robust, fast, and secure interface to Amazon EC2, EBS, S3, SQS, SDB, and CloudFront.
+These gems have been used in production by RightScale since late 2006 and are being maintained to track enhancements made by Amazon.
+The RightScale AWS gems comprise:
+
+- RightAws::Ec2 -- interface to Amazon EC2 (Elastic Compute Cloud) and the
+  associated EBS (Elastic Block Store)
+- RightAws::S3 and RightAws::S3Interface -- interface to Amazon S3 (Simple Storage Service)
+- RightAws::Sqs and RightAws::SqsInterface -- interface to first-generation Amazon SQS (Simple Queue Service) (API version 2007-05-01)
+- RightAws::SqsGen2 and RightAws::SqsGen2Interface -- interface to second-generation Amazon SQS (Simple Queue Service) (API version 2008-01-01)
+- RightAws::SdbInterface and RightAws::ActiveSdb -- interface to Amazon SDB (SimpleDB)
+- RightAws::AcfInterface -- interface to Amazon CloudFront, a content distribution service
+
+== FEATURES:
+
+- Full programmmatic access to EC2, EBS, S3, SQS, SDB, and CloudFront.
+- Complete error handling: all operations check for errors and report complete
+  error information by raising an AwsError.
+- Persistent HTTP connections with robust network-level retry layer using
+  RightHttpConnection).  This includes socket timeouts and retries.
+- Robust HTTP-level retry layer.  Certain (user-adjustable) HTTP errors returned
+  by Amazon's services are classified as temporary errors.
+  These errors are automaticallly retried using exponentially increasing intervals.
+  The number of retries is user-configurable.
+- Fast REXML-based parsing of responses (as fast as a pure Ruby solution allows).
+- Uses libxml (if available) for faster response parsing.
+- Support for large S3 list operations.  Buckets and key subfolders containing
+  many (&gt; 1000) keys are listed in entirety.  Operations based on list (like
+  bucket clear) work on arbitrary numbers of keys.
+- Support for streaming GETs from S3, and streaming PUTs to S3 if the data source is a file.
+- Support for single-threaded usage, multithreaded usage, as well as usage with multiple
+  AWS accounts.
+- Support for both first- and second-generation SQS (API versions 2007-05-01
+  and 2008-01-01).  These versions of SQS are not compatible.
+- Support for signature versions 0 and 1 on SQS, SDB, and EC2.
+- Interoperability with any cloud running Eucalyptus (http://eucalyptus.cs.ucsb.edu)
+- Test suite (requires AWS account to do "live" testing).
+'';
+      };
+      name = ''right_aws-3.0.5'';
+      requiredGems = [ g.right_http_connection_1_3_0 ];
+      sha256 = ''0pxdmxmqiidy3dpxsp4l0b1l6nq9b1sh4p1gkzalqm4l24646h4k'';
+    };
+    right_http_connection_1_3_0 = {
+      basename = ''right_http_connection'';
+      meta = {
+        description = ''RightScale's robust HTTP/S connection module'';
+        homepage = ''http://rightscale.rubyforge.org/'';
+        longDescription = ''Rightscale::HttpConnection is a robust HTTP/S library.  It implements a retry
+algorithm for low-level network errors.
+
+== FEATURES:
+
+- provides put/get streaming
+- does configurable retries on connect and read timeouts, DNS failures, etc.
+- HTTPS certificate checking
+'';
+      };
+      name = ''right_http_connection-1.3.0'';
+      requiredGems = [  ];
+      sha256 = ''0900zy2ya57vhxdkdm2gj7xmvzj4gwm5l7ad0lh68ka3vxhdi7ap'';
+    };
+    rjb_1_4_2 = {
+      basename = ''rjb'';
+      meta = {
+        description = ''Ruby Java bridge'';
+        homepage = ''http://rjb.rubyforge.org/'';
+        longDescription = ''RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
+'';
+      };
+      name = ''rjb-1.4.2'';
+      requiredGems = [  ];
+      sha256 = ''1cgbwpc45djs0mw05ydxf5apmb9ibj61n240ylqwzrajf13banzh'';
+    };
+    rjb_1_4_6 = {
       basename = ''rjb'';
       meta = {
         description = ''Ruby Java bridge'';
@@ -721,82 +1195,53 @@ See RDoc for a description of RDoc's markup and basic use.'';
         longDescription = ''RJB is a bridge program that connect between Ruby and Java with Java Native Interface.
 '';
       };
-      name = ''rjb-1.4.0'';
+      name = ''rjb-1.4.6'';
       requiredGems = [  ];
-      sha256 = ''03ildf1k04a430mqdfggld4wjvca3xd0d4qn0dwcfa2zxs3vnbz3'';
+      sha256 = ''0q2czc3ghk32hnxf76xsf0jqcfrnx60aqarvdjhgsfdc9a5pmk20'';
     };
-    rspec_2_9_0 = {
+    rspec_2_11_0 = {
       basename = ''rspec'';
       meta = {
-        description = ''rspec-2.9.0'';
+        description = ''rspec-2.11.0'';
         homepage = ''http://github.com/rspec'';
         longDescription = ''BDD for Ruby'';
       };
-      name = ''rspec-2.9.0'';
-      requiredGems = [ g.rspec_expectations_2_9_1 ];
-      sha256 = ''02r1cg82xia5vls4zq2dchmgdig8rpky8rivsqbckczr5k9w0hwv'';
+      name = ''rspec-2.11.0'';
+      requiredGems = [ g.rspec_core_2_11_1 g.rspec_expectations_2_11_3 g.rspec_mocks_2_11_3 ];
+      sha256 = ''0k55akvs2xhs57kz81g37s4v56vybq46sjs7f8wpybrwxryg1vxs'';
     };
-    rspec_core_2_9_0 = {
+    rspec_core_2_11_1 = {
       basename = ''rspec_core'';
       meta = {
-        description = ''rspec-core-2.9.0'';
+        description = ''rspec-core-2.11.1'';
         homepage = ''http://github.com/rspec/rspec-core'';
         longDescription = ''BDD for Ruby. RSpec runner and example groups.'';
       };
-      name = ''rspec-core-2.9.0'';
-      requiredGems = [  ];
-      sha256 = ''17wc7mqrwl0zzrx3gywf4w931vfdig1spyvl46fyqakf36shyknd'';
-    };
-    rspec_expectations_2_9_0 = {
-      basename = ''rspec_expectations'';
-      meta = {
-        description = ''rspec-expectations-2.9.0'';
-        homepage = ''http://github.com/rspec/rspec-expectations'';
-        longDescription = ''rspec expectations (should[_not] and matchers)'';
-      };
-      name = ''rspec-expectations-2.9.0'';
+      name = ''rspec-core-2.11.1'';
       requiredGems = [  ];
-      sha256 = ''0pdws2zdi1h7mx0dqhkx6l5sqvrnpkrvqsnxvpmxk413db7li34x'';
+      sha256 = ''035ki561pryy05y8cvv3mkihjwp9r2ychnazb7s33gl7q0l0jni4'';
     };
-    rspec_expectations_2_9_1 = {
+    rspec_expectations_2_11_3 = {
       basename = ''rspec_expectations'';
       meta = {
-        description = ''rspec-expectations-2.9.1'';
+        description = ''rspec-expectations-2.11.3'';
         homepage = ''http://github.com/rspec/rspec-expectations'';
         longDescription = ''rspec expectations (should[_not] and matchers)'';
       };
-      name = ''rspec-expectations-2.9.1'';
-      requiredGems = [  ];
-      sha256 = ''1vb7axdg76naml7i6zd45ry4gszs274xfqk1w617z0719mc557gc'';
+      name = ''rspec-expectations-2.11.3'';
+      requiredGems = [ g.diff_lcs_1_1_3 ];
+      sha256 = ''0vqqw4hkaff6v6i6kinki4jxp9xv8b2nbmz91qa1yhjd3wr14ai5'';
     };
-    rspec_mocks_2_9_0 = {
+    rspec_mocks_2_11_3 = {
       basename = ''rspec_mocks'';
       meta = {
-        description = ''rspec-mocks-2.9.0'';
+        description = ''rspec-mocks-2.11.3'';
         homepage = ''http://github.com/rspec/rspec-mocks'';
         longDescription = ''RSpec's 'test double' framework, with support for stubbing and mocking'';
       };
-      name = ''rspec-mocks-2.9.0'';
+      name = ''rspec-mocks-2.11.3'';
       requiredGems = [  ];
-      sha256 = ''10mp152j5l0r3mqqhxq35m3slamzdzwsm9qnf6chh0l3zx5dwifg'';
-    };
-    rubyforge_2_0_3 = {
-      basename = ''rubyforge'';
-      meta = {
-        description = ''A script which automates a limited set of rubyforge operations'';
-        homepage = ''http://codeforpeople.rubyforge.org/rubyforge/'';
-        longDescription = ''A script which automates a limited set of rubyforge operations.
-
-* Run 'rubyforge help' for complete usage.
-* Setup: For first time users AND upgrades to 0.4.0:
-  * rubyforge setup (deletes your username and password, so run sparingly!)
-  * edit ~/.rubyforge/user-config.yml
-  * rubyforge config
-* For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest.'';
-      };
-      name = ''rubyforge-2.0.3'';
-      requiredGems = [ g.json_pure_1_7_3 ];
-      sha256 = ''1ck9hkad55dy25819v4gd1nmnpvcrb3i4np3hc03h1j6q8qpxg5p'';
+      sha256 = ''1rna3ii52rlhhca49zigk692hdcmz7qib42i4hhny478k04wx0qg'';
     };
     rubyforge_2_0_4 = {
       basename = ''rubyforge'';
@@ -813,19 +1258,9 @@ See RDoc for a description of RDoc's markup and basic use.'';
 * For all rubyforge upgrades, run 'rubyforge config' to ensure you have latest.'';
       };
       name = ''rubyforge-2.0.4'';
-      requiredGems = [  ];
+      requiredGems = [ g.json_pure_1_7_7 ];
       sha256 = ''1wdaa4nzy39yzy848fa1rybi72qlyf9vhi1ra9wpx9rpi810fwh1'';
     };
-    rubyzip_0_9_4 = {
-      basename = ''rubyzip'';
-      meta = {
-        description = ''rubyzip is a ruby module for reading and writing zip files'';
-        homepage = ''http://rubyzip.sourceforge.net/'';
-      };
-      name = ''rubyzip-0.9.4'';
-      requiredGems = [  ];
-      sha256 = ''1lc67ssqyz49rm1jms5sdvy6x41h070razxlmvj4j5q6w3qixx41'';
-    };
     rubyzip_0_9_9 = {
       basename = ''rubyzip'';
       meta = {
@@ -836,7 +1271,7 @@ See RDoc for a description of RDoc's markup and basic use.'';
       requiredGems = [  ];
       sha256 = ''1khf6d903agnwd8965f5f8b353rzmfvygxp53z1199rqzw8h46q2'';
     };
-    sass_3_1_20 = {
+    sass_3_2_7 = {
       basename = ''sass'';
       meta = {
         description = ''A powerful but elegant CSS compiler that makes CSS fun again.'';
@@ -847,84 +1282,210 @@ See RDoc for a description of RDoc's markup and basic use.'';
       command line tool or a web-framework plugin.
 '';
       };
-      name = ''sass-3.1.20'';
+      name = ''sass-3.2.7'';
       requiredGems = [  ];
-      sha256 = ''1aw2n5vg82d7ajx9wpyfrx6v1ddxhk73j77dkwjgsmlgci5lab8a'';
+      sha256 = ''0c494gh1i4llk4lbi35vidsgclf3cgxind1a7nm499ac9sdz084s'';
     };
-    selenium_webdriver_2_24_0 = {
+    selenium_webdriver_2_31_0 = {
       basename = ''selenium_webdriver'';
       meta = {
         description = ''The next generation developer focused tool for automated testing of webapps'';
         homepage = ''http://selenium.googlecode.com'';
         longDescription = ''WebDriver is a tool for writing automated tests of websites. It aims to mimic the behaviour of a real user, and as such interacts with the HTML of the application.'';
       };
-      name = ''selenium-webdriver-2.24.0'';
-      requiredGems = [ g.rubyzip_0_9_9 g.childprocess_0_3_3 g.libwebsocket_0_1_3 ];
-      sha256 = ''0iricx2gglza44s92jhk7w44g2pbvg23jr5s0g3nggq7dc5mh48f'';
+      name = ''selenium-webdriver-2.31.0'';
+      requiredGems = [ g.multi_json_1_7_2 g.rubyzip_0_9_9 g.childprocess_0_3_9 g.websocket_1_0_7 ];
+      sha256 = ''1nv3ff31g183kdb97jjz0y7ny3vdnccd09pgblpj87bzhrrdfv3r'';
+    };
+    servolux_0_10_0 = {
+      basename = ''servolux'';
+      meta = {
+        description = ''* {Homepage}[http://rubygems.'';
+        homepage = ''http://gemcutter.org/gems/servolux'';
+        longDescription = ''Serv-O-Lux is a collection of Ruby classes that are useful for daemon and
+process management, and for writing your own Ruby services. The code is well
+documented and tested. It works with Ruby and JRuby supporting both 1.8 and 1.9
+interpreters.'';
+      };
+      name = ''servolux-0.10.0'';
+      requiredGems = [  ];
+      sha256 = ''08jdrk35f61ab8b48ffm85p9lgfpbnzq3n4is00gqhpcrrq72dhs'';
+    };
+    sinatra_1_3_2 = {
+      basename = ''sinatra'';
+      meta = {
+        description = ''Classy web-development dressed in a DSL'';
+        homepage = ''http://www.sinatrarb.com/'';
+        longDescription = ''Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort.'';
+      };
+      name = ''sinatra-1.3.2'';
+      requiredGems = [ g.rack_1_5_2 g.rack_protection_1_5_0 g.tilt_1_3_6 ];
+      sha256 = ''05blf915zpiwyz7agcn9rwdmddwxz0z4l3gd4qlqmrgd2vkw4sxc'';
     };
-    sprockets_2_1_3 = {
+    sprockets_2_2_2 = {
       basename = ''sprockets'';
       meta = {
         description = ''Rack-based asset packaging system'';
         homepage = ''http://getsprockets.org/'';
         longDescription = ''Sprockets is a Rack-based asset packaging system that concatenates and serves JavaScript, CoffeeScript, CSS, LESS, Sass, and SCSS.'';
       };
-      name = ''sprockets-2.1.3'';
-      requiredGems = [ g.hike_1_2_1 g.tilt_1_3_3 ];
-      sha256 = ''05q6qpskabl8v0vx1mwlzv5fhf48r9f4zvc7v3xdsygm2hbs3vzh'';
+      name = ''sprockets-2.2.2'';
+      requiredGems = [ g.hike_1_2_1 g.multi_json_1_7_2 g.rack_1_5_2 g.tilt_1_3_6 ];
+      sha256 = ''15ngw3bjbyr31ygzmmdxxa30ylah6pdn8akgdy9w30vfx2vr7s7s'';
+    };
+    syslog_protocol_0_9_2 = {
+      basename = ''syslog_protocol'';
+      meta = {
+        description = ''Syslog protocol parser and generator'';
+        homepage = ''https://github.com/eric/syslog_protocol'';
+        longDescription = ''Syslog protocol parser and generator'';
+      };
+      name = ''syslog_protocol-0.9.2'';
+      requiredGems = [  ];
+      sha256 = ''1yb2cmbyj0zmb2yhkgnmghcngrkhcxs4g1svcmgfj90l2hs23nmc'';
+    };
+    systemu_2_5_2 = {
+      basename = ''systemu'';
+      meta = {
+        description = ''systemu'';
+        homepage = ''https://github.com/ahoward/systemu'';
+        longDescription = ''description: systemu kicks the ass'';
+      };
+      name = ''systemu-2.5.2'';
+      requiredGems = [  ];
+      sha256 = ''0h834ajdg9w4xrijp31fn98pjfj08gi08xjvp5xh3i6hz9a25fhr'';
+    };
+    therubyracer_0_10_2 = {
+      basename = ''therubyracer'';
+      meta = {
+        description = ''Embed the V8 Javascript interpreter into Ruby'';
+        homepage = ''http://github.com/cowboyd/therubyracer'';
+        longDescription = ''Call javascript code and manipulate javascript objects from ruby. Call ruby code and manipulate ruby objects from javascript.'';
+      };
+      name = ''therubyracer-0.10.2'';
+      requiredGems = [ g.libv8_3_3_10_4 ];
+      sha256 = ''111hm2l613v06sy7pzjzmnyi4x11rg3c2syhnpv8fn0wnn9rdiyb'';
+    };
+    thin_1_5_1 = {
+      basename = ''thin'';
+      meta = {
+        description = ''A thin and fast web server'';
+        homepage = ''http://code.macournoyer.com/thin/'';
+        longDescription = ''A thin and fast web server'';
+      };
+      name = ''thin-1.5.1'';
+      requiredGems = [ g.rack_1_5_2 g.eventmachine_1_0_3 g.daemons_1_1_9 ];
+      sha256 = ''0hrq9m3hb6pm8yrqshhg0gafkphdpvwcqmr7k722kgdisp3w91ga'';
     };
-    thor_0_15_4 = {
+    thor_0_18_0 = {
       basename = ''thor'';
       meta = {
         description = ''A scripting framework that replaces rake, sake and rubigen'';
-        homepage = ''http://github.com/wycats/thor'';
+        homepage = ''http://whatisthor.com/'';
         longDescription = ''A scripting framework that replaces rake, sake and rubigen'';
       };
-      name = ''thor-0.15.4'';
+      name = ''thor-0.18.0'';
       requiredGems = [  ];
-      sha256 = ''1q4y34p4v0ipr6z5wcnc6n1mwfysrgjcibc1ls7rbdfzx4sdcic8'';
+      sha256 = ''0m7pl518j5q1ymgxmsi6xfjp6k40mwbmzk33s760v53azwxkfxan'';
     };
-    tilt_1_3_3 = {
+    tilt_1_3_6 = {
       basename = ''tilt'';
       meta = {
         description = ''Generic interface to multiple Ruby template engines'';
         homepage = ''http://github.com/rtomayko/tilt/'';
         longDescription = ''Generic interface to multiple Ruby template engines'';
       };
-      name = ''tilt-1.3.3'';
+      name = ''tilt-1.3.6'';
+      requiredGems = [  ];
+      sha256 = ''1yz6zfnwq0qyjn71115vd63ly8zm1jss0b2v7fbcbzzj9lrnq9y6'';
+    };
+    tins_0_7_2 = {
+      basename = ''tins'';
+      meta = {
+        description = ''Useful stuff.'';
+        homepage = ''http://flori.github.com/tins'';
+        longDescription = ''All the stuff that isn't good/big enough for a real library.'';
+      };
+      name = ''tins-0.7.2'';
       requiredGems = [  ];
-      sha256 = ''18qdl8nllbgwipa2ab9df3wlfgvsc8ml78hbypwc17b9qwv9bbs8'';
+      sha256 = ''142mvgn8218wikwdvd5gq4g6k3p24f273wlqvczzfhz02livrz90'';
     };
-    treetop_1_4_10 = {
+    treetop_1_4_12 = {
       basename = ''treetop'';
       meta = {
         description = ''A Ruby-based text parsing and interpretation DSL'';
-        homepage = ''http://functionalform.blogspot.com'';
+        homepage = ''https://github.com/cjheath/treetop'';
       };
-      name = ''treetop-1.4.10'';
-      requiredGems = [ g.polyglot_0_3_3 ];
-      sha256 = ''01f4w7fm6phhdbkx7bp0b58hrk3x4b0a63p2vvjbxm5gi2gv9ap2'';
+      name = ''treetop-1.4.12'';
+      requiredGems = [ g.polyglot_0_3_3 g.polyglot_0_3_3 ];
+      sha256 = ''1jlfjq67n933sm0px0s2j965v1kl1rj8fbx6xk8y4yppkv6ygxc8'';
     };
-    tzinfo_0_3_33 = {
+    tzinfo_0_3_37 = {
       basename = ''tzinfo'';
       meta = {
         description = ''Daylight-savings aware timezone library'';
         homepage = ''http://tzinfo.rubyforge.org/'';
         longDescription = ''TZInfo is a Ruby library that uses the standard tz (Olson) database to provide daylight savings aware transformations between times in different time zones.'';
       };
-      name = ''tzinfo-0.3.33'';
+      name = ''tzinfo-0.3.37'';
+      requiredGems = [  ];
+      sha256 = ''0pi2vabsg73h6z4wfwyd27k63issp2qp1nh0vd74rdk740gmb3kc'';
+    };
+    uuid_2_3_7 = {
+      basename = ''uuid'';
+      meta = {
+        description = ''UUID generator'';
+        homepage = ''http://github.com/assaf/uuid'';
+        longDescription = ''UUID generator for producing universally unique identifiers based on RFC 4122
+(http://www.ietf.org/rfc/rfc4122.txt).
+'';
+      };
+      name = ''uuid-2.3.7'';
+      requiredGems = [ g.macaddr_1_6_1 ];
+      sha256 = ''04q10an3v40zwjihvdwm23fw6vl39fbkhdiwfw78a51ym9airnlp'';
+    };
+    uuidtools_2_1_3 = {
+      basename = ''uuidtools'';
+      meta = {
+        description = ''UUID generator'';
+        homepage = ''http://uuidtools.rubyforge.org/'';
+        longDescription = ''A simple universally unique ID generation library.
+'';
+      };
+      name = ''uuidtools-2.1.3'';
+      requiredGems = [  ];
+      sha256 = ''0v8scs7760334kkwca7n8kah6nk4hyw7izgk014zg1l1yv7kzpi9'';
+    };
+    websocket_1_0_7 = {
+      basename = ''websocket'';
+      meta = {
+        description = ''Universal Ruby library to handle WebSocket protocol'';
+        homepage = ''http://github.com/imanel/websocket-ruby'';
+        longDescription = ''Universal Ruby library to handle WebSocket protocol'';
+      };
+      name = ''websocket-1.0.7'';
       requiredGems = [  ];
-      sha256 = ''0bgfbm2amclg6amf1g1pyw4bkpmavqzf2hq7w9466xz08z1zsv1p'';
+      sha256 = ''1jrfz4295qbnjaxv37fw9jzxyxz61izp7c0683mnscacpx262zw0'';
     };
-    xml_simple_1_0_12 = {
+    xml_simple_1_1_1 = {
       basename = ''xml_simple'';
       meta = {
         description = ''A simple API for XML processing.'';
         homepage = ''http://xml-simple.rubyforge.org'';
       };
-      name = ''xml-simple-1.0.12'';
+      name = ''xml-simple-1.1.1'';
+      requiredGems = [  ];
+      sha256 = ''0zlwz8kvpm45m227aazg369fapbqyhvd5v9aga8cvxyhqnq0b87i'';
+    };
+    yajl_ruby_1_1_0 = {
+      basename = ''yajl_ruby'';
+      meta = {
+        description = ''Ruby C bindings to the excellent Yajl JSON stream-based parser library.'';
+        homepage = ''http://github.com/brianmario/yajl-ruby'';
+      };
+      name = ''yajl-ruby-1.1.0'';
       requiredGems = [  ];
-      sha256 = ''0m7z3l8ccm3zd22gyx40fnfl0nah61jaigb4bkmplq0hdazyj60y'';
+      sha256 = ''0sj46j47icb12hdhcfh76rnvddyiic5ifqzkh3kla1vcr505kf4m'';
     };
   };
 }
diff --git a/pkgs/development/interpreters/ruby/libs.nix b/pkgs/development/interpreters/ruby/libs.nix
index 9aa9203f10f..1b4b7aec2b1 100644
--- a/pkgs/development/interpreters/ruby/libs.nix
+++ b/pkgs/development/interpreters/ruby/libs.nix
@@ -1,4 +1,4 @@
-{stdenv, getConfig, fetchurl, callPackage}:
+{ stdenv, config, fetchurl, callPackage }:
 
 let
   inherit (stdenv.lib) fold optional;
@@ -36,7 +36,7 @@ in
           if builtins.pathExists file then import (builtins.toPath file)
           else null;
       in
-      getConfig [ "gems" name ] fallback;
+      stdenv.lib.attrByPath [ "gems" name ] fallback config;
   in
 {
   generated = getLocalGemFun "generated";
diff --git a/pkgs/development/interpreters/ruby/patches.nix b/pkgs/development/interpreters/ruby/patches.nix
index a2d2d753a4a..c4da956b57c 100644
--- a/pkgs/development/interpreters/ruby/patches.nix
+++ b/pkgs/development/interpreters/ruby/patches.nix
@@ -1,5 +1,5 @@
 { fetchurl, writeScript, ruby, ncurses, sqlite, libxml2, libxslt, libffi
-, zlib, libuuid, gems, jdk }:
+, zlib, libuuid, gems, jdk, python, stdenv }:
 
 let
 
@@ -14,12 +14,46 @@ in
 
 {
   sup = { buildInputs = [ gems.ncursesw ]; };
+
+  libv8 = {
+    # This fix is needed to fool scons, which clears the environment by default.
+    # It's ugly, but it works.
+    #
+    # We create a gcc wrapper wrapper, which reexposes the environment variables
+    # that scons hides. Furthermore, they treat warnings as errors causing the
+    # build to fail, due to an unused variable.
+    #
+    # Finally, we must set CC and AR explicitly to allow scons to find the
+    # compiler and archiver
+    
+    preBuild = ''
+      cat > $TMPDIR/g++ <<EOF
+      #! ${stdenv.shell}
+      $(export)
+      
+      g++ \$(echo \$@ | sed 's/-Werror//g')
+      EOF
+      chmod +x $TMPDIR/g++
+      
+      
+      export CXX=$TMPDIR/g++
+      export AR=$(type -p ar)
+    '';
+    buildInputs = [ python ];
+  };
   
   sqlite3 = { propagatedBuildInputs = [ sqlite ]; };
   
   rails = { gemFlags = "--no-ri --no-rdoc"; };
   
   ncurses = { propagatedBuildInputs = [ ncurses ]; };
+
+  nix = {
+    postInstall = ''
+      cd $out/${ruby.gemPath}/gems/nix*
+      patch -Np1 -i ${./fix-gem-nix-versions.patch}
+    '';
+  };
   
   ncursesw = { propagatedBuildInputs = [ ncurses ]; };
   
diff --git a/pkgs/development/interpreters/ruby/ruby-2.0.nix b/pkgs/development/interpreters/ruby/ruby-2.0.nix
new file mode 100644
index 00000000000..7c47bac0bbb
--- /dev/null
+++ b/pkgs/development/interpreters/ruby/ruby-2.0.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl
+, zlib, zlibSupport ? true
+, openssl, opensslSupport ? true
+, gdbm, gdbmSupport ? true
+, ncurses, readline, cursesSupport ? false
+, groff, docSupport ? false
+, libyaml, yamlSupport ? true
+}:
+
+let
+  op = stdenv.lib.optional;
+  ops = stdenv.lib.optionals;
+in
+
+stdenv.mkDerivation rec {
+  version = with passthru; "${majorVersion}.${minorVersion}-p${patchLevel}";
+  
+  name = "ruby-${version}";
+  
+  src = fetchurl {
+    url = "ftp://ftp.ruby-lang.org/pub/ruby/2.0/${name}.tar.bz2";
+    sha256 = "0pr9jf01cfap93xcngyd5zpns67ffjsgaxkm0qr1r464rj9d7066";
+  };
+
+  # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
+  NROFF = "${groff}/bin/nroff";
+
+  buildInputs = (ops cursesSupport [ ncurses readline ] )
+    ++ (op docSupport groff )
+    ++ (op zlibSupport zlib)
+    ++ (op opensslSupport openssl)
+    ++ (op gdbmSupport gdbm)
+    ++ (op yamlSupport libyaml);
+
+  enableParallelBuilding = true;
+    
+  configureFlags = ["--enable-shared" ];
+
+  installFlags = stdenv.lib.optionalString docSupport "install-doc";
+  # Bundler tries to create this directory
+  postInstall = "mkdir -pv $out/${passthru.gemPath}";
+
+  meta = {
+    license = "Ruby";
+    homepage = "http://www.ruby-lang.org/en/";
+    description = "The Ruby language";
+    platforms = stdenv.lib.platforms.all;
+  };
+
+  passthru = rec {
+    majorVersion = "2.0";
+    minorVersion = "0";
+    patchLevel = "0";
+    libPath = "lib/ruby/${majorVersion}";
+    gemPath = "lib/ruby/gems/${majorVersion}";
+  };
+}
diff --git a/pkgs/development/interpreters/spidermonkey/builder.sh b/pkgs/development/interpreters/spidermonkey/builder.sh
deleted file mode 100644
index 91110159665..00000000000
--- a/pkgs/development/interpreters/spidermonkey/builder.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-source $stdenv/setup
-
-set -e
-set -x
-
-tar zxf $src
-cd js/src
-
-
-# Extend Makefile to dump some of its variables we want to know.
-cat >> Makefile.ref <<EOF
-printlibraries :
-	@echo \$(LIBRARY) \$(SHARED_LIBRARY) > LIBRARIES
-
-printprograms :
-	@echo \$(PROGRAM) > PROGRAMS
-EOF
-
-MAKE="make -f Makefile.ref"
-
-$MAKE printlibraries
-$MAKE printprograms
-$MAKE
-
-mkdir -p $out
-mkdir -p $out/bin
-mkdir -p $out/lib
-
-# Install the binaries that have been created.
-install $(cat PROGRAMS) $out/bin
-install $(cat LIBRARIES) $out/lib
diff --git a/pkgs/development/interpreters/tcl/default.nix b/pkgs/development/interpreters/tcl/default.nix
index 060aa3b5a6b..48755065b99 100644
--- a/pkgs/development/interpreters/tcl/default.nix
+++ b/pkgs/development/interpreters/tcl/default.nix
@@ -18,6 +18,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The Tcl scription language";
     homepage = http://www.tcl.tk/;
+    license = stdenv.lib.licenses.tcltk;
   };
   
   passthru = {
diff --git a/pkgs/development/interpreters/toolbus/default.nix b/pkgs/development/interpreters/toolbus/default.nix
deleted file mode 100644
index eda55b06963..00000000000
--- a/pkgs/development/interpreters/toolbus/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{javaAdapter ? false,
- jdk ? null,
-   stdenv, fetchurl, toolbuslib, atermjava, aterm, yacc, flex, tcltk} :
-
-stdenv.mkDerivation {
-   name = "toolbus-1.2.2";
-   builder = ./builder.sh;
-   src = fetchurl {
-            url = http://nixos.org/tarballs/toolbus-1.2.2.tar.gz;
-            md5 = "887349b097006c0883e1948797349a50";
-         };
-   java = if javaAdapter then true else false;
-   jdk = if javaAdapter then jdk else null;
-
-   inherit toolbuslib atermjava aterm yacc flex tcltk;
-   buildInputs = [toolbuslib atermjava aterm yacc flex jdk tcltk] ;
-}
diff --git a/pkgs/development/libraries/GConf/3.x.nix b/pkgs/development/libraries/GConf/3.x.nix
index 4f6d5a9a04a..82c0c1f2c43 100644
--- a/pkgs/development/libraries/GConf/3.x.nix
+++ b/pkgs/development/libraries/GConf/3.x.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ glib dbus_glib ];
   buildInputs = [ polkit gtk3 libxml2 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--disable-orbit";
 
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 7205e0fa7ea..8ff643ce5b1 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   configureFlags = configureFlagsFun { inherit alsaLib; };
 
   crossAttrs = {
-      configureFlags = configureFlagsFun { alsaLib = alsaLib.hostDrv; };
+      configureFlags = configureFlagsFun { alsaLib = alsaLib.crossDrv; };
   };
 
   passthru = {inherit openglSupport;};
diff --git a/pkgs/development/libraries/SDL_image/default.nix b/pkgs/development/libraries/SDL_image/default.nix
index 1ecb2f83082..8f0d59bc212 100644
--- a/pkgs/development/libraries/SDL_image/default.nix
+++ b/pkgs/development/libraries/SDL_image/default.nix
@@ -1,41 +1,27 @@
-{ stdenv, fetchhg, SDL, libpng, libjpeg, libtiff, libungif, libXpm, automake,
-  autoconf, pkgconfig }:
+{ stdenv, fetchurl, SDL, libpng, libjpeg, libtiff, libungif, libXpm }:
 
 stdenv.mkDerivation rec {
-  pname = "SDL_image";
-  version = "1.2.10-20110925";
+  name = "SDL_image-1.2.12";
 
-  name = "${pname}-${version}";
-
-  src = fetchhg {
-    url = http://hg.libsdl.org/SDL_image;
-    tag = "bb611e7cb1e5";
-    sha256 = "0003inlvvmlc2fyrzy01lwhhfb90ppsar2skaa7x6rhmpc71dakz";
+  src = fetchurl {
+    url = "http://www.libsdl.org/projects/SDL_image/release/${name}.tar.gz";
+    sha256 = "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b";
   };
 
   buildInputs = [SDL libpng libjpeg libtiff libungif libXpm];
 
-  buildNativeInputs = [ automake autoconf pkgconfig ];
-
-  patches = [ ./jpeg-linux.diff ];
-
-  preConfigure = ''
-    ./autogen.sh
-    '';
-
   postInstall = ''
     sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
-    -e 's,"SDL_version.h",<SDL/SDL_version.h>,' \
-    -e 's,"begin_code.h",<SDL/begin_code.h>,' \
-    -e 's,"close_code.h",<SDL/close_code.h>,' \
+      -e 's,"SDL_version.h",<SDL/SDL_version.h>,' \
+      -e 's,"begin_code.h",<SDL/begin_code.h>,' \
+      -e 's,"close_code.h",<SDL/close_code.h>,' \
       $out/include/SDL/SDL_image.h
-
-    ln -sv $out/include/SDL/SDL_image.h $out/include/
+    ln -sv SDL/SDL_image.h $out/include/SDL_image.h
   '';
 
   meta = {
     description = "SDL image library";
-    homepage = http://www.libsdl.org/projects/SDL_image/;
+    homepage = "http://www.libsdl.org/projects/SDL_image/";
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/SDL_image/jpeg-linux.diff b/pkgs/development/libraries/SDL_image/jpeg-linux.diff
deleted file mode 100644
index fd4cdf7f7a4..00000000000
--- a/pkgs/development/libraries/SDL_image/jpeg-linux.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-# HG changeset patch
-# User Yury G. Kudryashov <urkud@ya.ru>
-# Date 1316994786 -14400
-# Node ID 4c3cd9a4b0602c45c11ec62bcc1f5562ea071d70
-# Parent  bb611e7cb1e58cc37a6773a22a15c74b55e3d267
-Fix compilation on Linux
-
-Submitted upstream, see http://bugzilla.libsdl.org/show_bug.cgi?id=1179
-
-diff -r bb611e7cb1e5 -r 4c3cd9a4b060 IMG_jpg.c
---- a/IMG_jpg.c	Thu Aug 25 02:24:35 2011 -0400
-+++ b/IMG_jpg.c	Mon Sep 26 03:53:06 2011 +0400
-@@ -34,7 +34,7 @@
- 
- #include <jpeglib.h>
- 
--#if JPEG_LIB_VERSION >= 80
-+#ifdef JPEG_TRUE /* MinGW version of jpeg-8.x renamed TRUE to JPEG_TRUE etc. */
- 	typedef JPEG_boolean boolean;
- 	#define TRUE JPEG_TRUE
- 	#define FALSE JPEG_FALSE
diff --git a/pkgs/development/libraries/aacskeys/default.nix b/pkgs/development/libraries/aacskeys/default.nix
index 3bed95e2671..088f2cc4b1e 100644
--- a/pkgs/development/libraries/aacskeys/default.nix
+++ b/pkgs/development/libraries/aacskeys/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, openssl, jdk, premake}:
+{stdenv, fetchurl, openssl, jdk, premake3}:
 
 # Info on how to use / obtain aacs keys:
 # http://vlc-bluray.whoknowsmy.name/
@@ -6,7 +6,7 @@
 
 
 let baseName = "aacskeys";
-    version  = "0.4.0c";
+    version  = "0.4.0e";
 in
 
 stdenv.mkDerivation {
@@ -18,11 +18,11 @@ stdenv.mkDerivation {
   '';
 
   src = fetchurl {
-    url = "http://debian-multimedia.org/pool/main/a/${baseName}/${baseName}_${version}.orig.tar.gz";
-    sha256 = "54ea78898917f4acaf78101dda254de56bc7696bad12cbf22ee6f09d4ee88a43";
+    url = "http://deb-multimedia.org/pool/main/a/${baseName}/${baseName}_${version}.orig.tar.gz";
+    sha256 = "0d3zvwixpkixfkkc16wj37h2xbcq5hsqqhqngzqr6pslmqr67vnr";
   };
 
-  buildInputs = [openssl jdk premake];
+  buildInputs = [openssl jdk premake3];
 
   installPhase = ''
     ensureDir $out/{bin,lib,share/${baseName}}
diff --git a/pkgs/development/libraries/acl/default.nix b/pkgs/development/libraries/acl/default.nix
index 5b8174eaca5..065ef0ba7ca 100644
--- a/pkgs/development/libraries/acl/default.nix
+++ b/pkgs/development/libraries/acl/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" "bin" "doc" ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
   buildInputs = [ attr ];
 
   # Upstream use C++-style comments in C code. Remove them.
diff --git a/pkgs/development/libraries/agg/default.nix b/pkgs/development/libraries/agg/default.nix
index 9ef13735b08..8c24ae6fdbe 100644
--- a/pkgs/development/libraries/agg/default.nix
+++ b/pkgs/development/libraries/agg/default.nix
@@ -8,7 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb";
   };
   buildInputs = [ autoconf automake libtool pkgconfig freetype SDL libX11 ];
-  preConfigure = "sh autogen.sh";
+
+  # fix build with new automake, from Gentoo ebuild
+  preConfigure = ''
+    sed -i '/^AM_C_PROTOTYPES/d' configure.in
+    sh autogen.sh
+  '';
 
   configureFlags = "--x-includes=${libX11}/include --x-libraries=${libX11}/lib";
 
diff --git a/pkgs/development/libraries/apache-activemq/default.nix b/pkgs/development/libraries/apache-activemq/default.nix
new file mode 100644
index 00000000000..90d0dafdd95
--- /dev/null
+++ b/pkgs/development/libraries/apache-activemq/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "apache-activemq-${version}";
+  version = "5.8.0";
+
+  src = fetchurl {
+    url = "mirror://apache/activemq/apache-activemq/${version}/${name}-bin.tar.gz";
+    sha256 = "12a1lmmqapviqdgw307jm07vw1z5q53r56pkbp85w9wnqwspjrbk";
+  };
+
+  phases = [ "unpackPhase" "installPhase" ];
+
+  installPhase = ''
+    ensureDir $out
+    mv * $out/
+    for j in `find $out/lib -name "*.jar"`; do
+      cp="''${cp:+"$cp:"}$j";
+    done
+    echo "CLASSPATH=$cp" > $out/lib/classpath.env
+  '';
+
+  meta = {
+    homepage = http://activemq.apache.org/;
+    description = ''
+      Messaging and Integration Patterns server written in Java.
+    '';
+    license = stdenv.lib.licenses.asl20;
+  };
+
+}
diff --git a/pkgs/development/libraries/apr-util/default.nix b/pkgs/development/libraries/apr-util/default.nix
index ad02f9b84cc..5f6291127e9 100644
--- a/pkgs/development/libraries/apr-util/default.nix
+++ b/pkgs/development/libraries/apr-util/default.nix
@@ -9,11 +9,11 @@ assert bdbSupport -> db4 != null;
 assert ldapSupport -> openldap != null;
 
 stdenv.mkDerivation rec {
-  name = "apr-util-1.4.1";
+  name = "apr-util-1.5.1";
 
   src = fetchurl {
     url = "mirror://apache/apr/${name}.tar.bz2";
-    md5 = "52b31b33fb1aa16e65ddaefc76e41151";
+    md5 = "9c1db8606e520f201c451ec9a0b095f6";
   };
 
   configureFlags = ''
@@ -26,6 +26,8 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = stdenv.lib.optional ldapSupport openldap;
 
+  enableParallelBuilding = true;
+
   passthru = {
     inherit sslSupport bdbSupport ldapSupport;
   };
diff --git a/pkgs/development/libraries/aqbanking/default.nix b/pkgs/development/libraries/aqbanking/default.nix
index 6c6e3013717..0ddb1aaa749 100644
--- a/pkgs/development/libraries/aqbanking/default.nix
+++ b/pkgs/development/libraries/aqbanking/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gwenhywfar gmp zlib ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--with-gwen-dir=${gwenhywfar}";
 
diff --git a/pkgs/development/libraries/arts/default.nix b/pkgs/development/libraries/arts/default.nix
deleted file mode 100644
index 50c270f534e..00000000000
--- a/pkgs/development/libraries/arts/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{stdenv, fetchurl, pkgconfig, glib, kdelibs, libX11, libXext, zlib, libjpeg
-, libpng, perl, qt3}:
-
-stdenv.mkDerivation {
-  name = "arts-1.5.10";
-
-  src = fetchurl {
-    url = mirror://kde/stable/3.5.10/src/arts-1.5.10.tar.bz2;
-    sha256 = "0ffcm24lkgg3sm89q4zsj8za5h5d9j1195pmbjhx4hj0xcwkiqlj";
-  };
-
-  KDEDIR = kdelibs;
-  
-  configureFlags = ''
-    --with-extra-includes=${libjpeg}/include
-    --with-extra-libs=${libjpeg}/lib
-    --x-includes=${libX11}/include
-    --x-libraries=${libX11}/lib
-    --disable-dependency-tracking
-    --enable-final
-  '';
-
-  buildNativeInputs = [ pkgconfig perl ];
-
-  buildInputs =
-    [glib kdelibs libX11 libXext zlib libjpeg libpng qt3];
-
-  meta = {
-    homepage = http://www.arts-project.org/;
-  };
-}
diff --git a/pkgs/development/libraries/asc-support/default.nix b/pkgs/development/libraries/asc-support/default.nix
index a078faaceb1..a2b2588d9cc 100644
--- a/pkgs/development/libraries/asc-support/default.nix
+++ b/pkgs/development/libraries/asc-support/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
 
   buildInputs = [aterm toolbuslib asfSupport errorSupport ptSupport sglr tideSupport cLibrary configSupport ptableSupport rstoreSupport ];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 }  
diff --git a/pkgs/development/libraries/asf-support/default.nix b/pkgs/development/libraries/asf-support/default.nix
index e2b7a14e819..9a712a869af 100644
--- a/pkgs/development/libraries/asf-support/default.nix
+++ b/pkgs/development/libraries/asf-support/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm errorSupport ptSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/aterm/2.5.nix b/pkgs/development/libraries/aterm/2.5.nix
index daaf6fdd584..f116da12643 100644
--- a/pkgs/development/libraries/aterm/2.5.nix
+++ b/pkgs/development/libraries/aterm/2.5.nix
@@ -16,14 +16,15 @@ stdenv.mkDerivation {
     # SIZEOF_LONG, SIZEOF_INT and SIZEOF_VOID_P being set.
     ./sizeof.patch
   ];
-  
+
   doCheck = true;
 
-  dontDisableStatic = true; 
+  dontDisableStatic = true;
 
   meta = {
     homepage = http://www.cwi.nl/htbin/sen1/twiki/bin/view/SEN1/ATerm;
     license = "LGPL";
     description = "Library for manipulation of term data structures in C";
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/aterm/2.8.nix b/pkgs/development/libraries/aterm/2.8.nix
index 05fb6704d3b..498b0244b87 100644
--- a/pkgs/development/libraries/aterm/2.8.nix
+++ b/pkgs/development/libraries/aterm/2.8.nix
@@ -1,6 +1,6 @@
 {stdenv, fetchurl}:
 
-let 
+let
   isMingw = stdenv ? cross && stdenv.cross.config == "i686-pc-mingw32" ;
 in
 stdenv.mkDerivation ( {
@@ -15,7 +15,12 @@ stdenv.mkDerivation ( {
     # Fix for http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=841
     ./max-long.patch
   ] ++ ( if isMingw then [./aterm-mingw-asm.patch] else [] );
-  
+
+  # The test programs stress, randgen, fib, and testsafio all fail with
+  # segmentation faults when compiled with GCC 4.8.x, and the code itself many
+  # warnings, complaining "cast from pointer to integer of different size".
+  # This looks really bad. I leave the test suite enabled, because those issue
+  # feel too serious to just ignore.
   doCheck = true;
 
   meta = {
@@ -23,4 +28,4 @@ stdenv.mkDerivation ( {
     license = "LGPL";
     description = "Library for manipulation of term data structures in C";
   };
-} // ( if isMingw then { dontStrip = true; } else {}) ) 
+} // ( if isMingw then { dontStrip = true; } else {}) )
diff --git a/pkgs/development/libraries/atk/2.2.x.nix b/pkgs/development/libraries/atk/2.6.x.nix
index 715d8eb1ee2..82b366b4013 100644
--- a/pkgs/development/libraries/atk/2.2.x.nix
+++ b/pkgs/development/libraries/atk/2.6.x.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, pkgconfig, perl, glib }:
 
 stdenv.mkDerivation rec {
-  name = "atk-2.2.0";
+  name = "atk-2.6.0";
 
   src = fetchurl {
-    url = mirror://gnome/sources/atk/2.2/atk-2.2.0.tar.xz;
-    sha256 = "17bkqg89l9hxbkgc76cxlin1bwczk7m6ikbccx677lrxh3kz08lb";
+    url = "mirror://gnome/sources/atk/2.6/${name}.tar.xz";
+    sha256 = "eff663f90847620bb68c9c2cbaaf7f45e2ff44163b9ab3f10d15be763680491f";
   };
 
   enableParallelBuilding = true;
 
   outputs = [ "dev" "out" "doc" ];
 
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   propagatedBuildInputs = [ glib ];
 
diff --git a/pkgs/development/libraries/atkmm/2.22.x.nix b/pkgs/development/libraries/atkmm/default.nix
index 66237c4c7b9..b25432491fb 100644
--- a/pkgs/development/libraries/atkmm/2.22.x.nix
+++ b/pkgs/development/libraries/atkmm/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ atk glibmm ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/attica/default.nix b/pkgs/development/libraries/attica/default.nix
index a719537dd2f..99fe36faa4b 100644
--- a/pkgs/development/libraries/attica/default.nix
+++ b/pkgs/development/libraries/attica/default.nix
@@ -1,20 +1,20 @@
 { stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
-  name = "attica-0.4.0";
+  name = "attica-0.4.1";
   
   src = fetchurl {
     url = "mirror://kde/stable/attica/${name}.tar.bz2";
-    sha256 = "172d1z97aw9iscq6wh23i31s4hgq7mmhr3mk4xgifqv0hjcmzyhq";
+    sha256 = "1rnd861vy6waf25b1ilsr3rwb06dmmlnd8zq3l8y6r0lq5i2bl9n";
   };
   
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
   
   meta = with stdenv.lib; {
     description = "A library to access Open Collaboration Service providers";
     license = "LGPL";
-    maintainers = [ maintainers.sander maintainers.urkud ];
+    maintainers = [ maintainers.sander maintainers.urkud maintainers.phreedom ];
     inherit (qt4.meta) platforms;
   };
 }
diff --git a/pkgs/development/libraries/attr/default.nix b/pkgs/development/libraries/attr/default.nix
index 23541032067..8000dacfc46 100644
--- a/pkgs/development/libraries/attr/default.nix
+++ b/pkgs/development/libraries/attr/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" "bin" "doc" ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   configureFlags = "MAKE=make MSGFMT=msgfmt MSGMERGE=msgmerge XGETTEXT=xgettext ECHO=echo SED=sed AWK=gawk";
 
diff --git a/pkgs/development/libraries/audio/libbs2b/default.nix b/pkgs/development/libraries/audio/libbs2b/default.nix
new file mode 100644
index 00000000000..e43a5acb6bd
--- /dev/null
+++ b/pkgs/development/libraries/audio/libbs2b/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, libsndfile }:
+
+stdenv.mkDerivation rec {
+  name = "libbs2b-${version}";
+  version = "3.1.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/bs2b/${name}.tar.bz2";
+    sha256 = "0vz442kkjn2h0dlxppzi4m5zx8qfyrivq581n06xzvnyxi5rg6a7";
+  };
+
+  buildInputs = [ pkgconfig libsndfile ];
+
+  meta = {
+    homepage = "http://bs2b.sourceforge.net/";
+    description = "Bauer stereophonic-to-binaural DSP library";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/development/libraries/audio/lilv/default.nix b/pkgs/development/libraries/audio/lilv/default.nix
index a02a6ebabac..1baa96cd6da 100644
--- a/pkgs/development/libraries/audio/lilv/default.nix
+++ b/pkgs/development/libraries/audio/lilv/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "lilv-${version}";
-  version = "0.14.2";
+  version = "0.16.0";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "0g9sg5f8xkkvsad0c6rh4j1k2b2hwsh83yg66f4qznxh43np7zlx";
+    sha256 = "1ddrcikypi7gfmj5cqn975axzrgv7mhzif4h0ni9w5b4v64rvcyg";
   };
 
   buildInputs = [ lv2 pkgconfig python serd sord sratom ];
diff --git a/pkgs/development/libraries/audio/lv2/default.nix b/pkgs/development/libraries/audio/lv2/default.nix
index 136a825eef9..ce8ad3f9d52 100644
--- a/pkgs/development/libraries/audio/lv2/default.nix
+++ b/pkgs/development/libraries/audio/lv2/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "lv2-${version}";
-  version = "1.0.0";
+  version = "1.4.0";
 
   src = fetchurl {
     url = "http://lv2plug.in/spec/${name}.tar.bz2";
-    sha256 = "0lfp7679wwqd49k4mjxwqslpfx5fz2q7akxqayg400zqn70whzl5";
+    sha256 = "035hlfva2mij698nj3z1mz9g4mj4z5jx9axs6ww47jgyjcq38asz";
   };
 
   buildInputs = [ gtk libsndfile pkgconfig python ];
diff --git a/pkgs/development/libraries/audio/sratom/default.nix b/pkgs/development/libraries/audio/sratom/default.nix
index b23b58a3f82..daaf780e45d 100644
--- a/pkgs/development/libraries/audio/sratom/default.nix
+++ b/pkgs/development/libraries/audio/sratom/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "sratom-${version}";
-  version = "0.2.0";
+  version = "0.4.2";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "12wi0ycjnn6mlddcp476wzr6k2bb4ig1489gg8h1k7v0w7d6ry1a";
+    sha256 = "16i5snknl9frz638mgr58lp11ap1xmkbrkb3l6f0ad8ddqpcjm3i";
   };
 
   buildInputs = [ lv2 pkgconfig python serd sord ];
diff --git a/pkgs/development/libraries/audio/suil/default.nix b/pkgs/development/libraries/audio/suil/default.nix
index a7300f541c4..45253b65edb 100644
--- a/pkgs/development/libraries/audio/suil/default.nix
+++ b/pkgs/development/libraries/audio/suil/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, lv2, pkgconfig, python, serd, sord, sratom }:
+{ stdenv, fetchurl, gtk, lv2, pkgconfig, python, serd, sord, sratom, qt4 }:
 
 stdenv.mkDerivation rec {
   name = "suil-${version}";
-  version = "0.6.2";
+  version = "0.6.10";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "1rqi16zqnaf30gr2gwb8wbhg8a2l3m5fllf7rabldmgj4b4jlyzp";
+    sha256 = "1y7zgfciphr3icamikdfv2gh8xwix5blpq4npl426399i8f4ya5y";
   };
 
-  buildInputs = [ lv2 pkgconfig python serd sord sratom ];
+  buildInputs = [ gtk lv2 pkgconfig python qt4 serd sord sratom ];
 
   configurePhase = "python waf configure --prefix=$out";
 
diff --git a/pkgs/development/libraries/avahi/default.nix b/pkgs/development/libraries/avahi/default.nix
index 0789ef0ea7c..39a03e0b002 100644
--- a/pkgs/development/libraries/avahi/default.nix
+++ b/pkgs/development/libraries/avahi/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     ++ (stdenv.lib.optional qt4Support qt4)
     ++ libiconvOrEmpty;
 
-  buildNativeInputs = [ pkgconfig gettext intltool ];
+  nativeBuildInputs = [ pkgconfig gettext intltool ];
 
   configureFlags =
     [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix
index 0ad643d9ac4..3b2670d988a 100644
--- a/pkgs/development/libraries/boehm-gc/default.nix
+++ b/pkgs/development/libraries/boehm-gc/default.nix
@@ -1,15 +1,20 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation (rec {
-  name = "boehm-gc-7.2alpha6";
+stdenv.mkDerivation rec {
+  name = "boehm-gc-7.2d";
 
   src = fetchurl {
-    url = "http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2alpha6.tar.gz";
-    sha256 = "05jwadjbrv8pr7z9cb4miskicxqpxm0pca4h2rg5cgbpajr2bx7b";
+    url = http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/gc-7.2d.tar.gz;
+    sha256 = "0phwa5driahnpn79zqff14w9yc8sn3599cxz91m78hqdcpl0mznr";
   };
 
+  configureFlags = "--enable-cplusplus";
+
   doCheck = true;
 
+  # Don't run the native `strip' when cross-compiling.
+  dontStrip = stdenv ? cross;
+
   meta = {
     description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
 
@@ -39,10 +44,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-
-//
-
-# Don't run the native `strip' when cross-compiling.
-(if (stdenv ? cross)
- then { dontStrip = true; }
- else { }))
diff --git a/pkgs/development/libraries/boolstuff/default.nix b/pkgs/development/libraries/boolstuff/default.nix
index c05fddc18cf..9b5c25d4ca4 100644
--- a/pkgs/development/libraries/boolstuff/default.nix
+++ b/pkgs/development/libraries/boolstuff/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0akwb57lnzq1ak32k6mdxbma2gj0pqhj8y9m6hq79djb9s3mxvmn";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = { 
     description = "Library for operations on boolean expression binary trees";
diff --git a/pkgs/development/libraries/boost/1.44.nix b/pkgs/development/libraries/boost/1.44.nix
index ad09adc8606..7ed3c311de2 100644
--- a/pkgs/development/libraries/boost/1.44.nix
+++ b/pkgs/development/libraries/boost/1.44.nix
@@ -29,7 +29,7 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
+  cflags = if enablePIC then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
 
 in
 
@@ -68,10 +68,11 @@ stdenv.mkDerivation {
        url = https://svn.boost.org/trac/boost/raw-attachment/ticket/4688/boost_filesystem.patch ;
        sha256 = "15k91ihzs6190pnryh4cl0b3c2pjpl9d790mr14x16zq52y7px2d";
      })
+    ./time_utc_144.patch
   ];
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -85,7 +86,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.46.nix b/pkgs/development/libraries/boost/1.46.nix
deleted file mode 100644
index 0a64efdeb3b..00000000000
--- a/pkgs/development/libraries/boost/1.46.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
-, enableRelease ? true
-, enableDebug ? false
-, enableSingleThreaded ? false
-, enableMultiThreaded ? true
-, enableShared ? true
-, enableStatic ? false
-, enablePIC ? false
-}:
-
-let
-
-  variant = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableRelease "release" ++
-     stdenv.lib.optional enableDebug "debug");
-
-  threading = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableSingleThreaded "single" ++
-     stdenv.lib.optional enableMultiThreaded "multi");
-
-  link = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableShared "shared" ++
-     stdenv.lib.optional enableStatic "static");
-
-  # To avoid library name collisions
-  finalLayout = if ((enableRelease && enableDebug) ||
-    (enableSingleThreaded && enableMultiThreaded) ||
-    (enableShared && enableStatic)) then
-    "tagged" else "system";
-
-  cflags = if (enablePIC) then "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC" else "";
-
-in
-
-stdenv.mkDerivation {
-  name = "boost-1.46.0";
-
-  meta = {
-    homepage = "http://boost.org/";
-    description = "Boost C++ Library Collection";
-    license = "boost-license";
-
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-
-  src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_46_0.tar.bz2";
-    sha256 = "0ndsiv06332gbh6wj68pcnci3l5qrc5pm1ca9dkmxhpxj83zd41g";
-  };
-
-  enableParallelBuilding = true;
-
-  buildInputs = [icu expat zlib bzip2 python];
-
-  configureScript = "./bootstrap.sh";
-  configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
-
-  buildPhase = "./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
-
-  installPhase = ":";
-
-  crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
-    # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
-    # override them.
-    propagatedBuildInputs = buildInputs;
-    # We want to substitute the contents of configureFlags, removing thus the
-    # usual --build and --host added on cross building.
-    preConfigure = ''
-      export configureFlags="--prefix=$out --without-icu"
-    '';
-    buildPhase = ''
-      set -x
-      cat << EOF > user-config.jam
-      using gcc : cross : $crossConfig-g++ ;
-      EOF
-      ./bjam -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
-    '';
-  };
-}
diff --git a/pkgs/development/libraries/boost/1.47.nix b/pkgs/development/libraries/boost/1.47.nix
deleted file mode 100644
index 4b0c4d3f140..00000000000
--- a/pkgs/development/libraries/boost/1.47.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-{ stdenv, fetchurl, icu, expat, zlib, bzip2, python
-, enableRelease ? true
-, enableDebug ? false
-, enableSingleThreaded ? false
-, enableMultiThreaded ? true
-, enableShared ? true
-, enableStatic ? false
-, enablePIC ? false
-, enableExceptions ? false
-}:
-
-let
-
-  variant = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableRelease "release" ++
-     stdenv.lib.optional enableDebug "debug");
-
-  threading = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableSingleThreaded "single" ++
-     stdenv.lib.optional enableMultiThreaded "multi");
-
-  link = stdenv.lib.concatStringsSep ","
-    (stdenv.lib.optional enableShared "shared" ++
-     stdenv.lib.optional enableStatic "static");
-
-  # To avoid library name collisions
-  finalLayout = if ((enableRelease && enableDebug) ||
-    (enableSingleThreaded && enableMultiThreaded) ||
-    (enableShared && enableStatic)) then
-    "tagged" else "system";
-
-  cflags = if (enablePIC && enableExceptions) then
-             "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
-             "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
-             "cflags=-fexceptions"
-           else
-             "";
-in
-
-stdenv.mkDerivation {
-  name = "boost-1.47.0";
-
-  meta = {
-    homepage = "http://boost.org/";
-    description = "Boost C++ Library Collection";
-    license = "boost-license";
-
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-
-  src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_47_0.tar.bz2";
-    sha256 = "815a5d9faac4dbd523fbcf3fe1065e443c0bbf43427c44aa423422c6ec4c2e31";
-  };
-
-  # See <http://svn.boost.org/trac/boost/ticket/4688>.
-  patches = [ ./boost_filesystem.patch ];
-
-  enableParallelBuilding = true;
-
-  buildInputs = [icu expat zlib bzip2 python];
-
-  configureScript = "./bootstrap.sh";
-  configureFlags = "--with-icu=${icu} --with-python=${python}/bin/python";
-
-  buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${finalLayout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
-
-  installPhase = ":";
-
-  crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
-    # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
-    # override them.
-    propagatedBuildInputs = buildInputs;
-    # We want to substitute the contents of configureFlags, removing thus the
-    # usual --build and --host added on cross building.
-    preConfigure = ''
-      export configureFlags="--prefix=$out --without-icu"
-    '';
-    buildPhase = ''
-      set -x
-      cat << EOF > user-config.jam
-      using gcc : cross : $crossConfig-g++ ;
-      EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
-    '';
-  };
-}
diff --git a/pkgs/development/libraries/boost/1.49-headers.nix b/pkgs/development/libraries/boost/1.49-headers.nix
deleted file mode 100644
index 58c0c19a17b..00000000000
--- a/pkgs/development/libraries/boost/1.49-headers.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation {
-  name = "boost-1.49.0-headers";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_49_0.tar.bz2";
-    sha256 = "0g0d33942rm073jgqqvj3znm3rk45b2y2lplfjpyg9q7amzqlx6x";
-  };
-
-  phases = [ "installPhase" ];
-
-  installPhase = ''
-    mkdir -p $out/include
-    tar xvf $src -C $out/include --strip-components=1 boost_1_49_0/boost
-  '';
-
-  meta = {
-    homepage = "http://boost.org/";
-    description = "Boost C++ Library Collection";
-    license = "boost-license";
-
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.viric ];
-  };
-}
diff --git a/pkgs/development/libraries/boost/1.49.nix b/pkgs/development/libraries/boost/1.49.nix
index a86670927aa..6035232caf6 100644
--- a/pkgs/development/libraries/boost/1.49.nix
+++ b/pkgs/development/libraries/boost/1.49.nix
@@ -29,11 +29,11 @@ let
     (enableShared && enableStatic)) then
     "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
+  cflags = if enablePIC && enableExceptions then
              "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
@@ -57,7 +57,7 @@ stdenv.mkDerivation {
   };
 
   # See <http://svn.boost.org/trac/boost/ticket/4688>.
-  patches = [ ./boost_filesystem_post_1_49_0.patch ];
+  patches = [ ./boost_filesystem_post_1_49_0.patch ./time_utc.patch ] ++ (stdenv.lib.optional stdenv.isDarwin ./boost-149-darwin.patch );
 
   enableParallelBuilding = true;
 
@@ -71,7 +71,7 @@ stdenv.mkDerivation {
   installPhase = ":";
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -85,7 +85,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${finalLayout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/1.50-headers.nix b/pkgs/development/libraries/boost/1.53-headers.nix
index b901d73da73..04bad16bd70 100644
--- a/pkgs/development/libraries/boost/1.50-headers.nix
+++ b/pkgs/development/libraries/boost/1.53-headers.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "boost-1.50.0-headers";
+  name = "boost-headers-1.53.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_50_0.tar.bz2";
-    sha256 = "0ac5b82g6b5pdhzypgddql0i3i9vvrwf9iqp3lyp19hzr2wf5b69";
+    url = "mirror://sourceforge/boost/boost_1_53_0.tar.bz2";
+    sha256 = "15livg6y1l3gdsg6ybvp3y4gp0w3xh1rdcq5bjf0qaw804dh92pq";
   };
 
   phases = [ "installPhase" ];
 
   installPhase = ''
     mkdir -p $out/include
-    tar xvf $src -C $out/include --strip-components=1 boost_1_50_0/boost
+    tar xf $src -C $out/include --strip-components=1 boost_1_53_0/boost
   '';
 
   meta = {
diff --git a/pkgs/development/libraries/boost/1.50.nix b/pkgs/development/libraries/boost/1.53.nix
index 3d6c6010a20..ff09dfd5954 100644
--- a/pkgs/development/libraries/boost/1.50.nix
+++ b/pkgs/development/libraries/boost/1.53.nix
@@ -27,18 +27,18 @@ let
   # To avoid library name collisions
   layout = if taggedLayout then "tagged" else "system";
 
-  cflags = if (enablePIC && enableExceptions) then
-             "cflags=-fPIC -fexceptions cxxflags=-fPIC linkflags=-fPIC"
-           else if (enablePIC) then
+  cflags = if enablePIC && enableExceptions then
+             "cflags=\"-fPIC -fexceptions\" cxxflags=-fPIC linkflags=-fPIC"
+           else if enablePIC then
              "cflags=-fPIC cxxflags=-fPIC linkflags=-fPIC"
-           else if (enableExceptions) then
+           else if enableExceptions then
              "cflags=-fexceptions"
            else
              "";
 in
 
 stdenv.mkDerivation {
-  name = "boost-1.50.0";
+  name = "boost-1.53.0";
 
   meta = {
     homepage = "http://boost.org/";
@@ -50,8 +50,8 @@ stdenv.mkDerivation {
   };
 
   src = fetchurl {
-    url = "mirror://sourceforge/boost/boost_1_50_0.tar.bz2";
-    sha256 = "0ac5b82g6b5pdhzypgddql0i3i9vvrwf9iqp3lyp19hzr2wf5b69";
+    url = "mirror://sourceforge/boost/boost_1_53_0.tar.bz2";
+    sha256 = "15livg6y1l3gdsg6ybvp3y4gp0w3xh1rdcq5bjf0qaw804dh92pq";
   };
 
   enableParallelBuilding = true;
@@ -63,10 +63,15 @@ stdenv.mkDerivation {
 
   buildPhase = "./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install";
 
-  installPhase = ":";
+  # normal install does not install bjam, this is a separate step
+  installPhase = ''
+    cd tools/build/v2
+    sh bootstrap.sh
+    ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat}/include -sEXPAT_LIBPATH=${expat}/lib --layout=${layout} variant=${variant} threading=${threading} link=${link} ${cflags} install
+  '';
 
   crossAttrs = rec {
-    buildInputs = [ expat.hostDrv zlib.hostDrv bzip2.hostDrv ];
+    buildInputs = [ expat.crossDrv zlib.crossDrv bzip2.crossDrv ];
     # all buildInputs set previously fell into propagatedBuildInputs, as usual, so we have to
     # override them.
     propagatedBuildInputs = buildInputs;
@@ -80,7 +85,7 @@ stdenv.mkDerivation {
       cat << EOF > user-config.jam
       using gcc : cross : $crossConfig-g++ ;
       EOF
-      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.hostDrv}/include -sEXPAT_LIBPATH=${expat.hostDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
+      ./b2 -j$NIX_BUILD_CORES -sEXPAT_INCLUDE=${expat.crossDrv}/include -sEXPAT_LIBPATH=${expat.crossDrv}/lib --layout=${layout} --user-config=user-config.jam toolset=gcc-cross variant=${variant} threading=${threading} link=${link} ${cflags} --without-python install
     '';
   };
 }
diff --git a/pkgs/development/libraries/boost/boost-149-darwin.patch b/pkgs/development/libraries/boost/boost-149-darwin.patch
new file mode 100644
index 00000000000..2485f883afc
--- /dev/null
+++ b/pkgs/development/libraries/boost/boost-149-darwin.patch
@@ -0,0 +1,40 @@
+diff -rc boost_1_49_0/tools/build/v2/tools/darwin.jam boost_1_49_0-new/tools/build/v2/tools/darwin.jam
+*** boost_1_49_0/tools/build/v2/tools/darwin.jam	Mon Jun  6 22:36:21 2011
+--- boost_1_49_0-new/tools/build/v2/tools/darwin.jam	Thu May 23 22:07:45 2013
+***************
+*** 498,504 ****
+  flags darwin.compile OPTIONS <link>shared : -dynamic ;
+  
+  # Misc options.
+! flags darwin.compile OPTIONS : -no-cpp-precomp -gdwarf-2 -fexceptions ;
+  #~ flags darwin.link OPTIONS : -fexceptions ;
+  
+  # Add the framework names to use.
+--- 498,504 ----
+  flags darwin.compile OPTIONS <link>shared : -dynamic ;
+  
+  # Misc options.
+! flags darwin.compile OPTIONS : -gdwarf-2 -fexceptions ;
+  #~ flags darwin.link OPTIONS : -fexceptions ;
+  
+  # Add the framework names to use.
+diff -rc boost_1_49_0/tools/build/v2/tools/darwin.py boost_1_49_0-new/tools/build/v2/tools/darwin.py
+*** boost_1_49_0/tools/build/v2/tools/darwin.py	Wed Oct 28 08:47:51 2009
+--- boost_1_49_0-new/tools/build/v2/tools/darwin.py	Thu May 23 21:58:12 2013
+***************
+*** 37,43 ****
+  feature.feature ('framework', [], ['free'])
+  
+  toolset.flags ('darwin.compile', 'OPTIONS', '<link>shared', ['-dynamic'])
+! toolset.flags ('darwin.compile', 'OPTIONS', None, ['-Wno-long-double', '-no-cpp-precomp'])
+  toolset.flags ('darwin.compile.c++', 'OPTIONS', None, ['-fcoalesce-templates'])
+  
+  toolset.flags ('darwin.link', 'FRAMEWORK', '<framework>')
+--- 37,43 ----
+  feature.feature ('framework', [], ['free'])
+  
+  toolset.flags ('darwin.compile', 'OPTIONS', '<link>shared', ['-dynamic'])
+! toolset.flags ('darwin.compile', 'OPTIONS', None, ['-Wno-long-double'])
+  toolset.flags ('darwin.compile.c++', 'OPTIONS', None, ['-fcoalesce-templates'])
+  
+  toolset.flags ('darwin.link', 'FRAMEWORK', '<framework>')
diff --git a/pkgs/development/libraries/boost/boost_filesystem.patch b/pkgs/development/libraries/boost/boost_filesystem.patch
deleted file mode 100644
index f32e9ed572d..00000000000
--- a/pkgs/development/libraries/boost/boost_filesystem.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ubr boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp
---- boost_1_47_0/libs/filesystem/v2/src/v2_path.cpp	2011-01-11 22:39:33.000000000 +0100
-+++ boost_1_47_0-patched/libs/filesystem/v2/src/v2_path.cpp	2011-07-21 01:06:26.000000000 +0200
-@@ -45,7 +45,7 @@
-   {
- #if !defined(macintosh) && !defined(__APPLE__) && !defined(__APPLE_CC__) 
-     // ISO C calls this "the locale-specific native environment":
--    static std::locale lc("");
-+    static std::locale lc;
- #else  // Mac OS
-     // "All BSD system functions expect their string parameters to be in UTF-8 encoding
-     // and nothing else."
-diff -ubr boost_1_47_0/libs/filesystem/v3/src/path.cpp boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp
---- boost_1_47_0/libs/filesystem/v3/src/path.cpp	2011-07-05 16:49:42.000000000 +0200
-+++ boost_1_47_0-patched/libs/filesystem/v3/src/path.cpp	2011-07-21 01:06:26.000000000 +0200
-@@ -767,7 +767,7 @@
-     // or LANG are wrong, for example), so dynamic initialization is used to ensure
-     // that exceptions can be caught.
- 
--    return std::locale("");
-+    return std::locale();
- 
- #   endif
-   }
diff --git a/pkgs/development/libraries/boost/time_utc.patch b/pkgs/development/libraries/boost/time_utc.patch
new file mode 100644
index 00000000000..3585d0bfc6d
--- /dev/null
+++ b/pkgs/development/libraries/boost/time_utc.patch
@@ -0,0 +1,320 @@
+From: https://build.opensuse.org/package/view_file?file=boost-time_utc.patch&package=boost&project=Application%3AGeo
+
+From: https://svn.boost.org/trac/boost/changeset/78802
+
+Message:
+    Thread: fix TIME_UTC, WINVER, constexpr for tags, and don't use local files
+
+Only the TIME_UTC_ change is taken
+ 
+Index: boost_1_49_0/boost/thread/xtime.hpp
+===================================================================
+--- boost_1_49_0.orig/boost/thread/xtime.hpp
++++ boost_1_49_0/boost/thread/xtime.hpp
+@@ -2,7 +2,7 @@
+ // William E. Kempf
+ // Copyright (C) 2007-8 Anthony Williams
+ //
+-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
++//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ 
+ #ifndef BOOST_XTIME_WEK070601_HPP
+@@ -20,7 +20,7 @@ namespace boost {
+ 
+ enum xtime_clock_types
+ {
+-    TIME_UTC=1
++    TIME_UTC_=1
+ //    TIME_TAI,
+ //    TIME_MONOTONIC,
+ //    TIME_PROCESS,
+@@ -53,14 +53,14 @@ struct xtime
+         boost::posix_time::microseconds((nsec+500)/1000);
+ #endif
+     }
+-    
++
+ };
+ 
+ inline xtime get_xtime(boost::system_time const& abs_time)
+ {
+     xtime res;
+     boost::posix_time::time_duration const time_since_epoch=abs_time-boost::posix_time::from_time_t(0);
+-            
++
+     res.sec=static_cast<xtime::xtime_sec_t>(time_since_epoch.total_seconds());
+     res.nsec=static_cast<xtime::xtime_nsec_t>(time_since_epoch.fractional_seconds()*(1000000000/time_since_epoch.ticks_per_second()));
+     return res;
+@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_tim
+ 
+ inline int xtime_get(struct xtime* xtp, int clock_type)
+ {
+-    if (clock_type == TIME_UTC)
++    if (clock_type == TIME_UTC_)
+     {
+         *xtp=get_xtime(get_system_time());
+         return clock_type;
+@@ -81,7 +81,7 @@ inline int xtime_cmp(const xtime& xt1, c
+ {
+     if (xt1.sec == xt2.sec)
+         return (int)(xt1.nsec - xt2.nsec);
+-    else 
++    else
+         return (xt1.sec > xt2.sec) ? 1 : -1;
+ }
+ 
+Index: boost_1_49_0/libs/thread/example/starvephil.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/starvephil.cpp
++++ boost_1_49_0/libs/thread/example/starvephil.cpp
+@@ -50,7 +50,7 @@ public:
+                       << "very hot ..." << std::endl;
+         }
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += 3;
+         boost::thread::sleep(xt);
+         m_chickens += value;
+@@ -85,7 +85,7 @@ void chef()
+             std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
+         }
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += 2;
+         boost::thread::sleep(xt);
+         {
+@@ -111,7 +111,7 @@ struct phil
+             if (m_id > 0)
+             {
+                 boost::xtime xt;
+-                boost::xtime_get(&xt, boost::TIME_UTC);
++                boost::xtime_get(&xt, boost::TIME_UTC_);
+                 xt.sec += 3;
+                 boost::thread::sleep(xt);
+             }
+Index: boost_1_49_0/libs/thread/example/tennis.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/tennis.cpp
++++ boost_1_49_0/libs/thread/example/tennis.cpp
+@@ -1,7 +1,7 @@
+ // Copyright (C) 2001-2003
+ // William E. Kempf
+ //
+-//  Distributed under the Boost Software License, Version 1.0. (See accompanying 
++//  Distributed under the Boost Software License, Version 1.0. (See accompanying
+ //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+ 
+ #include <boost/thread/mutex.hpp>
+@@ -104,7 +104,7 @@ int main(int argc, char* argv[])
+     boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
+ 
+     boost::xtime xt;
+-    boost::xtime_get(&xt, boost::TIME_UTC);
++    boost::xtime_get(&xt, boost::TIME_UTC_);
+     xt.sec += 1;
+     boost::thread::sleep(xt);
+     {
+Index: boost_1_49_0/libs/thread/example/thread.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/thread.cpp
++++ boost_1_49_0/libs/thread/example/thread.cpp
+@@ -14,7 +14,7 @@ struct thread_alarm
+     void operator()()
+     {
+         boost::xtime xt;
+-        boost::xtime_get(&xt, boost::TIME_UTC);
++        boost::xtime_get(&xt, boost::TIME_UTC_);
+         xt.sec += m_secs;
+ 
+         boost::thread::sleep(xt);
+Index: boost_1_49_0/libs/thread/example/xtime.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/example/xtime.cpp
++++ boost_1_49_0/libs/thread/example/xtime.cpp
+@@ -10,7 +10,7 @@
+ int main(int argc, char* argv[])
+ {
+     boost::xtime xt;
+-    boost::xtime_get(&xt, boost::TIME_UTC);
++    boost::xtime_get(&xt, boost::TIME_UTC_);
+     xt.sec += 1;
+     boost::thread::sleep(xt); // Sleep for 1 second
+ }
+Index: boost_1_49_0/libs/thread/src/pthread/thread.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/pthread/thread.cpp
++++ boost_1_49_0/libs/thread/src/pthread/thread.cpp
+@@ -23,7 +23,7 @@
+ #include <unistd.h>
+ #endif
+ 
+-#include "timeconv.inl"
++#include <libs/thread/src/pthread/timeconv.inl>
+ 
+ namespace boost
+ {
+@@ -354,7 +354,7 @@ namespace boost
+                     cond.timed_wait(lock, xt);
+ #   endif
+                     xtime cur;
+-                    xtime_get(&cur, TIME_UTC);
++                    xtime_get(&cur, TIME_UTC_);
+                     if (xtime_cmp(xt, cur) <= 0)
+                         return;
+                 }
+@@ -369,7 +369,7 @@ namespace boost
+             BOOST_VERIFY(!pthread_yield());
+ #   else
+             xtime xt;
+-            xtime_get(&xt, TIME_UTC);
++            xtime_get(&xt, TIME_UTC_);
+             sleep(xt);
+ #   endif
+         }
+Index: boost_1_49_0/libs/thread/src/pthread/timeconv.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/pthread/timeconv.inl
++++ boost_1_49_0/libs/thread/src/pthread/timeconv.inl
+@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND =
+ inline void to_time(int milliseconds, boost::xtime& xt)
+ {
+     int res = 0;
+-    res = boost::xtime_get(&xt, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&xt, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+@@ -56,8 +56,8 @@ inline void to_timespec_duration(const b
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+     {
+@@ -87,8 +87,8 @@ inline void to_duration(boost::xtime xt,
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         milliseconds = 0;
+@@ -109,8 +109,8 @@ inline void to_microduration(boost::xtim
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    BOOST_ASSERT(res == boost::TIME_UTC); (void)res;
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    BOOST_ASSERT(res == boost::TIME_UTC_); (void)res;
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         microseconds = 0;
+Index: boost_1_49_0/libs/thread/src/win32/timeconv.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/src/win32/timeconv.inl
++++ boost_1_49_0/libs/thread/src/win32/timeconv.inl
+@@ -17,8 +17,8 @@ const int NANOSECONDS_PER_MICROSECOND =
+ inline void to_time(int milliseconds, boost::xtime& xt)
+ {
+     int res = 0;
+-    res = boost::xtime_get(&xt, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&xt, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+     xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+@@ -54,8 +54,8 @@ inline void to_timespec_duration(const b
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+     {
+@@ -85,8 +85,8 @@ inline void to_duration(boost::xtime xt,
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         milliseconds = 0;
+@@ -107,8 +107,8 @@ inline void to_microduration(boost::xtim
+ {
+     boost::xtime cur;
+     int res = 0;
+-    res = boost::xtime_get(&cur, boost::TIME_UTC);
+-    assert(res == boost::TIME_UTC);
++    res = boost::xtime_get(&cur, boost::TIME_UTC_);
++    assert(res == boost::TIME_UTC_);
+ 
+     if (boost::xtime_cmp(xt, cur) <= 0)
+         microseconds = 0;
+Index: boost_1_49_0/libs/thread/test/test_xtime.cpp
+===================================================================
+--- boost_1_49_0.orig/libs/thread/test/test_xtime.cpp
++++ boost_1_49_0/libs/thread/test/test_xtime.cpp
+@@ -17,8 +17,8 @@ void test_xtime_cmp()
+ {
+     boost::xtime xt1, xt2, cur;
+     BOOST_CHECK_EQUAL(
+-        boost::xtime_get(&cur, boost::TIME_UTC),
+-        static_cast<int>(boost::TIME_UTC));
++        boost::xtime_get(&cur, boost::TIME_UTC_),
++        static_cast<int>(boost::TIME_UTC_));
+ 
+     xt1 = xt2 = cur;
+     xt1.nsec -= 1;
+@@ -42,14 +42,14 @@ void test_xtime_get()
+     boost::xtime orig, cur, old;
+     BOOST_CHECK_EQUAL(
+         boost::xtime_get(&orig,
+-            boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
++            boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC_));
+     old = orig;
+ 
+     for (int x=0; x < 100; ++x)
+     {
+         BOOST_CHECK_EQUAL(
+-            boost::xtime_get(&cur, boost::TIME_UTC),
+-            static_cast<int>(boost::TIME_UTC));
++            boost::xtime_get(&cur, boost::TIME_UTC_),
++            static_cast<int>(boost::TIME_UTC_));
+         BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
+         BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
+         old = cur;
+Index: boost_1_49_0/libs/thread/test/util.inl
+===================================================================
+--- boost_1_49_0.orig/libs/thread/test/util.inl
++++ boost_1_49_0/libs/thread/test/util.inl
+@@ -28,8 +28,8 @@ inline boost::xtime delay(int secs, int
+     const int NANOSECONDS_PER_MILLISECOND = 1000000;
+ 
+     boost::xtime xt;
+-    if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))
+-        BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC");
++    if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC_))
++        BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_");
+ 
+     nsecs += xt.nsec;
+     msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
diff --git a/pkgs/development/libraries/boost/time_utc_144.patch b/pkgs/development/libraries/boost/time_utc_144.patch
new file mode 100644
index 00000000000..512832c1829
--- /dev/null
+++ b/pkgs/development/libraries/boost/time_utc_144.patch
@@ -0,0 +1,520 @@
+diff -rc boost_1_44_0/boost/thread/xtime.hpp boost_1_44_0-new/boost/thread/xtime.hpp
+*** boost_1_44_0/boost/thread/xtime.hpp	2008-06-18 15:01:08.000000000 +0200
+--- boost_1_44_0-new/boost/thread/xtime.hpp	2013-04-12 14:00:27.125713549 +0200
+***************
+*** 20,26 ****
+  
+  enum xtime_clock_types
+  {
+!     TIME_UTC=1
+  //    TIME_TAI,
+  //    TIME_MONOTONIC,
+  //    TIME_PROCESS,
+--- 20,26 ----
+  
+  enum xtime_clock_types
+  {
+!     TIME_UTC_=1
+  //    TIME_TAI,
+  //    TIME_MONOTONIC,
+  //    TIME_PROCESS,
+***************
+*** 68,74 ****
+  
+  inline int xtime_get(struct xtime* xtp, int clock_type)
+  {
+!     if (clock_type == TIME_UTC)
+      {
+          *xtp=get_xtime(get_system_time());
+          return clock_type;
+--- 68,74 ----
+  
+  inline int xtime_get(struct xtime* xtp, int clock_type)
+  {
+!     if (clock_type == TIME_UTC_)
+      {
+          *xtp=get_xtime(get_system_time());
+          return clock_type;
+diff -rc boost_1_44_0/libs/interprocess/test/condition_test_template.hpp boost_1_44_0-new/libs/interprocess/test/condition_test_template.hpp
+*** boost_1_44_0/libs/interprocess/test/condition_test_template.hpp	2009-10-15 20:45:53.000000000 +0200
+--- boost_1_44_0-new/libs/interprocess/test/condition_test_template.hpp	2013-04-12 14:00:20.215658855 +0200
+***************
+*** 49,56 ****
+      const int NANOSECONDS_PER_MILLISECOND = 1000000;
+  
+      boost::xtime xt;
+!     int ret = boost::xtime_get(&xt, boost::TIME_UTC);
+!     assert(ret == static_cast<int>(boost::TIME_UTC));(void)ret;
+      nsecs += xt.nsec;
+      msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
+      secs += msecs / MILLISECONDS_PER_SECOND;
+--- 49,56 ----
+      const int NANOSECONDS_PER_MILLISECOND = 1000000;
+  
+      boost::xtime xt;
+!     int ret = boost::xtime_get(&xt, boost::TIME_UTC_);
+!     assert(ret == static_cast<int>(boost::TIME_UTC_));(void)ret;
+      nsecs += xt.nsec;
+      msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
+      secs += msecs / MILLISECONDS_PER_SECOND;
+diff -rc boost_1_44_0/libs/interprocess/test/util.hpp boost_1_44_0-new/libs/interprocess/test/util.hpp
+*** boost_1_44_0/libs/interprocess/test/util.hpp	2009-10-15 20:45:53.000000000 +0200
+--- boost_1_44_0-new/libs/interprocess/test/util.hpp	2013-04-12 14:00:20.219658887 +0200
+***************
+*** 71,77 ****
+  boost::xtime xsecs(int secs)
+  {
+     boost::xtime ret;
+!    boost::xtime_get(&ret, boost::TIME_UTC);
+     ret.sec += secs;
+     return ret;
+  }
+--- 71,77 ----
+  boost::xtime xsecs(int secs)
+  {
+     boost::xtime ret;
+!    boost::xtime_get(&ret, boost::TIME_UTC_);
+     ret.sec += secs;
+     return ret;
+  }
+diff -rc boost_1_44_0/libs/spirit/classic/test/grammar_mt_tests.cpp boost_1_44_0-new/libs/spirit/classic/test/grammar_mt_tests.cpp
+*** boost_1_44_0/libs/spirit/classic/test/grammar_mt_tests.cpp	2008-06-22 17:05:38.000000000 +0200
+--- boost_1_44_0-new/libs/spirit/classic/test/grammar_mt_tests.cpp	2013-04-12 14:00:18.836647940 +0200
+***************
+*** 70,76 ****
+  {
+      static long const nanoseconds_per_second = 1000L*1000L*1000L;
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC);
+      xt.nsec+=1000*1000*milliseconds;
+      while (xt.nsec > nanoseconds_per_second)
+      {
+--- 70,76 ----
+  {
+      static long const nanoseconds_per_second = 1000L*1000L*1000L;
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC_);
+      xt.nsec+=1000*1000*milliseconds;
+      while (xt.nsec > nanoseconds_per_second)
+      {
+diff -rc boost_1_44_0/libs/spirit/classic/test/owi_mt_tests.cpp boost_1_44_0-new/libs/spirit/classic/test/owi_mt_tests.cpp
+*** boost_1_44_0/libs/spirit/classic/test/owi_mt_tests.cpp	2008-06-22 17:05:38.000000000 +0200
+--- boost_1_44_0-new/libs/spirit/classic/test/owi_mt_tests.cpp	2013-04-12 14:00:18.836647940 +0200
+***************
+*** 86,92 ****
+              return test_size;
+  
+          boost::xtime now;
+!         boost::xtime_get(&now, boost::TIME_UTC);
+          unsigned long seconds = now.sec - start_time.sec;
+          if (seconds < 4)
+          {
+--- 86,92 ----
+              return test_size;
+  
+          boost::xtime now;
+!         boost::xtime_get(&now, boost::TIME_UTC_);
+          unsigned long seconds = now.sec - start_time.sec;
+          if (seconds < 4)
+          {
+***************
+*** 187,193 ****
+  void concurrent_creation_of_objects()
+  {
+      {
+!         boost::xtime_get(&start_time, boost::TIME_UTC);
+          boost::thread thread1(callable_ref(test1));
+          boost::thread thread2(callable_ref(test2));
+          boost::thread thread3(callable_ref(test3));
+--- 187,193 ----
+  void concurrent_creation_of_objects()
+  {
+      {
+!         boost::xtime_get(&start_time, boost::TIME_UTC_);
+          boost::thread thread1(callable_ref(test1));
+          boost::thread thread2(callable_ref(test2));
+          boost::thread thread3(callable_ref(test3));
+diff -rc boost_1_44_0/libs/thread/example/starvephil.cpp boost_1_44_0-new/libs/thread/example/starvephil.cpp
+*** boost_1_44_0/libs/thread/example/starvephil.cpp	2006-09-14 23:51:01.000000000 +0200
+--- boost_1_44_0-new/libs/thread/example/starvephil.cpp	2013-04-12 14:00:19.413652507 +0200
+***************
+*** 50,56 ****
+                        << "very hot ..." << std::endl;
+          }
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC);
+          xt.sec += 3;
+          boost::thread::sleep(xt);
+          m_chickens += value;
+--- 50,56 ----
+                        << "very hot ..." << std::endl;
+          }
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC_);
+          xt.sec += 3;
+          boost::thread::sleep(xt);
+          m_chickens += value;
+***************
+*** 85,91 ****
+              std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
+          }
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC);
+          xt.sec += 2;
+          boost::thread::sleep(xt);
+          {
+--- 85,91 ----
+              std::cout << "(" << clock() << ") Chef: cooking ..." << std::endl;
+          }
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC_);
+          xt.sec += 2;
+          boost::thread::sleep(xt);
+          {
+***************
+*** 111,117 ****
+              if (m_id > 0)
+              {
+                  boost::xtime xt;
+!                 boost::xtime_get(&xt, boost::TIME_UTC);
+                  xt.sec += 3;
+                  boost::thread::sleep(xt);
+              }
+--- 111,117 ----
+              if (m_id > 0)
+              {
+                  boost::xtime xt;
+!                 boost::xtime_get(&xt, boost::TIME_UTC_);
+                  xt.sec += 3;
+                  boost::thread::sleep(xt);
+              }
+diff -rc boost_1_44_0/libs/thread/example/tennis.cpp boost_1_44_0-new/libs/thread/example/tennis.cpp
+*** boost_1_44_0/libs/thread/example/tennis.cpp	2009-10-19 11:18:13.000000000 +0200
+--- boost_1_44_0-new/libs/thread/example/tennis.cpp	2013-04-12 14:00:19.412652499 +0200
+***************
+*** 104,110 ****
+      boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
+  
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC);
+      xt.sec += 1;
+      boost::thread::sleep(xt);
+      {
+--- 104,110 ----
+      boost::thread thrdb(thread_adapter(&player, (void*)PLAYER_B));
+  
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC_);
+      xt.sec += 1;
+      boost::thread::sleep(xt);
+      {
+diff -rc boost_1_44_0/libs/thread/example/thread.cpp boost_1_44_0-new/libs/thread/example/thread.cpp
+*** boost_1_44_0/libs/thread/example/thread.cpp	2006-09-14 23:51:01.000000000 +0200
+--- boost_1_44_0-new/libs/thread/example/thread.cpp	2013-04-12 14:00:19.414652515 +0200
+***************
+*** 14,20 ****
+      void operator()()
+      {
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC);
+          xt.sec += m_secs;
+  
+          boost::thread::sleep(xt);
+--- 14,20 ----
+      void operator()()
+      {
+          boost::xtime xt;
+!         boost::xtime_get(&xt, boost::TIME_UTC_);
+          xt.sec += m_secs;
+  
+          boost::thread::sleep(xt);
+diff -rc boost_1_44_0/libs/thread/example/xtime.cpp boost_1_44_0-new/libs/thread/example/xtime.cpp
+*** boost_1_44_0/libs/thread/example/xtime.cpp	2006-09-14 23:51:01.000000000 +0200
+--- boost_1_44_0-new/libs/thread/example/xtime.cpp	2013-04-12 14:00:19.413652507 +0200
+***************
+*** 10,16 ****
+  int main(int argc, char* argv[])
+  {
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC);
+      xt.sec += 1;
+      boost::thread::sleep(xt); // Sleep for 1 second
+  }
+--- 10,16 ----
+  int main(int argc, char* argv[])
+  {
+      boost::xtime xt;
+!     boost::xtime_get(&xt, boost::TIME_UTC_);
+      xt.sec += 1;
+      boost::thread::sleep(xt); // Sleep for 1 second
+  }
+diff -rc boost_1_44_0/libs/thread/src/pthread/thread.cpp boost_1_44_0-new/libs/thread/src/pthread/thread.cpp
+*** boost_1_44_0/libs/thread/src/pthread/thread.cpp	2010-07-09 21:13:09.000000000 +0200
+--- boost_1_44_0-new/libs/thread/src/pthread/thread.cpp	2013-04-12 14:00:19.415652523 +0200
+***************
+*** 350,356 ****
+                      cond.timed_wait(lock, xt);
+  #   endif
+                      xtime cur;
+!                     xtime_get(&cur, TIME_UTC);
+                      if (xtime_cmp(xt, cur) <= 0)
+                          return;
+                  }
+--- 350,356 ----
+                      cond.timed_wait(lock, xt);
+  #   endif
+                      xtime cur;
+!                     xtime_get(&cur, TIME_UTC_);
+                      if (xtime_cmp(xt, cur) <= 0)
+                          return;
+                  }
+***************
+*** 365,371 ****
+              BOOST_VERIFY(!pthread_yield());
+  #   else
+              xtime xt;
+!             xtime_get(&xt, TIME_UTC);
+              sleep(xt);
+  #   endif
+          }
+--- 365,371 ----
+              BOOST_VERIFY(!pthread_yield());
+  #   else
+              xtime xt;
+!             xtime_get(&xt, TIME_UTC_);
+              sleep(xt);
+  #   endif
+          }
+diff -rc boost_1_44_0/libs/thread/src/pthread/timeconv.inl boost_1_44_0-new/libs/thread/src/pthread/timeconv.inl
+*** boost_1_44_0/libs/thread/src/pthread/timeconv.inl	2010-04-01 17:04:15.000000000 +0200
+--- boost_1_44_0-new/libs/thread/src/pthread/timeconv.inl	2013-04-12 14:00:19.414652515 +0200
+***************
+*** 20,27 ****
+  inline void to_time(int milliseconds, boost::xtime& xt)
+  {
+      int res = 0;
+!     res = boost::xtime_get(&xt, boost::TIME_UTC);
+!     BOOST_ASSERT(res == boost::TIME_UTC);
+  
+      xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+      xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+--- 20,27 ----
+  inline void to_time(int milliseconds, boost::xtime& xt)
+  {
+      int res = 0;
+!     res = boost::xtime_get(&xt, boost::TIME_UTC_);
+!     BOOST_ASSERT(res == boost::TIME_UTC_);
+  
+      xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+      xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+***************
+*** 57,64 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     BOOST_ASSERT(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+      {
+--- 57,64 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     BOOST_ASSERT(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+      {
+***************
+*** 88,95 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     BOOST_ASSERT(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          milliseconds = 0;
+--- 88,95 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     BOOST_ASSERT(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          milliseconds = 0;
+***************
+*** 110,117 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     BOOST_ASSERT(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          microseconds = 0;
+--- 110,117 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     BOOST_ASSERT(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          microseconds = 0;
+diff -rc boost_1_44_0/libs/thread/src/win32/timeconv.inl boost_1_44_0-new/libs/thread/src/win32/timeconv.inl
+*** boost_1_44_0/libs/thread/src/win32/timeconv.inl	2007-11-25 19:38:02.000000000 +0100
+--- boost_1_44_0-new/libs/thread/src/win32/timeconv.inl	2013-04-12 14:00:19.416652531 +0200
+***************
+*** 17,24 ****
+  inline void to_time(int milliseconds, boost::xtime& xt)
+  {
+      int res = 0;
+!     res = boost::xtime_get(&xt, boost::TIME_UTC);
+!     assert(res == boost::TIME_UTC);
+  
+      xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+      xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+--- 17,24 ----
+  inline void to_time(int milliseconds, boost::xtime& xt)
+  {
+      int res = 0;
+!     res = boost::xtime_get(&xt, boost::TIME_UTC_);
+!     assert(res == boost::TIME_UTC_);
+  
+      xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
+      xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
+***************
+*** 54,61 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     assert(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+      {
+--- 54,61 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     assert(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+      {
+***************
+*** 85,92 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     assert(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          milliseconds = 0;
+--- 85,92 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     assert(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          milliseconds = 0;
+***************
+*** 107,114 ****
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC);
+!     assert(res == boost::TIME_UTC);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          microseconds = 0;
+--- 107,114 ----
+  {
+      boost::xtime cur;
+      int res = 0;
+!     res = boost::xtime_get(&cur, boost::TIME_UTC_);
+!     assert(res == boost::TIME_UTC_);
+  
+      if (boost::xtime_cmp(xt, cur) <= 0)
+          microseconds = 0;
+diff -rc boost_1_44_0/libs/thread/test/test_xtime.cpp boost_1_44_0-new/libs/thread/test/test_xtime.cpp
+*** boost_1_44_0/libs/thread/test/test_xtime.cpp	2008-07-08 09:44:55.000000000 +0200
+--- boost_1_44_0-new/libs/thread/test/test_xtime.cpp	2013-04-12 14:00:19.432652657 +0200
+***************
+*** 17,24 ****
+  {
+      boost::xtime xt1, xt2, cur;
+      BOOST_CHECK_EQUAL(
+!         boost::xtime_get(&cur, boost::TIME_UTC),
+!         static_cast<int>(boost::TIME_UTC));
+  
+      xt1 = xt2 = cur;
+      xt1.nsec -= 1;
+--- 17,24 ----
+  {
+      boost::xtime xt1, xt2, cur;
+      BOOST_CHECK_EQUAL(
+!         boost::xtime_get(&cur, boost::TIME_UTC_),
+!         static_cast<int>(boost::TIME_UTC_));
+  
+      xt1 = xt2 = cur;
+      xt1.nsec -= 1;
+***************
+*** 42,55 ****
+      boost::xtime orig, cur, old;
+      BOOST_CHECK_EQUAL(
+          boost::xtime_get(&orig,
+!             boost::TIME_UTC), static_cast<int>(boost::TIME_UTC));
+      old = orig;
+  
+      for (int x=0; x < 100; ++x)
+      {
+          BOOST_CHECK_EQUAL(
+!             boost::xtime_get(&cur, boost::TIME_UTC),
+!             static_cast<int>(boost::TIME_UTC));
+          BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
+          BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
+          old = cur;
+--- 42,55 ----
+      boost::xtime orig, cur, old;
+      BOOST_CHECK_EQUAL(
+          boost::xtime_get(&orig,
+!             boost::TIME_UTC_), static_cast<int>(boost::TIME_UTC));
+      old = orig;
+  
+      for (int x=0; x < 100; ++x)
+      {
+          BOOST_CHECK_EQUAL(
+!             boost::xtime_get(&cur, boost::TIME_UTC_),
+!             static_cast<int>(boost::TIME_UTC_));
+          BOOST_CHECK(boost::xtime_cmp(cur, orig) >= 0);
+          BOOST_CHECK(boost::xtime_cmp(cur, old) >= 0);
+          old = cur;
+diff -rc boost_1_44_0/libs/thread/test/util.inl boost_1_44_0-new/libs/thread/test/util.inl
+*** boost_1_44_0/libs/thread/test/util.inl	2008-11-03 23:29:39.000000000 +0100
+--- boost_1_44_0-new/libs/thread/test/util.inl	2013-04-12 14:00:19.433652665 +0200
+***************
+*** 28,35 ****
+      const int NANOSECONDS_PER_MILLISECOND = 1000000;
+  
+      boost::xtime xt;
+!     if (boost::TIME_UTC != boost::xtime_get (&xt, boost::TIME_UTC))
+!         BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC");
+  
+      nsecs += xt.nsec;
+      msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
+--- 28,35 ----
+      const int NANOSECONDS_PER_MILLISECOND = 1000000;
+  
+      boost::xtime xt;
+!     if (boost::TIME_UTC_ != boost::xtime_get (&xt, boost::TIME_UTC))
+!         BOOST_ERROR ("boost::xtime_get != boost::TIME_UTC_");
+  
+      nsecs += xt.nsec;
+      msecs += nsecs / NANOSECONDS_PER_MILLISECOND;
diff --git a/pkgs/development/libraries/bullet/default.nix b/pkgs/development/libraries/bullet/default.nix
index b725f6bbf9f..6320dd58e4c 100644
--- a/pkgs/development/libraries/bullet/default.nix
+++ b/pkgs/development/libraries/bullet/default.nix
@@ -1,14 +1,17 @@
-{stdenv, fetchurl, unzip, cmake}:
+{ stdenv, fetchurl, cmake, mesa, freeglut }:
 
-stdenv.mkDerivation {
-  name = "bullet-2.78";
+stdenv.mkDerivation rec {
+  name = "bullet-2.80"; # vdrift 2012-07-22 doesn't build with 2.81
+  rev = "2531";
   src = fetchurl {
-    url = "http://bullet.googlecode.com/files/bullet-2.78.zip";
-    sha256 = "10l2dclvv0di9mi9qp6xfy9vybx182xp2dyygabacrpr3p75s77k";
+    url = "http://bullet.googlecode.com/files/${name}-rev${rev}.tgz";
+    sha256 = "0dig6k88jz5y0cz6dn186vc4l96l4v56zvwpsp5bv9f5wdwjskj6";
   };
-  buildInputs = [ unzip cmake ];
+
+  buildInputs = [ cmake mesa freeglut ];
   configurePhase = ''
-    cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXTRAS=OFF -DBUILD_DEMOS=OFF .
+    cmake -DBUILD_SHARED_LIBS=ON -DBUILD_EXTRAS=OFF -DBUILD_DEMOS=OFF \
+      -DCMAKE_INSTALL_PREFIX=$out .
   '';
 
   meta = {
@@ -19,6 +22,6 @@ stdenv.mkDerivation {
     '';
     homepage = http://code.google.com/p/bullet/;
     license = stdenv.lib.licenses.zlib;
-    maintainers = [ "Alexander Foremny <alexanderforemny@googlemail.com>" ];
+    maintainers = with stdenv.lib.maintainers; [ aforemny ];
   };
 }
diff --git a/pkgs/development/libraries/bwidget/default.nix b/pkgs/development/libraries/bwidget/default.nix
index 693e0587a0b..31dc885bc43 100644
--- a/pkgs/development/libraries/bwidget/default.nix
+++ b/pkgs/development/libraries/bwidget/default.nix
@@ -12,9 +12,19 @@ stdenv.mkDerivation rec {
   dontBuild = true;
 
   installPhase = ''
-    ensureDir "$out/tcltk"
-    cp -R *.tcl lang images "$out/tcltk/"
+    ensureDir "$out/lib/${passthru.libPrefix}"
+    cp -R *.tcl lang images "$out/lib/${passthru.libPrefix}"
   '';
 
-  buildInputs = [tcl];
+  passthru = {
+    libPrefix = "bwidget${version}";
+  };
+
+  buildInputs = [ tcl ];
+
+  meta = {
+    homepage = "http://tcl.activestate.com/software/tcllib/";
+    description = "The BWidget toolkit is a high-level widget set for Tcl/Tk.";
+    license = stdenv.lib.licenses.tcltk;
+  };
 }
diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix
new file mode 100644
index 00000000000..c1b23179a1d
--- /dev/null
+++ b/pkgs/development/libraries/c-ares/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "c-ares-1.10.0";
+
+  src = fetchurl {
+    url = "http://c-ares.haxx.se/download/${name}.tar.gz";
+    sha256 = "1nyka87yf2jfd0y6sspll0yxwb8zi7kyvajrdbjmh4axc5s1cw1x";
+  };
+
+  meta = {
+    description = "A C library for asynchronous DNS requests";
+
+    homepage = http://c-ares.haxx.se;
+
+    license = stdenv.lib.licenses.mit;
+
+    maintainer = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/development/libraries/c-library/default.nix b/pkgs/development/libraries/c-library/default.nix
index 96bb82f54be..714e8b66089 100644
--- a/pkgs/development/libraries/c-library/default.nix
+++ b/pkgs/development/libraries/c-library/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
   
   buildInputs = [aterm];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   dontStrip = isMingw;
 }  
diff --git a/pkgs/development/libraries/caelum/default.nix b/pkgs/development/libraries/caelum/default.nix
index 75eb5109b45..e48ed5a7692 100644
--- a/pkgs/development/libraries/caelum/default.nix
+++ b/pkgs/development/libraries/caelum/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ois ogre boost ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/cairo/1.12.2.nix b/pkgs/development/libraries/cairo/1.12.2.nix
new file mode 100644
index 00000000000..18195017c0f
--- /dev/null
+++ b/pkgs/development/libraries/cairo/1.12.2.nix
@@ -0,0 +1,82 @@
+{ postscriptSupport ? true
+, pdfSupport ? true
+, pngSupport ? true
+, xcbSupport ? false
+, gobjectSupport ? true, glib
+, stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs
+, zlib, libpng, pixman, libxcb ? null, xcbutil ? null
+, libiconvOrEmpty, libintlOrEmpty
+}:
+
+assert postscriptSupport -> zlib != null;
+assert pngSupport -> libpng != null;
+assert xcbSupport -> libxcb != null && xcbutil != null;
+
+stdenv.mkDerivation rec {
+  name = "cairo-1.12.2";
+
+  src = fetchurl {
+    url = "http://cairographics.org/releases/${name}.tar.xz";
+    sha1 = "bc2ee50690575f16dab33af42a2e6cdc6451e3f9";
+  };
+
+  buildInputs =
+    [ pkgconfig x11 fontconfig xlibs.libXrender ]
+    ++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ]
+    ++ libintlOrEmpty
+    ++ libiconvOrEmpty;
+
+  propagatedBuildInputs =
+    [ freetype pixman ] ++
+    stdenv.lib.optional gobjectSupport glib ++
+    stdenv.lib.optional postscriptSupport zlib ++
+    stdenv.lib.optional pngSupport libpng;
+
+  configureFlags =
+    [ "--enable-tee" ]
+    ++ stdenv.lib.optional xcbSupport "--enable-xcb"
+    ++ stdenv.lib.optional pdfSupport "--enable-pdf";
+
+  preConfigure = ''
+    # Work around broken `Requires.private' that prevents Freetype
+    # `-I' flags to be propagated.
+    sed -i "src/cairo.pc.in" \
+        -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype}/include/freetype2 -I${freetype}/include|g'
+  ''
+
+  # On FreeBSD, `-ldl' doesn't exist.
+  + (stdenv.lib.optionalString stdenv.isFreeBSD
+       '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
+          do
+            cat "$i" | sed -es/-ldl//g > t
+            mv t "$i"
+          done
+       '');
+
+  enableParallelBuilding = true;
+
+  # The default `--disable-gtk-doc' is ignored.
+  postInstall = "rm -rf $out/share/gtk-doc";
+
+  meta = {
+    description = "A 2D graphics library with support for multiple output devices";
+
+    longDescription = ''
+      Cairo is a 2D graphics library with support for multiple output
+      devices.  Currently supported output targets include the X
+      Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.  Experimental backends include OpenGL
+      (through glitz), XCB, BeOS, OS/2, and DirectFB.
+
+      Cairo is designed to produce consistent output on all output
+      media while taking advantage of display hardware acceleration
+      when available (e.g., through the X Render Extension).
+    '';
+
+    homepage = http://cairographics.org/;
+
+    licenses = [ "LGPLv2+" "MPLv1" ];
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index 34c8b929f55..1ac455efbd2 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -5,7 +5,7 @@
 , gobjectSupport ? true, glib
 , stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs
 , zlib, libpng, pixman, libxcb ? null, xcbutil ? null
-, gettext
+, libiconvOrEmpty, libintlOrEmpty
 }:
 
 assert postscriptSupport -> zlib != null;
@@ -13,23 +13,21 @@ assert pngSupport -> libpng != null;
 assert xcbSupport -> libxcb != null && xcbutil != null;
 
 stdenv.mkDerivation rec {
-  name = "cairo-1.10.2";
+  name = "cairo-1.12.4";
 
   src = fetchurl {
-    url = "http://cairographics.org/releases/${name}.tar.gz";
-    sha1 = "ccce5ae03f99c505db97c286a0c9a90a926d3c6e";
+    url = "http://cairographics.org/releases/${name}.tar.xz";
+    sha1 = "f4158981ed01e73c94fb8072074b17feee61a68b";
   };
 
-  enableParallelBuilding = true;
-
   outputs = [ "dev" "out" "bin" "doc" ];
 
   buildInputs =
-    [ pkgconfig x11 fontconfig xlibs.libXrender ]
+    [ pkgconfig x11 fontconfig ]
+    ++ stdenv.lib.optional (!stdenv.isDarwin) xlibs.libXrender
     ++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ]
-
-    # On non-GNU systems we need GNU Gettext for libintl.
-    ++ stdenv.lib.optional (!stdenv.isLinux) gettext;
+    ++ libintlOrEmpty
+    ++ libiconvOrEmpty;
 
   propagatedBuildInputs =
     [ freetype pixman ] ++
@@ -47,7 +45,18 @@ stdenv.mkDerivation rec {
     # `-I' flags to be propagated.
     sed -i "src/cairo.pc.in" \
         -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype}/include/freetype2 -I${freetype}/include|g'
-  '';
+  ''
+
+  # On FreeBSD, `-ldl' doesn't exist.
+  + (stdenv.lib.optionalString stdenv.isFreeBSD
+       '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
+          do
+            cat "$i" | sed -es/-ldl//g > t
+            mv t "$i"
+          done
+       '');
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "A 2D graphics library with support for multiple output devices";
diff --git a/pkgs/development/libraries/liblrdf/default.nix b/pkgs/development/libraries/celt/0.5.1.nix
index 515c81483b0..0f42e7cd040 100644
--- a/pkgs/development/libraries/liblrdf/default.nix
+++ b/pkgs/development/libraries/celt/0.5.1.nix
@@ -1,21 +1,19 @@
 x@{builderDefsPackage
-  , libtool, autoconf, automake, ladspaH, librdf_raptor, pkgconfig, zlib
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    baseName="liblrdf";
-    version="0.4.0";
-    project="lrdf";
+    baseName="celt";
+    version="0.5.1.3";
     name="${baseName}-${version}";
-    url="mirror://sourceforge/project/${project}/${baseName}/${version}/${name}.tar.gz";
-    hash="015jv7pp0a0qxgljgdvf7d01nj4fx0zgzg0wayjp7v86pa38xscm";
+    url="http://downloads.xiph.org/releases/${baseName}/${name}.tar.gz";
+    hash="0bkam9z5vnrxpbxkkh9kw6yzjka9di56h11iijikdd1f71l5nbpw";
   };
 in
 rec {
@@ -29,18 +27,20 @@ rec {
 
   /* doConfigure should be removed if not needed */
   phaseNames = ["doConfigure" "doMakeInstall"];
-      
+
   meta = {
-    description = "Lightweight RDF library with special support for LADSPA";
+    description = "CELT - low-delay audio codec";
     maintainers = with a.lib.maintainers;
     [
       raskin
     ];
     platforms = with a.lib.platforms;
       linux;
-    license = a.lib.licenses.gpl2;
+    license = "free";
   };
   passthru = {
+    updateInfo = {
+      downloadPage = "http://www.celt-codec.org/downloads/";
+    };
   };
 }) x
-
diff --git a/pkgs/development/libraries/cil-aterm/atermprinter.patch b/pkgs/development/libraries/cil-aterm/atermprinter.patch
deleted file mode 100644
index 16761898e19..00000000000
--- a/pkgs/development/libraries/cil-aterm/atermprinter.patch
+++ /dev/null
@@ -1,515 +0,0 @@
-diff -urN cil.orig/Makefile.cil.in cil/Makefile.cil.in
---- cil.orig/Makefile.cil.in	2005-06-01 14:37:13.000000000 +0200
-+++ cil/Makefile.cil.in	2005-11-21 10:45:48.000000000 +0100
-@@ -75,6 +75,7 @@
-               canonicalize heap oneret partial simplemem simplify \
- 	      dataslicing \
-               testcil \
-+	      atermprinter \
- 	      $(CILLY_FEATURES) \
- 	      feature_config
- # ww: we don't want "maincil" in an external cil library (cil.cma),
-diff -urN cil.orig/src/ext/atermprinter.ml cil/src/ext/atermprinter.ml
---- cil.orig/src/ext/atermprinter.ml	1970-01-01 01:00:00.000000000 +0100
-+++ cil/src/ext/atermprinter.ml	2005-11-21 11:14:44.000000000 +0100
-@@ -0,0 +1,489 @@
-+open Cil
-+open Pretty
-+open List
-+open String
-+open Printf
-+module S = String 
-+module E = Errormsg
-+module H = Hashtbl
-+module IH = Inthash
-+
-+let outputfilename = ref "cil.aterm"
-+let trace p = eprintf "%s" (p ^ "\n") ; flush stderr
-+let invalidStmt = mkStmt (Instr [])
-+let id = fun x -> x 
-+let compose f g x = (f (g x))
-+let (@) = compose
-+let pSpace            = text " "
-+let foldl1 op ls      = match ls with
-+			| (x::xs) -> fold_left op x xs
-+                        | _       -> raise (Invalid_argument "foldl1 should not take an empty list")
-+let pPacked d l r     = l ++ d ++ r
-+let pParens d         = pPacked d (text "(") (text ")")
-+let pBraced d         = pPacked d (text "{") (text "}")
-+let pSquared d        = pPacked d (text "[") (text "]")
-+let pSpaced d         = pPacked d pSpace pSpace
-+let pBool b           = (pSpaced @ text @ S.capitalize @ string_of_bool) b
-+let pInt64 i          = text (Int64.to_string i)
-+let pSeqSep sep xs    = match xs with
-+			| [] -> nil
-+                        | _  -> foldl1 (pPacked sep) xs
-+let pCommaSep xs      = pSeqSep (text ",") xs
-+let pPair (a,b)       = (pSpaced @ pParens @ pCommaSep) [a;b]
-+let pTriplet (a,b,c)  = (pSpaced @ pParens @ pCommaSep) [a;b;c]
-+let pSemiColSep xs    = pSeqSep (text ";") xs
-+let pTriple f g h (a,b,c) = (f a, g b, h c)
-+let pDouble f g (a,b) = (f a, g b)
-+let pOption p m  = match m with
-+	         | None   -> text "None()"
-+                 | Some v -> text "Some" ++ pParens( p v )
-+let pSpParens = pSpaced @ pParens
-+let pQuoted str = pPacked (text(escaped str)) (text "\"") (text "\"")
-+let pList   = pSpaced @ pSquared @ pCommaSep
-+let pRecord = pSpaced @ pBraced  @ pCommaSep
-+
-+class atermPrinter : cilPrinter  = 
-+object (self)
-+  inherit defaultCilPrinterClass
-+
-+  (* printing variable declarations; just store the varinfo *)
-+  method pVDecl () (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pVDecl"
-+                                         ; self#pp_varinfo vinfo
-+  (* printing variable uses; same as declarations; store the varinfo *)
-+  method pVar (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pVar" ;
-+    self#pp_varinfo vinfo
-+
-+  method pLval () ((lh, off):lval) : doc = if !E.verboseFlag then trace "pLvalue" ;
-+    text "Lvalue" ++ (pParens @ pCommaSep) [ self#pp_lhost lh ; self#pOffset nil off ] 
-+
-+  (** we are not using the first argument which represents the base from which we are
-+      offsetting, because we just want to generate a tree view of the CIL tree. For a tree view
-+      this base case is not necessary **)
-+  method pOffset (d:doc) (o:offset) : doc = if !E.verboseFlag then trace "pOffset" ;
-+    match o with
-+    | NoOffset           -> text "Offset_NoOffset() "
-+    | Field (finfo, off) -> text "Offset_Field" ++ (pParens @ pCommaSep) [ (self#pFieldDecl ()) finfo ; self#pOffset nil off ]
-+    | Index (e, off)     -> text "Offset_Index" ++ (pParens @ pCommaSep) [ self#pExp () e ; self#pOffset nil off ]
-+  
-+  (*** INSTRUCTIONS ***)
-+  method pInstr () (i:instr) : doc = if !E.verboseFlag then trace "pInstr" ;
-+    match i with
-+    | Set (lv,e,l) -> text "Set" ++ (pParens @ pCommaSep) [ 
-+	self#pLval () lv ;
-+	self#pExp () e ;
-+	self#pp_location l ]
-+    | Call (olv,e, elst, l) -> text "Call" ++ (pParens @ pCommaSep) [
-+	pOption (self#pLval ()) olv ;
-+	self#pExp () e ;
-+	pList (map (self#pExp ()) elst) ;
-+	self#pp_location l]
-+    | Asm (attr, slst1, slvlst, selst, slst2, l) -> text "Asm" ++ (pParens @ pCommaSep) [
-+	self#pAttrs () attr ;
-+	(pList  @ map pQuoted) slst1 ;
-+	pList (map (pPair @ pDouble pQuoted (self#pLval ())) slvlst) ;
-+	pList (map (pPair @ pDouble pQuoted (self#pExp ())) selst) ;
-+	(pList  @ map pQuoted) slst2 ;
-+	self#pp_location l]
-+
-+  (* a statement itself is just a record of info about the statement
-+     the different kinds of statements can be found at pStmtKind *) 
-+  method pStmt () (s:stmt) : doc = if !E.verboseFlag then trace "pStmt" ;
-+    self#pp_stmtinfo s
-+  method dStmt (out:out_channel) (i:int) (s:stmt) : unit = fprint out i (self#pStmt () s)
-+
-+  (* a block is just a record of info about the block of interest.
-+     the real block is a stmtkind (see pStmtKind) *)
-+  method dBlock (out:out_channel) (i:int) (b:block) : unit = fprint out i (self#pBlock () b)
-+  method pBlock () (b:block) : doc = if !E.verboseFlag then trace "pBlock" ;
-+    self#pp_blockinfo b
-+
-+  (*** GLOBALS ***)
-+  method pGlobal () (g:global) : doc = if !E.verboseFlag then trace "pGlobal" ;      (* global (vars, types, etc.) *)
-+    match g with 
-+    | GType        (typ , l) -> text "GlobalType" ++ (pParens @ pCommaSep) [ self#pp_typeinfo typ ; self#pp_location l ]
-+    | GCompTag     (comp, l) -> text "GlobalCompTag" ++ (pParens @ pCommaSep) [ self#pp_compinfo comp ; self#pp_location l ]
-+    | GCompTagDecl (comp, l) -> text "GlobalCompTagDecl" ++ (pParens @ pCommaSep) [ self#pp_compinfo comp ; self#pp_location l ]
-+    | GEnumTag     (enum, l) -> text "GlobalEnumTag" ++ (pParens @ pCommaSep) [ self#pp_enuminfo enum ; self#pp_location l ]
-+    | GEnumTagDecl (enum, l) -> text "GlobalEnumTagDecl" ++ (pParens @ pCommaSep) [ self#pp_enuminfo enum ; self#pp_location l ]
-+    | GVarDecl     (vinf, l) -> text "GlobalVarDecl" ++ (pParens @ pCommaSep) [ self#pp_varinfo vinf ; self#pp_location l ]
-+    | GVar   (vinf, iinf, l) -> text "GlobalVar" ++ (pParens @ pCommaSep) [ self#pp_varinfo vinf ; self#pp_initinfo iinf ; self#pp_location l ]
-+    | GFun         (fdec, l) -> text "GlobalFun" ++ (pParens @ pCommaSep) [ self#pp_fundec fdec ; self#pp_location l ]
-+    | GAsm         (str , l) -> text "GlobalAsm"  ++ (pParens @ pCommaSep) [ pQuoted str ; self#pp_location l ]
-+    | GPragma      (attr, l) -> text "GlobalPragma" ++ (pParens @ pCommaSep) [ (fun (doc1, bool1) -> doc1) (self#pAttr attr)
-+                                                        ; self#pp_location l
-+                                        ]
-+    | GText str -> text "GlobalText" ++ pParens( pQuoted str)
-+  method dGlobal (out:out_channel) (g:global) : unit = fprint out 80 (self#pGlobal () g)
-+
-+  (* a fielddecl is just a record containing info about the decl *)
-+  method pFieldDecl () : fieldinfo -> doc = if !E.verboseFlag then trace "pFieldDecl" ;
-+    self#pp_fieldinfo
-+
-+  (*** TYPES ***)
-+  method pType (nameOpt: doc option) (* Whether we are declaring a name or 
-+                                      * we are just printing a type *)
-+               () (t:typ) =  if !E.verboseFlag then trace "pType" ;     (* use of some type *)
-+    match t with
-+    | TVoid  attr         -> text "TVoid" ++ pParens( self#pAttrs () attr)
-+    | TInt   (ikin, attr) -> text "TInt" ++ (pParens @ pCommaSep) [ self#pp_ikind ikin ; self#pAttrs () attr ]
-+    | TFloat (fkin, attr) -> text "TFloat" ++ (pParens @ pCommaSep) [ self#pp_fkind fkin ; self#pAttrs () attr ]
-+    | TPtr   (t   , attr) -> text "TPtr" ++ (pParens @ pCommaSep) [ self#pType None () t ; self#pAttrs () attr ]
-+    | TArray (t, e, attr) -> text "TArray" ++ (pParens @ pCommaSep) [ self#pType None () t ;
-+	pOption (self#pExp ()) e ; self#pAttrs () attr ]
-+    | TFun (t, olst, b, attr) -> text "TFun" ++ (pParens @ pCommaSep) [ 
-+        self#pType None () t ;
-+	pOption (pList @ (map ( pTriplet
-+                              @ (pTriple (pQuoted) (self#pType None ()) (self#pAttrs ()))
-+                              )     
-+                         )
-+                )
-+                olst ;
-+	pBool b ;
-+	self#pAttrs () attr]
-+    | TNamed (tinfo, attr) -> text "TNamed" ++ (pParens @ pCommaSep) [ self#pp_typeinfo tinfo ; self#pAttrs () attr ]
-+    | TComp  (cinfo, attr) -> text "TComp" ++ (pParens @ pCommaSep) [ (text @ string_of_int) cinfo.ckey ;
-+                                                           self#pAttrs () attr]
-+    | TEnum  (einfo, attr) -> text "TEnum" ++ (pParens @ pCommaSep) [ self#pp_enuminfo einfo ; self#pAttrs () attr ]
-+    | TBuiltin_va_list (attr) -> text "TBuiltin_va_list" ++ pParens( self#pAttrs () attr)
-+  
-+  (*** ATTRIBUTES ***)
-+  method pAttr (Attr(an, args) : attribute) : (doc * bool) = if !E.verboseFlag then trace "pAttr" ;
-+    ( text "Attr" ++ (pParens @ pCommaSep) [ pQuoted an ; pList (map (self#pAttrParam ()) args) ]
-+    , false
-+    )
-+
-+  method pAttrParam () (p:attrparam) : doc = if !E.verboseFlag then trace "pAttrParam" ;
-+    match p with
-+    | AInt      (i)               -> text "AInt" ++ pParens( pQuoted (string_of_int i))
-+    | AStr      (s)               -> text "AStr" ++ pParens( pQuoted s)
-+    | ACons     (s, args)         -> text "ACons" ++ (pParens @ pCommaSep) [ pQuoted s ; pList (map (self#pAttrParam ()) args) ]
-+    | ASizeOf   (t)               -> text "ASizeOf" ++ pParens( self#pType None () t)
-+    | ASizeOfE  (arg)             -> text "ASizeOfE" ++ pParens( self#pAttrParam () arg)
-+    | ASizeOfS  (tsig)            -> text "ASizeOfS" ++ pParens( self#pp_typsig tsig)
-+    | AAlignOf  (t)               -> text "AAlignOf" ++ pParens( self#pType None () t)
-+    | AAlignOfE (arg)             -> text "AAlignOfE" ++ pParens( self#pAttrParam () arg)
-+    | AAlignOfS (tsig)            -> text "AAlignOfS" ++ pParens( self#pp_typsig tsig)
-+    | AUnOp     (uop, arg)        -> text "AUnOp" ++ (pParens @ pCommaSep) [ self#pp_unop uop ; self#pAttrParam () arg ]
-+    | ABinOp    (bop, arg1, arg2) -> text "ABinOp" ++ (pParens @ pCommaSep) [ self#pp_binop bop 
-+                                                                ; self#pAttrParam () arg1
-+                                                                ; self#pAttrParam () arg2 ]
-+    | ADot      (arg, s)          -> text "ADot" ++ (pParens @ pCommaSep) [ self#pAttrParam () arg ; pQuoted s]
-+
-+  method pAttrs () (attr:attributes) : doc = if !E.verboseFlag then trace "pAttrs" ;
-+    text "Attributes" ++ pParens( 
-+               pList (map (fst @ self#pAttr) attr)
-+              )
-+  
-+  (*** LABELS ***)
-+  method pLabel () (l:label) : doc = if !E.verboseFlag then trace "pLabel" ;
-+    match l with
-+    | Label   (s,l,b) -> text "Label" ++ (pParens @ pCommaSep) [
-+	pQuoted s ;
-+	self#pp_location l ;
-+	pBool b ]
-+    | Case    (e,l)   -> text "Case" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pp_location l ]
-+    | Default (l)     -> text "Default" ++ pParens( self#pp_location l)
-+
-+  (*** printing out locations as line directives is not necessary
-+       because we are printing the tree structure and locations are
-+       present everywhere ***)
-+  method pLineDirective : ?forcefile:bool -> location -> doc = fun ?forcefile _ -> nil
-+
-+  (*** STATEMENT KINDS ***)
-+  method pStmtKind s () (sk:stmtkind) : doc = if !E.verboseFlag then trace "pStmtKind" ;
-+    match sk with
-+    | Instr      (ilst)          -> text "Instr" ++ pParens( pList (map (self#pInstr ()) ilst))
-+    | Return     (oe, l)         -> text "Return" ++ (pParens @ pCommaSep) [ pOption (self#pExp ()) oe ; self#pp_location l ]
-+    | Goto       (stmtref, l)    -> text "Goto" ++ (pParens @ pCommaSep) [ self#pStmt () !stmtref ; self#pp_location l ]
-+    | Break      (l)             -> text "Break" ++ pParens( self#pp_location l)
-+    | Continue   (l)             -> text "Continue" ++ pParens( self#pp_location l)
-+    | If         (e, b1, b2, l)  -> text "If" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pBlock () b1 ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+    | Switch     (e,b,stlst,l)   -> text "Switch" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pBlock () b ;
-+	pList (map (self#pStmt ()) stlst) ;
-+	self#pp_location l ]
-+    | Loop       (b,l,os1, os2)  -> text "Loop" ++ (pParens @ pCommaSep) [
-+	self#pBlock () b ;
-+	self#pp_location l ;
-+	pOption (self#pStmt ()) os1 ;
-+	pOption (self#pStmt ()) os2 ]
-+    | Block      (b)             -> text "Block" ++ pParens( self#pBlock () b)
-+    | TryFinally (b1,b2,l)       -> text "TryFinally" ++ (pParens @ pCommaSep) [ 
-+	self#pBlock () b1 ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+    | TryExcept  (b1, pr, b2, l) -> text "TryExcept" ++ (pParens @ pCommaSep) [ 
-+	self#pBlock () b1 ;
-+	(  pPair
-+         @ pDouble (pList @ map (self#pInstr ())) 
-+                   (self#pExp ())
-+        ) pr ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+
-+  (*** EXPRESSIONS ***)
-+
-+  method pExp () (e:exp) : doc = if !E.verboseFlag then trace "pExp" ;
-+    match e with
-+    | Const     (c)              -> text "Constant" ++ pParens( self#pp_constant c)
-+    | Lval      (lh,off)         -> text "Lvalue" ++ (pParens @ pCommaSep)  [self#pp_lhost lh ; self#pOffset nil off ]
-+    | SizeOf    (t)              -> text "SizeOfType" ++ pParens( self#pType None () t)
-+    | SizeOfE   (e)              -> text "SizeOfExp" ++ pParens( self#pExp () e)
-+    | SizeOfStr (s)              -> text "SizeOfString" ++ pParens( pQuoted s)
-+    | AlignOf   (t)              -> text "AlignOfType" ++ pParens( self#pType None () t)
-+    | AlignOfE  (e)              -> text "AlignOfExp" ++ pParens( self#pExp () e)
-+    | UnOp      (uop, e, t)      -> text "UnOp" ++ (pParens @ pCommaSep) [ 
-+					self#pp_unop uop ; 
-+                                        self#pExp () e ; 
-+	                                self#pType None () t ]
-+    | BinOp     (bop, e1, e2, t) -> text "BinOp" ++ (pParens @ pCommaSep) [ 
-+                                        self#pp_binop bop ;
-+                                        self#pExp () e1 ;
-+                                        self#pExp () e2 ;
-+                                        self#pType None () t ]
-+    | CastE     (t,e)            -> text "Cast" ++ (pParens @ pCommaSep) [ self#pType None () t ; self#pExp () e]
-+    | AddrOf    (lv)             -> text "AddressOf" ++ pParens( self#pLval () lv)
-+    | StartOf   (lv)             -> text "StartOf" ++ pParens( self#pLval () lv)
-+
-+  (*** INITIALIZERS ***)
-+  method pInit () (i:init) : doc = if !E.verboseFlag then trace "pInit" ;
-+    match i with
-+    | SingleInit   (e)        -> text "SingleInit" ++ pParens( self#pExp () e)
-+    | CompoundInit (t, oilst) -> text "CompoundInit" ++ (pParens @ pCommaSep) [ self#pType None () t ;
-+				    pList (map (  pPair
-+			                        @ pDouble (self#pOffset nil) (self#pInit ())
-+			                       ) 
-+			                       oilst
-+			                  ) ]
-+  method dInit (out:out_channel) (i:int) (init1:init) : unit = fprint out i (self#pInit () init1)
-+
-+  (*** auxiliary methods ***)
-+  (* Mart: hmmmm *)
-+  method private pp_storage (s:storage) : doc =
-+    let tok = match s with
-+	      | NoStorage -> "NoStorage"
-+	      | Static    -> "Static"
-+	      | Register  -> "Register"
-+	      | Extern	  -> "Extern"
-+    in pQuoted ("Storage" ^ tok)
-+
-+  method private pp_typeinfo (tinfo:typeinfo) : doc = if !E.verboseFlag then trace "pp_typeinfo" ;
-+    text "Typeinfo" ++ (pParens @ pCommaSep) [   
-+    pQuoted tinfo.tname ;
-+    self#pType None () tinfo.ttype ;
-+    pBool tinfo.treferenced ]
-+
-+  method private pp_fieldinfo (finfo:fieldinfo) : doc = if !E.verboseFlag then trace "pp_fieldinfo" ;
-+    text "Fieldinfo" ++ (pParens @ pCommaSep) [ 
-+    pQuoted finfo.fname ;
-+    self#pType None () finfo.ftype ;
-+    pOption (pQuoted @ string_of_int) finfo.fbitfield ;
-+    self#pAttrs () finfo.fattr ;
-+    self#pp_location finfo.floc ]
-+
-+  method private pp_compinfo (cinfo:compinfo) : doc = if !E.verboseFlag then trace "pp_compinfo" ;
-+    text "Compinfo" ++ (pParens @ pCommaSep) [ 
-+    pBool cinfo.cstruct ;
-+    pQuoted cinfo.cname ;
-+    text (string_of_int cinfo.ckey) ;
-+    pList (map (self#pFieldDecl ()) cinfo.cfields) ;
-+    self#pAttrs () cinfo.cattr ;
-+    pBool cinfo.cdefined ;
-+    pBool cinfo.creferenced ]
-+
-+  method private pp_enuminfo (einfo:enuminfo) : doc = if !E.verboseFlag then trace "pp_enuminfo" ;
-+    text "Enuminfo" ++ (pParens @ pCommaSep) [
-+    pQuoted einfo.ename ;
-+    pList (map (  pTriplet
-+                @ (pTriple pQuoted (self#pExp ()) self#pp_location)
-+               )
-+               einfo.eitems) ;
-+    self#pAttrs () einfo.eattr ;
-+    pBool einfo.ereferenced ]
-+
-+  method private pp_location (loc:location) : doc = if !E.verboseFlag then trace "pp_location" ;
-+    text "Location" ++ (pParens @ pCommaSep) [
-+    text (string_of_int loc.line) ;
-+    pQuoted loc.file ;
-+    text (string_of_int loc.byte) ]
-+
-+  method private pp_varinfo (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pp_varinfo" ;
-+    text "Varinfo" ++ (pParens @ pCommaSep) [
-+    pQuoted vinfo.vname ;
-+    self#pType None () vinfo.vtype ;
-+    self#pAttrs () vinfo.vattr ;
-+    self#pp_storage vinfo.vstorage ;
-+    pBool vinfo.vglob ;
-+    pBool vinfo.vinline ;
-+    self#pp_location vinfo.vdecl ;
-+    text (string_of_int vinfo.vid) ;
-+    pBool vinfo.vaddrof ;
-+    pBool vinfo.vreferenced ]
-+
-+  method private pp_initinfo (iinfo:initinfo) : doc = if !E.verboseFlag then trace "pp_initinfo" ;
-+    text "Initinfo" ++ pParens( 
-+    pOption (self#pInit ()) iinfo.init)
-+
-+  method private pp_fundec (fdec:fundec) : doc = if !E.verboseFlag then trace "pp_fundec" ;
-+    text "Fundec" ++ (pParens @ pCommaSep) [
-+    self#pp_varinfo fdec.svar ;
-+    pList (map self#pp_varinfo fdec.sformals) ;
-+    pList (map self#pp_varinfo fdec.slocals) ;
-+    text (string_of_int fdec.smaxid) ;
-+    self#pBlock () fdec.sbody ;
-+    pOption (pSpParens @ text @ string_of_int) fdec.smaxstmtid ;
-+    pList (map (self#pStmt ()) fdec.sallstmts) ]
-+
-+  method private pp_ikind (ikin:ikind) : doc =
-+    let tok = match ikin with
-+              | IChar  -> "IChar"
-+	      | ISChar -> "ISChar"
-+	      | IUChar -> "IUChar"
-+	      | IInt   -> "IInt"
-+	      | IUInt  -> "IUInt"
-+	      | IShort -> "IShort"
-+	      | IUShort -> "IUShort"
-+	      | ILong  -> "ILong"
-+	      | IULong -> "IULong"
-+	      | ILongLong -> "ILongLong"
-+	      | IULongLong -> "IULongLong"
-+    in  pQuoted ("Ikind" ^ tok)
-+
-+  method private pp_fkind (fkin:fkind) : doc =
-+    let tok = match fkin with
-+	      | FFloat -> "FFloat"
-+	      | FDouble -> "FDouble"
-+	      | FLongDouble -> "FLongDouble"
-+    in pQuoted ("Fkind" ^ tok)
-+
-+  method private pp_typsig (tsig:typsig) : doc = if !E.verboseFlag then trace "pp_typsig" ;
-+    match tsig with
-+    | TSArray (tsig2, oe, attr)         -> text "TSArray" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      pOption pInt64 oe ;
-+					      self#pAttrs () attr ]
-+    | TSPtr   (tsig2, attr)             -> text "TSPtr" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      self#pAttrs () attr ]	
-+    | TSComp  (b, s, attr)              -> text "TSComp" ++ (pParens @ pCommaSep) [
-+					      pBool b ;
-+					      pQuoted s ;
-+					      self#pAttrs () attr ]
-+    | TSFun   (tsig2, tsiglst, b, attr) -> text "TSFun" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      pList (map self#pp_typsig tsiglst) ;
-+					      pBool b ;
-+					      self#pAttrs () attr ]
-+    | TSEnum  (s, attr)                 -> text "TSEnum" ++ (pParens @ pCommaSep) [
-+					      pQuoted s ;
-+					      self#pAttrs () attr ]
-+    | TSBase  (t)                       -> text "TSBase" ++ pParens( self#pType None () t)
-+     
-+
-+  method private pp_unop (uop:unop) : doc =
-+    let tok = match uop with
-+	      | Neg -> "Neg"
-+	      | BNot -> "BNot"
-+	      | LNot -> "LNot"
-+    in pQuoted ("UnOp" ^ tok)
-+
-+  method private pp_binop (bop:binop) : doc = 
-+    let tok = match bop with
-+              | PlusA -> "PlusA"
-+	      | PlusPI -> "PlusPI"
-+	      | IndexPI -> "IndexPI"
-+	      | MinusA -> "MinusA"
-+	      | MinusPI -> "MinusPI"
-+	      | MinusPP -> "MinusPP"
-+	      | Mult -> "Mult"
-+	      | Div -> "Div"
-+	      | Mod -> "Mod"
-+	      | Shiftlt -> "Shiftlt"
-+	      | Shiftrt -> "Shiftrt"
-+	      | Lt -> "Lt"
-+	      | Gt -> "Gt"
-+	      | Le -> "Le"
-+	      | Ge -> "Ge"
-+	      | Eq -> "Eq"
-+	      | Ne -> "Ne"
-+	      | BAnd -> "BAnd"
-+	      | BXor -> "BXor"
-+	      | BOr -> "BOr"
-+	      | LAnd -> "LAnd"
-+	      | LOr -> "LOr"
-+    in pQuoted ("BinOp" ^ tok )
-+
-+  method private pp_constant (c:constant) : doc = if !E.verboseFlag then trace "pp_constant" ;
-+    match c with
-+    | CInt64 (i, ikin, os) -> text "CInt64" ++ (pParens @ pCommaSep) [  
-+                                  pQuoted (Int64.to_string i)  ;
-+				  self#pp_ikind ikin ;
-+				  pOption pQuoted os ]
-+    | CStr   (s)           -> text "CStr" ++ pParens( pQuoted s)
-+    | CWStr  (ilist)       -> text "CWStr" ++ pParens( pList (map ( text @ Int64.to_string) ilist))
-+    | CChr   (c)           -> text "CChr" ++ pParens( text "\"" ++ text (Char.escaped c) ++ text "\"")
-+    | CReal  (f, fkin, os) -> text "CReal" ++ (pParens @ pCommaSep) [  pQuoted (sprintf "%f0" f) ;
-+				  self#pp_fkind fkin ;
-+				  pOption pQuoted os ]
-+
-+  method private pp_lhost (lh:lhost) : doc = if !E.verboseFlag then trace "pp_lhost" ;
-+    match lh with
-+    | Var (vinfo) -> text "Var" ++ pParens( self#pp_varinfo vinfo)
-+    | Mem (e)     -> text "Mem" ++ pParens( self#pExp () e)
-+
-+  method private pp_blockinfo (b:block) : doc = if !E.verboseFlag then trace "pp_blockinfo" ;
-+    text "Block" ++ (pParens @ pCommaSep) [
-+    self#pAttrs () b.battrs ;
-+    pList (map (self#pStmt ()) b.bstmts) ]
-+
-+  method private pp_stmtinfo (sinfo:stmt) : doc = if !E.verboseFlag then trace "pp_stmtinfo" ;
-+    text "Stmt" ++ (pParens @ pCommaSep) [
-+    pList (map (self#pLabel ()) sinfo.labels) ;
-+    self#pStmtKind invalidStmt () sinfo.skind ;
-+    text (string_of_int sinfo.sid) ;
-+    pList (map self#pp_stmtinfo sinfo.succs) ;
-+    pList (map self#pp_stmtinfo sinfo.preds) ]
-+end
-+
-+let ppFile (f:file) (pp:cilPrinter) : doc = if !E.verboseFlag then trace "ppFile" ;
-+  text "File" ++ (pParens @ pCommaSep) [ 
-+  pQuoted f.fileName ;
-+  pList (map (pp#pGlobal ()) f.globals) ]
-+
-+(* we need a different more flexible mapGlobals
-+   we only visit globals and not global init;
-+   use mapGlobinits *)
-+let mapGlobals2 (fl: file) 
-+                (doone: global -> 'a) : 'a list = 
-+  List.map doone fl.globals
-+
-+(* We redefine dumpFile because we don't want a header in our
-+   file telling us it was generated with CIL blabla *)
-+let dumpFile (pp: cilPrinter) (out : out_channel) file =
-+  printDepth := 99999;  
-+  Pretty.fastMode := true;
-+  if !E.verboseFlag then ignore (E.log "printing file %s\n" file.fileName);
-+  let file_doc = ppFile file pp in
-+  fprint out 80 file_doc;
-+  flush out
-+
-+let feature : featureDescr =
-+  { fd_name = "printaterm";
-+    fd_enabled = ref false;
-+    fd_description = "printing the current CIL AST to an ATerm";
-+    fd_extraopt = [("--atermfile", Arg.String (fun s -> outputfilename := s), "=<filename>: writes the ATerm to <filename>");];
-+    fd_doit = (function (f: file) ->        
-+        let channel = open_out !outputfilename in 
-+        let printer = new atermPrinter
-+	in dumpFile printer channel f
-+         ; close_out channel
-+    );
-+    fd_post_check = false;
-+  }
-diff -urN cil.orig/src/maincil.ml cil/src/maincil.ml
---- cil.orig/src/maincil.ml	2005-06-01 14:37:13.000000000 +0200
-+++ cil/src/maincil.ml	2005-11-21 10:45:34.000000000 +0100
-@@ -105,6 +105,7 @@
-     Simplemem.feature;
-     Simplify.feature;
-     Dataslicing.feature;
-+    Atermprinter.feature;
-   ] 
-   @ Feature_config.features 
- 
diff --git a/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.3.nix b/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.3.nix
deleted file mode 100644
index 9df14593019..00000000000
--- a/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.3.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{ stdenv, fetchurl, ocaml, perl }:
-
-stdenv.mkDerivation {
-  name    = "cil-aterm-1.3.3";
-  src     = fetchurl {
-		url = http://manju.cs.berkeley.edu/cil/distrib/cil-1.3.3.tar.gz;
-                md5 = "dafd350c154990728efb35a7073ca81a";
-            };
-  patches = [./atermprinter.patch];
-  buildInputs = [ ocaml perl ];
-  inherit ocaml perl;
-}  
diff --git a/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.4.patch b/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.4.patch
deleted file mode 100644
index 13fecc80171..00000000000
--- a/pkgs/development/libraries/cil-aterm/cil-aterm-1.3.4.patch
+++ /dev/null
@@ -1,593 +0,0 @@
-diff -urN cil-old/bin/CilConfig.pm.in cil-new/bin/CilConfig.pm.in
---- cil-old/bin/CilConfig.pm.in	2005-11-22 06:34:41.000000000 +0100
-+++ cil-new/bin/CilConfig.pm.in	2006-09-13 13:52:44.000000000 +0200
-@@ -1,7 +1,7 @@
- 
--use lib "@CILHOME@/lib"; # The libraries are in the lib directory
-+use lib "@prefix@/lib"; # The libraries are in the lib directory
- $::archos    = "@ARCHOS@";
- $::cc        = "@CC@";
--$::cilhome   = "@CILHOME@";
-+$::cilhome   = "@prefix@";
- $::default_mode = "@DEFAULT_CIL_MODE@";
- 
-diff -urN cil-old/Makefile.cil.in cil-new/Makefile.cil.in
---- cil-old/Makefile.cil.in	2005-11-22 06:34:41.000000000 +0100
-+++ cil-new/Makefile.cil.in	2006-09-13 13:52:09.000000000 +0200
-@@ -78,6 +78,7 @@
-               canonicalize heap oneret partial simplemem simplify \
- 	      dataslicing \
-               testcil \
-+              atermprinter \
- 	      $(CILLY_FEATURES) \
- 	      feature_config
- # ww: we don't want "maincil" in an external cil library (cil.cma),
-@@ -536,6 +537,8 @@
- 
- prefix = @prefix@
- exec_prefix = @exec_prefix@
-+bindir = @prefix@/bin
-+objdir = @prefix@/$(OBJDIR)
- libdir = @libdir@
- pkglibdir = $(libdir)/cil
- datadir = @datadir@
-@@ -554,6 +557,11 @@
- 	$(INSTALL_DATA) $(install_lib) $(DESTDIR)$(pkglibdir)
- 	$(INSTALL) -d $(DESTDIR)$(pkgdatadir)
- 	$(INSTALL_DATA) $(addprefix lib/, $(filter %.pm, $(DISTRIB_LIB))) $(DESTDIR)$(pkgdatadir)
-+	$(INSTALL) -d $(bindir)
-+	$(INSTALL) -d $(objdir)
-+	$(INSTALL) bin/* $(bindir)
-+	$(INSTALL_DATA) lib/* $(bindir)
-+	$(INSTALL) $(OBJDIR)/*.exe $(objdir)
- 
- cil.spec: cil.spec.in
- 	./config.status $@
-diff -urN cil-old/ocamlutil/Makefile.ocaml cil-new/ocamlutil/Makefile.ocaml
---- cil-old/ocamlutil/Makefile.ocaml	2005-11-22 06:34:41.000000000 +0100
-+++ cil-new/ocamlutil/Makefile.ocaml	2006-09-13 13:52:09.000000000 +0200
-@@ -135,6 +135,7 @@
- 
- CAMLFLAGS    =$(OPT_FLAGS) -I $(OBJDIR)
- 
-+
- # sm: two styles for echoing compilation progress:
- #   style 1, by George:
- #     - print English descriptions of what's happening
-@@ -152,20 +153,12 @@
- #   $(AT)          - put this before shell commands which are to be executed,
- #                    and also printed in style 2
- #   $(ECHO)        - use in place of '@' for things not printed in either style
--ifdef ECHOSTYLE_SCOTT
--  # 'true' silently consumes its arguments, whereas 'echo' prints them
--  NARRATIVE   := true           
--  COMMAND     := echo
--  AT          := 
--  ECHO        := @
--else
--  NARRATIVE   := echo
--  COMMAND     := true
--  # change these next two definitions to <empty> to echo everything,
--  # or leave as @ to suppress echoing
--  AT          := @
--  ECHO        := @
--endif
-+ 
-+# 'true' silently consumes its arguments, whereas 'echo' prints them
-+NARRATIVE   := true           
-+COMMAND     := echo
-+AT          := 
-+ECHO        := @
- 
- ifdef PREPROC
-   COMPILEFLAGS += -pp "$(PREPROC)$"
-@@ -361,4 +354,4 @@
- endif
- 
- listmodules: 
--	@echo $(MODULES)
-\ No newline at end of file
-+	@echo $(MODULES)
-diff -urN cil-old/src/ext/atermprinter.ml cil-new/src/ext/atermprinter.ml
---- cil-old/src/ext/atermprinter.ml	1970-01-01 01:00:00.000000000 +0100
-+++ cil-new/src/ext/atermprinter.ml	2006-09-13 13:52:09.000000000 +0200
-@@ -0,0 +1,488 @@
-+open Cil
-+open Pretty
-+open List
-+open String
-+open Printf
-+module S = String 
-+module E = Errormsg
-+module H = Hashtbl
-+module IH = Inthash
-+
-+let outputfilename = ref "cil.aterm"
-+let trace p = eprintf "%s" (p ^ "\n") ; flush stderr
-+let invalidStmt = mkStmt (Instr [])
-+let id = fun x -> x 
-+let compose f g x = (f (g x))
-+let (@) = compose
-+let pSpace            = text " "
-+let foldl1 op ls      = match ls with
-+			| (x::xs) -> fold_left op x xs
-+                        | _       -> raise (Invalid_argument "foldl1 should not take an empty list")
-+let pPacked d l r     = l ++ d ++ r
-+let pParens d         = pPacked d (text "(") (text ")")
-+let pBraced d         = pPacked d (text "{") (text "}")
-+let pSquared d        = pPacked d (text "[") (text "]")
-+let pSpaced d         = pPacked d pSpace pSpace
-+let pBool b           = (pSpaced @ text @ S.capitalize @ string_of_bool) b
-+let pInt64 i          = text (Int64.to_string i)
-+let pSeqSep sep xs    = match xs with
-+			| [] -> nil
-+                        | _  -> foldl1 (pPacked sep) xs
-+let pCommaSep xs      = pSeqSep (text ",") xs
-+let pPair (a,b)       = (pSpaced @ pParens @ pCommaSep) [a;b]
-+let pTriplet (a,b,c)  = (pSpaced @ pParens @ pCommaSep) [a;b;c]
-+let pSemiColSep xs    = pSeqSep (text ";") xs
-+let pTriple f g h (a,b,c) = (f a, g b, h c)
-+let pDouble f g (a,b) = (f a, g b)
-+let pOption p m  = match m with
-+	         | None   -> text "None()"
-+                 | Some v -> text "Some" ++ pParens( p v )
-+let pSpParens = pSpaced @ pParens
-+let pQuoted str = pPacked (text(escaped str)) (text "\"") (text "\"")
-+let pList   = pSpaced @ pSquared @ pCommaSep
-+let pRecord = pSpaced @ pBraced  @ pCommaSep
-+
-+class atermPrinter : cilPrinter  = 
-+object (self)
-+  inherit defaultCilPrinterClass
-+
-+  (* printing variable declarations; just store the varinfo *)
-+  method pVDecl () (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pVDecl"
-+                                         ; self#pp_varinfo vinfo
-+  (* printing variable uses; same as declarations; store the varinfo *)
-+  method pVar (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pVar" ;
-+    self#pp_varinfo vinfo
-+
-+  method pLval () ((lh, off):lval) : doc = if !E.verboseFlag then trace "pLvalue" ;
-+    text "Lvalue" ++ (pParens @ pCommaSep) [ self#pp_lhost lh ; self#pOffset nil off ] 
-+
-+  (** we are not using the first argument which represents the base from which we are
-+      offsetting, because we just want to generate a tree view of the CIL tree. For a tree view
-+      this base case is not necessary **)
-+  method pOffset (d:doc) (o:offset) : doc = if !E.verboseFlag then trace "pOffset" ;
-+    match o with
-+    | NoOffset           -> text "Offset_NoOffset() "
-+    | Field (finfo, off) -> text "Offset_Field" ++ (pParens @ pCommaSep) [ (self#pFieldDecl ()) finfo ; self#pOffset nil off ]
-+    | Index (e, off)     -> text "Offset_Index" ++ (pParens @ pCommaSep) [ self#pExp () e ; self#pOffset nil off ]
-+  
-+  (*** INSTRUCTIONS ***)
-+  method pInstr () (i:instr) : doc = if !E.verboseFlag then trace "pInstr" ;
-+    match i with
-+    | Set (lv,e,l) -> text "Set" ++ (pParens @ pCommaSep) [ 
-+	self#pLval () lv ;
-+	self#pExp () e ;
-+	self#pp_location l ]
-+    | Call (olv,e, elst, l) -> text "Call" ++ (pParens @ pCommaSep) [
-+	pOption (self#pLval ()) olv ;
-+	self#pExp () e ;
-+	pList (map (self#pExp ()) elst) ;
-+	self#pp_location l]
-+    | Asm (attr, slst1, slvlst, selst, slst2, l) -> text "Asm" ++ (pParens @ pCommaSep) [
-+	self#pAttrs () attr ;
-+	(pList  @ map pQuoted) slst1 ;
-+	pList (map (pPair @ pDouble pQuoted (self#pLval ())) slvlst) ;
-+	pList (map (pPair @ pDouble pQuoted (self#pExp ())) selst) ;
-+	(pList  @ map pQuoted) slst2 ;
-+	self#pp_location l]
-+
-+  (* a statement itself is just a record of info about the statement
-+     the different kinds of statements can be found at pStmtKind *) 
-+  method pStmt () (s:stmt) : doc = if !E.verboseFlag then trace "pStmt" ;
-+    self#pp_stmtinfo s
-+  method dStmt (out:out_channel) (i:int) (s:stmt) : unit = fprint out i (self#pStmt () s)
-+
-+  (* a block is just a record of info about the block of interest.
-+     the real block is a stmtkind (see pStmtKind) *)
-+  method dBlock (out:out_channel) (i:int) (b:block) : unit = fprint out i (self#pBlock () b)
-+  method pBlock () (b:block) : doc = if !E.verboseFlag then trace "pBlock" ;
-+    self#pp_blockinfo b
-+
-+  (*** GLOBALS ***)
-+  method pGlobal () (g:global) : doc = if !E.verboseFlag then trace "pGlobal" ;      (* global (vars, types, etc.) *)
-+    match g with 
-+    | GType        (typ , l) -> text "GlobalType" ++ (pParens @ pCommaSep) [ self#pp_typeinfo typ ; self#pp_location l ]
-+    | GCompTag     (comp, l) -> text "GlobalCompTag" ++ (pParens @ pCommaSep) [ self#pp_compinfo comp ; self#pp_location l ]
-+    | GCompTagDecl (comp, l) -> text "GlobalCompTagDecl" ++ (pParens @ pCommaSep) [ self#pp_compinfo comp ; self#pp_location l ]
-+    | GEnumTag     (enum, l) -> text "GlobalEnumTag" ++ (pParens @ pCommaSep) [ self#pp_enuminfo enum ; self#pp_location l ]
-+    | GEnumTagDecl (enum, l) -> text "GlobalEnumTagDecl" ++ (pParens @ pCommaSep) [ self#pp_enuminfo enum ; self#pp_location l ]
-+    | GVarDecl     (vinf, l) -> text "GlobalVarDecl" ++ (pParens @ pCommaSep) [ self#pp_varinfo vinf ; self#pp_location l ]
-+    | GVar   (vinf, iinf, l) -> text "GlobalVar" ++ (pParens @ pCommaSep) [ self#pp_varinfo vinf ; self#pp_initinfo iinf ; self#pp_location l ]
-+    | GFun         (fdec, l) -> text "GlobalFun" ++ (pParens @ pCommaSep) [ self#pp_fundec fdec ; self#pp_location l ]
-+    | GAsm         (str , l) -> text "GlobalAsm"  ++ (pParens @ pCommaSep) [ pQuoted str ; self#pp_location l ]
-+    | GPragma      (attr, l) -> text "GlobalPragma" ++ (pParens @ pCommaSep) [ (fun (doc1, bool1) -> doc1) (self#pAttr attr)
-+                                                        ; self#pp_location l
-+                                        ]
-+    | GText str -> text "GlobalText" ++ pParens( pQuoted str)
-+  method dGlobal (out:out_channel) (g:global) : unit = fprint out 80 (self#pGlobal () g)
-+
-+  (* a fielddecl is just a record containing info about the decl *)
-+  method pFieldDecl () : fieldinfo -> doc = if !E.verboseFlag then trace "pFieldDecl" ;
-+    self#pp_fieldinfo
-+
-+  (*** TYPES ***)
-+  method pType (nameOpt: doc option) (* Whether we are declaring a name or 
-+                                      * we are just printing a type *)
-+               () (t:typ) =  if !E.verboseFlag then trace "pType" ;     (* use of some type *)
-+    match t with
-+    | TVoid  attr         -> text "TVoid" ++ pParens( self#pAttrs () attr)
-+    | TInt   (ikin, attr) -> text "TInt" ++ (pParens @ pCommaSep) [ self#pp_ikind ikin ; self#pAttrs () attr ]
-+    | TFloat (fkin, attr) -> text "TFloat" ++ (pParens @ pCommaSep) [ self#pp_fkind fkin ; self#pAttrs () attr ]
-+    | TPtr   (t   , attr) -> text "TPtr" ++ (pParens @ pCommaSep) [ self#pType None () t ; self#pAttrs () attr ]
-+    | TArray (t, e, attr) -> text "TArray" ++ (pParens @ pCommaSep) [ self#pType None () t ;
-+	pOption (self#pExp ()) e ; self#pAttrs () attr ]
-+    | TFun (t, olst, b, attr) -> text "TFun" ++ (pParens @ pCommaSep) [ 
-+        self#pType None () t ;
-+	pOption (pList @ (map ( pTriplet
-+                              @ (pTriple (pQuoted) (self#pType None ()) (self#pAttrs ()))
-+                              )     
-+                         )
-+                )
-+                olst ;
-+	pBool b ;
-+	self#pAttrs () attr]
-+    | TNamed (tinfo, attr) -> text "TNamed" ++ (pParens @ pCommaSep) [ self#pp_typeinfo tinfo ; self#pAttrs () attr ]
-+    | TComp  (cinfo, attr) -> text "TComp" ++ (pParens @ pCommaSep) [ (text @ string_of_int) cinfo.ckey ;
-+                                                           self#pAttrs () attr]
-+    | TEnum  (einfo, attr) -> text "TEnum" ++ (pParens @ pCommaSep) [ self#pp_enuminfo einfo ; self#pAttrs () attr ]
-+    | TBuiltin_va_list (attr) -> text "TBuiltin_va_list" ++ pParens( self#pAttrs () attr)
-+  
-+  (*** ATTRIBUTES ***)
-+  method pAttr (Attr(an, args) : attribute) : (doc * bool) = if !E.verboseFlag then trace "pAttr" ;
-+    ( text "Attr" ++ (pParens @ pCommaSep) [ pQuoted an ; pList (map (self#pAttrParam ()) args) ]
-+    , false
-+    )
-+
-+  method pAttrParam () (p:attrparam) : doc = if !E.verboseFlag then trace "pAttrParam" ;
-+    match p with
-+    | AInt      (i)               -> text "AInt" ++ pParens( pQuoted (string_of_int i))
-+    | AStr      (s)               -> text "AStr" ++ pParens( pQuoted s)
-+    | ACons     (s, args)         -> text "ACons" ++ (pParens @ pCommaSep) [ pQuoted s ; pList (map (self#pAttrParam ()) args) ]
-+    | ASizeOf   (t)               -> text "ASizeOf" ++ pParens( self#pType None () t)
-+    | ASizeOfE  (arg)             -> text "ASizeOfE" ++ pParens( self#pAttrParam () arg)
-+    | ASizeOfS  (tsig)            -> text "ASizeOfS" ++ pParens( self#pp_typsig tsig)
-+    | AAlignOf  (t)               -> text "AAlignOf" ++ pParens( self#pType None () t)
-+    | AAlignOfE (arg)             -> text "AAlignOfE" ++ pParens( self#pAttrParam () arg)
-+    | AAlignOfS (tsig)            -> text "AAlignOfS" ++ pParens( self#pp_typsig tsig)
-+    | AUnOp     (uop, arg)        -> text "AUnOp" ++ (pParens @ pCommaSep) [ self#pp_unop uop ; self#pAttrParam () arg ]
-+    | ABinOp    (bop, arg1, arg2) -> text "ABinOp" ++ (pParens @ pCommaSep) [ self#pp_binop bop 
-+                                                                ; self#pAttrParam () arg1
-+                                                                ; self#pAttrParam () arg2 ]
-+    | ADot      (arg, s)          -> text "ADot" ++ (pParens @ pCommaSep) [ self#pAttrParam () arg ; pQuoted s]
-+
-+  method pAttrs () (attr:attributes) : doc = if !E.verboseFlag then trace "pAttrs" ;
-+    text "Attributes" ++ pParens( 
-+               pList (map (fst @ self#pAttr) attr)
-+              )
-+  
-+  (*** LABELS ***)
-+  method pLabel () (l:label) : doc = if !E.verboseFlag then trace "pLabel" ;
-+    match l with
-+    | Label   (s,l,b) -> text "Label" ++ (pParens @ pCommaSep) [
-+	pQuoted s ;
-+	self#pp_location l ;
-+	pBool b ]
-+    | Case    (e,l)   -> text "Case" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pp_location l ]
-+    | Default (l)     -> text "Default" ++ pParens( self#pp_location l)
-+
-+  (*** printing out locations as line directives is not necessary
-+       because we are printing the tree structure and locations are
-+       present everywhere ***)
-+  method pLineDirective : ?forcefile:bool -> location -> doc = fun ?forcefile _ -> nil
-+
-+  (*** STATEMENT KINDS ***)
-+  method pStmtKind s () (sk:stmtkind) : doc = if !E.verboseFlag then trace "pStmtKind" ;
-+    match sk with
-+    | Instr      (ilst)          -> text "Instr" ++ pParens( pList (map (self#pInstr ()) ilst))
-+    | Return     (oe, l)         -> text "Return" ++ (pParens @ pCommaSep) [ pOption (self#pExp ()) oe ; self#pp_location l ]
-+    | Goto       (stmtref, l)    -> text "Goto" ++ (pParens @ pCommaSep) [ self#pStmt () !stmtref ; self#pp_location l ]
-+    | Break      (l)             -> text "Break" ++ pParens( self#pp_location l)
-+    | Continue   (l)             -> text "Continue" ++ pParens( self#pp_location l)
-+    | If         (e, b1, b2, l)  -> text "If" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pBlock () b1 ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+    | Switch     (e,b,stlst,l)   -> text "Switch" ++ (pParens @ pCommaSep) [ 
-+	self#pExp () e ;
-+	self#pBlock () b ;
-+	pList (map (self#pStmt ()) stlst) ;
-+	self#pp_location l ]
-+    | Loop       (b,l,os1, os2)  -> text "Loop" ++ (pParens @ pCommaSep) [
-+	self#pBlock () b ;
-+	self#pp_location l ;
-+	pOption (self#pStmt ()) os1 ;
-+	pOption (self#pStmt ()) os2 ]
-+    | Block      (b)             -> text "Block" ++ pParens( self#pBlock () b)
-+    | TryFinally (b1,b2,l)       -> text "TryFinally" ++ (pParens @ pCommaSep) [ 
-+	self#pBlock () b1 ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+    | TryExcept  (b1, pr, b2, l) -> text "TryExcept" ++ (pParens @ pCommaSep) [ 
-+	self#pBlock () b1 ;
-+	(  pPair
-+         @ pDouble (pList @ map (self#pInstr ())) 
-+                   (self#pExp ())
-+        ) pr ;
-+	self#pBlock () b2 ;
-+	self#pp_location l ]
-+
-+  (*** EXPRESSIONS ***)
-+
-+  method pExp () (e:exp) : doc = if !E.verboseFlag then trace "pExp" ;
-+    match e with
-+    | Const     (c)              -> text "Constant" ++ pParens( self#pp_constant c)
-+    | Lval      (lh,off)         -> text "Lvalue" ++ (pParens @ pCommaSep)  [self#pp_lhost lh ; self#pOffset nil off ]
-+    | SizeOf    (t)              -> text "SizeOfType" ++ pParens( self#pType None () t)
-+    | SizeOfE   (e)              -> text "SizeOfExp" ++ pParens( self#pExp () e)
-+    | SizeOfStr (s)              -> text "SizeOfString" ++ pParens( pQuoted s)
-+    | AlignOf   (t)              -> text "AlignOfType" ++ pParens( self#pType None () t)
-+    | AlignOfE  (e)              -> text "AlignOfExp" ++ pParens( self#pExp () e)
-+    | UnOp      (uop, e, t)      -> text "UnOp" ++ (pParens @ pCommaSep) [ 
-+					self#pp_unop uop ; 
-+                                        self#pExp () e ; 
-+	                                self#pType None () t ]
-+    | BinOp     (bop, e1, e2, t) -> text "BinOp" ++ (pParens @ pCommaSep) [ 
-+                                        self#pp_binop bop ;
-+                                        self#pExp () e1 ;
-+                                        self#pExp () e2 ;
-+                                        self#pType None () t ]
-+    | CastE     (t,e)            -> text "Cast" ++ (pParens @ pCommaSep) [ self#pType None () t ; self#pExp () e]
-+    | AddrOf    (lv)             -> text "AddressOf" ++ pParens( self#pLval () lv)
-+    | StartOf   (lv)             -> text "StartOf" ++ pParens( self#pLval () lv)
-+
-+  (*** INITIALIZERS ***)
-+  method pInit () (i:init) : doc = if !E.verboseFlag then trace "pInit" ;
-+    match i with
-+    | SingleInit   (e)        -> text "SingleInit" ++ pParens( self#pExp () e)
-+    | CompoundInit (t, oilst) -> text "CompoundInit" ++ (pParens @ pCommaSep) [ self#pType None () t ;
-+				    pList (map (  pPair
-+			                        @ pDouble (self#pOffset nil) (self#pInit ())
-+			                       ) 
-+			                       oilst
-+			                  ) ]
-+  method dInit (out:out_channel) (i:int) (init1:init) : unit = fprint out i (self#pInit () init1)
-+
-+  (*** auxiliary methods ***)
-+  method private pp_storage (s:storage) : doc =
-+    let tok = match s with
-+	      | NoStorage -> "NoStorage"
-+	      | Static    -> "Static"
-+	      | Register  -> "Register"
-+	      | Extern	  -> "Extern"
-+    in text ("Storage_" ^ tok)
-+
-+  method private pp_typeinfo (tinfo:typeinfo) : doc = if !E.verboseFlag then trace "pp_typeinfo" ;
-+    text "Typeinfo" ++ (pParens @ pCommaSep) [   
-+    pQuoted tinfo.tname ;
-+    self#pType None () tinfo.ttype ;
-+    pBool tinfo.treferenced ]
-+
-+  method private pp_fieldinfo (finfo:fieldinfo) : doc = if !E.verboseFlag then trace "pp_fieldinfo" ;
-+    text "Fieldinfo" ++ (pParens @ pCommaSep) [ 
-+    pQuoted finfo.fname ;
-+    self#pType None () finfo.ftype ;
-+    pOption (pQuoted @ string_of_int) finfo.fbitfield ;
-+    self#pAttrs () finfo.fattr ;
-+    self#pp_location finfo.floc ]
-+
-+  method private pp_compinfo (cinfo:compinfo) : doc = if !E.verboseFlag then trace "pp_compinfo" ;
-+    text "Compinfo" ++ (pParens @ pCommaSep) [ 
-+    pBool cinfo.cstruct ;
-+    pQuoted cinfo.cname ;
-+    text (string_of_int cinfo.ckey) ;
-+    pList (map (self#pFieldDecl ()) cinfo.cfields) ;
-+    self#pAttrs () cinfo.cattr ;
-+    pBool cinfo.cdefined ;
-+    pBool cinfo.creferenced ]
-+
-+  method private pp_enuminfo (einfo:enuminfo) : doc = if !E.verboseFlag then trace "pp_enuminfo" ;
-+    text "Enuminfo" ++ (pParens @ pCommaSep) [
-+    pQuoted einfo.ename ;
-+    pList (map (  pTriplet
-+                @ (pTriple pQuoted (self#pExp ()) self#pp_location)
-+               )
-+               einfo.eitems) ;
-+    self#pAttrs () einfo.eattr ;
-+    pBool einfo.ereferenced ]
-+
-+  method private pp_location (loc:location) : doc = if !E.verboseFlag then trace "pp_location" ;
-+    text "Location" ++ (pParens @ pCommaSep) [
-+    text (string_of_int loc.line) ;
-+    pQuoted loc.file ;
-+    text (string_of_int loc.byte) ]
-+
-+  method private pp_varinfo (vinfo:varinfo) : doc = if !E.verboseFlag then trace "pp_varinfo" ;
-+    text "Varinfo" ++ (pParens @ pCommaSep) [
-+    pQuoted vinfo.vname ;
-+    self#pType None () vinfo.vtype ;
-+    self#pAttrs () vinfo.vattr ;
-+    self#pp_storage vinfo.vstorage ;
-+    pBool vinfo.vglob ;
-+    pBool vinfo.vinline ;
-+    self#pp_location vinfo.vdecl ;
-+    text (string_of_int vinfo.vid) ;
-+    pBool vinfo.vaddrof ;
-+    pBool vinfo.vreferenced ]
-+
-+  method private pp_initinfo (iinfo:initinfo) : doc = if !E.verboseFlag then trace "pp_initinfo" ;
-+    text "Initinfo" ++ pParens( 
-+    pOption (self#pInit ()) iinfo.init)
-+
-+  method private pp_fundec (fdec:fundec) : doc = if !E.verboseFlag then trace "pp_fundec" ;
-+    text "Fundec" ++ (pParens @ pCommaSep) [
-+    self#pp_varinfo fdec.svar ;
-+    pList (map self#pp_varinfo fdec.sformals) ;
-+    pList (map self#pp_varinfo fdec.slocals) ;
-+    text (string_of_int fdec.smaxid) ;
-+    self#pBlock () fdec.sbody ;
-+    pOption (pSpParens @ text @ string_of_int) fdec.smaxstmtid ;
-+    pList (map (self#pStmt ()) fdec.sallstmts) ]
-+
-+  method private pp_ikind (ikin:ikind) : doc =
-+    let tok = match ikin with
-+              | IChar  -> "IChar"
-+	      | ISChar -> "ISChar"
-+	      | IUChar -> "IUChar"
-+	      | IInt   -> "IInt"
-+	      | IUInt  -> "IUInt"
-+	      | IShort -> "IShort"
-+	      | IUShort -> "IUShort"
-+	      | ILong  -> "ILong"
-+	      | IULong -> "IULong"
-+	      | ILongLong -> "ILongLong"
-+	      | IULongLong -> "IULongLong"
-+    in text ("Ikind_" ^ tok)
-+
-+  method private pp_fkind (fkin:fkind) : doc =
-+    let tok = match fkin with
-+	      | FFloat -> "FFloat"
-+	      | FDouble -> "FDouble"
-+	      | FLongDouble -> "FLongDouble"
-+    in text ("Fkind_" ^ tok)
-+
-+  method private pp_typsig (tsig:typsig) : doc = if !E.verboseFlag then trace "pp_typsig" ;
-+    match tsig with
-+    | TSArray (tsig2, oe, attr)         -> text "TSArray" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      pOption pInt64 oe ;
-+					      self#pAttrs () attr ]
-+    | TSPtr   (tsig2, attr)             -> text "TSPtr" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      self#pAttrs () attr ]	
-+    | TSComp  (b, s, attr)              -> text "TSComp" ++ (pParens @ pCommaSep) [
-+					      pBool b ;
-+					      pQuoted s ;
-+					      self#pAttrs () attr ]
-+    | TSFun   (tsig2, tsiglst, b, attr) -> text "TSFun" ++ (pParens @ pCommaSep) [
-+					      self#pp_typsig tsig2 ;
-+					      pList (map self#pp_typsig tsiglst) ;
-+					      pBool b ;
-+					      self#pAttrs () attr ]
-+    | TSEnum  (s, attr)                 -> text "TSEnum" ++ (pParens @ pCommaSep) [
-+					      pQuoted s ;
-+					      self#pAttrs () attr ]
-+    | TSBase  (t)                       -> text "TSBase" ++ pParens( self#pType None () t)
-+     
-+
-+  method private pp_unop (uop:unop) : doc =
-+    let tok = match uop with
-+	      | Neg -> "Neg"
-+	      | BNot -> "BNot"
-+	      | LNot -> "LNot"
-+    in text ("UnOp_" ^ tok)
-+
-+  method private pp_binop (bop:binop) : doc = 
-+    let tok = match bop with
-+              | PlusA -> "PlusA"
-+	      | PlusPI -> "PlusPI"
-+	      | IndexPI -> "IndexPI"
-+	      | MinusA -> "MinusA"
-+	      | MinusPI -> "MinusPI"
-+	      | MinusPP -> "MinusPP"
-+	      | Mult -> "Mult"
-+	      | Div -> "Div"
-+	      | Mod -> "Mod"
-+	      | Shiftlt -> "Shiftlt"
-+	      | Shiftrt -> "Shiftrt"
-+	      | Lt -> "Lt"
-+	      | Gt -> "Gt"
-+	      | Le -> "Le"
-+	      | Ge -> "Ge"
-+	      | Eq -> "Eq"
-+	      | Ne -> "Ne"
-+	      | BAnd -> "BAnd"
-+	      | BXor -> "BXor"
-+	      | BOr -> "BOr"
-+	      | LAnd -> "LAnd"
-+	      | LOr -> "LOr"
-+    in text ("BinOp_" ^ tok )
-+
-+  method private pp_constant (c:constant) : doc = if !E.verboseFlag then trace "pp_constant" ;
-+    match c with
-+    | CInt64 (i, ikin, os) -> text "CInt64" ++ (pParens @ pCommaSep) [  
-+                                  pQuoted (Int64.to_string i)  ;
-+				  self#pp_ikind ikin ;
-+				  pOption pQuoted os ]
-+    | CStr   (s)           -> text "CStr" ++ pParens( pQuoted s)
-+    | CWStr  (ilist)       -> text "CWStr" ++ pParens( pList (map ( text @ Int64.to_string) ilist))
-+    | CChr   (c)           -> text "CChr" ++ pParens( text "\"" ++ text (Char.escaped c) ++ text "\"")
-+    | CReal  (f, fkin, os) -> text "CReal" ++ (pParens @ pCommaSep) [  pQuoted (sprintf "%f0" f) ;
-+				  self#pp_fkind fkin ;
-+				  pOption pQuoted os ]
-+
-+  method private pp_lhost (lh:lhost) : doc = if !E.verboseFlag then trace "pp_lhost" ;
-+    match lh with
-+    | Var (vinfo) -> text "Var" ++ pParens( self#pp_varinfo vinfo)
-+    | Mem (e)     -> text "Mem" ++ pParens( self#pExp () e)
-+
-+  method private pp_blockinfo (b:block) : doc = if !E.verboseFlag then trace "pp_blockinfo" ;
-+    text "Block" ++ (pParens @ pCommaSep) [
-+    self#pAttrs () b.battrs ;
-+    pList (map (self#pStmt ()) b.bstmts) ]
-+
-+  method private pp_stmtinfo (sinfo:stmt) : doc = if !E.verboseFlag then trace "pp_stmtinfo" ;
-+    text "Stmt" ++ (pParens @ pCommaSep) [
-+    pList (map (self#pLabel ()) sinfo.labels) ;
-+    self#pStmtKind invalidStmt () sinfo.skind ;
-+    text (string_of_int sinfo.sid) ;
-+    pList (map self#pp_stmtinfo sinfo.succs) ;
-+    pList (map self#pp_stmtinfo sinfo.preds) ]
-+end
-+
-+let ppFile (f:file) (pp:cilPrinter) : doc = if !E.verboseFlag then trace "ppFile" ;
-+  text "File" ++ (pParens @ pCommaSep) [ 
-+  pQuoted f.fileName ;
-+  pList (map (pp#pGlobal ()) f.globals) ]
-+
-+(* we need a different more flexible mapGlobals
-+   we only visit globals and not global init;
-+   use mapGlobinits *)
-+let mapGlobals2 (fl: file) 
-+                (doone: global -> 'a) : 'a list = 
-+  List.map doone fl.globals
-+
-+(* We redefine dumpFile because we don't want a header in our
-+   file telling us it was generated with CIL blabla *)
-+let dumpFile (pp: cilPrinter) (out : out_channel) file =
-+  printDepth := 99999;  
-+  Pretty.fastMode := true;
-+  if !E.verboseFlag then ignore (E.log "printing file %s\n" file.fileName);
-+  let file_doc = ppFile file pp in
-+  fprint out 80 file_doc;
-+  flush out
-+
-+let feature : featureDescr =
-+  { fd_name = "printaterm";
-+    fd_enabled = ref false;
-+    fd_description = "printing the current CIL AST to an ATerm";
-+    fd_extraopt = [("--atermfile", Arg.String (fun s -> outputfilename := s), "=<filename>: writes the ATerm to <filename>");];
-+    fd_doit = (function (f: file) ->        
-+        let channel = open_out !outputfilename in 
-+        let printer = new atermPrinter
-+	in dumpFile printer channel f
-+         ; close_out channel
-+    );
-+    fd_post_check = false;
-+  }
-diff -urN cil-old/src/maincil.ml cil-new/src/maincil.ml
---- cil-old/src/maincil.ml	2005-11-22 06:34:41.000000000 +0100
-+++ cil-new/src/maincil.ml	2006-09-13 13:52:09.000000000 +0200
-@@ -105,6 +105,7 @@
-     Simplemem.feature;
-     Simplify.feature;
-     Dataslicing.feature;
-+    Atermprinter.feature;
-   ] 
-   @ Feature_config.features 
- 
diff --git a/pkgs/development/libraries/cloog-ppl/default.nix b/pkgs/development/libraries/cloog-ppl/default.nix
index d9dae7bfd41..aa594a8e2bc 100644
--- a/pkgs/development/libraries/cloog-ppl/default.nix
+++ b/pkgs/development/libraries/cloog-ppl/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--with-ppl=${ppl}";
 
   crossAttrs = {
-    configureFlags = "--with-ppl=${ppl.hostDrv}";
+    configureFlags = "--with-ppl=${ppl.crossDrv}";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/clucene-core/2.x.nix b/pkgs/development/libraries/clucene-core/2.x.nix
new file mode 100644
index 00000000000..97c7a4c9f53
--- /dev/null
+++ b/pkgs/development/libraries/clucene-core/2.x.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, cmake, boost, zlib}:
+
+stdenv.mkDerivation rec {
+  name = "clucene-core-2.3.3.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/clucene/${name}.tar.gz";
+    sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost zlib ];
+
+  cmakeFlags = [ "-DBUILD_CONTRIBS=ON" "-DBUILD_CONTRIBS_LIB=ON" ];
+
+  patches = # From debian
+    [ ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
+      ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
+      ./Install-contribs-lib.patch
+    ];
+
+  meta = {
+    description = "CLucene is a port of the very popular Java Lucene text search engine API. Core package, 2.x branch.";
+    homepage = http://clucene.sourceforge.net;
+  };
+}
diff --git a/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch b/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
new file mode 100644
index 00000000000..80e49a8e712
--- /dev/null
+++ b/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
@@ -0,0 +1,19 @@
+From 7be4a19b76d98260cf95040a47935f854a4ba7a4 Mon Sep 17 00:00:00 2001
+From: Valentin Rusu <kde@rusu.info>
+Date: Sat, 17 Dec 2011 13:47:58 +0100
+Subject: [PATCH] Fix .pc file by adding clucene-shared library
+
+---
+ src/core/libclucene-core.pc.cmake |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/core/libclucene-core.pc.cmake
++++ b/src/core/libclucene-core.pc.cmake
+@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i
+ Name: libclucene
+ Description: CLucene - a C++ search engine, ported from the popular Apache Lucene
+ Version: @CLUCENE_VERSION_MAJOR@.@CLUCENE_VERSION_MINOR@.@CLUCENE_VERSION_REVISION@.@CLUCENE_VERSION_PATCH@
+-Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core
++Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
+ Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
+ ~
diff --git a/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch b/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
new file mode 100644
index 00000000000..f5f44a7fa2c
--- /dev/null
+++ b/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
@@ -0,0 +1,20 @@
+From 772481ca94071ddfe65102a451926e4f9aeb4d2c Mon Sep 17 00:00:00 2001
+From: Veit Jahns <idolum@users.sourceforge.net>
+Date: Thu, 26 May 2011 13:35:28 +0200
+Subject: [PATCH] Fixing ZLIB configuration in shared's CMakeLists
+
+---
+ src/shared/CMakeLists.txt |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/shared/CMakeLists.txt
++++ b/src/shared/CMakeLists.txt
+@@ -42,7 +42,7 @@ INCLUDE (CheckAtomicFunctions)
+ find_package(ZLIB)
+ IF ( ZLIB_FOUND )
+   SET ( EXTRA_LIBS ${EXTRA_LIBS} ${ZLIB_LIBRARY} )
+-ELSEIF ( ZLIB_FOUND )
++ELSE ( ZLIB_FOUND )
+   MESSAGE( "ZLIB not found, using local: ${clucene-ext_SOURCE_DIR}/zlib" )
+   SET(ZLIB_INCLUDE_DIR ${clucene-ext_SOURCE_DIR}/zlib )
+   SET(ZLIB_LIBRARY ${clucene-ext_BINARY_DIR})
diff --git a/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch b/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch
new file mode 100644
index 00000000000..899411fe02b
--- /dev/null
+++ b/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch
@@ -0,0 +1,49 @@
+Description: contribs-lib is not built and installed even with config
+Author: Vitaliy Filippov
+Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
+ 
+---
+ CMakeLists.txt                  |    2 +-
+ src/contribs-lib/CMakeLists.txt |   17 +++++++++++++++++
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS )
+   SET(BUILD_CONTRIBS_LIB 1)
+ ENDIF ( BUILD_CONTRIBS )
+ IF ( BUILD_CONTRIBS_LIB )
+-  ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL)
++  ADD_SUBDIRECTORY (src/contribs-lib)
+ ENDIF ( BUILD_CONTRIBS_LIB )
+ 
+ 
+--- a/src/contribs-lib/CMakeLists.txt
++++ b/src/contribs-lib/CMakeLists.txt
+@@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED
+ )
+ TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs})
+ 
++#install public headers.
++FOREACH(file ${HEADERS})
++	get_filename_component(apath ${file} PATH)
++	get_filename_component(aname ${file} NAME)
++	file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
++	IF ( NOT aname MATCHES "^_.*" )
++		install(FILES ${file} 
++		        DESTINATION include/${relpath}
++		        COMPONENT development)
++	ENDIF ( NOT aname MATCHES "^_.*" )
++ENDFOREACH(file)
++
+ #set properties on the libraries
+ SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES
+     VERSION ${CLUCENE_VERSION}
+     SOVERSION ${CLUCENE_SOVERSION}
+     COMPILE_DEFINITIONS_DEBUG _DEBUG
+ )
++
++#and install library
++install(TARGETS clucene-contribs-lib 
++        DESTINATION ${LIB_DESTINATION}  
++        COMPONENT runtime )
diff --git a/pkgs/development/libraries/clucene-core/default.nix b/pkgs/development/libraries/clucene-core/default.nix
index d180c4761e8..abd6712736f 100644
--- a/pkgs/development/libraries/clucene-core/default.nix
+++ b/pkgs/development/libraries/clucene-core/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "clucene-core-0.9.21b";
 
   src = fetchurl {
-    url = "mirror://sf/clucene/${name}.tar.bz2";
+    url = "mirror://sourceforge/clucene/${name}.tar.bz2";
     sha256 = "202ee45af747f18642ae0a088d7c4553521714a511a1a9ec99b8144cf9928317";
   };
   
diff --git a/pkgs/development/libraries/clutter-gtk/0.10.8.nix b/pkgs/development/libraries/clutter-gtk/0.10.8.nix
index b44801928e9..182040f5c41 100644
--- a/pkgs/development/libraries/clutter-gtk/0.10.8.nix
+++ b/pkgs/development/libraries/clutter-gtk/0.10.8.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ clutter gtk ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/clutter-gtk/default.nix b/pkgs/development/libraries/clutter-gtk/default.nix
index a48ff93ce22..3e13ff2da7e 100644
--- a/pkgs/development/libraries/clutter-gtk/default.nix
+++ b/pkgs/development/libraries/clutter-gtk/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ clutter gtk3 ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
diff --git a/pkgs/development/libraries/clutter/default.nix b/pkgs/development/libraries/clutter/default.nix
index 52a9eaa98fa..6c6891fb279 100644
--- a/pkgs/development/libraries/clutter/default.nix
+++ b/pkgs/development/libraries/clutter/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "0bzsvnharawfg525lpavrp55mq4aih5nb01dwwqwnccg8hk9z2fw";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs =
     [ libX11 mesa libXext libXfixes libXdamage libXcomposite libXi cogl pango
       atk json_glib
diff --git a/pkgs/development/libraries/cogl/default.nix b/pkgs/development/libraries/cogl/default.nix
index 11a6e374e2e..b697ed87edc 100644
--- a/pkgs/development/libraries/cogl/default.nix
+++ b/pkgs/development/libraries/cogl/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1ix87hz3qxqysqwx58wbc46lzchlmfs08fjzbf3l6mmsqj8gs9pc";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs =
     [ mesa glib gdk_pixbuf libXfixes libXcomposite libXdamage ];
diff --git a/pkgs/development/libraries/coin3d/default.nix b/pkgs/development/libraries/coin3d/default.nix
index f676c9abaa0..b477a88ed53 100644
--- a/pkgs/development/libraries/coin3d/default.nix
+++ b/pkgs/development/libraries/coin3d/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "3.1.3";
 
   src = fetchurl {
-    url = "http://ftp.coin3d.org/coin/src/all/Coin-${version}.tar.gz";
+    url = "https://bitbucket.org/Coin3D/coin/downloads/Coin-${version}.tar.gz";
     sha256 = "05ylhrcglm81dajbk132l1w892634z2i97x10fm64y1ih72phd2q";
   };
 
diff --git a/pkgs/development/libraries/config-support/default.nix b/pkgs/development/libraries/config-support/default.nix
index 72b1bea7b20..d25accd4664 100644
--- a/pkgs/development/libraries/config-support/default.nix
+++ b/pkgs/development/libraries/config-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/consolekit/0001-Don-t-daemonize-when-activated.patch b/pkgs/development/libraries/consolekit/0001-Don-t-daemonize-when-activated.patch
deleted file mode 100644
index 30f3ab4907b..00000000000
--- a/pkgs/development/libraries/consolekit/0001-Don-t-daemonize-when-activated.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Upstream patch
-
-From fc2870a65f6b3ed3b71bcac69c5faf3a9c759c64 Mon Sep 17 00:00:00 2001
-From: Matthias Clasen <mclasen@redhat.com>
-Date: Mon, 21 Dec 2009 11:13:23 -0500
-Subject: [PATCH 1/2] Don't daemonize when activated
-
-It confuses some versions of D-Bus and isn't needed
-(or wanted it).
-
-http://bugs.freedesktop.org/show_bug.cgi?id=25642
----
- data/org.freedesktop.ConsoleKit.service.in |    2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
-
-diff --git a/data/org.freedesktop.ConsoleKit.service.in b/data/org.freedesktop.ConsoleKit.service.in
-index ec2128c..d716a36 100644
---- a/data/org.freedesktop.ConsoleKit.service.in
-+++ b/data/org.freedesktop.ConsoleKit.service.in
-@@ -1,4 +1,4 @@
- [D-BUS Service]
- Name=org.freedesktop.ConsoleKit
--Exec=@sbindir@/console-kit-daemon
-+Exec=@sbindir@/console-kit-daemon --no-daemon
- User=root
--- 
-1.7.1
-
diff --git a/pkgs/development/libraries/consolekit/0002-Don-t-take-bus-name-until-ready.patch b/pkgs/development/libraries/consolekit/0002-Don-t-take-bus-name-until-ready.patch
deleted file mode 100644
index 2af59ac8d1e..00000000000
--- a/pkgs/development/libraries/consolekit/0002-Don-t-take-bus-name-until-ready.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-Upstream patch
-
-From 2418840248f07025ad0edc96ed17e03ce5e47f3e Mon Sep 17 00:00:00 2001
-From: Ray Strode <rstrode@redhat.com>
-Date: Mon, 21 Dec 2009 11:14:54 -0500
-Subject: [PATCH 2/2] Don't take bus name until ready
-
-Previously, we would take a bus name right away, but
-not register the manager object until later.  This
-causes a race when being activated by a method call
-on the manager object, where ConsoleKit gets started
-but the method call fails.
-
-https://bugs.freedesktop.org/show_bug.cgi?id=25744
----
- src/main.c |   16 ++++++++--------
- 1 files changed, 8 insertions(+), 8 deletions(-)
-
-diff --git a/src/main.c b/src/main.c
-index 809c6d6..b8f698f 100644
---- a/src/main.c
-+++ b/src/main.c
-@@ -294,11 +294,19 @@ main (int    argc,
- 
-         setup_debug_log (debug);
- 
-+        g_debug ("initializing console-kit-daemon %s", VERSION);
-+
-         connection = get_system_bus ();
-         if (connection == NULL) {
-                 goto out;
-         }
- 
-+        manager = ck_manager_new ();
-+
-+        if (manager == NULL) {
-+                goto out;
-+        }
-+
-         bus_proxy = get_bus_proxy (connection);
-         if (bus_proxy == NULL) {
-                 g_warning ("Could not construct bus_proxy object; bailing out");
-@@ -310,16 +318,8 @@ main (int    argc,
-                 goto out;
-         }
- 
--        g_debug ("initializing console-kit-daemon %s", VERSION);
--
-         create_pid_file ();
- 
--        manager = ck_manager_new ();
--
--        if (manager == NULL) {
--                goto out;
--        }
--
-         loop = g_main_loop_new (NULL, FALSE);
- 
-         g_signal_connect (bus_proxy,
--- 
-1.7.1
-
diff --git a/pkgs/development/libraries/consolekit/commands.patch b/pkgs/development/libraries/consolekit/commands.patch
deleted file mode 100644
index 48b0d5d8cf6..00000000000
--- a/pkgs/development/libraries/consolekit/commands.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-This patch adds shutdown commands specific to NixOS, as NixOS does not have
-a /sbin or /usr/sbin directory. In order not to have a dependency on the
-package that provides "shutdown" when in an environment other than NixOS,
-we'll make it depend on /var/run/current-system.
-
-Note: this patch does not compromise system security. Other systems than
-NixOS should have already shutdown in the earlier directories being searched,
-and otherwise /var/run is writable only be root.
-
---- ConsoleKit-0.4.1/tools/linux/ck-system-restart.org	2012-02-13 11:29:57.352902568 +0100
-+++ ConsoleKit-0.4.1/tools/linux/ck-system-restart	2012-02-13 11:43:27.593317712 +0100
-@@ -7,6 +7,9 @@
- elif [ -x "/usr/sbin/shutdown" ] ; then
- 	/usr/sbin/shutdown -r now
- 	exit $?
-+elif [ -x "/var/run/current-system/sw/sbin/shutdown" ] ; then
-+    /var/run/current-system/sw/sbin/shutdown -r now
-+    exit $?
- else
- 	exit 1
- fi
---- ConsoleKit-0.4.1/tools/linux/ck-system-stop.org	2012-02-13 11:30:06.228950934 +0100
-+++ ConsoleKit-0.4.1/tools/linux/ck-system-stop	2012-02-13 11:44:12.664563304 +0100
-@@ -7,6 +7,9 @@
- elif [ -x "/usr/sbin/shutdown" ] ; then
- 	/usr/sbin/shutdown -h now
- 	exit $?
-+elif [ -x "/var/run/current-system/sw/sbin/shutdown" ] ; then
-+    /var/run/current-system/sw/sbin/shutdown -h now
-+    exit $?
- else
- 	exit 1
- fi
diff --git a/pkgs/development/libraries/consolekit/default.nix b/pkgs/development/libraries/consolekit/default.nix
deleted file mode 100644
index e9cedf18857..00000000000
--- a/pkgs/development/libraries/consolekit/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, dbus_glib, zlib, pam, glib, 
-  libX11, polkit, expat }:
-
-stdenv.mkDerivation rec {
-  name = "consolekit-0.4.1";
-  
-  src = fetchurl {
-    url = http://www.freedesktop.org/software/ConsoleKit/dist/ConsoleKit-0.4.1.tar.bz2;
-    sha256 = "0gj0airrgyi14a06w3d4407g62bs5a1cam2h64s50x3d2k3ascph";
-  };
-  
-  buildInputs = [ pkgconfig dbus_glib zlib pam glib libX11 polkit expat ];
-  patches = [ ./0001-Don-t-daemonize-when-activated.patch
-    ./0002-Don-t-take-bus-name-until-ready.patch
-    ./commands.patch  # adds shutdown commands for NixOS to the list of shutdown commands
-  ];
-
-  # For console-kit to get the rpath to libgcc_s, needed for pthread_cancel to work
-  NIX_LDFLAGS = "-lgcc_s";
-
-  configureFlags = "--enable-pam-module --with-pam-module-dir=$(out)/lib/security --localstatedir=/var --sysconfdir=/etc";
-
-  installFlags = "sysconfdir=$(out)/etc DBUS_SYS_DIR=$(out)/etc/dbus-1/system.d"; # keep `make install' happy
-  
-  meta = {
-    homepage = http://www.freedesktop.org/wiki/Software/ConsoleKit;
-    description = "A framework for defining and tracking users, login sessions, and seats";
-  };
-}
diff --git a/pkgs/development/libraries/cppunit/default.nix b/pkgs/development/libraries/cppunit/default.nix
index dbbcf4388c5..2504f87a230 100644
--- a/pkgs/development/libraries/cppunit/default.nix
+++ b/pkgs/development/libraries/cppunit/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation {
   name = "cppunit-1.12.0";
 
   src = fetchurl {
-    url = mirror://sf/cppunit/cppunit-1.12.0.tar.gz;
+    url = mirror://sourceforge/cppunit/cppunit-1.12.0.tar.gz;
     sha256 = "07zyyx5dyai94y8r8va28971f5mw84mb93xx9pm6m4ddpj6c79cq";
   };
 
diff --git a/pkgs/development/libraries/cracklib/builder.sh b/pkgs/development/libraries/cracklib/builder.sh
deleted file mode 100644
index 3833cc1e6c1..00000000000
--- a/pkgs/development/libraries/cracklib/builder.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-source $stdenv/setup
-
-preConfigure() {
-  mkdir cracklib-dicts/
-  cp $dicts cracklib-dicts/
-}
-
-postInstall() {
-  $out/sbin/cracklib-format cracklib-dicts/* | $out/sbin/cracklib-packer cracklib_dict
-  cp cracklib_dict.* $out/lib
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/cracklib/default.nix b/pkgs/development/libraries/cracklib/default.nix
index 9833d79a726..32d1c478a49 100644
--- a/pkgs/development/libraries/cracklib/default.nix
+++ b/pkgs/development/libraries/cracklib/default.nix
@@ -3,18 +3,11 @@
 stdenv.mkDerivation rec {
   name = "cracklib-2.8.16";
 
-  #builder = ./builder.sh;
-
   src = fetchurl {
     url = "mirror://sourceforge/cracklib/${name}.tar.gz";
     sha256 = "1g3mchdvra9nihxlkl3rdz96as3xnfw5m59hmr5k17l7qa9a8fpw";
   };
 
-  #dicts = fetchurl {
-  #  url = http://nixos.org/tarballs/cracklib-words.gz;
-  #  md5 = "d18e670e5df560a8745e1b4dede8f84f";
-  #};
-
   meta = {
     homepage = http://sourceforge.net/projects/cracklib;
     description = "A library for checking the strength of passwords";
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index 8f39de41e55..f80d5813c3e 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -1,23 +1,16 @@
 { fetchurl, stdenv, unzip, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "crypto++-5.6.1";
+  name = "crypto++-5.6.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/cryptopp/cryptopp561.zip";
-    sha256 = "0s7jhvnfihikqp1iwpdz03fad62xkjxci6jiahrh6f3sn664vrwq";
+    url = "mirror://sourceforge/cryptopp/cryptopp562.zip";
+    sha256 = "0x1mqpz1v071cfrw4grbw7z734cxnpry1qh2b6rsmcx6nkyd5gsw";
   };
 
-  patches = [
-    ./pic.patch
-    ./salsa-gcc4.6.patch
-  ] ++ stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
+  patches = stdenv.lib.optional (stdenv.system != "i686-cygwin") ./dll.patch;
 
-
-  buildInputs = [ unzip ]
-
-    # For some reason the makefile sets "AR = libtool" on Darwin.
-    ++ stdenv.lib.optional (stdenv.system == "i686-darwin") libtool;
+  buildInputs = [ unzip libtool ];
 
   # Unpack the thing in a subdirectory.
   unpackPhase = ''
@@ -56,7 +49,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Crypto++, a free C++ class library of cryptographic schemes";
     homepage = http://cryptopp.com/;
-    license = "Public Domain";
+    license = "Boost 1.0";
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
diff --git a/pkgs/development/libraries/crypto++/pic.patch b/pkgs/development/libraries/crypto++/pic.patch
deleted file mode 100644
index c01550b132a..00000000000
--- a/pkgs/development/libraries/crypto++/pic.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Build position-independent code, for shared libraries.  Fix $(DLLSRCS)
-while we're at it (it lacks `pssr.cpp', for instance).
-
---- a/GNUmakefile	2009-03-15 02:48:02.000000000 +0100
-+++ b/GNUmakefile	2009-08-11 00:13:43.000000000 +0200
-@@ -104,6 +104,7 @@ TESTOBJS = bench.o bench2.o test.o valid
- LIBOBJS = $(filter-out $(TESTOBJS),$(OBJS))
- 
- DLLSRCS = algebra.cpp algparam.cpp asn.cpp basecode.cpp cbcmac.cpp channels.cpp cryptlib.cpp des.cpp dessp.cpp dh.cpp dll.cpp dsa.cpp ec2n.cpp eccrypto.cpp ecp.cpp eprecomp.cpp files.cpp filters.cpp fips140.cpp fipstest.cpp gf2n.cpp gfpcrypt.cpp hex.cpp hmac.cpp integer.cpp iterhash.cpp misc.cpp modes.cpp modexppc.cpp mqueue.cpp nbtheory.cpp oaep.cpp osrng.cpp pch.cpp pkcspad.cpp pubkey.cpp queue.cpp randpool.cpp rdtables.cpp rijndael.cpp rng.cpp rsa.cpp sha.cpp simple.cpp skipjack.cpp strciphr.cpp trdlocal.cpp
-+DLLSRCS = $(SRCS)
- DLLOBJS = $(DLLSRCS:.cpp=.export.o)
- LIBIMPORTOBJS = $(LIBOBJS:.o=.import.o)
- TESTIMPORTOBJS = $(TESTOBJS:.o=.import.o)
-@@ -162,7 +162,7 @@ endif
- 	$(CXX) $(CXXFLAGS) -DCRYPTOPP_IMPORTS -c $< -o $@
- 
- %.export.o : %.cpp
--	$(CXX) $(CXXFLAGS) -DCRYPTOPP_EXPORTS -c $< -o $@
-+	$(CXX) $(CXXFLAGS) -fPIC -DCRYPTOPP_EXPORTS -c $< -o $@
- 
- %.o : %.cpp
- 	$(CXX) $(CXXFLAGS) -c $<
diff --git a/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch b/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch
deleted file mode 100644
index 609d2f55d22..00000000000
--- a/pkgs/development/libraries/crypto++/salsa-gcc4.6.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From fbccde3578feddb16f07be981da1d0f26209fd04 Mon Sep 17 00:00:00 2001
-From: weidai <weidai@57ff6487-cd31-0410-9ec3-f628ee90f5f0>
-Date: Sun, 5 Jun 2011 21:07:11 +0000
-Subject: [PATCH 1/4] fix Salsa validation failure when compiling with GCC 4.6
- (https://sourceforge.net/apps/trac/cryptopp/ticket/12)
-
-git-svn-id: https://cryptopp.svn.sourceforge.net/svnroot/cryptopp/trunk@529 57ff6487-cd31-0410-9ec3-f628ee90f5f0
----
- c5/salsa.cpp |   21 +++++++++++----------
- 1 file changed, 11 insertions(+), 10 deletions(-)
-
-# NOTE: remove the c5 path component
-
-diff --git a/salsa.cpp b/salsa.cpp
-index bd216ee..bdc5d75 100755
---- a/salsa.cpp
-+++ b/salsa.cpp
-@@ -122,17 +122,17 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output
- 	if (HasSSE2())
- 	{
- 	#if CRYPTOPP_BOOL_X64
--		#define REG_output			%4
--		#define REG_input			%1
-+		#define REG_output			%1
-+		#define REG_input			%0
- 		#define REG_iterationCount	%2
--		#define REG_state			%3
--		#define REG_rounds			%0
-+		#define REG_state			%4		/* constant */
-+		#define REG_rounds			%3		/* constant */
- 		#define REG_roundsLeft		eax
- 		#define REG_temp32			edx
- 		#define REG_temp			rdx
--		#define SSE2_WORKSPACE		%5
-+		#define SSE2_WORKSPACE		%5		/* constant */
- 
--		FixedSizeAlignedSecBlock<byte, 32*16> workspace;
-+		CRYPTOPP_ALIGN_DATA(16) byte workspace[16*32];
- 	#else
- 		#define REG_output			edi
- 		#define REG_input			eax
-@@ -457,12 +457,13 @@ void Salsa20_Policy::OperateKeystream(KeystreamOperation operation, byte *output
- #ifdef __GNUC__
- 		AS_POP_IF86(	bx)
- 		".att_syntax prefix;"
--			: 
- 	#if CRYPTOPP_BOOL_X64
--			: "r" (m_rounds), "r" (input), "r" (iterationCount), "r" (m_state.data()), "r" (output), "r" (workspace.m_ptr)
--			: "%eax", "%edx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
-+			: "+r" (input), "+r" (output), "+r" (iterationCount)
-+			: "r" (m_rounds), "r" (m_state.m_ptr), "r" (workspace)
-+			: "%eax", "%rdx", "memory", "cc", "%xmm0", "%xmm1", "%xmm2", "%xmm3", "%xmm4", "%xmm5", "%xmm6", "%xmm7", "%xmm8", "%xmm9", "%xmm10", "%xmm11", "%xmm12", "%xmm13", "%xmm14", "%xmm15"
- 	#else
--			: "d" (m_rounds), "a" (input), "c" (iterationCount), "S" (m_state.data()), "D" (output)
-+			: "+a" (input), "+D" (output), "+c" (iterationCount)
-+			: "d" (m_rounds), "S" (m_state.m_ptr)
- 			: "memory", "cc"
- 	#endif
- 		);
--- 
-1.7.9.2
-
diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix
index a03f753a114..e90ec422661 100644
--- a/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -1,23 +1,29 @@
-{ stdenv, fetchurl, openssl, db4, gettext }:
+{ stdenv, fetchurl, openssl, db4, gettext, pam }:
 
 stdenv.mkDerivation rec {
-  name = "cyrus-sasl-2.1.25";
+  name = "cyrus-sasl-2.1.26";
 
   src = fetchurl {
-    url = "ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/${name}.tar.gz";
-    sha256 = "418c16e6240a4f9b637cbe3d62937b9675627bad27c622191d47de8686fe24fe";
+    url = "ftp://ftp.cyrusimap.org/cyrus-sasl/${name}.tar.gz";
+    sha256 = "1hvvbcsg21nlncbgs0cgn3iwlnb3vannzwsp6rwvnn9ba4v53g4g";
   };
 
-  buildInputs = [ openssl db4 gettext ];
+  buildInputs = [ openssl db4 gettext ] ++ stdenv.lib.optional stdenv.isLinux pam;
+
+  patches = [ ./missing-size_t.patch ]; # https://bugzilla.redhat.com/show_bug.cgi?id=906519
+  patchFlags = "-p0";
 
   # Set this variable at build-time to make sure $out can be evaluated.
   preConfigure = ''
     configureFlagsArray=( --with-plugindir=$out/lib/sasl2
                           --with-configdir=$out/lib/sasl2
-			  --enable-login
-			)
+                          --with-saslauthd=/run/saslauthd
+                          --enable-login
+                        )
   '';
 
+  installFlags = if stdenv.isDarwin then [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ] else null;
+
   meta = {
     homepage = "http://cyrusimap.web.cmu.edu/";
     description = "library for adding authentication support to connection-based protocols";
diff --git a/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch b/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
new file mode 100644
index 00000000000..42f20fb8096
--- /dev/null
+++ b/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
@@ -0,0 +1,13 @@
+Gentoo bug #458790
+--- include/sasl.h	2012-10-12 17:05:48.000000000 +0300
++++ include/sasl.h	2013-02-23 16:56:44.648786268 +0200
+@@ -121,6 +121,9 @@
+ #ifndef SASL_H
+ #define SASL_H 1
+ 
++/* stddef.h to get size_t defined */
++#include <stddef.h>
++
+ /* Keep in sync with win32/common.mak */
+ #define SASL_VERSION_MAJOR 2
+ #define SASL_VERSION_MINOR 1
diff --git a/pkgs/development/libraries/dbus-glib/default.nix b/pkgs/development/libraries/dbus-glib/default.nix
index 5fccc7ad66b..47e83e7780c 100644
--- a/pkgs/development/libraries/dbus-glib/default.nix
+++ b/pkgs/development/libraries/dbus-glib/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "04fiwld5yaxyggxlvdmbaqkngh4fn8gfkkqckcp3274bpgb82z19";
   };
 
-  buildNativeInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext ];
 
   buildInputs = [ expat ] ++ stdenv.lib.optional (!stdenv.isLinux) libiconv;
 
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index c943fe87fb3..5716ac6648a 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
 
 let
-  version = "1.4.16";
+  version = "1.6.4";
 
   src = fetchurl {
     url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
-    sha256 = "1ii93d0lzj5xm564dcq6ca4s0nvm5i9fx3jp0s7i9hlc5wkfd3hx";
+    sha256 = "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz";
   };
 
   patches = [ ./ignore-missing-includedirs.patch ];
@@ -17,10 +17,14 @@ in rec {
   libs = stdenv.mkDerivation {
     name = "dbus-library-" + version;
 
-    buildNativeInputs = [ pkgconfig ];
+    nativeBuildInputs = [ pkgconfig ];
 
     buildInputs = [ expat ];
 
+    # FIXME: dbus has optional systemd integration when checking
+    # at_console policies.  How to enable this without introducing a
+    # circular dependency between dbus and systemd?
+
     inherit src patches configureFlags;
 
     preConfigure =
@@ -44,7 +48,7 @@ in rec {
 
     configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
 
-    buildNativeInputs = [ pkgconfig ];
+    nativeBuildInputs = [ pkgconfig ];
 
     buildInputs = [ expat libs ]
       ++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
@@ -58,6 +62,8 @@ in rec {
       '';
 
     postConfigure = "cd tools";
+
+    installFlags = "localstatedir=$TMPDIR/var";
   };
 
   # I'm too lazy to separate daemon and libs now.
diff --git a/pkgs/development/libraries/despotify/default.nix b/pkgs/development/libraries/despotify/default.nix
new file mode 100644
index 00000000000..8e679221a48
--- /dev/null
+++ b/pkgs/development/libraries/despotify/default.nix
@@ -0,0 +1,34 @@
+{
+  stdenv, fetchsvn, openssl, zlib, libvorbis, pulseaudio, gstreamer, libao,
+  libtool, ncurses, glibc
+}:
+
+stdenv.mkDerivation rec {
+
+  name = "despotify-svn521";
+
+  src = fetchsvn {
+    url = "https://despotify.svn.sourceforge.net/svnroot/despotify";
+    rev = "521";
+  };
+
+  buildInputs = [
+    openssl zlib libvorbis pulseaudio gstreamer libao libtool ncurses glibc
+  ];
+
+  configurePhase = "cd src";
+
+  installPhase = "make LDCONFIG=true INSTALL_PREFIX=$out install";
+
+  meta = {
+    description = "Open source Spotify client and library";
+    longDescription = ''
+      despotify is a open source implementation of the Spotify API.  This
+      package provides both a library and a few already quite useful,
+      proof-of-concept clients.
+    '';
+    homepage = "http://despotify.se";
+    license = stdenv.lib.licenses.bsd2;
+  };
+
+}
diff --git a/pkgs/development/libraries/directfb/default.nix b/pkgs/development/libraries/directfb/default.nix
index 9b4241aa3be..cdc54ef6691 100644
--- a/pkgs/development/libraries/directfb/default.nix
+++ b/pkgs/development/libraries/directfb/default.nix
@@ -1,5 +1,5 @@
-{stdenv, fetchurl, perl, zlib, libjpeg, freetype, libpng, giflib
-, enableX11 ? true, libX11, xproto, xextproto, libXext, renderproto, libXrender
+{ stdenv, fetchurl, pkgconfig, perl, zlib, libjpeg, freetype, libpng, giflib
+, enableX11 ? true, xlibs
 , enableSDL ? true, SDL }:
 
 let s = import ./src-for-default.nix; in
@@ -10,16 +10,14 @@ stdenv.mkDerivation {
     sha256 = s.hash;
   };
 
-  patches = [ ./ftbfs.patch ];
+  nativeBuildInputs = [ perl ];
 
-  buildNativeInputs = [ perl ];
-
-  buildInputs = [ zlib libjpeg freetype giflib libpng ]
+  buildInputs = [ pkgconfig zlib libjpeg freetype giflib libpng ]
     ++ stdenv.lib.optional enableSDL SDL
-    ++ stdenv.lib.optionals enableX11 [
-      xproto libX11 libXext xextproto
-      renderproto libXrender
-    ];
+    ++ stdenv.lib.optionals enableX11 (with xlibs; [
+      xproto libX11 libXext #xextproto
+      #renderproto libXrender
+    ]);
 
   NIX_LDFLAGS="-lgcc_s";
 
@@ -31,7 +29,7 @@ stdenv.mkDerivation {
     "--enable-fbdev"
     "--enable-mmx"
     "--enable-sse"
-    "--enable-sysfs"
+    #"--enable-sysfs" # not recognized
     "--with-software"
     "--with-smooth-scaling"
     ] ++ stdenv.lib.optionals enableX11 [
diff --git a/pkgs/development/libraries/directfb/ftbfs.patch b/pkgs/development/libraries/directfb/ftbfs.patch
deleted file mode 100644
index b6907e70be7..00000000000
--- a/pkgs/development/libraries/directfb/ftbfs.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From: André Draszik <andre.draszik@st.com>
-Date: Wed, 28 Sep 2011 17:36:00 +0000 (+0100)
-Subject: generic_stretch_blit: fix compilation due to undefined reference to DSPF_ARGBF88871
-X-Git-Url: http://git.directfb.org/?p=core%2FDirectFB.git;a=commitdiff_plain;h=ef5e1398fe4037b63d6513e450f107fcfe91047f
-
-generic_stretch_blit: fix compilation due to undefined reference to DSPF_ARGBF88871
-
-../../../../DirectFB/src/gfx/generic/generic_stretch_blit.c: In function 'stretch_hvx':
-../../../../DirectFB/src/gfx/generic/generic_stretch_blit.c:444:21: error: 'DSPF_ARGBF88871' undeclared (first use in this function)
-../../../../DirectFB/src/gfx/generic/generic_stretch_blit.c:444:21: note: each undeclared identifier is reported only once for each function it appears in
----
-
-diff --git a/src/gfx/generic/generic_stretch_blit.c b/src/gfx/generic/generic_stretch_blit.c
-index 65076f4..6dd987b 100644
---- a/src/gfx/generic/generic_stretch_blit.c
-+++ b/src/gfx/generic/generic_stretch_blit.c
-@@ -441,7 +441,7 @@ stretch_hvx( CardState *state, DFBRectangle *srect, DFBRectangle *drect )
-                     }
-                     break;
- 
--               case DSPF_ARGBF88871:
-+               case DSPF_RGBAF88871:
-                     if (state->blittingflags & DSBLIT_SRC_PREMULTIPLY) {
-                          for (i=0; i<gfxs->Blut->num_entries; i++) {
-                               int alpha = entries[i].a + 1;
diff --git a/pkgs/development/libraries/directfb/src-for-default.nix b/pkgs/development/libraries/directfb/src-for-default.nix
index c154ac68e4a..a9c8c16a9d3 100644
--- a/pkgs/development/libraries/directfb/src-for-default.nix
+++ b/pkgs/development/libraries/directfb/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="1.5.3";
-   name="directfb-1.5.3";
-   hash="1w2i4az6v4sh086s27qbyn5w02s67a7dfm2xdpdm4r2zpgl7axg5";
-   url="http://directfb.org/downloads/Core/DirectFB-1.5/DirectFB-${version}.tar.gz";
-   advertisedUrl="http://directfb.org/downloads/Core/DirectFB-1.5/DirectFB-1.5.3.tar.gz";
+   version="1.6.2";
+   name="directfb-1.6.2";
+   hash="0k9x8lnjvlyalsd07a8z4iv2rfmpiz6j7aj0y4m4sybxhc8c86xr";
+   url="http://directfb.org/downloads/Core/DirectFB-1.6/DirectFB-${version}.tar.gz";
+   advertisedUrl="http://directfb.org/downloads/Core/DirectFB-1.6/DirectFB-1.6.2.tar.gz";
   
   
 }
diff --git a/pkgs/development/libraries/dxflib/default.nix b/pkgs/development/libraries/dxflib/default.nix
new file mode 100644
index 00000000000..f9c58857731
--- /dev/null
+++ b/pkgs/development/libraries/dxflib/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl}: 
+
+stdenv.mkDerivation rec {
+  version = "2.5.0.0-1";
+  name = "dxflib-${version}";
+  src = fetchurl {
+    url = "http://www.qcad.org/archives/dxflib/${name}.src.tar.gz";
+    sha256 = "20ad9991eec6b0f7a3cc7c500c044481a32110cdc01b65efa7b20d5ff9caefa9";
+  };
+
+  meta = {
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    platforms = stdenv.lib.platforms.linux;
+    description = ''DXF file format library'';
+  };
+}
+
diff --git a/pkgs/development/libraries/eigen/2.0.nix b/pkgs/development/libraries/eigen/2.0.nix
new file mode 100644
index 00000000000..9cf0a3c350c
--- /dev/null
+++ b/pkgs/development/libraries/eigen/2.0.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, cmake}:
+
+let
+  v = "2.0.16";
+in
+stdenv.mkDerivation {
+  name = "eigen-${v}";
+
+  src = fetchurl {
+    url = "http://bitbucket.org/eigen/eigen/get/${v}.tar.bz2";
+    name = "eigen-${v}.tar.bz2";
+    sha256 = "1akcb4g5hvc664gfc6sxb6f6jrm55fgks6017wg0smyvmm6k09v0";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with stdenv.lib; {
+    description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
+    license = licenses.lgpl3Plus;
+    homepage = http://eigen.tuxfamily.org ;
+    maintainers = with stdenv.lib.maintainers; [ sander urkud raskin ];
+  };
+}
diff --git a/pkgs/development/libraries/eigen/default.nix b/pkgs/development/libraries/eigen/default.nix
index 6884aca16fc..5653eec6d41 100644
--- a/pkgs/development/libraries/eigen/default.nix
+++ b/pkgs/development/libraries/eigen/default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl, cmake}:
 
 let
-  v = "2.0.16";
+  v = "3.1.2";
 in
 stdenv.mkDerivation {
   name = "eigen-${v}";
@@ -9,10 +9,10 @@ stdenv.mkDerivation {
   src = fetchurl {
     url = "http://bitbucket.org/eigen/eigen/get/${v}.tar.bz2";
     name = "eigen-${v}.tar.bz2";
-    sha256 = "1akcb4g5hvc664gfc6sxb6f6jrm55fgks6017wg0smyvmm6k09v0";
+    sha256 = "1hywvbn4a8f96fjn3cvd6nxzh5jvh05s1r263d9vqlgn25dxrzay";
   };
   
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
   
   meta = with stdenv.lib; {
     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
diff --git a/pkgs/development/libraries/enginepkcs11/default.nix b/pkgs/development/libraries/enginepkcs11/default.nix
index edd646f94fa..8c570c5421d 100644
--- a/pkgs/development/libraries/enginepkcs11/default.nix
+++ b/pkgs/development/libraries/enginepkcs11/default.nix
@@ -4,7 +4,10 @@ stdenv.mkDerivation rec {
   name = "engine_pkcs11-0.1.8";
   
   src = fetchurl {
-    url = "http://www.opensc-project.org/files/engine_pkcs11/${name}.tar.gz";
+    urls = [
+      "http://www.opensc-project.org/files/engine_pkcs11/${name}.tar.gz"
+      "http://www.openadk.org/distfiles/${name}.tar.gz"
+    ];
     sha256 = "1rd20rxy12rfx3kwwvk5sqvc1ll87z60rqak1ksfwbf4wx0pwzfy";
   };
   
diff --git a/pkgs/development/libraries/error-support/default.nix b/pkgs/development/libraries/error-support/default.nix
index da59c3bb9b4..766a0dbef1d 100644
--- a/pkgs/development/libraries/error-support/default.nix
+++ b/pkgs/development/libraries/error-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/expat/cve-2009-3560.patch b/pkgs/development/libraries/expat/cve-2009-3560.patch
deleted file mode 100644
index 71da9e39351..00000000000
--- a/pkgs/development/libraries/expat/cve-2009-3560.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-From: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/expat/files/expat-2.0.1-CVE-2009-3560-revised.patch?revision=1.1
-
-http://nvd.nist.gov/nvd.cfm?cvename=CVE-2009-3560
-http://bugs.gentoo.org/show_bug.cgi?id=303727
-http://cvs.fedoraproject.org/viewvc/rpms/expat/devel/
-
---- a/lib/xmlparse.c
-+++ b/lib/xmlparse.c
-@@ -3703,6 +3703,9 @@ doProlog(XML_Parser parser,
-         return XML_ERROR_UNCLOSED_TOKEN;
-       case XML_TOK_PARTIAL_CHAR:
-         return XML_ERROR_PARTIAL_CHAR;
-+      case -XML_TOK_PROLOG_S:
-+        tok = -tok;
-+        break;
-       case XML_TOK_NONE:
- #ifdef XML_DTD
-         /* for internal PE NOT referenced between declarations */
diff --git a/pkgs/development/libraries/expat/default.nix b/pkgs/development/libraries/expat/default.nix
index 35a2945207b..6b675230119 100644
--- a/pkgs/development/libraries/expat/default.nix
+++ b/pkgs/development/libraries/expat/default.nix
@@ -1,17 +1,15 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "expat-2.0.1";
-  
+stdenv.mkDerivation rec {
+  name = "expat-2.1.0";
+
   src = fetchurl {
-    url = mirror://sourceforge/expat/expat-2.0.1.tar.gz;
-    sha256 = "14sy5qx9hgjyfs743iq8ywldhp5w4n6cscqf2p4hgrw6vys60xl4";
+    url = "mirror://sourceforge/expat/${name}.tar.gz";
+    sha256 = "11pblz61zyxh68s5pdcbhc30ha1b2vfjd83aiwfg4vc15x3hadw2";
   };
 
-  patches = [ ./cve-2009-3560.patch ];
-
   meta = {
-    homepage = http://expat.sourceforge.net/;
+    homepage = http://www.libexpat.org/;
     description = "A stream-oriented XML parser library written in C";
   };
 }
diff --git a/pkgs/development/libraries/farsight2/default.nix b/pkgs/development/libraries/farsight2/default.nix
index cbb21073685..3467ac2cc3b 100644
--- a/pkgs/development/libraries/farsight2/default.nix
+++ b/pkgs/development/libraries/farsight2/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnice python pygobject gst_python gupnp_igd ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ gstreamer gst_plugins_base ];
 
diff --git a/pkgs/development/libraries/farstream/default.nix b/pkgs/development/libraries/farstream/default.nix
index b2b8ca6255b..7d84cf88993 100644
--- a/pkgs/development/libraries/farstream/default.nix
+++ b/pkgs/development/libraries/farstream/default.nix
@@ -1,5 +1,7 @@
 { stdenv, fetchurl, libnice, pkgconfig, python, gstreamer, gst_plugins_base
-, pygobject, gst_python, gupnp_igd }:
+, pygobject, gst_python, gupnp_igd
+, gst_plugins_good, gst_plugins_bad, gst_ffmpeg
+}:
 
 stdenv.mkDerivation rec {
   name = "farstream-0.1.2";
@@ -8,11 +10,13 @@ stdenv.mkDerivation rec {
     sha256 = "1nbkbvq959f70zhr03fwdibhs0sbf1k7zmbz9w99vda7gdcl0nps";
   };
 
-  buildInputs = [ libnice python pygobject gst_python gupnp_igd ];
+  buildInputs = [ libnice python pygobject gupnp_igd libnice ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
-  propagatedBuildInputs = [ gstreamer gst_plugins_base ];
+  propagatedBuildInputs = [ gstreamer gst_plugins_base gst_python
+    gst_plugins_good gst_plugins_bad gst_ffmpeg
+    ];
 
   meta = {
     homepage = http://www.freedesktop.org/wiki/Software/Farstream;
diff --git a/pkgs/development/libraries/ffmpeg/1.x.nix b/pkgs/development/libraries/ffmpeg/1.x.nix
new file mode 100644
index 00000000000..119e785ea4f
--- /dev/null
+++ b/pkgs/development/libraries/ffmpeg/1.x.nix
@@ -0,0 +1,96 @@
+{ stdenv, fetchurl, pkgconfig, yasm, zlib, bzip2, alsaLib, texinfo, perl
+, mp3Support ? true, lame ? null
+, speexSupport ? true, speex ? null
+, theoraSupport ? true, libtheora ? null
+, vorbisSupport ? true, libvorbis ? null
+, vpxSupport ? false, libvpx ? null
+, x264Support ? true, x264 ? null
+, xvidSupport ? true, xvidcore ? null
+, opusSupport ? true, libopus ? null
+, vdpauSupport ? true, libvdpau ? null
+, vaapiSupport ? true, libva ? null
+, faacSupport ? false, faac ? null
+, dc1394Support ? false, libdc1394 ? null
+, x11grabSupport ? false, libXext ? null, libXfixes ? null
+, playSupport ? true, SDL ? null
+}:
+
+assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert vorbisSupport -> libvorbis != null;
+assert vpxSupport -> libvpx != null;
+assert x264Support -> x264 != null;
+assert xvidSupport -> xvidcore != null;
+assert opusSupport -> libopus != null;
+assert vdpauSupport -> libvdpau != null;
+assert vaapiSupport -> libva != null;
+assert faacSupport -> faac != null;
+assert x11grabSupport -> libXext != null && libXfixes != null;
+assert playSupport -> SDL != null;
+
+stdenv.mkDerivation rec {
+  name = "ffmpeg-1.2";
+  
+  src = fetchurl {
+    url = "http://www.ffmpeg.org/releases/${name}.tar.bz2";
+    sha256 = "1bssxbn4p813xlgb8whg4b60j90yzfy92x70b4q8j35fgp0gnfcs";
+  };
+  
+  # `--enable-gpl' (as well as the `postproc' and `swscale') mean that
+  # the resulting library is GPL'ed, so it can only be used in GPL'ed
+  # applications.
+  configureFlags = [
+    "--enable-gpl"
+    "--enable-postproc"
+    "--enable-swscale"
+    "--enable-shared"
+    "--enable-avresample"
+    "--enable-runtime-cpudetect"
+  ]
+    ++ stdenv.lib.optional mp3Support "--enable-libmp3lame"
+    ++ stdenv.lib.optional speexSupport "--enable-libspeex"
+    ++ stdenv.lib.optional theoraSupport "--enable-libtheora"
+    ++ stdenv.lib.optional vorbisSupport "--enable-libvorbis"
+    ++ stdenv.lib.optional vpxSupport "--enable-libvpx"
+    ++ stdenv.lib.optional x264Support "--enable-libx264"
+    ++ stdenv.lib.optional xvidSupport "--enable-libxvid"
+    ++ stdenv.lib.optional opusSupport "--enable-libopus"
+    ++ stdenv.lib.optional vdpauSupport "--enable-vdpau"
+    ++ stdenv.lib.optional faacSupport "--enable-libfaac --enable-nonfree"
+    ++ stdenv.lib.optional dc1394Support "--enable-libdc1394"
+    ++ stdenv.lib.optional x11grabSupport "--enable-x11grab"
+    ++ stdenv.lib.optional playSupport "--enable-ffplay";
+
+  buildInputs = [ pkgconfig lame yasm zlib bzip2 alsaLib texinfo perl ]
+    ++ stdenv.lib.optional mp3Support lame
+    ++ stdenv.lib.optional speexSupport speex
+    ++ stdenv.lib.optional theoraSupport libtheora
+    ++ stdenv.lib.optional vorbisSupport libvorbis
+    ++ stdenv.lib.optional vpxSupport libvpx
+    ++ stdenv.lib.optional x264Support x264
+    ++ stdenv.lib.optional xvidSupport xvidcore
+    ++ stdenv.lib.optional opusSupport libopus
+    ++ stdenv.lib.optional vdpauSupport libvdpau
+    ++ stdenv.lib.optional vaapiSupport libva
+    ++ stdenv.lib.optional faacSupport faac
+    ++ stdenv.lib.optional dc1394Support libdc1394
+    ++ stdenv.lib.optionals x11grabSupport [ libXext libXfixes ]
+    ++ stdenv.lib.optional playSupport SDL;
+
+  enableParallelBuilding = true;
+    
+  crossAttrs = {
+    dontSetConfigureCross = true;
+    configureFlags = configureFlags ++ [
+      "--cross-prefix=${stdenv.cross.config}-"
+      "--enable-cross-compile"
+      "--target_os=linux"
+      "--arch=${stdenv.cross.arch}"
+      ];
+  };
+
+  meta = {
+    homepage = http://www.ffmpeg.org/;
+    description = "A complete, cross-platform solution to record, convert and stream audio and video";
+  };
+}
diff --git a/pkgs/development/libraries/ffmpeg/default.nix b/pkgs/development/libraries/ffmpeg/default.nix
index 3b5e28a2ee7..b37fcdf4436 100644
--- a/pkgs/development/libraries/ffmpeg/default.nix
+++ b/pkgs/development/libraries/ffmpeg/default.nix
@@ -74,6 +74,10 @@ stdenv.mkDerivation rec {
       ];
   };
 
+  passthru = {
+    inherit vdpauSupport;
+  };
+
   meta = {
     homepage = http://www.ffmpeg.org/;
     description = "A complete, cross-platform solution to record, convert and stream audio and video";
diff --git a/pkgs/development/libraries/ffms/default.nix b/pkgs/development/libraries/ffms/default.nix
new file mode 100644
index 00000000000..38371ec276d
--- /dev/null
+++ b/pkgs/development/libraries/ffms/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, zlib, ffmpeg, pkgconfig }:
+
+stdenv.mkDerivation {
+  name = "ffms-2.17";
+  
+  src = fetchurl {
+    url = http://ffmpegsource.googlecode.com/files/ffms-2.17-src.tar.bz2;
+    sha256 = "0gb42hrwnldz3zjlk4llx85dvxysxlfrdf5yy3fay8r8k1vpl7wr";
+  };
+
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  buildInputs = [ zlib ffmpeg pkgconfig ];
+
+  meta = {
+    homepage = http://code.google.com/p/ffmpegsource/;
+    description = "Libav/ffmpeg based source library for easy frame accurate access";
+    license = "MIT";
+  };
+}
diff --git a/pkgs/development/libraries/fftw/default.nix b/pkgs/development/libraries/fftw/default.nix
index 6b4fbe7df6c..e096c5fa94f 100644
--- a/pkgs/development/libraries/fftw/default.nix
+++ b/pkgs/development/libraries/fftw/default.nix
@@ -1,4 +1,4 @@
-{fetchurl, stdenv, builderDefs, stringsWithDeps, singlePrecision ? false, pthreads ? false}:
+{fetchurl, stdenv, builderDefs, stringsWithDeps, singlePrecision ? false, pthreads ? false, float ? false}:
 let
   version = "3.3.2";
   localDefs = builderDefs.passthru.function { 
@@ -12,6 +12,7 @@ let
                         # some distros seem to be shipping both versions within the same package?
                         # why does --enable-float still result in ..3f.so instead of ..3.so?
                    ++ (if singlePrecision then [ "--enable-single" ] else [ ])
+                   ++ (if float then [ "--enable-float" ] else [ ])
 		   ++ (stdenv.lib.optional (!pthreads) "--enable-openmp")
 		   ++ (stdenv.lib.optional pthreads "--enable-threads")
                         # I think all i686 has sse
diff --git a/pkgs/development/libraries/flann/default.nix b/pkgs/development/libraries/flann/default.nix
index eaf4ed8836e..4e4391a50f7 100644
--- a/pkgs/development/libraries/flann/default.nix
+++ b/pkgs/development/libraries/flann/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, unzip, cmake, python}:
 
 stdenv.mkDerivation {
-  name = "flann-1.6.8";
+  name = "flann-1.8.4";
   
   src = fetchurl {
-    url = http://people.cs.ubc.ca/~mariusm/uploads/FLANN/flann-1.6.8-src.zip;
-    sha256 = "0ag9k821jy0983gjrfsjnqkl5axklcih0qkpfy72h3643nin0f50";
+    url = http://people.cs.ubc.ca/~mariusm/uploads/FLANN/flann-1.8.4-src.zip;
+    sha256 = "022w8hph7bli5zbpnk3z1qh1c2sl5hm8fw2ccim651ynn0hr7fyz";
   };
 
   buildInputs = [ unzip cmake python ];
@@ -14,5 +14,7 @@ stdenv.mkDerivation {
     homepage = http://people.cs.ubc.ca/~mariusm/flann/;
     license = "BSD";
     description = "Fast approximate nearest neighbor searches in high dimensional spaces";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/fltk/fltk13.nix b/pkgs/development/libraries/fltk/fltk13.nix
index d3d89e6a907..3ab267ad6b4 100644
--- a/pkgs/development/libraries/fltk/fltk13.nix
+++ b/pkgs/development/libraries/fltk/fltk13.nix
@@ -14,7 +14,7 @@ composableDerivation.composableDerivation {} {
 
   propagatedBuildInputs = [ x11 inputproto libXi freeglut ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   flags =
     # this could be tidied up (?).. eg why does it require freeglut without glSupport?
diff --git a/pkgs/development/libraries/fmod/default.nix b/pkgs/development/libraries/fmod/default.nix
index f73480b3ce4..d85a24fa63a 100644
--- a/pkgs/development/libraries/fmod/default.nix
+++ b/pkgs/development/libraries/fmod/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation {
   name = "fmod-42204";
-  src = if (stdenv.system == "i686-linux") then
+  src = if stdenv.system == "i686-linux" then
     fetchurl {
       url = http://www.fmod.org/index.php/release/version/fmodapi42204linux.tar.gz;
       sha256 = "64eedc5b37c597eb925de446106d75cab0b5a79697d5ec048d34702812c08563";
-    } else if (stdenv.system == "x86_64-linux") then
+    } else if stdenv.system == "x86_64-linux" then
     fetchurl {
       url = http://www.fmod.org/index.php/release/version/fmodapi42204linux64.tar.gz;
       sha256 = "3f2eec8265838a1005febe07c4971660e85010e4622911890642dc438746edf3";
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 8e016401e3d..116fe3c0c20 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -1,22 +1,21 @@
-{ stdenv, fetchurl, freetype, expat }:
+{ stdenv, fetchurl, pkgconfig, freetype, expat }:
 
 stdenv.mkDerivation rec {
-  name = "fontconfig-2.8.0";
-  
+  name = "fontconfig-2.10.1";
+
   src = fetchurl {
     url = "http://fontconfig.org/release/${name}.tar.gz";
-    sha256 = "0d9370qnn1qzq0jidbycin2frkcr1kqj04jbgb79ykb5x9p1qaps";
+    sha256 = "08h252crb3aqciwdk81jypmz2i7618dzqn3zlr87w1f017wjp4f3";
   };
-  
-  buildInputs = [ freetype ];
+
+  buildInputs = [ pkgconfig freetype ];
+
   propagatedBuildInputs = [ expat ]; # !!! shouldn't be necessary, but otherwise pango breaks
 
   configureFlags = "--with-confdir=/etc/fonts --with-cache-dir=/var/cache/fontconfig --disable-docs --with-default-fonts=";
 
   # We should find a better way to access the arch reliably.
-  crossArch = if (stdenv ? cross && stdenv.cross != null)
-    then stdenv.cross.arch else null;
-
+  crossArch = stdenv.cross.arch or null;
 
   preConfigure = ''
     if test -n "$crossConfig"; then
@@ -24,6 +23,8 @@ stdenv.mkDerivation rec {
     fi
   '';
 
+  enableParallelBuilding = true;
+
   # Don't try to write to /etc/fonts or /var/cache/fontconfig at install time.
   installFlags = "CONFDIR=$(out)/etc/fonts RUN_FC_CACHE_TEST=false fc_cachedir=$(TMPDIR)/dummy";
 
@@ -31,5 +32,5 @@ stdenv.mkDerivation rec {
     description = "A library for font customization and configuration";
     homepage = http://fontconfig.org/;
     license = "bsd";
-  };  
+  };
 }
diff --git a/pkgs/development/libraries/fox/default.nix b/pkgs/development/libraries/fox/default.nix
new file mode 100644
index 00000000000..87e47e1b046
--- /dev/null
+++ b/pkgs/development/libraries/fox/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, x11, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft }:
+
+let
+  version = "1.7.9";
+in
+
+stdenv.mkDerivation rec {
+  name = "fox-${version}";
+
+  src = fetchurl {
+    url = "ftp://ftp.fox-toolkit.org/pub/${name}.tar.gz";
+    md5 = "b5897e9c664967f5042e57070037ff18";
+  };
+
+  buildInputs = [ x11 libpng libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "FOX is a C++ based class library for building Graphical User Interfaces";
+    longDescription = ''
+        FOX stands for Free Objects for X.
+        It is a C++ based class library for building Graphical User Interfaces.
+        Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
+        Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
+      '';
+    homepage = "http://fox-toolkit.org";
+    license = "LGPLv3";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/fox/fox-1.6.nix b/pkgs/development/libraries/fox/fox-1.6.nix
new file mode 100644
index 00000000000..540c2c61d94
--- /dev/null
+++ b/pkgs/development/libraries/fox/fox-1.6.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, x11, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor
+, libXrandr, mesa, libXft, libXfixes, xinput }:
+
+let
+  version = "1.6.48";
+in
+
+stdenv.mkDerivation rec {
+  name = "fox-${version}";
+
+  src = fetchurl {
+    url = "ftp://ftp.fox-toolkit.org/pub/${name}.tar.gz";
+    sha256 = "1i0q0357lrd41jjr2nkf2a7ls5ls2nwrkxbfc7202vy22942lb9k";
+  };
+
+  buildInputs = [ x11 libpng libjpeg libtiff zlib bzip2 libXcursor libXrandr
+      libXft mesa libXfixes xinput ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "FOX is a C++ based class library for building Graphical User Interfaces";
+    longDescription = ''
+        FOX stands for Free Objects for X.
+        It is a C++ based class library for building Graphical User Interfaces.
+        Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
+        Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
+      '';
+    homepage = "http://fox-toolkit.org";
+    license = "LGPLv3";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch b/pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch
deleted file mode 100644
index 1642affba91..00000000000
--- a/pkgs/development/libraries/freeglut/freeglut-gcc-4.2.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -urN freeglut-2.4.0.old/src/freeglut_joystick.c freeglut-2.4.0/src/freeglut_joystick.c
---- freeglut-2.4.0.old/src/freeglut_joystick.c	2007-06-16 03:51:41.000000000 +0000
-+++ freeglut-2.4.0/src/freeglut_joystick.c	2007-06-16 03:54:27.000000000 +0000
-@@ -1682,9 +1682,6 @@
- 
-   fgInitialiseJoysticks ();
- 
--  if ( !fgJoystick )
--    return 0;
--
-   if ( !fgState.JoysticksInitialised )
-     return 0;
- 
diff --git a/pkgs/development/libraries/freeimage/default.nix b/pkgs/development/libraries/freeimage/default.nix
index ec381dc433a..c3cfa6e8c87 100644
--- a/pkgs/development/libraries/freeimage/default.nix
+++ b/pkgs/development/libraries/freeimage/default.nix
@@ -1,9 +1,9 @@
 {stdenv, fetchurl, unzip}:
 stdenv.mkDerivation {
-  name = "freeimage-3.15.0";
+  name = "freeimage-3.15.3";
   src = fetchurl {
-    url = mirror://sourceforge/freeimage/FreeImage3150.zip;
-    sha256 = "0diyj862sdqwjqb7v2nccf8cl6886v937jkw6dgszp86qpwsfx3n";
+    url = mirror://sourceforge/freeimage/FreeImage3153.zip;
+    sha256 = "0i60fn1n9rw55dci0yw92zrw7k1jz3f9kv2z1wxmh84s5ngxa626";
   };
   buildInputs = [ unzip ];
   prePatch = ''
diff --git a/pkgs/development/libraries/freetype/default.nix b/pkgs/development/libraries/freetype/default.nix
index 8d4e769060a..4c695ab3345 100644
--- a/pkgs/development/libraries/freetype/default.nix
+++ b/pkgs/development/libraries/freetype/default.nix
@@ -6,32 +6,42 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "freetype-2.4.4";
+  name = "freetype-2.4.10";
 
   src = fetchurl {
     url = "mirror://sourceforge/freetype/${name}.tar.bz2";
-    sha256 = "1vqg93473j6jma1bxms7mczk32j8is0g9inkcmmmqdsdvk3q30jb";
+    sha256 = "0bwrkqpygayfc1rf6rr1nb8l3svgn1fmjz8davg2hnf46cn293hc";
   };
 
   outputs = [ "dev" "out" ];
 
   configureFlags = "--disable-static --bindir=$(dev)/bin";
 
-  # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
-  buildInputs = stdenv.lib.optional (stdenv.system == "i686-freebsd") gnumake;
-
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString useEncumberedCode
     "-DFT_CONFIG_OPTION_SUBPIXEL_RENDERING=1";
 
   # The asm for armel is written with the 'asm' keyword.
   CFLAGS = stdenv.lib.optionalString stdenv.isArm "-std=gnu99";
 
+  # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
+  buildInputs = stdenv.lib.optional (!stdenv.isLinux) gnumake;
+
+  enableParallelBuilding = true;
+
   postInstall =
     ''
       mkdir $dev/lib
       mv $out/lib/pkgconfig $dev/lib/
+      ln -s freetype2/freetype $dev/include/freetype
     '';
 
+  crossAttrs = {
+    # Somehow it calls the unwrapped gcc, "i686-pc-linux-gnu-gcc", instead
+    # of gcc. I think it's due to the unwrapped gcc being in the PATH. I don't
+    # know why it's on the PATH.
+    configureFlags = "--disable-static CC_BUILD=gcc";
+  };
+
   meta = {
     description = "A font rendering engine";
     homepage = http://www.freetype.org/;
diff --git a/pkgs/development/libraries/ftgl/2.1.2.nix b/pkgs/development/libraries/ftgl/2.1.2.nix
index 121f99e3b03..c83173450b1 100644
--- a/pkgs/development/libraries/ftgl/2.1.2.nix
+++ b/pkgs/development/libraries/ftgl/2.1.2.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
 
   buildInputs = [freetype mesa];
 
+  NIX_LDFLAGS = "-lGLU -lGL";
+
   patches = [ ./gcc.patch ];
 
   configureFlags = "--enable-shared";
diff --git a/pkgs/development/libraries/funambol/default.nix b/pkgs/development/libraries/funambol/default.nix
index 589ffaba3f9..98049e0ca35 100644
--- a/pkgs/development/libraries/funambol/default.nix
+++ b/pkgs/development/libraries/funambol/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib curl ];
 
-  buildNativeInputs = [ automake libtool autoconf unzip ];
+  nativeBuildInputs = [ automake libtool autoconf unzip ];
 
   meta = {
     description = "SyncML client sdk by Funambol project";
diff --git a/pkgs/development/libraries/gamin/deadlock.patch b/pkgs/development/libraries/gamin/deadlock.patch
new file mode 100644
index 00000000000..e2abc8ce2d9
--- /dev/null
+++ b/pkgs/development/libraries/gamin/deadlock.patch
@@ -0,0 +1,68 @@
+Fix for a deadlock:
+https://bugzilla.gnome.org/show_bug.cgi?id=667230
+
+From cc14440eface093548cb3bc7814da11d9a99d283 Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi@mageia.org>
+Date: Wed, 4 Jan 2012 00:23:55 +0200
+Subject: [PATCH] fix possible server deadlock in ih_sub_cancel
+
+ih_sub_foreach() calls ih_sub_cancel() while inotify_lock is locked.
+However, ih_sub_cancel() locks it again, and locking GMutex recursively
+causes undefined behaviour.
+
+Fix that by removing locking from ih_sub_cancel() as ih_sub_foreach()
+is its only user. Also make the function static so that it won't
+accidentally get used by other files without locking (inotify-helper.h
+is an internal server header).
+
+This should fix the intermittent deadlocks I've been experiencing
+causing KDE applications to no longer start, and probably also
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542361
+---
+ server/inotify-helper.c |    7 ++-----
+ server/inotify-helper.h |    1 -
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/server/inotify-helper.c b/server/inotify-helper.c
+index d77203e..0789fa4 100644
+--- a/server/inotify-helper.c
++++ b/server/inotify-helper.c
+@@ -123,13 +123,11 @@ ih_sub_add (ih_sub_t * sub)
+ 
+ /**
+  * Cancels a subscription which was being monitored.
++ * inotify_lock must be held when calling.
+  */
+-gboolean
++static gboolean
+ ih_sub_cancel (ih_sub_t * sub)
+ {
+-	G_LOCK(inotify_lock);
+-
+-
+ 	if (!sub->cancelled)
+ 	{
+ 		IH_W("cancelling %s\n", sub->pathname);
+@@ -140,7 +138,6 @@ ih_sub_cancel (ih_sub_t * sub)
+ 		sub_list = g_list_remove (sub_list, sub);
+ 	}
+ 
+-	G_UNLOCK(inotify_lock);
+ 	return TRUE;
+ }
+ 
+diff --git a/server/inotify-helper.h b/server/inotify-helper.h
+index 5d3b6d0..d36b5fd 100644
+--- a/server/inotify-helper.h
++++ b/server/inotify-helper.h
+@@ -34,7 +34,6 @@ gboolean	 ih_startup		(event_callback_t ecb,
+ 					 found_callback_t fcb);
+ gboolean	 ih_running		(void);
+ gboolean	 ih_sub_add		(ih_sub_t *sub);
+-gboolean	 ih_sub_cancel		(ih_sub_t *sub);
+ 
+ /* Return FALSE from 'f' if the subscription should be cancelled */
+ void		 ih_sub_foreach		(void *callerdata, gboolean (*f)(ih_sub_t *sub, void *callerdata));
+-- 
+1.7.7.2
+
diff --git a/pkgs/development/libraries/gamin/debian-patches.nix b/pkgs/development/libraries/gamin/debian-patches.nix
index 1da558db141..f784b8ccfee 100644
--- a/pkgs/development/libraries/gamin/debian-patches.nix
+++ b/pkgs/development/libraries/gamin/debian-patches.nix
@@ -1,6 +1,6 @@
 # Generated by debian-patches.sh from debian-patches.txt
 let
-  prefix = "http://patch-tracker.debian.org/patch/series/dl/gamin/0.1.10-4";
+  prefix = "http://patch-tracker.debian.org/patch/series/dl/gamin/0.1.10-4.1";
 in
 [
   {
diff --git a/pkgs/development/libraries/gamin/default.nix b/pkgs/development/libraries/gamin/default.nix
index a212946c67f..b61101654ba 100644
--- a/pkgs/development/libraries/gamin/default.nix
+++ b/pkgs/development/libraries/gamin/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "18cr51y5qacvs2fc2p1bqv32rs8bzgs6l67zhasyl45yx055y218";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ python glib ];
 
@@ -16,5 +16,5 @@ stdenv.mkDerivation rec {
   # <sys/socket.h> with Glibc 2.9.
   configureFlags = "--disable-debug --with-python=${python} CPPFLAGS=-D_GNU_SOURCE";
 
-  patches = map fetchurl (import ./debian-patches.nix);
+  patches = [ ./deadlock.patch ] ++ map fetchurl (import ./debian-patches.nix);
 }
diff --git a/pkgs/development/libraries/gdk-pixbuf/2.24.x.nix b/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix
index 80cc3f36f00..b3bd378e0e9 100644
--- a/pkgs/development/libraries/gdk-pixbuf/2.24.x.nix
+++ b/pkgs/development/libraries/gdk-pixbuf/2.26.x.nix
@@ -1,12 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz
-, jasper }:
+{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz, jasper }:
 
-stdenv.mkDerivation {
-  name = "gdk-pixbuf-2.24.1";
+stdenv.mkDerivation rec {
+  name = "gdk-pixbuf-2.26.1";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gdk-pixbuf/2.24/gdk-pixbuf-2.24.1.tar.xz;
-    sha256 = "1qdywh1r75lalb7z6s9pm6pmqx82chrrxqb8cdqi629nvc03yyns";
+    url = "mirror://gnome/sources/gdk-pixbuf/2.26/${name}.tar.xz";
+    sha256 = "a60af12b58d9cc15ba4c680c6730ce5d38e8d664af1d575a379385b94b4ec7ba";
   };
 
   outputs = [ "dev" "out" "bin" "doc" ];
@@ -16,7 +15,7 @@ stdenv.mkDerivation {
   # !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
   buildInputs = [ libX11 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];
 
diff --git a/pkgs/development/libraries/gegl/default.nix b/pkgs/development/libraries/gegl/default.nix
index 5da6e3e40f4..a30d5c78e7f 100644
--- a/pkgs/development/libraries/gegl/default.nix
+++ b/pkgs/development/libraries/gegl/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk bzip2 intltool ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = { 
     description = "Graph-based image processing framework";
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 73366b2bdc9..5468c9f2336 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation (rec {
     sha256 = "1sa3ch12qxa4h3ya6hkz119yclcccmincl9j20dhrdx5mykp3b4k";
   };
 
+  patches = [ ./no-gets.patch ];
+
   configureFlags = [ "--disable-csharp" ]
      ++ (stdenv.lib.optionals stdenv.isCygwin
           [ # We have a static libiconv, so we can only build the static lib.
@@ -34,7 +36,7 @@ stdenv.mkDerivation (rec {
       
   crossAttrs = {
     buildInputs = stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
-      stdenv.gccCross.libc.libiconv.hostDrv;
+      stdenv.gccCross.libc.libiconv.crossDrv;
     # Gettext fails to guess the cross compiler
     configureFlags = "CXX=${stdenv.cross.config}-g++";
   };
diff --git a/pkgs/development/libraries/gettext/no-gets.patch b/pkgs/development/libraries/gettext/no-gets.patch
new file mode 100644
index 00000000000..9daa48eae64
--- /dev/null
+++ b/pkgs/development/libraries/gettext/no-gets.patch
@@ -0,0 +1,42 @@
+hack until gzip pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/gettext-tools/libgettextpo/stdio.in.h
++++ b/gettext-tools/libgettextpo/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+--- a/gettext-tools/gnulib-lib/stdio.in.h
++++ b/gettext-tools/gnulib-lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
+--- a/gettext-runtime/gnulib-lib/stdio.in.h
++++ b/gettext-runtime/gnulib-lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/development/libraries/git2/default.nix b/pkgs/development/libraries/git2/default.nix
new file mode 100644
index 00000000000..2e7a8d33cb0
--- /dev/null
+++ b/pkgs/development/libraries/git2/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, cmake, zlib, python}:
+
+stdenv.mkDerivation rec {
+  version = "0.18.0";
+  name = "libgit2-${version}";
+
+  src = fetchurl {
+    name = "${name}.tar.gz";
+    url = "https://github.com/libgit2/libgit2/tarball/v${version}";
+    md5 = "50409ddb0c34713677b33ef617e92c94";
+  };
+
+  nativeBuildInputs = [ cmake python ];
+  buildInputs = [ zlib ];
+
+  meta = {
+    description = "the Git linkable library";
+    homepage = http://libgit2.github.com/;
+    license = with stdenv.lib.licenses; gpl2;
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/development/libraries/glew/default.nix b/pkgs/development/libraries/glew/default.nix
index db36944dcb2..77686c9a7de 100644
--- a/pkgs/development/libraries/glew/default.nix
+++ b/pkgs/development/libraries/glew/default.nix
@@ -1,23 +1,25 @@
 { stdenv, fetchurl, mesa, x11, libXmu, libXi }:
 
 stdenv.mkDerivation rec {
-  name = "glew-1.7.0";
+  name = "glew-1.9.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/glew/${name}.tgz";
-    sha256 = "02aw6sc4v1434m7awfcxqb0v987i2ykg3fncnp21i9g1n4zsclqn";
+    sha256 = "11xpmsw7m5qn7y8fa2ihhqcislz1bdd83mp99didd5ac84756dlv";
   };
 
   buildInputs = [ mesa x11 libXmu libXi ];
 
-  installPhase = "
-    GLEW_DEST=\$out make install
-    mkdir -pv \$out/share/doc/glew
-    cp -r README.txt LICENSE.txt doc  \$out/share/doc/glew
-  ";
-  
-  meta = { 
-    description = "Cross-platform open-source C/C++ extension loading library";
+  installPhase = ''
+    GLEW_DEST=$out make install
+    mkdir -pv $out/share/doc/glew
+    mkdir -p $out/lib/pkgconfig
+    cp glew*.pc $out/lib/pkgconfig
+    cp -r README.txt LICENSE.txt doc $out/share/doc/glew
+  '';
+
+  meta = {
+    description = "An OpenGL extension loading library for C(++)";
     homepage = http://glew.sourceforge.net/;
     license = ["BSD" "GLX" "SGI-B" "GPL2"]; # License description copied from gentoo-1.4.0 
   };
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 107a583d102..2c651980eda 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     sed -e "s@${glib}/lib/gio/modules@$out/lib/gio/modules@g" -i $(find . -name Makefile)
   '';
 
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
   propagatedBuildInputs =
     [ glib libtool gnutls2 libproxy libgcrypt libtasn1 gsettings_desktop_schemas ];
 }
diff --git a/pkgs/development/libraries/glib/2.30.x.nix b/pkgs/development/libraries/glib/2.34.x.nix
index 444259ef274..abc36908105 100644
--- a/pkgs/development/libraries/glib/2.30.x.nix
+++ b/pkgs/development/libraries/glib/2.34.x.nix
@@ -11,27 +11,27 @@
 #     Reminder: add 'sed -e 's@python2\.[0-9]@python@' -i
 #       $out/bin/gtester-report' to postInstall if this is solved
 
-stdenv.mkDerivation rec {
-  name = "glib-2.30.3";
+stdenv.mkDerivation (rec {
+  name = "glib-2.34.0";
 
   src = fetchurl {
-    url = mirror://gnome/sources/glib/2.30/glib-2.30.3.tar.xz;
-    sha256 = "09yxfajynbw78kji48z384lylp67kihfi1g78qrrjif4f5yb5jz6";
+    url = "mirror://gnome/sources/glib/2.34/${name}.tar.xz";
+    sha256 = "f69b112f8848be35139d9099b62bc81649241f78f6a775516f0d4c9b47f65144";
   };
 
-  enableParallelBuilding = true;
-
   outputs = [ "dev" "out" "bin" "doc" ];
 
   # configure script looks for d-bus but it is only needed for tests
-  buildInputs = [ pcre ] ++ stdenv.lib.optional (libiconvOrNull != null) libiconvOrNull;
+  buildInputs = [ libiconvOrNull ];
 
-  buildNativeInputs = [ perl pkgconfig gettext python ];
+  nativeBuildInputs = [ perl pkgconfig gettext python ];
 
-  propagatedBuildInputs = [ zlib libffi ];
+  propagatedBuildInputs = [ pcre zlib libffi ];
 
   configureFlags = "--with-pcre=system --disable-fam";
 
+  enableParallelBuilding = true;
+
   passthru.gioModuleDir = "lib/gio/modules";
 
   meta = {
@@ -52,3 +52,13 @@ stdenv.mkDerivation rec {
     platforms = stdenv.lib.platforms.linux;
   };
 }
+
+//
+
+(stdenv.lib.optionalAttrs stdenv.isDarwin {
+  # XXX: Disable the NeXTstep back-end because stdenv.gcc doesn't support
+  # Objective-C.
+  postConfigure =
+    '' sed -i configure -e's/glib_have_cocoa=yes/glib_have_cocoa=no/g'
+    '';
+}))
diff --git a/pkgs/development/libraries/glibc/2.13/common.nix b/pkgs/development/libraries/glibc/2.13/common.nix
index cc8c5373ff5..8be076f335c 100644
--- a/pkgs/development/libraries/glibc/2.13/common.nix
+++ b/pkgs/development/libraries/glibc/2.13/common.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation ({
   inherit kernelHeaders installLocales;
 
   # The host/target system.
-  crossConfig = if (cross != null) then cross.config else null;
+  crossConfig = if cross != null then cross.config else null;
 
   inherit (stdenv) is64bit;
 
@@ -102,14 +102,16 @@ stdenv.mkDerivation ({
     "-C"
     "--enable-add-ons"
     "--sysconfdir=/etc"
-    "--localedir=/var/run/current-system/sw/lib/locale" ] ++
-    (stdenv.lib.optional (stdenv.name == "stdenv") "libc_cv_ssp=no") ++ [
+    "--localedir=/var/run/current-system/sw/lib/locale"
+    "libc_cv_ssp=no"
     (if kernelHeaders != null
      then "--with-headers=${kernelHeaders}/include"
      else "--without-headers")
     (if profilingLibraries
      then "--enable-profile"
      else "--disable-profile")
+  ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [
+    "--enable-kernel=2.6.35"
   ] ++ stdenv.lib.optionals (cross != null) [
     (if cross.withTLS then "--with-tls" else "--without-tls")
     (if cross.float == "soft" then "--without-fp" else "--with-fp")
@@ -118,7 +120,8 @@ stdenv.mkDerivation ({
         && cross.platform.kernelMajor == "2.6") [
     "--enable-kernel=2.6.0"
     "--with-__thread"
-  ] ++ stdenv.lib.optionals stdenv.isArm [
+  ] ++ stdenv.lib.optionals (cross == null &&
+       (stdenv.system == "armv5tel-linux")) [
     "--host=arm-linux-gnueabi"
     "--build=arm-linux-gnueabi"
     "--without-fp"
@@ -126,6 +129,14 @@ stdenv.mkDerivation ({
     # To avoid linking with -lgcc_s (dynamic link)
     # so the glibc does not depend on its compiler store path
     "libc_cv_as_needed=no"
+  ] ++ stdenv.lib.optionals (cross == null && stdenv.platform.name == "raspberrypi") [
+    "--host=arm-linux-gnueabi"
+    "--build=arm-linux-gnueabi"
+    "--with-fp"
+
+    # To avoid linking with -lgcc_s (dynamic link)
+    # so the glibc does not depend on its compiler store path
+    "libc_cv_as_needed=no"
   ];
 
   installFlags = [ "sysconfdir=$(out)/etc" ];
diff --git a/pkgs/development/libraries/glibc/2.14/common.nix b/pkgs/development/libraries/glibc/2.14/common.nix
deleted file mode 100644
index ab3ef7c42f4..00000000000
--- a/pkgs/development/libraries/glibc/2.14/common.nix
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Build configuration used to build glibc, Info files, and locale
-   information.  */
-
-cross :
-
-{ name, fetchurl, stdenv, installLocales ? false
-, gccCross ? null, kernelHeaders ? null
-, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
-, profilingLibraries ? false, meta
-, preConfigure ? "", ... }@args :
-
-let
-  # For GNU/Hurd, see below.
-  version = if hurdHeaders != null then "20111025" else "2.14.1";
-
-  needsPortsNative = stdenv.isMips || stdenv.isArm;
-  needsPortsCross = cross.arch == "mips" || cross.arch == "arm";
-  needsPorts = if (stdenv ? cross) && stdenv.cross != null then true
-    else if cross == null then needsPortsNative
-    else needsPortsCross;
-
-  srcPorts = fetchurl {
-    url = "mirror://gnu/glibc/glibc-ports-2.14.1.tar.bz2";
-    sha256 = "1acs4sd5mjzmssmd0md6dfqwnziph2am7v09mbnnd8aadpxhm0qw";
-  };
-
-in
-
-assert (cross != null) -> (gccCross != null);
-
-assert (mig != null) -> (machHeaders != null);
-assert (machHeaders != null) -> (hurdHeaders != null);
-assert (hurdHeaders != null) -> (libpthreadHeaders != null);
-assert (hurdHeaders != null) -> (fetchgit != null);
-
-stdenv.mkDerivation ({
-  inherit kernelHeaders installLocales;
-
-  # The host/target system.
-  crossConfig = if (cross != null) then cross.config else null;
-
-  inherit (stdenv) is64bit;
-
-  enableParallelBuilding = true;
-
-  patches =
-    stdenv.lib.optional (fetchgit == null)
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-  ++ [
-    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
-    ./rpcgen-path.patch
-
-    /* Allow nixos and nix handle the locale-archive. */
-    ./nix-locale-archive.patch
-
-    /* don't use /etc/ld.so.cache, for non-nixos systems */
-    ./dont_use_system_ld_so_cache.patch
-
-    /* Without this patch many KDE binaries crash. */
-    ./glibc-elf-localscope.patch
-  ];
-
-  postPatch = ''
-    # Needed for glibc to build with the gnumake 3.82
-    # http://comments.gmane.org/gmane.linux.lfs.support/31227
-    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
-
-    # nscd needs libgcc, and we don't want it dynamically linked
-    # because we don't want it to depend on bootstrap-tools libs.
-    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
-  '';
-
-  configureFlags = [
-    "-C"
-    "--enable-add-ons"
-    "--sysconfdir=/etc"
-    "--localedir=/var/run/current-system/sw/lib/locale"
-    "libc_cv_ssp=no"
-    (if kernelHeaders != null
-     then "--with-headers=${kernelHeaders}/include"
-     else "--without-headers")
-    (if profilingLibraries
-     then "--enable-profile"
-     else "--disable-profile")
-  ] ++ stdenv.lib.optionals (cross != null) [
-    (if cross.withTLS then "--with-tls" else "--without-tls")
-    (if cross.float == "soft" then "--without-fp" else "--with-fp")
-    "--enable-kernel=2.6.0"
-    "--with-__thread"
-  ] ++ stdenv.lib.optionals stdenv.isArm [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-
-    # To avoid linking with -lgcc_s (dynamic link)
-    # so the glibc does not depend on its compiler store path
-    "libc_cv_as_needed=no"
-  ];
-
-  installFlags = [ "sysconfdir=$(out)/etc" ];
-  
-  buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
-    ++ stdenv.lib.optional (mig != null) mig;
-
-  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
-  # bootstrap.
-  BASH_SHELL = "/bin/sh";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
-}
-
-# Remove the `gccCross' attribute so that the *native* glibc store path
-# doesn't depend on whether `gccCross' is null or not.
-// (removeAttrs args [ "gccCross" ]) //
-
-{
-  name = name + "-${version}" +
-    stdenv.lib.optionalString (cross != null) "-${cross.config}";
-
-  src =
-    if hurdHeaders != null
-    then fetchgit {
-      # Shamefully the "official" glibc won't build on GNU, so use the one
-      # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
-      # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
-      url = "git://git.sv.gnu.org/hurd/glibc.git";
-      sha256 = "3fb3dd7030a4b6d3e144fa94c32a0c4f46f17f94e2dfbc6bef41cfc3198725ca";
-      rev = "d740cf9d201dc9ecb0335b0a585828dea9cce793";
-    }
-    else fetchurl {
-      url = "mirror://gnu/glibc/glibc-${version}.tar.bz2";
-      sha256 = "0fsvf5d6sib483rp7asdy8hs0dysxqkrvw316c82hsxy7vxa51bf";
-    };
-
-  # `fetchurl' is a function and thus should not be passed to the
-  # `derivation' primitive.
-  fetchurl = null;
-
-  # Remove absolute paths from `configure' & co.; build out-of-tree.
-  preConfigure = ''
-    export PWD_P=$(type -tP pwd)
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    ${if needsPorts then "tar xvf ${srcPorts}" else ""}
-
-    mkdir ../build
-    cd ../build
-
-    configureScript="`pwd`/../$sourceRoot/configure"
-
-    ${preConfigure}
-  '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-
-    longDescription =
-      '' Any Unix-like operating system needs a C library: the library which
-         defines the "system calls" and other basic facilities such as
-         open, malloc, printf, exit...
-
-         The GNU C library is used as the C library in the GNU system and
-         most systems with the Linux kernel.
-      '';
-
-    license = "LGPLv2+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    #platforms = stdenv.lib.platforms.linux;
-  } // meta;
-}
-
-//
-
-(if hurdHeaders != null
- then {
-   # Work around the fact that the configure snippet that looks for
-   # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
-   # glibc expects Mach, Hurd, and pthread headers to be in the same place.
-   CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
-
-   # `fetchgit' is a function and thus should not be passed to the
-   # `derivation' primitive.
-   fetchgit = null;
-
-   # Install NSS stuff in the right place.
-   # XXX: This will be needed for all new glibcs and isn't Hurd-specific.
-   makeFlags = ''vardbdir="$out/var/db"'';
- }
- else { }))
diff --git a/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch b/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch
deleted file mode 100644
index 444eb8251e4..00000000000
--- a/pkgs/development/libraries/glibc/2.14/dont_use_system_ld_so_cache.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff -Naur glibc-2.13-orig/elf/ldconfig.c glibc-2.13/elf/ldconfig.c
---- glibc-2.13-orig/elf/ldconfig.c	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/elf/ldconfig.c	2012-04-10 23:28:45.957492340 -0400
-@@ -51,7 +51,7 @@
- #endif
- 
- #ifndef LD_SO_CONF
--# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
-+# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
- #endif
- 
- /* Get libc version number.  */
-diff -Naur glibc-2.13-orig/elf/Makefile glibc-2.13/elf/Makefile
---- glibc-2.13-orig/elf/Makefile	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/elf/Makefile	2012-04-10 23:27:05.666477442 -0400
-@@ -459,11 +459,11 @@
- $(objpfx)sprof: $(libdl)
- 
- $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
--SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
--CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
-+PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
-+CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
- 		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
--CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
--CFLAGS-cache.c = $(SYSCONF-FLAGS)
-+CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
-+CFLAGS-cache.c = $(PREFIX-FLAGS)
- 
- CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
- 
-diff -Naur glibc-2.13-orig/sysdeps/generic/dl-cache.h glibc-2.13/sysdeps/generic/dl-cache.h
---- glibc-2.13-orig/sysdeps/generic/dl-cache.h	2011-01-17 23:34:07.000000000 -0500
-+++ glibc-2.13/sysdeps/generic/dl-cache.h	2012-04-10 23:28:20.077488815 -0400
-@@ -29,7 +29,7 @@
- #endif
- 
- #ifndef LD_SO_CACHE
--# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
-+# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
- #endif
- 
- #ifndef add_system_dir
diff --git a/pkgs/development/libraries/glibc/2.14/info.nix b/pkgs/development/libraries/glibc/2.14/info.nix
deleted file mode 100644
index 75bd996d9bc..00000000000
--- a/pkgs/development/libraries/glibc/2.14/info.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, texinfo, perl }:
-
-let build = import ./common.nix;
-in
-  /* null cross builder */
-  build null {
-    name = "glibc-info";
-
-    inherit fetchurl stdenv;
-
-    configureFlags = [ "--enable-add-ons" ];
-
-    buildInputs = [ texinfo perl ];
-
-    buildPhase = "make info";
-
-    # I don't know why the info is not generated in 'build'
-    # Somehow building the info still does not work, because the final
-    # libc.info hasn't a Top node.
-    installPhase = ''
-      mkdir -p "$out/share/info"
-      cp -v "../$sourceRoot/manual/"*.info* "$out/share/info"
-    '';
-
-    meta.description = "GNU Info manual of the GNU C Library";
-  }
diff --git a/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch
deleted file mode 100644
index e48dc2bc0a6..00000000000
--- a/pkgs/development/libraries/glibc/2.14/nss-skip-unavail.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ru glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c glibc-2.11.2/sysdeps/posix/getaddrinfo.c
---- glibc-2.11.2-orig/sysdeps/posix/getaddrinfo.c	2010-05-19 22:38:20.000000000 +0200
-+++ glibc-2.11.2/sysdeps/posix/getaddrinfo.c	2010-08-05 18:39:54.259556327 +0200
-@@ -505,8 +505,6 @@
- 	  int no_data = 0;
- 	  int no_inet6_data = 0;
- 	  service_user *nip = NULL;
--	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
--	  enum nss_status status = NSS_STATUS_UNAVAIL;
- 	  int no_more;
- 	  int old_res_options;
- 
-@@ -702,6 +700,8 @@
- 
- 	  while (!no_more)
- 	    {
-+ 	      enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+ 	      enum nss_status status = NSS_STATUS_UNAVAIL;
- 	      no_data = 0;
- 	      nss_gethostbyname4_r fct4
- 		= __nss_lookup_function (nip, "gethostbyname4_r");
diff --git a/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
deleted file mode 100644
index fbb03dd5fad..00000000000
--- a/pkgs/development/libraries/glibc/2.14/rpcgen-path.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
-(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
-patch makes it run any `cpp' command found in $PATH.
-
---- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
-+++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
-@@ -79,7 +79,7 @@ static const char *cmdname;
- 
- static const char *svcclosetime = "120";
- static int cppDefined;	/* explicit path for C preprocessor */
--static const char *CPP = SUNOS_CPP;
-+static const char *CPP = "cpp";
- static const char CPPFLAGS[] = "-C";
- static char *pathbuf;
- static int cpp_pid;
-@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
- static void open_output (const char *infile, const char *outfile);
- static void add_warning (void);
- static void clear_args (void);
--static void find_cpp (void);
- static void open_input (const char *infile, const char *define);
- static int check_nettype (const char *name, const char *list_to_check[]);
- static void c_output (const char *infile, const char *define,
-@@ -327,31 +326,6 @@ clear_args (void)
-   argcount = FIXEDARGS;
- }
- 
--/* make sure that a CPP exists */
--static void
--find_cpp (void)
--{
--  struct stat buf;
--
--  if (stat (CPP, &buf) < 0)
--    {				/* /lib/cpp or explicit cpp does not exist */
--      if (cppDefined)
--	{
--	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
--	  crash ();
--	}
--      else
--	{			/* try the other one */
--	  CPP = SVR4_CPP;
--	  if (stat (CPP, &buf) < 0)
--	    {			/* can't find any cpp */
--	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
--	      crash ();
--	    }
--	}
--    }
--}
--
- /*
-  * Open input file with given define for C-preprocessor
-  */
-@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
-   switch (cpp_pid)
-     {
-     case 0:
--      find_cpp ();
-       putarg (0, CPP);
-       putarg (1, CPPFLAGS);
-       addarg (define);
-@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
-       close (1);
-       dup2 (pd[1], 1);
-       close (pd[0]);
--      execv (arglist[0], (char **) arglist);
-+      execvp (arglist[0], (char **) arglist);
-       perror ("execv");
-       exit (1);
-     case -1:
diff --git a/pkgs/development/libraries/glibc/2.14/builder.sh b/pkgs/development/libraries/glibc/2.17/builder.sh
index e68e13f9bec..e68e13f9bec 100644
--- a/pkgs/development/libraries/glibc/2.14/builder.sh
+++ b/pkgs/development/libraries/glibc/2.17/builder.sh
diff --git a/pkgs/development/libraries/glibc/2.17/common.nix b/pkgs/development/libraries/glibc/2.17/common.nix
new file mode 100644
index 00000000000..413a0d7aae8
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/common.nix
@@ -0,0 +1,194 @@
+/* Build configuration used to build glibc, Info files, and locale
+   information.  */
+
+cross:
+
+{ name, fetchurl, fetchgit ? null, stdenv, installLocales ? false
+, gccCross ? null, kernelHeaders ? null
+, machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
+, mig ? null
+, profilingLibraries ? false, meta
+, preConfigure ? "", ... }@args:
+
+let
+
+  version = "2.17";
+
+in
+
+assert cross != null -> gccCross != null;
+assert mig != null -> machHeaders != null;
+assert machHeaders != null -> hurdHeaders != null;
+assert hurdHeaders != null -> libpthreadHeaders != null;
+
+stdenv.mkDerivation ({
+  inherit kernelHeaders installLocales;
+
+  # The host/target system.
+  crossConfig = if cross != null then cross.config else null;
+
+  inherit (stdenv) is64bit;
+
+  enableParallelBuilding = true;
+
+  /* Don't try to apply these patches to the Hurd's snapshot, which is
+     older.  */
+  patches = stdenv.lib.optionals (hurdHeaders == null)
+    [ /* Have rpcgen(1) look for cpp(1) in $PATH.  */
+      ./rpcgen-path.patch
+
+      /* Allow NixOS and Nix to handle the locale-archive. */
+      ./nix-locale-archive.patch
+
+      /* Don't use /etc/ld.so.cache, for non-NixOS systems.  */
+      ./dont-use-system-ld-so-cache.patch
+
+      /* Without this patch many KDE binaries crash. */
+      ./glibc-elf-localscope.patch
+
+      /* Add blowfish password hashing support.  This is needed for
+         compatibility with old NixOS installations (since NixOS used
+         to default to blowfish). */
+      ./glibc-crypt-blowfish.patch
+
+      /* Fix for random "./sysdeps/posix/getaddrinfo.c:1467:
+         rfc3484_sort: Assertion `src->results[i].native == -1 ||
+         src->results[i].native == a2_native' failed." crashes. */
+      ./glibc-rh739743.patch
+    ];
+
+  postPatch = ''
+    # Needed for glibc to build with the gnumake 3.82
+    # http://comments.gmane.org/gmane.linux.lfs.support/31227
+    sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+
+    # nscd needs libgcc, and we don't want it dynamically linked
+    # because we don't want it to depend on bootstrap-tools libs.
+    echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+  '';
+
+  configureFlags =
+    [ "-C"
+      "--enable-add-ons"
+      "--enable-obsolete-rpc"
+      "--sysconfdir=/etc"
+      "--localedir=/var/run/current-system/sw/lib/locale"
+      "libc_cv_ssp=no"
+      (if kernelHeaders != null
+       then "--with-headers=${kernelHeaders}/include"
+       else "--without-headers")
+      (if profilingLibraries
+       then "--enable-profile"
+       else "--disable-profile")
+    ] ++ stdenv.lib.optionals (cross == null && kernelHeaders != null) [
+      "--enable-kernel=2.6.35"
+    ] ++ stdenv.lib.optionals (cross != null) [
+      (if cross.withTLS then "--with-tls" else "--without-tls")
+      (if cross.float == "soft" then "--without-fp" else "--with-fp")
+    ] ++ stdenv.lib.optionals (cross != null
+          && cross.platform ? kernelMajor
+          && cross.platform.kernelMajor == "2.6") [
+      "--enable-kernel=2.6.0"
+      "--with-__thread"
+    ] ++ stdenv.lib.optionals (cross == null && stdenv.isArm) [
+      "--host=arm-linux-gnueabi"
+      "--build=arm-linux-gnueabi"
+
+      # To avoid linking with -lgcc_s (dynamic link)
+      # so the glibc does not depend on its compiler store path
+      "libc_cv_as_needed=no"
+    ];
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+
+  buildInputs = stdenv.lib.optionals (cross != null) [ gccCross ]
+    ++ stdenv.lib.optional (mig != null) mig;
+
+  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
+  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
+  # bootstrap.
+  BASH_SHELL = "/bin/sh";
+
+  # Workaround for this bug:
+  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
+  # I.e. when gcc is compiled with --with-arch=i686, then the
+  # preprocessor symbol `__i686' will be defined to `1'.  This causes
+  # the symbol __i686.get_pc_thunk.dx to be mangled.
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.system == "i686-linux") "-U__i686";
+}
+
+# Remove the `gccCross' attribute so that the *native* glibc store path
+# doesn't depend on whether `gccCross' is null or not.
+// (removeAttrs args [ "gccCross" "fetchurl" "fetchgit" ]) //
+
+{
+  name = name + "-${version}" +
+    stdenv.lib.optionalString (cross != null) "-${cross.config}";
+
+  src =
+    if hurdHeaders != null
+    then fetchgit {
+      # Shamefully the "official" glibc won't build on GNU, so use the one
+      # maintained by the Hurd folks, `tschwinge/Roger_Whittaker' branch.
+      # See <http://www.gnu.org/software/hurd/source_repositories/glibc.html>.
+      url = "git://git.sv.gnu.org/hurd/glibc.git";
+      sha256 = "cecec9dd5a2bafc875c56b058b6d7628a22b250b53747513dec304f31ffdb82d";
+      rev = "d3cdecf18e6550b0984a42b43ed48c5fb26501e1";
+    }
+    else fetchurl {
+      url = "mirror://gnu/glibc/glibc-${version}.tar.gz";
+      sha256 = "0ym3zk9ii64279wgw7pw9xkbxczy2ci7ka6mnfs05rhlainhicm3";
+    };
+
+  # Remove absolute paths from `configure' & co.; build out-of-tree.
+  preConfigure = ''
+    export PWD_P=$(type -tP pwd)
+    for i in configure io/ftwtest-sh; do
+        # Can't use substituteInPlace here because replace hasn't been
+        # built yet in the bootstrap.
+        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
+    done
+
+    mkdir ../build
+    cd ../build
+
+    configureScript="`pwd`/../$sourceRoot/configure"
+
+    ${stdenv.lib.optionalString (stdenv.gcc.libc != null)
+      ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.gcc.libc}/lib"''
+    }
+
+    ${preConfigure}
+  '';
+
+  meta = {
+    homepage = http://www.gnu.org/software/libc/;
+    description = "The GNU C Library"
+      + stdenv.lib.optionalString (hurdHeaders != null) ", for GNU/Hurd";
+
+    longDescription =
+      '' Any Unix-like operating system needs a C library: the library which
+         defines the "system calls" and other basic facilities such as
+         open, malloc, printf, exit...
+
+         The GNU C library is used as the C library in the GNU system and
+         most systems with the Linux kernel.
+      '';
+
+    license = "LGPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    #platforms = stdenv.lib.platforms.linux;
+  } // meta;
+}
+
+// stdenv.lib.optionalAttrs (hurdHeaders != null) {
+  # Work around the fact that the configure snippet that looks for
+  # <hurd/version.h> does not honor `--with-headers=$sysheaders' and that
+  # glibc expects Mach, Hurd, and pthread headers to be in the same place.
+  CPATH = "${hurdHeaders}/include:${machHeaders}/include:${libpthreadHeaders}/include";
+
+  # Install NSS stuff in the right place.
+  # XXX: This will be needed for all new glibcs and isn't Hurd-specific.
+  makeFlags = ''vardbdir="$out/var/db"'';
+})
diff --git a/pkgs/development/libraries/glibc/2.14/default.nix b/pkgs/development/libraries/glibc/2.17/default.nix
index 1b4e43b1013..b6d91c932db 100644
--- a/pkgs/development/libraries/glibc/2.14/default.nix
+++ b/pkgs/development/libraries/glibc/2.17/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, kernelHeaders
+{ stdenv, fetchurl, fetchgit ? null, kernelHeaders
 , machHeaders ? null, hurdHeaders ? null, libpthreadHeaders ? null
-, mig ? null, fetchgit ? null
+, mig ? null
 , installLocales ? true
 , profilingLibraries ? false
 , gccCross ? null
@@ -14,10 +14,12 @@ let
   cross = if gccCross != null then gccCross.target else null;
 in
   build cross ({
-    name = "glibc${if debugSymbols then "-debug" else ""}";
+    name = "glibc"
+      + stdenv.lib.optionalString (hurdHeaders != null) "-hurd"
+      + stdenv.lib.optionalString debugSymbols "-debug";
 
-    inherit fetchurl stdenv kernelHeaders installLocales profilingLibraries
-      gccCross;
+    inherit fetchurl fetchgit stdenv kernelHeaders installLocales
+      profilingLibraries gccCross;
 
     builder = ./builder.sh;
 
diff --git a/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch b/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch
new file mode 100644
index 00000000000..95f53773320
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/dont-use-system-ld-so-cache.patch
@@ -0,0 +1,45 @@
+diff -ru glibc-2.16.0-orig/elf/ldconfig.c glibc-2.16.0/elf/ldconfig.c
+--- glibc-2.16.0-orig/elf/ldconfig.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/elf/ldconfig.c	2012-09-18 11:59:27.463284814 -0400
+@@ -50,7 +50,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CONF
+-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
++# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
+ #endif
+ 
+ /* Get libc version number.  */
+diff -ru glibc-2.16.0-orig/elf/Makefile glibc-2.16.0/elf/Makefile
+--- glibc-2.16.0-orig/elf/Makefile	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/elf/Makefile	2012-09-18 12:03:30.031955196 -0400
+@@ -415,12 +415,12 @@
+ 
+ $(objpfx)pldd: $(pldd-modules:%=$(objpfx)%.o)
+ 
+-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+-CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
++PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
++CFLAGS-ldconfig.c = $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
+ 		    -D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
+-CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
+-CFLAGS-cache.c = $(SYSCONF-FLAGS)
+-CFLAGS-rtld.c = $(SYSCONF-FLAGS)
++CFLAGS-dl-cache.c = $(PREFIX-FLAGS)
++CFLAGS-cache.c = $(PREFIX-FLAGS)
++CFLAGS-rtld.c = $(PREFIX-FLAGS)
+ 
+ CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),\
+ 		     -DNOT_IN_libc=1 -DIS_IN_rtld=1 -DIN_LIB=rtld)
+diff -ru glibc-2.16.0-orig/sysdeps/generic/dl-cache.h glibc-2.16.0/sysdeps/generic/dl-cache.h
+--- glibc-2.16.0-orig/sysdeps/generic/dl-cache.h	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/sysdeps/generic/dl-cache.h	2012-09-18 11:59:27.465284809 -0400
+@@ -28,7 +28,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
+ #endif
+ 
+ #ifndef add_system_dir
diff --git a/pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch b/pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch
new file mode 100644
index 00000000000..a0a8acdab63
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/glibc-crypt-blowfish.patch
@@ -0,0 +1,795 @@
+From http://cvs.pld-linux.org/cgi-bin/viewvc.cgi/cvs/packages/glibc/glibc-crypt-blowfish.patch?revision=1.7&view=markup
+
+diff -ru -N glibc-2.17-orig/crypt/crypt_blowfish.c glibc-2.17/crypt/crypt_blowfish.c
+--- glibc-2.17-orig/crypt/crypt_blowfish.c	1970-01-01 01:00:00.000000000 +0100
++++ glibc-2.17/crypt/crypt_blowfish.c	2013-01-22 23:30:12.340353965 +0100
+@@ -0,0 +1,743 @@
++/*
++ * This code comes from John the Ripper password cracker, with reentrant
++ * and crypt(3) interfaces added, but optimizations specific to password
++ * cracking removed.
++ *
++ * Written by Solar Designer <solar at openwall.com> in 1998-2002 and
++ * placed in the public domain.
++ *
++ * There's absolutely no warranty.
++ *
++ * It is my intent that you should be able to use this on your system,
++ * as a part of a software package, or anywhere else to improve security,
++ * ensure compatibility, or for any other purpose. I would appreciate
++ * it if you give credit where it is due and keep your modifications in
++ * the public domain as well, but I don't require that in order to let
++ * you place this code and any modifications you make under a license
++ * of your choice.
++ *
++ * This implementation is compatible with OpenBSD bcrypt.c (version 2a)
++ * by Niels Provos <provos at citi.umich.edu>, and uses some of his
++ * ideas. The password hashing algorithm was designed by David Mazieres
++ * <dm at lcs.mit.edu>.
++ *
++ * There's a paper on the algorithm that explains its design decisions:
++ *
++ *	http://www.usenix.org/events/usenix99/provos.html
++ *
++ * Some of the tricks in BF_ROUND might be inspired by Eric Young's
++ * Blowfish library (I can't be sure if I would think of something if I
++ * hadn't seen his code).
++ */
++
++#include <string.h>
++
++#include <errno.h>
++#ifndef __set_errno
++#define __set_errno(val) errno = (val)
++#endif
++
++#undef __CONST
++#ifdef __GNUC__
++#define __CONST __const
++#else
++#define __CONST
++#endif
++
++#ifdef __i386__
++#define BF_ASM				0 /* original OW patch has 1 */
++#define BF_SCALE			1
++#elif defined(__alpha__) || defined(__hppa__) || defined(__x86_64__)
++#define BF_ASM				0
++#define BF_SCALE			1
++#else
++#define BF_ASM				0
++#define BF_SCALE			0
++#endif
++
++typedef unsigned int BF_word;
++
++/* Number of Blowfish rounds, this is also hardcoded into a few places */
++#define BF_N				16
++
++typedef BF_word BF_key[BF_N + 2];
++
++typedef struct {
++	BF_word S[4][0x100];
++	BF_key P;
++} BF_ctx;
++
++/*
++ * Magic IV for 64 Blowfish encryptions that we do at the end.
++ * The string is "OrpheanBeholderScryDoubt" on big-endian.
++ */
++static BF_word BF_magic_w[6] = {
++	0x4F727068, 0x65616E42, 0x65686F6C,
++	0x64657253, 0x63727944, 0x6F756274
++};
++
++/*
++ * P-box and S-box tables initialized with digits of Pi.
++ */
++static BF_ctx BF_init_state = {
++	{
++		{
++			0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
++			0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
++			0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
++			0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
++			0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
++			0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
++			0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
++			0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
++			0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
++			0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
++			0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
++			0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
++			0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
++			0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
++			0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
++			0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
++			0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
++			0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
++			0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
++			0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
++			0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
++			0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
++			0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
++			0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
++			0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
++			0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
++			0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
++			0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
++			0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
++			0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
++			0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
++			0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
++			0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
++			0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
++			0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
++			0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
++			0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
++			0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
++			0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
++			0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
++			0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
++			0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
++			0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
++			0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
++			0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
++			0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
++			0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
++			0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
++			0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
++			0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
++			0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
++			0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
++			0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
++			0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
++			0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
++			0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
++			0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
++			0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
++			0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
++			0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
++			0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
++			0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
++			0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
++			0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a
++		}, {
++			0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
++			0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
++			0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
++			0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
++			0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
++			0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
++			0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
++			0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
++			0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
++			0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
++			0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
++			0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
++			0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
++			0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
++			0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
++			0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
++			0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
++			0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
++			0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
++			0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
++			0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
++			0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
++			0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
++			0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
++			0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
++			0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
++			0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
++			0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
++			0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
++			0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
++			0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
++			0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
++			0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
++			0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
++			0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
++			0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
++			0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
++			0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
++			0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
++			0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
++			0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
++			0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
++			0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
++			0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
++			0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
++			0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
++			0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
++			0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
++			0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
++			0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
++			0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
++			0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
++			0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
++			0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
++			0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
++			0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
++			0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
++			0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
++			0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
++			0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
++			0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
++			0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
++			0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
++			0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7
++		}, {
++			0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
++			0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
++			0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
++			0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
++			0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
++			0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
++			0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
++			0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
++			0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
++			0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
++			0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
++			0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
++			0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
++			0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
++			0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
++			0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
++			0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
++			0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
++			0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
++			0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
++			0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
++			0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
++			0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
++			0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
++			0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
++			0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
++			0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
++			0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
++			0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
++			0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
++			0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
++			0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
++			0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
++			0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
++			0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
++			0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
++			0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
++			0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
++			0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
++			0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
++			0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
++			0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
++			0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
++			0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
++			0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
++			0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
++			0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
++			0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
++			0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
++			0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
++			0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
++			0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
++			0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
++			0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
++			0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
++			0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
++			0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
++			0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
++			0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
++			0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
++			0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
++			0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
++			0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
++			0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0
++		}, {
++			0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
++			0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
++			0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
++			0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
++			0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
++			0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
++			0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
++			0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
++			0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
++			0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
++			0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
++			0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
++			0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
++			0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
++			0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
++			0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
++			0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
++			0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
++			0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
++			0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
++			0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
++			0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
++			0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
++			0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
++			0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
++			0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
++			0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
++			0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
++			0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
++			0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
++			0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
++			0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
++			0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
++			0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
++			0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
++			0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
++			0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
++			0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
++			0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
++			0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
++			0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
++			0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
++			0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
++			0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
++			0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
++			0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
++			0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
++			0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
++			0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
++			0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
++			0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
++			0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
++			0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
++			0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
++			0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
++			0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
++			0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
++			0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
++			0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
++			0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
++			0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
++			0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
++			0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
++			0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6
++		}
++	}, {
++		0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
++		0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
++		0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
++		0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
++		0x9216d5d9, 0x8979fb1b
++	}
++};
++
++static unsigned char BF_itoa64[64 + 1] =
++	"./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
++
++static unsigned char BF_atoi64[0x60] = {
++	64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 0, 1,
++	54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 64, 64, 64, 64, 64,
++	64, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
++	17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 64, 64, 64, 64, 64,
++	64, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
++	43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 64, 64, 64, 64, 64
++};
++
++/*
++ * This may be optimized out if built with function inlining and no BF_ASM.
++ */
++static void clean(void *data, int size)
++{
++#if BF_ASM
++	extern void _BF_clean(void *data);
++#endif
++	memset(data, 0, size);
++#if BF_ASM
++	_BF_clean(data);
++#endif
++}
++
++#define BF_safe_atoi64(dst, src) \
++{ \
++	tmp = (unsigned char)(src); \
++	if ((unsigned int)(tmp -= 0x20) >= 0x60) return -1; \
++	tmp = BF_atoi64[tmp]; \
++	if (tmp > 63) return -1; \
++	(dst) = tmp; \
++}
++
++static int BF_decode(BF_word *dst, __CONST char *src, int size)
++{
++	unsigned char *dptr = (unsigned char *)dst;
++	unsigned char *end = dptr + size;
++	unsigned char *sptr = (unsigned char *)src;
++	unsigned int tmp, c1, c2, c3, c4;
++
++	do {
++		BF_safe_atoi64(c1, *sptr++);
++		BF_safe_atoi64(c2, *sptr++);
++		*dptr++ = (c1 << 2) | ((c2 & 0x30) >> 4);
++		if (dptr >= end) break;
++
++		BF_safe_atoi64(c3, *sptr++);
++		*dptr++ = ((c2 & 0x0F) << 4) | ((c3 & 0x3C) >> 2);
++		if (dptr >= end) break;
++
++		BF_safe_atoi64(c4, *sptr++);
++		*dptr++ = ((c3 & 0x03) << 6) | c4;
++	} while (dptr < end);
++
++	return 0;
++}
++
++static void BF_encode(char *dst, __CONST BF_word *src, int size)
++{
++	unsigned char *sptr = (unsigned char *)src;
++	unsigned char *end = sptr + size;
++	unsigned char *dptr = (unsigned char *)dst;
++	unsigned int c1, c2;
++
++	do {
++		c1 = *sptr++;
++		*dptr++ = BF_itoa64[c1 >> 2];
++		c1 = (c1 & 0x03) << 4;
++		if (sptr >= end) {
++			*dptr++ = BF_itoa64[c1];
++			break;
++		}
++
++		c2 = *sptr++;
++		c1 |= c2 >> 4;
++		*dptr++ = BF_itoa64[c1];
++		c1 = (c2 & 0x0f) << 2;
++		if (sptr >= end) {
++			*dptr++ = BF_itoa64[c1];
++			break;
++		}
++
++		c2 = *sptr++;
++		c1 |= c2 >> 6;
++		*dptr++ = BF_itoa64[c1];
++		*dptr++ = BF_itoa64[c2 & 0x3f];
++	} while (sptr < end);
++}
++
++static void BF_swap(BF_word *x, int count)
++{
++	static int endianness_check = 1;
++	char *is_little_endian = (char *)&endianness_check;
++	BF_word tmp;
++
++	if (*is_little_endian)
++	do {
++		tmp = *x;
++		tmp = (tmp << 16) | (tmp >> 16);
++		*x++ = ((tmp & 0x00FF00FF) << 8) | ((tmp >> 8) & 0x00FF00FF);
++	} while (--count);
++}
++
++#if BF_SCALE
++/* Architectures which can shift addresses left by 2 bits with no extra cost */
++#define BF_ROUND(L, R, N) \
++	tmp1 = L & 0xFF; \
++	tmp2 = L >> 8; \
++	tmp2 &= 0xFF; \
++	tmp3 = L >> 16; \
++	tmp3 &= 0xFF; \
++	tmp4 = L >> 24; \
++	tmp1 = data.ctx.S[3][tmp1]; \
++	tmp2 = data.ctx.S[2][tmp2]; \
++	tmp3 = data.ctx.S[1][tmp3]; \
++	tmp3 += data.ctx.S[0][tmp4]; \
++	tmp3 ^= tmp2; \
++	R ^= data.ctx.P[N + 1]; \
++	tmp3 += tmp1; \
++	R ^= tmp3;
++#else
++/* Architectures with no complicated addressing modes supported */
++#define BF_INDEX(S, i) \
++	(*((BF_word *)(((unsigned char *)S) + (i))))
++#define BF_ROUND(L, R, N) \
++	tmp1 = L & 0xFF; \
++	tmp1 <<= 2; \
++	tmp2 = L >> 6; \
++	tmp2 &= 0x3FC; \
++	tmp3 = L >> 14; \
++	tmp3 &= 0x3FC; \
++	tmp4 = L >> 22; \
++	tmp4 &= 0x3FC; \
++	tmp1 = BF_INDEX(data.ctx.S[3], tmp1); \
++	tmp2 = BF_INDEX(data.ctx.S[2], tmp2); \
++	tmp3 = BF_INDEX(data.ctx.S[1], tmp3); \
++	tmp3 += BF_INDEX(data.ctx.S[0], tmp4); \
++	tmp3 ^= tmp2; \
++	R ^= data.ctx.P[N + 1]; \
++	tmp3 += tmp1; \
++	R ^= tmp3;
++#endif
++
++/*
++ * Encrypt one block, BF_N is hardcoded here.
++ */
++#define BF_ENCRYPT \
++	L ^= data.ctx.P[0]; \
++	BF_ROUND(L, R, 0); \
++	BF_ROUND(R, L, 1); \
++	BF_ROUND(L, R, 2); \
++	BF_ROUND(R, L, 3); \
++	BF_ROUND(L, R, 4); \
++	BF_ROUND(R, L, 5); \
++	BF_ROUND(L, R, 6); \
++	BF_ROUND(R, L, 7); \
++	BF_ROUND(L, R, 8); \
++	BF_ROUND(R, L, 9); \
++	BF_ROUND(L, R, 10); \
++	BF_ROUND(R, L, 11); \
++	BF_ROUND(L, R, 12); \
++	BF_ROUND(R, L, 13); \
++	BF_ROUND(L, R, 14); \
++	BF_ROUND(R, L, 15); \
++	tmp4 = R; \
++	R = L; \
++	L = tmp4 ^ data.ctx.P[BF_N + 1];
++
++#if BF_ASM
++#define BF_body() \
++	_BF_body_r(&data.ctx);
++#else
++#define BF_body() \
++	L = R = 0; \
++	ptr = data.ctx.P; \
++	do { \
++		ptr += 2; \
++		BF_ENCRYPT; \
++		*(ptr - 2) = L; \
++		*(ptr - 1) = R; \
++	} while (ptr < &data.ctx.P[BF_N + 2]); \
++\
++	ptr = data.ctx.S[0]; \
++	do { \
++		ptr += 2; \
++		BF_ENCRYPT; \
++		*(ptr - 2) = L; \
++		*(ptr - 1) = R; \
++	} while (ptr < &data.ctx.S[3][0xFF]);
++#endif
++
++static void BF_set_key(__CONST char *key, BF_key expanded, BF_key initial)
++{
++	__CONST char *ptr = key;
++	int i, j;
++	BF_word tmp;
++
++	for (i = 0; i < BF_N + 2; i++) {
++		tmp = 0;
++		for (j = 0; j < 4; j++) {
++			tmp <<= 8;
++			tmp |= (unsigned char)*ptr;
++
++			if (!*ptr) ptr = key; else ptr++;
++		}
++
++		expanded[i] = tmp;
++		initial[i] = BF_init_state.P[i] ^ tmp;
++	}
++}
++
++char *_crypt_blowfish_rn(__CONST char *key, __CONST char *setting,
++	char *output, int size)
++{
++#if BF_ASM
++	extern void _BF_body_r(BF_ctx *ctx);
++#endif
++	struct {
++		BF_ctx ctx;
++		BF_key expanded_key;
++		union {
++			BF_word salt[4];
++			BF_word output[6];
++		} binary;
++	} data;
++	BF_word L, R;
++	BF_word tmp1, tmp2, tmp3, tmp4;
++	BF_word *ptr;
++	BF_word count;
++	int i;
++
++	if (size < 7 + 22 + 31 + 1) {
++		__set_errno(ERANGE);
++		return NULL;
++	}
++
++	if (setting[0] != '$' ||
++	    setting[1] != '2' ||
++	    setting[2] != 'a' ||
++	    setting[3] != '$' ||
++	    setting[4] < '0' || setting[4] > '3' ||
++	    setting[5] < '0' || setting[5] > '9' ||
++	    setting[6] != '$') {
++		__set_errno(EINVAL);
++		return NULL;
++	}
++
++	count = (BF_word)1 << ((setting[4] - '0') * 10 + (setting[5] - '0'));
++	if (count < 16 || BF_decode(data.binary.salt, &setting[7], 16)) {
++		clean(data.binary.salt, sizeof(data.binary.salt));
++		__set_errno(EINVAL);
++		return NULL;
++	}
++	BF_swap(data.binary.salt, 4);
++
++	BF_set_key(key, data.expanded_key, data.ctx.P);
++
++	memcpy(data.ctx.S, BF_init_state.S, sizeof(data.ctx.S));
++
++	L = R = 0;
++	for (i = 0; i < BF_N + 2; i += 2) {
++		L ^= data.binary.salt[i & 2];
++		R ^= data.binary.salt[(i & 2) + 1];
++		BF_ENCRYPT;
++		data.ctx.P[i] = L;
++		data.ctx.P[i + 1] = R;
++	}
++
++	ptr = data.ctx.S[0];
++	do {
++		ptr += 4;
++		L ^= data.binary.salt[(BF_N + 2) & 3];
++		R ^= data.binary.salt[(BF_N + 3) & 3];
++		BF_ENCRYPT;
++		*(ptr - 4) = L;
++		*(ptr - 3) = R;
++
++		L ^= data.binary.salt[(BF_N + 4) & 3];
++		R ^= data.binary.salt[(BF_N + 5) & 3];
++		BF_ENCRYPT;
++		*(ptr - 2) = L;
++		*(ptr - 1) = R;
++	} while (ptr < &data.ctx.S[3][0xFF]);
++
++	do {
++		data.ctx.P[0] ^= data.expanded_key[0];
++		data.ctx.P[1] ^= data.expanded_key[1];
++		data.ctx.P[2] ^= data.expanded_key[2];
++		data.ctx.P[3] ^= data.expanded_key[3];
++		data.ctx.P[4] ^= data.expanded_key[4];
++		data.ctx.P[5] ^= data.expanded_key[5];
++		data.ctx.P[6] ^= data.expanded_key[6];
++		data.ctx.P[7] ^= data.expanded_key[7];
++		data.ctx.P[8] ^= data.expanded_key[8];
++		data.ctx.P[9] ^= data.expanded_key[9];
++		data.ctx.P[10] ^= data.expanded_key[10];
++		data.ctx.P[11] ^= data.expanded_key[11];
++		data.ctx.P[12] ^= data.expanded_key[12];
++		data.ctx.P[13] ^= data.expanded_key[13];
++		data.ctx.P[14] ^= data.expanded_key[14];
++		data.ctx.P[15] ^= data.expanded_key[15];
++		data.ctx.P[16] ^= data.expanded_key[16];
++		data.ctx.P[17] ^= data.expanded_key[17];
++
++		BF_body();
++
++		tmp1 = data.binary.salt[0];
++		tmp2 = data.binary.salt[1];
++		tmp3 = data.binary.salt[2];
++		tmp4 = data.binary.salt[3];
++		data.ctx.P[0] ^= tmp1;
++		data.ctx.P[1] ^= tmp2;
++		data.ctx.P[2] ^= tmp3;
++		data.ctx.P[3] ^= tmp4;
++		data.ctx.P[4] ^= tmp1;
++		data.ctx.P[5] ^= tmp2;
++		data.ctx.P[6] ^= tmp3;
++		data.ctx.P[7] ^= tmp4;
++		data.ctx.P[8] ^= tmp1;
++		data.ctx.P[9] ^= tmp2;
++		data.ctx.P[10] ^= tmp3;
++		data.ctx.P[11] ^= tmp4;
++		data.ctx.P[12] ^= tmp1;
++		data.ctx.P[13] ^= tmp2;
++		data.ctx.P[14] ^= tmp3;
++		data.ctx.P[15] ^= tmp4;
++		data.ctx.P[16] ^= tmp1;
++		data.ctx.P[17] ^= tmp2;
++
++		BF_body();
++	} while (--count);
++
++	for (i = 0; i < 6; i += 2) {
++		L = BF_magic_w[i];
++		R = BF_magic_w[i + 1];
++
++		count = 64;
++		do {
++			BF_ENCRYPT;
++		} while (--count);
++
++		data.binary.output[i] = L;
++		data.binary.output[i + 1] = R;
++	}
++
++	memcpy(output, setting, 7 + 22 - 1);
++	output[7 + 22 - 1] = BF_itoa64[(int)
++		BF_atoi64[(int)setting[7 + 22 - 1] - 0x20] & 0x30];
++
++/* This has to be bug-compatible with the original implementation, so
++ * only encode 23 of the 24 bytes. :-) */
++	BF_swap(data.binary.output, 6);
++	BF_encode(&output[7 + 22], data.binary.output, 23);
++	output[7 + 22 + 31] = '\0';
++
++/* Overwrite the most obvious sensitive data we have on the stack. Note
++ * that this does not guarantee there's no sensitive data left on the
++ * stack and/or in registers; I'm not aware of portable code that does. */
++	clean(&data, sizeof(data));
++
++	return output;
++}
++
++char *_crypt_gensalt_blowfish_rn(unsigned long count,
++	__CONST char *input, int size, char *output, int output_size)
++{
++	if (size < 16 || output_size < 7 + 22 + 1 ||
++	    (count && (count < 4 || count > 31))) {
++		if (output_size > 0) output[0] = '\0';
++		__set_errno((output_size < 7 + 22 + 1) ? ERANGE : EINVAL);
++		return NULL;
++	}
++
++	if (!count) count = 5;
++
++	output[0] = '$';
++	output[1] = '2';
++	output[2] = 'a';
++	output[3] = '$';
++	output[4] = '0' + count / 10;
++	output[5] = '0' + count % 10;
++	output[6] = '$';
++
++	BF_encode(&output[7], (BF_word *)input, 16);
++	output[7 + 22] = '\0';
++
++	return output;
++}
+diff -ru -N glibc-2.17-orig/crypt/crypt-entry.c glibc-2.17/crypt/crypt-entry.c
+--- glibc-2.17-orig/crypt/crypt-entry.c	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/crypt/crypt-entry.c	2013-01-22 23:30:12.342353955 +0100
+@@ -61,6 +61,8 @@
+ extern char *__sha512_crypt_r (const char *key, const char *salt,
+ 			       char *buffer, int buflen);
+ extern char *__sha512_crypt (const char *key, const char *salt);
++extern char *_crypt_blowfish_rn (const char *key, const char *setting,
++				char *output, int size);
+ 
+ /* Define our magic string to mark salt for MD5 encryption
+    replacement.  This is meant to be the same as for other MD5 based
+@@ -73,6 +75,9 @@
+ /* Magic string for SHA512 encryption.  */
+ static const char sha512_salt_prefix[] = "$6$";
+ 
++/* Magic string for Blowfish encryption.  */
++static const char blowfish_salt_prefix[] = "$2a$";
++
+ /* For use by the old, non-reentrant routines (crypt/encrypt/setkey)  */
+ extern struct crypt_data _ufc_foobar;
+ 
+@@ -113,6 +118,11 @@
+   if (strncmp (sha512_salt_prefix, salt, sizeof (sha512_salt_prefix) - 1) == 0)
+     return __sha512_crypt_r (key, salt, (char *) data,
+ 			     sizeof (struct crypt_data));
++
++  /* Try to find out whether we have to use Blowfish encryption replacement.  */
++  if (strncmp (blowfish_salt_prefix, salt, sizeof (blowfish_salt_prefix) - 1) == 0)
++    return _crypt_blowfish_rn (key, salt, (char *) data,
++			     sizeof (struct crypt_data));
+ #endif
+ 
+   /*
+diff -ru -N glibc-2.17-orig/crypt/Makefile glibc-2.17/crypt/Makefile
+--- glibc-2.17-orig/crypt/Makefile	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/crypt/Makefile	2013-01-22 23:30:12.341353960 +0100
+@@ -26,7 +26,7 @@
+ extra-libs-others := $(extra-libs)
+ 
+ libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
+-		     crypt_util
++		     crypt_util crypt_blowfish
+ 
+ tests := cert md5c-test sha256c-test sha512c-test badsalttest
+ 
diff --git a/pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch b/pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch
index 98f7f81087b..98f7f81087b 100644
--- a/pkgs/development/libraries/glibc/2.14/glibc-elf-localscope.patch
+++ b/pkgs/development/libraries/glibc/2.17/glibc-elf-localscope.patch
diff --git a/pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch b/pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch
new file mode 100644
index 00000000000..c390b772b16
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/glibc-rh739743.patch
@@ -0,0 +1,55 @@
+2009-04-26  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (rfc3484_sort): don't assign native
+	result if the result has no associated interface.
+
+---
+ sysdeps/posix/getaddrinfo.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -1456,13 +1456,13 @@
+ 
+ 	      /* Fill in the results in all the records.  */
+ 	      for (int i = 0; i < src->nresults; ++i)
+-		if (src->results[i].index == a1_index)
++		if (a1_index != -1 && src->results[i].index == a1_index)
+ 		  {
+ 		    assert (src->results[i].native == -1
+ 			    || src->results[i].native == a1_native);
+ 		    src->results[i].native = a1_native;
+ 		  }
+-		else if (src->results[i].index == a2_index)
++		else if (a2_index != -1 && src->results[i].index == a2_index)
+ 		  {
+ 		    assert (src->results[i].native == -1
+ 			    || src->results[i].native == a2_native);
+
+2009-03-15  Aurelien Jarno  <aurelien@aurel32.net>
+
+	* sysdeps/posix/getaddrinfo.c (getaddrinfo): correctly detect 
+	interface for all 127.X.Y.Z addresses.
+
+---
+ sysdeps/posix/getaddrinfo.c |    9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+--- a/sysdeps/posix/getaddrinfo.c
++++ b/sysdeps/posix/getaddrinfo.c
+@@ -2265,7 +2265,14 @@
+ 			  tmp.addr[0] = 0;
+ 			  tmp.addr[1] = 0;
+ 			  tmp.addr[2] = htonl (0xffff);
+-			  tmp.addr[3] = sinp->sin_addr.s_addr;
++			  /* Special case for lo interface, the source address
++			     being possibly different than the interface 
++			     address. */
++			  if ((ntohl(sinp->sin_addr.s_addr) & 0xff000000)
++			      == 0x7f000000)
++			    tmp.addr[3] = htonl(0x7f000001);
++			  else
++			    tmp.addr[3] = sinp->sin_addr.s_addr;
+ 			}
+ 		      else
+ 			{
diff --git a/pkgs/development/libraries/glibc/2.17/info.nix b/pkgs/development/libraries/glibc/2.17/info.nix
new file mode 100644
index 00000000000..e4cdb42dd68
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/info.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, texinfo, perl }:
+
+let build = import ./common.nix; in
+
+/* null cross builder */
+build null {
+  name = "glibc-info";
+
+  inherit fetchurl stdenv;
+
+  configureFlags = [ "--enable-add-ons" ];
+
+  buildInputs = [ texinfo perl ];
+
+  buildPhase = "make info";
+
+  # I don't know why the info is not generated in 'build'
+  # Somehow building the info still does not work, because the final
+  # libc.info hasn't a Top node.
+  installPhase = ''
+    mkdir -p "$out/share/info"
+    cp -v "manual/"*.info* "$out/share/info"
+  '';
+
+  meta.description = "GNU Info manual of the GNU C Library";
+}
diff --git a/pkgs/development/libraries/glibc/2.14/locales-builder.sh b/pkgs/development/libraries/glibc/2.17/locales-builder.sh
index d732e208fa2..d732e208fa2 100644
--- a/pkgs/development/libraries/glibc/2.14/locales-builder.sh
+++ b/pkgs/development/libraries/glibc/2.17/locales-builder.sh
diff --git a/pkgs/development/libraries/glibc/2.14/locales.nix b/pkgs/development/libraries/glibc/2.17/locales.nix
index b7eae50ca38..b7eae50ca38 100644
--- a/pkgs/development/libraries/glibc/2.14/locales.nix
+++ b/pkgs/development/libraries/glibc/2.17/locales.nix
diff --git a/pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch b/pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch
index aca904f7ff4..88c8adef922 100644
--- a/pkgs/development/libraries/glibc/2.14/nix-locale-archive.patch
+++ b/pkgs/development/libraries/glibc/2.17/nix-locale-archive.patch
@@ -1,8 +1,7 @@
-diff --git a/locale/loadarchive.c b/locale/loadarchive.c
-index d545f17..0d8638a 100644
---- a/locale/loadarchive.c
-+++ b/locale/loadarchive.c
-@@ -124,6 +124,25 @@ calculate_head_size (const struct locarhead *h)
+diff -ru glibc-2.16.0-orig/locale/loadarchive.c glibc-2.16.0/locale/loadarchive.c
+--- glibc-2.16.0-orig/locale/loadarchive.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/loadarchive.c	2012-09-18 11:57:57.277515212 -0400
+@@ -123,6 +123,25 @@
  }
  
  
@@ -14,13 +13,13 @@ index d545f17..0d8638a 100644
 +  char *path2 = getenv ("LOCALE_ARCHIVE");
 +  const char *usualpath = "/usr/lib/locale/locale-archive";
 +  if (path)
-+    fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (path2 && fd < 0)
-+    fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (path2, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (fd < 0)
-+    fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  if (fd < 0)
-+    fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE);
++    fd = open_not_cancel_2 (usualpath, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +  return fd;
 +}
 +
@@ -28,29 +27,29 @@ index d545f17..0d8638a 100644
  /* Find the locale *NAMEP in the locale archive, and return the
     internalized data structure for its CATEGORY data.  If this locale has
     already been loaded from the archive, just returns the existing data
-@@ -203,7 +222,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+@@ -202,7 +221,7 @@
        archmapped = &headmap;
  
        /* The archive has never been opened.  */
--      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+-      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +      fd = open_locale_archive ();
        if (fd < 0)
  	/* Cannot open the archive, for whatever reason.  */
  	return NULL;
-@@ -394,7 +413,7 @@ _nl_load_locale_from_archive (int category, const char **namep)
+@@ -393,8 +412,7 @@
  	  if (fd == -1)
  	    {
  	      struct stat64 st;
--	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
+-	      fd = open_not_cancel_2 (archfname,
+-				      O_RDONLY|O_LARGEFILE|O_CLOEXEC);
 +	      fd = open_locale_archive ();
  	      if (fd == -1)
  		/* Cannot open the archive, for whatever reason.  */
  		return NULL;
-diff --git a/locale/programs/locale.c b/locale/programs/locale.c
-index 77262b7..fddc00d 100644
---- a/locale/programs/locale.c
-+++ b/locale/programs/locale.c
-@@ -628,6 +628,20 @@ nameentcmp (const void *a, const void *b)
+diff -ru glibc-2.16.0-orig/locale/programs/locale.c glibc-2.16.0/locale/programs/locale.c
+--- glibc-2.16.0-orig/locale/programs/locale.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/programs/locale.c	2012-09-18 11:53:03.719920947 -0400
+@@ -628,6 +628,20 @@
  		  ((const struct nameent *) b)->name);
  }
  
@@ -71,7 +70,7 @@ index 77262b7..fddc00d 100644
  
  static int
  write_archive_locales (void **all_datap, char *linebuf)
-@@ -641,7 +658,7 @@ write_archive_locales (void **all_datap, char *linebuf)
+@@ -641,7 +655,7 @@
    int fd, ret = 0;
    uint32_t cnt;
  
@@ -80,11 +79,10 @@ index 77262b7..fddc00d 100644
    if (fd < 0)
      return 0;
  
-diff --git a/locale/programs/locarchive.c b/locale/programs/locarchive.c
-index 85ba77d..3ad2af8 100644
---- a/locale/programs/locarchive.c
-+++ b/locale/programs/locarchive.c
-@@ -512,6 +512,20 @@ enlarge_archive (struct locarhandle *ah, const struct locarhead *head)
+diff -ru glibc-2.16.0-orig/locale/programs/locarchive.c glibc-2.16.0/locale/programs/locarchive.c
+--- glibc-2.16.0-orig/locale/programs/locarchive.c	2012-06-30 15:12:34.000000000 -0400
++++ glibc-2.16.0/locale/programs/locarchive.c	2012-09-18 11:53:03.720920942 -0400
+@@ -509,6 +509,20 @@
    *ah = new_ah;
  }
  
@@ -105,7 +103,7 @@ index 85ba77d..3ad2af8 100644
  
  void
  open_archive (struct locarhandle *ah, bool readonly)
-@@ -531,7 +548,7 @@ open_archive (struct locarhandle *ah, bool readonly)
+@@ -528,7 +542,7 @@
    while (1)
      {
        /* Open the archive.  We must have exclusive write access.  */
diff --git a/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch
new file mode 100644
index 00000000000..fd81ab5324e
--- /dev/null
+++ b/pkgs/development/libraries/glibc/2.17/rpcgen-path.patch
@@ -0,0 +1,54 @@
+diff -ru glibc-2.17-orig/sunrpc/rpc_main.c glibc-2.17/sunrpc/rpc_main.c
+--- glibc-2.17-orig/sunrpc/rpc_main.c	2012-12-25 04:02:13.000000000 +0100
++++ glibc-2.17/sunrpc/rpc_main.c	2012-12-29 00:21:04.124698455 +0100
+@@ -77,7 +77,7 @@
+ 
+ static const char *svcclosetime = "120";
+ static int cppDefined;	/* explicit path for C preprocessor */
+-static const char *CPP = "/lib/cpp";
++static const char *CPP = "cpp";
+ static const char CPPFLAGS[] = "-C";
+ static char *pathbuf;
+ static int cpp_pid;
+@@ -106,7 +106,6 @@
+ static void open_output (const char *infile, const char *outfile);
+ static void add_warning (void);
+ static void clear_args (void);
+-static void find_cpp (void);
+ static void open_input (const char *infile, const char *define);
+ static int check_nettype (const char *name, const char *list_to_check[]);
+ static void c_output (const char *infile, const char *define,
+@@ -318,25 +317,6 @@
+   argcount = FIXEDARGS;
+ }
+ 
+-/* make sure that a CPP exists */
+-static void
+-find_cpp (void)
+-{
+-  struct stat buf;
+-
+-  if (stat (CPP, &buf) == 0)
+-    return;
+-
+-  if (cppDefined) /* user specified cpp but it does not exist */
+-    {
+-      fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+-      crash ();
+-    }
+-
+-  /* fall back to system CPP */
+-  CPP = "cpp";
+-}
+-
+ /*
+  * Open input file with given define for C-preprocessor
+  */
+@@ -355,7 +335,6 @@
+   switch (cpp_pid)
+     {
+     case 0:
+-      find_cpp ();
+       putarg (0, CPP);
+       putarg (1, CPPFLAGS);
+       addarg (define);
diff --git a/pkgs/development/libraries/glibc/2.5/binutils-ld.patch b/pkgs/development/libraries/glibc/2.5/binutils-ld.patch
deleted file mode 100644
index 4cd7ab3cec3..00000000000
--- a/pkgs/development/libraries/glibc/2.5/binutils-ld.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Sat, 31 Jan 2009 00:21:15 +0000
-Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
-
-	newer linker scripts.
----
- ChangeLog    |    5 +++++
- elf/Makefile |    4 ++--
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index 8079fe9..e44ff1d 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
- 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
- 		  LC_ALL=C \
- 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
--		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- 		  > $@.lds
- 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
- 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\
---
-1.6.4
-
diff --git a/pkgs/development/libraries/glibc/2.5/builder.sh b/pkgs/development/libraries/glibc/2.5/builder.sh
deleted file mode 100644
index bc80af83b92..00000000000
--- a/pkgs/development/libraries/glibc/2.5/builder.sh
+++ /dev/null
@@ -1,57 +0,0 @@
-# glibc cannot have itself in its rpath.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-
-postUnpack() {
-    cd $sourceRoot/..
-}
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        substituteInPlace "$i" \
-            --replace "@PWD@" "pwd"
-    done
-
-    # Fix shell code that tries to determine whether GNU ld is recent enough.
-    substituteInPlace configure --replace '2.1[3-9]*)' '2.1[3-9]*|2.[2-9][0-9]*)'
-
-    mkdir ../build
-    cd ../build
-
-    configureScript=../$sourceRoot/configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-    export NIX_DONT_SET_RPATH=1
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make -j${NIX_BUILD_CORES:-1} -l${NIX_BUILD_CORES:-1} localedata/install-locales
-    fi
-    rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.5/default.nix b/pkgs/development/libraries/glibc/2.5/default.nix
deleted file mode 100644
index 8b8c204a480..00000000000
--- a/pkgs/development/libraries/glibc/2.5/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation {
-  name = "glibc-2.5";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.5.tar.bz2;
-    md5 = "1fb29764a6a650a4d5b409dda227ac9f";
-  };
-
-  patches = [ ./glibc-pwd.patch ./glibc-getcwd-param-MAX.patch ./glibc-inline.patch
-              ./x86-fnstsw.patch ./binutils-ld.patch ./make-3-82-fix.patch ];
-
-  inherit kernelHeaders installLocales;
-
-  inherit (stdenv) is64bit;
-
-  configureFlags="--enable-add-ons
-    --with-headers=${kernelHeaders}/include
-    --disable-sanity-checks
-    ${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  enableParallelBuilding = true;
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch b/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch
deleted file mode 100644
index 8543dbbf1d7..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-getcwd-param-MAX.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-2006-06-18  Mike Frysinger  <vapier@gentoo.org>
-
-	* sysdeps/unix/sysv/linux/getcwd.c: Include sys/param.h.
-
---- glibc-old/sysdeps/unix/sysv/linux/getcwd.c
-+++ glibc-new/sysdeps/unix/sysv/linux/getcwd.c
-@@ -24,6 +24,7 @@
- #include <limits.h>
- #include <stdlib.h>
- #include <unistd.h>
-+#include <sys/param.h>
- 
- #include <sysdep.h>
- #include <sys/syscall.h>
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-inline.patch b/pkgs/development/libraries/glibc/2.5/glibc-inline.patch
deleted file mode 100644
index 19e400e0d50..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-inline.patch
+++ /dev/null
@@ -1,1822 +0,0 @@
---- libc/mach/mach/mig_support.h.jj	2001-07-06 06:55:35.000000000 +0200
-+++ libc/mach/mach/mig_support.h	2006-11-07 11:18:32.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1993,94,97,99,2001 Free Software Foundation, Inc.
-+/* Copyright (C) 1993,94,97,99,2001,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -67,12 +67,12 @@ extern void mig_reply_setup (const mach_
- /* Idiocy support function.  */
- extern vm_size_t mig_strncpy (char *__dst, const char *__src, vm_size_t __len);
- extern vm_size_t __mig_strncpy (char *__dst, const char *__src, vm_size_t);
--extern __inline vm_size_t
-+__extern_inline vm_size_t
- __mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
- {
-   return __stpncpy (__dst, __src, __len) - __dst;
- }
--extern __inline vm_size_t
-+__extern_inline vm_size_t
- mig_strncpy (char *__dst, const char *__src, vm_size_t __len)
- {
-   return __mig_strncpy (__dst, __src, __len);
---- libc/mach/lock-intern.h.jj	2001-07-06 06:55:34.000000000 +0200
-+++ libc/mach/lock-intern.h	2006-11-06 21:05:34.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1994, 1996 Free Software Foundation, Inc.
-+/* Copyright (C) 1994, 1996, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -22,7 +22,7 @@
- #include <machine-lock.h>
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/include/stdlib.h.jj	2006-01-14 13:08:56.000000000 +0100
-+++ libc/include/stdlib.h	2006-11-06 21:08:02.000000000 +0100
-@@ -139,43 +139,43 @@ libc_hidden_proto (____strtoll_l_interna
- libc_hidden_proto (____strtoul_l_internal)
- libc_hidden_proto (____strtoull_l_internal)
- 
--extern __inline double
-+__extern_inline double
- __NTH (__strtod_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   __locale_t __loc))
- {
-   return ____strtod_l_internal (__nptr, __endptr, 0, __loc);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (__strtol_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   int __base, __locale_t __loc))
- {
-   return ____strtol_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (__strtoul_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, int __base, __locale_t __loc))
- {
-   return ____strtoul_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--extern __inline float
-+__extern_inline float
- __NTH (__strtof_l (__const char *__restrict __nptr, char **__restrict __endptr,
- 		   __locale_t __loc))
- {
-   return ____strtof_l_internal (__nptr, __endptr, 0, __loc);
- }
--extern __inline long double
-+__extern_inline long double
- __NTH (__strtold_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, __locale_t __loc))
- {
-   return ____strtold_l_internal (__nptr, __endptr, 0, __loc);
- }
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (__strtoll_l (__const char *__restrict __nptr,
- 		    char **__restrict __endptr, int __base, __locale_t __loc))
- {
-   return ____strtoll_l_internal (__nptr, __endptr, __base, 0, __loc);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (__strtoull_l (__const char * __restrict __nptr,
- 		     char **__restrict __endptr, int __base, __locale_t __loc))
- {
---- libc/include/ctype.h.jj	2004-03-16 11:09:04.000000000 +0100
-+++ libc/include/ctype.h	2006-11-06 21:06:24.000000000 +0100
-@@ -15,7 +15,7 @@ extern int __isctype (int __c, int __mas
- #  include <bits/libc-tsd.h>
- 
- #  ifndef CTYPE_EXTERN_INLINE	/* Used by ctype/ctype-info.c, which see.  */
--#   define CTYPE_EXTERN_INLINE extern inline
-+#   define CTYPE_EXTERN_INLINE __extern_inline
- #  endif
- 
- __libc_tsd_define (extern, CTYPE_B)
---- libc/include/sys/stat.h.jj	2006-02-12 22:29:08.000000000 +0100
-+++ libc/include/sys/stat.h	2006-11-06 21:07:01.000000000 +0100
-@@ -19,13 +19,13 @@ hidden_proto (__lxstat64)
- hidden_proto (__xstat)
- hidden_proto (__xstat64)
- #endif
--extern __inline__ int __stat (__const char *__path, struct stat *__statbuf)
-+__extern_inline int __stat (__const char *__path, struct stat *__statbuf)
- {
-   return __xstat (_STAT_VER, __path, __statbuf);
- }
- libc_hidden_proto (__xmknod)
--extern __inline__ int __mknod (__const char *__path, __mode_t __mode,
--			       __dev_t __dev)
-+__extern_inline int __mknod (__const char *__path, __mode_t __mode,
-+			     __dev_t __dev)
- {
-   return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
- }
---- libc/stdlib/stdlib.h.jj	2006-10-31 23:05:34.000000000 +0100
-+++ libc/stdlib/stdlib.h	2006-11-06 21:16:09.000000000 +0100
-@@ -324,18 +324,18 @@ extern unsigned long long int __strtoull
- /* Define inline functions which call the internal entry points.  */
- 
- __BEGIN_NAMESPACE_STD
--extern __inline double
-+__extern_inline double
- __NTH (strtod (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtod_internal (__nptr, __endptr, 0);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (strtol (__const char *__restrict __nptr, char **__restrict __endptr,
- 	       int __base))
- {
-   return __strtol_internal (__nptr, __endptr, __base, 0);
- }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (strtoul (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-@@ -345,13 +345,13 @@ __END_NAMESPACE_STD
- 
- # ifdef __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--extern __inline float
-+__extern_inline float
- __NTH (strtof (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtof_internal (__nptr, __endptr, 0);
- }
- #  ifndef __LDBL_COMPAT
--extern __inline long double
-+__extern_inline long double
- __NTH (strtold (__const char *__restrict __nptr, char **__restrict __endptr))
- {
-   return __strtold_internal (__nptr, __endptr, 0);
-@@ -361,13 +361,13 @@ __END_NAMESPACE_C99
- # endif
- 
- # ifdef __USE_BSD
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (strtoq (__const char *__restrict __nptr, char **__restrict __endptr,
- 	       int __base))
- {
-   return __strtoll_internal (__nptr, __endptr, __base, 0);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (strtouq (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-@@ -377,13 +377,13 @@ __NTH (strtouq (__const char *__restrict
- 
- # if defined __USE_MISC || defined __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (strtoll (__const char *__restrict __nptr, char **__restrict __endptr,
- 		int __base))
- {
-   return __strtoll_internal (__nptr, __endptr, __base, 0);
- }
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (strtoull (__const char * __restrict __nptr, char **__restrict __endptr,
- 		 int __base))
- {
-@@ -393,17 +393,17 @@ __END_NAMESPACE_C99
- # endif
- 
- __BEGIN_NAMESPACE_STD
--extern __inline double
-+__extern_inline double
- __NTH (atof (__const char *__nptr))
- {
-   return strtod (__nptr, (char **) NULL);
- }
--extern __inline int
-+__extern_inline int
- __NTH (atoi (__const char *__nptr))
- {
-   return (int) strtol (__nptr, (char **) NULL, 10);
- }
--extern __inline long int
-+__extern_inline long int
- __NTH (atol (__const char *__nptr))
- {
-   return strtol (__nptr, (char **) NULL, 10);
-@@ -412,7 +412,7 @@ __END_NAMESPACE_STD
- 
- # if defined __USE_MISC || defined __USE_ISOC99
- __BEGIN_NAMESPACE_C99
--__extension__ extern __inline long long int
-+__extension__ __extern_inline long long int
- __NTH (atoll (__const char *__nptr))
- {
-   return strtoll (__nptr, (char **) NULL, 10);
---- libc/stdlib/bits/stdlib.h.jj	2005-08-22 17:06:07.000000000 +0200
-+++ libc/stdlib/bits/stdlib.h	2006-11-07 11:18:39.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for stdlib functions.
--   Copyright (C) 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -28,7 +28,7 @@ extern char *__REDIRECT_NTH (__realpath_
- 			     (__const char *__restrict __name,
- 			      char *__restrict __resolved), realpath) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- __NTH (realpath (__const char *__restrict __name, char *__restrict __resolved))
- {
-   if (__bos (__resolved) != (size_t) -1)
-@@ -44,7 +44,7 @@ extern int __REDIRECT_NTH (__ptsname_r_a
- 					       size_t __buflen), ptsname_r)
-      __nonnull ((2));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (ptsname_r (int __fd, char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -59,7 +59,7 @@ extern int __wctomb_chk (char *__s, wcha
- extern int __REDIRECT_NTH (__wctomb_alias, (char *__s, wchar_t __wchar),
- 			   wctomb) __wur;
- 
--extern __always_inline __wur int
-+__extern_always_inline __wur int
- __NTH (wctomb (char *__s, wchar_t __wchar))
- {
-   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
-@@ -83,7 +83,7 @@ extern size_t __REDIRECT_NTH (__mbstowcs
- 			       __const char *__restrict __src,
- 			       size_t __len), mbstowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbstowcs (wchar_t *__restrict __dst, __const char *__restrict __src,
- 		 size_t __len))
- {
-@@ -104,7 +104,7 @@ extern size_t __REDIRECT_NTH (__wcstombs
- 			       __const wchar_t *__restrict __src,
- 			       size_t __len), wcstombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcstombs (char *__restrict __dst, __const wchar_t *__restrict __src,
- 		 size_t __len))
- {
-     --- libc/stdlib/gmp.h.jj	2002-08-27 00:39:44.000000000 +0200
-+++ libc/stdlib/gmp.h	2006-11-07 15:02:06.000000000 +0100
-@@ -1,6 +1,6 @@
- /* gmp.h -- Definitions for GNU multiple precision functions.
- 
--Copyright (C) 1991, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
-+Copyright (C) 1991, 1993, 1994, 1995, 1996, 2006 Free Software Foundation, Inc.
- 
- This file is part of the GNU MP Library.
- 
-@@ -21,6 +21,8 @@ MA 02111-1307, USA. */
- 
- #ifndef __GMP_H__
- 
-+#include <features.h>
-+
- #ifndef __GNU_MP__
- #define __GNU_MP__ 2
- #define __need_size_t
-@@ -41,7 +43,7 @@ MA 02111-1307, USA. */
- 
- #ifndef _EXTERN_INLINE
- #ifdef __GNUC__
--#define _EXTERN_INLINE extern __inline__
-+#define _EXTERN_INLINE __extern_inline
- #else
- #define _EXTERN_INLINE static
- #endif
---- libc/ctype/ctype.h.jj	2004-09-08 00:23:45.000000000 +0200
-+++ libc/ctype/ctype.h	2006-11-07 11:18:56.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004
-+/* Copyright (C) 1991,92,93,95,96,97,98,99,2001,2002,2004,2006
-    	Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-@@ -187,13 +187,13 @@ __exctype (_tolower);
- # endif
- 
- # ifdef __USE_EXTERN_INLINES
--extern __inline int
-+__extern_inline int
- __NTH (tolower (int __c))
- {
-   return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c;
- }
- 
--extern __inline int
-+__extern_inline int
- __NTH (toupper (int __c))
- {
-   return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c;
---- libc/nptl/sysdeps/pthread/bits/libc-lock.h.jj	2006-10-24 10:14:03.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/bits/libc-lock.h	2006-11-07 10:45:52.000000000 +0100
-@@ -1,5 +1,6 @@
- /* libc-internal interface for mutex locks.  NPTL version.
--   Copyright (C) 1996-2001, 2002, 2003, 2005 Free Software Foundation, Inc.
-+   Copyright (C) 1996-2001, 2002, 2003, 2005, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -408,7 +409,7 @@ extern void _pthread_cleanup_pop_restore
- 
- 
- /* Normal cleanup handling, based on C cleanup attribute.  */
--extern __inline void
-+__extern_inline void
- __libc_cleanup_routine (struct __pthread_cleanup_frame *f)
- {
-   if (f->__do_it)
---- libc/nptl/sysdeps/pthread/pthread.h.jj	2006-06-05 01:59:07.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/pthread.h	2006-11-07 10:49:27.000000000 +0100
-@@ -572,7 +572,7 @@ class __pthread_cleanup_class
-    function the compiler is free to decide inlining the change when
-    needed or fall back on the copy which must exist somewhere
-    else.  */
--extern __inline void
-+__extern_inline void
- __pthread_cleanup_routine (struct __pthread_cleanup_frame *__frame)
- {
-   if (__frame->__do_it)
-@@ -1103,7 +1103,7 @@ extern int pthread_atfork (void (*__prep
- 
- #ifdef __USE_EXTERN_INLINES
- /* Optimizations.  */
--extern __inline int
-+__extern_inline int
- __NTH (pthread_equal (pthread_t __thread1, pthread_t __thread2))
- {
-   return __thread1 == __thread2;
---- libc/nptl/sysdeps/pthread/allocalim.h.jj	2006-05-02 08:16:07.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/allocalim.h	2006-11-07 10:46:28.000000000 +0100
-@@ -21,8 +21,7 @@
- #include <limits.h>
- 
- 
--extern int
--__always_inline
-+__extern_always_inline int
- __libc_use_alloca (size_t size)
- {
-   return (__builtin_expect (size <= PTHREAD_STACK_MIN / 4, 1)
---- libc/nptl/sysdeps/pthread/gai_misc.h.jj	2006-09-05 17:23:12.000000000 +0200
-+++ libc/nptl/sysdeps/pthread/gai_misc.h	2006-11-06 21:17:39.000000000 +0100
-@@ -76,7 +76,7 @@
- #define gai_start_notify_thread __gai_start_notify_thread
- #define gai_create_helper_thread __gai_create_helper_thread
- 
--extern inline void
-+__extern_inline void
- __gai_start_notify_thread (void)
- {
-   sigset_t ss;
-@@ -85,7 +85,7 @@ __gai_start_notify_thread (void)
-   INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8);
- }
- 
--extern inline int
-+__extern_inline int
- __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/nptl/sysdeps/unix/sysv/linux/aio_misc.h.jj	2006-03-02 18:32:45.000000000 +0100
-+++ libc/nptl/sysdeps/unix/sysv/linux/aio_misc.h	2006-11-06 21:18:34.000000000 +0100
-@@ -27,7 +27,7 @@
- # define aio_start_notify_thread __aio_start_notify_thread
- # define aio_create_helper_thread __aio_create_helper_thread
- 
--extern inline void
-+__extern_inline void
- __aio_start_notify_thread (void)
- {
-   sigset_t ss;
-@@ -36,7 +36,7 @@ __aio_start_notify_thread (void)
-   INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8);
- }
- 
--extern inline int
-+__extern_inline int
- __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/resolv/gai_misc.c.jj	2006-08-03 10:01:53.000000000 +0200
-+++ libc/resolv/gai_misc.c	2006-11-07 10:49:55.000000000 +0100
-@@ -30,7 +30,7 @@
- #ifndef gai_create_helper_thread
- # define gai_create_helper_thread __gai_create_helper_thread
- 
--extern inline int
-+__extern_inline int
- __gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
- 			    void *arg)
- {
---- libc/bits/mathinline.h.jj	1997-10-13 05:53:18.000000000 +0200
-+++ libc/bits/mathinline.h	2006-11-07 10:51:05.000000000 +0100
-@@ -1,6 +1,6 @@
- /* This file should provide inline versions of math functions.
- 
--   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-+   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
- 
-    This file should define __MATH_INLINES if functions are actually defined as
-    inlines.  */
---- libc/bits/string.h.jj	1997-10-13 05:53:19.000000000 +0200
-+++ libc/bits/string.h	2006-11-07 10:50:54.000000000 +0100
-@@ -1,6 +1,6 @@
- /* This file should provide inline versions of string functions.
- 
--   Surround GCC-specific parts with #ifdef __GNUC__, and use `extern __inline'.
-+   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
- 
-    This file should define __STRING_INLINES if functions are actually defined
-    as inlines.  */
---- libc/bits/sigset.h.jj	2001-07-06 06:55:50.000000000 +0200
-+++ libc/bits/sigset.h	2006-11-07 11:19:08.000000000 +0100
-@@ -1,5 +1,6 @@
- /* __sig_atomic_t, __sigset_t, and related definitions.  Generic/BSD version.
--   Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1991, 1992, 1994, 1996, 1997, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -38,7 +39,7 @@ typedef unsigned long int __sigset_t;
- #define _SIGSET_H_fns 1
- 
- #ifndef _EXTERN_INLINE
--# define _EXTERN_INLINE extern __inline
-+# define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Return a mask that includes SIG only.  The cast to `sigset_t' avoids
---- libc/misc/sys/cdefs.h.jj	2006-01-14 21:14:36.000000000 +0100
-+++ libc/misc/sys/cdefs.h	2006-11-06 21:00:45.000000000 +0100
-@@ -279,6 +279,18 @@
- # define __always_inline __inline
- #endif
- 
-+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
-+   inline semantics.  */
-+#if __GNUC_PREREQ (4,3) && defined (__STDC_VERSION__) \
-+    && __STDC_VERSION__ >= 199901L
-+# define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
-+# define __extern_always_inline \
-+  extern __always_inline __inline __attribute__ ((__gnu_inline__))
-+#else
-+# define __extern_inline extern __inline
-+# define __extern_always_inline extern __always_inline
-+#endif
-+
- /* It is possible to compile containing GCC extensions even if GCC is
-    run in pedantic mode if the uses are carefully marked using the
-    `__extension__' keyword.  But this is not generally available before
---- libc/libio/bits/stdio.h.jj	2004-09-08 00:23:44.000000000 +0200
-+++ libc/libio/bits/stdio.h	2006-11-06 21:23:07.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimizing macros and inline functions for stdio functions.
--   Copyright (C) 1998, 2000, 2001, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1998, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __STDIO_INLINE inline
- #else
--# define __STDIO_INLINE extern __inline
-+# define __STDIO_INLINE __extern_inline
- #endif
- 
- 
---- libc/libio/bits/stdio2.h.jj	2005-03-19 01:14:58.000000000 +0100
-+++ libc/libio/bits/stdio2.h	2006-11-06 21:22:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for stdio functions.
--   Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -75,7 +75,7 @@ extern int __vprintf_chk (int __flag, __
- extern char *__gets_chk (char *__str, size_t) __wur;
- extern char *__REDIRECT (__gets_alias, (char *__str), gets) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- gets (char *__str)
- {
-   if (__bos (__str) != (size_t) -1)
-@@ -89,7 +89,7 @@ extern char *__REDIRECT (__fgets_alias,
- 			 (char *__restrict __s, int __n,
- 			  FILE *__restrict __stream), fgets) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -105,7 +105,7 @@ extern char *__REDIRECT (__fgets_unlocke
- 			 (char *__restrict __s, int __n,
- 			  FILE *__restrict __stream), fgets_unlocked) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
---- libc/argp/argp.h.jj	2006-04-22 17:08:26.000000000 +0200
-+++ libc/argp/argp.h	2006-11-06 21:24:08.000000000 +0100
-@@ -558,7 +558,7 @@ extern void *__argp_input (__const struc
- # endif
- 
- # ifndef ARGP_EI
--#  define ARGP_EI extern __inline__
-+#  define ARGP_EI __extern_inline
- # endif
- 
- ARGP_EI void
---- libc/argp/argp-fmtstream.h.jj	2005-09-27 23:45:41.000000000 +0200
-+++ libc/argp/argp-fmtstream.h	2006-11-07 11:19:12.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Word-wrapping and line-truncating streams.
--   Copyright (C) 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Written by Miles Bader <miles@gnu.ai.mit.edu>.
- 
-@@ -203,7 +203,7 @@ extern int __argp_fmtstream_ensure (argp
- #endif
- 
- #ifndef ARGP_FS_EI
--#define ARGP_FS_EI extern inline
-+#define ARGP_FS_EI __extern_inline
- #endif
- 
- ARGP_FS_EI size_t
---- libc/locale/programs/locfile.c.jj	2006-05-10 04:12:39.000000000 +0200
-+++ libc/locale/programs/locfile.c	2006-11-07 15:13:20.000000000 +0100
-@@ -33,6 +33,11 @@
- #include "locfile.h"
- #include "simple-hash.h"
- 
-+/* This prototype is needed to export locfile_hash from this object
-+   when using ISO C99 inline semantics.  */
-+struct keyword_t;
-+const struct keyword_t *locfile_hash (const char *str, unsigned int len);
-+
- #include "locfile-kw.h"
- 
- 
---- libc/locale/programs/charmap.c.jj	2006-08-19 19:50:52.000000000 +0200
-+++ libc/locale/programs/charmap.c	2006-11-07 15:11:05.000000000 +0100
-@@ -35,6 +35,10 @@
- 
- #include <assert.h>
- 
-+/* This prototype is needed to export charmap_hash from this object
-+   when using ISO C99 inline semantics.  */
-+struct keyword_t;
-+const struct keyword_t *charmap_hash (const char *str, unsigned int len);
- 
- /* Define the lookup function.  */
- #include "charmap-kw.h"
---- libc/io/sys/stat.h.jj	2006-01-06 13:14:05.000000000 +0100
-+++ libc/io/sys/stat.h	2006-11-06 21:27:03.000000000 +0100
-@@ -430,28 +430,28 @@ extern int __xmknodat (int __ver, int __
- #if defined __GNUC__ && __GNUC__ >= 2
- /* Inlined versions of the real stat and mknod functions.  */
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (stat (__const char *__path, struct stat *__statbuf))
- {
-   return __xstat (_STAT_VER, __path, __statbuf);
- }
- 
- # if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
--extern __inline__ int
-+__extern_inline int
- __NTH (lstat (__const char *__path, struct stat *__statbuf))
- {
-   return __lxstat (_STAT_VER, __path, __statbuf);
- }
- # endif
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (fstat (int __fd, struct stat *__statbuf))
- {
-   return __fxstat (_STAT_VER, __fd, __statbuf);
- }
- 
- # ifdef __USE_ATFILE
--extern __inline__ int
-+__extern_inline int
- __NTH (fstatat (int __fd, __const char *__filename, struct stat *__statbuf,
- 		int __flag))
- {
-@@ -460,7 +460,7 @@ __NTH (fstatat (int __fd, __const char *
- # endif
- 
- # if defined __USE_MISC || defined __USE_BSD
--extern __inline__ int
-+__extern_inline int
- __NTH (mknod (__const char *__path, __mode_t __mode, __dev_t __dev))
- {
-   return __xmknod (_MKNOD_VER, __path, __mode, &__dev);
-@@ -468,7 +468,7 @@ __NTH (mknod (__const char *__path, __mo
- # endif
- 
- # ifdef __USE_ATFILE
--extern __inline__ int
-+__extern_inline int
- __NTH (mknodat (int __fd, __const char *__path, __mode_t __mode,
- 		__dev_t __dev))
- {
-@@ -479,28 +479,28 @@ __NTH (mknodat (int __fd, __const char *
- # if defined __USE_LARGEFILE64 \
-   && (! defined __USE_FILE_OFFSET64 \
-       || (defined __REDIRECT_NTH && defined __OPTIMIZE__))
--extern __inline__ int
-+__extern_inline int
- __NTH (stat64 (__const char *__path, struct stat64 *__statbuf))
- {
-   return __xstat64 (_STAT_VER, __path, __statbuf);
- }
- 
- #  if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
--extern __inline__ int
-+__extern_inline int
- __NTH (lstat64 (__const char *__path, struct stat64 *__statbuf))
- {
-   return __lxstat64 (_STAT_VER, __path, __statbuf);
- }
- #  endif
- 
--extern __inline__ int
-+__extern_inline int
- __NTH (fstat64 (int __fd, struct stat64 *__statbuf))
- {
-   return __fxstat64 (_STAT_VER, __fd, __statbuf);
- }
- 
- #  ifdef __USE_GNU
--extern __inline__ int
-+__extern_inline int
- __NTH (fstatat64 (int __fd, __const char *__filename, struct stat64 *__statbuf,
- 		  int __flag))
- {
---- libc/wcsmbs/wchar.h.jj	2006-09-27 17:56:30.000000000 +0200
-+++ libc/wcsmbs/wchar.h	2006-11-06 21:28:28.000000000 +0100
-@@ -326,19 +326,19 @@ __END_NAMESPACE_C99
-    locales must use ASCII encoding for the values in the ASCII range
-    and because the wchar_t encoding is always ISO 10646.  */
- extern wint_t __btowc_alias (int __c) __asm ("btowc");
--extern __inline wint_t
-+__extern_inline wint_t
- __NTH (btowc (int __c))
- { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f'
- 	  ? (wint_t) __c : __btowc_alias (__c)); }
- 
- extern int __wctob_alias (wint_t __c) __asm ("wctob");
--extern __inline int
-+__extern_inline int
- __NTH (wctob (wint_t __wc))
- { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f'
- 	  ? (int) __wc : __wctob_alias (__wc)); }
- # endif
- 
--extern __inline size_t
-+__extern_inline size_t
- __NTH (mbrlen (__const char *__restrict __s, size_t __n,
- 	       mbstate_t *__restrict __ps))
- { return (__ps != NULL
-@@ -548,38 +548,38 @@ extern unsigned long long int __wcstoull
- /* Define inline functions which call the internal entry points.  */
- __BEGIN_NAMESPACE_C99
- 
--extern __inline double
-+__extern_inline double
- __NTH (wcstod (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr))
- { return __wcstod_internal (__nptr, __endptr, 0); }
--extern __inline long int
-+__extern_inline long int
- __NTH (wcstol (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr, int __base))
- { return __wcstol_internal (__nptr, __endptr, __base, 0); }
--extern __inline unsigned long int
-+__extern_inline unsigned long int
- __NTH (wcstoul (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr, int __base))
- { return __wcstoul_internal (__nptr, __endptr, __base, 0); }
- __END_NAMESPACE_C99
- 
- # ifdef __USE_GNU
--extern __inline float
-+__extern_inline float
- __NTH (wcstof (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr))
- { return __wcstof_internal (__nptr, __endptr, 0); }
- #  ifndef __LDBL_COMPAT
--extern __inline long double
-+__extern_inline long double
- __NTH (wcstold (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr))
- { return __wcstold_internal (__nptr, __endptr, 0); }
- #  endif
- __extension__
--extern __inline long long int
-+__extern_inline long long int
- __NTH (wcstoq (__const wchar_t *__restrict __nptr,
- 	       wchar_t **__restrict __endptr, int __base))
- { return __wcstoll_internal (__nptr, __endptr, __base, 0); }
- __extension__
--extern __inline unsigned long long int
-+__extern_inline unsigned long long int
- __NTH (wcstouq (__const wchar_t *__restrict __nptr,
- 		wchar_t **__restrict __endptr, int __base))
- { return __wcstoull_internal (__nptr, __endptr, __base, 0); }
---- libc/wcsmbs/bits/wchar2.h.jj	2006-01-14 13:09:47.000000000 +0100
-+++ libc/wcsmbs/bits/wchar2.h	2006-11-06 21:29:19.000000000 +0100
-@@ -30,7 +30,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemcp
- 				 __const wchar_t *__restrict __s2, size_t __n),
- 				wmemcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		size_t __n))
- {
-@@ -46,7 +46,7 @@ extern wchar_t *__REDIRECT_NTH (__wmemmo
- 						   __const wchar_t *__s2,
- 						   size_t __n), wmemmove);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemmove (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		 size_t __n))
- {
-@@ -65,7 +65,7 @@ extern wchar_t *__REDIRECT_NTH (__wmempc
- 				 __const wchar_t *__restrict __s2,
- 				 size_t __n), wmempcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmempcpy (wchar_t *__restrict __s1, __const wchar_t *__restrict __s2,
- 		 size_t __n))
- {
-@@ -81,7 +81,7 @@ extern wchar_t *__wmemset_chk (wchar_t *
- extern wchar_t *__REDIRECT_NTH (__wmemset_alias, (wchar_t *__s, wchar_t __c,
- 						  size_t __n), wmemset);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wmemset (wchar_t *__restrict __s, wchar_t __c, size_t __n))
- {
-   if (__bos0 (__s) != (size_t) -1)
-@@ -97,7 +97,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscpy
- 				(wchar_t *__restrict __dest,
- 				 __const wchar_t *__restrict __src), wcscpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcscpy (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -112,7 +112,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpcpy
- 						 __const wchar_t *__src),
- 				wcpcpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcpcpy (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -129,7 +129,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsncp
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcsncpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcsncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
-@@ -148,7 +148,7 @@ extern wchar_t *__REDIRECT_NTH (__wcpncp
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcpncpy);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcpncpy (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
-@@ -166,7 +166,7 @@ extern wchar_t *__REDIRECT_NTH (__wcscat
- 				(wchar_t *__restrict __dest,
- 				 __const wchar_t *__restrict __src), wcscat);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcscat (wchar_t *__dest, __const wchar_t *__src))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -183,7 +183,7 @@ extern wchar_t *__REDIRECT_NTH (__wcsnca
- 				 __const wchar_t *__restrict __src,
- 				 size_t __n), wcsncat);
- 
--extern __always_inline wchar_t *
-+__extern_always_inline wchar_t *
- __NTH (wcsncat (wchar_t *__dest, __const wchar_t *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1)
-@@ -246,7 +246,7 @@ extern wchar_t *__REDIRECT (__fgetws_ali
- 			    (wchar_t *__restrict __s, int __n,
- 			     __FILE *__restrict __stream), fgetws) __wur;
- 
--extern __always_inline __wur wchar_t *
-+__extern_always_inline __wur wchar_t *
- fgetws (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -264,7 +264,7 @@ extern wchar_t *__REDIRECT (__fgetws_unl
- 			     __FILE *__restrict __stream), fgetws_unlocked)
-   __wur;
- 
--extern __always_inline __wur wchar_t *
-+__extern_always_inline __wur wchar_t *
- fgetws_unlocked (wchar_t *__restrict __s, int __n, __FILE *__restrict __stream)
- {
-   if (__bos (__s) != (size_t) -1
-@@ -281,7 +281,7 @@ extern size_t __REDIRECT_NTH (__wcrtomb_
- 			      (char *__restrict __s, wchar_t __wchar,
- 			       mbstate_t *__restrict __ps), wcrtomb) __wur;
- 
--extern __always_inline __wur size_t
-+__extern_always_inline __wur size_t
- __NTH (wcrtomb (char *__s, wchar_t __wchar, mbstate_t *__ps))
- {
-   /* We would have to include <limits.h> to get a definition of MB_LEN_MAX.
-@@ -307,7 +307,7 @@ extern size_t __REDIRECT_NTH (__mbsrtowc
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      mbsrtowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbsrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
- 		  size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -330,7 +330,7 @@ extern size_t __REDIRECT_NTH (__wcsrtomb
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      wcsrtombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcsrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
- 		  size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -352,7 +352,7 @@ extern size_t __REDIRECT_NTH (__mbsnrtow
- 			       size_t __len, mbstate_t *__restrict __ps),
- 			      mbsnrtowcs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (mbsnrtowcs (wchar_t *__restrict __dst, __const char **__restrict __src,
- 		   size_t __nmc, size_t __len, mbstate_t *__restrict __ps))
- {
-@@ -376,7 +376,7 @@ extern size_t __REDIRECT_NTH (__wcsnrtom
- 			       size_t __nwc, size_t __len,
- 			       mbstate_t *__restrict __ps), wcsnrtombs);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (wcsnrtombs (char *__restrict __dst, __const wchar_t **__restrict __src,
- 		   size_t __nwc, size_t __len, mbstate_t *__restrict __ps))
- {
---- libc/socket/bits/socket2.h.jj	2005-08-08 21:00:53.000000000 +0200
-+++ libc/socket/bits/socket2.h	2006-11-06 21:29:59.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Checking macros for socket functions.
--   Copyright (C) 2005 Free Software Foundation, Inc.
-+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -26,7 +26,7 @@ extern ssize_t __recv_chk (int __fd, voi
- extern ssize_t __REDIRECT (__recv_alias, (int __fd, void *__buf, size_t __n,
- 					  int __flags), recv);
- 
--extern __always_inline ssize_t
-+__extern_always_inline ssize_t
- recv (int __fd, void *__buf, size_t __n, int __flags)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -44,7 +44,7 @@ extern ssize_t __REDIRECT (__recvfrom_al
- 			    int __flags, __SOCKADDR_ARG __addr,
- 			    socklen_t *__restrict __addr_len), recvfrom);
- 
--extern __always_inline ssize_t
-+__extern_always_inline ssize_t
- recvfrom (int __fd, void *__restrict __buf, size_t __n, int __flags,
- 	  __SOCKADDR_ARG __addr, socklen_t *__restrict __addr_len)
- {
---- libc/posix/bits/unistd.h.jj	2006-08-24 08:47:31.000000000 +0200
-+++ libc/posix/bits/unistd.h	2006-11-06 21:30:39.000000000 +0100
-@@ -26,7 +26,7 @@ extern ssize_t __read_chk (int __fd, voi
- extern ssize_t __REDIRECT (__read_alias, (int __fd, void *__buf,
- 					  size_t __nbytes), read) __wur;
- 
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- read (int __fd, void *__buf, size_t __nbytes)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -48,7 +48,7 @@ extern ssize_t __REDIRECT (__pread64_ali
- 			    __off64_t __offset), pread64) __wur;
- 
- # ifndef __USE_FILE_OFFSET64
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -57,7 +57,7 @@ pread (int __fd, void *__buf, size_t __n
-   return __pread_alias (__fd, __buf, __nbytes, __offset);
- }
- # else
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -68,7 +68,7 @@ pread (int __fd, void *__buf, size_t __n
- # endif
- 
- # ifdef __USE_LARGEFILE64
--extern __always_inline __wur ssize_t
-+__extern_always_inline __wur ssize_t
- pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset)
- {
-   if (__bos0 (__buf) != (size_t) -1
-@@ -89,7 +89,7 @@ extern ssize_t __REDIRECT_NTH (__readlin
- 				char *__restrict __buf, size_t __len), readlink)
-      __nonnull ((1, 2)) __wur;
- 
--extern __always_inline __nonnull ((1, 2)) __wur ssize_t
-+__extern_always_inline __nonnull ((1, 2)) __wur ssize_t
- __NTH (readlink (__const char *__restrict __path, char *__restrict __buf,
- 		 size_t __len))
- {
-@@ -111,7 +111,7 @@ extern ssize_t __REDIRECT_NTH (__readlin
- 			       readlinkat)
-      __nonnull ((2, 3)) __wur;
- 
--extern __always_inline __nonnull ((2, 3)) __wur ssize_t
-+__extern_always_inline __nonnull ((2, 3)) __wur ssize_t
- __NTH (readlinkat (int __fd, __const char *__restrict __path,
- 		   char *__restrict __buf, size_t __len))
- {
-@@ -127,7 +127,7 @@ extern char *__getcwd_chk (char *__buf, 
- extern char *__REDIRECT_NTH (__getcwd_alias,
- 			     (char *__buf, size_t __size), getcwd) __wur;
- 
--extern __always_inline __wur char *
-+__extern_always_inline __wur char *
- __NTH (getcwd (char *__buf, size_t __size))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -142,7 +142,7 @@ extern char *__getwd_chk (char *__buf, s
- extern char *__REDIRECT_NTH (__getwd_alias, (char *__buf), getwd)
-      __nonnull ((1)) __wur;
- 
--extern __always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
-+__extern_always_inline __nonnull ((1)) __attribute_deprecated__ __wur char *
- __NTH (getwd (char *__buf))
- {
-   if (__bos (__buf) != (size_t) -1)
-@@ -156,7 +156,7 @@ extern size_t __confstr_chk (int __name,
- extern size_t __REDIRECT_NTH (__confstr_alias, (int __name, char *__buf,
- 						size_t __len), confstr);
- 
--extern __always_inline size_t
-+__extern_always_inline size_t
- __NTH (confstr (int __name, char *__buf, size_t __len))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -171,7 +171,7 @@ extern int __getgroups_chk (int __size, 
- extern int __REDIRECT_NTH (__getgroups_alias, (int __size, __gid_t __list[]),
- 			   getgroups) __wur;
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (getgroups (int __size, __gid_t __list[]))
- {
-   if (__bos (__list) != (size_t) -1
-@@ -188,7 +188,7 @@ extern int __REDIRECT_NTH (__ttyname_r_a
- 					       size_t __buflen), ttyname_r)
-      __nonnull ((2));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (ttyname_r (int __fd, char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -204,7 +204,7 @@ extern int __getlogin_r_chk (char *__buf
- extern int __REDIRECT (__getlogin_r_alias, (char *__buf, size_t __buflen),
- 		       getlogin_r) __nonnull ((1));
- 
--extern __always_inline int
-+__extern_always_inline int
- getlogin_r (char *__buf, size_t __buflen)
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -221,7 +221,7 @@ extern int __gethostname_chk (char *__bu
- extern int __REDIRECT_NTH (__gethostname_alias, (char *__buf, size_t __buflen),
- 			   gethostname) __nonnull ((1));
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (gethostname (char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
-@@ -239,7 +239,7 @@ extern int __REDIRECT_NTH (__getdomainna
- 						   size_t __buflen),
- 			   getdomainname) __nonnull ((1)) __wur;
- 
--extern __always_inline int
-+__extern_always_inline int
- __NTH (getdomainname (char *__buf, size_t __buflen))
- {
-   if (__bos (__buf) != (size_t) -1
---- libc/string/bits/string3.h.jj	2005-08-08 21:02:31.000000000 +0200
-+++ libc/string/bits/string3.h	2006-11-07 11:19:17.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 2004, 2005 Free Software Foundation, Inc.
-+/* Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -151,7 +151,7 @@ extern char *__REDIRECT_NTH (__stpncpy_a
- 					       __const char *__src,
- 					       size_t __n), stpncpy);
- 
--extern __always_inline char *
-+__extern_always_inline char *
- __NTH (stpncpy (char *__dest, __const char *__src, size_t __n))
- {
-   if (__bos (__dest) != (size_t) -1
---- libc/string/bits/string2.h.jj	2004-05-28 08:39:13.000000000 +0200
-+++ libc/string/bits/string2.h	2006-11-07 11:19:24.000000000 +0100
-@@ -0,0 +1,18 @@
-+/*  DO NOT EDIT THIS FILE.
-+
-+    It has been auto-edited by fixincludes from:
-+
-+	"fixinc/tests/inc/bits/string2.h"
-+
-+    This had to be done to correct non-standard usages in the
-+    original, manufacturer supplied header file.  */
-+
-+
-+
-+#if defined( GLIBC_C99_INLINE_3_CHECK )
-+# if defined(__cplusplus) || __STDC_VERSION__ >= 19901L
-+#  define __STRING_INLINE inline
-+# else
-+#  define __STRING_INLINE extern __inline
-+# endif
-+#endif  /* GLIBC_C99_INLINE_3_CHECK */
-@@ -1,5 +1,5 @@
- /* Machine-independant string function optimizations.
--   Copyright (C) 1997-2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1997-2003, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
- 
-@@ -43,7 +43,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/string/argz.h.jj	2004-09-08 00:23:43.000000000 +0200
-+++ libc/string/argz.h	2006-11-07 11:19:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Routines for dealing with '\0' separated arg vectors.
--   Copyright (C) 1995,96,97,98,99,2000,2004 Free Software Foundation, Inc.
-+   Copyright (C) 1995,96,97,98,99,2000,2004,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -160,7 +160,7 @@ extern char *argz_next (__const char *__
- 			__const char *__restrict __entry) __THROW;
- 
- #ifdef __USE_EXTERN_INLINES
--extern inline char *
-+__extern_inline char *
- __NTH (__argz_next (__const char *__argz, size_t __argz_len,
- 		    __const char *__entry))
- {
-@@ -174,7 +174,7 @@ __NTH (__argz_next (__const char *__argz
-   else
-     return __argz_len > 0 ? (char *) __argz : 0;
- }
--extern inline char *
-+__extern_inline char *
- __NTH (argz_next (__const char *__argz, size_t __argz_len,
- 		  __const char *__entry))
- {
---- libc/math/bits/cmathcalls.h.jj	2001-07-06 06:55:35.000000000 +0200
-+++ libc/math/bits/cmathcalls.h	2006-11-07 11:19:39.000000000 +0100
-@@ -1,6 +1,6 @@
- /* Prototype declarations for complex math functions;
-    helper file for <complex.h>.
--   Copyright (C) 1997, 1998, 2001 Free Software Foundation, Inc.
-+   Copyright (C) 1997, 1998, 2001, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -135,21 +135,21 @@ __MATHDECL (_Mdouble_,creal, (_Mdouble_c
- #if defined __GNUC__ && !__GNUC_PREREQ (2, 97) && defined __OPTIMIZE__
- 
- /* Imaginary part of Z.  */
--extern __inline _Mdouble_
-+__extern_inline _Mdouble_
- __MATH_PRECNAME(cimag) (_Mdouble_complex_ __z) __THROW
- {
-   return __imag__ __z;
- }
- 
- /* Real part of Z.  */
--extern __inline _Mdouble_
-+__extern_inline _Mdouble_
- __MATH_PRECNAME(creal) (_Mdouble_complex_ __z) __THROW
- {
-   return __real__ __z;
- }
- 
- /* Complex conjugate of Z.  */
--extern __inline _Mdouble_complex_
-+__extern_inline _Mdouble_complex_
- __MATH_PRECNAME(conj) (_Mdouble_complex_ __z) __THROW
- {
-   return __extension__ ~__z;
---- libc/math/math_private.h.jj	2005-11-21 16:43:03.000000000 +0100
-+++ libc/math/math_private.h	2006-11-06 21:33:45.000000000 +0100
-@@ -192,7 +192,7 @@ extern int    __kernel_rem_pio2 (double*
- extern double __copysign (double x, double __y);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline double __copysign (double x, double y)
-+__extern_inline double __copysign (double x, double y)
- { return __builtin_copysign (x, y); }
- #endif
- 
-@@ -239,7 +239,7 @@ extern int   __kernel_rem_pio2f (float*,
- extern float __copysignf (float x, float __y);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline float __copysignf (float x, float y)
-+__extern_inline float __copysignf (float x, float y)
- { return __builtin_copysignf (x, y); }
- #endif
- 
-@@ -307,7 +307,7 @@ extern long double __logbl (long double 
- extern long double __significandl (long double x);
- 
- #if __GNUC_PREREQ (4, 0)
--extern inline long double __copysignl (long double x, long double y)
-+__extern_inline long double __copysignl (long double x, long double y)
- { return __builtin_copysignl (x, y); }
- #endif
- 
---- libc/hurd/hurd.h.jj	2002-01-02 10:52:20.000000000 +0100
-+++ libc/hurd/hurd.h	2006-11-07 11:19:51.000000000 +0100
-@@ -1,4 +1,5 @@
--/* Copyright (C) 1993,94,95,96,97,98,99,2001,02 Free Software Foundation, Inc.
-+/* Copyright (C) 1993,94,95,96,97,98,99,2001,2002,2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -44,7 +45,7 @@
- #include <errno.h>
- 
- #ifndef _HURD_H_EXTERN_INLINE
--#define _HURD_H_EXTERN_INLINE extern __inline
-+#define _HURD_H_EXTERN_INLINE __extern_inline
- #endif
- 
- _HURD_H_EXTERN_INLINE int
---- libc/hurd/hurd/port.h.jj	2001-07-06 06:54:47.000000000 +0200
-+++ libc/hurd/hurd/port.h	2006-11-07 11:19:58.000000000 +0100
-@@ -1,5 +1,6 @@
- /* Lightweight user references for ports.
--   Copyright (C) 1993, 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
-+   Copyright (C) 1993, 1994, 1995, 1997, 1999, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -55,7 +56,7 @@ struct hurd_port
- 
- 
- #ifndef _HURD_PORT_H_EXTERN_INLINE
--#define _HURD_PORT_H_EXTERN_INLINE extern __inline
-+#define _HURD_PORT_H_EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/hurd/hurd/threadvar.h.jj	2002-09-02 09:08:53.000000000 +0200
-+++ libc/hurd/hurd/threadvar.h	2006-11-07 10:54:40.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Internal per-thread variables for the Hurd.
--   Copyright (C) 1994,95,97,98,99,2001,02 Free Software Foundation, Inc.
-+   Copyright (C) 1994,95,97,98,99,2001,02,06 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -74,7 +74,7 @@ enum __hurd_threadvar_index
- 
- 
- #ifndef _HURD_THREADVAR_H_EXTERN_INLINE
--#define _HURD_THREADVAR_H_EXTERN_INLINE extern __inline
-+#define _HURD_THREADVAR_H_EXTERN_INLINE __extern_inline
- #endif
- 
- /* Return the location of the value for the per-thread variable with index
---- libc/hurd/hurd/fd.h.jj	2006-03-06 08:59:07.000000000 +0100
-+++ libc/hurd/hurd/fd.h	2006-11-07 10:53:18.000000000 +0100
-@@ -52,7 +52,7 @@ extern struct mutex _hurd_dtable_lock; /
- #include <hurd/signal.h>
- 
- #ifndef _HURD_FD_H_EXTERN_INLINE
--#define _HURD_FD_H_EXTERN_INLINE extern __inline
-+#define _HURD_FD_H_EXTERN_INLINE __extern_inline
- #endif
- 
- /* Returns the descriptor cell for FD.  If FD is invalid or unused, return
---- libc/hurd/hurd/signal.h.jj	2002-02-18 21:57:11.000000000 +0100
-+++ libc/hurd/hurd/signal.h	2006-11-07 10:54:13.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Implementing POSIX.1 signals under the Hurd.
--   Copyright (C) 1993,94,95,96,98,99,2002 Free Software Foundation, Inc.
-+   Copyright (C) 1993,94,95,96,98,99,2002,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -126,7 +126,7 @@ extern struct hurd_sigstate *_hurd_self_
-      __attribute__ ((__const__));
- 
- #ifndef _HURD_SIGNAL_H_EXTERN_INLINE
--#define _HURD_SIGNAL_H_EXTERN_INLINE extern __inline
-+#define _HURD_SIGNAL_H_EXTERN_INLINE __extern_inline
- #endif
- 
- _HURD_SIGNAL_H_EXTERN_INLINE struct hurd_sigstate *
---- libc/hurd/hurd/userlink.h.jj	2001-07-06 06:54:47.000000000 +0200
-+++ libc/hurd/hurd/userlink.h	2006-11-07 10:53:37.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Support for chains recording users of a resource; `struct hurd_userlink'.
--   Copyright (C) 1994, 1995, 1997, 1999 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1995, 1997, 1999, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -71,7 +71,7 @@ struct hurd_userlink
- 
- 
- #ifndef _HURD_USERLINK_H_EXTERN_INLINE
--#define _HURD_USERLINK_H_EXTERN_INLINE extern __inline
-+#define _HURD_USERLINK_H_EXTERN_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/mach/alpha/machine-sp.h.jj	2001-07-06 06:55:56.000000000 +0200
-+++ libc/sysdeps/mach/alpha/machine-sp.h	2006-11-07 10:55:42.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  Alpha version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -23,7 +23,7 @@
- /* Return the current stack pointer.  */
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- _EXTERN_INLINE void *
---- libc/sysdeps/mach/alpha/machine-lock.h.jj	2003-02-26 01:01:15.000000000 +0100
-+++ libc/sysdeps/mach/alpha/machine-lock.h	2006-11-07 11:20:04.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  Alpha version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/mach/i386/machine-lock.h.jj	2001-07-06 06:56:00.000000000 +0200
-+++ libc/sysdeps/mach/i386/machine-lock.h	2006-11-07 10:56:10.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  i386 version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile int __spin_lock_t;
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/mach/powerpc/machine-sp.h.jj	2002-08-27 00:39:44.000000000 +0200
-+++ libc/sysdeps/mach/powerpc/machine-sp.h	2006-11-07 10:56:59.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  PowerPC version.
--   Copyright (C) 2001 Free Software Foundation, Inc.
-+   Copyright (C) 2001, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -27,7 +27,7 @@
- # ifdef _HURD_THREADVAR_H_EXTERN_INLINE
- #  define _EXTERN_INLINE _HURD_THREADVAR_H_EXTERN_INLINE
- # else
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/mach/powerpc/machine-lock.h.jj	2002-02-17 08:13:25.000000000 +0100
-+++ libc/sysdeps/mach/powerpc/machine-lock.h	2006-11-07 10:56:40.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  PowerPC version.
--   Copyright (C) 1994,97,2002 Free Software Foundation, Inc.
-+   Copyright (C) 1994,97,2002,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef __volatile long int __spin_lock_
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/alpha/fpu/bits/mathinline.h.jj	2005-02-08 05:37:48.000000000 +0100
-+++ libc/sysdeps/alpha/fpu/bits/mathinline.h	2006-11-07 10:59:08.000000000 +0100
-@@ -1,5 +1,6 @@
- /* Inline math functions for Alpha.
--   Copyright (C) 1996, 1997, 1999-2001, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1996, 1997, 1999-2001, 2004, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by David Mosberger-Tang.
- 
-@@ -25,7 +26,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if defined __USE_ISOC99 && defined __GNUC__ && !__GNUC_PREREQ(3,0)
---- libc/sysdeps/ia64/fpu/bits/mathinline.h.jj	2004-09-08 23:44:02.000000000 +0200
-+++ libc/sysdeps/ia64/fpu/bits/mathinline.h	2006-11-07 10:59:49.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for ia64.
--   Copyright (C) 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if defined __USE_ISOC99 && defined __GNUC__ && __GNUC__ >= 2
---- libc/sysdeps/i386/fpu/bits/mathinline.h.jj	2004-09-08 00:23:42.000000000 +0200
-+++ libc/sysdeps/i386/fpu/bits/mathinline.h	2006-11-07 11:00:56.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for i387.
--   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004
-+   Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2006
-    Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by John C. Bowman <bowman@math.ualberta.ca>, 1995.
-@@ -26,7 +26,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/i386/i486/bits/string.h.jj	2004-12-15 21:30:16.000000000 +0100
-+++ libc/sysdeps/i386/i486/bits/string.h	2006-11-07 11:01:34.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimized, inlined string functions.  i486 version.
--   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004
-+   Copyright (C) 1997,1998,1999,2000,2001,2002,2003,2004,2006
-    	Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-@@ -35,7 +35,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/generic/inttypes.h.jj	2004-09-08 00:23:42.000000000 +0200
-+++ libc/sysdeps/generic/inttypes.h	2006-11-07 11:02:59.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1997-2001, 2004 Free Software Foundation, Inc.
-+/* Copyright (C) 1997-2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -330,7 +330,7 @@ extern long int __strtol_internal (__con
- 				   int __base, int __group) __THROW;
- #   define __strtol_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -345,7 +345,7 @@ extern unsigned long int __strtoul_inter
- 					     int __base, int __group) __THROW;
- #   define __strtoul_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -359,7 +359,7 @@ extern long int __wcstol_internal (__con
- 				   int __base, int __group) __THROW;
- #   define __wcstol_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -376,7 +376,7 @@ extern unsigned long int __wcstoul_inter
- 					     int __base, int __group) __THROW;
- #   define __wcstoul_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -393,7 +393,7 @@ extern long long int __strtoll_internal 
- 					 int __base, int __group) __THROW;
- #   define __strtoll_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (strtoimax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -411,7 +411,7 @@ extern unsigned long long int __strtoull
- 						   int __group) __THROW;
- #   define __strtoull_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (strtoumax (__const char *__restrict nptr, char **__restrict endptr,
- 		  int base))
- {
-@@ -427,7 +427,7 @@ extern long long int __wcstoll_internal 
- 					 int __base, int __group) __THROW;
- #   define __wcstoll_internal_defined	1
- #  endif
--extern __inline intmax_t
-+__extern_inline intmax_t
- __NTH (wcstoimax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
-@@ -446,7 +446,7 @@ extern unsigned long long int __wcstoull
- 						   int __group) __THROW;
- #   define __wcstoull_internal_defined	1
- #  endif
--extern __inline uintmax_t
-+__extern_inline uintmax_t
- __NTH (wcstoumax (__const __gwchar_t *__restrict nptr,
- 		  __gwchar_t **__restrict endptr, int base))
- {
---- libc/sysdeps/generic/machine-sp.h.jj	2001-07-06 06:55:49.000000000 +0200
-+++ libc/sysdeps/generic/machine-sp.h	2006-11-07 11:06:02.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific function to return the stack pointer.  Stub version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -23,7 +23,7 @@
- /* Return the current stack pointer.  */
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- _EXTERN_INLINE void *
---- libc/sysdeps/generic/machine-lock.h.jj	2001-07-06 06:55:49.000000000 +0200
-+++ libc/sysdeps/generic/machine-lock.h	2006-11-07 11:02:08.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Machine-specific definition for spin locks.  Stub version.
--   Copyright (C) 1994, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1994, 1997, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -30,7 +30,7 @@ typedef volatile int __spin_lock_t;
- 
- 
- #ifndef _EXTERN_INLINE
--#define _EXTERN_INLINE extern __inline
-+#define _EXTERN_INLINE __extern_inline
- #endif
- 
- /* Unlock LOCK.  */
---- libc/sysdeps/generic/allocalim.h.jj	2002-10-09 11:19:59.000000000 +0200
-+++ libc/sysdeps/generic/allocalim.h	2006-11-07 11:03:22.000000000 +0100
-@@ -1,4 +1,4 @@
--extern inline int __libc_use_alloca (size_t size)
-+__extern_inline int __libc_use_alloca (size_t size)
- {
-   return size <= __MAX_ALLOCA_CUTOFF;
- }
---- libc/sysdeps/pthread/aio_misc.c.jj	2006-01-04 00:12:54.000000000 +0100
-+++ libc/sysdeps/pthread/aio_misc.c	2006-11-07 11:06:31.000000000 +0100
-@@ -33,7 +33,7 @@
- #ifndef aio_create_helper_thread
- # define aio_create_helper_thread __aio_create_helper_thread
- 
--extern inline int
-+__extern_inline int
- __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), void *arg)
- {
-   pthread_attr_t attr;
---- libc/sysdeps/s390/bits/string.h.jj	2005-01-28 22:44:42.000000000 +0100
-+++ libc/sysdeps/s390/bits/string.h	2006-11-07 11:07:05.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Optimized, inlined string functions.  S/390 version.
--   Copyright (C) 2000, 2001 Free Software Foundation, Inc.
-+   Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
-    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
-    This file is part of the GNU C Library.
- 
-@@ -34,7 +34,7 @@
- # ifdef __cplusplus
- #  define __STRING_INLINE inline
- # else
--#  define __STRING_INLINE extern __inline
-+#  define __STRING_INLINE __extern_inline
- # endif
- #endif
- 
---- libc/sysdeps/s390/fpu/bits/mathinline.h.jj	2006-02-01 04:00:20.000000000 +0100
-+++ libc/sysdeps/s390/fpu/bits/mathinline.h	2006-11-07 11:07:37.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for s390.
--   Copyright (C) 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -24,7 +24,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- #if (!defined __NO_MATH_INLINES || defined __LIBC_INTERNAL_MATH_INLINES) \
---- libc/sysdeps/powerpc/fpu/bits/mathinline.h.jj	2006-11-06 20:53:15.000000000 +0100
-+++ libc/sysdeps/powerpc/fpu/bits/mathinline.h	2006-11-07 11:08:04.000000000 +0100
-@@ -25,7 +25,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif  /* __cplusplus */
- 
- #if defined __GNUC__ && !defined _SOFT_FLOAT
---- libc/sysdeps/x86_64/fpu/bits/mathinline.h.jj	2004-09-08 00:18:59.000000000 +0200
-+++ libc/sysdeps/x86_64/fpu/bits/mathinline.h	2006-11-07 11:10:33.000000000 +0100
-@@ -1,5 +1,5 @@
- /* Inline math functions for x86-64.
--   Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
- 
-@@ -25,7 +25,7 @@
- #ifdef __cplusplus
- # define __MATH_INLINE __inline
- #else
--# define __MATH_INLINE extern __inline
-+# define __MATH_INLINE __extern_inline
- #endif
- 
- 
---- libc/sysdeps/sparc/fpu/bits/mathinline.h.jj	2006-01-14 13:09:02.000000000 +0100
-+++ libc/sysdeps/sparc/fpu/bits/mathinline.h	2006-11-07 11:10:57.000000000 +0100
-@@ -131,7 +131,7 @@
- # ifdef __cplusplus
- #  define __MATH_INLINE __inline
- # else
--#  define __MATH_INLINE extern __inline
-+#  define __MATH_INLINE __extern_inline
- # endif  /* __cplusplus */
- 
- /* The gcc, version 2.7 or below, has problems with all this inlining
---- libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h.jj	2004-09-11 18:28:10.000000000 +0200
-+++ libc/sysdeps/unix/bsd/bsd4.4/bits/socket.h	2006-11-07 11:12:07.000000000 +0100
-@@ -1,5 +1,5 @@
- /* System-specific socket constants and types.  4.4 BSD version.
--   Copyright (C) 1991,92,1994-2002,2004 Free Software Foundation, Inc.
-+   Copyright (C) 1991,92,1994-2002,2004,2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -227,7 +227,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
- 				      struct cmsghdr *__cmsg) __THROW;
- #ifdef __USE_EXTERN_INLINES
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- _EXTERN_INLINE struct cmsghdr *
- __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
---- libc/sysdeps/unix/sysv/linux/ia64/ioperm.c.jj	2004-03-18 00:17:58.000000000 +0100
-+++ libc/sysdeps/unix/sysv/linux/ia64/ioperm.c	2006-11-07 11:13:23.000000000 +0100
-@@ -1,4 +1,4 @@
--/* Copyright (C) 1999, 2000, 2001, 2004 Free Software Foundation, Inc.
-+/* Copyright (C) 1999, 2000, 2001, 2004, 2006 Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
-    Contributed by David Mosberger-Tang <davidm@hpl.hp.com>.
- 
-@@ -51,7 +51,7 @@ static struct
-   }
- io;
- 
--__inline__ unsigned long int
-+static __always_inline unsigned long int
- io_offset (unsigned long int port)
- {
- 	return ((port >> 2) << 12) | (port & 0xfff);
---- libc/sysdeps/unix/sysv/linux/bits/socket.h.jj	2006-04-02 19:25:37.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/bits/socket.h	2006-11-07 11:15:04.000000000 +0100
-@@ -264,7 +264,7 @@ extern struct cmsghdr *__cmsg_nxthdr (st
- 				      struct cmsghdr *__cmsg) __THROW;
- #ifdef __USE_EXTERN_INLINES
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- _EXTERN_INLINE struct cmsghdr *
- __NTH (__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg))
---- libc/sysdeps/unix/sysv/linux/bits/sigset.h.jj	2001-07-06 06:56:14.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/bits/sigset.h	2006-11-07 11:14:48.000000000 +0100
-@@ -1,5 +1,6 @@
- /* __sig_atomic_t, __sigset_t, and related definitions.  Linux version.
--   Copyright (C) 1991, 1992, 1994, 1996, 1997 Free Software Foundation, Inc.
-+   Copyright (C) 1991, 1992, 1994, 1996, 1997, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -43,7 +44,7 @@ typedef struct
- # define _SIGSET_H_fns 1
- 
- # ifndef _EXTERN_INLINE
--#  define _EXTERN_INLINE extern __inline
-+#  define _EXTERN_INLINE __extern_inline
- # endif
- 
- /* Return a mask that includes the bit for SIG only.  */
---- libc/sysdeps/unix/sysv/linux/sys/sysmacros.h.jj	2004-09-08 00:18:59.000000000 +0200
-+++ libc/sysdeps/unix/sysv/linux/sys/sysmacros.h	2006-11-07 11:15:53.000000000 +0100
-@@ -0,0 +1,18 @@
-+/*  DO NOT EDIT THIS FILE.
-+
-+    It has been auto-edited by fixincludes from:
-+
-+	"fixinc/tests/inc/sys/sysmacros.h"
-+
-+    This had to be done to correct non-standard usages in the
-+    original, manufacturer supplied header file.  */
-+
-+
-+
-+#if defined( GLIBC_C99_INLINE_4_CHECK )
-+__extension__ 
-+#if __STDC_VERSION__ < 19901L
-+extern
-+#endif
-+ __inline unsigned int
-+#endif  /* GLIBC_C99_INLINE_4_CHECK */
-@@ -1,5 +1,6 @@
- /* Definitions of macros to access `dev_t' values.
--   Copyright (C) 1996, 1997, 1999, 2003, 2004 Free Software Foundation, Inc.
-+   Copyright (C) 1996, 1997, 1999, 2003, 2004, 2006
-+   Free Software Foundation, Inc.
-    This file is part of the GNU C Library.
- 
-    The GNU C Library is free software; you can redistribute it and/or
-@@ -27,30 +28,30 @@
-    they need.  */
- #ifdef __GLIBC_HAVE_LONG_LONG
- __extension__
--extern __inline unsigned int gnu_dev_major (unsigned long long int __dev)
-+__extern_inline unsigned int gnu_dev_major (unsigned long long int __dev)
-      __THROW;
- __extension__
--extern __inline unsigned int gnu_dev_minor (unsigned long long int __dev)
-+__extern_inline unsigned int gnu_dev_minor (unsigned long long int __dev)
-      __THROW;
- __extension__
--extern __inline unsigned long long int gnu_dev_makedev (unsigned int __major,
-+__extern_inline unsigned long long int gnu_dev_makedev (unsigned int __major,
- 							unsigned int __minor)
-      __THROW;
- 
- # if defined __GNUC__ && __GNUC__ >= 2
--__extension__ extern __inline unsigned int
-+__extension__ __extern_inline unsigned int
- __NTH (gnu_dev_major (unsigned long long int __dev))
- {
-   return ((__dev >> 8) & 0xfff) | ((unsigned int) (__dev >> 32) & ~0xfff);
- }
- 
--__extension__ extern __inline unsigned int
-+__extension__ __extern_inline unsigned int
- __NTH (gnu_dev_minor (unsigned long long int __dev))
- {
-   return (__dev & 0xff) | ((unsigned int) (__dev >> 12) & ~0xff);
- }
- 
--__extension__ extern __inline unsigned long long int
-+__extension__ __extern_inline unsigned long long int
- __NTH (gnu_dev_makedev (unsigned int __major, unsigned int __minor))
- {
-   return ((__minor & 0xff) | ((__major & 0xfff) << 8)
diff --git a/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch b/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch
deleted file mode 100644
index 07039718477..00000000000
--- a/pkgs/development/libraries/glibc/2.5/glibc-pwd.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-diff -ruN glibc-20050110/configure glibc-20050110.patched/configure
---- glibc-20050110/configure	2005-01-05 10:39:53.000000000 +0100
-+++ glibc-20050110.patched/configure	2005-01-18 13:33:01.000000000 +0100
-@@ -1393,7 +1393,7 @@
- ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
- 
- 
--if test "`cd $srcdir; /bin/pwd`" = "`/bin/pwd`"; then
-+if test "`cd $srcdir; @PWD@`" = "`@PWD@`"; then
-   { { echo "$as_me:$LINENO: error: you must configure in a separate build directory" >&5
- echo "$as_me: error: you must configure in a separate build directory" >&2;}
-    { (exit 1); exit 1; }; }
-diff -ruN glibc-20050110/io/ftwtest-sh glibc-20050110.patched/io/ftwtest-sh
---- glibc-20050110/io/ftwtest-sh	2004-02-09 21:12:23.000000000 +0100
-+++ glibc-20050110.patched/io/ftwtest-sh	2005-01-18 13:33:15.000000000 +0100
-@@ -120,7 +120,7 @@
-     sort > $testout
- 
- # perhaps $tmp involves some symlinks...
--tmpreal=`cd $tmp; /bin/pwd 2>/dev/null || /usr/bin/pwd`
-+tmpreal=`cd $tmp; @PWD@ 2>/dev/null || /usr/bin/pwd`
- 
- cat <<EOF | cmp $testout - || exit 1
- base = "$tmp/", file = "ftwtest.d", flag = FTW_D, cwd = $tmpreal, level = 0
-@@ -138,7 +138,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d |
-     sort > $testout
-@@ -160,7 +160,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/. |
-     sort > $testout
-@@ -182,7 +182,7 @@
- EOF
- rm $testout
- 
--curwd=`/bin/pwd 2>/dev/null || /usr/bin/pwd`
-+curwd=`@PWD@ 2>/dev/null || /usr/bin/pwd`
- cd "$tmp"
- LD_LIBRARY_PATH=$objpfx $ldso $testprogram --chdir ftwtest.d/foo/lvl1/link@1 |
-     sort > $testout
-diff -ruN glibc-20050110/scripts/rellns-sh glibc-20050110.patched/scripts/rellns-sh
---- glibc-20050110/scripts/rellns-sh	1999-12-19 00:40:25.000000000 +0100
-+++ glibc-20050110.patched/scripts/rellns-sh	2005-01-18 13:35:53.245937423 +0100
-@@ -22,13 +22,13 @@
-   exit 1
- fi
- 
--if test -x /bin/pwd; then
--  pwd=/bin/pwd
--elif test -x /usr/bin/pwd; then
--  pwd=/usr/bin/pwd
--else
-+#if test -x /bin/pwd; then
-+#  pwd=/bin/pwd
-+#elif test -x /usr/bin/pwd; then
-+#  pwd=/usr/bin/pwd
-+#else
-   pwd='pwd'
--fi
-+#fi
- 
- # Make both paths absolute.
- if test -d $1; then
diff --git a/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch b/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch
deleted file mode 100644
index 816e0aa528b..00000000000
--- a/pkgs/development/libraries/glibc/2.5/make-3-82-fix.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- glibc-2.5/manual/Makefile.orig	2011-01-26 17:03:14.000000000 +0100
-+++ glibc-2.5/manual/Makefile	2011-01-26 17:04:30.000000000 +0100
-@@ -232,7 +232,10 @@
- .PHONY: stubs
- stubs: $(objpfx)stubs
- endif
--$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
-+$(objpfx)stubs ../po/manual.pot:
-+	$(make-target-directory)
-+	touch $@
-+$(objpfx)stamp%:
- 	$(make-target-directory)
- 	touch $@
- 
diff --git a/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch b/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch
deleted file mode 100644
index 45deb1d2d71..00000000000
--- a/pkgs/development/libraries/glibc/2.5/x86-fnstsw.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-# --- T2-COPYRIGHT-NOTE-BEGIN ---
-# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
-# 
-# T2 SDE: package/.../glibc/x86-fnstsw.patch
-# Copyright (C) 2008 The T2 SDE Project
-# 
-# More information can be found in the files COPYING and README.
-# 
-# This patch file is dual-licensed. It is available under the license the
-# patched project is licensed under, as long as it is an OpenSource license
-# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
-# of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
-# --- T2-COPYRIGHT-NOTE-END ---
-
-Fix more strict checking in binutils since 2.18.50.0.3:
-  sysdeps/i386/fpu/ftestexcept.c:33: Error: suffix or operands invalid for `fnstsw'
-
-  - Rene Rebe <rene@exactcode.de>
-
---- glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c.vanilla	2008-09-02 12:45:07.000000000 +0200
-+++ glibc-2.6.1/sysdeps/i386/fpu/ftestexcept.c	2008-09-02 12:46:37.000000000 +0200
-@@ -26,7 +26,7 @@
- int
- fetestexcept (int excepts)
- {
--  int temp;
-+  short temp;
-   int xtemp = 0;
- 
-   /* Get current exceptions.  */
diff --git a/pkgs/development/libraries/glibc/2.7/builder.sh b/pkgs/development/libraries/glibc/2.7/builder.sh
deleted file mode 100644
index d5a43229bfa..00000000000
--- a/pkgs/development/libraries/glibc/2.7/builder.sh
+++ /dev/null
@@ -1,60 +0,0 @@
-# glibc cannot have itself in its rpath.
-export NIX_NO_SELF_RPATH=1
-export NIX_DONT_SET_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.
-export BASH_SHELL=$SHELL
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-    
-    mkdir ../build
-    cd ../build
-    
-    configureScript=../$sourceRoot/configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make localedata/install-locales
-    fi
-    rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.7/default.nix b/pkgs/development/libraries/glibc/2.7/default.nix
deleted file mode 100644
index 7eb34e88899..00000000000
--- a/pkgs/development/libraries/glibc/2.7/default.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation {
-  name = "glibc-2.7";
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = mirror://gnu/glibc/glibc-2.7.tar.bz2;
-    sha256 = "06j5q20l11x8kcrl9bg15xgb1pw0w82pazikxf4zvq2fmhiaa922";
-  };
-
-  inherit kernelHeaders installLocales;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-       
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-       
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-  ];
-
-  # `--with-tls --without-__thread' enables support for TLS but causes
-  # it not to be used.  Required if we don't want to barf on 2.4
-  # kernels.  Or something.
-  configureFlags="--enable-add-ons
-    --with-headers=${kernelHeaders}/include
-    ${if profilingLibraries then "--enable-profile" else "--disable-profile"}";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-}
diff --git a/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch
deleted file mode 100644
index 4d29082f941..00000000000
--- a/pkgs/development/libraries/glibc/2.7/nss-skip-unavail.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -rc glibc-2.7-orig/sysdeps/posix/getaddrinfo.c glibc-2.7/sysdeps/posix/getaddrinfo.c
-*** glibc-2.7-orig/sysdeps/posix/getaddrinfo.c	2007-10-17 18:05:12.000000000 +0200
---- glibc-2.7/sysdeps/posix/getaddrinfo.c	2008-04-08 12:17:09.000000000 +0200
-***************
-*** 498,505 ****
-  	  int no_data = 0;
-  	  int no_inet6_data = 0;
-  	  service_user *nip = NULL;
-- 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-- 	  enum nss_status status = NSS_STATUS_UNAVAIL;
-  	  int no_more;
-  	  int old_res_options;
-  
---- 498,503 ----
-***************
-*** 689,694 ****
---- 687,694 ----
-  
-  	  while (!no_more)
-  	    {
-+               enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+               enum nss_status status = NSS_STATUS_UNAVAIL;
-  	      nss_gethostbyname3_r fct = NULL;
-  	      if (req->ai_flags & AI_CANONNAME)
-  		/* No need to use this function if we do not look for
diff --git a/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch b/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch
deleted file mode 100644
index ab3d6144d6e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/binutils-2.20.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-Support GNU Binutils 2.20 and beyond.  Patch from
-http://sourceware.org/ml/libc-alpha/2009-09/msg00009.html .
-
-diff --git a/configure b/configure
-index 48e6952..b1d84d7 100755
---- a/configure
-+++ b/configure
-@@ -4841,7 +4841,7 @@ $as_echo_n "checking version of $AS... " >&6; }
-   ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-   case $ac_prog_version in
-     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
--    2.1[3-9]*)
-+    2.1[3-9]*|[2-9].[2-9]*)
-        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- 
-@@ -4904,7 +4904,7 @@ $as_echo_n "checking version of $LD... " >&6; }
-   ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
-   case $ac_prog_version in
-     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
--    2.1[3-9]*)
-+    2.1[3-9]*|[2-9].[2-9]*)
-        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
- 
-diff --git a/configure.in b/configure.in
-index 4584afe..7c4f71f 100644
---- a/configure.in
-+++ b/configure.in
-@@ -897,10 +897,10 @@ AC_SUBST(MIG)dnl Needed by sysdeps/mach/configure.in
- # Accept binutils 2.13 or newer.
- AC_CHECK_PROG_VER(AS, $AS, --version,
- 		  [GNU assembler.* \([0-9]*\.[0-9.]*\)],
--		  [2.1[3-9]*], AS=: critic_missing="$critic_missing as")
-+		  [2.1[3-9]*|[2-9].[2-9]*], AS=: critic_missing="$critic_missing as")
- AC_CHECK_PROG_VER(LD, $LD, --version,
- 		  [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
--		  [2.1[3-9]*], LD=: critic_missing="$critic_missing ld")
-+		  [2.1[3-9]*|[2-9].[2-9]*], LD=: critic_missing="$critic_missing ld")
- 
- # We need the physical current working directory.  We cannot use the
- # "pwd -P" shell builtin since that's not portable.  Instead we try to
diff --git a/pkgs/development/libraries/glibc/2.9/binutils-ld.patch b/pkgs/development/libraries/glibc/2.9/binutils-ld.patch
deleted file mode 100644
index ae70f145ce0..00000000000
--- a/pkgs/development/libraries/glibc/2.9/binutils-ld.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-From 7c8a67320e26b8c11108bf0a3410d3aef9cf3486 Mon Sep 17 00:00:00 2001
-From: Ulrich Drepper <drepper@redhat.com>
-Date: Sat, 31 Jan 2009 00:21:15 +0000
-Subject: [PATCH] * elf/Makefile (ld.so): Adjust the sed script to insert _begin in to
-
-	newer linker scripts.
----
- ChangeLog    |    5 +++++
- elf/Makefile |    4 ++--
- 2 files changed, 7 insertions(+), 2 deletions(-)
-
-diff --git a/elf/Makefile b/elf/Makefile
-index 8079fe9..e44ff1d 100644
---- a/elf/Makefile
-+++ b/elf/Makefile
-@@ -1,4 +1,4 @@
--# Copyright (C) 1995-2007, 2008 Free Software Foundation, Inc.
-+# Copyright (C) 1995-2007, 2008, 2009 Free Software Foundation, Inc.
- # This file is part of the GNU C Library.
- 
- # The GNU C Library is free software; you can redistribute it and/or
-@@ -304,7 +304,7 @@ $(objpfx)ld.so: $(objpfx)librtld.os $(ld-map)
- 		  $(LDFLAGS-rtld) -Wl,-z,defs -Wl,--verbose 2>&1 |	\
- 		  LC_ALL=C \
- 		  sed -e '/^=========/,/^=========/!d;/^=========/d'	\
--		      -e 's/\. = 0 + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
-+		      -e 's/\. = .* + SIZEOF_HEADERS;/& _begin = . - SIZEOF_HEADERS;/' \
- 		  > $@.lds
- 	$(LINK.o) -nostdlib -nostartfiles -shared -o $@			\
- 		  $(LDFLAGS-rtld) -Wl,-z,defs $(z-now-$(bind-now))	\
--- 
-1.6.4
-
diff --git a/pkgs/development/libraries/glibc/2.9/builder.sh b/pkgs/development/libraries/glibc/2.9/builder.sh
deleted file mode 100644
index c81a3ac2a9e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/builder.sh
+++ /dev/null
@@ -1,85 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    if test -n "$crossConfig"; then
-        sed -i s/-lgcc_eh//g Makeconfig
-    fi
-
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-    if test -n "$crossConfig"; then
-        cat > config.cache << "EOF"
-libc_cv_forced_unwind=yes
-libc_cv_c_cleanup=yes
-libc_cv_gnu89_inline=yes
-EOF
-        export BUILD_CC=gcc
-        export CC="${crossConfig}-gcc"
-        export AR="${crossConfig}-ar"
-        export RANLIB="${crossConfig}-ranlib"
-        configureFlags="${configureFlags} --cache-file=config.cache"
-
-        # Disable the native stripping, because it breaks libc_nonshared.a
-        dontStrip=1
-    fi
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-
-    export NIX_DONT_SET_RPATH=1
-    unset CFLAGS
-}
-
-
-postInstall() {
-    if test -n "$installLocales"; then
-        make localedata/install-locales
-    fi
-    test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-
-    # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
-    # "lib64" to "lib".
-    if test -n "$is64bit"; then
-        ln -s lib $out/lib64
-    fi
-}
-
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/default.nix b/pkgs/development/libraries/glibc/2.9/default.nix
deleted file mode 100644
index 7d42825206e..00000000000
--- a/pkgs/development/libraries/glibc/2.9/default.nix
+++ /dev/null
@@ -1,103 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, installLocales ? true
-, profilingLibraries ? false
-, gccCross ? null
-}:
-let
-    cross = if gccCross != null then gccCross.target else null;
-in
-stdenv.mkDerivation rec {
-  name = "glibc-2.9" +
-    stdenv.lib.optionalString (cross != null) "-${cross.config}";
-
-  builder = ./builder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit kernelHeaders installLocales;
-  crossConfig = if (cross != null) then cross.config else null;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Fix for NIXPKGS-79: when doing host name lookups, when
-       nsswitch.conf contains a line like
-
-         hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       don't return an error when mdns4_minimal can't be found.  This
-       is a bug in Glibc: when a service can't be found, NSS should
-       continue to the next service unless "UNAVAIL=return" is set.
-       ("NOTFOUND=return" refers to the service returning a NOTFOUND
-       error, not the service itself not being found.)  The reason is
-       that the "status" variable (while initialised to UNAVAIL) is
-       outside of the loop that iterates over the services, the
-       "files" service sets status to NOTFOUND.  So when the call to
-       find "mdns4_minimal" fails, "status" will still be NOTFOUND,
-       and it will return instead of continuing to "dns".  Thus, the
-       line
-
-         hosts: mdns4_minimal [NOTFOUND=return] dns mdns4
-
-       does work because "status" will contain UNAVAIL after the
-       failure to find mdns4_minimal. */
-    ./nss-skip-unavail.patch
-
-    /* Make it possible to override the locale-archive in NixOS. */
-    ./locale-override.patch
-
-    /* Have rpcgen(1) look for cpp(1) in $PATH.  */
-    ./rpcgen-path.patch
-
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-
-    ./binutils-ld.patch
-  ];
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--with-headers=${kernelHeaders}/include"
-    (if profilingLibraries then "--enable-profile" else "--disable-profile")
-  ] ++ stdenv.lib.optionals (cross != null) [
-    "--with-tls"
-    "--enable-kernel=2.6.0"
-    "--without-fp"
-    "--with-__thread"
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  buildNativeInputs = stdenv.lib.optionals (cross != null) [ gccCross ];
-
-  preInstall = if (cross != null) then ''
-    mkdir -p $out/lib
-    ln -s ${stdenv.gcc.gcc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
-  '' else "";
-
-  postInstall = if (cross != null) then ''
-    rm $out/lib/libgcc_s.so.1
-  '' else "";
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/headers.nix b/pkgs/development/libraries/glibc/2.9/headers.nix
deleted file mode 100644
index 7adeb11c8bc..00000000000
--- a/pkgs/development/libraries/glibc/2.9/headers.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-{ stdenv, fetchurl, kernelHeaders
-, profilingLibraries ? false
-}:
-
-stdenv.mkDerivation rec {
-  name = "glibc-headers-2.9";
-
-  builder = ./headersbuilder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit kernelHeaders;
-
-  inherit (stdenv) is64bit;
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--with-headers=${kernelHeaders}/include"
-    "--disable-sanity-checks"
-    "--enable-hacker-mode"
-    (if profilingLibraries then "--enable-profile" else "--disable-profile")
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  buildPhase = "true";
-
-  # I took some tricks from crosstool-0.43
-  installPhase = ''
-    make cross-compiling=yes CFLAGS=-DBOOTSTRAP_GCC install-headers
-    mkdir -p $out/include/gnu
-    touch $out/include/gnu/stubs.h
-    cp ../include/features.h $out/include/features.h
-    (cd $out/include && ln -s $kernelHeaders/include/* .) || exit 1
-  '';
-
-  # Workaround for this bug:
-  #   http://sourceware.org/bugzilla/show_bug.cgi?id=411
-  # I.e. when gcc is compiled with --with-arch=i686, then the
-  # preprocessor symbol `__i686' will be defined to `1'.  This causes
-  # the symbol __i686.get_pc_thunk.dx to be mangled.
-  NIX_CFLAGS_COMPILE = "-U__i686";
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "The GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/headersbuilder.sh b/pkgs/development/libraries/glibc/2.9/headersbuilder.sh
deleted file mode 100644
index 23f4bd4cc61..00000000000
--- a/pkgs/development/libraries/glibc/2.9/headersbuilder.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/info.nix b/pkgs/development/libraries/glibc/2.9/info.nix
deleted file mode 100644
index cc79bbece3d..00000000000
--- a/pkgs/development/libraries/glibc/2.9/info.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv, fetchurl, texinfo, perl }:
-
-stdenv.mkDerivation rec {
-  name = "glibc-info-2.9";
-  
-  src = fetchurl {
-    url = http://nixos.org/tarballs/glibc-2.9-20081208.tar.bz2;
-    sha256 = "0zhxbgcsl97pf349m0lz8d5ljvvzrcqc23yf08d888xlk4ms8m3h";
-  };
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  preConfigure = ''
-    export PWD_P=$(type -tP pwd)
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-    mkdir ../build
-    cd ../build
-    
-    configureScript=../$sourceRoot/configure
-  '';
-
-  configureFlags = [ "--enable-add-ons" ];
-
-  buildInputs = [ texinfo perl ];
-
-  buildPhase = "make info";
-
-  # I don't know why the info is not generated in 'build'
-  # Somehow building the info still does not work, because the final
-  # libc.info hasn't a Top node.
-  installPhase = ''
-    mkdir -p $out/share/info
-    cp ../$sourceRoot/manual/*.info $out/share/info
-  '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "Locale information for the GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/locale-override.patch b/pkgs/development/libraries/glibc/2.9/locale-override.patch
deleted file mode 100644
index 108d0e35dac..00000000000
--- a/pkgs/development/libraries/glibc/2.9/locale-override.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-diff -rc glibc-2.9-20081208-orig/locale/loadarchive.c glibc-2.9-20081208/locale/loadarchive.c
-*** glibc-2.9-20081208-orig/locale/loadarchive.c	2005-09-09 18:56:52.000000000 +0200
---- glibc-2.9-20081208/locale/loadarchive.c	2009-04-19 13:54:26.000000000 +0200
-***************
-*** 124,129 ****
---- 124,142 ----
-  }
-  
-  
-+ static int
-+ open_locale_archive ()
-+ {
-+   int fd = -1;
-+   char *path = getenv ("LOCALE_ARCHIVE");
-+   if (path)
-+     fd = open_not_cancel_2 (path, O_RDONLY|O_LARGEFILE);
-+   if (fd < 0)
-+     fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-+   return fd;
-+ }
-+ 
-+ 
-  /* Find the locale *NAMEP in the locale archive, and return the
-     internalized data structure for its CATEGORY data.  If this locale has
-     already been loaded from the archive, just returns the existing data
-***************
-*** 203,209 ****
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
---- 216,222 ----
-        archmapped = &headmap;
-  
-        /* The archive has never been opened.  */
-!       fd = open_locale_archive ();
-        if (fd < 0)
-  	/* Cannot open the archive, for whatever reason.  */
-  	return NULL;
-***************
-*** 394,400 ****
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_not_cancel_2 (archfname, O_RDONLY|O_LARGEFILE);
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
---- 407,413 ----
-  	  if (fd == -1)
-  	    {
-  	      struct stat64 st;
-! 	      fd = open_locale_archive ();
-  	      if (fd == -1)
-  		/* Cannot open the archive, for whatever reason.  */
-  		return NULL;
-diff -rc glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h glibc-2.9-20081208/sysdeps/generic/unsecvars.h
-*** glibc-2.9-20081208-orig/sysdeps/generic/unsecvars.h	2006-10-11 18:24:05.000000000 +0200
---- glibc-2.9-20081208/sysdeps/generic/unsecvars.h	2009-04-19 13:55:34.000000000 +0200
-***************
-*** 16,21 ****
---- 16,22 ----
-    "LD_SHOW_AUXV\0"							      \
-    "LD_USE_LOAD_BIAS\0"							      \
-    "LOCALDOMAIN\0"							      \
-+   "LOCALE_ARCHIVE\0"							      \
-    "LOCPATH\0"								      \
-    "MALLOC_TRACE\0"							      \
-    "NIS_PATH\0"								      \
diff --git a/pkgs/development/libraries/glibc/2.9/locales.nix b/pkgs/development/libraries/glibc/2.9/locales.nix
deleted file mode 100644
index a1fe9f82f14..00000000000
--- a/pkgs/development/libraries/glibc/2.9/locales.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This function builds just the `lib/locale/locale-archive' file from
-   Glibc and nothing else.  If `allLocales' is true, all supported
-   locales are included; otherwise, just the locales listed in
-   `locales'.  See localedata/SUPPORTED in the Glibc source tree for
-   the list of all supported locales:
-   http://sourceware.org/cgi-bin/cvsweb.cgi/libc/localedata/SUPPORTED?cvsroot=glibc
-*/
-
-{ stdenv, fetchurl, allLocales ? true, locales ? ["en_US.UTF-8/UTF-8"] }:
-
-stdenv.mkDerivation rec {
-  name = "glibc-locales-2.9";
-
-  builder = ./localesbuilder.sh;
-
-  src = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-2.9.tar.bz2;
-    sha256 = "0v53m7flx6qcx7cvrvvw6a4dx4x3y6k8nvpc4wfv5xaaqy2am2q9";
-  };
-
-  srcPorts = fetchurl {
-    url = http://ftp.gnu.org/gnu/glibc/glibc-ports-2.9.tar.bz2;
-    sha256 = "0r2sn527wxqifi63di7ns9wbjh1cainxn978w178khhy7yw9fk42";
-  };
-
-  inherit (stdenv) is64bit;
-
-  configureFlags = [
-    "--enable-add-ons"
-    "--without-headers"
-    "--disable-profile"
-  ] ++ (if stdenv.isArm then [
-    "--host=arm-linux-gnueabi"
-    "--build=arm-linux-gnueabi"
-    "--without-fp"
-  ] else []);
-
-  patches = [
-    /* Support GNU Binutils 2.20 and above.  */
-    ./binutils-2.20.patch
-  ];
-
-  # Awful hack: `localedef' doesn't allow the path to `locale-archive'
-  # to be overriden, but you *can* specify a prefix, i.e. it will use
-  # <prefix>/<path-to-glibc>/lib/locale/locale-archive.  So we use
-  # $TMPDIR as a prefix, meaning that the locale-archive is placed in
-  # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
-  buildPhase =
-    ''
-      mkdir -p $TMPDIR/"$(dirname $(readlink -f $(type -p localedef)))/../lib/locale"
-      make localedata/install-locales \
-          LOCALEDEF="localedef --prefix=$TMPDIR" \
-          localedir=$out/lib/locale \
-          ${if allLocales then "" else "SUPPORTED-LOCALES=\"${toString locales}\""}
-    '';
-
-  installPhase =
-    ''
-      mkdir -p $out/lib/locale
-      cp $TMPDIR/nix/store/*/lib/locale/locale-archive $out/lib/locale/
-    '';
-
-  meta = {
-    homepage = http://www.gnu.org/software/libc/;
-    description = "Locale information for the GNU C Library";
-  };
-}
diff --git a/pkgs/development/libraries/glibc/2.9/localesbuilder.sh b/pkgs/development/libraries/glibc/2.9/localesbuilder.sh
deleted file mode 100644
index a28f6bcbaeb..00000000000
--- a/pkgs/development/libraries/glibc/2.9/localesbuilder.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-# Glibc cannot have itself in its RPATH.
-export NIX_NO_SELF_RPATH=1
-
-source $stdenv/setup
-
-# Explicitly tell glibc to use our pwd, not /bin/pwd.
-export PWD_P=$(type -tP pwd)
-
-# Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
-# prevent a retained dependency on the bootstrap tools in the
-# stdenv-linux bootstrap.
-export BASH_SHELL=/bin/sh
-
-
-preConfigure() {
-
-    for i in configure io/ftwtest-sh; do
-        # Can't use substituteInPlace here because replace hasn't been
-        # built yet in the bootstrap.
-        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
-    done
-
-    # In the glibc 2.6/2.7 tarballs C-translit.h is a little bit older
-    # than C-translit.h.in, forcing Make to rebuild it unnecessarily.
-    # This wouldn't be problem except that it requires Perl, which we
-    # don't want as a dependency in the Nixpkgs bootstrap.  So force
-    # the output file to be newer.
-    touch locale/C-translit.h
-
-    tar xvjf "$srcPorts"
-    
-    mkdir build
-    cd build
-    
-    configureScript=../configure
-}
-
-
-postConfigure() {
-    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
-    # This has to be done *after* `configure' because it builds some
-    # test binaries.
-    export NIX_CFLAGS_LINK=
-    export NIX_LDFLAGS_BEFORE=
-
-    export NIX_DONT_SET_RPATH=1
-    unset CFLAGS
-}
-
-genericBuild
diff --git a/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch b/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch
deleted file mode 100644
index dc09b509870..00000000000
--- a/pkgs/development/libraries/glibc/2.9/nss-skip-unavail.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-diff -rc glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c
-*** glibc-2.9-20081208-orig/sysdeps/posix/getaddrinfo.c	2008-07-30 21:14:22.000000000 +0200
---- glibc-2.9-20081208/sysdeps/posix/getaddrinfo.c	2008-12-10 11:39:32.000000000 +0100
-***************
-*** 505,512 ****
-  	  int no_data = 0;
-  	  int no_inet6_data = 0;
-  	  service_user *nip = NULL;
-- 	  enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-- 	  enum nss_status status = NSS_STATUS_UNAVAIL;
-  	  int no_more;
-  	  int old_res_options;
-  
---- 505,510 ----
-***************
-*** 702,707 ****
---- 700,707 ----
-  
-  	  while (!no_more)
-  	    {
-+ 	      enum nss_status inet6_status = NSS_STATUS_UNAVAIL;
-+ 	      enum nss_status status = NSS_STATUS_UNAVAIL;
-  	      nss_gethostbyname4_r fct4
-  		= __nss_lookup_function (nip, "gethostbyname4_r");
-  	      if (fct4 != NULL)
diff --git a/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch b/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch
deleted file mode 100644
index fbb03dd5fad..00000000000
--- a/pkgs/development/libraries/glibc/2.9/rpcgen-path.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-By default, rpcgen(1) looks for cpp(1) from a list of fixed absolute paths
-(`/lib/cpp', etc.), which may only be overrided with the `-Y' option.  This
-patch makes it run any `cpp' command found in $PATH.
-
---- glibc-2.7/sunrpc/rpc_main.c	2006-11-10 21:54:46.000000000 +0100
-+++ glibc-2.7/sunrpc/rpc_main.c	2009-04-22 14:32:10.000000000 +0200
-@@ -79,7 +79,7 @@ static const char *cmdname;
- 
- static const char *svcclosetime = "120";
- static int cppDefined;	/* explicit path for C preprocessor */
--static const char *CPP = SUNOS_CPP;
-+static const char *CPP = "cpp";
- static const char CPPFLAGS[] = "-C";
- static char *pathbuf;
- static int cpp_pid;
-@@ -108,7 +108,6 @@ static char *extendfile (const char *fil
- static void open_output (const char *infile, const char *outfile);
- static void add_warning (void);
- static void clear_args (void);
--static void find_cpp (void);
- static void open_input (const char *infile, const char *define);
- static int check_nettype (const char *name, const char *list_to_check[]);
- static void c_output (const char *infile, const char *define,
-@@ -327,31 +326,6 @@ clear_args (void)
-   argcount = FIXEDARGS;
- }
- 
--/* make sure that a CPP exists */
--static void
--find_cpp (void)
--{
--  struct stat buf;
--
--  if (stat (CPP, &buf) < 0)
--    {				/* /lib/cpp or explicit cpp does not exist */
--      if (cppDefined)
--	{
--	  fprintf (stderr, _ ("cannot find C preprocessor: %s \n"), CPP);
--	  crash ();
--	}
--      else
--	{			/* try the other one */
--	  CPP = SVR4_CPP;
--	  if (stat (CPP, &buf) < 0)
--	    {			/* can't find any cpp */
--	      fputs (_ ("cannot find any C preprocessor (cpp)\n"), stdout);
--	      crash ();
--	    }
--	}
--    }
--}
--
- /*
-  * Open input file with given define for C-preprocessor
-  */
-@@ -370,7 +344,6 @@ open_input (const char *infile, const ch
-   switch (cpp_pid)
-     {
-     case 0:
--      find_cpp ();
-       putarg (0, CPP);
-       putarg (1, CPPFLAGS);
-       addarg (define);
-@@ -380,7 +353,7 @@ open_input (const char *infile, const ch
-       close (1);
-       dup2 (pd[1], 1);
-       close (pd[0]);
--      execv (arglist[0], (char **) arglist);
-+      execvp (arglist[0], (char **) arglist);
-       perror ("execv");
-       exit (1);
-     case -1:
diff --git a/pkgs/development/libraries/glibmm/2.30.x.nix b/pkgs/development/libraries/glibmm/2.30.x.nix
deleted file mode 100644
index 4792ae790be..00000000000
--- a/pkgs/development/libraries/glibmm/2.30.x.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, glib, libsigcxx }:
-
-stdenv.mkDerivation rec {
-  name = "glibmm-2.30.1";
-
-  src = fetchurl {
-    url = mirror://gnome/sources/glibmm/2.30/glibmm-2.30.1.tar.xz;
-    sha256 = "15zqgx6rashyhxk89qjqq05p6m40akpgzyjk8bfb3jk68rc2nn39";
-  };
-
-  buildNativeInputs = [pkgconfig];
-  propagatedBuildInputs = [glib libsigcxx];
-
-  meta = {
-    description = "C++ interface to the GLib library";
-
-    homepage = http://gtkmm.org/;
-
-    license = "LGPLv2+";
-
-    maintainers = with stdenv.lib.maintainers; [urkud raskin];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/glibmm/default.nix b/pkgs/development/libraries/glibmm/default.nix
new file mode 100644
index 00000000000..962b14bc788
--- /dev/null
+++ b/pkgs/development/libraries/glibmm/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, glib, gdk_pixbuf, libsigcxx }:
+
+stdenv.mkDerivation rec {
+  name = "glibmm-2.34.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/glibmm/2.34/${name}.tar.xz";
+    sha256 = "1i4jsvahva2q0mig7kjnpsw0r3fnpybm8b6hzymfm2hpgqnaa9dl";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  propagatedBuildInputs = [ glib gdk_pixbuf libsigcxx ];
+
+  meta = {
+    description = "C++ interface to the GLib library";
+
+    homepage = http://gtkmm.org/;
+
+    license = "LGPLv2+";
+
+    maintainers = with stdenv.lib.maintainers; [urkud raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gmp/4.3.1.nix b/pkgs/development/libraries/gmp/4.3.1.nix
deleted file mode 100644
index 5f83d9ae46d..00000000000
--- a/pkgs/development/libraries/gmp/4.3.1.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{stdenv, fetchurl, m4, cxx ? true}:
-
-stdenv.mkDerivation rec {
-  name = "gmp-4.3.1";
-
-  src = fetchurl {
-    url = "mirror://gnu/gmp/${name}.tar.bz2";
-    sha256 = "1j5pklq36ivg2cim5wfysns229a544lqkimp3mlzkwjl513ra0ma";
-  };
-
-  buildInputs = [m4];
-
-  preConfigure = "ln -sf configfsf.guess config.guess";
-
-  configureFlags = if cxx then "--enable-cxx" else "--disable-cxx";
-
-  doCheck = true;
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "A free library for arbitrary precision arithmetic, operating on signed integers, rational numbers, and floating point numbers";
-    homepage = http://gmplib.org/;
-    license = "LGPL";
-    platforms = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/development/libraries/gmp/4.3.2.nix b/pkgs/development/libraries/gmp/4.3.2.nix
index d25b6941153..df7bd0ea3b9 100644
--- a/pkgs/development/libraries/gmp/4.3.2.nix
+++ b/pkgs/development/libraries/gmp/4.3.2.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck";
   };
 
-  buildNativeInputs = [ m4 ];
+  nativeBuildInputs = [ m4 ];
 
   # Prevent the build system from using sub-architecture-specific
   # instructions (e.g., SSE2 on i686).
diff --git a/pkgs/development/libraries/gmp/5.0.5.nix b/pkgs/development/libraries/gmp/5.0.5.nix
index 98ebe5fcc25..461187a509c 100644
--- a/pkgs/development/libraries/gmp/5.0.5.nix
+++ b/pkgs/development/libraries/gmp/5.0.5.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./ignore-bad-cpuid.patch ];
 
-  buildNativeInputs = [ m4 ];
+  nativeBuildInputs = [ m4 ];
 
   configureFlags =
     # Build a "fat binary", with routines for several sub-architectures
@@ -23,6 +23,13 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  crossAttrs = {
+    # Disable stripping to avoid "libgmp.a: Archive has no index"
+    # (see <http://hydra.nixos.org/build/4268666>.)
+    dontStrip = true;
+    dontCrossStrip = true;
+  };
+
   meta = {
     description = "GMP, the GNU multiple precision arithmetic library";
 
diff --git a/pkgs/development/libraries/gmp/5.1.1.nix b/pkgs/development/libraries/gmp/5.1.1.nix
new file mode 100644
index 00000000000..0261f833962
--- /dev/null
+++ b/pkgs/development/libraries/gmp/5.1.1.nix
@@ -0,0 +1,54 @@
+{ stdenv, fetchurl, m4, cxx ? true }:
+
+stdenv.mkDerivation rec {
+  name = "gmp-5.1.1";
+
+  src = fetchurl {
+    urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
+    sha256 = "1bdgf04k2i12pfivxgjq68iarz3ngix9hpzbmkgijrdk92gpgm50";
+  };
+
+  nativeBuildInputs = [ m4 ];
+
+  configureFlags =
+    # Build a "fat binary", with routines for several sub-architectures
+    # (x86), except on Solaris where some tests crash with "Memory fault".
+    # See <http://hydra.nixos.org/build/2760931>, for instance.
+    (stdenv.lib.optional (!stdenv.isSunOS) "--enable-fat")
+    ++ (if cxx then [ "--enable-cxx" ] else [ "--disable-cxx" ]);
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://gmplib.org/";
+    description = "GMP, the GNU multiple precision arithmetic library";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/libraries/gnu-efi/default.nix b/pkgs/development/libraries/gnu-efi/default.nix
index c43e9f6b4da..ca24db94cd0 100644
--- a/pkgs/development/libraries/gnu-efi/default.nix
+++ b/pkgs/development/libraries/gnu-efi/default.nix
@@ -2,12 +2,13 @@
 , fetchurl
 }:
 
-stdenv.mkDerivation {
-  name = "gnu-efi-3.0p";
+let version = "3.0s"; in stdenv.mkDerivation {
+
+  name = "gnu-efi-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/gnu-efi/gnu-efi_3.0p.orig.tar.gz";
-    sha256 = "1pm4wk1gma7mb8z19js7kb5y31a0zk308mkafmq6gb0b2a0i39cn";
+    url = "mirror://sourceforge/gnu-efi/gnu-efi_${version}.orig.tar.gz";
+    sha256 = "18bpswzkj81dadq1b7n2s9g0cz60l34ggzxlq21mb8va10j9zmhh";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/gnutls/2.12.nix b/pkgs/development/libraries/gnutls/2.12.nix
index cbb72754b1b..85a676a05b1 100644
--- a/pkgs/development/libraries/gnutls/2.12.nix
+++ b/pkgs/development/libraries/gnutls/2.12.nix
@@ -5,11 +5,11 @@ assert guileBindings -> guile != null;
 
 stdenv.mkDerivation rec {
 
-  name = "gnutls-2.12.11";
+  name = "gnutls-2.12.23";
 
-  src = fetchurl {
-    url = "mirror://gnu/gnutls/${name}.tar.bz2";
-    sha256 = "0q0kk69y1vpdxdz0mxqw603zi2y5kkgz3rvinc6bv6z9mwd8xd80";
+  src = fetchurl { # missing on standard mirrors
+    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v2.12/${name}.tar.bz2";
+    sha256 = "1lkys703z4yxfgzarmgas5ccvn6m254w9wvm7s8v0zkj81z7m9nz";
   };
 
   configurePhase = ''
diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix
index b8f88c6f5b8..df6a67b9731 100644
--- a/pkgs/development/libraries/gnutls/default.nix
+++ b/pkgs/development/libraries/gnutls/default.nix
@@ -1,39 +1,48 @@
-{ fetchurl, stdenv, zlib, lzo, libtasn1, nettle
-, guileBindings, guile, perl }:
+{ fetchurl, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
+, guileBindings, guile, perl, gmp }:
 
 assert guileBindings -> guile != null;
 
 stdenv.mkDerivation (rec {
 
-  name = "gnutls-3.0.22";
+  name = "gnutls-3.1.12";
 
   src = fetchurl {
-    url = "mirror://gnu/gnutls/${name}.tar.xz";
-    sha256 = "1pp90fm27qi5cd0pq18xcmnl79xcbfwxc54bg1xi1wv0vryqdpcr";
+    url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/${name}.tar.lz";
+    sha256 = "1h8j3xi2jad2dclybgqffb5264hdqrxpsx99irs03yy9np6iw5l8";
   };
 
+  # Note: GMP is a dependency of Nettle, whose public headers include
+  # GMP headers, hence the hack.
   configurePhase = ''
     ./configure --prefix="$out"                                 \
       --disable-dependency-tracking --enable-fast-install       \
       --without-p11-kit                                         \
-      --with-lzo --with-libtasn1-prefix="${libtasn1}"		\
+      --with-lzo --with-libtasn1-prefix="${libtasn1}"           \
+      --with-libnettle-prefix="${nettle}"                       \
+      CPPFLAGS="-I${gmp}/include"                               \
       ${if guileBindings
         then "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\""
         else ""}
   '';
 
-  buildInputs = [ zlib lzo ]
+  # Build of the Guile bindings is not parallel-safe.  See
+  # <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad>
+  # for the actual fix.
+  enableParallelBuilding = false;
+
+  buildInputs = [ zlib lzo lzip ]
     ++ stdenv.lib.optional guileBindings guile;
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   propagatedBuildInputs = [ nettle libtasn1 ];
 
   # XXX: Gnulib's `test-select' fails on FreeBSD:
   # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
-  doCheck = (!stdenv.isFreeBSD);
+  doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "The GNU Transport Layer Security Library";
 
     longDescription = ''
@@ -52,8 +61,7 @@ stdenv.mkDerivation (rec {
 
     homepage = http://www.gnu.org/software/gnutls/;
     license = "LGPLv2.1+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ maintainers.ludo ];
   };
 }
 
diff --git a/pkgs/development/libraries/gobject-introspection/default.nix b/pkgs/development/libraries/gobject-introspection/default.nix
index de9059dbd15..fe1d519f562 100644
--- a/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/pkgs/development/libraries/gobject-introspection/default.nix
@@ -1,12 +1,7 @@
 { stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python }:
 
-let
-  baseName = "gobject-introspection";
-  v = "0.10.8";
-in
-
 stdenv.mkDerivation rec {
-  name = "${baseName}-${v}";
+  name = "gobject-introspection-1.34.0";
 
   buildInputs = [ flex bison glib pkgconfig python ];
   propagatedBuildInputs = [ libffi ];
@@ -16,8 +11,8 @@ stdenv.mkDerivation rec {
   configureFlags = "--disable-tests";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${baseName}/0.10/${name}.tar.bz2";
-    sha256 = "5b1387ff37f03db880a2b1cbd6c6b6dfb923a29468d4d8367c458abf7704c61e";
+    url = "mirror://gnome/sources/gobject-introspection/1.34/${name}.tar.xz";
+    sha256 = "80e211ea95404fc7c5fa3b04ba69ee0b29af70847af315155ab06b8cff832c85";
   };
 
   postInstall = "rm -rf $out/share/gtk-doc";
diff --git a/pkgs/development/libraries/goffice/0.9.nix b/pkgs/development/libraries/goffice/0.10.nix
index 23b65b1c712..793704be255 100644
--- a/pkgs/development/libraries/goffice/0.9.nix
+++ b/pkgs/development/libraries/goffice/0.10.nix
@@ -3,11 +3,11 @@
 , cairo, gconf, libgnomeui }:
 
 stdenv.mkDerivation rec {
-  name = "goffice-0.9.3";
+  name = "goffice-0.10.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/goffice/0.9/${name}.tar.xz";
-    sha256 = "0l9achvmbmhn2p5qd0nl7vxn5c3nf1ndzlyknczzyiaa6d5zj91h";
+    url = "mirror://gnome/sources/goffice/0.10/${name}.tar.xz";
+    sha256 = "7e7577f69203b03c4966906bcaabc6e87a629efb1684630c2bee7907bed08439";
   };
 
   buildInputs = [
diff --git a/pkgs/development/libraries/goffice/default.nix b/pkgs/development/libraries/goffice/default.nix
index b90cbbad920..14da5f3468b 100644
--- a/pkgs/development/libraries/goffice/default.nix
+++ b/pkgs/development/libraries/goffice/default.nix
@@ -1,19 +1,21 @@
 { fetchurl, stdenv, pkgconfig, glib, gtk, libglade, bzip2
 , pango, libgsf, libxml2, libart, intltool, gettext
-, cairo, gconf, libgnomeui }:
+, cairo, gconf, libgnomeui, pcre }:
 
 stdenv.mkDerivation rec {
-  name = "goffice-0.6.6";
+  name = "goffice-0.8.17";
 
   src = fetchurl {
-    # An old version, but one that's actually usable for Gnucash.
-    url = "mirror://gnome/sources/goffice/0.6/${name}.tar.bz2";
-    sha256 = "11lzhmk7g6mdsbyn4p4a6q2d9m8j71vad2haw6pmzyjzv2gs4rq7";
+    url = "mirror://gnome/sources/goffice/0.8/${name}.tar.xz";
+    sha256 = "165070beb67b84580afe80a8a100b674a81d553ab791acd72ac0c655f4fadb15";
   };
 
+  # fix linking error: undefined reference to pcre_info
+  patches = [ ./pcre_info.patch ]; # inspired by https://bugs.php.net/bug.php?id=60986
+
   buildInputs = [
     pkgconfig libglade bzip2 libart intltool gettext
-    gconf libgnomeui
+    gconf libgnomeui pcre
   ];
 
   propagatedBuildInputs = [
@@ -21,6 +23,12 @@ stdenv.mkDerivation rec {
     glib libgsf libxml2 gtk libglade libart cairo pango
   ];
 
+  postInstall =
+    ''
+      # Get GnuCash to build.  Might be unnecessary if we upgrade pkgconfig.
+      substituteInPlace $out/lib/pkgconfig/libgoffice-*.pc --replace Requires.private Requires
+    '';
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/development/libraries/goffice/pcre_info.patch b/pkgs/development/libraries/goffice/pcre_info.patch
new file mode 100644
index 00000000000..cd4ef3c9fed
--- /dev/null
+++ b/pkgs/development/libraries/goffice/pcre_info.patch
@@ -0,0 +1,13 @@
+diff --git a/goffice/utils/regutf8.c b/goffice/utils/regutf8.c
+index bc4aae4..3adb696 100644
+--- a/goffice/utils/regutf8.c
++++ b/goffice/utils/regutf8.c
+@@ -155,7 +155,7 @@ go_regcomp (GORegexp *gor, const char *pat, int cflags)
+ 		default: return GO_REG_BADPAT;
+ 		}
+ 	} else {
+-		gor->re_nsub = pcre_info (r, NULL, NULL);
++		gor->re_nsub = pcre_fullinfo (r, NULL, NULL, NULL);
+ 		gor->nosub = (cflags & GO_REG_NOSUB) != 0;
+ 		return 0;
+ 	}
diff --git a/pkgs/development/libraries/google-perftools/default.nix b/pkgs/development/libraries/google-perftools/default.nix
deleted file mode 100644
index 7935a794a2f..00000000000
--- a/pkgs/development/libraries/google-perftools/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{stdenv, fetchurl, libunwind}:
-
-stdenv.mkDerivation rec {
-  name = "google-perftools-1.8.3";
-  src = fetchurl {
-    url = "http://google-perftools.googlecode.com/files/${name}.tar.gz";
-    sha256 = "0ncx3a8jl6n38q9bjnaz5sq96yb6yh99j3bl64k3295v9arl9mva";
-  };
-  buildInputs = [libunwind];
-  meta = {
-    description = "Fast, multi-threaded malloc() and nifty performance analysis tools.";
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix
new file mode 100644
index 00000000000..76d1d8c41f7
--- /dev/null
+++ b/pkgs/development/libraries/gperftools/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libunwind }:
+
+stdenv.mkDerivation rec {
+  name = "gperftools-2.0";
+
+  src = fetchurl {
+    url = "https://gperftools.googlecode.com/files/${name}.tar.gz";
+    sha1 = "da7181a7ba9b5ee7302daf6c16e886c179fe8d1b";
+  };
+
+  patches = [ ./glibc-2.16.patch ];
+
+  buildInputs = [ libunwind ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://code.google.com/p/gperftools/;
+    description = "Fast, multi-threaded malloc() and nifty performance analysis tools";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gperftools/glibc-2.16.patch b/pkgs/development/libraries/gperftools/glibc-2.16.patch
new file mode 100644
index 00000000000..b17e0d57f5f
--- /dev/null
+++ b/pkgs/development/libraries/gperftools/glibc-2.16.patch
@@ -0,0 +1,13 @@
+Index: gperftools-2.0/src/base/linuxthreads.cc
+===================================================================
+--- gperftools-2.0.orig/src/base/linuxthreads.cc
++++ gperftools-2.0/src/base/linuxthreads.cc
+@@ -193,7 +193,7 @@ static volatile int *sig_pids, sig_num_t
+ /* Signal handler to help us recover from dying while we are attached to
+  * other threads.
+  */
+-static void SignalHandler(int signum, siginfo_t *si, void *data) {
++static void SignalHandler(int signum, struct siginfo *si, void *data) {
+   if (sig_pids != NULL) {
+     if (signum == SIGABRT) {
+       while (sig_num_threads-- > 0) {
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 582208f08b6..4ba4cbb3347 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -1,5 +1,15 @@
-{ stdenv, fetchurl, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan }:
+{ stdenv, fetchurl, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan
+, useGnupg1 ? false, gnupg1 ? null }:
 
+assert useGnupg1 -> gnupg1 != null;
+assert !useGnupg1 -> gnupg != null;
+
+let
+  gpgPath = if useGnupg1 then
+    "${gnupg1}/bin/gpg"
+  else
+    "${gnupg}/bin/gpg2";
+in
 stdenv.mkDerivation rec {
   name = "gpgme-1.3.1";
   
@@ -8,9 +18,9 @@ stdenv.mkDerivation rec {
     sha256 = "1m7l7nicn6gd952cgspv9xr8whqivbg33nbg8kbpj3dffnl2gvqm";
   };
   
-  propagatedBuildInputs = [ libgpgerror glib pth libassuan ];
+  propagatedBuildInputs = [ libgpgerror glib libassuan pth ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
-  configureFlags = "--with-gpg=${gnupg}/bin/gpg2";
+  configureFlags = "--with-gpg=${gpgPath}";
 }
diff --git a/pkgs/development/libraries/grantlee/default.nix b/pkgs/development/libraries/grantlee/default.nix
index 47d3d22f043..4fc7b681baa 100644
--- a/pkgs/development/libraries/grantlee/default.nix
+++ b/pkgs/development/libraries/grantlee/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, qt4, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "grantlee-0.2.0";
+  name = "grantlee-0.3.0";
 
 # Upstream download server has country code firewall, so I made a mirror.
   src = fetchurl {
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
       "http://downloads.grantlee.org/${name}.tar.gz"
       "http://www.loegria.net/grantlee/${name}.tar.gz"
     ];
-    sha256 = "0x6lvn5i9025vdbs6sybs2mm5ay5y40f7nvb58mc2k518rmjb9j3";
+    sha256 = "0c2zwaickp7han0zbxg78qrxv06jjfc4xyz2lmvl1xxmpv4vqzpv";
   };
 
   buildInputs = [ cmake qt4 ];
diff --git a/pkgs/development/libraries/gsasl/default.nix b/pkgs/development/libraries/gsasl/default.nix
index 9f71bc5e202..3b52133058f 100644
--- a/pkgs/development/libraries/gsasl/default.nix
+++ b/pkgs/development/libraries/gsasl/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gss, libidn }:
 
 stdenv.mkDerivation rec {
-  name = "gsasl-1.6.1";
+  name = "gsasl-1.8.0";
 
   src = fetchurl {
     url = "mirror://gnu/gsasl/${name}.tar.gz";
-    sha256 = "02dmras3kqik08p14mpq0lj678w7wmmaxpcvdrx116wkcgspv2z6";
+    sha256 = "1rci64cxvcfr8xcjpqc4inpfq7aw4snnsbf5xz7d30nhvv8n40ii";
   };
 
   buildInputs = [ gss libidn ];
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix
index 47762660b29..2ac325dc282 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-base/default.nix
@@ -8,14 +8,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-plugins-base-0.10.35";
+  name = "gst-plugins-base-0.10.36";
 
   src = fetchurl {
     urls = [
-      "${meta.homepage}/src/gst-plugins-base/${name}.tar.bz2"
-      "mirror://gentoo/distfiles/${name}.tar.bz2"
+      "${meta.homepage}/src/gst-plugins-base/${name}.tar.xz"
+      "mirror://gentoo/distfiles/${name}.tar.xz"
       ];
-    sha256 = "00vis5kg6km26zaq1ywz7ki9xvkwpc9c5wn41d01z2i5nldz096d";
+    sha256 = "0jp6hjlra98cnkal4n6bdmr577q8mcyp3c08s3a02c4hjhw5rr0z";
   };
 
   patchPhase = ''
@@ -43,3 +43,4 @@ stdenv.mkDerivation rec {
     license = "LGPLv2+";
   };
 }
+
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
index 4298a88f65e..85468b309c5 100644
--- a/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-good/default.nix
@@ -5,16 +5,18 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gst-plugins-good-0.10.30";
+  name = "gst-plugins-good-0.10.31";
 
   src = fetchurl {
     urls = [
       "${meta.homepage}/src/gst-plugins-good/${name}.tar.bz2"
       "mirror://gentoo/distfiles/${name}.tar.bz2"
       ];
-    sha256 = "1xlmw211fcn60y2m5gxrryb3knqril4kk2c01b6j713xna8blb5i";
+    sha256 = "1ijswgcrdp243mfsyza31fpzq6plz40p4b83vkr2x4x7807889vy";
   };
 
+  patches = [ ./v4l.patch ];
+
   configureFlags = "--disable-oss";
 
   buildInputs =
diff --git a/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch b/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch
new file mode 100644
index 00000000000..22cff574134
--- /dev/null
+++ b/pkgs/development/libraries/gstreamer/gst-plugins-good/v4l.patch
@@ -0,0 +1,11 @@
+diff -ru -x '*~' gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c
+--- gst-plugins-good-0.10.31-orig/sys/v4l2/gstv4l2bufferpool.c	2011-12-30 14:59:13.000000000 +0100
++++ gst-plugins-good-0.10.31/sys/v4l2/gstv4l2bufferpool.c	2013-01-28 17:41:25.549523708 +0100
+@@ -181,7 +181,6 @@
+     GST_LOG_OBJECT (pool->v4l2elem, "  MMAP offset:  %u",
+         ret->vbuffer.m.offset);
+   GST_LOG_OBJECT (pool->v4l2elem, "  length:    %u", ret->vbuffer.length);
+-  GST_LOG_OBJECT (pool->v4l2elem, "  input:     %u", ret->vbuffer.input);
+ 
+   data = (guint8 *) v4l2_mmap (0, ret->vbuffer.length,
+       PROT_READ | PROT_WRITE, MAP_SHARED, pool->video_fd,
diff --git a/pkgs/development/libraries/gstreamer/gstreamer/default.nix b/pkgs/development/libraries/gstreamer/gstreamer/default.nix
index 01d5487302c..5d33e7bff03 100644
--- a/pkgs/development/libraries/gstreamer/gstreamer/default.nix
+++ b/pkgs/development/libraries/gstreamer/gstreamer/default.nix
@@ -1,14 +1,14 @@
 { fetchurl, stdenv, perl, bison, flex, pkgconfig, glib, libxml2 }:
 
 stdenv.mkDerivation rec {
-  name = "gstreamer-0.10.35";
+  name = "gstreamer-0.10.36";
 
   src = fetchurl {
     urls =
-      [ "${meta.homepage}/src/gstreamer/${name}.tar.bz2"
-        "mirror://gentoo/distfiles/${name}.tar.bz2"
+      [ "${meta.homepage}/src/gstreamer/${name}.tar.xz"
+        "mirror://gentoo/distfiles/${name}.tar.xz"
       ];
-    sha256 = "11lp13lig3c6qys80phyvsik56r9y0c95vg2jxxliqj6rnigwyw1";
+    sha256 = "1nkid1n2l3rrlmq5qrf5yy06grrkwjh3yxl5g0w58w0pih8allci";
   };
 
   buildInputs = [ perl bison flex pkgconfig ];
diff --git a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
index 8bfeb8a4bea..c3510a69a12 100644
--- a/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
+++ b/pkgs/development/libraries/gstreamer/qt-gstreamer/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gstreamer gst_plugins_base glib qt4 ];
   propagatedBuildInputs = [ boost ];
-  buildNativeInputs = [ cmake automoc4 flex bison pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 flex bison pkgconfig ];
 
   cmakeFlags = "-DUSE_QT_PLUGIN_DIR=OFF -DUSE_GST_PLUGIN_DIR=OFF";
 
diff --git a/pkgs/development/libraries/gtk+/2.24.x.nix b/pkgs/development/libraries/gtk+/2.24.x.nix
index 4b32c80df78..ed5694d1396 100644
--- a/pkgs/development/libraries/gtk+/2.24.x.nix
+++ b/pkgs/development/libraries/gtk+/2.24.x.nix
@@ -7,25 +7,19 @@
 assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
-stdenv.mkDerivation {
-  name = "gtk+-2.24.10";
+stdenv.mkDerivation rec {
+  name = "gtk+-2.24.14";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gtk+/2.24/gtk+-2.24.10.tar.xz;
-    sha256 = "128fb8vmsqmfmpf1r8na65281jwkqix4q7wix399xqfnp4dy6mpa";
+    url = "mirror://gnome/sources/gtk+/2.24/${name}.tar.xz";
+    sha256 = "8bd1b8b511a3004e8972badf467ce829e6855cdff15540b9344dc934c68008ac";
   };
 
-  patches =
-    [ # Fix broken icons such as the back/forward buttons in Firefox.
-      # http://bugs.gentoo.org/339319
-      ./old-icons.patch
-    ];
-
   outputs = [ "dev" "out" "bin" "doc" ];
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   propagatedBuildInputs =
     [ xlibs.xlibs glib atk pango gdk_pixbuf cairo
diff --git a/pkgs/development/libraries/gtk+/3.2.x.nix b/pkgs/development/libraries/gtk+/3.2.x.nix
index df59c017626..cace1b626f4 100644
--- a/pkgs/development/libraries/gtk+/3.2.x.nix
+++ b/pkgs/development/libraries/gtk+/3.2.x.nix
@@ -8,16 +8,16 @@ assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
 stdenv.mkDerivation rec {
-  name = "gtk+-3.2.3";
+  name = "gtk+-3.2.4";
 
   src = fetchurl {
-    url = mirror://gnome/sources/gtk+/3.2/gtk+-3.2.3.tar.xz;
-    sha256 = "0g8x2kcqq17bccm4yszim837saj73zfk66ia2azcgfqfa7r21kz2";
+    url = "mirror://gnome/sources/gtk+/3.2/${name}.tar.xz";
+    sha256 = "f981bf514858c00d7084bd6f6c34b3c60b8aebdb959e7aca6faa59ed67c136bd";
   };
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   propagatedBuildInputs =
     [ xlibs.xlibs glib atk pango gdk_pixbuf cairo
diff --git a/pkgs/development/libraries/gtk+/old-icons.patch b/pkgs/development/libraries/gtk+/old-icons.patch
deleted file mode 100644
index e53d87474d0..00000000000
--- a/pkgs/development/libraries/gtk+/old-icons.patch
+++ /dev/null
@@ -1,270 +0,0 @@
-diff -ru gtk+-2.24.5-orig/gtk/Makefile.in gtk+-2.24.5/gtk/Makefile.in
---- gtk+-2.24.5-orig/gtk/Makefile.in	2011-06-16 01:56:37.000000000 +0200
-+++ gtk+-2.24.5/gtk/Makefile.in	2011-07-07 15:38:06.000000000 +0200
-@@ -1616,7 +1616,173 @@
- 	stock-icons/24/folder-remote.png 		\
- 	stock-icons/24/user-home.png 			\
- 	stock-icons/24/user-desktop.png 		\
--	stock-icons/24/text-x-generic.png
-+	stock-icons/24/text-x-generic.png		\
-+	stock-icons/16/gtk-quit.png			\
-+	stock-icons/16/gtk-info.png			\
-+	stock-icons/16/gtk-file.png			\
-+	stock-icons/16/gtk-open.png			\
-+	stock-icons/16/gtk-print-preview.png		\
-+	stock-icons/16/gtk-print.png			\
-+	stock-icons/16/gtk-properties.png		\
-+	stock-icons/16/gtk-revert-to-saved-ltr.png	\
-+	stock-icons/16/gtk-revert-to-saved-rtl.png	\
-+	stock-icons/16/gtk-save-as.png			\
-+	stock-icons/16/gtk-new.png			\
-+	stock-icons/16/gtk-harddisk.png			\
-+	stock-icons/16/gtk-clear.png			\
-+	stock-icons/16/gtk-copy.png			\
-+	stock-icons/16/gtk-cut.png			\
-+	stock-icons/16/gtk-delete.png			\
-+	stock-icons/16/gtk-find-and-replace.png		\
-+	stock-icons/16/gtk-find.png			\
-+	stock-icons/16/gtk-paste.png			\
-+	stock-icons/16/gtk-redo-ltr.png			\
-+	stock-icons/16/gtk-redo-rtl.png			\
-+	stock-icons/16/gtk-select-all.png		\
-+	stock-icons/16/gtk-undo-ltr.png			\
-+	stock-icons/16/gtk-undo-rtl.png			\
-+	stock-icons/16/gtk-directory.png		\
-+	stock-icons/16/gtk-unindent-ltr.png		\
-+	stock-icons/16/gtk-unindent-rtl.png		\
-+	stock-icons/16/gtk-indent-ltr.png		\
-+	stock-icons/16/gtk-indent-rtl.png		\
-+	stock-icons/16/gtk-justify-center.png		\
-+	stock-icons/16/gtk-justify-fill.png		\
-+	stock-icons/16/gtk-justify-left.png		\
-+	stock-icons/16/gtk-justify-right.png		\
-+	stock-icons/16/gtk-bold.png			\
-+	stock-icons/16/gtk-italic.png			\
-+	stock-icons/16/gtk-strikethrough.png		\
-+	stock-icons/16/gtk-underline.png		\
-+	stock-icons/16/gtk-goto-bottom.png		\
-+	stock-icons/16/gtk-go-down.png			\
-+	stock-icons/16/gtk-goto-first-ltr.png		\
-+	stock-icons/16/gtk-home.png			\
-+	stock-icons/16/gtk-jump-to-ltr.png		\
-+	stock-icons/16/gtk-jump-to-rtl.png		\
-+	stock-icons/16/gtk-goto-last-ltr.png		\
-+	stock-icons/16/gtk-go-forward-ltr.png		\
-+	stock-icons/16/gtk-go-back-ltr.png		\
-+	stock-icons/16/gtk-goto-top.png			\
-+	stock-icons/16/gtk-go-up.png			\
-+	stock-icons/16/gtk-about.png			\
-+	stock-icons/16/gtk-help.png			\
-+	stock-icons/16/gtk-missing-image.png		\
-+	stock-icons/16/gtk-add.png			\
-+	stock-icons/16/gtk-remove.png			\
-+	stock-icons/16/gtk-floppy.png			\
-+	stock-icons/16/gtk-cdrom.png			\
-+	stock-icons/16/gtk-media-pause.png		\
-+	stock-icons/16/gtk-media-play-ltr.png		\
-+	stock-icons/16/gtk-media-play-rtl.png		\
-+	stock-icons/16/gtk-media-stop.png		\
-+	stock-icons/16/gtk-media-record.png		\
-+	stock-icons/16/gtk-media-rewind-ltr.png		\
-+	stock-icons/16/gtk-media-forward-ltr.png	\
-+	stock-icons/16/gtk-media-previous-ltr.png	\
-+	stock-icons/16/gtk-media-next-ltr.png		\
-+	stock-icons/16/gtk-network.png			\
-+	stock-icons/16/gtk-print-error.png		\
-+	stock-icons/16/gtk-print-report.png		\
-+	stock-icons/16/gtk-print-paused.png		\
-+	stock-icons/16/gtk-print-warning.png		\
-+	stock-icons/16/gtk-stop.png			\
-+	stock-icons/16/gtk-execute.png			\
-+	stock-icons/16/gtk-spell-check.png		\
-+	stock-icons/16/gtk-fullscreen.png		\
-+	stock-icons/16/gtk-refresh.png			\
-+	stock-icons/16/gtk-leave-fullscreen.png		\
-+	stock-icons/16/gtk-sort-ascending.png		\
-+	stock-icons/16/gtk-sort-descending.png		\
-+	stock-icons/16/gtk-close.png			\
-+	stock-icons/16/gtk-zoom-fit.png			\
-+	stock-icons/16/gtk-zoom-in.png			\
-+	stock-icons/16/gtk-zoom-100.png			\
-+	stock-icons/16/gtk-zoom-out.png			\
-+	stock-icons/24/gtk-quit.png			\
-+	stock-icons/24/gtk-info.png			\
-+	stock-icons/24/gtk-file.png			\
-+	stock-icons/24/gtk-open.png			\
-+	stock-icons/24/gtk-print-preview.png		\
-+	stock-icons/24/gtk-print.png			\
-+	stock-icons/24/gtk-properties.png		\
-+	stock-icons/24/gtk-revert-to-saved-ltr.png	\
-+	stock-icons/24/gtk-revert-to-saved-rtl.png	\
-+	stock-icons/24/gtk-save-as.png			\
-+	stock-icons/24/gtk-new.png			\
-+	stock-icons/24/gtk-harddisk.png			\
-+	stock-icons/24/gtk-clear.png			\
-+	stock-icons/24/gtk-copy.png			\
-+	stock-icons/24/gtk-cut.png			\
-+	stock-icons/24/gtk-delete.png			\
-+	stock-icons/24/gtk-find-and-replace.png		\
-+	stock-icons/24/gtk-find.png			\
-+	stock-icons/24/gtk-paste.png			\
-+	stock-icons/24/gtk-redo-ltr.png			\
-+	stock-icons/24/gtk-redo-rtl.png			\
-+	stock-icons/24/gtk-select-all.png		\
-+	stock-icons/24/gtk-undo-ltr.png			\
-+	stock-icons/24/gtk-undo-rtl.png			\
-+	stock-icons/24/gtk-directory.png		\
-+	stock-icons/24/gtk-unindent-ltr.png		\
-+	stock-icons/24/gtk-unindent-rtl.png		\
-+	stock-icons/24/gtk-indent-ltr.png		\
-+	stock-icons/24/gtk-indent-rtl.png		\
-+	stock-icons/24/gtk-justify-center.png		\
-+	stock-icons/24/gtk-justify-fill.png		\
-+	stock-icons/24/gtk-justify-left.png		\
-+	stock-icons/24/gtk-justify-right.png		\
-+	stock-icons/24/gtk-bold.png			\
-+	stock-icons/24/gtk-italic.png			\
-+	stock-icons/24/gtk-strikethrough.png		\
-+	stock-icons/24/gtk-underline.png		\
-+	stock-icons/24/gtk-goto-bottom.png		\
-+	stock-icons/24/gtk-go-down.png			\
-+	stock-icons/24/gtk-goto-first-ltr.png		\
-+	stock-icons/24/gtk-home.png			\
-+	stock-icons/24/gtk-jump-to-ltr.png		\
-+	stock-icons/24/gtk-jump-to-rtl.png		\
-+	stock-icons/24/gtk-goto-last-ltr.png		\
-+	stock-icons/24/gtk-go-forward-ltr.png		\
-+	stock-icons/24/gtk-go-back-ltr.png		\
-+	stock-icons/24/gtk-goto-top.png			\
-+	stock-icons/24/gtk-go-up.png			\
-+	stock-icons/24/gtk-about.png			\
-+	stock-icons/24/gtk-help.png			\
-+	stock-icons/24/gtk-missing-image.png		\
-+	stock-icons/24/gtk-add.png			\
-+	stock-icons/24/gtk-remove.png			\
-+	stock-icons/24/gtk-floppy.png			\
-+	stock-icons/24/gtk-cdrom.png			\
-+	stock-icons/24/gtk-media-pause.png		\
-+	stock-icons/24/gtk-media-play-ltr.png		\
-+	stock-icons/24/gtk-media-play-rtl.png		\
-+	stock-icons/24/gtk-media-stop.png		\
-+	stock-icons/24/gtk-media-record.png		\
-+	stock-icons/24/gtk-media-rewind-ltr.png		\
-+	stock-icons/24/gtk-media-forward-ltr.png	\
-+	stock-icons/24/gtk-media-previous-ltr.png	\
-+	stock-icons/24/gtk-media-next-ltr.png		\
-+	stock-icons/24/gtk-network.png			\
-+	stock-icons/24/gtk-print-error.png		\
-+	stock-icons/24/gtk-print-report.png		\
-+	stock-icons/24/gtk-print-paused.png		\
-+	stock-icons/24/gtk-print-warning.png		\
-+	stock-icons/24/gtk-stop.png			\
-+	stock-icons/24/gtk-execute.png			\
-+	stock-icons/24/gtk-spell-check.png		\
-+	stock-icons/24/gtk-fullscreen.png		\
-+	stock-icons/24/gtk-refresh.png			\
-+	stock-icons/24/gtk-leave-fullscreen.png		\
-+	stock-icons/24/gtk-sort-ascending.png		\
-+	stock-icons/24/gtk-sort-descending.png		\
-+	stock-icons/24/gtk-close.png			\
-+	stock-icons/24/gtk-zoom-fit.png			\
-+	stock-icons/24/gtk-zoom-in.png			\
-+	stock-icons/24/gtk-zoom-100.png			\
-+	stock-icons/24/gtk-zoom-out.png			\
-+	stock-icons/48/gtk-dialog-error.png
-+
- 
- @CROSS_COMPILING_FALSE@gtk_update_icon_cache_program = \
- @CROSS_COMPILING_FALSE@	   ./gtk-update-icon-cache
-@@ -2887,7 +3053,91 @@
- 	   && $(LN_S) folder.png user-desktop.png 			\
- 	   && $(RM) user-home.png 					\
- 	   && $(LN_S) folder.png user-home.png 				\
-+	   && $(LN_S) application-exit.png gtk-quit.png			\
-+	   && $(LN_S) dialog-information.png gtk-info.png			\
-+	   && $(LN_S) document-new.png gtk-file.png			\
-+	   && $(LN_S) document-open.png gtk-open.png			\
-+	   && $(LN_S) document-print-preview.png gtk-print-preview.png			\
-+	   && $(LN_S) document-print.png gtk-print.png			\
-+	   && $(LN_S) document-properties.png gtk-properties.png			\
-+	   && $(LN_S) document-revert-ltr.png gtk-revert-to-saved-ltr.png			\
-+	   && $(LN_S) document-revert-rtl.png gtk-revert-to-saved-rtl.png			\
-+	   && $(LN_S) document-save-as.png gtk-save-as.png			\
-+	   && $(LN_S) document-x-generic.png gtk-new.png			\
-+	   && $(LN_S) drive-harddisk.png gtk-harddisk.png			\
-+	   && $(LN_S) edit-clear.png gtk-clear.png			\
-+	   && $(LN_S) edit-copy.png gtk-copy.png			\
-+	   && $(LN_S) edit-cut.png gtk-cut.png			\
-+	   && $(LN_S) edit-delete.png gtk-delete.png			\
-+	   && $(LN_S) edit-find-replace.png gtk-find-and-replace.png			\
-+	   && $(LN_S) edit-find.png gtk-find.png			\
-+	   && $(LN_S) edit-paste.png gtk-paste.png			\
-+	   && $(LN_S) edit-redo-ltr.png gtk-redo-ltr.png			\
-+	   && $(LN_S) edit-redo-rtl.png gtk-redo-rtl.png			\
-+	   && $(LN_S) edit-select-all.png gtk-select-all.png			\
-+	   && $(LN_S) edit-undo-ltr.png gtk-undo-ltr.png			\
-+	   && $(LN_S) edit-undo-rtl.png gtk-undo-rtl.png			\
-+	   && $(LN_S) folder.png gtk-directory.png			\
-+	   && $(LN_S) format-indent-less-ltr.png gtk-unindent-ltr.png			\
-+	   && $(LN_S) format-indent-less-rtl.png gtk-unindent-rtl.png			\
-+	   && $(LN_S) format-indent-more-ltr.png gtk-indent-ltr.png			\
-+	   && $(LN_S) format-indent-more-rtl.png gtk-indent-rtl.png			\
-+	   && $(LN_S) format-justify-center.png gtk-justify-center.png			\
-+	   && $(LN_S) format-justify-fill.png gtk-justify-fill.png			\
-+	   && $(LN_S) format-justify-left.png gtk-justify-left.png			\
-+	   && $(LN_S) format-justify-right.png gtk-justify-right.png			\
-+	   && $(LN_S) format-text-bold.png gtk-bold.png			\
-+	   && $(LN_S) format-text-italic.png gtk-italic.png			\
-+	   && $(LN_S) format-text-strikethrough.png gtk-strikethrough.png			\
-+	   && $(LN_S) format-text-underline.png gtk-underline.png			\
-+	   && $(LN_S) go-bottom.png gtk-goto-bottom.png			\
-+	   && $(LN_S) go-down.png gtk-go-down.png			\
-+	   && $(LN_S) go-first-ltr.png gtk-goto-first-ltr.png			\
-+	   && $(LN_S) go-home.png gtk-home.png			\
-+	   && $(LN_S) go-jump-ltr.png gtk-jump-to-ltr.png			\
-+	   && $(LN_S) go-jump-rtl.png gtk-jump-to-rtl.png			\
-+	   && $(LN_S) go-last-ltr.png gtk-goto-last-ltr.png			\
-+	   && $(LN_S) go-next-ltr.png gtk-go-forward-ltr.png			\
-+	   && $(LN_S) go-previous-ltr.png gtk-go-back-ltr.png			\
-+	   && $(LN_S) go-top.png gtk-goto-top.png			\
-+	   && $(LN_S) go-up.png gtk-go-up.png			\
-+	   && $(LN_S) help-about.png gtk-about.png			\
-+	   && $(LN_S) help-contents.png gtk-help.png			\
-+	   && $(LN_S) image-missing.png gtk-missing-image.png			\
-+	   && $(LN_S) list-add.png gtk-add.png			\
-+	   && $(LN_S) list-remove.png gtk-remove.png			\
-+	   && $(LN_S) media-floppy.png gtk-floppy.png			\
-+	   && $(LN_S) media-optical.png gtk-cdrom.png			\
-+	   && $(LN_S) media-playback-pause.png gtk-media-pause.png			\
-+	   && $(LN_S) media-playback-start-ltr.png gtk-media-play-ltr.png			\
-+	   && $(LN_S) media-playback-start-rtl.png gtk-media-play-rtl.png			\
-+	   && $(LN_S) media-playback-stop.png gtk-media-stop.png			\
-+	   && $(LN_S) media-record.png gtk-media-record.png			\
-+	   && $(LN_S) media-seek-backward-ltr.png gtk-media-rewind-ltr.png			\
-+	   && $(LN_S) media-seek-forward-ltr.png gtk-media-forward-ltr.png			\
-+	   && $(LN_S) media-skip-backward-ltr.png gtk-media-previous-ltr.png			\
-+	   && $(LN_S) media-skip-forward-ltr.png gtk-media-next-ltr.png			\
-+	   && $(LN_S) network-idle.png gtk-network.png			\
-+	   && $(LN_S) printer-error.png gtk-print-error.png			\
-+	   && $(LN_S) printer-info.png gtk-print-report.png			\
-+	   && $(LN_S) printer-paused.png gtk-print-paused.png			\
-+	   && $(LN_S) printer-warning.png gtk-print-warning.png			\
-+	   && $(LN_S) process-stop.png gtk-stop.png			\
-+	   && $(LN_S) system-run.png gtk-execute.png			\
-+	   && $(LN_S) tools-check-spelling.png gtk-spell-check.png			\
-+	   && $(LN_S) view-fullscreen.png gtk-fullscreen.png			\
-+	   && $(LN_S) view-refresh.png gtk-refresh.png			\
-+	   && $(LN_S) view-restore.png gtk-leave-fullscreen.png			\
-+	   && $(LN_S) view-sort-ascending.png gtk-sort-ascending.png			\
-+	   && $(LN_S) view-sort-descending.png gtk-sort-descending.png			\
-+	   && $(LN_S) window-close.png gtk-close.png			\
-+	   && $(LN_S) zoom-fit-best.png gtk-zoom-fit.png			\
-+	   && $(LN_S) zoom-in.png gtk-zoom-in.png			\
-+	   && $(LN_S) zoom-original.png gtk-zoom-100.png			\
-+	   && $(LN_S) zoom-out.png gtk-zoom-out.png			\
- 	) done 								\
-+	&& (cd stock-icons/48						\
-+	   && $(LN_S) dialog-error.png gtk-dialog-error.png)		\
- 	&& touch stamp-icons
- 
- gtkbuiltincache.h: @REBUILD@ stamp-icons
diff --git a/pkgs/development/libraries/gtk-sharp-2/default.nix b/pkgs/development/libraries/gtk-sharp-2/default.nix
index 7ffc918f678..9baac518ff7 100644
--- a/pkgs/development/libraries/gtk-sharp-2/default.nix
+++ b/pkgs/development/libraries/gtk-sharp-2/default.nix
@@ -26,6 +26,13 @@ stdenv.mkDerivation {
 
   # patches = [ ./dllmap-glue.patch ];
 
+  # patch bad usage of glib, which wasn't tolerated anymore
+  prePatch = ''
+    for f in glib/glue/{thread,list,slist}.c; do
+      sed -i 's,#include <glib/.*\.h>,#include <glib.h>,g' "$f"
+    done
+  '';
+
   buildInputs = [
     pkgconfig mono glib pango gtk GConf libglade libgnomecanvas
     libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
diff --git a/pkgs/development/libraries/gtk-sharp-2/dllmap-glue.patch b/pkgs/development/libraries/gtk-sharp-2/dllmap-glue.patch
deleted file mode 100644
index 51f4524811d..00000000000
--- a/pkgs/development/libraries/gtk-sharp-2/dllmap-glue.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-diff -rc gtk-sharp-1.0.6-orig/gdk/gdk-sharp.dll.config.in gtk-sharp-1.0.6/gdk/gdk-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/gdk/gdk-sharp.dll.config.in	2004-12-16 18:15:44.000000000 +0100
---- gtk-sharp-1.0.6/gdk/gdk-sharp.dll.config.in	2005-03-08 12:40:58.000000000 +0100
-***************
-*** 3,6 ****
---- 3,7 ----
-    <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libgdk-win32-2.0-0.dll" target="libgdk-x11-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libgdk_pixbuf-2.0-0.dll" target="libgdk_pixbuf-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="gdksharpglue" target="libgdksharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
-diff -rc gtk-sharp-1.0.6-orig/glade/glade-sharp.dll.config.in gtk-sharp-1.0.6/glade/glade-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/glade/glade-sharp.dll.config.in	2004-12-16 18:15:46.000000000 +0100
---- gtk-sharp-1.0.6/glade/glade-sharp.dll.config.in	2005-03-08 12:41:19.000000000 +0100
-***************
-*** 1,3 ****
---- 1,4 ----
-  <configuration>
-    <dllmap dll="libglade-2.0-0.dll" target="libglade-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="gladesharpglue" target="libgladesharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
-diff -rc gtk-sharp-1.0.6-orig/glib/glib-sharp.dll.config.in gtk-sharp-1.0.6/glib/glib-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/glib/glib-sharp.dll.config.in	2004-12-16 18:15:38.000000000 +0100
---- gtk-sharp-1.0.6/glib/glib-sharp.dll.config.in	2005-03-08 12:37:57.000000000 +0100
-***************
-*** 2,5 ****
---- 2,6 ----
-    <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libgthread-2.0-0.dll" target="libgthread-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="glibsharpglue" target="libglibsharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
-diff -rc gtk-sharp-1.0.6-orig/gnome/gnome-sharp.dll.config.in gtk-sharp-1.0.6/gnome/gnome-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/gnome/gnome-sharp.dll.config.in	2004-12-16 18:15:43.000000000 +0100
---- gtk-sharp-1.0.6/gnome/gnome-sharp.dll.config.in	2005-03-08 12:41:50.000000000 +0100
-***************
-*** 8,11 ****
---- 8,12 ----
-    <dllmap dll="gnomeprint-2-2" target="libgnomeprint-2-2@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="gnomeprintui-2-2" target="libgnomeprintui-2-2@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="gnomeui-2" target="libgnomeui-2@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="gnomesharpglue" target="libgnomesharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
-diff -rc gtk-sharp-1.0.6-orig/gtk/gtk-sharp.dll.config.in gtk-sharp-1.0.6/gtk/gtk-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/gtk/gtk-sharp.dll.config.in	2004-12-16 18:14:51.000000000 +0100
---- gtk-sharp-1.0.6/gtk/gtk-sharp.dll.config.in	2005-03-08 12:38:19.000000000 +0100
-***************
-*** 3,6 ****
---- 3,7 ----
-    <dllmap dll="libgobject-2.0-0.dll" target="libgobject-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libatk-1.0-0.dll" target="libatk-1.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libgtk-win32-2.0-0.dll" target="libgtk-x11-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="gtksharpglue" target="libgtksharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
-diff -rc gtk-sharp-1.0.6-orig/pango/pango-sharp.dll.config.in gtk-sharp-1.0.6/pango/pango-sharp.dll.config.in
-*** gtk-sharp-1.0.6-orig/pango/pango-sharp.dll.config.in	2004-12-16 18:14:55.000000000 +0100
---- gtk-sharp-1.0.6/pango/pango-sharp.dll.config.in	2005-03-08 12:42:11.000000000 +0100
-***************
-*** 1,4 ****
---- 1,5 ----
-  <configuration>
-    <dllmap dll="libglib-2.0-0.dll" target="libglib-2.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-    <dllmap dll="libpango-1.0-0.dll" target="libpango-1.0@LIB_PREFIX@.0@LIB_SUFFIX@"/>
-+   <dllmap dll="pangosharpglue" target="libpangosharpglue@LIB_PREFIX@@LIB_SUFFIX@"/>
-  </configuration>
diff --git a/pkgs/development/libraries/gtkmm/2.24.x.nix b/pkgs/development/libraries/gtkmm/2.x.nix
index 56d151101c5..ec7f01a8be5 100644
--- a/pkgs/development/libraries/gtkmm/2.24.x.nix
+++ b/pkgs/development/libraries/gtkmm/2.x.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0gcm91sc1a05c56kzh74l370ggj0zz8nmmjvjaaxgmhdq8lpl369";
   };
 
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   propagatedBuildInputs = [ glibmm gtk atkmm cairomm pangomm ];
 
diff --git a/pkgs/development/libraries/gtkmm/3.2.x.nix b/pkgs/development/libraries/gtkmm/3.x.nix
index 890d4a34519..d3681b4b386 100644
--- a/pkgs/development/libraries/gtkmm/3.2.x.nix
+++ b/pkgs/development/libraries/gtkmm/3.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1wkljr2vjvjg5mggi4rvk9k4j2kzh8lc106k2yp8gqjlhk2xm5b1";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ glibmm gtk3 atkmm cairomm pangomm ];
 
diff --git a/pkgs/development/libraries/gts/default.nix b/pkgs/development/libraries/gts/default.nix
index b3038d5eadd..7eb519a045c 100644
--- a/pkgs/development/libraries/gts/default.nix
+++ b/pkgs/development/libraries/gts/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, glib, pkgconfig }:
+{ fetchurl, stdenv, glib, pkgconfig, gettext }:
 
 
 stdenv.mkDerivation rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "07mqx09jxh8cv9753y2d2jsv7wp8vjmrd7zcfpbrddz3wc9kx705";
   };
 
-  buildInputs = [ glib pkgconfig ];
+  buildInputs = [ glib pkgconfig ] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") gettext;
 
   meta = {
     homepage = http://gts.sourceforge.net/;
diff --git a/pkgs/development/libraries/gupnp-igd/default.nix b/pkgs/development/libraries/gupnp-igd/default.nix
index bd930e5ecf6..20a5f2d9c94 100644
--- a/pkgs/development/libraries/gupnp-igd/default.nix
+++ b/pkgs/development/libraries/gupnp-igd/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "gupnp-igd-0.2.1";
 
   src = fetchurl {
-    url = "http://www.gupnp.org/sites/all/files/sources/${name}.tar.gz";
+    url = https://launchpad.net/ubuntu/+archive/primary/+files/gupnp-igd_0.2.1.orig.tar.gz;
     sha256 = "18ia8l24hbylz3dnbg2jf848bmbx0hjkq4fkwzzfn57z021f0fh2";
   };
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib python pygobject ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.gupnp.org/;
diff --git a/pkgs/development/libraries/gupnp/default.nix b/pkgs/development/libraries/gupnp/default.nix
index 5679591878a..c70d8fcb0c2 100644
--- a/pkgs/development/libraries/gupnp/default.nix
+++ b/pkgs/development/libraries/gupnp/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   propagatedBuildInputs = [ libxml2 libsoup gssdp ];
   buildInputs = [ glib libuuid ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.gupnp.org/;
diff --git a/pkgs/development/libraries/gvfs/default.nix b/pkgs/development/libraries/gvfs/default.nix
new file mode 100644
index 00000000000..067d3dc9383
--- /dev/null
+++ b/pkgs/development/libraries/gvfs/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, pkgconfig, intltool, libtool
+, glib, dbus, udev, udisks2, libgcrypt
+, libgphoto2, avahi, libarchive, fuse, libcdio
+, libxml2, libxslt, docbook_xsl
+, lightWeight ? true, gnome, samba, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "gvfs-1.14.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gvfs/1.14/${name}.tar.xz";
+    sha256 = "1g4ghyf45jg2ajdkv2d972hbckyjh3d9jdrppai85pl9pk2dmfy3";
+  };
+
+  nativeBuildInputs = [ pkgconfig intltool libtool ];
+
+  buildInputs =
+    [ makeWrapper glib dbus.libs udev udisks2 libgcrypt
+      libgphoto2 avahi libarchive fuse libcdio
+      libxml2 libxslt docbook_xsl
+      # ToDo: a ligther version of libsoup to have FTP/HTTP support?
+    ] ++ stdenv.lib.optionals (!lightWeight) (with gnome; [
+      gtk libsoup libgnome_keyring gconf samba
+      # ToDo: not working and probably useless until gnome3 from x-updates
+    ]);
+
+  enableParallelBuilding = true;
+
+  # ToDo: one probably should specify schemas for samba and others here
+  fixupPhase = ''
+    wrapProgram $out/libexec/gvfsd --set GSETTINGS_SCHEMA_DIR "$out/share/glib-2.0/schemas"
+  '';
+
+  meta = {
+    description = "Virtual Filesystem support library" + stdenv.lib.optionalString lightWeight " (light-weight)";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/gwenhywfar/default.nix b/pkgs/development/libraries/gwenhywfar/default.nix
index 207b81997af..724524e2b26 100644
--- a/pkgs/development/libraries/gwenhywfar/default.nix
+++ b/pkgs/development/libraries/gwenhywfar/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 gtk ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   QTDIR = qt4;
 }
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
new file mode 100644
index 00000000000..5755e747a6b
--- /dev/null
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, pkgconfig, glib, freetype }:
+
+stdenv.mkDerivation rec {
+  name = "harfbuzz-0.9.4";
+
+  src = fetchurl {
+    url = "http://www.freedesktop.org/software/harfbuzz/release/${name}.tar.bz2";
+    sha256 = "2572f9a810d17a735ef565115463827d075af2371ee5b68e6d77231381f4bddc";
+  };
+
+  buildInputs = [ pkgconfig glib freetype ];
+
+  meta = {
+    description = "An OpenType text shaping engine";
+    homepage = http://www.freedesktop.org/wiki/Software/HarfBuzz;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/haskell/Agda/default.nix b/pkgs/development/libraries/haskell/Agda/default.nix
index c72177e2108..f6589dc53be 100644
--- a/pkgs/development/libraries/haskell/Agda/default.nix
+++ b/pkgs/development/libraries/haskell/Agda/default.nix
@@ -1,21 +1,21 @@
-{ cabal, alex, binary, filepath, happy, hashable, hashtables
-, haskeline, haskellSrcExts, mtl, QuickCheck, syb, xhtml, zlib
+{ cabal, alex, binary, deepseq, filepath, geniplate, happy
+, hashable, hashtables, haskeline, haskellSrcExts, mtl, parallel
+, QuickCheck, text, time, unorderedContainers, xhtml, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "Agda";
-  version = "2.3.0.1";
-  sha256 = "0f2kc3by2z01g8bqc446hyzx9sidx6qi0p7h5bcpjf8iryk1dh2w";
+  version = "2.3.2";
+  sha256 = "1xp0qvag6wx6zjwhmb7nm13hp63vlh8h4a2rkc85rsh610m0nynl";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    binary filepath hashable hashtables haskeline haskellSrcExts mtl
-    QuickCheck syb xhtml zlib
+    binary deepseq filepath geniplate hashable hashtables haskeline
+    haskellSrcExts mtl parallel QuickCheck text time
+    unorderedContainers xhtml zlib
   ];
   buildTools = [ alex happy ];
-  patchPhase = ''
-    sed -i -e 's|mtl == 2.0.\*|mtl|' Agda.cabal
-  '';
+  jailbreak = true;
   meta = {
     homepage = "http://wiki.portal.chalmers.se/agda/";
     description = "A dependently typed functional programming language and proof assistant";
diff --git a/pkgs/development/libraries/haskell/Boolean/default.nix b/pkgs/development/libraries/haskell/Boolean/default.nix
index 58bdf8b9970..bc8e9dca159 100644
--- a/pkgs/development/libraries/haskell/Boolean/default.nix
+++ b/pkgs/development/libraries/haskell/Boolean/default.nix
@@ -2,10 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "Boolean";
-  version = "0.0.1";
-  sha256 = "dafcfb2e9d7f7aa24a3d3ceb385424176297cdf6f6044028d42d0fea1cae7765";
+  version = "0.2";
+  sha256 = "1r8qvsfbfjfp453pdy9ci9w584ad9bm4xv0ynx4b1yny34ag3zr3";
   meta = {
-    description = "Generalized booleans";
+    description = "Generalized booleans and numbers";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/Cabal/1.14.0.nix b/pkgs/development/libraries/haskell/Cabal/1.14.0.nix
index b424551a2f9..7b666a1cf6e 100644
--- a/pkgs/development/libraries/haskell/Cabal/1.14.0.nix
+++ b/pkgs/development/libraries/haskell/Cabal/1.14.0.nix
@@ -1,15 +1,24 @@
-{ cabal, filepath }:
+{ cabal, extensibleExceptions, filepath, HUnit, QuickCheck
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "Cabal";
   version = "1.14.0";
   sha256 = "1r5b4x1ham5gdg9m9l8idpvr9czlk1q21vqmg0di4adkp2fhlm3j";
   buildDepends = [ filepath ];
+  testDepends = [
+    extensibleExceptions filepath HUnit QuickCheck testFramework
+    testFrameworkHunit testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://www.haskell.org/cabal/";
     description = "A framework for packaging Haskell software";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/Cabal/1.16.0.3.nix b/pkgs/development/libraries/haskell/Cabal/1.16.0.3.nix
new file mode 100644
index 00000000000..c1689817dcc
--- /dev/null
+++ b/pkgs/development/libraries/haskell/Cabal/1.16.0.3.nix
@@ -0,0 +1,25 @@
+{ cabal, extensibleExceptions, filepath, HUnit, QuickCheck
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "Cabal";
+  version = "1.16.0.3";
+  sha256 = "11lzqgdjaix8n7nabmafl3jf9gisb04c025cmdycfihfajfn49zg";
+  buildDepends = [ filepath ];
+  testDepends = [
+    extensibleExceptions filepath HUnit QuickCheck testFramework
+    testFrameworkHunit testFrameworkQuickcheck2
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://www.haskell.org/cabal/";
+    description = "A framework for packaging Haskell software";
+    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/development/libraries/haskell/ChasingBottoms/default.nix b/pkgs/development/libraries/haskell/ChasingBottoms/default.nix
new file mode 100644
index 00000000000..719e5eb2cee
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ChasingBottoms/default.nix
@@ -0,0 +1,15 @@
+{ cabal, mtl, QuickCheck, random, syb }:
+
+cabal.mkDerivation (self: {
+  pname = "ChasingBottoms";
+  version = "1.3.0.6";
+  sha256 = "1l40n1ylzrbp0lhm80q9djl8mf39zvmw7zzlg0gzxsqbzwbsggx8";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ mtl QuickCheck random syb ];
+  meta = {
+    description = "For testing partial and infinite values";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/CouchDB/default.nix b/pkgs/development/libraries/haskell/CouchDB/default.nix
index 3642d402615..4a413e2e7b8 100644
--- a/pkgs/development/libraries/haskell/CouchDB/default.nix
+++ b/pkgs/development/libraries/haskell/CouchDB/default.nix
@@ -1,10 +1,11 @@
-{ cabal, HTTP, json, mtl, network }:
+{ cabal, HTTP, HUnit, json, mtl, network, utf8String }:
 
 cabal.mkDerivation (self: {
   pname = "CouchDB";
-  version = "0.10.1";
-  sha256 = "1ny62ab0sjrkh7mpxj0ahqrv7c8dh0n5s1g8xl0mq3yiwlrjdsim";
-  buildDepends = [ HTTP json mtl network ];
+  version = "1.2";
+  sha256 = "0a9g0iblfyqppcy1ni3ac8f3yv5km95bfblhwqlsk6khydi5ka98";
+  buildDepends = [ HTTP json mtl network utf8String ];
+  testDepends = [ HTTP HUnit json mtl network utf8String ];
   meta = {
     homepage = "http://github.com/arjunguha/haskell-couchdb/";
     description = "CouchDB interface";
diff --git a/pkgs/development/libraries/haskell/Crypto/default.nix b/pkgs/development/libraries/haskell/Crypto/default.nix
index f6f06b9c283..c7d10d0160d 100644
--- a/pkgs/development/libraries/haskell/Crypto/default.nix
+++ b/pkgs/development/libraries/haskell/Crypto/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Crypto";
-  version = "4.2.5";
-  sha256 = "0wv48is2jqia8hda6q65y3mhabxlw9hjzmpk3dx70rzh4w44yxb8";
+  version = "4.2.5.1";
+  sha256 = "0rmgl0a4k6ys2lc6d607g28c2p443a46dla903rz5aha7m9y1mba";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ HUnit QuickCheck random ];
@@ -11,9 +11,6 @@ cabal.mkDerivation (self: {
     description = "Collects together existing Haskell cryptographic functions into a package";
     license = "unknown";
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/DAV/default.nix b/pkgs/development/libraries/haskell/DAV/default.nix
new file mode 100644
index 00000000000..c330f082e89
--- /dev/null
+++ b/pkgs/development/libraries/haskell/DAV/default.nix
@@ -0,0 +1,22 @@
+{ cabal, caseInsensitive, httpConduit, httpTypes, lens, liftedBase
+, mtl, network, optparseApplicative, resourcet, transformers
+, xmlConduit, xmlHamlet
+}:
+
+cabal.mkDerivation (self: {
+  pname = "DAV";
+  version = "0.4.1";
+  sha256 = "0bcrnlixrzvbdvw7ffv2xl2d0k0w71jf0i5ayf97ymxly8ii8s0c";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    caseInsensitive httpConduit httpTypes lens liftedBase mtl network
+    optparseApplicative resourcet transformers xmlConduit xmlHamlet
+  ];
+  meta = {
+    homepage = "http://floss.scru.org/hDAV";
+    description = "RFC 4918 WebDAV support";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/DSH/default.nix b/pkgs/development/libraries/haskell/DSH/default.nix
index 725fe95cc8d..409afcd45b0 100644
--- a/pkgs/development/libraries/haskell/DSH/default.nix
+++ b/pkgs/development/libraries/haskell/DSH/default.nix
@@ -1,15 +1,10 @@
-{ cabal, convertible, csv, FerryCore, HaXml, HDBC, json, mtl
-, Pathfinder, syb, text, xhtml
-}:
+{ cabal, csv, FerryCore, HaXml, HDBC, mtl, Pathfinder, text }:
 
 cabal.mkDerivation (self: {
   pname = "DSH";
-  version = "0.7.8.1";
-  sha256 = "1yz8rh3hkqc465slfzi7jqhjd1xrmcghjxl7zprxw082p2qvj8g5";
-  buildDepends = [
-    convertible csv FerryCore HaXml HDBC json mtl Pathfinder syb text
-    xhtml
-  ];
+  version = "0.8.2.3";
+  sha256 = "0d5jh1vxjx3874rgwvxjm00lj3vvp8ggz2c54x6ymhmgav3pd8vy";
+  buildDepends = [ csv FerryCore HaXml HDBC mtl Pathfinder text ];
   meta = {
     description = "Database Supported Haskell";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/Diff/default.nix b/pkgs/development/libraries/haskell/Diff/default.nix
index c28bef5cbd7..04149400ff8 100644
--- a/pkgs/development/libraries/haskell/Diff/default.nix
+++ b/pkgs/development/libraries/haskell/Diff/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Diff";
-  version = "0.1.3";
-  sha256 = "02dhy4rp3mkzm5x3h1rkdin2h8qcb7h7nhn14gl2gvl6wdykfh5w";
+  version = "0.3.0";
+  sha256 = "0k7fj4icnh25x21cmrnbqq0sjgxrr2ffhn8bz89qmy5h9dznvy98";
   meta = {
     description = "O(ND) diff algorithm in haskell";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/GLFW/default.nix b/pkgs/development/libraries/haskell/GLFW/default.nix
index 59095ba7927..f204bcdf655 100644
--- a/pkgs/development/libraries/haskell/GLFW/default.nix
+++ b/pkgs/development/libraries/haskell/GLFW/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "GLFW";
-  version = "0.5.0.1";
-  sha256 = "1zjxw0fn1am9n4bwqn8jwp14cdgyg1cv5v8rrg2bisggw7wdc4c6";
+  version = "0.5.1.0";
+  sha256 = "190d75w84y9gayxvdz13dnzpyflc5qy4vdg5iv9p2dpcamcih3km";
   buildDepends = [ OpenGL ];
   extraLibraries = [ libX11 mesa ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/GLURaw/default.nix b/pkgs/development/libraries/haskell/GLURaw/1.3.0.0.nix
index 459c7b99e5c..d719e8179d4 100644
--- a/pkgs/development/libraries/haskell/GLURaw/default.nix
+++ b/pkgs/development/libraries/haskell/GLURaw/1.3.0.0.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "GLURaw";
-  version = "1.2.0.0";
-  sha256 = "06dsazj3zadjahwy926gnjngqg8cb1mhdxh8bg5f3axf3hsvxqp1";
+  version = "1.3.0.0";
+  sha256 = "1sh87jz9161svsf719y63cr21wf4d7wpbz75g2c2xss301qhafg0";
   buildDepends = [ OpenGLRaw ];
   extraLibraries = [ freeglut mesa ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/GLUT/2.3.0.0.nix b/pkgs/development/libraries/haskell/GLUT/2.3.1.0.nix
index 7725d1c8303..d65dfa15c6f 100644
--- a/pkgs/development/libraries/haskell/GLUT/2.3.0.0.nix
+++ b/pkgs/development/libraries/haskell/GLUT/2.3.1.0.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "GLUT";
-  version = "2.3.0.0";
-  sha256 = "10rh57w3lx8fs0xy24lqilv5a5sgq57kshydja41r6fq9wdvwp99";
+  version = "2.3.1.0";
+  sha256 = "1ijx636py7gpm79r0qjsv8f4pw3m1cgz80gnn3qghs3lw0l8f1ci";
   buildDepends = [ OpenGL OpenGLRaw StateVar Tensor ];
   extraLibraries = [ freeglut libICE libSM libXi libXmu mesa ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/GLUT/2.4.0.0.nix b/pkgs/development/libraries/haskell/GLUT/2.4.0.0.nix
new file mode 100644
index 00000000000..a7a7e7f371a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/GLUT/2.4.0.0.nix
@@ -0,0 +1,18 @@
+{ cabal, freeglut, libICE, libSM, libXi, libXmu, mesa, OpenGL
+, OpenGLRaw
+}:
+
+cabal.mkDerivation (self: {
+  pname = "GLUT";
+  version = "2.4.0.0";
+  sha256 = "1g6bnj2p9hj6c04pmkjwlw9brp7rrva1fyylr2q2dbfz4kbz438h";
+  buildDepends = [ OpenGL OpenGLRaw ];
+  extraLibraries = [ freeglut libICE libSM libXi libXmu mesa ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/Opengl";
+    description = "A binding for the OpenGL Utility Toolkit";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/Glob/default.nix b/pkgs/development/libraries/haskell/Glob/default.nix
new file mode 100644
index 00000000000..08ae4617956
--- /dev/null
+++ b/pkgs/development/libraries/haskell/Glob/default.nix
@@ -0,0 +1,14 @@
+{ cabal, dlist, filepath, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "Glob";
+  version = "0.7.2";
+  sha256 = "1x4gh7z9jx9hdkjwsc31yyjssw6i7ziixhjrxr9b8zkijk1b4r5i";
+  buildDepends = [ dlist filepath transformers ];
+  meta = {
+    homepage = "http://iki.fi/matti.niemenmaa/glob/";
+    description = "Globbing library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/Graphalyze/default.nix b/pkgs/development/libraries/haskell/Graphalyze/default.nix
index d0258fd2698..d61abc7a245 100644
--- a/pkgs/development/libraries/haskell/Graphalyze/default.nix
+++ b/pkgs/development/libraries/haskell/Graphalyze/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Graphalyze";
-  version = "0.13.0.0";
-  sha256 = "1xh6xg2rw43cbi83rmpb0c2yib9cfj0pwg66nx5x5a0al2c9pdsr";
+  version = "0.14.0.1";
+  sha256 = "1prgszkrnb22x9xkwmxbvb9w1h78ffig9268f3q3y65knggmwp1x";
   buildDepends = [
     bktrees fgl filepath graphviz pandoc random text time
   ];
diff --git a/pkgs/development/libraries/haskell/HDBC/HDBC-odbc.nix b/pkgs/development/libraries/haskell/HDBC/HDBC-odbc.nix
index d5dca127ca1..50994384c96 100644
--- a/pkgs/development/libraries/haskell/HDBC/HDBC-odbc.nix
+++ b/pkgs/development/libraries/haskell/HDBC/HDBC-odbc.nix
@@ -2,14 +2,14 @@
 
 cabal.mkDerivation (self: {
   pname = "HDBC-odbc";
-  version = "2.3.1.0";
-  sha256 = "0vza38ggs863wjh25xnwslwlin68166ywws72bs766rl0rq7fkf4";
+  version = "2.3.1.1";
+  sha256 = "0zypgwy8yxzp69c2775gkzi8591b0l3wncn7vmq11l16ign95fc7";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ HDBC mtl time utf8String ];
   extraLibraries = [ odbc ];
   meta = {
-    homepage = "http://software.complete.org/hdbc-odbc";
+    homepage = "https://github.com/hdbc/hdbc-odbc";
     description = "ODBC driver for HDBC";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/HDBC/HDBC.nix b/pkgs/development/libraries/haskell/HDBC/HDBC.nix
index 03000b68811..a8275c31b85 100644
--- a/pkgs/development/libraries/haskell/HDBC/HDBC.nix
+++ b/pkgs/development/libraries/haskell/HDBC/HDBC.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "HDBC";
-  version = "2.3.1.1";
-  sha256 = "1gqihvsf5w7j8xbn1xy93mdrsh77qwxbhfmyjivbm6i95w1i0kb7";
+  version = "2.3.1.2";
+  sha256 = "1rjamh8xscb9jhxgxcrs2qnvs2ipv9dqgnn0bpv5vwclmzmn5j87";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ convertible mtl text time utf8String ];
diff --git a/pkgs/development/libraries/haskell/hfuse/default.nix b/pkgs/development/libraries/haskell/HFuse/default.nix
index 8ff4f7fd275..64943d5e1c1 100644
--- a/pkgs/development/libraries/haskell/hfuse/default.nix
+++ b/pkgs/development/libraries/haskell/HFuse/default.nix
@@ -17,7 +17,6 @@ cabal.mkDerivation (self: {
     platforms = self.ghc.meta.platforms;
     maintainers = [
       self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
     ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/HGL/default.nix b/pkgs/development/libraries/haskell/HGL/default.nix
deleted file mode 100644
index 954401b31e3..00000000000
--- a/pkgs/development/libraries/haskell/HGL/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, X11 }:
-
-cabal.mkDerivation (self: {
-  pname = "HGL";
-  version = "3.2.0.2";
-  sha256 = "13wcvf6bfii9pihr8m08b81fyslf5n587ds4zzgizbd8m38k81vz";
-  buildDepends = [ X11 ];
-  meta = {
-    description = "A simple graphics library based on X11 or Win32";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/HSH/default.nix b/pkgs/development/libraries/haskell/HSH/default.nix
index 40620901839..107e3df979b 100644
--- a/pkgs/development/libraries/haskell/HSH/default.nix
+++ b/pkgs/development/libraries/haskell/HSH/default.nix
@@ -1,16 +1,17 @@
 { cabal, filepath, hslogger, MissingH, mtl, regexBase, regexCompat
-, regexPosix
+, regexPosix, fetchurl
 }:
 
 cabal.mkDerivation (self: {
   pname = "HSH";
-  version = "2.0.4";
-  sha256 = "1ddpazmk82716hqd1riqs7vnl4aildgwkjgk80iam49df9p5b8v8";
+  version = "2.1.0";
+  sha256 = "0gz2hzdvf0gqv33jihn67bvry38c6hkjapb1prxmb3w12lisr4l5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
     filepath hslogger MissingH mtl regexBase regexCompat regexPosix
   ];
+  patches = [ (fetchurl { url = "https://github.com/jgoerzen/hsh/pull/10.patch"; sha256 = "0fw2ihl4hlncggwf3v4d7aydm3rzgzpcxplfbwq7janysix4q950"; }) ];
   meta = {
     homepage = "http://software.complete.org/hsh";
     description = "Library to mix shell scripting with Haskell programs";
diff --git a/pkgs/development/libraries/haskell/HStringTemplate/default.nix b/pkgs/development/libraries/haskell/HStringTemplate/default.nix
index 6754c15f3f4..6f96bbbcb7f 100644
--- a/pkgs/development/libraries/haskell/HStringTemplate/default.nix
+++ b/pkgs/development/libraries/haskell/HStringTemplate/default.nix
@@ -1,13 +1,14 @@
-{ cabal, deepseq, filepath, mtl, parsec, syb, sybWithClass, text
-, time, utf8String
+{ cabal, blazeBuilder, deepseq, filepath, mtl, parsec, syb, text
+, time, utf8String, void
 }:
 
 cabal.mkDerivation (self: {
   pname = "HStringTemplate";
-  version = "0.6.9";
-  sha256 = "0xa665q5gya51vjkg1i6f6qk67jx28xcbxs5v1d9yr1f8djh5d9v";
+  version = "0.7.1";
+  sha256 = "0hqc1496xazihlww8j90m1cwzj7cihqbfjdly9s8kjf8d5my64ld";
   buildDepends = [
-    deepseq filepath mtl parsec syb sybWithClass text time utf8String
+    blazeBuilder deepseq filepath mtl parsec syb text time utf8String
+    void
   ];
   meta = {
     description = "StringTemplate implementation in Haskell";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.0.6.nix b/pkgs/development/libraries/haskell/HTTP/4000.0.6.nix
index c87b38af452..ac4ac232edf 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.0.6.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.0.6.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "4000.0.6";
   sha256 = "75af1ac4dc21b10c8a1a54a33179ea822e591887bab7278360a3d6b38304d39b";
   buildDepends = [ mtl network parsec ];
+  doCheck = false;
   meta = {
     homepage = "http://projects.haskell.org/http/";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.0.9.nix b/pkgs/development/libraries/haskell/HTTP/4000.0.9.nix
index 493da3337b9..0beebbfe294 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.0.9.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.0.9.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "4000.0.9";
   sha256 = "1e2b4a8b782ad1417c8755bb0d248851bc142b351366ed460e07f2945a5e95ba";
   buildDepends = [ mtl network parsec ];
+  doCheck = false;
   meta = {
     homepage = "http://projects.haskell.org/http/";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.1.1.nix b/pkgs/development/libraries/haskell/HTTP/4000.1.1.nix
index 28a3bd5fe95..31cfdddac79 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.1.1.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.1.1.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "4000.1.1";
   sha256 = "09khx5fb673a0d7m3bl39xjdxvc60m52rmm4865cha2mby0zidy3";
   buildDepends = [ mtl network parsec ];
+  doCheck = false;
   meta = {
     homepage = "http://projects.haskell.org/http/";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.1.2.nix b/pkgs/development/libraries/haskell/HTTP/4000.1.2.nix
index a75c72f6a28..8d4a39526b2 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.1.2.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.1.2.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "4000.1.2";
   sha256 = "19vcy8xinrvn01caly6sg1p1yvbbf7nwq10kxmnwqssnl4h5cwn8";
   buildDepends = [ mtl network parsec ];
+  doCheck = false;
   meta = {
     homepage = "http://projects.haskell.org/http/";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.2.1.nix b/pkgs/development/libraries/haskell/HTTP/4000.2.1.nix
index 5c6057ace9e..f3da4a5ccf2 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.2.1.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.2.1.nix
@@ -1,10 +1,16 @@
-{ cabal, mtl, network, parsec }:
+{ cabal, httpdShed, HUnit, mtl, network, parsec, split
+, testFramework, testFrameworkHunit
+}:
 
 cabal.mkDerivation (self: {
   pname = "HTTP";
   version = "4000.2.1";
   sha256 = "01076rk7ly5228pszn54x4nqc6rqq1xw11ij9ajvhzf419islh0a";
   buildDepends = [ mtl network parsec ];
+  testDepends = [
+    httpdShed HUnit network split testFramework testFrameworkHunit
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/haskell/HTTP";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.2.2.nix b/pkgs/development/libraries/haskell/HTTP/4000.2.2.nix
index 5fbb2ed8a84..e6238a5e738 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.2.2.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.2.2.nix
@@ -1,10 +1,16 @@
-{ cabal, mtl, network, parsec }:
+{ cabal, httpdShed, HUnit, mtl, network, parsec, split
+, testFramework, testFrameworkHunit
+}:
 
 cabal.mkDerivation (self: {
   pname = "HTTP";
   version = "4000.2.2";
   sha256 = "0qrr9wdj25sdfxifppmw0w14g8skpgf42ic4iqcqylxxzfa8v7vh";
   buildDepends = [ mtl network parsec ];
+  testDepends = [
+    httpdShed HUnit network split testFramework testFrameworkHunit
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/haskell/HTTP";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.2.3.nix b/pkgs/development/libraries/haskell/HTTP/4000.2.3.nix
index cff762864bc..d9e422f9e89 100644
--- a/pkgs/development/libraries/haskell/HTTP/4000.2.3.nix
+++ b/pkgs/development/libraries/haskell/HTTP/4000.2.3.nix
@@ -1,10 +1,16 @@
-{ cabal, mtl, network, parsec }:
+{ cabal, httpdShed, HUnit, mtl, network, parsec, split
+, testFramework, testFrameworkHunit
+}:
 
 cabal.mkDerivation (self: {
   pname = "HTTP";
   version = "4000.2.3";
   sha256 = "1z7s5rkyljwdl95cwqbqg64i207wjwxgpksrdmvcv82k39srzx80";
   buildDepends = [ mtl network parsec ];
+  testDepends = [
+    httpdShed HUnit network split testFramework testFrameworkHunit
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/haskell/HTTP";
     description = "A library for client-side HTTP";
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.2.5.nix b/pkgs/development/libraries/haskell/HTTP/4000.2.5.nix
new file mode 100644
index 00000000000..93ba5e949db
--- /dev/null
+++ b/pkgs/development/libraries/haskell/HTTP/4000.2.5.nix
@@ -0,0 +1,23 @@
+{ cabal, caseInsensitive, conduit, deepseq, httpdShed, httpTypes
+, HUnit, mtl, network, parsec, pureMD5, split, testFramework
+, testFrameworkHunit, wai, warp
+}:
+
+cabal.mkDerivation (self: {
+  pname = "HTTP";
+  version = "4000.2.5";
+  sha256 = "03ij1zkykc438x2r1szz6ddvfhrjywlx61nrz377srcpbdmhxpb7";
+  buildDepends = [ mtl network parsec ];
+  testDepends = [
+    caseInsensitive conduit deepseq httpdShed httpTypes HUnit mtl
+    network pureMD5 split testFramework testFrameworkHunit wai warp
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/haskell/HTTP";
+    description = "A library for client-side HTTP";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/HTTP/4000.2.8.nix b/pkgs/development/libraries/haskell/HTTP/4000.2.8.nix
new file mode 100644
index 00000000000..1b52261dea0
--- /dev/null
+++ b/pkgs/development/libraries/haskell/HTTP/4000.2.8.nix
@@ -0,0 +1,23 @@
+{ cabal, caseInsensitive, conduit, deepseq, httpdShed, httpTypes
+, HUnit, mtl, network, parsec, pureMD5, split, testFramework
+, testFrameworkHunit, wai, warp
+}:
+
+cabal.mkDerivation (self: {
+  pname = "HTTP";
+  version = "4000.2.8";
+  sha256 = "0p0cwzjw2102bsyfaga6m8b53s6qnhd6byg2j2qla653f6kjlsh8";
+  buildDepends = [ mtl network parsec ];
+  testDepends = [
+    caseInsensitive conduit deepseq httpdShed httpTypes HUnit mtl
+    network pureMD5 split testFramework testFrameworkHunit wai warp
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/haskell/HTTP";
+    description = "A library for client-side HTTP";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/text/0.11.1.12.nix b/pkgs/development/libraries/haskell/HUnit/1.2.5.2.nix
index e860e1c61a1..b94e0f20733 100644
--- a/pkgs/development/libraries/haskell/text/0.11.1.12.nix
+++ b/pkgs/development/libraries/haskell/HUnit/1.2.5.2.nix
@@ -1,13 +1,13 @@
 { cabal, deepseq }:
 
 cabal.mkDerivation (self: {
-  pname = "text";
-  version = "0.11.1.12";
-  sha256 = "0j2044whj3xckmxqmgdjbc2mpwdan481qzjslwplqbqwml2jvkml";
+  pname = "HUnit";
+  version = "1.2.5.2";
+  sha256 = "0hcs6qh8bqhip1kkjjnw7ccgcsmawdz5yvffjj5y8zd2vcsavx8a";
   buildDepends = [ deepseq ];
   meta = {
-    homepage = "https://github.com/bos/text";
-    description = "An efficient packed Unicode text type";
+    homepage = "http://hunit.sourceforge.net/";
+    description = "A unit testing framework for Haskell";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/HaXml/default.nix b/pkgs/development/libraries/haskell/HaXml/default.nix
index 55898e9d9d9..b490cf75d96 100644
--- a/pkgs/development/libraries/haskell/HaXml/default.nix
+++ b/pkgs/development/libraries/haskell/HaXml/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "HaXml";
-  version = "1.23.3";
-  sha256 = "1gp3vjv8g0i9bd0sryfjarzp7n8ddfbrib68jzhqgjkqbyj2bs8g";
+  version = "1.24";
+  sha256 = "18kvavqa84k2121ppxngn39fjz4w63chngb3255w1fhdz13v3ydn";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ filepath polyparse random ];
diff --git a/pkgs/development/libraries/haskell/Hipmunk/default.nix b/pkgs/development/libraries/haskell/Hipmunk/default.nix
index fee71449142..c07060cf197 100644
--- a/pkgs/development/libraries/haskell/Hipmunk/default.nix
+++ b/pkgs/development/libraries/haskell/Hipmunk/default.nix
@@ -5,6 +5,9 @@ cabal.mkDerivation (self: {
   version = "5.2.0.10";
   sha256 = "0kq6dlx1g7dra7nsfmrc13yvnl7wh00fadmgln9v2vyf0ww82x95";
   buildDepends = [ StateVar transformers ];
+  patchPhase = ''
+    sed -i -e 's|containers.*,|containers,|' Hipmunk.cabal
+  '';
   meta = {
     homepage = "http://patch-tag.com/r/felipe/hipmunk/home";
     description = "A Haskell binding for Chipmunk";
diff --git a/pkgs/development/libraries/haskell/HsOpenSSL/default.nix b/pkgs/development/libraries/haskell/HsOpenSSL/default.nix
index 3a4c94e33a2..9eefaaef84a 100644
--- a/pkgs/development/libraries/haskell/HsOpenSSL/default.nix
+++ b/pkgs/development/libraries/haskell/HsOpenSSL/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "HsOpenSSL";
-  version = "0.10.3.2";
-  sha256 = "15mlllzw8ahvrx259bz5vwisdig7bvkany1qjhmz6y8v2rcplr7f";
+  version = "0.10.3.3";
+  sha256 = "04d2nd2hcbglw8blwhi3d32vazdxnvs9s52788qyllgm7gmay6a5";
   buildDepends = [ network time ];
   extraLibraries = [ openssl ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/IORefCAS/default.nix b/pkgs/development/libraries/haskell/IORefCAS/default.nix
index fc9b09bd0d7..8025ef13bc2 100644
--- a/pkgs/development/libraries/haskell/IORefCAS/default.nix
+++ b/pkgs/development/libraries/haskell/IORefCAS/default.nix
@@ -1,11 +1,13 @@
-{ cabal, bitsAtomic }:
+{ cabal, bitsAtomic, HUnit, QuickCheck, time }:
 
 cabal.mkDerivation (self: {
   pname = "IORefCAS";
-  version = "0.2";
-  sha256 = "18hyy3jqr9yky5r873816fqnywrwba90sq6zx61i2vkqlfbll1k9";
+  version = "0.2.0.1";
+  sha256 = "06vfck59x30mqa9h2ljd4r2cx1ks91b9gwcr928brp7filsq9fdb";
   buildDepends = [ bitsAtomic ];
+  testDepends = [ bitsAtomic HUnit QuickCheck time ];
   meta = {
+    homepage = "https://github.com/rrnewton/haskell-lockfree-queue/wiki";
     description = "Atomic compare and swap for IORefs and STRefs";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/JuicyPixels/default.nix b/pkgs/development/libraries/haskell/JuicyPixels/default.nix
index a99f8295c60..c289c009256 100644
--- a/pkgs/development/libraries/haskell/JuicyPixels/default.nix
+++ b/pkgs/development/libraries/haskell/JuicyPixels/default.nix
@@ -1,17 +1,17 @@
-{ cabal, cereal, deepseq, mtl, primitive, transformers, vector
+{ cabal, binary, deepseq, mtl, primitive, transformers, vector
 , zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "JuicyPixels";
-  version = "1.3";
-  sha256 = "07wljfag4ylw16wdi7znjb61pfihdik5d7p4h2lmz6xirm4mjzrm";
+  version = "3.0";
+  sha256 = "1qhhhnfs12r67nf07bx58n8a2v6wikan8cqs1wnjnaad8yk2spsg";
   buildDepends = [
-    cereal deepseq mtl primitive transformers vector zlib
+    binary deepseq mtl primitive transformers vector zlib
   ];
   meta = {
     homepage = "https://github.com/Twinside/Juicy.Pixels";
-    description = "Picture loading/serialization (in png, jpeg and bitmap)";
+    description = "Picture loading/serialization (in png, jpeg, bitmap, radiance and gif)";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/List/default.nix b/pkgs/development/libraries/haskell/List/default.nix
new file mode 100644
index 00000000000..65c90c0824e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/List/default.nix
@@ -0,0 +1,14 @@
+{ cabal, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "List";
+  version = "0.5.1";
+  sha256 = "1hgkal8jh035bs0z6z8i899dc0888fhdx8940y27aaxxbmlzfy1p";
+  buildDepends = [ transformers ];
+  meta = {
+    homepage = "http://github.com/yairchu/generator/tree";
+    description = "List monad transformer and class";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/ListLike/default.nix b/pkgs/development/libraries/haskell/ListLike/default.nix
index 58595edf744..2fa427b1f57 100644
--- a/pkgs/development/libraries/haskell/ListLike/default.nix
+++ b/pkgs/development/libraries/haskell/ListLike/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ListLike";
-  version = "3.1.6";
-  sha256 = "0ij6yb80dv841zn23lp6251avzmljzmy4j25r7w6h55y32y7gq46";
+  version = "3.1.7.1";
+  sha256 = "1g3i8iz71x3j41ji9xsbh84v5hj3mxls0zqnx27sb31mx6bic4w1";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/ListZipper/default.nix b/pkgs/development/libraries/haskell/ListZipper/default.nix
new file mode 100644
index 00000000000..d7307bde5d7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ListZipper/default.nix
@@ -0,0 +1,13 @@
+{ cabal, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "ListZipper";
+  version = "1.2.0.2";
+  sha256 = "0z3izxpl21fxz43jpx7zqs965anb3gp5vidv3pwwznr88ss2j6a9";
+  buildDepends = [ QuickCheck ];
+  meta = {
+    description = "Simple zipper for lists";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/MemoTrie/default.nix b/pkgs/development/libraries/haskell/MemoTrie/default.nix
index 115ad935ae1..f3bd183d137 100644
--- a/pkgs/development/libraries/haskell/MemoTrie/default.nix
+++ b/pkgs/development/libraries/haskell/MemoTrie/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "MemoTrie";
-  version = "0.5";
-  sha256 = "07knq5ccsyicznvr25vlbzadrgdw2aic71hhbv6v16wra1f17gbf";
+  version = "0.6.1";
+  sha256 = "1bx0xd28irxjrq181wirx0vdrdj4qg4n4wj7ya27lkh408mwsxm6";
   buildDepends = [ void ];
   meta = {
     homepage = "http://haskell.org/haskellwiki/MemoTrie";
diff --git a/pkgs/development/libraries/haskell/MissingH/default.nix b/pkgs/development/libraries/haskell/MissingH/default.nix
index 52e26fe1f83..659a1158d0f 100644
--- a/pkgs/development/libraries/haskell/MissingH/default.nix
+++ b/pkgs/development/libraries/haskell/MissingH/default.nix
@@ -1,15 +1,15 @@
 { cabal, filepath, hslogger, HUnit, mtl, network, parsec, random
-, regexCompat
+, regexCompat, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "MissingH";
-  version = "1.1.1.0";
-  sha256 = "1i2fdr6p0jnn9w865ngjcchbsamrvnvdf9c4vzhjhzy500z2k1ry";
+  version = "1.2.0.0";
+  sha256 = "0bqg1j2pvm0ixrbnsxrr5kgibhbp191irhcavqlwfwgaxhrpqnm1";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    filepath hslogger HUnit mtl network parsec random regexCompat
+    filepath hslogger HUnit mtl network parsec random regexCompat time
   ];
   meta = {
     homepage = "http://software.complete.org/missingh";
diff --git a/pkgs/development/libraries/haskell/MonadRandom/default.nix b/pkgs/development/libraries/haskell/MonadRandom/default.nix
index da343a527ce..738b69f2832 100644
--- a/pkgs/development/libraries/haskell/MonadRandom/default.nix
+++ b/pkgs/development/libraries/haskell/MonadRandom/default.nix
@@ -1,10 +1,10 @@
-{ cabal, mtl, random }:
+{ cabal, mtl, random, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "MonadRandom";
-  version = "0.1.7";
-  sha256 = "0y4fsb3j0babq388rw3y1kbxbjz6plfgbg4g1y27hdf7jf5c8x33";
-  buildDepends = [ mtl random ];
+  version = "0.1.9";
+  sha256 = "1n947650xlz47rj6y6ik2mknyr9smwragjr5akccinmfm1krg6lz";
+  buildDepends = [ mtl random transformers ];
   meta = {
     description = "Random-number generation monad";
     license = "unknown";
diff --git a/pkgs/development/libraries/haskell/NumInstances/default.nix b/pkgs/development/libraries/haskell/NumInstances/default.nix
index 4d258f5634d..d276697a6d9 100644
--- a/pkgs/development/libraries/haskell/NumInstances/default.nix
+++ b/pkgs/development/libraries/haskell/NumInstances/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "NumInstances";
-  version = "1.0";
-  sha256 = "1fmg3slwma5f88a2qxj54ny40s67qbdyvsyh506bkp11v54958fy";
+  version = "1.3";
+  sha256 = "0w1hls5azsg95c0v510xqgr8hs195y2rxzjc7hpjg8q44d4z78sh";
   meta = {
+    homepage = "https://github.com/conal/NumInstances";
     description = "Instances of numeric classes for functions and tuples";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/OpenAL/default.nix b/pkgs/development/libraries/haskell/OpenAL/default.nix
index 206e78eb728..a04aea993fa 100644
--- a/pkgs/development/libraries/haskell/OpenAL/default.nix
+++ b/pkgs/development/libraries/haskell/OpenAL/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "OpenAL";
-  version = "1.4.0.1";
-  sha256 = "180f84sjakhd1b8h5n3l92by2wmic20n6ax0z5fi3fvk9w73khyv";
+  version = "1.4.0.2";
+  sha256 = "19q4pd5i2w330qh895z0cgim4m4f4gxqf4ya1192fchqmgcz1svz";
   buildDepends = [ ObjectName StateVar Tensor ];
   extraLibraries = [ openal ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/OpenGL/2.5.0.0.nix b/pkgs/development/libraries/haskell/OpenGL/2.6.0.1.nix
index 9d8c1bb29ae..318bdf19748 100644
--- a/pkgs/development/libraries/haskell/OpenGL/2.5.0.0.nix
+++ b/pkgs/development/libraries/haskell/OpenGL/2.6.0.1.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "OpenGL";
-  version = "2.5.0.0";
-  sha256 = "1kpakn5i4aka67mqcpfq9jpl38h409x63zd14y35abpm6h3x8m3j";
+  version = "2.6.0.1";
+  sha256 = "1fpabhpjfl1bj0dhlj2sg8zsn3l6py4zw1arplwmqalz3xbkkgdi";
   buildDepends = [ GLURaw ObjectName OpenGLRaw StateVar Tensor ];
   extraLibraries = [ libX11 mesa ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/OpenGL/2.8.0.0.nix b/pkgs/development/libraries/haskell/OpenGL/2.8.0.0.nix
new file mode 100644
index 00000000000..72183c86192
--- /dev/null
+++ b/pkgs/development/libraries/haskell/OpenGL/2.8.0.0.nix
@@ -0,0 +1,16 @@
+{ cabal, GLURaw, libX11, mesa, OpenGLRaw }:
+
+cabal.mkDerivation (self: {
+  pname = "OpenGL";
+  version = "2.8.0.0";
+  sha256 = "1wb5772dhh4a81ks9zxz8adpfxa97hcna9s263h9cl2vny6ksxff";
+  buildDepends = [ GLURaw OpenGLRaw ];
+  extraLibraries = [ libX11 mesa ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/Opengl";
+    description = "A binding for the OpenGL graphics system";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/OpenGLRaw/default.nix b/pkgs/development/libraries/haskell/OpenGLRaw/1.3.0.0.nix
index b51e12eab65..a6a45bf5b24 100644
--- a/pkgs/development/libraries/haskell/OpenGLRaw/default.nix
+++ b/pkgs/development/libraries/haskell/OpenGLRaw/1.3.0.0.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "OpenGLRaw";
-  version = "1.2.0.0";
-  sha256 = "1nwk93wlwh7gz2lb1dc88frmwik71g61a7k8xfiib2q5a8a8kf9r";
+  version = "1.3.0.0";
+  sha256 = "0ifp5inrm48hzpq0x9hlk5cxh2k64y05phmsdb5hydb7r6dcla32";
   extraLibraries = [ mesa ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Opengl";
diff --git a/pkgs/development/libraries/haskell/QuickCheck/2.5.nix b/pkgs/development/libraries/haskell/QuickCheck/2.5.1.1.nix
index 127d90ca5e7..24e16a4955f 100644
--- a/pkgs/development/libraries/haskell/QuickCheck/2.5.nix
+++ b/pkgs/development/libraries/haskell/QuickCheck/2.5.1.1.nix
@@ -1,10 +1,10 @@
-{ cabal, extensibleExceptions, random }:
+{ cabal, random }:
 
 cabal.mkDerivation (self: {
   pname = "QuickCheck";
-  version = "2.5";
-  sha256 = "0a4ibyw5abm7ds6pds41147phjkccx8v60vqdj05c5n28hbzbgbh";
-  buildDepends = [ extensibleExceptions random ];
+  version = "2.5.1.1";
+  sha256 = "1ff2mhm27l8cc8nrsbw2z65dc9m7h879jykl5g7yqip5l88j0jcq";
+  buildDepends = [ random ];
   meta = {
     homepage = "http://code.haskell.org/QuickCheck";
     description = "Automatic testing of Haskell programs";
diff --git a/pkgs/development/libraries/haskell/QuickCheck/2.6.nix b/pkgs/development/libraries/haskell/QuickCheck/2.6.nix
new file mode 100644
index 00000000000..39c97859e65
--- /dev/null
+++ b/pkgs/development/libraries/haskell/QuickCheck/2.6.nix
@@ -0,0 +1,15 @@
+{ cabal, random }:
+
+cabal.mkDerivation (self: {
+  pname = "QuickCheck";
+  version = "2.6";
+  sha256 = "03cp7mshjy2yrg31i13b9kmc2a6lrmrbl1sh9s8lswcj305c00c0";
+  buildDepends = [ random ];
+  meta = {
+    homepage = "http://code.haskell.org/QuickCheck";
+    description = "Automatic testing of Haskell programs";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/RSA/default.nix b/pkgs/development/libraries/haskell/RSA/default.nix
index ed14a3e8d19..c5257c5b262 100644
--- a/pkgs/development/libraries/haskell/RSA/default.nix
+++ b/pkgs/development/libraries/haskell/RSA/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "RSA";
-  version = "1.2.1.0";
-  sha256 = "14x53xjy4rqdgin6kyrm2b16hb0k599gfiwiwrsyri9mx3f3s1ca";
+  version = "1.2.2.0";
+  sha256 = "0x4an1060slppyccf18isqrdl548ll33xzzqch3qxg285a0mm12m";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/ReadArgs/default.nix b/pkgs/development/libraries/haskell/ReadArgs/default.nix
new file mode 100644
index 00000000000..12c3e34571e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ReadArgs/default.nix
@@ -0,0 +1,17 @@
+{ cabal, hspec, systemFilepath, text }:
+
+cabal.mkDerivation (self: {
+  pname = "ReadArgs";
+  version = "1.2.1";
+  sha256 = "099gg6nq70yf2pl5ya8f083lw8x5rncnv54y2p5jlkdwfwmpmbnv";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ systemFilepath text ];
+  testDepends = [ hspec systemFilepath text ];
+  meta = {
+    homepage = "http://github.com/rampion/ReadArgs";
+    description = "Simple command line argument parsing";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/SDL-ttf/default.nix b/pkgs/development/libraries/haskell/SDL-ttf/default.nix
index f58674f2520..f1a0489167e 100644
--- a/pkgs/development/libraries/haskell/SDL-ttf/default.nix
+++ b/pkgs/development/libraries/haskell/SDL-ttf/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "SDL-ttf";
-  version = "0.6.1";
-  sha256 = "0n6vbigkjfvvk98bp7ys14snpd1zmbz69ndhhpnrn02h363vwkal";
+  version = "0.6.2";
+  sha256 = "0jajnbqnhdd4i8pj8j27m53zwgfs1v06kiwy0s0zml02fdkq8j4a";
   buildDepends = [ SDL ];
   extraLibraries = [ SDL_ttf ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/SDL/default.nix b/pkgs/development/libraries/haskell/SDL/default.nix
index a83518f9e10..62731657e82 100644
--- a/pkgs/development/libraries/haskell/SDL/default.nix
+++ b/pkgs/development/libraries/haskell/SDL/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "SDL";
-  version = "0.6.3";
-  sha256 = "0m3ick3rw8623ja42yfj4pa57naa6yb20ym8lv252gwb18ghp4sp";
+  version = "0.6.4";
+  sha256 = "1zrfx2nw0k8lfkr6vnwsp5wr3yz62v0bq60p4sdzj7gm01bz92g0";
   extraLibraries = [ SDL ];
   meta = {
     description = "Binding to libSDL";
diff --git a/pkgs/development/libraries/haskell/SHA/default.nix b/pkgs/development/libraries/haskell/SHA/default.nix
index 956b1a8f8a3..34341270084 100644
--- a/pkgs/development/libraries/haskell/SHA/default.nix
+++ b/pkgs/development/libraries/haskell/SHA/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "SHA";
-  version = "1.5.1";
-  sha256 = "009c0nabva0c4aq4yhqdmdqmrrjmg8scpy7yz65bbhqnfwnjvdks";
+  version = "1.6.1";
+  sha256 = "1v3a2skkbr64y7x1aqpq1qz03isc42l9hd1viqcsv4qlld595fgx";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ binary ];
diff --git a/pkgs/development/libraries/haskell/SMTPClient/default.nix b/pkgs/development/libraries/haskell/SMTPClient/default.nix
index 1e2dee4fcdc..91c128756f4 100644
--- a/pkgs/development/libraries/haskell/SMTPClient/default.nix
+++ b/pkgs/development/libraries/haskell/SMTPClient/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "SMTPClient";
-  version = "1.0.4";
-  sha256 = "12m0qv8bf0s52yz07sipxlvas8k3xvi1d4lw6960q0nxr40ijyy2";
+  version = "1.1.0";
+  sha256 = "07njj24c43iz33c641d5ish62h13lhpvn2mx5pv5i6s3fm3bxsfk";
   buildDepends = [ extensibleExceptions hsemail network ];
   meta = {
     description = "A simple SMTP client library";
diff --git a/pkgs/development/libraries/haskell/SafeSemaphore/default.nix b/pkgs/development/libraries/haskell/SafeSemaphore/default.nix
new file mode 100644
index 00000000000..d4cc7490277
--- /dev/null
+++ b/pkgs/development/libraries/haskell/SafeSemaphore/default.nix
@@ -0,0 +1,15 @@
+{ cabal, HUnit, stm }:
+
+cabal.mkDerivation (self: {
+  pname = "SafeSemaphore";
+  version = "0.9.0";
+  sha256 = "1xa30cciw8wmri675kdsz4pb5qwrh592pzylbhawqsvsarf80gz4";
+  buildDepends = [ stm ];
+  testDepends = [ HUnit ];
+  meta = {
+    homepage = "https://github.com/ChrisKuklewicz/SafeSemaphore";
+    description = "Much safer replacement for QSemN, QSem, and SampleVar";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/Stream/default.nix b/pkgs/development/libraries/haskell/Stream/default.nix
index 83789765ec7..a95b3076137 100644
--- a/pkgs/development/libraries/haskell/Stream/default.nix
+++ b/pkgs/development/libraries/haskell/Stream/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Stream";
-  version = "0.4.6";
-  sha256 = "0ppjcddm8dxxd260dsnzrdijifg4pa66lm401qj4fiddw0b50wzb";
+  version = "0.4.6.1";
+  sha256 = "19z052rd0varq5cbw0i0f0vkbpb40kqg6i93kz2brk6a101q5llp";
   buildDepends = [ lazysmallcheck QuickCheck ];
   meta = {
     description = "A library for manipulating infinite lists";
diff --git a/pkgs/development/libraries/haskell/X11/1.5.0.1.nix b/pkgs/development/libraries/haskell/X11/1.5.0.1.nix
deleted file mode 100644
index e36b940e923..00000000000
--- a/pkgs/development/libraries/haskell/X11/1.5.0.1.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ cabal, libX11, libXext, libXinerama, syb }:
-
-cabal.mkDerivation (self: {
-  pname = "X11";
-  version = "1.5.0.1";
-  sha256 = "0s8k3lhvlks6i1mwfnm5fimfd2f0sjw9k2p67is3x564kih7mh19";
-  buildDepends = [ syb ];
-  extraLibraries = [ libX11 libXext libXinerama ];
-  meta = {
-    homepage = "https://github.com/haskell-pkg-janitors/X11";
-    description = "A binding to the X11 graphics library";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/X11/1.6.0.nix b/pkgs/development/libraries/haskell/X11/default.nix
index 6292f7eab5c..c304a58b9a5 100644
--- a/pkgs/development/libraries/haskell/X11/1.6.0.nix
+++ b/pkgs/development/libraries/haskell/X11/default.nix
@@ -1,11 +1,12 @@
-{ cabal, libX11, libXext, libXinerama, libXrandr, libXrender, syb
+{ cabal, dataDefault, libX11, libXext, libXinerama, libXrandr
+, libXrender
 }:
 
 cabal.mkDerivation (self: {
   pname = "X11";
-  version = "1.6.0";
-  sha256 = "0jjnr4490mkdrmq3lvv7hha7rc9vbwsxlwsvcv56q6zgjx4zwf8j";
-  buildDepends = [ syb ];
+  version = "1.6.1.1";
+  sha256 = "1bkfnxcmf8qia0l3x5n3j4f1zakjwnlq0mhdnbpp6v3q2g37brbw";
+  buildDepends = [ dataDefault ];
   extraLibraries = [
     libX11 libXext libXinerama libXrandr libXrender
   ];
diff --git a/pkgs/development/libraries/haskell/abstract-deque/default.nix b/pkgs/development/libraries/haskell/abstract-deque/default.nix
index 90d6f4c274e..475abb0b3a9 100644
--- a/pkgs/development/libraries/haskell/abstract-deque/default.nix
+++ b/pkgs/development/libraries/haskell/abstract-deque/default.nix
@@ -1,11 +1,13 @@
-{ cabal, HUnit, IORefCAS }:
+{ cabal, HUnit, random, testFramework, testFrameworkHunit }:
 
 cabal.mkDerivation (self: {
   pname = "abstract-deque";
-  version = "0.1.5";
-  sha256 = "1zp19kq3m72nx7rr00yyq8iwia4abg4x9kw4d5s5k0srp5f9fn3q";
-  buildDepends = [ HUnit IORefCAS ];
+  version = "0.2";
+  sha256 = "0cq1k74b854flfvh7qhfnpngn4vyzp1az1rkaara23wlylydgs89";
+  buildDepends = [ HUnit random ];
+  testDepends = [ HUnit random testFramework testFrameworkHunit ];
   meta = {
+    homepage = "https://github.com/rrnewton/haskell-lockfree-queue/wiki";
     description = "Abstract, parameterized interface to mutable Deques";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/accelerate-cuda/default.nix b/pkgs/development/libraries/haskell/accelerate-cuda/default.nix
index ff9a98cbb59..aee3b666890 100644
--- a/pkgs/development/libraries/haskell/accelerate-cuda/default.nix
+++ b/pkgs/development/libraries/haskell/accelerate-cuda/default.nix
@@ -1,22 +1,19 @@
-{ cabal, accelerate, binary, blazeBuilder, cryptohash, cuda
-, fclabels, filepath, hashable, hashtables, languageCQuote
-, mainlandPretty, mtl, srcloc, transformers, unorderedContainers
+{ cabal, accelerate, binary, cryptohash, cuda, fclabels, filepath
+, hashable, hashtables, languageCQuote, mainlandPretty, mtl
+, SafeSemaphore, srcloc, text, transformers, unorderedContainers
 }:
 
 cabal.mkDerivation (self: {
   pname = "accelerate-cuda";
-  version = "0.12.1.1";
-  sha256 = "1kj9i6djjb46ad3dnzk72mf33r8h1mjxljs7x5rf2d658hqk5yfv";
+  version = "0.13.0.1";
+  sha256 = "0nswa73ajvmh1s6n2nks4zm3ybfm8v46wd789cs09f5s90ingpsj";
   buildDepends = [
-    accelerate binary blazeBuilder cryptohash cuda fclabels filepath
-    hashable hashtables languageCQuote mainlandPretty mtl srcloc
-    transformers unorderedContainers
+    accelerate binary cryptohash cuda fclabels filepath hashable
+    hashtables languageCQuote mainlandPretty mtl SafeSemaphore srcloc
+    text transformers unorderedContainers
   ];
-  patchPhase = ''
-    sed -i -e 's|\<defaultMain\>|defaultMainWithHooks autoconfUserHooks|' Setup.hs
-  '';
   meta = {
-    homepage = "http://www.cse.unsw.edu.au/~chak/project/accelerate/";
+    homepage = "https://github.com/AccelerateHS/accelerate-cuda/";
     description = "Accelerate backend for NVIDIA GPUs";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.stdenv.lib.platforms.none;
diff --git a/pkgs/development/libraries/haskell/accelerate-examples/default.nix b/pkgs/development/libraries/haskell/accelerate-examples/default.nix
index f88824c21fe..b9536052dd2 100644
--- a/pkgs/development/libraries/haskell/accelerate-examples/default.nix
+++ b/pkgs/development/libraries/haskell/accelerate-examples/default.nix
@@ -1,25 +1,26 @@
-{ cabal, accelerate, accelerateCuda, accelerateIo, attoparsec, bmp
-, bytestringLexing, cmdargs, criterion, cuda, deepseq, fclabels
-, filepath, gloss, hashtables, mtl, mwcRandom, pgm, QuickCheck
-, random, testFramework, testFrameworkQuickcheck2, vector
-, vectorAlgorithms
+{ cabal, accelerate, accelerateCuda, accelerateFft, accelerateIo
+, attoparsec, bmp, bytestringLexing, cereal, cmdargs, criterion
+, cuda, deepseq, fclabels, filepath, gloss, hashtables, mtl
+, mwcRandom, pgm, QuickCheck, random, repa, repaIo, testFramework
+, testFrameworkQuickcheck2, vector, vectorAlgorithms
 }:
 
 cabal.mkDerivation (self: {
   pname = "accelerate-examples";
-  version = "0.12.1.0";
-  sha256 = "0vlax90yy9h4ljm87ffmnqv881nr4ssbc968mbbwi2704hn4chhb";
+  version = "0.13.0.0";
+  sha256 = "18f8p47sf10zn678540qzzf5pl18w9f068s83lpz4lk0r5gf4lzx";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    accelerate accelerateCuda accelerateIo attoparsec bmp
-    bytestringLexing cmdargs criterion cuda deepseq fclabels filepath
-    gloss hashtables mtl mwcRandom pgm QuickCheck random testFramework
-    testFrameworkQuickcheck2 vector vectorAlgorithms
+    accelerate accelerateCuda accelerateFft accelerateIo attoparsec bmp
+    bytestringLexing cereal cmdargs criterion cuda deepseq fclabels
+    filepath gloss hashtables mtl mwcRandom pgm QuickCheck random repa
+    repaIo testFramework testFrameworkQuickcheck2 vector
+    vectorAlgorithms
   ];
   configureFlags = "-f-opencl";
   meta = {
-    homepage = "http://www.cse.unsw.edu.au/~chak/project/accelerate/";
+    homepage = "https://github.com/AccelerateHS/accelerate-examples";
     description = "Examples using the Accelerate library";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.stdenv.lib.platforms.none;
diff --git a/pkgs/development/libraries/haskell/accelerate-fft/default.nix b/pkgs/development/libraries/haskell/accelerate-fft/default.nix
new file mode 100644
index 00000000000..523e5ae1504
--- /dev/null
+++ b/pkgs/development/libraries/haskell/accelerate-fft/default.nix
@@ -0,0 +1,14 @@
+{ cabal, accelerate, accelerateCuda, cuda, cufft }:
+
+cabal.mkDerivation (self: {
+  pname = "accelerate-fft";
+  version = "0.13.0.0";
+  sha256 = "0gqdb7m0qf8wvccqnz9pafbvas3viwhr9i422cmfvjpxsmnzlcp7";
+  buildDepends = [ accelerate accelerateCuda cuda cufft ];
+  meta = {
+    homepage = "https://github.com/AccelerateHS/accelerate-fft";
+    description = "FFT using the Accelerate library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/accelerate-io/default.nix b/pkgs/development/libraries/haskell/accelerate-io/default.nix
index 1cefda35325..3daa16d87c9 100644
--- a/pkgs/development/libraries/haskell/accelerate-io/default.nix
+++ b/pkgs/development/libraries/haskell/accelerate-io/default.nix
@@ -1,12 +1,12 @@
-{ cabal, accelerate, repa, vector }:
+{ cabal, accelerate, bmp, repa, vector }:
 
 cabal.mkDerivation (self: {
   pname = "accelerate-io";
-  version = "0.12.1.0";
-  sha256 = "1hcyshzfh7ldswv7sjklxlw5h1hx7spx6dy23bvdryrkq929gb8a";
-  buildDepends = [ accelerate repa vector ];
+  version = "0.13.0.1";
+  sha256 = "0wjprbhcddnjqbhmpxiwq73hazdnhafhjj7mpvpxhs9pz1dbv89h";
+  buildDepends = [ accelerate bmp repa vector ];
   meta = {
-    homepage = "http://www.cse.unsw.edu.au/~chak/project/accelerate/";
+    homepage = "https://github.com/AccelerateHS/accelerate-io";
     description = "Read and write Accelerate arrays in various formats";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/accelerate/default.nix b/pkgs/development/libraries/haskell/accelerate/default.nix
index a2dc4cb2e59..b91de6de44e 100644
--- a/pkgs/development/libraries/haskell/accelerate/default.nix
+++ b/pkgs/development/libraries/haskell/accelerate/default.nix
@@ -1,9 +1,11 @@
-{ cabal }:
+{ cabal, fclabels, hashable, hashtables }:
 
 cabal.mkDerivation (self: {
   pname = "accelerate";
-  version = "0.12.1.0";
-  sha256 = "1zvrb36xvvzfdl0k7a25329mdplwa76k9wk0yf3za3j0kb20d4f4";
+  version = "0.13.0.1";
+  sha256 = "01vkvvvzlj023cwxz90clrcgz4xyz0nb8idm1zad21gzrij14915";
+  buildDepends = [ fclabels hashable hashtables ];
+  noHaddock = true;
   meta = {
     homepage = "https://github.com/AccelerateHS/accelerate/";
     description = "An embedded language for accelerated array processing";
diff --git a/pkgs/development/libraries/haskell/acid-state/default.nix b/pkgs/development/libraries/haskell/acid-state/default.nix
new file mode 100644
index 00000000000..10f222cfe10
--- /dev/null
+++ b/pkgs/development/libraries/haskell/acid-state/default.nix
@@ -0,0 +1,18 @@
+{ cabal, cereal, extensibleExceptions, filepath, mtl, network
+, safecopy, stm
+}:
+
+cabal.mkDerivation (self: {
+  pname = "acid-state";
+  version = "0.8.3";
+  sha256 = "1n7vafw3jz7kmlp5jqn1wv0ip2rcbyfx0cdi2m1a2lvpi6dh97gc";
+  buildDepends = [
+    cereal extensibleExceptions filepath mtl network safecopy stm
+  ];
+  meta = {
+    homepage = "http://acid-state.seize.it/";
+    description = "Add ACID guarantees to any serializable Haskell data structure";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/active/default.nix b/pkgs/development/libraries/haskell/active/default.nix
new file mode 100644
index 00000000000..209341e22e7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/active/default.nix
@@ -0,0 +1,18 @@
+{ cabal, newtype, QuickCheck, semigroupoids, semigroups
+, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "active";
+  version = "0.1.0.4";
+  sha256 = "0f4bgx7l9vx2kywl87zpxpjbfix79lp8chf6xzfpmh4wrbmfgi1s";
+  buildDepends = [ newtype semigroupoids semigroups vectorSpace ];
+  testDepends = [
+    newtype QuickCheck semigroupoids semigroups vectorSpace
+  ];
+  meta = {
+    description = "Abstractions for animation";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/aeson/default.nix b/pkgs/development/libraries/haskell/aeson/default.nix
index c1cacb9eaa3..3c4135feb72 100644
--- a/pkgs/development/libraries/haskell/aeson/default.nix
+++ b/pkgs/development/libraries/haskell/aeson/default.nix
@@ -1,15 +1,21 @@
 { cabal, attoparsec, blazeBuilder, deepseq, dlist, hashable, mtl
-, syb, text, time, unorderedContainers, vector
+, QuickCheck, syb, testFramework, testFrameworkQuickcheck2, text
+, time, unorderedContainers, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "aeson";
-  version = "0.6.0.2";
-  sha256 = "04vyjpp3zi2g65rrkq4x4bddw0nfclniq5hhfq7l3jhybd8jxy51";
+  version = "0.6.1.0";
+  sha256 = "16hjwcybmgmk1sg8x02r9bxisx4gl61rlq8w2zsxfgkxwjpfhkbx";
   buildDepends = [
     attoparsec blazeBuilder deepseq dlist hashable mtl syb text time
     unorderedContainers vector
   ];
+  testDepends = [
+    attoparsec QuickCheck testFramework testFrameworkQuickcheck2 text
+    time
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/aeson";
     description = "Fast JSON parsing and encoding";
diff --git a/pkgs/development/libraries/haskell/alsa-core/default.nix b/pkgs/development/libraries/haskell/alsa-core/default.nix
new file mode 100644
index 00000000000..140d554e88c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/alsa-core/default.nix
@@ -0,0 +1,15 @@
+{ cabal, alsaLib, extensibleExceptions }:
+
+cabal.mkDerivation (self: {
+  pname = "alsa-core";
+  version = "0.5.0.1";
+  sha256 = "1avh4a419h9d2zsslg6j8hm87ppgsgqafz8ll037rk2yy1g4jl7b";
+  buildDepends = [ extensibleExceptions ];
+  pkgconfigDepends = [ alsaLib ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/ALSA";
+    description = "Binding to the ALSA Library API (Exceptions)";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/alsa-pcm/default.nix b/pkgs/development/libraries/haskell/alsa-pcm/default.nix
new file mode 100644
index 00000000000..3d1091f2702
--- /dev/null
+++ b/pkgs/development/libraries/haskell/alsa-pcm/default.nix
@@ -0,0 +1,21 @@
+{ cabal, alsaCore, alsaLib, extensibleExceptions, sampleFrame
+, storableRecord
+}:
+
+cabal.mkDerivation (self: {
+  pname = "alsa-pcm";
+  version = "0.6";
+  sha256 = "10cmlf1s9y65cs81wn7xwgcd4218n3h3p34avibv3fa7n3q9b4x1";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    alsaCore extensibleExceptions sampleFrame storableRecord
+  ];
+  pkgconfigDepends = [ alsaLib ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/ALSA";
+    description = "Binding to the ALSA Library API (PCM audio)";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/ansi-terminal/default.nix b/pkgs/development/libraries/haskell/ansi-terminal/default.nix
index 90a0a9b2b00..6d598f29ec9 100644
--- a/pkgs/development/libraries/haskell/ansi-terminal/default.nix
+++ b/pkgs/development/libraries/haskell/ansi-terminal/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ansi-terminal";
-  version = "0.5.5";
-  sha256 = "09r4nlpmkis6cp30jkymfas13hz6ph4zqxhvigrxn6s76v7nb5a8";
+  version = "0.6";
+  sha256 = "0a5zrq80yrj48s2cm8lns06p6wwnz72vs2wy0ryp0gw6rrg50fkg";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/ansi-wl-pprint/default.nix b/pkgs/development/libraries/haskell/ansi-wl-pprint/default.nix
index f34fcf6559d..bfccdcffd74 100644
--- a/pkgs/development/libraries/haskell/ansi-wl-pprint/default.nix
+++ b/pkgs/development/libraries/haskell/ansi-wl-pprint/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ansi-wl-pprint";
-  version = "0.6.4";
-  sha256 = "0zrhzkmc5ki6q9ac5l16lhnyf9z2raj78gj9n0a7530rcv4ak3k0";
+  version = "0.6.6";
+  sha256 = "1zkbiv5cpdgjiyn2nrrha29r84al7jg6647flqmc8riz2nn91zqy";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ ansiTerminal ];
diff --git a/pkgs/development/libraries/haskell/appar/default.nix b/pkgs/development/libraries/haskell/appar/default.nix
new file mode 100644
index 00000000000..4c2f5a9ce46
--- /dev/null
+++ b/pkgs/development/libraries/haskell/appar/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "appar";
+  version = "0.1.4";
+  sha256 = "09jb9ij78fdkz2qk66rw99q19qnm504dpv0yq0pjsl6xwjmndsjq";
+  meta = {
+    description = "A simple applicative parser";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/arithmoi/default.nix b/pkgs/development/libraries/haskell/arithmoi/default.nix
new file mode 100644
index 00000000000..181937fdd80
--- /dev/null
+++ b/pkgs/development/libraries/haskell/arithmoi/default.nix
@@ -0,0 +1,14 @@
+{ cabal, mtl, random }:
+
+cabal.mkDerivation (self: {
+  pname = "arithmoi";
+  version = "0.4.0.3";
+  sha256 = "0idn312xzly636h13zmm7cw7ki64bpnniqc97nshqzgp8if5ycrc";
+  buildDepends = [ mtl random ];
+  meta = {
+    homepage = "https://bitbucket.org/dafis/arithmoi";
+    description = "Efficient basic number-theoretic functions. Primes, powers, integer logarithms.";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/arrows/default.nix b/pkgs/development/libraries/haskell/arrows/default.nix
index baebfbce0f6..149f5f951e5 100644
--- a/pkgs/development/libraries/haskell/arrows/default.nix
+++ b/pkgs/development/libraries/haskell/arrows/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "arrows";
-  version = "0.4.4.0";
-  sha256 = "1dcvv1vscyggwqmlm6j2sc29zy0wmhn6w4g617gbxxb1j28bm6a9";
+  version = "0.4.4.1";
+  sha256 = "1qpbpwsc3frjdngwjv3r58nfa0ik88cqh24ls47svigsz3c4n42v";
   buildDepends = [ Stream ];
   meta = {
     homepage = "http://www.haskell.org/arrows/";
diff --git a/pkgs/development/libraries/haskell/asn1-data/default.nix b/pkgs/development/libraries/haskell/asn1-data/default.nix
index 60e795f6e2e..a90e8e769e2 100644
--- a/pkgs/development/libraries/haskell/asn1-data/default.nix
+++ b/pkgs/development/libraries/haskell/asn1-data/default.nix
@@ -1,17 +1,15 @@
-{ cabal, attoparsec, attoparsecEnumerator, enumerator, mtl, text }:
+{ cabal, cereal, mtl, text }:
 
 cabal.mkDerivation (self: {
   pname = "asn1-data";
-  version = "0.6.1.3";
-  sha256 = "0vly55dpqrm9vb8ayp72na1nf2rr5ini3d81qqvxflmjgpksrgwq";
+  version = "0.7.1";
+  sha256 = "10s7mxygw6w8a8mx090msvbl8pji8m68lsxxyr5bp7p887naia7r";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [
-    attoparsec attoparsecEnumerator enumerator mtl text
-  ];
+  buildDepends = [ cereal mtl text ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-asn1-data";
-    description = "ASN1 data reader and writer in RAW, BER, DER and CER forms";
+    description = "ASN1 data reader and writer in RAW, BER and DER forms";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/asn1-types/default.nix b/pkgs/development/libraries/haskell/asn1-types/default.nix
new file mode 100644
index 00000000000..a50ee82a38d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/asn1-types/default.nix
@@ -0,0 +1,14 @@
+{ cabal, time }:
+
+cabal.mkDerivation (self: {
+  pname = "asn1-types";
+  version = "0.2.0";
+  sha256 = "0350g5p3zbvm29nnjd554i6fyc47vmzpb42w6q46v3i9fiy23kvd";
+  buildDepends = [ time ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-asn1-types";
+    description = "ASN.1 types";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/async/default.nix b/pkgs/development/libraries/haskell/async/2.0.1.3.nix
index 499dc394ece..1b943208dea 100644
--- a/pkgs/development/libraries/haskell/async/default.nix
+++ b/pkgs/development/libraries/haskell/async/2.0.1.3.nix
@@ -1,10 +1,11 @@
-{ cabal, stm }:
+{ cabal, HUnit, stm, testFramework, testFrameworkHunit }:
 
 cabal.mkDerivation (self: {
   pname = "async";
-  version = "2.0.1.2";
-  sha256 = "03mmrs1xrw91pv9xpas8acxvrh4j6bq5l24bqk4vmaq2pdy9snn3";
+  version = "2.0.1.3";
+  sha256 = "1rbjr6xw5sp8npw17fxg0942kikssv2hyci2sy26r0na98483mkh";
   buildDepends = [ stm ];
+  testDepends = [ HUnit testFramework testFrameworkHunit ];
   meta = {
     homepage = "https://github.com/simonmar/async";
     description = "Run IO operations asynchronously and wait for their results";
diff --git a/pkgs/development/libraries/haskell/async/2.0.1.4.nix b/pkgs/development/libraries/haskell/async/2.0.1.4.nix
new file mode 100644
index 00000000000..5dd76b4d6e0
--- /dev/null
+++ b/pkgs/development/libraries/haskell/async/2.0.1.4.nix
@@ -0,0 +1,16 @@
+{ cabal, HUnit, stm, testFramework, testFrameworkHunit }:
+
+cabal.mkDerivation (self: {
+  pname = "async";
+  version = "2.0.1.4";
+  sha256 = "1hi40bjwpl65mz7zj0sgh16bp9dwafbm5ysi2q8fzwwq5l0zxpa1";
+  buildDepends = [ stm ];
+  testDepends = [ HUnit testFramework testFrameworkHunit ];
+  meta = {
+    homepage = "https://github.com/simonmar/async";
+    description = "Run IO operations asynchronously and wait for their results";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/atomic-primops/default.nix b/pkgs/development/libraries/haskell/atomic-primops/default.nix
new file mode 100644
index 00000000000..4b37ea84d58
--- /dev/null
+++ b/pkgs/development/libraries/haskell/atomic-primops/default.nix
@@ -0,0 +1,14 @@
+{ cabal, Cabal, primitive }:
+
+cabal.mkDerivation (self: {
+  pname = "atomic-primops";
+  version = "0.1.0.2";
+  sha256 = "1qjm97hi2wr658yk7f5cfppizaawmrkvs2q7qzq00h14fr71xxca";
+  buildDepends = [ Cabal primitive ];
+  meta = {
+    homepage = "https://github.com/rrnewton/haskell-lockfree-queue/wiki";
+    description = "A safe approach to CAS and other atomic ops in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/attoparsec-binary/default.nix b/pkgs/development/libraries/haskell/attoparsec-binary/default.nix
new file mode 100644
index 00000000000..623ae104090
--- /dev/null
+++ b/pkgs/development/libraries/haskell/attoparsec-binary/default.nix
@@ -0,0 +1,13 @@
+{ cabal, attoparsec }:
+
+cabal.mkDerivation (self: {
+  pname = "attoparsec-binary";
+  version = "0.2";
+  sha256 = "02vswxsgayw50xli7mbacsjmk1diifzkfgnyfn9ck5mk41dl9rh5";
+  buildDepends = [ attoparsec ];
+  meta = {
+    description = "Binary processing extensions to Attoparsec";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/attoparsec-conduit/default.nix b/pkgs/development/libraries/haskell/attoparsec-conduit/default.nix
index db4ebc6799d..663a91b0c30 100644
--- a/pkgs/development/libraries/haskell/attoparsec-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/attoparsec-conduit/default.nix
@@ -1,10 +1,12 @@
-{ cabal, attoparsec, conduit, text, transformers }:
+{ cabal, attoparsec, conduit, hspec, resourcet, text, transformers
+}:
 
 cabal.mkDerivation (self: {
   pname = "attoparsec-conduit";
-  version = "0.5.0";
-  sha256 = "17l98kbv2pxcchacy7r4ja0czdklc7r4j8vzv3pi0pjb2s9ih6sq";
+  version = "1.0.1";
+  sha256 = "14b6ym5sjvg1x82ijydhrjk5445kg0fvwqzqwqld59akbqb6fpg5";
   buildDepends = [ attoparsec conduit text transformers ];
+  testDepends = [ attoparsec conduit hspec resourcet text ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Consume attoparsec parsers via conduit";
diff --git a/pkgs/development/libraries/haskell/attoparsec/enumerator.nix b/pkgs/development/libraries/haskell/attoparsec-enumerator/default.nix
index d52687d8080..d52687d8080 100644
--- a/pkgs/development/libraries/haskell/attoparsec/enumerator.nix
+++ b/pkgs/development/libraries/haskell/attoparsec-enumerator/default.nix
diff --git a/pkgs/development/libraries/haskell/attoparsec/0.10.4.0.nix b/pkgs/development/libraries/haskell/attoparsec/0.10.4.0.nix
new file mode 100644
index 00000000000..c352ce7ca8e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/attoparsec/0.10.4.0.nix
@@ -0,0 +1,20 @@
+{ cabal, deepseq, QuickCheck, testFramework
+, testFrameworkQuickcheck2, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "attoparsec";
+  version = "0.10.4.0";
+  sha256 = "0inkcrl40j9kgcmmi0xkcszayqjd5yn7i9fyvv0ywfqwpl6lxf5n";
+  buildDepends = [ deepseq text ];
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2 text
+  ];
+  meta = {
+    homepage = "https://github.com/bos/attoparsec";
+    description = "Fast combinator parsing for bytestrings and text";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/attoparsec/default.nix b/pkgs/development/libraries/haskell/attoparsec/default.nix
deleted file mode 100644
index 6f923605b67..00000000000
--- a/pkgs/development/libraries/haskell/attoparsec/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ cabal, deepseq, text }:
-
-cabal.mkDerivation (self: {
-  pname = "attoparsec";
-  version = "0.10.2.0";
-  sha256 = "0hvkx63knhxdc06lkv2avz2dblbvn0hhvckfqyr22ls1qrpgz71c";
-  buildDepends = [ deepseq text ];
-  meta = {
-    homepage = "https://github.com/bos/attoparsec";
-    description = "Fast combinator parsing for bytestrings";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/authenticate-oauth/default.nix b/pkgs/development/libraries/haskell/authenticate-oauth/default.nix
new file mode 100644
index 00000000000..c21d6eddbee
--- /dev/null
+++ b/pkgs/development/libraries/haskell/authenticate-oauth/default.nix
@@ -0,0 +1,21 @@
+{ cabal, base64Bytestring, blazeBuilder, blazeBuilderConduit
+, conduit, cryptoPubkeyTypes, dataDefault, httpConduit, httpTypes
+, monadControl, random, resourcet, RSA, SHA, time, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "authenticate-oauth";
+  version = "1.4.0.6";
+  sha256 = "1ylfvc744wqyn5xbv6fivfys5kk9k9r2b9xf63zfzj5l5yqmv91a";
+  buildDepends = [
+    base64Bytestring blazeBuilder blazeBuilderConduit conduit
+    cryptoPubkeyTypes dataDefault httpConduit httpTypes monadControl
+    random resourcet RSA SHA time transformers
+  ];
+  meta = {
+    homepage = "http://github.com/yesodweb/authenticate";
+    description = "Library to authenticate with OAuth for Haskell web applications";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/authenticate/default.nix b/pkgs/development/libraries/haskell/authenticate/default.nix
index dc0ce313eff..f0a1969ffba 100644
--- a/pkgs/development/libraries/haskell/authenticate/default.nix
+++ b/pkgs/development/libraries/haskell/authenticate/default.nix
@@ -1,17 +1,16 @@
-{ cabal, aeson, attoparsec, blazeBuilder, blazeBuilderConduit
-, caseInsensitive, conduit, httpConduit, httpTypes, monadControl
-, network, resourcet, tagsoup, text, transformers
+{ cabal, aeson, attoparsec, blazeBuilder, caseInsensitive, conduit
+, httpConduit, httpTypes, network, tagsoup, text, transformers
 , unorderedContainers, xmlConduit
 }:
 
 cabal.mkDerivation (self: {
   pname = "authenticate";
-  version = "1.3.1";
-  sha256 = "1ad3vzfa7nvp8h8wk5370d2qyri0nywq1wjdvqas2mg4iv7v7271";
+  version = "1.3.2.6";
+  sha256 = "12sgi6q6kajjhh8mns9nklxj0kwn32xs5kzi7wmw50shx0smnjrz";
   buildDepends = [
-    aeson attoparsec blazeBuilder blazeBuilderConduit caseInsensitive
-    conduit httpConduit httpTypes monadControl network resourcet
-    tagsoup text transformers unorderedContainers xmlConduit
+    aeson attoparsec blazeBuilder caseInsensitive conduit httpConduit
+    httpTypes network tagsoup text transformers unorderedContainers
+    xmlConduit
   ];
   meta = {
     homepage = "http://github.com/yesodweb/authenticate";
diff --git a/pkgs/development/libraries/haskell/base-compat/default.nix b/pkgs/development/libraries/haskell/base-compat/default.nix
new file mode 100644
index 00000000000..ca208b7c1a3
--- /dev/null
+++ b/pkgs/development/libraries/haskell/base-compat/default.nix
@@ -0,0 +1,13 @@
+{ cabal, hspec, setenv }:
+
+cabal.mkDerivation (self: {
+  pname = "base-compat";
+  version = "0.2.1";
+  sha256 = "1yssx3nww89dmkw8i55bp1vinbczbxhhh0kh4f3b9fyw5ylnai43";
+  testDepends = [ hspec setenv ];
+  meta = {
+    description = "A compatibility layer for base";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/base64-bytestring/default.nix b/pkgs/development/libraries/haskell/base64-bytestring/default.nix
index 5fd552d6272..67450dc8887 100644
--- a/pkgs/development/libraries/haskell/base64-bytestring/default.nix
+++ b/pkgs/development/libraries/haskell/base64-bytestring/default.nix
@@ -1,12 +1,18 @@
-{ cabal }:
+{ cabal, HUnit, QuickCheck, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "base64-bytestring";
-  version = "0.1.2.0";
-  sha256 = "039naasb3z8q42zl067paylxb9i1m1pkp4w6b5yqsc38sbmikv1z";
+  version = "1.0.0.1";
+  sha256 = "0l1v4ddjdsgi9nqzyzcxxj76rwar3lzx8gmwf2r54bqan3san9db";
+  testDepends = [
+    HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "https://github.com/bos/base64-bytestring";
-    description = "Fast base64 encoding and deconding for ByteStrings";
+    description = "Fast base64 encoding and decoding for ByteStrings";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/base64-conduit/default.nix b/pkgs/development/libraries/haskell/base64-conduit/default.nix
new file mode 100644
index 00000000000..3a2d044de64
--- /dev/null
+++ b/pkgs/development/libraries/haskell/base64-conduit/default.nix
@@ -0,0 +1,18 @@
+{ cabal, base64Bytestring, conduit, hspec, QuickCheck, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "base64-conduit";
+  version = "1.0.0";
+  sha256 = "10wjgdixk5da48jpm2i91vy3ckdqpbpgba6hzn7ak6d3qac22m9q";
+  buildDepends = [ base64Bytestring conduit ];
+  testDepends = [
+    base64Bytestring conduit hspec QuickCheck transformers
+  ];
+  meta = {
+    homepage = "http://github.com/snoyberg/conduit";
+    description = "Base64-encode and decode streams of bytes";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/basic-prelude/default.nix b/pkgs/development/libraries/haskell/basic-prelude/default.nix
new file mode 100644
index 00000000000..cdf929d8027
--- /dev/null
+++ b/pkgs/development/libraries/haskell/basic-prelude/default.nix
@@ -0,0 +1,19 @@
+{ cabal, hashable, liftedBase, ReadArgs, systemFilepath, text
+, transformers, unorderedContainers, vector
+}:
+
+cabal.mkDerivation (self: {
+  pname = "basic-prelude";
+  version = "0.3.5.0";
+  sha256 = "1nrfibvvh5vzzr2jz5hipsj29b7ml6d90ijlr917n9aq200w14ar";
+  buildDepends = [
+    hashable liftedBase ReadArgs systemFilepath text transformers
+    unorderedContainers vector
+  ];
+  meta = {
+    homepage = "https://github.com/snoyberg/basic-prelude";
+    description = "An enhanced core prelude; a common foundation for alternate preludes";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/benchpress/default.nix b/pkgs/development/libraries/haskell/benchpress/default.nix
index c80f04f966d..9218e50b767 100644
--- a/pkgs/development/libraries/haskell/benchpress/default.nix
+++ b/pkgs/development/libraries/haskell/benchpress/default.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.2.2.6";
   sha256 = "19ygaf2g4yqkfbc6bw6fmf9jsymbj1iallzvl0zw3vjx860rchfg";
   buildDepends = [ mtl time ];
+  jailbreak = true;
   meta = {
     homepage = "http://github.com/tibbe/benchpress";
     description = "Micro-benchmarking with detailed statistics";
diff --git a/pkgs/development/libraries/haskell/bifunctors/default.nix b/pkgs/development/libraries/haskell/bifunctors/default.nix
new file mode 100644
index 00000000000..c659c3bc3be
--- /dev/null
+++ b/pkgs/development/libraries/haskell/bifunctors/default.nix
@@ -0,0 +1,14 @@
+{ cabal, semigroupoids, semigroups, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "bifunctors";
+  version = "3.2.0.1";
+  sha256 = "1biicx0zi48wzzi7vkhzvrdyk59hmmm1bqbsga6x5nbrbf3qrkm6";
+  buildDepends = [ semigroupoids semigroups tagged ];
+  meta = {
+    homepage = "http://github.com/ekmett/bifunctors/";
+    description = "Haskell 98 bifunctors";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/binary-shared/default.nix b/pkgs/development/libraries/haskell/binary-shared/default.nix
index 6d70e384c38..4033565684d 100644
--- a/pkgs/development/libraries/haskell/binary-shared/default.nix
+++ b/pkgs/development/libraries/haskell/binary-shared/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "binary-shared";
-  version = "0.8.2";
-  sha256 = "05cqdpclb4xc6ydwdpxfi3bvaaw7syxlmb5r9kxjcp3f6fji5rm2";
+  version = "0.8.3";
+  sha256 = "1clqq0rqjw1v7y6glkjnfyga5gxh768flyw617g47z0qa181c0c3";
   buildDepends = [ binary mtl ];
   meta = {
     homepage = "http://www.leksah.org";
diff --git a/pkgs/development/libraries/haskell/binary/default.nix b/pkgs/development/libraries/haskell/binary/default.nix
index a8fefba0274..245c80ef1cc 100644
--- a/pkgs/development/libraries/haskell/binary/default.nix
+++ b/pkgs/development/libraries/haskell/binary/default.nix
@@ -1,11 +1,17 @@
-{ cabal }:
+{ cabal, Cabal, filepath, HUnit, QuickCheck, random, testFramework
+, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "binary";
-  version = "0.5.1.1";
-  sha256 = "0s62a92a2wwp8hdmkc6j6i9lh5mi6z1yd26fbhsbbm8bxah64pcl";
+  version = "0.7.1.0";
+  sha256 = "16cb94z57ijw0q3h5p8jbvrv1vmnchsfjhrzvh3gdm3wf75fy8ln";
+  testDepends = [
+    Cabal filepath HUnit QuickCheck random testFramework
+    testFrameworkQuickcheck2
+  ];
   meta = {
-    homepage = "http://code.haskell.org/binary/";
+    homepage = "https://github.com/kolmodin/binary";
     description = "Binary serialisation for Haskell values using lazy ByteStrings";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix b/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
index db3e1e8a71f..16c352b7a33 100644
--- a/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-builder-conduit/default.nix
@@ -1,10 +1,15 @@
-{ cabal, blazeBuilder, conduit, text, transformers }:
+{ cabal, blazeBuilder, conduit, hspec, QuickCheck, text
+, transformers
+}:
 
 cabal.mkDerivation (self: {
   pname = "blaze-builder-conduit";
-  version = "0.5.0";
-  sha256 = "1saviq46670khz3pcw2ldvbhhgqs522lvbpm62mxjfvrynjw1gwg";
+  version = "1.0.0";
+  sha256 = "15q0b0k5dxrp9cw2b4qf9mmjwz1mmxrn3890df5rc9z6yajajrc6";
   buildDepends = [ blazeBuilder conduit text transformers ];
+  testDepends = [
+    blazeBuilder conduit hspec QuickCheck transformers
+  ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Convert streams of builders to streams of bytestrings";
diff --git a/pkgs/development/libraries/haskell/blaze-builder/default.nix b/pkgs/development/libraries/haskell/blaze-builder/default.nix
index aa4eb4c5357..816537b1ab6 100644
--- a/pkgs/development/libraries/haskell/blaze-builder/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-builder/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "blaze-builder";
-  version = "0.3.1.0";
-  sha256 = "192pqmr6mcjnflqpvp93nycfbdi0ifab8ifvrxvmwbrdkiidvai6";
+  version = "0.3.1.1";
+  sha256 = "1pnw5kjpyxf3mh72cb9a0f1qwpq3a2bkgqp1j3ny8l6nmzw0c9d1";
   buildDepends = [ text ];
   meta = {
     homepage = "http://github.com/meiersi/blaze-builder";
diff --git a/pkgs/development/libraries/haskell/blaze-html/default.nix b/pkgs/development/libraries/haskell/blaze-html/default.nix
index c8b2eb06a32..ec21e3fcd84 100644
--- a/pkgs/development/libraries/haskell/blaze-html/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-html/default.nix
@@ -1,10 +1,16 @@
-{ cabal, blazeBuilder, blazeMarkup, text }:
+{ cabal, blazeBuilder, blazeMarkup, HUnit, QuickCheck
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "blaze-html";
-  version = "0.5.0.0";
-  sha256 = "0cfvdf50jbm6w277jf69ac57nbkgkn2ifcp6r2amd3qdbmdgqkwj";
+  version = "0.6.1.1";
+  sha256 = "08zfmkvahmm613r0nrabwl5zv9ragcrhdqsa8jfdrfdkrf6ckbrc";
   buildDepends = [ blazeBuilder blazeMarkup text ];
+  testDepends = [
+    blazeBuilder blazeMarkup HUnit QuickCheck testFramework
+    testFrameworkHunit testFrameworkQuickcheck2 text
+  ];
   meta = {
     homepage = "http://jaspervdj.be/blaze";
     description = "A blazingly fast HTML combinator library for Haskell";
diff --git a/pkgs/development/libraries/haskell/blaze-markup/default.nix b/pkgs/development/libraries/haskell/blaze-markup/default.nix
index 7a5adbf1079..0c544119d5f 100644
--- a/pkgs/development/libraries/haskell/blaze-markup/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-markup/default.nix
@@ -1,10 +1,16 @@
-{ cabal, blazeBuilder, text }:
+{ cabal, blazeBuilder, HUnit, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "blaze-markup";
-  version = "0.5.1.0";
-  sha256 = "0vq0xzwa13sjybg6zdi3ynsn6yxyl1q6rbalvb9r6f3plrmik37a";
+  version = "0.5.1.5";
+  sha256 = "0g3smm1ym7h45bkzx94b77ssyg0z0gqfwbnap3ywa2381rb39l74";
   buildDepends = [ blazeBuilder text ];
+  testDepends = [
+    blazeBuilder HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 text
+  ];
   meta = {
     homepage = "http://jaspervdj.be/blaze";
     description = "A blazingly fast markup combinator library for Haskell";
diff --git a/pkgs/development/libraries/haskell/blaze-svg/default.nix b/pkgs/development/libraries/haskell/blaze-svg/default.nix
new file mode 100644
index 00000000000..7b3ec55dc57
--- /dev/null
+++ b/pkgs/development/libraries/haskell/blaze-svg/default.nix
@@ -0,0 +1,14 @@
+{ cabal, blazeMarkup, mtl }:
+
+cabal.mkDerivation (self: {
+  pname = "blaze-svg";
+  version = "0.3.3.0";
+  sha256 = "1wi4nc73ic3qmbx6v9fniacwcz2nlvmp5snn144fdiwb22klfn5f";
+  buildDepends = [ blazeMarkup mtl ];
+  meta = {
+    homepage = "https://github.com/deepakjois/blaze-svg";
+    description = "SVG combinator library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/blaze-textual/default.nix b/pkgs/development/libraries/haskell/blaze-textual/default.nix
index f673f708707..ede82e5c2ed 100644
--- a/pkgs/development/libraries/haskell/blaze-textual/default.nix
+++ b/pkgs/development/libraries/haskell/blaze-textual/default.nix
@@ -1,10 +1,16 @@
-{ cabal, blazeBuilder, text, time, vector }:
+{ cabal, blazeBuilder, doubleConversion, QuickCheck, testFramework
+, testFrameworkQuickcheck2, text, time, vector
+}:
 
 cabal.mkDerivation (self: {
   pname = "blaze-textual";
-  version = "0.2.0.6";
-  sha256 = "1699fj9zig6ids9bdjn5v0gqhnyx5dkzi542gkx1gs8943c94737";
+  version = "0.2.0.8";
+  sha256 = "0zzqh53ywzz8ss58glp3i8is8gry5yqzvdjw4xh95fbbzcz4cgc7";
   buildDepends = [ blazeBuilder text time vector ];
+  testDepends = [
+    blazeBuilder doubleConversion QuickCheck testFramework
+    testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://github.com/bos/blaze-textual";
     description = "Fast rendering of common datatypes";
diff --git a/pkgs/development/libraries/haskell/bloomfilter/default.nix b/pkgs/development/libraries/haskell/bloomfilter/default.nix
index 2545c3f4f40..7c8c2d34849 100644
--- a/pkgs/development/libraries/haskell/bloomfilter/default.nix
+++ b/pkgs/development/libraries/haskell/bloomfilter/default.nix
@@ -3,7 +3,7 @@
 cabal.mkDerivation (self: {
   pname = "bloomfilter";
   version = "1.2.6.10";
-  sha256 = "1z2jc7588fkv42dxf0dxsrgk5pmj3xapshy1vyfwipp1q6y20x4j";
+  sha256 = "162vp9riwf5q2l1hnw3g157fpwnw185fk41hkgyf8qaavcrz6slv";
   buildDepends = [ deepseq ];
   meta = {
     homepage = "https://github.com/bos/bloomfilter";
diff --git a/pkgs/development/libraries/haskell/bmp/default.nix b/pkgs/development/libraries/haskell/bmp/1.2.2.1.nix
index 705b462a6d5..e018ac7a8d2 100644
--- a/pkgs/development/libraries/haskell/bmp/default.nix
+++ b/pkgs/development/libraries/haskell/bmp/1.2.2.1.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "bmp";
-  version = "1.2.1.1";
-  sha256 = "0s5srqkaccrwh9gsxn9kmyh4jf0qf40ix8ipi0b70fbbffr97hmk";
+  version = "1.2.2.1";
+  sha256 = "0yxkkvpgavk9im9i9f6zpzc1n5nj2g4qsk4ck51aqz2fv6z1rhiy";
   buildDepends = [ binary ];
   meta = {
     homepage = "http://code.ouroborus.net/bmp";
diff --git a/pkgs/development/libraries/haskell/bmp/1.2.5.2.nix b/pkgs/development/libraries/haskell/bmp/1.2.5.2.nix
new file mode 100644
index 00000000000..6c85c9349c9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/bmp/1.2.5.2.nix
@@ -0,0 +1,16 @@
+{ cabal, binary }:
+
+cabal.mkDerivation (self: {
+  pname = "bmp";
+  version = "1.2.5.2";
+  sha256 = "0f88f2ynm1fpzbjijy5fa8blfrdv42h5h28hfjlpd4fp0h96in5x";
+  buildDepends = [ binary ];
+  jailbreak = true;
+  meta = {
+    homepage = "http://code.ouroborus.net/bmp";
+    description = "Read and write uncompressed BMP image files";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/boomerang/default.nix b/pkgs/development/libraries/haskell/boomerang/default.nix
new file mode 100644
index 00000000000..963448a56e7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/boomerang/default.nix
@@ -0,0 +1,13 @@
+{ cabal, mtl, text }:
+
+cabal.mkDerivation (self: {
+  pname = "boomerang";
+  version = "1.3.3";
+  sha256 = "1i44j3qyjkq69h65wfsrps5zp097i3nh9fwcb2f1spr8nznb5mff";
+  buildDepends = [ mtl text ];
+  meta = {
+    description = "Library for invertible parsing and printing";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/bson/default.nix b/pkgs/development/libraries/haskell/bson/default.nix
index 20107eb1784..e572e366bdd 100644
--- a/pkgs/development/libraries/haskell/bson/default.nix
+++ b/pkgs/development/libraries/haskell/bson/default.nix
@@ -1,14 +1,19 @@
-{ cabal, binary, cryptohash, dataBinaryIeee754, mtl, network, text
-, time
+{ cabal, binary, cryptohash, dataBinaryIeee754, mtl, network
+, QuickCheck, testFramework, testFrameworkQuickcheck2, text, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "bson";
-  version = "0.2.1";
-  sha256 = "1g5xvkpn5j2yn9figxiv5dindwv6gg90np56k235hy9cwmdicmwq";
+  version = "0.2.2";
+  sha256 = "043lbaj4rrvh4a1yc033np51vi8xlbczflbhyx2bsiryzbi27waf";
   buildDepends = [
     binary cryptohash dataBinaryIeee754 mtl network text time
   ];
+  testDepends = [
+    binary cryptohash dataBinaryIeee754 mtl network QuickCheck
+    testFramework testFrameworkQuickcheck2 text time
+  ];
+  doCheck = false;
   meta = {
     homepage = "http://github.com/selectel/bson-haskell";
     description = "BSON documents are JSON-like objects with a standard binary encoding";
diff --git a/pkgs/development/libraries/haskell/byteorder/default.nix b/pkgs/development/libraries/haskell/byteorder/default.nix
index bdbad6f5e63..86de1da9328 100644
--- a/pkgs/development/libraries/haskell/byteorder/default.nix
+++ b/pkgs/development/libraries/haskell/byteorder/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "byteorder";
-  version = "1.0.3";
-  sha256 = "056jb47r4pkimi6z2z49prnsmjnhnijk57zm0divl1k55igi5way";
+  version = "1.0.4";
+  sha256 = "06995paxbxk8lldvarqpb3ygcjbg4v8dk4scib1rjzwlhssvn85x";
   meta = {
     homepage = "http://community.haskell.org/~aslatter/code/byteorder";
     description = "Exposes the native endianness or byte ordering of the system";
diff --git a/pkgs/development/libraries/haskell/bytestring-lexing/default.nix b/pkgs/development/libraries/haskell/bytestring-lexing/default.nix
index 2de7eec8eb5..93c8b2aa229 100644
--- a/pkgs/development/libraries/haskell/bytestring-lexing/default.nix
+++ b/pkgs/development/libraries/haskell/bytestring-lexing/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "bytestring-lexing";
-  version = "0.4.0";
-  sha256 = "1lww38rab9k8drndqkg306kiq6663i89sq6l1bvjv6cs13acc8wr";
+  version = "0.4.3";
+  sha256 = "0dynfrf8ym01v2dl57422h8r75kdlqh2qzqi9yc0f1bmbfqxap6r";
   buildTools = [ alex ];
   meta = {
     homepage = "http://code.haskell.org/~wren/";
diff --git a/pkgs/development/libraries/haskell/bytestring-nums/default.nix b/pkgs/development/libraries/haskell/bytestring-nums/default.nix
index 9659bea3f77..e78a6478151 100644
--- a/pkgs/development/libraries/haskell/bytestring-nums/default.nix
+++ b/pkgs/development/libraries/haskell/bytestring-nums/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "bytestring-nums";
-  version = "0.3.5";
-  sha256 = "12knbyrvr1wa7za8bwypvq3cp81k18qi032dl98s2ylhcz1r6rdk";
+  version = "0.3.6";
+  sha256 = "1kg777gpqj05h5bj0637yky64bdx7x77hm7nq2rhpw4i1mh9gjmx";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/bytestring-progress/default.nix b/pkgs/development/libraries/haskell/bytestring-progress/default.nix
new file mode 100644
index 00000000000..e9bb268b9fc
--- /dev/null
+++ b/pkgs/development/libraries/haskell/bytestring-progress/default.nix
@@ -0,0 +1,15 @@
+{ cabal, terminalProgressBar, time }:
+
+cabal.mkDerivation (self: {
+  pname = "bytestring-progress";
+  version = "1.0.3";
+  sha256 = "1v9cl7d4fcchbdrpbgjj4ilg79cj241vzijiifdsgkq30ikv2yxs";
+  buildDepends = [ terminalProgressBar time ];
+  noHaddock = true;
+  meta = {
+    homepage = "http://github.com/acw/bytestring-progress";
+    description = "A library for tracking the consumption of a lazy ByteString";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/c2hs/default.nix b/pkgs/development/libraries/haskell/c2hs/default.nix
index d717174902b..6ad4db61cfd 100644
--- a/pkgs/development/libraries/haskell/c2hs/default.nix
+++ b/pkgs/development/libraries/haskell/c2hs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "c2hs";
-  version = "0.16.3";
-  sha256 = "1qqsxfdkf5sfj3mvk265dbng3br9w633y8v1piajqaidki7vwqm5";
+  version = "0.16.4";
+  sha256 = "0m8mzc19cgaqsi1skqimk22770xddxx0j024mgp76hl8vqc5rcgi";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ filepath languageC ];
diff --git a/pkgs/development/libraries/haskell/cabal-file-th/default.nix b/pkgs/development/libraries/haskell/cabal-file-th/default.nix
index c57e46cb8bb..55b4fea36fe 100644
--- a/pkgs/development/libraries/haskell/cabal-file-th/default.nix
+++ b/pkgs/development/libraries/haskell/cabal-file-th/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cabal-file-th";
-  version = "0.2.2";
-  sha256 = "1ql2gmg3mdfkmnk1m3966npr6l1in15fzlkbn7dr1cp4s90igqhy";
+  version = "0.2.3";
+  sha256 = "0kawvb5n56rkq4453l6pia3wrr6jvvdwkghi6i176n1gm2zf2ri8";
   buildDepends = [ Cabal ];
   meta = {
     homepage = "http://github.com/nkpart/cabal-file-th";
diff --git a/pkgs/development/libraries/haskell/cairo/default.nix b/pkgs/development/libraries/haskell/cairo/default.nix
index 183e0815f71..59126959bfb 100644
--- a/pkgs/development/libraries/haskell/cairo/default.nix
+++ b/pkgs/development/libraries/haskell/cairo/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cairo";
-  version = "0.12.3.1";
-  sha256 = "173pql0n51a9z46vzpwd9q67nblhb61qirynjra9vzydiy79bfwi";
+  version = "0.12.4";
+  sha256 = "0gy6nxhxam3yv0caj4psg9dd1a5yazh616fjbmjfh0kbk8vl6fbq";
   buildDepends = [ mtl ];
   buildTools = [ gtk2hsBuildtools ];
   extraLibraries = [ cairo libc pkgconfig zlib ];
diff --git a/pkgs/development/libraries/haskell/carray/default.nix b/pkgs/development/libraries/haskell/carray/default.nix
new file mode 100644
index 00000000000..7fa22dfa2eb
--- /dev/null
+++ b/pkgs/development/libraries/haskell/carray/default.nix
@@ -0,0 +1,13 @@
+{ cabal, binary, ixShapable, syb }:
+
+cabal.mkDerivation (self: {
+  pname = "carray";
+  version = "0.1.5.2";
+  sha256 = "0kjqxjnamhnpjjf2bgm1gnsy6jx1fjbn5mx394pyx1vq3lkfgfb0";
+  buildDepends = [ binary ixShapable syb ];
+  meta = {
+    description = "A C-compatible array library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/case-insensitive/default.nix b/pkgs/development/libraries/haskell/case-insensitive/1.0.0.1.nix
index 7f53773f1ab..b5fe61c13cb 100644
--- a/pkgs/development/libraries/haskell/case-insensitive/default.nix
+++ b/pkgs/development/libraries/haskell/case-insensitive/1.0.0.1.nix
@@ -1,15 +1,17 @@
-{ cabal, hashable, text }:
+{ cabal, deepseq, hashable, HUnit, testFramework
+, testFrameworkHunit, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "case-insensitive";
-  version = "0.4.0.3";
-  sha256 = "1lpfxfwfxiimvh5nxqrnjqj2687dp7rmv9wkrpmw2zm5wkxwcmzf";
-  buildDepends = [ hashable text ];
+  version = "1.0.0.1";
+  sha256 = "1yp8895qvxcmai0hvxdq77qss9cia2f9fyn6rm0hln3rcx8n53xm";
+  buildDepends = [ deepseq hashable text ];
+  testDepends = [ HUnit testFramework testFrameworkHunit text ];
   meta = {
     homepage = "https://github.com/basvandijk/case-insensitive";
     description = "Case insensitive string comparison";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/case-insensitive/1.0.0.2.nix b/pkgs/development/libraries/haskell/case-insensitive/1.0.0.2.nix
new file mode 100644
index 00000000000..083fa7df370
--- /dev/null
+++ b/pkgs/development/libraries/haskell/case-insensitive/1.0.0.2.nix
@@ -0,0 +1,17 @@
+{ cabal, deepseq, hashable, HUnit, testFramework
+, testFrameworkHunit, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "case-insensitive";
+  version = "1.0.0.2";
+  sha256 = "11cczwg11y6pfsidj1i052rhri98sgg2qzf0ixgjq1gywakjx5f2";
+  buildDepends = [ deepseq hashable text ];
+  testDepends = [ HUnit testFramework testFrameworkHunit text ];
+  meta = {
+    homepage = "https://github.com/basvandijk/case-insensitive";
+    description = "Case insensitive string comparison";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cautious-file/default.nix b/pkgs/development/libraries/haskell/cautious-file/default.nix
index bbdb6d350c8..44ed255bb63 100644
--- a/pkgs/development/libraries/haskell/cautious-file/default.nix
+++ b/pkgs/development/libraries/haskell/cautious-file/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "cautious-file";
-  version = "1.0.1";
-  sha256 = "0mlgchvdhw9lhml4pqmxxvx1zcqmkcyl3yx6w3zp0df200njzsws";
+  version = "1.0.2";
+  sha256 = "1sw5ngwrarq1lsd4c6v2wdmgbhkkq6kpybb62r8ccm11ddgn3yiq";
   buildDepends = [ filepath ];
+  doCheck = false;
   meta = {
     description = "Ways to write a file cautiously, to reduce the chances of problems such as data loss due to crashes or power failures";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/cereal-conduit/default.nix b/pkgs/development/libraries/haskell/cereal-conduit/default.nix
new file mode 100644
index 00000000000..464e8dbb5e7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cereal-conduit/default.nix
@@ -0,0 +1,15 @@
+{ cabal, cereal, conduit, HUnit, mtl, resourcet, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "cereal-conduit";
+  version = "0.7";
+  sha256 = "0cf0lp47qiilrdrzmn58hwh3q7fh7g55f2a1r1bw31xapp1cvbix";
+  buildDepends = [ cereal conduit transformers ];
+  testDepends = [ cereal conduit HUnit mtl resourcet transformers ];
+  meta = {
+    homepage = "https://github.com/litherum/cereal-conduit";
+    description = "Turn Data.Serialize Gets and Puts into Sources, Sinks, and Conduits";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/certificate/default.nix b/pkgs/development/libraries/haskell/certificate/default.nix
index 6581ddf0e1a..db314a12296 100644
--- a/pkgs/development/libraries/haskell/certificate/default.nix
+++ b/pkgs/development/libraries/haskell/certificate/default.nix
@@ -1,12 +1,16 @@
-{ cabal, asn1Data, cryptoPubkeyTypes, mtl, pem, time }:
+{ cabal, asn1Data, cryptohash, cryptoPubkeyTypes, filepath, mtl
+, pem, time
+}:
 
 cabal.mkDerivation (self: {
   pname = "certificate";
-  version = "1.2.5";
-  sha256 = "1zxi1hflq973m7a1c9wvxdx8aqapx1kqy8j7nn7k67l9gpjb1jbc";
+  version = "1.3.8";
+  sha256 = "1id3jfaisl04n1mjj9lbq3gyz8hyn3r9p9chzmfbra0pcj3vf1m0";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ asn1Data cryptoPubkeyTypes mtl pem time ];
+  buildDepends = [
+    asn1Data cryptohash cryptoPubkeyTypes filepath mtl pem time
+  ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-certificate";
     description = "Certificates and Key Reader/Writer";
diff --git a/pkgs/development/libraries/haskell/cgi/3001.1.7.5.nix b/pkgs/development/libraries/haskell/cgi/3001.1.7.5.nix
new file mode 100644
index 00000000000..284c1ee2c05
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cgi/3001.1.7.5.nix
@@ -0,0 +1,14 @@
+{ cabal, mtl, network, parsec, xhtml }:
+
+cabal.mkDerivation (self: {
+  pname = "cgi";
+  version = "3001.1.7.5";
+  sha256 = "1zdgdzkrzclf492pb9px5a490mxfxl5c1099axcxxm9wlpmf49ji";
+  buildDepends = [ mtl network parsec xhtml ];
+  meta = {
+    homepage = "http://andersk.mit.edu/haskell/cgi/";
+    description = "A library for writing CGI programs";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cgi/3001.1.8.2.nix b/pkgs/development/libraries/haskell/cgi/3001.1.8.4.nix
index d77bd227f8b..d2d89918086 100644
--- a/pkgs/development/libraries/haskell/cgi/3001.1.8.2.nix
+++ b/pkgs/development/libraries/haskell/cgi/3001.1.8.4.nix
@@ -1,14 +1,10 @@
-{ cabal, extensibleExceptions, MonadCatchIOMtl, mtl, network
-, parsec, xhtml
-}:
+{ cabal, MonadCatchIOMtl, mtl, network, parsec, xhtml }:
 
 cabal.mkDerivation (self: {
   pname = "cgi";
-  version = "3001.1.8.2";
-  sha256 = "09ly7bn5ck563jq1wip5w628g74xj4p1ha9rllfdck33pqrl2mgz";
-  buildDepends = [
-    extensibleExceptions MonadCatchIOMtl mtl network parsec xhtml
-  ];
+  version = "3001.1.8.4";
+  sha256 = "1h0ynrrda18g5pn1sw2n94rhhp3k39nb7wmx53b52dhxkp2izlgn";
+  buildDepends = [ MonadCatchIOMtl mtl network parsec xhtml ];
   meta = {
     homepage = "http://andersk.mit.edu/haskell/cgi/";
     description = "A library for writing CGI programs";
diff --git a/pkgs/development/libraries/haskell/checkers/default.nix b/pkgs/development/libraries/haskell/checkers/default.nix
new file mode 100644
index 00000000000..4742f5104da
--- /dev/null
+++ b/pkgs/development/libraries/haskell/checkers/default.nix
@@ -0,0 +1,13 @@
+{ cabal, QuickCheck, random }:
+
+cabal.mkDerivation (self: {
+  pname = "checkers";
+  version = "0.3.1";
+  sha256 = "0lhy8bk8kkj540kjbc76j4x4xsprqwlmxdrss4r0j1bxgmfwha6p";
+  buildDepends = [ QuickCheck random ];
+  meta = {
+    description = "Check properties on standard classes and data structures";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cipher-aes/default.nix b/pkgs/development/libraries/haskell/cipher-aes/default.nix
new file mode 100644
index 00000000000..e27f203306e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cipher-aes/default.nix
@@ -0,0 +1,16 @@
+{ cabal, QuickCheck, testFramework, testFrameworkQuickcheck2 }:
+
+cabal.mkDerivation (self: {
+  pname = "cipher-aes";
+  version = "0.1.8";
+  sha256 = "171mj9abm0x9bg6mf225mhb25i7xh4v5la5866llb1qrrpvsk1xf";
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2
+  ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-cipher-aes";
+    description = "Fast AES cipher implementation with advanced mode of operations";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cipher-rc4/default.nix b/pkgs/development/libraries/haskell/cipher-rc4/default.nix
new file mode 100644
index 00000000000..7d3cacdd67a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cipher-rc4/default.nix
@@ -0,0 +1,16 @@
+{ cabal, QuickCheck, testFramework, testFrameworkQuickcheck2 }:
+
+cabal.mkDerivation (self: {
+  pname = "cipher-rc4";
+  version = "0.1.2";
+  sha256 = "0nyrqms7h3hq236h03sjjjqdcxn3iz3fg4ifqj43f4nb8gv0ifb1";
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2
+  ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-cipher-rc4";
+    description = "Fast RC4 cipher implementation";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/circle-packing/default.nix b/pkgs/development/libraries/haskell/circle-packing/default.nix
new file mode 100644
index 00000000000..bffc72cf73e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/circle-packing/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "circle-packing";
+  version = "0.1.0.2";
+  sha256 = "182fadwlf6j3jhlfjskaddaickgcb07wlb7fh42yip2680gh9k1j";
+  meta = {
+    description = "Simple heuristic for packing discs of varying radii in a circle";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/citeproc-hs/default.nix b/pkgs/development/libraries/haskell/citeproc-hs/default.nix
index 3cd0c09c3b2..2c68fd24d1f 100644
--- a/pkgs/development/libraries/haskell/citeproc-hs/default.nix
+++ b/pkgs/development/libraries/haskell/citeproc-hs/default.nix
@@ -1,14 +1,14 @@
-{ cabal, filepath, hsBibutils, HTTP, json, mtl, network
-, pandocTypes, parsec, syb, time, utf8String, xml
+{ cabal, filepath, hexpat, hsBibutils, HTTP, json, mtl, network
+, pandocTypes, parsec, syb, time, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "citeproc-hs";
-  version = "0.3.4";
-  sha256 = "17w6fpmlhbfd8jxxz4s6ybz3dswf0i96fjjbs05ykh4i97rs62nv";
+  version = "0.3.8";
+  sha256 = "0wlfwjxg852qcgx54m99xm7hxsmcw8c8r7fyrsxyxl3054xnfwz8";
   buildDepends = [
-    filepath hsBibutils HTTP json mtl network pandocTypes parsec syb
-    time utf8String xml
+    filepath hexpat hsBibutils HTTP json mtl network pandocTypes parsec
+    syb time utf8String
   ];
   meta = {
     homepage = "http://gorgias.mine.nu/repos/citeproc-hs/";
diff --git a/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
new file mode 100644
index 00000000000..c04b4dfc25e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/classy-prelude-conduit/default.nix
@@ -0,0 +1,20 @@
+{ cabal, classyPrelude, conduit, hspec, monadControl, QuickCheck
+, resourcet, transformers, void, xmlConduit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "classy-prelude-conduit";
+  version = "0.5.3";
+  sha256 = "1rmx439kdjipyz2s3v2s1xv1mb55kb4njl9k6f8mfhykgac39rhz";
+  buildDepends = [
+    classyPrelude conduit monadControl resourcet transformers void
+    xmlConduit
+  ];
+  testDepends = [ conduit hspec QuickCheck transformers ];
+  meta = {
+    homepage = "https://github.com/snoyberg/classy-prelude";
+    description = "conduit instances for classy-prelude";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/classy-prelude/default.nix b/pkgs/development/libraries/haskell/classy-prelude/default.nix
new file mode 100644
index 00000000000..51a2d6c55ba
--- /dev/null
+++ b/pkgs/development/libraries/haskell/classy-prelude/default.nix
@@ -0,0 +1,21 @@
+{ cabal, basicPrelude, hashable, hspec, liftedBase, monadControl
+, QuickCheck, systemFilepath, text, transformers
+, unorderedContainers, vector
+}:
+
+cabal.mkDerivation (self: {
+  pname = "classy-prelude";
+  version = "0.5.7";
+  sha256 = "1wq8la7nq3dh21yqwcjhwgy5s5mpqlvmrfma48v8ch6w4wwb0sqz";
+  buildDepends = [
+    basicPrelude hashable liftedBase monadControl systemFilepath text
+    transformers unorderedContainers vector
+  ];
+  testDepends = [ hspec QuickCheck transformers ];
+  meta = {
+    homepage = "https://github.com/snoyberg/classy-prelude";
+    description = "A typeclass-based Prelude";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/clientsession/default.nix b/pkgs/development/libraries/haskell/clientsession/default.nix
index 417e568092d..e670ff1a3d1 100644
--- a/pkgs/development/libraries/haskell/clientsession/default.nix
+++ b/pkgs/development/libraries/haskell/clientsession/default.nix
@@ -1,18 +1,16 @@
-{ cabal, base64Bytestring, cereal, cprngAes, cryptoApi
-, cryptocipher, entropy, skein, tagged
+{ cabal, base64Bytestring, cereal, cipherAes, cprngAes, cryptoApi
+, entropy, hspec, HUnit, QuickCheck, skein, tagged, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "clientsession";
-  version = "0.8.0";
-  sha256 = "1ypd5ki4lvwriw922p65hmj41sargawah1gnwi0q08vc7iagq64k";
+  version = "0.9";
+  sha256 = "0cyw34vzvv1j7w094cjcf97g8bki7l9x82s8csaf96y6d9qws308";
   buildDepends = [
-    base64Bytestring cereal cprngAes cryptoApi cryptocipher entropy
-    skein tagged
+    base64Bytestring cereal cipherAes cprngAes cryptoApi entropy skein
+    tagged
   ];
-  patchPhase = ''
-    sed -i -e 's|, base64-bytestring.*|, base64-bytestring|' clientsession.cabal
-  '';
+  testDepends = [ cereal hspec HUnit QuickCheck transformers ];
   meta = {
     homepage = "http://github.com/yesodweb/clientsession/tree/master";
     description = "Securely store session data in a client-side cookie";
diff --git a/pkgs/development/libraries/haskell/cmdargs/default.nix b/pkgs/development/libraries/haskell/cmdargs/default.nix
index 38b0bf24bcb..dfaed86b9af 100644
--- a/pkgs/development/libraries/haskell/cmdargs/default.nix
+++ b/pkgs/development/libraries/haskell/cmdargs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cmdargs";
-  version = "0.9.7";
-  sha256 = "0w3y94hjq5w1i2vcj45jfdbi1iadib2nsv0pa3w9dmqvn9wxlvz4";
+  version = "0.10.3";
+  sha256 = "1cglfbkmgbsv3k32vdfg4xk6b5g5c2z8pm0xgbmdb4bbg765lrh6";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ filepath transformers ];
diff --git a/pkgs/development/libraries/haskell/comonad-transformers/2.1.2.nix b/pkgs/development/libraries/haskell/comonad-transformers/2.1.2.nix
deleted file mode 100644
index 1dd7c212c71..00000000000
--- a/pkgs/development/libraries/haskell/comonad-transformers/2.1.2.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ cabal, comonad, contravariant, distributive, semigroupoids
-, semigroups, transformers
-}:
-
-cabal.mkDerivation (self: {
-  pname = "comonad-transformers";
-  version = "2.1.2";
-  sha256 = "0yhpsifnqxrg1p8f9hjslwkrakiaxa2kk9726q923a5sj225cvis";
-  buildDepends = [
-    comonad contravariant distributive semigroupoids semigroups
-    transformers
-  ];
-  meta = {
-    homepage = "http://github.com/ekmett/comonad-transformers/";
-    description = "Comonad transformers";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/comonad-transformers/3.0.nix b/pkgs/development/libraries/haskell/comonad-transformers/default.nix
index bc378235b91..99c4016947d 100644
--- a/pkgs/development/libraries/haskell/comonad-transformers/3.0.nix
+++ b/pkgs/development/libraries/haskell/comonad-transformers/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "comonad-transformers";
-  version = "3.0";
-  sha256 = "1bjix61rdzmqcd1irh6p91jwy4sz1617sj4zic07p7ng9h7fsz24";
+  version = "3.0.2";
+  sha256 = "1910hqp7f03p44alxm4dm8i4wikf0b60hmm85yrhbq02kcr3379d";
   buildDepends = [
     comonad contravariant distributive semigroupoids semigroups
     transformers
diff --git a/pkgs/development/libraries/haskell/comonad/3.0.0.2.nix b/pkgs/development/libraries/haskell/comonad/3.0.0.2.nix
deleted file mode 100644
index 3394de01206..00000000000
--- a/pkgs/development/libraries/haskell/comonad/3.0.0.2.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, semigroups, transformers }:
-
-cabal.mkDerivation (self: {
-  pname = "comonad";
-  version = "3.0.0.2";
-  sha256 = "01q71b446mdbdj81qjrxjl5bshbg4bjih5zpw9fd4y5431bclfhi";
-  buildDepends = [ semigroups transformers ];
-  meta = {
-    homepage = "http://github.com/ekmett/comonad/";
-    description = "Haskell 98 compatible comonads";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/comonad/1.1.1.6.nix b/pkgs/development/libraries/haskell/comonad/default.nix
index 53e014fb8ac..7e11886fc58 100644
--- a/pkgs/development/libraries/haskell/comonad/1.1.1.6.nix
+++ b/pkgs/development/libraries/haskell/comonad/default.nix
@@ -1,10 +1,11 @@
-{ cabal, semigroups, transformers }:
+{ cabal, doctest, filepath, semigroups, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "comonad";
-  version = "1.1.1.6";
-  sha256 = "1sg0pa7393mzfm27pl52nchplhkls3k0f4ff8vzk76wzrgvhysg5";
+  version = "3.0.2";
+  sha256 = "0ryyifcxc5rmjrf9323zzj357709mah1hdsrnrbakd5ck7grjfay";
   buildDepends = [ semigroups transformers ];
+  testDepends = [ doctest filepath ];
   meta = {
     homepage = "http://github.com/ekmett/comonad/";
     description = "Haskell 98 compatible comonads";
diff --git a/pkgs/development/libraries/haskell/comonads-fd/default.nix b/pkgs/development/libraries/haskell/comonads-fd/default.nix
new file mode 100644
index 00000000000..5921d8b07d3
--- /dev/null
+++ b/pkgs/development/libraries/haskell/comonads-fd/default.nix
@@ -0,0 +1,18 @@
+{ cabal, comonad, comonadTransformers, mtl, semigroups
+, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "comonads-fd";
+  version = "3.0.1";
+  sha256 = "0ap9sw7h130bza43091mbl9a5bsin6342zawgycdcsag49wm3dyy";
+  buildDepends = [
+    comonad comonadTransformers mtl semigroups transformers
+  ];
+  meta = {
+    homepage = "http://github.com/ekmett/comonads-fd/";
+    description = "Comonad transformers using functional dependencies";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/concurrent-extra/default.nix b/pkgs/development/libraries/haskell/concurrent-extra/default.nix
new file mode 100644
index 00000000000..db380f03b5b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/concurrent-extra/default.nix
@@ -0,0 +1,20 @@
+{ cabal, baseUnicodeSymbols, HUnit, stm, testFramework
+, testFrameworkHunit, unboundedDelays
+}:
+
+cabal.mkDerivation (self: {
+  pname = "concurrent-extra";
+  version = "0.7.0.5";
+  sha256 = "0g1ckrwgdyrlp1m352ivplajqzqhw5ymlkb4miiv7c5i9xyyyqnc";
+  buildDepends = [ baseUnicodeSymbols stm unboundedDelays ];
+  testDepends = [
+    baseUnicodeSymbols HUnit stm testFramework testFrameworkHunit
+    unboundedDelays
+  ];
+  meta = {
+    homepage = "https://github.com/basvandijk/concurrent-extra";
+    description = "Extra concurrency primitives";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/conduit/default.nix b/pkgs/development/libraries/haskell/conduit/default.nix
index 6ed4ae90221..6a12708ea33 100644
--- a/pkgs/development/libraries/haskell/conduit/default.nix
+++ b/pkgs/development/libraries/haskell/conduit/default.nix
@@ -1,15 +1,18 @@
-{ cabal, liftedBase, monadControl, resourcet, text, transformers
-, transformersBase, void
+{ cabal, doctest, hspec, liftedBase, mmorph, monadControl
+, QuickCheck, resourcet, text, transformers, transformersBase, void
 }:
 
 cabal.mkDerivation (self: {
   pname = "conduit";
-  version = "0.5.2.3";
-  sha256 = "1snyh9zxdmvjb1ilaz6c2z5220r7ygshmcq013nch44b6w3r3cp9";
+  version = "1.0.6";
+  sha256 = "0da5wxhsfjgcn850iimcp15vhg5lw0fa8i7c3hdw4yvrpza14dcn";
   buildDepends = [
-    liftedBase monadControl resourcet text transformers
+    liftedBase mmorph monadControl resourcet text transformers
     transformersBase void
   ];
+  testDepends = [
+    doctest hspec QuickCheck resourcet text transformers void
+  ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Streaming data processing library";
diff --git a/pkgs/development/libraries/haskell/configurator/default.nix b/pkgs/development/libraries/haskell/configurator/default.nix
index 0c4c610106e..775c2e5027f 100644
--- a/pkgs/development/libraries/haskell/configurator/default.nix
+++ b/pkgs/development/libraries/haskell/configurator/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "configurator";
-  version = "0.2.0.0";
-  sha256 = "0zkcmziyfq2sm9i75ysi5nxd21fynp88m0safhmn3jld7plj03la";
+  version = "0.2.0.2";
+  sha256 = "011rgd48gv4idkh2dwg4mlyx3s6pgm1263xq5ixsa4sg3jqh9d8b";
   buildDepends = [
     attoparsec hashable text unixCompat unorderedContainers
   ];
diff --git a/pkgs/development/libraries/haskell/constraints/default.nix b/pkgs/development/libraries/haskell/constraints/default.nix
new file mode 100644
index 00000000000..0fe2cb8864a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/constraints/default.nix
@@ -0,0 +1,15 @@
+{ cabal, newtype }:
+
+cabal.mkDerivation (self: {
+  pname = "constraints";
+  version = "0.3.2";
+  sha256 = "1fmjl6dh2iswvmq8r3izplp6zg9m8yq1c4rj0zpqjbv2iqsi4kl1";
+  buildDepends = [ newtype ];
+  meta = {
+    homepage = "http://github.com/ekmett/constraints/";
+    description = "Constraint manipulation";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/contravariant/default.nix b/pkgs/development/libraries/haskell/contravariant/default.nix
index 526b9e1f997..2c967d26085 100644
--- a/pkgs/development/libraries/haskell/contravariant/default.nix
+++ b/pkgs/development/libraries/haskell/contravariant/default.nix
@@ -1,10 +1,10 @@
-{ cabal, transformers }:
+{ cabal, tagged, transformers, transformersCompat }:
 
 cabal.mkDerivation (self: {
   pname = "contravariant";
-  version = "0.2.0.2";
-  sha256 = "0142s1c914zbfnvysvcc9s3bv8qs6wimnqcmxca1gxaxqvyfkf3p";
-  buildDepends = [ transformers ];
+  version = "0.4";
+  sha256 = "1nqslc9vcx6v6c33fn7mvb1xhr33yl3ja92p788zx8z1drx9cqc3";
+  buildDepends = [ tagged transformers transformersCompat ];
   meta = {
     homepage = "http://github.com/ekmett/contravariant/";
     description = "Haskell 98 contravariant functors";
diff --git a/pkgs/development/libraries/haskell/cookie/default.nix b/pkgs/development/libraries/haskell/cookie/default.nix
index 1b958b3240e..b7dae5d4a9b 100644
--- a/pkgs/development/libraries/haskell/cookie/default.nix
+++ b/pkgs/development/libraries/haskell/cookie/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cookie";
-  version = "0.4.0";
-  sha256 = "1vkz6nys26i0yprb8jkv8iyq9xqnxb0wv07f7s7c448vx4gfln98";
+  version = "0.4.0.1";
+  sha256 = "01k5gq9kwbrivkhr1sj8aw4cgf2c1xgwwajqvd435r0g99fpx5kk";
   buildDepends = [ blazeBuilder dataDefault text time ];
   meta = {
     homepage = "http://github.com/snoyberg/cookie";
diff --git a/pkgs/development/libraries/haskell/cprng-aes/default.nix b/pkgs/development/libraries/haskell/cprng-aes/default.nix
index 881d4519a53..4f2aa58b7d2 100644
--- a/pkgs/development/libraries/haskell/cprng-aes/default.nix
+++ b/pkgs/development/libraries/haskell/cprng-aes/default.nix
@@ -1,10 +1,12 @@
-{ cabal, cereal, cryptoApi, cryptocipher, entropy, random }:
+{ cabal, cipherAes, cryptoApi, cryptoRandomApi, entropy, random }:
 
 cabal.mkDerivation (self: {
   pname = "cprng-aes";
-  version = "0.2.3";
-  sha256 = "1xyphzb3afvw7kpgq3b0c86b45rp5a8s870gag1lp7h686lhfnn3";
-  buildDepends = [ cereal cryptoApi cryptocipher entropy random ];
+  version = "0.3.4";
+  sha256 = "0k1zh4nw30qgdrkgn6x6zfbpp129f9cparzyqsdqfbf44j0mf2rw";
+  buildDepends = [
+    cipherAes cryptoApi cryptoRandomApi entropy random
+  ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cprng-aes";
     description = "Crypto Pseudo Random Number Generator using AES in counter mode";
diff --git a/pkgs/development/libraries/haskell/criterion/default.nix b/pkgs/development/libraries/haskell/criterion/default.nix
index 54b6b20dc83..84eacff71a1 100644
--- a/pkgs/development/libraries/haskell/criterion/default.nix
+++ b/pkgs/development/libraries/haskell/criterion/default.nix
@@ -1,14 +1,15 @@
-{ cabal, aeson, deepseq, filepath, hastache, mtl, mwcRandom, parsec
-, statistics, time, transformers, vector, vectorAlgorithms
+{ cabal, aeson, binary, deepseq, filepath, Glob, hastache, mtl
+, mwcRandom, parsec, statistics, time, transformers, vector
+, vectorAlgorithms
 }:
 
 cabal.mkDerivation (self: {
   pname = "criterion";
-  version = "0.6.1.1";
-  sha256 = "1w5yqcgnx2ij3hmvmz5g4ynj6n8wa3yyk1kfbbwxyh9j5kc2xwiw";
+  version = "0.8.0.0";
+  sha256 = "05v4glwvidsd4gm2jcvmlcpfaxg2x0fb69w051rbwg9scanrm7bf";
   buildDepends = [
-    aeson deepseq filepath hastache mtl mwcRandom parsec statistics
-    time transformers vector vectorAlgorithms
+    aeson binary deepseq filepath Glob hastache mtl mwcRandom parsec
+    statistics time transformers vector vectorAlgorithms
   ];
   meta = {
     homepage = "https://github.com/bos/criterion";
diff --git a/pkgs/development/libraries/haskell/crypto-api/default.nix b/pkgs/development/libraries/haskell/crypto-api/default.nix
index 5f71e622250..23fdd553f9e 100644
--- a/pkgs/development/libraries/haskell/crypto-api/default.nix
+++ b/pkgs/development/libraries/haskell/crypto-api/default.nix
@@ -1,12 +1,12 @@
-{ cabal, cereal, entropy, largeword, tagged }:
+{ cabal, cereal, entropy, tagged, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "crypto-api";
-  version = "0.10.2";
-  sha256 = "06dbvdwyw2hf5cafpjfhasgyzzbigvvg74c47lafvqvgxvn9v4ms";
-  buildDepends = [ cereal entropy largeword tagged ];
+  version = "0.12.2.1";
+  sha256 = "03hbjjrwnpa4ji2ig458s0c4g13r566sl6fs3hciwyf6cfq597wk";
+  buildDepends = [ cereal entropy tagged transformers ];
   meta = {
-    homepage = "http://trac.haskell.org/crypto-api/wiki";
+    homepage = "https://github.com/TomMD/crypto-api";
     description = "A generic interface for cryptographic operations";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/crypto-conduit/default.nix b/pkgs/development/libraries/haskell/crypto-conduit/default.nix
index e76d5967836..61d6bcbeabe 100644
--- a/pkgs/development/libraries/haskell/crypto-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/crypto-conduit/default.nix
@@ -1,10 +1,17 @@
-{ cabal, cereal, conduit, cryptoApi, transformers }:
+{ cabal, cereal, conduit, cryptoApi, cryptocipher
+, cryptohashCryptoapi, hspec, skein, transformers
+}:
 
 cabal.mkDerivation (self: {
   pname = "crypto-conduit";
-  version = "0.4.0";
-  sha256 = "15x7v6vmmd90mrb60wllvdai8fk8cvm5bkxzzqyjikshldvlhmas";
+  version = "0.5.2";
+  sha256 = "0ncqwr2a9nxl6q7qys9gb5db62lx622g5db1xhpfni045x324kbz";
   buildDepends = [ cereal conduit cryptoApi transformers ];
+  testDepends = [
+    cereal conduit cryptoApi cryptocipher cryptohashCryptoapi hspec
+    skein transformers
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/meteficha/crypto-conduit";
     description = "Conduit interface for cryptographic operations (from crypto-api)";
diff --git a/pkgs/development/libraries/haskell/crypto-numbers/default.nix b/pkgs/development/libraries/haskell/crypto-numbers/default.nix
new file mode 100644
index 00000000000..af6985cd9ed
--- /dev/null
+++ b/pkgs/development/libraries/haskell/crypto-numbers/default.nix
@@ -0,0 +1,20 @@
+{ cabal, cryptoRandomApi, HUnit, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, vector
+}:
+
+cabal.mkDerivation (self: {
+  pname = "crypto-numbers";
+  version = "0.1.3";
+  sha256 = "115lgnay3ly5r53flh3v5jygqks0rg1i8qmbvrqf9nkmnmw6a5x1";
+  buildDepends = [ cryptoRandomApi vector ];
+  testDepends = [
+    cryptoRandomApi HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 vector
+  ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-crypto-numbers";
+    description = "Cryptographic numbers: functions and algorithms";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/crypto-pubkey-types/default.nix b/pkgs/development/libraries/haskell/crypto-pubkey-types/default.nix
index fa3151d893c..e4234d1d4cd 100644
--- a/pkgs/development/libraries/haskell/crypto-pubkey-types/default.nix
+++ b/pkgs/development/libraries/haskell/crypto-pubkey-types/default.nix
@@ -1,10 +1,10 @@
-{ cabal, cryptoApi }:
+{ cabal, asn1Types }:
 
 cabal.mkDerivation (self: {
   pname = "crypto-pubkey-types";
-  version = "0.1.1";
-  sha256 = "0chlz01nlxnh9bk5b97vm6q6ai0ifybkdaynwibj8px418mmbkib";
-  buildDepends = [ cryptoApi ];
+  version = "0.4.0";
+  sha256 = "0bapzvd0xgv38mbj1xhzcswchnx81sq0wwyax3qqzcpgvcyz28sl";
+  buildDepends = [ asn1Types ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-crypto-pubkey-types";
     description = "Generic cryptography Public keys algorithm types";
diff --git a/pkgs/development/libraries/haskell/crypto-pubkey/default.nix b/pkgs/development/libraries/haskell/crypto-pubkey/default.nix
new file mode 100644
index 00000000000..47e8dc179ae
--- /dev/null
+++ b/pkgs/development/libraries/haskell/crypto-pubkey/default.nix
@@ -0,0 +1,23 @@
+{ cabal, cryptohash, cryptoNumbers, cryptoPubkeyTypes
+, cryptoRandomApi, HUnit, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "crypto-pubkey";
+  version = "0.1.4";
+  sha256 = "13ah3ip6gdv7b1zz5qwi7515a3k8pp3l0jr1kq4q2a0vqy24gkn1";
+  buildDepends = [
+    cryptohash cryptoNumbers cryptoPubkeyTypes cryptoRandomApi
+  ];
+  testDepends = [
+    cryptohash cryptoNumbers cryptoRandomApi HUnit QuickCheck
+    testFramework testFrameworkHunit testFrameworkQuickcheck2
+  ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-crypto-pubkey";
+    description = "Public Key cryptography";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/crypto-random-api/default.nix b/pkgs/development/libraries/haskell/crypto-random-api/default.nix
new file mode 100644
index 00000000000..7c3b10a3838
--- /dev/null
+++ b/pkgs/development/libraries/haskell/crypto-random-api/default.nix
@@ -0,0 +1,14 @@
+{ cabal, entropy }:
+
+cabal.mkDerivation (self: {
+  pname = "crypto-random-api";
+  version = "0.2.0";
+  sha256 = "0z49kwgjj7rz235642q64hbkgp0zl6ipn29xd19yb75xc5q7gsan";
+  buildDepends = [ entropy ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-crypto-random-api";
+    description = "Simple random generators API for cryptography related code";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cryptocipher/default.nix b/pkgs/development/libraries/haskell/cryptocipher/default.nix
index 1798f4e21a5..50935a77a64 100644
--- a/pkgs/development/libraries/haskell/cryptocipher/default.nix
+++ b/pkgs/development/libraries/haskell/cryptocipher/default.nix
@@ -1,19 +1,24 @@
-{ cabal, cereal, cpu, cryptoApi, cryptoPubkeyTypes, primitive
-, tagged, vector
+{ cabal, cereal, cipherAes, cipherRc4, cpu, cryptoApi, cryptohash
+, entropy, primitive, QuickCheck, testFramework
+, testFrameworkQuickcheck2, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "cryptocipher";
-  version = "0.3.5";
-  sha256 = "02qc1rr9l51dnk0sn7js8zv2w2qhkha3ik828j5s729h80cyw99s";
+  version = "0.5.0";
+  sha256 = "16gqsy23y3g9089ng94124g5pvc4d0vnh2r47ii789f8j96062nd";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    cereal cpu cryptoApi cryptoPubkeyTypes primitive tagged vector
+    cereal cipherAes cipherRc4 cpu cryptoApi primitive vector
+  ];
+  testDepends = [
+    cryptoApi cryptohash entropy QuickCheck testFramework
+    testFrameworkQuickcheck2 vector
   ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cryptocipher";
-    description = "Symmetrical Block, Stream and PubKey Ciphers";
+    description = "Symmetrical block and stream ciphers";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/cryptohash-cryptoapi/default.nix b/pkgs/development/libraries/haskell/cryptohash-cryptoapi/default.nix
new file mode 100644
index 00000000000..e21e026080b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cryptohash-cryptoapi/default.nix
@@ -0,0 +1,14 @@
+{ cabal, cereal, cryptoApi, cryptohash, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "cryptohash-cryptoapi";
+  version = "0.1.0";
+  sha256 = "06b62ddwx2mp71dzaj8h88vw2c6nv3rj8n6d3d9vmqa7cws3mjkx";
+  buildDepends = [ cereal cryptoApi cryptohash tagged ];
+  meta = {
+    homepage = "http://github.com/vincenthz/hs-cryptohash-cryptoapi";
+    description = "Crypto-api interfaces for cryptohash";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/cryptohash/default.nix b/pkgs/development/libraries/haskell/cryptohash/default.nix
index 77ecc4ef554..97f74e80530 100644
--- a/pkgs/development/libraries/haskell/cryptohash/default.nix
+++ b/pkgs/development/libraries/haskell/cryptohash/default.nix
@@ -1,12 +1,16 @@
-{ cabal, cereal, cryptoApi, tagged }:
+{ cabal, cereal, cryptoApi, HUnit, QuickCheck, tagged
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "cryptohash";
-  version = "0.7.5";
-  sha256 = "18x1k22m2mw0jx3p1mc68n0gg1vsnkp50qvmlkh3i34vdnjcdrqg";
-  isLibrary = true;
-  isExecutable = true;
+  version = "0.9.0";
+  sha256 = "0ipzrp83pz33qc7gmn9bmhbmc1f0hfvagyfr5bnmhgrh6lgy9s7l";
   buildDepends = [ cereal cryptoApi tagged ];
+  testDepends = [
+    HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-cryptohash";
     description = "collection of crypto hashes, fast, pure and practical";
diff --git a/pkgs/development/libraries/haskell/css-text/default.nix b/pkgs/development/libraries/haskell/css-text/default.nix
index 9970d87fbe0..f59a80b2b65 100644
--- a/pkgs/development/libraries/haskell/css-text/default.nix
+++ b/pkgs/development/libraries/haskell/css-text/default.nix
@@ -1,10 +1,11 @@
-{ cabal, attoparsec, text }:
+{ cabal, attoparsec, hspec, HUnit, QuickCheck, text }:
 
 cabal.mkDerivation (self: {
   pname = "css-text";
   version = "0.1.1";
   sha256 = "10vb08rnfq987w7wrirw8ib1kzafxaaancswm4xpw46ha3rq1m0y";
   buildDepends = [ attoparsec text ];
+  testDepends = [ attoparsec hspec HUnit QuickCheck text ];
   meta = {
     homepage = "http://www.yesodweb.com/";
     description = "CSS parser and renderer";
diff --git a/pkgs/development/libraries/haskell/cuda/default.nix b/pkgs/development/libraries/haskell/cuda/default.nix
index 296d639918e..ac9e41fd628 100644
--- a/pkgs/development/libraries/haskell/cuda/default.nix
+++ b/pkgs/development/libraries/haskell/cuda/default.nix
@@ -1,27 +1,24 @@
-{ cabal, c2hs, cudatoolkit, extensibleExceptions, nvidia_x11 }:
+{ cabal, c2hs, cudatoolkit, nvidia_x11 }:
 
 cabal.mkDerivation (self: {
   pname = "cuda";
-  version = "0.4.1.0";
-  sha256 = "1drr95d4v3khidxr6na5vyq28bv5rqk2n676q0bydc4rqwhb1z6w";
-  buildDepends = [ extensibleExceptions ];
+  version = "0.5.0.2";
+  sha256 = "1if730wcww5qx5qki1ir0d576wwpwrh00krp1svgdlx2j50rmgq5";
   buildTools = [ c2hs ];
   extraLibraries = [ cudatoolkit nvidia_x11 self.stdenv.gcc ];
+  doCheck = false;
   # Perhaps this should be the default in cabal.nix ...
   #
   # The cudatoolkit provides both 64 and 32-bit versions of the
   # library. GHC's linker fails if the wrong version is found first.
   # We solve this by eliminating lib64 from the path on 32-bit
   # platforms and putting lib64 first on 64-bit platforms.
-  
   libPaths = if self.stdenv.is64bit then "lib64 lib" else "lib";
-  
   configurePhase = ''
     for i in Setup.hs Setup.lhs; do
       test -f $i && ghc --make $i
     done
-  
-    for p in $extraBuildInputs $propagatedBuildNativeInputs; do
+    for p in $extraBuildInputs $propagatedNativeBuildInputs; do
       if [ -d "$p/include" ]; then
         extraLibDirs="$extraLibDirs --extra-include-dir=$p/include"
       fi
@@ -31,7 +28,6 @@ cabal.mkDerivation (self: {
         fi
       done
     done
-  
     ./Setup configure --verbose --prefix="$out" $libraryProfiling $extraLibDirs $configureFlags
   '';
   meta = {
diff --git a/pkgs/development/libraries/haskell/cufft/default.nix b/pkgs/development/libraries/haskell/cufft/default.nix
new file mode 100644
index 00000000000..76039f06548
--- /dev/null
+++ b/pkgs/development/libraries/haskell/cufft/default.nix
@@ -0,0 +1,15 @@
+{ cabal, c2hs, cuda }:
+
+cabal.mkDerivation (self: {
+  pname = "cufft";
+  version = "0.1.0.1";
+  sha256 = "0j1rsixl48z8xszym9s3rw4pwq4s5bz6inqkfsq726gni0nlm8vx";
+  buildDepends = [ cuda ];
+  buildTools = [ c2hs ];
+  meta = {
+    homepage = "http://github.com/robeverest/cufft";
+    description = "Haskell bindings for the CUFFT library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/curl/default.nix b/pkgs/development/libraries/haskell/curl/default.nix
index 072b8f2d6e6..a530044ca6e 100644
--- a/pkgs/development/libraries/haskell/curl/default.nix
+++ b/pkgs/development/libraries/haskell/curl/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "curl";
-  version = "1.3.7";
-  sha256 = "0i6d7732p5gn1bcvavbxcg4wd18j425mi1yjg0b29zzz3yl0qhgi";
+  version = "1.3.8";
+  sha256 = "0vj4hpaa30jz7c702xpsfvqaqdxz28zslsqnsfx6bf6dpwvck1wh";
   extraLibraries = [ curl ];
   meta = {
     description = "Haskell binding to libcurl";
diff --git a/pkgs/development/libraries/haskell/data-accessor/data-accessor-template.nix b/pkgs/development/libraries/haskell/data-accessor/data-accessor-template.nix
index 077e31c683e..41bd2347012 100644
--- a/pkgs/development/libraries/haskell/data-accessor/data-accessor-template.nix
+++ b/pkgs/development/libraries/haskell/data-accessor/data-accessor-template.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "data-accessor-template";
-  version = "0.2.1.9";
-  sha256 = "14zp2zjxlkdi33cjif9lc1kl8m0x4brh0pk3d34wk1g1bfzynijc";
+  version = "0.2.1.10";
+  sha256 = "11a4c0g74ppl7nls0dhx6xs47dfcq1wp7bd8qgdba6hhn645afzy";
   buildDepends = [ dataAccessor utilityHt ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Record_access";
diff --git a/pkgs/development/libraries/haskell/data-accessor/data-accessor-transformers.nix b/pkgs/development/libraries/haskell/data-accessor/data-accessor-transformers.nix
new file mode 100644
index 00000000000..83712b858c2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-accessor/data-accessor-transformers.nix
@@ -0,0 +1,14 @@
+{ cabal, dataAccessor, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "data-accessor-transformers";
+  version = "0.2.1.4";
+  sha256 = "1bf1j8g5q81zw51bri89hj3i9jnlmhdggw8rhw3n2v103399pf7d";
+  buildDepends = [ dataAccessor transformers ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/Record_access";
+    description = "Use Accessor to access state in transformers State monad";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-accessor/data-accessor.nix b/pkgs/development/libraries/haskell/data-accessor/data-accessor.nix
index 6f73cc48817..7c1de10b20b 100644
--- a/pkgs/development/libraries/haskell/data-accessor/data-accessor.nix
+++ b/pkgs/development/libraries/haskell/data-accessor/data-accessor.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "data-accessor";
-  version = "0.2.2.2";
-  sha256 = "1q9hx2bkp7dknr9ygx39lj93i846x8g9j7lkhkjijvsicih28yyi";
+  version = "0.2.2.3";
+  sha256 = "1fa1rbbs3m05y61w42vj4vqlcpqmz60v8mv3r0h6lx669k6ka5gj";
   buildDepends = [ transformers ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Record_access";
diff --git a/pkgs/development/libraries/haskell/data-binary-ieee754/default.nix b/pkgs/development/libraries/haskell/data-binary-ieee754/default.nix
index 08f6b654f3b..5066a83c5f6 100644
--- a/pkgs/development/libraries/haskell/data-binary-ieee754/default.nix
+++ b/pkgs/development/libraries/haskell/data-binary-ieee754/default.nix
@@ -2,13 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "data-binary-ieee754";
-  version = "0.4.2.1";
-  sha256 = "0i0nclq8858flpp2sl3czwz6rfaykjrlzpvlfr6vlxzf8zvah9kz";
-  isLibrary = true;
-  isExecutable = true;
+  version = "0.4.3";
+  sha256 = "0aba7qvjvhfp9cpr65j8zs62niv9yccrardk10aaqpkz3ihc86pm";
   buildDepends = [ binary ];
   meta = {
-    homepage = "http://john-millikin.com/software/data-binary-ieee754/";
+    homepage = "https://john-millikin.com/software/data-binary-ieee754/";
     description = "Parser/Serialiser for IEEE-754 floating-point values";
     license = self.stdenv.lib.licenses.mit;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/data-default-class/default.nix b/pkgs/development/libraries/haskell/data-default-class/default.nix
new file mode 100644
index 00000000000..1db4468a6de
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-default-class/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "data-default-class";
+  version = "0.0.1";
+  sha256 = "0ccgr3jllinchqhw3lsn73ic6axk4196if5274rr1rghls0fxj5d";
+  meta = {
+    description = "A class for types with a default value";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-default-instances-base/default.nix b/pkgs/development/libraries/haskell/data-default-instances-base/default.nix
new file mode 100644
index 00000000000..5fc59b232a4
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-default-instances-base/default.nix
@@ -0,0 +1,13 @@
+{ cabal, dataDefaultClass }:
+
+cabal.mkDerivation (self: {
+  pname = "data-default-instances-base";
+  version = "0.0.1";
+  sha256 = "1832nq6by91f1iw73ycvkbgn8kpra83pvf2q61hy47xffh0zy4pb";
+  buildDepends = [ dataDefaultClass ];
+  meta = {
+    description = "Default instances for types in base";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-default-instances-containers/default.nix b/pkgs/development/libraries/haskell/data-default-instances-containers/default.nix
new file mode 100644
index 00000000000..6ac626b7079
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-default-instances-containers/default.nix
@@ -0,0 +1,13 @@
+{ cabal, dataDefaultClass }:
+
+cabal.mkDerivation (self: {
+  pname = "data-default-instances-containers";
+  version = "0.0.1";
+  sha256 = "06h8xka031w752a7cjlzghvr8adqbl95xj9z5zc1b62w02phfpm5";
+  buildDepends = [ dataDefaultClass ];
+  meta = {
+    description = "Default instances for types in containers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-default-instances-dlist/default.nix b/pkgs/development/libraries/haskell/data-default-instances-dlist/default.nix
new file mode 100644
index 00000000000..a89da0c84f5
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-default-instances-dlist/default.nix
@@ -0,0 +1,13 @@
+{ cabal, dataDefaultClass, dlist }:
+
+cabal.mkDerivation (self: {
+  pname = "data-default-instances-dlist";
+  version = "0.0.1";
+  sha256 = "0narkdqiprhgayjiawrr4390h4rq4pl2pb6mvixbv2phrc8kfs3x";
+  buildDepends = [ dataDefaultClass dlist ];
+  meta = {
+    description = "Default instances for types in dlist";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-default-instances-old-locale/default.nix b/pkgs/development/libraries/haskell/data-default-instances-old-locale/default.nix
new file mode 100644
index 00000000000..b1b7742692a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/data-default-instances-old-locale/default.nix
@@ -0,0 +1,13 @@
+{ cabal, dataDefaultClass }:
+
+cabal.mkDerivation (self: {
+  pname = "data-default-instances-old-locale";
+  version = "0.0.1";
+  sha256 = "00h81i5phib741yj517p8mbnc48myvfj8axzsw44k34m48lv1lv0";
+  buildDepends = [ dataDefaultClass ];
+  meta = {
+    description = "Default instances for types in old-locale";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/data-default/default.nix b/pkgs/development/libraries/haskell/data-default/default.nix
index 893f2121f0a..e4340c7ec32 100644
--- a/pkgs/development/libraries/haskell/data-default/default.nix
+++ b/pkgs/development/libraries/haskell/data-default/default.nix
@@ -1,10 +1,17 @@
-{ cabal, dlist }:
+{ cabal, dataDefaultClass, dataDefaultInstancesBase
+, dataDefaultInstancesContainers, dataDefaultInstancesDlist
+, dataDefaultInstancesOldLocale
+}:
 
 cabal.mkDerivation (self: {
   pname = "data-default";
-  version = "0.5.0";
-  sha256 = "1wv8wjd9j40s7h19aph5pqph7rby5ma1nlagqywn9q0634iq9n2a";
-  buildDepends = [ dlist ];
+  version = "0.5.3";
+  sha256 = "0d1hm0l9kim3kszshr4msmgzizrzha48gz2kb7b61p7n3gs70m7c";
+  buildDepends = [
+    dataDefaultClass dataDefaultInstancesBase
+    dataDefaultInstancesContainers dataDefaultInstancesDlist
+    dataDefaultInstancesOldLocale
+  ];
   meta = {
     description = "A class for types with a default value";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/data-inttrie/default.nix b/pkgs/development/libraries/haskell/data-inttrie/default.nix
index 926d465065d..ec3cf7ca649 100644
--- a/pkgs/development/libraries/haskell/data-inttrie/default.nix
+++ b/pkgs/development/libraries/haskell/data-inttrie/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "data-inttrie";
-  version = "0.0.7";
-  sha256 = "19d586p2pj38pirrkip9z6yxrdbpiqsbnczmnyvd8slndilqz0ip";
+  version = "0.1.0";
+  sha256 = "00kzf3cw0y0848cprmx3i7g70rmr92hhfzn60a2x98vb8f7y3814";
   meta = {
     homepage = "http://github.com/luqui/data-inttrie";
     description = "A lazy, infinite trie of integers";
diff --git a/pkgs/development/libraries/haskell/data-lens-template/default.nix b/pkgs/development/libraries/haskell/data-lens-template/default.nix
index fc058b92e54..7ba9e3f9da7 100644
--- a/pkgs/development/libraries/haskell/data-lens-template/default.nix
+++ b/pkgs/development/libraries/haskell/data-lens-template/default.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "data-lens-template";
-  version = "2.1.5";
-  sha256 = "09i9lby5jd2kcg0l7y4hkga7jxixcpqw4dc7h1kngqdz92a1ydxc";
+  version = "2.1.7";
+  sha256 = "108xvk5glsw016vdvjb1p3a9zh7rgbkjv5xashs1hj25f8k4cw49";
   buildDepends = [ dataLens ];
   meta = {
-    homepage = "http://github.com/ekmett/data-lens-template/";
+    homepage = "http://github.com/roconnor/data-lens-template/";
     description = "Utilities for Data.Lens";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/data-memocombinators/default.nix b/pkgs/development/libraries/haskell/data-memocombinators/default.nix
index 25f063c20ac..2b3adde1d72 100644
--- a/pkgs/development/libraries/haskell/data-memocombinators/default.nix
+++ b/pkgs/development/libraries/haskell/data-memocombinators/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "data-memocombinators";
-  version = "0.4.3";
-  sha256 = "0mzvjgccm23y7mfaz9iwdy64amf69d7i8yq9fc9mjx1nyzxdrgsc";
+  version = "0.4.4";
+  sha256 = "06x79rgxi6cxrpzjzzsjk7yj7i0ajmcgns0n12lxakz9vxbqxyn2";
   buildDepends = [ dataInttrie ];
   meta = {
     homepage = "http://github.com/luqui/data-memocombinators";
diff --git a/pkgs/development/libraries/haskell/dataenc/default.nix b/pkgs/development/libraries/haskell/dataenc/default.nix
index d2428600ce9..9c4de4a1b84 100644
--- a/pkgs/development/libraries/haskell/dataenc/default.nix
+++ b/pkgs/development/libraries/haskell/dataenc/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "dataenc";
-  version = "0.14.0.3";
-  sha256 = "1k6k9cpx5ma32gvzf2mdbz4kfiblwfah9875qr13zkl4has9y0pd";
+  version = "0.14.0.5";
+  sha256 = "13gajqbayar7x8sq3rw93i277gqd0bx1i34spshlj4b41fraxc8w";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/date-cache/default.nix b/pkgs/development/libraries/haskell/date-cache/default.nix
new file mode 100644
index 00000000000..a460dcbdafc
--- /dev/null
+++ b/pkgs/development/libraries/haskell/date-cache/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "date-cache";
+  version = "0.3.0";
+  sha256 = "0grhcbd0rhdn0cf1fz82x8pv8cmxfhndlcwyrax4mnnr3pql9kmb";
+  meta = {
+    description = "Date cacher";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/dbus/default.nix b/pkgs/development/libraries/haskell/dbus/default.nix
new file mode 100644
index 00000000000..16cb2c7ca03
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dbus/default.nix
@@ -0,0 +1,19 @@
+{ cabal, cereal, libxmlSax, network, parsec, random, text
+, transformers, vector, xmlTypes
+}:
+
+cabal.mkDerivation (self: {
+  pname = "dbus";
+  version = "0.10.4";
+  sha256 = "0cv4sgk1mdxc81jlky21k0y3zg7qii585xiapr1m589r5528gj2f";
+  buildDepends = [
+    cereal libxmlSax network parsec random text transformers vector
+    xmlTypes
+  ];
+  meta = {
+    homepage = "https://john-millikin.com/software/haskell-dbus/";
+    description = "A client library for the D-Bus IPC system";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/deepseq-th/default.nix b/pkgs/development/libraries/haskell/deepseq-th/default.nix
index 1072bcb9ca7..228fcd28c78 100644
--- a/pkgs/development/libraries/haskell/deepseq-th/default.nix
+++ b/pkgs/development/libraries/haskell/deepseq-th/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "deepseq-th";
-  version = "0.1.0.3";
-  sha256 = "1xx88i55iskyxrpxbdg0srb64y5siqs1b8qj7bh3i1893qs9sha2";
+  version = "0.1.0.4";
+  sha256 = "12wk8higrp12b22zzz1b4ar1q5h7flk22bp2rvswsqri2zkbi965";
   buildDepends = [ deepseq ];
+  testDepends = [ deepseq ];
   meta = {
     description = "Template Haskell based deriver for optimised NFData instances";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/deepseq/1.3.0.0.nix b/pkgs/development/libraries/haskell/deepseq/1.3.0.1.nix
index 2470dcdf89f..78f9273e46a 100644
--- a/pkgs/development/libraries/haskell/deepseq/1.3.0.0.nix
+++ b/pkgs/development/libraries/haskell/deepseq/1.3.0.1.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "deepseq";
-  version = "1.3.0.0";
-  sha256 = "0z2k1rda67nmhv62irjfd642iarj1i9m55l6p47j4cysrszhvqgy";
+  version = "1.3.0.1";
+  sha256 = "068zka6rwprbzpx7yisi1ajsxdly23zaf2vjklx1wp66yypx54lp";
   meta = {
     description = "Deep evaluation of data structures";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/dependent-map/default.nix b/pkgs/development/libraries/haskell/dependent-map/default.nix
new file mode 100644
index 00000000000..32a10efc785
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dependent-map/default.nix
@@ -0,0 +1,14 @@
+{ cabal, dependentSum }:
+
+cabal.mkDerivation (self: {
+  pname = "dependent-map";
+  version = "0.1.1.1";
+  sha256 = "1p5a5qahw7i6cvb0g0g1bv9gzy6jlxr5vb3hp8gahm210zw8g990";
+  buildDepends = [ dependentSum ];
+  meta = {
+    homepage = "https://github.com/mokus0/dependent-map";
+    description = "Dependent finite maps (partial dependent products)";
+    license = "unknown";
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/dependent-sum-template/default.nix b/pkgs/development/libraries/haskell/dependent-sum-template/default.nix
new file mode 100644
index 00000000000..2ea45097d3f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dependent-sum-template/default.nix
@@ -0,0 +1,14 @@
+{ cabal, dependentSum, thExtras }:
+
+cabal.mkDerivation (self: {
+  pname = "dependent-sum-template";
+  version = "0.0.0.1";
+  sha256 = "16p6ckl6ml8lgy42mvivnqphfd73cg8chms3fxid66gv4fif68zl";
+  buildDepends = [ dependentSum thExtras ];
+  meta = {
+    homepage = "/dev/null";
+    description = "Template Haskell code to generate instances of classes in dependent-sum package";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/dependent-sum/default.nix b/pkgs/development/libraries/haskell/dependent-sum/default.nix
new file mode 100644
index 00000000000..3d33956edcf
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dependent-sum/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "dependent-sum";
+  version = "0.2.0.1";
+  sha256 = "07zv8rj574vf7wl3pms4q8d9m7zsfppac5vla9d9b7q11s81lldf";
+  meta = {
+    homepage = "https://github.com/mokus0/dependent-sum";
+    description = "Dependent sum type";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/derive/default.nix b/pkgs/development/libraries/haskell/derive/default.nix
index ff65518e7f9..906c51fc072 100644
--- a/pkgs/development/libraries/haskell/derive/default.nix
+++ b/pkgs/development/libraries/haskell/derive/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "derive";
-  version = "2.5.10";
-  sha256 = "0r5qcchs6kw080pw95r442yk1ld48lk2imn7apk0ibkx53i4mqls";
+  version = "2.5.11";
+  sha256 = "0934k49kpp32wffpvpk2sia7frd9ik56k6ghy6d6j31cabxf9m8r";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/diagrams/cairo.nix b/pkgs/development/libraries/haskell/diagrams/cairo.nix
new file mode 100644
index 00000000000..bc2abf5c16d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/cairo.nix
@@ -0,0 +1,19 @@
+{ cabal, cairo, cmdargs, colour, diagramsCore, diagramsLib
+, filepath, mtl, split, time
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-cairo";
+  version = "0.6";
+  sha256 = "0fxqwkv2cpgpkr80q828rm91ybn7j0dwj1p5ysc3648w28jvhkil";
+  buildDepends = [
+    cairo cmdargs colour diagramsCore diagramsLib filepath mtl split
+    time
+  ];
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams";
+    description = "Cairo backend for diagrams drawing EDSL";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/diagrams/contrib.nix b/pkgs/development/libraries/haskell/diagrams/contrib.nix
new file mode 100644
index 00000000000..141a820b5d1
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/contrib.nix
@@ -0,0 +1,25 @@
+{ cabal, arithmoi, circlePacking, colour, dataDefault, diagramsCore
+, diagramsLib, forceLayout, HUnit, lens, MonadRandom, mtl
+, QuickCheck, split, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-contrib";
+  version = "0.6.1";
+  sha256 = "0z92sfgqpfk401lzkvnsg3ij05795qc61c4lx12glbmdpfhilcpi";
+  buildDepends = [
+    arithmoi circlePacking colour dataDefault diagramsCore diagramsLib
+    forceLayout lens MonadRandom mtl split vectorSpace
+  ];
+  testDepends = [
+    diagramsLib HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams/";
+    description = "Collection of user contributions to diagrams EDSL";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/diagrams/core.nix b/pkgs/development/libraries/haskell/diagrams/core.nix
new file mode 100644
index 00000000000..ed23b092b02
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/core.nix
@@ -0,0 +1,20 @@
+{ cabal, dualTree, MemoTrie, monoidExtras, newtype, semigroups
+, vectorSpace, vectorSpacePoints
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-core";
+  version = "0.6.0.2";
+  sha256 = "1g4b1zabgfdpaf7y3804r3w04ll4sqqrf71rm9389dg17ghc1q85";
+  buildDepends = [
+    dualTree MemoTrie monoidExtras newtype semigroups vectorSpace
+    vectorSpacePoints
+  ];
+  jailbreak = true;
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams";
+    description = "Core libraries for diagrams EDSL";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/diagrams/diagrams.nix b/pkgs/development/libraries/haskell/diagrams/diagrams.nix
new file mode 100644
index 00000000000..6f201e7cd85
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/diagrams.nix
@@ -0,0 +1,18 @@
+{ cabal, diagramsContrib, diagramsCore, diagramsLib, diagramsSvg }:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams";
+  version = "0.6";
+  sha256 = "1i62jbixjzw82y622ymp6lrp4kzgn7iv55arivvh0y46bbmybqvh";
+  buildDepends = [
+    diagramsContrib diagramsCore diagramsLib diagramsSvg
+  ];
+  noHaddock = true;
+  jailbreak = true;
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams";
+    description = "Embedded domain-specific language for declarative vector graphics";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/diagrams/lib.nix b/pkgs/development/libraries/haskell/diagrams/lib.nix
new file mode 100644
index 00000000000..73c7ff8f8c4
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/lib.nix
@@ -0,0 +1,19 @@
+{ cabal, active, colour, dataDefault, diagramsCore, monoidExtras
+, newtype, NumInstances, semigroups, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-lib";
+  version = "0.6.0.3";
+  sha256 = "0rc3m2v1bxlm5rz1pi1w4k37sbgmr9qv54rllsqan1kicafjaqw1";
+  buildDepends = [
+    active colour dataDefault diagramsCore monoidExtras newtype
+    NumInstances semigroups vectorSpace
+  ];
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams";
+    description = "Embedded domain-specific language for declarative graphics";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/diagrams/svg.nix b/pkgs/development/libraries/haskell/diagrams/svg.nix
new file mode 100644
index 00000000000..561f32118c2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/diagrams/svg.nix
@@ -0,0 +1,19 @@
+{ cabal, blazeSvg, cmdargs, colour, diagramsCore, diagramsLib
+, filepath, monoidExtras, mtl, split, time, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "diagrams-svg";
+  version = "0.6.0.1";
+  sha256 = "0x4yjm1wdhicknls1y3fhdg89m8wcvfk2svabww9075w6ras79qk";
+  buildDepends = [
+    blazeSvg cmdargs colour diagramsCore diagramsLib filepath
+    monoidExtras mtl split time vectorSpace
+  ];
+  meta = {
+    homepage = "http://projects.haskell.org/diagrams/";
+    description = "SVG backend for diagrams drawing EDSL";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/dice/default.nix b/pkgs/development/libraries/haskell/dice/default.nix
new file mode 100644
index 00000000000..23d3339d348
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dice/default.nix
@@ -0,0 +1,15 @@
+{ cabal, parsec, randomFu, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "dice";
+  version = "0.1";
+  sha256 = "1rfx3vh983f3gc6si661zimhjl47ip30l3pvf7dysjirr3gffgz1";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ parsec randomFu transformers ];
+  meta = {
+    description = "Simplistic D&D style dice-rolling system";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/digest/default.nix b/pkgs/development/libraries/haskell/digest/default.nix
index bd6d249eee3..c315c0813eb 100644
--- a/pkgs/development/libraries/haskell/digest/default.nix
+++ b/pkgs/development/libraries/haskell/digest/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "digest";
-  version = "0.0.1.1";
-  sha256 = "1m04szf9yabmm6mkjq2x7a57bjdf2i611wm2k99wdcygb5cvif3v";
+  version = "0.0.1.2";
+  sha256 = "04gy2zp8yzvv7j9bdfvmfzcz3sqyqa6rwslqcn4vyair2vmif5v4";
   extraLibraries = [ zlib ];
   meta = {
     description = "Various cryptographic hashes for bytestrings; CRC32 and Adler32 for now";
diff --git a/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix b/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
index acc75a3552a..e2dc195b196 100644
--- a/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
+++ b/pkgs/development/libraries/haskell/digestive-functors-heist/default.nix
@@ -1,10 +1,13 @@
-{ cabal, digestiveFunctors, heist, text, xmlhtml }:
+{ cabal, blazeBuilder, digestiveFunctors, heist, mtl, text, xmlhtml
+}:
 
 cabal.mkDerivation (self: {
   pname = "digestive-functors-heist";
-  version = "0.5.0.0";
-  sha256 = "1cqzpnr53mailnmjgkbqk4f4hrjd84h6682mr8x7qg5v27zvcdbn";
-  buildDepends = [ digestiveFunctors heist text xmlhtml ];
+  version = "0.7.0.0";
+  sha256 = "0ljsr4yy3pb4cjg9dcgfcs9rn1ihg3xi9ak5p3h3kw3w19d1hsaq";
+  buildDepends = [
+    blazeBuilder digestiveFunctors heist mtl text xmlhtml
+  ];
   meta = {
     homepage = "http://github.com/jaspervdj/digestive-functors";
     description = "Heist frontend for the digestive-functors library";
diff --git a/pkgs/development/libraries/haskell/digestive-functors-snap/default.nix b/pkgs/development/libraries/haskell/digestive-functors-snap/default.nix
index 3d5725e603f..f23ee6d0691 100644
--- a/pkgs/development/libraries/haskell/digestive-functors-snap/default.nix
+++ b/pkgs/development/libraries/haskell/digestive-functors-snap/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "digestive-functors-snap";
-  version = "0.5.0.0";
-  sha256 = "01lbd42rsryzqzra8ax22iw6c9fyv5az8q7dkdi6yyfxdq976l0x";
+  version = "0.6.0.0";
+  sha256 = "18hc0sx7in0df6kgkc8mrxag5h2rmdj2cca9zf9w1if6wimx3g88";
   buildDepends = [ digestiveFunctors filepath mtl snapCore text ];
   meta = {
     homepage = "http://github.com/jaspervdj/digestive-functors";
diff --git a/pkgs/development/libraries/haskell/digestive-functors/default.nix b/pkgs/development/libraries/haskell/digestive-functors/default.nix
index d6d4710f306..1d3f31e5568 100644
--- a/pkgs/development/libraries/haskell/digestive-functors/default.nix
+++ b/pkgs/development/libraries/haskell/digestive-functors/default.nix
@@ -1,10 +1,17 @@
-{ cabal, mtl, text }:
+{ cabal, HUnit, mtl, QuickCheck, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "digestive-functors";
-  version = "0.5.0.2";
-  sha256 = "1phakcljl6ri2p9lfzjnn001jw0inyxa5zd7lp2k9lhq1yq0byb0";
+  version = "0.6.1.0";
+  sha256 = "0p38q8xz01vjn1mf718xi5ny3i7z9zd00lnnybmd6zy03laq4a2d";
   buildDepends = [ mtl text ];
+  testDepends = [
+    HUnit mtl QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 text
+  ];
+  jailbreak = true;
   meta = {
     homepage = "http://github.com/jaspervdj/digestive-functors";
     description = "A practical formlet library";
diff --git a/pkgs/development/libraries/haskell/dimensional-tf/default.nix b/pkgs/development/libraries/haskell/dimensional-tf/default.nix
new file mode 100644
index 00000000000..70995ecb3ce
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dimensional-tf/default.nix
@@ -0,0 +1,14 @@
+{ cabal, numtypeTf, time }:
+
+cabal.mkDerivation (self: {
+  pname = "dimensional-tf";
+  version = "0.1.1";
+  sha256 = "0hhp2nx8xyk5ms3mzg1d3jhzm1b0bxz7aijxqasrxjq9p04jr2ci";
+  buildDepends = [ numtypeTf time ];
+  meta = {
+    homepage = "http://dimensional.googlecode.com/";
+    description = "Statically checked physical dimensions, implemented using type families";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/directory-tree/default.nix b/pkgs/development/libraries/haskell/directory-tree/default.nix
index 65148f10a22..5c8b357593e 100644
--- a/pkgs/development/libraries/haskell/directory-tree/default.nix
+++ b/pkgs/development/libraries/haskell/directory-tree/default.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "directory-tree";
-  version = "0.10.1";
-  sha256 = "02acmfdw1yjb0h9dpjy04xxclsasm1p0m6w1dvccd4x2aqc6ybbw";
+  version = "0.11.0";
+  sha256 = "07vqwnzbwfjvlwcl50x5jl9yzvqfln0m4k4lam9r5n49wv7p01c9";
   buildDepends = [ filepath ];
   meta = {
-    homepage = "http://coder.bsimmons.name/blog/2009/05/directory-tree-module-released/";
+    homepage = "http://brandon.si/code/directory-tree-module-released/";
     description = "A simple directory-like tree datatype, with useful IO functions";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/distributed-process-simplelocalnet/default.nix b/pkgs/development/libraries/haskell/distributed-process-simplelocalnet/default.nix
new file mode 100644
index 00000000000..aaca850c0d7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/distributed-process-simplelocalnet/default.nix
@@ -0,0 +1,23 @@
+{ cabal, binary, dataAccessor, distributedProcess, network
+, networkMulticast, networkTransport, networkTransportTcp
+, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "distributed-process-simplelocalnet";
+  version = "0.2.0.9";
+  sha256 = "0bkb26bfpmyhh26hgznnw073kvk78ws6lqi86pxrgnnm9sx5mi21";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary dataAccessor distributedProcess network networkMulticast
+    networkTransport networkTransportTcp transformers
+  ];
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "Simple zero-configuration backend for Cloud Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/distributed-process/default.nix b/pkgs/development/libraries/haskell/distributed-process/default.nix
new file mode 100644
index 00000000000..95f7993da22
--- /dev/null
+++ b/pkgs/development/libraries/haskell/distributed-process/default.nix
@@ -0,0 +1,32 @@
+{ cabal, ansiTerminal, binary, dataAccessor, distributedStatic
+, HUnit, mtl, network, networkTransport, networkTransportTcp
+, random, rank1dynamic, stm, syb, testFramework, testFrameworkHunit
+, time, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "distributed-process";
+  version = "0.4.2";
+  sha256 = "16w8jp66903vn089ysqdn534v0744cr2m6wkqd77zri6a0caaa6c";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary dataAccessor distributedStatic mtl networkTransport random
+    rank1dynamic stm syb time transformers
+  ];
+  testDepends = [
+    ansiTerminal binary distributedStatic HUnit network
+    networkTransport networkTransportTcp random stm testFramework
+    testFrameworkHunit
+  ];
+  noHaddock = true;
+  jailbreak = true;
+  doCheck = false;
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "Cloud Haskell: Erlang-style concurrency in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/distributed-static/default.nix b/pkgs/development/libraries/haskell/distributed-static/default.nix
new file mode 100644
index 00000000000..9147b724ba2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/distributed-static/default.nix
@@ -0,0 +1,15 @@
+{ cabal, binary, rank1dynamic }:
+
+cabal.mkDerivation (self: {
+  pname = "distributed-static";
+  version = "0.2.1.1";
+  sha256 = "08y9554x6avjwdmbf33fw1pw1wl8qmgfngmgb6vgad88krnixq1h";
+  buildDepends = [ binary rank1dynamic ];
+  meta = {
+    homepage = "http://www.github.com/haskell-distributed/distributed-process";
+    description = "Compositional, type-safe, polymorphic static values and closures";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/distributive/default.nix b/pkgs/development/libraries/haskell/distributive/default.nix
index a8b07c608d8..d40952024ef 100644
--- a/pkgs/development/libraries/haskell/distributive/default.nix
+++ b/pkgs/development/libraries/haskell/distributive/default.nix
@@ -1,10 +1,11 @@
-{ cabal, transformers }:
+{ cabal, doctest, filepath, transformers, transformersCompat }:
 
 cabal.mkDerivation (self: {
   pname = "distributive";
-  version = "0.2.2";
-  sha256 = "13wvr2wb3h2nr1qd3dwjqx0b6g4igjqm3q2cyi4mc41gwihkbhr2";
-  buildDepends = [ transformers ];
+  version = "0.3.1";
+  sha256 = "0zf3wq1xz9sbb0g6fg852jckrwkffsfkghq3zx03d2q9ginc6jbc";
+  buildDepends = [ transformers transformersCompat ];
+  testDepends = [ doctest filepath ];
   meta = {
     homepage = "http://github.com/ekmett/distributive/";
     description = "Haskell 98 Distributive functors -- Dual to Traversable";
diff --git a/pkgs/development/libraries/haskell/dns/default.nix b/pkgs/development/libraries/haskell/dns/default.nix
new file mode 100644
index 00000000000..0854f39efce
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dns/default.nix
@@ -0,0 +1,18 @@
+{ cabal, attoparsec, attoparsecConduit, binary, blazeBuilder
+, conduit, iproute, mtl, network, networkConduit, random
+}:
+
+cabal.mkDerivation (self: {
+  pname = "dns";
+  version = "0.3.6";
+  sha256 = "0dpwy94id9rxxjpji47nazinm8i1ihm0606dmi5iqqhbl5h2jara";
+  buildDepends = [
+    attoparsec attoparsecConduit binary blazeBuilder conduit iproute
+    mtl network networkConduit random
+  ];
+  meta = {
+    description = "DNS library in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/doctest/default.nix b/pkgs/development/libraries/haskell/doctest/default.nix
new file mode 100644
index 00000000000..3b8c03e2da2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/doctest/default.nix
@@ -0,0 +1,23 @@
+{ cabal, baseCompat, deepseq, filepath, ghcPaths, hspec, HUnit
+, QuickCheck, setenv, silently, stringbuilder, syb, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "doctest";
+  version = "0.9.7";
+  sha256 = "0d3aywm5v3kx16c1i6cb4inr7hdnmsl8qawxp27g0yng03wdra5l";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ deepseq filepath ghcPaths syb transformers ];
+  testDepends = [
+    baseCompat deepseq filepath ghcPaths hspec HUnit QuickCheck setenv
+    silently stringbuilder syb transformers
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/sol/doctest-haskell#readme";
+    description = "Test interactive Haskell examples";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/double-conversion/default.nix b/pkgs/development/libraries/haskell/double-conversion/default.nix
index 82a1e4d4c39..cad61e52ee0 100644
--- a/pkgs/development/libraries/haskell/double-conversion/default.nix
+++ b/pkgs/development/libraries/haskell/double-conversion/default.nix
@@ -1,10 +1,11 @@
-{ cabal, text }:
+{ cabal, testFramework, testFrameworkQuickcheck2, text }:
 
 cabal.mkDerivation (self: {
   pname = "double-conversion";
-  version = "0.2.0.4";
-  sha256 = "00rb8n2ky20ah9ry398jagi9gb0gz40yjfalh35cpckmg30z199x";
+  version = "0.2.0.6";
+  sha256 = "1c6hy0ghdqf44fvhdpdxjbcr0ahimw283x5fnvjxja36i71qshjp";
   buildDepends = [ text ];
+  testDepends = [ testFramework testFrameworkQuickcheck2 text ];
   meta = {
     homepage = "https://github.com/bos/double-conversion";
     description = "Fast conversion between double precision floating point and text";
diff --git a/pkgs/development/libraries/haskell/dstring/default.nix b/pkgs/development/libraries/haskell/dstring/default.nix
index e025b00f837..4b5dd2b3888 100644
--- a/pkgs/development/libraries/haskell/dstring/default.nix
+++ b/pkgs/development/libraries/haskell/dstring/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "dstring";
-  version = "0.4.0.3";
-  sha256 = "0wzj1wzls7w79ac84sc5msblh2dmfmcxm77drpdqdirl1pwdlq9c";
+  version = "0.4.0.4";
+  sha256 = "15zy1dhfs87hxq1qm54ym0pdhvg7l76m7vy5y06dnksb1sblhaqm";
   buildDepends = [ baseUnicodeSymbols dlist ];
   meta = {
     homepage = "https://github.com/basvandijk/dstring";
diff --git a/pkgs/development/libraries/haskell/dual-tree/default.nix b/pkgs/development/libraries/haskell/dual-tree/default.nix
new file mode 100644
index 00000000000..841fae96791
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dual-tree/default.nix
@@ -0,0 +1,14 @@
+{ cabal, monoidExtras, newtype, semigroups }:
+
+cabal.mkDerivation (self: {
+  pname = "dual-tree";
+  version = "0.1.0.2";
+  sha256 = "0ys50m8yjksxi33qyk6ql4ldpdzb0fvxqvywi3y46xi16w5yrkb0";
+  buildDepends = [ monoidExtras newtype semigroups ];
+  jailbreak = true;
+  meta = {
+    description = "Rose trees with cached and accumulating monoidal annotations";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/dyre/default.nix b/pkgs/development/libraries/haskell/dyre/default.nix
new file mode 100644
index 00000000000..8b3d2cab677
--- /dev/null
+++ b/pkgs/development/libraries/haskell/dyre/default.nix
@@ -0,0 +1,18 @@
+{ cabal, binary, executablePath, filepath, ghcPaths, ioStorage
+, time, xdgBasedir
+}:
+
+cabal.mkDerivation (self: {
+  pname = "dyre";
+  version = "0.8.11";
+  sha256 = "0sg5csshznbbyvq72s4sps7bkjlkfxiwcy4i3ip83lrxjw1msvr8";
+  buildDepends = [
+    binary executablePath filepath ghcPaths ioStorage time xdgBasedir
+  ];
+  meta = {
+    homepage = "http://github.com/willdonnelly/dyre";
+    description = "Dynamic reconfiguration in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/edit-distance/default.nix b/pkgs/development/libraries/haskell/edit-distance/default.nix
index 07744765adb..22f5953b7e0 100644
--- a/pkgs/development/libraries/haskell/edit-distance/default.nix
+++ b/pkgs/development/libraries/haskell/edit-distance/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "edit-distance";
-  version = "0.2.1";
-  sha256 = "1zhiyzgqmxi4mn7zn5q6rg03hgff9y5f9xizbs00069v7ncygi38";
+  version = "0.2.1.2";
+  sha256 = "08dxsp1ar8mr4xrjy37lzl0s1rjnqsdq30p09nclip5pyhcw7g44";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ random ];
diff --git a/pkgs/development/libraries/haskell/editline/default.nix b/pkgs/development/libraries/haskell/editline/0.2.1.0.nix
index aee315d01fc..7e6262423c6 100644
--- a/pkgs/development/libraries/haskell/editline/default.nix
+++ b/pkgs/development/libraries/haskell/editline/0.2.1.0.nix
@@ -3,13 +3,12 @@
 cabal.mkDerivation (self: {
   pname = "editline";
   version = "0.2.1.0";
-  sha256 = "83618e5f86074fdc11d7f5033aa2886284462941be38fa02966acc92712c46e1";
+  sha256 = "1qa65iqr5k3ajq1glf5y84lld132i2i3l0zmsw8xqkq7hrgqwqc3";
   extraLibraries = [ libedit ];
   meta = {
     homepage = "http://code.haskell.org/editline";
     description = "Bindings to the editline library (libedit)";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/editline/0.2.1.1.nix b/pkgs/development/libraries/haskell/editline/0.2.1.1.nix
new file mode 100644
index 00000000000..cf9f1e099a2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/editline/0.2.1.1.nix
@@ -0,0 +1,14 @@
+{ cabal, libedit }:
+
+cabal.mkDerivation (self: {
+  pname = "editline";
+  version = "0.2.1.1";
+  sha256 = "101zhzja14n8bhbrly7w2aywx3sxyzgyjdrmgpg4gn4alf4lzdlz";
+  extraLibraries = [ libedit ];
+  meta = {
+    homepage = "http://code.haskell.org/editline";
+    description = "Bindings to the editline library (libedit)";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/either/default.nix b/pkgs/development/libraries/haskell/either/default.nix
new file mode 100644
index 00000000000..4730af58569
--- /dev/null
+++ b/pkgs/development/libraries/haskell/either/default.nix
@@ -0,0 +1,17 @@
+{ cabal, MonadRandom, mtl, semigroupoids, semigroups, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "either";
+  version = "3.4";
+  sha256 = "05nbp8gp50wq592k6dsrpzp6wmqjn9pz6mkizqfb65z1wvd1xiz2";
+  buildDepends = [
+    MonadRandom mtl semigroupoids semigroups transformers
+  ];
+  meta = {
+    homepage = "http://github.com/ekmett/either/";
+    description = "An either monad transformer";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/elerea/default.nix b/pkgs/development/libraries/haskell/elerea/default.nix
new file mode 100644
index 00000000000..8ba4687d3e3
--- /dev/null
+++ b/pkgs/development/libraries/haskell/elerea/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "elerea";
+  version = "2.7.0.2";
+  sha256 = "1n45q1hx548c6yqbj3321lky3xxsffpqvmcq0m9hw36d3cvwbvg0";
+  meta = {
+    description = "A minimalistic FRP library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/email-validate/default.nix b/pkgs/development/libraries/haskell/email-validate/default.nix
index 89c5ddb02d7..3ba05926179 100644
--- a/pkgs/development/libraries/haskell/email-validate/default.nix
+++ b/pkgs/development/libraries/haskell/email-validate/default.nix
@@ -1,10 +1,16 @@
-{ cabal, parsec, ranges }:
+{ cabal, attoparsec, HUnit, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "email-validate";
-  version = "0.2.8";
-  sha256 = "04cz1nm1zkb46kdxs43pmkxli2xm5nqlh951nn0mdgy6hqhkpkqd";
-  buildDepends = [ parsec ranges ];
+  version = "1.0.0";
+  sha256 = "0sj1cvn9ap0m8d4cg4cqavvmkd74vp86lyyra9g6f17815sxdbsg";
+  buildDepends = [ attoparsec ];
+  testDepends = [
+    HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://porg.es/blog/email-address-validation-simpler-faster-more-correct";
     description = "Validating an email address string against RFC 5322";
diff --git a/pkgs/development/libraries/haskell/encoding/default.nix b/pkgs/development/libraries/haskell/encoding/default.nix
new file mode 100644
index 00000000000..1b7ef1bcd1d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/encoding/default.nix
@@ -0,0 +1,16 @@
+{ cabal, binary, extensibleExceptions, HaXml, mtl, regexCompat }:
+
+cabal.mkDerivation (self: {
+  pname = "encoding";
+  version = "0.6.7.2";
+  sha256 = "0b1z5824vdkcc51bd1vgcbaniw3fv9dmd5qczjc89b5lhrl7qq0d";
+  buildDepends = [
+    binary extensibleExceptions HaXml mtl regexCompat
+  ];
+  meta = {
+    homepage = "http://code.haskell.org/encoding/";
+    description = "A library for various character encodings";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/entropy/default.nix b/pkgs/development/libraries/haskell/entropy/default.nix
index 004d7492c51..f98903d3dc1 100644
--- a/pkgs/development/libraries/haskell/entropy/default.nix
+++ b/pkgs/development/libraries/haskell/entropy/default.nix
@@ -2,10 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "entropy";
-  version = "0.2.1";
-  sha256 = "1qp8hvdzfgg2wk7d431qycwbn2zpzlplc1c7dbhimj1had5jscrs";
+  version = "0.2.2";
+  sha256 = "1zri5qs19cbz9ydbh076q6834pspf2gqn06ssz4hsq6j65cnd9x2";
   meta = {
-    homepage = "http://trac.haskell.org/crypto-api/wiki";
+    homepage = "https://github.com/TomMD/entropy";
     description = "A platform independent entropy source";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/errors/default.nix b/pkgs/development/libraries/haskell/errors/default.nix
new file mode 100644
index 00000000000..7ed890c513c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/errors/default.nix
@@ -0,0 +1,13 @@
+{ cabal, either, safe, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "errors";
+  version = "1.4.1";
+  sha256 = "18npfwr6byh0aib9qxpynr2gf0v92c0xbxky4a733jbdrwli5c40";
+  buildDepends = [ either safe transformers ];
+  meta = {
+    description = "Simplified error-handling";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/exception-mtl/default.nix b/pkgs/development/libraries/haskell/exception-mtl/default.nix
index 9b378751ebf..2c64598d1d0 100644
--- a/pkgs/development/libraries/haskell/exception-mtl/default.nix
+++ b/pkgs/development/libraries/haskell/exception-mtl/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "exception-mtl";
-  version = "0.3.0.2";
-  sha256 = "1mhk1z7hz50h8ssr4s7dzdxzn02rr0njxijdddfjjw71fln3nl5h";
+  version = "0.3.0.3";
+  sha256 = "1mmkp16c5ixknhm69a2zjrs9q0dd5ragmljnjjd6lxpakdlw64ww";
   buildDepends = [ exceptionTransformers mtl transformers ];
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
diff --git a/pkgs/development/libraries/haskell/exception-transformers/default.nix b/pkgs/development/libraries/haskell/exception-transformers/default.nix
index b1e0fcec5e0..a4d0cfd247a 100644
--- a/pkgs/development/libraries/haskell/exception-transformers/default.nix
+++ b/pkgs/development/libraries/haskell/exception-transformers/default.nix
@@ -1,10 +1,11 @@
-{ cabal, stm, transformers }:
+{ cabal, HUnit, stm, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "exception-transformers";
-  version = "0.3.0.2";
-  sha256 = "1ah3dimnc980vkr2lycpl4nsb615gxqws6mv9j90mz6g165h9khf";
+  version = "0.3.0.3";
+  sha256 = "0z3z5pppaqqbndd4fgv1czr8f9f4a8r86bwc3bcv88yf7y8cfbwz";
   buildDepends = [ stm transformers ];
+  testDepends = [ HUnit transformers ];
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
     description = "Type classes and monads for unchecked extensible exceptions";
diff --git a/pkgs/development/libraries/haskell/explicit-exception/default.nix b/pkgs/development/libraries/haskell/explicit-exception/default.nix
index 86d4cc50c3b..0f2385a004f 100644
--- a/pkgs/development/libraries/haskell/explicit-exception/default.nix
+++ b/pkgs/development/libraries/haskell/explicit-exception/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "explicit-exception";
-  version = "0.1.7";
-  sha256 = "0pqh97fxs55554bd16dknggkr0yayqj1dz0sddp9b2svjy2q4vrm";
+  version = "0.1.7.1";
+  sha256 = "15p5pndam6byd3p8qlnn8pjdhb7rvn93fxa2m40x3wxh58ymkh14";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ transformers ];
diff --git a/pkgs/development/libraries/haskell/fast-logger/default.nix b/pkgs/development/libraries/haskell/fast-logger/default.nix
index 74f78e72af2..c9544b2c1f6 100644
--- a/pkgs/development/libraries/haskell/fast-logger/default.nix
+++ b/pkgs/development/libraries/haskell/fast-logger/default.nix
@@ -1,10 +1,12 @@
-{ cabal, blazeBuilder, filepath, text, unixTime }:
+{ cabal, blazeBuilder, dateCache, filepath, hspec, text, unixTime
+}:
 
 cabal.mkDerivation (self: {
   pname = "fast-logger";
-  version = "0.2.2";
-  sha256 = "1r1fk0lqmh49v24wnx236x9cz122c8806y9mrxnaihxggw4anj0x";
-  buildDepends = [ blazeBuilder filepath text unixTime ];
+  version = "0.3.1";
+  sha256 = "0sjn3vad0fbchv1fhap71wfnihlwnfhk6p9h9hpnbr0i4b32f1ks";
+  buildDepends = [ blazeBuilder dateCache filepath text unixTime ];
+  testDepends = [ hspec ];
   meta = {
     description = "A fast logging system";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/fclabels/default.nix b/pkgs/development/libraries/haskell/fclabels/default.nix
index 25ec69c8459..0064a7f425a 100644
--- a/pkgs/development/libraries/haskell/fclabels/default.nix
+++ b/pkgs/development/libraries/haskell/fclabels/default.nix
@@ -2,10 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "fclabels";
-  version = "1.1.4";
-  sha256 = "0b15nvnsxckw75q7dgrfxnnjc93ah140gi3s5wpb41q0fnvl9npz";
+  version = "1.1.6";
+  sha256 = "0f5zqbqsm89lp1f7wrmcs8pn7hzbbl8id7xa6ny114bgxrfbrwpk";
   buildDepends = [ mtl transformers ];
   meta = {
+    homepage = "https://github.com/sebastiaanvisser/fclabels";
     description = "First class accessor labels";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/fgl-visualize/default.nix b/pkgs/development/libraries/haskell/fgl-visualize/default.nix
index 279f25eaca2..c446ae8545d 100644
--- a/pkgs/development/libraries/haskell/fgl-visualize/default.nix
+++ b/pkgs/development/libraries/haskell/fgl-visualize/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "fgl-visualize";
-  version = "0.1";
-  sha256 = "0ri6ywg7rj8qfyngjxvihw43s2h2l3w03fwq1ipn59cdcnah08bc";
+  version = "0.1.0.1";
+  sha256 = "0vwafx0rggksg5i7cx4r2bs5wa6csb5p39vpix425zr3l6vggrxq";
   buildDepends = [ dotgen fgl ];
   meta = {
     description = "Convert FGL graphs to dot (graphviz) files";
diff --git a/pkgs/development/libraries/haskell/file-embed/default.nix b/pkgs/development/libraries/haskell/file-embed/default.nix
index 1ca06b356ec..ccb0f8bac82 100644
--- a/pkgs/development/libraries/haskell/file-embed/default.nix
+++ b/pkgs/development/libraries/haskell/file-embed/default.nix
@@ -1,9 +1,11 @@
-{ cabal }:
+{ cabal, filepath, HUnit }:
 
 cabal.mkDerivation (self: {
   pname = "file-embed";
-  version = "0.0.4.4";
-  sha256 = "1czwa5vpafhvif4gv7bwa7hrxkrbrvvybgyjckd0hdpl6bpd4nhp";
+  version = "0.0.4.8";
+  sha256 = "1jq4jdrxw822gzz7mc07nx4yj233mwmykp6xk371pf3hnq8rly0h";
+  buildDepends = [ filepath ];
+  testDepends = [ filepath HUnit ];
   meta = {
     homepage = "https://github.com/snoyberg/file-embed";
     description = "Use Template Haskell to embed file contents directly";
diff --git a/pkgs/development/libraries/haskell/file-location/default.nix b/pkgs/development/libraries/haskell/file-location/default.nix
new file mode 100644
index 00000000000..8a28d0b27fb
--- /dev/null
+++ b/pkgs/development/libraries/haskell/file-location/default.nix
@@ -0,0 +1,15 @@
+{ cabal, liftedBase, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "file-location";
+  version = "0.4.5.2";
+  sha256 = "0dyzf2lhh0n4hwbh44qfh6bw9snl4hha9sv76c4ndi7v1rvnx197";
+  buildDepends = [ liftedBase transformers ];
+  testDepends = [ liftedBase transformers ];
+  meta = {
+    homepage = "https://github.com/gregwebs/FileLocation.hs";
+    description = "common functions that show file location information";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/filepath/default.nix b/pkgs/development/libraries/haskell/filepath/default.nix
index ae28bdc2e41..0cd65bb1905 100644
--- a/pkgs/development/libraries/haskell/filepath/default.nix
+++ b/pkgs/development/libraries/haskell/filepath/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "filepath";
-  version = "1.3.0.0";
-  sha256 = "1v5affq82b4fypm49d5sradcx4ymgmkac563vfx483pmyl73i5jl";
+  version = "1.3.0.1";
+  sha256 = "1ny8dz8rv883vg6hkzg3zank771cr2z9sfhii7aw4rfb71k29g5p";
   meta = {
     homepage = "http://www-users.cs.york.ac.uk/~ndm/filepath/";
     description = "Library for manipulating FilePaths in a cross platform way";
diff --git a/pkgs/development/libraries/haskell/filestore/default.nix b/pkgs/development/libraries/haskell/filestore/default.nix
index b0cc40d3914..04321d34ffa 100644
--- a/pkgs/development/libraries/haskell/filestore/default.nix
+++ b/pkgs/development/libraries/haskell/filestore/default.nix
@@ -4,17 +4,11 @@
 
 cabal.mkDerivation (self: {
   pname = "filestore";
-  version = "0.5";
-  sha256 = "0cppm8iksz4dnh4kafyfy0cqbidw83rdpgc1mksiwh9c9gaxrlq7";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [
-    Diff filepath HUnit mtl parsec split time utf8String xml
-  ];
-  patchPhase = ''
-    sed -i -e 's|split.*,|split,|' filestore.cabal
-  '';
-  noHaddock = true;
+  version = "0.6.0.1";
+  sha256 = "1la30bimcjngcv5dyx1a9x8lr8c4zs0dp4kzh8y5mjf8snky1avf";
+  buildDepends = [ Diff filepath parsec split time utf8String xml ];
+  testDepends = [ Diff filepath HUnit mtl time ];
+  doCheck = false;
   meta = {
     description = "Interface for versioning file stores";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/filesystem-conduit/default.nix b/pkgs/development/libraries/haskell/filesystem-conduit/default.nix
new file mode 100644
index 00000000000..46ae27fc090
--- /dev/null
+++ b/pkgs/development/libraries/haskell/filesystem-conduit/default.nix
@@ -0,0 +1,21 @@
+{ cabal, blazeBuilder, conduit, hspec, QuickCheck, systemFileio
+, systemFilepath, text, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "filesystem-conduit";
+  version = "1.0.0";
+  sha256 = "1fz3iihcqpg6m3svjqdg8lvkpza955qn8cbs9b3w333vxkglhi6v";
+  buildDepends = [
+    conduit systemFileio systemFilepath text transformers
+  ];
+  testDepends = [
+    blazeBuilder conduit hspec QuickCheck text transformers
+  ];
+  meta = {
+    homepage = "http://github.com/snoyberg/conduit";
+    description = "Use system-filepath data types with conduits";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/fingertree/default.nix b/pkgs/development/libraries/haskell/fingertree/default.nix
index 71afad2cdbc..299b2e926db 100644
--- a/pkgs/development/libraries/haskell/fingertree/default.nix
+++ b/pkgs/development/libraries/haskell/fingertree/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "fingertree";
-  version = "0.0.1.0";
-  sha256 = "e80bf256506290c8f4fb44222920ae7d8405fd22e453c7a08dba49297d49328b";
+  version = "0.0.1.1";
+  sha256 = "00llr24b2r539250fangl0jj39gf26gjwvhjpy5qg8l920hrjn78";
   meta = {
     description = "Generic finger-tree structure, with example instances";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/flexible-defaults/default.nix b/pkgs/development/libraries/haskell/flexible-defaults/default.nix
index 40ac59d1c9e..7be21dbbf34 100644
--- a/pkgs/development/libraries/haskell/flexible-defaults/default.nix
+++ b/pkgs/development/libraries/haskell/flexible-defaults/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "flexible-defaults";
-  version = "0.0.0.3";
-  sha256 = "1s0dz61bqzzbxqvn9i8zwaccsha15als45zzjs2yc11r3m151dla";
+  version = "0.0.1.1";
+  sha256 = "0cbp8hb7y29xz3hl780173cs6ca4df0r98fz7v3drqr46aq55ipl";
   buildDepends = [ thExtras transformers ];
   meta = {
     homepage = "https://github.com/mokus0/flexible-defaults";
diff --git a/pkgs/development/libraries/haskell/force-layout/default.nix b/pkgs/development/libraries/haskell/force-layout/default.nix
new file mode 100644
index 00000000000..025ed14869f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/force-layout/default.nix
@@ -0,0 +1,13 @@
+{ cabal, lens, newtype, vectorSpace, vectorSpacePoints }:
+
+cabal.mkDerivation (self: {
+  pname = "force-layout";
+  version = "0.2";
+  sha256 = "0aif7a28qs8ya7q9sklp02gb5228jyj8k4jabbp2sia7j4khrkpv";
+  buildDepends = [ lens newtype vectorSpace vectorSpacePoints ];
+  meta = {
+    description = "Simple force-directed layout";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/fsnotify/default.nix b/pkgs/development/libraries/haskell/fsnotify/default.nix
new file mode 100644
index 00000000000..1ef55d105f7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/fsnotify/default.nix
@@ -0,0 +1,20 @@
+{ cabal, Cabal, Glob, hinotify, hspec, QuickCheck, random
+, systemFileio, systemFilepath, text, time, uniqueid
+}:
+
+cabal.mkDerivation (self: {
+  pname = "fsnotify";
+  version = "0.0.11";
+  sha256 = "03m911pncyzgfdx4aj38azbbmj25fdm3s9l1w27zv0l730fy8ywq";
+  buildDepends = [ hinotify systemFileio systemFilepath text time ];
+  testDepends = [
+    Cabal Glob hinotify hspec QuickCheck random systemFileio
+    systemFilepath text time uniqueid
+  ];
+  doCheck = false;
+  meta = {
+    description = "Cross platform library for file change notification";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/funcmp/default.nix b/pkgs/development/libraries/haskell/funcmp/default.nix
index f6893cc3797..d17ca718f0a 100644
--- a/pkgs/development/libraries/haskell/funcmp/default.nix
+++ b/pkgs/development/libraries/haskell/funcmp/default.nix
@@ -2,14 +2,17 @@
 
 cabal.mkDerivation (self: {
   pname = "funcmp";
-  version = "1.6";
-  sha256 = "1l317gnav6adbdi849zdcgcvrlcs4mz4p0s67wg323prq713fkz0";
+  version = "1.7";
+  sha256 = "1rna7x7lw36fv5pyq0zn4b472mh11r0bszzji13wm3byhhmzs04k";
   buildDepends = [ filepath ];
   meta = {
     homepage = "http://savannah.nongnu.org/projects/funcmp/";
     description = "Functional MetaPost";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/generic-deriving/default.nix b/pkgs/development/libraries/haskell/generic-deriving/default.nix
index ffc44542976..043156ab5e1 100644
--- a/pkgs/development/libraries/haskell/generic-deriving/default.nix
+++ b/pkgs/development/libraries/haskell/generic-deriving/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "generic-deriving";
-  version = "1.2.1";
-  sha256 = "0ld4kh3p3lmavxi4y25fpxvq75qk7bd87yvwcbj63j6af1v60h2z";
+  version = "1.5.0";
+  sha256 = "1m3hckwpzmarlvm2xq22za3386ady6p89kg7nd8cnjkifnnbz20r";
   meta = {
     description = "Generic programming library for generalised deriving";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/geniplate/default.nix b/pkgs/development/libraries/haskell/geniplate/default.nix
new file mode 100644
index 00000000000..eff79afa416
--- /dev/null
+++ b/pkgs/development/libraries/haskell/geniplate/default.nix
@@ -0,0 +1,13 @@
+{ cabal, mtl }:
+
+cabal.mkDerivation (self: {
+  pname = "geniplate";
+  version = "0.6.0.3";
+  sha256 = "1n73p57gkn9qf7jn54izypc7zycd9i6y9z9i1gc8yn1wd8sv7vkn";
+  buildDepends = [ mtl ];
+  meta = {
+    description = "Use template Haskell to generate Uniplate-like functions";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/ghc-core/default.nix b/pkgs/development/libraries/haskell/ghc-core/default.nix
index fd1e45d1e2e..8c2f481122b 100644
--- a/pkgs/development/libraries/haskell/ghc-core/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-core/default.nix
@@ -2,13 +2,13 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-core";
-  version = "0.5.4";
-  sha256 = "1s68m2zkpz0n927rgzg0l0r5v8pk3z03rlkd82h83agw0hzb9ng7";
+  version = "0.5.6";
+  sha256 = "11byidxq2mcqams9a7df0hwwlzir639mr1s556sw5rrbi7jz6d7c";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ colorizeHaskell filepath pcreLight ];
   meta = {
-    homepage = "http://code.haskell.org/~dons/code/ghc-core";
+    homepage = "https://github.com/shachaf/ghc-core";
     description = "Display GHC's core and assembly output in a pager";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/ghc-events/default.nix b/pkgs/development/libraries/haskell/ghc-events/default.nix
index 4827b749484..5b7decf9416 100644
--- a/pkgs/development/libraries/haskell/ghc-events/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-events/default.nix
@@ -2,15 +2,13 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-events";
-  version = "0.4.0.0";
-  sha256 = "0q1r5jxk8ma8rg65n4iixl5zyk4nxpzi4ywf0jz8y1nbbhbas7g2";
+  version = "0.4.2.0";
+  sha256 = "0209r9g5w4ifsaw3dkfra6kma1vyk50dc306an72mcwnp4l7dv4l";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ binary mtl ];
-  patchPhase = ''
-    sed -i -e 's|mtl *>=.*$|mtl,|' ghc-events.cabal
-  '';
-  noHaddock = true;
+  testDepends = [ binary mtl ];
+  doCheck = false;
   meta = {
     description = "Library and tool for parsing .eventlog files from GHC";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/ghc-heap-view/default.nix b/pkgs/development/libraries/haskell/ghc-heap-view/default.nix
new file mode 100644
index 00000000000..342e2a7cd31
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ghc-heap-view/default.nix
@@ -0,0 +1,14 @@
+{ cabal, binary, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "ghc-heap-view";
+  version = "0.5.0.1";
+  sha256 = "1zqzv6r4nkzam51bb6pp2i1kkzhx5mnaqcn8wzr0hxbi5lc1088h";
+  buildDepends = [ binary transformers ];
+  meta = {
+    description = "Extract the heap representation of Haskell values and thunks";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/ghc-mod/default.nix b/pkgs/development/libraries/haskell/ghc-mod/default.nix
index b4412c35421..fe0602bf888 100644
--- a/pkgs/development/libraries/haskell/ghc-mod/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mod/default.nix
@@ -1,18 +1,23 @@
-{ cabal, Cabal, emacs, filepath, ghcPaths, ghcSybUtils, hlint
-, ioChoice, regexPosix, syb, transformers
+{ cabal, Cabal, convertible, emacs, filepath, ghcPaths, ghcSybUtils
+, hlint, hspec, ioChoice, syb, time, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "ghc-mod";
-  version = "1.11.0";
-  sha256 = "19cx6jhciww2xgad3q35h3jlwiv9s9b6na2qi1cbga7p77swarsv";
-  isLibrary = false;
+  version = "2.0.3";
+  sha256 = "0f0n4cqpspad3ygw89rp8wj1gxb7mv5zrd8938zm1rn2mimihggr";
+  isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    Cabal filepath ghcPaths ghcSybUtils hlint ioChoice regexPosix syb
-    transformers
+    Cabal convertible filepath ghcPaths ghcSybUtils hlint ioChoice syb
+    time transformers
+  ];
+  testDepends = [
+    Cabal convertible filepath ghcPaths ghcSybUtils hlint hspec
+    ioChoice syb time transformers
   ];
   buildTools = [ emacs ];
+  doCheck = false;
   postInstall = ''
       cd $out/share/$pname-$version
       make
@@ -23,7 +28,7 @@ cabal.mkDerivation (self: {
     '';
   meta = {
     homepage = "http://www.mew.org/~kazu/proj/ghc-mod/";
-    description = "Happy Haskell programming on Emacs/Vim";
+    description = "Happy Haskell Programming";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [
diff --git a/pkgs/development/libraries/haskell/ghc-mtl/default.nix b/pkgs/development/libraries/haskell/ghc-mtl/default.nix
index f885b9a5313..ea2495f6586 100644
--- a/pkgs/development/libraries/haskell/ghc-mtl/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-mtl/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-mtl";
-  version = "1.0.1.1";
-  sha256 = "04lm1g27xwwph02k3d8b51nbhi2sw8jx7arqczcqc3rygak10fpn";
+  version = "1.0.1.2";
+  sha256 = "06m8ynqlbvvs37w211ikldwvlvg4ry27x9l7idnwa1m8w2jkbkva";
   buildDepends = [ MonadCatchIOMtl mtl ];
   meta = {
     homepage = "http://darcsden.com/jcpetruzza/ghc-mtl";
diff --git a/pkgs/development/libraries/haskell/ghc-paths/default.nix b/pkgs/development/libraries/haskell/ghc-paths/default.nix
index 8f01db02f99..b930e993dcc 100644
--- a/pkgs/development/libraries/haskell/ghc-paths/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-paths/default.nix
@@ -2,8 +2,9 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-paths";
-  version = "0.1.0.8";
-  sha256 = "0mhc5zhbybp1vmkjsqbca51993vkpx5g8hql160m8m95apkc2wl6";
+  version = "0.1.0.9";
+  sha256 = "0ibrr1dxa35xx20cpp8jzgfak1rdmy344dfwq4vlq013c6w8z9mg";
+  patches = [ ./ghc-paths-nix.patch ];
   meta = {
     description = "Knowledge of GHC's installation directories";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/ghc-paths/ghc-paths-nix.patch b/pkgs/development/libraries/haskell/ghc-paths/ghc-paths-nix.patch
new file mode 100644
index 00000000000..b3c75a26a03
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ghc-paths/ghc-paths-nix.patch
@@ -0,0 +1,43 @@
+diff -Naur ghc-paths-0.1.0.9/GHC/Paths.hs ghc-paths-0.1.0.9-new/GHC/Paths.hs
+--- ghc-paths-0.1.0.9/GHC/Paths.hs	2012-12-16 13:53:45.720148396 +0100
++++ ghc-paths-0.1.0.9-new/GHC/Paths.hs	2012-12-16 17:22:12.765576568 +0100
+@@ -1,13 +1,35 @@
+ {-# LANGUAGE CPP #-}
++{-# LANGUAGE ScopedTypeVariables #-}
+ 
+ module GHC.Paths (
+         ghc, ghc_pkg, libdir, docdir
+   ) where
+ 
++import Control.Exception as E
++import Data.Maybe
++import System.Environment
++import System.IO.Unsafe
++
++-- Yes, there's lookupEnv now, but we want to be compatible
++-- with older GHCs.
++checkEnv :: String -> IO (Maybe String)
++checkEnv var = E.catch (fmap Just (getEnv var))
++                       (\ (e :: IOException) -> return Nothing)
++
++nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath
++nixLibdir = unsafePerformIO (checkEnv "NIX_GHC_LIBDIR")
++nixDocdir = unsafePerformIO (checkEnv "NIX_GHC_DOCDIR")
++nixGhc    = unsafePerformIO (checkEnv "NIX_GHC")
++nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCPKG")
++{-# NOINLINE nixLibdir #-}
++{-# NOINLINE nixDocdir #-}
++{-# NOINLINE nixGhc    #-}
++{-# NOINLINE nixGhcPkg #-}
++
+ libdir, docdir, ghc, ghc_pkg :: FilePath
+ 
+-libdir  = GHC_PATHS_LIBDIR
+-docdir  = GHC_PATHS_DOCDIR
++libdir  = fromMaybe GHC_PATHS_LIBDIR  nixLibdir
++docdir  = fromMaybe GHC_PATHS_DOCDIR  nixDocdir
+ 
+-ghc     = GHC_PATHS_GHC
+-ghc_pkg = GHC_PATHS_GHC_PKG
++ghc     = fromMaybe GHC_PATHS_GHC     nixGhc
++ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg
diff --git a/pkgs/development/libraries/haskell/ghc-syb-utils/default.nix b/pkgs/development/libraries/haskell/ghc-syb-utils/default.nix
index 804e55a2245..6f5f1458507 100644
--- a/pkgs/development/libraries/haskell/ghc-syb-utils/default.nix
+++ b/pkgs/development/libraries/haskell/ghc-syb-utils/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "ghc-syb-utils";
-  version = "0.2.1.0";
-  sha256 = "02wmd4zkng38z3bhsk4w4dqj1lzznhg2p0ijwr1a0dgx8cqr490z";
+  version = "0.2.1.1";
+  sha256 = "1fwlzqbkjn592jh01nccn99iii6047fg9f3hh255586nzngihh1l";
   buildDepends = [ syb ];
   meta = {
     homepage = "http://github.com/nominolo/ghc-syb";
diff --git a/pkgs/development/libraries/haskell/ghc-vis/default.nix b/pkgs/development/libraries/haskell/ghc-vis/default.nix
new file mode 100644
index 00000000000..12508a09c63
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ghc-vis/default.nix
@@ -0,0 +1,20 @@
+{ cabal, cairo, deepseq, fgl, ghcHeapView, graphviz, gtk, mtl
+, svgcairo, text, transformers, xdot
+}:
+
+cabal.mkDerivation (self: {
+  pname = "ghc-vis";
+  version = "0.7.0.1";
+  sha256 = "0k6pm1lqmcmgdqzcdbygdyg6bgx4k0gi77k1mxwprgr9vv3ly26w";
+  buildDepends = [
+    cairo deepseq fgl ghcHeapView graphviz gtk mtl svgcairo text
+    transformers xdot
+  ];
+  meta = {
+    homepage = "http://felsin9.de/nnis/ghc-vis";
+    description = "Live visualization of data structures in GHCi";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/gio/default.nix b/pkgs/development/libraries/haskell/gio/default.nix
index 98a3d32348e..e9d295798b6 100644
--- a/pkgs/development/libraries/haskell/gio/default.nix
+++ b/pkgs/development/libraries/haskell/gio/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "gio";
-  version = "0.12.3";
-  sha256 = "0kmqldlgxwj8sh0b5k5gicc5z2n6mc9h3fmdby4wx1l4ska7rajn";
+  version = "0.12.4";
+  sha256 = "0npvq77z72c9z009krvs4n9vv3gqj6g8fdqd777kzw1dbkhp9ziy";
   buildDepends = [ glib mtl ];
   buildTools = [ gtk2hsBuildtools ];
   pkgconfigDepends = [ glib ];
diff --git a/pkgs/development/libraries/haskell/github/default.nix b/pkgs/development/libraries/haskell/github/default.nix
new file mode 100644
index 00000000000..78711cc7c44
--- /dev/null
+++ b/pkgs/development/libraries/haskell/github/default.nix
@@ -0,0 +1,20 @@
+{ cabal, aeson, attoparsec, caseInsensitive, conduit, dataDefault
+, failure, HTTP, httpConduit, httpTypes, network, text, time
+, unorderedContainers, vector
+}:
+
+cabal.mkDerivation (self: {
+  pname = "github";
+  version = "0.7.0";
+  sha256 = "0r803hpyyd0nfhlk5jn4ripzi2cpj708zp9g961g7wvvvi66013p";
+  buildDepends = [
+    aeson attoparsec caseInsensitive conduit dataDefault failure HTTP
+    httpConduit httpTypes network text time unorderedContainers vector
+  ];
+  meta = {
+    homepage = "https://github.com/fpco/github";
+    description = "Access to the Github API, v3";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/gitit/default.nix b/pkgs/development/libraries/haskell/gitit/default.nix
index 148750e9ddc..9213c534fa3 100644
--- a/pkgs/development/libraries/haskell/gitit/default.nix
+++ b/pkgs/development/libraries/haskell/gitit/default.nix
@@ -7,8 +7,8 @@
 
 cabal.mkDerivation (self: {
   pname = "gitit";
-  version = "0.10.0.1";
-  sha256 = "0dx4jq7j0s6h5lfl8qrr4qnyb3j0cnnc1c786yf8kcmhk04n028f";
+  version = "0.10.3.1";
+  sha256 = "1sm6rryfyqr0nd4flbc5d520xyw2ajnkylvqf4fi4dhl6fnbpam5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -18,9 +18,6 @@ cabal.mkDerivation (self: {
     safe SHA syb tagsoup text time url utf8String xhtml xml xssSanitize
     zlib
   ];
-  patchPhase = ''
-    sed -i -e 's|hslogger.*,|hslogger,|' gitit.cabal
-  '';
   meta = {
     homepage = "http://gitit.net";
     description = "Wiki using happstack, git or darcs, and pandoc";
diff --git a/pkgs/development/libraries/haskell/glib/default.nix b/pkgs/development/libraries/haskell/glib/default.nix
index 86ce395f1ff..29d2f92d7ba 100644
--- a/pkgs/development/libraries/haskell/glib/default.nix
+++ b/pkgs/development/libraries/haskell/glib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "glib";
-  version = "0.12.3.1";
-  sha256 = "1k5s1d05kv0amvkjr644pqvicvmcgr5fffsz0xyljbj5jk4iv0py";
+  version = "0.12.4";
+  sha256 = "0s92phy1xlgjzqc7y5plviipb98m13h5lj4n9g6lbv4i106z97ax";
   buildTools = [ gtk2hsBuildtools ];
   extraLibraries = [ libc pkgconfig ];
   pkgconfigDepends = [ glib ];
diff --git a/pkgs/development/libraries/haskell/gloss/default.nix b/pkgs/development/libraries/haskell/gloss/default.nix
index 08e08e29ec0..003207e77ae 100644
--- a/pkgs/development/libraries/haskell/gloss/default.nix
+++ b/pkgs/development/libraries/haskell/gloss/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "gloss";
-  version = "1.7.4.1";
-  sha256 = "01mxazdgmz3k8y4s2k2mj11g1m788dykx60i7bqbdwzbzc65hcfw";
+  version = "1.7.8.3";
+  sha256 = "0wbp8bz5c3hzix6r7nbg6dmakb77i3lq4hgjk3gd8mvksd3n97jr";
   buildDepends = [ bmp GLUT OpenGL ];
+  jailbreak = true;
   meta = {
     homepage = "http://gloss.ouroborus.net";
     description = "Painless 2D vector graphics, animations and simulations";
diff --git a/pkgs/development/libraries/haskell/glpk-hs/default.nix b/pkgs/development/libraries/haskell/glpk-hs/default.nix
index 006f227a8c2..fbbe7d31c2a 100644
--- a/pkgs/development/libraries/haskell/glpk-hs/default.nix
+++ b/pkgs/development/libraries/haskell/glpk-hs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "glpk-hs";
-  version = "0.3.3";
-  sha256 = "1pnq0v5va7f40ky9xb8c4z9wcmmnny2vk4afasz5pwivbxh42mfl";
+  version = "0.3.4";
+  sha256 = "0wyasd0dqi5nnh52lx980vnyhm0rwib0sd7qnpj4s9hq8rn994cm";
   buildDepends = [ deepseq mtl ];
   extraLibraries = [ glpk ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/gnuidn/default.nix b/pkgs/development/libraries/haskell/gnuidn/default.nix
new file mode 100644
index 00000000000..6ae78cf49b6
--- /dev/null
+++ b/pkgs/development/libraries/haskell/gnuidn/default.nix
@@ -0,0 +1,17 @@
+{ cabal, c2hs, libidn, text }:
+
+cabal.mkDerivation (self: {
+  pname = "gnuidn";
+  version = "0.2";
+  sha256 = "0xk72p3z1lwlmab0jcf7m48p5pncgz00hb7l96naz1gdkbq7xizd";
+  buildDepends = [ text ];
+  buildTools = [ c2hs ];
+  extraLibraries = [ libidn ];
+  pkgconfigDepends = [ libidn ];
+  meta = {
+    homepage = "http://john-millikin.com/software/bindings/gnuidn/";
+    description = "Bindings for GNU IDN";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/gnutls/default.nix b/pkgs/development/libraries/haskell/gnutls/default.nix
new file mode 100644
index 00000000000..72f98677ce6
--- /dev/null
+++ b/pkgs/development/libraries/haskell/gnutls/default.nix
@@ -0,0 +1,16 @@
+{ cabal, gnutls, monadsTf, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "gnutls";
+  version = "0.1.4";
+  sha256 = "0xgjp274m4z005z77lhmh7blg6rw9g28jm0sd376rr49hykbxwd1";
+  buildDepends = [ monadsTf transformers ];
+  extraLibraries = [ gnutls ];
+  pkgconfigDepends = [ gnutls ];
+  meta = {
+    homepage = "https://john-millikin.com/software/haskell-gnutls/";
+    description = "Bindings for GNU libgnutls";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/graphviz/default.nix b/pkgs/development/libraries/haskell/graphviz/default.nix
index 77867472d66..6f7aea3289e 100644
--- a/pkgs/development/libraries/haskell/graphviz/default.nix
+++ b/pkgs/development/libraries/haskell/graphviz/default.nix
@@ -1,14 +1,23 @@
-{ cabal, colour, dlist, fgl, filepath, polyparse, text
-, transformers, wlPprintText
+{ cabal, colour, dlist, fgl, filepath, polyparse, QuickCheck
+, temporary, text, transformers, wlPprintText
 }:
 
 cabal.mkDerivation (self: {
   pname = "graphviz";
-  version = "2999.13.0.3";
-  sha256 = "0rwjlwfa3s1vgh5mwzwmzq4s153iq338zy7jqi0qyxcs52illqq8";
+  version = "2999.16.0.0";
+  sha256 = "1g4q4wyj5amz9xvgnqn143p5nq6m4a0lggxz7jn9l2hwp41bx1g8";
   buildDepends = [
-    colour dlist fgl filepath polyparse text transformers wlPprintText
+    colour dlist fgl filepath polyparse temporary text transformers
+    wlPprintText
   ];
+  testDepends = [
+    colour dlist fgl filepath polyparse QuickCheck temporary text
+    transformers wlPprintText
+  ];
+  patchPhase = ''
+    sed -i -e 's|polyparse.*,|polyparse,|' graphviz.cabal
+  '';
+  doCheck = false;
   meta = {
     homepage = "http://projects.haskell.org/graphviz/";
     description = "Bindings to Graphviz for graph visualisation";
diff --git a/pkgs/development/libraries/haskell/groupoids/default.nix b/pkgs/development/libraries/haskell/groupoids/default.nix
new file mode 100644
index 00000000000..4c085c0ae23
--- /dev/null
+++ b/pkgs/development/libraries/haskell/groupoids/default.nix
@@ -0,0 +1,14 @@
+{ cabal, semigroupoids }:
+
+cabal.mkDerivation (self: {
+  pname = "groupoids";
+  version = "3.0.1.1";
+  sha256 = "0r4xjyq7icd52nas27bhr5k8q7li6lba8mlkcipghhsgxsyjfp63";
+  buildDepends = [ semigroupoids ];
+  meta = {
+    homepage = "http://github.com/ekmett/groupoids/";
+    description = "Haskell 98 Groupoids";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/gsasl/default.nix b/pkgs/development/libraries/haskell/gsasl/default.nix
new file mode 100644
index 00000000000..5a654cdd11d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/gsasl/default.nix
@@ -0,0 +1,15 @@
+{ cabal, gsasl, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "gsasl";
+  version = "0.3.5";
+  sha256 = "1797rs6syrgs82akbj7nkmj0nni4w83fhwrl1zy2l3jqkcacvbm3";
+  buildDepends = [ transformers ];
+  pkgconfigDepends = [ gsasl ];
+  meta = {
+    homepage = "https://john-millikin.com/software/haskell-gsasl/";
+    description = "Bindings for GNU libgsasl";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/gtk/default.nix b/pkgs/development/libraries/haskell/gtk/default.nix
index 57e6e20f78d..ed5244d7262 100644
--- a/pkgs/development/libraries/haskell/gtk/default.nix
+++ b/pkgs/development/libraries/haskell/gtk/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "gtk";
-  version = "0.12.3.1";
-  sha256 = "0v9sh07lpvih2gk4ivy0jx2slw7rpvbf75xp20plzgzmay1y978s";
+  version = "0.12.4";
+  sha256 = "0w6ffi9fdz44kb6g1kipk5780r2wc2l3f5cgxjx5nd60qz1xh7p2";
   buildDepends = [ cairo glib mtl pango ];
   buildTools = [ gtk2hsBuildtools ];
   extraLibraries = [ libc pkgconfig ];
diff --git a/pkgs/development/libraries/haskell/gtk2hs-buildtools/default.nix b/pkgs/development/libraries/haskell/gtk2hs-buildtools/default.nix
index aea067af904..677c6c15214 100644
--- a/pkgs/development/libraries/haskell/gtk2hs-buildtools/default.nix
+++ b/pkgs/development/libraries/haskell/gtk2hs-buildtools/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "gtk2hs-buildtools";
-  version = "0.12.3.1";
-  sha256 = "0a5lay1zy1pi6inaqjvhn8v0by2z5dpy3dssqsxwbq2hkfxizzy6";
+  version = "0.12.4";
+  sha256 = "0xh5z8pix5q48d9liicl021kq9py4rj5612va6lfjkj813p5zq2z";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ filepath random ];
diff --git a/pkgs/development/libraries/haskell/hS3/default.nix b/pkgs/development/libraries/haskell/hS3/default.nix
index 9c4c9681b5f..83ee2c810eb 100644
--- a/pkgs/development/libraries/haskell/hS3/default.nix
+++ b/pkgs/development/libraries/haskell/hS3/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hS3";
-  version = "0.5.6";
-  sha256 = "1cd6dzvhfkfp0lzw8lwfcr0wn8wqi2hm8pgb5idp4vg4z00yf2zc";
+  version = "0.5.7";
+  sha256 = "1p5p6vwazqi5kpi3i0msbgcdf6flp25b2v1an6lvj7y8dx1pk6f2";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/hackage-db/default.nix b/pkgs/development/libraries/haskell/hackage-db/default.nix
index b27ff78d8f9..f3d029a5ea7 100644
--- a/pkgs/development/libraries/haskell/hackage-db/default.nix
+++ b/pkgs/development/libraries/haskell/hackage-db/default.nix
@@ -1,15 +1,18 @@
-{ cabal, Cabal, filepath, tar }:
+{ cabal, Cabal, filepath, tar, utf8String }:
 
 cabal.mkDerivation (self: {
   pname = "hackage-db";
-  version = "1.3";
-  sha256 = "17l2aw2kzjpjzyrg0c5vlaglx0vl475g3wxwavvzrd60z9lb3cp9";
-  buildDepends = [ Cabal filepath tar ];
+  version = "1.5";
+  sha256 = "1m7f6vwgjzibk8rd14y6m62xv5969ns94a57sansi9d83q6rj9iv";
+  buildDepends = [ Cabal filepath tar utf8String ];
   meta = {
     homepage = "http://github.com/peti/hackage-db";
     description = "provide access to the Hackage database via Data.Map";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hakyll/default.nix b/pkgs/development/libraries/haskell/hakyll/default.nix
index 4224bfe1216..4f50ab44950 100644
--- a/pkgs/development/libraries/haskell/hakyll/default.nix
+++ b/pkgs/development/libraries/haskell/hakyll/default.nix
@@ -1,22 +1,42 @@
-{ cabal, binary, blazeHtml, blazeMarkup, citeprocHs, cryptohash
-, filepath, hamlet, lrucache, mtl, pandoc, parsec, regexBase
-, regexTdfa, snapCore, snapServer, tagsoup, text, time
+{ cabal, binary, blazeHtml, blazeMarkup, citeprocHs, cmdargs
+, cryptohash, dataDefault, deepseq, filepath, httpConduit
+, httpTypes, HUnit, lrucache, mtl, pandoc, parsec, QuickCheck
+, random, regexBase, regexTdfa, snapCore, snapServer, tagsoup
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2, text
+, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "hakyll";
-  version = "3.4.1.0";
-  sha256 = "028wq61kvh2nkz8dxbpcnvic1vlqnz1a2l1xrvficmvk25qyqmvy";
+  version = "4.2.2.0";
+  sha256 = "0kz8v2ip0hmvqnrxgv44g2863z1dql88razl7aa3fw01q56ihz0y";
+  isLibrary = true;
+  isExecutable = true;
   buildDepends = [
-    binary blazeHtml blazeMarkup citeprocHs cryptohash filepath hamlet
-    lrucache mtl pandoc parsec regexBase regexTdfa snapCore snapServer
+    binary blazeHtml blazeMarkup citeprocHs cmdargs cryptohash
+    dataDefault deepseq filepath httpConduit httpTypes lrucache mtl
+    pandoc parsec random regexBase regexTdfa snapCore snapServer
     tagsoup text time
   ];
+  testDepends = [
+    binary blazeHtml blazeMarkup citeprocHs cmdargs cryptohash
+    dataDefault deepseq filepath httpConduit httpTypes HUnit lrucache
+    mtl pandoc parsec QuickCheck random regexBase regexTdfa snapCore
+    snapServer tagsoup testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 text time
+  ];
+  doCheck = false;
+  patchPhase = ''
+    sed -i -e 's|cryptohash .*,|cryptohash,|' hakyll.cabal
+  '';
   meta = {
     homepage = "http://jaspervdj.be/hakyll";
     description = "A static website compiler library";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hamlet/default.nix b/pkgs/development/libraries/haskell/hamlet/default.nix
index 31d1ad66d2e..c5d0b335531 100644
--- a/pkgs/development/libraries/haskell/hamlet/default.nix
+++ b/pkgs/development/libraries/haskell/hamlet/default.nix
@@ -1,14 +1,15 @@
-{ cabal, blazeBuilder, blazeHtml, blazeMarkup, failure, parsec
-, shakespeare, text
+{ cabal, blazeBuilder, blazeHtml, blazeMarkup, failure, hspec
+, HUnit, parsec, shakespeare, text
 }:
 
 cabal.mkDerivation (self: {
   pname = "hamlet";
-  version = "1.1.0.2";
-  sha256 = "0knkc43ldz3jhn3pmsysqbzlsp8akh9kiyy2jncra9y0xhminpqy";
+  version = "1.1.7.1";
+  sha256 = "1kcjzvslxis8qapy7g1cqkqqamrnkyammy33pan7ckzv5fd59q5p";
   buildDepends = [
     blazeBuilder blazeHtml blazeMarkup failure parsec shakespeare text
   ];
+  testDepends = [ blazeHtml blazeMarkup hspec HUnit parsec text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "Haml-like template files that are compile-time checked";
diff --git a/pkgs/development/libraries/haskell/happstack/happstack-hamlet.nix b/pkgs/development/libraries/haskell/happstack/happstack-hamlet.nix
index 7b2c937bd06..fad611798e9 100644
--- a/pkgs/development/libraries/haskell/happstack/happstack-hamlet.nix
+++ b/pkgs/development/libraries/haskell/happstack/happstack-hamlet.nix
@@ -2,12 +2,9 @@
 
 cabal.mkDerivation (self: {
   pname = "happstack-hamlet";
-  version = "7.0.1";
-  sha256 = "13ayypl2x402h6a7yq7fvgd2mn21gl5gcw2hk7f5vr2bdlvwv53n";
+  version = "7.0.2";
+  sha256 = "0hsmvv5rggyl7sa4sp30zyr43k6zj7dlpd0mb916wzcqrnyxa34a";
   buildDepends = [ hamlet happstackServer text ];
-  patchPhase = ''
-    sed -i -e 's|hamlet .*,|hamlet,|' happstack-hamlet.cabal
-  '';
   meta = {
     homepage = "http://www.happstack.com/";
     description = "Support for Hamlet HTML templates in Happstack";
diff --git a/pkgs/development/libraries/haskell/happstack/happstack-server.nix b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
index 410eb7e1d05..b679ba453fd 100644
--- a/pkgs/development/libraries/haskell/happstack/happstack-server.nix
+++ b/pkgs/development/libraries/haskell/happstack/happstack-server.nix
@@ -1,21 +1,22 @@
 { cabal, base64Bytestring, blazeHtml, extensibleExceptions
-, filepath, hslogger, html, monadControl, mtl, network, parsec
-, sendfile, syb, systemFilepath, text, time, transformers
-, transformersBase, utf8String, xhtml, zlib
+, filepath, hslogger, html, HUnit, monadControl, mtl, network
+, parsec, sendfile, syb, systemFilepath, text, threads, time
+, timeCompat, transformers, transformersBase, utf8String, xhtml
+, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "happstack-server";
-  version = "7.0.4";
-  sha256 = "168201z5slm6mrkckpdpshgaiz29k9j1j97vmbrybprj0zhcrl7r";
+  version = "7.1.7.1";
+  sha256 = "1q897av0ynfh6jn4jhmmamkwda7zg36p4ncn9yic69calzvjpz72";
   buildDepends = [
     base64Bytestring blazeHtml extensibleExceptions filepath hslogger
     html monadControl mtl network parsec sendfile syb systemFilepath
-    text time transformers transformersBase utf8String xhtml zlib
+    text threads time timeCompat transformers transformersBase
+    utf8String xhtml zlib
   ];
-  patchPhase = ''
-    sed -i -e 's|base64-bytestring.*,|base64-bytestring,|' happstack-server.cabal
-  '';
+  testDepends = [ HUnit parsec zlib ];
+  doCheck = false;
   meta = {
     homepage = "http://happstack.com";
     description = "Web related tools and services";
diff --git a/pkgs/development/libraries/haskell/happstack/happstack-util.nix b/pkgs/development/libraries/haskell/happstack/happstack-util.nix
deleted file mode 100644
index b457ec6dc32..00000000000
--- a/pkgs/development/libraries/haskell/happstack/happstack-util.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ cabal, extensibleExceptions, filepath, hslogger, mtl, network
-, parsec, random, time, unixCompat
-}:
-
-cabal.mkDerivation (self: {
-  pname = "happstack-util";
-  version = "6.0.3";
-  sha256 = "0hqssd5wzir6rxn46q8r3hdp3nl7v5m7w322j39120xpg2bhiphh";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [
-    extensibleExceptions filepath hslogger mtl network parsec random
-    time unixCompat
-  ];
-  patchPhase = ''
-    sed -i -e 's|mtl >= 1.1 && < 2.1|mtl|' happstack-util.cabal
-  '';
-  meta = {
-    homepage = "http://happstack.com";
-    description = "Web framework";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/hashable/default.nix b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
index 96fe7ae0eb1..ffb3f98e8b3 100644
--- a/pkgs/development/libraries/haskell/hashable/default.nix
+++ b/pkgs/development/libraries/haskell/hashable/1.1.2.5.nix
@@ -1,10 +1,15 @@
-{ cabal, text }:
+{ cabal, QuickCheck, random, testFramework
+, testFrameworkQuickcheck2, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "hashable";
   version = "1.1.2.5";
   sha256 = "0gbiaj5ck2bvvinndp2pg7qsm2h2izbnz9wi97dbm7i8r4qd9d9z";
   buildDepends = [ text ];
+  testDepends = [
+    QuickCheck random testFramework testFrameworkQuickcheck2 text
+  ];
   meta = {
     homepage = "http://github.com/tibbe/hashable";
     description = "A class for types that can be converted to a hash value";
diff --git a/pkgs/development/libraries/haskell/hashable/1.2.0.7.nix b/pkgs/development/libraries/haskell/hashable/1.2.0.7.nix
new file mode 100644
index 00000000000..e92f0c2c9d1
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hashable/1.2.0.7.nix
@@ -0,0 +1,22 @@
+{ cabal, HUnit, QuickCheck, random, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "hashable";
+  version = "1.2.0.7";
+  sha256 = "1v70b85g9kx0ikgxpiqpl8dp3w9hdxm75h73g69giyiy7swn9630";
+  buildDepends = [ text ];
+  testDepends = [
+    HUnit QuickCheck random testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 text
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://github.com/tibbe/hashable";
+    description = "A class for types that can be converted to a hash value";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/hashed-storage/default.nix b/pkgs/development/libraries/haskell/hashed-storage/default.nix
index 04f465bb9fe..77a4251259d 100644
--- a/pkgs/development/libraries/haskell/hashed-storage/default.nix
+++ b/pkgs/development/libraries/haskell/hashed-storage/default.nix
@@ -4,13 +4,14 @@
 
 cabal.mkDerivation (self: {
   pname = "hashed-storage";
-  version = "0.5.9";
-  sha256 = "1ycn0zwk5jqm6wwgs8nxpdg7fh5wx0i2058i0a924whj196kkhk2";
+  version = "0.5.10";
+  sha256 = "1k7drnk0y5apjvwsiw85032yvxllbi7ndg6h9x207gnjxm64m0h5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
     binary dataenc extensibleExceptions filepath mmap mtl zlib
   ];
+  doCheck = false;
   meta = {
     description = "Hashed file storage support code";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/hashtables/default.nix b/pkgs/development/libraries/haskell/hashtables/default.nix
index 1f9e4b418e2..ae62c051ec5 100644
--- a/pkgs/development/libraries/haskell/hashtables/default.nix
+++ b/pkgs/development/libraries/haskell/hashtables/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hashtables";
-  version = "1.0.1.6";
-  sha256 = "071msa15447rk2zc5jbpms8sc1ml8yi1n5pycycrcik8dhsm3slb";
+  version = "1.1.0.2";
+  sha256 = "0d103cvr168hgyghm6fp67r4lz1p592x45igwld6xq3nyxjxnbp9";
   buildDepends = [ hashable primitive vector ];
   meta = {
     homepage = "http://github.com/gregorycollins/hashtables";
diff --git a/pkgs/development/libraries/haskell/haskeline/default.nix b/pkgs/development/libraries/haskell/haskeline/default.nix
index 9863293c41d..a283f229b76 100644
--- a/pkgs/development/libraries/haskell/haskeline/default.nix
+++ b/pkgs/development/libraries/haskell/haskeline/default.nix
@@ -1,13 +1,10 @@
-{ cabal, extensibleExceptions, filepath, mtl, terminfo, utf8String
-}:
+{ cabal, filepath, terminfo, transformers, utf8String }:
 
 cabal.mkDerivation (self: {
   pname = "haskeline";
-  version = "0.6.4.7";
-  sha256 = "18ma4i2i6hx8bhbkh1d7mqzsqbfj0zc2bkv3czjyylizqwhpq6ih";
-  buildDepends = [
-    extensibleExceptions filepath mtl terminfo utf8String
-  ];
+  version = "0.7.0.3";
+  sha256 = "10xc229ddk4g87i78vgjbfr7sii28fx00qwnggb5x7sfigfca8sg";
+  buildDepends = [ filepath terminfo transformers utf8String ];
   configureFlags = "-fterminfo";
   meta = {
     homepage = "http://trac.haskell.org/haskeline";
diff --git a/pkgs/development/libraries/haskell/haskell-platform/2010.2.0.0.nix b/pkgs/development/libraries/haskell/haskell-platform/2010.2.0.0.nix
index 3a47f2a39c9..8f00f5fb48b 100644
--- a/pkgs/development/libraries/haskell/haskell-platform/2010.2.0.0.nix
+++ b/pkgs/development/libraries/haskell/haskell-platform/2010.2.0.0.nix
@@ -7,7 +7,7 @@ cabal.mkDerivation (self : {
   pname = "haskell-platform";
   version = "2010.2.0.0";
   src = fetchurl {
-    url = "http://hackage.haskell.org/platform/${self.version}/cabal/${self.pname}-${self.version}.tar.gz";
+    url = "http://pkgs.fedoraproject.org/repo/pkgs/haskell-platform/haskell-platform-2010.2.0.0.tar.gz/9c9c6422ebfe1a5e78e69ae017f4d54b/haskell-platform-2010.2.0.0.tar.gz";
     sha256 = "c0b0b45151e74cff759ae25083c2ff7a7af4d2f74c19294b78730c879864f3c0";
   };
   propagatedBuildInputs = [
@@ -21,4 +21,3 @@ cabal.mkDerivation (self : {
     maintainers = [self.stdenv.lib.maintainers.andres];
   };
 })
-
diff --git a/pkgs/development/libraries/haskell/haskell-platform/2012.4.0.0.nix b/pkgs/development/libraries/haskell/haskell-platform/2012.4.0.0.nix
new file mode 100644
index 00000000000..c9f269eebef
--- /dev/null
+++ b/pkgs/development/libraries/haskell/haskell-platform/2012.4.0.0.nix
@@ -0,0 +1,44 @@
+{cabal, fetchurl, GLUT, HTTP, HUnit, OpenGL, QuickCheck, async, cgi, fgl,
+ haskellSrc, html, network, parallel, parsec, primitive,
+ regexBase, regexCompat, regexPosix,
+ split, stm, syb, deepseq, text, transformers, mtl, vector, xhtml, zlib, random,
+ cabalInstall, alex, happy, haddock, ghc}:
+
+# This is just a meta-package. Because upstream fails to provide proper versioned
+# release tarballs that can be used for the purpose of verifying this package, we
+# just create it on the fly from a simple Setup.hs file and a .cabal file that we
+# store directly in the nixpkgs repository.
+
+cabal.mkDerivation (self : {
+  pname = "haskell-platform";
+  version = "2012.4.0.0";
+  cabalFile = ./haskell-platform-2012.4.0.0.cabal;
+  setupFile = ./Setup.hs;
+  src = null;
+  propagatedBuildInputs = [
+    GLUT HTTP HUnit OpenGL QuickCheck async cgi fgl
+    haskellSrc html network parallel parsec primitive
+    regexBase regexCompat regexPosix
+    split stm syb deepseq text transformers mtl vector xhtml zlib random
+    cabalInstall alex happy ghc haddock
+  ];
+  unpackPhase = ''
+    sourceRoot=haskell-platform
+    mkdir $sourceRoot
+    cp ${self.cabalFile} $sourceRoot/${self.pname}.cabal
+    cp ${self.setupFile} $sourceRoot/Setup.hs
+    touch $sourceRoot/LICENSE
+  '';
+  noHaddock = true;
+  meta = {
+    homepage = "http://haskell.org/platform";
+    description = "Haskell Platform meta package";
+    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/development/libraries/haskell/haskell-platform/2013.2.0.0.nix b/pkgs/development/libraries/haskell/haskell-platform/2013.2.0.0.nix
new file mode 100644
index 00000000000..2e0181bd1a7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/haskell-platform/2013.2.0.0.nix
@@ -0,0 +1,45 @@
+{ cabal, fetchurl
+, async, attoparsec, caseInsensitive, cgi, fgl, GLUT, GLURaw, haskellSrc
+, hashable, html, HTTP, HUnit, mtl, network, OpenGL, OpenGLRaw, parallel
+, parsec, QuickCheck, random, regexBase, regexCompat, regexPosix, split, stm
+, syb, text, transformers, unorderedContainers, vector, xhtml, zlib
+, cabalInstall, alex, haddock, happy, primitive, ghc
+}:
+
+# This is just a meta-package. Because upstream fails to provide proper versioned
+# release tarballs that can be used for the purpose of verifying this package, we
+# just create it on the fly from a simple Setup.hs file and a .cabal file that we
+# store directly in the nixpkgs repository.
+
+cabal.mkDerivation (self : {
+  pname = "haskell-platform";
+  version = "2013.2.0.0";
+  cabalFile = ./haskell-platform-2013.2.0.0.cabal;
+  setupFile = ./Setup.hs;
+  src = null;
+  propagatedBuildInputs = [
+    async attoparsec caseInsensitive cgi fgl GLUT GLURaw haskellSrc
+    hashable html HTTP HUnit mtl network OpenGL OpenGLRaw parallel
+    parsec QuickCheck random regexBase regexCompat regexPosix split stm
+    syb text transformers unorderedContainers vector xhtml zlib
+    cabalInstall alex haddock happy primitive ghc
+  ];
+  unpackPhase = ''
+    sourceRoot=haskell-platform
+    mkdir $sourceRoot
+    cp ${self.cabalFile} $sourceRoot/${self.pname}.cabal
+    cp ${self.setupFile} $sourceRoot/Setup.hs
+    touch $sourceRoot/LICENSE
+  '';
+  noHaddock = true;
+  meta = {
+    homepage = "http://haskell.org/platform";
+    description = "Haskell Platform meta package";
+    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/development/libraries/haskell/haskell-platform/haskell-platform-2012.4.0.0.cabal b/pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2012.4.0.0.cabal
new file mode 100644
index 00000000000..23d1f7a0a7d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2012.4.0.0.cabal
@@ -0,0 +1,113 @@
+name:                haskell-platform
+version:             2012.4.0.0
+homepage:            http://haskell.org/platform
+license:             BSD3
+license-file:        LICENSE
+author:              libraries@haskell.org
+maintainer:          haskell-platform@projects.haskell.org
+category:            System
+synopsis:            The Haskell Platform
+description:
+    The Haskell Platform (HP) is the blessed set of libraries and tools on
+    which to build further Haskell libraries and applications. It is
+    intended to provide a comprehensive, stable, and quality tested base for
+    Haskell projects to work from.
+    .
+    This version specifies the following additional developer tools be
+    installed, for a system to be in full compliance:
+    .
+    * cabal-install
+    * alex
+    * happy
+    * haddock
+
+cabal-version:       >= 1.8
+build-type:          Custom
+tested-with:         GHC ==7.4.2
+
+flag include-ghc-depends
+  description: Include all the GHC provided packages in the dependencies
+  default:     False
+
+library
+  if flag(include-ghc-depends)
+    build-depends:
+      ghc                      ==7.4.2,
+
+      -- Core libraries: provided by every ghc installation
+      -- We don't include "non-API" packages here.
+      --                                        begin core packages
+      array                    ==0.4.0.0,
+      base                     ==4.5.1.0,
+      bytestring               ==0.9.2.1,
+      Cabal                    ==1.14.0,
+      containers               ==0.4.2.1,
+      deepseq                  ==1.3.0.0,
+      directory                ==1.1.0.2,
+      extensible-exceptions    ==0.1.1.4,
+      filepath                 ==1.3.0.0,
+      haskell2010              ==1.1.0.1,
+      haskell98                ==2.0.0.1,
+      hpc                      ==0.5.1.1,
+      old-locale               ==1.0.0.4,
+      old-time                 ==1.1.0.0,
+      pretty                   ==1.1.1.0,
+      process                  ==1.1.0.1,
+      template-haskell         ==2.7.0.0,
+      time                     ==1.4
+  if !os(windows)
+    build-depends:
+      unix                     ==2.5.1.1
+      --                                        end core packages
+  else
+    build-depends:
+      Win32                    ==2.2.2.0
+
+  build-depends:
+    -- Libraries in addition to what GHC provides:
+    -- Note: newer versions of cgi need monad-catchio.
+    --                                          begin platform packages
+    async                       ==2.0.1.3,
+    cgi                         ==3001.1.7.4,
+    fgl                         ==5.4.2.4,
+    GLUT                        ==2.1.2.1,
+    haskell-src                 ==1.0.1.5,
+    html                        ==1.0.1.2,
+    HTTP                        ==4000.2.5,
+    HUnit                       ==1.2.5.1,
+    mtl                         ==2.1.2,
+    network                     ==2.3.1.0,
+    OpenGL                      ==2.2.3.1,
+    parallel                    ==3.2.0.3,
+    parsec                      ==3.1.3,
+    QuickCheck                  ==2.5.1.1,
+    random                      ==1.0.1.1,
+    regex-base                  ==0.93.2,
+    regex-compat                ==0.95.1,
+    regex-posix                 ==0.95.2,
+    split                       ==0.2.1.1,
+    stm                         ==2.4,
+    syb                         ==0.3.7,
+    text                        ==0.11.2.3,
+    transformers                ==0.3.0.0,
+    vector                      ==0.10.0.1,
+    xhtml                       ==3000.2.1,
+    zlib                        ==0.5.4.0,
+
+    -- Libraries that are needed to support the above,
+    -- though are not officially part of the platform
+    primitive                   ==0.5.0.1
+
+  -- Depending on programs does not work, they are not registered
+  -- We list them to help distro packaging.
+  build-tools:
+    cabal-install               ==0.14.0,
+    alex                        ==3.0.2,
+    happy                       ==1.18.10
+    --                                          end platform packages
+    -- hscolour                 ==1.19   -- ???
+    -- haddock                  ==2.11.0 -- need to use the one shipped with ghc
+
+-- N.B.: The begin/end comment annotations are used to build the source
+-- installer: Packages that are part of the core are checked at build time.
+-- Source of packages that are part of the platform are included in the tarball.
diff --git a/pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2013.2.0.0.cabal b/pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2013.2.0.0.cabal
new file mode 100644
index 00000000000..cf676ab1d6e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/haskell-platform/haskell-platform-2013.2.0.0.cabal
@@ -0,0 +1,118 @@
+name:                haskell-platform
+version:             2013.2.0.0
+homepage:            http://haskell.org/platform
+license:             BSD3
+license-file:        LICENSE
+author:              libraries@haskell.org
+maintainer:          haskell-platform@projects.haskell.org
+category:            System
+synopsis:            The Haskell Platform
+description:
+    The Haskell Platform (HP) is the blessed set of libraries and tools on
+    which to build further Haskell libraries and applications. It is
+    intended to provide a comprehensive, stable, and quality tested base for
+    Haskell projects to work from.
+    .
+    This version specifies the following additional developer tools be
+    installed, for a system to be in full compliance:
+    .
+    * cabal-install
+    * alex
+    * happy
+    * haddock
+
+cabal-version:       >= 1.8
+build-type:          Custom
+tested-with:         GHC ==7.6.3
+
+flag include-ghc-depends
+  description: Include all the GHC provided packages in the dependencies
+  default:     False
+
+library
+  if flag(include-ghc-depends)
+    build-depends:
+      ghc                      ==7.6.3,
+
+      -- Core libraries: provided by every ghc installation
+      -- We don't include "non-API" packages here.
+      --                                        begin core packages
+      array                     ==0.4.0.1,
+      base                      ==4.6.0.1,
+      bytestring                ==0.10.0.2,
+      Cabal                     ==1.16.0,
+      containers                ==0.5.0.0,
+      deepseq                   ==1.3.0.1,
+      directory                 ==1.2.0.1,
+      filepath                  ==1.3.0.1,
+      haskell2010               ==1.1.1.0,
+      haskell98                 ==2.0.0.2,
+      hpc                       ==0.6.0.0,
+      old-locale                ==1.0.0.5,
+      old-time                  ==1.1.0.1,
+      pretty                    ==1.1.1.0,
+      process                   ==1.1.0.2,
+      template-haskell          ==2.8.0.0,
+      time                      ==1.4.0.1
+  if !os(windows)
+    build-depends:
+      unix                      ==2.6.0.1
+      --                                        end core packages
+  else
+    build-depends:
+      Win32                     ==2.3.0.0
+
+  build-depends:
+    -- Libraries in addition to what GHC provides:
+    -- Note: newer versions of cgi need monad-catchio.
+    --                                          begin platform packages
+    async                       ==2.0.1.4,
+    attoparsec                  ==0.10.4.0,
+    case-insensitive            ==1.0.0.1,
+    cgi                         ==3001.1.7.5,
+    fgl                         ==5.4.2.4,
+    GLUT                        ==2.4.0.0,
+    GLURaw                      ==1.3.0.0,
+    haskell-src                 ==1.0.1.5,
+    hashable                    ==1.1.2.5,
+    html                        ==1.0.1.2,
+    HTTP                        ==4000.2.8,
+    HUnit                       ==1.2.5.2,
+    mtl                         ==2.1.2,
+    network                     ==2.4.1.2,
+    OpenGL                      ==2.8.0.0,
+    OpenGLRaw                   ==1.3.0.0,
+    parallel                    ==3.2.0.3,
+    parsec                      ==3.1.3,
+    QuickCheck                  ==2.6,
+    random                      ==1.0.1.1,
+    regex-base                  ==0.93.2,
+    regex-compat                ==0.95.1,
+    regex-posix                 ==0.95.2,
+    split                       ==0.2.2,
+    stm                         ==2.4.2,
+    syb                         ==0.4.0,
+    text                        ==0.11.3.1,
+    transformers                ==0.3.0.0,
+    unordered-containers        ==0.2.3.0,
+    vector                      ==0.10.0.1,
+    xhtml                       ==3000.2.1,
+    zlib                        ==0.5.4.1,
+
+    -- Libraries that are needed to support the above,
+    -- though are not officially part of the platform
+    primitive                   ==0.5.0.1
+
+  -- Depending on programs does not work, they are not registered
+  -- We list them to help distro packaging.
+  build-tools:
+    cabal-install               ==1.16.0.2,
+    alex                        ==3.0.5,
+    happy                       ==1.18.10
+    --                                          end platform packages
+    -- hscolour                 ==1.20.3   -- ???
+    -- haddock                  ==2.13.2 -- need to use the one shipped with ghc
+
+-- N.B.: The begin/end comment annotations are used to build the source
+-- installer: Packages that are part of the core are checked at build time.
+-- Source of packages that are part of the platform are included in the tarball.
diff --git a/pkgs/development/libraries/haskell/haskell-src-exts/1.11.1.nix b/pkgs/development/libraries/haskell/haskell-src-exts/1.11.1.nix
index 9df67a70c6c..1918260cc62 100644
--- a/pkgs/development/libraries/haskell/haskell-src-exts/1.11.1.nix
+++ b/pkgs/development/libraries/haskell/haskell-src-exts/1.11.1.nix
@@ -6,6 +6,7 @@ cabal.mkDerivation (self: {
   sha256 = "1jqf8l81zw7x5ryf8h2n0b2636yhxkfp3j4ndbqw6hc7i5q581m6";
   buildDepends = [ cpphs ];
   buildTools = [ happy ];
+  doCheck = false;
   meta = {
     homepage = "http://code.haskell.org/haskell-src-exts";
     description = "Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer";
diff --git a/pkgs/development/libraries/haskell/haskell-src-exts/1.13.3.nix b/pkgs/development/libraries/haskell/haskell-src-exts/1.13.5.nix
index d4cb1d97bb7..5521e037b4e 100644
--- a/pkgs/development/libraries/haskell/haskell-src-exts/1.13.3.nix
+++ b/pkgs/development/libraries/haskell/haskell-src-exts/1.13.5.nix
@@ -2,10 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "haskell-src-exts";
-  version = "1.13.3";
-  sha256 = "0z2vs6ji0dgm3c11jwcq5jcnjr8a6pawrkn3c8a3a5p612v8d495";
+  version = "1.13.5";
+  sha256 = "03bzhfp7l9f5hh61qdrr83331nbfgj3jfsfylwmnmcknpisdqnkw";
   buildDepends = [ cpphs ];
   buildTools = [ happy ];
+  doCheck = false;
   meta = {
     homepage = "http://code.haskell.org/haskell-src-exts";
     description = "Manipulating Haskell source: abstract syntax, lexer, parser, and pretty-printer";
diff --git a/pkgs/development/libraries/haskell/haskell-src-meta/default.nix b/pkgs/development/libraries/haskell/haskell-src-meta/default.nix
index 2300d6e80ca..7b6ccb69633 100644
--- a/pkgs/development/libraries/haskell/haskell-src-meta/default.nix
+++ b/pkgs/development/libraries/haskell/haskell-src-meta/default.nix
@@ -1,10 +1,10 @@
-{ cabal, haskellSrcExts, syb, thLift, uniplate }:
+{ cabal, haskellSrcExts, syb, thOrphans, uniplate }:
 
 cabal.mkDerivation (self: {
   pname = "haskell-src-meta";
-  version = "0.5.1.2";
-  sha256 = "09if8423dwf4jcr6p7d8j4r9i2n8jc7xxvjn1p1mwjp0ajzk8g9s";
-  buildDepends = [ haskellSrcExts syb thLift uniplate ];
+  version = "0.6.0.2";
+  sha256 = "1msqnsavghsc5bil3mm9swpi9a54pki4162jdfwwvlzvdmfvk9hp";
+  buildDepends = [ haskellSrcExts syb thOrphans uniplate ];
   meta = {
     description = "Parse source to template-haskell abstract syntax";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/hastache/default.nix b/pkgs/development/libraries/haskell/hastache/default.nix
index f37badde96d..15d32de346d 100644
--- a/pkgs/development/libraries/haskell/hastache/default.nix
+++ b/pkgs/development/libraries/haskell/hastache/default.nix
@@ -1,14 +1,15 @@
-{ cabal, blazeBuilder, filepath, ieee754, mtl, syb, text
-, utf8String
+{ cabal, blazeBuilder, filepath, HUnit, ieee754, mtl, syb, text
+, transformers, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "hastache";
-  version = "0.4.2";
-  sha256 = "1ad691qxnnx0a6ik0cjdzd8aw7z88p06zckbb3cb1r8pk6m0g7vi";
+  version = "0.5.0";
+  sha256 = "1c1pphw7qx5l5fdfqchihvp2yrwwb0ln8dfshkvd1giv8cjmbyn8";
   buildDepends = [
-    blazeBuilder filepath ieee754 mtl syb text utf8String
+    blazeBuilder filepath ieee754 mtl syb text transformers utf8String
   ];
+  testDepends = [ HUnit mtl syb text ];
   meta = {
     homepage = "http://github.com/lymar/hastache";
     description = "Haskell implementation of Mustache templates";
diff --git a/pkgs/development/libraries/haskell/haxr/default.nix b/pkgs/development/libraries/haskell/haxr/default.nix
index 1283d3a4a59..a5aaf44c392 100644
--- a/pkgs/development/libraries/haskell/haxr/default.nix
+++ b/pkgs/development/libraries/haskell/haxr/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "haxr";
-  version = "3000.9.0.1";
-  sha256 = "106hw8ysjx12dvwij4ld6n54mxj2yl1p7iihp2fwz50v50mz6102";
+  version = "3000.9.3";
+  sha256 = "1jg7abgbykxjjpmakmfm6zcwxn0hf9q53430ibr4m9n6alh7nglq";
   buildDepends = [
     base64Bytestring blazeBuilder HaXml HTTP mtl network time
     utf8String
diff --git a/pkgs/development/libraries/haskell/heist/default.nix b/pkgs/development/libraries/haskell/heist/default.nix
index 44ba8ba15ee..22ad08afe38 100644
--- a/pkgs/development/libraries/haskell/heist/default.nix
+++ b/pkgs/development/libraries/haskell/heist/default.nix
@@ -1,20 +1,21 @@
 { cabal, aeson, attoparsec, blazeBuilder, blazeHtml, directoryTree
-, filepath, MonadCatchIOTransformers, mtl, random, text, time
-, transformers, unorderedContainers, vector, xmlhtml
+, dlist, errors, filepath, hashable, MonadCatchIOTransformers, mtl
+, random, text, time, transformers, unorderedContainers, vector
+, xmlhtml
 }:
 
 cabal.mkDerivation (self: {
   pname = "heist";
-  version = "0.8.1.1";
-  sha256 = "0ad56izskafpc1dx2nq0a8w71ayppwx8dc7kdaw1by972kh3nflh";
+  version = "0.12.0";
+  sha256 = "0fdqvippsxljylchfcr32lw367i17cpv4yavjvmhfd923vgmmfj9";
   buildDepends = [
-    aeson attoparsec blazeBuilder blazeHtml directoryTree filepath
-    MonadCatchIOTransformers mtl random text time transformers
-    unorderedContainers vector xmlhtml
+    aeson attoparsec blazeBuilder blazeHtml directoryTree dlist errors
+    filepath hashable MonadCatchIOTransformers mtl random text time
+    transformers unorderedContainers vector xmlhtml
   ];
   meta = {
     homepage = "http://snapframework.com/";
-    description = "An (x)html templating system";
+    description = "An Haskell template system supporting both HTML5 and XML";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
   };
diff --git a/pkgs/development/libraries/haskell/hexpat/default.nix b/pkgs/development/libraries/haskell/hexpat/default.nix
new file mode 100644
index 00000000000..5a656bc19c7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hexpat/default.nix
@@ -0,0 +1,18 @@
+{ cabal, deepseq, extensibleExceptions, List, text, transformers
+, utf8String
+}:
+
+cabal.mkDerivation (self: {
+  pname = "hexpat";
+  version = "0.20.3";
+  sha256 = "13dh0cvcmp6yi4nncsn6q9pkisld9xvz6j4xabng5ax67vdgdvrs";
+  buildDepends = [
+    deepseq extensibleExceptions List text transformers utf8String
+  ];
+  meta = {
+    homepage = "http://haskell.org/haskellwiki/Hexpat/";
+    description = "XML parser/formatter based on expat";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/highlighting-kate/default.nix b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
index 55051901206..fb7d0d4a00a 100644
--- a/pkgs/development/libraries/haskell/highlighting-kate/default.nix
+++ b/pkgs/development/libraries/haskell/highlighting-kate/default.nix
@@ -1,12 +1,13 @@
-{ cabal, blazeHtml, filepath, mtl, parsec, regexPcreBuiltin }:
+{ cabal, blazeHtml, filepath, mtl, parsec, regexPcre }:
 
 cabal.mkDerivation (self: {
   pname = "highlighting-kate";
-  version = "0.5.2";
-  sha256 = "1a3aifknbxm3v0lvqisdc6zqgki9x9z12jdrmijxmxq1riwwalr2";
+  version = "0.5.3.9";
+  sha256 = "158k38snqhgfjyzq82f8k1fkrpw0ld023wndzyzwwc6s933ap8hc";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ blazeHtml filepath mtl parsec regexPcreBuiltin ];
+  buildDepends = [ blazeHtml filepath mtl parsec regexPcre ];
+  prePatch = "sed -i -e 's|regex-pcre-builtin|regex-pcre|' highlighting-kate.cabal";
   meta = {
     homepage = "http://github.com/jgm/highlighting-kate";
     description = "Syntax highlighting";
diff --git a/pkgs/development/libraries/haskell/hinotify/default.nix b/pkgs/development/libraries/haskell/hinotify/default.nix
index 8cbf3f20a72..de1c0e12759 100644
--- a/pkgs/development/libraries/haskell/hinotify/default.nix
+++ b/pkgs/development/libraries/haskell/hinotify/default.nix
@@ -2,13 +2,12 @@
 
 cabal.mkDerivation (self: {
   pname = "hinotify";
-  version = "0.3.2";
-  sha256 = "0gr9rv1af6w7g2hbjhz1livi5zfhzdswjyapvjz3d7cga906bj48";
+  version = "0.3.5";
+  sha256 = "00pzvqw2w3gbz8j4hiz8zxm7rki07g1iamjlbazz3kmpwcgjxi0l";
   meta = {
-    homepage = "http://code.haskell.org/hinotify/README.html";
-    description = "Haskell binding to INotify";
+    homepage = "https://github.com/kolmodin/hinotify.git";
+    description = "Haskell binding to inotify";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hint/default.nix b/pkgs/development/libraries/haskell/hint/default.nix
index 795d8c1d674..8cf1accca9c 100644
--- a/pkgs/development/libraries/haskell/hint/default.nix
+++ b/pkgs/development/libraries/haskell/hint/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hint";
-  version = "0.3.3.4";
-  sha256 = "0pmvhlj9m0s1wvw8ppx1wx879lwzg38bcvhy1ma1d4wnrpq3bhiy";
+  version = "0.3.3.6";
+  sha256 = "080wnds99lg9p4n2h9d4bpgvk73yzc3im2ysn1r8f3nqai4b2can";
   buildDepends = [
     extensibleExceptions filepath ghcMtl ghcPaths haskellSrc
     MonadCatchIOMtl mtl random utf8String
diff --git a/pkgs/development/libraries/haskell/hjsmin/default.nix b/pkgs/development/libraries/haskell/hjsmin/default.nix
index 6d749feea3a..9551581dadf 100644
--- a/pkgs/development/libraries/haskell/hjsmin/default.nix
+++ b/pkgs/development/libraries/haskell/hjsmin/default.nix
@@ -1,10 +1,16 @@
-{ cabal, blazeBuilder, languageJavascript, text }:
+{ cabal, blazeBuilder, Cabal, HUnit, languageJavascript, QuickCheck
+, testFramework, testFrameworkHunit, text
+}:
 
 cabal.mkDerivation (self: {
   pname = "hjsmin";
-  version = "0.1.2";
-  sha256 = "04yk383504blg8x10x5j1fd5mzyybqkhz7jfsyimvz2wz2v86qsb";
+  version = "0.1.4.1";
+  sha256 = "0r73hd6kn37mdbm2i3g6v3qqm696kyflqs6ajq68qr5sr62sjb1a";
   buildDepends = [ blazeBuilder languageJavascript text ];
+  testDepends = [
+    blazeBuilder Cabal HUnit languageJavascript QuickCheck
+    testFramework testFrameworkHunit text
+  ];
   meta = {
     homepage = "http://github.com/alanz/hjsmin";
     description = "Haskell implementation of a javascript minifier";
diff --git a/pkgs/development/libraries/haskell/hledger-lib/default.nix b/pkgs/development/libraries/haskell/hledger-lib/default.nix
index 644406ae1ec..57cb8dc8710 100644
--- a/pkgs/development/libraries/haskell/hledger-lib/default.nix
+++ b/pkgs/development/libraries/haskell/hledger-lib/default.nix
@@ -1,23 +1,29 @@
-{ cabal, cmdargs, csv, filepath, HUnit, mtl, parsec, regexpr, safe
-, shakespeareText, split, time, transformers, utf8String
+{ cabal, cmdargs, csv, filepath, HUnit, mtl, parsec, prettyShow
+, regexCompat, regexpr, safe, split, testFramework
+, testFrameworkHunit, time, transformers, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "hledger-lib";
-  version = "0.18.2";
-  sha256 = "0lcs58bdix4m7sslrdi38rqw5x5fb4ip0n5is0phxdrbp0nggd4z";
+  version = "0.21.2";
+  sha256 = "07li348kmwz9j4bfgmkq7zs9nyqxi5hhydij2fg4jwj0hbfxvmy9";
   buildDepends = [
-    cmdargs csv filepath HUnit mtl parsec regexpr safe shakespeareText
-    split time transformers utf8String
+    cmdargs csv filepath HUnit mtl parsec prettyShow regexCompat
+    regexpr safe split time transformers utf8String
+  ];
+  testDepends = [
+    cmdargs csv filepath HUnit mtl parsec prettyShow regexCompat
+    regexpr safe split testFramework testFrameworkHunit time
+    transformers
   ];
-  patchPhase = ''
-    sed -i -e 's|,split.*|,split|' hledger-lib.cabal
-  '';
   meta = {
     homepage = "http://hledger.org";
     description = "Core data types, parsers and utilities for the hledger accounting tool";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hledger-web/default.nix b/pkgs/development/libraries/haskell/hledger-web/default.nix
index cc4ccc186c6..acffb0e55ff 100644
--- a/pkgs/development/libraries/haskell/hledger-web/default.nix
+++ b/pkgs/development/libraries/haskell/hledger-web/default.nix
@@ -1,27 +1,30 @@
-{ cabal, blazeHtml, cabalFileTh, clientsession, cmdargs, filepath
-, hamlet, hledger, hledgerLib, HUnit, ioStorage, networkConduit
-, parsec, regexpr, safe, shakespeareText, text, time, transformers
-, wai, waiExtra, warp, yaml, yesod, yesodCore, yesodDefault
-, yesodStatic
+{ cabal, blazeHtml, blazeMarkup, clientsession, cmdargs
+, dataDefault, filepath, hamlet, hjsmin, hledger, hledgerLib, hspec
+, httpConduit, HUnit, json, networkConduit, parsec, regexpr, safe
+, shakespeareText, text, time, transformers, wai, waiExtra
+, waiHandlerLaunch, warp, yaml, yesod, yesodCore, yesodPlatform
+, yesodStatic, yesodTest
 }:
 
 cabal.mkDerivation (self: {
   pname = "hledger-web";
-  version = "0.18.2";
-  sha256 = "1bhah29why34qaiy7mgzpzjd5dm94izcf3jmgflix56gkgzk86p1";
+  version = "0.21.2";
+  sha256 = "1z8nyvqzyjh36g50w4gmh8mzvydanfn1s3gx4nliwk4mjfj4bbkl";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    blazeHtml cabalFileTh clientsession cmdargs filepath hamlet hledger
-    hledgerLib HUnit ioStorage networkConduit parsec regexpr safe
-    shakespeareText text time transformers wai waiExtra warp yaml yesod
-    yesodCore yesodDefault yesodStatic
+    blazeHtml blazeMarkup clientsession cmdargs dataDefault filepath
+    hamlet hjsmin hledger hledgerLib httpConduit HUnit json
+    networkConduit parsec regexpr safe shakespeareText text time
+    transformers wai waiExtra waiHandlerLaunch warp yaml yesod
+    yesodCore yesodPlatform yesodStatic
   ];
+  testDepends = [ hspec yesod yesodTest ];
+  doCheck = false;
   meta = {
     homepage = "http://hledger.org";
     description = "A web interface for the hledger accounting tool";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hledger/default.nix b/pkgs/development/libraries/haskell/hledger/default.nix
index efc2936f406..5d81a49f10b 100644
--- a/pkgs/development/libraries/haskell/hledger/default.nix
+++ b/pkgs/development/libraries/haskell/hledger/default.nix
@@ -1,26 +1,32 @@
-{ cabal, cabalFileTh, cmdargs, filepath, haskeline, hledgerLib
-, HUnit, mtl, parsec, regexpr, safe, shakespeareText, split, text
-, time, utf8String
+{ cabal, cmdargs, csv, filepath, haskeline, hledgerLib, HUnit, mtl
+, parsec, prettyShow, regexCompat, regexpr, safe, shakespeareText
+, split, testFramework, testFrameworkHunit, text, time
+, transformers, utf8String
 }:
 
 cabal.mkDerivation (self: {
   pname = "hledger";
-  version = "0.18.2";
-  sha256 = "1i0rix3h5vrq9j01fzgwyhs2n8nfzhidi4rjlvn402ps0w6j15ld";
+  version = "0.21.2";
+  sha256 = "04n9bm97zqh8am83fr2aflw3gv5nwm9jm7bp9vzd4986f1c43ig3";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    cabalFileTh cmdargs filepath haskeline hledgerLib HUnit mtl parsec
-    regexpr safe shakespeareText split text time utf8String
+    cmdargs filepath haskeline hledgerLib HUnit mtl parsec regexpr safe
+    shakespeareText split text time utf8String
+  ];
+  testDepends = [
+    cmdargs csv filepath haskeline hledgerLib HUnit mtl parsec
+    prettyShow regexCompat regexpr safe shakespeareText split
+    testFramework testFrameworkHunit text time transformers
   ];
-  patchPhase = ''
-    sed -i -e 's|,split.*|,split|' hledger.cabal
-  '';
   meta = {
     homepage = "http://hledger.org";
     description = "The main command-line interface for the hledger accounting tool";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hoauth/default.nix b/pkgs/development/libraries/haskell/hoauth/default.nix
index e118f765097..c568b292c3c 100644
--- a/pkgs/development/libraries/haskell/hoauth/default.nix
+++ b/pkgs/development/libraries/haskell/hoauth/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hoauth";
-  version = "0.3.4";
-  sha256 = "0a8a77smzhxmynfi0ayvsgibpw9aav2f7pi9j3dxjas14zg9qv2k";
+  version = "0.3.5";
+  sha256 = "06vk3dv2dby7wadxg4qq2bzy10hl8ix2x4vpxggwd13xy3kpzjqp";
   buildDepends = [
     binary cryptoPubkeyTypes curl dataenc entropy mtl random RSA SHA
     time utf8String
diff --git a/pkgs/development/libraries/haskell/hoogle/default.nix b/pkgs/development/libraries/haskell/hoogle/default.nix
index e13ab47beaa..1e722a186dc 100644
--- a/pkgs/development/libraries/haskell/hoogle/default.nix
+++ b/pkgs/development/libraries/haskell/hoogle/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hoogle";
-  version = "4.2.13";
-  sha256 = "0asw9lr22d8jxr58b7w2j5hgllxhw2w8kllh5aq5jjs272hjiy9i";
+  version = "4.2.16";
+  sha256 = "1hamwqhndrkajm4xvxxfhr2rnlmf3z2ysyfxx3y6d24jawjyqf8a";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -17,7 +17,7 @@ cabal.mkDerivation (self: {
   meta = {
     homepage = "http://www.haskell.org/hoogle/";
     description = "Haskell API Search";
-    license = "GPL";
+    license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
diff --git a/pkgs/development/libraries/haskell/hopenssl/default.nix b/pkgs/development/libraries/haskell/hopenssl/default.nix
index 5c62cbf3fe0..b65abe6aa3e 100644
--- a/pkgs/development/libraries/haskell/hopenssl/default.nix
+++ b/pkgs/development/libraries/haskell/hopenssl/default.nix
@@ -2,15 +2,18 @@
 
 cabal.mkDerivation (self: {
   pname = "hopenssl";
-  version = "1.6.1";
-  sha256 = "75ba42c5e9b02c09057c5aa25f577bdfe5214533fbd2921ac555897ade85958a";
+  version = "1.6.2";
+  sha256 = "0b9xdm7jgkadx53vwszjnisyblzsqk99s3zqppgp0iqqf9955s4w";
   buildDepends = [ mtl ];
   extraLibraries = [ openssl ];
   meta = {
-    homepage = "http://gitorious.org/hopenssl";
+    homepage = "http://github.com/peti/hopenssl";
     description = "FFI bindings to OpenSSL's EVP digest interface";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hp2any-core/default.nix b/pkgs/development/libraries/haskell/hp2any-core/default.nix
index 37e6000a3c0..96ac397da79 100644
--- a/pkgs/development/libraries/haskell/hp2any-core/default.nix
+++ b/pkgs/development/libraries/haskell/hp2any-core/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hp2any-core";
-  version = "0.11.1";
-  sha256 = "146bigmch7dawyyakj0w55p0jdpnxkj8q5izjsswqqk0pdxia546";
+  version = "0.11.2";
+  sha256 = "1gmw9bggw8hsp6pi0xgrryf0sqjb1aaxbwh85q5h72h4ixskwn1y";
   buildDepends = [ attoparsec filepath network time ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Hp2any";
diff --git a/pkgs/development/libraries/haskell/hp2any-graph/default.nix b/pkgs/development/libraries/haskell/hp2any-graph/default.nix
index 98b9518c7de..83369ac008b 100644
--- a/pkgs/development/libraries/haskell/hp2any-graph/default.nix
+++ b/pkgs/development/libraries/haskell/hp2any-graph/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hp2any-graph";
-  version = "0.5.3";
-  sha256 = "1al20pxfgkgwynrx7vr0i57342s91lcm3cnd9qjx8b6vkqmzykkq";
+  version = "0.5.4";
+  sha256 = "1lhp9saw51w09fhk94hz31rjawnnxavd7x3lxjc8xn1778wp3v9h";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/hs-bibutils/default.nix b/pkgs/development/libraries/haskell/hs-bibutils/default.nix
index c96e6aeaac6..adf136cd898 100644
--- a/pkgs/development/libraries/haskell/hs-bibutils/default.nix
+++ b/pkgs/development/libraries/haskell/hs-bibutils/default.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "hs-bibutils";
-  version = "4.12";
-  sha256 = "0akxi69as7k5c0955yla9wcl1xvcvgzpzy3p1jj781w1lf89p537";
+  version = "5.0";
+  sha256 = "18gchn62g2cqzyj1nr8wd5i6smhq739g00cblkllj1jkni33ch2l";
   buildDepends = [ syb ];
   meta = {
-    homepage = "http://code.haskell.org/hs-bibutils";
+    homepage = "http://gorgias.mine.nu/repos/hs-bibutils/";
     description = "Haskell bindings to bibutils, the bibliography conversion utilities";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/hscolour/default.nix b/pkgs/development/libraries/haskell/hscolour/default.nix
index 2c2aa5be7e6..d8bc08b4b33 100644
--- a/pkgs/development/libraries/haskell/hscolour/default.nix
+++ b/pkgs/development/libraries/haskell/hscolour/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hscolour";
-  version = "1.20.2";
-  sha256 = "0jl2m2bpsqg2hnf9mmwwrpa7af8wqwaajfp2h3nnnmy5qks10ad5";
+  version = "1.20.3";
+  sha256 = "15ix93sw4p7g5ln2halcgqppdc0i0vmkzcjzxvqzkk9yp9pq3nrs";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/hsdns/default.nix b/pkgs/development/libraries/haskell/hsdns/default.nix
index aab6530fcc9..b72f4d947c4 100644
--- a/pkgs/development/libraries/haskell/hsdns/default.nix
+++ b/pkgs/development/libraries/haskell/hsdns/default.nix
@@ -2,16 +2,19 @@
 
 cabal.mkDerivation (self: {
   pname = "hsdns";
-  version = "1.5";
-  sha256 = "2788d1ad5ef07ae5f356a460fb92316118f3a4d9c779ec27fb8243602bcf6399";
+  version = "1.6";
+  sha256 = "1vf3crkhs7z572bqdf7p2hfcqkjxvnyg0w0cf8b7kyfxzn8bj3fa";
   buildDepends = [ network ];
   extraLibraries = [ adns ];
   noHaddock = true;
   meta = {
-    homepage = "http://gitorious.org/hsdns";
+    homepage = "http://github.com/peti/hsdns";
     description = "Asynchronous DNS Resolver";
-    license = "LGPL";
+    license = self.stdenv.lib.licenses.gpl3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hsemail/default.nix b/pkgs/development/libraries/haskell/hsemail/default.nix
index 36a320dbe68..1d823d6f840 100644
--- a/pkgs/development/libraries/haskell/hsemail/default.nix
+++ b/pkgs/development/libraries/haskell/hsemail/default.nix
@@ -1,15 +1,19 @@
-{ cabal, mtl, parsec }:
+{ cabal, doctest, hspec, mtl, parsec }:
 
 cabal.mkDerivation (self: {
   pname = "hsemail";
-  version = "1.7.2";
-  sha256 = "1bl017gfyvjvxs9z1fns6sknk1l55905r82i31aqbz9qyaj70gzx";
+  version = "1.7.6";
+  sha256 = "0v4c6ljrzc7680i85wyxq7fkfs2j00941ps3rn8r16x3x2r8di04";
   buildDepends = [ mtl parsec ];
+  testDepends = [ doctest hspec parsec ];
   meta = {
-    homepage = "http://gitorious.org/hsemail";
+    homepage = "http://github.com/peti/hsemail";
     description = "Internet Message Parsers";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/hslogger-template/default.nix b/pkgs/development/libraries/haskell/hslogger-template/default.nix
index a7b1a51b705..be78bea938c 100644
--- a/pkgs/development/libraries/haskell/hslogger-template/default.nix
+++ b/pkgs/development/libraries/haskell/hslogger-template/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hslogger-template";
-  version = "2.0.1";
-  sha256 = "1m8h4i8cxxw83vhbw61njvv86qdcff6zi3bf0nyhc4cq7pfrzqvj";
+  version = "2.0.2";
+  sha256 = "0qkyclj9fajvzbfcs0ik8ncy66x916r40jd85r4wi5nh482i7sp3";
   buildDepends = [ hslogger mtl ];
   meta = {
     description = "Automatic generation of hslogger functions";
diff --git a/pkgs/development/libraries/haskell/hspec-expectations/default.nix b/pkgs/development/libraries/haskell/hspec-expectations/default.nix
new file mode 100644
index 00000000000..4aaa5fe5e95
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hspec-expectations/default.nix
@@ -0,0 +1,16 @@
+{ cabal, hspec, HUnit, markdownUnlit, silently }:
+
+cabal.mkDerivation (self: {
+  pname = "hspec-expectations";
+  version = "0.3.2";
+  sha256 = "0962wlngqck0wc7mcby9bzci1s8d9a91vsm39rnab5wifhc2c6xi";
+  buildDepends = [ HUnit ];
+  testDepends = [ hspec HUnit markdownUnlit silently ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/sol/hspec-expectations#readme";
+    description = "Catchy combinators for HUnit";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/hspec-meta/default.nix b/pkgs/development/libraries/haskell/hspec-meta/default.nix
new file mode 100644
index 00000000000..93162ff8cdf
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hspec-meta/default.nix
@@ -0,0 +1,22 @@
+{ cabal, ansiTerminal, deepseq, filepath, hspecExpectations, HUnit
+, QuickCheck, quickcheckIo, random, setenv, time, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "hspec-meta";
+  version = "1.5.4";
+  sha256 = "07m7wxannk9rr8q2bdxhkjjlvwlzp7lq2c41y6cgjkjcm2x9qcc8";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    ansiTerminal deepseq filepath hspecExpectations HUnit QuickCheck
+    quickcheckIo random setenv time transformers
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://hspec.github.com/";
+    description = "A version of Hspec which is used to test Hspec itself";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/hspec/default.nix b/pkgs/development/libraries/haskell/hspec/default.nix
new file mode 100644
index 00000000000..354cd286de0
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hspec/default.nix
@@ -0,0 +1,28 @@
+{ cabal, ansiTerminal, deepseq, doctest, filepath, ghcPaths
+, hspecExpectations, hspecMeta, HUnit, QuickCheck, quickcheckIo
+, random, setenv, silently, time, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "hspec";
+  version = "1.5.4";
+  sha256 = "18c7mj2qh0q7ksb9sa7jhpfzsbbsfbv3gpkjpz1fx17bd3h8vkld";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    ansiTerminal deepseq filepath hspecExpectations HUnit QuickCheck
+    quickcheckIo random setenv time transformers
+  ];
+  testDepends = [
+    ansiTerminal deepseq doctest filepath ghcPaths hspecExpectations
+    hspecMeta HUnit QuickCheck quickcheckIo random setenv silently time
+    transformers
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://hspec.github.com/";
+    description = "Behavior-Driven Development for Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/hstatsd/default.nix b/pkgs/development/libraries/haskell/hstatsd/default.nix
new file mode 100644
index 00000000000..91a6159784a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/hstatsd/default.nix
@@ -0,0 +1,14 @@
+{ cabal, mtl, network, text }:
+
+cabal.mkDerivation (self: {
+  pname = "hstatsd";
+  version = "0.1";
+  sha256 = "092q52yyb1xdji1y72bdcgvp8by2w1z9j717sl1gmh2p89cpjrs4";
+  buildDepends = [ mtl network text ];
+  meta = {
+    homepage = "https://github.com/mokus0/hstatsd";
+    description = "Quick and dirty statsd interface";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/hsyslog/default.nix b/pkgs/development/libraries/haskell/hsyslog/default.nix
index d5043024fd6..3f475425659 100644
--- a/pkgs/development/libraries/haskell/hsyslog/default.nix
+++ b/pkgs/development/libraries/haskell/hsyslog/default.nix
@@ -2,13 +2,16 @@
 
 cabal.mkDerivation (self: {
   pname = "hsyslog";
-  version = "1.4";
-  sha256 = "f3bf4bf47565cb0245afb0e8ffa3f79635b02f0032081845a5999964d828f4db";
+  version = "1.5";
+  sha256 = "1dpcawnl3a5lw2w8gc9920sjrw43qmq1k2zws8rx2q0r6ps7nhgp";
   meta = {
-    homepage = "http://gitorious.org/hsyslog";
+    homepage = "http://github.com/peti/hsyslog";
     description = "FFI interface to syslog(3) from POSIX.1-2001.";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/html-conduit/default.nix b/pkgs/development/libraries/haskell/html-conduit/default.nix
new file mode 100644
index 00000000000..eaf1754b622
--- /dev/null
+++ b/pkgs/development/libraries/haskell/html-conduit/default.nix
@@ -0,0 +1,21 @@
+{ cabal, conduit, filesystemConduit, hspec, HUnit, resourcet
+, systemFilepath, tagstreamConduit, text, transformers, xmlConduit
+, xmlTypes
+}:
+
+cabal.mkDerivation (self: {
+  pname = "html-conduit";
+  version = "1.1.0";
+  sha256 = "11mkr7plhbn8kyki0h362habzhsnlb7yrg4ypy48d0l3i7p7vm53";
+  buildDepends = [
+    conduit filesystemConduit resourcet systemFilepath tagstreamConduit
+    text transformers xmlConduit xmlTypes
+  ];
+  testDepends = [ hspec HUnit xmlConduit ];
+  meta = {
+    homepage = "https://github.com/snoyberg/xml";
+    description = "Parse HTML documents using xml-conduit datatypes";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/http-conduit/default.nix b/pkgs/development/libraries/haskell/http-conduit/default.nix
index 9c0efe3f05c..cea5708c269 100644
--- a/pkgs/development/libraries/haskell/http-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/http-conduit/default.nix
@@ -1,21 +1,31 @@
-{ cabal, asn1Data, attoparsec, attoparsecConduit, base64Bytestring
-, blazeBuilder, blazeBuilderConduit, caseInsensitive, certificate
-, conduit, cookie, cprngAes, dataDefault, deepseq, failure
-, httpTypes, liftedBase, monadControl, mtl, network, regexCompat
+{ cabal, asn1Data, base64Bytestring, blazeBuilder
+, blazeBuilderConduit, caseInsensitive, certificate, conduit
+, cookie, cprngAes, dataDefault, deepseq, failure, filepath, hspec
+, httpTypes, HUnit, liftedBase, mimeTypes, monadControl, mtl
+, network, networkConduit, publicsuffixlist, random, regexCompat
 , resourcet, socks, text, time, tls, tlsExtra, transformers
-, transformersBase, utf8String, void, zlibConduit
+, transformersBase, utf8String, void, wai, warp, zlibConduit
 }:
 
 cabal.mkDerivation (self: {
   pname = "http-conduit";
-  version = "1.6.0";
-  sha256 = "1vr4kglmlqn6s31ks231qx4b8034p6yi0501h3zswpqyf5cimhl7";
+  version = "1.9.4";
+  sha256 = "0zm8m3nvxyc9z3b8d47ggx56raqpz1aa8r268k6gidpc5zpad2yl";
   buildDepends = [
-    asn1Data attoparsec attoparsecConduit base64Bytestring blazeBuilder
-    blazeBuilderConduit caseInsensitive certificate conduit cookie
-    cprngAes dataDefault deepseq failure httpTypes liftedBase
-    monadControl mtl network regexCompat resourcet socks text time tls
-    tlsExtra transformers transformersBase utf8String void zlibConduit
+    asn1Data base64Bytestring blazeBuilder blazeBuilderConduit
+    caseInsensitive certificate conduit cookie cprngAes dataDefault
+    deepseq failure filepath httpTypes liftedBase mimeTypes
+    monadControl mtl network publicsuffixlist random regexCompat
+    resourcet socks text time tls tlsExtra transformers
+    transformersBase utf8String void zlibConduit
+  ];
+  testDepends = [
+    asn1Data base64Bytestring blazeBuilder blazeBuilderConduit
+    caseInsensitive certificate conduit cookie cprngAes dataDefault
+    deepseq failure filepath hspec httpTypes HUnit liftedBase mimeTypes
+    monadControl mtl network networkConduit publicsuffixlist random
+    regexCompat resourcet socks text time tls tlsExtra transformers
+    transformersBase utf8String void wai warp zlibConduit
   ];
   meta = {
     homepage = "http://www.yesodweb.com/book/http-conduit";
diff --git a/pkgs/development/libraries/haskell/http-date/default.nix b/pkgs/development/libraries/haskell/http-date/default.nix
index 82e6d8477b6..3571c160f6b 100644
--- a/pkgs/development/libraries/haskell/http-date/default.nix
+++ b/pkgs/development/libraries/haskell/http-date/default.nix
@@ -1,10 +1,11 @@
-{ cabal, attoparsec }:
+{ cabal, attoparsec, doctest, hspec, time }:
 
 cabal.mkDerivation (self: {
   pname = "http-date";
-  version = "0.0.2";
-  sha256 = "18nijf3hswbvcd5amhbccqmgnanmslsmqpd2iixlvwz5hqb3ncvj";
+  version = "0.0.4";
+  sha256 = "1pbm066i1cpa3z2kfsqpva0qixnx87s76dpafz3wf6dkaqj8n8i5";
   buildDepends = [ attoparsec ];
+  testDepends = [ doctest hspec time ];
   meta = {
     description = "HTTP Date parser/formatter";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix b/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix
new file mode 100644
index 00000000000..6d1c34556f7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/http-reverse-proxy/default.nix
@@ -0,0 +1,26 @@
+{ cabal, blazeBuilder, caseInsensitive, classyPrelude, conduit
+, dataDefault, hspec, httpConduit, httpTypes, liftedBase
+, monadControl, network, networkConduit, text, transformers, wai
+, warp, word8
+}:
+
+cabal.mkDerivation (self: {
+  pname = "http-reverse-proxy";
+  version = "0.1.1.6";
+  sha256 = "0fh61rm3k00shzis2dkgifnkfn78vx124dzmmdzlf550kjmhxb9l";
+  buildDepends = [
+    blazeBuilder caseInsensitive classyPrelude conduit dataDefault
+    httpConduit httpTypes liftedBase monadControl network
+    networkConduit text wai warp word8
+  ];
+  testDepends = [
+    blazeBuilder conduit hspec httpConduit httpTypes liftedBase network
+    networkConduit transformers wai warp
+  ];
+  meta = {
+    homepage = "https://github.com/fpco/http-reverse-proxy";
+    description = "Reverse proxy HTTP requests, either over raw sockets or with WAI";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/http-types/default.nix b/pkgs/development/libraries/haskell/http-types/default.nix
index 14d347f39f5..c4c064fbf81 100644
--- a/pkgs/development/libraries/haskell/http-types/default.nix
+++ b/pkgs/development/libraries/haskell/http-types/default.nix
@@ -1,10 +1,11 @@
-{ cabal, blazeBuilder, caseInsensitive, text }:
+{ cabal, blazeBuilder, caseInsensitive, hspec, QuickCheck, text }:
 
 cabal.mkDerivation (self: {
   pname = "http-types";
-  version = "0.7.3";
-  sha256 = "1s2y2fl9l75xd6fls9ajasn37i7cqxfw772rkw50d3vxvk2fdxjh";
+  version = "0.8.0";
+  sha256 = "14d1gzgwhinkwx3lmc6hvqj6ivjrvy4m6fm2walnyk1zv24zli75";
   buildDepends = [ blazeBuilder caseInsensitive text ];
+  testDepends = [ blazeBuilder hspec QuickCheck text ];
   meta = {
     homepage = "https://github.com/aristidb/http-types";
     description = "Generic HTTP types for Haskell (for both client and server code)";
diff --git a/pkgs/development/libraries/haskell/hxt-regex-xmlschema/default.nix b/pkgs/development/libraries/haskell/hxt-regex-xmlschema/default.nix
index fb2e4a2c1e5..879ff0affdc 100644
--- a/pkgs/development/libraries/haskell/hxt-regex-xmlschema/default.nix
+++ b/pkgs/development/libraries/haskell/hxt-regex-xmlschema/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hxt-regex-xmlschema";
-  version = "9.0.4";
-  sha256 = "0jl89p9sb76zb6j2b9ssxaai6jq3jbnnpv4v05wfvlmk8apckwgf";
+  version = "9.1.0";
+  sha256 = "0l97rkrvl6pmxdgiwbwh2s3l00lyaihrhsffhh69639bgs67zgwr";
   buildDepends = [ hxtCharproperties parsec ];
   meta = {
     homepage = "http://www.haskell.org/haskellwiki/Regular_expressions_for_XML_Schema";
diff --git a/pkgs/development/libraries/haskell/hxt/default.nix b/pkgs/development/libraries/haskell/hxt/default.nix
index 203bb89ef09..35783c7762e 100644
--- a/pkgs/development/libraries/haskell/hxt/default.nix
+++ b/pkgs/development/libraries/haskell/hxt/default.nix
@@ -4,12 +4,13 @@
 
 cabal.mkDerivation (self: {
   pname = "hxt";
-  version = "9.2.2";
-  sha256 = "0ichjpshq10b11dyfv1q7rs2m190x3gplx6k54amlxv45nwd1s6r";
+  version = "9.3.1.1";
+  sha256 = "1x0z85vx49s2b9bgjm14c2152cwr0vzf02rlxrla5dj5g565985y";
   buildDepends = [
     binary deepseq filepath HUnit hxtCharproperties hxtRegexXmlschema
     hxtUnicode mtl network parsec
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://www.fh-wedel.de/~si/HXmlToolbox/index.html";
     description = "A collection of tools for processing XML with Haskell";
diff --git a/pkgs/development/libraries/haskell/idna/default.nix b/pkgs/development/libraries/haskell/idna/default.nix
new file mode 100644
index 00000000000..1d5bc92bf6f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/idna/default.nix
@@ -0,0 +1,13 @@
+{ cabal, punycode, stringprep, text }:
+
+cabal.mkDerivation (self: {
+  pname = "idna";
+  version = "0.2";
+  sha256 = "0gl1mn2fjyxdpzl024imspf7hk4xvj9r8mvisqnlkdsng8i5jnyz";
+  buildDepends = [ punycode stringprep text ];
+  meta = {
+    description = "Implements IDNA (RFC 3490)";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/instant-generics/default.nix b/pkgs/development/libraries/haskell/instant-generics/default.nix
index f4dfc4848a6..61e580b6293 100644
--- a/pkgs/development/libraries/haskell/instant-generics/default.nix
+++ b/pkgs/development/libraries/haskell/instant-generics/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "instant-generics";
-  version = "0.3.5";
-  sha256 = "15j41krvabf541vm4vpn2jvlg3nbi6pywcig9zbjjpckzwp5vj9x";
+  version = "0.3.7";
+  sha256 = "0kkfx009ij3pwga7x18vr8p0ffhahlp8sb6ykzfh8rhcqd4ryzyv";
   buildDepends = [ syb ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/InstantGenerics";
diff --git a/pkgs/development/libraries/haskell/io-choice/default.nix b/pkgs/development/libraries/haskell/io-choice/default.nix
index f8b1f1d51a4..bec6431b42b 100644
--- a/pkgs/development/libraries/haskell/io-choice/default.nix
+++ b/pkgs/development/libraries/haskell/io-choice/default.nix
@@ -1,13 +1,15 @@
-{ cabal, liftedBase, monadControl, transformers, transformersBase
+{ cabal, hspec, liftedBase, monadControl, transformers
+, transformersBase
 }:
 
 cabal.mkDerivation (self: {
   pname = "io-choice";
-  version = "0.0.2";
-  sha256 = "0kxn357cc31gvaajg41h6xwpivq049dl1zd551xfvrvzndvy061f";
+  version = "0.0.4";
+  sha256 = "1b6jvk37jkpd4m3r6ip70xwzrz67a30yam831nqpljsbgk2f9arq";
   buildDepends = [
     liftedBase monadControl transformers transformersBase
   ];
+  testDepends = [ hspec liftedBase monadControl transformers ];
   meta = {
     description = "Choice for IO and lifted IO";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/iproute/default.nix b/pkgs/development/libraries/haskell/iproute/default.nix
new file mode 100644
index 00000000000..045bb64035c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/iproute/default.nix
@@ -0,0 +1,19 @@
+{ cabal, appar, byteorder, doctest, hspec, network, QuickCheck
+, safe
+}:
+
+cabal.mkDerivation (self: {
+  pname = "iproute";
+  version = "1.2.11";
+  sha256 = "14f96sb41f5m14186900rz84vwv7idjiylp8m5nsm6gganvh4sh4";
+  buildDepends = [ appar byteorder network ];
+  testDepends = [
+    appar byteorder doctest hspec network QuickCheck safe
+  ];
+  meta = {
+    homepage = "http://www.mew.org/~kazu/proj/iproute/";
+    description = "IP Routing Table";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/iteratee/default.nix b/pkgs/development/libraries/haskell/iteratee/default.nix
index 14c125121bd..ee9026bae49 100644
--- a/pkgs/development/libraries/haskell/iteratee/default.nix
+++ b/pkgs/development/libraries/haskell/iteratee/default.nix
@@ -4,10 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "iteratee";
-  version = "0.8.9.1";
-  sha256 = "1yk7jvabmabf0qjcd00imbg7vx84yjf71h7x3zbv4a51ykfy5hax";
-  isLibrary = true;
-  isExecutable = true;
+  version = "0.8.9.4";
+  sha256 = "0j8q5i3kf1ld7630z65hj55p2jlhl23f6qjag4zwrhrh38bfr531";
   buildDepends = [
     ListLike MonadCatchIOTransformers monadControl parallel
     transformers transformersBase
diff --git a/pkgs/development/libraries/haskell/ix-shapable/default.nix b/pkgs/development/libraries/haskell/ix-shapable/default.nix
new file mode 100644
index 00000000000..056e308b4ac
--- /dev/null
+++ b/pkgs/development/libraries/haskell/ix-shapable/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "ix-shapable";
+  version = "0.1.0";
+  sha256 = "08ljlzywnw0h8ijwb6yh4r8l6z7bbknwxv9cjq7lkfx7m2vgy1sh";
+  meta = {
+    description = "Reshape multi-dimensional arrays";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/json/default.nix b/pkgs/development/libraries/haskell/json/default.nix
index 5bfbb59d83f..9a56f412fe2 100644
--- a/pkgs/development/libraries/haskell/json/default.nix
+++ b/pkgs/development/libraries/haskell/json/default.nix
@@ -1,18 +1,14 @@
-{ cabal, mtl, parsec, syb }:
+{ cabal, mtl, parsec, syb, text }:
 
 cabal.mkDerivation (self: {
   pname = "json";
-  version = "0.5";
-  sha256 = "12jbvq0lp7z5q6g94pv8s5455yydfyh9h2xlr76wqzfh3myvy6fl";
-  buildDepends = [ mtl parsec syb ];
-  patchPhase = "sed -i json.cabal -e '1iExtensions: FlexibleInstances'";
+  version = "0.7";
+  sha256 = "18v8vbx3pyskf3ap4lpy2d3461gghfsq5bzjyrjvqsd2r9r44rfk";
+  buildDepends = [ mtl parsec syb text ];
   meta = {
     description = "Support for serialising Haskell to and from JSON";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/kansas-lava/default.nix b/pkgs/development/libraries/haskell/kansas-lava/default.nix
new file mode 100644
index 00000000000..6ae0447b1fe
--- /dev/null
+++ b/pkgs/development/libraries/haskell/kansas-lava/default.nix
@@ -0,0 +1,22 @@
+{ cabal, cmdargs, dataDefault, dataReify, dotgen, filepath, netlist
+, netlistToVhdl, random, sizedTypes, strict
+}:
+
+cabal.mkDerivation (self: {
+  pname = "kansas-lava";
+  version = "0.2.4";
+  sha256 = "0rsjlj558k57r1sfm12n9r9wn8r615bbrwgjhal07qhvy4qip4pg";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    cmdargs dataDefault dataReify dotgen filepath netlist netlistToVhdl
+    random sizedTypes strict
+  ];
+  jailbreak = true;
+  meta = {
+    homepage = "http://ittc.ku.edu/csdl/fpg/Tools/KansasLava";
+    description = "Kansas Lava is a hardware simulator and VHDL generator";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/knob/default.nix b/pkgs/development/libraries/haskell/knob/default.nix
new file mode 100644
index 00000000000..acaf8def004
--- /dev/null
+++ b/pkgs/development/libraries/haskell/knob/default.nix
@@ -0,0 +1,14 @@
+{ cabal, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "knob";
+  version = "0.1.1";
+  sha256 = "05qj7s04p5pbasivyxc06l0jbii250zjnvb3l1y2sfhglb7q8b4c";
+  buildDepends = [ transformers ];
+  meta = {
+    homepage = "https://john-millikin.com/software/knob/";
+    description = "Memory-backed handles";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/lambdabot-utils/default.nix b/pkgs/development/libraries/haskell/lambdabot-utils/default.nix
index 3339e7aa96d..51db50a75b7 100644
--- a/pkgs/development/libraries/haskell/lambdabot-utils/default.nix
+++ b/pkgs/development/libraries/haskell/lambdabot-utils/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "lambdabot-utils";
-  version = "4.2.1";
-  sha256 = "1a5rj8zjvfhziwldikgki92lg9bwv6h9ysp6yqip6lja18h4lilx";
+  version = "4.2.2";
+  sha256 = "0mmz9rn6vv8xnavmz66g164h1liir3rzg1n7lmbcsgwcyhm925d7";
   buildDepends = [
     binary haskellSrc mtl network random regexCompat regexPosix syb
     tagsoup utf8String zlib
diff --git a/pkgs/development/libraries/haskell/lambdabot/default.nix b/pkgs/development/libraries/haskell/lambdabot/default.nix
index 926c5acafba..922130f4f9b 100644
--- a/pkgs/development/libraries/haskell/lambdabot/default.nix
+++ b/pkgs/development/libraries/haskell/lambdabot/default.nix
@@ -1,21 +1,27 @@
-{ cabal, arrows, binary, brainfuck, dataMemocombinators, filepath
-, haskellSrc, haskellSrcExts, HTTP, IOSpec, lambdabotUtils, logict
-, MonadRandom, mtl, network, numbers, oeis, parsec, random
-, readline, regexCompat, show, syb, tagsoup, unlambda, utf8String
-, vectorSpace
+{ cabal, arrows, binary, brainfuck, dataMemocombinators
+, dependentMap, dependentSum, dependentSumTemplate, dice
+, editDistance, filepath, haskeline, haskellSrcExts, hoogle
+, hslogger, hstatsd, HTTP, IOSpec, liftedBase, logict, misfortune
+, monadControl, MonadRandom, mtl, mueval, network, numbers, oeis
+, parsec, QuickCheck, random, randomFu, randomSource, regexTdfa
+, SafeSemaphore, show, split, syb, tagsoup, time, transformers
+, transformersBase, unlambda, utf8String, vectorSpace, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "lambdabot";
-  version = "4.2.3.3";
-  sha256 = "1fxxmrm390pnqpf7v4kap2asaqh02sphl8r6inq4sdy1zs2rxrvk";
+  version = "4.3";
+  sha256 = "0pjwxlq4rbmg9wj44vrillly967y35b4i995mz5167hpji05clvy";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    arrows binary brainfuck dataMemocombinators filepath haskellSrc
-    haskellSrcExts HTTP IOSpec lambdabotUtils logict MonadRandom mtl
-    network numbers oeis parsec random readline regexCompat show syb
-    tagsoup unlambda utf8String vectorSpace
+    arrows binary brainfuck dataMemocombinators dependentMap
+    dependentSum dependentSumTemplate dice editDistance filepath
+    haskeline haskellSrcExts hoogle hslogger hstatsd HTTP IOSpec
+    liftedBase logict misfortune monadControl MonadRandom mtl mueval
+    network numbers oeis parsec QuickCheck random randomFu randomSource
+    regexTdfa SafeSemaphore show split syb tagsoup time transformers
+    transformersBase unlambda utf8String vectorSpace zlib
   ];
   meta = {
     homepage = "http://haskell.org/haskellwiki/Lambdabot";
diff --git a/pkgs/development/libraries/haskell/lambdacube-engine/default.nix b/pkgs/development/libraries/haskell/lambdacube-engine/default.nix
new file mode 100644
index 00000000000..f3c9a8af4ea
--- /dev/null
+++ b/pkgs/development/libraries/haskell/lambdacube-engine/default.nix
@@ -0,0 +1,19 @@
+{ cabal, binary, bitmap, bytestringTrie, filepath, mtl, OpenGLRaw
+, stbImage, uulib, vect, vector, vectorAlgorithms, xml, zipArchive
+}:
+
+cabal.mkDerivation (self: {
+  pname = "lambdacube-engine";
+  version = "0.2.4";
+  sha256 = "1xdp10nylndmfw16dywqrxj30g99rf9qbcx5qiglvzm1c1kxid3f";
+  buildDepends = [
+    binary bitmap bytestringTrie filepath mtl OpenGLRaw stbImage uulib
+    vect vector vectorAlgorithms xml zipArchive
+  ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/LambdaCubeEngine";
+    description = "3D rendering engine written entirely in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/language-c-quote/default.nix b/pkgs/development/libraries/haskell/language-c-quote/default.nix
index a765b015a31..35d15c0291a 100644
--- a/pkgs/development/libraries/haskell/language-c-quote/default.nix
+++ b/pkgs/development/libraries/haskell/language-c-quote/default.nix
@@ -1,19 +1,24 @@
 { cabal, alex, exceptionMtl, exceptionTransformers, filepath, happy
-, haskellSrcMeta, mainlandPretty, mtl, srcloc, syb, symbol
+, haskellSrcMeta, HUnit, mainlandPretty, mtl, srcloc, syb, symbol
+, testFramework, testFrameworkHunit
 }:
 
 cabal.mkDerivation (self: {
   pname = "language-c-quote";
-  version = "0.3.2";
-  sha256 = "1pxrag9ws93rsqrsxcyxg07pvp2qw0f19yj2b40ynwzk112nkd16";
+  version = "0.7.2";
+  sha256 = "01ki78qh39gbd9md3pq783vx2p86gyzhclci7pcppz2rd3man51m";
   buildDepends = [
     exceptionMtl exceptionTransformers filepath haskellSrcMeta
     mainlandPretty mtl srcloc syb symbol
   ];
+  testDepends = [
+    HUnit srcloc symbol testFramework testFrameworkHunit
+  ];
   buildTools = [ alex happy ];
+  jailbreak = true;
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
-    description = "C/CUDA/OpenCL quasiquoting library";
+    description = "C/CUDA/OpenCL/Objective-C quasiquoting library";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/language-haskell-extract/default.nix b/pkgs/development/libraries/haskell/language-haskell-extract/default.nix
index 7cbbce517f6..a77040a5578 100644
--- a/pkgs/development/libraries/haskell/language-haskell-extract/default.nix
+++ b/pkgs/development/libraries/haskell/language-haskell-extract/default.nix
@@ -1,10 +1,10 @@
-{ cabal, haskellSrcExts, regexPosix }:
+{ cabal, regexPosix }:
 
 cabal.mkDerivation (self: {
   pname = "language-haskell-extract";
-  version = "0.2.1";
-  sha256 = "0lmg16g3z8cx0vb037bk4j2nr3qvybfcqfsr8l6jk57b2nz3yhbf";
-  buildDepends = [ haskellSrcExts regexPosix ];
+  version = "0.2.4";
+  sha256 = "1nxcs7g8a1sp91bzpy4cj6s31k5pvc3gvig04cbrggv5cvjidnhl";
+  buildDepends = [ regexPosix ];
   meta = {
     homepage = "http://github.com/finnsson/template-helper";
     description = "Module to automatically extract functions from the local code";
diff --git a/pkgs/development/libraries/haskell/language-java/default.nix b/pkgs/development/libraries/haskell/language-java/default.nix
new file mode 100644
index 00000000000..5464826788b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/language-java/default.nix
@@ -0,0 +1,22 @@
+{ cabal, alex, cpphs, filepath, HUnit, mtl, parsec, QuickCheck, syb
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "language-java";
+  version = "0.2.4";
+  sha256 = "1fb36xq75mzmbsh25s0pscazvz6nvfy2mn1270653m7s3gdgcs5f";
+  buildDepends = [ cpphs parsec syb ];
+  testDepends = [
+    filepath HUnit mtl QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  buildTools = [ alex ];
+  doCheck = false;
+  meta = {
+    homepage = "http://github.com/vincenthz/language-java";
+    description = "Manipulating Java source: abstract syntax, lexer, parser, and pretty-printer";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/language-javascript/default.nix b/pkgs/development/libraries/haskell/language-javascript/default.nix
index 3f04b3a9289..4571b869e3b 100644
--- a/pkgs/development/libraries/haskell/language-javascript/default.nix
+++ b/pkgs/development/libraries/haskell/language-javascript/default.nix
@@ -1,10 +1,16 @@
-{ cabal, blazeBuilder, happy, mtl, utf8Light, utf8String }:
+{ cabal, blazeBuilder, Cabal, happy, HUnit, mtl, QuickCheck
+, testFramework, testFrameworkHunit, utf8Light, utf8String
+}:
 
 cabal.mkDerivation (self: {
   pname = "language-javascript";
-  version = "0.5.4";
-  sha256 = "0hjx12n3pkxcdkppqalv6sl68vjlib37gby89ksay807ndslvb9q";
+  version = "0.5.7";
+  sha256 = "0mndz0bqxkayzm7g92cvai9ahb9msr99syp9djhaya1d45595ad3";
   buildDepends = [ blazeBuilder mtl utf8Light utf8String ];
+  testDepends = [
+    blazeBuilder Cabal HUnit mtl QuickCheck testFramework
+    testFrameworkHunit utf8Light utf8String
+  ];
   buildTools = [ happy ];
   meta = {
     homepage = "http://github.com/alanz/language-javascript";
diff --git a/pkgs/development/libraries/haskell/largeword/default.nix b/pkgs/development/libraries/haskell/largeword/default.nix
index 7f01336f281..da0cafb9ba7 100644
--- a/pkgs/development/libraries/haskell/largeword/default.nix
+++ b/pkgs/development/libraries/haskell/largeword/default.nix
@@ -1,11 +1,17 @@
-{ cabal }:
+{ cabal, HUnit, QuickCheck, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "largeword";
-  version = "1.0.2";
-  sha256 = "0ylbl9rffhqw9ahasn23n00h7v5yqmghmqkrq446zdr72bq23hk2";
+  version = "1.0.5";
+  sha256 = "0icwqwpn59xd0qfpaihvwz1waax617qqcl05jv9f26sjdr8688dl";
+  testDepends = [
+    HUnit QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
   meta = {
-    homepage = "http://trac.haskell.org/largeword/wiki";
+    homepage = "https://github.com/idontgetoutmuch/largeword";
     description = "Provides Word128, Word192 and Word256 and a way of producing other large words if required";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/leksah/leksah-server.nix b/pkgs/development/libraries/haskell/leksah/leksah-server.nix
index cfcc69641b5..1a907a384f1 100644
--- a/pkgs/development/libraries/haskell/leksah/leksah-server.nix
+++ b/pkgs/development/libraries/haskell/leksah/leksah-server.nix
@@ -1,6 +1,6 @@
 { cabal, attoparsec, attoparsecEnumerator, binary, binaryShared
-, Cabal, deepseq, enumerator, filepath, haddock, hslogger, ltk
-, network, parsec, processLeksah, strict, time, transformers
+, Cabal, deepseq, enumerator, filepath, haddock, hslogger, HUnit
+, ltk, network, parsec, processLeksah, strict, time, transformers
 }:
 
 cabal.mkDerivation (self: {
@@ -14,6 +14,7 @@ cabal.mkDerivation (self: {
     enumerator filepath haddock hslogger ltk network parsec
     processLeksah strict time transformers
   ];
+  testDepends = [ enumerator hslogger HUnit transformers ];
   meta = {
     homepage = "http://leksah.org";
     description = "Metadata collection for leksah";
diff --git a/pkgs/development/libraries/haskell/lens/default.nix b/pkgs/development/libraries/haskell/lens/default.nix
new file mode 100644
index 00000000000..4531603214e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/lens/default.nix
@@ -0,0 +1,35 @@
+{ cabal, bifunctors, comonad, comonadsFd, comonadTransformers
+, contravariant, deepseq, distributive, doctest, filepath
+, genericDeriving, hashable, HUnit, MonadCatchIOTransformers, mtl
+, nats, parallel, profunctorExtras, profunctors, QuickCheck
+, reflection, semigroupoids, semigroups, simpleReflect, split
+, tagged, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2, testFrameworkTh, text, transformers
+, transformersCompat, unorderedContainers, vector, void
+}:
+
+cabal.mkDerivation (self: {
+  pname = "lens";
+  version = "3.9.0.2";
+  sha256 = "0ch38z33zgdyzjmc7jqwabwq68iidicpzhbwzpd4fvcqdp27apl2";
+  buildDepends = [
+    bifunctors comonad comonadsFd comonadTransformers contravariant
+    distributive filepath genericDeriving hashable
+    MonadCatchIOTransformers mtl parallel profunctorExtras profunctors
+    reflection semigroupoids semigroups split tagged text transformers
+    transformersCompat unorderedContainers vector void
+  ];
+  testDepends = [
+    deepseq doctest filepath genericDeriving HUnit mtl nats parallel
+    QuickCheck semigroups simpleReflect split testFramework
+    testFrameworkHunit testFrameworkQuickcheck2 testFrameworkTh text
+    transformers unorderedContainers vector
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://github.com/ekmett/lens/";
+    description = "Lenses, Folds and Traversals";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/lenses/default.nix b/pkgs/development/libraries/haskell/lenses/default.nix
new file mode 100644
index 00000000000..aa560fbda06
--- /dev/null
+++ b/pkgs/development/libraries/haskell/lenses/default.nix
@@ -0,0 +1,14 @@
+{ cabal, mtl }:
+
+cabal.mkDerivation (self: {
+  pname = "lenses";
+  version = "0.1.6";
+  sha256 = "0n2r7gjiq5vk6jjaxn7kr3g5gvn4y0gmdqpn9l0nfgqdnscmfbiv";
+  buildDepends = [ mtl ];
+  meta = {
+    homepage = "http://github.com/jvranish/Lenses/tree/master";
+    description = "Simple Functional Lenses";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/libffi/default.nix b/pkgs/development/libraries/haskell/libffi/default.nix
new file mode 100644
index 00000000000..da87fc01bc6
--- /dev/null
+++ b/pkgs/development/libraries/haskell/libffi/default.nix
@@ -0,0 +1,13 @@
+{ cabal, libffi }:
+
+cabal.mkDerivation (self: {
+  pname = "libffi";
+  version = "0.1";
+  sha256 = "0g7jnhng3j7z5517aaqga0144aamibsbpgm3yynwyfzkq1kp0f28";
+  pkgconfigDepends = [ libffi ];
+  meta = {
+    description = "A binding to libffi";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/liblastfm/default.nix b/pkgs/development/libraries/haskell/liblastfm/default.nix
new file mode 100644
index 00000000000..4e98aa82bc2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/liblastfm/default.nix
@@ -0,0 +1,22 @@
+{ cabal, aeson, attoparsec, cereal, contravariant, cryptoApi
+, httpConduit, httpTypes, HUnit, network, pureMD5, testFramework
+, testFrameworkHunit, text, void
+}:
+
+cabal.mkDerivation (self: {
+  pname = "liblastfm";
+  version = "0.2.0.0";
+  sha256 = "1x147mry8pq8qzrhrsbxm4b7sb80c9900kq2igwvcskwszd5h56n";
+  buildDepends = [
+    aeson cereal contravariant cryptoApi httpConduit httpTypes network
+    pureMD5 text void
+  ];
+  testDepends = [
+    aeson attoparsec HUnit testFramework testFrameworkHunit text
+  ];
+  meta = {
+    description = "Lastfm API interface";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/libmpd/default.nix b/pkgs/development/libraries/haskell/libmpd/default.nix
index c0ba821d5f1..7402d6f31db 100644
--- a/pkgs/development/libraries/haskell/libmpd/default.nix
+++ b/pkgs/development/libraries/haskell/libmpd/default.nix
@@ -1,10 +1,15 @@
-{ cabal, filepath, mtl, network, text, time, utf8String }:
+{ cabal, dataDefault, filepath, hspec, HUnit, mtl, network
+, QuickCheck, text, time, utf8String
+}:
 
 cabal.mkDerivation (self: {
   pname = "libmpd";
-  version = "0.8.0";
-  sha256 = "0sn9yqiqr011glb7q0f3xj24wkkvnib0khzf833npcas4420d0ya";
+  version = "0.8.0.2";
+  sha256 = "1phlbb5lsapw2hb0db7906ddlmvnpyk1xbgxvl9zp9zfd0sn40aj";
   buildDepends = [ filepath mtl network text time utf8String ];
+  testDepends = [
+    dataDefault hspec HUnit mtl network QuickCheck text time utf8String
+  ];
   meta = {
     homepage = "http://github.com/joachifm/libmpd-haskell";
     description = "An MPD client library";
diff --git a/pkgs/development/libraries/haskell/libxml-sax/default.nix b/pkgs/development/libraries/haskell/libxml-sax/default.nix
new file mode 100644
index 00000000000..afdd782fe09
--- /dev/null
+++ b/pkgs/development/libraries/haskell/libxml-sax/default.nix
@@ -0,0 +1,16 @@
+{ cabal, libxml2, text, xmlTypes }:
+
+cabal.mkDerivation (self: {
+  pname = "libxml-sax";
+  version = "0.7.4";
+  sha256 = "1vbxrmxxb6a58hd6dd81kz8fh198jkvwv4gxzbbfw44170946c0z";
+  buildDepends = [ text xmlTypes ];
+  extraLibraries = [ libxml2 ];
+  pkgconfigDepends = [ libxml2 ];
+  meta = {
+    homepage = "https://john-millikin.com/software/haskell-libxml/";
+    description = "Bindings for the libXML2 SAX interface";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/lifted-base/default.nix b/pkgs/development/libraries/haskell/lifted-base/default.nix
index 09264ab57f4..dc970925f98 100644
--- a/pkgs/development/libraries/haskell/lifted-base/default.nix
+++ b/pkgs/development/libraries/haskell/lifted-base/default.nix
@@ -1,12 +1,18 @@
-{ cabal, baseUnicodeSymbols, monadControl, transformersBase }:
+{ cabal, baseUnicodeSymbols, HUnit, monadControl, testFramework
+, testFrameworkHunit, transformers, transformersBase
+}:
 
 cabal.mkDerivation (self: {
   pname = "lifted-base";
-  version = "0.1.2";
-  sha256 = "0js94dlfy2wjl026jcj2l399ly4zgw0cgxkmil6lsm34gcy9vrvq";
+  version = "0.2.1.0";
+  sha256 = "0c4vzyfyjvqv5q8mprgxf9ckibpp5k1zh9k5slmdsd9m1l3pwwqy";
   buildDepends = [
     baseUnicodeSymbols monadControl transformersBase
   ];
+  testDepends = [
+    HUnit monadControl testFramework testFrameworkHunit transformers
+    transformersBase
+  ];
   meta = {
     homepage = "https://github.com/basvandijk/lifted-base";
     description = "lifted IO operations from the base library";
diff --git a/pkgs/development/libraries/haskell/lockfree-queue/default.nix b/pkgs/development/libraries/haskell/lockfree-queue/default.nix
new file mode 100644
index 00000000000..ac2114b7f37
--- /dev/null
+++ b/pkgs/development/libraries/haskell/lockfree-queue/default.nix
@@ -0,0 +1,20 @@
+{ cabal, abstractDeque, atomicPrimops, HUnit, IORefCAS
+, testFramework, testFrameworkHunit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "lockfree-queue";
+  version = "0.2.0.2";
+  sha256 = "0mb07hx4cllnxv7mz19vvn9zcc5rx0ji5wv80fx0yirgk2qjpgml";
+  buildDepends = [ abstractDeque atomicPrimops IORefCAS ];
+  testDepends = [
+    abstractDeque atomicPrimops HUnit IORefCAS testFramework
+    testFrameworkHunit
+  ];
+  meta = {
+    homepage = "https://github.com/rrnewton/haskell-lockfree-queue/wiki";
+    description = "Michael and Scott lock-free queues";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/logict/default.nix b/pkgs/development/libraries/haskell/logict/default.nix
index 4e67e4ffb4c..0a03ed45fee 100644
--- a/pkgs/development/libraries/haskell/logict/default.nix
+++ b/pkgs/development/libraries/haskell/logict/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "logict";
-  version = "0.5.0.1";
-  sha256 = "0k3acw6fwhqz4qaz7k85fx5b43hwc926il0mljc69gjrgw0c8nzv";
+  version = "0.6";
+  sha256 = "1np4wizvwlx458kq6mmdrh8qcp1794y1bs4mnnz951h6hay5z49f";
   buildDepends = [ mtl ];
   meta = {
     homepage = "http://code.haskell.org/~dolio/logict";
diff --git a/pkgs/development/libraries/haskell/lrucache/default.nix b/pkgs/development/libraries/haskell/lrucache/default.nix
index d92bd820348..2d494f4a896 100644
--- a/pkgs/development/libraries/haskell/lrucache/default.nix
+++ b/pkgs/development/libraries/haskell/lrucache/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "lrucache";
-  version = "1.1.1";
-  sha256 = "05y0b2dbbp017hkbr0pz943956dm31g5xhma4bqnh49yd4lyn5l9";
+  version = "1.1.1.3";
+  sha256 = "1djjxlyfrk3wpgc4h6xljpray09v7lc956202k9bxra24vj5f1lm";
   meta = {
     homepage = "http://github.com/chowells79/lrucache";
     description = "a simple, pure LRU cache";
diff --git a/pkgs/development/libraries/haskell/maccatcher/default.nix b/pkgs/development/libraries/haskell/maccatcher/default.nix
new file mode 100644
index 00000000000..6109f33f82f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/maccatcher/default.nix
@@ -0,0 +1,15 @@
+{ cabal, binary, parsec }:
+
+cabal.mkDerivation (self: {
+  pname = "maccatcher";
+  version = "2.1.5";
+  sha256 = "0z56rbfr8vijhjf3dcqd4kaxgx9bf3qgi9sm61yc3i6ra60w7byb";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ binary parsec ];
+  meta = {
+    description = "Obtain the host MAC address on *NIX and Windows";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/mainland-pretty/default.nix b/pkgs/development/libraries/haskell/mainland-pretty/default.nix
index d64a6c76180..2bcf2037cbe 100644
--- a/pkgs/development/libraries/haskell/mainland-pretty/default.nix
+++ b/pkgs/development/libraries/haskell/mainland-pretty/default.nix
@@ -1,10 +1,10 @@
-{ cabal, srcloc, symbol }:
+{ cabal, srcloc, text }:
 
 cabal.mkDerivation (self: {
   pname = "mainland-pretty";
-  version = "0.1.3.0";
-  sha256 = "1grfsn066z11737dxdk1bdhyvz9vjxxn6krfgx9bc8jin6n9h6aq";
-  buildDepends = [ srcloc symbol ];
+  version = "0.2.6";
+  sha256 = "1mjw79jg0vq8qvgvjdinidw1pvfj3mych3z0f6g031vmqz7fqvzy";
+  buildDepends = [ srcloc text ];
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
     description = "Pretty printing designed for printing source code";
diff --git a/pkgs/development/libraries/haskell/markdown-unlit/default.nix b/pkgs/development/libraries/haskell/markdown-unlit/default.nix
new file mode 100644
index 00000000000..06c1b9e2fca
--- /dev/null
+++ b/pkgs/development/libraries/haskell/markdown-unlit/default.nix
@@ -0,0 +1,15 @@
+{ cabal, hspec, QuickCheck, silently, stringbuilder }:
+
+cabal.mkDerivation (self: {
+  pname = "markdown-unlit";
+  version = "0.2.0.1";
+  sha256 = "1bc3vcifv2xcddh8liq380c6sxarrs5pf21pfs9i4dx9rfl3hvhq";
+  isLibrary = true;
+  isExecutable = true;
+  testDepends = [ hspec QuickCheck silently stringbuilder ];
+  meta = {
+    description = "Literate Haskell support for Markdown";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/math-functions/default.nix b/pkgs/development/libraries/haskell/math-functions/default.nix
index fda06d718ed..2e29269a9fd 100644
--- a/pkgs/development/libraries/haskell/math-functions/default.nix
+++ b/pkgs/development/libraries/haskell/math-functions/default.nix
@@ -1,10 +1,16 @@
-{ cabal, erf, vector }:
+{ cabal, erf, HUnit, ieee754, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, vector
+}:
 
 cabal.mkDerivation (self: {
   pname = "math-functions";
-  version = "0.1.1.1";
-  sha256 = "1256fyd80z6yf61a5a90b3lad7hj0n59cyn741nkdh8p6hqrsi7z";
+  version = "0.1.3.0";
+  sha256 = "06wxr8fbhmsgkpyx2vimx9l6apk0p27mwrxrvbjk0b7m9vsg3ay5";
   buildDepends = [ erf vector ];
+  testDepends = [
+    HUnit ieee754 QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 vector
+  ];
   meta = {
     homepage = "https://github.com/bos/math-functions";
     description = "Special functions and Chebyshev polynomials";
diff --git a/pkgs/development/libraries/haskell/mime-mail/default.nix b/pkgs/development/libraries/haskell/mime-mail/default.nix
index 9abc588a0e7..d24bf5719bd 100644
--- a/pkgs/development/libraries/haskell/mime-mail/default.nix
+++ b/pkgs/development/libraries/haskell/mime-mail/default.nix
@@ -2,14 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "mime-mail";
-  version = "0.4.1.1";
-  sha256 = "01dshc6ysjkab9hl851948l6k0lwgm1fqmyk97zy7wckb252w6y4";
+  version = "0.4.1.2";
+  sha256 = "01dw9zvgxmwg0jslw14a9kjrmyjvwla8bw40w2426ifdwwxb3ywy";
   buildDepends = [
     base64Bytestring blazeBuilder filepath random text
   ];
-  patchPhase = ''
-    sed -i -e 's|, base64-bytestring.*|, base64-bytestring|' mime-mail.cabal
-  '';
   meta = {
     homepage = "http://github.com/snoyberg/mime-mail";
     description = "Compose MIME email messages";
diff --git a/pkgs/development/libraries/haskell/mime-types/default.nix b/pkgs/development/libraries/haskell/mime-types/default.nix
index 8359d6dc181..5dd5f65c9e7 100644
--- a/pkgs/development/libraries/haskell/mime-types/default.nix
+++ b/pkgs/development/libraries/haskell/mime-types/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "mime-types";
-  version = "0.1.0.0";
-  sha256 = "0xc36pr84nszyych3jd8sl6kj1grsyv8ci8v7ilrbpnw7ngbkw1p";
+  version = "0.1.0.3";
+  sha256 = "0mzhkqcjlnrs9mwn2crsr1m2mf6pgygs1s3ks8akz1618v6jm6y1";
   buildDepends = [ text ];
   meta = {
     homepage = "https://github.com/yesodweb/wai";
diff --git a/pkgs/development/libraries/haskell/minimorph/default.nix b/pkgs/development/libraries/haskell/minimorph/default.nix
new file mode 100644
index 00000000000..06dcfaa1139
--- /dev/null
+++ b/pkgs/development/libraries/haskell/minimorph/default.nix
@@ -0,0 +1,15 @@
+{ cabal, HUnit, testFramework, testFrameworkHunit, text }:
+
+cabal.mkDerivation (self: {
+  pname = "minimorph";
+  version = "0.1.4.0";
+  sha256 = "16ri9hfriszrgqcm111b1pp5x65s034hrc35kjz5qax32mnc9rn6";
+  buildDepends = [ text ];
+  testDepends = [ HUnit testFramework testFrameworkHunit text ];
+  meta = {
+    homepage = "http://darcsden.com/kowey/minimorph";
+    description = "English spelling functions with an emphasis on simplicity";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/miniutter/default.nix b/pkgs/development/libraries/haskell/miniutter/default.nix
new file mode 100644
index 00000000000..22018087226
--- /dev/null
+++ b/pkgs/development/libraries/haskell/miniutter/default.nix
@@ -0,0 +1,16 @@
+{ cabal, HUnit, minimorph, testFramework, testFrameworkHunit, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "miniutter";
+  version = "0.4.0";
+  sha256 = "1l275aad8svrqp22jv9s0mmlam7wbdlf6m4m97658rm8ks4j2mbx";
+  buildDepends = [ minimorph text ];
+  testDepends = [ HUnit testFramework testFrameworkHunit text ];
+  meta = {
+    homepage = "https://github.com/Mikolaj/miniutter";
+    description = "Simple English clause creation from arbitrary words";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/misfortune/default.nix b/pkgs/development/libraries/haskell/misfortune/default.nix
new file mode 100644
index 00000000000..5fe26fff744
--- /dev/null
+++ b/pkgs/development/libraries/haskell/misfortune/default.nix
@@ -0,0 +1,21 @@
+{ cabal, cereal, filepath, knob, monadLoops, randomFu, regexBase
+, regexPcre, semigroups, text, utf8String, vector
+}:
+
+cabal.mkDerivation (self: {
+  pname = "misfortune";
+  version = "0.1.1.1";
+  sha256 = "0knb31jxxn7zds13a90d4lir39386nwzd181mlzkrw5niw1zwmhb";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    cereal filepath knob monadLoops randomFu regexBase regexPcre
+    semigroups text utf8String vector
+  ];
+  meta = {
+    homepage = "https://github.com/mokus0/misfortune";
+    description = "fortune-mod clone";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/mmorph/default.nix b/pkgs/development/libraries/haskell/mmorph/default.nix
new file mode 100644
index 00000000000..c4379499fad
--- /dev/null
+++ b/pkgs/development/libraries/haskell/mmorph/default.nix
@@ -0,0 +1,13 @@
+{ cabal, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "mmorph";
+  version = "1.0.0";
+  sha256 = "10r8frcn6ar56n1vxy8rkys8j52f8xkqan8qxqanka1150k6khqk";
+  buildDepends = [ transformers ];
+  meta = {
+    description = "Monad morphisms";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/monad-control/default.nix b/pkgs/development/libraries/haskell/monad-control/default.nix
index bf27ac461c3..ac59d470145 100644
--- a/pkgs/development/libraries/haskell/monad-control/default.nix
+++ b/pkgs/development/libraries/haskell/monad-control/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "monad-control";
-  version = "0.3.1.4";
-  sha256 = "0mvcj6rljh2drkpf29zavwsqpzd9lw7s0n4inxm82i2017xdazy1";
+  version = "0.3.2.1";
+  sha256 = "17wfdg3a2kkx1jwh7gfgbyx4351b420krsf8syb8l9xrl9gdz5a3";
   buildDepends = [
     baseUnicodeSymbols transformers transformersBase
   ];
diff --git a/pkgs/development/libraries/haskell/monad-logger/default.nix b/pkgs/development/libraries/haskell/monad-logger/default.nix
index 66f10e16e66..c06809c261d 100644
--- a/pkgs/development/libraries/haskell/monad-logger/default.nix
+++ b/pkgs/development/libraries/haskell/monad-logger/default.nix
@@ -1,10 +1,15 @@
-{ cabal, fastLogger, resourcet, text, transformers }:
+{ cabal, conduit, fastLogger, monadControl, mtl, resourcet, text
+, transformers, transformersBase
+}:
 
 cabal.mkDerivation (self: {
   pname = "monad-logger";
-  version = "0.2.0";
-  sha256 = "0rsp24lx9gcvayj5d6afq26qrggm9qrjqjpdm7088xbl5k0c71fz";
-  buildDepends = [ fastLogger resourcet text transformers ];
+  version = "0.3.1.1";
+  sha256 = "11qqmflcydjfm5py7rkbi9qd0mkhw4kxzxff95wf0jmaia9knvx6";
+  buildDepends = [
+    conduit fastLogger monadControl mtl resourcet text transformers
+    transformersBase
+  ];
   meta = {
     homepage = "https://github.com/kazu-yamamoto/logger";
     description = "A class of monads which can log messages";
diff --git a/pkgs/development/libraries/haskell/monad-loops/default.nix b/pkgs/development/libraries/haskell/monad-loops/default.nix
index ef7d6c27173..a58d90fc98b 100644
--- a/pkgs/development/libraries/haskell/monad-loops/default.nix
+++ b/pkgs/development/libraries/haskell/monad-loops/default.nix
@@ -1,14 +1,13 @@
-{ cabal, stm }:
+{ cabal }:
 
 cabal.mkDerivation (self: {
   pname = "monad-loops";
-  version = "0.3.3.0";
-  sha256 = "06v8wnkbjrpsy47shjy2bd8asbw6d5rgzy8z5q0jwdhira42h3v1";
-  buildDepends = [ stm ];
+  version = "0.4.2";
+  sha256 = "08sz08p4z1p78dv7rmsqvin59h19i6i07sp7jg3zwxwjxa76fds8";
   meta = {
     homepage = "https://github.com/mokus0/monad-loops";
     description = "Monadic loops";
-    license = self.stdenv.lib.licenses.bsd3;
+    license = self.stdenv.lib.licenses.publicDomain;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
diff --git a/pkgs/development/libraries/haskell/monad-par/0.1.0.3.nix b/pkgs/development/libraries/haskell/monad-par/0.1.0.3.nix
index 1bfac2b13d2..8692d6267cb 100644
--- a/pkgs/development/libraries/haskell/monad-par/0.1.0.3.nix
+++ b/pkgs/development/libraries/haskell/monad-par/0.1.0.3.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.1.0.3";
   sha256 = "1c0yclil152hv06c2sbgam9amd63nnzh7a4xsnxb05wgy93qs2mg";
   buildDepends = [ deepseq HUnit ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/simonmar/monad-par";
     description = "A library for parallel programming based on a monad";
diff --git a/pkgs/development/libraries/haskell/monad-par/0.3.4.2.nix b/pkgs/development/libraries/haskell/monad-par/0.3.4.2.nix
new file mode 100644
index 00000000000..ab875b34c36
--- /dev/null
+++ b/pkgs/development/libraries/haskell/monad-par/0.3.4.2.nix
@@ -0,0 +1,28 @@
+{ cabal, abstractDeque, abstractPar, deepseq, HUnit, monadParExtras
+, mtl, mwcRandom, parallel, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, testFrameworkTh
+, time
+}:
+
+cabal.mkDerivation (self: {
+  pname = "monad-par";
+  version = "0.3.4.2";
+  sha256 = "1k10m4w2g92psahsvcyi98sc31wg5anijp46lbsipi2r2gxxc7bs";
+  buildDepends = [
+    abstractDeque abstractPar deepseq monadParExtras mtl mwcRandom
+    parallel
+  ];
+  testDepends = [
+    abstractDeque abstractPar deepseq HUnit monadParExtras mtl
+    mwcRandom QuickCheck testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 testFrameworkTh time
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/simonmar/monad-par";
+    description = "A library for parallel programming based on a monad";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/monad-par/0.3.nix b/pkgs/development/libraries/haskell/monad-par/0.3.nix
deleted file mode 100644
index d6f83dd3168..00000000000
--- a/pkgs/development/libraries/haskell/monad-par/0.3.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ cabal, abstractDeque, abstractPar, deepseq, monadParExtras, mtl
-, mwcRandom, parallel
-}:
-
-cabal.mkDerivation (self: {
-  pname = "monad-par";
-  version = "0.3";
-  sha256 = "19vzz8qhv8z84grcb4myivmmaj0sn7rm956nqxv5dh2l8c279zsd";
-  buildDepends = [
-    abstractDeque abstractPar deepseq monadParExtras mtl mwcRandom
-    parallel
-  ];
-  meta = {
-    homepage = "https://github.com/simonmar/monad-par";
-    description = "A library for parallel programming based on a monad";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/monad-peel/default.nix b/pkgs/development/libraries/haskell/monad-peel/default.nix
index 69ab9b0365b..39f911dae93 100644
--- a/pkgs/development/libraries/haskell/monad-peel/default.nix
+++ b/pkgs/development/libraries/haskell/monad-peel/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "monad-peel";
-  version = "0.1";
-  sha256 = "0q56hdjgbj7ykpjx5z8qlqqkngmgm5wzm9vwcd7v675k2ywcl3ys";
+  version = "0.1.1";
+  sha256 = "0n3cxa94wd3hjvy9jgf3d8p7qfb9jaaf29simjya7rlcb673pg3l";
   buildDepends = [ extensibleExceptions transformers ];
   meta = {
     homepage = "http://andersk.mit.edu/haskell/monad-peel/";
diff --git a/pkgs/development/libraries/haskell/monadcryptorandom/default.nix b/pkgs/development/libraries/haskell/monadcryptorandom/default.nix
index c1901f470fd..df63e3ec659 100644
--- a/pkgs/development/libraries/haskell/monadcryptorandom/default.nix
+++ b/pkgs/development/libraries/haskell/monadcryptorandom/default.nix
@@ -1,12 +1,12 @@
-{ cabal, cryptoApi, mtl, transformers }:
+{ cabal, cryptoApi, mtl, tagged, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "monadcryptorandom";
-  version = "0.4.1";
-  sha256 = "01x3zfr4m93bgx062rhxqk1d8qhn6s7rkfkm4yf00p89fclyjsg1";
-  buildDepends = [ cryptoApi mtl transformers ];
+  version = "0.5.1";
+  sha256 = "10waxc0i7hcqlgb9iwcdz0xqkym4ihavgwq466xlaqzzhcpp38d6";
+  buildDepends = [ cryptoApi mtl tagged transformers ];
   meta = {
-    homepage = "http://trac.haskell.org/crypto-api/wiki";
+    homepage = "https://github.com/TomMD/monadcryptorandom";
     description = "A monad for using CryptoRandomGen";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/monads-tf/default.nix b/pkgs/development/libraries/haskell/monads-tf/default.nix
index 53c0a2cad8e..f51fd8c840a 100644
--- a/pkgs/development/libraries/haskell/monads-tf/default.nix
+++ b/pkgs/development/libraries/haskell/monads-tf/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "monads-tf";
-  version = "0.1.0.0";
-  sha256 = "1d38rddm9h8crs96zhzj87a3ygix0ipyxy0qcyas88k60fgavg5i";
+  version = "0.1.0.1";
+  sha256 = "19za12iazwrbqwpxy6lkj01dwm921386ryxgdqvcqisn8cj6jm1v";
   buildDepends = [ transformers ];
   meta = {
     description = "Monad classes, using type families";
diff --git a/pkgs/development/libraries/haskell/mongoDB/default.nix b/pkgs/development/libraries/haskell/mongoDB/default.nix
index aec216ea59d..e730125544e 100644
--- a/pkgs/development/libraries/haskell/mongoDB/default.nix
+++ b/pkgs/development/libraries/haskell/mongoDB/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "mongoDB";
-  version = "1.3.0";
-  sha256 = "1l6r55bicjdybn8jn9rp94aamjqy5j5qs2775m05aba8svsl4kma";
+  version = "1.4.0";
+  sha256 = "1cj73k6lfpxmfaigqwwglnncfl1ikz6yjgs0d9f6k42kwysbddwz";
   buildDepends = [
     binary bson cryptohash liftedBase monadControl mtl network parsec
     random randomShuffle text transformersBase
diff --git a/pkgs/development/libraries/haskell/monoid-extras/default.nix b/pkgs/development/libraries/haskell/monoid-extras/default.nix
new file mode 100644
index 00000000000..a0ba1fd9856
--- /dev/null
+++ b/pkgs/development/libraries/haskell/monoid-extras/default.nix
@@ -0,0 +1,13 @@
+{ cabal, semigroups }:
+
+cabal.mkDerivation (self: {
+  pname = "monoid-extras";
+  version = "0.2.2.3";
+  sha256 = "00yj7wdyznsis82fb7i07s0vz8vsn2mpqk7jkgl9xxa57gk1rsax";
+  buildDepends = [ semigroups ];
+  meta = {
+    description = "Various extra monoid-related definitions and utilities";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/mpppc/default.nix b/pkgs/development/libraries/haskell/mpppc/default.nix
index fa19197871d..54357821171 100644
--- a/pkgs/development/libraries/haskell/mpppc/default.nix
+++ b/pkgs/development/libraries/haskell/mpppc/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "mpppc";
-  version = "0.1.2";
-  sha256 = "1zms71wx5a6rd60xy1pv6g1kxlx0hzh36pbr5a5lkfflc583z1k5";
+  version = "0.1.3";
+  sha256 = "1zcilskpslpqyrbwpabwbry4p3kpcfca94wchh9dkq9g8pg8laxi";
   buildDepends = [ ansiTerminal split text ];
+  jailbreak = true;
   meta = {
     description = "Multi-dimensional parametric pretty-printer with color";
     license = "GPL";
diff --git a/pkgs/development/libraries/haskell/mtl/2.1.nix b/pkgs/development/libraries/haskell/mtl/2.1.nix
deleted file mode 100644
index e231a3a1f3a..00000000000
--- a/pkgs/development/libraries/haskell/mtl/2.1.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, transformers }:
-
-cabal.mkDerivation (self: {
-  pname = "mtl";
-  version = "2.1";
-  sha256 = "041fhi6vgddj43y26ljhxqjryjbsj0rb6m6gfpvrjynzp6c7c5n6";
-  buildDepends = [ transformers ];
-  meta = {
-    description = "Monad classes, using functional dependencies";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/mueval/default.nix b/pkgs/development/libraries/haskell/mueval/default.nix
new file mode 100644
index 00000000000..f965caf2c1e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/mueval/default.nix
@@ -0,0 +1,21 @@
+{ cabal, Cabal, extensibleExceptions, filepath, hint, mtl, show
+, simpleReflect, utf8String
+}:
+
+cabal.mkDerivation (self: {
+  pname = "mueval";
+  version = "0.9";
+  sha256 = "1y6n3zvdlzxl5hi1raz7ac6fgy9321ilka3g2pk7p1ss9d10k8pb";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    Cabal extensibleExceptions filepath hint mtl show simpleReflect
+    utf8String
+  ];
+  meta = {
+    homepage = "http://code.haskell.org/mubot/";
+    description = "Safely evaluate pure Haskell expressions";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/multiarg/default.nix b/pkgs/development/libraries/haskell/multiarg/default.nix
index c376ab0cbd6..d636ea7b542 100644
--- a/pkgs/development/libraries/haskell/multiarg/default.nix
+++ b/pkgs/development/libraries/haskell/multiarg/default.nix
@@ -2,13 +2,13 @@
 
 cabal.mkDerivation (self: {
   pname = "multiarg";
-  version = "0.4.0.0";
-  sha256 = "04m4ynf6x8rlnlmnl6a7jj42fszjc1bly4h3jyjxxsqjdynrv81q";
+  version = "0.16.0.0";
+  sha256 = "086mnhbp1d3n0xdn4cdlyrkkgrykg4bwhi7sbfdmn688qhpl3g9m";
   buildDepends = [ explicitException utf8String ];
   meta = {
     homepage = "https://github.com/massysett/multiarg";
     description = "Combinators to build command line parsers";
-    license = self.stdenv.lib.licenses.mit;
+    license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
diff --git a/pkgs/development/libraries/haskell/multirec/default.nix b/pkgs/development/libraries/haskell/multirec/default.nix
index 4f73ffa98ae..a7d7459b455 100644
--- a/pkgs/development/libraries/haskell/multirec/default.nix
+++ b/pkgs/development/libraries/haskell/multirec/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "multirec";
-  version = "0.7.2";
-  sha256 = "1f715h27x8gz73d2irgl1gw74zd5lyda80nzk9xxwihqqkzvbhsm";
+  version = "0.7.3";
+  sha256 = "0k1wbjsvkl08nwjikflc8yyalk654mf8bvi1rhm28i4na52myi5y";
   noHaddock = true;
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/Multirec";
diff --git a/pkgs/development/libraries/haskell/multiset/default.nix b/pkgs/development/libraries/haskell/multiset/0.2.1.nix
index 9f85317505c..9f85317505c 100644
--- a/pkgs/development/libraries/haskell/multiset/default.nix
+++ b/pkgs/development/libraries/haskell/multiset/0.2.1.nix
diff --git a/pkgs/development/libraries/haskell/time/1.2.0.5.nix b/pkgs/development/libraries/haskell/multiset/0.2.2.nix
index 9d059245d7b..16fcf155747 100644
--- a/pkgs/development/libraries/haskell/time/1.2.0.5.nix
+++ b/pkgs/development/libraries/haskell/multiset/0.2.2.nix
@@ -1,12 +1,11 @@
 { cabal }:
 
 cabal.mkDerivation (self: {
-  pname = "time";
-  version = "1.2.0.5";
-  sha256 = "0y4plv9qvpmzzzb5855zngm6lmd38m0vr2mzwm94xhz2xsqhdh2z";
+  pname = "multiset";
+  version = "0.2.2";
+  sha256 = "1g14c1zm4rdc8nxvb69k98h542wi24q2lpba1gpqjqspk4d0sjmn";
   meta = {
-    homepage = "http://semantic.org/TimeLib/";
-    description = "A time library";
+    description = "The Data.MultiSet container type";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/murmur-hash/default.nix b/pkgs/development/libraries/haskell/murmur-hash/default.nix
index 8f1ee9fa6a3..0c4058eb111 100644
--- a/pkgs/development/libraries/haskell/murmur-hash/default.nix
+++ b/pkgs/development/libraries/haskell/murmur-hash/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "murmur-hash";
-  version = "0.1.0.5";
-  sha256 = "1m7rm57bxkrl4i9fbvmx5m29axyxddrs4ss7plbd19pw3wsvgmr0";
+  version = "0.1.0.6";
+  sha256 = "0wnkwl3a9x0f4rvsj4wf129n03vpw8qk4kzx6vmrapwwb4r80npz";
   meta = {
     homepage = "http://github.com/nominolo/murmur-hash";
     description = "MurmurHash2 implementation for Haskell";
diff --git a/pkgs/development/libraries/haskell/mwc-random/default.nix b/pkgs/development/libraries/haskell/mwc-random/default.nix
index 1e2d56147c3..3e9be2c5e58 100644
--- a/pkgs/development/libraries/haskell/mwc-random/default.nix
+++ b/pkgs/development/libraries/haskell/mwc-random/default.nix
@@ -1,10 +1,17 @@
-{ cabal, primitive, time, vector }:
+{ cabal, HUnit, primitive, QuickCheck, statistics, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, time, vector
+}:
 
 cabal.mkDerivation (self: {
   pname = "mwc-random";
   version = "0.12.0.1";
   sha256 = "1sq4yxi231ka8rzwsihqziibs7amvl27ycr018wymm3yz36vsy7c";
   buildDepends = [ primitive time vector ];
+  testDepends = [
+    HUnit QuickCheck statistics testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 vector
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/mwc-random";
     description = "Fast, high quality pseudo random number generation";
diff --git a/pkgs/development/libraries/haskell/nanospec/default.nix b/pkgs/development/libraries/haskell/nanospec/default.nix
new file mode 100644
index 00000000000..b7f498a35c8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/nanospec/default.nix
@@ -0,0 +1,14 @@
+{ cabal, hspec, silently }:
+
+cabal.mkDerivation (self: {
+  pname = "nanospec";
+  version = "0.1.0";
+  sha256 = "16qpn199p8nrllg800zryhb8795jgk78znng5fjq1raj8l3snjk0";
+  testDepends = [ hspec silently ];
+  doCheck = false;
+  meta = {
+    description = "A lightweight implementation of a subset of Hspec's API";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/nat/default.nix b/pkgs/development/libraries/haskell/nat/default.nix
new file mode 100644
index 00000000000..3ad4240e289
--- /dev/null
+++ b/pkgs/development/libraries/haskell/nat/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "nat";
+  version = "0.3";
+  sha256 = "1v43c1dr72qn8mymnwcq6an8sqxjaxhac037k4gbv8z8bg18zmf5";
+  meta = {
+    description = "Lazy binary natural numbers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/nats/default.nix b/pkgs/development/libraries/haskell/nats/default.nix
new file mode 100644
index 00000000000..02f5c289836
--- /dev/null
+++ b/pkgs/development/libraries/haskell/nats/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "nats";
+  version = "0.1";
+  sha256 = "08gh7jjmws70919hmqqmvnfqcpxr34f03jmg3lzmmhqvr15gm1vy";
+  meta = {
+    homepage = "http://github.com/ekmett/nats/";
+    description = "Haskell 98 natural numbers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/naturals/default.nix b/pkgs/development/libraries/haskell/naturals/default.nix
new file mode 100644
index 00000000000..787ac70ffa9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/naturals/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "naturals";
+  version = "0.2.0.2";
+  sha256 = "1ay291833dcah411zc3r4qjilaw8x13ljlnb5z40d1s7784djm16";
+  meta = {
+    homepage = "frigidcode.com";
+    description = "Constructors and related functions for natural numbers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/netlist-to-vhdl/default.nix b/pkgs/development/libraries/haskell/netlist-to-vhdl/default.nix
new file mode 100644
index 00000000000..ff9ed1ac0bf
--- /dev/null
+++ b/pkgs/development/libraries/haskell/netlist-to-vhdl/default.nix
@@ -0,0 +1,13 @@
+{ cabal, netlist }:
+
+cabal.mkDerivation (self: {
+  pname = "netlist-to-vhdl";
+  version = "0.3.1";
+  sha256 = "15daik7l0pjqilya01l5rl84g2fyjwkap1md0nx82gxcp8m1v76k";
+  buildDepends = [ netlist ];
+  meta = {
+    description = "Convert a Netlist AST to VHDL";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/netlist/default.nix b/pkgs/development/libraries/haskell/netlist/default.nix
new file mode 100644
index 00000000000..57550dcb3d8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/netlist/default.nix
@@ -0,0 +1,13 @@
+{ cabal, binary, syb }:
+
+cabal.mkDerivation (self: {
+  pname = "netlist";
+  version = "0.3.1";
+  sha256 = "0f3fwgpg0p3ajgxfzbqr4z04ly5cdbhjxms5xbd0k2ixdwgyxm67";
+  buildDepends = [ binary syb ];
+  meta = {
+    description = "Netlist AST";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/netwire/default.nix b/pkgs/development/libraries/haskell/netwire/default.nix
new file mode 100644
index 00000000000..d7ab9539e0c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/netwire/default.nix
@@ -0,0 +1,18 @@
+{ cabal, bifunctors, deepseq, liftedBase, monadControl, mtl
+, profunctors, random, semigroups, tagged, time, vectorSpace
+}:
+
+cabal.mkDerivation (self: {
+  pname = "netwire";
+  version = "4.0.7";
+  sha256 = "035jz7j19c7n4za9xi8vj6yl9m2b2v6d53mp711gf8609wv0cx0c";
+  buildDepends = [
+    bifunctors deepseq liftedBase monadControl mtl profunctors random
+    semigroups tagged time vectorSpace
+  ];
+  meta = {
+    description = "Flexible wire arrows for FRP";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-conduit-tls/default.nix b/pkgs/development/libraries/haskell/network-conduit-tls/default.nix
new file mode 100644
index 00000000000..483271fe959
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-conduit-tls/default.nix
@@ -0,0 +1,21 @@
+{ cabal, aeson, certificate, conduit, cryptoApi, cryptoRandomApi
+, network, networkConduit, pem, systemFileio, systemFilepath, tls
+, tlsExtra, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "network-conduit-tls";
+  version = "1.0.0.2";
+  sha256 = "1vzhalz6hxal73rxm6f2l9m7j34mldamz16wrb6ay67wg6giq55z";
+  buildDepends = [
+    aeson certificate conduit cryptoApi cryptoRandomApi network
+    networkConduit pem systemFileio systemFilepath tls tlsExtra
+    transformers
+  ];
+  meta = {
+    homepage = "https://github.com/snoyberg/conduit";
+    description = "Create TLS-aware network code with conduits";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-conduit/default.nix b/pkgs/development/libraries/haskell/network-conduit/default.nix
index f05d191ed17..032592f974b 100644
--- a/pkgs/development/libraries/haskell/network-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/network-conduit/default.nix
@@ -3,11 +3,12 @@
 
 cabal.mkDerivation (self: {
   pname = "network-conduit";
-  version = "0.5.0";
-  sha256 = "0q7smsrv3gp5kvzqfgw2mw9w70gjr5pkx2bmk58dvbnz6al85abn";
+  version = "1.0.0";
+  sha256 = "16kgg6wkpl10kcwfijm9iqi7r5gababaymxyhmjab6axfzknppk3";
   buildDepends = [
     conduit liftedBase monadControl network transformers
   ];
+  testDepends = [ conduit ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Stream socket data using conduits";
diff --git a/pkgs/development/libraries/haskell/network-info/default.nix b/pkgs/development/libraries/haskell/network-info/default.nix
new file mode 100644
index 00000000000..c1bfea43bde
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-info/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "network-info";
+  version = "0.2.0.3";
+  sha256 = "04nwl5akrsppxkqqq7a7qi5sixvrzvj4njl8rbz7sglbh9393rs2";
+  meta = {
+    homepage = "http://github.com/jystic/network-info";
+    description = "Access the local computer's basic network configuration";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-multicast/default.nix b/pkgs/development/libraries/haskell/network-multicast/default.nix
new file mode 100644
index 00000000000..3a461a51f53
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-multicast/default.nix
@@ -0,0 +1,14 @@
+{ cabal, network }:
+
+cabal.mkDerivation (self: {
+  pname = "network-multicast";
+  version = "0.0.7";
+  sha256 = "18qlg4cg7ci1z3mbqh5z16mxkjir0079a0rgm4qk6jbmsnvfsq43";
+  buildDepends = [ network ];
+  meta = {
+    description = "Simple multicast library";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-protocol-xmpp/default.nix b/pkgs/development/libraries/haskell/network-protocol-xmpp/default.nix
new file mode 100644
index 00000000000..910d2cc6774
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-protocol-xmpp/default.nix
@@ -0,0 +1,19 @@
+{ cabal, gnuidn, gnutls, gsasl, libxmlSax, monadsTf, network, text
+, transformers, xmlTypes
+}:
+
+cabal.mkDerivation (self: {
+  pname = "network-protocol-xmpp";
+  version = "0.4.5";
+  sha256 = "1phnd9nygpc8gmyriwaqjnvygxi5zg4nx2i1m3vwwxql221420gg";
+  buildDepends = [
+    gnuidn gnutls gsasl libxmlSax monadsTf network text transformers
+    xmlTypes
+  ];
+  meta = {
+    homepage = "https://john-millikin.com/software/haskell-xmpp/";
+    description = "Client library for the XMPP protocol";
+    license = self.stdenv.lib.licenses.gpl3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-transport-tcp/default.nix b/pkgs/development/libraries/haskell/network-transport-tcp/default.nix
new file mode 100644
index 00000000000..840712e3416
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-transport-tcp/default.nix
@@ -0,0 +1,25 @@
+{ cabal, dataAccessor, dataAccessorTransformers, HUnit
+, lockfreeQueue, mtl, network, networkTransport
+, networkTransportTests, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "network-transport-tcp";
+  version = "0.3.1";
+  sha256 = "15i4qbx1s3dxaixn6kd2z1hsymfvpqzf4jpqd3mcbpjlgrn6craf";
+  buildDepends = [ dataAccessor network networkTransport ];
+  testDepends = [
+    dataAccessor dataAccessorTransformers HUnit lockfreeQueue mtl
+    network networkTransport networkTransportTests QuickCheck
+    testFramework testFrameworkHunit testFrameworkQuickcheck2
+    transformers
+  ];
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "TCP instantiation of Network.Transport";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-transport-tests/default.nix b/pkgs/development/libraries/haskell/network-transport-tests/default.nix
new file mode 100644
index 00000000000..7aedea7995b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-transport-tests/default.nix
@@ -0,0 +1,14 @@
+{ cabal, ansiTerminal, mtl, networkTransport, random }:
+
+cabal.mkDerivation (self: {
+  pname = "network-transport-tests";
+  version = "0.1.0.1";
+  sha256 = "15vdkjq10mm378iyci1lpj6b77m7sil5mk3yhzf6vcbfj54pwca6";
+  buildDepends = [ ansiTerminal mtl networkTransport random ];
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "Unit tests for Network.Transport implementations";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network-transport/default.nix b/pkgs/development/libraries/haskell/network-transport/default.nix
new file mode 100644
index 00000000000..eaa41944a6b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network-transport/default.nix
@@ -0,0 +1,15 @@
+{ cabal, binary, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "network-transport";
+  version = "0.3.0.1";
+  sha256 = "1iijcd864znik83smk1bjidinm199wri5fdyrhnffj0n35knrvas";
+  buildDepends = [ binary transformers ];
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "Network abstraction layer";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/network/2.3.0.13.nix b/pkgs/development/libraries/haskell/network/2.3.0.13.nix
index 29452da7b2e..557dea081fd 100644
--- a/pkgs/development/libraries/haskell/network/2.3.0.13.nix
+++ b/pkgs/development/libraries/haskell/network/2.3.0.13.nix
@@ -1,10 +1,11 @@
-{ cabal, parsec }:
+{ cabal, HUnit, parsec, testFramework, testFrameworkHunit }:
 
 cabal.mkDerivation (self: {
   pname = "network";
   version = "2.3.0.13";
   sha256 = "0xw53czvcw8k49aqxmchc1rcd6pyxp4icwgp64625fnm3l4yjiq7";
   buildDepends = [ parsec ];
+  testDepends = [ HUnit testFramework testFrameworkHunit ];
   meta = {
     homepage = "http://github.com/haskell/network";
     description = "Low-level networking interface";
diff --git a/pkgs/development/libraries/haskell/network/2.3.1.0.nix b/pkgs/development/libraries/haskell/network/2.3.1.0.nix
index 28fa50d8342..dc0c1811e59 100644
--- a/pkgs/development/libraries/haskell/network/2.3.1.0.nix
+++ b/pkgs/development/libraries/haskell/network/2.3.1.0.nix
@@ -1,10 +1,11 @@
-{ cabal, parsec }:
+{ cabal, HUnit, parsec, testFramework, testFrameworkHunit }:
 
 cabal.mkDerivation (self: {
   pname = "network";
   version = "2.3.1.0";
   sha256 = "1fp25wkl5cc4kx0jv5w02b7pzgqadjg1yrknzzwsqxc5s3cpyz6l";
   buildDepends = [ parsec ];
+  testDepends = [ HUnit testFramework testFrameworkHunit ];
   meta = {
     homepage = "http://github.com/haskell/network";
     description = "Low-level networking interface";
diff --git a/pkgs/development/libraries/haskell/network/2.4.1.2.nix b/pkgs/development/libraries/haskell/network/2.4.1.2.nix
new file mode 100644
index 00000000000..6f245cf1840
--- /dev/null
+++ b/pkgs/development/libraries/haskell/network/2.4.1.2.nix
@@ -0,0 +1,20 @@
+{ cabal, HUnit, parsec, testFramework, testFrameworkHunit
+, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "network";
+  version = "2.4.1.2";
+  sha256 = "0f7ykdv7xbsr5m3h2ml0hw3nlbnq785m0gr624pwk2s289jwakdh";
+  buildDepends = [ parsec ];
+  testDepends = [
+    HUnit testFramework testFrameworkHunit testFrameworkQuickcheck2
+  ];
+  meta = {
+    homepage = "https://github.com/haskell/network";
+    description = "Low-level networking interface";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/newtype/default.nix b/pkgs/development/libraries/haskell/newtype/default.nix
new file mode 100644
index 00000000000..40354c9472c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/newtype/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "newtype";
+  version = "0.2";
+  sha256 = "0ng4i5r73256gzwl6bw57h0abqixj783c3ggph1hk2wsplx0655p";
+  meta = {
+    description = "A typeclass and set of functions for working with newtypes";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/numbers/default.nix b/pkgs/development/libraries/haskell/numbers/default.nix
index 8b57b3d7e96..81a3e866dc0 100644
--- a/pkgs/development/libraries/haskell/numbers/default.nix
+++ b/pkgs/development/libraries/haskell/numbers/default.nix
@@ -1,11 +1,14 @@
-{ cabal }:
+{ cabal, QuickCheck, testFramework, testFrameworkQuickcheck2 }:
 
 cabal.mkDerivation (self: {
   pname = "numbers";
-  version = "3000.0.0.0";
-  sha256 = "073xjrnbv6z16va2h3arlxq3z8kywb961dwh4jcm8g7w5m84b2xb";
+  version = "3000.1.0.3";
+  sha256 = "0w2m2m3vp3lpvnc7wkw6pqfz741a68dma4s0asl7cryykwf94xgz";
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2
+  ];
   meta = {
-    homepage = "https://github.com/DanBurton/numbers";
+    homepage = "https://github.com/DanBurton/numbers#readme";
     description = "Various number types";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/numeric-prelude/default.nix b/pkgs/development/libraries/haskell/numeric-prelude/default.nix
index 1cb6ab49bcd..f6f4d420e2a 100644
--- a/pkgs/development/libraries/haskell/numeric-prelude/default.nix
+++ b/pkgs/development/libraries/haskell/numeric-prelude/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "numeric-prelude";
-  version = "0.3.0.2";
-  sha256 = "0ihk8r06n2s72b4k67x8msn6gmn2cmxyswzk1j1r4jbhnk83b6wr";
+  version = "0.4.0.1";
+  sha256 = "1j361gj7cw31x31vnjhxmy7a62ldvyyqfm7irhff7sf5gv4kr5wh";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/numtype-tf/default.nix b/pkgs/development/libraries/haskell/numtype-tf/default.nix
new file mode 100644
index 00000000000..76f57daca38
--- /dev/null
+++ b/pkgs/development/libraries/haskell/numtype-tf/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "numtype-tf";
+  version = "0.1";
+  sha256 = "1hvnqgjg7yifxdsji9v0wqwbp4syhdc97pa3nrn4p96g7kmvw25v";
+  meta = {
+    homepage = "http://dimensional.googlecode.com/";
+    description = "Type-level (low cardinality) integers, implemented using type families";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/optparse-applicative/default.nix b/pkgs/development/libraries/haskell/optparse-applicative/default.nix
new file mode 100644
index 00000000000..a3ab241b28c
--- /dev/null
+++ b/pkgs/development/libraries/haskell/optparse-applicative/default.nix
@@ -0,0 +1,20 @@
+{ cabal, HUnit, testFramework, testFrameworkHunit
+, testFrameworkThPrime, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "optparse-applicative";
+  version = "0.5.2.1";
+  sha256 = "0w4mk851mx8dch8lnck0g82asmzrsc47xrf34jygh0f6v4kbj40i";
+  buildDepends = [ transformers ];
+  testDepends = [
+    HUnit testFramework testFrameworkHunit testFrameworkThPrime
+  ];
+  jailbreak = true;
+  meta = {
+    homepage = "https://github.com/pcapriotti/optparse-applicative";
+    description = "Utilities and combinators for parsing command line options";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/pandoc-types/default.nix b/pkgs/development/libraries/haskell/pandoc-types/default.nix
index 6dfbc1fc15f..d4f49791d30 100644
--- a/pkgs/development/libraries/haskell/pandoc-types/default.nix
+++ b/pkgs/development/libraries/haskell/pandoc-types/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pandoc-types";
-  version = "1.9.1";
-  sha256 = "1174nkaig0g71n3kqrhgqn7xmr9rni3l3dh1xpypc0ksjm0ym21i";
+  version = "1.10";
+  sha256 = "1xbqvgb95h0jhqx2y0jzds3xvycx5gwi3xn6agdmfkg7xhx9hnz6";
   buildDepends = [ syb ];
   meta = {
     homepage = "http://johnmacfarlane.net/pandoc";
diff --git a/pkgs/development/libraries/haskell/pandoc/default.nix b/pkgs/development/libraries/haskell/pandoc/default.nix
index 8f34d2d88a0..f81fb4e56d9 100644
--- a/pkgs/development/libraries/haskell/pandoc/default.nix
+++ b/pkgs/development/libraries/haskell/pandoc/default.nix
@@ -1,28 +1,38 @@
-{ cabal, base64Bytestring, blazeHtml, citeprocHs
-, extensibleExceptions, filepath, highlightingKate, HTTP, json, mtl
-, network, pandocTypes, parsec, random, syb, tagsoup, temporary
-, texmath, time, utf8String, xml, zipArchive, zlib
+{ cabal, ansiTerminal, base64Bytestring, blazeHtml, blazeMarkup
+, citeprocHs, dataDefault, Diff, extensibleExceptions, filepath
+, highlightingKate, HTTP, HUnit, json, mtl, network, pandocTypes
+, parsec, QuickCheck, random, syb, tagsoup, temporary
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+, texmath, text, time, xml, zipArchive, zlib
 }:
 
 cabal.mkDerivation (self: {
   pname = "pandoc";
-  version = "1.9.4.2";
-  sha256 = "1zr2qx6bimyhzia5maqpb454hgdwjvgs234mcki4f1z3dgbq0lsk";
+  version = "1.11.1";
+  sha256 = "0b23vrgkm1csykx1zrldkg5ka816j6m7a5fhs4cxffalifq91c7b";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    base64Bytestring blazeHtml citeprocHs extensibleExceptions filepath
-    highlightingKate HTTP json mtl network pandocTypes parsec random
-    syb tagsoup temporary texmath time utf8String xml zipArchive zlib
+    base64Bytestring blazeHtml blazeMarkup citeprocHs dataDefault
+    extensibleExceptions filepath highlightingKate HTTP json mtl
+    network pandocTypes parsec random syb tagsoup temporary texmath
+    text time xml zipArchive zlib
   ];
-  patchPhase = ''
-    sed -i -e 's|base64-bytestring.*,|base64-bytestring,|' pandoc.cabal
-  '';
+  testDepends = [
+    ansiTerminal Diff filepath highlightingKate HUnit pandocTypes
+    QuickCheck syb testFramework testFrameworkHunit
+    testFrameworkQuickcheck2 text
+  ];
+  configureFlags = "-fblaze_html_0_5";
+  doCheck = false;
   meta = {
     homepage = "http://johnmacfarlane.net/pandoc";
     description = "Conversion between markup formats";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/pango/default.nix b/pkgs/development/libraries/haskell/pango/default.nix
index ca764844c16..bbd935eb043 100644
--- a/pkgs/development/libraries/haskell/pango/default.nix
+++ b/pkgs/development/libraries/haskell/pango/default.nix
@@ -3,8 +3,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pango";
-  version = "0.12.3";
-  sha256 = "0203z59c9dsqp6mgb12h2iwjs52m2cqdxa7arwi1sccc3cz86cai";
+  version = "0.12.4";
+  sha256 = "08c7kmbnga6lijv7hpxgs766lsvaqpbqbph1gsxncqsl8haq4v5c";
   buildDepends = [ cairo glib mtl ];
   buildTools = [ gtk2hsBuildtools ];
   extraLibraries = [ libc pkgconfig ];
diff --git a/pkgs/development/libraries/haskell/parallel-io/default.nix b/pkgs/development/libraries/haskell/parallel-io/default.nix
new file mode 100644
index 00000000000..56c1a130696
--- /dev/null
+++ b/pkgs/development/libraries/haskell/parallel-io/default.nix
@@ -0,0 +1,16 @@
+{ cabal, extensibleExceptions, random }:
+
+cabal.mkDerivation (self: {
+  pname = "parallel-io";
+  version = "0.3.3";
+  sha256 = "0i86x3bf8pjlg6mdg1zg5lcrjpg75pbqs2mrgrbp4z4bkcmw051s";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ extensibleExceptions random ];
+  meta = {
+    homepage = "http://batterseapower.github.com/parallel-io";
+    description = "Combinators for executing IO actions in parallel on a thread pool";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/parseargs/default.nix b/pkgs/development/libraries/haskell/parseargs/default.nix
index d51533a0653..2a481246e88 100644
--- a/pkgs/development/libraries/haskell/parseargs/default.nix
+++ b/pkgs/development/libraries/haskell/parseargs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "parseargs";
-  version = "0.1.3.2";
-  sha256 = "1ncdbjzfkhb1f3aznsci26kss9nrv3iilc65q5xdl9nly8p837mv";
+  version = "0.1.3.5";
+  sha256 = "1ig1n2nnicmy71qwcl5hkdk4mvwq0mz6zr5h9kw329lgvr9cyzyc";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/libraries/haskell/path-pieces/default.nix b/pkgs/development/libraries/haskell/path-pieces/default.nix
index d4f52aef58e..14b9f8d7081 100644
--- a/pkgs/development/libraries/haskell/path-pieces/default.nix
+++ b/pkgs/development/libraries/haskell/path-pieces/default.nix
@@ -1,12 +1,12 @@
-{ cabal, text, time }:
+{ cabal, fileLocation, hspec, HUnit, QuickCheck, text, time }:
 
 cabal.mkDerivation (self: {
   pname = "path-pieces";
-  version = "0.1.1";
-  sha256 = "17ymk2azgz2c1hwnzqd9xy77hh51mvrgz4zs7lz4ik6rnvvihraz";
+  version = "0.1.2";
+  sha256 = "1cxsa8lq1f2jf86iv6f17nraiav8k2vzjxln1y7z45qhcp1sbbaa";
   buildDepends = [ text time ];
+  testDepends = [ fileLocation hspec HUnit QuickCheck text ];
   meta = {
-    homepage = "http://github.com/snoyberg/path-pieces";
     description = "Components of paths";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/pathtype/default.nix b/pkgs/development/libraries/haskell/pathtype/default.nix
index f08ded72968..f0be81e64ae 100644
--- a/pkgs/development/libraries/haskell/pathtype/default.nix
+++ b/pkgs/development/libraries/haskell/pathtype/default.nix
@@ -1,10 +1,10 @@
-{ cabal, QuickCheck }:
+{ cabal, QuickCheck, time }:
 
 cabal.mkDerivation (self: {
   pname = "pathtype";
-  version = "0.5.2";
-  sha256 = "0rbmq6kzz2l07q9a5k888scpn62hnw2hmzz4ysprhfgdnn5b2cvi";
-  buildDepends = [ QuickCheck ];
+  version = "0.5.3";
+  sha256 = "11plb7xw4j8vjziw1q0ymx33p6185cxd2hqrxw2hgsfzf2b9dvqg";
+  buildDepends = [ QuickCheck time ];
   meta = {
     homepage = "http://code.haskell.org/pathtype";
     description = "Type-safe replacement for System.FilePath etc";
diff --git a/pkgs/development/libraries/haskell/pem/default.nix b/pkgs/development/libraries/haskell/pem/default.nix
index ff9b91fe0da..16b47a9c8ae 100644
--- a/pkgs/development/libraries/haskell/pem/default.nix
+++ b/pkgs/development/libraries/haskell/pem/default.nix
@@ -1,10 +1,15 @@
-{ cabal, attoparsec, base64Bytestring, cereal, mtl }:
+{ cabal, attoparsec, base64Bytestring, cereal, mtl, QuickCheck
+, testFramework, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "pem";
-  version = "0.1.1";
-  sha256 = "0klb39w6mihx35xgdw5wvi1q6r61xgrsqvcqi4c5r6psv5z94cil";
+  version = "0.1.2";
+  sha256 = "1p2sw36b9w6lf53jzj86ibyy9a48fjd786mx3x8mvc5lczx8v78m";
   buildDepends = [ attoparsec base64Bytestring cereal mtl ];
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-pem";
     description = "Privacy Enhanced Mail (PEM) format reader and writer";
diff --git a/pkgs/development/libraries/haskell/permutation/default.nix b/pkgs/development/libraries/haskell/permutation/default.nix
index 5903cb27f71..4f38dfcaa12 100644
--- a/pkgs/development/libraries/haskell/permutation/default.nix
+++ b/pkgs/development/libraries/haskell/permutation/default.nix
@@ -4,6 +4,7 @@ cabal.mkDerivation (self: {
   pname = "permutation";
   version = "0.4.1";
   sha256 = "0fgw4ivs8sa18fyphwr3mzp2v7ha2nz2yf3a7jmz9ymqdf2xws97";
+  doCheck = false;
   meta = {
     homepage = "http://stat.stanford.edu/~patperry/code/permutation";
     description = "A library for permutations and combinations";
diff --git a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
index 9b545ad1524..c7d6b532db6 100644
--- a/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-postgresql/default.nix
@@ -1,13 +1,13 @@
-{ cabal, aeson, conduit, monadControl, persistent, postgresqlLibpq
-, postgresqlSimple, text, time, transformers
+{ cabal, aeson, blazeBuilder, conduit, monadControl, persistent
+, postgresqlLibpq, postgresqlSimple, text, time, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "persistent-postgresql";
-  version = "1.0.0";
-  sha256 = "149vv6wd0a85gphwrqcyd66ivdzyy7yc37c99ngq7377fdnszzhn";
+  version = "1.2.0";
+  sha256 = "0i5ha1vs91makwrw4qqwdzp92i24ynmmsmjyqpik6q80fxxiwps6";
   buildDepends = [
-    aeson conduit monadControl persistent postgresqlLibpq
+    aeson blazeBuilder conduit monadControl persistent postgresqlLibpq
     postgresqlSimple text time transformers
   ];
   meta = {
diff --git a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
index 5b3ecd5ebc4..bb7a6731a26 100644
--- a/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-sqlite/default.nix
@@ -1,13 +1,13 @@
-{ cabal, aeson, conduit, monadControl, persistent, text
-, transformers
+{ cabal, aeson, conduit, monadControl, monadLogger, persistent
+, text, transformers
 }:
 
 cabal.mkDerivation (self: {
   pname = "persistent-sqlite";
-  version = "1.0.0";
-  sha256 = "0ak9x6w9566mjc0ggsqxr69x4w5w7igdxkq6wwm6ysy5cvs8fwc8";
+  version = "1.2.0";
+  sha256 = "09xd9z16rcq9ymx5ysshzdr30lih55b9kasvbq5xw6wq7lvg6q4h";
   buildDepends = [
-    aeson conduit monadControl persistent text transformers
+    aeson conduit monadControl monadLogger persistent text transformers
   ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
diff --git a/pkgs/development/libraries/haskell/persistent-template/default.nix b/pkgs/development/libraries/haskell/persistent-template/default.nix
index 13c40c6781f..f3ab1800dae 100644
--- a/pkgs/development/libraries/haskell/persistent-template/default.nix
+++ b/pkgs/development/libraries/haskell/persistent-template/default.nix
@@ -1,10 +1,15 @@
-{ cabal, aeson, monadControl, persistent, text, transformers }:
+{ cabal, aeson, hspec, monadControl, monadLogger, persistent
+, QuickCheck, text, transformers
+}:
 
 cabal.mkDerivation (self: {
   pname = "persistent-template";
-  version = "1.0.0";
-  sha256 = "14hg2f0v14m34qvj9m75nn3h4c33bh3gg1xixn0q318hwj9vpfcn";
-  buildDepends = [ aeson monadControl persistent text transformers ];
+  version = "1.2.0.1";
+  sha256 = "1l8ws4mijl0cwcl14ms8hibfgcn3y6b1679xc0cdyz1ifiymkdns";
+  buildDepends = [
+    aeson monadControl monadLogger persistent text transformers
+  ];
+  testDepends = [ aeson hspec persistent QuickCheck text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
     description = "Type-safe, non-relational, multi-backend persistence";
diff --git a/pkgs/development/libraries/haskell/persistent/default.nix b/pkgs/development/libraries/haskell/persistent/default.nix
index 6820e92f7eb..79fd1f6f781 100644
--- a/pkgs/development/libraries/haskell/persistent/default.nix
+++ b/pkgs/development/libraries/haskell/persistent/default.nix
@@ -1,19 +1,25 @@
 { cabal, aeson, attoparsec, base64Bytestring, blazeHtml
-, blazeMarkup, conduit, liftedBase, monadControl, monadLogger
-, pathPieces, poolConduit, resourcet, sqlite, text, time
-, transformers, transformersBase, unorderedContainers, vector
+, blazeMarkup, conduit, hspec, liftedBase, monadControl
+, monadLogger, pathPieces, poolConduit, resourcet, silently, sqlite
+, text, time, transformers, transformersBase, unorderedContainers
+, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "persistent";
-  version = "1.0.0";
-  sha256 = "1rrvq3girsjxfvdvvr9zxgc3252hrwcy84zj2mj0a5w057jahhhg";
+  version = "1.2.0.1";
+  sha256 = "1bs74g1fkwq4wvz18lp0ial6z58vpslgv0rqdn91ka6gw8k4fvlb";
   buildDepends = [
     aeson attoparsec base64Bytestring blazeHtml blazeMarkup conduit
     liftedBase monadControl monadLogger pathPieces poolConduit
-    resourcet text time transformers transformersBase
+    resourcet silently text time transformers transformersBase
     unorderedContainers vector
   ];
+  testDepends = [
+    aeson attoparsec base64Bytestring blazeHtml conduit hspec
+    monadControl monadLogger pathPieces resourcet text time
+    transformers unorderedContainers vector
+  ];
   extraLibraries = [ sqlite ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
diff --git a/pkgs/development/libraries/haskell/pipes-concurrency/default.nix b/pkgs/development/libraries/haskell/pipes-concurrency/default.nix
new file mode 100644
index 00000000000..702853766a7
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pipes-concurrency/default.nix
@@ -0,0 +1,13 @@
+{ cabal, pipes, stm, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "pipes-concurrency";
+  version = "1.1.0";
+  sha256 = "05xpwxhf08yf88ya89f8gcy4vphi6qxyccf2yiyi5zrf6c2pkr00";
+  buildDepends = [ pipes stm transformers ];
+  meta = {
+    description = "Concurrency for the pipes ecosystem";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/pipes-parse/default.nix b/pkgs/development/libraries/haskell/pipes-parse/default.nix
new file mode 100644
index 00000000000..2a5e62926b9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pipes-parse/default.nix
@@ -0,0 +1,13 @@
+{ cabal, pipes }:
+
+cabal.mkDerivation (self: {
+  pname = "pipes-parse";
+  version = "1.0.0";
+  sha256 = "0fk39a6d0ik5ghwyj6yyi9d0cj2sp22812fin7amcxcafrplf88w";
+  buildDepends = [ pipes ];
+  meta = {
+    description = "Parsing infrastructure for the pipes ecosystem";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/pipes-safe/default.nix b/pkgs/development/libraries/haskell/pipes-safe/default.nix
new file mode 100644
index 00000000000..09c58f0a017
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pipes-safe/default.nix
@@ -0,0 +1,13 @@
+{ cabal, pipes, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "pipes-safe";
+  version = "1.2.0";
+  sha256 = "0ki9i9378j8kgw5dd91b38r686pcr9fl2vf9dfgfshia072ppggj";
+  buildDepends = [ pipes transformers ];
+  meta = {
+    description = "Safety for the pipes ecosystem";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/pipes/default.nix b/pkgs/development/libraries/haskell/pipes/default.nix
new file mode 100644
index 00000000000..87c173850f9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pipes/default.nix
@@ -0,0 +1,13 @@
+{ cabal, mmorph, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "pipes";
+  version = "3.3.0";
+  sha256 = "1bgznfv7hxqwj5f7vkm8d41phw63bl2swzr0wrz0pcqxlr42likb";
+  buildDepends = [ mmorph transformers ];
+  meta = {
+    description = "Compositional pipelines";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/polyparse/1.7.nix b/pkgs/development/libraries/haskell/polyparse/1.7.nix
deleted file mode 100644
index 23a0af761c1..00000000000
--- a/pkgs/development/libraries/haskell/polyparse/1.7.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ cabal, text }:
-
-cabal.mkDerivation (self: {
-  pname = "polyparse";
-  version = "1.7";
-  sha256 = "de8ed0ce54f1f81bb0783dd97b7b22eca28df4a238684a26b37c5af2d17a364b";
-  buildDepends = [ text ];
-  meta = {
-    homepage = "http://code.haskell.org/~malcolm/polyparse/";
-    description = "A variety of alternative parser combinator libraries";
-    license = "LGPL";
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/polyparse/1.8.nix b/pkgs/development/libraries/haskell/polyparse/default.nix
index 24425c6b5e6..45b994026c2 100644
--- a/pkgs/development/libraries/haskell/polyparse/1.8.nix
+++ b/pkgs/development/libraries/haskell/polyparse/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "polyparse";
-  version = "1.8";
-  sha256 = "08nr22r87q2yxxlcpvf35pkq56b4k3f1fzj3cvjnr7137k7c7ywn";
+  version = "1.9";
+  sha256 = "12khjhv1dvs4j1jyh3law7m1gmkad8s6q7clh7w6l5ll2n1dc4lz";
   buildDepends = [ text ];
   meta = {
     homepage = "http://code.haskell.org/~malcolm/polyparse/";
diff --git a/pkgs/development/libraries/haskell/pool-conduit/default.nix b/pkgs/development/libraries/haskell/pool-conduit/default.nix
index 73966514e49..77faceeea92 100644
--- a/pkgs/development/libraries/haskell/pool-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/pool-conduit/default.nix
@@ -1,10 +1,12 @@
-{ cabal, resourcePool, resourcet, transformers }:
+{ cabal, monadControl, resourcePool, resourcet, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "pool-conduit";
-  version = "0.1.0.2";
-  sha256 = "1fs2kskvsvck9n011f2pv0s3mxd2hh71p61dxrskz79mfvks5yky";
-  buildDepends = [ resourcePool resourcet transformers ];
+  version = "0.1.2";
+  sha256 = "10lvq18pk9d4la5irr1qv1c9y4qbwlglmzgs7bz1d0g5232w3rv8";
+  buildDepends = [
+    monadControl resourcePool resourcet transformers
+  ];
   meta = {
     homepage = "http://www.yesodweb.com/book/persistent";
     description = "Resource pool allocations via ResourceT";
diff --git a/pkgs/development/libraries/haskell/pop3-client/default.nix b/pkgs/development/libraries/haskell/pop3-client/default.nix
new file mode 100644
index 00000000000..6656814f64f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pop3-client/default.nix
@@ -0,0 +1,14 @@
+{ cabal, mtl, network }:
+
+cabal.mkDerivation (self: {
+  pname = "pop3-client";
+  version = "0.1.4";
+  sha256 = "0kfcfxfwg5rjm7qx9r0ssdvkrvca95hflahrip1hi5wbplf224xv";
+  buildDepends = [ mtl network ];
+  meta = {
+    homepage = "https://github.com/tmrudick/haskell-pop3-client/";
+    description = "POP3 Client Library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/postgresql-libpq/default.nix b/pkgs/development/libraries/haskell/postgresql-libpq/default.nix
index 040c931d1f6..90a92019f0e 100644
--- a/pkgs/development/libraries/haskell/postgresql-libpq/default.nix
+++ b/pkgs/development/libraries/haskell/postgresql-libpq/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "postgresql-libpq";
-  version = "0.8.2.1";
-  sha256 = "0fjy451gc9lg3kcglq4s5s3hja8ni3adh4jmxd01kfyvyhwggv4d";
+  version = "0.8.2.2";
+  sha256 = "1mmsfgia318p34l8jx8hihb160sx2wpg2h5r741akcs50v6p5878";
   extraLibraries = [ postgresql ];
   meta = {
     homepage = "http://github.com/lpsmith/postgresql-libpq";
diff --git a/pkgs/development/libraries/haskell/postgresql-simple/default.nix b/pkgs/development/libraries/haskell/postgresql-simple/default.nix
index 28b5c0dec85..0a40cdf7a96 100644
--- a/pkgs/development/libraries/haskell/postgresql-simple/default.nix
+++ b/pkgs/development/libraries/haskell/postgresql-simple/default.nix
@@ -1,15 +1,20 @@
-{ cabal, attoparsec, blazeBuilder, blazeTextual, postgresqlLibpq
-, text, time, transformers, vector
+{ cabal, attoparsec, base16Bytestring, blazeBuilder, blazeTextual
+, cryptohash, HUnit, postgresqlLibpq, text, time, transformers
+, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "postgresql-simple";
-  version = "0.2.4.0";
-  sha256 = "1n1s650j4z82cz34rq9qgj805yc9x852snnqjaa1iwrg9i3r150f";
+  version = "0.3.3.0";
+  sha256 = "0srkalfg41gdnzwwa2bmwwrcdqnw13f7b94wv4d5a6sg6yf1ry1l";
   buildDepends = [
     attoparsec blazeBuilder blazeTextual postgresqlLibpq text time
     transformers vector
   ];
+  testDepends = [
+    base16Bytestring cryptohash HUnit text time vector
+  ];
+  doCheck = false;
   meta = {
     description = "Mid-Level PostgreSQL client library";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/pretty-show/default.nix b/pkgs/development/libraries/haskell/pretty-show/1.2.nix
index 577848ab459..545816a57a0 100644
--- a/pkgs/development/libraries/haskell/pretty-show/default.nix
+++ b/pkgs/development/libraries/haskell/pretty-show/1.2.nix
@@ -12,6 +12,5 @@ cabal.mkDerivation (self: {
     description = "Tools for working with derived Show instances";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/pretty-show/1.5.nix b/pkgs/development/libraries/haskell/pretty-show/1.5.nix
new file mode 100644
index 00000000000..5fedd0aca29
--- /dev/null
+++ b/pkgs/development/libraries/haskell/pretty-show/1.5.nix
@@ -0,0 +1,17 @@
+{ cabal, filepath, haskellLexer }:
+
+cabal.mkDerivation (self: {
+  pname = "pretty-show";
+  version = "1.5";
+  sha256 = "1n04f9aypgbhkq0lbji9czv1mjfwv4f80w1c6hqs55gmzwif63m4";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ filepath haskellLexer ];
+  meta = {
+    homepage = "http://wiki.github.com/yav/pretty-show";
+    description = "Tools for working with derived `Show` instances and generic inspection of values";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/primitive/default.nix b/pkgs/development/libraries/haskell/primitive/0.5.0.1.nix
index 9daef669c57..af6778ccd14 100644
--- a/pkgs/development/libraries/haskell/primitive/default.nix
+++ b/pkgs/development/libraries/haskell/primitive/0.5.0.1.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "primitive";
-  version = "0.4.1";
-  sha256 = "06999i59xhvjwfdbnr1n09zkvg7lnim64nqxqlvk0x6slkidb7f6";
+  version = "0.5.0.1";
+  sha256 = "04s33xqxz68ddppig5pjf7ki1y5y62xzzzmg3b5pkcxp0r6rsv2j";
   meta = {
     homepage = "http://code.haskell.org/primitive";
-    description = "Wrappers for primitive operations";
+    description = "Primitive memory-related operations";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/process-extras/default.nix b/pkgs/development/libraries/haskell/process-extras/default.nix
index ac2950d4927..1d9cb4f8062 100644
--- a/pkgs/development/libraries/haskell/process-extras/default.nix
+++ b/pkgs/development/libraries/haskell/process-extras/default.nix
@@ -1,10 +1,10 @@
-{ cabal, text }:
+{ cabal, deepseq, text }:
 
 cabal.mkDerivation (self: {
   pname = "process-extras";
-  version = "0.1.3";
-  sha256 = "16hm1w34qnrpb6x8gaqv1bs1cd4p98kayf23275s6vd48kw9v0b0";
-  buildDepends = [ text ];
+  version = "0.2.0";
+  sha256 = "0mr4f2v19qz6d6jhffz9gky0ykdqwl8c11adbdm04wm2a3xsvf7g";
+  buildDepends = [ deepseq text ];
   meta = {
     homepage = "https://github.com/davidlazar/process-extras";
     description = "Process extras";
diff --git a/pkgs/development/libraries/haskell/profunctor-extras/default.nix b/pkgs/development/libraries/haskell/profunctor-extras/default.nix
new file mode 100644
index 00000000000..df16898ddd3
--- /dev/null
+++ b/pkgs/development/libraries/haskell/profunctor-extras/default.nix
@@ -0,0 +1,19 @@
+{ cabal, comonad, profunctors, semigroupoidExtras, semigroupoids
+, tagged, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "profunctor-extras";
+  version = "3.3";
+  sha256 = "0sdiwc1d2jx2xrzsxjsxjh8m24f4blr2m8vmh78knpi9hy0bxgvr";
+  buildDepends = [
+    comonad profunctors semigroupoidExtras semigroupoids tagged
+    transformers
+  ];
+  meta = {
+    homepage = "http://github.com/ekmett/profunctor-extras/";
+    description = "Profunctor extras";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/profunctors/default.nix b/pkgs/development/libraries/haskell/profunctors/default.nix
new file mode 100644
index 00000000000..83398295108
--- /dev/null
+++ b/pkgs/development/libraries/haskell/profunctors/default.nix
@@ -0,0 +1,14 @@
+{ cabal, comonad, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "profunctors";
+  version = "3.3.0.1";
+  sha256 = "16d7xg929r4smmmcgi54bz7rsjxs6psksrdvzl4336sjpp3dw5h2";
+  buildDepends = [ comonad tagged ];
+  meta = {
+    homepage = "http://github.com/ekmett/profunctors/";
+    description = "Haskell 98 Profunctors";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/project-template/default.nix b/pkgs/development/libraries/haskell/project-template/default.nix
new file mode 100644
index 00000000000..fa60370f1f5
--- /dev/null
+++ b/pkgs/development/libraries/haskell/project-template/default.nix
@@ -0,0 +1,24 @@
+{ cabal, base64Bytestring, base64Conduit, classyPrelude, conduit
+, hspec, mtl, QuickCheck, resourcet, systemFileio, systemFilepath
+, text, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "project-template";
+  version = "0.1.3";
+  sha256 = "1nsc4i3s9a7d0nysswhylvnr79z0ax9biiwr7b6jn7jzx0f2bdmm";
+  buildDepends = [
+    base64Bytestring base64Conduit classyPrelude conduit mtl resourcet
+    systemFileio systemFilepath text transformers
+  ];
+  testDepends = [
+    base64Bytestring classyPrelude conduit hspec QuickCheck
+    transformers
+  ];
+  meta = {
+    homepage = "https://github.com/fpco/haskell-ide";
+    description = "Specify Haskell project templates and generate files";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/publicsuffixlist/default.nix b/pkgs/development/libraries/haskell/publicsuffixlist/default.nix
new file mode 100644
index 00000000000..ea1bb7164c8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/publicsuffixlist/default.nix
@@ -0,0 +1,15 @@
+{ cabal, cereal, dataDefault, HUnit, idna, text, utf8String }:
+
+cabal.mkDerivation (self: {
+  pname = "publicsuffixlist";
+  version = "0.1";
+  sha256 = "0mbrmhgyjp8jms3fd3nq4knc4j97sw8ijrmnlfjs7qj8jw4vwzxk";
+  buildDepends = [ cereal dataDefault text utf8String ];
+  testDepends = [ cereal dataDefault HUnit idna text utf8String ];
+  meta = {
+    homepage = "https://github.com/litherum/publicsuffixlist";
+    description = "Is a given string a domain suffix?";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/punycode/default.nix b/pkgs/development/libraries/haskell/punycode/default.nix
new file mode 100644
index 00000000000..a4ad760d8ff
--- /dev/null
+++ b/pkgs/development/libraries/haskell/punycode/default.nix
@@ -0,0 +1,16 @@
+{ cabal, cereal, encoding, HUnit, mtl, QuickCheck, text }:
+
+cabal.mkDerivation (self: {
+  pname = "punycode";
+  version = "2.0";
+  sha256 = "192jgfixnpxdj6jiiz92kx5bi6ij3c389b76q9f4vyfmvcajj1sr";
+  buildDepends = [ cereal mtl text ];
+  testDepends = [ cereal encoding HUnit mtl QuickCheck text ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/litherum/punycode";
+    description = "Encode unicode strings to ascii forms according to RFC 3492";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/pureMD5/default.nix b/pkgs/development/libraries/haskell/pureMD5/default.nix
index 9501c7ffff1..8e66b2c3c03 100644
--- a/pkgs/development/libraries/haskell/pureMD5/default.nix
+++ b/pkgs/development/libraries/haskell/pureMD5/default.nix
@@ -2,10 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pureMD5";
-  version = "2.1.0.3";
-  sha256 = "0whlsb6zq4zcp3wq0bd6pgcsl0namr8b2s6i4l5aykq8v7fx40ii";
-  isLibrary = true;
-  isExecutable = true;
+  version = "2.1.2.1";
+  sha256 = "1zsn949qk95bwx1fbyv84q0lhb4k18bgixl7nivfzsnmhr31fs37";
   buildDepends = [ binary cereal cryptoApi tagged ];
   meta = {
     description = "A Haskell-only implementation of the MD5 digest (hash) algorithm";
diff --git a/pkgs/development/libraries/haskell/pwstore-fast/default.nix b/pkgs/development/libraries/haskell/pwstore-fast/default.nix
index add66a0bed2..d75823d6025 100644
--- a/pkgs/development/libraries/haskell/pwstore-fast/default.nix
+++ b/pkgs/development/libraries/haskell/pwstore-fast/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "pwstore-fast";
-  version = "2.2";
-  sha256 = "03b9vr5j6cadvi6w3lr8b9km4jq6jh0vzcmkxzq9qvvly89lx96a";
+  version = "2.3";
+  sha256 = "014l4n00lpg5037fkdwnxnv7xjfc3vlz1dphr7hfbqnjwf1z9ibw";
   buildDepends = [ base64Bytestring cryptohash random ];
   meta = {
     homepage = "https://github.com/PeterScott/pwstore";
diff --git a/pkgs/development/libraries/haskell/quickcheck-io/default.nix b/pkgs/development/libraries/haskell/quickcheck-io/default.nix
new file mode 100644
index 00000000000..b7c33b6d1a0
--- /dev/null
+++ b/pkgs/development/libraries/haskell/quickcheck-io/default.nix
@@ -0,0 +1,13 @@
+{ cabal, HUnit, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "quickcheck-io";
+  version = "0.1.0";
+  sha256 = "167ds7c7p1lcfsylxhq2sr0jxbviyim1n42dhyr0s0b6hazw8cjs";
+  buildDepends = [ HUnit QuickCheck ];
+  meta = {
+    description = "Use HUnit assertions as QuickCheck properties";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/random-fu/default.nix b/pkgs/development/libraries/haskell/random-fu/default.nix
index 72936308464..8dd228ad3db 100644
--- a/pkgs/development/libraries/haskell/random-fu/default.nix
+++ b/pkgs/development/libraries/haskell/random-fu/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "random-fu";
-  version = "0.2.3.0";
-  sha256 = "17vn1dz4z00xjpsxjx2dfjnz4qhbn5cbkm2s142kdskiphgxi2f8";
+  version = "0.2.4.0";
+  sha256 = "1wiwh52qfs699mcj3ylwc97pyabczn6dr8j92qczs89g8vvi91wd";
   buildDepends = [
     erf gamma monadLoops mtl randomShuffle randomSource rvar syb
     transformers vector
diff --git a/pkgs/development/libraries/haskell/random-source/default.nix b/pkgs/development/libraries/haskell/random-source/default.nix
index e4dab92dcb7..acc0285a59a 100644
--- a/pkgs/development/libraries/haskell/random-source/default.nix
+++ b/pkgs/development/libraries/haskell/random-source/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "random-source";
-  version = "0.3.0.2";
-  sha256 = "0sp39bj7rqg4w4rc4d4zgj0f77c23z4xc47p55chy12znc4frlp2";
+  version = "0.3.0.4";
+  sha256 = "1gvx9r6vy36lx7fy537zdbnbhpmfxz88a7gh0aiyd2vi7bvnndxy";
   buildDepends = [
     flexibleDefaults mersenneRandomPure64 mtl mwcRandom random stateref
     syb thExtras
diff --git a/pkgs/development/libraries/haskell/rank1dynamic/default.nix b/pkgs/development/libraries/haskell/rank1dynamic/default.nix
new file mode 100644
index 00000000000..8694d2399b2
--- /dev/null
+++ b/pkgs/development/libraries/haskell/rank1dynamic/default.nix
@@ -0,0 +1,15 @@
+{ cabal, binary }:
+
+cabal.mkDerivation (self: {
+  pname = "rank1dynamic";
+  version = "0.1.0.2";
+  sha256 = "1341hhbdm6y0mj0qjda0ckqsla51fxiy1yfpbwfvsmpi2bkzgxn6";
+  buildDepends = [ binary ];
+  meta = {
+    homepage = "http://github.com/haskell-distributed/distributed-process";
+    description = "Like Data.Dynamic/Data.Typeable but with support for rank-1 polymorphic types";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/reactive-banana-wx/default.nix b/pkgs/development/libraries/haskell/reactive-banana-wx/default.nix
index 702e3383d34..ee408fea480 100644
--- a/pkgs/development/libraries/haskell/reactive-banana-wx/default.nix
+++ b/pkgs/development/libraries/haskell/reactive-banana-wx/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "reactive-banana-wx";
-  version = "0.6.0.1";
-  sha256 = "1i674jy8fwirq267vwwdyqa4whxfx3r689rxjbrh9hyicqwcrl24";
+  version = "0.7.1.0";
+  sha256 = "06hkb8v6rjpw95vf16xh547igxxzddr6wpjiwhqwpwhz2alavk2v";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ cabalMacosx reactiveBanana wx wxcore ];
diff --git a/pkgs/development/libraries/haskell/reactive-banana/default.nix b/pkgs/development/libraries/haskell/reactive-banana/default.nix
index 1c5cb92d47b..8d1ee0ffc95 100644
--- a/pkgs/development/libraries/haskell/reactive-banana/default.nix
+++ b/pkgs/development/libraries/haskell/reactive-banana/default.nix
@@ -1,13 +1,15 @@
-{ cabal, fclabels, hashable, QuickCheck, transformers
-, unorderedContainers, vault
+{ cabal, hashable, HUnit, testFramework, testFrameworkHunit
+, transformers, unorderedContainers, vault
 }:
 
 cabal.mkDerivation (self: {
   pname = "reactive-banana";
-  version = "0.6.0.0";
-  sha256 = "1s0ymkqrjnzylxdwqfslf87g7sjqk135hnvgdkzy4dbvvpplq113";
-  buildDepends = [
-    fclabels hashable QuickCheck transformers unorderedContainers vault
+  version = "0.7.1.2";
+  sha256 = "1x4ln3dr937va0ii7lr86d6wsrh2qd1sxany4y9dkpcrsvb3db0l";
+  buildDepends = [ hashable transformers unorderedContainers vault ];
+  testDepends = [
+    hashable HUnit testFramework testFrameworkHunit transformers
+    unorderedContainers vault
   ];
   meta = {
     homepage = "http://haskell.org/haskellwiki/Reactive-banana";
diff --git a/pkgs/development/libraries/haskell/readline/default.nix b/pkgs/development/libraries/haskell/readline/default.nix
index 898b005c4da..6090fc8578a 100644
--- a/pkgs/development/libraries/haskell/readline/default.nix
+++ b/pkgs/development/libraries/haskell/readline/default.nix
@@ -1,9 +1,9 @@
-{ cabal, readline, ncurses } :
+{ cabal, readline, ncurses }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "readline";
-  version = "1.0.1.0";
-  sha256 = "07f2f039f32bf18838a4875d0f3caa3ed9436dd52b962b2061f0bb8a3316fa1d";
+  version = "1.0.3.0";
+  sha256 = "1sszlx34qa88fad3wlhd4rkb1my1nrpzvyd8vq7dn806j5sf3ff0";
   propagatedBuildInputs = [ readline ncurses ];
   # experimentally link with ncursesw because ghci can't interpret ld scripts,
   # and ncurses sometimes seems to be a script pointing to ncursesw
@@ -14,9 +14,6 @@ cabal.mkDerivation (self : {
     description = "An interface to the GNU readline library";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/reflection/default.nix b/pkgs/development/libraries/haskell/reflection/default.nix
new file mode 100644
index 00000000000..5f227d60ca8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/reflection/default.nix
@@ -0,0 +1,14 @@
+{ cabal, tagged }:
+
+cabal.mkDerivation (self: {
+  pname = "reflection";
+  version = "1.3.2";
+  sha256 = "0jmdygvmvhw20aqjk7k0jah93ggfgf2bgq5zpwnz9bwgi9gs17x6";
+  buildDepends = [ tagged ];
+  meta = {
+    homepage = "http://github.com/ekmett/reflection";
+    description = "Reifies arbitrary terms into types that can be reflected back into terms";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/regex-pcre-builtin/default.nix b/pkgs/development/libraries/haskell/regex-pcre-builtin/default.nix
deleted file mode 100644
index 67180215fde..00000000000
--- a/pkgs/development/libraries/haskell/regex-pcre-builtin/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ cabal, regexBase }:
-
-cabal.mkDerivation (self: {
-  pname = "regex-pcre-builtin";
-  version = "0.94.2.1.7.7";
-  sha256 = "1c4zxfild1fbpxwqcp2jnf6iwfs0z6nc8dry09gmjykxlhisxi8s";
-  buildDepends = [ regexBase ];
-  meta = {
-    homepage = "http://sourceforge.net/projects/lazy-regex";
-    description = "Replaces/Enhances Text.Regex";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/regular/default.nix b/pkgs/development/libraries/haskell/regular/default.nix
index c37c54e8bfa..8a3e740491c 100644
--- a/pkgs/development/libraries/haskell/regular/default.nix
+++ b/pkgs/development/libraries/haskell/regular/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "regular";
-  version = "0.3.4";
-  sha256 = "10gfid99xcqv3i9rp4x8hykk91qq3h7b7lxzsl7ii58vmifa4kgq";
+  version = "0.3.4.2";
+  sha256 = "0fshjpbgabdcsa9a4cjmvfrzy7db4s679rprdbrhhfwf5xiszs2s";
   meta = {
     description = "Generic programming library for regular datatypes";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/repa-algorithms/default.nix b/pkgs/development/libraries/haskell/repa-algorithms/default.nix
index d8a1e61c5d7..acf9dc712f3 100644
--- a/pkgs/development/libraries/haskell/repa-algorithms/default.nix
+++ b/pkgs/development/libraries/haskell/repa-algorithms/default.nix
@@ -2,10 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "repa-algorithms";
-  version = "3.2.1.1";
-  sha256 = "19gc2vbkqxysnm0argksn8c3cv7vf30hkdycgv8fdfn0yc95xz0v";
+  version = "3.2.3.1";
+  sha256 = "12w76npa52g7zxa0j9w8q9njacm2dn0hcd8a8386p9r6iy6lpjwc";
   buildDepends = [ repa vector ];
   extraLibraries = [ llvm ];
+  jailbreak = true;
   meta = {
     homepage = "http://repa.ouroborus.net";
     description = "Algorithms using the Repa array library";
diff --git a/pkgs/development/libraries/haskell/repa-examples/default.nix b/pkgs/development/libraries/haskell/repa-examples/default.nix
index 1f3e66e5e08..0d65439f2c5 100644
--- a/pkgs/development/libraries/haskell/repa-examples/default.nix
+++ b/pkgs/development/libraries/haskell/repa-examples/default.nix
@@ -1,13 +1,18 @@
-{ cabal, llvm, random, repa, repaAlgorithms, repaIo, vector }:
+{ cabal, llvm, QuickCheck, random, repa, repaAlgorithms, repaIo
+, vector
+}:
 
 cabal.mkDerivation (self: {
   pname = "repa-examples";
-  version = "3.2.1.1";
-  sha256 = "0nbdp3vwg7ha9vhz7f2kys3jxdlwiihxz031cfpkv2si5ci3gy1b";
+  version = "3.2.3.2";
+  sha256 = "1l8bvaaap5gl62j9zinjgj8vlqq4b52p46hnj8kq9n09lxq6xq96";
   isLibrary = false;
   isExecutable = true;
-  buildDepends = [ random repa repaAlgorithms repaIo vector ];
+  buildDepends = [
+    QuickCheck random repa repaAlgorithms repaIo vector
+  ];
   extraLibraries = [ llvm ];
+  jailbreak = true;
   meta = {
     homepage = "http://repa.ouroborus.net";
     description = "Examples using the Repa array library";
diff --git a/pkgs/development/libraries/haskell/repa-io/default.nix b/pkgs/development/libraries/haskell/repa-io/default.nix
index 293a7bc6d58..046fafca43a 100644
--- a/pkgs/development/libraries/haskell/repa-io/default.nix
+++ b/pkgs/development/libraries/haskell/repa-io/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "repa-io";
-  version = "3.2.1.1";
-  sha256 = "156amnlqsxhwalnc4nypcd66znv2f8c71d5xi8ja5g8d9f1yg02g";
+  version = "3.2.3.2";
+  sha256 = "116qxq0jsq3hbj0hxjxfr9sl29vzj1rpfbzfxgc243v1hh4rdjfr";
   buildDepends = [ binary bmp repa vector ];
+  jailbreak = true;
   meta = {
     homepage = "http://repa.ouroborus.net";
     description = "Read and write Repa arrays in various formats";
diff --git a/pkgs/development/libraries/haskell/repa/default.nix b/pkgs/development/libraries/haskell/repa/default.nix
index b6102d45572..ae56ba5157a 100644
--- a/pkgs/development/libraries/haskell/repa/default.nix
+++ b/pkgs/development/libraries/haskell/repa/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "repa";
-  version = "3.2.1.1";
-  sha256 = "0jzcy3xdlwmcjq1mpfqh0axcgbj3i03nxg7blw2sly8qrgfl0ri1";
+  version = "3.2.3.3";
+  sha256 = "0rdny7yjcmz9iy07sqnjmwyr58f0kyzzdycwi55j963rb4vqkacn";
   buildDepends = [ QuickCheck vector ];
   meta = {
     homepage = "http://repa.ouroborus.net";
diff --git a/pkgs/development/libraries/haskell/repr/default.nix b/pkgs/development/libraries/haskell/repr/default.nix
index 2558f4fbd31..c44735eda00 100644
--- a/pkgs/development/libraries/haskell/repr/default.nix
+++ b/pkgs/development/libraries/haskell/repr/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "repr";
-  version = "0.4.1.2";
-  sha256 = "09rv23p1hvvfw5wnhiawgrpqgqa4i0d00skyj9z1jj6bfxk5avjs";
+  version = "0.4.1.3";
+  sha256 = "1y1zl81yjc9jrci83bm6bn8hrfqf6x25vxzkhrkydhhwcwqfqaj5";
   buildDepends = [
     baseUnicodeSymbols dstring random stringCombinators
   ];
diff --git a/pkgs/development/libraries/haskell/resource-pool/default.nix b/pkgs/development/libraries/haskell/resource-pool/default.nix
index 7ed81b8d986..77bc9105193 100644
--- a/pkgs/development/libraries/haskell/resource-pool/default.nix
+++ b/pkgs/development/libraries/haskell/resource-pool/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "resource-pool";
-  version = "0.2.1.0";
-  sha256 = "12akfi906l1nm7h3wvjkzl9bxn74dbv17xw2c1mqgl6sg470d587";
+  version = "0.2.1.1";
+  sha256 = "1ypyzy7mkmpab6rghsizrx6raam3l2acwxm56x7jmcv8s2algi1g";
   buildDepends = [
     hashable monadControl stm time transformers transformersBase vector
   ];
diff --git a/pkgs/development/libraries/haskell/resourcet/default.nix b/pkgs/development/libraries/haskell/resourcet/default.nix
index 7531008d854..4b2defc79d7 100644
--- a/pkgs/development/libraries/haskell/resourcet/default.nix
+++ b/pkgs/development/libraries/haskell/resourcet/default.nix
@@ -1,14 +1,15 @@
-{ cabal, liftedBase, monadControl, mtl, transformers
+{ cabal, hspec, liftedBase, mmorph, monadControl, mtl, transformers
 , transformersBase
 }:
 
 cabal.mkDerivation (self: {
   pname = "resourcet";
-  version = "0.3.3.1";
-  sha256 = "164r2p08j3im4wz5jkadl5pvb0qj02k4f2s3v08lm39a51kygjdl";
+  version = "0.4.7.1";
+  sha256 = "1x9njf5amxv04fvn7fsgpagvzl09sl6bnnx686i554frg66b2azh";
   buildDepends = [
-    liftedBase monadControl mtl transformers transformersBase
+    liftedBase mmorph monadControl mtl transformers transformersBase
   ];
+  testDepends = [ hspec liftedBase transformers ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Deterministic allocation and freeing of scarce resources";
diff --git a/pkgs/development/libraries/haskell/safecopy/default.nix b/pkgs/development/libraries/haskell/safecopy/default.nix
new file mode 100644
index 00000000000..c700ff0df3d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/safecopy/default.nix
@@ -0,0 +1,14 @@
+{ cabal, cereal, text, time }:
+
+cabal.mkDerivation (self: {
+  pname = "safecopy";
+  version = "0.8.2";
+  sha256 = "0l2kqymsxv244fahxcpxlrspk6xipz3br6j854ipbfh8b0bfvr4m";
+  buildDepends = [ cereal text time ];
+  meta = {
+    homepage = "http://acid-state.seize.it/safecopy";
+    description = "Binary serialization with version control";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/sample-frame/default.nix b/pkgs/development/libraries/haskell/sample-frame/default.nix
new file mode 100644
index 00000000000..f8acbf1fda8
--- /dev/null
+++ b/pkgs/development/libraries/haskell/sample-frame/default.nix
@@ -0,0 +1,16 @@
+{ cabal, QuickCheck, storableRecord }:
+
+cabal.mkDerivation (self: {
+  pname = "sample-frame";
+  version = "0.0.2";
+  sha256 = "1k1fyslgw5vvn9a38mhp7c9j1xxf75ys010rcn2vr3pm6aj868sx";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ QuickCheck storableRecord ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/Synthesizer";
+    description = "Handling of samples in an (audio) signal";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/scotty/default.nix b/pkgs/development/libraries/haskell/scotty/default.nix
new file mode 100644
index 00000000000..9baaa89d2d4
--- /dev/null
+++ b/pkgs/development/libraries/haskell/scotty/default.nix
@@ -0,0 +1,19 @@
+{ cabal, aeson, blazeBuilder, caseInsensitive, conduit, dataDefault
+, httpTypes, mtl, regexCompat, resourcet, text, wai, waiExtra, warp
+}:
+
+cabal.mkDerivation (self: {
+  pname = "scotty";
+  version = "0.4.6";
+  sha256 = "0g83kgqr1p03z7dks6x00id2gz95kkw00wmwp5vyz4zvx1mmmvk8";
+  buildDepends = [
+    aeson blazeBuilder caseInsensitive conduit dataDefault httpTypes
+    mtl regexCompat resourcet text wai waiExtra warp
+  ];
+  meta = {
+    homepage = "https://github.com/ku-fpg/scotty";
+    description = "Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/semigroupoid-extras/default.nix b/pkgs/development/libraries/haskell/semigroupoid-extras/default.nix
new file mode 100644
index 00000000000..263adb42f25
--- /dev/null
+++ b/pkgs/development/libraries/haskell/semigroupoid-extras/default.nix
@@ -0,0 +1,14 @@
+{ cabal, comonad, distributive, groupoids, semigroupoids }:
+
+cabal.mkDerivation (self: {
+  pname = "semigroupoid-extras";
+  version = "3.0.1";
+  sha256 = "1b6ix9myjav1h4bbq3jxlan8sn2pjw8x0zhazv3anxfab5n2sxpd";
+  buildDepends = [ comonad distributive groupoids semigroupoids ];
+  meta = {
+    homepage = "http://github.com/ekmett/semigroupoid-extras";
+    description = "Semigroupoids requiring Haskell extensions";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/semigroupoids/3.0.nix b/pkgs/development/libraries/haskell/semigroupoids/3.0.nix
deleted file mode 100644
index 4ffc3c2badc..00000000000
--- a/pkgs/development/libraries/haskell/semigroupoids/3.0.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, comonad, contravariant, semigroups, transformers }:
-
-cabal.mkDerivation (self: {
-  pname = "semigroupoids";
-  version = "3.0";
-  sha256 = "0wsax14ck363nby0xrhcpvdzf0pzspayl7gsm0br0lr6ipmpcrag";
-  buildDepends = [ comonad contravariant semigroups transformers ];
-  meta = {
-    homepage = "http://github.com/ekmett/semigroupoids";
-    description = "Haskell 98 semigroupoids: Category sans id";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/semigroupoids/1.3.4.nix b/pkgs/development/libraries/haskell/semigroupoids/default.nix
index 776e452eafe..4f1367dd559 100644
--- a/pkgs/development/libraries/haskell/semigroupoids/1.3.4.nix
+++ b/pkgs/development/libraries/haskell/semigroupoids/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "semigroupoids";
-  version = "1.3.4";
-  sha256 = "0vnipjndbsldk5w1qw35i2zrd418rq13y10g0i33ylg1gwnsrqph";
+  version = "3.0.2";
+  sha256 = "0k137iafw0srgmy4qwx3cbx00519c0h91nmszdbx6pzpvf6m5fwm";
   buildDepends = [ comonad contravariant semigroups transformers ];
   meta = {
     homepage = "http://github.com/ekmett/semigroupoids";
diff --git a/pkgs/development/libraries/haskell/semigroups/default.nix b/pkgs/development/libraries/haskell/semigroups/default.nix
index 795c690d7a2..ded335ca524 100644
--- a/pkgs/development/libraries/haskell/semigroups/default.nix
+++ b/pkgs/development/libraries/haskell/semigroups/default.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, nats }:
 
 cabal.mkDerivation (self: {
   pname = "semigroups";
-  version = "0.8.4";
-  sha256 = "0xphwxxzddgcw2hr4h60l3y27f1x032w049wkjs71f5hdypwapv4";
+  version = "0.9.2";
+  sha256 = "06r6zdfbks48yb7ib0bc168xxk4qciv4dbazq76dpmnlhwxcf1li";
+  buildDepends = [ nats ];
   meta = {
     homepage = "http://github.com/ekmett/semigroups/";
     description = "Haskell 98 semigroups";
diff --git a/pkgs/development/libraries/haskell/sendfile/default.nix b/pkgs/development/libraries/haskell/sendfile/default.nix
index a4b410f4561..dc1f24757af 100644
--- a/pkgs/development/libraries/haskell/sendfile/default.nix
+++ b/pkgs/development/libraries/haskell/sendfile/default.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "sendfile";
-  version = "0.7.6";
-  sha256 = "0wqbnr07s3g7f6p4x27ips9nzjjz1ii5hw1q54i31g40jzv8rs7z";
+  version = "0.7.9";
+  sha256 = "0hnw1ym81cff49dwww19kgbs4s0kpandbvn6h5cml3y0p1nxybqh";
   buildDepends = [ network ];
   meta = {
-    homepage = "http://patch-tag.com/r/mae/sendfile";
+    homepage = "http://hub.darcs.net/stepcut/sendfile";
     description = "A portable sendfile library";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/setenv/default.nix b/pkgs/development/libraries/haskell/setenv/default.nix
new file mode 100644
index 00000000000..b19728820aa
--- /dev/null
+++ b/pkgs/development/libraries/haskell/setenv/default.nix
@@ -0,0 +1,14 @@
+{ cabal, hspec, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "setenv";
+  version = "0.1.0";
+  sha256 = "04w42bpfbrs5crjp19zzi9dg61xpz4wvmjs2vc7q7qxblyhdfdsy";
+  testDepends = [ hspec QuickCheck ];
+  doCheck = false;
+  meta = {
+    description = "A cross-platform library for setting environment variables";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/shake/default.nix b/pkgs/development/libraries/haskell/shake/default.nix
new file mode 100644
index 00000000000..c5cc24cc8da
--- /dev/null
+++ b/pkgs/development/libraries/haskell/shake/default.nix
@@ -0,0 +1,21 @@
+{ cabal, binary, deepseq, filepath, hashable, random, time
+, transformers, unorderedContainers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "shake";
+  version = "0.10.3";
+  sha256 = "0dvpjswiiw2s4zh5sjx7qs4xp41bw2wqny0k61pkg5wvgw3b7jmh";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary deepseq filepath hashable random time transformers
+    unorderedContainers
+  ];
+  meta = {
+    homepage = "http://community.haskell.org/~ndm/shake/";
+    description = "Build system library, like Make, but more accurate dependencies";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/shakespeare-css/default.nix b/pkgs/development/libraries/haskell/shakespeare-css/default.nix
index a64e9acc7d7..a18df3062e2 100644
--- a/pkgs/development/libraries/haskell/shakespeare-css/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-css/default.nix
@@ -1,10 +1,11 @@
-{ cabal, parsec, shakespeare, text }:
+{ cabal, hspec, HUnit, parsec, shakespeare, text, transformers }:
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-css";
-  version = "1.0.1.4";
-  sha256 = "0avixf7z3hcvgcijgrm7hisr8i8waa8nb435gv8lv5vvz8yq3k0n";
-  buildDepends = [ parsec shakespeare text ];
+  version = "1.0.5.1";
+  sha256 = "06x57cm9ni7cgdizdwzqzpqdmgzhchax7c4mbqvk3ymgf3lybrss";
+  buildDepends = [ parsec shakespeare text transformers ];
+  testDepends = [ hspec HUnit shakespeare text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "Stick your haskell variables into css at compile time";
diff --git a/pkgs/development/libraries/haskell/shakespeare-i18n/default.nix b/pkgs/development/libraries/haskell/shakespeare-i18n/default.nix
index 1150ead0394..667edcdce1c 100644
--- a/pkgs/development/libraries/haskell/shakespeare-i18n/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-i18n/default.nix
@@ -1,10 +1,11 @@
-{ cabal, parsec, shakespeare, text }:
+{ cabal, hspec, parsec, shakespeare, text }:
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-i18n";
-  version = "1.0.0.2";
-  sha256 = "11ydkl6v31v79q8a8fqf4p99p7dv9dlimr3rhi9cs5lrxz9gmf5z";
+  version = "1.0.0.3";
+  sha256 = "0k5daz6ayc4d6zxsq7p27bp5fq4qr31qxw9z9mwb5xcz2404d00r";
   buildDepends = [ parsec shakespeare text ];
+  testDepends = [ hspec text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "A type-based approach to internationalization";
diff --git a/pkgs/development/libraries/haskell/shakespeare-js/default.nix b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
index ff2f0c09e0c..802fc885137 100644
--- a/pkgs/development/libraries/haskell/shakespeare-js/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-js/default.nix
@@ -1,10 +1,11 @@
-{ cabal, shakespeare, text }:
+{ cabal, aeson, hspec, HUnit, shakespeare, text }:
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-js";
-  version = "1.0.0.5";
-  sha256 = "1d4na2q1q798ki5f84gpf89ri26qmrxqrwbw7mmlrfwkj1qw69rs";
-  buildDepends = [ shakespeare text ];
+  version = "1.1.4";
+  sha256 = "05hnqpg1icf6akvchhiam8sd2xkfiyvbwq504gnys55rxgjabfy3";
+  buildDepends = [ aeson shakespeare text ];
+  testDepends = [ aeson hspec HUnit shakespeare text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "Stick your haskell variables into javascript/coffeescript at compile time";
diff --git a/pkgs/development/libraries/haskell/shakespeare-text/default.nix b/pkgs/development/libraries/haskell/shakespeare-text/default.nix
index fbc31e3eda1..d4cc135cc62 100644
--- a/pkgs/development/libraries/haskell/shakespeare-text/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare-text/default.nix
@@ -1,10 +1,11 @@
-{ cabal, shakespeare, text }:
+{ cabal, hspec, HUnit, shakespeare, text }:
 
 cabal.mkDerivation (self: {
   pname = "shakespeare-text";
-  version = "1.0.0.4";
-  sha256 = "14kas2m7kbv1f49qpx6z097r707l3gqp9lwvh0q42cc6rlwab5l7";
+  version = "1.0.0.5";
+  sha256 = "176yzx43sh0fnxpszn8kximd6i96yf2s374z55kvc1kspf7jk736";
   buildDepends = [ shakespeare text ];
+  testDepends = [ hspec HUnit text ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "Interpolation with quasi-quotation: put variables strings";
diff --git a/pkgs/development/libraries/haskell/shakespeare/default.nix b/pkgs/development/libraries/haskell/shakespeare/default.nix
index 1619cc6760c..16ad7ffa44a 100644
--- a/pkgs/development/libraries/haskell/shakespeare/default.nix
+++ b/pkgs/development/libraries/haskell/shakespeare/default.nix
@@ -1,10 +1,13 @@
-{ cabal, parsec, text }:
+{ cabal, hspec, parsec, systemFileio, systemFilepath, text, time }:
 
 cabal.mkDerivation (self: {
   pname = "shakespeare";
-  version = "1.0.1.1";
-  sha256 = "0w5dcli9gbmbpfg8rd8bia7wfll4iisi2cbdwdhbnn159mw8s25x";
-  buildDepends = [ parsec text ];
+  version = "1.0.5";
+  sha256 = "1dc1yg35pxh45fv20fvnlpas0svqi18h6bdalpjaqjb164s114vf";
+  buildDepends = [ parsec systemFileio systemFilepath text time ];
+  testDepends = [
+    hspec parsec systemFileio systemFilepath text time
+  ];
   meta = {
     homepage = "http://www.yesodweb.com/book/shakespearean-templates";
     description = "A toolkit for making compile-time interpolated templates";
diff --git a/pkgs/development/libraries/haskell/shelly/default.nix b/pkgs/development/libraries/haskell/shelly/default.nix
index 0c266ab1b29..1e9e1f8c6cc 100644
--- a/pkgs/development/libraries/haskell/shelly/default.nix
+++ b/pkgs/development/libraries/haskell/shelly/default.nix
@@ -1,13 +1,17 @@
-{ cabal, mtl, systemFileio, systemFilepath, text, time, unixCompat
+{ cabal, hspec, HUnit, mtl, systemFileio, systemFilepath, text
+, time, unixCompat
 }:
 
 cabal.mkDerivation (self: {
   pname = "shelly";
-  version = "0.14.0.1";
-  sha256 = "062c3zqr6ad61p0s423h8rhimqfld6p95z3qzrmag9f29a5f4fbz";
+  version = "0.15.4.1";
+  sha256 = "12m11s22izz0ny1syb1ykp2hi9n240myf0nhapvn8jx1fgf5iyck";
   buildDepends = [
     mtl systemFileio systemFilepath text time unixCompat
   ];
+  testDepends = [
+    hspec HUnit mtl systemFileio systemFilepath text time unixCompat
+  ];
   meta = {
     homepage = "https://github.com/yesodweb/Shelly.hs";
     description = "shell-like (systems) programming in Haskell";
diff --git a/pkgs/development/libraries/haskell/show/default.nix b/pkgs/development/libraries/haskell/show/default.nix
index 7fe0013d0d2..28ed4371264 100644
--- a/pkgs/development/libraries/haskell/show/default.nix
+++ b/pkgs/development/libraries/haskell/show/default.nix
@@ -1,10 +1,10 @@
-{ cabal, QuickCheck, random, smallcheck, syb }:
+{ cabal, syb }:
 
 cabal.mkDerivation (self: {
   pname = "show";
-  version = "0.4.1.2";
-  sha256 = "1qaphxjaxng7d0kcn3vvxbvqljzzs1hvmsrdsm3pbi19qlsavd5w";
-  buildDepends = [ QuickCheck random smallcheck syb ];
+  version = "0.6";
+  sha256 = "15bvfffnr034z8wbmhxa8h5qskbxwbflk434dx023l1qlm3sjmsg";
+  buildDepends = [ syb ];
   meta = {
     description = "'Show' instances for Lambdabot";
     license = "GPL";
diff --git a/pkgs/development/libraries/haskell/silently/default.nix b/pkgs/development/libraries/haskell/silently/default.nix
new file mode 100644
index 00000000000..fcd7a0a872a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/silently/default.nix
@@ -0,0 +1,15 @@
+{ cabal, deepseq, nanospec }:
+
+cabal.mkDerivation (self: {
+  pname = "silently";
+  version = "1.2.4.1";
+  sha256 = "035dw3zg680ykyz5rqkkrjn51wkznbc4jb45a8l2gh3vgqzgbf52";
+  buildDepends = [ deepseq ];
+  testDepends = [ deepseq nanospec ];
+  meta = {
+    homepage = "https://github.com/trystan/silently";
+    description = "Prevent or capture writing to stdout and other handles";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/simple-reflect/default.nix b/pkgs/development/libraries/haskell/simple-reflect/default.nix
new file mode 100644
index 00000000000..7a7f40c6d83
--- /dev/null
+++ b/pkgs/development/libraries/haskell/simple-reflect/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "simple-reflect";
+  version = "0.3.1";
+  sha256 = "189pc7fk28bwl0mq6hw502kc048n203rb4vpf2wva490r36xiw6s";
+  meta = {
+    homepage = "http://twan.home.fmf.nl/blog/haskell/simple-reflection-of-expressions.details";
+    description = "Simple reflection of expressions containing variables";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/simple-sendfile/default.nix b/pkgs/development/libraries/haskell/simple-sendfile/default.nix
index 20bdca91bb3..9e8f638c65c 100644
--- a/pkgs/development/libraries/haskell/simple-sendfile/default.nix
+++ b/pkgs/development/libraries/haskell/simple-sendfile/default.nix
@@ -1,10 +1,12 @@
-{ cabal, network }:
+{ cabal, conduit, hspec, HUnit, network, networkConduit }:
 
 cabal.mkDerivation (self: {
   pname = "simple-sendfile";
-  version = "0.2.6";
-  sha256 = "1bv8lmpp1h89kx614ijyi5kyqsf4nj75zdarjwxm7is6ixp3rnha";
+  version = "0.2.11";
+  sha256 = "1q9m9lxv9jfkn6a1lf07jcl4li3n5996df1qrfkfjq2n0bvn4qfj";
   buildDepends = [ network ];
+  testDepends = [ conduit hspec HUnit network networkConduit ];
+  doCheck = false;
   meta = {
     description = "Cross platform library for the sendfile system call";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/sized-types/default.nix b/pkgs/development/libraries/haskell/sized-types/default.nix
new file mode 100644
index 00000000000..672b2c090ef
--- /dev/null
+++ b/pkgs/development/libraries/haskell/sized-types/default.nix
@@ -0,0 +1,15 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "sized-types";
+  version = "0.3.4.0";
+  sha256 = "0fpk7xpqzzylxbnxhz56lxzfnrhfibn0x7ahxl91x6biysnh714c";
+  isLibrary = true;
+  isExecutable = true;
+  meta = {
+    homepage = "http://www.ittc.ku.edu/csdl/fpg/Tools";
+    description = "Sized types in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/skein/default.nix b/pkgs/development/libraries/haskell/skein/default.nix
index 5a4afd9309b..3db59020b15 100644
--- a/pkgs/development/libraries/haskell/skein/default.nix
+++ b/pkgs/development/libraries/haskell/skein/default.nix
@@ -1,10 +1,11 @@
-{ cabal, cereal, cryptoApi, tagged }:
+{ cabal, cereal, cryptoApi, filepath, hspec, tagged }:
 
 cabal.mkDerivation (self: {
   pname = "skein";
-  version = "0.1.0.8";
-  sha256 = "0d0xrrcagf663rn37gpr13jyvfm7rnil18mz4miavb4hwzni46rm";
+  version = "1.0.3";
+  sha256 = "15vzydywhwjdgybabvv6lfk1vjs7blvs3k2apwxjdjh2q7jmgkam";
   buildDepends = [ cereal cryptoApi tagged ];
+  testDepends = [ cereal cryptoApi filepath hspec tagged ];
   meta = {
     homepage = "https://github.com/meteficha/skein";
     description = "Skein, a family of cryptographic hash functions. Includes Skein-MAC as well.";
diff --git a/pkgs/development/libraries/haskell/smallcheck/default.nix b/pkgs/development/libraries/haskell/smallcheck/default.nix
index 1086a1929a8..6d82e7e5132 100644
--- a/pkgs/development/libraries/haskell/smallcheck/default.nix
+++ b/pkgs/development/libraries/haskell/smallcheck/default.nix
@@ -1,10 +1,10 @@
-{ cabal, dlist }:
+{ cabal, logict, mtl }:
 
 cabal.mkDerivation (self: {
   pname = "smallcheck";
-  version = "0.6.1";
-  sha256 = "1p2bsc08lcyzmqdjc5qsr60dr03kvc8xw7kk4lbi9cnn9s9w90vb";
-  buildDepends = [ dlist ];
+  version = "1.0.2";
+  sha256 = "09zlsvgbwgpjwkjhizbzzww2nvkyxvkf214yqxzfaa1cj9xzbbdi";
+  buildDepends = [ logict mtl ];
   meta = {
     homepage = "https://github.com/feuerbach/smallcheck";
     description = "A property-based testing library";
diff --git a/pkgs/development/libraries/haskell/smtp-mail/default.nix b/pkgs/development/libraries/haskell/smtp-mail/default.nix
new file mode 100644
index 00000000000..e07ed9e236b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/smtp-mail/default.nix
@@ -0,0 +1,19 @@
+{ cabal, base16Bytestring, base64Bytestring, cryptohash, filepath
+, mimeMail, network, text
+}:
+
+cabal.mkDerivation (self: {
+  pname = "smtp-mail";
+  version = "0.1.4.3";
+  sha256 = "0kpm42n7s3rvkn9i3s8wvkdrq2d85qy422y6p2r4s7nivh6sx1dk";
+  buildDepends = [
+    base16Bytestring base64Bytestring cryptohash filepath mimeMail
+    network text
+  ];
+  meta = {
+    homepage = "http://github.com/jhickner/smtp-mail";
+    description = "Simple email sending via SMTP";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/snap/core.nix b/pkgs/development/libraries/haskell/snap/core.nix
index 1d51b9d9933..a20ec8e7ca5 100644
--- a/pkgs/development/libraries/haskell/snap/core.nix
+++ b/pkgs/development/libraries/haskell/snap/core.nix
@@ -1,21 +1,19 @@
-{ cabal, attoparsec, attoparsecEnumerator, base16Bytestring
-, blazeBuilder, blazeBuilderEnumerator, bytestringMmap
-, bytestringNums, caseInsensitive, deepseq, dlist, enumerator
-, filepath, HUnit, MonadCatchIOTransformers, mtl, mwcRandom
-, regexPosix, text, time, transformers, unixCompat
-, unorderedContainers, vector, zlibEnum
+{ cabal, attoparsec, attoparsecEnumerator, blazeBuilder
+, blazeBuilderEnumerator, bytestringMmap, caseInsensitive, deepseq
+, enumerator, filepath, HUnit, MonadCatchIOTransformers, mtl
+, random, regexPosix, text, time, unixCompat, unorderedContainers
+, vector, zlibEnum
 }:
 
 cabal.mkDerivation (self: {
   pname = "snap-core";
-  version = "0.9.0";
-  sha256 = "1fsjamv9sl19in2ws97v246sbvlnj05rm9dljc0pz7kasawyqsb7";
+  version = "0.9.3.1";
+  sha256 = "1q2lk70l0hk4l6ksjnal1bfkby0i08gdzvj9cscvxs4njxmgdapq";
   buildDepends = [
-    attoparsec attoparsecEnumerator base16Bytestring blazeBuilder
-    blazeBuilderEnumerator bytestringMmap bytestringNums
-    caseInsensitive deepseq dlist enumerator filepath HUnit
-    MonadCatchIOTransformers mtl mwcRandom regexPosix text time
-    transformers unixCompat unorderedContainers vector zlibEnum
+    attoparsec attoparsecEnumerator blazeBuilder blazeBuilderEnumerator
+    bytestringMmap caseInsensitive deepseq enumerator filepath HUnit
+    MonadCatchIOTransformers mtl random regexPosix text time unixCompat
+    unorderedContainers vector zlibEnum
   ];
   meta = {
     homepage = "http://snapframework.com/";
diff --git a/pkgs/development/libraries/haskell/snap/loader-dynamic.nix b/pkgs/development/libraries/haskell/snap/loader-dynamic.nix
index 5815496695c..abe4d4cc074 100644
--- a/pkgs/development/libraries/haskell/snap/loader-dynamic.nix
+++ b/pkgs/development/libraries/haskell/snap/loader-dynamic.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "snap-loader-dynamic";
-  version = "0.9.0";
-  sha256 = "1pbpvi20an077klvha1dflnlxpfb6m81n9d50hjhidf6430cmmhm";
+  version = "0.10";
+  sha256 = "0wnrsbnf3crfxhhraz4my08m6yhmqj632rv6cdy9ili3wxjkqd57";
   buildDepends = [ directoryTree hint mtl snapCore time ];
   meta = {
     homepage = "http://snapframework.com/";
diff --git a/pkgs/development/libraries/haskell/snap/loader-static.nix b/pkgs/development/libraries/haskell/snap/loader-static.nix
index a9dcbf10810..e75ae50d6c8 100644
--- a/pkgs/development/libraries/haskell/snap/loader-static.nix
+++ b/pkgs/development/libraries/haskell/snap/loader-static.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "snap-loader-static";
-  version = "0.9.0";
-  sha256 = "1blchmg0qfng7bw235z1gqkwyi764j78bc29vd5p6xxhmq111ys7";
+  version = "0.9.0.1";
+  sha256 = "0xlb8611r9l9ld97rs27nji7k1qvjg5i62b4al38xj6i0f2skyyi";
   meta = {
     homepage = "http://snapframework.com/";
     description = "Snap: A Haskell Web Framework: static loader";
diff --git a/pkgs/development/libraries/haskell/snap/server.nix b/pkgs/development/libraries/haskell/snap/server.nix
index 20a6af0ba90..c11dfe4f398 100644
--- a/pkgs/development/libraries/haskell/snap/server.nix
+++ b/pkgs/development/libraries/haskell/snap/server.nix
@@ -1,19 +1,17 @@
-{ cabal, attoparsec, attoparsecEnumerator, binary, blazeBuilder
-, blazeBuilderEnumerator, bytestringNums, caseInsensitive
-, directoryTree, enumerator, filepath, MonadCatchIOTransformers
-, mtl, murmurHash, network, snapCore, text, time, transformers
-, unixCompat, vector, vectorAlgorithms
+{ cabal, attoparsec, attoparsecEnumerator, blazeBuilder
+, blazeBuilderEnumerator, caseInsensitive, enumerator
+, MonadCatchIOTransformers, mtl, network, snapCore, text, time
+, unixCompat
 }:
 
 cabal.mkDerivation (self: {
   pname = "snap-server";
-  version = "0.9.0";
-  sha256 = "12mjy1w6gsnw93bcpsnxnw7kc2v73dfps7gk542iw73lldfhh3va";
+  version = "0.9.3.3";
+  sha256 = "1n50xyhg4rva7ifv70825177606q87ip7f9p5kf94i9kci0kmlig";
   buildDepends = [
-    attoparsec attoparsecEnumerator binary blazeBuilder
-    blazeBuilderEnumerator bytestringNums caseInsensitive directoryTree
-    enumerator filepath MonadCatchIOTransformers mtl murmurHash network
-    snapCore text time transformers unixCompat vector vectorAlgorithms
+    attoparsec attoparsecEnumerator blazeBuilder blazeBuilderEnumerator
+    caseInsensitive enumerator MonadCatchIOTransformers mtl network
+    snapCore text time unixCompat
   ];
   meta = {
     homepage = "http://snapframework.com/";
diff --git a/pkgs/development/libraries/haskell/snap/snap.nix b/pkgs/development/libraries/haskell/snap/snap.nix
index 4121a657357..80cdf575d70 100644
--- a/pkgs/development/libraries/haskell/snap/snap.nix
+++ b/pkgs/development/libraries/haskell/snap/snap.nix
@@ -1,30 +1,27 @@
-{ cabal, aeson, attoparsec, cereal, clientsession, configurator
-, dataLens, dataLensTemplate, directoryTree, filepath, hashable
-, heist, logict, MonadCatchIOTransformers, mtl, mwcRandom
-, pwstoreFast, snapCore, snapServer, stm, syb, text, time
-, transformers, unorderedContainers, utf8String, vector
-, vectorAlgorithms, xmlhtml
+{ cabal, aeson, attoparsec, cereal, clientsession, comonad
+, configurator, directoryTree, dlist, errors, filepath, hashable
+, heist, lens, logict, MonadCatchIOTransformers, mtl, mwcRandom
+, pwstoreFast, regexPosix, snapCore, snapServer, stm, syb, text
+, time, transformers, unorderedContainers, vector, vectorAlgorithms
+, xmlhtml
 }:
 
 cabal.mkDerivation (self: {
   pname = "snap";
-  version = "0.9.1.1";
-  sha256 = "1g8jvnwrhna5g064dmv4v4khrpwwn0vcqw8l7rcpkp75l46fq29z";
+  version = "0.12.0";
+  sha256 = "0nccmbvhwrcfkz4771bhc210mh2ic0i93ks1752ndgk3007rkiff";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    aeson attoparsec cereal clientsession configurator dataLens
-    dataLensTemplate directoryTree filepath hashable heist logict
-    MonadCatchIOTransformers mtl mwcRandom pwstoreFast snapCore
-    snapServer stm syb text time transformers unorderedContainers
-    utf8String vector vectorAlgorithms xmlhtml
+    aeson attoparsec cereal clientsession comonad configurator
+    directoryTree dlist errors filepath hashable heist lens logict
+    MonadCatchIOTransformers mtl mwcRandom pwstoreFast regexPosix
+    snapCore snapServer stm syb text time transformers
+    unorderedContainers vector vectorAlgorithms xmlhtml
   ];
-  patchPhase = ''
-    sed -i snap.cabal -e 's|clientsession.*,|clientsession,|'
-  '';
   meta = {
     homepage = "http://snapframework.com/";
-    description = "Snap: A Haskell Web Framework: project starter executable and glue code library";
+    description = "Top-level package for the Snap Web Framework";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
   };
diff --git a/pkgs/development/libraries/haskell/socks/default.nix b/pkgs/development/libraries/haskell/socks/default.nix
index d1b4494090c..27dd54b2959 100644
--- a/pkgs/development/libraries/haskell/socks/default.nix
+++ b/pkgs/development/libraries/haskell/socks/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "socks";
-  version = "0.4.2";
-  sha256 = "1nbhx2jjij5kjqa0l68s401ach4yziq6w8mvcv589fcscw212w8r";
+  version = "0.5.1";
+  sha256 = "08zwbkglkahjadqn2m7l0k5yp4lcd9h6kgb8k8mjlwxayx82a0ay";
   buildDepends = [ cereal network ];
   meta = {
     homepage = "http://github.com/vincenthz/hs-socks";
diff --git a/pkgs/development/libraries/haskell/split/0.2.1.1.nix b/pkgs/development/libraries/haskell/split/0.2.1.1.nix
new file mode 100644
index 00000000000..0fb28b53ac9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/split/0.2.1.1.nix
@@ -0,0 +1,14 @@
+{ cabal, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "split";
+  version = "0.2.1.1";
+  sha256 = "1zzp4dwf846s74a4lhw2gf4awsk9iblhl5zcg2zccgv1lr4w2dmz";
+  testDepends = [ QuickCheck ];
+  meta = {
+    description = "Combinator library for splitting lists";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/split/default.nix b/pkgs/development/libraries/haskell/split/0.2.2.nix
index 42d33d10a06..ab60774cca4 100644
--- a/pkgs/development/libraries/haskell/split/default.nix
+++ b/pkgs/development/libraries/haskell/split/0.2.2.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, QuickCheck }:
 
 cabal.mkDerivation (self: {
   pname = "split";
-  version = "0.2.0.0";
-  sha256 = "1gk0nx6bw5j9gxaa6ki70wqszbllz7c1ccfnwg49fl3qfabg1i7c";
+  version = "0.2.2";
+  sha256 = "0xa3j0gwr6k5vizxybnzk5fgb3pppgspi6mysnp2gwjp2dbrxkzr";
+  testDepends = [ QuickCheck ];
   meta = {
     description = "Combinator library for splitting lists";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/srcloc/default.nix b/pkgs/development/libraries/haskell/srcloc/default.nix
index d76309bc795..f652ed001e4 100644
--- a/pkgs/development/libraries/haskell/srcloc/default.nix
+++ b/pkgs/development/libraries/haskell/srcloc/default.nix
@@ -1,10 +1,9 @@
-{ cabal, syb, symbol }:
+{ cabal }:
 
 cabal.mkDerivation (self: {
   pname = "srcloc";
-  version = "0.1.2";
-  sha256 = "08awipz6al7jk7d974am5v9fkp87i5dy6d457mx1rv7lczlyhws9";
-  buildDepends = [ syb symbol ];
+  version = "0.4.0";
+  sha256 = "00af562n4m3nwlhl86x8rx7hhpnhwaijin61wk574pp47bh2jg0k";
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
     description = "Data types for managing source code locations";
diff --git a/pkgs/development/libraries/haskell/statistics/default.nix b/pkgs/development/libraries/haskell/statistics/default.nix
index d977fabb92c..54876a879fc 100644
--- a/pkgs/development/libraries/haskell/statistics/default.nix
+++ b/pkgs/development/libraries/haskell/statistics/default.nix
@@ -1,15 +1,23 @@
-{ cabal, deepseq, erf, mathFunctions, monadPar, mwcRandom
-, primitive, vector, vectorAlgorithms
+{ cabal, binary, deepseq, erf, HUnit, ieee754, mathFunctions
+, monadPar, mwcRandom, primitive, QuickCheck, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2, vector
+, vectorAlgorithms, vectorBinaryInstances
 }:
 
 cabal.mkDerivation (self: {
   pname = "statistics";
-  version = "0.10.1.0";
-  sha256 = "0fnpwnhcwxjcm81b9daqdy07cw5qgqa7m2bj6fxxwicpvawcyabc";
+  version = "0.10.4.1";
+  sha256 = "0kd3zn8ckz3h9dnighmfviacw5cy6czsj90ryn8c0h6yb2s3gqi1";
   buildDepends = [
-    deepseq erf mathFunctions monadPar mwcRandom primitive vector
+    binary deepseq erf mathFunctions monadPar mwcRandom primitive
+    vector vectorAlgorithms vectorBinaryInstances
+  ];
+  testDepends = [
+    erf HUnit ieee754 mathFunctions mwcRandom primitive QuickCheck
+    testFramework testFrameworkHunit testFrameworkQuickcheck2 vector
     vectorAlgorithms
   ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/statistics";
     description = "A library of statistical types, data, and functions";
diff --git a/pkgs/development/libraries/haskell/stm-chans/default.nix b/pkgs/development/libraries/haskell/stm-chans/default.nix
new file mode 100644
index 00000000000..e8bd79a9a80
--- /dev/null
+++ b/pkgs/development/libraries/haskell/stm-chans/default.nix
@@ -0,0 +1,14 @@
+{ cabal, stm }:
+
+cabal.mkDerivation (self: {
+  pname = "stm-chans";
+  version = "3.0.0";
+  sha256 = "1nnl5h88dshcmk0ydhkf84kkf6989igxry9r0z7lwlxfgf7q9nim";
+  buildDepends = [ stm ];
+  meta = {
+    homepage = "http://code.haskell.org/~wren/";
+    description = "Additional types of channels for STM";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/stm-conduit/default.nix b/pkgs/development/libraries/haskell/stm-conduit/default.nix
new file mode 100644
index 00000000000..79171aefb9f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/stm-conduit/default.nix
@@ -0,0 +1,21 @@
+{ cabal, conduit, HUnit, QuickCheck, resourcet, stm, stmChans
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "stm-conduit";
+  version = "2.1.0";
+  sha256 = "0rxnw7kpxvhwmpbn2v9ps0b2hw9321817nyywjjq3x8fadg8w99l";
+  buildDepends = [ conduit resourcet stm stmChans transformers ];
+  testDepends = [
+    conduit HUnit QuickCheck stm stmChans testFramework
+    testFrameworkHunit testFrameworkQuickcheck2 transformers
+  ];
+  meta = {
+    homepage = "https://github.com/wowus/stm-conduit";
+    description = "Introduces conduits to channels, and promotes using conduits concurrently";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/syb/default.nix b/pkgs/development/libraries/haskell/stm/2.4.2.nix
index 65dd5e0e018..a3fa76e4a51 100644
--- a/pkgs/development/libraries/haskell/syb/default.nix
+++ b/pkgs/development/libraries/haskell/stm/2.4.2.nix
@@ -1,11 +1,11 @@
 { cabal }:
 
 cabal.mkDerivation (self: {
-  pname = "syb";
-  version = "0.1.0.1";
-  sha256 = "08nf4id26s5iasxzdy5jds6h87fy3a55zgw0zrig4dg6difmwjp3";
+  pname = "stm";
+  version = "2.4.2";
+  sha256 = "1nsq92z7y0w227fyig0xz4365xp50hnzzkqr4s836q969kb3rvn8";
   meta = {
-    description = "Scrap Your Boilerplate";
+    description = "Software Transactional Memory";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/streamproc/default.nix b/pkgs/development/libraries/haskell/streamproc/default.nix
index 36080e9044e..2b37be487e6 100644
--- a/pkgs/development/libraries/haskell/streamproc/default.nix
+++ b/pkgs/development/libraries/haskell/streamproc/default.nix
@@ -2,13 +2,16 @@
 
 cabal.mkDerivation (self: {
   pname = "streamproc";
-  version = "1.6";
-  sha256 = "0bb1rdzzpjggw7dk4q3hwa1j1bvkfqhz6vrd45shcp57ixqlp6ws";
+  version = "1.6.2";
+  sha256 = "1wl44n4nav4h203mzfdf1bd5nh4v23dib54lvxka1rl3zymgyvp7";
   meta = {
-    homepage = "http://gitorious.org/streamproc";
+    homepage = "http://github.com/peti/streamproc";
     description = "Stream Processer Arrow";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/development/libraries/haskell/string-combinators/default.nix b/pkgs/development/libraries/haskell/string-combinators/default.nix
index 03587d24d02..bfc38fb07e8 100644
--- a/pkgs/development/libraries/haskell/string-combinators/default.nix
+++ b/pkgs/development/libraries/haskell/string-combinators/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "string-combinators";
-  version = "0.6.0.3";
-  sha256 = "18jawxqvcj7zpvb0wf1zln12s03mp6nglhv5ccywrkb5x0r0557j";
+  version = "0.6.0.4";
+  sha256 = "0r1za5ypx9fz073h1yljjdkxmz0h77vg94bk827ndwkfgzgpzvh7";
   buildDepends = [ baseUnicodeSymbols ];
   meta = {
     homepage = "https://github.com/basvandijk/string-combinators";
diff --git a/pkgs/development/libraries/haskell/string-qq/default.nix b/pkgs/development/libraries/haskell/string-qq/default.nix
new file mode 100644
index 00000000000..78fe1c3930f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/string-qq/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "string-qq";
+  version = "0.0.2";
+  sha256 = "0662m3i5xrdrr95w829bszkhp88mj9iy1zya54vk2sl5hz9wlmwp";
+  meta = {
+    description = "QuasiQuoter for non-interpolated strings, texts and bytestrings";
+    license = self.stdenv.lib.licenses.publicDomain;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/stringbuilder/default.nix b/pkgs/development/libraries/haskell/stringbuilder/default.nix
new file mode 100644
index 00000000000..efe0956afc0
--- /dev/null
+++ b/pkgs/development/libraries/haskell/stringbuilder/default.nix
@@ -0,0 +1,13 @@
+{ cabal, hspec, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "stringbuilder";
+  version = "0.4.0";
+  sha256 = "0v0lpb13khpiygfdkyzzsf64anxjykwvjsrkds836whm1bv86lhl";
+  testDepends = [ hspec QuickCheck ];
+  meta = {
+    description = "A writer monad for multi-line string literals";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/stringprep/default.nix b/pkgs/development/libraries/haskell/stringprep/default.nix
new file mode 100644
index 00000000000..f1654751f75
--- /dev/null
+++ b/pkgs/development/libraries/haskell/stringprep/default.nix
@@ -0,0 +1,13 @@
+{ cabal, ranges, text, textIcu }:
+
+cabal.mkDerivation (self: {
+  pname = "stringprep";
+  version = "0.1.5";
+  sha256 = "1a25b18kd1zx06gi677g3xvsm49izhhf26z2dfljkjfykf05kqmp";
+  buildDepends = [ ranges text textIcu ];
+  meta = {
+    description = "Implements the \"StringPrep\" algorithm";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/stringsearch/default.nix b/pkgs/development/libraries/haskell/stringsearch/default.nix
index fb31ab76a2c..f8032f8cde4 100644
--- a/pkgs/development/libraries/haskell/stringsearch/default.nix
+++ b/pkgs/development/libraries/haskell/stringsearch/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "stringsearch";
-  version = "0.3.6.3";
-  sha256 = "1f0sl1zjya8glvlscf3g5i0in0ai1knls7kg9dp82grg2k287sgz";
+  version = "0.3.6.4";
+  sha256 = "16g0x0n8x3bg3mij7w3r5m3h2i2dn3bd298n14iccdwhfnlzm91b";
   meta = {
     homepage = "https://bitbucket.org/dafis/stringsearch";
     description = "Fast searching, splitting and replacing of ByteStrings";
diff --git a/pkgs/development/libraries/haskell/strptime/default.nix b/pkgs/development/libraries/haskell/strptime/default.nix
new file mode 100644
index 00000000000..c092f0c0d15
--- /dev/null
+++ b/pkgs/development/libraries/haskell/strptime/default.nix
@@ -0,0 +1,13 @@
+{ cabal, text, time }:
+
+cabal.mkDerivation (self: {
+  pname = "strptime";
+  version = "1.0.10";
+  sha256 = "1f42yf49fqr2fyjfakscmmlnmw3w5rg7wyy6gjyrf0gcgsh0h9fd";
+  buildDepends = [ text time ];
+  meta = {
+    description = "Efficient parsing of LocalTime using a binding to C's strptime, with some extra features (i.e. fractional seconds)";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/stylish-haskell/default.nix b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
new file mode 100644
index 00000000000..1d2cea756ff
--- /dev/null
+++ b/pkgs/development/libraries/haskell/stylish-haskell/default.nix
@@ -0,0 +1,24 @@
+{ cabal, aeson, cmdargs, filepath, haskellSrcExts, HUnit, mtl
+, strict, syb, testFramework, testFrameworkHunit, yaml
+}:
+
+cabal.mkDerivation (self: {
+  pname = "stylish-haskell";
+  version = "0.5.6.1";
+  sha256 = "0fxncnl9bvb7qjha3r06qli9qlzfljism6k688hrr9y6l06jdc2c";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    aeson cmdargs filepath haskellSrcExts mtl strict syb yaml
+  ];
+  testDepends = [
+    aeson cmdargs filepath haskellSrcExts HUnit mtl syb testFramework
+    testFrameworkHunit yaml
+  ];
+  meta = {
+    homepage = "https://github.com/jaspervdj/stylish-haskell";
+    description = "Haskell code prettifier";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/syb/0.3.5.nix b/pkgs/development/libraries/haskell/syb/0.4.0.nix
index b1264ecb437..7408d0ac537 100644
--- a/pkgs/development/libraries/haskell/syb/0.3.5.nix
+++ b/pkgs/development/libraries/haskell/syb/0.4.0.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, HUnit, mtl }:
 
 cabal.mkDerivation (self: {
   pname = "syb";
-  version = "0.3.5";
-  sha256 = "17gwhn0rqjf9zkx1dsmsaj41qdjlk4mq5lzpqkgy3slq30nwwwbr";
+  version = "0.4.0";
+  sha256 = "1wxz8y2dcjl407l596qswcl9cakbb5cs4wzwlyy6qjz7lyd0h0gj";
+  testDepends = [ HUnit mtl ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/SYB";
     description = "Scrap Your Boilerplate";
diff --git a/pkgs/development/libraries/haskell/syb/syb-with-class.nix b/pkgs/development/libraries/haskell/syb/syb-with-class.nix
index 10f9f226f69..c6a85e27df1 100644
--- a/pkgs/development/libraries/haskell/syb/syb-with-class.nix
+++ b/pkgs/development/libraries/haskell/syb/syb-with-class.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "syb-with-class";
-  version = "0.6.1.3";
-  sha256 = "0dmj9ah7az5lckamvm46pff0595p6v4pvzdv0lqq97gjs5i59y9d";
+  version = "0.6.1.4";
+  sha256 = "0fi6m1a4017422kdmj1vvvzbks79jkcldp20h2nb7jsf8zvimfkc";
   meta = {
     description = "Scrap Your Boilerplate With Class";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/symbol/default.nix b/pkgs/development/libraries/haskell/symbol/default.nix
index b8dd2aa69a2..e92c2ec03ad 100644
--- a/pkgs/development/libraries/haskell/symbol/default.nix
+++ b/pkgs/development/libraries/haskell/symbol/default.nix
@@ -2,9 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "symbol";
-  version = "0.1.3";
-  sha256 = "1kz4kzbv6bara31pv4vc75r6wvjln6md8gjlsxx8hf50ab8vb68j";
+  version = "0.1.4";
+  sha256 = "00318syprv1ixfbr4v7xq86z10f0psxk0b8kaxvawvacm8hp61bn";
   buildDepends = [ deepseq syb ];
+  jailbreak = true;
   meta = {
     homepage = "http://www.eecs.harvard.edu/~mainland/";
     description = "A 'Symbol' type for fast symbol comparison";
diff --git a/pkgs/development/libraries/haskell/system-fileio/default.nix b/pkgs/development/libraries/haskell/system-fileio/default.nix
index 7534ce4a1d1..f61dedb7b8c 100644
--- a/pkgs/development/libraries/haskell/system-fileio/default.nix
+++ b/pkgs/development/libraries/haskell/system-fileio/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "system-fileio";
-  version = "0.3.9";
-  sha256 = "0mfmijwnkp92s58jb51lk0p1p3418f6qskr95phc1zp40yrcw8nx";
+  version = "0.3.11";
+  sha256 = "0hnjrzhzbqx9l93c8dnl5b54f72ki584cn3jh8m6z56x2lrs24zb";
   buildDepends = [ systemFilepath text time ];
   meta = {
     homepage = "https://john-millikin.com/software/haskell-filesystem/";
diff --git a/pkgs/development/libraries/haskell/system-filepath/default.nix b/pkgs/development/libraries/haskell/system-filepath/default.nix
index d4ffbf82d2a..851b28baafe 100644
--- a/pkgs/development/libraries/haskell/system-filepath/default.nix
+++ b/pkgs/development/libraries/haskell/system-filepath/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "system-filepath";
-  version = "0.4.6";
-  sha256 = "0p8lf10b5zn2gw5klpjc397q892cydvnl677srj9rk3lhmsm5jjl";
+  version = "0.4.7";
+  sha256 = "108bmgz6rynkyabr4pws07smdh31syqvzry9cshrw3zd07c3mn89";
   buildDepends = [ deepseq text ];
   meta = {
     homepage = "https://john-millikin.com/software/haskell-filesystem/";
diff --git a/pkgs/development/libraries/haskell/tabular/default.nix b/pkgs/development/libraries/haskell/tabular/default.nix
index ddfc4aac7d6..32ede2f660b 100644
--- a/pkgs/development/libraries/haskell/tabular/default.nix
+++ b/pkgs/development/libraries/haskell/tabular/default.nix
@@ -2,11 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "tabular";
-  version = "0.2.2.3";
-  sha256 = "cf6d9f1928ec6981edcbb06c4dcbaea7a96deef5272192ad4290caa18711ea76";
+  version = "0.2.2.4";
+  sha256 = "103fqbypsgykv6z29jp1s75pd99vra9sfa70krcnlhbk9kbvdyjk";
   buildDepends = [ csv html mtl ];
   meta = {
-    homepage = "http://patch-tag.com/r/kowey/tabular";
+    homepage = "http://hub.darcs.net/kowey/tabular";
     description = "Two-dimensional data tables with rendering functions";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/tagged/default.nix b/pkgs/development/libraries/haskell/tagged/default.nix
index dde949686bd..42f0beef125 100644
--- a/pkgs/development/libraries/haskell/tagged/default.nix
+++ b/pkgs/development/libraries/haskell/tagged/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "tagged";
-  version = "0.4.2.1";
-  sha256 = "0acd0wyyl6nx8i6r5h6smb7apmnmic6kn7ks9pc8nfmhlzhgfk57";
+  version = "0.6";
+  sha256 = "0w2sx6lys074y5ck2ll53dmak39pfnckbh6llgmicrj4zhgcd8jm";
   meta = {
     homepage = "http://github.com/ekmett/tagged";
     description = "Haskell 98 phantom types to avoid unsafely passing dummy arguments";
diff --git a/pkgs/development/libraries/haskell/tagsoup/0.10.1nix b/pkgs/development/libraries/haskell/tagsoup/0.10.1nix
deleted file mode 100644
index 462ee658fd2..00000000000
--- a/pkgs/development/libraries/haskell/tagsoup/0.10.1nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ cabal, mtl, network }:
-
-cabal.mkDerivation (self: {
-  pname = "tagsoup";
-  version = "0.10.1";
-  sha256 = "0bssfj5r790yj33q23i0lbj83xahzd9rf4jhqs21vgrpn9fqsynl";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [ mtl network ];
-  meta = {
-    homepage = "http://community.haskell.org/~ndm/tagsoup/";
-    description = "Parsing and extracting information from (possibly malformed) HTML/XML documents";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-  };
-})
diff --git a/pkgs/development/libraries/haskell/tagsoup/default.nix b/pkgs/development/libraries/haskell/tagsoup/default.nix
index 78f52a3ad32..3258267f012 100644
--- a/pkgs/development/libraries/haskell/tagsoup/default.nix
+++ b/pkgs/development/libraries/haskell/tagsoup/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "tagsoup";
-  version = "0.12.7";
-  sha256 = "0f4f0552n9qkycvh01jyk52190nk4frlp9za8vyczayrm3vmw268";
+  version = "0.12.8";
+  sha256 = "05cm9h80qmxvk7xhlgly9zcmpbsajagspaa8p6k4ddch6q9lj7m3";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ text ];
diff --git a/pkgs/development/libraries/haskell/tagstream-conduit/default.nix b/pkgs/development/libraries/haskell/tagstream-conduit/default.nix
new file mode 100644
index 00000000000..1b290bd310b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/tagstream-conduit/default.nix
@@ -0,0 +1,21 @@
+{ cabal, attoparsec, attoparsecConduit, blazeBuilder
+, blazeBuilderConduit, caseInsensitive, conduit, hspec, HUnit
+, QuickCheck, text, transformers
+}:
+
+cabal.mkDerivation (self: {
+  pname = "tagstream-conduit";
+  version = "0.5.4";
+  sha256 = "1djf66kn3m4sdwmis82f9w2nkmjyrq12zda7ic9pcsvra579868i";
+  buildDepends = [
+    attoparsec attoparsecConduit blazeBuilder blazeBuilderConduit
+    caseInsensitive conduit text transformers
+  ];
+  testDepends = [ conduit hspec HUnit QuickCheck text ];
+  meta = {
+    homepage = "http://github.com/yihuang/tagstream-conduit";
+    description = "streamlined html tag parser";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/tar/0.3.2.0.nix b/pkgs/development/libraries/haskell/tar/default.nix
index 15bb647b542..04257960a64 100644
--- a/pkgs/development/tools/haskell/tar/0.3.2.0.nix
+++ b/pkgs/development/libraries/haskell/tar/default.nix
@@ -1,10 +1,10 @@
-{ cabal, filepath }:
+{ cabal, filepath, time }:
 
 cabal.mkDerivation (self: {
   pname = "tar";
-  version = "0.3.2.0";
-  sha256 = "0yplrfai8bwihyn18whi0jiz1qzll9hgbc37xcy2jkr28480jba9";
-  buildDepends = [ filepath ];
+  version = "0.4.0.1";
+  sha256 = "0vbsv7h3zgp30mlgsw156jkv1rqy5zbm98as9haf7x15hd6jf254";
+  buildDepends = [ filepath time ];
   meta = {
     description = "Reading, writing and manipulating \".tar\" archive files.";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/temporary/default.nix b/pkgs/development/libraries/haskell/temporary/default.nix
index 99ce29b1991..df93cae198a 100644
--- a/pkgs/development/libraries/haskell/temporary/default.nix
+++ b/pkgs/development/libraries/haskell/temporary/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "temporary";
-  version = "1.1.2.3";
-  sha256 = "1x4jljggbcdq90h578yyvc8z1i9zmlhvqfz2dym8kj8pq4qiwixd";
+  version = "1.1.2.4";
+  sha256 = "1j8kc22rz2wqg90n5wcxb06ylqv3lnz764077kvwhrw7mhmbp7jz";
   buildDepends = [ filepath ];
   meta = {
     homepage = "http://www.github.com/batterseapower/temporary";
diff --git a/pkgs/development/libraries/haskell/terminal-progress-bar/default.nix b/pkgs/development/libraries/haskell/terminal-progress-bar/default.nix
new file mode 100644
index 00000000000..d5e16e43d3a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/terminal-progress-bar/default.nix
@@ -0,0 +1,19 @@
+{ cabal, baseUnicodeSymbols, HUnit, testFramework
+, testFrameworkHunit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "terminal-progress-bar";
+  version = "0.0.1.3";
+  sha256 = "04glnz72ivnaqfhyxb5sc175yxiq7lf7xi1jhbk9gi95md00f1js";
+  buildDepends = [ baseUnicodeSymbols ];
+  testDepends = [
+    baseUnicodeSymbols HUnit testFramework testFrameworkHunit
+  ];
+  meta = {
+    homepage = "https://github.com/roelvandijk/terminal-progress-bar";
+    description = "A simple progress bar in the terminal";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/test-framework-hunit/default.nix b/pkgs/development/libraries/haskell/test-framework-hunit/default.nix
index 42e2e448529..011d791643c 100644
--- a/pkgs/development/libraries/haskell/test-framework-hunit/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-hunit/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework-hunit";
-  version = "0.2.7";
-  sha256 = "1c7424i5vnggzncwiwqqwq7ir7kaijif2waqmss5pn6db3gj33fc";
+  version = "0.3.0";
+  sha256 = "1jwbpbf9q3g936gk71632h830l2wsiic8h6ms1jlmw209mpm7c84";
   buildDepends = [ extensibleExceptions HUnit testFramework ];
   meta = {
     homepage = "http://batterseapower.github.com/test-framework/";
diff --git a/pkgs/development/libraries/haskell/test-framework-quickcheck/default.nix b/pkgs/development/libraries/haskell/test-framework-quickcheck/default.nix
index d71e2a034d0..cabc0fe1d0a 100644
--- a/pkgs/development/libraries/haskell/test-framework-quickcheck/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-quickcheck/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework-quickcheck";
-  version = "0.2.8.1";
-  sha256 = "042vdq18mqw4rhsj3x51mz1iv9zbxvlz7jg6r9cni2xpw5m7v6dk";
+  version = "0.3.0";
+  sha256 = "0g8sh3x3mhns03svccgbdbw8crzpzmahp1hr1fs6ag66fqr8p9mv";
   buildDepends = [
     deepseq extensibleExceptions QuickCheck random testFramework
   ];
diff --git a/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix b/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
index 1f1a45d4245..b944c1e104c 100644
--- a/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-quickcheck2/default.nix
@@ -2,11 +2,12 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework-quickcheck2";
-  version = "0.2.12.2";
-  sha256 = "08m8y78qy23imcwyqdqla7syxdf91iqrb0j8g6g7gwsg5asjq6ip";
+  version = "0.3.0.1";
+  sha256 = "1177cvlb4qsa5x2k12dd60y7b14dyd3jr1ygb49aackhjx52c41s";
   buildDepends = [
     extensibleExceptions QuickCheck random testFramework
   ];
+  jailbreak = true;
   meta = {
     homepage = "http://batterseapower.github.com/test-framework/";
     description = "QuickCheck2 support for the test-framework package";
diff --git a/pkgs/development/libraries/haskell/test-framework-th-prime/default.nix b/pkgs/development/libraries/haskell/test-framework-th-prime/default.nix
new file mode 100644
index 00000000000..ebcd608eb6a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/test-framework-th-prime/default.nix
@@ -0,0 +1,13 @@
+{ cabal, cpphs, haskellSrcExts, testFramework }:
+
+cabal.mkDerivation (self: {
+  pname = "test-framework-th-prime";
+  version = "0.0.5";
+  sha256 = "0lsxnbckh88cq38azml86szdcvx3rhs3is13ib4z0ryfqnv4hhpl";
+  buildDepends = [ cpphs haskellSrcExts testFramework ];
+  meta = {
+    description = "Template Haskell for test framework";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/test-framework-th/default.nix b/pkgs/development/libraries/haskell/test-framework-th/default.nix
index 64164c7f161..f70e522a2ce 100644
--- a/pkgs/development/libraries/haskell/test-framework-th/default.nix
+++ b/pkgs/development/libraries/haskell/test-framework-th/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework-th";
-  version = "0.2.2";
-  sha256 = "0nzfvxr5bnxinx41a5w5mwhyxzz2936dl0xhd80cv9plx19ylh0w";
+  version = "0.2.4";
+  sha256 = "12lw7yj02jb9s0i7rb98jjam43j2h0gzmnbj9zi933fx7sg0sy4b";
   buildDepends = [
     haskellSrcExts languageHaskellExtract regexPosix testFramework
   ];
diff --git a/pkgs/development/libraries/haskell/test-framework/0.5.nix b/pkgs/development/libraries/haskell/test-framework/0.5.nix
deleted file mode 100644
index d69bd131774..00000000000
--- a/pkgs/development/libraries/haskell/test-framework/0.5.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ cabal, ansiTerminal, ansiWlPprint, extensibleExceptions, hostname
-, random, regexPosix, time, xml
-}:
-
-cabal.mkDerivation (self: {
-  pname = "test-framework";
-  version = "0.5";
-  sha256 = "19zm9xdhyjhqi2ryd2gkwi7m92s88mmiw1b6b91hjfhfw3c1qlzz";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [
-    ansiTerminal ansiWlPprint extensibleExceptions hostname random
-    regexPosix time xml
-  ];
-  meta = {
-    homepage = "http://batterseapower.github.com/test-framework/";
-    description = "Framework for running and organising tests, with HUnit and QuickCheck support";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/test-framework/0.6.nix b/pkgs/development/libraries/haskell/test-framework/default.nix
index 94054894568..b9f335e1a5a 100644
--- a/pkgs/development/libraries/haskell/test-framework/0.6.nix
+++ b/pkgs/development/libraries/haskell/test-framework/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "test-framework";
-  version = "0.6";
-  sha256 = "1ah5q3fwd5dmh2zb4rphdpz7hs39m4g1khvxjjwfzwyd9pxiz723";
+  version = "0.8";
+  sha256 = "1w895nq357zpc4v6vr5nbszyrw7cpsjq5bj38vdd10bfpjjmijcl";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/libraries/haskell/testpack/default.nix b/pkgs/development/libraries/haskell/testpack/default.nix
deleted file mode 100644
index a308594060f..00000000000
--- a/pkgs/development/libraries/haskell/testpack/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ cabal, HUnit, mtl, QuickCheck, random }:
-
-cabal.mkDerivation (self: {
-  pname = "testpack";
-  version = "2.1.2";
-  sha256 = "12dhl8svy0wmdwlvkp0p0j6wr6vgv4hrjcpdv48kc5rcwjvh8xif";
-  buildDepends = [ HUnit mtl QuickCheck random ];
-  meta = {
-    homepage = "http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack";
-    description = "Test Utililty Pack for HUnit and QuickCheck";
-    license = "LGPL";
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/texmath/0.4.nix b/pkgs/development/libraries/haskell/texmath/0.4.nix
deleted file mode 100644
index 9d9a4f07586..00000000000
--- a/pkgs/development/libraries/haskell/texmath/0.4.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ cabal, parsec, syb, xml }:
-
-cabal.mkDerivation (self: {
-  pname = "texmath";
-  version = "0.4";
-  sha256 = "1rvnhqljxkljy8ncpaj8p7b14nvvm6zmiixv13m1zxlcr457j2ai";
-  isLibrary = true;
-  isExecutable = true;
-  buildDepends = [ parsec syb xml ];
-  meta = {
-    homepage = "http://github.com/jgm/texmath";
-    description = "Conversion of LaTeX math formulas to MathML";
-    license = "GPL";
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/texmath/default.nix b/pkgs/development/libraries/haskell/texmath/default.nix
index 6820b2ed247..8082e77d282 100644
--- a/pkgs/development/libraries/haskell/texmath/default.nix
+++ b/pkgs/development/libraries/haskell/texmath/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "texmath";
-  version = "0.6.0.6";
-  sha256 = "0wxpz9vsgi4lfgjz5w96pn2r2jdflkvb4yd06nxshimxdr51974k";
+  version = "0.6.1.5";
+  sha256 = "15cxki04khq29m9h5wxzxgppc3r58ccp2hgsslp2g1f59x2wm348";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ parsec syb xml ];
diff --git a/pkgs/development/libraries/haskell/text-icu/default.nix b/pkgs/development/libraries/haskell/text-icu/default.nix
new file mode 100644
index 00000000000..16115809f5b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/text-icu/default.nix
@@ -0,0 +1,15 @@
+{ cabal, icu, text }:
+
+cabal.mkDerivation (self: {
+  pname = "text-icu";
+  version = "0.6.3.5";
+  sha256 = "1blfw9377yl732ypbjhkvi3vfg6c1f1rkxcsvwmqyhkdzb2agg0a";
+  buildDepends = [ text ];
+  extraLibraries = [ icu ];
+  meta = {
+    homepage = "https://bitbucket.org/bos/text-icu";
+    description = "Bindings to the ICU library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/text/0.11.0.5.nix b/pkgs/development/libraries/haskell/text/0.11.0.5.nix
index 0b415d28aea..59644d05720 100644
--- a/pkgs/development/libraries/haskell/text/0.11.0.5.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.0.5.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.11.0.5";
   sha256 = "1a5y2i7qrkyyvm112q44rhd7jbqxvfxssz2g5ngbx11yypl3hcdv";
   buildDepends = [ deepseq ];
+  doCheck = false;
   meta = {
     homepage = "http://bitbucket.org/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.0.6.nix b/pkgs/development/libraries/haskell/text/0.11.0.6.nix
index 354621fd5cd..04fd250dfe9 100644
--- a/pkgs/development/libraries/haskell/text/0.11.0.6.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.0.6.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.11.0.6";
   sha256 = "103l1c8jfwpddsqzwj9jqh89vay8ax1znxqgjqprv2fvr7s0zvkp";
   buildDepends = [ deepseq ];
+  doCheck = false;
   meta = {
     homepage = "http://bitbucket.org/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.1.13.nix b/pkgs/development/libraries/haskell/text/0.11.1.13.nix
index edf109a79cf..71d0c28e48d 100644
--- a/pkgs/development/libraries/haskell/text/0.11.1.13.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.1.13.nix
@@ -1,10 +1,17 @@
-{ cabal, deepseq }:
+{ cabal, deepseq, HUnit, QuickCheck, random, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "text";
   version = "0.11.1.13";
   sha256 = "0lbc4yfqpydps0rd1qjymnnhp87sl9w7n1f5vd5lsixby93zjv2f";
   buildDepends = [ deepseq ];
+  testDepends = [
+    deepseq HUnit QuickCheck random testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.1.5.nix b/pkgs/development/libraries/haskell/text/0.11.1.5.nix
index 3f4132a87a2..03c2d90ff8d 100644
--- a/pkgs/development/libraries/haskell/text/0.11.1.5.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.1.5.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.11.1.5";
   sha256 = "0fxxhw932gdvaqafsbw7dfzccc43hv92yhxppzp6jrg0npbyz04l";
   buildDepends = [ deepseq ];
+  doCheck = false;
   meta = {
     homepage = "https://bitbucket.org/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.2.0.nix b/pkgs/development/libraries/haskell/text/0.11.2.0.nix
index 213464f3f19..ab784807bfa 100644
--- a/pkgs/development/libraries/haskell/text/0.11.2.0.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.2.0.nix
@@ -1,10 +1,17 @@
-{ cabal, deepseq }:
+{ cabal, deepseq, HUnit, QuickCheck, random, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "text";
   version = "0.11.2.0";
   sha256 = "1fx5302m41awzbms410x3gcixsck36rl7i1ma7pz6l5d1pmi538p";
   buildDepends = [ deepseq ];
+  testDepends = [
+    deepseq HUnit QuickCheck random testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.2.3.nix b/pkgs/development/libraries/haskell/text/0.11.2.3.nix
index e1f0c6ea72d..afa0e7eb5d3 100644
--- a/pkgs/development/libraries/haskell/text/0.11.2.3.nix
+++ b/pkgs/development/libraries/haskell/text/0.11.2.3.nix
@@ -1,10 +1,17 @@
-{ cabal, deepseq }:
+{ cabal, deepseq, HUnit, QuickCheck, random, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "text";
   version = "0.11.2.3";
   sha256 = "0jrl3qbi91gkcnws9crsa59jsmmbjy91fwvl07qka9m48nq3f9rm";
   buildDepends = [ deepseq ];
+  testDepends = [
+    deepseq HUnit QuickCheck random testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/bos/text";
     description = "An efficient packed Unicode text type";
diff --git a/pkgs/development/libraries/haskell/text/0.11.3.1.nix b/pkgs/development/libraries/haskell/text/0.11.3.1.nix
new file mode 100644
index 00000000000..6bbab990b8a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/text/0.11.3.1.nix
@@ -0,0 +1,22 @@
+{ cabal, deepseq, HUnit, QuickCheck, random, testFramework
+, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "text";
+  version = "0.11.3.1";
+  sha256 = "17smd4h8xiqlggwd3n4j2dszfqsjpjjbjgk9badhkmya8ykd9akn";
+  buildDepends = [ deepseq ];
+  testDepends = [
+    deepseq HUnit QuickCheck random testFramework testFrameworkHunit
+    testFrameworkQuickcheck2
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/bos/text";
+    description = "An efficient packed Unicode text type";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/th-extras/default.nix b/pkgs/development/libraries/haskell/th-extras/default.nix
index be78bbaef31..3475ccb804a 100644
--- a/pkgs/development/libraries/haskell/th-extras/default.nix
+++ b/pkgs/development/libraries/haskell/th-extras/default.nix
@@ -2,12 +2,12 @@
 
 cabal.mkDerivation (self: {
   pname = "th-extras";
-  version = "0.0.0.1";
-  sha256 = "13d9fs48z87inma3kg9b7lfjp3h8j85fav6awd1zj3i2nl214hff";
+  version = "0.0.0.2";
+  sha256 = "15sqf2jjnqcssq8hp80fk0ysgwqykjjc31gvvmzg4sypskpjs8cl";
   buildDepends = [ syb ];
   meta = {
     homepage = "https://github.com/mokus0/th-extras";
-    description = "A grab bag of useful functions for use with Template Haskell";
+    description = "A grab bag of functions for use with Template Haskell";
     license = self.stdenv.lib.licenses.publicDomain;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/th-orphans/default.nix b/pkgs/development/libraries/haskell/th-orphans/default.nix
new file mode 100644
index 00000000000..da14adfe339
--- /dev/null
+++ b/pkgs/development/libraries/haskell/th-orphans/default.nix
@@ -0,0 +1,14 @@
+{ cabal, thLift }:
+
+cabal.mkDerivation (self: {
+  pname = "th-orphans";
+  version = "0.6";
+  sha256 = "1ablf4c8vp9kzvr75ngl5yz3ip5klk6zmq7bcqcvks758b9c6qgj";
+  buildDepends = [ thLift ];
+  noHaddock = true;
+  meta = {
+    description = "Orphan instances for TH datatypes";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/threads/default.nix b/pkgs/development/libraries/haskell/threads/default.nix
new file mode 100644
index 00000000000..d802790da9d
--- /dev/null
+++ b/pkgs/development/libraries/haskell/threads/default.nix
@@ -0,0 +1,21 @@
+{ cabal, baseUnicodeSymbols, concurrentExtra, HUnit, stm
+, testFramework, testFrameworkHunit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "threads";
+  version = "0.5.0.2";
+  sha256 = "14ccmjg56429a3mzx11ccv18bvkqg56ph9kbpmhdx2ajar80g6jm";
+  buildDepends = [ baseUnicodeSymbols stm ];
+  testDepends = [
+    baseUnicodeSymbols concurrentExtra HUnit stm testFramework
+    testFrameworkHunit
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/basvandijk/threads";
+    description = "Fork threads and wait for their result";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/time-compat/default.nix b/pkgs/development/libraries/haskell/time-compat/default.nix
new file mode 100644
index 00000000000..fa7c3ff4185
--- /dev/null
+++ b/pkgs/development/libraries/haskell/time-compat/default.nix
@@ -0,0 +1,14 @@
+{ cabal, time }:
+
+cabal.mkDerivation (self: {
+  pname = "time-compat";
+  version = "0.1.0.3";
+  sha256 = "0zqgzr8yjn36rn6gflwh5s0c92vl44xzxiw0jz8d5h0h8lhi21sr";
+  buildDepends = [ time ];
+  meta = {
+    homepage = "http://hub.darcs.net/dag/time-compat";
+    description = "Compatibility with old-time for the time package";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/time/1.1.3.nix b/pkgs/development/libraries/haskell/time/1.1.3.nix
deleted file mode 100644
index 55c52e8a73c..00000000000
--- a/pkgs/development/libraries/haskell/time/1.1.3.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal }:
-
-cabal.mkDerivation (self: {
-  pname = "time";
-  version = "1.1.3";
-  sha256 = "46d32400bc0099ccef1fb670684c00a31055725403ea15c7a39278ff7dccc65b";
-  meta = {
-    homepage = "http://semantic.org/TimeLib/";
-    description = "A time library";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/time/1.2.0.3.nix b/pkgs/development/libraries/haskell/time/1.2.0.3.nix
deleted file mode 100644
index 23c07f9dd23..00000000000
--- a/pkgs/development/libraries/haskell/time/1.2.0.3.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal }:
-
-cabal.mkDerivation (self: {
-  pname = "time";
-  version = "1.2.0.3";
-  sha256 = "acb1e3cf2b98a73632d35b0665808b05df6c03fcefd62796fe291f5b2ef4348e";
-  meta = {
-    homepage = "http://semantic.org/TimeLib/";
-    description = "A time library";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/time/1.4.0.1.nix b/pkgs/development/libraries/haskell/time/1.4.0.2.nix
index 107c7cee037..62232d1aa5a 100644
--- a/pkgs/development/libraries/haskell/time/1.4.0.1.nix
+++ b/pkgs/development/libraries/haskell/time/1.4.0.2.nix
@@ -1,10 +1,15 @@
-{ cabal, deepseq }:
+{ cabal, Cabal, deepseq, QuickCheck, testFramework
+, testFrameworkQuickcheck2
+}:
 
 cabal.mkDerivation (self: {
   pname = "time";
-  version = "1.4.0.1";
-  sha256 = "046jyz2xnbg2s94d9xhpphgq93mqlky7bc50vss40wdk6l7w8aws";
+  version = "1.4.0.2";
+  sha256 = "0p4ncankr9968lp4fnbq6pc5xwv2198gxhbds656da9jbv74w7j8";
   buildDepends = [ deepseq ];
+  testDepends = [
+    Cabal deepseq QuickCheck testFramework testFrameworkQuickcheck2
+  ];
   meta = {
     homepage = "http://semantic.org/TimeLib/";
     description = "A time library";
diff --git a/pkgs/development/libraries/haskell/tls-extra/default.nix b/pkgs/development/libraries/haskell/tls-extra/default.nix
index 349c4e05754..b53b948c41d 100644
--- a/pkgs/development/libraries/haskell/tls-extra/default.nix
+++ b/pkgs/development/libraries/haskell/tls-extra/default.nix
@@ -1,19 +1,20 @@
-{ cabal, certificate, cryptoApi, cryptocipher, cryptohash, mtl
-, network, pem, text, time, tls, vector
+{ cabal, certificate, cipherAes, cipherRc4, cryptohash
+, cryptoPubkey, cryptoRandomApi, mtl, network, pem, text, time, tls
+, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "tls-extra";
-  version = "0.4.6";
-  sha256 = "1xl55i4nr7kyc3qxi8zmq18m0xhlwlrx9fwkck22krshqgq2i6nn";
+  version = "0.6.4";
+  sha256 = "058ia1cabs7ribz287iqkkjvqpp2n7c219f3xc92fhm0qq00mh5n";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
-    certificate cryptoApi cryptocipher cryptohash mtl network pem text
-    time tls vector
+    certificate cipherAes cipherRc4 cryptohash cryptoPubkey
+    cryptoRandomApi mtl network pem text time tls vector
   ];
   meta = {
-    homepage = "http://github.com/vincenthz/hs-tls-extra";
+    homepage = "http://github.com/vincenthz/hs-tls";
     description = "TLS extra default values and helpers";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/tls/default.nix b/pkgs/development/libraries/haskell/tls/default.nix
index d440d942277..72e0976ceaf 100644
--- a/pkgs/development/libraries/haskell/tls/default.nix
+++ b/pkgs/development/libraries/haskell/tls/default.nix
@@ -1,16 +1,21 @@
-{ cabal, cereal, certificate, cryptoApi, cryptocipher, cryptohash
-, mtl
+{ cabal, cereal, certificate, cprngAes, cryptohash, cryptoPubkey
+, cryptoRandomApi, mtl, network, QuickCheck, testFramework
+, testFrameworkQuickcheck2, time
 }:
 
 cabal.mkDerivation (self: {
   pname = "tls";
-  version = "0.9.9";
-  sha256 = "0l29ja7mcyykj4dh7awjbrb9aswgarxls71vk68pdfaz047jsvx6";
-  isLibrary = true;
-  isExecutable = true;
+  version = "1.1.2";
+  sha256 = "1vg1mnz6cxxgs48pbpjp4hwyvsysxyzvjfy4p1vd23lwc32cdjqg";
   buildDepends = [
-    cereal certificate cryptoApi cryptocipher cryptohash mtl
+    cereal certificate cryptohash cryptoPubkey cryptoRandomApi mtl
+    network
   ];
+  testDepends = [
+    cereal certificate cprngAes cryptoPubkey cryptoRandomApi mtl
+    QuickCheck testFramework testFrameworkQuickcheck2 time
+  ];
+  doCheck = false;
   meta = {
     homepage = "http://github.com/vincenthz/hs-tls";
     description = "TLS/SSL protocol native implementation (Server and Client)";
diff --git a/pkgs/development/libraries/haskell/transformers-compat/default.nix b/pkgs/development/libraries/haskell/transformers-compat/default.nix
new file mode 100644
index 00000000000..f3120a61f20
--- /dev/null
+++ b/pkgs/development/libraries/haskell/transformers-compat/default.nix
@@ -0,0 +1,15 @@
+{ cabal, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "transformers-compat";
+  version = "0.1.1.1";
+  sha256 = "0i0bcfmqsnqa8fyp81virr5bh3hk23261xyx28jcfamrc18ly9ij";
+  buildDepends = [ transformers ];
+  noHaddock = true;
+  meta = {
+    homepage = "http://github.com/ekmett/transformers-compat/";
+    description = "A small compatibility shim exposing the new types from transformers 0.3 to older Haskell platforms.";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/type-equality/default.nix b/pkgs/development/libraries/haskell/type-equality/default.nix
index 66b8b1974ff..ee90387b637 100644
--- a/pkgs/development/libraries/haskell/type-equality/default.nix
+++ b/pkgs/development/libraries/haskell/type-equality/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "type-equality";
-  version = "0.1.0.2";
-  sha256 = "09m6vc5hglf3xdg0bg9lgbkgjffmbkfgcrqf5ii36l92c4dik32q";
+  version = "0.1.2";
+  sha256 = "06acqpkvyvalv5knjzzbgm40hzas6cdfsypvjxsbb0mhq4d80xwr";
   meta = {
     homepage = "http://github.com/hesselink/type-equality/";
     description = "Type equality, coercion/cast and other operations";
diff --git a/pkgs/development/libraries/haskell/type-level-natural-number/default.nix b/pkgs/development/libraries/haskell/type-level-natural-number/default.nix
new file mode 100644
index 00000000000..8dff0ffd58f
--- /dev/null
+++ b/pkgs/development/libraries/haskell/type-level-natural-number/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "type-level-natural-number";
+  version = "1.1.1";
+  sha256 = "1zc26nckpcixxp1m818jhzi3dj1ysnjfc2xliq4rpmf5583k6mjw";
+  meta = {
+    description = "Simple, Haskell 2010-compatible type level natural numbers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/unbounded-delays/default.nix b/pkgs/development/libraries/haskell/unbounded-delays/default.nix
new file mode 100644
index 00000000000..ccccf9d95d3
--- /dev/null
+++ b/pkgs/development/libraries/haskell/unbounded-delays/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "unbounded-delays";
+  version = "0.1.0.5";
+  sha256 = "109swgxlv3ywf5g0wgm3gp2y7azd6mqf2lfb9sk21dfzcz28aq4k";
+  meta = {
+    homepage = "https://github.com/basvandijk/unbounded-delays";
+    description = "Unbounded thread delays and timeouts";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/uniplate/default.nix b/pkgs/development/libraries/haskell/uniplate/default.nix
index 909b7f7659e..8519ff451b2 100644
--- a/pkgs/development/libraries/haskell/uniplate/default.nix
+++ b/pkgs/development/libraries/haskell/uniplate/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uniplate";
-  version = "1.6.7";
-  sha256 = "1f71dinmp3vmx9j0a1sxm0f8gzxknsvhnyb8sxfjrvpvixzyg0dx";
+  version = "1.6.10";
+  sha256 = "0j0hsvlkml8v9f8iijcgq58qnxnmk7gzxcnl9rxx4fdr9fnaffj3";
   buildDepends = [ hashable syb unorderedContainers ];
   meta = {
     homepage = "http://community.haskell.org/~ndm/uniplate/";
diff --git a/pkgs/development/libraries/haskell/unix-compat/default.nix b/pkgs/development/libraries/haskell/unix-compat/default.nix
index 85e6bb81533..9742b193e7b 100644
--- a/pkgs/development/libraries/haskell/unix-compat/default.nix
+++ b/pkgs/development/libraries/haskell/unix-compat/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "unix-compat";
-  version = "0.3.0.1";
-  sha256 = "09y2iih741l4jpi83c15zap94phfms4mavzg04r9rjgbav0ns2c4";
+  version = "0.4.1.1";
+  sha256 = "1cjny6zca5wdj7d56kjkaxlad85kknn91pisrizjy6wngszyaigf";
   meta = {
     homepage = "http://github.com/jystic/unix-compat";
     description = "Portable POSIX-compatibility layer";
diff --git a/pkgs/development/libraries/haskell/unix-process-conduit/default.nix b/pkgs/development/libraries/haskell/unix-process-conduit/default.nix
new file mode 100644
index 00000000000..6ee4304ac17
--- /dev/null
+++ b/pkgs/development/libraries/haskell/unix-process-conduit/default.nix
@@ -0,0 +1,15 @@
+{ cabal, conduit, hspec, transformers }:
+
+cabal.mkDerivation (self: {
+  pname = "unix-process-conduit";
+  version = "0.2.0.2";
+  sha256 = "1n9ja7dlxhsxyglfzk397xdgvdny766y1isrb5d065srxprsj2g6";
+  buildDepends = [ conduit transformers ];
+  testDepends = [ conduit hspec transformers ];
+  meta = {
+    homepage = "https://github.com/snoyberg/conduit";
+    description = "Run processes on Unix systems, with a conduit interface";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/unix-time/default.nix b/pkgs/development/libraries/haskell/unix-time/default.nix
index 61d8f86189d..22d3af28fd0 100644
--- a/pkgs/development/libraries/haskell/unix-time/default.nix
+++ b/pkgs/development/libraries/haskell/unix-time/default.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, doctest, hspec, QuickCheck, time }:
 
 cabal.mkDerivation (self: {
   pname = "unix-time";
-  version = "0.1.2";
-  sha256 = "146m4b93bla0pbf76bmff6f3aq9zx60cwy58mkqa0a4dyndd3pid";
+  version = "0.1.8";
+  sha256 = "1s9r2i4hl7nm1f4zya03q0a2ayliby51caziz1w79schhplfa5sv";
+  testDepends = [ doctest hspec QuickCheck time ];
   meta = {
     description = "Unix time parser/formatter and utilities";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/unlambda/default.nix b/pkgs/development/libraries/haskell/unlambda/default.nix
index c0cfc72bd9e..474bb1a8b09 100644
--- a/pkgs/development/libraries/haskell/unlambda/default.nix
+++ b/pkgs/development/libraries/haskell/unlambda/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "unlambda";
-  version = "0.1";
-  sha256 = "0xmn5w5vza6z2i3fs2hv2jgmb1lyk918viknsx3lk36i1dbyivgi";
+  version = "0.1.3";
+  sha256 = "0clcpkhg23a7ma72rjjpl2w8jpg2mdn4rgm3vf0vqr7lbyma1h89";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ mtl ];
diff --git a/pkgs/development/libraries/haskell/unordered-containers/0.2.3.0.nix b/pkgs/development/libraries/haskell/unordered-containers/0.2.3.0.nix
new file mode 100644
index 00000000000..a8f1ae922ee
--- /dev/null
+++ b/pkgs/development/libraries/haskell/unordered-containers/0.2.3.0.nix
@@ -0,0 +1,21 @@
+{ cabal, ChasingBottoms, deepseq, hashable, HUnit, QuickCheck
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "unordered-containers";
+  version = "0.2.3.0";
+  sha256 = "1vzgjr9jxdkmgq970ng9zi2j60awvx8iv1v6kzjlrkwzxx1a9dpd";
+  buildDepends = [ deepseq hashable ];
+  testDepends = [
+    ChasingBottoms hashable HUnit QuickCheck testFramework
+    testFrameworkHunit testFrameworkQuickcheck2
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/tibbe/unordered-containers";
+    description = "Efficient hashing-based container types";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/unordered-containers/0.2.3.1.nix b/pkgs/development/libraries/haskell/unordered-containers/0.2.3.1.nix
new file mode 100644
index 00000000000..af4f93c7457
--- /dev/null
+++ b/pkgs/development/libraries/haskell/unordered-containers/0.2.3.1.nix
@@ -0,0 +1,21 @@
+{ cabal, ChasingBottoms, deepseq, hashable, HUnit, QuickCheck
+, testFramework, testFrameworkHunit, testFrameworkQuickcheck2
+}:
+
+cabal.mkDerivation (self: {
+  pname = "unordered-containers";
+  version = "0.2.3.1";
+  sha256 = "10wz5y42r9b2ym7vl5sqrcawyjixmhy370h0kzpvczs8mlzvrlx8";
+  buildDepends = [ deepseq hashable ];
+  testDepends = [
+    ChasingBottoms hashable HUnit QuickCheck testFramework
+    testFrameworkHunit testFrameworkQuickcheck2
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "https://github.com/tibbe/unordered-containers";
+    description = "Efficient hashing-based container types";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/unordered-containers/default.nix b/pkgs/development/libraries/haskell/unordered-containers/default.nix
deleted file mode 100644
index e6ff0dd64b9..00000000000
--- a/pkgs/development/libraries/haskell/unordered-containers/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, deepseq, hashable }:
-
-cabal.mkDerivation (self: {
-  pname = "unordered-containers";
-  version = "0.2.2.0";
-  sha256 = "1418vr7swk2p1xjxyj86arln6niwgpfjfqdknnkh31m4h83f0q5r";
-  buildDepends = [ deepseq hashable ];
-  meta = {
-    description = "Efficient hashing-based container types";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/libraries/haskell/urlencoded/default.nix b/pkgs/development/libraries/haskell/urlencoded/default.nix
new file mode 100644
index 00000000000..05bd2ab09bb
--- /dev/null
+++ b/pkgs/development/libraries/haskell/urlencoded/default.nix
@@ -0,0 +1,16 @@
+{ cabal, mtl, network, split }:
+
+cabal.mkDerivation (self: {
+  pname = "urlencoded";
+  version = "0.4.0";
+  sha256 = "0idh70apfxx8bkbsxda4xhb0b5xf4x237dwi4v55ildrhxx4b68k";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ mtl network split ];
+  meta = {
+    homepage = "https://github.com/pheaver/urlencoded";
+    description = "Generate or process x-www-urlencoded data";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/utility-ht/default.nix b/pkgs/development/libraries/haskell/utility-ht/default.nix
index 93b4cc1480e..76ce975b11e 100644
--- a/pkgs/development/libraries/haskell/utility-ht/default.nix
+++ b/pkgs/development/libraries/haskell/utility-ht/default.nix
@@ -1,9 +1,10 @@
-{ cabal }:
+{ cabal, QuickCheck }:
 
 cabal.mkDerivation (self: {
   pname = "utility-ht";
-  version = "0.0.8";
-  sha256 = "02sm1xj5xa65hpkvl2yk89d9dlg3c2ap8qcviq9zj10asmsbzyd8";
+  version = "0.0.9";
+  sha256 = "1m5mjxwf51jd00swp1f4cimaqaral6827y1sidbq61qkw7l6ss8r";
+  testDepends = [ QuickCheck ];
   meta = {
     description = "Various small helper functions for Lists, Maybes, Tuples, Functions";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/uu-interleaved/default.nix b/pkgs/development/libraries/haskell/uu-interleaved/default.nix
new file mode 100644
index 00000000000..a71111282fa
--- /dev/null
+++ b/pkgs/development/libraries/haskell/uu-interleaved/default.nix
@@ -0,0 +1,13 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "uu-interleaved";
+  version = "0.1.0.0";
+  sha256 = "00zq89fjz3r5pj6qbci017cm9y2rsvl265y9d95q0rv6ljhsayzs";
+  meta = {
+    homepage = "http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators";
+    description = "Providing an interleaving combinator for use with applicative/alternative style implementations";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/uu-options/default.nix b/pkgs/development/libraries/haskell/uu-options/default.nix
new file mode 100644
index 00000000000..651cd9fe450
--- /dev/null
+++ b/pkgs/development/libraries/haskell/uu-options/default.nix
@@ -0,0 +1,18 @@
+{ cabal, lenses, mtl, transformers, uuInterleaved, uuParsinglib }:
+
+cabal.mkDerivation (self: {
+  pname = "uu-options";
+  version = "0.1.0.1";
+  sha256 = "0dygg4w3rlnf1pnmwq7i6vzz0v90b4g18ipfc5whn1ss1bixwxk4";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    lenses mtl transformers uuInterleaved uuParsinglib
+  ];
+  meta = {
+    homepage = "http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators";
+    description = "Parse command line options using uu-interleave and uu-parsinglib";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
index 1bb3cb76dac..8d0b0bda23d 100644
--- a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
+++ b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
@@ -1,10 +1,10 @@
-{ cabal, ListLike, time }:
+{ cabal, ListLike, time, uuInterleaved }:
 
 cabal.mkDerivation (self: {
   pname = "uu-parsinglib";
-  version = "2.7.3.4";
-  sha256 = "1f582cr17qxwrhxx6pdv503ldm4ccbnbv9pcksibgparfyc25bnv";
-  buildDepends = [ ListLike time ];
+  version = "2.8.1";
+  sha256 = "10phjwm8dm45rms2vfpx9vzm56v7b9wp0308xkfbalh5zbvxmv35";
+  buildDepends = [ ListLike time uuInterleaved ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/bin/view/HUT/ParserCombinators";
     description = "Fast, online, error-correcting, monadic, applicative, merging, permuting, idiomatic parser combinators";
diff --git a/pkgs/development/libraries/haskell/uuid/default.nix b/pkgs/development/libraries/haskell/uuid/default.nix
new file mode 100644
index 00000000000..2aa30d8823e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/uuid/default.nix
@@ -0,0 +1,20 @@
+{ cabal, binary, criterion, cryptohash, deepseq, HUnit, maccatcher
+, mersenneRandomPure64, QuickCheck, random, time
+}:
+
+cabal.mkDerivation (self: {
+  pname = "uuid";
+  version = "1.2.13";
+  sha256 = "0y9r71iqvabmvyrglw42g37skgisyknkv3pkfih2qfrfkk75zw0s";
+  buildDepends = [ binary cryptohash maccatcher random time ];
+  testDepends = [
+    criterion deepseq HUnit mersenneRandomPure64 QuickCheck random
+  ];
+  doCheck = false;
+  meta = {
+    homepage = "http://projects.haskell.org/uuid/";
+    description = "For creating, comparing, parsing and printing Universally Unique Identifiers";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/uulib/default.nix b/pkgs/development/libraries/haskell/uulib/default.nix
index 991f3808098..2521c44bec6 100644
--- a/pkgs/development/libraries/haskell/uulib/default.nix
+++ b/pkgs/development/libraries/haskell/uulib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uulib";
-  version = "0.9.14";
-  sha256 = "0bi62l9fp1ghqq4dagdy4nsxmm08gpsrnfgy6d6k8f4239s3yr0z";
+  version = "0.9.15";
+  sha256 = "0433shh493c04qmi0sd9mfzpy198zi11gxdmcs6nz2gcnxm812zm";
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/HUT/WebHome";
     description = "Haskell Utrecht Tools Library";
diff --git a/pkgs/development/libraries/haskell/vacuum/default.nix b/pkgs/development/libraries/haskell/vacuum/default.nix
index 11f74432be6..8506e580502 100644
--- a/pkgs/development/libraries/haskell/vacuum/default.nix
+++ b/pkgs/development/libraries/haskell/vacuum/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vacuum";
-  version = "2.0.0.0";
-  sha256 = "0a810ql4lp1pyvys9a5aw28gxn7h2p4hkc0by4pmpw5d7kdhn9y3";
+  version = "2.1.0.1";
+  sha256 = "0gzh5v9mr0mgz9hxjnm8n3jcl2702wad7qaqaar1zc95lkabpf65";
   extraLibraries = [ ghcPaths ];
   meta = {
     homepage = "http://thoughtpolice.github.com/vacuum";
diff --git a/pkgs/development/libraries/haskell/vault/default.nix b/pkgs/development/libraries/haskell/vault/default.nix
index 4d74884a1a7..6039e742477 100644
--- a/pkgs/development/libraries/haskell/vault/default.nix
+++ b/pkgs/development/libraries/haskell/vault/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vault";
-  version = "0.2.0.1";
-  sha256 = "027wgbnmdnp98f0wvc9xsfh175n7rq8m2j9i7j1c5vxwgi61dqxq";
+  version = "0.2.0.4";
+  sha256 = "1a63rarksp4waj64b9kv8q77wbhdnsnxahkixl1klp25hkp8aan3";
   buildDepends = [ hashable unorderedContainers ];
   meta = {
     homepage = "https://github.com/HeinrichApfelmus/vault";
diff --git a/pkgs/development/libraries/haskell/vcs-revision/default.nix b/pkgs/development/libraries/haskell/vcs-revision/default.nix
new file mode 100644
index 00000000000..a1cd2783931
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vcs-revision/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "vcs-revision";
+  version = "0.0.1";
+  sha256 = "1zfv9b02ml8622kz755azhi4ajyxrqniiachd92znfrry4n8z1mn";
+  meta = {
+    description = "Facilities for accessing the version control revision of the current directory";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vect/default.nix b/pkgs/development/libraries/haskell/vect/default.nix
new file mode 100644
index 00000000000..2d81a013176
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vect/default.nix
@@ -0,0 +1,14 @@
+{ cabal, random }:
+
+cabal.mkDerivation (self: {
+  pname = "vect";
+  version = "0.4.7";
+  sha256 = "1049jh8rcxfnyckz5m5asdlyafqszlig96k387raldyfzbrf8f4d";
+  buildDepends = [ random ];
+  meta = {
+    homepage = "http://code.haskell.org/~bkomuves/";
+    description = "A low-dimensional linear algebra library, tailored to computer graphics";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vector-algorithms/default.nix b/pkgs/development/libraries/haskell/vector-algorithms/default.nix
index 2704942b360..dc8c9dd35ba 100644
--- a/pkgs/development/libraries/haskell/vector-algorithms/default.nix
+++ b/pkgs/development/libraries/haskell/vector-algorithms/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "vector-algorithms";
-  version = "0.5.4.1";
-  sha256 = "00dikjmy1pyyn3mmq7sjnmd91xcg7q3n3yiil3dqi1fgr0787xng";
+  version = "0.5.4.2";
+  sha256 = "08pb6mkghf9h5011vxrfdrfq6g26jk4gxmjh9s3hpdiwybf3ab64";
   buildDepends = [ primitive vector ];
   meta = {
     homepage = "http://code.haskell.org/~dolio/";
diff --git a/pkgs/development/libraries/haskell/vector-binary-instances/default.nix b/pkgs/development/libraries/haskell/vector-binary-instances/default.nix
new file mode 100644
index 00000000000..62d1c0506ed
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vector-binary-instances/default.nix
@@ -0,0 +1,14 @@
+{ cabal, binary, cereal, vector }:
+
+cabal.mkDerivation (self: {
+  pname = "vector-binary-instances";
+  version = "0.2.1.0";
+  sha256 = "028rsf2w193rhs1gic5yvvrwidw9sblczcn10aw64npfc6502l4l";
+  buildDepends = [ binary cereal vector ];
+  meta = {
+    homepage = "https://github.com/bos/vector-binary-instances";
+    description = "Instances of Data.Binary and Data.Serialize for vector";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vector-space-points/default.nix b/pkgs/development/libraries/haskell/vector-space-points/default.nix
new file mode 100644
index 00000000000..2a5c1eb2fc4
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vector-space-points/default.nix
@@ -0,0 +1,13 @@
+{ cabal, newtype, vectorSpace }:
+
+cabal.mkDerivation (self: {
+  pname = "vector-space-points";
+  version = "0.1.2.1";
+  sha256 = "0prbmk48xdr2gbxqpv0g89xz5v3k9wps9v2gymkh32jag2lgzi66";
+  buildDepends = [ newtype vectorSpace ];
+  meta = {
+    description = "A type for points, as distinct from vectors";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vector-space/default.nix b/pkgs/development/libraries/haskell/vector-space/default.nix
index 2957959f005..c6d440a5d47 100644
--- a/pkgs/development/libraries/haskell/vector-space/default.nix
+++ b/pkgs/development/libraries/haskell/vector-space/default.nix
@@ -2,11 +2,10 @@
 
 cabal.mkDerivation (self: {
   pname = "vector-space";
-  version = "0.8.2";
-  sha256 = "09gndxxscyc9w85fih370gag8yd1xbfg94nxkwdvhzvbkns9k2ad";
+  version = "0.8.6";
+  sha256 = "03kz2qhnynbgs4vk7348zjkkakzzwvxhbasl0lcazj1cx1ay7c4l";
   buildDepends = [ Boolean MemoTrie NumInstances ];
   meta = {
-    homepage = "http://haskell.org/haskellwiki/vector-space";
     description = "Vector & affine spaces, linear maps, and derivatives";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/vector/0.10.0.1.nix b/pkgs/development/libraries/haskell/vector/0.10.0.1.nix
new file mode 100644
index 00000000000..7acc89d6a91
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vector/0.10.0.1.nix
@@ -0,0 +1,15 @@
+{ cabal, deepseq, primitive }:
+
+cabal.mkDerivation (self: {
+  pname = "vector";
+  version = "0.10.0.1";
+  sha256 = "1bq8am8qnpnsla315i21f1kikikalyz9ps1izxgpr9q1ic2lbsgc";
+  buildDepends = [ deepseq primitive ];
+  meta = {
+    homepage = "http://code.haskell.org/vector";
+    description = "Efficient Arrays";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vector/0.10.nix b/pkgs/development/libraries/haskell/vector/0.10.nix
new file mode 100644
index 00000000000..8fac71eed4b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vector/0.10.nix
@@ -0,0 +1,15 @@
+{ cabal, deepseq, primitive }:
+
+cabal.mkDerivation (self: {
+  pname = "vector";
+  version = "0.10";
+  sha256 = "0lwhsdg7wv6gwjswakf2d1h9w7lp4pznab0mz6xg5q48pgknrcig";
+  buildDepends = [ deepseq primitive ];
+  meta = {
+    homepage = "http://code.haskell.org/vector";
+    description = "Efficient Arrays";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vector/default.nix b/pkgs/development/libraries/haskell/vector/0.9.1.nix
index 63add64226d..63add64226d 100644
--- a/pkgs/development/libraries/haskell/vector/default.nix
+++ b/pkgs/development/libraries/haskell/vector/0.9.1.nix
diff --git a/pkgs/development/libraries/haskell/void/default.nix b/pkgs/development/libraries/haskell/void/default.nix
index 581d2f8c9ae..591040a9548 100644
--- a/pkgs/development/libraries/haskell/void/default.nix
+++ b/pkgs/development/libraries/haskell/void/default.nix
@@ -1,10 +1,10 @@
-{ cabal, semigroups }:
+{ cabal, hashable, semigroups }:
 
 cabal.mkDerivation (self: {
   pname = "void";
-  version = "0.5.7";
-  sha256 = "1rkc32122mkyxl0a4spbcqz908wh49l5ab8gfvsy0y02d3lldfd4";
-  buildDepends = [ semigroups ];
+  version = "0.6";
+  sha256 = "0g1dja7qcp2d9a4m8j1f4ddyvbl003znyk7yn5w5qiiqr1pacs1n";
+  buildDepends = [ hashable semigroups ];
   meta = {
     homepage = "http://github.com/ekmett/void";
     description = "A Haskell 98 logically uninhabited data type";
diff --git a/pkgs/development/libraries/haskell/vty-ui/default.nix b/pkgs/development/libraries/haskell/vty-ui/default.nix
new file mode 100644
index 00000000000..3b38db8c1de
--- /dev/null
+++ b/pkgs/development/libraries/haskell/vty-ui/default.nix
@@ -0,0 +1,21 @@
+{ cabal, filepath, mtl, QuickCheck, random, regexBase, stm, text
+, time, vector, vty
+}:
+
+cabal.mkDerivation (self: {
+  pname = "vty-ui";
+  version = "1.6";
+  sha256 = "0chwgzzk2pl9kppd9r6h2azbqc668xpdrrk5y415yi8wcw61s0bc";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    filepath mtl QuickCheck random regexBase stm text time vector vty
+  ];
+  jailbreak = true;
+  meta = {
+    homepage = "http://jtdaugherty.github.com/vty-ui/";
+    description = "An interactive terminal user interface library for Vty";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/vty/default.nix b/pkgs/development/libraries/haskell/vty/default.nix
index 684fbd2eed0..3121399b3a9 100644
--- a/pkgs/development/libraries/haskell/vty/default.nix
+++ b/pkgs/development/libraries/haskell/vty/default.nix
@@ -1,17 +1,24 @@
-{ cabal, deepseq, mtl, parallel, parsec, terminfo, utf8String
-, vector
+{ cabal, Cabal, deepseq, mtl, parallel, parsec, QuickCheck, random
+, stringQq, terminfo, utf8String, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "vty";
-  version = "4.7.0.14";
-  sha256 = "0wgn2jbr7lih9znkpa09nvb4qjd0801c0r4mwwrw4pd9n9mkjqn9";
+  version = "4.7.3";
+  sha256 = "0x059mzw6v2xf92fdhy0ilyqbics2as6dqrdr6njpp0m6qykkybb";
+  isLibrary = true;
+  isExecutable = true;
   buildDepends = [
-    deepseq mtl parallel parsec terminfo utf8String vector
+    deepseq mtl parallel parsec stringQq terminfo utf8String vector
   ];
+  testDepends = [
+    Cabal deepseq mtl parallel parsec QuickCheck random terminfo
+    utf8String vector
+  ];
+  doCheck = false;
   meta = {
     homepage = "https://github.com/coreyoconnor/vty";
-    description = "A simple terminal access library";
+    description = "A simple terminal UI library";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/wai-app-static/default.nix b/pkgs/development/libraries/haskell/wai-app-static/default.nix
index e1f2cb9116d..74ec00c58fd 100644
--- a/pkgs/development/libraries/haskell/wai-app-static/default.nix
+++ b/pkgs/development/libraries/haskell/wai-app-static/default.nix
@@ -1,23 +1,24 @@
 { cabal, base64Bytestring, blazeBuilder, blazeHtml, blazeMarkup
-, cereal, cryptoConduit, cryptohash, fileEmbed, httpDate, httpTypes
-, mimeTypes, systemFileio, systemFilepath, text, time, transformers
-, unixCompat, wai
+, cereal, cryptoConduit, cryptohash, fileEmbed, hspec, httpDate
+, httpTypes, mimeTypes, network, systemFileio, systemFilepath, text
+, time, transformers, unixCompat, wai, waiTest
 }:
 
 cabal.mkDerivation (self: {
   pname = "wai-app-static";
-  version = "1.3.0";
-  sha256 = "1xsjq0xip9anbd4cpami8w6d2p0pdp375hzw1jx6pvajjmkjksqn";
+  version = "1.3.1.3";
+  sha256 = "0h6m1an3srkvyaz50w16v2mhjyfdqbqq2d7ng3yhrrmb1fyvhas1";
   buildDepends = [
     base64Bytestring blazeBuilder blazeHtml blazeMarkup cereal
     cryptoConduit cryptohash fileEmbed httpDate httpTypes mimeTypes
     systemFileio systemFilepath text time transformers unixCompat wai
   ];
-  patchPhase = ''
-    sed -i -e 's|, base64-bytestring.*|, base64-bytestring|' wai-app-static.cabal
-  '';
-    meta = {
-    homepage = "http://www.yesodweb.com/book/wai";
+  testDepends = [
+    hspec httpDate httpTypes mimeTypes network text time transformers
+    unixCompat wai waiTest
+  ];
+  meta = {
+    homepage = "http://www.yesodweb.com/book/web-application-interface";
     description = "WAI application for static serving";
     license = self.stdenv.lib.licenses.mit;
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/libraries/haskell/wai-extra/default.nix b/pkgs/development/libraries/haskell/wai-extra/default.nix
index c7732cc6e2b..3192def654e 100644
--- a/pkgs/development/libraries/haskell/wai-extra/default.nix
+++ b/pkgs/development/libraries/haskell/wai-extra/default.nix
@@ -1,17 +1,23 @@
-{ cabal, ansiTerminal, blazeBuilder, blazeBuilderConduit
-, caseInsensitive, conduit, dataDefault, fastLogger, httpTypes
-, network, resourcet, stringsearch, text, time, transformers, void
-, wai, waiLogger, zlibConduit
+{ cabal, ansiTerminal, base64Bytestring, blazeBuilder
+, blazeBuilderConduit, caseInsensitive, conduit, dataDefault
+, dateCache, fastLogger, hspec, httpTypes, HUnit, network
+, resourcet, stringsearch, text, time, transformers, void, wai
+, waiLogger, waiTest, word8, zlib, zlibBindings, zlibConduit
 }:
 
 cabal.mkDerivation (self: {
   pname = "wai-extra";
-  version = "1.3.0";
-  sha256 = "1j76iaymnsyrin014slkv06p3zdk8lfff94abwvvanxl7gs9b286";
+  version = "1.3.4.2";
+  sha256 = "14mrvh3av6dn4jx5q06b4lyjw8sr1ynygbncf5fbp3nzn8nmh17s";
   buildDepends = [
-    ansiTerminal blazeBuilder blazeBuilderConduit caseInsensitive
-    conduit dataDefault fastLogger httpTypes network resourcet
-    stringsearch text time transformers void wai waiLogger zlibConduit
+    ansiTerminal base64Bytestring blazeBuilder blazeBuilderConduit
+    caseInsensitive conduit dataDefault dateCache fastLogger httpTypes
+    network resourcet stringsearch text time transformers void wai
+    waiLogger word8 zlibConduit
+  ];
+  testDepends = [
+    blazeBuilder conduit dataDefault fastLogger hspec httpTypes HUnit
+    text transformers wai waiTest zlib zlibBindings
   ];
   meta = {
     homepage = "http://github.com/yesodweb/wai";
diff --git a/pkgs/development/libraries/haskell/wai-handler-launch/default.nix b/pkgs/development/libraries/haskell/wai-handler-launch/default.nix
new file mode 100644
index 00000000000..a3d02329dfd
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wai-handler-launch/default.nix
@@ -0,0 +1,18 @@
+{ cabal, blazeBuilder, blazeBuilderConduit, conduit, httpTypes
+, transformers, wai, warp, zlibConduit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "wai-handler-launch";
+  version = "1.3.1.4";
+  sha256 = "0ii74p2400a4w0pcswk8j57wbasi17alifs4xgwv79b235wnn317";
+  buildDepends = [
+    blazeBuilder blazeBuilderConduit conduit httpTypes transformers wai
+    warp zlibConduit
+  ];
+  meta = {
+    description = "Launch a web app in the default browser";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/wai-logger/default.nix b/pkgs/development/libraries/haskell/wai-logger/default.nix
index 49e643b4e20..f6035269112 100644
--- a/pkgs/development/libraries/haskell/wai-logger/default.nix
+++ b/pkgs/development/libraries/haskell/wai-logger/default.nix
@@ -1,14 +1,14 @@
-{ cabal, blazeBuilder, byteorder, caseInsensitive, fastLogger
-, httpTypes, network, wai
+{ cabal, blazeBuilder, byteorder, caseInsensitive, dateCache
+, fastLogger, httpTypes, network, wai
 }:
 
 cabal.mkDerivation (self: {
   pname = "wai-logger";
-  version = "0.2.0";
-  sha256 = "1p89k71y0y5kpvy9iniqfyz3wmaw1q75s2324df1m1w1hcc0lgb6";
+  version = "0.3.1";
+  sha256 = "0x1d67fcfpjrgyjr7hipifqrzk13x8z8xmlj7h999r8mswijhgii";
   buildDepends = [
-    blazeBuilder byteorder caseInsensitive fastLogger httpTypes network
-    wai
+    blazeBuilder byteorder caseInsensitive dateCache fastLogger
+    httpTypes network wai
   ];
   meta = {
     description = "A logging system for WAI";
diff --git a/pkgs/development/libraries/haskell/wai-test/default.nix b/pkgs/development/libraries/haskell/wai-test/default.nix
new file mode 100644
index 00000000000..2d0f6637171
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wai-test/default.nix
@@ -0,0 +1,21 @@
+{ cabal, blazeBuilder, blazeBuilderConduit, caseInsensitive
+, conduit, cookie, hspec, httpTypes, HUnit, network, text
+, transformers, wai
+}:
+
+cabal.mkDerivation (self: {
+  pname = "wai-test";
+  version = "1.3.1";
+  sha256 = "0dw9lbwb27yr3953ill0r727ivqav5b2ica8gbaalvnh3h5c8akg";
+  buildDepends = [
+    blazeBuilder blazeBuilderConduit caseInsensitive conduit cookie
+    httpTypes HUnit network text transformers wai
+  ];
+  testDepends = [ hspec wai ];
+  meta = {
+    homepage = "http://www.yesodweb.com/book/web-application-interface";
+    description = "Unit test framework (built on HUnit) for WAI applications";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/wai/default.nix b/pkgs/development/libraries/haskell/wai/default.nix
index a67da394a65..9b3b1083bc0 100644
--- a/pkgs/development/libraries/haskell/wai/default.nix
+++ b/pkgs/development/libraries/haskell/wai/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "wai";
-  version = "1.3.0";
-  sha256 = "08y0s7b5db5nyvxv0bvraj6ih7054h5n4lkwdlm3nkbm8s9k8hwv";
+  version = "1.4.0.1";
+  sha256 = "1d08mp7dpf8iw50yjysr5p7fc9jgdcwql943p9c11x35n2ks6z2n";
   buildDepends = [
     blazeBuilder conduit httpTypes network text transformers vault
   ];
diff --git a/pkgs/development/libraries/haskell/warp/default.nix b/pkgs/development/libraries/haskell/warp/default.nix
index e066196cd4d..3cf1f8e6ba6 100644
--- a/pkgs/development/libraries/haskell/warp/default.nix
+++ b/pkgs/development/libraries/haskell/warp/default.nix
@@ -1,16 +1,22 @@
 { cabal, blazeBuilder, blazeBuilderConduit, caseInsensitive
-, conduit, httpTypes, liftedBase, network, networkConduit
-, simpleSendfile, transformers, unixCompat, wai
+, conduit, hashable, hspec, httpTypes, HUnit, liftedBase, network
+, networkConduit, QuickCheck, simpleSendfile, transformers
+, unixCompat, void, wai
 }:
 
 cabal.mkDerivation (self: {
   pname = "warp";
-  version = "1.3.0.1";
-  sha256 = "0bgmz2kd2z9agpid0w2whfz1cyrmiaiyap20za1l56d88m0p1z45";
+  version = "1.3.8.2";
+  sha256 = "0s8na04n21glgkc0bcc0171ikh9cagx35s2h6i1pb5pwa8l0akv6";
   buildDepends = [
-    blazeBuilder blazeBuilderConduit caseInsensitive conduit httpTypes
-    liftedBase network networkConduit simpleSendfile transformers
-    unixCompat wai
+    blazeBuilder blazeBuilderConduit caseInsensitive conduit hashable
+    httpTypes liftedBase network networkConduit simpleSendfile
+    transformers unixCompat void wai
+  ];
+  testDepends = [
+    blazeBuilder blazeBuilderConduit caseInsensitive conduit hashable
+    hspec httpTypes HUnit liftedBase network networkConduit QuickCheck
+    simpleSendfile transformers unixCompat void wai
   ];
   meta = {
     homepage = "http://github.com/yesodweb/wai";
diff --git a/pkgs/development/libraries/haskell/wl-pprint-extras/default.nix b/pkgs/development/libraries/haskell/wl-pprint-extras/default.nix
new file mode 100644
index 00000000000..77670b4f117
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wl-pprint-extras/default.nix
@@ -0,0 +1,14 @@
+{ cabal, nats, semigroupoids, semigroups, text, utf8String }:
+
+cabal.mkDerivation (self: {
+  pname = "wl-pprint-extras";
+  version = "3.4";
+  sha256 = "17vxyckx2pj4sc2d1yw1rcsxn1rp4nzdjp0hgpy78xsp9plccgsy";
+  buildDepends = [ nats semigroupoids semigroups text utf8String ];
+  meta = {
+    homepage = "http://github.com/ekmett/wl-pprint-extras/";
+    description = "A free monad based on the Wadler/Leijen pretty printer";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/wl-pprint-terminfo/default.nix b/pkgs/development/libraries/haskell/wl-pprint-terminfo/default.nix
new file mode 100644
index 00000000000..d2bd35eebd4
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wl-pprint-terminfo/default.nix
@@ -0,0 +1,18 @@
+{ cabal, nats, semigroups, terminfo, text, transformers
+, wlPprintExtras
+}:
+
+cabal.mkDerivation (self: {
+  pname = "wl-pprint-terminfo";
+  version = "3.6";
+  sha256 = "14dq0inv6i8pwjzrpys420iwi6002mard1n73z96k89zq5xhwlbg";
+  buildDepends = [
+    nats semigroups terminfo text transformers wlPprintExtras
+  ];
+  meta = {
+    homepage = "http://github.com/ekmett/wl-pprint-terminfo/";
+    description = "A color pretty printer with terminfo support";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/wl-pprint/default.nix b/pkgs/development/libraries/haskell/wl-pprint/default.nix
new file mode 100644
index 00000000000..9849d4fab0e
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wl-pprint/default.nix
@@ -0,0 +1,12 @@
+{ cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "wl-pprint";
+  version = "1.1";
+  sha256 = "16kp3fkh0x9kgzk6fdqrm8m0v7b5cgbv0m3x63ybbp5vxbhand06";
+  meta = {
+    description = "The Wadler/Leijen Pretty Printer";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/word8/default.nix b/pkgs/development/libraries/haskell/word8/default.nix
new file mode 100644
index 00000000000..e8abded2438
--- /dev/null
+++ b/pkgs/development/libraries/haskell/word8/default.nix
@@ -0,0 +1,13 @@
+{ cabal, hspec }:
+
+cabal.mkDerivation (self: {
+  pname = "word8";
+  version = "0.0.3";
+  sha256 = "1k5sq91pidgw7w8fc62k9gl8iynb65pcza6mjx8pa3n2lslp7125";
+  testDepends = [ hspec ];
+  meta = {
+    description = "Word8 library";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/wxHaskell/fix-bogus-pointer-assignment.patch b/pkgs/development/libraries/haskell/wxHaskell/fix-bogus-pointer-assignment.patch
new file mode 100644
index 00000000000..38551d24d43
--- /dev/null
+++ b/pkgs/development/libraries/haskell/wxHaskell/fix-bogus-pointer-assignment.patch
@@ -0,0 +1,13 @@
+diff -ubr wxc-0.90.0.4-orig/src/cpp/eljpen.cpp wxc-0.90.0.4/src/cpp/eljpen.cpp
+--- wxc-0.90.0.4-orig/src/cpp/eljpen.cpp	2012-07-03 12:12:17.000000000 +0200
++++ wxc-0.90.0.4/src/cpp/eljpen.cpp	2013-01-07 12:09:50.296417007 +0100
+@@ -156,7 +156,7 @@
+ EWXWEXPORT(void,wxPen_GetStipple)(void* self,wxBitmap* _ref)

+ {

+ #if defined(__WXGTK__)

+-    *_ref = NULL;

++    _ref = NULL;

+ #else

+     *_ref = *(((wxPen*)self)->GetStipple());

+ #endif

+Only in wxc-0.90.0.4/src/cpp: eljpen.cpp.orig
diff --git a/pkgs/development/libraries/haskell/wxHaskell/wxc.nix b/pkgs/development/libraries/haskell/wxHaskell/wxc.nix
index f439b9e1594..74ca4f91d70 100644
--- a/pkgs/development/libraries/haskell/wxHaskell/wxc.nix
+++ b/pkgs/development/libraries/haskell/wxHaskell/wxc.nix
@@ -10,7 +10,7 @@ cabal.mkDerivation (self: {
   postInstall = ''
     cp -v dist/build/libwxc.so.${self.version} $out/lib/libwxc.so
   '';
-
+  patches = [ ./fix-bogus-pointer-assignment.patch ];
   meta = {
     homepage = "http://haskell.org/haskellwiki/WxHaskell";
     description = "wxHaskell C++ wrapper";
diff --git a/pkgs/development/libraries/haskell/wxHaskell/wxcore.nix b/pkgs/development/libraries/haskell/wxHaskell/wxcore.nix
index 98032d91c8e..5dde5e8fc3f 100644
--- a/pkgs/development/libraries/haskell/wxHaskell/wxcore.nix
+++ b/pkgs/development/libraries/haskell/wxHaskell/wxcore.nix
@@ -8,6 +8,9 @@ cabal.mkDerivation (self: {
   sha256 = "0d79hr6cz9zj3w57h6630nfnsmfq1w73gz04jjmlhwh8ih557imw";
   buildDepends = [ filepath parsec stm time wxc wxdirect ];
   extraLibraries = [ libX11 mesa wxGTK ];
+  patchPhase = ''
+    sed -i -e 's|containers >=.*|containers|' wxcore.cabal
+  '';
   meta = {
     homepage = "http://haskell.org/haskellwiki/WxHaskell";
     description = "wxHaskell core";
diff --git a/pkgs/development/libraries/haskell/wxHaskell/wxdirect.nix b/pkgs/development/libraries/haskell/wxHaskell/wxdirect.nix
index a1caaef1bc9..08512c20625 100644
--- a/pkgs/development/libraries/haskell/wxHaskell/wxdirect.nix
+++ b/pkgs/development/libraries/haskell/wxHaskell/wxdirect.nix
@@ -7,6 +7,9 @@ cabal.mkDerivation (self: {
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ parsec strict time ];
+  patchPhase = ''
+    sed -i -e 's|containers >=.*|containers|' wxdirect.cabal
+  '';
   meta = {
     homepage = "http://haskell.org/haskellwiki/WxHaskell";
     description = "helper tool for building wxHaskell";
diff --git a/pkgs/development/libraries/haskell/xdg-basedir/default.nix b/pkgs/development/libraries/haskell/xdg-basedir/default.nix
new file mode 100644
index 00000000000..3a12faf07c9
--- /dev/null
+++ b/pkgs/development/libraries/haskell/xdg-basedir/default.nix
@@ -0,0 +1,14 @@
+{ cabal, filepath }:
+
+cabal.mkDerivation (self: {
+  pname = "xdg-basedir";
+  version = "0.2.2";
+  sha256 = "0azlzaxp2dn4l1nr7shsxah2magk1szf6fx0mv75az00qsjw6qg4";
+  buildDepends = [ filepath ];
+  meta = {
+    homepage = "http://github.com/willdonnelly/xdg-basedir";
+    description = "A basic implementation of the XDG Base Directory specification";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/xdot/default.nix b/pkgs/development/libraries/haskell/xdot/default.nix
new file mode 100644
index 00000000000..130402ec75b
--- /dev/null
+++ b/pkgs/development/libraries/haskell/xdot/default.nix
@@ -0,0 +1,14 @@
+{ cabal, cairo, graphviz, gtk, mtl, polyparse, text }:
+
+cabal.mkDerivation (self: {
+  pname = "xdot";
+  version = "0.2.3.1";
+  sha256 = "1gricrnssxgzaq1z7nnyppmz284nix0m89477x22mal125pkcf7n";
+  buildDepends = [ cairo graphviz gtk mtl polyparse text ];
+  meta = {
+    description = "Parse Graphviz xdot files and interactively view them using GTK and Cairo";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/xml-conduit/default.nix b/pkgs/development/libraries/haskell/xml-conduit/default.nix
index e321d2b08d9..b586a6336bc 100644
--- a/pkgs/development/libraries/haskell/xml-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/xml-conduit/default.nix
@@ -1,18 +1,21 @@
 { cabal, attoparsec, attoparsecConduit, blazeBuilder
 , blazeBuilderConduit, blazeHtml, blazeMarkup, conduit, dataDefault
-, failure, monadControl, resourcet, systemFilepath, text
-, transformers, xmlTypes
+, failure, hspec, HUnit, monadControl, resourcet, systemFilepath
+, text, transformers, xmlTypes
 }:
 
 cabal.mkDerivation (self: {
   pname = "xml-conduit";
-  version = "1.0.3";
-  sha256 = "1pci21zwdclv018fk5hjfmif2wg6zfm9b4g1w3srgm6wdh5013r7";
+  version = "1.1.0.3";
+  sha256 = "04mnn6j9bbkhvav04gl9cbd4rldl7bwgcapvykwvf2p3nb3d7bi4";
   buildDepends = [
     attoparsec attoparsecConduit blazeBuilder blazeBuilderConduit
     blazeHtml blazeMarkup conduit dataDefault failure monadControl
     resourcet systemFilepath text transformers xmlTypes
   ];
+  testDepends = [
+    blazeMarkup conduit hspec HUnit text transformers xmlTypes
+  ];
   meta = {
     homepage = "http://github.com/snoyberg/xml";
     description = "Pure-Haskell utilities for dealing with XML with the conduit package";
diff --git a/pkgs/development/libraries/haskell/xml-hamlet/default.nix b/pkgs/development/libraries/haskell/xml-hamlet/default.nix
new file mode 100644
index 00000000000..9c85223d654
--- /dev/null
+++ b/pkgs/development/libraries/haskell/xml-hamlet/default.nix
@@ -0,0 +1,15 @@
+{ cabal, hspec, HUnit, parsec, shakespeare, text, xmlConduit }:
+
+cabal.mkDerivation (self: {
+  pname = "xml-hamlet";
+  version = "0.4.0.4";
+  sha256 = "1s4s5z1xir9zmcbfz8mrznf2byclmg0qjjhwmpal2r9ly9g3na98";
+  buildDepends = [ parsec shakespeare text xmlConduit ];
+  testDepends = [ hspec HUnit parsec shakespeare text xmlConduit ];
+  meta = {
+    homepage = "http://www.yesodweb.com/";
+    description = "Hamlet-style quasiquoter for XML content";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/xml/default.nix b/pkgs/development/libraries/haskell/xml/default.nix
index dc2e7dc70bd..072e5d8bc1c 100644
--- a/pkgs/development/libraries/haskell/xml/default.nix
+++ b/pkgs/development/libraries/haskell/xml/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xml";
-  version = "1.3.12";
-  sha256 = "1lmqnzna0zy297y4q6qviv7a4966zz9mhfhk6anrp66cz890whai";
+  version = "1.3.13";
+  sha256 = "04xq2ma2if5gqz16bjrxwigh4vzw6m8i2zk11s5qg3d4z370fdn3";
   buildDepends = [ text ];
   meta = {
     homepage = "http://code.galois.com";
diff --git a/pkgs/development/libraries/haskell/xmlhtml/default.nix b/pkgs/development/libraries/haskell/xmlhtml/default.nix
index 654da2e76b5..66c1f645267 100644
--- a/pkgs/development/libraries/haskell/xmlhtml/default.nix
+++ b/pkgs/development/libraries/haskell/xmlhtml/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xmlhtml";
-  version = "0.2.0.2";
-  sha256 = "0dqlqx3cnrqap3ficdkmwm8661j8i7qknb8xhjqvfmnb9pwqdks2";
+  version = "0.2.1";
+  sha256 = "1nqkjbhpzr7zxpjvlxy6pync6zyarvjblcxg8igq75dyzk7qhafg";
   buildDepends = [
     blazeBuilder blazeHtml blazeMarkup parsec text unorderedContainers
   ];
diff --git a/pkgs/development/libraries/haskell/xss-sanitize/default.nix b/pkgs/development/libraries/haskell/xss-sanitize/default.nix
index 0fac2ad6372..89bdab65b17 100644
--- a/pkgs/development/libraries/haskell/xss-sanitize/default.nix
+++ b/pkgs/development/libraries/haskell/xss-sanitize/default.nix
@@ -1,12 +1,17 @@
-{ cabal, attoparsec, cssText, network, tagsoup, text, utf8String }:
+{ cabal, attoparsec, cssText, hspec, HUnit, network, tagsoup, text
+, utf8String
+}:
 
 cabal.mkDerivation (self: {
   pname = "xss-sanitize";
-  version = "0.3.2";
-  sha256 = "0m7gl232i06i090kbrlz67cs4q3pqf8169m9kjdj41kj6jay1dcx";
+  version = "0.3.3";
+  sha256 = "0xnyp8nwglh4waawijk1q5z8higf8mggh6hp0pp6ys4bm7gsp74a";
   buildDepends = [
     attoparsec cssText network tagsoup text utf8String
   ];
+  testDepends = [
+    attoparsec cssText hspec HUnit network tagsoup text utf8String
+  ];
   meta = {
     homepage = "http://github.com/yesodweb/haskell-xss-sanitize";
     description = "sanitize untrusted HTML to prevent XSS attacks";
diff --git a/pkgs/development/libraries/haskell/yaml/default.nix b/pkgs/development/libraries/haskell/yaml/default.nix
index c6a456bf9a4..fe40fb785c9 100644
--- a/pkgs/development/libraries/haskell/yaml/default.nix
+++ b/pkgs/development/libraries/haskell/yaml/default.nix
@@ -1,18 +1,21 @@
-{ cabal, aeson, attoparsec, conduit, resourcet, text, transformers
-, unorderedContainers, vector
+{ cabal, aeson, attoparsec, conduit, hspec, HUnit, resourcet, text
+, transformers, unorderedContainers, vector
 }:
 
 cabal.mkDerivation (self: {
   pname = "yaml";
-  version = "0.8.0.1";
-  sha256 = "0frps30spsxkr479h4hpzsc9gkaazgmdjp5p4pmzy9mf174qacs8";
+  version = "0.8.2.4";
+  sha256 = "0gk2h3wfx818jibj51jh5ksrrkghx4ykvdqfji4lrh1mv08ah3d0";
   buildDepends = [
     aeson attoparsec conduit resourcet text transformers
     unorderedContainers vector
   ];
+  testDepends = [
+    conduit hspec HUnit text transformers unorderedContainers
+  ];
   meta = {
     homepage = "http://github.com/snoyberg/yaml/";
-    description = "Low-level binding to the libyaml C library";
+    description = "Support for parsing and rendering YAML documents";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/yesod-auth/default.nix b/pkgs/development/libraries/haskell/yesod-auth/default.nix
index fdb6b0e3f60..22f1c583011 100644
--- a/pkgs/development/libraries/haskell/yesod-auth/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-auth/default.nix
@@ -1,20 +1,21 @@
-{ cabal, aeson, authenticate, blazeHtml, blazeMarkup, hamlet
-, httpConduit, liftedBase, mimeMail, persistent, persistentTemplate
-, pureMD5, pwstoreFast, random, SHA, shakespeareCss, text
-, transformers, unorderedContainers, wai, yesodCore, yesodForm
-, yesodJson, yesodPersistent
+{ cabal, aeson, authenticate, blazeHtml, blazeMarkup, dataDefault
+, emailValidate, fileEmbed, hamlet, httpConduit, httpTypes
+, liftedBase, mimeMail, network, persistent, persistentTemplate
+, pureMD5, pwstoreFast, random, resourcet, SHA, shakespeareCss
+, shakespeareJs, text, transformers, unorderedContainers, wai
+, yesodCore, yesodForm, yesodPersistent
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-auth";
-  version = "1.1.1";
-  sha256 = "03zywcdv8kb0h8hpdg1zb3c10s6y6j3gg64n8w970f0izi93haxv";
+  version = "1.2.0.1";
+  sha256 = "02nljkc12mgjhvkiv876w6w13q9s9iigya8v4jzj6myv48lainvd";
   buildDepends = [
-    aeson authenticate blazeHtml blazeMarkup hamlet httpConduit
-    liftedBase mimeMail persistent persistentTemplate pureMD5
-    pwstoreFast random SHA shakespeareCss text transformers
-    unorderedContainers wai yesodCore yesodForm yesodJson
-    yesodPersistent
+    aeson authenticate blazeHtml blazeMarkup dataDefault emailValidate
+    fileEmbed hamlet httpConduit httpTypes liftedBase mimeMail network
+    persistent persistentTemplate pureMD5 pwstoreFast random resourcet
+    SHA shakespeareCss shakespeareJs text transformers
+    unorderedContainers wai yesodCore yesodForm yesodPersistent
   ];
   meta = {
     homepage = "http://www.yesodweb.com/";
diff --git a/pkgs/development/libraries/haskell/yesod-core/default.nix b/pkgs/development/libraries/haskell/yesod-core/default.nix
index 219a83e1e96..7518e6ff82a 100644
--- a/pkgs/development/libraries/haskell/yesod-core/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-core/default.nix
@@ -1,23 +1,29 @@
-{ cabal, aeson, blazeBuilder, blazeHtml, blazeMarkup
-, caseInsensitive, cereal, clientsession, conduit, cookie, failure
-, fastLogger, hamlet, httpTypes, liftedBase, monadControl
-, monadLogger, parsec, pathPieces, random, resourcet, shakespeare
+{ cabal, aeson, attoparsecConduit, blazeBuilder, blazeHtml
+, blazeMarkup, caseInsensitive, cereal, clientsession, conduit
+, cookie, dataDefault, failure, fastLogger, hamlet, hspec
+, httpTypes, HUnit, liftedBase, monadControl, monadLogger, parsec
+, pathPieces, QuickCheck, random, resourcet, safe, shakespeare
 , shakespeareCss, shakespeareI18n, shakespeareJs, text, time
-, transformers, transformersBase, vector, wai, waiExtra
-, yesodRoutes
+, transformers, transformersBase, vector, wai, waiExtra, waiTest
+, warp, yesodRoutes
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-core";
-  version = "1.1.1";
-  sha256 = "1rq0zdn9d6f34s7wnnr32hnbz23z8bvz3j2ylv8sz5h3nwmbfz99";
+  version = "1.2.1";
+  sha256 = "1p9xaw0d9dx68q7i99kjcqy1lhmd164drbcw3489560wa71mwamk";
   buildDepends = [
-    aeson blazeBuilder blazeHtml blazeMarkup caseInsensitive cereal
-    clientsession conduit cookie failure fastLogger hamlet httpTypes
-    liftedBase monadControl monadLogger parsec pathPieces random
-    resourcet shakespeare shakespeareCss shakespeareI18n shakespeareJs
-    text time transformers transformersBase vector wai waiExtra
-    yesodRoutes
+    aeson attoparsecConduit blazeBuilder blazeHtml blazeMarkup
+    caseInsensitive cereal clientsession conduit cookie dataDefault
+    failure fastLogger hamlet httpTypes liftedBase monadControl
+    monadLogger parsec pathPieces random resourcet safe shakespeare
+    shakespeareCss shakespeareI18n shakespeareJs text time transformers
+    transformersBase vector wai waiExtra warp yesodRoutes
+  ];
+  testDepends = [
+    blazeBuilder conduit hamlet hspec httpTypes HUnit liftedBase
+    QuickCheck random resourcet shakespeareCss shakespeareJs text
+    transformers wai waiTest
   ];
   meta = {
     homepage = "http://www.yesodweb.com/";
diff --git a/pkgs/development/libraries/haskell/yesod-default/default.nix b/pkgs/development/libraries/haskell/yesod-default/default.nix
index c3dce8ca7d3..58ea0b10a22 100644
--- a/pkgs/development/libraries/haskell/yesod-default/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-default/default.nix
@@ -1,19 +1,13 @@
-{ cabal, dataDefault, hamlet, networkConduit, shakespeareCss
-, shakespeareJs, text, transformers, unorderedContainers, wai
-, waiExtra, warp, yaml, yesodCore
-}:
+{ cabal, yesodCore }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-default";
-  version = "1.1.0";
-  sha256 = "124407a0in474l71jja04ds0xh84ac5i3jv62iswxlcp1y9f52bq";
-  buildDepends = [
-    dataDefault hamlet networkConduit shakespeareCss shakespeareJs text
-    transformers unorderedContainers wai waiExtra warp yaml yesodCore
-  ];
+  version = "1.2.0";
+  sha256 = "15nsknnxnfbkpg4pswxcpgfb2y0hz0xxj56jknd93hcm7aay36pk";
+  buildDepends = [ yesodCore ];
   meta = {
     homepage = "http://www.yesodweb.com/";
-    description = "Default config and main functions for your yesod application";
+    description = "Default config and main functions for your yesod application (deprecated)";
     license = self.stdenv.lib.licenses.mit;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/yesod-form/default.nix b/pkgs/development/libraries/haskell/yesod-form/default.nix
index 35a0adc2592..d693cd1d0a4 100644
--- a/pkgs/development/libraries/haskell/yesod-form/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-form/default.nix
@@ -1,20 +1,20 @@
-{ cabal, attoparsec, blazeBuilder, blazeHtml, blazeMarkup
-, cryptoApi, dataDefault, emailValidate, hamlet, network
-, persistent, shakespeareCss, shakespeareJs, text, time
+{ cabal, aeson, attoparsec, blazeBuilder, blazeHtml, blazeMarkup
+, cryptoApi, dataDefault, emailValidate, hamlet, hspec, network
+, persistent, resourcet, shakespeareCss, shakespeareJs, text, time
 , transformers, wai, xssSanitize, yesodCore, yesodPersistent
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-form";
-  version = "1.1.1";
-  sha256 = "04wlfhaqx7qg904n6f1yz00m3c2sa5ywbhz6m0pmzfm9a7byggcc";
+  version = "1.3.0";
+  sha256 = "1y729h61w30yi4mcva727317gdc70nhn6jzxb7fmc9hqgnh136nc";
   buildDepends = [
-    attoparsec blazeBuilder blazeHtml blazeMarkup cryptoApi dataDefault
-    emailValidate hamlet network persistent shakespeareCss
-    shakespeareJs text time transformers wai xssSanitize yesodCore
-    yesodPersistent
+    aeson attoparsec blazeBuilder blazeHtml blazeMarkup cryptoApi
+    dataDefault emailValidate hamlet network persistent resourcet
+    shakespeareCss shakespeareJs text time transformers wai xssSanitize
+    yesodCore yesodPersistent
   ];
-  noHaddock = true;
+  testDepends = [ hspec text time ];
   meta = {
     homepage = "http://www.yesodweb.com/";
     description = "Form handling support for Yesod Web Framework";
diff --git a/pkgs/development/libraries/haskell/yesod-json/default.nix b/pkgs/development/libraries/haskell/yesod-json/default.nix
index 4a2a2346a87..780444bd861 100644
--- a/pkgs/development/libraries/haskell/yesod-json/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-json/default.nix
@@ -1,19 +1,13 @@
-{ cabal, aeson, attoparsecConduit, blazeBuilder, conduit, safe
-, shakespeareJs, text, transformers, vector, wai, waiExtra
-, yesodCore, yesodRoutes
-}:
+{ cabal, yesodCore }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-json";
-  version = "1.1.0";
-  sha256 = "13dbajs51nyrvch13xz05h6jrnhc097s0iykw5z43x05a6xwj20n";
-  buildDepends = [
-    aeson attoparsecConduit blazeBuilder conduit safe shakespeareJs
-    text transformers vector wai waiExtra yesodCore yesodRoutes
-  ];
+  version = "1.2.0";
+  sha256 = "0d035k1ls5iq1c12yxknyc33qd22ayyhl69y62zmcw7arwx35sgw";
+  buildDepends = [ yesodCore ];
   meta = {
     homepage = "http://www.yesodweb.com/";
-    description = "Generate content for Yesod using the aeson package";
+    description = "Generate content for Yesod using the aeson package. (deprecated)";
     license = self.stdenv.lib.licenses.mit;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/libraries/haskell/yesod-persistent/default.nix b/pkgs/development/libraries/haskell/yesod-persistent/default.nix
index a094f472233..1f0b330ff2c 100644
--- a/pkgs/development/libraries/haskell/yesod-persistent/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-persistent/default.nix
@@ -1,11 +1,19 @@
-{ cabal, persistent, persistentTemplate, transformers, yesodCore }:
+{ cabal, blazeBuilder, conduit, hspec, liftedBase, persistent
+, persistentSqlite, persistentTemplate, poolConduit, resourcet
+, text, transformers, waiTest, yesodCore
+}:
 
 cabal.mkDerivation (self: {
   pname = "yesod-persistent";
-  version = "1.1.0";
-  sha256 = "0c8cvc2gy9ixa0h79ycnyi86indny2i86g5xcg30a2rvc4mjbaaj";
+  version = "1.2.0";
+  sha256 = "1gzzs62mnx2q15sm3hvlk18qjgk3bi828klgl2ckc0462f7z8d0k";
   buildDepends = [
-    persistent persistentTemplate transformers yesodCore
+    blazeBuilder conduit liftedBase persistent persistentTemplate
+    poolConduit resourcet transformers yesodCore
+  ];
+  testDepends = [
+    blazeBuilder conduit hspec persistent persistentSqlite text waiTest
+    yesodCore
   ];
   meta = {
     homepage = "http://www.yesodweb.com/";
diff --git a/pkgs/development/libraries/haskell/yesod-platform/default.nix b/pkgs/development/libraries/haskell/yesod-platform/default.nix
new file mode 100644
index 00000000000..09514ea9316
--- /dev/null
+++ b/pkgs/development/libraries/haskell/yesod-platform/default.nix
@@ -0,0 +1,65 @@
+{ cabal, aeson, ansiTerminal, asn1Data, asn1Types, attoparsec
+, attoparsecConduit, authenticate, base64Bytestring
+, baseUnicodeSymbols, blazeBuilder, blazeBuilderConduit, blazeHtml
+, blazeMarkup, byteorder, caseInsensitive, cereal, certificate
+, cipherAes, cipherRc4, clientsession, conduit, cookie, cprngAes
+, cryptoApi, cryptoConduit, cryptohash, cryptoNumbers, cryptoPubkey
+, cryptoPubkeyTypes, cryptoRandomApi, cssText, dataDefault
+, dataDefaultClass, dataDefaultInstancesBase
+, dataDefaultInstancesContainers, dataDefaultInstancesDlist
+, dataDefaultInstancesOldLocale, dateCache, dlist, emailValidate
+, entropy, failure, fastLogger, fileEmbed, filesystemConduit
+, hamlet, hashable, hjsmin, hspec, hspecExpectations, htmlConduit
+, httpConduit, httpDate, httpTypes, languageJavascript, liftedBase
+, mimeMail, mimeTypes, mmorph, monadControl, monadLogger
+, networkConduit, pathPieces, pem, persistent, persistentTemplate
+, poolConduit, primitive, publicsuffixlist, pureMD5, pwstoreFast
+, quickcheckIo, resourcePool, resourcet, safe, semigroups, setenv
+, SHA, shakespeare, shakespeareCss, shakespeareI18n, shakespeareJs
+, shakespeareText, silently, simpleSendfile, skein, socks
+, stringsearch, systemFileio, systemFilepath, tagged, tagsoup
+, tagstreamConduit, tls, tlsExtra, transformersBase, unixCompat
+, unorderedContainers, utf8Light, utf8String, vault, vector, void
+, wai, waiAppStatic, waiExtra, waiLogger, waiTest, warp, word8
+, xmlConduit, xmlTypes, xssSanitize, yaml, yesod, yesodAuth
+, yesodCore, yesodForm, yesodPersistent, yesodRoutes, yesodStatic
+, yesodTest, zlibBindings, zlibConduit
+}:
+
+cabal.mkDerivation (self: {
+  pname = "yesod-platform";
+  version = "1.2.0.1";
+  sha256 = "0hff8kx5d1z8xmy7fnzzhvy9774r26i4bczkb4cz30v3v5pf2g15";
+  buildDepends = [
+    aeson ansiTerminal asn1Data asn1Types attoparsec attoparsecConduit
+    authenticate base64Bytestring baseUnicodeSymbols blazeBuilder
+    blazeBuilderConduit blazeHtml blazeMarkup byteorder caseInsensitive
+    cereal certificate cipherAes cipherRc4 clientsession conduit cookie
+    cprngAes cryptoApi cryptoConduit cryptohash cryptoNumbers
+    cryptoPubkey cryptoPubkeyTypes cryptoRandomApi cssText dataDefault
+    dataDefaultClass dataDefaultInstancesBase
+    dataDefaultInstancesContainers dataDefaultInstancesDlist
+    dataDefaultInstancesOldLocale dateCache dlist emailValidate entropy
+    failure fastLogger fileEmbed filesystemConduit hamlet hashable
+    hjsmin hspec hspecExpectations htmlConduit httpConduit httpDate
+    httpTypes languageJavascript liftedBase mimeMail mimeTypes mmorph
+    monadControl monadLogger networkConduit pathPieces pem persistent
+    persistentTemplate poolConduit primitive publicsuffixlist pureMD5
+    pwstoreFast quickcheckIo resourcePool resourcet safe semigroups
+    setenv SHA shakespeare shakespeareCss shakespeareI18n shakespeareJs
+    shakespeareText silently simpleSendfile skein socks stringsearch
+    systemFileio systemFilepath tagged tagsoup tagstreamConduit tls
+    tlsExtra transformersBase unixCompat unorderedContainers utf8Light
+    utf8String vault vector void wai waiAppStatic waiExtra waiLogger
+    waiTest warp word8 xmlConduit xmlTypes xssSanitize yaml yesod
+    yesodAuth yesodCore yesodForm yesodPersistent yesodRoutes
+    yesodStatic yesodTest zlibBindings zlibConduit
+  ];
+  jailbreak = true;
+  meta = {
+    homepage = "http://www.yesodweb.com/";
+    description = "Meta package for Yesod";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/yesod-routes/default.nix b/pkgs/development/libraries/haskell/yesod-routes/default.nix
index 9a801d62df8..44d728ffcfd 100644
--- a/pkgs/development/libraries/haskell/yesod-routes/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-routes/default.nix
@@ -1,10 +1,11 @@
-{ cabal, pathPieces, text, vector }:
+{ cabal, hspec, HUnit, pathPieces, text, vector }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-routes";
-  version = "1.1.0";
-  sha256 = "0r0a3s1dngqp2vcq0cdsbqf1lsyhygj2x4a93csr2iyn244zgxnx";
+  version = "1.2.0";
+  sha256 = "1d7z0v6jrl08w7qz3apwdjss3vq151y28l7231cpqiia46damib2";
   buildDepends = [ pathPieces text vector ];
+  testDepends = [ hspec HUnit pathPieces text ];
   meta = {
     homepage = "http://www.yesodweb.com/";
     description = "Efficient routing for Yesod";
diff --git a/pkgs/development/libraries/haskell/yesod-static/default.nix b/pkgs/development/libraries/haskell/yesod-static/default.nix
index d7e9498c968..d341434345b 100644
--- a/pkgs/development/libraries/haskell/yesod-static/default.nix
+++ b/pkgs/development/libraries/haskell/yesod-static/default.nix
@@ -1,16 +1,24 @@
 { cabal, base64Bytestring, cereal, conduit, cryptoConduit
-, cryptohash, fileEmbed, httpTypes, systemFilepath, text
-, transformers, unixCompat, wai, waiAppStatic, yesodCore
+, cryptohash, dataDefault, fileEmbed, hspec, httpTypes
+, shakespeareCss, systemFileio, systemFilepath, text, transformers
+, unixCompat, wai, waiAppStatic, yesodCore
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod-static";
-  version = "1.1.0";
-  sha256 = "07aynfgr5hbm98yimlbw9scph387rkxh4mdij4is1mcv2rdhvhxm";
+  version = "1.2.0";
+  sha256 = "18fkphk8qzshm5r0ivdvllmbmvl5q6m84zsf1g0fmridqz2xywjz";
   buildDepends = [
-    base64Bytestring cereal conduit cryptoConduit cryptohash fileEmbed
-    httpTypes systemFilepath text transformers unixCompat wai
-    waiAppStatic yesodCore
+    base64Bytestring cereal conduit cryptoConduit cryptohash
+    dataDefault fileEmbed httpTypes shakespeareCss systemFileio
+    systemFilepath text transformers unixCompat wai waiAppStatic
+    yesodCore
+  ];
+  testDepends = [
+    base64Bytestring cereal conduit cryptoConduit cryptohash
+    dataDefault fileEmbed hspec httpTypes shakespeareCss systemFileio
+    systemFilepath text transformers unixCompat wai waiAppStatic
+    yesodCore
   ];
   meta = {
     homepage = "http://www.yesodweb.com/";
diff --git a/pkgs/development/libraries/haskell/yesod-test/default.nix b/pkgs/development/libraries/haskell/yesod-test/default.nix
new file mode 100644
index 00000000000..f32e90dab17
--- /dev/null
+++ b/pkgs/development/libraries/haskell/yesod-test/default.nix
@@ -0,0 +1,27 @@
+{ cabal, attoparsec, blazeBuilder, blazeHtml, blazeMarkup
+, caseInsensitive, cookie, hspec, htmlConduit, httpTypes, HUnit
+, monadControl, network, persistent, poolConduit, text, time
+, transformers, wai, waiTest, xmlConduit, xmlTypes, yesodCore
+, yesodForm
+}:
+
+cabal.mkDerivation (self: {
+  pname = "yesod-test";
+  version = "1.2.0";
+  sha256 = "184hfhp62jq2icyn1l6s8kvdcsa6099vmykg2nxrafg9f83lb53q";
+  buildDepends = [
+    attoparsec blazeBuilder blazeHtml blazeMarkup caseInsensitive
+    cookie hspec htmlConduit httpTypes HUnit monadControl network
+    persistent poolConduit text time transformers wai waiTest
+    xmlConduit xmlTypes yesodCore
+  ];
+  testDepends = [
+    hspec htmlConduit HUnit text xmlConduit yesodCore yesodForm
+  ];
+  meta = {
+    homepage = "http://www.yesodweb.com";
+    description = "integration testing for WAI/Yesod Applications";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/yesod/default.nix b/pkgs/development/libraries/haskell/yesod/default.nix
index eeb2e376680..53dc5cab87c 100644
--- a/pkgs/development/libraries/haskell/yesod/default.nix
+++ b/pkgs/development/libraries/haskell/yesod/default.nix
@@ -1,23 +1,18 @@
-{ cabal, attoparsec, blazeBuilder, blazeHtml, blazeMarkup, Cabal
-, filepath, hamlet, httpTypes, monadControl, parsec, shakespeareCss
-, shakespeareJs, shakespeareText, systemFileio, systemFilepath, tar
-, text, time, transformers, unixCompat, unorderedContainers, wai
-, waiExtra, warp, yaml, yesodAuth, yesodCore, yesodForm, yesodJson
-, yesodPersistent, zlib
+{ cabal, aeson, blazeHtml, blazeMarkup, dataDefault, hamlet
+, monadControl, networkConduit, safe, shakespeareCss, shakespeareJs
+, text, transformers, unorderedContainers, wai, waiExtra, warp
+, yaml, yesodAuth, yesodCore, yesodForm, yesodPersistent
 }:
 
 cabal.mkDerivation (self: {
   pname = "yesod";
-  version = "1.1.0.2";
-  sha256 = "0r89sg0nnv3x46l9z39gn109a38jzr46lgx33v18268maqlc7brb";
-  isLibrary = true;
-  isExecutable = true;
+  version = "1.2.0.1";
+  sha256 = "1whkw0lmkyja2j6vbfcf5rjmmhmc85r4arjwjrvdmz6jkjyqham3";
   buildDepends = [
-    attoparsec blazeBuilder blazeHtml blazeMarkup Cabal filepath hamlet
-    httpTypes monadControl parsec shakespeareCss shakespeareJs
-    shakespeareText systemFileio systemFilepath tar text time
-    transformers unixCompat unorderedContainers wai waiExtra warp yaml
-    yesodAuth yesodCore yesodForm yesodJson yesodPersistent zlib
+    aeson blazeHtml blazeMarkup dataDefault hamlet monadControl
+    networkConduit safe shakespeareCss shakespeareJs text transformers
+    unorderedContainers wai waiExtra warp yaml yesodAuth yesodCore
+    yesodForm yesodPersistent
   ];
   meta = {
     homepage = "http://www.yesodweb.com/";
diff --git a/pkgs/development/libraries/haskell/yst/default.nix b/pkgs/development/libraries/haskell/yst/default.nix
index 6a94987ba91..d194b1970c8 100644
--- a/pkgs/development/libraries/haskell/yst/default.nix
+++ b/pkgs/development/libraries/haskell/yst/default.nix
@@ -1,16 +1,16 @@
-{ cabal, csv, filepath, HsSyck, HStringTemplate, pandoc, parsec
-, split, time, utf8String, xhtml
+{ cabal, csv, filepath, HDBC, HDBCSqlite3, HsSyck, HStringTemplate
+, pandoc, parsec, split, time, utf8String, xhtml
 }:
 
 cabal.mkDerivation (self: {
   pname = "yst";
-  version = "0.2.4.1";
-  sha256 = "0y620p6kn1mky30fia63na5idppfjfmc828jcaa0ads08rmj5wgy";
+  version = "0.3.1.1";
+  sha256 = "1wc2s5aan4rqdrpqgqvka5pqm3d691si5hdf0m0wpi2hzkwl3qv3";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
-    csv filepath HsSyck HStringTemplate pandoc parsec split time
-    utf8String xhtml
+    csv filepath HDBC HDBCSqlite3 HsSyck HStringTemplate pandoc parsec
+    split time utf8String xhtml
   ];
   meta = {
     homepage = "http://github.com/jgm/yst";
diff --git a/pkgs/development/libraries/haskell/zeromq-haskell/default.nix b/pkgs/development/libraries/haskell/zeromq-haskell/default.nix
index f5166f0f1f0..20d414ac6b1 100644
--- a/pkgs/development/libraries/haskell/zeromq-haskell/default.nix
+++ b/pkgs/development/libraries/haskell/zeromq-haskell/default.nix
@@ -1,9 +1,14 @@
-{ cabal, zeromq }:
+{ cabal, QuickCheck, testFramework, testFrameworkQuickcheck2
+, zeromq
+}:
 
 cabal.mkDerivation (self: {
   pname = "zeromq-haskell";
   version = "0.8.4";
   sha256 = "0lvjszi08r5wm5ch03153y7lir6cdgqr2gnhq45j4b0kid6gkpv3";
+  testDepends = [
+    QuickCheck testFramework testFrameworkQuickcheck2
+  ];
   extraLibraries = [ zeromq ];
   meta = {
     homepage = "http://github.com/twittner/zeromq-haskell/";
diff --git a/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
new file mode 100644
index 00000000000..3b4f9f8ff32
--- /dev/null
+++ b/pkgs/development/libraries/haskell/zeromq3-haskell/default.nix
@@ -0,0 +1,22 @@
+{ cabal, ansiTerminal, checkers, MonadCatchIOTransformers
+, QuickCheck, transformers, zeromq
+}:
+
+cabal.mkDerivation (self: {
+  pname = "zeromq3-haskell";
+  version = "0.3.1";
+  sha256 = "0wr157wl2qpnbfsqy4nlsnd6nbkl063387f7ab4qa07yhj5av80f";
+  buildDepends = [ MonadCatchIOTransformers transformers ];
+  testDepends = [
+    ansiTerminal checkers MonadCatchIOTransformers QuickCheck
+    transformers
+  ];
+  extraLibraries = [ zeromq ];
+  doCheck = false;
+  meta = {
+    homepage = "http://github.com/twittner/zeromq-haskell/";
+    description = "Bindings to ZeroMQ 3.x";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/libraries/haskell/zip-archive/default.nix b/pkgs/development/libraries/haskell/zip-archive/default.nix
index 050d48280d2..38290c8cd54 100644
--- a/pkgs/development/libraries/haskell/zip-archive/default.nix
+++ b/pkgs/development/libraries/haskell/zip-archive/default.nix
@@ -1,12 +1,16 @@
-{ cabal, binary, digest, filepath, mtl, utf8String, zlib }:
+{ cabal, binary, digest, filepath, HUnit, mtl, time, utf8String
+, zlib
+}:
 
 cabal.mkDerivation (self: {
   pname = "zip-archive";
-  version = "0.1.1.8";
-  sha256 = "0rq4jk1sxi6lrc7d7sh500lh83v2fxxrfh2gknqiyzxd3wh364y1";
+  version = "0.1.3.4";
+  sha256 = "0hvndr3gb7fiv4qjwjvic5mg7wq7h7nw3c3v5xq8fnlr1l943vyb";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ binary digest filepath mtl utf8String zlib ];
+  buildDepends = [ binary digest filepath mtl time utf8String zlib ];
+  testDepends = [ HUnit time ];
+  doCheck = false;
   meta = {
     homepage = "http://github.com/jgm/zip-archive";
     description = "Library for creating and modifying zip archives";
diff --git a/pkgs/development/libraries/haskell/zipper/default.nix b/pkgs/development/libraries/haskell/zipper/default.nix
index bf27fa78162..5ff1da422ef 100644
--- a/pkgs/development/libraries/haskell/zipper/default.nix
+++ b/pkgs/development/libraries/haskell/zipper/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zipper";
-  version = "0.4.1";
-  sha256 = "19xgvqznf200akzf19mp40fg75c0gzpp38wq3n671nm90r08lgvi";
+  version = "0.4.2";
+  sha256 = "1r8092amq5w9gl5szycl1r7wx87xnmkcapdzcwfa4c3pvxrhjy44";
   buildDepends = [ multirec ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/GenericProgramming/Multirec";
diff --git a/pkgs/development/libraries/haskell/zlib-bindings/default.nix b/pkgs/development/libraries/haskell/zlib-bindings/default.nix
index 3bb9d314957..f69be8ae99e 100644
--- a/pkgs/development/libraries/haskell/zlib-bindings/default.nix
+++ b/pkgs/development/libraries/haskell/zlib-bindings/default.nix
@@ -1,10 +1,11 @@
-{ cabal, zlib }:
+{ cabal, hspec, QuickCheck, zlib }:
 
 cabal.mkDerivation (self: {
   pname = "zlib-bindings";
-  version = "0.1.1";
-  sha256 = "0hgqr7sh3pri482191gd9qrz2nbgxw1aqdx1x6lc9s0bbw68isai";
+  version = "0.1.1.3";
+  sha256 = "18jhav7chbapakm9mwn7bn9lgvip7qaz61dw5gwv2nyalvm96qfr";
   buildDepends = [ zlib ];
+  testDepends = [ hspec QuickCheck zlib ];
   meta = {
     homepage = "http://github.com/snoyberg/zlib-bindings";
     description = "Low-level bindings to the zlib package";
diff --git a/pkgs/development/libraries/haskell/zlib-conduit/default.nix b/pkgs/development/libraries/haskell/zlib-conduit/default.nix
index 0f6a3656126..b283c496a29 100644
--- a/pkgs/development/libraries/haskell/zlib-conduit/default.nix
+++ b/pkgs/development/libraries/haskell/zlib-conduit/default.nix
@@ -1,10 +1,13 @@
-{ cabal, conduit, transformers, void, zlibBindings }:
+{ cabal, conduit, hspec, QuickCheck, resourcet, transformers, void
+, zlibBindings
+}:
 
 cabal.mkDerivation (self: {
   pname = "zlib-conduit";
-  version = "0.5.0";
-  sha256 = "0mba63wx11vb9xir4fbp031ay71xv8b3rnj8gnihsxf3yqq09b99";
+  version = "1.0.0";
+  sha256 = "0q0l4qw1f2cwjj71n4i082ba47x1xba695q8xk0ky2vw5s8cg0bv";
   buildDepends = [ conduit transformers void zlibBindings ];
+  testDepends = [ conduit hspec QuickCheck resourcet transformers ];
   meta = {
     homepage = "http://github.com/snoyberg/conduit";
     description = "Streaming compression/decompression via conduits";
diff --git a/pkgs/development/libraries/haskell/zlib-enum/default.nix b/pkgs/development/libraries/haskell/zlib-enum/default.nix
index d4ec47410fc..f799194c0f6 100644
--- a/pkgs/development/libraries/haskell/zlib-enum/default.nix
+++ b/pkgs/development/libraries/haskell/zlib-enum/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "zlib-enum";
-  version = "0.2.2.1";
-  sha256 = "02ava6h40bqfmby33683nxasfw5fmrgfvbx6kqgz1gqz5921gjx9";
+  version = "0.2.3";
+  sha256 = "0lr72h4wlclav0p0j5wwaxifq97lw7rh3612lva73fg45akl9di1";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ enumerator transformers zlibBindings ];
diff --git a/pkgs/development/libraries/haskell/zlib/0.5.3.3.nix b/pkgs/development/libraries/haskell/zlib/0.5.3.3.nix
index a151a45c0e7..bba9e1a13fe 100644
--- a/pkgs/development/libraries/haskell/zlib/0.5.3.3.nix
+++ b/pkgs/development/libraries/haskell/zlib/0.5.3.3.nix
@@ -5,6 +5,7 @@ cabal.mkDerivation (self: {
   version = "0.5.3.3";
   sha256 = "1hrq34w9y8m7nahvrdpnkh9rdb4jycpcpv9ix6qrxijvbz2vdbg2";
   extraLibraries = [ zlib ];
+  jailbreak = true;
   meta = {
     description = "Compression and decompression in the gzip and zlib formats";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/libraries/haskell/zlib/0.5.4.0.nix b/pkgs/development/libraries/haskell/zlib/0.5.4.0.nix
new file mode 100644
index 00000000000..abeed295e03
--- /dev/null
+++ b/pkgs/development/libraries/haskell/zlib/0.5.4.0.nix
@@ -0,0 +1,14 @@
+{ cabal, zlib }:
+
+cabal.mkDerivation (self: {
+  pname = "zlib";
+  version = "0.5.4.0";
+  sha256 = "18hc4wr8brzbl9qapjbjyb9kyqrznv2xbw7rv1a6k8i3392ilxv1";
+  extraLibraries = [ zlib ];
+  meta = {
+    description = "Compression and decompression in the gzip and zlib formats";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/haskell/zlib/0.5.4.1.nix b/pkgs/development/libraries/haskell/zlib/0.5.4.1.nix
new file mode 100644
index 00000000000..c1fa7d78d0a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/zlib/0.5.4.1.nix
@@ -0,0 +1,14 @@
+{ cabal, zlib }:
+
+cabal.mkDerivation (self: {
+  pname = "zlib";
+  version = "0.5.4.1";
+  sha256 = "0l550l2qw4gx530h1yjjpdh6rkm59l9l6jbmlm0vx41cqpj6b8yc";
+  extraLibraries = [ zlib ];
+  meta = {
+    description = "Compression and decompression in the gzip and zlib formats";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/libraries/hspell/dicts.nix b/pkgs/development/libraries/hspell/dicts.nix
index a7f0d19865c..fd456ca6209 100644
--- a/pkgs/development/libraries/hspell/dicts.nix
+++ b/pkgs/development/libraries/hspell/dicts.nix
@@ -2,7 +2,7 @@
 
 let
   dict = a: stdenv.mkDerivation ({
-    inherit (hspell) src patchPhase buildNativeInputs;
+    inherit (hspell) src patchPhase nativeBuildInputs;
     meta = hspell.meta // {
       description = "${a.buildFlags} Hebrew dictionary";
     } // (if a ? meta then a.meta else {});
diff --git a/pkgs/development/libraries/http_parser/build-shared.patch b/pkgs/development/libraries/http_parser/build-shared.patch
new file mode 100644
index 00000000000..5922cdfb584
--- /dev/null
+++ b/pkgs/development/libraries/http_parser/build-shared.patch
@@ -0,0 +1,30 @@
+diff -Naur http-parser-2.1-orig/http_parser.gyp http-parser-2.1/http_parser.gyp
+--- http-parser-2.1-orig/http_parser.gyp	2013-03-26 18:35:20.000000000 -0400
++++ http-parser-2.1/http_parser.gyp	2013-05-23 16:47:49.280488341 -0400
+@@ -21,7 +21,7 @@
+       },
+       'Release': {
+         'defines': [ 'NDEBUG' ],
+-        'cflags': [ '-Wall', '-Wextra', '-O3' ],
++        'cflags': [ '-Wall', '-Wextra', '-O3', '-fPIC' ],
+         'msvs_settings': {
+           'VCCLCompilerTool': {
+             'RuntimeLibrary': 0, # static release
+@@ -50,7 +50,7 @@
+   'targets': [
+     {
+       'target_name': 'http_parser',
+-      'type': 'static_library',
++      'type': 'shared_library',
+       'include_dirs': [ '.' ],
+       'direct_dependent_settings': {
+         'defines': [ 'HTTP_PARSER_STRICT=0' ],
+@@ -73,7 +73,7 @@
+ 
+     {
+       'target_name': 'http_parser_strict',
+-      'type': 'static_library',
++      'type': 'shared_library',
+       'include_dirs': [ '.' ],
+       'direct_dependent_settings': {
+         'defines': [ 'HTTP_PARSER_STRICT=1' ],
diff --git a/pkgs/development/libraries/http_parser/default.nix b/pkgs/development/libraries/http_parser/default.nix
new file mode 100644
index 00000000000..09371e4efb8
--- /dev/null
+++ b/pkgs/development/libraries/http_parser/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, gyp, utillinux, python }:
+
+let
+  version = "2.1";
+in stdenv.mkDerivation {
+  name = "http-parser-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/joyent/http-parser/archive/v${version}.tar.gz";
+    sha256 = "16a2w5z4g2bma25fqcrkpidqzlq8a2jxkk93ajl721q85406j105";
+  };
+
+  patches = [ ./build-shared.patch ];
+
+  configurePhase = "gyp -f make --depth=`pwd` http_parser.gyp";
+
+  buildFlags = [ "BUILDTYPE=Release" ];
+
+  buildInputs = [ gyp ] ++ (stdenv.lib.optional stdenv.isLinux utillinux) ++ stdenv.lib.optional stdenv.isDarwin python;
+
+  doCheck = !stdenv.isDarwin;
+
+  checkPhase = ''
+    out/Release/test-nonstrict
+    out/Release/test-strict
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    mv out/Release/${if stdenv.isDarwin then "*.dylib" else "lib.target/*"} $out/lib
+
+    mkdir -p $out/include
+    mv http_parser.h $out/include
+  '';
+
+  postFixup = if stdenv.isDarwin then ''
+    install_name_tool -id $out/lib/libhttp_parser.dylib $out/lib/libhttp_parser.dylib
+    install_name_tool -id $out/lib/libhttp_parser_strict.dylib $out/lib/libhttp_parser_strict.dylib
+  '' else null;
+
+  meta = {
+    description = "An HTTP message parser written in C";
+
+    homepage = https://github.com/joyent/http-parser;
+
+    license = stdenv.lib.licenses.mit;
+
+    maintainer = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/development/libraries/hunspell/default.nix b/pkgs/development/libraries/hunspell/default.nix
index c5243bc6393..04be58eb50a 100644
--- a/pkgs/development/libraries/hunspell/default.nix
+++ b/pkgs/development/libraries/hunspell/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "hunspell-1.3.2";
 
   src = fetchurl {
-    url = "mirror://sf/hunspell/${name}.tar.gz";
+    url = "mirror://sourceforge/hunspell/${name}.tar.gz";
     sha256 = "1gfxdajnqk2civkshkfjx5ldg7kjdgj76m5khpsbjk4lxsjd9vdl";
   };
 
diff --git a/pkgs/development/libraries/hwloc/default.nix b/pkgs/development/libraries/hwloc/default.nix
index 4f2bd4f679a..3c5f198cea6 100644
--- a/pkgs/development/libraries/hwloc/default.nix
+++ b/pkgs/development/libraries/hwloc/default.nix
@@ -2,15 +2,15 @@
 , pciutils, numactl }:
 
 stdenv.mkDerivation rec {
-  name = "hwloc-1.4.2";
+  name = "hwloc-1.6";
 
   src = fetchurl {
-    url = "http://www.open-mpi.org/software/hwloc/v1.4/downloads/${name}.tar.bz2";
-    sha256 = "0xamcnbkrf18v1rj4h6ddx6cn4gffx6zgzjaym8c3k5mlpgigfdw";
+    url = "http://www.open-mpi.org/software/hwloc/v1.6/downloads/${name}.tar.bz2";
+    sha256 = "0y561bryiqp1f5af5lm432dcw93xwp1jw55si7wa6skxnd6ch25w";
   };
 
   # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   # Filter out `null' inputs.  This allows users to `.override' the
   # derivation and set optional dependencies to `null'.
@@ -23,6 +23,8 @@ stdenv.mkDerivation rec {
     # Since `libpci' appears in `hwloc.pc', it must be propagated.
     stdenv.lib.optional stdenv.isLinux pciutils;
 
+  enableParallelBuilding = true;
+
   postInstall =
     stdenv.lib.optionalString (stdenv.isLinux && numactl != null)
       '' if [ -d "${numactl}/lib64" ]
diff --git a/pkgs/development/libraries/icu/default.nix b/pkgs/development/libraries/icu/default.nix
index 0474b79a847..3d37db20edc 100644
--- a/pkgs/development/libraries/icu/default.nix
+++ b/pkgs/development/libraries/icu/default.nix
@@ -2,25 +2,26 @@
 
 let
   pname = "icu4c";
-  version = "4.8.1";
+  version = "51.1";
 in
 
 stdenv.mkDerivation {
   name = pname + "-" + version;
-  
+
   src = fetchurl {
-    url = "http://download.icu-project.org/files/${pname}/${version}/${pname}-"
-      + (stdenv.lib.replaceChars ["."] ["_"] version) + "-src.tgz";
-    sha256 = "13zq190gl54zr84f0k48w9knarjsb966jkailyy06yhqjipcv90r";
+    url = http://download.icu-project.org/files/icu4c/51.1/icu4c-51_1-src.tgz;
+    sha256 = "0sv6hgkm92pm27zgjxgk284lcxxbsl0syi40ckw2b7yj7d8sxrc7";
   };
 
-  postUnpack = "
-    sourceRoot=\${sourceRoot}/source
-    echo Source root reset to \${sourceRoot}
-  ";
-  
+  postUnpack = ''
+    sourceRoot=''${sourceRoot}/source
+    echo Source root reset to ''${sourceRoot}
+  '';
+
   configureFlags = "--disable-debug";
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Unicode and globalization support library";
     homepage = http://site.icu-project.org/;
diff --git a/pkgs/development/libraries/ilbc/default.nix b/pkgs/development/libraries/ilbc/default.nix
index 3ab4e7e738c..d77b5d46a79 100644
--- a/pkgs/development/libraries/ilbc/default.nix
+++ b/pkgs/development/libraries/ilbc/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "0zf4mvi3jzx6zjrfl2rbhl2m68pzbzpf1vbdmn7dqbfpcb67jpdy";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   unpackPhase = ''
     mkdir -v ${name}
diff --git a/pkgs/development/libraries/imlib2/default.nix b/pkgs/development/libraries/imlib2/default.nix
index 83adb16bbc8..d77e2052f81 100644
--- a/pkgs/development/libraries/imlib2/default.nix
+++ b/pkgs/development/libraries/imlib2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ x11 libjpeg libtiff libungif libpng bzip2 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     platforms = stdenv.lib.platforms.gnu; # random choice
diff --git a/pkgs/development/libraries/indilib/default.nix b/pkgs/development/libraries/indilib/default.nix
index 9fc5ac665e8..dd8207ffa2b 100644
--- a/pkgs/development/libraries/indilib/default.nix
+++ b/pkgs/development/libraries/indilib/default.nix
@@ -1,13 +1,15 @@
 { stdenv, fetchurl, cmake, cfitsio, libusb, zlib, boost }:
 
 stdenv.mkDerivation {
-  name = "indilib-0.8";
+  name = "indilib-0.9.6";
 
   src = fetchurl {
-    url = mirror://sf/indi/libindi_0.8.tar.gz;
-    sha256 = "d5ed14a5de6fd6e5db15463ada96c2b15b53e84a1ffe199b76f70128493f2a65";
+    url = mirror://sourceforge/indi/libindi_0.9.6.tar.gz;
+    sha256 = "1cyhsrsl68iczc4gcdnrrdh0r1dxjac6prxjfkw15wz97ya0mvs4";
   };
 
+  patches = [ ./link-zlib.patch ./udev-dir.patch ];
+
   propagatedBuildInputs = [ cmake cfitsio libusb zlib boost ];
 
   meta = {
diff --git a/pkgs/development/libraries/indilib/link-zlib.patch b/pkgs/development/libraries/indilib/link-zlib.patch
new file mode 100644
index 00000000000..c051194a1b8
--- /dev/null
+++ b/pkgs/development/libraries/indilib/link-zlib.patch
@@ -0,0 +1,12 @@
+diff -Naur libindi-0.9.6-upstream/CMakeLists.txt libindi-0.9.6/CMakeLists.txt
+--- libindi-0.9.6-upstream/CMakeLists.txt	2012-11-19 16:09:14.000000000 -0430
++++ libindi-0.9.6/CMakeLists.txt	2013-05-02 16:50:25.666624174 -0430
+@@ -169,7 +169,7 @@
+ # To link with main() and indibase classes  ######

+ ##################################################

+ add_library(indidriver SHARED ${libindicom_SRCS} ${liblilxml_SRCS} ${indimain_SRCS} ${indidriver_SRCS})

+-target_link_libraries(indidriver ${LIBUSB_LIBRARIES})

++target_link_libraries(indidriver z ${LIBUSB_LIBRARIES})

+ if (NOVA_FOUND)

+ target_link_libraries(indidriver ${NOVA_LIBRARIES})

+ endif(NOVA_FOUND)

diff --git a/pkgs/development/libraries/indilib/udev-dir.patch b/pkgs/development/libraries/indilib/udev-dir.patch
new file mode 100644
index 00000000000..2f6d03d6070
--- /dev/null
+++ b/pkgs/development/libraries/indilib/udev-dir.patch
@@ -0,0 +1,12 @@
+diff -Naur libindi-0.9.6-upstream/CMakeLists.txt libindi-0.9.6/CMakeLists.txt
+--- libindi-0.9.6-upstream/CMakeLists.txt	2012-11-19 16:09:14.000000000 -0430
++++ libindi-0.9.6/CMakeLists.txt	2013-05-02 17:02:55.455944987 -0430
+@@ -13,7 +13,7 @@
+ set(DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/indi/")

+ set(BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")

+ set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include")

+-set(UDEVRULES_INSTALL_DIR "/etc/udev/rules.d")

++set(UDEVRULES_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/etc/udev/rules.d")

+ 

+ IF(APPLE)

+ set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")

diff --git a/pkgs/development/libraries/intel-tbb/default.nix b/pkgs/development/libraries/intel-tbb/default.nix
new file mode 100644
index 00000000000..ad2c317a9ef
--- /dev/null
+++ b/pkgs/development/libraries/intel-tbb/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "intel-tbb-4.1";
+  
+  src = fetchurl {
+    url = http://threadingbuildingblocks.org/sites/default/files/software_releases/linux/tbb41_20121003oss_lin.tgz;
+    sha256 = "12vxljcgkrcyw9mm8v5vfk03nkf3bmwz60r2qbljs0hl2yrx8jml";
+  };
+
+  buildPhase = ''
+    mkdir -p $out
+    cp -R * $out
+
+    for f in $out/lib/${if stdenv.system == "x86_64-linux" then "linux64" else "ia32"}/*.so.2; do
+      patchelf --set-rpath ${stdenv.gcc.gcc}/lib:${stdenv.gcc.gcc}/lib64 $f
+    done
+
+    rm $out/CHANGES $out/README $out/COPYING
+  '';
+
+  dontInstall = true;
+
+  meta = {
+    homepage = http://threadingbuildingblocks.org/;
+  };
+}
diff --git a/pkgs/development/libraries/iso-codes/default.nix b/pkgs/development/libraries/iso-codes/default.nix
index a0119866df0..4e6614345c1 100644
--- a/pkgs/development/libraries/iso-codes/default.nix
+++ b/pkgs/development/libraries/iso-codes/default.nix
@@ -1,10 +1,10 @@
-{stdenv, fetchurl, gettext, python}:
+{stdenv, fetchurl, gettext, python, xz}:
 
 stdenv.mkDerivation rec {
-  name = "iso-codes-3.23";
+  name = "iso-codes-3.40";
   src = fetchurl {
-    url = "ftp://pkg-isocodes.alioth.debian.org/pub/pkg-isocodes/${name}.tar.bz2";
-    sha256 = "0lf9phrdr10biihqswq1qmwk5cz954nwavgbnpm7a5r6vzfzkfbq";
+    url = "http://pkg-isocodes.alioth.debian.org/downloads/${name}.tar.xz";
+    sha256 = "0iph96n8vh4khidxg2zzhmcqnphfzg50agn0lv9cjhmnx0i712pr";
   };
   patchPhase = ''
     for i in `find . -name \*.py`
@@ -13,6 +13,7 @@ stdenv.mkDerivation rec {
     done
   '';
   buildInputs = [ gettext ];
+  nativeBuildInputs = [ xz ];
 
   meta = {
     homepage = http://pkg-isocodes.alioth.debian.org/;
diff --git a/pkgs/development/libraries/itk/default.nix b/pkgs/development/libraries/itk/default.nix
index 6be998b691a..bfe10490fc7 100644
--- a/pkgs/development/libraries/itk/default.nix
+++ b/pkgs/development/libraries/itk/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildNativeInputs = [ cmake xz ];
+  nativeBuildInputs = [ cmake xz ];
   buildInputs = [ libX11 libuuid ];
 
   meta = {
diff --git a/pkgs/development/libraries/jansson/default.nix b/pkgs/development/libraries/jansson/default.nix
new file mode 100644
index 00000000000..a1f9983abe2
--- /dev/null
+++ b/pkgs/development/libraries/jansson/default.nix
@@ -0,0 +1,16 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "jansson-2.4";
+
+  src = fetchurl {
+    url = "http://www.digip.org/jansson/releases/${name}.tar.gz";
+    sha256 = "1fcbd1ac3d8b610644acf86a5731d760bb228c9acbace20a2ad0f23baec79b41";
+  };
+
+  meta = {
+    homepage = "http://www.digip.org/jansson/";
+    description = "Jansson is a C library for encoding, decoding and manipulating JSON data.";
+    license = "MIT";
+  };
+}
diff --git a/pkgs/development/libraries/jasper/default.nix b/pkgs/development/libraries/jasper/default.nix
index 8cf4cc7991f..4046c05f79e 100644
--- a/pkgs/development/libraries/jasper/default.nix
+++ b/pkgs/development/libraries/jasper/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "154l7zk7yh3v8l2l6zm5s2alvd2fzkp6c9i18iajfbna5af5m43b";
   };
 
-  buildNativeInputs = [unzip];
+  nativeBuildInputs = [unzip];
   propagatedBuildInputs = [ libjpeg ];
 
   configureFlags = "--enable-shared";
diff --git a/pkgs/development/libraries/java/rhino/default.nix b/pkgs/development/libraries/java/rhino/default.nix
index 800ae7ba718..3e666c9fa23 100644
--- a/pkgs/development/libraries/java/rhino/default.nix
+++ b/pkgs/development/libraries/java/rhino/default.nix
@@ -5,7 +5,7 @@ let
   options = "-Dbuild.compiler=gcj";   # FIXME: We assume GCJ here.
 
   xbeans  = fetchurl {
-    url = "http://www.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
+    url = "http://archive.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
     sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
   };
 in
diff --git a/pkgs/development/libraries/javascript/jquery-ui/default.nix b/pkgs/development/libraries/javascript/jquery-ui/default.nix
index 2334a04f9b8..e2d48f25bb5 100644
--- a/pkgs/development/libraries/javascript/jquery-ui/default.nix
+++ b/pkgs/development/libraries/javascript/jquery-ui/default.nix
@@ -1,15 +1,13 @@
 { stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
-  name = "jquery-ui-1.8.10";
+  name = "jquery-ui-1.10.2";
 
   src = fetchurl {
-    url = "http://jqueryui.com/download/${name}.custom.zip";
-    sha256 = "0yglab9zmxr1il2rmxxd7gycpfaavgpi03h8nc5b2yx2kz80jlik";
+    url = "http://jqueryui.com/resources/download/${name}.custom.zip";
+    sha256 = "0r1fmqpym7bjqhjay9br4h3izky781bsda7v7552yjwkgiv391hl";
   };
 
-  sourceRoot = ".";
-
   buildInputs = [ unzip ];
 
   installPhase =
diff --git a/pkgs/development/libraries/jbig2dec/default.nix b/pkgs/development/libraries/jbig2dec/default.nix
index 60c6e9922a4..e15c5c8d179 100644
--- a/pkgs/development/libraries/jbig2dec/default.nix
+++ b/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchurl }: 
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "jbig2dec-0.11";
-  
+
   src = fetchurl {
-    url = http://ghostscript.com/~giles/jbig2/jbig2dec/jbig2dec-0.11.tar.gz;
-    sha256 = "1ffhgmf2fqzk0h4k736pp06z7q5y4x41fg844bd6a9vgncq86bby";
+    url = "mirror://sourceforge/jbig2dec/${name}.tar.xz";
+    sha256 = "1xddc30garsg5j8p348cz5l8vn8j7723c0sykv0kc1w5ihaghsq1";
   };
-  
+
   meta = {
     homepage = http://jbig2dec.sourceforge.net/;
     description = "Decoder implementation of the JBIG2 image compression format";
diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix
index ace271b7a35..8ca1445b1f6 100644
--- a/pkgs/development/libraries/json-glib/default.nix
+++ b/pkgs/development/libraries/json-glib/default.nix
@@ -5,12 +5,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl_gnome {
     project = "json-glib";
-    major = "0"; minor = "14"; patchlevel = "0"; extension = "xz";
-    sha256 = "0mpw996cyidspjwns281l5haj9i8azpkfpl4jf98lh3kcqcr07l2";
+    major = "0"; minor = "14"; patchlevel = "2"; extension = "xz";
+    sha256 = "19wlpsbdnm3mq2a6yjpzj0cwrmlkarp2m5x6g63b0r2n7vxaa5mq";
   };
 
   propagatedBuildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://live.gnome.org/JsonGlib;
diff --git a/pkgs/development/libraries/kdevplatform/default.nix b/pkgs/development/libraries/kdevplatform/default.nix
index 10aa4c02028..2ff2fac296d 100644
--- a/pkgs/development/libraries/kdevplatform/default.nix
+++ b/pkgs/development/libraries/kdevplatform/default.nix
@@ -2,17 +2,17 @@
   gettext, pkgconfig, apr, aprutil, boost, qjson }:
 
 stdenv.mkDerivation rec {
-  name = "kdevplatform-1.3.0";
+  name = "kdevplatform-1.3.1";
 
   src = fetchurl {
-    url = "mirror://kde/stable/kdevelop/4.3.0/src/${name}.tar.bz2";
-    sha256 = "0afka8999csyj8hbgmcsbn8h2by04v7n8k4mrwkl0b79crdvwbcd";
+    url = "mirror://kde/stable/kdevelop/4.3.1/src/${name}.tar.bz2";
+    sha256 = "1fiqwabw5ilhw1jwvvr743dym12y3kxrs3zlqahz57yncdsglcl6";
   };
 
   propagatedBuildInputs = [ kdelibs qt4 phonon ];
   buildInputs = [ apr aprutil subversion boost qjson ];
 
-  buildNativeInputs = [ cmake automoc4 gettext pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 gettext pkgconfig ];
 
   meta = {
     maintainers = [ stdenv.lib.maintainers.urkud ];
diff --git a/pkgs/development/libraries/kerberos/heimdal.nix b/pkgs/development/libraries/kerberos/heimdal.nix
index 72adb808aa1..b0a5ecedcc6 100644
--- a/pkgs/development/libraries/kerberos/heimdal.nix
+++ b/pkgs/development/libraries/kerberos/heimdal.nix
@@ -1,18 +1,16 @@
 { stdenv, fetchurl, openldap, readline, db4, openssl, cyrus_sasl, sqlite} :
 
 stdenv.mkDerivation rec {
-  name = "heimdal-1.3.3";
+  name = "heimdal-1.5.2";
 
   src = fetchurl {
     urls = [
       "http://www.h5l.org/dist/src/${name}.tar.gz"
       "http://ftp.pdc.kth.se/pub/heimdal/src/${name}.tar.gz"
     ];
-    sha256 = "0c465by1g7niy3nkfs5mwrm6j6w2cvrf4988h3lpmj194lkjp3cc";
+    sha256 = "22603f282f31173533b939d289f3374258aa1ccccbe51ee088d7568d321279ec";
   };
 
-  patches = [ ./no-md2.patch ];
-  
   ## ugly, X should be made an option
   configureFlags = [
     "--with-openldap=${openldap}"
@@ -21,7 +19,7 @@ stdenv.mkDerivation rec {
   ];
   # dont succeed with --libexec=$out/sbin, so
   postInstall = ''
-    mv $out/libexec/* $out/sbin/
+    mv "$out/libexec/"* $out/sbin/
     rmdir $out/libexec
   '';
 
diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix
index 38272165a28..a903a600da3 100644
--- a/pkgs/development/libraries/kerberos/krb5.nix
+++ b/pkgs/development/libraries/kerberos/krb5.nix
@@ -2,7 +2,7 @@
 
 let
   pname = "krb5";
-  version = "1.10";
+  version = "1.10.5";
   name = "${pname}-${version}";
   webpage = http://web.mit.edu/kerberos/;
 in
@@ -12,7 +12,7 @@ stdenv.mkDerivation (rec {
 
   src = fetchurl {
     url = "${webpage}/dist/krb5/1.10/${name}-signed.tar";
-    sha256 = "1pa4m6538drb51gsqxbbxlsnc9fm9ccid9m2s3pv3di5l0a7l8bg";
+    sha256 = "1nf195j9s8g55sh5dzbhy2l21kcdwgpn4acxrbwkvngdz9mv7g4k";
   };
 
   buildInputs = [ perl ncurses yacc ];
@@ -23,7 +23,9 @@ stdenv.mkDerivation (rec {
     cd ${name}/src
   '';
 
-  meta = { 
+  enableParallelBuilding = true;
+
+  meta = {
       description = "MIT Kerberos 5";
       homepage = webpage;
       license = "MPL";
diff --git a/pkgs/development/libraries/kerberos/no-md2.patch b/pkgs/development/libraries/kerberos/no-md2.patch
deleted file mode 100644
index c13671c988e..00000000000
--- a/pkgs/development/libraries/kerberos/no-md2.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-http://old.nabble.com/-patch--fix-build-with-openssl-1.0-td28388913.html
-
-diff -Naur -x '*~' heimdal-1.3.2/include/crypto-headers.h heimdal-1.3.2-fix-build-openssl-1.0/include/crypto-headers.h
---- heimdal-1.3.2/include/crypto-headers.h 2010-03-22 05:11:24.000000000 +0100
-+++ heimdal-1.3.2-fix-build-openssl-1.0/include/crypto-headers.h 2010-04-28 14:54:53.000000000 +0200
-@@ -13,7 +13,9 @@
- #include <openssl/des.h>
- #include <openssl/rc4.h>
- #include <openssl/rc2.h>
-+#ifdef HAVE_OPENSSL_MD2_H
- #include <openssl/md2.h>
-+#endif
- #include <openssl/md4.h>
- #include <openssl/md5.h>
- #include <openssl/sha.h>
-diff -Naur -x '*~' heimdal-1.3.2/lib/hx509/crypto.c heimdal-1.3.2-fix-build-openssl-1.0/lib/hx509/crypto.c
---- heimdal-1.3.2/lib/hx509/crypto.c 2010-03-22 05:11:24.000000000 +0100
-+++ heimdal-1.3.2-fix-build-openssl-1.0/lib/hx509/crypto.c 2010-04-28 15:12:20.000000000 +0200
-@@ -1354,6 +1354,7 @@
-     NULL
- };
- 
-+#ifdef HAVE_OPENSSL_MD2_H
- static const struct signature_alg md2_alg = {
-     "rsa-md2",
-     &asn1_oid_id_rsa_digest_md2,
-@@ -1366,6 +1367,7 @@
-     evp_md_verify_signature,
-     NULL
- };
-+#endif
- 
- /*
-  * Order matter in this structure, "best" first for each "key
-@@ -1387,7 +1389,9 @@
-     &sha256_alg,
-     &sha1_alg,
-     &md5_alg,
-+#ifdef HAVE_OPENSSL_MD2_H
-     &md2_alg,
-+#endif
-     NULL
- };
- 
-
-
diff --git a/pkgs/development/libraries/ldns/default.nix b/pkgs/development/libraries/ldns/default.nix
index a357fccca16..8479551d28d 100644
--- a/pkgs/development/libraries/ldns/default.nix
+++ b/pkgs/development/libraries/ldns/default.nix
@@ -1,10 +1,11 @@
 {stdenv, fetchurl, openssl, perl}:
 
-stdenv.mkDerivation {
-  name = "ldns-1.6.11";
+stdenv.mkDerivation rec {
+  name = "ldns-1.6.16";
+
   src = fetchurl {
-    url = "http://www.nlnetlabs.nl/downloads/ldns/ldns-1.6.11.tar.gz";
-    sha256 = "1248c9gkgfmjdmpp3lfd56vvln94ii54kbxa5iykxvcxivmbi4b8";
+    url = "http://www.nlnetlabs.nl/downloads/ldns/${name}.tar.gz";
+    sha256 = "15gn9m95r6sq2n55dw4r87p2aljb5lvy1w0y0br70wbr0p5zkci4";
   };
 
   patchPhase = ''
@@ -13,7 +14,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ openssl perl ];
 
-  configureFlags = [ "--with-ssl=${openssl}" ];
+  configureFlags = [ "--with-ssl=${openssl}" "--with-drill" ];
 
   meta = {
     description = "Library with the aim of simplifying DNS programming in C";
diff --git a/pkgs/development/libraries/leveldb/default.nix b/pkgs/development/libraries/leveldb/default.nix
new file mode 100644
index 00000000000..12846dfbe8b
--- /dev/null
+++ b/pkgs/development/libraries/leveldb/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "leveldb-1.9.0";
+
+  src = fetchurl {
+    url = "https://leveldb.googlecode.com/files/${name}.tar.gz";
+    sha256 = "b2699b04e5aba8e98382c4955b94725d1f76bd0b5decd60c5628205b717a1d4f";
+  };
+
+  buildPhase = "make all db_bench";
+
+  installPhase = "
+    mkdir -p $out/lib/
+    cp libleveldb* $out/lib/
+    mkdir -p $out/include/
+    cp -r include $out/
+    mkdir -p $out/bin/
+    cp db_bench $out/lib/
+  ";
+
+  meta = {
+    homepage = "https://code.google.com/p/leveldb/";
+    description = "A fast and lightweight key/value database library by Google.";
+    license = "BSD";
+  };
+}
diff --git a/pkgs/development/libraries/levmar/use-atlas.patch b/pkgs/development/libraries/levmar/use-atlas.patch
deleted file mode 100644
index 2be9999b40f..00000000000
--- a/pkgs/development/libraries/levmar/use-atlas.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/Makefile b/Makefile
-index af70b4c..53c6fab 100644
---- a/Makefile
-+++ b/Makefile
-@@ -15,11 +15,11 @@ DEMOBJS=lmdemo.o
- DEMOSRCS=lmdemo.c
- AR=ar
- RANLIB=ranlib
--LAPACKLIBS=-llapack -lblas -lf2c # comment this line if you are not using LAPACK.
-+#LAPACKLIBS=-llapack -lblas -lf2c # comment this line if you are not using LAPACK.
-                                  # On systems with a FORTRAN (not f2c'ed) version of LAPACK, -lf2c is
-                                  # not necessary; on others, -lf2c is equivalent to -lF77 -lI77
- 
--#LAPACKLIBS=-L/usr/local/atlas/lib -llapack -lcblas -lf77blas -latlas -lf2c # This works with the ATLAS updated lapack and Linux_P4SSE2
-+LAPACKLIBS=-llapack -lcblas -lf77blas -latlas -lgfortran # This works with the ATLAS updated lapack and Linux_P4SSE2
-                                                                             # from http://www.netlib.org/atlas/archives/linux/
- 
- #LAPACKLIBS=-llapack -lgoto2 -lpthread -lf2c # This works with GotoBLAS
-diff --git a/misc.h b/misc.h
-index e32f18d..827507e 100644
---- a/misc.h
-+++ b/misc.h
-@@ -30,11 +30,11 @@
- /* f2c'd BLAS */
- //#define LM_BLAS_PREFIX f2c_
- /* C BLAS */
--//#define LM_BLAS_PREFIX cblas_
-+#define LM_BLAS_PREFIX cblas_
- 
- /* common suffix for BLAS subroutines */
--//#define LM_BLAS_SUFFIX  // define empty if a f2c_ or cblas_ prefix was defined for LM_BLAS_PREFIX above
--#define LM_BLAS_SUFFIX _ // use this in case of no BLAS prefix
-+#define LM_BLAS_SUFFIX  // define empty if a f2c_ or cblas_ prefix was defined for LM_BLAS_PREFIX above
-+//#define LM_BLAS_SUFFIX _ // use this in case of no BLAS prefix
- 
- 
- #define LCAT_(a, b)    #a b
diff --git a/pkgs/development/libraries/libalkimia/default.nix b/pkgs/development/libraries/libalkimia/default.nix
index 7a37c61c495..d372c5cf8fc 100644
--- a/pkgs/development/libraries/libalkimia/default.nix
+++ b/pkgs/development/libraries/libalkimia/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kdelibs, gmpxx }:
+{ stdenv, fetchurl, pkgconfig, kdelibs, gmpxx }:
 
 stdenv.mkDerivation rec {
   name = "libalkimia-4.3.2";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   patchPhase = "sed -e 's/KDE4_DATA_DIR/DATA_INSTALL_DIR/' -i CMakeLists.txt";
-  buildInputs = [ kdelibs gmpxx ];
+  buildInputs = [ pkgconfig kdelibs gmpxx ];
 
   meta = {
     maintainers = [ stdenv.lib.maintainers.urkud ];
diff --git a/pkgs/development/libraries/libarchive/default.nix b/pkgs/development/libraries/libarchive/default.nix
index fc554dcd875..851601fe963 100644
--- a/pkgs/development/libraries/libarchive/default.nix
+++ b/pkgs/development/libraries/libarchive/default.nix
@@ -1,21 +1,27 @@
-{ fetchurl, stdenv, acl, openssl, libxml2, attr, zlib, bzip2, e2fsprogs
+{ fetchurl, stdenv, acl, openssl, libxml2, attr, zlib, bzip2, e2fsprogs, xz
 , sharutils }:
 
 stdenv.mkDerivation rec {
-  name = "libarchive-2.8.3";
+  name = "libarchive-3.0.4";
 
   src = fetchurl {
-    url = "http://libarchive.googlecode.com/files/${name}.tar.gz";
-    sha256 = "16095d15334b3c8dbb02db5af3d415f12c1c3bdd4eb43af7bbc36ab7572c0b7a";
+    url = "https://github.com/downloads/libarchive/libarchive/${name}.tar.gz";
+    sha256 = "76e8d7c7b100ec4071e48c1b7d3f3ea1d22b39db3e45b7189f75b5ff4df90fac";
   };
 
-  propagatedBuildInputs = [ libxml2 zlib bzip2 openssl ] ++
+  buildInputs = [ sharutils libxml2 zlib bzip2 openssl xz ] ++
     stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ];
 
-  buildInputs = [ sharutils ];
-
   meta = {
-    description = "A library for reading and writing streaming archives";
-    homepage = http://people.freebsd.org/~kientzle/libarchive;
+    description = "Multi-format archive and compression library";
+    longDescription = ''
+      This library has code for detecting and reading many archive formats and
+      compressions formats including (but not limited to) tar, shar, cpio, zip, and
+      compressed with gzip, bzip2, lzma, xz, .. 
+    '';
+    homepage = http://libarchive.github.com/;
+    license = stdenv.lib.licenses.bsd3;
+    platforms = with stdenv.lib.platforms; all;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/development/libraries/libassuan/default.nix b/pkgs/development/libraries/libassuan/default.nix
index 362ecd403d2..f93a44c2e1d 100644
--- a/pkgs/development/libraries/libassuan/default.nix
+++ b/pkgs/development/libraries/libassuan/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "06xckkvxxlx7cj77803m8x58gxksap4k8yhspc5cqsy7fhinimds";
   };
 
-  propagatedBuildInputs = [ pth libgpgerror ];
+  propagatedBuildInputs = [ libgpgerror pth ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/libbluedevil/default.nix b/pkgs/development/libraries/libbluedevil/default.nix
index 4b233437adb..8443ddaa606 100644
--- a/pkgs/development/libraries/libbluedevil/default.nix
+++ b/pkgs/development/libraries/libbluedevil/default.nix
@@ -1,12 +1,13 @@
-{ stdenv, fetchgit, cmake, qt4 }:
+{ stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
-  name = "libbluedevil-20110304";
+  name = "${pname}-${version}";
+  pname = "libbluedevil";
+  version = "1.9.3";
 
-  src = fetchgit {
-    url = git://anongit.kde.org/libbluedevil.git;
-    rev = "b44537b1784528cacc62ab1d570c1565bd326b4f";
-    sha256 = "15rx44dncg7hm2x04yz53ni4l1fpb40c3bma3pbvr7l2yd89x3sa";
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
+    sha256 = "0fdq083145mb3ynw14pc471ahp7is48wqpmswrvfz3hkyayriss3";
   };
 
   buildInputs = [ cmake qt4 ];
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index 03bbcc933f4..6c139242f3e 100644
--- a/pkgs/development/libraries/libbluray/default.nix
+++ b/pkgs/development/libraries/libbluray/default.nix
@@ -19,7 +19,8 @@ stdenv.mkDerivation {
     sha256 = "551b623e76c2dba44b5490fb42ccdc491b28cd42841de28237b8edbed0f0711c";
   };
 
-  buildInputs = [autoconf automake libtool] ++ stdenv.lib.optionals withAACS [jdk ant libaacs];
+  nativeBuildInputs = [autoconf automake libtool];
+  buildInputs = stdenv.lib.optionals withAACS [jdk ant libaacs];
   NIX_LDFLAGS = stdenv.lib.optionalString withAACS "-laacs";
 
   preConfigure = "./bootstrap";
diff --git a/pkgs/development/libraries/libc++/default.nix b/pkgs/development/libraries/libc++/default.nix
new file mode 100644
index 00000000000..bed95311915
--- /dev/null
+++ b/pkgs/development/libraries/libc++/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchsvn, cmake }:
+
+let rev = "165151"; in
+
+stdenv.mkDerivation {
+  name = "libc++-pre${rev}";
+
+  src = fetchsvn {
+    url = "http://llvm.org/svn/llvm-project/libcxx/trunk";
+    inherit rev;
+    sha256 = "00l8xx5nc3cjlmln7c1sy1i4v844has9kbfxrsziwkalzbgwaslz";
+  };
+
+  buildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://libcxx.llvm.org/;
+    description = "A new implementation of the C++ standard library, targeting C++11";
+    license = "BSD";
+    maintainers = stdenv.lib.maintainers.shlevy;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
+
diff --git a/pkgs/development/libraries/libcanberra/default.nix b/pkgs/development/libraries/libcanberra/default.nix
index 691294d4a85..6d56cd44633 100644
--- a/pkgs/development/libraries/libcanberra/default.nix
+++ b/pkgs/development/libraries/libcanberra/default.nix
@@ -14,6 +14,10 @@ stdenv.mkDerivation rec {
 
   configureFlags = "--disable-oss --disable-schemas-install";
 
+  passthru = {
+    gtkModule = "/lib/gtk-2.0/";
+  };
+
   meta = {
     description = "libcanberra, an implementation of the XDG Sound Theme and Name Specifications";
 
diff --git a/pkgs/development/libraries/libcdr/default.nix b/pkgs/development/libraries/libcdr/default.nix
new file mode 100644
index 00000000000..d2d68640560
--- /dev/null
+++ b/pkgs/development/libraries/libcdr/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libwpg, libwpd, lcms2, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "libcdr-0.0.8";
+
+  src = fetchurl {
+    url = "http://dev-www.libreoffice.org/src/${name}.tar.xz";
+    sha256 = "117a8gp29xs3kin6kaisb3frsx8dwrsjgs4wq4y5hjqprzy6lwz0";
+  };
+
+  buildInputs = [ libwpg libwpd lcms2 ];
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  CXXFLAGS="--std=gnu++0x"; # For c++11 constants in lcms2.h
+
+  meta = {
+    description = "A library providing ability to interpret and import Corel Draw drawings into various applications";
+    homepage = http://www.freedesktop.org/wiki/Software/libcdr;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libcello/default.nix b/pkgs/development/libraries/libcello/default.nix
new file mode 100644
index 00000000000..4a7bc56568e
--- /dev/null
+++ b/pkgs/development/libraries/libcello/default.nix
@@ -0,0 +1,16 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "libcello-0.9.2";
+
+  src = fetchurl {
+    url = "http://libcello.org/static/${name}.tar.gz";
+    sha256 = "cd82639cb9b133119fd89a77a5a505a55ea5fcc8decfc53bee0725358ec8bad0";
+  };
+
+  meta = {
+    homepage = "http://libcello.org/";
+    description = "Higher level programming in C";
+    license = "BSD";
+  };
+}
diff --git a/pkgs/development/libraries/libchop/default.nix b/pkgs/development/libraries/libchop/default.nix
index 4f0c83f2702..9a1b4122365 100644
--- a/pkgs/development/libraries/libchop/default.nix
+++ b/pkgs/development/libraries/libchop/default.nix
@@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g";
   };
 
-  buildNativeInputs = [ pkgconfig gperf ];
+  patches = [ ./gets-undeclared.patch ];
+
+  nativeBuildInputs = [ pkgconfig gperf ];
+  
   buildInputs =
     [ zlib bzip2 lzo
       libgcrypt
diff --git a/pkgs/development/libraries/libchop/gets-undeclared.patch b/pkgs/development/libraries/libchop/gets-undeclared.patch
new file mode 100644
index 00000000000..b6cdc77caa8
--- /dev/null
+++ b/pkgs/development/libraries/libchop/gets-undeclared.patch
@@ -0,0 +1,71 @@
+This patch is needed to allow builds with newer versions of
+the GNU libc (2.16+).
+
+
+commit 66712c23388e93e5c518ebc8515140fa0c807348
+Author: Eric Blake <eblake@redhat.com>
+Date:   Thu Mar 29 13:30:41 2012 -0600
+
+    stdio: don't assume gets any more
+    
+    Gnulib intentionally does not have a gets module, and now that C11
+    and glibc have dropped it, we should be more proactive about warning
+    any user on a platform that still has a declaration of this dangerous
+    interface.
+    
+    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
+    support.
+    * modules/stdio (Makefile.am): Likewise.
+    * lib/stdio-read.c (gets): Likewise.
+    * tests/test-stdio-c++.cc: Likewise.
+    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
+    * lib/stdio.in.h (gets): Make warning occur in more places.
+    * doc/posix-functions/gets.texi (gets): Update documentation.
+    Reported by Christer Solskogen.
+    
+    Signed-off-by: Eric Blake <eblake@redhat.com>
+
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index aa7b599..c377b6e 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
+@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ # endif
+ #endif
+ 
+-/* Some people would argue that sprintf should be handled like gets
+-   (for example, OpenBSD issues a link warning for both functions),
+-   since both can cause security holes due to buffer overruns.
++/* Some people would argue that all sprintf uses should be warned about
++   (for example, OpenBSD issues a link warning for it),
++   since it can cause security holes due to buffer overruns.
+    However, we believe that sprintf can be used safely, and is more
+    efficient than snprintf in those safe cases; and as proof of our
+    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix
index aeb9331c8ad..d49f4cc6a72 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -2,7 +2,7 @@
 
 let
   baseName = "libdbusmenu-qt";
-  v = "0.9.0";
+  v = "0.9.2";
   homepage = "http://launchpad.net/${baseName}";
   name = "${baseName}-${v}";
 in
@@ -12,11 +12,11 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "${homepage}/trunk/${v}/+download/${name}.tar.bz2";
-    sha256 = "0xdicb3fmwgbyhc6cpcmdkwysdg18m5rcqc3izpwv6brq4aq4787";
+    sha256 = "1v0ri5g9xw2z64ik0kx0ra01v8rpjn2kxprrxppkls1wvav1qv5f";
   };
 
   buildInputs = [ qt4 ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DWITH_DOC=OFF";
   
diff --git a/pkgs/development/libraries/libdevil/default.nix b/pkgs/development/libraries/libdevil/default.nix
index 12008bcbccb..6efb785b657 100644
--- a/pkgs/development/libraries/libdevil/default.nix
+++ b/pkgs/development/libraries/libdevil/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr mesa libX11 ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
 
diff --git a/pkgs/development/libraries/libdiscid/default.nix b/pkgs/development/libraries/libdiscid/default.nix
index bd39ea9464c..b8f79f2ae69 100644
--- a/pkgs/development/libraries/libdiscid/default.nix
+++ b/pkgs/development/libraries/libdiscid/default.nix
@@ -1,8 +1,9 @@
-{ stdenv, fetchurl, cmake }:
+{ stdenv, fetchurl, cmake, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "libdiscid-0.2.2";
 
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ cmake ];
 
   src = fetchurl {
@@ -10,6 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "00l4ln9rk0vqf67iccwqrgc9qx1al92i05zylh85kd1zn9d5sjwp";
   };
 
+  # developer forgot to update his version number
+  # this is propagated to pkg-config
+  preConfigure = ''
+    substituteInPlace "CMakeLists.txt" \
+      --replace "PROJECT_VERSION 0.1.1" "PROJECT_VERSION 0.2.2"
+  '';
+
   meta = {
     description = "A C library for creating MusicBrainz DiscIDs from audio CDs";
     homepage = http://musicbrainz.org/doc/libdiscid;
diff --git a/pkgs/development/libraries/libdmtx/default.nix b/pkgs/development/libraries/libdmtx/default.nix
index 97622bb7b24..970a1cf05e9 100644
--- a/pkgs/development/libraries/libdmtx/default.nix
+++ b/pkgs/development/libraries/libdmtx/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0iin2j3ad7ldj32dwc04g28k54iv3lrc5121rgyphm7l9hvigbvk";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ imagemagick ];
 
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index a6b39e170bd..a2546bf2d69 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,20 +1,20 @@
-{stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, cairo, udev}:
+{ stdenv, fetchurl, pkgconfig, libpthreadstubs, libpciaccess, udev }:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.29";
+  name = "libdrm-2.4.33";
   
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "0bj5ihmnzpbbgdrvp5f8bgsk0k19haixr893449pjd4k7v4jshz2";
+    sha256 = "1slgi61n4dlsfli47ql354fd1ppj7n40jd94wvnsdqx0mna9syrd";
   };
 
-  buildNativeInputs = [ pkgconfig ];
-  buildInputs = [ libpthreadstubs libpciaccess cairo udev ];
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ libpthreadstubs libpciaccess udev ];
 
   patches = stdenv.lib.optional stdenv.isDarwin ./libdrm-apple.patch;
 
   preConfigure = stdenv.lib.optionalString stdenv.isDarwin
-  "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
+    "echo : \\\${ac_cv_func_clock_gettime=\'yes\'} > config.cache";
 
   configureFlags = [ "--enable-nouveau-experimental-api"
                      "--enable-radeon-experimental-api"
diff --git a/pkgs/development/libraries/libdwarf/default.nix b/pkgs/development/libraries/libdwarf/default.nix
new file mode 100644
index 00000000000..44eec24cb41
--- /dev/null
+++ b/pkgs/development/libraries/libdwarf/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, libelf }:
+
+stdenv.mkDerivation rec {
+  name = "libdwarf-20121130";
+  
+  src = fetchurl {
+    url = http://reality.sgiweb.org/davea/libdwarf-20121130.tar.gz;
+    sha256 = "1nfdfn5xf3n485pvpb853awyxxnvrg207i0wmrr7bhk8fcxdxbn0";
+  };
+
+  configureFlags = " --enable-shared --disable-nonshared";
+
+  preConfigure = ''
+    cd libdwarf
+  '';
+  buildInputs = [ libelf ];
+
+  installPhase = ''
+    mkdir -p $out/lib $out/include
+    cp libdwarf.so $out/lib
+    cp libdwarf.h dwarf.h $out/include
+  '';
+
+  meta = {
+    homepage = http://reality.sgiweb.org/davea/dwarf.html;
+  };
+}
diff --git a/pkgs/development/libraries/libeatmydata/default.nix b/pkgs/development/libraries/libeatmydata/default.nix
new file mode 100644
index 00000000000..48a0423653d
--- /dev/null
+++ b/pkgs/development/libraries/libeatmydata/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libeatmydata-65";
+  
+  src = fetchurl {
+    url = "http://www.flamingspork.com/projects/libeatmydata/${name}.tar.gz";
+    sha256 = "1hfmd24ps5661zbbw1qqgqs6hcwx6ll2fxz2j4cfvkmf0kzw25la";
+  };
+
+  meta = {
+    homepage = http://www.flamingspork.com/projects/libeatmydata/;
+    license = "GPLv3+";
+    description = "Small LD_PRELOAD library to disable fsync and friends";
+  };
+}
diff --git a/pkgs/development/libraries/libee/default.nix b/pkgs/development/libraries/libee/default.nix
new file mode 100644
index 00000000000..c3c73381acd
--- /dev/null
+++ b/pkgs/development/libraries/libee/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl, pkgconfig, libestr }:
+stdenv.mkDerivation {
+  name = "libee-0.4.1";
+
+  src = fetchurl {
+    url = http://www.libee.org/download/files/download/libee-0.4.1.tar.gz;
+    md5 = "7bbf4160876c12db6193c06e2badedb2";
+  };
+
+  buildInputs = [pkgconfig libestr];
+
+  meta = {
+    homepage = "http://www.libee.org/";
+    description = "An Event Expression Library inspired by CEE";
+  };
+}
diff --git a/pkgs/development/libraries/libestr/default.nix b/pkgs/development/libraries/libestr/default.nix
new file mode 100644
index 00000000000..74d86667b5b
--- /dev/null
+++ b/pkgs/development/libraries/libestr/default.nix
@@ -0,0 +1,8 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation {
+  name = "libestr-0.1.4";
+  src = fetchurl {
+    url = http://libestr.adiscon.com/files/download/libestr-0.1.4.tar.gz;
+    sha256 = "1qw5vqryawdm434l9ql3r160ap2f5mmp7b6pciac7qli62y0a2z3";
+  };
+}
diff --git a/pkgs/development/libraries/libev/src-for-default.nix b/pkgs/development/libraries/libev/src-for-default.nix
index 52c8e65bc4f..49624fc6bd2 100644
--- a/pkgs/development/libraries/libev/src-for-default.nix
+++ b/pkgs/development/libraries/libev/src-for-default.nix
@@ -1,8 +1,9 @@
 rec {
-  advertisedUrl="http://dist.schmorp.de/libev/Attic/libev-4.04.tar.gz";
-  version = "4.04";
-  url="http://dist.schmorp.de/libev/Attic/libev-4.04.tar.gz";
-  hash = "ab3a09e967e3b868055cd9363fd236aa093f8643d19cc7042e90e0dfe905b012";
-  name = "libev-4.04";
+   version="4.11";
+   name="libev-4.11";
+   hash="1pwcjch21xc7cfmjldkw1n7lcs4pyqm9dx573wdhmmp4yrpz2mcz";
+   url="http://dist.schmorp.de/libev/Attic/libev-${version}.tar.gz";
+   advertisedUrl="http://dist.schmorp.de/libev/Attic/libev-4.11.tar.gz";
+  
   
 }
diff --git a/pkgs/development/libraries/libevent/1.4.nix b/pkgs/development/libraries/libevent/1.4.nix
new file mode 100644
index 00000000000..ed190bf6061
--- /dev/null
+++ b/pkgs/development/libraries/libevent/1.4.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl}:
+
+let version = "1.4.14b"; in
+stdenv.mkDerivation {
+  name = "libevent-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/downloads/libevent/libevent/libevent-${version}-stable.tar.gz";
+    sha256 = "00b3wih3qpcik6v0qh1406abs2xb954d58ncqwzs8ar2d93ip9mg";
+  };
+
+  meta = {
+    description = "libevent, an event notification library";
+
+    longDescription =
+      '' The libevent API provides a mechanism to execute a callback function
+         when a specific event occurs on a file descriptor or after a timeout
+         has been reached.  Furthermore, libevent also support callbacks due
+         to signals or regular timeouts.
+
+         libevent is meant to replace the event loop found in event driven
+         network servers.  An application just needs to call event_dispatch()
+         and then add or remove events dynamically without having to change
+         the event loop.
+      '';
+
+    license = "mBSD";
+  };
+}
diff --git a/pkgs/development/libraries/libevent/default.nix b/pkgs/development/libraries/libevent/default.nix
index 3be67d18040..b2987689be7 100644
--- a/pkgs/development/libraries/libevent/default.nix
+++ b/pkgs/development/libraries/libevent/default.nix
@@ -25,5 +25,6 @@ stdenv.mkDerivation {
       '';
 
     license = "mBSD";
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libextractor/default.nix b/pkgs/development/libraries/libextractor/default.nix
index a6b670eedb6..b1aaaa7f2c8 100644
--- a/pkgs/development/libraries/libextractor/default.nix
+++ b/pkgs/development/libraries/libextractor/default.nix
@@ -1,17 +1,17 @@
 { fetchurl, stdenv, libtool, gettext, zlib, bzip2, flac, libvorbis
 , exiv2, libgsf, rpm, pkgconfig
-, gtkSupport ? true, glib ? null, gtk ? null
+, gtkSupport ? true, glib ? null, gtk3 ? null
 , videoSupport ? true, ffmpeg ? null, libmpeg2 ? null}:
 
-assert gtkSupport -> glib != null && gtk != null;
+assert gtkSupport -> glib != null && gtk3 != null;
 assert videoSupport -> ffmpeg != null && libmpeg2 != null;
 
 stdenv.mkDerivation rec {
-  name = "libextractor-0.6.2";
+  name = "libextractor-1.0.1";
 
   src = fetchurl {
     url = "mirror://gnu/libextractor/${name}.tar.gz";
-    sha256 = "1pyh599717vjblyjch95r76afdxfhrzqr7nx1pz1davy5fpsw5aw";
+    sha256 = "1khy9s86vq6667h02zp2fvb16sqm27xlmr0xchgfxvsd6ascnl9j";
   };
 
   preConfigure =
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
    [ libtool gettext zlib bzip2 flac libvorbis exiv2
      libgsf rpm
      pkgconfig
-   ] ++ stdenv.lib.optionals gtkSupport [ glib gtk ]
+   ] ++ stdenv.lib.optionals gtkSupport [ glib gtk3 ]
      ++ stdenv.lib.optionals videoSupport [ ffmpeg libmpeg2 ];
 
   configureFlags = "--disable-ltdl-install "
diff --git a/pkgs/development/libraries/libexttextcat/default.nix b/pkgs/development/libraries/libexttextcat/default.nix
new file mode 100644
index 00000000000..a75fada7484
--- /dev/null
+++ b/pkgs/development/libraries/libexttextcat/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libexttextcat-3.3.1";
+
+  src = fetchurl {
+    url = "http://dev-www.libreoffice.org/src/libexttextcat/${name}.tar.xz";
+    sha256 = "1a7ablpipfbiyhl6wsraj5z8pj3qkqgnrms73wzsqhpbyww334h4";
+  };
+
+  patches = [ ./memory-leaks.patch ];
+
+  meta = {
+    description = "An N-Gram-Based Text Categorization library primarily intended for language guessing";
+    homepage = http://www.freedesktop.org/wiki/Software/libexttextcat;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libexttextcat/memory-leaks.patch b/pkgs/development/libraries/libexttextcat/memory-leaks.patch
new file mode 100644
index 00000000000..0be4ffdc93a
--- /dev/null
+++ b/pkgs/development/libraries/libexttextcat/memory-leaks.patch
@@ -0,0 +1,37 @@
+Combined upstream commits 980592386f23db8b0dc84c434805cb167d0cc091 and
+5ef4ad86ec934282cba891922ec2d13784da3354.
+diff -u b/src/textcat.c b/src/textcat.c
+--- b/src/textcat.c
++++ b/src/textcat.c
+@@ -212,8 +212,6 @@
+                                 sizeof(char) * (tmp_size + 1));
+             if (tmp == NULL)
+             {
+-                free(finger_print_file_name);
+-                finger_print_file_name_size = 0;
+                 goto BAILOUT;
+             }
+             else
+@@ -226,10 +224,7 @@
+         strcat(finger_print_file_name, segment[0]);
+ 
+         if (fp_Read(h->fprint[h->size], finger_print_file_name, 400) == 0)
+-        {
+-            textcat_Done(h);
+             goto BAILOUT;
+-        }
+         h->fprint_disable[h->size] = 0xF0;  /* 0xF0 is the code for enabled
+                                                languages, 0x0F is for disabled 
+                                              */
+@@ -242,9 +237,10 @@
+     return h;
+ 
+   BAILOUT:
++    free(finger_print_file_name);
+     fclose(fp);
++    textcat_Done(h);
+     return NULL;
+-
+ }
+ 
+ extern candidate_t *textcat_GetClassifyFullOutput(void *handle)
diff --git a/pkgs/development/libraries/libf2c/default.nix b/pkgs/development/libraries/libf2c/default.nix
index edcf177add7..3f800c2086e 100644
--- a/pkgs/development/libraries/libf2c/default.nix
+++ b/pkgs/development/libraries/libf2c/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation rec {
-  name = "libf2c";
+  name = "libf2c-20100903";
   
   src = fetchurl {
     url = http://www.netlib.org/f2c/libf2c.zip;
-    sha256 = "14py0zdwzj5gqjzi0z2hlcy3czpzx1fav55akdj143qgav8h6dav";
+    sha256 = "1mcp1lh7gay7hm186dr0wvwd2bc05xydhnc1qy3dqs4n3r102g7i";
   };
 
   unpackPhase = ''
diff --git a/pkgs/development/libraries/libffi/default.nix b/pkgs/development/libraries/libffi/default.nix
index 83f88e1819f..27c3e9f66f3 100644
--- a/pkgs/development/libraries/libffi/default.nix
+++ b/pkgs/development/libraries/libffi/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation (rec {
-  name = "libffi-3.0.9";
+  name = "libffi-3.0.13";
 
   src = fetchurl {
     url = "ftp://sourceware.org/pub/libffi/${name}.tar.gz";
-    sha256 = "0ln4jbpb6clcsdpb9niqk0frgx4k0xki96wiv067ig0q4cajb7aq";
+    sha256 = "077ibkf84bvcd6rw1m6jb107br63i2pp301rkmsbgg6300adxp8x";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libftdi/default.nix b/pkgs/development/libraries/libftdi/default.nix
index 6805434dcec..ef7a67b7fcd 100644
--- a/pkgs/development/libraries/libftdi/default.nix
+++ b/pkgs/development/libraries/libftdi/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, libusb}:
 
 stdenv.mkDerivation rec {
-  name = "libftdi-0.17";
+  name = "libftdi-0.20";
   
   src = fetchurl {
     url = "http://www.intra2net.com/en/developer/libftdi/download/${name}.tar.gz";
-    sha256 = "1w5bzq4h4v9qah9dx0wbz6w7ircr91ack0sh6wqs8s5b4m8jgh6m";
+    sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
   };
 
   buildInputs = [ libusb ];
diff --git a/pkgs/development/libraries/libgadu/default.nix b/pkgs/development/libraries/libgadu/default.nix
index 98324c184c6..43056010770 100644
--- a/pkgs/development/libraries/libgadu/default.nix
+++ b/pkgs/development/libraries/libgadu/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation {
 
-  name = "libgadu-1.11.0";
+  name = "libgadu-1.11.2";
 
   src = fetchurl {
-    url = http://toxygen.net/libgadu/files/libgadu-1.11.0.tar.gz;
-    sha256 = "045a0bd395k3ramdvlzyfx3878p42fv4r04rgasmdsm2n33wgm38";
+    url = http://toxygen.net/libgadu/files/libgadu-1.11.2.tar.gz;
+    sha256 = "0kifi9blhbimihqw4kaf6wyqhlx8fpp8nq4s6y280ar9p0il2n3z";
   };
 
   propagatedBuildInputs = [ zlib ];
diff --git a/pkgs/development/libraries/libgcrypt/default.nix b/pkgs/development/libraries/libgcrypt/default.nix
index d705bd80bdc..0438816b1b4 100644
--- a/pkgs/development/libraries/libgcrypt/default.nix
+++ b/pkgs/development/libraries/libgcrypt/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, libgpgerror }:
 
 stdenv.mkDerivation rec {
-  name = "libgcrypt-1.5.0";
+  name = "libgcrypt-1.5.2";
 
   src = fetchurl {
     url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
-    sha256 = "1ykkh7dm0gyndz7bbpvn3agijj8xb2h02m02f42hm504c18zqqjb";
+    sha1 = "c9998383532ba3e8bcaf690f2f0d65e814b48d2f";
   };
 
   propagatedBuildInputs = [ libgpgerror ];
diff --git a/pkgs/development/libraries/libgcrypt/git.nix b/pkgs/development/libraries/libgcrypt/git.nix
new file mode 100644
index 00000000000..bf917464343
--- /dev/null
+++ b/pkgs/development/libraries/libgcrypt/git.nix
@@ -0,0 +1,48 @@
+{ fetchgit, stdenv, libgpgerror, autoconf, automake, libtool, transfig, ghostscript, texinfo }:
+
+stdenv.mkDerivation rec {
+  name = "libgcrypt-git-20130524";
+
+  src = fetchgit {
+    url = git://git.gnupg.org/libgcrypt.git;
+    rev = "99b18aa53";
+    sha256 = "1rhbpxqrkfszlv8jvw8s4apwklal07k8zxv5q555l7binc1j1j3z";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool transfig ghostscript texinfo ];
+
+  propagatedBuildInputs = [ libgpgerror ];
+
+  preConfigure = ''
+    sh autogen.sh
+  '';
+
+  preBuild = ''
+    (cd doc; make stamp-vti)
+  '';
+
+  doCheck = true;
+
+  # For some reason the tests don't find `libgpg-error.so'.
+  checkPhase = ''
+    LD_LIBRARY_PATH="${libgpgerror}/lib:$LD_LIBRARY_PATH" \
+    make check
+  '';
+
+  meta = {
+    description = "GNU Libgcrypt, a general-pupose cryptographic library";
+
+    longDescription = ''
+      GNU Libgcrypt is a general purpose cryptographic library based on
+      the code from GnuPG.  It provides functions for all
+      cryptographic building blocks: symmetric ciphers, hash
+      algorithms, MACs, public key algorithms, large integer
+      functions, random numbers and a lot of supporting functions.
+    '';
+
+    license = "LGPLv2+";
+
+    homepage = https://www.gnu.org/software/libgcrypt/;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index 46a53a88d8a..3b1e5ba0b77 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   patches =
     [ (fetchurl {
-        url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-dotnet/libgdiplus/files/libgdiplus-2.10.1-libpng15.patch?revision=1.1;
+        url = "https://raw.github.com/MagicGroup/MagicSpecLib/master/libgdiplus/libgdiplus-2.10.1-libpng15.patch";
         sha256 = "130r0jm065pjvbz5dkx96w37vj1wqc8fakmi2znribs14g0bl65f";
       })
     ];
diff --git a/pkgs/development/libraries/libgnome-keyring/3.x.nix b/pkgs/development/libraries/libgnome-keyring/3.x.nix
index a8b8e98ced9..54a023a16f8 100644
--- a/pkgs/development/libraries/libgnome-keyring/3.x.nix
+++ b/pkgs/development/libraries/libgnome-keyring/3.x.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib dbus_libs libgcrypt ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) platforms maintainers;
diff --git a/pkgs/development/libraries/libgnome-keyring/default.nix b/pkgs/development/libraries/libgnome-keyring/default.nix
index 05a21f3c82e..4aadafff844 100644
--- a/pkgs/development/libraries/libgnome-keyring/default.nix
+++ b/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib dbus_libs libgcrypt ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   meta = {
     inherit (glib.meta) platforms maintainers;
diff --git a/pkgs/development/libraries/libgpg-error/default.nix b/pkgs/development/libraries/libgpg-error/default.nix
index f7052b90b42..eafa857598c 100644
--- a/pkgs/development/libraries/libgpg-error/default.nix
+++ b/pkgs/development/libraries/libgpg-error/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, bash }:
 
 stdenv.mkDerivation (rec {
-  name = "libgpg-error-1.10";
+  name = "libgpg-error-1.11";
 
   src = fetchurl {
     url = "mirror://gnupg/libgpg-error/${name}.tar.bz2";
-    sha256 = "0cal3jdnzdailr13qcy74grfbplbghkgr3qwk6qjjp4bass2j1jj";
+    sha1 = "be209b013652add5c7e2c473ea114f58203cc6cd";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libgphoto2/2.4.nix b/pkgs/development/libraries/libgphoto2/2.4.nix
new file mode 100644
index 00000000000..3edc8d0ac6c
--- /dev/null
+++ b/pkgs/development/libraries/libgphoto2/2.4.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, pkgconfig, libusb, libtool, libexif, libjpeg, gettext}:
+
+stdenv.mkDerivation rec {
+  name = "libgphoto2-2.4.14";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
+    sha256 = "14h20s0kwqr1nsj90dgjwzs0r3h7z1cpmnivrikd0rrg4m2jvcsr";
+  };
+  
+  nativeBuildInputs = [ pkgconfig gettext ];
+  buildInputs = [ libtool libjpeg ];
+
+  # These are mentioned in the Requires line of libgphoto's pkg-config file.
+  propagatedBuildInputs = [ libusb libexif ];
+
+  meta = {
+    homepage = http://www.gphoto.org/proj/libgphoto2/;
+    description = "A library for accessing digital cameras";
+    longDescription = ''
+      This is the library backend for gphoto2. It contains the code for PTP,
+      MTP, and other vendor specific protocols for controlling and transferring data
+      from digital cameras. 
+    '';
+    # XXX: the homepage claims LGPL, but several src files are lgpl21Plus
+    license = stdenv.lib.licenses.lgpl21Plus; 
+    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/development/libraries/libgphoto2/default.nix b/pkgs/development/libraries/libgphoto2/default.nix
index 16001e689dd..0c0dc5b764f 100644
--- a/pkgs/development/libraries/libgphoto2/default.nix
+++ b/pkgs/development/libraries/libgphoto2/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchurl, pkgconfig, libusb, libtool, libexif, libjpeg, gettext}:
 
 stdenv.mkDerivation rec {
-  name = "libgphoto2-2.4.11";
+  name = "libgphoto2-2.5.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
-    sha256 = "08y40mqy714cg0160lny13z9kyxm63m3ksg8hljy5pspxanbn5ji";
+    sha256 = "0f1818l1vs5fbmrihzyv3qasddbqi3r01jik5crrxddwalsi2bd3";
   };
   
-  buildNativeInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkgconfig gettext ];
   buildInputs = [ libtool libjpeg ];
 
   # These are mentioned in the Requires line of libgphoto's pkg-config file.
@@ -17,6 +17,14 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://www.gphoto.org/proj/libgphoto2/;
     description = "A library for accessing digital cameras";
-    license = "LGPL 2.1";
+    longDescription = ''
+      This is the library backend for gphoto2. It contains the code for PTP,
+      MTP, and other vendor specific protocols for controlling and transferring data
+      from digital cameras. 
+    '';
+    # XXX: the homepage claims LGPL, but several src files are lgpl21Plus
+    license = stdenv.lib.licenses.lgpl21Plus; 
+    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/development/libraries/libgpod/default.nix b/pkgs/development/libraries/libgpod/default.nix
index e271e966180..0ad46e2ed5f 100644
--- a/pkgs/development/libraries/libgpod/default.nix
+++ b/pkgs/development/libraries/libgpod/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ glib libxml2 sqlite zlib sg3_utils
     gdk_pixbuf taglib libimobiledevice python pygobject mutagen ];
 
-  buildNativeInputs = [ gettext perlXMLParser intltool pkgconfig perl
+  nativeBuildInputs = [ gettext perlXMLParser intltool pkgconfig perl
     libimobiledevice.swig ];
 
   meta = {
diff --git a/pkgs/development/libraries/libgsf/default.nix b/pkgs/development/libraries/libgsf/default.nix
index 3941fd4d694..56f6242c09e 100644
--- a/pkgs/development/libraries/libgsf/default.nix
+++ b/pkgs/development/libraries/libgsf/default.nix
@@ -7,14 +7,14 @@ assert gnomeSupport -> gdk_pixbuf != null && gnome_vfs != null && libbonobo != n
   && glib != null;
 
 stdenv.mkDerivation rec {
-  name = "libgsf-1.14.22";
+  name = "libgsf-1.14.25";
 
   src = fetchurl {
-    url = mirror://gnome/sources/libgsf/1.14/libgsf-1.14.22.tar.xz;
-    sha256 = "0gvq1gbbcl078s3kgdc508jp7p3a3ps34fj4pf8vsamprbikpwm5";
+    url = "mirror://gnome/sources/libgsf/1.14/${name}.tar.xz";
+    sha256 = "127548f07e07951984fb139c3f89d65b9e471aefe6555387de03e1113944d1a2";
   };
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
   buildInputs =
     [ perl perlXMLParser gettext bzip2 python ]
     ++ stdenv.lib.optionals gnomeSupport [ gnome_vfs gdk_pixbuf ];
diff --git a/pkgs/development/libraries/libgtop/default.nix b/pkgs/development/libraries/libgtop/default.nix
index f214c7acf73..b592f458c6c 100644
--- a/pkgs/development/libraries/libgtop/default.nix
+++ b/pkgs/development/libraries/libgtop/default.nix
@@ -8,5 +8,5 @@ stdenv.mkDerivation {
   };
 
   propagatedBuildInputs = [ glib ];
-  buildNativeInputs = [ pkgconfig perl intltool ];
+  nativeBuildInputs = [ pkgconfig perl intltool ];
 }
diff --git a/pkgs/development/libraries/libgweather/default.nix b/pkgs/development/libraries/libgweather/default.nix
index 4a4da810ae6..5e7a4cff741 100644
--- a/pkgs/development/libraries/libgweather/default.nix
+++ b/pkgs/development/libraries/libgweather/default.nix
@@ -9,5 +9,5 @@ stdenv.mkDerivation {
   };
   configureFlags = if stdenv ? glibc then "--with-zoneinfo-dir=${stdenv.glibc}/share/zoneinfo" else "";
   propagatedBuildInputs = [ libxml2 gtk3 libsoup GConf3 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 }
diff --git a/pkgs/development/libraries/libharu/default.nix b/pkgs/development/libraries/libharu/default.nix
index 3b8c4be54e0..db1aa4a7473 100644
--- a/pkgs/development/libraries/libharu/default.nix
+++ b/pkgs/development/libraries/libharu/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
           sha256 = "1993vskpycyr43rwdp8f688fc5zvllrqq935r7rhsgbqbipkk73h";
         };
 
-        buildNativeInputs = [ patchutils ];
+        nativeBuildInputs = [ patchutils ];
 
         buildCommand = "filterdiff -x '*/CHANGES' $src > $out";
       })
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 54dfc1aecc6..59d352cf730 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -1,10 +1,13 @@
-{stdenv, fetchurl, perl}:
+{stdenv, fetchsvn, perl, cmake}:
 
 stdenv.mkDerivation rec {
-  name = "libical-0.48";
-  src = fetchurl {
-    url = "mirror://sourceforge/freeassociation/${name}.tar.gz";
-    sha256 = "1w6znkh0xxhbcm717mbzfva9ycrqs2lajhng391i7pghaw3qprra";
+  name = "libical-0.48-p20120623";
+  src = fetchsvn {
+    url = "https://freeassociation.svn.sourceforge.net/svnroot/freeassociation/trunk/libical";
+    rev = "1130";
+    sha256 = "56caf19abdf44807fda75a67ef0886319551e53c4e4ece4da4fc862e34c64e1a";
   };
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl cmake ];
+
+  patches = [ ./respect-env-tzdir.patch ];
 }
diff --git a/pkgs/development/libraries/libical/respect-env-tzdir.patch b/pkgs/development/libraries/libical/respect-env-tzdir.patch
new file mode 100644
index 00000000000..12da8d41c7b
--- /dev/null
+++ b/pkgs/development/libraries/libical/respect-env-tzdir.patch
@@ -0,0 +1,32 @@
+* Remove /usr/*/zoneinfo from the default search path
+* Respect $TZDIR
+diff --git a/src/libical/icaltz-util.c b/src/libical/icaltz-util.c
+index adf7598..d2fd5c8 100644
+--- a/src/libical/icaltz-util.c
++++ b/src/libical/icaltz-util.c
+@@ -108,7 +108,7 @@ typedef struct
+ 
+ static int r_pos [] = {1, 2, 3, -2, -1};
+ 
+-static char *search_paths [] = {"/usr/share/zoneinfo","/usr/lib/zoneinfo","/etc/zoneinfo","/usr/share/lib/zoneinfo"};
++static char *search_paths [] = {"/etc/zoneinfo"};
+ static char *zdir = NULL;
+ 
+ #define NUM_SEARCH_PATHS (sizeof (search_paths)/ sizeof (search_paths [0]))
+@@ -195,6 +195,16 @@ set_zonedir (void)
+ 	const char *fname = ZONES_TAB_SYSTEM_FILENAME;
+ 	int i;	
+ 
++	const char *env_tzdir = strdup (getenv ("TZDIR"));
++	if (env_tzdir) {
++		sprintf (file_path, "%s/%s", env_tzdir, fname);
++		if (!access (file_path, F_OK|R_OK)) {
++			zdir = env_tzdir;
++			return;
++		}
++		free (env_tzdir);
++	}
++
+ 	for (i = 0;i < NUM_SEARCH_PATHS; i++) {
+ 		sprintf (file_path, "%s/%s", search_paths [i], fname);
+ 		if (!access (file_path, F_OK|R_OK)) {
diff --git a/pkgs/development/libraries/libicns/default.nix b/pkgs/development/libraries/libicns/default.nix
index 0e582c903c5..970a7a87497 100644
--- a/pkgs/development/libraries/libicns/default.nix
+++ b/pkgs/development/libraries/libicns/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libpng, jasper }:
 
-stdenv.mkDerivation {
-  name = "libicns-0.8.0";
+stdenv.mkDerivation rec {
+  name = "libicns-0.8.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/icns/libicns-0.8.0.tar.gz;
-    sha256 = "0jh67nm07jr1nfkfjid3jjw7fyw5hvj6a2fqan1bhg6gyr2hswla";
+    url = "mirror://sourceforge/icns/${name}.tar.gz";
+    sha256 = "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk";
   };
 
   buildInputs = [ libpng jasper ];
diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix
index f2958e4668d..c13af535429 100644
--- a/pkgs/development/libraries/libiconv/default.nix
+++ b/pkgs/development/libraries/libiconv/default.nix
@@ -1,6 +1,6 @@
 { fetchurl, stdenv }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "libiconv-1.13.1";
 
   src = fetchurl {
@@ -8,6 +8,18 @@ stdenv.mkDerivation (rec {
     sha256 = "0jcsjk2g28bq20yh7rvbn8xgq6q42g8dkkac0nfh12b061l638sm";
   };
 
+  # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
+  # (Windows' linker would need to be used somehow to produce an actual
+  # DLL.)  Thus, build the static library too, and this is what Gettext
+  # will actually use.
+  configureFlags = stdenv.lib.optional stdenv.isCygwin [ "--enable-static" ];
+
+  crossAttrs = {
+    # Disable stripping to avoid "libiconv.a: Archive has no index" (MinGW).
+    dontStrip = true;
+    dontCrossStrip = true;
+  };
+
   meta = {
     description = "GNU libiconv, an iconv(3) implementation";
 
@@ -27,16 +39,6 @@ stdenv.mkDerivation (rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
 
     # This library is not needed on GNU platforms.
-    platforms = [ "i686-cygwin" "i686-darwin" ];
+    platforms = [ "i686-cygwin" ];
   };
 }
-
-//
-
-stdenv.lib.optionalAttrs stdenv.isCygwin {
-  # On Cygwin, Libtool produces a `.dll.a', which is not a "real" DLL
-  # (Windows' linker would need to be used somehow to produce an actual
-  # DLL.)  Thus, build the static library too, and this is what Gettext
-  # will actually use.
-  configureFlags = [ "--enable-static" ];
-})
diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix
index 6da91d98d13..94e785ee53b 100644
--- a/pkgs/development/libraries/libidn/default.nix
+++ b/pkgs/development/libraries/libidn/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "libidn-1.24";
+  name = "libidn-1.25";
 
   src = fetchurl {
     url = "mirror://gnu/libidn/${name}.tar.gz";
-    sha256 = "1zrmbwxvgmv7d37sdnlfn4lf3pxc7vgng3lhl18pkjry0v30h5ys";
+    sha256 = "05j7qcj7gb791k6ya2pwr7cq9yxgi0bjqiiwf9yq6pbai8r2brkz";
   };
 
   doCheck = ! stdenv.isDarwin;
diff --git a/pkgs/development/libraries/libimobiledevice/default.nix b/pkgs/development/libraries/libimobiledevice/default.nix
index b4bb3b47a35..a21d9bf7b5d 100644
--- a/pkgs/development/libraries/libimobiledevice/default.nix
+++ b/pkgs/development/libraries/libimobiledevice/default.nix
@@ -4,7 +4,7 @@
 stdenv.mkDerivation rec {
   name = "libimobiledevice-1.0.6";
 
-  buildNativeInputs = [ python libplist.swig pkgconfig ];
+  nativeBuildInputs = [ python libplist.swig pkgconfig ];
   buildInputs = [ readline ];
   propagatedBuildInputs = [ usbmuxd glib gnutls libgcrypt libtasn1 libplist ];
 
diff --git a/pkgs/development/libraries/libinfinity/default.nix b/pkgs/development/libraries/libinfinity/default.nix
index 3d34f6303e3..b8a815e4a6f 100644
--- a/pkgs/development/libraries/libinfinity/default.nix
+++ b/pkgs/development/libraries/libinfinity/default.nix
@@ -3,7 +3,7 @@
 , documentation ? false # build documentation
 , avahiSupport ? false # build support for Avahi in libinfinity
 , stdenv, fetchurl, pkgconfig, glib, libxml2, gnutls, gsasl
-, gtk ? null, gtkdoc ? null, avahi ? null, libdaemon ? null }:
+, gtk ? null, gtkdoc ? null, avahi ? null, libdaemon ? null, libidn, gss }:
 
 let
   edf = flag: feature: (if flag then "--with-" else "--without-") + feature;
@@ -11,13 +11,13 @@ let
 
 in stdenv.mkDerivation rec {
 
-  name = "libinfinity-0.4.1";
+  name = "libinfinity-0.5.3";
   src = fetchurl {
     url = "http://releases.0x539.de/libinfinity/${name}.tar.gz";
-    sha256 = "1vdyj6xvwkisrc222i84mq93gasywad4i0ismafdjq2wapxn30r6";
+    sha256 = "04qa3ky2skhc9b5f9i9sc8hci3ykklqznmgy616yzs3n22bmax9j";
   };
 
-  buildInputs = [ pkgconfig glib libxml2 gsasl ]
+  buildInputs = [ pkgconfig glib libxml2 gsasl libidn gss ]
     ++ optional gtkWidgets gtk
     ++ optional documentation gtkdoc
     ++ optional avahiSupport avahi
diff --git a/pkgs/development/libraries/libixp/builder.sh b/pkgs/development/libraries/libixp/builder.sh
deleted file mode 100644
index 58513600fa0..00000000000
--- a/pkgs/development/libraries/libixp/builder.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-source $stdenv/setup
- 
-## oh, this is ugly. It would be way better to fix the Makefile instead
-postUnpack() {
-cd $sourceRoot
-
-cat > config.mk <<END
-VERSION = 0.3
-PREFIX=
-MANPREFIX=/share/man
-
-INCS = -I.
-LIBS = -L. -lc
-
-LDFLAGS = \${LIBS}
-
-CFLAGS = -g \${INCS} -DVERSION=\"\${VERSION}\"
-SOFLAGS = -fPIC -shared
-
-AR = ar cr
-RANLIB = ranlib
-
-END
-
-echo -e "PREFIX=\nDESTDIR=${out}" >> config.mk
-
-cd ..
-}
- 
-postUnpack=postUnpack
-
-genericBuild
diff --git a/pkgs/development/libraries/libixp_for_wmii/default.nix b/pkgs/development/libraries/libixp_for_wmii/default.nix
index a322c087d89..caeb87ee694 100644
--- a/pkgs/development/libraries/libixp_for_wmii/default.nix
+++ b/pkgs/development/libraries/libixp_for_wmii/default.nix
@@ -1,6 +1,6 @@
 args: with args;
 stdenv.mkDerivation {
-  name = "libixp_for_wmii";
+  name = "libixp_for_wmii-0.4";
   phases = "unpackPhase installPhase";
   installPhase = "
      export LDFLAGS\=$(echo \$NIX_LDFLAGS | sed -e 's/-rpath/-L/g')
diff --git a/pkgs/development/libraries/libjpeg/default.nix b/pkgs/development/libraries/libjpeg/default.nix
index f598482f830..63d698dda18 100644
--- a/pkgs/development/libraries/libjpeg/default.nix
+++ b/pkgs/development/libraries/libjpeg/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }: 
 
 stdenv.mkDerivation {
-  name = "libjpeg-8c";
+  name = "libjpeg-8d";
   
   src = fetchurl {
-    url = http://www.ijg.org/files/jpegsrc.v8c.tar.gz;
-    sha256 = "16kwrjhziv81gl9fq9b7qir8khm3wfb9zj7fzs7yabsb00z0pz7d";
+    url = http://www.ijg.org/files/jpegsrc.v8d.tar.gz;
+    sha256 = "1cz0dy05mgxqdgjf52p54yxpyy95rgl30cnazdrfmw7hfca9n0h0";
   };
   
   meta = {
diff --git a/pkgs/development/libraries/libktorrent/default.nix b/pkgs/development/libraries/libktorrent/default.nix
index 1f50f1b976b..a452cb7609e 100644
--- a/pkgs/development/libraries/libktorrent/default.nix
+++ b/pkgs/development/libraries/libktorrent/default.nix
@@ -2,8 +2,8 @@
 , phonon, libgcrypt }:
 
 let
-  mp_ = "1.3";
-  version = "1.${mp_}";
+  mp_ = "2.1";
+  version = "1.${mp_}-2";
   version4 = "4.${mp_}";
 in
 stdenv.mkDerivation rec {
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://ktorrent.org/downloads/${version4}/${name}.tar.bz2";
-    sha256 = "0mvvx6mdfy0pyhk6lwwmmbd3pd2ai6n2rf5kdjqhpkm9wbrck85n";
+    sha256 = "1b4ibkba27ivvjsh5s93xwlcgzvvwsgl6mcd8g96d1al05n2ccw9";
   };
 
-  buildNativeInputs = [ cmake automoc4 gettext ];
+  nativeBuildInputs = [ cmake automoc4 gettext ];
   buildInputs = [ kdelibs phonon gmp qca2 boost libgcrypt ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix
index 24b93221d11..b1e8342ca91 100644
--- a/pkgs/development/libraries/liblastfm/default.nix
+++ b/pkgs/development/libraries/liblastfm/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   prefixKey = "--prefix ";
   propagatedBuildInputs = [ qt4 libsamplerate fftwSinglePrec ];
-  buildNativeInputs = [ ruby pkgconfig which ];
+  nativeBuildInputs = [ ruby pkgconfig which ];
 
   configureFlags = "--release";
 
diff --git a/pkgs/development/libraries/liblockfile/default.nix b/pkgs/development/libraries/liblockfile/default.nix
new file mode 100644
index 00000000000..2db90845f69
--- /dev/null
+++ b/pkgs/development/libraries/liblockfile/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  _name   = "liblockfile";
+  version = "1.09";
+  name    = "${_name}-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/libl/${_name}/${_name}_${version}.orig.tar.gz";
+    sha256 = "0zqvbxls1632wqfhv4v3q2djzlz9391h0wdgsvhnaqrr0nx9x5qn";
+  };
+
+  preConfigure = ''
+    sed -i -e 's/install -g [^ ]* /install /' Makefile.in
+  '';
+
+  preInstall = ''
+    mkdir -p $out/{bin,lib,include,man} $out/man/man{1,3}
+  '';
+
+
+  meta = {
+    description = "Liblockfile is a shared library with NFS-safe locking functions.";
+    homepage = http://packages.debian.org/unstable/libs/liblockfile1;
+    license = "GPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/libmad/default.nix b/pkgs/development/libraries/libmad/default.nix
index 178e65d2506..6e2e2c949cc 100644
--- a/pkgs/development/libraries/libmad/default.nix
+++ b/pkgs/development/libraries/libmad/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   patches = [ ./001-mips_removal_h_constraint.patch ./pkgconfig.patch ];
 
-  buildNativeInputs = [ autoconf ];
+  nativeBuildInputs = [ autoconf ];
 
   # The -fforce-mem flag has been removed in GCC 4.3.
   preConfigure = ''
diff --git a/pkgs/development/libraries/libmcrypt/default.nix b/pkgs/development/libraries/libmcrypt/default.nix
new file mode 100644
index 00000000000..79019cbc489
--- /dev/null
+++ b/pkgs/development/libraries/libmcrypt/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, disablePosixThreads ? false }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "libmcrypt-2.5.8";
+  
+  src = fetchurl {
+    url = mirror://sourceforge/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz;
+    sha256 = "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4";
+  };
+
+  buildInputs = [];
+
+  configureFlags = optional disablePosixThreads
+    [ "--disable-posix-threads" ];
+
+  meta = {
+    description = "MCrypt is a replacement for the old crypt() package and crypt(1) command, with extensions.";
+    homepage = http://mcrypt.sourceforge.net;
+    license = "GPL";
+  };
+}
diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix
new file mode 100644
index 00000000000..487b4de6cb7
--- /dev/null
+++ b/pkgs/development/libraries/libmemcached/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, cyrus_sasl, libevent }:
+
+stdenv.mkDerivation rec {
+  name = "libmemcached-1.0.7";
+  
+  src = fetchurl {
+    url = https://launchpad.net/libmemcached/1.0/1.0.7/+download/libmemcached-1.0.7.tar.gz;
+    sha256 = "10cdczkgqiirjy7jwfdk49namqi4jiv1djqrf5fxbaiyfg4qdyiy";
+  };
+  
+  buildInputs = [ cyrus_sasl libevent ];
+
+  meta = {
+    homepage = http://libmemcached.org;
+    description = "libMemcached is an open source C/C++ client library and tools for the memcached server.";
+    license = "BSD";
+  };
+}
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index 90888ce0961..42f7c60610e 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, curl}:
 
 stdenv.mkDerivation rec {
-  name = "libmicrohttpd-0.9.9";
+  name = "libmicrohttpd-0.9.24";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
-    sha256 = "0059isy80cmxv44dhngnsc4g25kwxdcfis5yrva199r0vnb8ab6c";
+    sha256 = "0cp2ac6wbk493zslbvbmb5z96h18k496f9id8d2ji7hbdrwzfk6h";
   };
 
   buildInputs = [ curl ];
diff --git a/pkgs/development/libraries/libmms/default.nix b/pkgs/development/libraries/libmms/default.nix
index 8d24ddbb630..0f6d220861c 100644
--- a/pkgs/development/libraries/libmms/default.nix
+++ b/pkgs/development/libraries/libmms/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://libmms.sourceforge.net;
diff --git a/pkgs/development/libraries/libmng/default.nix b/pkgs/development/libraries/libmng/default.nix
index 5a73fd417f9..fcaf95672e1 100644
--- a/pkgs/development/libraries/libmng/default.nix
+++ b/pkgs/development/libraries/libmng/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "unmaintained/autogen.sh";
 
-  buildNativeInputs = [ automake110x autoconf libtool ];
+  nativeBuildInputs = [ automake110x autoconf libtool ];
 
   propagatedBuildInputs = [ zlib libpng libjpeg lcms ];
 
diff --git a/pkgs/development/libraries/libmnl/default.nix b/pkgs/development/libraries/libmnl/default.nix
new file mode 100644
index 00000000000..fb6eacc366b
--- /dev/null
+++ b/pkgs/development/libraries/libmnl/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libmnl-1.0.3";
+
+  src = fetchurl {
+    url = "http://netfilter.org/projects/libmnl/files/${name}.tar.bz2";
+    sha1 = "c27e25f67c6422ebf893fc3a844af8085a1c5b63";
+  };
+
+  meta = {
+    description = "minimalistic user-space library oriented to Netlink developers";
+    longDescription = ''
+      libmnl is a minimalistic user-space library oriented to Netlink developers.
+      There are a lot of common tasks in parsing, validating, constructing of both the Netlink
+      header and TLVs that are repetitive and easy to get wrong.
+      This library aims to provide simple helpers that allows you to re-use code and to avoid
+      re-inventing the wheel.
+    '';
+    homepage = http://netfilter.org/projects/libmnl/index.html;
+    license = "GPLv2+";
+
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch b/pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch
deleted file mode 100644
index cdaecf7dc54..00000000000
--- a/pkgs/development/libraries/libmsn/libmsn-4.1-openssl-1.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-http://bugs.gentoo.org/328031
-
---- msntest/msntest.cpp
-+++ msntest/msntest.cpp
-@@ -259,7 +259,11 @@
-                     if(mySocketsSsl[i].isSSL && !mySocketsSsl[i].isConnected)
-                     {
-                         BIO *bio_socket_new;
--                        SSL_METHOD *meth=NULL;
-+                        #if OPENSSL_VERSION_NUMBER >= 0x10000000L
-+                        const SSL_METHOD *meth=NULL;
-+                        #else
-+                        SSL_METHOD *meth=NULL;
-+                        #endif
-                         meth=SSLv23_client_method();
-                         SSLeay_add_ssl_algorithms();
-                         mySocketsSsl[i].ctx = SSL_CTX_new(meth);
diff --git a/pkgs/development/libraries/libmspack/default.nix b/pkgs/development/libraries/libmspack/default.nix
index 1d34b07b2a4..7a8b2d36143 100644
--- a/pkgs/development/libraries/libmspack/default.nix
+++ b/pkgs/development/libraries/libmspack/default.nix
@@ -1,9 +1,16 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "libmspack-0.0.20040308alpha";
+  name = "libmspack-0.3alpha";
   src = fetchurl {
-    url = http://www.kyz.uklinux.net/downloads/libmspack-0.0.20040308alpha.tar.gz;
-    md5 = "4d8e967649df0f6ade83df7da4b7511c";
+    url = http://www.cabextract.org.uk/libmspack/libmspack-0.3alpha.tar.gz;
+    sha256 = "03rlzhvzd3qm7sb029gs14syq1z6xjmczvwb9kbz5sl20sjngidh";
   };
+
+  meta = {
+    description = "A de/compression library for various Microsoft formats";
+    homepage = http://www.cabextract.org.uk/libmspack;
+    license = "LGPL2";
+  };
+
 }
diff --git a/pkgs/development/libraries/libnatspec/default.nix b/pkgs/development/libraries/libnatspec/default.nix
index fbab569e38c..985745c3898 100644
--- a/pkgs/development/libraries/libnatspec/default.nix
+++ b/pkgs/development/libraries/libnatspec/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, popt }:
+{ stdenv, fetchurl, popt, libiconv }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   name = "libnatspec-0.2.6";
 
   src = fetchurl {
@@ -16,4 +16,8 @@ stdenv.mkDerivation rec {
     platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.urkud ];
   };
-}
+} // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
+  NIX_CFLAGS_COMPILE = "-I${libiconv}/include";
+
+  NIX_CFLAGS_LINK = "-L${libiconv}/lib -liconv";
+})
diff --git a/pkgs/development/libraries/libnetfilter_conntrack/default.nix b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
new file mode 100644
index 00000000000..99624911077
--- /dev/null
+++ b/pkgs/development/libraries/libnetfilter_conntrack/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, pkgconfig, libnfnetlink, libmnl }:
+
+stdenv.mkDerivation rec {
+  name = "libnetfilter_conntrack-1.0.2";
+
+  src = fetchurl {
+    url = "http://netfilter.org/projects/libnetfilter_conntrack/files/${name}.tar.bz2";
+    md5 = "447114b5d61bb9a9617ead3217c3d3ff";
+  };
+
+  buildInputs = [ pkgconfig libnfnetlink libmnl ];
+
+  meta = {
+    description = "userspace library providing an API to the in-kernel connection tracking state table.";
+    longDescription = ''
+      libnetfilter_conntrack is a userspace library providing a programming interface (API) to the
+      in-kernel connection tracking state table. The library libnetfilter_conntrack has been
+      previously known as libnfnetlink_conntrack and libctnetlink. This library is currently used
+      by conntrack-tools among many other applications
+    '';
+    homepage = http://netfilter.org/projects/libnetfilter_conntrack/;
+    license = "GPLv2+";
+
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libnfnetlink/default.nix b/pkgs/development/libraries/libnfnetlink/default.nix
new file mode 100644
index 00000000000..07a182dff10
--- /dev/null
+++ b/pkgs/development/libraries/libnfnetlink/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libnfnetlink-1.0.1";
+
+  src = fetchurl {
+    url = "http://www.netfilter.org/projects/libnfnetlink/files/${name}.tar.bz2";
+    md5 = "98927583d2016a9fb1936fed992e2c5e";
+  };
+
+  meta = {
+    description = "low-level library for netfilter related kernel/userspace communication.";
+    longDescription = ''
+      libnfnetlink is the low-level library for netfilter related kernel/userspace communication.
+      It provides a generic messaging infrastructure for in-kernel netfilter subsystems
+      (such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users
+      and/or management tools in userspace.
+
+      This library is not meant as a public API for application developers.
+      It is only used by other netfilter.org projects, like the aforementioned ones.
+    '';
+    homepage = http://www.netfilter.org/projects/libnfnetlink/index.html;
+    license = "GPLv2";
+
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix
index 5a3cb9d041b..4ccb7d4df8b 100644
--- a/pkgs/development/libraries/libnice/default.nix
+++ b/pkgs/development/libraries/libnice/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, glib, gupnp_igd, gstreamer, gst_plugins_base }:
 
 stdenv.mkDerivation rec {
-  name = "libnice-0.1.1";
-  
+  name = "libnice-0.1.4";
+
   src = fetchurl {
     url = "http://nice.freedesktop.org/releases/${name}.tar.gz";
-    sha256 = "0jcpb953jn7c3ng2vbkljybzh63x6mg4m6rjxj1s1iccm3fi6qki";
+    sha256 = "0mxzr3y91hkjxdz1mzhxwi59la86hw2rzmd3y9c32801kkg1gra4";
   };
 
   buildInputs = [ pkgconfig glib gupnp_igd gstreamer gst_plugins_base ];
diff --git a/pkgs/development/libraries/libnotify/default.nix b/pkgs/development/libraries/libnotify/default.nix
index 7bfd8c05104..ab8034c781e 100644
--- a/pkgs/development/libraries/libnotify/default.nix
+++ b/pkgs/development/libraries/libnotify/default.nix
@@ -1,17 +1,34 @@
-{ stdenv, fetchurl, pkgconfig, dbus, dbus_glib, gtk, glib }:
- 
+{ stdenv, fetchurl, pkgconfig, automake, autoconf, libtool, glib, gdk_pixbuf }:
+
 stdenv.mkDerivation rec {
-  name = "libnotify-0.4.5";
+  ver_maj = "0.7";
+  ver_min = "5";
+  name = "libnotify-${ver_maj}.${ver_min}";
 
   src = fetchurl {
-    url = "http://www.galago-project.org/files/releases/source/libnotify/${name}.tar.gz";
-    sha256 = "1ndh7wpm9qh12vm5avjrq2xv1j681j9qq6j2fyj6a2shl67dp687";
+    url = "mirror://gnome/sources/libnotify/${ver_maj}/${name}.tar.xz";
+    sha256 = "0lmnzy16vdjs9vlgdm0b7wfyi1nh526hv2dpb7vxb92bhx3wny23";
+  };
+  src_m4 = fetchurl {
+    url = "mirror://gentoo/distfiles/introspection-20110205.m4.tar.bz2";
+    sha256 = "1cnqh7aaji648nfd5537v7xaak8hgww3bpifhwam7bl0sc3ad523";
   };
 
-  buildInputs = [ pkgconfig dbus.libs dbus_glib gtk glib ];
+  # see Gentoo ebuild - we don't need to depend on gtk+(2/3)
+  preConfigure = ''
+    cd m4
+    tar xvf ${src_m4}
+    cd ..
+
+    sed -i -e 's:noinst_PROG:check_PROG:' tests/Makefile.am || die
+    sed -i -e '/PKG_CHECK_MODULES(TESTS/d' configure.ac || die
+    AT_M4DIR=. autoreconf
+  '';
+
+  buildInputs = [ pkgconfig automake autoconf glib gdk_pixbuf ];
 
   meta = {
-    homepage = http://galago-project.org/;
+    homepage = http://galago-project.org/; # very obsolete but found no better
     description = "A library that sends desktop notifications to a notification daemon";
   };
 }
diff --git a/pkgs/development/libraries/libnova/default.nix b/pkgs/development/libraries/libnova/default.nix
index e24a93c1043..28decb9cfca 100644
--- a/pkgs/development/libraries/libnova/default.nix
+++ b/pkgs/development/libraries/libnova/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "libnova-0.12.1";
 	
   src = fetchurl {
-    url = "mirror://sf/libnova/${name}.tar.gz";
+    url = "mirror://sourceforge/libnova/${name}.tar.gz";
     sha256 = "0bs6c45q4qkrns36qndl8vns5gvhgpd90hi68bhah4r4hrg48lw0";
   };
   
diff --git a/pkgs/development/libraries/libogg/default.nix b/pkgs/development/libraries/libogg/default.nix
index e7e9f71eb6b..add52e00419 100644
--- a/pkgs/development/libraries/libogg/default.nix
+++ b/pkgs/development/libraries/libogg/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0jy79ffkl34vycnwfsj4svqsdg1lwy2l1rr49y8r4d44kh12a5r3";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   outputs = [ "dev" "doc" "out" ];
 
diff --git a/pkgs/development/libraries/liboil/default.nix b/pkgs/development/libraries/liboil/default.nix
index 05cafecff27..45f75b4f805 100644
--- a/pkgs/development/libraries/liboil/default.nix
+++ b/pkgs/development/libraries/liboil/default.nix
@@ -1,17 +1,20 @@
-{stdenv, fetchurl, pkgconfig, glib }:
+{stdenv, fetchurl, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "liboil-0.3.15";
+  name = "liboil-0.3.17";
 
   src = fetchurl {
     url = "${meta.homepage}/download/${name}.tar.gz";
-    sha256 = "1m3zcl54sf21cf2ckzny16ihymz8whi60ymyrhmd3m1dlw1knpmf";
+    sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh";
   };
 
-  buildInputs = [pkgconfig glib];
+  buildInputs = [ pkgconfig ];
+
+  patches = [ ./x86_64-cpuid.patch ];
 
   meta = {
     homepage = http://liboil.freedesktop.org;
     description = "A library of simple functions that are optimized for various CPUs";
+    license = "BSD-2";
   };
 }
diff --git a/pkgs/development/libraries/liboil/x86_64-cpuid.patch b/pkgs/development/libraries/liboil/x86_64-cpuid.patch
new file mode 100644
index 00000000000..d86dd79c3bc
--- /dev/null
+++ b/pkgs/development/libraries/liboil/x86_64-cpuid.patch
@@ -0,0 +1,38 @@
+From 705916007fba0a845229a02dc6474cb523eff150 Mon Sep 17 00:00:00 2001
+From: David Schleef <ds@schleef.org>
+Date: Tue, 20 Jul 2010 21:05:26 +0000
+Subject: x86: Fix cpuid function on x86-64
+
+Fixes: #28956.
+---
+diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c
+index e7a1978..ef4d3f2 100644
+--- a/liboil/liboilcpu-x86.c
++++ b/liboil/liboilcpu-x86.c
+@@ -162,13 +162,10 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
+ static void
+ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
+ {
++  *a = op;
+   __asm__ (
+-      "  pushq %%rbx\n"
+       "  cpuid\n"
+-      "  mov %%ebx, %%esi\n"
+-      "  popq %%rbx\n"
+-      : "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d)
+-      : "0" (op));
++      : "+a" (*a), "=b" (*b), "=c" (*c), "=d" (*d));
+ }
+ #endif
+ 
+@@ -185,7 +182,7 @@ oil_cpu_detect_cpuid (void)
+ {
+   uint32_t eax, ebx, ecx, edx;
+   uint32_t level;
+-  char vendor[13] = { 0 };
++  char vendor[13+4] = { 0 };
+   int ret;
+ 
+   oil_fault_check_enable ();
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/pkgs/development/libraries/libopensc-dnie/default.nix b/pkgs/development/libraries/libopensc-dnie/default.nix
index ad524c21ff1..d229933111e 100644
--- a/pkgs/development/libraries/libopensc-dnie/default.nix
+++ b/pkgs/development/libraries/libopensc-dnie/default.nix
@@ -7,11 +7,11 @@ assert opensc.name == "opensc-0.11.7";
 stdenv.mkDerivation rec {
   name = "libopensc-dnie-1.4.6-2";
   
-  src = if (stdenv.system == "i686-linux") then (fetchurl {
+  src = if stdenv.system == "i686-linux" then (fetchurl {
       url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar;
       sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i";
     })
-    else if (stdenv.system == "x86_64-linux") then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
+    else if stdenv.system == "x86_64-linux" then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
       sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9";
     })
     else throw "Architecture not supported";
diff --git a/pkgs/development/libraries/libopus/default.nix b/pkgs/development/libraries/libopus/default.nix
new file mode 100644
index 00000000000..d08ae8ef72a
--- /dev/null
+++ b/pkgs/development/libraries/libopus/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, fixedPoint ? false }:
+
+stdenv.mkDerivation rec {
+  name = "libopus-1.0.2";
+  
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/opus/opus-1.0.2.tar.gz";
+    sha256 = "12npbkrcwvh3fl9l18cwrxwg269cg2j6j7876cc9q0axxvdmwqfs";
+  };
+
+  configureFlags = stdenv.lib.optionalString fixedPoint "--enable-fixed-point";
+
+  meta = {
+    description = "Open, royalty-free, highly versatile audio codec";
+    license = "BSD";
+    homepage = http://www.opus-codec.org/;
+  };
+}
diff --git a/pkgs/development/libraries/libotr/0001-Fix-pass-opdata-when-sending-message-fragment.patch b/pkgs/development/libraries/libotr/0001-Fix-pass-opdata-when-sending-message-fragment.patch
new file mode 100644
index 00000000000..2b39d1fee9a
--- /dev/null
+++ b/pkgs/development/libraries/libotr/0001-Fix-pass-opdata-when-sending-message-fragment.patch
@@ -0,0 +1,29 @@
+From dc5f05eb934ebd285e01febb9a4018512db702b1 Mon Sep 17 00:00:00 2001
+From: David Goulet <dgoulet@ev0ke.net>
+Date: Sat, 19 Jan 2013 15:53:23 -0500
+Subject: [PATCH] Fix: pass opdata when sending message fragment
+
+The inject_message callback was missing the opdata when sending message
+fragments.
+
+Signed-off-by: David Goulet <dgoulet@ev0ke.net>
+---
+ src/message.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/message.c b/src/message.c
+index 7c39529..aa71df2 100644
+--- a/src/message.c
++++ b/src/message.c
+@@ -441,7 +441,7 @@ fragment:
+ 	/* Fragment and send according to policy */
+ 	if (!err && messagep && *messagep) {
+ 	    if (context) {
+-		err = fragment_and_send(ops, NULL, context, *messagep,
++		err = fragment_and_send(ops, opdata, context, *messagep,
+ 			fragPolicy, messagep);
+ 	    }
+ 	}
+-- 
+1.7.10.4
+
diff --git a/pkgs/development/libraries/libotr/3.2.nix b/pkgs/development/libraries/libotr/3.2.nix
new file mode 100644
index 00000000000..7dd6226a698
--- /dev/null
+++ b/pkgs/development/libraries/libotr/3.2.nix
@@ -0,0 +1,11 @@
+{stdenv, fetchurl, libgcrypt}:
+
+stdenv.mkDerivation {
+  name = "libotr-3.2.1";
+  src = fetchurl {
+    url = http://www.cypherpunks.ca/otr/libotr-3.2.0.tar.gz;
+    sha256 = "14v6idnqpp2vhgir9bzp1ay2gmhqsb8iavrkwmallakfwch9sfyq";
+  };
+
+  propagatedBuildInputs = [libgcrypt];
+}
diff --git a/pkgs/development/libraries/libotr/default.nix b/pkgs/development/libraries/libotr/default.nix
index 472cc79fd4a..d737b8d9916 100644
--- a/pkgs/development/libraries/libotr/default.nix
+++ b/pkgs/development/libraries/libotr/default.nix
@@ -1,11 +1,27 @@
 {stdenv, fetchurl, libgcrypt}:
 
-stdenv.mkDerivation {
-  name = "libotr-3.2.0";
+stdenv.mkDerivation rec {
+  name = "libotr-4.0.0";
   src = fetchurl {
-    url = http://www.cypherpunks.ca/otr/libotr-3.2.0.tar.gz;
-    sha256 = "14v6idnqpp2vhgir9bzp1ay2gmhqsb8iavrkwmallakfwch9sfyq";
+    urls = [
+      "http://www.cypherpunks.ca/otr/${name}.tar.gz"
+      # The site is down at the time of updating to 4.0.0, so I add this url
+      http://ftp.de.debian.org/debian/pool/main/libo/libotr/libotr_4.0.0.orig.tar.gz
+    ];
+    sha256 = "3f911994409898e74527730745ef35ed75c352c695a1822a677a34b2cf0293b4";
   };
 
-  propagatedBuildInputs = [libgcrypt];
+  # Crashes without it, still not accepted upstream.
+  # Discussed in https://github.com/cryptodotis/irssi-otr/issues/21
+  patches = [ ./0001-Fix-pass-opdata-when-sending-message-fragment.patch ];
+
+  NIX_LDFLAGS = "-lssp";
+
+  propagatedBuildInputs = [ libgcrypt ];
+
+  meta = {
+    homepage = "http://www.cypherpunks.ca/otr/";
+    license = "LGPLv2.1";
+    description = "Library for Off-The-Record Messaging";
+  };
 }
diff --git a/pkgs/development/libraries/libp11/default.nix b/pkgs/development/libraries/libp11/default.nix
index acfca9bf888..4f1bd7de3d9 100644
--- a/pkgs/development/libraries/libp11/default.nix
+++ b/pkgs/development/libraries/libp11/default.nix
@@ -4,7 +4,10 @@ stdenv.mkDerivation rec {
   name = "libp11-0.2.7";
   
   src = fetchurl {
-    url = "http://www.opensc-project.org/files/libp11/${name}.tar.gz";
+    urls = [
+      "http://www.opensc-project.org/files/libp11/${name}.tar.gz"
+      "http://www.openadk.org/distfiles/${name}.tar.gz"
+    ];
     sha256 = "0kaz5qafaxm0ycywmajl166c29fh9cz89b8i043jqsbxlpzf4hdp";
   };
   
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index 8f786469a55..87e2a641654 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, flex, bison }:
 
 stdenv.mkDerivation rec {
-  name = "libpcap-1.2.1";
+  name = "libpcap-1.4.0";
   
   src = fetchurl {
     url = "http://www.tcpdump.org/release/${name}.tar.gz";
-    sha256 = "1gfy00zv6blplw3405q46khmjhdnp6ylblvygjjjk5skgvpscdd1";
+    sha256 = "01klphfqxvkyjvic0hmc10qmiicqz6pv6kvb9s00kaz8f57jlskw";
   };
   
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   
   configureFlags = "--with-pcap=linux";
 
diff --git a/pkgs/development/libraries/libplist/default.nix b/pkgs/development/libraries/libplist/default.nix
index 81626959938..95da6dfb749 100644
--- a/pkgs/development/libraries/libplist/default.nix
+++ b/pkgs/development/libraries/libplist/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "libplist-1.3";
 
-  buildNativeInputs = [ cmake swig2 ];
+  nativeBuildInputs = [ cmake swig2 ];
 
   patches = [ ./swig.patch ];
 
diff --git a/pkgs/development/libraries/libpng/12.nix b/pkgs/development/libraries/libpng/12.nix
index 5d6e439484d..031e2aa1a91 100644
--- a/pkgs/development/libraries/libpng/12.nix
+++ b/pkgs/development/libraries/libpng/12.nix
@@ -3,16 +3,16 @@
 assert zlib != null;
 
 stdenv.mkDerivation rec {
-  name = "libpng-1.2.47";
+  name = "libpng-1.2.50";
 
   src = fetchurl {
     url = "mirror://sourceforge/libpng/${name}.tar.xz";
-    sha256 = "1lai3dnzw81y40jr17bdj1qh08hwv9mc1v74yybl7jdx2hiilsvx";
+    sha256 = "1rz8v3cvy1zzpagxn91lj8swb9vf75rz3yyi18v7zb4jihgzh927";
   };
 
   propagatedBuildInputs = [ zlib ];
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
   passthru = { inherit zlib; };
 
diff --git a/pkgs/development/libraries/libpng/default.nix b/pkgs/development/libraries/libpng/default.nix
index a06e8e12543..ce23cf48587 100644
--- a/pkgs/development/libraries/libpng/default.nix
+++ b/pkgs/development/libraries/libpng/default.nix
@@ -3,11 +3,11 @@
 assert zlib != null;
 
 stdenv.mkDerivation rec {
-  name = "libpng-1.5.10";
+  name = "libpng-1.5.13";
 
   src = fetchurl {
     url = "mirror://sourceforge/libpng/${name}.tar.xz";
-    sha256 = "0pb096zn6iyza28js4j7krvcw23b979igfi315aqmvx622bw6jfx";
+    sha256 = "1vks4mqv4140b10kp53qrywsx9m4xan5ibwsrlmf42ni075zjhxq";
   };
 
   propagatedBuildInputs = [ zlib ];
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 9c75bd51db1..bf1a1e232bb 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "libqalculate-0.9.7";
 
   src = fetchurl {
-    url = "mirror://sf/qalculate/${name}.tar.gz";
+    url = "mirror://sourceforge/qalculate/${name}.tar.gz";
     sha256 = "0mbrc021dk0ayyglk4qyf9328cayrlz2q94lh8sh9l9r6g79fvcs";
   };
 
diff --git a/pkgs/development/libraries/libraw1394/default.nix b/pkgs/development/libraries/libraw1394/default.nix
index 2ca4d1bd090..81cac5be709 100644
--- a/pkgs/development/libraries/libraw1394/default.nix
+++ b/pkgs/development/libraries/libraw1394/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "libraw1394-2.0.8";
+  name = "libraw1394-2.1.0";
 
   src = fetchurl {
     url = "mirror://kernel/linux/libs/ieee1394/${name}.tar.gz";
-    sha256 = "0cwd8xn7wsm7nddbz7xgynxcjb1m4v2vjw1ky4dd6r5cv454hslk";
+    sha256 = "0w5sw06p51wfq2ahgql93ljkkp3hqprifzcxq8dq71c8zcbgyg58";
   };
 
   meta = { 
diff --git a/pkgs/development/libraries/librdf/default.nix b/pkgs/development/libraries/librdf/default.nix
index e02cedeeab3..21c952b7fb8 100644
--- a/pkgs/development/libraries/librdf/default.nix
+++ b/pkgs/development/libraries/librdf/default.nix
@@ -1,16 +1,30 @@
-{ stdenv, fetchurl, pkgconfig, librdf_raptor, ladspaH, openssl, zlib }:
+{ stdenv, fetchurl, pkgconfig, libtool, automake, autoconf
+, librdf_raptor, librdf_raptor2, ladspaH, openssl, zlib #, swh_lv2
+}:
 
-stdenv.mkDerivation {
-  name = "liblrdf-0.4.0";
+stdenv.mkDerivation rec {
+  version = "0.5.0";
+  name = "liblrdf-${version}";
 
   src = fetchurl {
-    url = mirror://sourceforge/lrdf/liblrdf/0.4.0/liblrdf-0.4.0.tar.gz;
-    sha256 = "015jv7pp0a0qxgljgdvf7d01nj4fx0zgzg0wayjp7v86pa38xscm";
+    url = "http://github.com/swh/LRDF/archive/${version}.tar.gz";
+    sha256 = "18p2flb2sv2hq6w2qkd29z9c7knnwqr3f12i2srshlzx6vwkm05s";
   };
 
-  buildInputs = [ pkgconfig librdf_raptor ladspaH openssl zlib ];
+  postPatch = "sed -i -e 's:usr/local:usr:' examples/{instances,remove}_test.c";
 
-  meta = { 
+  preConfigure = "rm m4/* && autoreconf -if";
+
+  buildInputs = [
+    pkgconfig libtool automake autoconf ladspaH openssl zlib /*swh_lv2*/
+    #librdf_raptor 
+  ];
+
+  propagatedBuildInputs = [ librdf_raptor2 ];
+
+  #doCheck = true; # would need swh_lv2 and some path patching
+
+  meta = {
     description = "A lightweight RDF library with special support for LADSPA plugins.";
     homepage = http://sourceforge.net/projects/lrdf/;
     license = "GPLv2";
diff --git a/pkgs/development/libraries/librdf/raptor2.nix b/pkgs/development/libraries/librdf/raptor2.nix
index 2f956630fa1..4658cf28335 100644
--- a/pkgs/development/libraries/librdf/raptor2.nix
+++ b/pkgs/development/libraries/librdf/raptor2.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, libxml2, libxslt, curl }:
 
 stdenv.mkDerivation rec {
-  name = "raptor2-2.0.4";
+  name = "raptor2-2.0.8"; # 2.0.9 misses a header and so fails liblrdf
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "0viaam60adhsxim2vaq5xs1pfmm6wiidxpkrhwyl7x9mz8x9vx1l";
+    sha256 = "1mz7cxnfw73saf74c9if06n2mlsvn2rnn67vy7j2mq3wkhy0hcb0";
   };
 
   buildInputs = [ libxml2 libxslt ];
 
   postInstall = "rm -rvf $out/share/gtk-doc";
 
-  meta = { 
+  meta = {
     description = "The RDF Parser Toolkit";
     homepage = "http://librdf.org/raptor";
     license = "LGPL-2.1 Apache-2.0";
diff --git a/pkgs/development/libraries/librdf/rasqal.nix b/pkgs/development/libraries/librdf/rasqal.nix
index bcab7e03917..6d6f9d05808 100644
--- a/pkgs/development/libraries/librdf/rasqal.nix
+++ b/pkgs/development/libraries/librdf/rasqal.nix
@@ -1,22 +1,22 @@
 { stdenv, fetchurl, librdf_raptor2, gmp, pkgconfig, pcre, libxml2 }:
 
 stdenv.mkDerivation rec {
-  name = "rasqal-0.9.26";
+  name = "rasqal-0.9.30";
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "1drjcy1k9g72iis0ghllzn7n0w03bahhrd2p5hs39anbm6mr0yk9";
+    sha256 = "1z8wifq79kivcwpwzmjnjdrbr65zam190gpxhgrvsyfch0yykw5b";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ gmp pcre libxml2 ];
 
   propagatedBuildInputs = [ librdf_raptor2 ];
 
   postInstall = "rm -rvf $out/share/gtk-doc";
-  
-  meta = { 
+
+  meta = {
     description = "Library that handles Resource Description Framework (RDF)";
     homepage = "http://librdf.org/rasqal";
     license = "LGPL-2.1 Apache-2.0";
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index e825e1d852b..26b3de70dcd 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -7,14 +7,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "redland-1.0.14";
+  name = "redland-1.0.16";
 
   src = fetchurl {
     url = "http://download.librdf.org/source/${name}.tar.gz";
-    sha256 = "1i460q9gslb7l75hjwc6w2kp2wk7fgp8lr7phamg33c6j013y30k";
+    sha256 = "1gcx0h5dxa3c4xhhjk3gr0708zjj0n6zpslvbjfi2qbf13y798nr";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 ]
     ++ stdenv.lib.optional withMysql mysql
diff --git a/pkgs/development/libraries/libre/default.nix b/pkgs/development/libraries/libre/default.nix
new file mode 100644
index 00000000000..cc9139d664e
--- /dev/null
+++ b/pkgs/development/libraries/libre/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, zlib, openssl}:
+stdenv.mkDerivation rec {
+  version = "0.4.2";
+  name = "libre-${version}";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/re-${version}.tar.gz";
+    sha256 = "1c99ygs46qhd4a0ardxhdyjaw5p8clhzmsm8jydqxnmbakwy518m";
+  };
+  buildInputs = [zlib openssl];
+  makeFlags = [
+    "USE_ZLIB=1" "USE_OPENSSL=1" 
+    ''PREFIX=$(out)''
+  ]
+  ++ stdenv.lib.optional (stdenv.gcc.gcc != null) "SYSROOT_ALT=${stdenv.gcc.gcc}"
+  ++ stdenv.lib.optional (stdenv.gcc.libc != null) "SYSROOT=${stdenv.gcc.libc}"
+  ;
+  meta = {
+    homepage = "http://www.creytiv.com/re.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; bsd3;
+  };
+}
diff --git a/pkgs/development/libraries/librem/default.nix b/pkgs/development/libraries/librem/default.nix
new file mode 100644
index 00000000000..04f3cc97bf3
--- /dev/null
+++ b/pkgs/development/libraries/librem/default.nix
@@ -0,0 +1,24 @@
+{stdenv, fetchurl, zlib, openssl, libre}:
+stdenv.mkDerivation rec {
+  version = "0.4.2";
+  name = "librem-${version}";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/rem-${version}.tar.gz";
+    sha256 = "55c66118e3026c5ed42d8b9e0c668149baefe83f1aa76394cddba2d72f45d5c7";
+  };
+  buildInputs = [zlib openssl libre];
+  makeFlags = [
+    "LIBRE_MK=${libre}/share/re/re.mk"
+    "LIBRE_INC=${libre}/include/re"
+    ''PREFIX=$(out)''
+  ]
+  ++ stdenv.lib.optional (stdenv.gcc.gcc != null) "SYSROOT_ALT=${stdenv.gcc.gcc}"
+  ++ stdenv.lib.optional (stdenv.gcc.libc != null) "SYSROOT=${stdenv.gcc.libc}"
+  ;
+  meta = {
+    homepage = "http://www.creytiv.com/rem.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; bsd3;
+  };
+}
diff --git a/pkgs/development/libraries/librsvg/default.nix b/pkgs/development/libraries/librsvg/default.nix
index 86b818cd5a9..0da30203876 100644
--- a/pkgs/development/libraries/librsvg/default.nix
+++ b/pkgs/development/libraries/librsvg/default.nix
@@ -9,8 +9,21 @@ stdenv.mkDerivation {
   };
   buildInputs = [ libxml2 libgsf bzip2 libcroco ];
   propagatedBuildInputs = [ glib gtk ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
-  # It tries to install the loader to $gdk_pixbuf
-  configureFlags = "--disable-pixbuf-loader";
+  # It wants to add loaders and update the loaders.cache in gdk-pixbuf
+  # Patching the Makefiles to it creates rsvg specific loaders and the
+  # relevant loader.cache here.
+  # The loaders.cache can be used by setting GDK_PIXBUF_MODULE_FILE to
+  # point to this file in a wrapper.
+  postConfigure = ''
+    GDK_PIXBUF=$out/lib/gdk-pixbuf
+    mkdir -p $GDK_PIXBUF/loaders
+    sed -e "s#gdk_pixbuf_moduledir = .*#gdk_pixbuf_moduledir = $GDK_PIXBUF/loaders#" \
+        -i gdk-pixbuf-loader/Makefile
+    sed -e "s#gdk_pixbuf_cache_file = .*#gdk_pixbuf_cache_file = $GDK_PIXBUF/loaders.cache#" \
+        -i gdk-pixbuf-loader/Makefile
+    sed -e "s#\$(GDK_PIXBUF_QUERYLOADERS)#GDK_PIXBUF_MODULEDIR=$GDK_PIXBUF/loaders \$(GDK_PIXBUF_QUERYLOADERS)#" \
+         -i gdk-pixbuf-loader/Makefile
+  '';
 }
diff --git a/pkgs/development/libraries/libshout/default.nix b/pkgs/development/libraries/libshout/default.nix
new file mode 100644
index 00000000000..760b8ecce09
--- /dev/null
+++ b/pkgs/development/libraries/libshout/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, pkgconfig 
+, libvorbis, libtheora, speex}:
+
+# need pkgconfig so that libshout installs ${out}/lib/pkgconfig/shout.pc
+
+stdenv.mkDerivation rec {
+	name = "libshout-2.3.1";
+
+	src = fetchurl {
+		url = "http://downloads.xiph.org/releases/libshout/${name}.tar.gz";
+		sha256 = "cf3c5f6b4a5e3fcfbe09fb7024aa88ad4099a9945f7cb037ec06bcee7a23926e";
+	};
+
+  buildInputs = [ libvorbis libtheora speex pkgconfig ];
+
+  meta = {
+    description = "icecast 'c' language bindings";
+
+    longDescription = ''
+      Libshout is a library for communicating with and sending data to an icecast
+      server.  It handles the socket connection, the timing of the data, and prevents
+      bad data from getting to the icecast server.
+    '';
+
+    homepage = http://www.icecast.org;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+ 
+  };
+}
diff --git a/pkgs/development/libraries/libsoup/default.nix b/pkgs/development/libraries/libsoup/default.nix
index 861f41cb7a4..08784a0f257 100644
--- a/pkgs/development/libraries/libsoup/default.nix
+++ b/pkgs/development/libraries/libsoup/default.nix
@@ -2,15 +2,15 @@
 , gnomeSupport ? true, libgnome_keyring, sqlite, glib_networking }:
 
 stdenv.mkDerivation {
-  name = "libsoup-2.36.1";
+  name = "libsoup-2.38.1";
 
   src = fetchurl {
-    url = mirror://gnome/sources/libsoup/2.36/libsoup-2.36.1.tar.xz;
-    sha256 = "0r8zkr0a328jkww4dv9z1q691rw59nh4lf5f5pzzr9szzw3j8wkk";
+    url = mirror://gnome/sources/libsoup/2.38/libsoup-2.38.1.tar.xz;
+    sha256 = "16iza4y8pmc4sn90iid88fgminvgcqypy3s2qnmzkzm5qwzr5f3i";
   };
 
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ glib libxml2 ]
     ++ stdenv.lib.optionals gnomeSupport [ libgnome_keyring sqlite ];
   passthru.propagatedUserEnvPackages = [ glib_networking ];
diff --git a/pkgs/development/libraries/libspectre/default.nix b/pkgs/development/libraries/libspectre/default.nix
index 0be6ac5f4ef..a819e0cef6f 100644
--- a/pkgs/development/libraries/libspectre/default.nix
+++ b/pkgs/development/libraries/libspectre/default.nix
@@ -1,16 +1,16 @@
-{ fetchurl, stdenv, ghostscript }:
+{ fetchurl, stdenv, pkgconfig, ghostscript, cairo }:
 
 stdenv.mkDerivation rec {
-  name = "libspectre-0.2.6";
+  name = "libspectre-0.2.7";
 
   src = fetchurl {
     url = "http://libspectre.freedesktop.org/releases/${name}.tar.gz";
-    sha256 = "1lqdmi7vx497pbigpp77064a4463lmihzh44898l101c69i7qqrg";
+    sha256 = "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8";
   };
 
   buildInputs = [
     # Need `libgs.so'.
-    ghostscript
+    pkgconfig ghostscript cairo /*for tests*/
   ];
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix
new file mode 100644
index 00000000000..1972a4be653
--- /dev/null
+++ b/pkgs/development/libraries/libspotify/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey }:
+
+let version = "12.1.51"; in
+
+if stdenv.system != "x86_64-linux" then throw ''
+  Check https://developer.spotify.com/technologies/libspotify/ for a tarball for your system and add it here
+'' else stdenv.mkDerivation {
+  name = "libspotify-${version}";
+
+  src = fetchurl {
+    url = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-x86_64-release.tar.gz";
+
+    sha256 = "0n0h94i4xg46hfba95n3ypah93crwb80bhgsg00f6sms683lx8a3";
+  };
+
+  buildPhase = "true";
+
+  installFlags = "prefix=$(out)";
+
+  postInstall = "mv -v share $out";
+
+  patchPhase = "sed -i 's/ldconfig//' Makefile";
+
+  passthru = {
+    samples = if apiKey == null
+      then throw ''
+        Please visit ${libspotify.meta.homepage} to get an api key then set config.libspotify.apiKey accordingly
+      '' else stdenv.mkDerivation {
+        name = "libspotify-samples-${version}";
+
+        src = libspotify.src;
+
+        buildInputs = [ pkgconfig libspotify alsaLib readline ];
+
+        postUnpack = "sourceRoot=$sourceRoot/share/doc/libspotify/examples";
+
+        patchPhase = "cp ${apiKey} appkey.c";
+
+        installPhase = ''
+          mkdir -p $out/bin
+          install -m 755 jukebox/jukebox $out/bin
+          install -m 755 spshell/spshell $out/bin
+          install -m 755 localfiles/posix_stu $out/bin
+        '';
+
+        meta = libspotify.meta // { description = "Spotify API library samples"; };
+      };
+
+    inherit apiKey;
+  };
+
+  meta = {
+    description = "Spotify API library";
+
+    homepage = https://developer.spotify.com/technologies/libspotify;
+
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+
+    license = stdenv.lib.licenses.unfree;
+  };
+}
diff --git a/pkgs/development/libraries/libssh/default.nix b/pkgs/development/libraries/libssh/default.nix
index 1ac93db0f4d..c2b812744c9 100644
--- a/pkgs/development/libraries/libssh/default.nix
+++ b/pkgs/development/libraries/libssh/default.nix
@@ -1,14 +1,19 @@
-{stdenv, fetchurl, cmake, zlib, libgcrypt}:
+{ stdenv, fetchurl, cmake, zlib, libgcrypt }:
 
 stdenv.mkDerivation rec {
-  name = "libssh-0.5.2";
+  name = "libssh-0.5.3";
+
   src = fetchurl {
-    url = "http://www.libssh.org/files/0.5/${name}.tar.gz";
-    sha256 = "09xjb8ja8k3j3a0y3zjphhxwrnh1y618afcbbri48x87mz0vks21";
+    url = "https://red.libssh.org/attachments/download/38/${name}.tar.gz";
+    sha256 = "1w6s217vjq0w3v5i0c5ql6m0ki1yz05g9snah3azxfkl9k4schpd";
   };
+
   buildInputs = [ zlib libgcrypt ];
-  buildNativeInputs = [ cmake ];
+
+  nativeBuildInputs = [ cmake ];
+
   cmakeFlags = "-DWITH_GCRYPT=ON";
+
   meta = {
     description = "SSH client library";
     license = "LGPL";
diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix
index a0723d95671..93377429e7e 100644
--- a/pkgs/development/libraries/libssh2/default.nix
+++ b/pkgs/development/libraries/libssh2/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurlBoot, openssl, zlib}:
 
 stdenv.mkDerivation rec {
-  name = "libssh2-1.2.6";
+  name = "libssh2-1.4.3";
 
   src = fetchurlBoot {
     url = "${meta.homepage}/download/${name}.tar.gz";
-    sha256 = "00f6hw972v7jd0rrdr6kx5cn7pa1spyx8xgc7vhjydksgsig3f8b";
+    sha256 = "eac6f85f9df9db2e6386906a6227eb2cd7b3245739561cad7d6dc1d5d021b96d";
   };
 
   buildInputs = [ openssl zlib ];
diff --git a/pkgs/development/libraries/libtasn1/default.nix b/pkgs/development/libraries/libtasn1/default.nix
index f70f7d34801..f5c07f47379 100644
--- a/pkgs/development/libraries/libtasn1/default.nix
+++ b/pkgs/development/libraries/libtasn1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "libtasn1-2.12";
+  name = "libtasn1-2.13";
 
   src = fetchurl {
     url = "mirror://gnu/libtasn1/${name}.tar.gz";
-    sha256 = "0p8w38l04fgm82iqgl1abhb1ajp04v116bi6fd7lc3n80657l98f";
+    sha256 = "14asfhi35pwc67v7abbwim344h444237bjaqp92gwhhx7m44cvm5";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/libtheora/default.nix b/pkgs/development/libraries/libtheora/default.nix
index e846b213ee0..cb936747417 100644
--- a/pkgs/development/libraries/libtheora/default.nix
+++ b/pkgs/development/libraries/libtheora/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation ({
   propagatedBuildInputs = [libogg libvorbis];
 
   crossAttrs = {
-    propagatedBuildInputs = [libogg.hostDrv tremor.hostDrv];
+    propagatedBuildInputs = [libogg.crossDrv tremor.crossDrv];
     configureFlags = "--disable-examples";
   };
 }
diff --git a/pkgs/development/libraries/libtiff/default.nix b/pkgs/development/libraries/libtiff/default.nix
index 0657dc30369..44b28645927 100644
--- a/pkgs/development/libraries/libtiff/default.nix
+++ b/pkgs/development/libraries/libtiff/default.nix
@@ -1,22 +1,24 @@
 { stdenv, fetchurl, zlib, libjpeg }:
 
-stdenv.mkDerivation {
-  name = "libtiff-3.9.4";
+let version = "3.9.7"; in
+
+stdenv.mkDerivation rec {
+  name = "libtiff-${version}";
 
   src = fetchurl {
     urls =
-      [ ftp://ftp.remotesensing.org/pub/libtiff/tiff-3.9.4.tar.gz
-        http://download.osgeo.org/libtiff/tiff-3.9.4.tar.gz
+      [ "ftp://ftp.remotesensing.org/pub/libtiff/tiff-${version}.tar.gz"
+        "http://download.osgeo.org/libtiff/tiff-${version}.tar.gz"
       ];
-    sha256 = "19hxd773yxcs4lxlc3zfdkz5aiv705vj2jvy5srpqkxpbw3nvdv7";
+    sha256 = "0spg1hr5rsrmg88sfzb05qnf0haspq7r5hvdkxg5zib1rva4vmpm";
   };
 
   outputs = [ "dev" "out" "bin" "doc" ];
 
-  enableParallelBuilding = true;
-
   propagatedBuildInputs = [ zlib libjpeg ];
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Library and utilities for working with the TIFF image file format";
     homepage = http://www.libtiff.org/;
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index 8916e926771..517fbf2bd43 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -1,17 +1,21 @@
-{ stdenv, fetchurl, boost, openssl, pkgconfig, zlib }:
+{ stdenv, fetchurl, boost, openssl, pkgconfig, zlib, python }:
 
 stdenv.mkDerivation rec {
   name = "libtorrent-rasterbar-${version}";
-  version = "0.15.8";
+  version = "0.16.8";
   
   src = fetchurl {
     url = "http://libtorrent.googlecode.com/files/${name}.tar.gz";
-    sha256 = "0767i20igrfadscw3vdyadd4qidybwx9h898rkaq95zlwhaygpzm";
+    sha256 = "01jxhyndqkc0qag22s5w0vs63hlp4rr4bca8k7fj37gky7w119c0";
   };
 
-  buildInputs = [ boost pkgconfig openssl zlib ];
+  buildInputs = [ boost pkgconfig openssl zlib python ];
 
-  configureFlags = [ "--with-boost=${boost}/include/boost" "--with-boost-libdir=${boost}/lib" ];
+  configureFlags = [ 
+    "--with-boost=${boost}/include/boost" 
+    "--with-boost-libdir=${boost}/lib" 
+    "--enable-python-binding"
+ ];
   
   meta = with stdenv.lib; {
     homepage = http://www.rasterbar.com/products/libtorrent/;
diff --git a/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch b/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch
new file mode 100644
index 00000000000..1cc5b6e01be
--- /dev/null
+++ b/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch
@@ -0,0 +1,143 @@
+From 557b0e5045c9eadb556ce11e16965cf0d0787438 Mon Sep 17 00:00:00 2001
+From: Stef Walter <stefw@collabora.co.uk>
+Date: Tue, 14 Jun 2011 12:33:45 +0100
+Subject: [PATCH] Remove G_CONST_RETURN usage, now that its gone in glib.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=652545
+
+[Alexandre Rostovtsev <tetromino@gmail.com>: backported to unique-1.1]
+---
+ unique/uniqueapp.c       |    4 ++--
+ unique/uniquebackend.c   |    4 ++--
+ unique/uniquebackend.h   |    4 ++--
+ unique/uniqueinternals.h |    4 ++--
+ unique/uniquemessage.c   |    4 ++--
+ unique/uniquemessage.h   |    4 ++--
+ 6 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..e8edc94 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -781,7 +781,7 @@ unique_app_watch_window (UniqueApp *app,
+ }
+ 
+ 
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_command_to_string (UniqueApp *app,
+                           gint       command)
+ {
+@@ -863,7 +863,7 @@ unique_command_from_string (UniqueApp   *app,
+   return retval;
+ }
+ 
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_response_to_string (UniqueResponse response)
+ {
+   GEnumClass *enum_class;
+diff --git a/unique/uniquebackend.c b/unique/uniquebackend.c
+index a76e42e..68e2735 100644
+--- a/unique/uniquebackend.c
++++ b/unique/uniquebackend.c
+@@ -111,7 +111,7 @@ unique_backend_set_name (UniqueBackend *backend,
+  *
+  * Return value: FIXME
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_backend_get_name (UniqueBackend *backend)
+ {
+   g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
+@@ -154,7 +154,7 @@ unique_backend_set_startup_id (UniqueBackend *backend,
+  *
+  * Return value: FIXME
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_backend_get_startup_id (UniqueBackend *backend)
+ {
+   g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
+diff --git a/unique/uniquebackend.h b/unique/uniquebackend.h
+index a50ce4e..b19ad3e 100644
+--- a/unique/uniquebackend.h
++++ b/unique/uniquebackend.h
+@@ -94,10 +94,10 @@ GType                 unique_backend_get_type       (void) G_GNUC_CONST;
+ 
+ UniqueBackend *       unique_backend_create         (void);
+ 
+-G_CONST_RETURN gchar *unique_backend_get_name       (UniqueBackend     *backend);
++const gchar *         unique_backend_get_name       (UniqueBackend     *backend);
+ void                  unique_backend_set_name       (UniqueBackend     *backend,
+                                                      const gchar       *name);
+-G_CONST_RETURN gchar *unique_backend_get_startup_id (UniqueBackend     *backend);
++const gchar *         unique_backend_get_startup_id (UniqueBackend     *backend);
+ void                  unique_backend_set_startup_id (UniqueBackend     *backend,
+                                                      const gchar       *startup_id);
+ GdkScreen *           unique_backend_get_screen     (UniqueBackend     *backend);
+diff --git a/unique/uniqueinternals.h b/unique/uniqueinternals.h
+index 3cec152..ccae0cd 100644
+--- a/unique/uniqueinternals.h
++++ b/unique/uniqueinternals.h
+@@ -44,11 +44,11 @@ UniqueResponse unique_app_emit_message_received (UniqueApp         *app,
+  * and then back into an id
+  */
+ UniqueResponse        unique_response_from_string  (const gchar    *response);
+-G_CONST_RETURN gchar *unique_response_to_string    (UniqueResponse  response);
++const gchar *         unique_response_to_string    (UniqueResponse  response);
+ 
+ gint                  unique_command_from_string   (UniqueApp      *app,
+                                                     const gchar    *command);
+-G_CONST_RETURN gchar *unique_command_to_string     (UniqueApp      *app,
++const gchar *         unique_command_to_string     (UniqueApp      *app,
+                                                     gint            command);
+ 
+ G_END_DECLS
+diff --git a/unique/uniquemessage.c b/unique/uniquemessage.c
+index c74392d..2b2a9fc 100644
+--- a/unique/uniquemessage.c
++++ b/unique/uniquemessage.c
+@@ -185,7 +185,7 @@ unique_message_data_set (UniqueMessageData *message_data,
+  *
+  * Since: 1.0.2
+  */
+-G_CONST_RETURN guchar *
++const guchar *
+ unique_message_data_get (UniqueMessageData *message_data,
+                          gsize             *length)
+ {
+@@ -525,7 +525,7 @@ unique_message_data_get_screen (UniqueMessageData *message_data)
+  *   owned by the #UniqueMessageData structure and should not be
+  *   modified or freed
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_message_data_get_startup_id (UniqueMessageData *message_data)
+ {
+   g_return_val_if_fail (message_data != NULL, NULL);
+diff --git a/unique/uniquemessage.h b/unique/uniquemessage.h
+index d3e9c3c..93eee21 100644
+--- a/unique/uniquemessage.h
++++ b/unique/uniquemessage.h
+@@ -48,7 +48,7 @@ void                   unique_message_data_free           (UniqueMessageData *me
+ void                   unique_message_data_set            (UniqueMessageData *message_data,
+                                                            const guchar      *data,
+                                                            gsize              length);
+-G_CONST_RETURN guchar *unique_message_data_get            (UniqueMessageData *message_data,
++const guchar *         unique_message_data_get            (UniqueMessageData *message_data,
+                                                            gsize             *length);
+ 
+ gboolean               unique_message_data_set_text       (UniqueMessageData *message_data,
+@@ -63,7 +63,7 @@ void                   unique_message_data_set_filename   (UniqueMessageData *me
+ gchar *                unique_message_data_get_filename   (UniqueMessageData *message_data);
+ 
+ GdkScreen *            unique_message_data_get_screen     (UniqueMessageData *message_data);
+-G_CONST_RETURN gchar * unique_message_data_get_startup_id (UniqueMessageData *message_data);
++const gchar *          unique_message_data_get_startup_id (UniqueMessageData *message_data);
+ guint                  unique_message_data_get_workspace  (UniqueMessageData *message_data);
+ 
+ G_END_DECLS
+-- 
+1.7.6
+
diff --git a/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch b/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch
new file mode 100644
index 00000000000..f47e66267d5
--- /dev/null
+++ b/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch
@@ -0,0 +1,50 @@
+From 9df132a70d54b768a8e1d0335d24b85ac9b3fb76 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@linux.intel.com>
+Date: Sun, 27 Mar 2011 08:42:22 +0000
+Subject: Remove compiler warnings
+
+(cherry picked from commit f791ed16b19dddc7fbaf90d8f797520e67883021)
+
+Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
+---
+diff --git a/unique/dbus/uniquebackend-dbus.c b/unique/dbus/uniquebackend-dbus.c
+index 3ae1bed..69faa00 100644
+--- a/unique/dbus/uniquebackend-dbus.c
++++ b/unique/dbus/uniquebackend-dbus.c
+@@ -84,7 +84,6 @@ unique_backend_dbus_register_proxy (UniqueBackendDBus *backend_dbus)
+ static gboolean
+ unique_backend_dbus_request_name (UniqueBackend *backend)
+ {
+-  UniqueBackendDBus *backend_dbus;
+   const gchar *name;
+   DBusGConnection *connection;
+   DBusGProxy *proxy;
+@@ -97,8 +96,6 @@ unique_backend_dbus_request_name (UniqueBackend *backend)
+   if (!connection)
+     return FALSE;
+ 
+-  backend_dbus = UNIQUE_BACKEND_DBUS (backend);
+-
+   retval = TRUE;
+   name = unique_backend_get_name (backend);
+   g_assert (name != NULL);
+@@ -207,10 +204,14 @@ unique_backend_dbus_send_message (UniqueBackend     *backend,
+                                         cmd, data, time_,
+                                         &resp,
+                                         &error);
+-  if (error)
++  if (!res)
+     {
+-      g_warning ("Error while sending message: %s", error->message);
+-      g_error_free (error);
++      if (error)
++        {
++          g_warning ("Error while sending message: %s", error->message);
++          g_error_free (error);
++        }
++
+       g_free (cmd);
+       
+       return UNIQUE_RESPONSE_INVALID;
+--
+cgit v0.9
diff --git a/pkgs/development/libraries/libunique/1.1.6-fix-test.patch b/pkgs/development/libraries/libunique/1.1.6-fix-test.patch
new file mode 100644
index 00000000000..b2e85e4d71a
--- /dev/null
+++ b/pkgs/development/libraries/libunique/1.1.6-fix-test.patch
@@ -0,0 +1,26 @@
+From caf736f4b84808393b0d7030ae6128a3322a71e2 Mon Sep 17 00:00:00 2001
+From: Tobias Mueller <tobiasmue@gnome.org>
+Date: Mon, 12 Apr 2010 13:01:42 +0000
+Subject: test-unique: Resolve format string issues
+
+Provide a proper literal format string to not expose potential vulnerabilites.
+Fixes bug 615522.
+---
+diff --git a/tests/test-unique.c b/tests/test-unique.c
+index b7cde45..c9958c9 100644
+--- a/tests/test-unique.c
++++ b/tests/test-unique.c
+@@ -82,9 +82,11 @@ app_message_cb (UniqueApp         *app,
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_CLOSE,
++                                   "%s",
+                                    title);
+   if (message)
+     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
++                                              "%s",
+                                               message);
+ 
+   gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
+--
+cgit v0.9
diff --git a/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch b/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch
new file mode 100644
index 00000000000..927771e7311
--- /dev/null
+++ b/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch
@@ -0,0 +1,37 @@
+From 30ca2903a8ed4eed974ea744e4b9bd96198c425d Mon Sep 17 00:00:00 2001
+From: Rodney Lorrimar <r.lorrimar@fugro-fsi.com.au>
+Date: Mon, 21 Dec 2009 02:07:46 +0000
+Subject: Include NUL terminator in unique_message_data_get_filename()
+
+https://bugzilla.gnome.org/show_bug.cgi?id=605104
+
+Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
+---
+diff --git a/unique/uniqueinternals.h b/unique/uniqueinternals.h
+index ace40ed..3cec152 100644
+--- a/unique/uniqueinternals.h
++++ b/unique/uniqueinternals.h
+@@ -13,7 +13,7 @@ G_BEGIN_DECLS
+ struct _UniqueMessageData
+ {
+   guchar *data;
+-  gint length;
++  gint length;  /* length of data not including NUL terminator */
+ 
+   GdkScreen *screen;
+   gchar *startup_id;
+diff --git a/unique/uniquemessage.c b/unique/uniquemessage.c
+index 10f6df5..c74392d 100644
+--- a/unique/uniquemessage.c
++++ b/unique/uniquemessage.c
+@@ -493,7 +493,7 @@ unique_message_data_get_filename (UniqueMessageData *message_data)
+ {
+   g_return_val_if_fail (message_data != NULL, NULL);
+ 
+-  return g_memdup (message_data->data, message_data->length);
++  return g_memdup (message_data->data, message_data->length + 1);
+ }
+ 
+ /**
+--
+cgit v0.9
diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix
new file mode 100644
index 00000000000..603759d47c0
--- /dev/null
+++ b/pkgs/development/libraries/libunique/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, glib, gtk, dbus_glib }:
+
+stdenv.mkDerivation rec {
+  name = "libunique-1.1.6";
+  src = fetchurl {
+    url = "mirror://gnome/sources/libunique/1.1/${name}.tar.bz2";
+    sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
+  };
+
+  # patches from Gentoo portage
+  patches = [
+    ./1.1.6-compiler-warnings.patch
+    ./1.1.6-fix-test.patch
+    ./1.1.6-G_CONST_RETURN.patch
+    ./1.1.6-include-terminator.patch
+  ];
+
+  buildInputs = [ pkgconfig glib gtk dbus_glib ];
+
+  # don't make deprecated usages hard errors
+  preBuildPhases = "preBuild";
+  preBuild = ''substituteInPlace unique/dbus/Makefile --replace -Werror ""'';
+
+  doCheck = true;
+
+  meta = {
+    homepage = http://live.gnome.org/LibUnique;
+    description = "A library for writing single instance applications";
+    license = "LGPLv2.1";
+  };
+}
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index dcdd9f46d76..8a1580d4fbe 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "libusb-1.0.8";
+  name = "libusb-1.0.9";
 
   src = fetchurl {
     url = "mirror://sourceforge/libusb/${name}.tar.bz2";
-    sha256 = "1afvpaqnl5plqg95nkvsl4sj9d6ckrmjq44mql8l4zqgf6jx7l11";
+    sha256 = "16sz34ix6hw2wwl3kqx6rf26fg210iryr68wc439dc065pffw879";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/libva/default.nix b/pkgs/development/libraries/libva/default.nix
index 9b2eb19bab4..5caea5ba610 100644
--- a/pkgs/development/libraries/libva/default.nix
+++ b/pkgs/development/libraries/libva/default.nix
@@ -1,19 +1,16 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes, intelgen4asm }:
+{ stdenv, fetchurl, libX11, pkgconfig, libXext, mesa, libdrm, libXfixes }:
 
 stdenv.mkDerivation rec {
-  name = "libva-1.0.12";
+  name = "libva-1.1.0";
   
   src = fetchurl {
-    url = "http://cgit.freedesktop.org/libva/snapshot/${name}.tar.bz2";
-    sha256 = "1xg8zvmh75w63sc8ykagzrbzswph6g9jardy8v83glkqzilaw2p8";
+    url = "http://www.freedesktop.org/software/vaapi/releases/libva/${name}.tar.bz2";
+    sha256 = "1a7g7i96ww8hmim2pq2a3xc89073lzacxn1xh9526bzhlqjdqsnv";
   };
 
-  buildInputs = [ autoconf automake libtool libX11 libXext pkgconfig mesa libdrm
-    libXfixes intelgen4asm ];
+  buildInputs = [ libX11 libXext pkgconfig mesa libdrm libXfixes ];
 
-  configureFlags = [ "--enable-i965-driver" "--enable-glx" ];
-
-  preConfigure = "sh autogen.sh";
+  configureFlags = [ "--enable-glx" ];
 
   meta = {
     homepage = http://www.freedesktop.org/wiki/Software/vaapi;
diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix
index bf9927c9307..92ab8d67c91 100644
--- a/pkgs/development/libraries/libvdpau/default.nix
+++ b/pkgs/development/libraries/libvdpau/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libX11 }:
 
 stdenv.mkDerivation rec {
-  name = "libvdpau-0.4.1";
+  name = "libvdpau-0.5";
   
   src = fetchurl {
     url = "http://people.freedesktop.org/~aplattner/vdpau/${name}.tar.gz";
-    sha256 = "16zmmbawfnvrxjqvgfwxjfd1wh3vyz2cmvxza6cgf4j9qs36y6q6";
+    sha256 = "0k2ydz4yp7zynlkpd1llfwax30xndwbca36z83ah1i4ldjw2gfhx";
   };
 
   buildInputs = [ pkgconfig libX11 ];
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index de6ef510e16..6a6b693cbbe 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -3,14 +3,14 @@
 , libtasn1, ebtables, libgcrypt, yajl
 }:
 
-let version = "0.9.11"; in
+let version = "1.0.3"; in
 
 stdenv.mkDerivation {
   name = "libvirt-${version}";
 
   src = fetchurl {
     url = "http://libvirt.org/sources/libvirt-${version}.tar.gz";
-    sha256 = "0qk0fsc5rxwwjp7801vdanmw61p89xqiy6q279i0kqc3bx1zx66f";
+    sha256 = "0mr727n0ygxk6y69srg3ahmjd7wligamw683x2snmz6wgk6llkzn";
   };
 
   buildInputs =
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
 
   postInstall =
     ''
-      substituteInPlace $out/etc/rc.d/init.d/libvirt-guests \
+      substituteInPlace $out/libexec/libvirt-guests.sh \
         --replace "$out/bin" "${gettext}/bin"
     '';
 
diff --git a/pkgs/development/libraries/libvisio/default.nix b/pkgs/development/libraries/libvisio/default.nix
new file mode 100644
index 00000000000..77e7e0a56f6
--- /dev/null
+++ b/pkgs/development/libraries/libvisio/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, boost, libwpd, libwpg, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "libvisio-0.0.19";
+
+  src = fetchurl {
+    url = "http://dev-www.libreoffice.org/src/${name}.tar.xz";
+    sha256 = "1iqkz280mi066bdccyxagkqm41i270nx01cacvgjq2pflgd3njd1";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ boost libwpd libwpg ];
+
+  configureFlags = "--disable-werror";
+
+  meta = {
+    description = "A library providing ability to interpret and import visio diagrams into various applications";
+    homepage = http://www.freedesktop.org/wiki/Software/libvisio;
+    platforms = stdenv.lib.platforms.gnu; # random choice
+  };
+}
diff --git a/pkgs/development/libraries/libvncserver/default.nix b/pkgs/development/libraries/libvncserver/default.nix
index 755ae1dfca5..65a8880fc9d 100644
--- a/pkgs/development/libraries/libvncserver/default.nix
+++ b/pkgs/development/libraries/libvncserver/default.nix
@@ -3,7 +3,7 @@ let
   lib = args.lib;
   fetchurl = args.fetchurl;
 
-  version = lib.attrByPath ["version"] "0.9.1" args; 
+  version = lib.attrByPath ["version"] "0.9.9" args; 
   buildInputs = with args; [
     libtool libjpeg openssl libX11 libXdamage xproto damageproto
     xextproto libXext fixesproto libXfixes xineramaproto libXinerama
@@ -13,7 +13,7 @@ in
 rec {
   src = fetchurl {
     url = "http://downloads.sourceforge.net/libvncserver/LibVNCServer-${version}.tar.gz";
-    sha256 = "10pjhfv0vnfphy4bghygm1bfz983ca6y91mmpsyn1wy16zyagg8g";
+    sha256 = "1y83z31wbjivbxs60kj8a8mmjmdkgxlvr2x15yz95yy24lshs1ng";
   };
 
   inherit buildInputs;
diff --git a/pkgs/development/libraries/libvorbis/default.nix b/pkgs/development/libraries/libvorbis/default.nix
index 0a54adcada4..b6c25ad9a93 100644
--- a/pkgs/development/libraries/libvorbis/default.nix
+++ b/pkgs/development/libraries/libvorbis/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1gby6hapz9njx4l9g0pndyk4q83z5fgrgc30mfwfgx7bllspsk43";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
   propagatedBuildInputs = [ libogg ];
 
   outputs = [ "dev" "out" "doc" ];
diff --git a/pkgs/development/libraries/libvpx/default.nix b/pkgs/development/libraries/libvpx/default.nix
index 0d1a2cacc46..1c225aa7853 100644
--- a/pkgs/development/libraries/libvpx/default.nix
+++ b/pkgs/development/libraries/libvpx/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, bash, yasm, which, perl}:
 
 stdenv.mkDerivation rec {
-  name = "libvpx-1.0.0";
+  name = "libvpx-1.1.0";
   
   src = fetchurl {
-    url = http://webm.googlecode.com/files/libvpx-v1.0.0.tar.bz2;
-    sha256 = "08gyx90ndv0v8dhbhp3jdh6g37pmcjlfwljzsy0nskm4345dpkh7";
+    url = http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2;
+    sha256 = "1ibjxcdsazqfbbjhb8w56vy3n9qwny2m9q4kzx4rmk9v9g7p9q4w";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/libraries/libwpd/0.8.nix b/pkgs/development/libraries/libwpd/0.8.nix
index ceaa0d36d4b..536db35fb4e 100644
--- a/pkgs/development/libraries/libwpd/0.8.nix
+++ b/pkgs/development/libraries/libwpd/0.8.nix
@@ -12,5 +12,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib libgsf libxml2 ];
 
-  buildNativeInputs = [ pkgconfig bzip2 ];
+  nativeBuildInputs = [ pkgconfig bzip2 ];
 }
diff --git a/pkgs/development/libraries/libwpd/default.nix b/pkgs/development/libraries/libwpd/default.nix
index d857b6e17ea..1c56022de58 100644
--- a/pkgs/development/libraries/libwpd/default.nix
+++ b/pkgs/development/libraries/libwpd/default.nix
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ glib libgsf libxml2 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/libwpg/default.nix b/pkgs/development/libraries/libwpg/default.nix
index d140b8b8a0c..a97b8fc2fd8 100644
--- a/pkgs/development/libraries/libwpg/default.nix
+++ b/pkgs/development/libraries/libwpg/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libwpd ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://libwpg.sourceforge.net;
diff --git a/pkgs/development/libraries/libxcrypt/default.nix b/pkgs/development/libraries/libxcrypt/default.nix
deleted file mode 100644
index 536d30992bb..00000000000
--- a/pkgs/development/libraries/libxcrypt/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl}:
-
-# I could not build it in armv5tel-linux or the fuloon2f
-assert !stdenv.isArm;
-assert stdenv.system != "mips64el-linux";
-   
-stdenv.mkDerivation {
-  name = "libxcrypt-3.0.2";
-   
-  src = fetchurl {
-    url = ftp://ftp.suse.com/pub/people/kukuk/libxcrypt/libxcrypt-3.0.2.tar.bz2;
-    sha256 = "15l2xvhi3r3b40x4665c101ikylh5xsbpw03gnszypfjgn1jkcii";
-  };
-
-  patches = [ ./gcc46.patch ];
-
-}
diff --git a/pkgs/development/libraries/libxcrypt/gcc46.patch b/pkgs/development/libraries/libxcrypt/gcc46.patch
deleted file mode 100644
index 0664f96aa68..00000000000
--- a/pkgs/development/libraries/libxcrypt/gcc46.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-For gcc 4.6 to build this. Otherwise it says 's unused variable', and it's built
-with -Werror.
-
-diff --git a/src/cert.c b/src/cert.c
-index 28c7b11..34570a4 100644
---- a/src/cert.c
-+++ b/src/cert.c
-@@ -87,9 +87,7 @@ char *cp;
- 	int i,j,t;
- 
- 	for(i=0;i<8;i++){
--		int s;
--                  
--                s = scanf("%2x",&t);
-+                scanf("%2x",&t);
- 		if(feof(stdin))
- 		  good_bye();
- 		for(j=0; j<8 ; j++) {
diff --git a/pkgs/development/libraries/libxklavier/default.nix b/pkgs/development/libraries/libxklavier/default.nix
index 419f9a497c0..ac5c6146cba 100644
--- a/pkgs/development/libraries/libxklavier/default.nix
+++ b/pkgs/development/libraries/libxklavier/default.nix
@@ -5,14 +5,14 @@ stdenv.mkDerivation rec {
   name = "libxklavier-5.0";
 
   src = fetchurl {
-    url = "mirror://sf/gswitchit/${name}.tar.bz2";
+    url = "mirror://sourceforge/gswitchit/${name}.tar.bz2";
     sha256 = "1c2dxinjfpq1lzxi0z46r0j80crbmwb0lkvnh6987cjjlwblpnfz";
   };
 
   # TODO: enable xmodmap support, needs xmodmap DB
   propagatedBuildInputs = [ libX11 libXi xkeyboard_config libxml2 libICE glib libxkbfile isocodes ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = ''
     --with-xkb-base=${xkeyboard_config}/etc/X11/xkb
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index defba390cf1..e25074f8d12 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -1,28 +1,39 @@
-{stdenv, fetchurl, zlib, python ? null, pythonSupport ? true }:
+{ stdenv, fetchurl, zlib, xz, python ? null, pythonSupport ? true }:
 
 assert pythonSupport -> python != null;
 
-stdenv.mkDerivation {
-  name = "libxml2-2.7.8";
+stdenv.mkDerivation rec {
+  name = "libxml2-2.9.0";
 
   src = fetchurl {
-    url = ftp://xmlsoft.org/libxml2/libxml2-sources-2.7.8.tar.gz;
-    sha256 = "6a33c3a2d18b902cd049e0faa25dd39f9b554a5b09a3bb56ee07dd7938b11c54";
+    url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
+    sha256 = "10ib8bpar2pl68aqksfinvfmqknwnk7i35ibq6yjl8dpb0cxj9dd";
   };
 
-  configureFlags = ''                                                  
-    ${if pythonSupport then "--with-python=${python}" else ""}         
-  '';
-  
-  propagatedBuildInputs = [zlib];
+  patches = [ ./pthread-once-init.patch ];
+
+  configureFlags = stdenv.lib.optionalString pythonSupport "--with-python=${python}";
+
+  buildInputs = (stdenv.lib.optional pythonSupport [ python ])
+
+    # Libxml2 has an optional dependency on liblzma.  However, on impure
+    # platforms, it may end up using that from /usr/lib, and thus lack a
+    # RUNPATH for that, leading to undefined references for its users.
+    ++ (stdenv.lib.optional stdenv.isFreeBSD xz);
+
+  propagatedBuildInputs = [ zlib ];
 
   setupHook = ./setup-hook.sh;
 
-  passthru = {inherit pythonSupport;};
+  passthru = { inherit pythonSupport; };
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = http://xmlsoft.org/;
-    description = "A XML parsing library for C";
+    description = "An XML parsing library for C";
     license = "bsd";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/development/libraries/libxml2/pthread-once-init.patch b/pkgs/development/libraries/libxml2/pthread-once-init.patch
new file mode 100644
index 00000000000..fadfc27a911
--- /dev/null
+++ b/pkgs/development/libraries/libxml2/pthread-once-init.patch
@@ -0,0 +1,35 @@
+http://git.gnome.org/browse/libxml2/commit/?id=3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e
+
+From 3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e Mon Sep 17 00:00:00 2001
+From: Friedrich Haubensak <hsk@fli-leibniz.de>
+Date: Wed, 12 Sep 2012 15:34:53 +0000
+Subject: Fix a thread portability problem
+
+cannot compile libxml2-2.9.0 using studio 12.1 compiler on solaris 10
+
+I.M.O. structure initializer (as PTHREAD_ONCE_INIT) cannot be used in
+a structure assignment anyway
+---
+diff --git a/threads.c b/threads.c
+index f206149..7e85a26 100644
+--- a/threads.c
++++ b/threads.c
+@@ -146,6 +146,7 @@ struct _xmlRMutex {
+ static pthread_key_t globalkey;
+ static pthread_t mainthread;
+ static pthread_once_t once_control = PTHREAD_ONCE_INIT;
++static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
+ static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
+ #elif defined HAVE_WIN32_THREADS
+ #if defined(HAVE_COMPILER_TLS)
+@@ -915,7 +916,7 @@ xmlCleanupThreads(void)
+ #ifdef HAVE_PTHREAD_H
+     if ((libxml_is_threaded)  && (pthread_key_delete != NULL))
+         pthread_key_delete(globalkey);
+-    once_control = PTHREAD_ONCE_INIT;
++    once_control = once_control_init;
+ #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || defined(LIBXML_STATIC_FOR_DLL))
+     if (globalkey != TLS_OUT_OF_INDEXES) {
+         xmlGlobalStateCleanupHelperParams *p;
+--
+cgit v0.9.0.2
diff --git a/pkgs/development/libraries/libxml2/setup-hook.sh b/pkgs/development/libraries/libxml2/setup-hook.sh
index d87c226506a..f8e4f5e0fd6 100644
--- a/pkgs/development/libraries/libxml2/setup-hook.sh
+++ b/pkgs/development/libraries/libxml2/setup-hook.sh
@@ -1,10 +1,10 @@
 addXMLCatalogs () {
     for kind in dtd xsl; do
-	if test -d $1/xml/$kind; then
+        if test -d $1/xml/$kind; then
             for i in $(find $1/xml/$kind -name catalog.xml); do
-		export XML_CATALOG_FILES="$XML_CATALOG_FILES $i"
+                export XML_CATALOG_FILES="$XML_CATALOG_FILES $i"
             done
-	fi
+        fi
     done
 }
 
diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix
index 05ce8019c4e..ed56ffaff73 100644
--- a/pkgs/development/libraries/libxslt/default.nix
+++ b/pkgs/development/libraries/libxslt/default.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl, libxml2 }:
+{ stdenv, fetchurl, libxml2 }:
+
+stdenv.mkDerivation (rec {
+  name = "libxslt-1.1.27";
 
-stdenv.mkDerivation rec {
-  name = "libxslt-1.1.26";
-  
   src = fetchurl {
     url = "ftp://xmlsoft.org/libxml2/${name}.tar.gz";
-    sha256 = "1c9xdv39jvq1hp16gsbi56hbz032dmqyy0fpi4ls1y3152s55pam";
+    sha256 = "09ky3vhlaahvsb0q9gp6h3as53pfj70gincirachjqzj46jdka5n";
   };
-  
-  buildInputs = [libxml2];
-  
+
+  buildInputs = [ libxml2 ];
+
   postInstall = ''
     mkdir -p $out/nix-support
     ln -s ${libxml2}/nix-support/setup-hook $out/nix-support/
@@ -19,5 +19,18 @@ stdenv.mkDerivation rec {
     homepage = http://xmlsoft.org/XSLT/;
     description = "A C library and tools to do XSL transformations";
     license = "bsd";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
-}
+} // (if !stdenv.isFreeBSD then {} else {
+  buildInputs = [];
+
+  configureFlags = [
+    "--with-libxml-prefix=${libxml2}"
+    "--without-python"
+    "--without-crypto"
+    "--without-debug"
+    "--without-mem-debug"
+    "--without-debugger"
+  ];
+}))
diff --git a/pkgs/development/libraries/libxtc_dxtn/default.nix b/pkgs/development/libraries/libxtc_dxtn/default.nix
new file mode 100644
index 00000000000..0e7442633d7
--- /dev/null
+++ b/pkgs/development/libraries/libxtc_dxtn/default.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, mesa }:
+
+stdenv.mkDerivation rec {
+  name = "libtxc_dxtn-1.0.1";
+
+  src = fetchurl {
+    url = "people.freedesktop.org/~cbrill/libtxc_dxtn/${name}.tar.bz2";
+    sha256 = "0q5fjaknl7s0z206dd8nzk9bdh8g4p23bz7784zrllnarl90saa5";
+  };
+
+  postUnpack = ''
+    tar xf ${mesa.src} --wildcards '*/include/'
+    export NIX_CFLAGS_COMPILE="-I $NIX_BUILD_TOP/[mM]esa*/include"
+  '';
+}
diff --git a/pkgs/development/libraries/libyaml/default.nix b/pkgs/development/libraries/libyaml/default.nix
index 5d56b6bcdcd..50bc4019df6 100644
--- a/pkgs/development/libraries/libyaml/default.nix
+++ b/pkgs/development/libraries/libyaml/default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "libyaml";
+  name = "libyaml-0.1.3";
 
   src = fetchurl {
     url = http://pyyaml.org/download/libyaml/yaml-0.1.3.tar.gz;
diff --git a/pkgs/development/libraries/lirc/default.nix b/pkgs/development/libraries/lirc/default.nix
index 20ef82401e6..75f175a5b2d 100644
--- a/pkgs/development/libraries/lirc/default.nix
+++ b/pkgs/development/libraries/lirc/default.nix
@@ -10,5 +10,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ alsaLib ];
 
-  configureFlags = "--with-driver=none --enable-sandboxed";
+  configureFlags = [
+    "--with-driver=devinput"
+    "--sysconfdir=$(out)/etc"
+    "--enable-sandboxed"
+  ];
 }
diff --git a/pkgs/development/libraries/log4cpp/default.nix b/pkgs/development/libraries/log4cpp/default.nix
new file mode 100644
index 00000000000..2b255307558
--- /dev/null
+++ b/pkgs/development/libraries/log4cpp/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "log4cpp-1.1";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/log4cpp/${name}.tar.gz";
+    sha256 = "1d386ws9v6f9bxma4dh5m6nzr4k2rv5q96xl5bp5synlmghd2ny2";
+  };
+
+  meta = {
+    homepage = http://log4cpp.sourceforge.net/;
+    description = "A logging framework for C++ patterned after Apache log4j";
+    license = "LGPLv2.1+";
+  };
+}
diff --git a/pkgs/development/libraries/loudmouth/default.nix b/pkgs/development/libraries/loudmouth/default.nix
index ffa3ebdef92..ae9f3fc6c18 100644
--- a/pkgs/development/libraries/loudmouth/default.nix
+++ b/pkgs/development/libraries/loudmouth/default.nix
@@ -1,16 +1,22 @@
-{stdenv, fetchurl, openssl, libidn, glib, pkgconfig, zlib}:
+{ stdenv, fetchurl, openssl, libidn, glib, pkgconfig, zlib }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   name = "loudmouth-1.4.3";
-    
+
   src = fetchurl {
-    url = mirror://gnome/sources/loudmouth/1.4/loudmouth-1.4.3.tar.bz2;
+    url = "mirror://gnome/sources/loudmouth/1.4/${name}.tar.bz2";
     md5 = "55339ca42494690c3942ee1465a96937";
   };
-    
+
+  patches = [ ./glib-2.32.patch ];
+
   configureFlags = "--with-ssl=openssl";
-  
-  propagatedBuildInputs = [openssl libidn glib zlib];
-  
-  buildInputs = [pkgconfig];
+
+  propagatedBuildInputs = [ openssl libidn glib zlib ];
+
+  buildInputs = [ pkgconfig ];
+
+  meta = {
+    description = "A lightweight C library for the Jabber protocol";
+  };
 }
diff --git a/pkgs/development/libraries/loudmouth/glib-2.32.patch b/pkgs/development/libraries/loudmouth/glib-2.32.patch
new file mode 100644
index 00000000000..87fc170c80d
--- /dev/null
+++ b/pkgs/development/libraries/loudmouth/glib-2.32.patch
@@ -0,0 +1,13 @@
+Index: loudmouth-1.4.3/loudmouth/lm-error.c
+===================================================================
+--- loudmouth-1.4.3.orig/loudmouth/lm-error.c
++++ loudmouth-1.4.3/loudmouth/lm-error.c
+@@ -19,7 +19,7 @@
+  */
+ 
+ #include <config.h>
+-#include <glib/gerror.h>
++#include <glib.h>
+ #include "lm-error.h"
+ 
+ /**
diff --git a/pkgs/development/libraries/mdds/default.nix b/pkgs/development/libraries/mdds/default.nix
new file mode 100644
index 00000000000..484f878a55e
--- /dev/null
+++ b/pkgs/development/libraries/mdds/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "mdds-0.6.0";
+
+  src = fetchurl {
+    url = http://multidimalgorithm.googlecode.com/files/mdds_0.6.0.tar.bz2;
+    sha256 = "0yx6cx2cxk9wpmfpv6k3agkr1sjzxdgxrm3zfj34zwyxr3sh0ql4";
+  };
+
+  meta = {
+    homepage = https://code.google.com/p/multidimalgorithm/;
+    description = "A collection of multi-dimensional data structure and indexing algorithm";
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index 3d5dff53ff4..4aa78570b2f 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -2,15 +2,15 @@
   libv4l, libtheora, intltool, libvpx, gsm }:
 
 stdenv.mkDerivation rec {
-  name = "mediastreamer-2.8.0";
+  name = "mediastreamer-2.8.2";
 
   src = fetchurl {
     url = "mirror://savannah/linphone/mediastreamer/${name}.tar.gz";
-    sha256 = "0h1qda2mjc76xirldlvpmzf57vcbgr113a9b0kw1xm5i58s0w34f";
+    sha256 = "0csg9a4mwfw5j475q9d5klhy82jnpcqfrlbvw81nxnqki40bnbm6";
   };
 
 # TODO: make it load plugins from *_PLUGIN_PATH
-  buildNativeInputs = [pkgconfig intltool];
+  nativeBuildInputs = [pkgconfig intltool];
 
   propagatedBuildInputs = [alsaLib ffmpeg speex ortp pulseaudio xorg.libX11
     xorg.libXv xorg.libXext libv4l libtheora libvpx gsm ];
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index 219dc161761..d3f7afbd308 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -7,34 +7,31 @@ if ! stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms then
   throw "unsupported platform for Mesa"
 else
 
-let version = "7.11.2"; in
+let version = "8.0.4"; in
 
 stdenv.mkDerivation {
   name = "mesa-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.freedesktop.org/pub/mesa/${version}/MesaLib-${version}.tar.bz2";
-    sha256 = "0msk1fh4yw4yi7z37v75vhpa23z49lkwgin6drczbihbqsl6lx2p";
+    md5 = "d546f988adfdf986cff45b1efa2d8a46";
   };
 
-  patches = [ ./swrast-settexbuffer.patch ] ++ stdenv.lib.optional
-    (stdenv.system == "mips64el-linux") ./mips_wmb.patch;
+  patches =
+    stdenv.lib.optional (stdenv.system == "mips64el-linux") ./mips_wmb.patch;
 
   prePatch = "patchShebangs .";
 
-# r300
   configureFlags =
-      " --with-driver=dri --enable-gl-osmesa --enable-gles1"
+      " --enable-gles1 --enable-gles2 --enable-gallium-egl"
     + " --with-gallium-drivers=i915,nouveau,r600,svga,swrast"
-    + " --enable-gles2 --enable-gallium-egl --disable-glx-tls"
-    + " --enable-xcb --enable-egl --disable-glut"
     # Texture floats are patented, see docs/patents.txt
     + stdenv.lib.optionalString enableTextureFloats " --enable-texture-float";
 
   buildInputs = [ expat libdrm libXxf86vm libXfixes libXdamage glproto dri2proto
     libxml2Python libX11 libXext libxcb libXt udev ];
 
-  buildNativeInputs = [ pkgconfig python makedepend file flex bison ];
+  nativeBuildInputs = [ pkgconfig python makedepend file flex bison ];
 
   enableParallelBuilding = true;
 
@@ -44,7 +41,6 @@ stdenv.mkDerivation {
     description = "An open source implementation of OpenGL";
     homepage = http://www.mesa3d.org/;
     license = "bsd";
-
     platforms = stdenv.lib.platforms.mesaPlatforms;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
diff --git a/pkgs/development/libraries/mesa/swrast-settexbuffer.patch b/pkgs/development/libraries/mesa/swrast-settexbuffer.patch
deleted file mode 100644
index c74daa3aef1..00000000000
--- a/pkgs/development/libraries/mesa/swrast-settexbuffer.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-https://build.opensuse.org/package/view_file?file=0001-Fix-crash-in-swrast-when-setting-a-texture-for-a-pix.patch&package=Mesa&project=openSUSE%3AFactory&srcmd5=be25d34ad69853c2bb21ed376061d573
-
-diff -ru Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c
---- Mesa-7.10.1-orig//src/mesa/drivers/dri/swrast/swrast.c	2010-12-14 22:43:15.000000000 +0100
-+++ Mesa-7.10.1//src/mesa/drivers/dri/swrast/swrast.c	2011-03-07 18:08:17.062816112 +0100
-@@ -61,6 +61,7 @@
- static void swrastSetTexBuffer2(__DRIcontext *pDRICtx, GLint target,
- 				GLint texture_format, __DRIdrawable *dPriv)
- {
-+    GET_CURRENT_CONTEXT(ctx);
-     struct dri_context *dri_ctx;
-     int x, y, w, h;
-     __DRIscreen *sPriv = dPriv->driScreenPriv;
-@@ -90,6 +91,10 @@
-     _mesa_init_teximage_fields(&dri_ctx->Base, target, texImage,
- 			       w, h, 1, 0, internalFormat, texFormat);
- 
-+    ctx->Driver.TexImage2D(ctx, target, 0, internalFormat,
-+              w, h, 0, texture_format, GL_UNSIGNED_INT_8_8_8_8,
-+              NULL, &ctx->Unpack, texObj, texImage);
-+
-     sPriv->swrast_loader->getImage(dPriv, x, y, w, h, (char *)texImage->Data,
- 				   dPriv->loaderPrivate);
- 
diff --git a/pkgs/development/libraries/mlt/default.nix b/pkgs/development/libraries/mlt/default.nix
index 640bc7edc32..4d17184a608 100644
--- a/pkgs/development/libraries/mlt/default.nix
+++ b/pkgs/development/libraries/mlt/default.nix
@@ -1,27 +1,29 @@
 { stdenv, fetchurl, SDL, ffmpeg, libdv, libsamplerate, libvorbis
-, libxml2 , pkgconfig, qt4, sox }:
+, libxml2 , pkgconfig, qt4, sox, gtk2 }:
 
 stdenv.mkDerivation rec {
   name = "mlt-${version}";
-  version = "0.8.0";
+  version = "0.8.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/mlt/${name}.tar.gz";
-    sha256 = "1pf61imb5xzgzf65g54kybjr67235rxi20691023mcv34qwppl3v";
+    sha256 = "0m4nzxli1pl8w59m4iwwhpmr1xdz7xfknmbl3a0mkkd1jzdiq3nc";
   };
 
-  buildInputs = 
+  buildInputs =
     [ SDL ffmpeg libdv libsamplerate libvorbis libxml2 pkgconfig qt4
-      sox
+      sox # gtk2 /*optional*/
     ];
 
   # Mostly taken from:
   # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
-  configureFlags = [ "--enable-gpl" "--avformat-swscale" ];
+  configureFlags = [ "--enable-gpl" "--enable-gpl3" "--avformat-swscale" ];
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = http://www.mltframework.org/;
     description = "Open source multimedia framework, designed for television broadcasting";
-    license = "GPLv2+";
+    license = "GPLv3";
   };
 }
diff --git a/pkgs/development/libraries/muparser/default.nix b/pkgs/development/libraries/muparser/default.nix
index 009b6c9ddfe..3cc1c6ce43c 100644
--- a/pkgs/development/libraries/muparser/default.nix
+++ b/pkgs/development/libraries/muparser/default.nix
@@ -1,12 +1,14 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
-	name = "muparser-1.34";
+	name = "muparser-2.2.2";
 	src = fetchurl {
-		url = mirror://sourceforge/muparser/muparser_v134.tar.gz;
-		sha256 = "0xi27xjj7bwwf5nw3n2lynpr76al3vp204zwh71wkfnhwbzksg8f";
+		url = mirror://sourceforge/muparser/muparser_v2_2_2.zip;
+		sha256 = "0pncvjzzbwcadgpwnq5r7sl9v5r2y9gjgfnlw0mrs9wj206dbhx9";
 	};
 
+  buildInputs = [ unzip ];
+
   meta = {
     homepage = http://muparser.sourceforge.net;
     description = "An extensible high performance math expression parser library written in C++";
diff --git a/pkgs/development/libraries/mygui/default.nix b/pkgs/development/libraries/mygui/default.nix
index f692c14a6df..0a2df000384 100644
--- a/pkgs/development/libraries/mygui/default.nix
+++ b/pkgs/development/libraries/mygui/default.nix
@@ -1,16 +1,16 @@
-{stdenv, fetchurl, unzip, ogre, cmake, ois, freetype, libuuid, boost}:
+{stdenv, fetchurl, unzip, ogre, cmake, ois, freetype, libuuid, boost, pkgconfig}:
 
 stdenv.mkDerivation rec {
-  name = "mygui-3.0.1";
+  name = "mygui-3.2.0";
   
   src = fetchurl {
-    url = mirror://sourceforge/my-gui/MyGUI_3.0.1_source.zip;
-    sha256 = "1n56kl8ykzgv4k2nm9317jg9b9x2qa3l9hamz11hzn1qqjn2z4ig";
+    url = mirror://sourceforge/my-gui/MyGUI_3.2.0.zip;
+    sha256 = "16m1xrhx13qbwnp9gds2amlwycq8q5npr0665hnknwsb6rph010p";
   };
 
   enableParallelBuilding = true;
 
-  buildInputs = [ unzip ogre cmake ois freetype libuuid boost ];
+  buildInputs = [ unzip ogre cmake ois freetype libuuid boost pkgconfig ];
 
   meta = {
     homepage = http://mygui.info/;
diff --git a/pkgs/development/libraries/mythes/default.nix b/pkgs/development/libraries/mythes/default.nix
new file mode 100644
index 00000000000..8fc160ae11d
--- /dev/null
+++ b/pkgs/development/libraries/mythes/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, hunspell, pkgconfig, perl }:
+
+stdenv.mkDerivation rec {
+  name = "mythes-1.2.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hunspell/${name}.tar.gz";
+    sha256 = "0f5q7yiwg9bw4a5zxg0dapqdfc2grfb4ss34ifir3mhhy4q3jf4j";
+  };
+
+  buildInputs = [ hunspell ];
+  nativeBuildInputs = [ pkgconfig perl ];
+
+  meta = {
+    homepage = http://hunspell.sourceforge.net/;
+    description = "Thesaurus library from Hunspell project";
+    inherit (hunspell.meta) platforms;
+  };
+}
diff --git a/pkgs/development/libraries/ncbi/default.nix b/pkgs/development/libraries/ncbi/default.nix
index 0b795e78ad5..a74cd81854e 100644
--- a/pkgs/development/libraries/ncbi/default.nix
+++ b/pkgs/development/libraries/ncbi/default.nix
@@ -49,6 +49,6 @@ rec {
     maintainers = [
       a.lib.maintainers.raskin
     ];
-    platforms = a.lib.platforms.linux ;
+    #platforms = a.lib.platforms.linux ;
   };
 }
diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix
index a6b9a69e6e1..569d7fe2a32 100644
--- a/pkgs/development/libraries/ncurses/default.nix
+++ b/pkgs/development/libraries/ncurses/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation (rec {
     ${if unicode then "--enable-widec" else ""}${if cxx then "" else "--without-cxx-binding"}
   '';
 
-  selfBuildNativeInput = true;
+  selfNativeBuildInput = true;
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/neon/0.26.nix b/pkgs/development/libraries/neon/0.26.nix
deleted file mode 100644
index 6b06e54e73d..00000000000
--- a/pkgs/development/libraries/neon/0.26.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ stdenv, fetchurl, libxml2, pkgconfig
-, compressionSupport ? true, zlib ? null
-, sslSupport ? true, openssl ? null
-}:
-
-assert compressionSupport -> zlib != null;
-assert sslSupport -> openssl != null;
-
-stdenv.mkDerivation {
-  name = "neon-0.26.4";
-  
-  src = fetchurl {
-    url = http://www.webdav.org/neon/neon-0.26.4.tar.gz;
-    sha256 = "1pjrn5wb18gy419293hmwd02blmh36aaxsrgajm9nkkkjzqakncj";
-  };
-   
-  buildInputs = [libxml2]
-    ++ stdenv.lib.optional compressionSupport zlib
-    ++ (if sslSupport then [ openssl pkgconfig ] else []);
-
-  configureFlags = ''
-    ${if compressionSupport then "--with-zlib" else "--without-zlib"}
-    ${if sslSupport then "--with-ssl" else "--without-ssl"}
-    --enable-shared
-  '';
-
-  passthru = {inherit compressionSupport sslSupport;};
-
-  meta = {
-    description = "An HTTP and WebDAV client library";
-    homepage = http://www.webdav.org/neon/;
-  };
-}
diff --git a/pkgs/development/libraries/neon/0.28.nix b/pkgs/development/libraries/neon/0.28.nix
deleted file mode 100644
index 8e717ff52d8..00000000000
--- a/pkgs/development/libraries/neon/0.28.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ stdenv, fetchurl, libxml2, pkgconfig
-, compressionSupport ? true, zlib ? null
-, sslSupport ? true, openssl ? null
-, static ? false
-, shared ? true
-}:
-
-assert compressionSupport -> zlib != null;
-assert sslSupport -> openssl != null;
-assert static || shared;
-
-stdenv.mkDerivation rec {
-  name = "neon-0.28.6";
-
-  src = fetchurl {
-    url = "http://www.webdav.org/neon/${name}.tar.gz";
-    sha256 = "03ncisn1iziz79vw678wsrv8jf63m2szd2qml5baj53slcd8pvh6";
-  };
-
-  buildInputs = [libxml2 pkgconfig openssl]
-    ++ stdenv.lib.optional compressionSupport zlib;
-
-  configureFlags = ''
-    ${if shared then "--enable-shared" else "--disable-shared"}
-    ${if static then "--enable-static" else "--disable-static"}
-    ${if compressionSupport then "--with-zlib" else "--without-zlib"}
-    ${if sslSupport then "--with-ssl" else "--without-ssl"}
-    --enable-shared
-  '';
-
-  passthru = {inherit compressionSupport sslSupport;};
-
-  meta = {
-    description = "An HTTP and WebDAV client library";
-    homepage = http://www.webdav.org/neon/;
-  };
-}
diff --git a/pkgs/development/libraries/neon/0.29.nix b/pkgs/development/libraries/neon/default.nix
index ffc409d271e..ffc409d271e 100644
--- a/pkgs/development/libraries/neon/0.29.nix
+++ b/pkgs/development/libraries/neon/default.nix
diff --git a/pkgs/development/libraries/nettle/default.nix b/pkgs/development/libraries/nettle/default.nix
index 6c7383435a8..4208402ab99 100644
--- a/pkgs/development/libraries/nettle/default.nix
+++ b/pkgs/development/libraries/nettle/default.nix
@@ -1,18 +1,22 @@
 { fetchurl, stdenv, gmp, gnum4 }:
 
 stdenv.mkDerivation (rec {
-  name = "nettle-2.4";
+  name = "nettle-2.7.1";
 
   src = fetchurl {
-    # Eventually use `mirror://gnu/'.
-    url = "ftp://ftp.lysator.liu.se/pub/security/lsh/${name}.tar.gz";
-    sha256 = "0gwwcipmjxkv7p2p01m19n4c3jiczg682w58l5dgg0b8vw494056";
+    url = "mirror://gnu/nettle/${name}.tar.gz";
+    sha256 = "0h2vap31yvi1a438d36lg1r1nllfx3y19r4rfxv7slrm6kafnwdw";
   };
 
   buildInputs = [ gnum4 ];
   propagatedBuildInputs = [ gmp ];
 
-  doCheck = (stdenv.system != "i686-cygwin");
+  doCheck = (stdenv.system != "i686-cygwin" && !stdenv.isDarwin);
+
+  enableParallelBuilding = true;
+
+  # It doesn't build otherwise
+  dontDisableStatic = true;
 
   patches = stdenv.lib.optional (stdenv.system == "i686-cygwin")
               ./cygwin.patch;
diff --git a/pkgs/development/libraries/npth/default.nix b/pkgs/development/libraries/npth/default.nix
index a9f80fa9348..c9b685aa05b 100644
--- a/pkgs/development/libraries/npth/default.nix
+++ b/pkgs/development/libraries/npth/default.nix
@@ -1,18 +1,13 @@
-{ stdenv, fetchgit, autoconf, automake, libtool }:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "npth-git20120407";
+  name = "npth-0.91";
 
-  src = fetchgit {
-    url = "git://git.gnupg.org/npth.git";
-    rev = "cbb52bd5ada02bbd914869f4540221831358d077";
-    sha256 = "1789b15bc49171d47bbd5a3bccbadc7dde1ae095bb2c205c7ec5d7a36573876d";
+  src = fetchurl {
+    url = "ftp://ftp.gnupg.org/gcrypt/npth/${name}.tar.bz2";
+    sha256 = "1qgs1n70x83dyyysabg50dh8s3464jwsa63qi5if2cd3sk78dvya";
   };
 
-  buildInputs = [ autoconf automake libtool ];
-
-  preConfigure = "autoreconf -vfi";
-
   meta = {
     description = "The New GNU Portable Threads Library";
     longDescription = ''
diff --git a/pkgs/development/libraries/nspr/default.nix b/pkgs/development/libraries/nspr/default.nix
index c570688de21..1aef55c9b2c 100644
--- a/pkgs/development/libraries/nspr/default.nix
+++ b/pkgs/development/libraries/nspr/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl }:
 
-let version = "4.9.1"; in
+let version = "4.10"; in
 
 stdenv.mkDerivation {
   name = "nspr-${version}";
 
   src = fetchurl {
     url = "http://ftp.mozilla.org/pub/mozilla.org/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
-    sha1 = "1d52282668f2f8f5aabf7a5a3e7f6ba9a5df9710";
+    sha1 = "10dbf68c07497dab30be09db526931c885d5a7e9";
   };
 
-  preConfigure = "cd mozilla/nsprpub";
+  preConfigure = "cd nspr";
 
   configureFlags = "--enable-optimize --disable-debug ${if stdenv.is64bit then "--enable-64bit" else ""}";
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     '';
 
   enableParallelBuilding = true;
-    
+
   meta = {
     homepage = http://www.mozilla.org/projects/nspr/;
     description = "Netscape Portable Runtime, a platform-neutral API for system-level and libc-like functions";
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 38e9d80d5b7..d38fc19f40e 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -11,20 +11,22 @@ let
   };
 
   secLoadPatch = fetchurl {
-    url = "http://patch-tracker.debian.org/patch/series/dl/nss/2:3.13.5-1/85_security_load.patch";
+    name = "security_load.patch";
+    urls = [
+      # "http://patch-tracker.debian.org/patch/series/dl/nss/2:3.13.6-1/85_security_load.patch"
+      # "http://anonscm.debian.org/gitweb/?p=pkg-mozilla/nss.git;a=blob_plain;f=debian/patches/85_security_load.patch;hb=HEAD"
+      "http://www.parsix.org/export/7797/pkg/security/raul/main/nss/trunk/debian/patches/85_security_load.patch"
+    ];
     sha256 = "8a8d0ae4ebbd7c389973fa5d26d8bc5f473046c6cb1d8283cb9a3c1f4c565c47";
   };
 
 in stdenv.mkDerivation rec {
   name = "nss-${version}";
-  version = "3.13.6";
-
-  src = let
-    uscoreVersion = stdenv.lib.replaceChars ["."] ["_"] version;
-    releasePath = "releases/NSS_${uscoreVersion}_RTM/src/nss-${version}.tar.gz";
-  in fetchurl {
-    url = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/${releasePath}";
-    sha256 = "f7e90727e0ecc1c29de10da39a79bc9c53b814ccfbf40720e053b29c683d43a0";
+  version = "3.14.3";
+
+  src = fetchurl {
+    url = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_14_3_RTM/src/${name}.tar.gz";
+    sha1 = "94d8781d1fa29cfbd37453dda3e9488709b82c4c";
   };
 
   buildInputs = [ nspr perl zlib sqlite ];
@@ -36,14 +38,28 @@ in stdenv.mkDerivation rec {
   '';
 
   patches = [
-    ./nss-3.12.5-gentoo-fixups.diff
+    ./nss-3.14.1-gentoo-fixups-r1.patch
     secLoadPatch
     ./nix_secload_fixup.patch
+    ./sync-up-with-upstream-softokn-changes.patch
   ];
 
   postPatch = ''
     sed -i -e 's/^DIRS.*$/& pem/' mozilla/security/nss/lib/ckfw/manifest.mn
-    sed -i -e "/^PREFIX =/s:= /usr:= $out:" mozilla/security/nss/config/Makefile
+
+    # Fix up the patch from Gentoo
+    sed -i \
+      -e "/^PREFIX =/s|= /usr|= $out|" \
+      -e '/@libdir@/s|gentoo/nss|lib|' \
+      -e '/ln -sf/d' \
+      mozilla/security/nss/config/Makefile
+
+    # Note for spacing/tab nazis: The TAB characters are intentional!
+    cat >> mozilla/security/nss/config/Makefile <<INSTALL_TARGET
+    install:
+    	mkdir -p \$(DIST)/lib/pkgconfig
+    	cp nss.pc \$(DIST)/lib/pkgconfig
+    INSTALL_TARGET
   '';
 
   preConfigure = "cd mozilla/security/nss";
diff --git a/pkgs/development/libraries/nss/nss-3.12.5-gentoo-fixups.diff b/pkgs/development/libraries/nss/nss-3.14.1-gentoo-fixups-r1.patch
index 57fbb71ff78..bc3a98ec143 100644
--- a/pkgs/development/libraries/nss/nss-3.12.5-gentoo-fixups.diff
+++ b/pkgs/development/libraries/nss/nss-3.14.1-gentoo-fixups-r1.patch
@@ -1,7 +1,7 @@
-diff -urN nss-3.12.5-orig/mozilla/security/nss/config/Makefile nss-3.12.5/mozilla/security/nss/config/Makefile
---- nss-3.12.5-orig/mozilla/security/nss/config/Makefile	1969-12-31 18:00:00.000000000 -0600
-+++ nss-3.12.5/mozilla/security/nss/config/Makefile	2009-09-14 21:45:45.619639265 -0500
-@@ -0,0 +1,42 @@
+diff -urN a/mozilla/security/nss/config/Makefile b/mozilla/security/nss/config/Makefile
+--- a/mozilla/security/nss/config/Makefile	1969-12-31 18:00:00.000000000 -0600
++++ b/mozilla/security/nss/config/Makefile	2012-12-15 07:27:20.650148987 -0600
+@@ -0,0 +1,40 @@
 +CORE_DEPTH = ../..
 +DEPTH      = ../..
 +
@@ -16,15 +16,17 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/config/Makefile nss-3.12.5/mozill
 +
 +export:
 +	# Create the nss.pc file
++	mkdir -p $(DIST)/lib/pkgconfig
 +	sed -e "s,@prefix@,$(PREFIX)," \
 +	    -e "s,@exec_prefix@,\$${prefix}," \
-+	    -e "s,@libdir@,\$${prefix}/lib," \
++	    -e "s,@libdir@,\$${prefix}/gentoo/nss," \
 +	    -e "s,@includedir@,\$${prefix}/include/nss," \
 +	    -e "s,@NSS_MAJOR_VERSION@,$(NSS_MAJOR_VERSION),g" \
 +	    -e "s,@NSS_MINOR_VERSION@,$(NSS_MINOR_VERSION)," \
 +	    -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
 +	    nss.pc.in > nss.pc
 +	chmod 0644 nss.pc
++	ln -sf ../../../../../security/nss/config/nss.pc $(DIST)/lib/pkgconfig
 +
 +	# Create the nss-config script
 +	mkdir -p $(DIST)/bin
@@ -34,19 +36,15 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/config/Makefile nss-3.12.5/mozill
 +	    -e "s,@NSS_PATCH_VERSION@,$(NSS_PATCH_VERSION)," \
 +	    nss-config.in > nss-config
 +	chmod 0755 nss-config
-+	# ln -sf ../../../../security/nss/config/nss-config $(DIST)/bin
++	ln -sf ../../../../security/nss/config/nss-config $(DIST)/bin
 +
 +libs:
 +
 +dummy: all export libs
 +
-+install:
-+	mkdir -p $(DIST)/lib/pkgconfig
-+	cp nss.pc $(DIST)/lib/pkgconfig
-+
-diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in nss-3.12.5/mozilla/security/nss/config/nss-config.in
---- nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in	1969-12-31 18:00:00.000000000 -0600
-+++ nss-3.12.5/mozilla/security/nss/config/nss-config.in	2009-09-14 21:47:45.190638078 -0500
+diff -urN a/mozilla/security/nss/config/nss-config.in b/mozilla/security/nss/config/nss-config.in
+--- a/mozilla/security/nss/config/nss-config.in	1969-12-31 18:00:00.000000000 -0600
++++ b/mozilla/security/nss/config/nss-config.in	2012-12-15 07:27:20.651148959 -0600
 @@ -0,0 +1,145 @@
 +#!/bin/sh
 +
@@ -177,7 +175,7 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in nss-3.12.5/m
 +fi
 +
 +if test "$echo_libs" = "yes"; then
-+      libdirs="-Wl,-R$libdir -L$libdir"
++      libdirs=""
 +      if test -n "$lib_ssl"; then
 +	libdirs="$libdirs -lssl${major_version}"
 +      fi
@@ -193,9 +191,9 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss-config.in nss-3.12.5/m
 +      echo $libdirs
 +fi      
 +
-diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss.pc.in nss-3.12.5/mozilla/security/nss/config/nss.pc.in
---- nss-3.12.5-orig/mozilla/security/nss/config/nss.pc.in	1969-12-31 18:00:00.000000000 -0600
-+++ nss-3.12.5/mozilla/security/nss/config/nss.pc.in	2009-09-14 21:45:45.653637310 -0500
+diff -urN a/mozilla/security/nss/config/nss.pc.in b/mozilla/security/nss/config/nss.pc.in
+--- a/mozilla/security/nss/config/nss.pc.in	1969-12-31 18:00:00.000000000 -0600
++++ b/mozilla/security/nss/config/nss.pc.in	2012-12-15 07:27:20.651148959 -0600
 @@ -0,0 +1,12 @@
 +prefix=@prefix@
 +exec_prefix=@exec_prefix@
@@ -206,13 +204,13 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/config/nss.pc.in nss-3.12.5/mozil
 +Description: Network Security Services
 +Version: @NSS_MAJOR_VERSION@.@NSS_MINOR_VERSION@.@NSS_PATCH_VERSION@
 +Requires: nspr >= 4.8
-+Libs: -L${libdir} -lssl3 -lsmime3 -lnssutil3 -lnss3 -Wl,-R${libdir}
++Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3
 +Cflags: -I${includedir}
 +
-diff -urN nss-3.12.5-orig/mozilla/security/nss/Makefile nss-3.12.5/mozilla/security/nss/Makefile
---- nss-3.12.5-orig/mozilla/security/nss/Makefile	2008-12-02 17:24:39.000000000 -0600
-+++ nss-3.12.5/mozilla/security/nss/Makefile	2009-09-14 21:45:45.678657145 -0500
-@@ -78,7 +78,7 @@
+diff -urN a/mozilla/security/nss/Makefile b/mozilla/security/nss/Makefile
+--- a/mozilla/security/nss/Makefile	2012-11-13 19:14:07.000000000 -0600
++++ b/mozilla/security/nss/Makefile	2012-12-15 07:27:57.235162137 -0600
+@@ -44,7 +44,7 @@
  # (7) Execute "local" rules. (OPTIONAL).                              #
  #######################################################################
  
@@ -221,27 +219,25 @@ diff -urN nss-3.12.5-orig/mozilla/security/nss/Makefile nss-3.12.5/mozilla/secur
  
  nss_clean_all: clobber_coreconf clobber_nspr clobber_dbm clobber
  
-@@ -140,12 +140,6 @@
+@@ -106,12 +106,6 @@
  	--with-dist-prefix='$(NSPR_PREFIX)' \
  	--with-dist-includedir='$(NSPR_PREFIX)/include'
  
 -build_nspr: $(NSPR_CONFIG_STATUS)
--	cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE)
+-	$(MAKE) -C $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME)
 -
 -clobber_nspr: $(NSPR_CONFIG_STATUS)
--	cd $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) ; $(MAKE) clobber
+-	$(MAKE) -C $(CORE_DEPTH)/../nsprpub/$(OBJDIR_NAME) clobber
 -
  build_dbm:
- ifndef NSS_DISABLE_DBM
- 	cd $(CORE_DEPTH)/dbm ; $(MAKE) export libs
-diff -urN nss-3.12.5-orig/mozilla/security/nss/manifest.mn nss-3.12.5/mozilla/security/nss/manifest.mn
---- nss-3.12.5-orig/mozilla/security/nss/manifest.mn	2008-04-04 15:36:59.000000000 -0500
-+++ nss-3.12.5/mozilla/security/nss/manifest.mn	2009-09-14 21:45:45.703656167 -0500
-@@ -42,6 +42,6 @@
+ ifdef NSS_DISABLE_DBM
+ 	@echo "skipping the build of DBM"
+diff -urN a/mozilla/security/nss/manifest.mn b/mozilla/security/nss/manifest.mn
+--- a/mozilla/security/nss/manifest.mn	2012-03-20 09:46:49.000000000 -0500
++++ b/mozilla/security/nss/manifest.mn	2012-12-15 07:27:20.652148933 -0600
+@@ -10,6 +10,6 @@
  
  RELEASE = nss
  
 -DIRS = lib cmd
 +DIRS = lib cmd config
- 
- 
diff --git a/pkgs/development/libraries/nss/sync-up-with-upstream-softokn-changes.patch b/pkgs/development/libraries/nss/sync-up-with-upstream-softokn-changes.patch
new file mode 100644
index 00000000000..4942debcd30
--- /dev/null
+++ b/pkgs/development/libraries/nss/sync-up-with-upstream-softokn-changes.patch
@@ -0,0 +1,406 @@
+From d6dbecfea317a468be12423595e584f43d84d8ec Mon Sep 17 00:00:00 2001
+From: Elio Maldonado <emaldona@redhat.com>
+Date: Sat, 9 Feb 2013 17:11:00 -0500
+Subject: [PATCH] Sync up with upstream softokn changes
+
+- Disable RSA OEP case in FormatBlock, RSA_OAEP support is experimental and in a state of flux
+- Numerous change upstream due to the work for TLS/DTLS 'Lucky 13' vulnerability CVE-2013-0169
+- It now compiles with the NSS_3_14_3_BETA1 source
+---
+ mozilla/security/nss/lib/ckfw/pem/rsawrapr.c |  338 +++++++-------------------
+ 1 files changed, 82 insertions(+), 256 deletions(-)
+
+diff --git a/mozilla/security/nss/lib/ckfw/pem/rsawrapr.c b/mozilla/security/nss/lib/ckfw/pem/rsawrapr.c
+index 5ac4f39..3780d30 100644
+--- a/mozilla/security/nss/lib/ckfw/pem/rsawrapr.c
++++ b/mozilla/security/nss/lib/ckfw/pem/rsawrapr.c
+@@ -46,6 +46,7 @@
+ #include "sechash.h"
+ #include "base.h"
+ 
++#include "lowkeyi.h"
+ #include "secerr.h"
+ 
+ #define RSA_BLOCK_MIN_PAD_LEN		8
+@@ -54,9 +55,8 @@
+ #define RSA_BLOCK_PRIVATE_PAD_OCTET	0xff
+ #define RSA_BLOCK_AFTER_PAD_OCTET	0x00
+ 
+-#define OAEP_SALT_LEN		8
+-#define OAEP_PAD_LEN		8
+-#define OAEP_PAD_OCTET		0x00
++/* Needed for RSA-PSS functions */
++static const unsigned char eightZeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ 
+ #define FLAT_BUFSIZE 512        /* bytes to hold flattened SHA1Context. */
+ 
+@@ -78,127 +78,39 @@ pem_PublicModulusLen(NSSLOWKEYPublicKey *pubk)
+     return 0;
+ }
+ 
+-static SHA1Context *SHA1_CloneContext(SHA1Context * original)
+-{
+-    SHA1Context *clone = NULL;
+-    unsigned char *pBuf;
+-    int sha1ContextSize = SHA1_FlattenSize(original);
+-    SECStatus frv;
+-    unsigned char buf[FLAT_BUFSIZE];
+-
+-    PORT_Assert(sizeof buf >= sha1ContextSize);
+-    if (sizeof buf >= sha1ContextSize) {
+-        pBuf = buf;
+-    } else {
+-        pBuf = nss_ZAlloc(NULL, sha1ContextSize);
+-        if (!pBuf)
+-            goto done;
+-    }
+-
+-    frv = SHA1_Flatten(original, pBuf);
+-    if (frv == SECSuccess) {
+-        clone = SHA1_Resurrect(pBuf, NULL);
+-        memset(pBuf, 0, sha1ContextSize);
+-    }
+-  done:
+-    if (pBuf != buf)
+-        nss_ZFreeIf(pBuf);
+-    return clone;
++/* Constant time comparison of a single byte.
++ * Returns 1 iff a == b, otherwise returns 0.
++ * Note: For ranges of bytes, use constantTimeCompare.
++ */
++static unsigned char constantTimeEQ8(unsigned char a, unsigned char b) {
++    unsigned char c = ~(a - b | b - a);
++    c >>= 7;
++    return c;
+ }
+ 
+-/*
+- * Modify data by XORing it with a special hash of salt.
++/* Constant time comparison of a range of bytes.
++ * Returns 1 iff len bytes of a are identical to len bytes of b, otherwise
++ * returns 0.
+  */
+-static SECStatus
+-oaep_xor_with_h1(unsigned char *data, unsigned int datalen,
+-                 unsigned char *salt, unsigned int saltlen)
+-{
+-    SHA1Context *sha1cx;
+-    unsigned char *dp, *dataend;
+-    unsigned char end_octet;
+-
+-    sha1cx = SHA1_NewContext();
+-    if (sha1cx == NULL) {
+-        return SECFailure;
+-    }
+-
+-    /*
+-     * Get a hash of salt started; we will use it several times,
+-     * adding in a different end octet (x00, x01, x02, ...).
+-     */
+-    SHA1_Begin(sha1cx);
+-    SHA1_Update(sha1cx, salt, saltlen);
+-    end_octet = 0;
+-
+-    dp = data;
+-    dataend = data + datalen;
+-
+-    while (dp < dataend) {
+-        SHA1Context *sha1cx_h1;
+-        unsigned int sha1len, sha1off;
+-        unsigned char sha1[SHA1_LENGTH];
+-
+-        /*
+-         * Create hash of (salt || end_octet)
+-         */
+-        sha1cx_h1 = SHA1_CloneContext(sha1cx);
+-        SHA1_Update(sha1cx_h1, &end_octet, 1);
+-        SHA1_End(sha1cx_h1, sha1, &sha1len, sizeof(sha1));
+-        SHA1_DestroyContext(sha1cx_h1, PR_TRUE);
+-        PORT_Assert(sha1len == SHA1_LENGTH);
+-
+-        /*
+-         * XOR that hash with the data.
+-         * When we have fewer than SHA1_LENGTH octets of data
+-         * left to xor, use just the low-order ones of the hash.
+-         */
+-        sha1off = 0;
+-        if ((dataend - dp) < SHA1_LENGTH)
+-            sha1off = SHA1_LENGTH - (dataend - dp);
+-        while (sha1off < SHA1_LENGTH)
+-            *dp++ ^= sha1[sha1off++];
+-
+-        /*
+-         * Bump for next hash chunk.
+-         */
+-        end_octet++;
+-    }
+-
+-    SHA1_DestroyContext(sha1cx, PR_TRUE);
+-    return SECSuccess;
++static unsigned char constantTimeCompare(const unsigned char *a,
++                                         const unsigned char *b,
++                                         unsigned int len) {
++    unsigned char tmp = 0;
++    unsigned int i;
++    for (i = 0; i < len; ++i, ++a, ++b)
++        tmp |= *a ^ *b;
++    return constantTimeEQ8(0x00, tmp);
+ }
+ 
+-/*
+- * Modify salt by XORing it with a special hash of data.
++/* Constant time conditional.
++ * Returns a if c is 1, or b if c is 0. The result is undefined if c is
++ * not 0 or 1.
+  */
+-static SECStatus
+-oaep_xor_with_h2(unsigned char *salt, unsigned int saltlen,
+-                 unsigned char *data, unsigned int datalen)
++static unsigned int constantTimeCondition(unsigned int c,
++                                          unsigned int a,
++                                          unsigned int b)
+ {
+-    unsigned char sha1[SHA1_LENGTH];
+-    unsigned char *psalt, *psha1, *saltend;
+-    SECStatus rv;
+-
+-    /*
+-     * Create a hash of data.
+-     */
+-    rv = SHA1_HashBuf(sha1, data, datalen);
+-    if (rv != SECSuccess) {
+-        return rv;
+-    }
+-
+-    /*
+-     * XOR the low-order octets of that hash with salt.
+-     */
+-    PORT_Assert(saltlen <= SHA1_LENGTH);
+-    saltend = salt + saltlen;
+-    psalt = salt;
+-    psha1 = sha1 + SHA1_LENGTH - saltlen;
+-    while (psalt < saltend) {
+-        *psalt++ ^= *psha1++;
+-    }
+-
+-    return SECSuccess;
++    return (~(c - 1) & a) | ((c - 1) & b);
+ }
+ 
+ /*
+@@ -212,7 +124,7 @@ static unsigned char *rsa_FormatOneBlock(unsigned modulusLen,
+     unsigned char *block;
+     unsigned char *bp;
+     int padLen;
+-    int i;
++    int i, j;
+     SECStatus rv;
+ 
+     block = (unsigned char *) nss_ZAlloc(NULL, modulusLen);
+@@ -260,124 +172,58 @@ static unsigned char *rsa_FormatOneBlock(unsigned modulusLen,
+          */
+     case RSA_BlockPublic:
+ 
+-        /*
+-         * 0x00 || BT || Pad || 0x00 || ActualData
+-         *   1      1   padLen    1      data->len
+-         * Pad is all non-zero random bytes.
+-         */
+-        padLen = modulusLen - data->len - 3;
+-        PORT_Assert(padLen >= RSA_BLOCK_MIN_PAD_LEN);
+-        if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
+-            nss_ZFreeIf(block);
+-            return NULL;
+-        }
+-        for (i = 0; i < padLen; i++) {
+-            /* Pad with non-zero random data. */
+-            do {
+-                rv = RNG_GenerateGlobalRandomBytes(bp + i, 1);
+-            } while (rv == SECSuccess
+-                     && bp[i] == RSA_BLOCK_AFTER_PAD_OCTET);
+-            if (rv != SECSuccess) {
+-                nss_ZFreeIf(block);
+-                return NULL;
+-            }
+-        }
+-        bp += padLen;
+-        *bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
+-        nsslibc_memcpy(bp, data->data, data->len);
+-
+-        break;
+-
+-        /*
+-         * Blocks intended for public-key operation, using
+-         * Optimal Asymmetric Encryption Padding (OAEP).
+-         */
+-    case RSA_BlockOAEP:
+-        /*
+-         * 0x00 || BT || Modified2(Salt) || Modified1(PaddedData)
+-         *   1      1     OAEP_SALT_LEN     OAEP_PAD_LEN + data->len [+ N]
+-         *
+-         * where:
+-         *   PaddedData is "Pad1 || ActualData [|| Pad2]"
+-         *   Salt is random data.
+-         *   Pad1 is all zeros.
+-         *   Pad2, if present, is random data.
+-         *   (The "modified" fields are all the same length as the original
+-         * unmodified values; they are just xor'd with other values.)
+-         *
+-         *   Modified1 is an XOR of PaddedData with a special octet
+-         * string constructed of iterated hashing of Salt (see below).
+-         *   Modified2 is an XOR of Salt with the low-order octets of
+-         * the hash of Modified1 (see farther below ;-).
+-         *
+-         * Whew!
+-         */
+-
+-
+-        /*
+-         * Salt
+-         */
+-        rv = RNG_GenerateGlobalRandomBytes(bp, OAEP_SALT_LEN);
+-        if (rv != SECSuccess) {
+-            nss_ZFreeIf(block);
+-            return NULL;
+-        }
+-        bp += OAEP_SALT_LEN;
+-
+-        /*
+-         * Pad1
+-         */
+-        nsslibc_memset(bp, OAEP_PAD_OCTET, OAEP_PAD_LEN);
+-        bp += OAEP_PAD_LEN;
+-
+-        /*
+-         * Data
+-         */
+-        nsslibc_memcpy(bp, data->data, data->len);
+-        bp += data->len;
+-
+-        /*
+-         * Pad2
+-         */
+-        if (bp < (block + modulusLen)) {
+-            rv = RNG_GenerateGlobalRandomBytes(bp,
+-                                               block - bp + modulusLen);
+-            if (rv != SECSuccess) {
+-                nss_ZFreeIf(block);
+-                return NULL;
+-            }
+-        }
+-
+-        /*
+-         * Now we have the following:
+-         * 0x00 || BT || Salt || PaddedData
+-         * (From this point on, "Pad1 || Data [|| Pad2]" is treated
+-         * as the one entity PaddedData.)
+-         *
+-         * We need to turn PaddedData into Modified1.
+-         */
+-        if (oaep_xor_with_h1(block + 2 + OAEP_SALT_LEN,
+-                             modulusLen - 2 - OAEP_SALT_LEN,
+-                             block + 2, OAEP_SALT_LEN) != SECSuccess) {
+-            nss_ZFreeIf(block);
+-            return NULL;
+-        }
+-
+-        /*
+-         * Now we have:
+-         * 0x00 || BT || Salt || Modified1(PaddedData)
+-         *
+-         * The remaining task is to turn Salt into Modified2.
+-         */
+-        if (oaep_xor_with_h2(block + 2, OAEP_SALT_LEN,
+-                             block + 2 + OAEP_SALT_LEN,
+-                             modulusLen - 2 - OAEP_SALT_LEN) !=
+-            SECSuccess) {
+-            nss_ZFreeIf(block);
+-            return NULL;
+-        }
+-
+-        break;
++	/*
++	 * 0x00 || BT || Pad || 0x00 || ActualData
++	 *   1      1   padLen    1      data->len
++	 * Pad is all non-zero random bytes.
++	 *
++	 * Build the block left to right.
++	 * Fill the entire block from Pad to the end with random bytes.
++	 * Use the bytes after Pad as a supply of extra random bytes from 
++	 * which to find replacements for the zero bytes in Pad.
++	 * If we need more than that, refill the bytes after Pad with 
++	 * new random bytes as necessary.
++	 */
++	padLen = modulusLen - (data->len + 3);
++	PORT_Assert (padLen >= RSA_BLOCK_MIN_PAD_LEN);
++	if (padLen < RSA_BLOCK_MIN_PAD_LEN) {
++	    nss_ZFreeIf (block);
++	    return NULL;
++	}
++	j = modulusLen - 2;
++	rv = RNG_GenerateGlobalRandomBytes(bp, j);
++	if (rv == SECSuccess) {
++	    for (i = 0; i < padLen; ) {
++		unsigned char repl;
++		/* Pad with non-zero random data. */
++		if (bp[i] != RSA_BLOCK_AFTER_PAD_OCTET) {
++		    ++i;
++		    continue;
++		}
++		if (j <= padLen) {
++		    rv = RNG_GenerateGlobalRandomBytes(bp + padLen,
++					  modulusLen - (2 + padLen));
++		    if (rv != SECSuccess)
++		    	break;
++		    j = modulusLen - 2;
++		}
++		do {
++		    repl = bp[--j];
++		} while (repl == RSA_BLOCK_AFTER_PAD_OCTET && j > padLen);
++		if (repl != RSA_BLOCK_AFTER_PAD_OCTET) {
++		    bp[i++] = repl;
++		}
++	    }
++	}
++	if (rv != SECSuccess) {
++	    /*sftk_fatalError = PR_TRUE;*/
++	    nss_ZFreeIf (block);
++	    return NULL;
++	}
++	bp += padLen;
++	*bp++ = RSA_BLOCK_AFTER_PAD_OCTET;
++	nsslibc_memcpy(bp, data->data, data->len);
++	break;
+ 
+     default:
+         PORT_Assert(0);
+@@ -427,26 +273,6 @@ rsa_FormatBlock(SECItem * result, unsigned modulusLen,
+ 
+         break;
+ 
+-    case RSA_BlockOAEP:
+-        /*
+-         * 0x00 || BT || M1(Salt) || M2(Pad1||ActualData[||Pad2])
+-         *
+-         * The "2" below is the first octet + the second octet.
+-         * (The other fields do not contain the clear values, but are
+-         * the same length as the clear values.)
+-         */
+-        PORT_Assert(data->len <= (modulusLen - (2 + OAEP_SALT_LEN
+-                                                + OAEP_PAD_LEN)));
+-
+-        result->data = rsa_FormatOneBlock(modulusLen, blockType, data);
+-        if (result->data == NULL) {
+-            result->len = 0;
+-            return SECFailure;
+-        }
+-        result->len = modulusLen;
+-
+-        break;
+-
+     case RSA_BlockRaw:
+         /*
+          * Pad || ActualData
+-- 
+1.7.1
+
diff --git a/pkgs/development/libraries/ntrack/default.nix b/pkgs/development/libraries/ntrack/default.nix
index 95bde495c0e..13ab00e41be 100644
--- a/pkgs/development/libraries/ntrack/default.nix
+++ b/pkgs/development/libraries/ntrack/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnl qt4 ];
 
-  buildNativeInputs = [ pkgconfig python ];
+  nativeBuildInputs = [ pkgconfig python ];
 
   configureFlags = "--without-gobject CFLAGS=--std=gnu99";
 
diff --git a/pkgs/development/libraries/ogre/default.nix b/pkgs/development/libraries/ogre/default.nix
index 3a8e1c4ae55..6bb1916ed0f 100644
--- a/pkgs/development/libraries/ogre/default.nix
+++ b/pkgs/development/libraries/ogre/default.nix
@@ -8,11 +8,11 @@
 , nvidia_cg_toolkit }:
 
 stdenv.mkDerivation {
-  name = "ogre-1.7.2";
+  name = "ogre-1.8.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/ogre/1.7/ogre_src_v1-7-2.tar.bz2";
-    sha256 = "10q8jx842s4aws9py6q67rb4dh5vli5vvg54jl8manjb4f388jh5";
+    url = "mirror://sourceforge/ogre/1.8.1/ogre_src_v1-8-1.tar.bz2";
+    sha256 = "1avadx87sdfdk8165wlffnd5dzks694dcdnkg3ijap966k4qm46s";
   };
 
   cmakeFlags = [ "-DOGRE_INSTALL_SAMPLES=yes" ]
diff --git a/pkgs/development/libraries/ogrepaged/default.nix b/pkgs/development/libraries/ogrepaged/default.nix
index 6b2b9c9e4a6..f508637dfef 100644
--- a/pkgs/development/libraries/ogrepaged/default.nix
+++ b/pkgs/development/libraries/ogrepaged/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ois ogre libX11 boost ];
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   cmakeFlags = "-DPAGEDGEOMETRY_BUILD_SAMPLES=OFF";
 
diff --git a/pkgs/development/libraries/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix
new file mode 100644
index 00000000000..984b84085fe
--- /dev/null
+++ b/pkgs/development/libraries/oniguruma/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "onig-5.9.3";
+  
+  src = fetchurl {
+    url = http://www.geocities.jp/kosako3/oniguruma/archive/onig-5.9.3.tar.gz;
+    sha256 = "0ahz0l64v2xv4jbh0w3q697xjff8jzdq2264h9jhwxl459msdfy3";
+  };
+  
+  meta = {
+    homepage = http://www.geocities.jp/kosako3/oniguruma/;
+    description = "Oniguruma is a regular expressions library.";
+    license = "BSD";
+  };
+}
diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix
index 59851eda25a..b9b08433a62 100644
--- a/pkgs/development/libraries/openal-soft/default.nix
+++ b/pkgs/development/libraries/openal-soft/default.nix
@@ -1,15 +1,16 @@
 { stdenv, fetchurl, cmake, alsaLib }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
 #The current release is still in a testing phase, though it should be stable
 # (neither the ABI or API will break). Please try it out and let me know how it
 #  works. :-)
 
-  name = "openal-soft-1.1.93";
+  version = "1.15.1";
+  name = "openal-soft-${version}";
 
   src = fetchurl {
-    url = http://kcat.strangesoft.net/openal-releases/openal-soft-1.1.93.tar.bz2;
-    sha256 = "162nyv4jy6qzi7s5q3wpdawfph6npyn1n4wjf21haxdxq0mmp6l7";
+    url = "http://kcat.strangesoft.net/openal-releases/${name}.tar.bz2";
+    sha256 = "0mmhdqiyb3c9dzvxspm8h2v8jibhi8pfjxnf6m0wn744y1ia2a8f";
   };
 
   buildInputs = [ cmake alsaLib ];
diff --git a/pkgs/development/libraries/openbabel/default.nix b/pkgs/development/libraries/openbabel/default.nix
index 455dbceff23..e6df13eed34 100644
--- a/pkgs/development/libraries/openbabel/default.nix
+++ b/pkgs/development/libraries/openbabel/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   # TODO : separate lib and apps
   buildInputs = [ zlib libxml2 eigen python cairo ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = {
     platforms = stdenv.lib.platforms.all;
diff --git a/pkgs/development/libraries/opencascade/6.5.nix b/pkgs/development/libraries/opencascade/6.5.nix
new file mode 100644
index 00000000000..7cc47a30eb7
--- /dev/null
+++ b/pkgs/development/libraries/opencascade/6.5.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, automake, autoconf, libtool, qt4,
+ftgl, freetype}:
+
+stdenv.mkDerivation rec {
+  name = "opencascade-6.5.4";
+  src = fetchurl {
+    url = http://files.opencascade.com/OCCT/OCC_6.5.4_release/OpenCASCADE654.tar.gz;
+    sha256 = "1di08mc0wly4cdi3rh9kj52bk0bfpyk6dy03c9yfnv04i7z03kmy";
+  };
+
+  buildInputs = [ mesa tcl tk file libXmu automake autoconf libtool qt4 ftgl freetype ];
+
+  preUnpack = ''
+    sourceRoot=`pwd`/ros
+  '';
+
+  preConfigure = ''
+    sh ./build_configure
+  '';
+
+  # -fpermissive helps building opencascade, although gcc detects a flaw in the code
+  # and reports an error otherwise. Further versions may fix that.
+  NIX_CFLAGS_COMPILE = "-fpermissive";
+
+  configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" "--with-qt=${qt4}" "--with-ftgl=${ftgl}" "--with-freetype=${freetype}" ];
+
+  postInstall = ''
+    mv $out/inc $out/include
+    mkdir -p $out/share/doc/${name}
+    cp -R ../doc $out/share/doc/${name}
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
+    homepage = http://www.opencascade.org/;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/opencascade/default.nix b/pkgs/development/libraries/opencascade/default.nix
index 375aa4f2d58..1ce38ab7b3c 100644
--- a/pkgs/development/libraries/opencascade/default.nix
+++ b/pkgs/development/libraries/opencascade/default.nix
@@ -1,33 +1,23 @@
-{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, automake, autoconf, libtool, qt4,
-ftgl, freetype}:
+{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, cmake, qt4, freetype}:
 
 stdenv.mkDerivation rec {
-  name = "opencascade-6.5.2";
+  name = "opencascade-6.6.0";
   src = fetchurl {
-    url = http://files.opencascade.com/OCCT/OCC_6.5.2_release/OpenCASCADE652.tar.gz;
-    sha256 = "0nsfjhd6rv1fmq8jbyzcs0f13h4xfld487vqs9bwd4lbwcfqxwcy";
+    url = http://files.opencascade.com/OCCT/OCC_6.6.0_release/OpenCASCADE660.tgz;
+    sha256 = "0q2xn915w9skv9sj74lxnyv9g3b0yi1j04majyzxk6sv4nra97z3";
   };
 
-  buildInputs = [ mesa tcl tk file libXmu automake autoconf libtool qt4 ftgl freetype ];
+  buildInputs = [ cmake mesa tcl tk file libXmu qt4 freetype ];
 
   preUnpack = ''
-    sourceRoot=`pwd`/ros
+    sourceRoot=`pwd`/ros/adm/cmake
+    cmakeFlags="$cmakeFlags -DINSTALL_DIR=$out -D3RDPARTY_TCL_DIR=${tcl} -D3RDPARTY_FREETYPE_DIR=${freetype}"
   '';
 
-  preConfigure = ''
-    sh ./build_configure
-  '';
-
-  # -fpermissive helps building opencascade, although gcc detects a flaw in the code
-  # and reports an error otherwise. Further versions may fix that.
-  NIX_CFLAGS_COMPILE = "-I${ftgl}/include/FTGL -I${freetype}/include/freetype2 -fpermissive";
-
-  configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" ];
-
   postInstall = ''
     mv $out/inc $out/include
     mkdir -p $out/share/doc/${name}
-    cp -R ../doc $out/share/doc/${name}
+    cp -R ../../../doc $out/share/doc/${name}
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/opencascade/oce.nix b/pkgs/development/libraries/opencascade/oce.nix
new file mode 100644
index 00000000000..500e6229050
--- /dev/null
+++ b/pkgs/development/libraries/opencascade/oce.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, mesa, tcl, tk, file, libXmu, cmake, libtool, qt4,
+ftgl, freetype}:
+
+stdenv.mkDerivation rec {
+  name = "opencascade-oce-0.13-dev";
+  src = fetchurl {
+    url = https://api.github.com/repos/tpaviot/oce/tarball/bd77743bfa0e765c3a57d116a62d75b50e1a455;
+    name = "${name}.tar.gz";
+    sha256 = "1w7z326la9427yb23hbalsksk6w4ma5xil4jscnvi8mk6g48wyxv";
+  };
+
+  buildInputs = [ mesa tcl tk file libXmu libtool qt4 ftgl freetype cmake ];
+
+  preConfigure = ''
+    cmakeFlags="$cmakeFlags -DOCE_INSTALL_PREFIX=$out"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
+    homepage = http://www.opencascade.org/;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/opencolorio/default.nix b/pkgs/development/libraries/opencolorio/default.nix
new file mode 100644
index 00000000000..513b340e132
--- /dev/null
+++ b/pkgs/development/libraries/opencolorio/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, cmake, unzip }:
+
+stdenv.mkDerivation rec {
+  name = "ocio-${version}";
+  version = "1.0.8";
+
+  src = fetchurl {
+    url = "https://github.com/imageworks/OpenColorIO/archive/v1.0.8.zip";
+    sha256 = "1l70bf40dz2znm9rh3r6xs9d6kp719y1djayb7dc89khfqqbx2di";
+  };
+
+  buildInputs = [ cmake unzip ];
+
+  meta = with stdenv.lib; {
+    homepage = http://opencolorio.org;
+    description = "A color management framework for visual effects and animation";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/libraries/opencv/changeset_r3190.diff b/pkgs/development/libraries/opencv/changeset_r3190.diff
deleted file mode 100644
index 4a614659e72..00000000000
--- a/pkgs/development/libraries/opencv/changeset_r3190.diff
+++ /dev/null
@@ -1,20 +0,0 @@
---- opencv/src/highgui/cvcap_ffmpeg.cpp

-+++ opencv/src/highgui/cvcap_ffmpeg.cpp

-@@ -49,6 +49,15 @@

- #if !defined(WIN32) || defined(__MINGW32__)

- // some versions of FFMPEG assume a C99 compiler, and don't define INT64_C

--#ifndef INT64_C

--#define INT64_C

-+#if !defined INT64_C || !defined UINT64_C

-+# if __WORDSIZE == 64

-+#  define INT64_C(c)	c ## UL

-+# else

-+#  define INT64_C(c)	c ## ULL

-+# endif

-+# if __WORDSIZE == 64

-+#  define UINT64_C(c)	c ## UL

-+# else

-+#  define UINT64_C(c)	c ## ULL

-+# endif

- #define __STDC_CONSTANT_MACROS

- // force re-inclusion of stdint.h to get INT64_C macro

diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index d40b253df2f..a7e514a5780 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -1,19 +1,20 @@
 { stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
-, pkgconfig, gstreamer, xineLib, glib }:
+, pkgconfig, gstreamer, xineLib, glib, python27, python27Packages }:
 
-let v = "2.4.2"; in
+let v = "2.4.5"; in
 
 stdenv.mkDerivation rec {
   name = "opencv-${v}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/opencvlibrary/OpenCV-${v}.tar.bz2";
-    sha256 = "0a1c4ys78k670dsk1fapylpf8hwfyzy944r9jvwivqh33s0j6039";
+    url = "mirror://sourceforge/opencvlibrary/opencv-${v}.tar.gz";
+    sha256 = "14k2w07jcchp11c9v6p5x49h3h1zmg2m9brm2sypz5sp9g7yw2yk";
   };
 
-  buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer ];
+  buildInputs = [ gtk glib libjpeg libpng libtiff jasper ffmpeg xineLib gstreamer
+    python27 python27Packages.numpy ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/opencv/default.nix.edited b/pkgs/development/libraries/opencv/default.nix.edited
deleted file mode 100644
index 05db48095c3..00000000000
--- a/pkgs/development/libraries/opencv/default.nix.edited
+++ /dev/null
@@ -1,27 +0,0 @@
-{ stdenv, fetchurl, cmake, gtk, libjpeg, libpng, libtiff, jasper, ffmpeg
-, pkgconfig, gstreamer }:
-
-let v = "2.3.1a"; in
-
-stdenv.mkDerivation rec {
-  name = "opencv-${v}";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/opencvlibrary/OpenCV-${v}.tar.bz2";
-    sha256 = "0325s7pa2npcw2gc06pr6q5ik4xdyf08rvkfc0myn10w20lzb8m9";
-  };
-
-  buildInputs = [ gtk libjpeg libpng libtiff jasper ffmpeg gstreamer ];
-
-  buildNativeInputs = [ cmake pkgconfig ];
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Open Computer Vision Library with more than 500 algorithms";
-    homepage = http://opencv.willowgarage.com/;
-    license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/development/libraries/openexr/default.nix b/pkgs/development/libraries/openexr/default.nix
index 386b92f2684..33397e8b98e 100644
--- a/pkgs/development/libraries/openexr/default.nix
+++ b/pkgs/development/libraries/openexr/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, zlib, ctl, ilmbase }:
 
 stdenv.mkDerivation rec {
-  name = "openexr-1.6.1";
+  name = "openexr-1.7.1";
   
   src = fetchurl {
     url = "http://download.savannah.nongnu.org/releases/openexr/${name}.tar.gz";
diff --git a/pkgs/development/libraries/openjpeg/default.nix b/pkgs/development/libraries/openjpeg/default.nix
index 575d580faf6..6024456652c 100644
--- a/pkgs/development/libraries/openjpeg/default.nix
+++ b/pkgs/development/libraries/openjpeg/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl }: 
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "openjpeg-1.5.1";
 
-stdenv.mkDerivation {
-  name = "openjpeg-1.5.0";
-  
   src = fetchurl {
-    url = http://openjpeg.googlecode.com/files/openjpeg-1.5.0.tar.gz;
-    sha256 = "1kja6s9dk0hh7p9064kg69y6vninwyvpqi8cap92waj38jmqz469";
+    url = "http://openjpeg.googlecode.com/files/${name}.tar.gz";
+    sha256 = "13dbyf3jwr4h2dn1k11zph3jgx17z7d66xmi640mbsf8l6bk1yvc";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/openldap/default.nix b/pkgs/development/libraries/openldap/default.nix
index 5c9fedb7fc5..1d5a0961340 100644
--- a/pkgs/development/libraries/openldap/default.nix
+++ b/pkgs/development/libraries/openldap/default.nix
@@ -1,14 +1,19 @@
 {stdenv, fetchurl, openssl, cyrus_sasl, db4, groff}:
 
 stdenv.mkDerivation rec {
-  name = "openldap-2.4.31";
+  name = "openldap-2.4.34";
 
   src = fetchurl {
     url = "ftp://ftp.nl.uu.net/pub/unix/db/openldap/openldap-release/${name}.tgz";
-    sha256 = "bde845840df4794b869a6efd6a6b1086f80989038e4844b2e4d7d6b57b39c5b6";
+    sha256 = "01h6zq6zki9b1k07pbyps5vxj9w39ybzjvkyz5h9xk09dd54raza";
   };
 
-  buildInputs = [openssl cyrus_sasl db4 groff];
+  buildInputs = [ openssl cyrus_sasl db4 groff ];
+
+  configureFlags =
+    [ "--enable-overlays"
+    ] ++ stdenv.lib.optional (openssl == null) "--without-tls"
+      ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl";
 
   dontPatchELF = 1; # !!!
 
diff --git a/pkgs/development/libraries/openmotif/default.nix b/pkgs/development/libraries/openmotif/default.nix
deleted file mode 100644
index cf9b059bd16..00000000000
--- a/pkgs/development/libraries/openmotif/default.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-args: with args;
-
-# this is the stable edition of OpenMotif - sources fetched from Debian, without
-# patches applied
-
-stdenv.mkDerivation {
-  name = "openmotif-2.2.3";
-  src = fetchurl {
-    url = http://ftp.de.debian.org/debian/pool/non-free/o/openmotif/openmotif_2.2.3.orig.tar.gz; 
-    sha256 = "0amd9834p1ajnin7c8f1gad2jl2csf69msxcpc10rzm2x27jigxi";
-  };
-
-  unpackPhase = ''
-    tar xzf $src
-    tar xzf openmotif-2.2.3.orig/dist/openMotif-2.2.3.tar.gz
-    rm -rf openmotif-2.2.3.orig
-    cd openMotif-2.2.3
-  '';
-
-  buildInputs = [flex perl];
-  propagatedBuildInputs = [x11 libXp libXau libXaw libXext xbitmaps];
-
-  CFLAGS="-fno-strict-aliasing";  # without this openmotif may segfault
-
-  meta = {
-    description = "Open source version of motif toolkit including aka libmotif3";
-    homepage = http://www.opengroup.org/openmotif/;
-    # Open motif is free for open source projects
-    license = "non-free";
-  };
-}
-
diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix
index 6de49846c2d..d32cbd51606 100644
--- a/pkgs/development/libraries/openmpi/default.nix
+++ b/pkgs/development/libraries/openmpi/default.nix
@@ -1,11 +1,16 @@
 {stdenv, fetchurl, gfortran}:
 
 stdenv.mkDerivation {
-  name = "openmpi-1.4.2";
+  name = "openmpi-1.6.4";
   src = fetchurl {
-    url = http://www.open-mpi.org/software/ompi/v1.4/downloads/openmpi-1.4.2.tar.bz2 ;
-    sha1 = "3e85092433d0e399cc7a51c018f9d13562f78b80";
+    url = http://www.open-mpi.org/software/ompi/v1.6/downloads/openmpi-1.6.4.tar.bz2 ;
+    sha1 = "38095d3453519177272f488d5058a98f7ebdbf10";
   };
   buildInputs = [ gfortran ];
+  meta = {
+    homePage = http://www.open-mpi.org/;
+    description = "Open source MPI-2 implementation";
+    longDescription = "The Open MPI Project is an open source MPI-2 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
+  };
 }
 
diff --git a/pkgs/development/libraries/openscenegraph/default.nix b/pkgs/development/libraries/openscenegraph/default.nix
index 08e08b876b6..01993fa1cd8 100644
--- a/pkgs/development/libraries/openscenegraph/default.nix
+++ b/pkgs/development/libraries/openscenegraph/default.nix
@@ -2,22 +2,22 @@ x@{builderDefsPackage
   , cmake, giflib, libjpeg, libtiff, lib3ds, freetype, libpng
   , coin3d, jasper, gdal, xproto, libX11, libXmu, freeglut, mesa
   , doxygen, ffmpeg, xineLib, unzip, zlib, openal, libxml2
-  , curl
+  , curl, a52dec, faad2, gdk_pixbuf
   , ...}:
 builderDefsPackage
 (a :
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="OpenSceneGraph";
-    version="2.8.3";
+    version="3.0.1";
     name="${baseName}-${version}";
     url="http://www.openscenegraph.org/downloads/stable_releases/${name}/source/${name}.zip";
-    hash="0phihxs7zgir9n1z54xsrsha8wa0xll7xl6lvqvrrczf0bm80yrs";
+    hash="15l23mxv93mw6wkc90x52jhwxh7r3d7lahwdsv3jfnha9dbh648c";
   };
 in
 rec {
@@ -30,7 +30,9 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "addInputs" "doUnpack" "doCmake" "doMakeInstall"];
+  phaseNames = ["setVars" "addInputs" "doUnpack" "doPatch" "doCmake" "doMakeInstall"];
+
+  patches = [ ./xine.patch ]; # http://forum.openscenegraph.org/viewtopic.php?t=9659
 
   cmakeFlags = [
     "-D MATH_LIBRARY="
@@ -39,7 +41,7 @@ rec {
   setVars = a.noDepEntry ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -D__STDC_CONSTANT_MACROS=1"
   '';
-      
+
   meta = {
     description = "A 3D graphics toolkit";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/openscenegraph/xine.patch b/pkgs/development/libraries/openscenegraph/xine.patch
new file mode 100644
index 00000000000..8fbc8ceec52
--- /dev/null
+++ b/pkgs/development/libraries/openscenegraph/xine.patch
@@ -0,0 +1,18 @@
+--- OpenSceneGraph-3.0.1.orig/src/osgPlugins/xine/video_out_rgb.c
++++ OpenSceneGraph-3.0.1/src/osgPlugins/xine/video_out_rgb.c
+@@ -2769,8 +2769,14 @@ init_class(xine_t* xine, void* vo_visual
+ 	clear(rgb_class, sizeof(rgbout_class_t));
+ 
+ 	rgb_class->driver_class.open_plugin     = open_plugin;
++#if XINE_MAJOR_VERSION < 1 || (XINE_MAJOR_VERSION == 1 && XINE_MINOR_VERSION < 2)
+ 	rgb_class->driver_class.get_identifier  = get_identifier;
+ 	rgb_class->driver_class.get_description = get_description;
++#else
++	rgb_class->driver_class.identifier      = get_identifier(NULL);
++	rgb_class->driver_class.description     = get_description(NULL);
++#endif
++
+ 	rgb_class->driver_class.dispose         = dispose_class;
+ 
+ 	return(rgb_class);
+
diff --git a/pkgs/development/libraries/openssl/darwin-arch.patch b/pkgs/development/libraries/openssl/darwin-arch.patch
index 5d5a3afdd1d..63db3efc084 100644
--- a/pkgs/development/libraries/openssl/darwin-arch.patch
+++ b/pkgs/development/libraries/openssl/darwin-arch.patch
@@ -1,20 +1,12 @@
-diff -ru openssl-1.0.0g-orig/Configure openssl-1.0.0g/Configure
---- openssl-1.0.0g-orig/Configure	2011-12-19 18:04:38.000000000 +0100
-+++ openssl-1.0.0g/Configure	2012-01-23 13:45:23.644170171 +0100
-@@ -549,11 +549,11 @@
- 
- ##### MacOS X (a.k.a. Rhapsody or Darwin) setup
- "rhapsody-ppc-cc","cc:-O3 -DB_ENDIAN::(unknown):MACOSX_RHAPSODY::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}::",
--"darwin-ppc-cc","cc:-arch ppc -O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
--"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin-ppc-cc","cc:-O3 -DB_ENDIAN -Wa,-force_cpusubtype_ALL::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin64-ppc-cc","cc:-O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin-i386-cc","cc:-O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"debug-darwin-i386-cc","cc:-g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
-+"darwin64-x86_64-cc","cc:-O3 -DL_ENDIAN -DMD32_REG_T=int -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+diff -ru -x '*~' openssl-1.0.1c-orig/Configure openssl-1.0.1c/Configure
+--- openssl-1.0.1c-orig/Configure	2012-03-14 23:20:40.000000000 +0100
++++ openssl-1.0.1c/Configure	2012-12-18 17:29:30.268090633 +0100
+@@ -579,7 +579,7 @@
+ "darwin64-ppc-cc","cc:-arch ppc64 -O3 -DB_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc64_asm}:osx64:dlfcn:darwin-shared:-fPIC -fno-common:-arch ppc64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "darwin-i386-cc","cc:-arch i386 -O3 -fomit-frame-pointer -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:".eval{my $asm=$x86_asm;$asm=~s/cast\-586\.o//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin-i386-cc","cc:-arch i386 -g3 -DL_ENDIAN::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:BN_LLONG RC4_INT RC4_CHUNK DES_UNROLL BF_PTR:${x86_asm}:macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch i386 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+-"darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-x86_64-cc","cc:-O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHAR RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
  "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
- 
- ##### A/UX
+ # iPhoneOS/iOS
+ "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index bb78f5264b3..7aabceacd96 100644
--- a/pkgs/development/libraries/openssl/default.nix
+++ b/pkgs/development/libraries/openssl/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchurl, perl }:
+{ stdenv, fetchurl, perl
+, withCryptodev ? false, cryptodevHeaders }:
 
 let
-  name = "openssl-1.0.0i";
+  name = "openssl-1.0.1e";
 
   opensslCrossSystem = stdenv.lib.attrByPath [ "openssl" "system" ]
     (throw "openssl needs its platform name cross building" null)
@@ -40,7 +41,7 @@ stdenv.mkDerivation {
       "http://www.openssl.org/source/${name}.tar.gz"
       "http://openssl.linux-mirror.org/source/${name}.tar.gz"
     ];
-    sha1 = "b7aa11cbd7d264c2b1f44e3d55b334fb33f7b674";
+    sha256 = "1qqskk39jh85fvdn3ycmdqjdf67c0b97dwmmbcysl4gzr3l1akzp";
   };
 
   patches = patchesCross false;
@@ -48,22 +49,28 @@ stdenv.mkDerivation {
   # TODO: separate lib.
   outputs = [ "out" "man" "bin" ];
 
-  buildNativeInputs = [ perl ];
+  buildInputs = stdenv.lib.optional withCryptodev cryptodevHeaders;
+
+  nativeBuildInputs = [ perl ];
 
   # On x86_64-darwin, "./config" misdetects the system as
   # "darwin-i386-cc".  So specify the system type explicitly.
   configureScript =
     if stdenv.system == "x86_64-darwin" then "./Configure darwin64-x86_64-cc" else "./config";
 
-  configureFlags = "shared --libdir=lib";
+  configureFlags = "shared --libdir=lib --openssldir=etc/ssl" +
+    stdenv.lib.optionalString withCryptodev " -DHAVE_CRYPTODEV -DUSE_CRYPTODEV_DIGESTS";
 
   makeFlags = "MANDIR=$(man)/share/man";
 
+  # Parallel building is broken in OpenSSL.
+  #enableParallelBuilding = true;
+
   postInstall =
     ''
       # If we're building dynamic libraries, then don't install static
       # libraries.
-      if [ -n "$(echo $out/lib/*.so)" ]; then
+      if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib)" ]; then
           rm $out/lib/*.a
       fi
 
diff --git a/pkgs/development/libraries/pango/1.29.x.nix b/pkgs/development/libraries/pango/1.30.x.nix
index af46998114c..fa6d50d6c87 100644
--- a/pkgs/development/libraries/pango/1.29.x.nix
+++ b/pkgs/development/libraries/pango/1.30.x.nix
@@ -1,23 +1,23 @@
-{ stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng }:
+{ stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, fontconfig }:
 
 stdenv.mkDerivation rec {
-  name = "pango-1.29.4";
+  name = "pango-1.30.1";
 
   src = fetchurl {
-    url = mirror://gnome/sources/pango/1.29/pango-1.29.4.tar.xz;
-    sha256 = "0zqjq6ccv6mbah74rcvb03ksq1jwan21z37mdmqa56307sax3s3s";
+    url = "mirror://gnome/sources/pango/1.30/${name}.tar.xz";
+    sha256 = "3a8c061e143c272ddcd5467b3567e970cfbb64d1d1600a8f8e62435556220cbe";
   };
 
-  enableParallelBuilding = true;
-
   outputs = [ "dev" "out" "bin" "doc" ];
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin gettext;
+  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   propagatedBuildInputs = [ x11 glib cairo libpng ];
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "A library for laying out and rendering of text, with an emphasis on internationalization";
 
diff --git a/pkgs/development/libraries/pangomm/2.28.x.nix b/pkgs/development/libraries/pangomm/2.28.x.nix
index 5cd4744fed3..7f4d14dfbac 100644
--- a/pkgs/development/libraries/pangomm/2.28.x.nix
+++ b/pkgs/development/libraries/pangomm/2.28.x.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "10kcdpg080m393f1vz0km41kd3483fkyabprm59gvjwklxkcp3bp";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   propagatedBuildInputs = [ pango glibmm cairomm libpng ];
 
   meta = {
diff --git a/pkgs/development/libraries/pcl/default.nix b/pkgs/development/libraries/pcl/default.nix
new file mode 100644
index 00000000000..1a3484c2ee5
--- /dev/null
+++ b/pkgs/development/libraries/pcl/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qt4, libusb1 }:
+
+stdenv.mkDerivation {
+  name = "pcl-1.6.0";
+
+  buildInputs = [ cmake qhull flann boost vtk eigen pkgconfig qt4 libusb1 ];
+
+  src = fetchurl {
+    url = mirror://sourceforge/pointclouds/PCL-1.6.0-Source.tar.bz2;
+    sha256 = "0ip3djcjgynlr9vac6jlcw6kxhg2lm8fc0aqk747a6l0rqvllf1x";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://pointclouds.org/;
+    description = "Open project for 2D/3D image and point cloud processing";
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/pcre/8.30.nix b/pkgs/development/libraries/pcre/8.30.nix
deleted file mode 100644
index 2f636492eb6..00000000000
--- a/pkgs/development/libraries/pcre/8.30.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
-
-stdenv.mkDerivation rec {
-  name = "pcre-8.30";
-
-  src = fetchurl {
-    url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "c1113fd7db934e97ad8b3917d432e5b642e9eb9afd127eb797804937c965f4ac";
-  };
-
-  # The compiler on Darwin crashes with an internal error while building the
-  # C++ interface. Disabling optimizations on that platform remedies the
-  # problem. In case we ever update the Darwin GCC version, the exception for
-  # that platform ought to be removed.
-  configureFlags = ''
-    ${if unicodeSupport then "--enable-unicode-properties" else ""}
-    ${if !cplusplusSupport then "--disable-cpp" else ""}
-  '' + stdenv.lib.optionalString stdenv.isDarwin "CXXFLAGS=-O0";
-
-  doCheck = !stdenv.isCygwin;                   # XXX: test failure on Cygwin
-
-  meta = {
-    homepage = "http://www.pcre.org/";
-    description = "A library for Perl Compatible Regular Expressions";
-    license = "BSD-3";
-
-    longDescription = ''
-      The PCRE library is a set of functions that implement regular
-      expression pattern matching using the same syntax and semantics as
-      Perl 5. PCRE has its own native API, as well as a set of wrapper
-      functions that correspond to the POSIX regular expression API. The
-      PCRE library is free, even for building proprietary software.
-    '';
-
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-}
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index edfe26740de..e59c249348a 100644
--- a/pkgs/development/libraries/pcre/default.nix
+++ b/pkgs/development/libraries/pcre/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, unicodeSupport ? true, cplusplusSupport ? true }:
 
 stdenv.mkDerivation rec {
-  name = "pcre-8.21";
+  name = "pcre-8.31";
 
   src = fetchurl {
     url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/${name}.tar.bz2";
-    sha256 = "1qwrqldbwszbmr4cw4f0xmcl889cmmjbf58l9vxn89zw26fm1f54";
+    sha256 = "5778a02535473c7ee7838ea598c19f451e63cf5eec0bf0307a688301c9078c3c";
   };
 
   # The compiler on Darwin crashes with an internal error while building the
diff --git a/pkgs/development/libraries/pdf2htmlex/default.nix b/pkgs/development/libraries/pdf2htmlex/default.nix
new file mode 100644
index 00000000000..597385aa9fa
--- /dev/null
+++ b/pkgs/development/libraries/pdf2htmlex/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, cmake, poppler, fontforge, unzip, pkgconfig, python}:
+
+stdenv.mkDerivation rec {
+  version = "0.8.1";
+  name = "pdf2htmlex-${version}";
+  
+  src = fetchurl {
+      url = "https://github.com/coolwanglu/pdf2htmlEX/archive/v${version}.zip";
+      sha256 = "0v8x03vq46ng9s27ryn76lcsjgpxgak6062jnx59lnyz856wvp8a";
+  };
+
+  buildInputs = [
+    cmake
+    unzip
+    poppler
+    fontforge
+    pkgconfig
+    python
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Convert PDF to HTML without losing text or format. ";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.iElectric ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/pdf2htmlex/pdf2xml.patch b/pkgs/development/libraries/pdf2htmlex/pdf2xml.patch
new file mode 100644
index 00000000000..596a3aea674
--- /dev/null
+++ b/pkgs/development/libraries/pdf2htmlex/pdf2xml.patch
@@ -0,0 +1,48 @@
+diff -rc pdf2xml/pdf2xml/Makefile.linux pdf2xml-new/pdf2xml/Makefile.linux
+*** pdf2xml/Makefile.linux	2008-02-07 17:43:10.000000000 +0100
+--- pdf2xml-new/Makefile.linux	2010-08-25 15:41:23.000000000 +0200
+***************
+*** 30,36 ****
+  
+  
+  # Executable name
+! PDFTOXMLEXE=pdftoxml.exe
+  
+  # Main target
+  all: pdftoxmlEXE
+--- 30,36 ----
+  
+  
+  # Executable name
+! PDFTOXMLEXE=pdftoxml
+  
+  # Main target
+  all: pdftoxmlEXE
+diff -rc pdf2xml/pdf2xml/src/pdftoxml.cc pdf2xml-new/pdf2xml/src/pdftoxml.cc
+*** pdf2xml/src/pdftoxml.cc	2010-04-26 10:58:01.000000000 +0200
+--- pdf2xml-new/src/pdftoxml.cc	2010-08-25 15:36:15.000000000 +0200
+***************
+*** 11,21 ****
+  //
+  //===========================================================================
+  
+  #include <aconf.h>
+- #include <stdio.h>
+  #include <stdlib.h>
+  #include <stddef.h>
+! #include <string.h>
+  #include "parseargs.h"
+  #include "GString.h"
+  #include "gmem.h"
+--- 11,21 ----
+  //
+  //===========================================================================
+  
++ #include <string.h>
+  #include <aconf.h>
+  #include <stdlib.h>
+  #include <stddef.h>
+! #include <cstdio>
+  #include "parseargs.h"
+  #include "GString.h"
+  #include "gmem.h"
diff --git a/pkgs/development/libraries/pgen/default.nix b/pkgs/development/libraries/pgen/default.nix
index 91c9f16f5c8..53dc7a768ee 100644
--- a/pkgs/development/libraries/pgen/default.nix
+++ b/pkgs/development/libraries/pgen/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation ( rec {
   };
 
   buildInputs = [aterm toolbuslib cLibrary configSupport ptSupport ptableSupport errorSupport tideSupport sdfSupport sglr ascSupport asfSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
 
   dontStrip = isMingw;
 } // ( if isMingw then { NIX_CFLAGS_COMPILE = "-O2 -Wl,--stack=0x2300000"; } else {} ) )
diff --git a/pkgs/development/libraries/phat/default.nix b/pkgs/development/libraries/phat/default.nix
deleted file mode 100644
index 6e68e3d9da8..00000000000
--- a/pkgs/development/libraries/phat/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl, gtk, libgnomecanvas, pkgconfig }:
- 
-stdenv.mkDerivation rec {
-  name = "phat-${version}";
-  version = "0.4.1";
-
-  src = fetchurl {
-    url = "http://download.berlios.de/phat/${name}.tar.gz";
-    sha256 = "1icncp2d8hbarzz8mmflkw13blg7blgwfic8q2wll7s6n01ii2av";
-  };
-
-  buildInputs = [ gtk libgnomecanvas pkgconfig ];
-
-  meta = with stdenv.lib; {
-    description = "GTK+ widgets geared toward pro-audio apps";
-    homepage = http://phat.berlios.de;
-    license = licenses.gpl2Plus;
-    platforms = platforms.linux;
-    maintainers = [ maintainers.goibhniu ];
-  };
-}
diff --git a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
index b2677eb1e7a..f297bd792c7 100644
--- a/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
+++ b/pkgs/development/libraries/phonon-backend-gstreamer/default.nix
@@ -2,7 +2,7 @@
 , gst_plugins_base }:
 
 let
-  version = "4.6.0";
+  version = "4.6.3";
   pname = "phonon-backend-gstreamer";
 in
 
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://kde/stable/phonon/${pname}/${version}/src/${name}.tar.xz";
-    sha256 = "0bwkd1dmj8p4m5xindh6ixfvifq36qmvfn246vx22syqfl6f1m2v";
+    sha256 = "0n5ggap1xzspq8x1j9bvnf7wqqh5495sysri7zyg42g32gqp7qjm";
   };
 
   buildInputs = [ phonon qt4 gstreamer gst_plugins_base ];
 
-  buildNativeInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
 
   meta = {
     homepage = http://phonon.kde.org/;
diff --git a/pkgs/development/libraries/phonon-backend-vlc/default.nix b/pkgs/development/libraries/phonon-backend-vlc/default.nix
index faa88f8854f..97e778cc1f5 100644
--- a/pkgs/development/libraries/phonon-backend-vlc/default.nix
+++ b/pkgs/development/libraries/phonon-backend-vlc/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     sha256 = "1233szd05ahaxyk1sjis374n90m40svfks2aq9jx3g3lxygzwmi2";
   };
 
-  buildNativeInputs = [ cmake automoc4 xz ];
+  nativeBuildInputs = [ cmake automoc4 xz ];
 
   buildInputs = [ qt4 vlc_ phonon ];
 
diff --git a/pkgs/development/libraries/phonon/default.nix b/pkgs/development/libraries/phonon/default.nix
index 2c70957746d..bd74b937276 100644
--- a/pkgs/development/libraries/phonon/default.nix
+++ b/pkgs/development/libraries/phonon/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 pulseaudio ];
 
-  buildNativeInputs = [ cmake automoc4 ];
+  nativeBuildInputs = [ cmake automoc4 ];
 
   meta = {
     homepage = http://phonon.kde.org/;
diff --git a/pkgs/development/libraries/php-xcache/default.nix b/pkgs/development/libraries/php-xcache/default.nix
index b1d1bde358a..5f175aa72ff 100644
--- a/pkgs/development/libraries/php-xcache/default.nix
+++ b/pkgs/development/libraries/php-xcache/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, php, autoconf, automake, libtool, m4 }:
 
 stdenv.mkDerivation rec {
-  name = "php-xcache-1.3.1";
+  name = "php-xcache-3.0.1";
   
   src = fetchurl {
-    url = http://xcache.lighttpd.net/pub/Releases/1.3.1/xcache-1.3.1.tar.bz2;
-    sha256 = "16qj6hns7frs655k2vg9dabnk28085hf6qxhr9dybw6ja5aj24g3";
+    url = http://xcache.lighttpd.net/pub/Releases/3.0.1/xcache-3.0.1.tar.bz2;
+    md5 = "45086010bc4f82f506c08be1c556941b";
   };
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/physfs/default.nix b/pkgs/development/libraries/physfs/default.nix
index fef902fec03..16fb46d1698 100644
--- a/pkgs/development/libraries/physfs/default.nix
+++ b/pkgs/development/libraries/physfs/default.nix
@@ -1,21 +1,21 @@
 {stdenv, fetchurl, cmake}:
 
 stdenv.mkDerivation rec {
-  name = "physfs-2.0.2";
+  name = "physfs-2.0.3";
 
   src = fetchurl {
-    url = "${meta.homepage}/downloads/${name}.tar.gz";
-    sha256 = "02dwy0vsn2dp31f15vxd3yxxr1rgy25ab7ncavyh73i290qnsadf";
+    url = "${meta.homepage}/downloads/${name}.tar.bz2";
+    sha256 = "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patchPhase = ''
     sed s,-Werror,, -i CMakeLists.txt
   '';
 
   meta = {
-    homepage = http://icculus.org/physfs/;
+    homepage = "http://icculus.org/physfs/";
     description = "Library to provide abstract access to various archives";
     license = "free";
   };
diff --git a/pkgs/development/libraries/pkcs11helper/default.nix b/pkgs/development/libraries/pkcs11helper/default.nix
new file mode 100644
index 00000000000..5443df89704
--- /dev/null
+++ b/pkgs/development/libraries/pkcs11helper/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pkgconfig, openssl, autoconf, automake, libtool }:
+
+let
+  rev = "5d412bad60";
+in
+stdenv.mkDerivation rec {
+  name = "pkcs11-helper-20121123-${rev}";
+  
+  src = fetchurl {
+    url = "https://github.com/alonbl/pkcs11-helper/tarball/${rev}";
+    name = "${name}.tar.gz";
+    sha256 = "1mih6mha39yr5s5m18lg4854qc105asgnwmjw7f95kgmzni62kxp";
+  };
+
+  preConfigure = "autoreconf -vfi";
+  
+  buildInputs = [ pkgconfig openssl autoconf automake libtool ];
+
+  meta = {
+    homepage = https://www.opensc-project.org/opensc/wiki/pkcs11-helper;
+    license = [ "BSD" "GPLv2" ];
+    description = "Library that simplifies the interaction with PKCS#11 providers";
+  };
+}
diff --git a/pkgs/development/libraries/plib/default.nix b/pkgs/development/libraries/plib/default.nix
index 679db72802c..5e15a63735e 100644
--- a/pkgs/development/libraries/plib/default.nix
+++ b/pkgs/development/libraries/plib/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
   };
 
-  NIX_CFLAGS_COMPILE = if (enablePIC) then "-fPIC" else "";
+  NIX_CFLAGS_COMPILE = if enablePIC then "-fPIC" else "";
 
   propagatedBuildInputs = [
     mesa freeglut SDL
diff --git a/pkgs/development/libraries/podofo/default.nix b/pkgs/development/libraries/podofo/default.nix
index ad447207a14..d6b604367fb 100644
--- a/pkgs/development/libraries/podofo/default.nix
+++ b/pkgs/development/libraries/podofo/default.nix
@@ -2,13 +2,21 @@
 openssl, libpng, lua5}:
 
 stdenv.mkDerivation rec {
-  name = "podofo-0.9.1";
+  name = "podofo-0.9.2";
   src = fetchurl {
     url = "mirror://sourceforge/podofo/${name}.tar.gz";
-    sha256 = "0icpxh1l1dpviq2zwy764dhg8y03zwyf4pgw4s7kb165nvh9v5kv";
+    sha256 = "1wx3s0718rmhdzdwyi8hgpf2s92sk3hijy8f4glrmnjpiihr2la6";
   };
   propagatedBuildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng ];
-  buildInputs = [ cmake lua5 stdenv.gcc.libc ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ lua5 stdenv.gcc.libc ];
+
+  crossAttrs = {
+    propagatedBuildInputs = [ zlib.crossDrv freetype.crossDrv libjpeg.crossDrv
+      libtiff.crossDrv fontconfig.crossDrv openssl.crossDrv libpng.crossDrv
+      lua5.crossDrv stdenv.gccCross.libc ];
+  };
+
   cmakeFlags = "-DPODOFO_BUILD_SHARED=ON -DPODOFO_BUILD_STATIC=OFF";
 
   meta = {
diff --git a/pkgs/development/libraries/polkit-qt-1/default.nix b/pkgs/development/libraries/polkit-qt-1/default.nix
index 0c1a0a79584..13bc992d026 100644
--- a/pkgs/development/libraries/polkit-qt-1/default.nix
+++ b/pkgs/development/libraries/polkit-qt-1/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./polkit-install.patch ];
 
-  buildNativeInputs = [ cmake automoc4 ];
+  nativeBuildInputs = [ cmake automoc4 ];
 
   propagatedBuildInputs = [ polkit glib qt4 ];
 
diff --git a/pkgs/development/libraries/polkit/default.nix b/pkgs/development/libraries/polkit/default.nix
index 88daab5ff92..788b6d6d32b 100644
--- a/pkgs/development/libraries/polkit/default.nix
+++ b/pkgs/development/libraries/polkit/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, pkgconfig, glib, expat, pam, intltool, gettext
 , gobjectIntrospection
-, useSystemd ? false, systemd ? null }:
+, useSystemd ? true, systemd }:
 
 let
 
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index d2ad4061567..1d796789210 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -6,11 +6,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "poppler-0.18.4";
+  name = "poppler-0.22.4";
 
   src = fetchurl {
     url = "${meta.homepage}${name}.tar.gz";
-    sha256 = "0bnl05al7mjndp2h0355946j59nfw76f5v0x57d47q68rm412hik";
+    sha256 = "0fz1vk0rbxvnv7ssj8l910k1rx0gjhzl5wr7hkdf4r9jwqs8yhsg";
   };
 
   propagatedBuildInputs =
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals gtkSupport [ glib gtk ]
     ++ stdenv.lib.optional qt4Support qt4;
 
-  buildNativeInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkgconfig cmake ];
 
   cmakeFlags = "-DENABLE_XPDF_HEADERS=ON -DENABLE_LIBCURL=ON -DENABLE_ZLIB=ON";
 
diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix
index 8cad9022d91..b24b4e06cb9 100644
--- a/pkgs/development/libraries/ppl/default.nix
+++ b/pkgs/development/libraries/ppl/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1sxviip4yk6gp453pid5scy1ba66dzdpr02i1416yk7lkv0x3yz3";
   };
 
-  buildNativeInputs = [ perl gnum4 ];
+  nativeBuildInputs = [ perl gnum4 ];
   propagatedBuildInputs = [ gmpxx ];
 
   configureFlags = "--disable-watchdog";
diff --git a/pkgs/development/libraries/prison/default.nix b/pkgs/development/libraries/prison/default.nix
index ca8ba46d7dc..7beb93eb462 100644
--- a/pkgs/development/libraries/prison/default.nix
+++ b/pkgs/development/libraries/prison/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 qrencode libdmtx ];
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "Qt4 library for QR-codes";
diff --git a/pkgs/development/libraries/protobufc/default.nix b/pkgs/development/libraries/protobufc/default.nix
new file mode 100644
index 00000000000..58c639ee604
--- /dev/null
+++ b/pkgs/development/libraries/protobufc/default.nix
@@ -0,0 +1,22 @@
+{ fetchurl, stdenv, zlib, protobuf }:
+
+stdenv.mkDerivation rec {
+  name = "protobuf-c-0.15";
+
+  src = fetchurl {
+    url = "http://protobuf-c.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0dh0180lzqk6n1r0qk38kgdy4x15mpkg5j4g2r31qhx52f757jwg";
+  };
+
+  buildInputs = [ protobuf ];
+
+  doCheck = true;
+
+  meta = {
+    description = "C bindings for Google's Protocol Buffers";
+
+    license = "BSD";
+
+    homepage = http://code.google.com/p/protobuf-c/;
+  };
+}
diff --git a/pkgs/development/libraries/pt-support/default.nix b/pkgs/development/libraries/pt-support/default.nix
index c2264eebddc..063fdd7cc04 100644
--- a/pkgs/development/libraries/pt-support/default.nix
+++ b/pkgs/development/libraries/pt-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation ( rec {
   };
 
   buildInputs = [aterm toolbuslib errorSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 } // ( if isMingw then { NIX_CFLAGS_COMPILE = "-O2 -Wl,--stack=0x2300000"; } else {} ) )
diff --git a/pkgs/development/libraries/ptable-support/default.nix b/pkgs/development/libraries/ptable-support/default.nix
index c95a82d4287..357d288c732 100644
--- a/pkgs/development/libraries/ptable-support/default.nix
+++ b/pkgs/development/libraries/ptable-support/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm ptSupport];
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/pth/default.nix b/pkgs/development/libraries/pth/default.nix
index ffd81f84489..b7b09caed9b 100644
--- a/pkgs/development/libraries/pth/default.nix
+++ b/pkgs/development/libraries/pth/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj";
   };
 
+  preConfigure = stdenv.lib.optionalString stdenv.isArm ''
+    configureFlagsArray=("CFLAGS=-DJB_SP=8 -DJB_PC=9")
+  '';
+
   meta = {
     description = "The GNU Portable Threads library";
     homepage = http://www.gnu.org/software/pth;
diff --git a/pkgs/development/libraries/qca2/default.nix b/pkgs/development/libraries/qca2/default.nix
index 6af622c0a15..1da9ef193b5 100644
--- a/pkgs/development/libraries/qca2/default.nix
+++ b/pkgs/development/libraries/qca2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   
   buildInputs = [ qt4 ];
   
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
 
   preBuild =
     ''
diff --git a/pkgs/development/libraries/qca2/ossl.nix b/pkgs/development/libraries/qca2/ossl.nix
index 1e0c583b7a5..153d3ba5746 100644
--- a/pkgs/development/libraries/qca2/ossl.nix
+++ b/pkgs/development/libraries/qca2/ossl.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 =  "ef2c0307e8834e1e7cb23b6fea1cc22486328a37186301a6c11161b1c93d834b";
   };
   buildInputs = [ qt4 qca2 openssl ];
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
   dontAddPrefix = true;
   configureFlags="--no-separate-debug-info --with-qca=${qca2}
     --with-openssl-inc=${openssl}/include --with-openssl-lib=${openssl}/lib";
diff --git a/pkgs/development/libraries/qhull/default.nix b/pkgs/development/libraries/qhull/default.nix
index 6d15ce576ff..b81dbda1586 100644
--- a/pkgs/development/libraries/qhull/default.nix
+++ b/pkgs/development/libraries/qhull/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "127zpjp6sm8c101hz239k82lpxqcqf4ksdyfqc2py2sm22kclpm3";
   };
 
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = "-DMAN_INSTALL_DIR=share/man/man1 -DDOC_INSTALL_DIR=share/doc/qhull";
 
diff --git a/pkgs/development/libraries/qimageblitz/default.nix b/pkgs/development/libraries/qimageblitz/default.nix
index 4aac06a5101..5800b562e6b 100644
--- a/pkgs/development/libraries/qimageblitz/default.nix
+++ b/pkgs/development/libraries/qimageblitz/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   name = "${pn}-${v}";
   
   src = fetchurl {
-    url = "mirror://sf/${pn}/${pn}-${v}.tar.bz2";
+    url = "mirror://sourceforge/${pn}/${pn}-${v}.tar.bz2";
     sha256 = "0pnaf3qi7rgkxzs2mssmslb3f9ya4cyx09wzwlis3ppyvf72j0p9";
   };
   
diff --git a/pkgs/development/libraries/qjson/default.nix b/pkgs/development/libraries/qjson/default.nix
index a4b146ff424..e69ae5f98f7 100644
--- a/pkgs/development/libraries/qjson/default.nix
+++ b/pkgs/development/libraries/qjson/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
-  name = "qjson-0.7.1";
+  name = "qjson-0.8.1";
 
   src = fetchurl {
-    url = "mirror://sf/qjson/${name}.tar.bz2";
-    sha256 = "155r7nypgnsvjc6w3q51zmjchpqxi4c3azad9cf1fip8bws993iv";
+    url = "mirror://sourceforge/qjson/${name}.tar.bz2";
+    sha256 = "1n8lr2ph08yhcgimf4q1pnkd4z15v895bsf3m68ljz14aswvakfd";
   };
 
   buildInputs = [ cmake qt4 ];
diff --git a/pkgs/development/libraries/qoauth/default.nix b/pkgs/development/libraries/qoauth/default.nix
new file mode 100644
index 00000000000..f93e4479e71
--- /dev/null
+++ b/pkgs/development/libraries/qoauth/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, qt4, qca2 }:
+
+stdenv.mkDerivation {
+  name = "qoauth-1.0.1";
+
+  src = fetchurl {
+    url = https://github.com/ayoy/qoauth/tarball/v1.0.1;
+    name = "qoauth-1.0.1.tar.gz";
+    sha256 = "1ax0g4dd49a3a1699ams13bkhz690xfwqg8rxp1capbdpf2aa8cp";
+  };
+
+  configurePhase = "qmake PREFIX=$prefix";
+  patchPhase = "sed -e 's/lib64/lib/g' -i src/src.pro";
+
+  buildInputs = [ qt4 qca2 ];
+
+  NIX_CFLAGS_COMPILE="-I${qca2}/include/QtCrypto";
+  NIX_LDFLAGS = "-lqca";
+
+  meta = {
+    description = "Qt library for OAuth authentication";
+    inherit (qt4.meta) platforms;
+    maintainers = [ stdenv.lib.maintainers.urkud ];
+  };
+}
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index ba796259f70..91eec5fcd31 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
     sha256 = "0jd4g3bwkgk2s4flbmgisyihm7cam964gzb3pawjlkhas01zghz8";
   };
 
-  buildNativeInputs = [ which ];
+  nativeBuildInputs = [ which ];
   propagatedBuildInputs = [x11 libXft libXrender zlib libjpeg libpng];
 
   configureFlags = "
diff --git a/pkgs/development/libraries/qt-4.x/4.7/default.nix b/pkgs/development/libraries/qt-4.x/4.7/default.nix
deleted file mode 100644
index 47832a114b4..00000000000
--- a/pkgs/development/libraries/qt-4.x/4.7/default.nix
+++ /dev/null
@@ -1,114 +0,0 @@
-{ stdenv, fetchurl
-, alsaLib, pulseaudio
-, libXft, libXrender, randrproto, xextproto, libXinerama, xineramaproto, libXcursor, libXmu
-, libXv, libXext, libXfixes, inputproto, fixesproto, libXrandr, freetype, fontconfig
-, zlib, libjpeg, libpng, libmng, which, mesa, openssl, dbus, cups, pkgconfig, libtiff, glib
-, mysql, postgresql, sqlite
-, perl, coreutils, libXi
-, buildDemos ? false, buildExamples ? false, useDocs ? false
-}:
-
-let
-  v = "4.7.4";
-in
-
-stdenv.mkDerivation rec {
-  name = "qt-${v}";
-
-  src = fetchurl {
-    url = "ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-${v}.tar.gz";
-    sha256 = "07i283si8rckdsg3h9a4sp213l16hgjrl7cpzclrjvx4x2y5w6cp";
-  };
-
-  preConfigure =
-    ''
-      export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
-      configureFlags+="
-        -docdir $out/share/doc/${name}
-        -plugindir $out/lib/qt4/plugins
-        -importdir $out/lib/qt4/imports
-        -examplesdir $out/share/doc/${name}/examples
-        -demosdir $out/share/doc/${name}/demos
-        -datadir $out/share/${name}
-        -translationdir $out/share/${name}/translations
-      "
-    '';
-
-  configureFlags =
-    ''
-      -v -no-separate-debug-info -release -fast -confirm-license -opensource
-      -system-zlib -system-libpng -system-libjpeg -qt-gif -system-libmng
-      -opengl -xrender -xrandr -xinerama -xcursor
-      -plugin-sql-mysql -system-sqlite
-      -qdbus -cups -glib -xfixes -dbus-linked -openssl-linked
-      -fontconfig -I${freetype}/include/freetype2
-      -exceptions -xmlpatterns
-      -multimedia -audio-backend -no-phonon
-      -webkit -javascript-jit
-      -make libs -make tools -make translations
-      ${if buildDemos == true then "-make demos" else "-nomake demos"}
-      ${if buildExamples == true then "-make examples" else "-nomake examples"}
-      ${if useDocs then "-make docs" else "-nomake docs"}
-    '';
-
-  propagatedBuildInputs = [
-    alsaLib
-    sqlite
-    libXft
-    libXrender
-    libXrandr
-    libXi
-    randrproto
-    xextproto
-    libXinerama
-    xineramaproto
-    libXcursor
-    zlib
-    libjpeg
-    libmng
-    mysql
-    postgresql
-    libpng
-    which
-    mesa
-    libXmu
-    libXv
-    openssl
-    dbus.libs
-    cups
-    pkgconfig
-    libXext
-    freetype
-    fontconfig
-    inputproto
-    fixesproto
-    libXfixes
-    glib
-    libtiff
-    pulseaudio
-  ];
-
-  buildInputs = [ perl ];
-
-  prefixKey = "-prefix ";
-
-  prePatch = ''
-    substituteInPlace configure --replace /bin/pwd pwd
-    substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
-    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i mkspecs/*/*.conf
-  '';
-
-  postInstall = ''
-    ${if useDocs then "rm -rfv $out/share/doc/${name}/{html,src}" else ""}
-  '';
-
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
-    homepage = http://qt.nokia.com/products;
-    description = "A cross-platform application framework for C++";
-    license = "GPL/LGPL";
-    maintainers = with maintainers; [ urkud sander ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index f56886259a6..ade9a67cbcc 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -7,13 +7,17 @@
 , perl, coreutils, libXi
 , buildMultimedia ? true, alsaLib, gstreamer, gst_plugins_base
 , buildWebkit ? true
-, flashplayerFix ? true, gdk_pixbuf
+, flashplayerFix ? false, gdk_pixbuf
 , gtkStyle ? false, libgnomeui, gtk, GConf, gnome_vfs
+, developerBuild ? false
+, docs ? false
+, examples ? false
+, demos ? false
 }:
 
-let
-  v = "4.8.2";
-in
+with stdenv.lib;
+
+let v = "4.8.4"; in
 
 # TODO:
 #  * move some plugins (e.g., SQL plugins) to dedicated derivations to avoid
@@ -24,27 +28,26 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://releases.qt-project.org/qt4/source/qt-everywhere-opensource-src-${v}.tar.gz";
-    sha256 = "0y93vkkn44md37gyg4y8sc9ylk27xkniaimfcpdcwd090qnjl6wj";
+    sha256 = "0w1j16q6glniv4hppdgcvw52w72gb2jab35ylkw0qjn5lj5y7c1k";
   };
 
-  patches = [ ( substituteAll {
+  patches =
+    [ ./glib-2.32.patch
+      (substituteAll {
         src = ./dlopen-absolute-paths.diff;
         inherit cups icu libXfixes;
         glibc = stdenv.gcc.libc;
       })
-    ] ++ stdenv.lib.optional gtkStyle (
-      substituteAll {
+    ] ++ stdenv.lib.optional gtkStyle (substituteAll {
         src = ./dlopen-gtkstyle.diff;
         # substituteAll ignores env vars starting with capital letter
-        gconf = GConf; 
+        gconf = GConf;
         inherit gnome_vfs libgnomeui gtk;
-      }
-    ) ++ stdenv.lib.optional flashplayerFix (
-      substituteAll {
+      })
+    ++ stdenv.lib.optional flashplayerFix (substituteAll {
         src = ./dlopen-webkit-nsplugin.diff;
         inherit gtk gdk_pixbuf;
-      }
-    );
+      });
 
   preConfigure =
     ''
@@ -72,29 +75,30 @@ stdenv.mkDerivation rec {
       -exceptions -xmlpatterns
 
       -make libs -make tools -make translations
-      -nomake demos -nomake examples -nomake docs
+      -${if demos then "" else "no"}make demos
+      -${if examples then "" else "no"}make examples
+      -${if docs then "" else "no"}make docs
 
       -no-phonon ${if buildWebkit then "" else "-no"}-webkit ${if buildMultimedia then "" else "-no"}-multimedia -audio-backend
+      ${if developerBuild then "-developer-build" else ""}
     '';
 
   propagatedBuildInputs =
     [ libXrender libXrandr libXinerama libXcursor libXext libXfixes
       libXv libXi libSM
     ]
-    ++ (stdenv.lib.optional (stdenv.lib.lists.elem stdenv.system
-                              stdenv.lib.platforms.mesaPlatforms)
-         mesa)
-    ++ (stdenv.lib.optional (buildWebkit || buildMultimedia) alsaLib)
+    ++ optional (stdenv.lib.lists.elem stdenv.system stdenv.lib.platforms.mesaPlatforms) mesa
+    ++ optional (buildWebkit || buildMultimedia) alsaLib
     ++ [ zlib libpng openssl dbus.libs freetype fontconfig glib ]
-    ++ (stdenv.lib.optionals (buildWebkit || buildMultimedia)
-        [ gstreamer gst_plugins_base ]);
+    ++ optionals (buildWebkit || buildMultimedia) [ gstreamer gst_plugins_base ];
 
   # The following libraries are only used in plugins
-  buildInputs = [ cups # Qt dlopen's libcups instead of linking to it
-    mysql postgresql sqlite libjpeg libmng libtiff icu ]
-    ++ stdenv.lib.optionals gtkStyle [ gtk gdk_pixbuf ];
+  buildInputs =
+    [ cups # Qt dlopen's libcups instead of linking to it
+      mysql postgresql sqlite libjpeg libmng libtiff icu ]
+    ++ optionals gtkStyle [ gtk gdk_pixbuf ];
 
-  buildNativeInputs = [ perl pkgconfig which ];
+  nativeBuildInputs = [ perl pkgconfig which ];
 
   prefixKey = "-prefix ";
 
@@ -119,7 +123,7 @@ stdenv.mkDerivation rec {
       -no-svg
       -make qmake -make libs -nomake tools
       -nomake demos -nomake examples -nomake docs
-    '' + stdenv.lib.optionalString isMingw " -xplatform win32-g++-4.6";
+    '' + optionalString isMingw " -xplatform win32-g++-4.6";
     patches = [];
     preConfigure = ''
       sed -i -e 's/ g++/ ${stdenv.cross.config}-g++/' \
@@ -136,16 +140,15 @@ stdenv.mkDerivation rec {
     '';
     dontSetConfigureCross = true;
     dontStrip = true;
-  } // (if isMingw then
-  {
+  } // optionalAttrs isMingw {
     propagatedBuildInputs = [ ];
-  } else {});
+  };
 
-  meta = with stdenv.lib; {
-    homepage = http://qt.nokia.com/products;
+  meta = {
+    homepage = http://qt-project.org/;
     description = "A cross-platform application framework for C++";
     license = "GPL/LGPL";
-    maintainers = with maintainers; [ urkud sander ];
+    maintainers = with maintainers; [ urkud sander phreedom ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff b/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff
index 9823d649365..fe691996277 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff
+++ b/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff
@@ -1,5 +1,27 @@
---- a/src/gui/painting/qcups.cpp	2011-12-08 09:06:02.000000000 +0400
-+++ b/src/gui/painting/qcups.cpp	2011-12-18 12:17:07.000000000 +0400
+diff -ru qt-everywhere-opensource-src-4.8.3-orig/src/corelib/tools/qlocale_icu.cpp qt-everywhere-opensource-src-4.8.3/src/corelib/tools/qlocale_icu.cpp
+--- qt-everywhere-opensource-src-4.8.3-orig/src/corelib/tools/qlocale_icu.cpp	2012-09-10 21:36:50.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.3/src/corelib/tools/qlocale_icu.cpp	2012-09-28 22:57:40.764153828 -0400
+@@ -81,7 +81,7 @@
+     if (status == NotLoaded) {
+ 
+         // resolve libicui18n
+-        QLibrary lib(QLatin1String("icui18n"), QLatin1String(U_ICU_VERSION_SHORT));
++        QLibrary lib(QLatin1String("@icu@/lib/libicui18n"), QLatin1String(U_ICU_VERSION_SHORT));
+         lib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+         if (!lib.load()) {
+             qWarning() << "Unable to load library icui18n" << lib.errorString();
+@@ -111,7 +111,7 @@
+         }
+ 
+         // resolve libicuuc
+-        QLibrary ucLib(QLatin1String("icuuc"), QLatin1String(U_ICU_VERSION_SHORT));
++        QLibrary ucLib(QLatin1String("@icu@/lib/libicuuc"), QLatin1String(U_ICU_VERSION_SHORT));
+         ucLib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+         if (!ucLib.load()) {
+             qWarning() << "Unable to load library icuuc" << ucLib.errorString();
+diff -ru qt-everywhere-opensource-src-4.8.3-orig/src/gui/painting/qcups.cpp qt-everywhere-opensource-src-4.8.3/src/gui/painting/qcups.cpp
+--- qt-everywhere-opensource-src-4.8.3-orig/src/gui/painting/qcups.cpp	2012-09-10 21:36:51.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.3/src/gui/painting/qcups.cpp	2012-09-28 18:08:26.600720491 -0400
 @@ -87,7 +87,7 @@
  
  static void resolveCups()
@@ -9,8 +31,9 @@
      if(cupsLib.load()) {
          _cupsGetDests = (CupsGetDests) cupsLib.resolve("cupsGetDests");
          _cupsFreeDests = (CupsFreeDests) cupsLib.resolve("cupsFreeDests");
---- a/src/gui/painting/qprinterinfo_unix.cpp	2011-12-08 09:06:02.000000000 +0400
-+++ b/src/gui/painting/qprinterinfo_unix.cpp	2011-12-23 16:22:15.000000000 +0400
+diff -ru qt-everywhere-opensource-src-4.8.3-orig/src/gui/painting/qprinterinfo_unix.cpp qt-everywhere-opensource-src-4.8.3/src/gui/painting/qprinterinfo_unix.cpp
+--- qt-everywhere-opensource-src-4.8.3-orig/src/gui/painting/qprinterinfo_unix.cpp	2012-09-10 21:36:51.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.3/src/gui/painting/qprinterinfo_unix.cpp	2012-09-28 18:08:26.601720488 -0400
 @@ -454,7 +454,7 @@
      char *domain;
      int err;
@@ -20,39 +43,21 @@
      typedef int (*ypGetDefaultDomain)(char **);
      ypGetDefaultDomain _ypGetDefaultDomain = (ypGetDefaultDomain)lib.resolve("yp_get_default_domain");
      typedef int (*ypAll)(const char *, const char *, const struct ypall_callback *);
---- a/src/network/kernel/qhostinfo_unix.cpp	2011-12-23 16:26:07.000000000 +0400
-+++ b/src/network/kernel/qhostinfo_unix.cpp	2011-12-23 16:25:55.000000000 +0400
+diff -ru qt-everywhere-opensource-src-4.8.3-orig/src/network/kernel/qhostinfo_unix.cpp qt-everywhere-opensource-src-4.8.3/src/network/kernel/qhostinfo_unix.cpp
+--- qt-everywhere-opensource-src-4.8.3-orig/src/network/kernel/qhostinfo_unix.cpp	2012-09-10 21:36:51.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.3/src/network/kernel/qhostinfo_unix.cpp	2012-09-28 18:08:53.186643755 -0400
 @@ -95,7 +95,7 @@
  static void resolveLibrary()
  {
  #ifndef QT_NO_LIBRARY
 -    QLibrary lib(QLatin1String("resolv"));
 +    QLibrary lib(QLatin1String("@glibc@/lib/libresolv"));
+     lib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
      if (!lib.load())
          return;
- 
---- a/src/corelib/tools/qlocale_icu.cpp	2011-12-08 09:06:03.000000000 +0400
-+++ b/src/corelib/tools/qlocale_icu.cpp	2011-12-23 16:29:15.000000000 +0400
-@@ -81,7 +81,7 @@
-     if (status == NotLoaded) {
- 
-         // resolve libicui18n
--        QLibrary lib(QLatin1String("icui18n"), QLatin1String(U_ICU_VERSION_SHORT));
-+        QLibrary lib(QLatin1String("@icu@/lib/libicui18n"), QLatin1String(U_ICU_VERSION_SHORT));
-         if (!lib.load()) {
-             qWarning() << "Unable to load library icui18n" << lib.errorString();
-             status = ErrorLoading;
-@@ -110,7 +110,7 @@
-         }
- 
-         // resolve libicuuc
--        QLibrary ucLib(QLatin1String("icuuc"), QLatin1String(U_ICU_VERSION_SHORT));
-+        QLibrary ucLib(QLatin1String("@icu@/lib/libicuuc"), QLatin1String(U_ICU_VERSION_SHORT));
-         if (!ucLib.load()) {
-             qWarning() << "Unable to load library icuuc" << ucLib.errorString();
-             status = ErrorLoading;
---- a/src/plugins/platforms/xlib/qxlibstatic.cpp	2011-12-08 09:06:02.000000000 +0400
-+++ b/src/plugins/platforms/xlib/qxlibstatic.cpp	2011-12-23 20:38:49.000000000 +0400
+diff -ru qt-everywhere-opensource-src-4.8.3-orig/src/plugins/platforms/xlib/qxlibstatic.cpp qt-everywhere-opensource-src-4.8.3/src/plugins/platforms/xlib/qxlibstatic.cpp
+--- qt-everywhere-opensource-src-4.8.3-orig/src/plugins/platforms/xlib/qxlibstatic.cpp	2012-09-10 21:36:51.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.3/src/plugins/platforms/xlib/qxlibstatic.cpp	2012-09-28 18:08:26.601720488 -0400
 @@ -242,7 +242,7 @@
  }
  
diff --git a/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff b/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff
index 522676a2b31..a1c9238be1a 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff
+++ b/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff
@@ -1,15 +1,17 @@
---- a/src/gui/styles/qgtkstyle_p.cpp	2011-12-08 09:06:02.000000000 +0400
-+++ b/src/gui/styles/qgtkstyle_p.cpp	2011-12-24 17:56:46.000000000 +0400
-@@ -312,7 +312,7 @@
+diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
+index 3b128e6..39434db 100644
+--- a/src/gui/styles/qgtkstyle_p.cpp
++++ b/src/gui/styles/qgtkstyle_p.cpp
+@@ -312,7 +312,7 @@ GtkStyle* QGtkStylePrivate::gtkStyle(const QHashableLatin1Literal &path)
  void QGtkStylePrivate::resolveGtk() const
  {
      // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
 -    QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
 +    QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
+     libgtk.setLoadHints(QLibrary::ImprovedSearchHeuristics);
  
      gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
-     gtk_window_new = (Ptr_gtk_window_new)libgtk.resolve("gtk_window_new");
-@@ -434,8 +434,8 @@
+@@ -435,8 +435,8 @@ void QGtkStylePrivate::resolveGtk() const
      pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
      pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
  
@@ -20,7 +22,7 @@
  }
  
  /* \internal
-@@ -607,9 +607,9 @@
+@@ -608,9 +608,9 @@ void QGtkStylePrivate::cleanupGtkWidgets()
  static bool resolveGConf()
  {
      if (!QGtkStylePrivate::gconf_client_get_default) {
diff --git a/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch b/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch
new file mode 100644
index 00000000000..4593c1b4ba8
--- /dev/null
+++ b/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch
@@ -0,0 +1,12 @@
+diff -Naur qt-everywhere-opensource-src-4.8.2-orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h qt-everywhere-opensource-src-4.8.2/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+--- qt-everywhere-opensource-src-4.8.2-orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h	2012-04-26 15:46:22.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.2/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h	2012-07-14 22:47:02.145152876 -0400
+@@ -89,7 +89,7 @@
+ #include <pthread.h>
+ #elif PLATFORM(GTK)
+ #include <wtf/gtk/GOwnPtr.h>
+-typedef struct _GMutex GMutex;
++typedef union _GMutex GMutex;
+ typedef struct _GCond GCond;
+ #endif
+ 
diff --git a/pkgs/development/libraries/rstore-support/default.nix b/pkgs/development/libraries/rstore-support/default.nix
index 95c6d0a0b52..c18f52e84d7 100644
--- a/pkgs/development/libraries/rstore-support/default.nix
+++ b/pkgs/development/libraries/rstore-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/science/biology/bioconductor/bioconductor.nix b/pkgs/development/libraries/science/biology/bioconductor/bioconductor.nix
deleted file mode 100644
index d48511cead3..00000000000
--- a/pkgs/development/libraries/science/biology/bioconductor/bioconductor.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{stdenv, fetchurl, rLang}:
-
-let
-
-  /* Function to compile Bioconductor packages */
-
-  buildBioConductor =
-    { pname, pver, src, postInstall ? ""}:
-
-    stdenv.mkDerivation {
-      name = "${pname}-${pver}";
-
-      inherit src;
-
-      buildInputs = [rLang];
-
-      # dontAddPrefix = true;
-
-      # preBuild = "makeFlagsArray=(dictdir=$out/lib/aspell datadir=$out/lib/aspell)";
-
-      inherit postInstall;
-      installPhase = ''
-        R CMD INSTALL ${affyioSrc}
-      '';
-
-      meta = {
-        description = "Bioconductor package for ${pname}";
-      };
-    };
-
-in {
-
-   affyio = buildBioC {
-     pname = "affyio";
-     pver  = "1.8.1";
-     src = fetchurl {
-       url = http://www.bioconductor.org/packages/release/bioc/src/contrib/affyio_1.8.1.tar.gz;
-       sha256 = "136nkpq870vrwf9z5gq32xjzrp8bjfbk9pn8fki2a5w2lr0qc8nh";
-     };
-  };
-
-    
-}
diff --git a/pkgs/development/libraries/science/biology/biolib/default.nix b/pkgs/development/libraries/science/biology/biolib/default.nix
index f9de62e7cfa..b12366c0142 100644
--- a/pkgs/development/libraries/science/biology/biolib/default.nix
+++ b/pkgs/development/libraries/science/biology/biolib/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, cmake, rLang, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "biolib";
+  name = "biolib-${version}";
   
   version = "0.0.1";
   
diff --git a/pkgs/development/libraries/science/math/atlas/default.nix b/pkgs/development/libraries/science/math/atlas/default.nix
index 2cca8d7d9c4..9aab09094a0 100644
--- a/pkgs/development/libraries/science/math/atlas/default.nix
+++ b/pkgs/development/libraries/science/math/atlas/default.nix
@@ -1,50 +1,65 @@
-{ stdenv, fetchurl, gfortran, tolerateCpuTimingInaccuracy ? true, shared ? false }:
+{ stdenv, fetchurl, gfortran, tolerateCpuTimingInaccuracy ? true, shared ? false
+, cpuConfig ? if stdenv.isi686 then "-b 32 -A 18 -V 1" else "-b 64 -A 31 -V 192"
+}:
+
+# Atlas detects the CPU and optimizes its build accordingly. This is great when
+# the code is run on the same machine that built the binary, but in case of a
+# central build farm like Hydra, this feature is dangerous because the code may
+# be generated utilizing fancy features that users who download the binary
+# cannot execute.
+#
+# To avoid these issues, the build is configured using the 'cpuConfig'
+# parameter as follows:
+#
+#   | x86 CPU                                     | x86_64 CPU             |
+#   |---------------------------------------------+------------------------|
+#   | -b 32                                       | -b 64                  |
+#   | -A 18  (Pentium II)                         | -A 31 (Athlon K7)      |
+#   | -V 1 (No SIMD: Pentium II doesn't have SSE) | -V 192 (SSE1 and SSE2) |
+#
+# Users who want to compile a highly optimized version of ATLAS that's suitable
+# for their local machine can override these settings accordingly.
 
 let
+  version = "3.10.1";
+
   optionalString = stdenv.lib.optionalString;
+  optional = stdenv.lib.optional;
 in
 
 stdenv.mkDerivation {
-  name = "atlas-3.9.67";
+  name = "atlas-${version}";
 
   src = fetchurl {
-    url = mirror://sf/math-atlas/atlas3.9.67.tar.bz2;
-    sha256 = "06xxlv440z8a3qmfrh17p28girv71c6awvpw5vhpspr0pcsgk1pa";
+    url = "mirror://sourceforge/math-atlas/atlas${version}.tar.bz2";
+    sha256 = "11ncgdc7kzb2y2gqb3sgarm5saj9fr07r3h2yh2h5bja429b85d2";
   };
 
+  buildInputs = [ gfortran ];
+
+  # Atlas aborts the build if it detects that some kind of CPU frequency
+  # scaling is active on the build machine because that feature offsets the
+  # performance timings. We ignore that check, however, because with binaries
+  # being pre-built on Hydra those timings aren't accurate for the local
+  # machine in the first place.
+  patches = optional tolerateCpuTimingInaccuracy ./disable-timing-accuracy-check.patch;
+
   # Configure outside of the source directory.
   preConfigure = '' mkdir build; cd build; configureScript=../configure; '';
 
-  # * -fPIC allows to build atlas inside shared objects, as octave does.
+  # * -fPIC is passed even in non-shared builds so that the ATLAS code can be
+  #   used to inside of shared libraries, like Octave does.
   #
-  # * Atlas aborts the build if it detects that some kind of CPU frequency
-  #   scaling is active on the build machine because that feature offsets the
-  #   performance timings. We ignore that check, however, because with binaries
-  #   being pre-built on Hydra those timings aren't accurate for the local
-  #   machine in the first place.
-  # * Atlas detects the cpu and does some tricks. For example, notices the
-  #   hydra AMD Family 10h computer, and uses a SSE trick for it (bit 17 of MXCSR)
-  #   available, for what I know, only in that family. So we hardcode K7
-  #     -A 31 = Athlon K7
-  #     -A 18 = Pentium II
-  #     -V 192 = SSE1|SSE2 (Or it takes SSE3 somehow in my machine without SSE3)
-  #     -V 1 = No SIMD (Pentium II does not have any SSE)
-  #     -t 0 = No threading
-  configureFlags = "-Fa alg -fPIC -t 0"
-    + optionalString stdenv.isi686 " -b 32 -A 18 -V 1"
-    + optionalString stdenv.isx86_64 " -A 31 -V 192"
-    + optionalString tolerateCpuTimingInaccuracy " -Si cputhrchk 0"
-    + optionalString shared " --shared "
-    ;
-
-  buildInputs = [ gfortran ];
+  # * -t 0 disables use of multi-threading. It's not quite clear what the
+  #   consequences of that setting are and whether it's necessary or not.
+  configureFlags = "-Fa alg -fPIC -t 0 ${cpuConfig}" + optionalString shared " --shared";
 
   doCheck = true;
 
   meta = {
     homepage = "http://math-atlas.sourceforge.net/";
     description = "Automatically Tuned Linear Algebra Software (ATLAS)";
-    license = "GPL";
+    license = stdenv.lib.licenses.bsd3;
 
     longDescription = ''
       The ATLAS (Automatically Tuned Linear Algebra Software) project is an ongoing
diff --git a/pkgs/development/libraries/science/math/atlas/disable-timing-accuracy-check.patch b/pkgs/development/libraries/science/math/atlas/disable-timing-accuracy-check.patch
new file mode 100644
index 00000000000..ddacc742d14
--- /dev/null
+++ b/pkgs/development/libraries/science/math/atlas/disable-timing-accuracy-check.patch
@@ -0,0 +1,22 @@
+diff -ubr ATLAS-orig/CONFIG/src/config.c ATLAS/CONFIG/src/config.c
+--- ATLAS-orig/CONFIG/src/config.c	2013-02-06 11:23:47.078036878 +0100
++++ ATLAS/CONFIG/src/config.c	2013-02-06 11:24:16.481120888 +0100
+@@ -711,17 +711,7 @@
+ 
+ int ProbeCPUThrottle(int verb, char *targarg, enum OSTYPE OS, enum ASMDIA asmb)
+ {
+-   int i, iret;
+-   char *ln;
+-   i = strlen(targarg) + 22 + 12;
+-   ln = malloc(i*sizeof(char));
+-   assert(ln);
+-   sprintf(ln, "%s -O %d -s %d -t", targarg, OS, asmb);
+-   iret = GetIntProbe(verb, ln, "arch", "CPU THROTTLE", 0);
+-   free(ln);
+-   if (iret) printf("CPU Throttling apparently enabled!\n");
+-   else printf("Cannot detect CPU throttling.\n");
+-   return(iret);
++   return 0;
+ }
+ 
+ char *NewAppendedString_SFLAG(char *old, char *flag, char *str)
diff --git a/pkgs/development/libraries/science/math/blas/default.nix b/pkgs/development/libraries/science/math/blas/default.nix
index 55654586edd..7066ebad87c 100644
--- a/pkgs/development/libraries/science/math/blas/default.nix
+++ b/pkgs/development/libraries/science/math/blas/default.nix
@@ -32,10 +32,14 @@ stdenv.mkDerivation {
     echo >>make.inc "RANLIB = ranlib"
     make
   '';
- 
-  installPhase = ''
-    install -D -m755 libblas.a "$out/lib/libblas.a"
-    install -D -m755 libblas.so.3.0.3 "$out/lib/libblas.so.3.0.3"
+
+  installPhase =
+    # FreeBSD's stdenv doesn't use Coreutils.
+    let dashD = if stdenv.isFreeBSD then "" else "-D"; in
+    (stdenv.lib.optionalString stdenv.isFreeBSD "mkdir -p $out/lib ;")
+    + ''
+    install ${dashD} -m755 libblas.a "$out/lib/libblas.a"
+    install ${dashD} -m755 libblas.so.3.0.3 "$out/lib/libblas.so.3.0.3"
     ln -s libblas.so.3.0.3 "$out/lib/libblas.so.3"
     ln -s libblas.so.3.0.3 "$out/lib/libblas.so"
   '';
diff --git a/pkgs/development/libraries/science/math/liblapack/default.nix b/pkgs/development/libraries/science/math/liblapack/default.nix
index 9f25011b76f..029deecb93a 100644
--- a/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ atlasMaybeShared ];
   buildInputs = [ gfortran cmake ];
-  buildNativeInputs = [ python ];
+  nativeBuildInputs = [ python ];
 
   cmakeFlags = [
     "-DUSE_OPTIMIZED_BLAS=ON"
diff --git a/pkgs/development/libraries/sdf-support/default.nix b/pkgs/development/libraries/sdf-support/default.nix
index 0604a099d3c..8095650b12f 100644
--- a/pkgs/development/libraries/sdf-support/default.nix
+++ b/pkgs/development/libraries/sdf-support/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
 
   buildInputs = [aterm toolbuslib errorSupport ptSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/serd/default.nix b/pkgs/development/libraries/serd/default.nix
index 8deb26abc1d..63733a35b20 100644
--- a/pkgs/development/libraries/serd/default.nix
+++ b/pkgs/development/libraries/serd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "serd-${version}";
-  version = "0.14.0";
+  version = "0.18.2";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "023gsw0nwn2fh2vp7v2gwsmdwk6658zfl1ihdvr9xbayfcv88wlg";
+    sha256 = "1hgajhm4iar4n2kh71pv6yr0yhipj28kds9y5mbig8izqc188gcf";
   };
 
   buildInputs = [ pcre pkgconfig python ];
diff --git a/pkgs/development/libraries/sglr/default.nix b/pkgs/development/libraries/sglr/default.nix
index 449667c6b52..f6c14eae464 100644
--- a/pkgs/development/libraries/sglr/default.nix
+++ b/pkgs/development/libraries/sglr/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib cLibrary configSupport ptSupport ptableSupport errorSupport];
-  buildNativeInputs = [pkgconfig];  
+  nativeBuildInputs = [pkgconfig];  
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/simgear/default.nix b/pkgs/development/libraries/simgear/default.nix
index 961d1475333..de8e1d1df1d 100644
--- a/pkgs/development/libraries/simgear/default.nix
+++ b/pkgs/development/libraries/simgear/default.nix
@@ -1,23 +1,23 @@
 x@{builderDefsPackage
   , plib, freeglut, xproto, libX11, libXext, xextproto, libXi , inputproto
   , libICE, libSM, libXt, libXmu, mesa, boost, zlib, libjpeg , freealut
-  , openscenegraph, openal
+  , openscenegraph, openal, expat, cmake
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    baseName="SimGear";
-    version="2.0.0";
+    baseName="simgear";
+    version="2.10.0";
     name="${baseName}-${version}";
-    extension="tar.gz";
-    url="ftp://ftp.goflyflightgear.com/simgear/Source/${name}.${extension}";
-    hash="08fia5rjrlvw45i3v09fn90vhdhb54wjl6kn3d8vpspxmsw4fn55";
+    extension="tar.bz2";
+    url="http://mirrors.ibiblio.org/pub/mirrors/simgear/ftp/Source/${name}.${extension}";
+    hash="0pb148hb35p1c5iz0kpiclmswjl9bax9xfm087ldpxsqg9a0sb2q";
   };
 in
 rec {
@@ -30,8 +30,8 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
+  phaseNames = [ "doCmake" "doMakeInstall" ];
+
   meta = {
     description = "Simulation construction toolkit";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/smpeg/default.nix b/pkgs/development/libraries/smpeg/default.nix
index 3e7baf77df8..e259e22ff01 100644
--- a/pkgs/development/libraries/smpeg/default.nix
+++ b/pkgs/development/libraries/smpeg/default.nix
@@ -10,11 +10,13 @@ stdenv.mkDerivation rec {
     sha256 = "0ynwn7ih5l2b1kpzpibns9bb9wzfjak7mgrb1ji0dkn2q5pv6lr0";
   };
 
+  enableParallelBuilding = true;
+
   buildInputs = [ SDL autoconf automake libtool gtk m4 pkgconfig mesa ];
 
   preConfigure = ''
     touch NEWS AUTHORS ChangeLog
-    autoreconf -fvi -I acinclude
+    sh autogen.sh
   '';
 
   postInstall = ''
diff --git a/pkgs/development/libraries/snappy/default.nix b/pkgs/development/libraries/snappy/default.nix
new file mode 100644
index 00000000000..ff1bfa7d4eb
--- /dev/null
+++ b/pkgs/development/libraries/snappy/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "snappy-1.1.0";
+  
+  src = fetchurl {
+    url = "http://snappy.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0q31cx3zkw0apx1fy8z3xlh2lvivssvykqn0vxsgm4xvi32jpa0z";
+  };
+
+  # -DNDEBUG for speed
+  preConfigure = ''
+    configureFlagsArray=("CXXFLAGS=-DNDEBUG -O2")
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = http://code.google.com/p/snappy/;
+    license = "BSD";
+    description = "Compression/decompression library for very high speeds";
+  };
+}
diff --git a/pkgs/development/libraries/sodium/default.nix b/pkgs/development/libraries/sodium/default.nix
new file mode 100644
index 00000000000..0d40df40574
--- /dev/null
+++ b/pkgs/development/libraries/sodium/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="sodium";
+    version="0.3";
+    name="${baseName}-${version}";
+    hash="0l1p0d7ag186hhs65kifp8jfgf4mm9rngv41bhq35d7d9gw2d2lh";
+    url="http://download.dnscrypt.org/libsodium/releases/libsodium-0.3.tar.gz";
+    sha256="0l1p0d7ag186hhs65kifp8jfgf4mm9rngv41bhq35d7d9gw2d2lh";
+  };
+  buildInputs = [
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  meta = {
+    inherit (s) version;
+    description = ''A cryptography library with simple API'';
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/sodium/default.upstream b/pkgs/development/libraries/sodium/default.upstream
new file mode 100644
index 00000000000..ccc02cd8978
--- /dev/null
+++ b/pkgs/development/libraries/sodium/default.upstream
@@ -0,0 +1 @@
+url http://download.dnscrypt.org/libsodium/releases/
diff --git a/pkgs/development/libraries/sofia-sip/default.nix b/pkgs/development/libraries/sofia-sip/default.nix
index 3ce49e8ffaf..950d1302dad 100644
--- a/pkgs/development/libraries/sofia-sip/default.nix
+++ b/pkgs/development/libraries/sofia-sip/default.nix
@@ -9,5 +9,5 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ glib openssl ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 }
diff --git a/pkgs/development/libraries/soprano/default.nix b/pkgs/development/libraries/soprano/default.nix
index 54e40efe65e..8ca16ff72c7 100644
--- a/pkgs/development/libraries/soprano/default.nix
+++ b/pkgs/development/libraries/soprano/default.nix
@@ -2,11 +2,11 @@
 , pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "soprano-2.7.6";
+  name = "soprano-2.9.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/soprano/${name}.tar.bz2";
-    sha256 = "0cnprxc8wykl96aphsh2d3711h7cals7gnibbxpsmsqyqbnhbp98";
+    sha256 = "105xlng1ka0661gk2ap39rjjy7znp670df0c5569x04vppgd45g1";
   };
 
   patches = [ ./find-virtuoso.patch ];
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   # We disable the Java backend, since we do not need them and they make the closure size much bigger
   buildInputs = [ qt4 clucene_core librdf_redland libiodbc ];
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
 
   meta = {
     homepage = http://soprano.sourceforge.net/;
diff --git a/pkgs/development/libraries/soqt/default.nix b/pkgs/development/libraries/soqt/default.nix
index 60b148f870e..7d655ae122a 100644
--- a/pkgs/development/libraries/soqt/default.nix
+++ b/pkgs/development/libraries/soqt/default.nix
@@ -5,13 +5,13 @@ stdenv.mkDerivation rec {
   version = "1.5.0";
 
   src = fetchurl {
-    url = "http://ftp.coin3d.org/coin/src/all/SoQt-${version}.tar.gz";
+    url = "https://bitbucket.org/Coin3D/coin/downloads/SoQt-${version}.tar.gz";
     sha256 = "14dbh8ynzjcgwgxjc6530c5plji7vn62kbdf447w0dp53564p8zn";
   };
 
   buildInputs = [ coin3d qt4 ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.coin3d.org/;
diff --git a/pkgs/development/libraries/sord/default.nix b/pkgs/development/libraries/sord/default.nix
index ee9d241424c..0f2326420cb 100644
--- a/pkgs/development/libraries/sord/default.nix
+++ b/pkgs/development/libraries/sord/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "sord-${version}";
-  version = "0.8.0";
+  version = "0.12.0";
 
   src = fetchurl {
     url = "http://download.drobilla.net/${name}.tar.bz2";
-    sha256 = "0ncaplfr3wal9h8h3lafw0bhx34w046r7md74djgrysrm2h77pwr";
+    sha256 = "1f0wz7ynnk72hyr4jfi0lgvj90ld2va1kig8fkw30s8b903alsqj";
   };
 
   buildInputs = [ pkgconfig python serd ];
diff --git a/pkgs/development/libraries/spandsp/default.nix b/pkgs/development/libraries/spandsp/default.nix
new file mode 100644
index 00000000000..f88ab48e027
--- /dev/null
+++ b/pkgs/development/libraries/spandsp/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl, audiofile, libtiff}:
+stdenv.mkDerivation rec {
+  version = "0.0.5";
+  name = "spandsp-${version}";
+  src=fetchurl {
+    url = "http://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tgz";
+    sha256 = "07f42a237c77b08fa765c3a148c83cdfa267bf24c0ab681d80b90d30dd0b3dbf";
+  };
+  buildInputs = [];
+  propagatedBuildInputs = [audiofile libtiff];
+  meta = {
+    homepage = "http://www.creytiv.com/baresip.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; gpl2;
+  };
+}
+
diff --git a/pkgs/development/libraries/spice-protocol/default.nix b/pkgs/development/libraries/spice-protocol/default.nix
new file mode 100644
index 00000000000..25f42275644
--- /dev/null
+++ b/pkgs/development/libraries/spice-protocol/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "spice-protocol-0.12.2";
+
+  src = fetchurl {
+    url = "http://www.spice-space.org/download/releases/${name}.tar.bz2";
+    sha256 = "0v6msf6gbl8g69qamp97dggz148zpc3ncbfgbq3b472wszjdkclb";
+  };
+
+  meta = {
+    description = "Protocol headers for the SPICE protocol.";
+    homepage = http://www.spice-space.org;
+    license = stdenv.lib.licenses.bsd3;
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
new file mode 100644
index 00000000000..2bcb9e593b8
--- /dev/null
+++ b/pkgs/development/libraries/spice/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, pkgconfig, pixman, celt, alsaLib, openssl
+, libXrandr, libXfixes, libXext, libXrender, libXinerama, libjpeg, zlib
+, spice_protocol, python, pyparsing }:
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "spice-0.12.0";
+
+  src = fetchurl {
+    url = "http://www.spice-space.org/download/releases/${name}.tar.bz2";
+    sha256 = "15mp6nz467h4l5jg3vk51si6r5w7g329jvsy61f2gl3yabwcxmva";
+  };
+
+  buildInputs = [ pixman celt alsaLib openssl libjpeg zlib
+                  libXrandr libXfixes libXrender libXext libXinerama
+                  python pyparsing ];
+
+  nativeBuildInputs = [ pkgconfig spice_protocol ];
+
+  NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+
+  configureFlags = [
+    "--with-sasl=no"
+    "--disable-smartcard"
+  ];
+
+  postInstall = ''
+    ln -s spice-server $out/include/spice
+  '';
+
+  meta = {
+    description = "Complete open source solution for interaction with virtualized desktop devices";
+    longDescription = ''
+      The Spice project aims to provide a complete open source solution for interaction
+      with virtualized desktop devices.The Spice project deals with both the virtualized
+      devices and the front-end. Interaction between front-end and back-end is done using
+      VD-Interfaces. The VD-Interfaces (VDI) enable both ends of the solution to be easily
+      utilized by a third-party component.
+    '';
+    homepage = http://www.spice-space.org/;
+    license = licenses.lgpl21;
+
+    maintainers = [ maintainers.bluescreen303 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/3.7.14.nix
index de154964fe5..be3a24c1e4c 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/3.7.14.nix
@@ -3,15 +3,15 @@
 assert readline != null -> ncurses != null;
 
 stdenv.mkDerivation {
-  name = "sqlite-3.7.13";
+  name = "sqlite-3.7.14.1";
 
   src = fetchurl {
-    url = http://www.sqlite.org/sqlite-autoconf-3071300.tar.gz;
-    sha1 = "d3833b6ad68db8505d1044f761dd962f415cd302";
+    url = http://www.sqlite.org/sqlite-autoconf-3071401.tar.gz;
+    sha1 = "c464e0e3efe98227c6546b9b1e786b51b8b642fc";
   };
 
   buildInputs = [ readline ncurses ];
-  
+
   configureFlags = "--enable-threadsafe";
 
   CFLAGS = "-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1";
diff --git a/pkgs/development/libraries/sqlite/3.6.x.nix b/pkgs/development/libraries/sqlite/3.7.16.nix
index 6a1c02dede1..231f4e5d69c 100644
--- a/pkgs/development/libraries/sqlite/3.6.x.nix
+++ b/pkgs/development/libraries/sqlite/3.7.16.nix
@@ -3,18 +3,19 @@
 assert readline != null -> ncurses != null;
 
 stdenv.mkDerivation {
-  name = "sqlite-3.6.23.1";
+  name = "sqlite-3.7.16.2";
 
   src = fetchurl {
-    url = "http://www.sqlite.org/sqlite-amalgamation-3.6.23.1.tar.gz";
-    sha256 = "0n1maahlqxk7p6kmsv0v2afy6qbv15n85mgkr4ylbf3ghcjdg06h";
+    url = http://www.sqlite.org/2013/sqlite-autoconf-3071602.tar.gz;
+    sha1 = "85bf857cf86f34831d55d7ba97606dba581b8d62";
   };
 
-  buildInputs = [readline ncurses];
+  buildInputs = [ readline ncurses ];
+
   configureFlags = "--enable-threadsafe";
 
-  NIX_CFLAGS_COMPILE = "-DSQLITE_ENABLE_COLUMN_METADATA=1";
-  NIX_CFLAGS_LINK = if readline != null then "-lncurses" else "";
+  CFLAGS = "-DSQLITE_ENABLE_COLUMN_METADATA=1 -DSQLITE_SECURE_DELETE=1 -DSQLITE_ENABLE_UNLOCK_NOTIFY=1";
+  LDFLAGS = if readline != null then "-lncurses" else "";
 
   meta = {
     homepage = http://www.sqlite.org/;
diff --git a/pkgs/development/libraries/sqlite/full.nix b/pkgs/development/libraries/sqlite/3.7.9-full.nix
index ccb960643bd..c6ef448ea12 100644
--- a/pkgs/development/libraries/sqlite/full.nix
+++ b/pkgs/development/libraries/sqlite/3.7.9-full.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ readline ncurses ];
-  buildNativeInputs = [ tcl ];
+  nativeBuildInputs = [ tcl ];
 
   doCheck = true;
   checkTarget = "test";
diff --git a/pkgs/development/libraries/srtp/default.nix b/pkgs/development/libraries/srtp/default.nix
index 887c0c7c1a3..1b8b654ca80 100644
--- a/pkgs/development/libraries/srtp/default.nix
+++ b/pkgs/development/libraries/srtp/default.nix
@@ -27,8 +27,12 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
+  phaseNames = ["setVars" "doConfigure" "doMakeInstall"];
+
+  setVars = a.fullDepEntry ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
+  '' ["minInit"];
+
   meta = {
     description = "Secure RTP";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/development/libraries/stlport/default.nix b/pkgs/development/libraries/stlport/default.nix
index 040395ecf8a..f1c8a84fee2 100644
--- a/pkgs/development/libraries/stlport/default.nix
+++ b/pkgs/development/libraries/stlport/default.nix
@@ -1,10 +1,25 @@
 {stdenv, fetchurl}:
 
-stdenv.mkDerivation {
-  name = "STLport-5.2.0";
+stdenv.mkDerivation rec {
+  name = "STLport-5.2.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/stlport/STLport-5.2.0.tar.bz2;
-    md5 = "448d74859407912c0087adcf51bf109a";
+    url = "mirror://sourceforge/stlport/${name}.tar.bz2";
+    sha256 = "1jbgak1m1qk7d4gyn1p2grbws2icsf7grbs3dh44ai9ck1xh0nvm";
+  };
+
+  # fix hardcoded /usr/bin; not recognizing the standard --disable-static flag
+  configurePhase = ''
+    echo Preconf: build/Makefiles/gmake/*/sys.mak
+    for f in build/Makefiles/gmake/*/sys.mak; do
+      substituteInPlace "$f" --replace /usr/bin/ ""
+    done
+    ./configure --prefix=$out
+  '';
+
+  meta = {
+    description = "An implementation of the C++ Standard Library";
+    homepage = http://sourceforge.net/projects/stlport/;
+    license = "free"; # seems BSD-like
   };
 }
diff --git a/pkgs/development/libraries/strigi/default.nix b/pkgs/development/libraries/strigi/default.nix
index 6d7212f5c5c..fc8dc123032 100644
--- a/pkgs/development/libraries/strigi/default.nix
+++ b/pkgs/development/libraries/strigi/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   name = "strigi-${version}";
-  version = "0.7.5";
+  version = "0.7.8";
 
   src = fetchurl {
     url = "http://www.vandenoever.info/software/strigi/${name}.tar.bz2";
-    sha256 = "16qqnlh0dy3r92shzm2q36h5qi3m06pihr4h5cq944hpvqz5w7qi";
+    sha256 = "12grxzqwnvbyqw7q1gnz42lypadxmq89vk2qpxczmpmc4nk63r23";
   };
   
   includeAllQtDirs = true;
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ zlib bzip2 stdenv.gcc.libc libxml2 qt4 exiv2 clucene_core fam dbus_tools ];
 
-  buildNativeInputs = [ cmake pkgconfig perl ];
+  nativeBuildInputs = [ cmake pkgconfig perl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/taglib-extras/default.nix b/pkgs/development/libraries/taglib-extras/default.nix
index de0c7ba2b75..05fe67eb9d7 100644
--- a/pkgs/development/libraries/taglib-extras/default.nix
+++ b/pkgs/development/libraries/taglib-extras/default.nix
@@ -7,5 +7,5 @@ stdenv.mkDerivation rec {
     sha256 = "0cln49ws9svvvals5fzxjxlzqm0fzjfymn7yfp4jfcjz655nnm7y";
   };
   buildInputs = [ taglib ];
-  buildNativeInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 }
diff --git a/pkgs/development/libraries/taglib/default.nix b/pkgs/development/libraries/taglib/default.nix
index 8157ca269aa..cd083f0d80a 100644
--- a/pkgs/development/libraries/taglib/default.nix
+++ b/pkgs/development/libraries/taglib/default.nix
@@ -1,17 +1,17 @@
 {stdenv, fetchurl, zlib, cmake}:
 
 stdenv.mkDerivation rec {
-  name = "taglib-1.7.1";
-  
+  name = "taglib-1.8";
+
   src = fetchurl {
     url = "https://github.com/downloads/taglib/taglib/${name}.tar.gz";
-    sha256 = "1nc7zd9jxx5gw4n6zqgvjh0wxlm89ihcyyrzk2rbf15njw4lgpjj";
+    sha256 = "16i0zjpxqqslbwi4kl6y15qwm15mh7ykh74x19m2741wf20k9lv6";
   };
-  
+
   cmakeFlags = "-DWITH_ASF=ON -DWITH_MP4=ON";
 
   buildInputs = [zlib];
-  buildNativeInputs = [cmake];
+  nativeBuildInputs = [cmake];
 
   meta = {
     homepage = http://developer.kde.org/~wheeler/taglib.html;
diff --git a/pkgs/development/libraries/taglib/live.nix b/pkgs/development/libraries/taglib/live.nix
deleted file mode 100644
index 35af2ff5195..00000000000
--- a/pkgs/development/libraries/taglib/live.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{stdenv, fetchsvn, fetchsvnrevision, zlib, cmake
-, repository ? "svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib"
-, rev ? fetchsvnrevision repository
-, src ? fetchsvn {
-    url = repository;
-    rev = rev;
-  }
-}:
-
-stdenv.mkDerivation {
-  name = "taglib-live";
-
-  inherit src;
-
-  cmakeFlags = [ "-DWITH-ASF=ON" "-DWITH-MP4=ON" ];
-
-  buildInputs = [ zlib cmake ];
-
-  meta = {
-    homepage = http://developer.kde.org/~wheeler/taglib.html;
-    description = "A library for reading and editing the meta-data of several popular audio formats";
-  };
-}
diff --git a/pkgs/development/libraries/tclgpg/default.nix b/pkgs/development/libraries/tclgpg/default.nix
new file mode 100644
index 00000000000..d8bea7f14e3
--- /dev/null
+++ b/pkgs/development/libraries/tclgpg/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchsvn, autoconf, automake, tcl, tcllib, gnupg }:
+
+stdenv.mkDerivation rec {
+  name = "tclgpg-${version}";
+  version = "1.0pre";
+
+  src = fetchsvn {
+    url = "http://tclgpg.googlecode.com/svn/trunk";
+    rev = 74;
+    sha256 = "5207b1d246fea6d4527e8c044579dae45a2e31eeaa5633f4f97c7e7b54ec27c5";
+  };
+
+  configureFlags = "--with-tcl=" + tcl + "/lib "
+                 + "--with-tclinclude=" + tcl + "/include ";
+
+  preConfigure = ''
+    configureFlags="--exec_prefix=$prefix $configureFlags"
+    sed -i -e 's|dtplite|TCLLIBPATH="${tcllib}/lib/tcllib${tcllib.version}" &|' Makefile.in
+    autoreconf -vfi
+  '';
+
+  prePatch = ''
+    sed -i -e 's|\[auto_execok gpg\]|"${gnupg}/bin/gpg2"|' tclgpg.tcl
+  '';
+
+  passthru = {
+    libPrefix = "gpg1.0";
+  };
+
+  buildInputs = [ autoconf automake tcl tcllib ];
+
+  meta = {
+    homepage = http://code.google.com/p/tclgpg/;
+    description = "A Tcl interface to GNU Privacy Guard";
+    license = stdenv.lib.licenses.bsd2;
+  };
+}
diff --git a/pkgs/development/libraries/tcllib/default.nix b/pkgs/development/libraries/tcllib/default.nix
index fcfbbe19d94..12bbe0914e0 100644
--- a/pkgs/development/libraries/tcllib/default.nix
+++ b/pkgs/development/libraries/tcllib/default.nix
@@ -9,5 +9,15 @@ stdenv.mkDerivation rec {
     sha256 = "11052fgfmv9vyswzjjgfvh3pi0k3fnfnl9ri6nl4vc6f6z5ry56x";
   };
 
-  buildInputs = [tcl];
+  passthru = {
+    libPrefix = "tcllib${version}";
+  };
+
+  buildInputs = [ tcl ];
+
+  meta = {
+    homepage = "http://tcl.activestate.com/software/tcllib/";
+    description = "Tcl-only library of standard routines for Tcl";
+    license = stdenv.lib.licenses.tcltk;
+  };
 }
diff --git a/pkgs/development/libraries/tcltls/default.nix b/pkgs/development/libraries/tcltls/default.nix
index dbbfc3d3855..278fed37514 100644
--- a/pkgs/development/libraries/tcltls/default.nix
+++ b/pkgs/development/libraries/tcltls/default.nix
@@ -17,5 +17,15 @@ stdenv.mkDerivation rec {
     sha256 = "adec50143a9ad634a671d24f7c7bbf2455487eb5f12d290f41797c32a98b93f3";
   };
 
-  buildInputs = [tcl openssl];
+  passthru = {
+    libPrefix = "tls${version}";
+  };
+
+  buildInputs = [ tcl openssl ];
+
+  meta = {
+    homepage = "http://tls.sourceforge.net/";
+    description = "An OpenSSL / RSA-bsafe Tcl extension";
+    license = stdenv.lib.licenses.tcltk;
+  };
 }
diff --git a/pkgs/development/libraries/tcp-wrappers/default.nix b/pkgs/development/libraries/tcp-wrappers/default.nix
deleted file mode 100644
index 14335e6a3ad..00000000000
--- a/pkgs/development/libraries/tcp-wrappers/default.nix
+++ /dev/null
@@ -1,74 +0,0 @@
-x@{builderDefsPackage
-  , flex, bison
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
-
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="tcp-wrappers";
-    version="7.6";
-    name="${baseName}-${version}";
-    url="http://ftp.porcupine.org/pub/security/tcp_wrappers_${version}.tar.gz";
-    hash="0p9ilj4v96q32klavx0phw9va21fjp8vpk11nbh6v2ppxnnxfhwm";
-  };
-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 = ["setVars" "doUnpack" "fixMakefile" "doPatch" 
-    "doMake" "doDeploy"];
-
-  patches = [./have-strerror.patch ./trivial-fixes.patch];
-
-  makeFlags = [
-    "REAL_DAEMON_DIR=$out/bin"
-    "STYLE='\"-DHAVE_STRERROR -DSYS_ERRLIST_DEFINED\"'"
-    "generic"
-  ];
-
-  setVars = a.noDepEntry ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lnsl"
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fPIC"
-  '';
-
-  fixMakefile = a.fullDepEntry ''
-    chmod u+w Makefile
-    echo 'libwrap.so: $(LIB_OBJ)' >> Makefile
-    echo '	ld $(LIB_OBJ) --shared -o libwrap.so' >> Makefile
-  '' ["minInit"];
-
-  doDeploy = a.fullDepEntry ''
-    mkdir -p "$out"/{sbin,lib}
-    make libwrap.so
-    cp libwrap.{a,so} "$out/lib"
-    find . -perm +111 -a ! -name '*.*' -exec cp '{}' "$out/sbin" ';'
-  '' ["defEnsureDir" "minInit"];
-      
-  meta = {
-    description = "Network logging TCP wrappers";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = "free-noncopyleft";
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://ftp.porcupine.org/pub/security/index.html";
-    };
-  };
-}) x
diff --git a/pkgs/development/libraries/tcp-wrappers/have-strerror.patch b/pkgs/development/libraries/tcp-wrappers/have-strerror.patch
deleted file mode 100644
index 626fce1a88a..00000000000
--- a/pkgs/development/libraries/tcp-wrappers/have-strerror.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Debian patch
-diff -ruN tcp_wrappers_7.6.orig/percent_m.c tcp_wrappers_7.6/percent_m.c
---- tcp_wrappers_7.6.orig/percent_m.c	1994-12-28 17:42:37.000000000 +0100
-+++ tcp_wrappers_7.6/percent_m.c	2003-08-21 02:45:31.000000000 +0200
-@@ -29,11 +29,15 @@
- 
-     while (*bp = *cp)
- 	if (*cp == '%' && cp[1] == 'm') {
-+#ifdef HAVE_STRERROR
-+	    strcpy(bp, strerror(errno));
-+#else
- 	    if (errno < sys_nerr && errno > 0) {
- 		strcpy(bp, sys_errlist[errno]);
- 	    } else {
- 		sprintf(bp, "Unknown error %d", errno);
- 	    }
-+#endif
- 	    bp += strlen(bp);
- 	    cp += 2;
- 	} else {
diff --git a/pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch b/pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch
deleted file mode 100644
index 1e55819f8de..00000000000
--- a/pkgs/development/libraries/tcp-wrappers/trivial-fixes.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Debian patch
-diff -ruNp tcp_wrappers_7.6.orig/options.c tcp_wrappers_7.6/options.c
---- tcp_wrappers_7.6.orig/options.c	2006-03-01 23:45:28.000000000 +0100
-+++ tcp_wrappers_7.6/options.c	2006-03-01 22:55:44.000000000 +0100
-@@ -41,6 +41,7 @@ static char sccsid[] = "@(#) options.c 1
- #include <netinet/in.h>
- #include <netdb.h>
- #include <stdio.h>
-+#include <unistd.h>
- #include <syslog.h>
- #include <pwd.h>
- #include <grp.h>
-diff -ruNp tcp_wrappers_7.6.orig/scaffold.c tcp_wrappers_7.6/scaffold.c
---- tcp_wrappers_7.6.orig/scaffold.c	2006-03-01 23:45:28.000000000 +0100
-+++ tcp_wrappers_7.6/scaffold.c	2006-03-01 22:56:13.000000000 +0100
-@@ -17,6 +17,7 @@ static char sccs_id[] = "@(#) scaffold.c
- #include <arpa/inet.h>
- #include <netdb.h>
- #include <stdio.h>
-+#include <stdlib.h>
- #include <syslog.h>
- #include <setjmp.h>
- #include <string.h>
-@@ -28,3 +28,2 @@
- 
--extern char *malloc();
-
diff --git a/pkgs/development/libraries/telepathy/farstream/default.nix b/pkgs/development/libraries/telepathy/farstream/default.nix
index a183737dc9b..a6a624c0a87 100644
--- a/pkgs/development/libraries/telepathy/farstream/default.nix
+++ b/pkgs/development/libraries/telepathy/farstream/default.nix
@@ -2,16 +2,16 @@
 , pkgconfig, libxslt, python, gstreamer, gst_python, pygobject }:
 
 stdenv.mkDerivation rec {
-  name = "${pname}-0.2.3";
+  name = "${pname}-0.4.0";
   pname = "telepathy-farstream";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
-    sha256 = "1a163gk9y3ckabm4a43lxc5a7j2s42hykbwr6r7b5mlfyqq8myx1";
+    sha256 = "13mllgfx4b1hh1vpzq8lk5qfr3ivkkkmwbxgi6d47avgk746kznd";
   };
 
   buildInputs = [ gst_plugins_base gst_python pygobject ];
 
-  propagatedBuildInputs = [ dbus_glib farstream telepathy_glib gstreamer ];
-  buildNativeInputs = [ pkgconfig python libxslt];
+  propagatedBuildInputs = [ dbus_glib telepathy_glib gstreamer farstream ];
+  nativeBuildInputs = [ pkgconfig python libxslt];
 }
diff --git a/pkgs/development/libraries/telepathy/glib/default.nix b/pkgs/development/libraries/telepathy/glib/default.nix
index b31338a6595..46aba67702d 100644
--- a/pkgs/development/libraries/telepathy/glib/default.nix
+++ b/pkgs/development/libraries/telepathy/glib/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, dbus_glib, glib, python, pkgconfig, libxslt }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-glib-0.18.1";
+  name = "telepathy-glib-0.20.1";
 
   src = fetchurl {
     url = "${meta.homepage}/releases/telepathy-glib/${name}.tar.gz";
-    sha256 = "0vac5wk9rpaniqxwa50szcc5ql779ks37sy4z7fj4k73i5k2af1p";
+    sha256 = "1dk1s977zv8c935jsiv7ll51a52rlwd7a6f8v7z8klzvc4zk9801";
   };
 
   propagatedBuildInputs = [dbus_glib glib python];
-  
+
   buildInputs = [pkgconfig libxslt];
 
   meta = {
diff --git a/pkgs/development/libraries/telepathy/qt/default.nix b/pkgs/development/libraries/telepathy/qt/default.nix
index 64067a61e3e..b535961357b 100644
--- a/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/pkgs/development/libraries/telepathy/qt/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, cmake, qt4, pkgconfig, python, libxslt, dbus_glib
-, telepathy_farstream, telepathy_glib }:
+, telepathy_farstream, telepathy_glib, pythonDBus }:
 
 stdenv.mkDerivation rec {
-  name = "telepathy-qt-0.9.1";
+  name = "telepathy-qt-0.9.3";
 
   src = fetchurl {
     url = "http://telepathy.freedesktop.org/releases/telepathy-qt/${name}.tar.gz";
-    sha256 = "0rwyxjk6646r43mvsg01q7rfsah0ni05fa8gxzlx1zhj76db95yh";
+    sha256 = "1yabyhsikw828ns7cf6hvzbxdxh53na1ck0q7qsav1lvlyz5gzy0";
   };
 
-  buildNativeInputs = [ cmake pkgconfig python libxslt ];
-  propagatedBuildInputs = [ qt4 dbus_glib telepathy_farstream telepathy_glib ];
+  nativeBuildInputs = [ cmake pkgconfig python libxslt ];
+  propagatedBuildInputs = [ qt4 dbus_glib telepathy_farstream telepathy_glib pythonDBus ];
   preBuild = ''
     NIX_CFLAGS_COMPILE+=" `pkg-config --cflags dbus-glib-1`"
   '';
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index e3fd2bc34ff..431b8773978 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "libtirpc-0.2.2";
+  name = "libtirpc-0.2.3";
 
   src = fetchurl {
     url = "mirror://sourceforge/libtirpc/${name}.tar.bz2";
-    sha256 = "f05eb17c85d62423858b8f74512cfe66a9ae1cedf93f03c2a0a32e04f0a33705";
+    sha256 = "0g4jd8da0kfxz5lv1x5v7f3mfxw53cck8g2zz4llrjmlj42flaag";
   };
 
   # http://www.sourcemage.org/projects/grimoire/repository/revisions/d6344b6a3a94b88ed67925a474de5930803acfbf
diff --git a/pkgs/development/libraries/tide-support/default.nix b/pkgs/development/libraries/tide-support/default.nix
index a778535f362..d30d316c0dc 100644
--- a/pkgs/development/libraries/tide-support/default.nix
+++ b/pkgs/development/libraries/tide-support/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [aterm toolbuslib];
-  buildNativeInputs = [pkgconfig];    
+  nativeBuildInputs = [pkgconfig];    
 
   dontStrip = isMingw;
 } 
diff --git a/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch b/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch
new file mode 100644
index 00000000000..ca89685a458
--- /dev/null
+++ b/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch
@@ -0,0 +1,13 @@
+--- a/tinyxml.pc	1970-01-01 01:00:00.000000000 +0100
++++ b/tinyxml.pc	2012-12-29 08:52:07.512266072 +0100
+@@ -0,0 +1,10 @@
++prefix=@out@
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: TinyXML
++Description: A simple, small, C++ XML parser
++Version: @version@
++Libs: -L${libdir} -ltinyxml
++Cflags: -I${includedir}
diff --git a/pkgs/development/libraries/tinyxml/2.6.2-entity.patch b/pkgs/development/libraries/tinyxml/2.6.2-entity.patch
new file mode 100755
index 00000000000..3164261291b
--- /dev/null
+++ b/pkgs/development/libraries/tinyxml/2.6.2-entity.patch
@@ -0,0 +1,64 @@
+? entity.patch
+Index: a/tinyxml.cpp
+===================================================================
+RCS file: b/tinyxml.cpp,v
+retrieving revision 1.105
+diff -u -r1.105 a/tinyxml.cpp
+--- tinyxml.cpp	5 Jun 2010 19:06:57 -0000	1.105
++++ tinyxml.cpp	19 Jul 2010 21:24:16 -0000
+@@ -57,30 +57,7 @@
+ 	{
+ 		unsigned char c = (unsigned char) str[i];
+ 
+-		if (    c == '&' 
+-		     && i < ( (int)str.length() - 2 )
+-			 && str[i+1] == '#'
+-			 && str[i+2] == 'x' )
+-		{
+-			// Hexadecimal character reference.
+-			// Pass through unchanged.
+-			// &#xA9;	-- copyright symbol, for example.
+-			//
+-			// The -1 is a bug fix from Rob Laveaux. It keeps
+-			// an overflow from happening if there is no ';'.
+-			// There are actually 2 ways to exit this loop -
+-			// while fails (error case) and break (semicolon found).
+-			// However, there is no mechanism (currently) for
+-			// this function to return an error.
+-			while ( i<(int)str.length()-1 )
+-			{
+-				outString->append( str.c_str() + i, 1 );
+-				++i;
+-				if ( str[i] == ';' )
+-					break;
+-			}
+-		}
+-		else if ( c == '&' )
++		if ( c == '&' )
+ 		{
+ 			outString->append( entity[0].str, entity[0].strLength );
+ 			++i;
+Index: a/xmltest.cpp
+===================================================================
+RCS file: b/xmltest.cpp,v
+retrieving revision 1.89
+diff -u -r1.89 a/xmltest.cpp
+--- xmltest.cpp	5 Jun 2010 17:41:52 -0000	1.89
++++ xmltest.cpp	19 Jul 2010 21:24:16 -0000
+@@ -1340,6 +1340,16 @@
+ 		}*/
+ 	}
+ 
++	#ifdef TIXML_USE_STL
++	{
++		TiXmlDocument xml;
++		xml.Parse("<foo>foo&amp;#xa+bar</foo>");
++		std::string str;
++		str << xml;
++		XmlTest( "Entity escaping", "<foo>foo&amp;#xa+bar</foo>", str.c_str() );
++	}
++	#endif
++
+ 	/*  1417717 experiment
+ 	{
+ 		TiXmlDocument xml;
diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix
new file mode 100644
index 00000000000..fde30a98fe9
--- /dev/null
+++ b/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchurl, unzip }:
+
+let
+  version = "2.6.2";
+in stdenv.mkDerivation {
+  name = "tinyxml-${version}";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/project/tinyxml/tinyxml/${version}/tinyxml_2_6_2.zip";
+    sha256 = "04nmw6im2d1xp12yir8va93xns5iz816pwi25n9cql3g3i8bjsxc";
+  };
+  
+  patches = [
+    # add pkgconfig file
+    ./2.6.2-add-pkgconfig.patch
+    
+    # http://sourceforge.net/tracker/index.php?func=detail&aid=3031828&group_id=13559&atid=313559
+    ./2.6.2-entity.patch
+  ];
+  
+  buildInputs = [ unzip ];
+  buildPhase = ''
+    # use STL (xbmc requires it)
+    sed '1i#define TIXML_USE_STL 1' -i tinyxml.h
+    sed '1i#define TIXML_USE_STL 1' -i xmltest.cpp
+
+    # build xmltest
+    make
+    
+    # build the lib as a shared library
+    g++ -Wall -O2 -shared -fpic tinyxml.cpp \
+    tinyxmlerror.cpp tinyxmlparser.cpp      \
+    tinystr.cpp -o libtinyxml.so
+  '';
+  
+  doCheck = true;
+  checkPhase = ''
+    ./xmltest
+    result=$?
+    if [[ $result != 0 ]] ; then
+      exit $result
+    fi
+  '';
+  
+  installPhase = ''
+    mkdir -pv $out/include/
+    mkdir -pv $out/lib/pkgconfig/
+    mkdir -pv $out/share/doc/tinyxml/
+    
+    cp -v libtinyxml.so $out/lib/
+    cp -v *.h $out/include/
+    
+    substituteInPlace tinyxml.pc --replace "@out@" "$out"
+    substituteInPlace tinyxml.pc --replace "@version@" "${version}"
+    cp -v tinyxml.pc $out/lib/pkgconfig/
+    
+    cp -v docs/* $out/share/doc/tinyxml/
+  '';
+  
+  meta = {
+    description = "TinyXML is a simple, small, C++ XML parser that can be easily integrating into other programs.";
+    homepage = "http://www.grinninglizard.com/tinyxml/index.html";
+    license = "free-non-copyleft";
+  };
+}
diff --git a/pkgs/development/libraries/tokyo-tyrant/default.nix b/pkgs/development/libraries/tokyo-tyrant/default.nix
index 63319213312..b623c773142 100644
--- a/pkgs/development/libraries/tokyo-tyrant/default.nix
+++ b/pkgs/development/libraries/tokyo-tyrant/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "13xqcinhydqmh7231qlir6pymacjwcf98drybkhd9597kzxp1bs2";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ tokyocabinet ];
 
   doCheck = false;                                # FIXME
diff --git a/pkgs/development/libraries/toolbuslib/default.nix b/pkgs/development/libraries/toolbuslib/default.nix
index 4d184b11abd..16680f0134c 100644
--- a/pkgs/development/libraries/toolbuslib/default.nix
+++ b/pkgs/development/libraries/toolbuslib/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   patches = if isMingw then [./mingw.patch] else [];
   
   buildInputs = [aterm] ++ (if isMingw then [w32api] else []);
-  buildNativeInputs = [pkgconfig];
+  nativeBuildInputs = [pkgconfig];
   
   dontStrip = isMingw; 
 }  
diff --git a/pkgs/development/libraries/tremor/default.nix b/pkgs/development/libraries/tremor/default.nix
index 2770fadf004..d55ea6166e8 100644
--- a/pkgs/development/libraries/tremor/default.nix
+++ b/pkgs/development/libraries/tremor/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "161411cbefa1527da7a8fc087e78d8e21d19143d3a6eb42fb281e5026aad7568";
   };
 
-  buildNativeInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
   propagatedBuildInputs = [ libogg ];
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/tsocks/default.nix b/pkgs/development/libraries/tsocks/default.nix
new file mode 100644
index 00000000000..a0d607517ac
--- /dev/null
+++ b/pkgs/development/libraries/tsocks/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  name = "tsocks-${version}";
+  version = "1.8beta5";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/tsocks/${name}.tar.gz";
+    sha256 = "0ixkymiph771dcdzvssi9dr2pk1bzaw9zv85riv3xl40mzspx7c4";
+  };
+
+  preConfigure = ''
+      export configureFlags="$configureFlags --libdir=$out/lib"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Transparent SOCKS v4 proxying library";
+    homepage = http://tsocks.sourceforge.net/;
+    license = "GPLv2";
+    maintainers = [ maintainers.phreedom ];
+    platforms = platforms.linux;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/libraries/ustr/default.nix b/pkgs/development/libraries/ustr/default.nix
index ebf9628126e..b016a6f715c 100644
--- a/pkgs/development/libraries/ustr/default.nix
+++ b/pkgs/development/libraries/ustr/default.nix
@@ -8,8 +8,11 @@ stdenv.mkDerivation rec {
     url = "http://www.and.org/ustr/${version}/${name}.tar.bz2";
     sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx";
   };
+
   prePatch = "substituteInPlace Makefile --replace /usr/include/ ${glibc}/include/";
 
+  patches = [ ./va_args.patch ]; # fixes bogus warnings that failed libsemanage
+
   makeFlags = "DESTDIR=$(out) prefix= LDCONFIG=echo";
 
   configurePhase = "make ustr-import";
@@ -21,4 +24,4 @@ stdenv.mkDerivation rec {
     license = licenses.bsd2;
     maintainers = [ maintainers.phreedom ];
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/development/libraries/ustr/va_args.patch b/pkgs/development/libraries/ustr/va_args.patch
new file mode 100644
index 00000000000..f75b537485d
--- /dev/null
+++ b/pkgs/development/libraries/ustr/va_args.patch
@@ -0,0 +1,23 @@
+diff --git a/ustr-compiler.h b/ustr-compiler.h
+index 9e71276..c5f847a 100644
+--- a/ustr-compiler.h
++++ b/ustr-compiler.h
+@@ -11,17 +11,11 @@
+ #define USTR_CONF_HAVE_ATTR_FMT 1
+ #endif
+ 
++#include <stdarg.h>
+ /* We assume this is enough,
+  * C99 specifies that va_copy() exists and is a macro */
+-#ifdef va_copy
+ # define USTR_CONF_HAVE_VA_COPY 1
+ # define USTR__VA_COPY(x, y)   va_copy(x, y)
+-#elif __va_copy
+-# define USTR_CONF_HAVE_VA_COPY 1
+-# define USTR__VA_COPY(x, y) __va_copy(x, y)
+-#else
+-# define USTR_CONF_HAVE_VA_COPY 0
+-#endif
+ 
+ #ifndef USTR_CONF_HAVE_ATTR_NONNULL
+ #if defined(__GNUC__) && (__GNUC__ > 3) /* not sure */
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index af0e6426b81..25deb9eb351 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -5,24 +5,28 @@ assert readline != null;
 let
   system = stdenv.system;
   arch = if system == "i686-linux" then "ia32" else if system == "x86_64-linux" || system == "x86_64-darwin" then "x64" else "";
-  version = "3.11.10.15";
+  version = "3.14.5.9";
 in
 
 assert arch != "";
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation {
     name = "v8-${version}";
+
     src = fetchsvn {
       url = "http://v8.googlecode.com/svn/tags/${version}";
-      sha256 = "0pdw4r6crsb07gshww4kbfbavxgkal8yaxkaggnkz62lrwbcwrwi";
+      sha256 = "18qp5qp5xrb6f00w01cklz358yrl54pks963f5rwvwz82d8sfyqr";
+      name = "v8-${version}-src";
     };
 
+    patches = [ ./fix-GetLocalizedMessage-usage.patch ];
+
     configurePhase = ''
       mkdir build/gyp
       ln -sv ${gyp}/bin/gyp build/gyp/gyp
     '';
 
-    buildNativeInputs = stdenv.lib.optional (system == "i686-linux") which;
+    nativeBuildInputs = stdenv.lib.optional (system == "i686-linux") which;
     buildInputs = [ readline python ];
 
     buildFlags = [
@@ -37,7 +41,16 @@ stdenv.mkDerivation rec {
       mkdir -p $out/bin
       mkdir -p $out/lib
       mv -v out/${arch}.release/d8 $out/bin
-      mv -v out/${arch}.release/lib.target/libv8.so $out/lib
+
+      ${if stdenv.system == "x86_64-darwin" then
+        "mv -v out/${arch}.release/libv8.dylib $out/lib"
+      else
+        "mv -v out/${arch}.release/lib.target/libv8.so $out/lib"}
       mv -v include $out/
     '';
+
+    postFixup = if stdenv.isDarwin then ''
+      install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/bin/d8
+      install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.gcc.gcc}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
+    '' else null;
 }
diff --git a/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch b/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch
new file mode 100644
index 00000000000..3bc0fff4d50
--- /dev/null
+++ b/pkgs/development/libraries/v8/fix-GetLocalizedMessage-usage.patch
@@ -0,0 +1,27 @@
+From dbe142c4eda0f15fad9fa85743dd11b81292fa8f Mon Sep 17 00:00:00 2001
+From: Timothy J Fontaine <tjfontaine@gmail.com>
+Date: Thu, 23 May 2013 13:57:59 -0700
+Subject: [PATCH] v8: fix GetLocalizedMessage usage
+
+As is the backport of the abort on uncaught exception wouldn't compile
+because we it was passing in `this` when it was unnecessary.
+---
+ deps/v8/src/isolate.cc | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/isolate.cc b/src/isolate.cc
+index 04a438b..5a5293e 100644
+--- a/src/isolate.cc
++++ b/src/isolate.cc
+@@ -1161,7 +1161,7 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
+           (report_exception || can_be_caught_externally)) {
+         fatal_exception_depth++;
+         fprintf(stderr, "%s\n\nFROM\n",
+-          *MessageHandler::GetLocalizedMessage(this, message_obj));
++          *MessageHandler::GetLocalizedMessage(message_obj));
+         PrintCurrentStackTrace(stderr);
+         OS::Abort();
+       }
+-- 
+1.8.1.6
+
diff --git a/pkgs/development/libraries/vaapi-intel/default.nix b/pkgs/development/libraries/vaapi-intel/default.nix
new file mode 100644
index 00000000000..548aeb8a2de
--- /dev/null
+++ b/pkgs/development/libraries/vaapi-intel/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, autoconf, automake, libtool, mesa, libva, libdrm, libX11, pkgconfig
+, intelgen4asm }:
+
+stdenv.mkDerivation rec {
+  name = "libva-intel-driver-1.0.19";
+  
+  src = fetchurl {
+    url = "http://www.freedesktop.org/software/vaapi/releases/libva-intel-driver/${name}.tar.bz2";
+    sha256 = "14m7krah3ajkwj190q431lqqa84hdljcdmrcrqkbgaffyjlqvdid";
+  };
+
+  buildInputs = [ autoconf automake libtool mesa libva pkgconfig libdrm libX11 intelgen4asm ];
+
+  preConfigure = ''
+    sh autogen.sh
+    sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
+  '';
+
+  meta = {
+    homepage = http://cgit.freedesktop.org/vaapi/intel-driver/;
+    license = "MIT";
+    description = "Intel driver for the VAAPI library";
+  };
+}
diff --git a/pkgs/development/libraries/vaapi-vdpau/default.nix b/pkgs/development/libraries/vaapi-vdpau/default.nix
new file mode 100644
index 00000000000..a3d51217ead
--- /dev/null
+++ b/pkgs/development/libraries/vaapi-vdpau/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, libvdpau, mesa, libva, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "libva-vdpau-driver-0.7.4";
+  
+  src = fetchurl {
+    url = "http://www.freedesktop.org/software/vaapi/releases/libva-vdpau-driver/${name}.tar.bz2";
+    sha256 = "1fcvgshzyc50yb8qqm6v6wn23ghimay23ci0p8sm8gxcy211jp0m";
+  };
+
+  buildInputs = [ libvdpau mesa libva pkgconfig ];
+
+  preConfigure = ''
+    sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
+  '';
+
+  meta = {
+    homepage = http://cgit.freedesktop.org/vaapi/vdpau-driver/;
+    license = "GPLv2+";
+    description = "VDPAU driver for the VAAPI library";
+  };
+}
diff --git a/pkgs/development/libraries/vcdimager/default.nix b/pkgs/development/libraries/vcdimager/default.nix
index 6940f88ffbe..58b9d2f2573 100644
--- a/pkgs/development/libraries/vcdimager/default.nix
+++ b/pkgs/development/libraries/vcdimager/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1526jxynslg07i50v3c3afhc8swbd4si8y6s8m3h1wrz6mkplp87";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ libxml2 popt ];
 
diff --git a/pkgs/development/libraries/vmime/default.nix b/pkgs/development/libraries/vmime/default.nix
index 4f70b7a39a4..24234469fa2 100644
--- a/pkgs/development/libraries/vmime/default.nix
+++ b/pkgs/development/libraries/vmime/default.nix
@@ -1,13 +1,14 @@
-{stdenv, fetchurl, gsasl, gnutls, pkgconfig, zlib, libtasn1 }:
+{stdenv, fetchurl, gsasl, gnutls, pkgconfig, zlib, libtasn1, libgcrypt }:
 
 stdenv.mkDerivation {
-  name = "vmime-0.9.1";
+  name = "vmime-0.9.2svn";
   src = fetchurl {
-    url = mirror://sourceforge/vmime/libvmime-0.9.1.tar.bz2;
-    sha256 = "1bninkznn07zhl7gc3jnigzvb0x1sclwqwgjy47ahzdwv5vcnriv";
+    url = http://download.zarafa.com/community/final/7.0/7.0.5-31880/sourcecode/libvmime-0.9.2+svn603.tar.bz2;
+    #url = mirror://sourceforge/vmime/libvmime-0.9.1.tar.bz2;
+    sha256 = "1jhxiy8c2cgzfjps0z4q40wygdpgm8jr7jn727cbzrscj2c48kxx";
   };
 
-  buildInputs = [ gsasl gnutls pkgconfig zlib libtasn1 ];
+  buildInputs = [ gsasl gnutls pkgconfig zlib libtasn1 libgcrypt ];
 
   meta = {
     homepage = http://www.vmime.org/;
diff --git a/pkgs/development/libraries/vtk/default.nix b/pkgs/development/libraries/vtk/default.nix
index db7d0d77f69..e8f42e9f7f5 100644
--- a/pkgs/development/libraries/vtk/default.nix
+++ b/pkgs/development/libraries/vtk/default.nix
@@ -1,18 +1,40 @@
-{stdenv, fetchurl, cmake, mesa, libX11, xproto, libXt }:
+{ stdenv, fetchurl, cmake, mesa, libX11, xproto, libXt
+, useQt4 ? false, qt4 }:
+
+with stdenv.lib;
+
+let
+  os = stdenv.lib.optionalString;
+  majorVersion = "5.10";
+  minorVersion = "0";
+  version = "${majorVersion}.${minorVersion}";
+in
 
 stdenv.mkDerivation rec {
-  name = "vtk-5.4.2";
+  name = "vtk-${os useQt4 "qvtk-"}${version}";
   src = fetchurl {
-    url = "http://www.vtk.org/files/release/5.4/${name}.tar.gz";
-    sha256 = "0gd7xlxiqww6xxcs2kicz0g6k147y3200np4jnsf10vlxs10az03";
+    url = "${meta.homepage}files/release/${majorVersion}/vtk-${version}.tar.gz";
+    md5 = "a0363f78910f466ba8f1bd5ab5437cb9";
   };
-  buildInputs = [ cmake mesa libX11 xproto libXt ];
+
+  buildInputs = [ cmake mesa libX11 xproto libXt ]
+    ++ optional useQt4 qt4;
+
+  # Shared libraries don't work, because of rpath troubles with the current
+  # nixpkgs camke approach. It wants to call a binary at build time, just
+  # built and requiring one of the shared objects.
+  # At least, we use -fPIC for other packages to be able to use this in shared
+  # objects.
+  cmakeFlags = [ "-DCMAKE_C_FLAGS=-fPIC" "-DCMAKE_CXX_FLAGS=-fPIC" ] ++ optional useQt4
+    [ "-DVTK_USE_QT:BOOL=ON" ];
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "Open source libraries for 3D computer graphics, image processing and visualization";
     homepage = http://www.vtk.org/;
     license = "BSD";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [ viric bbenoist ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix
index 01ccb23b77c..2f169f3f25d 100644
--- a/pkgs/development/libraries/vxl/default.nix
+++ b/pkgs/development/libraries/vxl/default.nix
@@ -9,7 +9,10 @@ stdenv.mkDerivation {
 
   buildInputs = [ cmake unzip libtiff expat zlib libpng libjpeg ];
 
-  cmakeFlags = "-DBUILD_TESTING=OFF " + (if (stdenv.system == "x86_64-linux") then
+  # BUILD_OUL wants old linux headers for videodev.h, not available
+  # in stdenv linux headers
+  cmakeFlags = "-DBUILD_TESTING=OFF -DBUILD_OUL=OFF "
+    + (if stdenv.system == "x86_64-linux" then
       "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
     else
       "");
diff --git a/pkgs/development/libraries/wayland/default.nix b/pkgs/development/libraries/wayland/default.nix
new file mode 100644
index 00000000000..9e00b0d8bcf
--- /dev/null
+++ b/pkgs/development/libraries/wayland/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, libffi, expat, pkgconfig, libxslt, docbook_xsl, doxygen }:
+
+stdenv.mkDerivation rec {
+  name = "wayland-1.0.5";
+
+  src = fetchurl {
+    url = "http://wayland.freedesktop.org/releases/${name}.tar.xz";
+
+    sha256 = "130n7v5i7rfsrli2n8vdzfychlgd8v7by7sfgp8vfqdlss5km34w";
+  };
+
+  buildInputs = [ pkgconfig libffi expat libxslt docbook_xsl doxygen ];
+
+  meta = {
+    description = "The reference implementation of the Wayland protocol";
+
+    homepage = http://wayland.freedesktop.org;
+
+    license = stdenv.lib.licenses.bsd3;
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/libraries/webkit/bison26.patch b/pkgs/development/libraries/webkit/bison26.patch
new file mode 100644
index 00000000000..95898adeb8a
--- /dev/null
+++ b/pkgs/development/libraries/webkit/bison26.patch
@@ -0,0 +1,515 @@
+Index: /trunk/Source/WebCore/ChangeLog

+===================================================================

+--- /trunk/Source/WebCore/ChangeLog	(revision 124098)

++++ /trunk/Source/WebCore/ChangeLog	(revision 124099)

+@@ -1,2 +1,27 @@

++2012-07-30  Alexis Menard  <alexis.menard@openbossa.org>

++

++        Build fix with newer bison 2.6.

++        https://bugs.webkit.org/show_bug.cgi?id=92264

++

++        Reviewed by Adam Barth.

++

++        As stated in http://www.gnu.org/software/bison/manual/html_node/Table-of-Symbols.html

++        YYLEX_PARAM and YYPARSE_PARAM are depecreated since version 1.875. So far all Mac OS

++        version I had access to as well as recent Linux runs at least version 2.3 so it's safe

++        to use the replacement of these deprecated macros in favor of %lex-param and %parse-param.

++        As announced http://lists.gnu.org/archive/html/info-gnu/2012-07/msg00011.html with the release

++        of version 2.6 YYLEX_PARAM and YYPARSE_PARAM are not supported anymore.

++

++        No new tests : build fix and the patch should not trigger any regressions

++

++        * css/CSSGrammar.y:

++        * css/CSSParser.cpp:

++        * xml/XPathGrammar.y: Refactored a bit to not use an intermediate PARSER define.

++        * xml/XPathParser.cpp: bison 2.6 declare xpathyyparse in the .h file now, i.e. XPathGrammar.h

++        therefore including this file within the namespace {} declarations leads to xpathyyparse being

++        defined part of WebCore::XPath namespaces but the actual implementation of xpathyyparse is in XPathGrammar.cpp

++        (generated) and not implemented within the WebCore::XPath so it lead to linking issues. Last, XPathGrammar.h needs 

++        to be included after the other includes as it uses some XPath types. It breaks the style but CSSParser.cpp is doing the same.

++

+ 2012-07-30  Sadrul Habib Chowdhury  <sadrul@chromium.org>

+ 

+Index: /trunk/Source/WebCore/css/CSSParser.cpp

+===================================================================

+--- /trunk/Source/WebCore/css/CSSParser.cpp	(revision 124098)

++++ /trunk/Source/WebCore/css/CSSParser.cpp	(revision 124099)

+@@ -115,5 +115,5 @@

+ #endif

+ 

+-extern int cssyyparse(void* parser);

++extern int cssyyparse(WebCore::CSSParser*);

+ 

+ using namespace std;

+Index: /trunk/Source/WebCore/css/CSSGrammar.y

+===================================================================

+--- /trunk/Source/WebCore/css/CSSGrammar.y	(revision 124098)

++++ /trunk/Source/WebCore/css/CSSGrammar.y	(revision 124099)

+@@ -54,11 +54,10 @@

+ #define YYDEBUG 0

+ 

+-// FIXME: Replace with %parse-param { CSSParser* parser } once we can depend on bison 2.x

+-#define YYPARSE_PARAM parser

+-#define YYLEX_PARAM parser

+-

+ %}

+ 

+ %pure_parser

++

++%parse-param { CSSParser* parser }

++%lex-param { CSSParser* parser }

+ 

+ %union {

+@@ -90,5 +89,5 @@

+ %{

+ 

+-static inline int cssyyerror(const char*)

++static inline int cssyyerror(void*, const char*)

+ {

+     return 1;

+Index: /trunk/Source/WebCore/xml/XPathParser.cpp

+===================================================================

+--- /trunk/Source/WebCore/xml/XPathParser.cpp	(revision 124098)

++++ /trunk/Source/WebCore/xml/XPathParser.cpp	(revision 124099)

+@@ -33,22 +33,19 @@

+ #include "XPathException.h"

+ #include "XPathNSResolver.h"

++#include "XPathPath.h"

+ #include "XPathStep.h"

+ #include <wtf/StdLibExtras.h>

+ #include <wtf/text/StringHash.h>

+ 

+-int xpathyyparse(void*);

+-

++using namespace WebCore;

+ using namespace WTF;

+ using namespace Unicode;

+-

+-namespace WebCore {

+-namespace XPath {

+-

+-class LocationPath;

+-

+-#include "XPathGrammar.h"    

++using namespace XPath;

++

++extern int xpathyyparse(WebCore::XPath::Parser*);

++#include "XPathGrammar.h"

+ 

+ Parser* Parser::currentParser = 0;

+-    

++

+ enum XMLCat { NameStart, NameCont, NotPartOfName };

+ 

+@@ -631,4 +628,2 @@

+ }

+ 

+-}

+-}

+Index: /trunk/Source/WebCore/xml/XPathGrammar.y

+===================================================================

+--- /trunk/Source/WebCore/xml/XPathGrammar.y	(revision 124098)

++++ /trunk/Source/WebCore/xml/XPathGrammar.y	(revision 124099)

+@@ -35,4 +35,5 @@

+ #include "XPathPath.h"

+ #include "XPathPredicate.h"

++#include "XPathStep.h"

+ #include "XPathVariableReference.h"

+ #include <wtf/FastMalloc.h>

+@@ -45,6 +46,4 @@

+ #define YYDEBUG 0

+ #define YYMAXDEPTH 10000

+-#define YYPARSE_PARAM parserParameter

+-#define PARSER static_cast<Parser*>(parserParameter)

+ 

+ using namespace WebCore;

+@@ -54,4 +53,5 @@

+ 

+ %pure_parser

++%parse-param { WebCore::XPath::Parser* parser }

+ 

+ %union

+@@ -72,5 +72,5 @@

+ 

+ static int xpathyylex(YYSTYPE* yylval) { return Parser::current()->lex(yylval); }

+-static void xpathyyerror(const char*) { }

++static void xpathyyerror(void*, const char*) { }

+     

+ %}

+@@ -119,5 +119,5 @@

+     OrExpr

+     {

+-        PARSER->m_topExpr = $1;

++        parser->m_topExpr = $1;

+     }

+     ;

+@@ -139,5 +139,5 @@

+     {

+         $$ = new LocationPath;

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -151,5 +151,5 @@

+         $$ = $2;

+         $$->insertFirstStep($1);

+-        PARSER->unregisterParseNode($1);

++        parser->unregisterParseNode($1);

+     }

+     ;

+@@ -160,6 +160,6 @@

+         $$ = new LocationPath;

+         $$->appendStep($1);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -167,5 +167,5 @@

+     {

+         $$->appendStep($3);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($3);

+     }

+     |

+@@ -174,6 +174,6 @@

+         $$->appendStep($2);

+         $$->appendStep($3);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($2);

++        parser->unregisterParseNode($3);

+     }

+     ;

+@@ -184,9 +184,9 @@

+         if ($2) {

+             $$ = new Step(Step::ChildAxis, *$1, *$2);

+-            PARSER->deletePredicateVector($2);

++            parser->deletePredicateVector($2);

+         } else

+             $$ = new Step(Step::ChildAxis, *$1);

+-        PARSER->deleteNodeTest($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteNodeTest($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -195,6 +195,6 @@

+         String localName;

+         String namespaceURI;

+-        if (!PARSER->expandQName(*$1, localName, namespaceURI)) {

+-            PARSER->m_gotNamespaceError = true;

++        if (!parser->expandQName(*$1, localName, namespaceURI)) {

++            parser->m_gotNamespaceError = true;

+             YYABORT;

+         }

+@@ -202,9 +202,9 @@

+         if ($2) {

+             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$2);

+-            PARSER->deletePredicateVector($2);

++            parser->deletePredicateVector($2);

+         } else

+             $$ = new Step(Step::ChildAxis, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -213,9 +213,9 @@

+         if ($3) {

+             $$ = new Step($1, *$2, *$3);

+-            PARSER->deletePredicateVector($3);

++            parser->deletePredicateVector($3);

+         } else

+             $$ = new Step($1, *$2);

+-        PARSER->deleteNodeTest($2);

+-        PARSER->registerParseNode($$);

++        parser->deleteNodeTest($2);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -224,6 +224,6 @@

+         String localName;

+         String namespaceURI;

+-        if (!PARSER->expandQName(*$2, localName, namespaceURI)) {

+-            PARSER->m_gotNamespaceError = true;

++        if (!parser->expandQName(*$2, localName, namespaceURI)) {

++            parser->m_gotNamespaceError = true;

+             YYABORT;

+         }

+@@ -231,9 +231,9 @@

+         if ($3) {

+             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI), *$3);

+-            PARSER->deletePredicateVector($3);

++            parser->deletePredicateVector($3);

+         } else

+             $$ = new Step($1, Step::NodeTest(Step::NodeTest::NameTest, localName, namespaceURI));

+-        PARSER->deleteString($2);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($2);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -260,6 +260,6 @@

+             $$ = new Step::NodeTest(Step::NodeTest::CommentNodeTest);

+ 

+-        PARSER->deleteString($1);

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->registerNodeTest($$);

+     }

+     |

+@@ -267,6 +267,6 @@

+     {

+         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest);

+-        PARSER->deleteString($1);        

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->registerNodeTest($$);

+     }

+     |

+@@ -274,7 +274,7 @@

+     {

+         $$ = new Step::NodeTest(Step::NodeTest::ProcessingInstructionNodeTest, $3->stripWhiteSpace());

+-        PARSER->deleteString($1);        

+-        PARSER->deleteString($3);

+-        PARSER->registerNodeTest($$);

++        parser->deleteString($1);

++        parser->deleteString($3);

++        parser->registerNodeTest($$);

+     }

+     ;

+@@ -294,6 +294,6 @@

+         $$ = new Vector<Predicate*>;

+         $$->append(new Predicate($1));

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerPredicateVector($$);

++        parser->unregisterParseNode($1);

++        parser->registerPredicateVector($$);

+     }

+     |

+@@ -301,5 +301,5 @@

+     {

+         $$->append(new Predicate($2));

+-        PARSER->unregisterParseNode($2);

++        parser->unregisterParseNode($2);

+     }

+     ;

+@@ -316,5 +316,5 @@

+     {

+         $$ = new Step(Step::DescendantOrSelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -324,5 +324,5 @@

+     {

+         $$ = new Step(Step::SelfAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -330,5 +330,5 @@

+     {

+         $$ = new Step(Step::ParentAxis, Step::NodeTest(Step::NodeTest::AnyNodeTest));

+-        PARSER->registerParseNode($$);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -338,6 +338,6 @@

+     {

+         $$ = new VariableReference(*$1);

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -350,6 +350,6 @@

+     {

+         $$ = new StringExpression(*$1);

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -357,6 +357,6 @@

+     {

+         $$ = new Number($1->toDouble());

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -370,6 +370,6 @@

+         if (!$$)

+             YYABORT;

+-        PARSER->deleteString($1);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -379,7 +379,7 @@

+         if (!$$)

+             YYABORT;

+-        PARSER->deleteString($1);

+-        PARSER->deleteExpressionVector($3);

+-        PARSER->registerParseNode($$);

++        parser->deleteString($1);

++        parser->deleteExpressionVector($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -390,6 +390,6 @@

+         $$ = new Vector<Expression*>;

+         $$->append($1);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->registerExpressionVector($$);

++        parser->unregisterParseNode($1);

++        parser->registerExpressionVector($$);

+     }

+     |

+@@ -397,5 +397,5 @@

+     {

+         $$->append($3);

+-        PARSER->unregisterParseNode($3);

++        parser->unregisterParseNode($3);

+     }

+     ;

+@@ -413,7 +413,7 @@

+         $$->addSubExpression($1);

+         $$->addSubExpression($3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -431,7 +431,7 @@

+         $3->setAbsolute(true);

+         $$ = new Path(static_cast<Filter*>($1), $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -441,8 +441,8 @@

+         $3->setAbsolute(true);

+         $$ = new Path(static_cast<Filter*>($1), $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($2);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -454,7 +454,7 @@

+     {

+         $$ = new Filter($1, *$2);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->deletePredicateVector($2);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->deletePredicateVector($2);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -466,7 +466,7 @@

+     {

+         $$ = new LogicalOp(LogicalOp::OP_Or, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -478,7 +478,7 @@

+     {

+         $$ = new LogicalOp(LogicalOp::OP_And, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -490,7 +490,7 @@

+     {

+         $$ = new EqTestOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -502,7 +502,7 @@

+     {

+         $$ = new EqTestOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -514,7 +514,7 @@

+     {

+         $$ = new NumericOp(NumericOp::OP_Add, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     |

+@@ -522,7 +522,7 @@

+     {

+         $$ = new NumericOp(NumericOp::OP_Sub, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -534,7 +534,7 @@

+     {

+         $$ = new NumericOp($2, $1, $3);

+-        PARSER->unregisterParseNode($1);

+-        PARSER->unregisterParseNode($3);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($1);

++        parser->unregisterParseNode($3);

++        parser->registerParseNode($$);

+     }

+     ;

+@@ -547,6 +547,6 @@

+         $$ = new Negative;

+         $$->addSubExpression($2);

+-        PARSER->unregisterParseNode($2);

+-        PARSER->registerParseNode($$);

++        parser->unregisterParseNode($2);

++        parser->registerParseNode($$);

+     }

+     ;

diff --git a/pkgs/development/libraries/webkit/default.nix b/pkgs/development/libraries/webkit/default.nix
index c0fd878e0bb..ef4d259cb02 100644
--- a/pkgs/development/libraries/webkit/default.nix
+++ b/pkgs/development/libraries/webkit/default.nix
@@ -1,6 +1,6 @@
 args : with args; 
 let 
-  s = import ./src-for-default.nix;
+  s = import ./src-for-default.nix; # 1.8.3 needs newer gtk3, wait for x-updates
   version = lib.attrByPath ["version"] s.version args;
 in
 rec {
@@ -9,12 +9,13 @@ rec {
     sha256 = s.hash;
   };
 
-  buildInputs = [gtk glib atk cairo curl fontconfig freetype
-    gettext libjpeg libpng libtiff libxml2 libxslt pango
-    sqlite icu gperf bison flex autoconf automake libtool 
-    perl intltool pkgconfig libsoup gtkdoc libXt libproxy
-    enchant python ruby which renderproto libXrender geoclue
-    kbproto
+  buildInputs = with xlibs; [
+    pkgconfig libtool intltool autoconf automake gperf bison flex
+    gtk3 gtk2 glib atk cairo pango fontconfig freetype libsoup gtkdoc
+    libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+    which libproxy geoclue enchant python ruby perl
+    mesa libXt libXrender renderproto libXcomposite compositeproto
+    libXdamage damageproto kbproto
     ];
 
   propagatedBuildInputs = [
@@ -22,19 +23,22 @@ rec {
     ];
 
   configureFlags = [
-    "--enable-3D-transforms"
+    # "--enable-3D-transforms" # no longer recognized
     "--enable-web-sockets"
     "--enable-web-timing"
-    
+
+    # https://bugs.webkit.org/show_bug.cgi?id=55294
+    "--enable-image-resizer"
+
     "--enable-geolocation"
 
     # Not implemented?
-    #"--enable-web-audio"
+    # "--enable-web-audio"
 
     "--enable-mathml"
 
     #"--enable-wml"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=45110
     #"--enable-indexed-database"
 
@@ -43,23 +47,29 @@ rec {
 
     # "--enable-input-speech"
 
-    "--enable-file-writer"
+    #"--enable-file-writer" # no longer recognized
     "--enable-blob"
 
     # https://bugs.webkit.org/show_bug.cgi?id=59430
-    #"--enable-directory-upload"
+    # "--enable-directory-upload"
 
     # https://bugs.webkit.org/show_bug.cgi?id=58443
-    #"--enable-file-system"
+    # "--enable-file-system"
+
+    "--enable-dependency-tracking" # to fix parallel building
     ];
 
+  # instead of enableParallelBuilding = true;
+  makeFlags = "-j$NIX_BUILD_CORES";
+
   /* doConfigure should be specified separately */
-  phaseNames = ["setVars" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
+  phaseNames = ["doPatch" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
     "doReplaceUsrBin" "doMakeInstall" "doAddPrograms"];
 
-  setVars = fullDepEntry (''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lXt"
-  '') ["minInit"];
+  patches = [ ./bison26.patch ]; # http://trac.webkit.org/changeset/124099
+  patchFlags = "-p2";
+
+  #doCheck = true; # tests still have problems
 
   doReplaceUsrBin = fullDepEntry (''
     for i in $(find . -name '*.pl') $(find . -name '*.pm'); do 
@@ -78,12 +88,19 @@ rec {
     sed -re 's@( |^)//.*@/* & */@' -i $(find . -name '*.c' -o -name '*.h')
   '') ["minInit" "doUnpack"];
 
+  # See http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2012-April/022893.html
+  fixConfigure = fullDepEntry (''
+    sed   -i -e 's/=GSTREAMER_0_10_REQUIRED_VERSION/=\$GSTREAMER_0_10_REQUIRED_VERSION/' \
+      -e 's/=GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/=\$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/' \
+      configure{,.ac}
+  '') ["minInit" "doUnpack"];
+
   name = s.name;
   meta = {
     description = "WebKit - a fast and correct HTML renderer";
     maintainers = [stdenv.lib.maintainers.raskin];
   };
   passthru = {
-    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg;
+    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg libsoup;
   };
 }
diff --git a/pkgs/development/libraries/webkit/gtk2.nix b/pkgs/development/libraries/webkit/gtk2.nix
index 5c755c193a5..c2e3b9b06dd 100644
--- a/pkgs/development/libraries/webkit/gtk2.nix
+++ b/pkgs/development/libraries/webkit/gtk2.nix
@@ -10,11 +10,13 @@ rec {
     sha256 = s.hash;
   };
 
-  buildInputs = [gtk glib atk cairo curl fontconfig freetype
-    gettext libjpeg libpng libtiff libxml2 libxslt pango
-    sqlite icu gperf bison flex autoconf automake libtool 
-    intltool pkgconfig libsoup gtkdoc libXt libproxy
-    enchant python ruby which renderproto libXrender geoclue perl
+  buildInputs = with xlibs; [
+    pkgconfig libtool intltool autoconf automake gperf bison flex
+    gtk2 glib atk cairo pango fontconfig freetype libsoup gtkdoc
+    libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+    which libproxy geoclue enchant python ruby perl
+    mesa libXt libXrender renderproto libXcomposite compositeproto
+    libXdamage damageproto kbproto
     ];
 
   propagatedBuildInputs = [
@@ -22,12 +24,14 @@ rec {
     ];
 
   configureFlags = [
-    "--enable-3D-transforms"
+    "--with-gtk=2.0"
+
+    # "--enable-3D-transforms" # no longer recognized
     "--enable-web-sockets"
     "--enable-web-timing"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=55294
-    # "--enable-image-resizer"
+    "--enable-image-resizer"
 
     "--enable-geolocation"
 
@@ -37,15 +41,16 @@ rec {
     "--enable-mathml"
 
     #"--enable-wml"
-    
+
     # https://bugs.webkit.org/show_bug.cgi?id=45110
-    # "--enable-indexed-database"
+    #"--enable-indexed-database"
 
-    "--enable-xhtmlmp"
+    # Doesn't work in release...
+    #"--enable-xhtmlmp"
 
     # "--enable-input-speech"
 
-    "--enable-file-writer"
+    #"--enable-file-writer" # no longer recognized
     "--enable-blob"
 
     # https://bugs.webkit.org/show_bug.cgi?id=59430
@@ -53,15 +58,21 @@ rec {
 
     # https://bugs.webkit.org/show_bug.cgi?id=58443
     # "--enable-file-system"
+
+    "--enable-dependency-tracking" # to fix parallel building
     ];
 
+  # instead of enableParallelBuilding = true;
+  makeFlags = "-j$NIX_BUILD_CORES";
+
   /* doConfigure should be specified separately */
-  phaseNames = ["setVars" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
+  phaseNames = ["doPatch" "fixConfigure" /* "paranoidFixComments" */ "doConfigure" (doPatchShebangs ".") 
     "doReplaceUsrBin" "doMakeInstall" "doAddPrograms"];
 
-  setVars = fullDepEntry (''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lXt"
-  '') ["minInit"];
+  patches = [ ./bison26.patch ]; # http://trac.webkit.org/changeset/124099
+  patchFlags = "-p2";
+
+  #doCheck = true; # tests still have problems
 
   doReplaceUsrBin = fullDepEntry (''
     for i in $(find . -name '*.pl') $(find . -name '*.pm'); do 
@@ -80,12 +91,19 @@ rec {
     sed -re 's@( |^)//.*@/* & */@' -i $(find . -name '*.c' -o -name '*.h')
   '') ["minInit" "doUnpack"];
 
+  # See http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2012-April/022893.html
+  fixConfigure = fullDepEntry (''
+    sed   -i -e 's/=GSTREAMER_0_10_REQUIRED_VERSION/=\$GSTREAMER_0_10_REQUIRED_VERSION/' \
+      -e 's/=GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/=\$GSTREAMER_0_10_PLUGINS_BASE_REQUIRED_VERSION/' \
+      configure{,.ac}
+  '') ["minInit" "doUnpack"];
+
   name = s.name;
   meta = {
     description = "WebKit - a fast and correct HTML renderer";
     maintainers = [stdenv.lib.maintainers.raskin];
   };
   passthru = {
-    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg;
+    inherit gstreamer gst_plugins_base gst_plugins_good gst_ffmpeg libsoup;
   };
 }
diff --git a/pkgs/development/libraries/webkit/src-for-default.nix b/pkgs/development/libraries/webkit/src-for-default.nix
index 30e129e2fae..65bcd435096 100644
--- a/pkgs/development/libraries/webkit/src-for-default.nix
+++ b/pkgs/development/libraries/webkit/src-for-default.nix
@@ -1,9 +1,10 @@
 rec {
-   version="1.6.3";
-   name="webkit-1.6.3";
-   hash="1hvph13ak7a85qmj1ikanwxf2nn53m5f6a50j627lp49db7dpl0j";
-   url="http://webkitgtk.org/webkit-1.6.3.tar.xz";
-   advertisedUrl="http://webkitgtk.org/webkit-1.6.3.tar.xz";
+   version="1.8.1";
+   name="webkit-1.8.1";
+   hash="0a1v3v8dp2cl332qr51j4fpl0rwpgxbf29hn3zdim9hcniv6l4ls";
+   url="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
+   advertisedUrl="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
   
   
 }
+
diff --git a/pkgs/development/libraries/webkit/src-for-gtk2.nix b/pkgs/development/libraries/webkit/src-for-gtk2.nix
index 5f5149fedfe..65bcd435096 100644
--- a/pkgs/development/libraries/webkit/src-for-gtk2.nix
+++ b/pkgs/development/libraries/webkit/src-for-gtk2.nix
@@ -1,9 +1,10 @@
 rec {
-   version="1.4.0";
-   name="webkit-1.4.0";
-   hash="123zllzlnkjgw4d2ag73dvrjmkikbapxlz5730ps6y4qm43gxc1y";
-   url="http://webkitgtk.org/webkit-1.4.0.tar.gz";
-   advertisedUrl="http://webkitgtk.org/webkit-1.4.0.tar.gz";
+   version="1.8.1";
+   name="webkit-1.8.1";
+   hash="0a1v3v8dp2cl332qr51j4fpl0rwpgxbf29hn3zdim9hcniv6l4ls";
+   url="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
+   advertisedUrl="http://webkitgtk.org/releases/webkit-1.8.1.tar.xz";
   
   
 }
+
diff --git a/pkgs/development/libraries/wildmidi/default.nix b/pkgs/development/libraries/wildmidi/default.nix
new file mode 100644
index 00000000000..85e5726f863
--- /dev/null
+++ b/pkgs/development/libraries/wildmidi/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, alsaLib, freepats }:
+
+stdenv.mkDerivation rec {
+  name = "wildmidi-0.2.3.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/wildmidi/wildmidi/${name}.tar.gz";
+    sha256 = "0m75753mn0rbwja180c2qk53s149wp4k35dijr2i6pa7sc12fr00";
+  };
+
+  # NOTE: $out in configureFlags, like this:
+  #   configureFlags = "--disable-werror --with-wildmidi-cfg=$out/etc/wildmidi.cfg";
+  # is not expanded, so use this workaround:
+  preConfigure = ''
+    configureFlags="--disable-werror --with-wildmidi-cfg=$out/etc/wildmidi.cfg"
+  '';
+
+  buildInputs = [ alsaLib ];
+
+  postInstall = ''
+    mkdir "$out"/etc
+    echo "dir ${freepats}" > "$out"/etc/wildmidi.cfg
+    echo "source ${freepats}/freepats.cfg" >> "$out"/etc/wildmidi.cfg
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software MIDI player and library";
+    longDescription = ''
+      WildMIDI is a simple software midi player which has a core softsynth
+      library that can be use with other applications.
+    '';
+    homepage = http://wildmidi.sourceforge.net/;
+    # The library is LGPLv3, the wildmidi executable is GPLv3
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/development/libraries/wxGTK-2.8/default.nix b/pkgs/development/libraries/wxGTK-2.8/default.nix
index 43bcfea4f2e..10907726954 100644
--- a/pkgs/development/libraries/wxGTK-2.8/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.8/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   buildInputs = [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer gst_plugins_base GConf ]
     ++ optional withMesa mesa;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [
     "--enable-gtk2"
diff --git a/pkgs/development/libraries/wxGTK-2.9/default.nix b/pkgs/development/libraries/wxGTK-2.9/default.nix
index a0e69bff0fe..fca5a4a278e 100644
--- a/pkgs/development/libraries/wxGTK-2.9/default.nix
+++ b/pkgs/development/libraries/wxGTK-2.9/default.nix
@@ -7,18 +7,21 @@ assert withMesa -> mesa != null;
 
 with stdenv.lib;
 
+let
+  version = "2.9.4";
+in
 stdenv.mkDerivation {
-  name = "wxwidgets-2.9.3";
+  name = "wxwidgets-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/wxwindows/wxWidgets-2.9.3.tar.bz2";
-    sha256 = "739c31a360b5c46b55904a7fb086f5cdfff0816efbc491d8263349210bf323b2";
+    url = "mirror://sourceforge/wxwindows/wxWidgets-${version}.tar.bz2";
+    sha256 = "04jda4bns7cmp7xy68qz112yg0lribpc6xs5k9gilfqcyhshqlvc";
   };
 
   buildInputs = [ gtk libXinerama libSM libXxf86vm xf86vidmodeproto gstreamer gst_plugins_base GConf ]
     ++ optional withMesa mesa;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = [
     "--enable-gtk2"
diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix
index a5e045d27d6..9f53d36bb63 100644
--- a/pkgs/development/libraries/x264/default.nix
+++ b/pkgs/development/libraries/x264/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, yasm}:
 
 stdenv.mkDerivation rec {
-  version = "snapshot-20120129-2245-stable";
+  version = "snapshot-20130424-2245-stable";
   name = "x264-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-${version}.tar.bz2";
-    sha256 = "1i63xsa46a5l0ys3mqbcqr4gr5kpaf9fs05cbf0782iir5k07pcr";
+    sha256 = "0vzyqsgrm9k3hzka2p8ib92jl0ha8d4267r2rb3pr9gmpjaj9azk";
   };
 
   patchPhase = ''
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ yasm ];
 
-  meta = { 
+  meta = {
     description = "library for encoding H264/AVC video streams";
     homepage = http://www.videolan.org/developers/x264.html;
     license = "GPL";
diff --git a/pkgs/development/libraries/xine-lib/default.nix b/pkgs/development/libraries/xine-lib/default.nix
index 4ae48a4c04e..45c60acfa89 100644
--- a/pkgs/development/libraries/xine-lib/default.nix
+++ b/pkgs/development/libraries/xine-lib/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1mjk686h1qzqj51h4xs4xvagfgnnhm8czbzzjvr5w034pr8n8rg1";
   };
 
-  buildNativeInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkgconfig perl ];
 
   buildInputs = [
     xorg.libX11 xorg.libXv xorg.libXinerama xorg.libxcb xorg.libXext
diff --git a/pkgs/development/libraries/xmlsec/default.nix b/pkgs/development/libraries/xmlsec/default.nix
new file mode 100644
index 00000000000..afb23e4de35
--- /dev/null
+++ b/pkgs/development/libraries/xmlsec/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkgconfig, libgcrypt, libtool }:
+
+let
+  version = "1.2.19";
+in
+stdenv.mkDerivation rec {
+  name = "xmlsec-${version}";
+
+  src = fetchurl {
+    url = "http://www.aleksey.com/xmlsec/download/xmlsec1-${version}.tar.gz";
+    sha256 = "1h5ar0h8n0l8isgic82w00cwfpw7i9wxw17kbdb6q3yvzb4zgj1g";
+  };
+
+  buildInputs = [ libxml2 gnutls libxslt pkgconfig libgcrypt libtool ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.aleksey.com/xmlsec;
+    description = "XML Security Library in C based on libxml2";
+    license = "MIT";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/libraries/zeromq/default.nix b/pkgs/development/libraries/zeromq/2.x.nix
index 06beb9254f9..06beb9254f9 100644
--- a/pkgs/development/libraries/zeromq/default.nix
+++ b/pkgs/development/libraries/zeromq/2.x.nix
diff --git a/pkgs/development/libraries/zeromq/3.x.nix b/pkgs/development/libraries/zeromq/3.x.nix
new file mode 100644
index 00000000000..fbb3b5ad74f
--- /dev/null
+++ b/pkgs/development/libraries/zeromq/3.x.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, libuuid}:
+
+stdenv.mkDerivation rec {
+  name = "zeromq-3.2.1-rc2";
+
+  src = fetchurl {
+    url = "http://download.zeromq.org/${name}.tar.gz";
+    sha256 = "b0a70da77e39537120a1fa058c49434982741ecef5211edcd7aeab4caffb82b7";
+  };
+
+  buildInputs = [ libuuid ];
+
+  meta = {
+    homepage = "http://www.zeromq.org";
+    description = "The Intelligent Transport Layer";
+  };
+}
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 5e1ddf83951..ec47c35c153 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-static-libgcc";
 
   crossAttrs = {
-    dontStrip = if static then true else false;
+    dontStrip = static;
   } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {
     configurePhase=''
       installFlags="BINARY_PATH=$out/bin INCLUDE_PATH=$out/include LIBRARY_PATH=$out/lib"
diff --git a/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix b/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
index 83e800faa2c..3c28ed04dba 100644
--- a/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
+++ b/pkgs/development/misc/avr-gcc-with-avr-libc/default.nix
@@ -6,13 +6,18 @@ stdenv.mkDerivation {
   name = "avr-gcc-libc";
 
   srcBinutils = fetchurl {
-    url = "mirror://gnu/binutils/binutils-2.21.tar.bz2";
-    sha256 = "1iyhc42zfa0j2gaxy4zvpk47sdqj4rqvib0mb8597ss8yidyrav0";
+    url = "mirror://gnu/binutils/binutils-2.21.1.tar.bz2";
+    sha256 = "0m7nmd7gc9d9md43wbrv65hz6lbi2crqwryzpigv19ray1lzmv6d";
   };
 
   srcGCC = fetchurl {
-    url = "mirror://gcc/releases/gcc-4.6.1/gcc-core-4.6.1.tar.bz2";
-    sha256 = "0bbb8f754a31f29013f6e9ad4c755d92bb0f154a665c4b623e86ae7174d98e33";
+    url = "mirror://gcc/releases/gcc-4.6.3/gcc-core-4.6.3.tar.bz2";
+    sha256 = "1hai090f0svf886nyhn4glmfw54v9lz88w2izkx5iqhd3j400gi8";
+  };
+
+  srcGCCGPP = fetchurl {
+    url = "mirror://gcc/releases/gcc-4.6.3/gcc-g++-4.6.3.tar.bz2";
+    sha256 = "1s199gb6p65r5k69cdfqqcz5hgifw9bhyj65n2b91s80x4rwgq5k";
   };
 
   srcAVRLibc = fetchurl {
@@ -55,10 +60,11 @@ stdenv.mkDerivation {
 
     cd $TMP
     tar jxf $srcGCC
+    tar jxf $srcGCCGPP
       cd gcc-*
       mkdir obj-avr
       cd obj-avr
-      ../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c --disable-libssp --with-dwarf2
+      ../configure --target=avr --prefix="$prefix" --disable-nls --enable-languages=c,c++ --disable-libssp --with-dwarf2
       make $MAKE_FLAGS
       make install
 
diff --git a/pkgs/development/mobile/androidenv/addon.xml b/pkgs/development/mobile/androidenv/addon.xml
new file mode 100644
index 00000000000..fb5d324d778
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/addon.xml
@@ -0,0 +1,950 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<sdk:sdk-addon xmlns:sdk="http://schemas.android.com/sdk/android/addon/5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <sdk:license id="android-sdk-license" type="text">Terms and Conditions
+
+This is the Android Software Development Kit License Agreement.
+
+
+1. Introduction
+
+
+1.1 The Android Software Development Kit (referred to in this License Agreement as the &quot;SDK&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 &quot;Android&quot; means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+
+2. Accepting this License Agreement
+
+
+2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
+
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
+
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
+
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
+
+
+3. SDK License from Google
+
+
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
+
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement.  Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
+
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
+
+
+4. Use of the SDK by You
+
+
+4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+
+5. Your Developer Credentials
+
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+
+6. Privacy and Information
+
+
+6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
+
+
+7. Third Party Applications
+
+
+7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
+
+
+8. Using Android APIs
+
+
+8.1 Google Data APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+
+9. Terminating this License Agreement
+
+
+9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
+
+9.3 Google may at any time, terminate this License Agreement with you if:
+(A) you have breached any provision of this License Agreement; or
+(B) Google is required to do so by law; or
+(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
+(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+
+9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
+
+
+10. DISCLAIMER OF WARRANTIES
+
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+
+11. LIMITATION OF LIABILITY
+
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+
+12. Indemnification
+
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
+
+
+13. Changes to the License Agreement
+
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
+
+
+14. General Legal Terms
+
+
+14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
+
+14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+November 13, 2012
+    </sdk:license>
+
+    <sdk:license id="android-googletv-license" type="text">Terms and Conditions
+
+This is the Google TV Add-on for the Android Software Development Kit License Agreement.
+
+1. Introduction
+
+1.1 The Google TV Add-on for the Android Software Development Kit (referred to in this License Agreement as the &quot;Google TV Add-on&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the Google TV Add-on.
+
+1.2 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+2. Accepting this License Agreement
+
+2.1 In order to use the Google TV Add-on, you must first agree to this License Agreement. You may not use the Google TV Add-on if you do not accept this License Agreement.
+
+2.2 You can accept this License Agreement by:
+
+(A) clicking to accept or agree to this License Agreement, where this option is made available to you; or
+
+(B) by actually using the Google TV Add-on.  In this case, you agree that use of the Google TV Add-on constitutes acceptance of the License Agreement from that point onwards.
+
+2.3 You may not use the Google TV Add-on and may not accept the Licensing Agreement if you are a person barred from receiving the Google TV Add-on under the laws of the United States or other countries including the country in which you are resident or from which you use the Google TV Add-on.
+
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the Licensing Agreement or use the Google TV Add-on on behalf of your employer or other entity.
+
+3. Google TV Add-on License from Google
+
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non- assignable and non-exclusive license to use the Google TV Add-on solely to develop applications to run on the Google TV platform.
+
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the Google TV Add-on, including any Intellectual Property Rights that subsist in the Google TV Add-on. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the Google TV Add-on or any part of the Google TV Add-on. Except to the extent required by applicable third party licenses, you may not load any part of the Google TV Add-on onto a mobile handset, television, or any other hardware device except a personal computer, combine any part of the Google TV Add-on with other software, or distribute any software or device incorporating a part of the Google TV Add-on.
+
+3.4 Use, reproduction and distribution of components of the Google TV Add-on licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+
+3.5 You agree that the form and nature of the Google TV Add-on that Google provides may change without prior notice to you and that future versions of the Google TV Add-on may be incompatible with applications developed on previous versions of the Google TV Add-on. You agree that Google may stop (permanently or temporarily) providing the Google TV Add-on (or any features within the Google TV Add-on) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.6 Nothing in this License Agreement gives you a right to use any of Google's or it’s licensors’ trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.7 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the Google TV Add-on.
+
+4. Use of the Google TV Add-on by You
+
+4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the Google TV Add-on, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the Google TV Add-on and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the Google TV Add-on to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, your must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you explicit permission to do so.
+
+4.4 You agree that you will not engage in any activity with the Google TV Add-on, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google, Multichannel Video Program Distributors or any mobile communications carrier.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through the Google TV platform and/or applications for the Google TV platform, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+5. Your Developer Credentials
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+6. Privacy and Information
+
+6.1 In order to continually innovate and improve the Google TV Add-on, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the Google TV Add-on are being used and how they are being used. Before any of this information is collected, the Google TV Add-on will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the Google TV Add-on and is maintained in accordance with Google's Privacy Policy.
+
+7. Third Party Applications for the Google TV Platform
+
+7.1 If you use the Google TV Add-on to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
+
+8. Using Google TV APIs
+
+8.1 If you use any Google TV API to retrieve data from Google, you acknowledge that the data (“Google TV API Contentâ€) may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.  Some portions of the Google TV API Content are licensed to Google by third parties, including but not limited to Tribune Media Services
+
+8.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+8.3 Except as explicitly permitted in Section 3 (Google TV Add-on License from Google), you must:
+
+(a) not modify nor format the Google TV API Content except to the extent reasonably and technically necessary to optimize the display such Google TV API Content in your application;
+
+(b) not edit the Google TV API Content in a manner that renders the Google TV API Content inaccurate of alters its inherent meaning (provided that displaying excerpts will not violate the foregoing); or
+
+(c)  not create any commercial audience measurement tool or service using the Google TV API Content
+
+9. Terminating this License Agreement
+
+9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the Google TV Add-on and any relevant developer credentials.
+
+9.3 Google may at any time, terminate this License Agreement with you if:
+
+(A) you have breached any provision of this License Agreement; or
+
+(B) Google is required to do so by law; or
+
+(C) the partner with whom Google offered certain parts of Google TV Add-on (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the Google TV Add-on to you; or
+
+(D) Google decides to no longer providing the Google TV Add-on or certain parts of the Google TV Add-on to users in the country in which you are resident or from which you use the service, or the provision of the Google TV Add-on or certain Google TV Add-on services to you by Google is, in Google's sole discretion, no longer commercially viable.
+
+9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
+
+10. DISCLAIMER OF WARRANTIES
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE GOOGLE TV ADD-ON IS AT YOUR SOLE RISK AND THAT THE GOOGLE TV ADD-ON IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE GOOGLE TV ADD-ON AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE GOOGLE TV ADD-ON IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+11. LIMITATION OF LIABILITY
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+12. Indemnification
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the Google TV Add-on, (b) any application you develop on the Google TV Add-on that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
+
+13. Changes to the License Agreement
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the Google TV Add-on.
+
+14. General Legal Terms
+
+14.1 This License Agreement constitute the whole legal agreement between you and Google and govern your use of the Google TV Add-on (excluding any services which Google may provide to you under a separate written agreement), and completely replace any prior agreements between you and Google in relation to the Google TV Add-on.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that Google’s API data licensors and each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE GOOGLE TV ADD-ON IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE GOOGLE TV ADD-ON. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
+
+14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+
+August 15, 2011
+   </sdk:license>
+
+    <!-- ADD-ONS ....................... -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>3</sdk:api-level>
+        <sdk:revision>03</sdk:revision>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>34908058</sdk:size>
+                <sdk:checksum type="sha1">1f92abf3a76be66ae8032257fc7620acbd2b2e3a</sdk:checksum>
+                <sdk:url>google_apis-3-r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Tue Nov 24 16:38:28 PST 2009 using donut 20842: Platform. Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>4</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android + Google APIs, revision 2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>42435735</sdk:size>
+                <sdk:checksum type="sha1">9b6e86d8568558de4d606a7debc4f6049608dbd0</sdk:checksum>
+                <sdk:url>google_apis-4_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Thu Oct 22 10:16:34 PDT 2009 using eclair-sdk 17704: Platform. Addon. Tools. Doc. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>5</sdk:api-level>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android + Google APIs, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>49123776</sdk:size>
+                <sdk:checksum type="sha1">46eaeb56b645ee7ffa24ede8fa17f3df70db0503</sdk:checksum>
+                <sdk:url>google_apis-5_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Mon Nov 23 14:08:02 PST 2009 using eclair-release 20723: Platform. Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>6</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android + Google APIs, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>53382941</sdk:size>
+                <sdk:checksum type="sha1">5ff545d96e031e09580a6cf55713015c7d4936b2</sdk:checksum>
+                <sdk:url>google_apis-6_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Mon Dec 21 14:36:17 PST 2009 using eclair-release 22607: Platform. Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>7</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android + Google APIs, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>53691339</sdk:size>
+                <sdk:checksum type="sha1">2e7f91e0fe34fef7f58aeced973c6ae52361b5ac</sdk:checksum>
+                <sdk:url>google_apis-7_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Wed Jun 30 16:13:06 PDT 2010 using froyo-release 43546: Platform. Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>8</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android + Google APIs, API 8, revision 2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>59505020</sdk:size>
+                <sdk:checksum type="sha1">3079958e7ec87222cac1e6b27bc471b27bf2c352</sdk:checksum>
+                <sdk:url>google_apis-8_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Thu Jan 20 13:47:16 PST 2011 using gingerbread-sdk-release 93351: Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>9</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android + Google APIs, API 9, revision 2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>63401546</sdk:size>
+                <sdk:checksum type="sha1">78664645a1e9accea4430814f8694291a7f1ea5d</sdk:checksum>
+                <sdk:url>google_apis-9_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:obsolete/>
+    </sdk:add-on>
+
+    <!-- Generated on Thu May  5 15:52:16 PDT 2011 using gingerbread 123630: Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>10</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android + Google APIs, API 10, revision 2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>65781578</sdk:size>
+                <sdk:checksum type="sha1">cc0711857c881fa7534f90cf8cc09b8fe985484d</sdk:checksum>
+                <sdk:url>google_apis-10_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Thu Feb 17 08:43:44 PST 2011 using honeycomb 104254: Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>11</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android + Google APIs, API 11, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>83477179</sdk:size>
+                <sdk:checksum type="sha1">5eab5e81addee9f3576d456d205208314b5146a5</sdk:checksum>
+                <sdk:url>google_apis-11_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Wed May  4 19:44:46 PDT 2011 using honeycomb-mr1 123685: Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>12</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android + Google APIs, API 12, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>86099835</sdk:size>
+                <sdk:checksum type="sha1">e9999f4fa978812174dfeceec0721c793a636e5d</sdk:checksum>
+                <sdk:url>google_apis-12_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <!-- Generated on Fri Jul 15 11:51:11 PDT 2011 using honeycomb-mr2 142871: Addon. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:api-level>13</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android + Google APIs, API 13, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>88615525</sdk:size>
+                <sdk:checksum type="sha1">3b153edd211c27dc736c893c658418a4f9041417</sdk:checksum>
+                <sdk:url>google_apis-13_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+                <sdk:description>API for Google Maps.</sdk:description>
+            </sdk:lib>
+        </sdk:libs>
+    </sdk:add-on>
+
+    <sdk:add-on>
+        <!-- Generated at Wed Dec  7 13:47:50 2011 from git_ics-mr0 @ 229537 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:api-level>14</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.android.future.usb.accessory</sdk:name>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>106533714</sdk:size>
+                <sdk:checksum type="sha1">f8eb4d96ad0492b4c0db2d7e4f1a1a3836664d39</sdk:checksum>
+                <sdk:url>google_apis-14_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+    </sdk:add-on>
+
+    <sdk:add-on>
+        <!-- Generated at Fri Mar 30 10:45:40 2012 from ics-mr1 @ 302030 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:api-level>15</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.android.future.usb.accessory</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.google.android.media.effects</sdk:name>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>106612472</sdk:size>
+                <sdk:checksum type="sha1">6757c12788da0ea00c2ab58e54cb438b9f2bcf66</sdk:checksum>
+                <sdk:url>google_apis-15_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:add-on>
+
+    <sdk:add-on>
+        <!-- Generated at Tue Oct  9 14:06:38 2012 from git_jb-dev @ 495790 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:api-level>16</sdk:api-level>
+        <sdk:revision>3</sdk:revision>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.android.future.usb.accessory</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.google.android.media.effects</sdk:name>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>127278413</sdk:size>
+                <sdk:checksum type="sha1">63467dd32f471e3e81e33e9772c22f33235aa3b3</sdk:checksum>
+                <sdk:url>google_apis-16_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:add-on>
+
+    <!-- GOOGLE TV ADDONS ............. -->
+
+    <sdk:add-on>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_tv_addon</sdk:name-id>
+        <sdk:name-display>Google TV Addon</sdk:name-display>
+        <sdk:api-level>12</sdk:api-level>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android + Google TV, API 12, preview release</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-googletv-license"/>
+        <sdk:archives>
+            <sdk:archive os="linux">
+                <sdk:size>78266751</sdk:size>
+                <sdk:checksum type="sha1">92128a12e7e8b0fb5bac59153d7779b717e7b840</sdk:checksum>
+                <sdk:url>google_tv-12_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:libs/>
+    </sdk:add-on>
+
+    <sdk:add-on>
+        <!-- Generated at Mon Nov 12 17:15:51 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-id>google_apis</sdk:name-id>
+        <sdk:name-display>Google APIs</sdk:name-display>
+        <sdk:description>Android + Google APIs</sdk:description>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:libs>
+            <sdk:lib>
+                <sdk:name>com.google.android.maps</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.android.future.usb.accessory</sdk:name>
+            </sdk:lib>
+            <sdk:lib>
+                <sdk:name>com.google.android.media.effects</sdk:name>
+            </sdk:lib>
+        </sdk:libs>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>132568033</sdk:size>
+                <sdk:checksum type="sha1">62cb086f11e15713878c8834d58ef1a2454c19a4</sdk:checksum>
+                <sdk:url>google_apis-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:add-on>
+
+    <!-- EXTRAS VENDOR=ANDROID ........................ -->
+
+    <sdk:extra>
+        <!-- Generated at Mon Nov 12 17:16:25 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>11</sdk:revision>
+        <sdk:vendor-display>Android</sdk:vendor-display>
+        <sdk:vendor-id>android</sdk:vendor-id>
+        <sdk:name-display>Android Support Library</sdk:name-display>
+        <sdk:path>support</sdk:path>
+        <sdk:old-paths>compatibility</sdk:old-paths>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>1264808</sdk:size>
+                <sdk:checksum type="sha1">d30d182d8e4c86bb4464c03a83ccffce7bc84ecd</sdk:checksum>
+                <sdk:url>support_r11.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <!-- EXTRAS VENDOR=GOOGLE ....................... -->
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Play Licensing Library</sdk:name-display>
+        <sdk:path>play_licensing</sdk:path>
+        <sdk:old-paths>market_licensing</sdk:old-paths>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Google Play Licensing client library</sdk:description>
+        <sdk:desc-url>http://developer.android.com/guide/publishing/licensing.html</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>75109</sdk:size>
+                <sdk:checksum type="sha1">355e8dc304a92a5616db235af8ee7bd554356254</sdk:checksum>
+                <sdk:url>market_licensing-r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Play APK Expansion Library</sdk:name-display>
+        <sdk:path>play_apk_expansion</sdk:path>
+        <sdk:old-paths>market_apk_expansion</sdk:old-paths>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Google Play APK Expansion library</sdk:description>
+        <sdk:desc-url>http://developer.android.com/guide/market/expansion-files.html</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>111636</sdk:size>
+                <sdk:checksum type="sha1">47fa8c691fcc8cf815e7ebbf140f12e94495f73b</sdk:checksum>
+                <sdk:url>market_apk_expansion-r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Play services</sdk:name-display>
+        <sdk:path>google_play_services</sdk:path>
+        <sdk:revision>4</sdk:revision>
+        <sdk:description>Google Play Services client library and sample code</sdk:description>
+        <sdk:desc-url>https://developers.google.com/android/google-play-services/index</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>3732458</sdk:size>
+                <sdk:checksum type="sha1">bbb3d11225fcf60a0bae75afa2c4737010468bf6</sdk:checksum>
+                <sdk:url>google_play_services_2012110_r04.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+    </sdk:extra>
+
+    <sdk:extra>
+        <!-- Generated at Tue Aug 28 11:07:05 2012 from git_master @ 449897 -->
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google USB Driver</sdk:name-display>
+        <sdk:path>usb_driver</sdk:path>
+        <sdk:revision>7</sdk:revision>
+        <sdk:description>USB Driver for Windows, revision 7</sdk:description>
+        <sdk:desc-url>http://developer.android.com/</sdk:desc-url>
+        <sdk:uses-license ref="android-sdk-license"/>
+        <sdk:archives>
+            <sdk:archive os="windows">
+                <sdk:size>8681704</sdk:size>
+                <sdk:checksum type="sha1">147c339fde22f98ae41b15349a8303d39a2cf6e5</sdk:checksum>
+                <sdk:url>usb_driver_r07-windows.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Play Billing Library</sdk:name-display>
+        <sdk:path>play_billing</sdk:path>
+        <sdk:old-paths>market_billing</sdk:old-paths>
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Google Play Billing files and sample code</sdk:description>
+        <sdk:desc-url>http://developer.android.com/google/play/billing/index.html</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>435718</sdk:size>
+                <sdk:checksum type="sha1">a133d454c992ef2a18e62fa810e8185f1be4b054</sdk:checksum>
+                <sdk:url>play_billing_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google AdMob Ads SDK</sdk:name-display>
+        <sdk:path>admob_ads_sdk</sdk:path>
+        <sdk:revision>8</sdk:revision>
+        <sdk:description>AdMob Ads SDK</sdk:description>
+        <sdk:desc-url>https://developers.google.com/mobile-ads-sdk/docs/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>545547</sdk:size>
+                <sdk:checksum type="sha1">031476aa5a491239d2624e8de8c9e46e40d93e3f</sdk:checksum>
+                <sdk:url>https://dl-ssl.google.com/googleadmobadssdk/googleadmobadssdkandroid-6.2.1.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Analytics SDK</sdk:name-display>
+        <sdk:path>analytics_sdk</sdk:path>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Analytics SDK</sdk:description>
+        <sdk:desc-url>http://code.google.com/mobile/analytics/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>53055</sdk:size>
+                <sdk:checksum type="sha1">328bcdc6c241879ebb04d6edc6fec1052a171004</sdk:checksum>
+                <sdk:url>https://dl.google.com/gaformobileapps/GoogleAnalyticsAndroid_1.4.2.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Web Driver</sdk:name-display>
+        <sdk:path>webdriver</sdk:path>
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>WebDriver</sdk:description>
+        <sdk:desc-url>http://selenium.googlecode.com</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>4055193</sdk:size>
+                <sdk:checksum type="sha1">13f3a3b2670a5fc04a7342861644be9a01b07e38</sdk:checksum>
+                <sdk:url>webdriver_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+
+    <sdk:extra>
+        <sdk:vendor-id>google</sdk:vendor-id>
+        <sdk:vendor-display>Google Inc.</sdk:vendor-display>
+        <sdk:name-display>Google Cloud Messaging for Android Library</sdk:name-display>
+        <sdk:path>gcm</sdk:path>
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Google Cloud Messaging for Android library and sample code</sdk:description>
+        <sdk:desc-url>https://developers.google.com/android/gcm/index</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive os="any">
+                <sdk:size>5901400</sdk:size>
+                <sdk:checksum type="sha1">ad066fd0dc7fc99d8aadac09c65a3c2519fbc7bf</sdk:checksum>
+                <sdk:url>gcm_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:extra>
+</sdk:sdk-addon>
diff --git a/pkgs/development/mobile/androidenv/addons.nix b/pkgs/development/mobile/androidenv/addons.nix
new file mode 100644
index 00000000000..f26db5c2cb7
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/addons.nix
@@ -0,0 +1,198 @@
+
+{stdenv, fetchurl, unzip}:
+
+let
+  buildGoogleApis = args:
+    stdenv.mkDerivation (args // {
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+      '';
+    });
+in
+{
+    
+  google_apis_3 = buildGoogleApis {
+    name = "google_apis-3";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-3-r03.zip;
+        sha1 = "1f92abf3a76be66ae8032257fc7620acbd2b2e3a";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_4 = buildGoogleApis {
+    name = "google_apis-4";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-4_r02.zip;
+        sha1 = "9b6e86d8568558de4d606a7debc4f6049608dbd0";
+      };
+      meta = {
+        description = "Android + Google APIs, revision 2";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_5 = buildGoogleApis {
+    name = "google_apis-5";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-5_r01.zip;
+        sha1 = "46eaeb56b645ee7ffa24ede8fa17f3df70db0503";
+      };
+      meta = {
+        description = "Android + Google APIs, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_6 = buildGoogleApis {
+    name = "google_apis-6";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-6_r01.zip;
+        sha1 = "5ff545d96e031e09580a6cf55713015c7d4936b2";
+      };
+      meta = {
+        description = "Android + Google APIs, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_7 = buildGoogleApis {
+    name = "google_apis-7";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-7_r01.zip;
+        sha1 = "2e7f91e0fe34fef7f58aeced973c6ae52361b5ac";
+      };
+      meta = {
+        description = "Android + Google APIs, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_8 = buildGoogleApis {
+    name = "google_apis-8";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-8_r02.zip;
+        sha1 = "3079958e7ec87222cac1e6b27bc471b27bf2c352";
+      };
+      meta = {
+        description = "Android + Google APIs, API 8, revision 2";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_9 = buildGoogleApis {
+    name = "google_apis-9";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-9_r02.zip;
+        sha1 = "78664645a1e9accea4430814f8694291a7f1ea5d";
+      };
+      meta = {
+        description = "Android + Google APIs, API 9, revision 2";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_10 = buildGoogleApis {
+    name = "google_apis-10";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-10_r02.zip;
+        sha1 = "cc0711857c881fa7534f90cf8cc09b8fe985484d";
+      };
+      meta = {
+        description = "Android + Google APIs, API 10, revision 2";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_11 = buildGoogleApis {
+    name = "google_apis-11";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-11_r01.zip;
+        sha1 = "5eab5e81addee9f3576d456d205208314b5146a5";
+      };
+      meta = {
+        description = "Android + Google APIs, API 11, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_12 = buildGoogleApis {
+    name = "google_apis-12";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-12_r01.zip;
+        sha1 = "e9999f4fa978812174dfeceec0721c793a636e5d";
+      };
+      meta = {
+        description = "Android + Google APIs, API 12, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_13 = buildGoogleApis {
+    name = "google_apis-13";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-13_r01.zip;
+        sha1 = "3b153edd211c27dc736c893c658418a4f9041417";
+      };
+      meta = {
+        description = "Android + Google APIs, API 13, revision 1";
+        url = http://developer.android.com/;
+      };
+    };
+    
+  google_apis_14 = buildGoogleApis {
+    name = "google_apis-14";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-14_r02.zip;
+        sha1 = "f8eb4d96ad0492b4c0db2d7e4f1a1a3836664d39";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        
+      };
+    };
+    
+  google_apis_15 = buildGoogleApis {
+    name = "google_apis-15";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-15_r02.zip;
+        sha1 = "6757c12788da0ea00c2ab58e54cb438b9f2bcf66";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        
+      };
+    };
+    
+  google_apis_16 = buildGoogleApis {
+    name = "google_apis-16";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-16_r03.zip;
+        sha1 = "63467dd32f471e3e81e33e9772c22f33235aa3b3";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        
+      };
+    };
+    
+  google_apis_17 = buildGoogleApis {
+    name = "google_apis-17";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/google_apis-17_r01.zip;
+        sha1 = "62cb086f11e15713878c8834d58ef1a2454c19a4";
+      };
+      meta = {
+        description = "Android + Google APIs";
+        
+      };
+    };
+    
+}
+  
\ No newline at end of file
diff --git a/pkgs/development/mobile/androidenv/androidsdk.nix b/pkgs/development/mobile/androidenv/androidsdk.nix
new file mode 100644
index 00000000000..e8e1f919fe4
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/androidsdk.nix
@@ -0,0 +1,194 @@
+{ stdenv, stdenv_32bit, fetchurl, unzip, makeWrapper
+, platformTools, support, platforms, sysimages, addons
+, zlib_32bit
+, libX11_32bit, libxcb_32bit, libXau_32bit, libXdmcp_32bit, libXext_32bit
+, libX11, libXext, libXrender, libxcb, libXau, libXdmcp
+, freetype, fontconfig, gtk, atk
+}:
+{platformVersions, useGoogleAPIs}:
+
+stdenv.mkDerivation {
+  name = "android-sdk-21";
+  
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    then fetchurl {
+      url = http://dl.google.com/android/android-sdk_r21-linux.tgz;
+      md5 = "7f8d73b629f808cdcfc9f9900bbd7580";
+    }
+    else if stdenv.system == "x86_64-darwin" then fetchurl {
+      url = http://dl.google.com/android/android-sdk_r21-macosx.zip;
+      md5 = "67e46adca90dd18d7291443f6c15d6af";
+    }
+    else throw "platform not ${stdenv.system} supported!";
+  
+  buildCommand = ''
+    mkdir -p $out/libexec
+    cd $out/libexec
+    unpackFile $src;
+    
+    cd android-sdk-*/tools
+    
+    ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    ''
+      # There are a number of native binaries. We must patch them to let them find the interpreter and libstdc++
+    
+      for i in dmtracedump emulator emulator-arm emulator-mips emulator-x86 hprof-conv mksdcard sqlite3
+      do
+          patchelf --set-interpreter ${stdenv_32bit.gcc.libc}/lib/ld-linux.so.2 $i
+          patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib $i
+      done
+    
+      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+        # We must also patch the 64-bit emulator instances, if needed
+        
+        for i in emulator64-arm emulator64-mips emulator64-x86
+        do
+            patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 $i
+            patchelf --set-rpath ${stdenv.gcc.gcc}/lib64 $i
+        done
+      ''}
+      
+      # These tools also need zlib in addition to libstdc++
+    
+      for i in etc1tool zipalign
+      do
+          patchelf --set-interpreter ${stdenv_32bit.gcc.libc}/lib/ld-linux.so.2 $i
+          patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib:${zlib_32bit}/lib $i
+      done
+    
+      # The emulators need additional libraries, which are not in the RPATH => let's wrap them
+    
+      for i in emulator emulator-arm emulator-mips emulator-x86
+      do
+          wrapProgram `pwd`/$i \
+            --prefix LD_LIBRARY_PATH : `pwd`/lib:${libX11_32bit}/lib:${libxcb_32bit}/lib:${libXau_32bit}/lib:${libXdmcp_32bit}/lib:${libXext_32bit}/lib
+      done
+      
+      ${stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+        for i in emulator64-arm emulator64-mips emulator64-x86
+        do
+            wrapProgram `pwd`/$i \
+            --prefix LD_LIBRARY_PATH : `pwd`/lib:${libX11}/lib:${libxcb}/lib:${libXau}/lib:${libXdmcp}/lib:${libXext}/lib
+        done
+      ''}
+    ''}
+
+    patchShebangs .
+    
+    ${if stdenv.system == "i686-linux" then
+      ''
+        # The monitor requires some more patching
+        
+        cd lib/monitor-x86
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux.so.2 monitor
+        patchelf --set-rpath ${libX11}/lib:${libXext}/lib:${libXrender}/lib:${freetype}/lib:${fontconfig}/lib libcairo-swt.so
+        
+        wrapProgram `pwd`/monitor \
+          --prefix LD_LIBRARY_PATH : ${gtk}/lib:${atk}/lib:${stdenv.gcc.gcc}/lib
+
+        cd ../..
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        # The monitor requires some more patching
+        
+        cd lib/monitor-x86_64
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 monitor
+        patchelf --set-rpath ${libX11}/lib:${libXext}/lib:${libXrender}/lib:${freetype}/lib:${fontconfig}/lib libcairo-swt.so
+        
+        wrapProgram `pwd`/monitor \
+          --prefix LD_LIBRARY_PATH : ${gtk}/lib:${atk}/lib:${stdenv.gcc.gcc}/lib
+
+        cd ../..
+      ''
+      else ""}
+    
+    # Symlink the other sub packages
+    
+    cd ..
+    ln -s ${platformTools}/platform-tools
+    ln -s ${support}/support
+    
+    # Symlink required Google API add-ons
+    
+    mkdir -p add-ons
+    cd add-ons
+    
+    ${if useGoogleAPIs then
+        stdenv.lib.concatMapStrings (platformVersion:
+        if (builtins.hasAttr ("google_apis_"+platformVersion) addons) then
+          let
+            googleApis = builtins.getAttr ("google_apis_"+platformVersion) addons;
+          in
+          "ln -s ${googleApis}/* addon-google_apis-${platformVersion}"
+        else "") platformVersions
+      else ""}
+      
+    cd ..
+
+    # Symlink required platforms
+   
+    mkdir -p platforms
+    cd platforms
+    
+    ${stdenv.lib.concatMapStrings (platformVersion:
+      if (builtins.hasAttr ("platform_"+platformVersion) platforms) then
+        let
+          platform = builtins.getAttr ("platform_"+platformVersion) platforms;
+        in
+        "ln -s ${platform}/* android-${platformVersion}"
+      else ""
+    ) platformVersions}
+    
+    cd ..
+    
+    # Symlink required system images
+  
+    mkdir -p system-images
+    cd system-images
+    
+    ${stdenv.lib.concatMapStrings (platformVersion:
+      if (builtins.hasAttr ("sysimg_"+platformVersion) sysimages) then
+        let
+          sysimg = builtins.getAttr ("sysimg_"+platformVersion) sysimages;
+        in
+        ''
+          mkdir -p android-${platformVersion}
+          cd android-${platformVersion}
+          ln -s ${sysimg}/*
+          cd ..
+        ''
+      else ""
+    ) platformVersions}
+    
+    # Create wrappers to the most important tools and platform tools so that we can run them if the SDK is in our PATH
+    
+    ensureDir $out/bin
+
+    for i in $out/libexec/android-sdk-*/tools/*
+    do
+        if [ ! -d $i ] && [ -x $i ]
+        then
+            ( echo '#! ${stdenv.shell} -e'
+              echo "cd $out/libexec/android-sdk-*/tools"
+              echo "exec ./$(basename $i) \"\$@\"" ) > $out/bin/$(basename $i)
+          
+              chmod +x $out/bin/$(basename $i)
+        fi
+    done
+    
+    for i in $out/libexec/android-sdk-*/platform-tools/*
+    do
+        if [ ! -d $i ] && [ -x $i ]
+        then
+            ( echo '#! ${stdenv.shell} -e'
+              echo "cd $out/libexec/android-sdk-*/platform-tools"
+              echo "exec ./$(basename $i) \"\$@\"") > $out/bin/$(basename $i)
+          
+              chmod +x $out/bin/$(basename $i)
+        fi
+    done
+  '';
+  
+  buildInputs = [ unzip makeWrapper ];
+}
diff --git a/pkgs/development/mobile/androidenv/build-app.nix b/pkgs/development/mobile/androidenv/build-app.nix
new file mode 100644
index 00000000000..8b770ede0fc
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/build-app.nix
@@ -0,0 +1,45 @@
+{ stdenv, androidsdk, jdk, ant }:
+{ name, src, platformVersions ? [ "8" ], useGoogleAPIs ? false
+, release ? false, keyStore ? null, keyAlias ? null, keyStorePassword ? null, keyAliasPassword ? null
+}:
+
+assert release -> keyStore != null && keyAlias != null && keyStorePassword != null && keyAliasPassword != null;
+
+let
+  platformName = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then "linux"
+    else if stdenv.system == "x86_64-darwin" then "macosx"
+    else throw "Platform: ${stdenv.system} is not supported!";
+
+  androidsdkComposition = androidsdk { inherit platformVersions useGoogleAPIs; };
+in
+stdenv.mkDerivation {
+  name = stdenv.lib.replaceChars [" "] [""] name;
+  inherit src;
+  
+  ANDROID_HOME = "${androidsdkComposition}/libexec/android-sdk-${platformName}";
+
+  buildInputs = [ jdk ant ];
+  
+  buildPhase = ''
+    ${stdenv.lib.optionalString release ''
+    
+      # Provide key singing attributes
+      ( echo "key.store=${keyStore}"
+        echo "key.alias=${keyAlias}"
+        echo "key.store.password=${keyStorePassword}"
+        echo "key.alias.password=${keyAliasPassword}"
+      ) >> ant.properties
+    ''}
+  
+    export ANDROID_SDK_HOME=`pwd` # Key files cannot be stored in the user's home directory. This overrides it.
+    ant ${if release then "release" else "debug"}
+  '';
+  
+  installPhase = ''
+    mkdir -p $out
+    mv bin/*-${if release then "release" else "debug"}.apk $out
+    
+    mkdir -p $out/nix-support
+    echo "file binary-dist \"$(echo $out/*.apk)\"" > $out/nix-support/hydra-build-products
+  '';
+}
diff --git a/pkgs/development/mobile/androidenv/default.nix b/pkgs/development/mobile/androidenv/default.nix
new file mode 100644
index 00000000000..a76deb98b6e
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/default.nix
@@ -0,0 +1,62 @@
+{pkgs, pkgs_i686}:
+
+rec {
+  platformTools = import ./platform-tools.nix {
+    inherit (pkgs) stdenv fetchurl unzip;
+    inherit (pkgs_i686) zlib ncurses;
+    stdenv_32bit = pkgs_i686.stdenv;
+  };
+  
+  support = import ./support.nix {
+    inherit (pkgs) stdenv fetchurl unzip;
+  };
+  
+  platforms = if (pkgs.stdenv.system == "i686-linux" || pkgs.stdenv.system == "x86_64-linux")
+    then import ./platforms-linux.nix {
+      inherit (pkgs) stdenv fetchurl unzip;
+    }
+    else if pkgs.stdenv.system == "x86_64-darwin"
+    then import ./platforms-macosx.nix {
+      inherit (pkgs) stdenv fetchurl unzip;
+    }
+    else throw "Platform: ${pkgs.stdenv.system} not supported!";
+
+  sysimages = import ./sysimages.nix {
+    inherit (pkgs) stdenv fetchurl unzip;
+  };
+
+  addons = import ./addons.nix {
+    inherit (pkgs) stdenv fetchurl unzip;
+  };
+
+  androidsdk = import ./androidsdk.nix {
+    inherit (pkgs) stdenv fetchurl unzip makeWrapper;
+    inherit (pkgs) freetype fontconfig gtk atk;
+    inherit (pkgs.xorg) libX11 libXext libXrender libxcb libXau libXdmcp;
+    
+    inherit platformTools support platforms sysimages addons;
+    
+    stdenv_32bit = pkgs_i686.stdenv;
+    zlib_32bit = pkgs_i686.zlib;
+    libX11_32bit = pkgs_i686.xorg.libX11;
+    libxcb_32bit = pkgs_i686.xorg.libxcb;
+    libXau_32bit = pkgs_i686.xorg.libXau;
+    libXdmcp_32bit = pkgs_i686.xorg.libXdmcp;
+    libXext_32bit = pkgs_i686.xorg.libXext;
+  };
+  
+  androidsdk_4_1 = androidsdk {
+    platformVersions = [ "16" ];
+    useGoogleAPIs = true;
+  };
+  
+  buildApp = import ./build-app.nix {
+    inherit (pkgs) stdenv jdk ant;
+    inherit androidsdk;
+  };
+  
+  emulateApp = import ./emulate-app.nix {
+    inherit (pkgs) stdenv;
+    inherit androidsdk;
+  };
+}
diff --git a/pkgs/development/mobile/androidenv/emulate-app.nix b/pkgs/development/mobile/androidenv/emulate-app.nix
new file mode 100644
index 00000000000..3cbe5723806
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/emulate-app.nix
@@ -0,0 +1,87 @@
+{stdenv, androidsdk}:
+{name, app, platformVersion ? "8", useGoogleAPIs ? false, package, activity}:
+
+let
+  androidsdkComposition = androidsdk { inherit useGoogleAPIs; platformVersions = [ platformVersion ]; };
+in
+stdenv.mkDerivation {
+  inherit name;
+  
+  buildCommand = ''
+    mkdir -p $out/bin
+    
+    cat > $out/bin/run-test-emulator << "EOF"
+    #!/bin/sh -e
+    
+    # We need a TMPDIR
+    if [ "$TMPDIR" = "" ]
+    then
+        export TMPDIR=/tmp
+    fi
+    
+    # Store the virtual devices somewhere else, instead of polluting a user's HOME directory
+    export ANDROID_SDK_HOME=$(mktemp -d $TMPDIR/nix-android-vm-XXXX)
+    
+    # We have to look for a free TCP port
+    
+    echo "Looking for a free TCP port in range 5554-5584"
+    
+    for i in $(seq 5554 2 5584)
+    do
+        if [ -z "$(${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb devices | grep emulator-$i)" ]
+        then
+            port=$i
+            break
+        fi
+    done
+    
+    if [ -z "$port" ]
+    then
+        echo "Unfortunately, the emulator port space is exhausted!"
+        exit 1
+    else
+        echo "We have a free TCP port: $port"
+    fi
+    
+    export ANDROID_SERIAL="emulator-$port"
+    
+    # Create a virtual android device
+    ${androidsdkComposition}/libexec/android-sdk-*/tools/android create avd -n device -t ${if useGoogleAPIs then "'Google Inc.:Google APIs:"+platformVersion+"'" else "android-"+platformVersion}
+    
+    # Launch the emulator
+    ${androidsdkComposition}/libexec/android-sdk-*/tools/emulator -avd device -no-boot-anim -port $port &
+
+    # Wait until the device has completely booted
+    
+    echo "Waiting until the emulator has booted the device and the package manager is ready..."
+    
+    ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port wait-for-device
+    
+    echo "Device state has been reached"
+    
+    while [ -z "$(${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port shell getprop dev.bootcomplete | grep 1)" ]
+    do
+        sleep 5
+    done
+    
+    echo "dev.bootcomplete property is 1"
+    
+    #while [ -z "$(${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port shell getprop sys.boot_completed | grep 1)" ]
+    #do
+        #sleep 5
+    #done
+    
+    #echo "sys.boot_completed property is 1"
+    
+    echo "ready"
+    
+    # Install the App through the debugger
+    ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port install ${app}/*.apk
+    
+    # Start the application
+    ${androidsdkComposition}/libexec/android-sdk-*/platform-tools/adb -s emulator-$port shell am start -a android.intent.action.MAIN -n ${package}/.${activity}
+    EOF
+    
+    chmod +x $out/bin/run-test-emulator
+  '';
+}
diff --git a/pkgs/development/mobile/androidenv/generate-addons.sh b/pkgs/development/mobile/androidenv/generate-addons.sh
new file mode 100755
index 00000000000..9b2cf34eabc
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-addons.sh
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+xsltproc generate-addons.xsl addon.xml > addons.nix
diff --git a/pkgs/development/mobile/androidenv/generate-addons.xsl b/pkgs/development/mobile/androidenv/generate-addons.xsl
new file mode 100644
index 00000000000..0100b980a4e
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-addons.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:sdk="http://schemas.android.com/sdk/android/addon/5">
+
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+  <xsl:template match="/sdk:sdk-addon">
+{stdenv, fetchurl, unzip}:
+
+let
+  buildGoogleApis = args:
+    stdenv.mkDerivation (args // {
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+      '';
+    });
+in
+{
+    <xsl:for-each select="sdk:add-on[sdk:name-id='google_apis']">
+  google_apis_<xsl:value-of select="sdk:api-level" /> = buildGoogleApis {
+    name = "<xsl:value-of select="sdk:name-id" />-<xsl:value-of select="sdk:api-level" />";
+      src = fetchurl {
+        url = https://dl-ssl.google.com/android/repository/<xsl:value-of select="sdk:archives/sdk:archive[@os='any']/sdk:url" />;
+        sha1 = "<xsl:value-of select="sdk:archives/sdk:archive[@os='any']/sdk:checksum[@type='sha1']" />";
+      };
+      meta = {
+        description = "<xsl:value-of select="sdk:description" />";
+        <xsl:for-each select="sdk:desc-url">url = <xsl:value-of select="." />;</xsl:for-each>
+      };
+    };
+    </xsl:for-each>
+}
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/pkgs/development/mobile/androidenv/generate-platforms.sh b/pkgs/development/mobile/androidenv/generate-platforms.sh
new file mode 100755
index 00000000000..983d8bde87b
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-platforms.sh
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+xsltproc --stringparam os linux generate-platforms.xsl repository-7.xml > platforms-linux.nix
+xsltproc --stringparam os macosx generate-platforms.xsl repository-7.xml > platforms-macosx.nix
diff --git a/pkgs/development/mobile/androidenv/generate-platforms.xsl b/pkgs/development/mobile/androidenv/generate-platforms.xsl
new file mode 100644
index 00000000000..1802ae63efe
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-platforms.xsl
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:sdk="http://schemas.android.com/sdk/android/repository/7">
+
+  <xsl:param name="os" />
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+  <xsl:template match="/sdk:sdk-repository">
+{stdenv, fetchurl, unzip}:
+
+let
+  buildPlatform = args:
+    stdenv.mkDerivation (args // {   
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+    '';
+  });
+in
+{
+    <xsl:for-each select="sdk:platform">
+  platform_<xsl:value-of select="sdk:api-level" /> = buildPlatform {
+    name = "android-platform-<xsl:value-of select="sdk:version" />";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/<xsl:value-of select="sdk:archives/sdk:archive[@os=$os or @os='any']/sdk:url" />;
+      sha1 = "<xsl:value-of select="sdk:archives/sdk:archive[@os=$os or @os='any']/sdk:checksum[@type='sha1']" />";
+    };
+    meta = {
+      description = "<xsl:value-of select="sdk:description" />";
+      <xsl:for-each select="sdk:desc-url">url = <xsl:value-of select="." />;</xsl:for-each>
+    };
+  };
+    </xsl:for-each>
+}
+  </xsl:template>
+</xsl:stylesheet>
diff --git a/pkgs/development/mobile/androidenv/generate-sysimages.sh b/pkgs/development/mobile/androidenv/generate-sysimages.sh
new file mode 100755
index 00000000000..dc28c27f45f
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-sysimages.sh
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+
+xsltproc generate-sysimages.xsl repository-7.xml > sysimages.nix
diff --git a/pkgs/development/mobile/androidenv/generate-sysimages.xsl b/pkgs/development/mobile/androidenv/generate-sysimages.xsl
new file mode 100644
index 00000000000..1224ebbd4e8
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/generate-sysimages.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:str="http://exslt.org/strings"
+  xmlns:sdk="http://schemas.android.com/sdk/android/repository/7">
+
+  <xsl:output omit-xml-declaration="yes" indent="no" />
+
+  <xsl:template match="/sdk:sdk-repository">
+{stdenv, fetchurl, unzip}:
+
+let
+  buildSystemImage = args:
+    stdenv.mkDerivation (args // {   
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+    '';
+  });
+in
+{
+    <xsl:for-each select="sdk:system-image">
+  sysimg_<xsl:value-of select="sdk:api-level" /> = buildSystemImage {
+    name = "<xsl:value-of select="sdk:abi" />-<xsl:value-of select="sdk:api-level" />";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/<xsl:value-of select="sdk:archives/sdk:archive[@os='any']/sdk:url" />;
+      sha1 = "<xsl:value-of select="sdk:archives/sdk:archive[@os='any']/sdk:checksum[@type='sha1']" />";
+    };
+  };
+    </xsl:for-each>
+}
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/pkgs/development/mobile/androidenv/platform-tools.nix b/pkgs/development/mobile/androidenv/platform-tools.nix
new file mode 100644
index 00000000000..55499608290
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/platform-tools.nix
@@ -0,0 +1,41 @@
+{stdenv, stdenv_32bit, fetchurl, unzip, zlib, ncurses}:
+
+stdenv.mkDerivation {
+  name = "android-platform-tools-r16";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+    then fetchurl {
+      url = https://dl-ssl.google.com/android/repository/platform-tools_r16-linux.zip;
+      sha1 = "84d563ae5e324f223f335f11bf511bf6207c05fb";
+    }
+    else if stdenv.system == "x86_64-darwin" then fetchurl {
+      url = https://dl-ssl.google.com/android/repository/platform-tools_r16-macosx.zip;
+      sha1 = "fbb0f8d2786a83b8c3eb6df402e706e136db8fed";
+    }
+    else throw "System ${stdenv.system} not supported!";
+  
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    unzip $src
+    cd platform-tools
+    
+    ${stdenv.lib.optionalString (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux")
+      ''
+        for i in aapt adb aidl dexdump fastboot llvm-rs-cc
+        do
+            patchelf --set-interpreter ${stdenv_32bit.gcc.libc}/lib/ld-linux.so.2 $i
+        done
+    
+        patchelf --set-rpath ${zlib}/lib:${stdenv_32bit.gcc.gcc}/lib aapt
+        patchelf --set-rpath ${ncurses}/lib:${stdenv_32bit.gcc.gcc}/lib adb
+        patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib aidl
+        patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib fastboot
+        patchelf --set-rpath ${zlib}/lib:${stdenv_32bit.gcc.gcc}/lib dexdump
+        patchelf --set-rpath ${stdenv_32bit.gcc.gcc}/lib llvm-rs-cc
+    ''}
+    
+    patchShebangs .
+  '';
+  
+  buildInputs = [ unzip ];
+}
diff --git a/pkgs/development/mobile/androidenv/platforms-linux.nix b/pkgs/development/mobile/androidenv/platforms-linux.nix
new file mode 100644
index 00000000000..f544fcc08be
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/platforms-linux.nix
@@ -0,0 +1,210 @@
+
+{stdenv, fetchurl, unzip}:
+
+let
+  buildPlatform = args:
+    stdenv.mkDerivation (args // {   
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+    '';
+  });
+in
+{
+    
+  platform_2 = buildPlatform {
+    name = "android-platform-1.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.1_r1-linux.zip;
+      sha1 = "c054d25c9b4c6251fa49c2f9c54336998679d3fe";
+    };
+    meta = {
+      description = "Android SDK Platform 1.1_r1";
+      url = http://developer.android.com/sdk/android-1.1.html;
+    };
+  };
+    
+  platform_3 = buildPlatform {
+    name = "android-platform-1.5";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.5_r04-linux.zip;
+      sha1 = "5c134b7df5f4b8bd5b61ba93bdaebada8fa3468c";
+    };
+    meta = {
+      description = "Android SDK Platform 1.5_r3";
+      url = http://developer.android.com/sdk/android-1.5.html;
+    };
+  };
+    
+  platform_4 = buildPlatform {
+    name = "android-platform-1.6";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.6_r03-linux.zip;
+      sha1 = "483ed088e45bbdf3444baaf9250c8b02e5383cb0";
+    };
+    meta = {
+      description = "Android SDK Platform 1.6_r2";
+      url = http://developer.android.com/sdk/android-1.6.html;
+    };
+  };
+    
+  platform_5 = buildPlatform {
+    name = "android-platform-2.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.0_r01-linux.zip;
+      sha1 = "be9be6a99ca32875c96ec7f91160ca9fce7e3c7d";
+    };
+    meta = {
+      description = "Android SDK Platform 2.0, revision 1";
+      url = http://developer.android.com/sdk/android-2.0.html;
+    };
+  };
+    
+  platform_6 = buildPlatform {
+    name = "android-platform-2.0.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.0.1_r01-linux.zip;
+      sha1 = "ce2c971dce352aa28af06bda92a070116aa5ae1a";
+    };
+    meta = {
+      description = "Android SDK Platform 2.0.1_r1";
+      url = http://developer.android.com/sdk/android-2.0.1.html;
+    };
+  };
+    
+  platform_7 = buildPlatform {
+    name = "android-platform-2.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.1_r03-linux.zip;
+      sha1 = "5ce51b023ac19f8738500b1007a1da5de2349a1e";
+    };
+    meta = {
+      description = "Android SDK Platform 2.1_r3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_8 = buildPlatform {
+    name = "android-platform-2.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.2_r03-linux.zip;
+      sha1 = "231262c63eefdff8fd0386e9ccfefeb27a8f9202";
+    };
+    meta = {
+      description = "Android SDK Platform 2.2_r3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_9 = buildPlatform {
+    name = "android-platform-2.3.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.3.1_r02-linux.zip;
+      sha1 = "209f8a7a8b2cb093fce858b8b55fed3ba5206773";
+    };
+    meta = {
+      description = "Android SDK Platform 2.3.1_r2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_10 = buildPlatform {
+    name = "android-platform-2.3.3";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.3.3_r02-linux.zip;
+      sha1 = "887e37783ec32f541ea33c2c649dda648e8e6fb3";
+    };
+    meta = {
+      description = "Android SDK Platform 2.3.3._r2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_11 = buildPlatform {
+    name = "android-platform-3.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.0_r02-linux.zip;
+      sha1 = "2c7d4bd13f276e76f6bbd87315fe27aba351dd37";
+    };
+    meta = {
+      description = "Android SDK Platform 3.0, revision 2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_12 = buildPlatform {
+    name = "android-platform-3.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.1_r03-linux.zip;
+      sha1 = "4a50a6679cd95bb68bb5fc032e754cd7c5e2b1bf";
+    };
+    meta = {
+      description = "Android SDK Platform 3.1, revision 3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_13 = buildPlatform {
+    name = "android-platform-3.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.2_r01-linux.zip;
+      sha1 = "6189a500a8c44ae73a439604363de93591163cd9";
+    };
+    meta = {
+      description = "Android SDK Platform 3.2, revision 1";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_14 = buildPlatform {
+    name = "android-platform-4.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-14_r03.zip;
+      sha1 = "41ba83b51e886461628c41b1b4d47762e0688ed5";
+    };
+    meta = {
+      description = "Android SDK Platform 4.0";
+      
+    };
+  };
+    
+  platform_15 = buildPlatform {
+    name = "android-platform-4.0.3";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-15_r03.zip;
+      sha1 = "23da24610a8da51054c5391001c51ce43a778b97";
+    };
+    meta = {
+      description = "Android SDK Platform 4.0.3";
+      
+    };
+  };
+    
+  platform_16 = buildPlatform {
+    name = "android-platform-4.1.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-16_r03.zip;
+      sha1 = "80d9ffef58168f9bccd862830e2ee51f686b167e";
+    };
+    meta = {
+      description = "Android SDK Platform 4.1";
+      
+    };
+  };
+    
+  platform_17 = buildPlatform {
+    name = "android-platform-4.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-17_r01.zip;
+      sha1 = "c2e7c8c8db40e06b804ddb1725ac2c3555b55025";
+    };
+    meta = {
+      description = "Android SDK Platform 4.2";
+      
+    };
+  };
+    
+}
+  
\ No newline at end of file
diff --git a/pkgs/development/mobile/androidenv/platforms-macosx.nix b/pkgs/development/mobile/androidenv/platforms-macosx.nix
new file mode 100644
index 00000000000..a1434bbe56c
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/platforms-macosx.nix
@@ -0,0 +1,210 @@
+
+{stdenv, fetchurl, unzip}:
+
+let
+  buildPlatform = args:
+    stdenv.mkDerivation (args // {   
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+    '';
+  });
+in
+{
+    
+  platform_2 = buildPlatform {
+    name = "android-platform-1.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.1_r1-macosx.zip;
+      sha1 = "e21dbcff45b7356657449ebb3c7e941be2bb5ebe";
+    };
+    meta = {
+      description = "Android SDK Platform 1.1_r1";
+      url = http://developer.android.com/sdk/android-1.1.html;
+    };
+  };
+    
+  platform_3 = buildPlatform {
+    name = "android-platform-1.5";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.5_r04-macosx.zip;
+      sha1 = "d3a67c2369afa48b6c3c7624de5031c262018d1e";
+    };
+    meta = {
+      description = "Android SDK Platform 1.5_r3";
+      url = http://developer.android.com/sdk/android-1.5.html;
+    };
+  };
+    
+  platform_4 = buildPlatform {
+    name = "android-platform-1.6";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-1.6_r03-macosx.zip;
+      sha1 = "bdafad44f5df9f127979bdb21a1fdd87ee3cd625";
+    };
+    meta = {
+      description = "Android SDK Platform 1.6_r2";
+      url = http://developer.android.com/sdk/android-1.6.html;
+    };
+  };
+    
+  platform_5 = buildPlatform {
+    name = "android-platform-2.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.0_r01-macosx.zip;
+      sha1 = "2a866d0870dbba18e0503cd41e5fae988a21b314";
+    };
+    meta = {
+      description = "Android SDK Platform 2.0, revision 1";
+      url = http://developer.android.com/sdk/android-2.0.html;
+    };
+  };
+    
+  platform_6 = buildPlatform {
+    name = "android-platform-2.0.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.0.1_r01-macosx.zip;
+      sha1 = "c3096f80d75a6fc8cb38ef8a18aec920e53d42c0";
+    };
+    meta = {
+      description = "Android SDK Platform 2.0.1_r1";
+      url = http://developer.android.com/sdk/android-2.0.1.html;
+    };
+  };
+    
+  platform_7 = buildPlatform {
+    name = "android-platform-2.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.1_r03-linux.zip;
+      sha1 = "5ce51b023ac19f8738500b1007a1da5de2349a1e";
+    };
+    meta = {
+      description = "Android SDK Platform 2.1_r3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_8 = buildPlatform {
+    name = "android-platform-2.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.2_r03-linux.zip;
+      sha1 = "231262c63eefdff8fd0386e9ccfefeb27a8f9202";
+    };
+    meta = {
+      description = "Android SDK Platform 2.2_r3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_9 = buildPlatform {
+    name = "android-platform-2.3.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.3.1_r02-linux.zip;
+      sha1 = "209f8a7a8b2cb093fce858b8b55fed3ba5206773";
+    };
+    meta = {
+      description = "Android SDK Platform 2.3.1_r2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_10 = buildPlatform {
+    name = "android-platform-2.3.3";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-2.3.3_r02-linux.zip;
+      sha1 = "887e37783ec32f541ea33c2c649dda648e8e6fb3";
+    };
+    meta = {
+      description = "Android SDK Platform 2.3.3._r2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_11 = buildPlatform {
+    name = "android-platform-3.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.0_r02-linux.zip;
+      sha1 = "2c7d4bd13f276e76f6bbd87315fe27aba351dd37";
+    };
+    meta = {
+      description = "Android SDK Platform 3.0, revision 2";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_12 = buildPlatform {
+    name = "android-platform-3.1";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.1_r03-linux.zip;
+      sha1 = "4a50a6679cd95bb68bb5fc032e754cd7c5e2b1bf";
+    };
+    meta = {
+      description = "Android SDK Platform 3.1, revision 3";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_13 = buildPlatform {
+    name = "android-platform-3.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-3.2_r01-linux.zip;
+      sha1 = "6189a500a8c44ae73a439604363de93591163cd9";
+    };
+    meta = {
+      description = "Android SDK Platform 3.2, revision 1";
+      url = http://developer.android.com/sdk/;
+    };
+  };
+    
+  platform_14 = buildPlatform {
+    name = "android-platform-4.0";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-14_r03.zip;
+      sha1 = "41ba83b51e886461628c41b1b4d47762e0688ed5";
+    };
+    meta = {
+      description = "Android SDK Platform 4.0";
+      
+    };
+  };
+    
+  platform_15 = buildPlatform {
+    name = "android-platform-4.0.3";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-15_r03.zip;
+      sha1 = "23da24610a8da51054c5391001c51ce43a778b97";
+    };
+    meta = {
+      description = "Android SDK Platform 4.0.3";
+      
+    };
+  };
+    
+  platform_16 = buildPlatform {
+    name = "android-platform-4.1.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-16_r03.zip;
+      sha1 = "80d9ffef58168f9bccd862830e2ee51f686b167e";
+    };
+    meta = {
+      description = "Android SDK Platform 4.1";
+      
+    };
+  };
+    
+  platform_17 = buildPlatform {
+    name = "android-platform-4.2";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/android-17_r01.zip;
+      sha1 = "c2e7c8c8db40e06b804ddb1725ac2c3555b55025";
+    };
+    meta = {
+      description = "Android SDK Platform 4.2";
+      
+    };
+  };
+    
+}
+  
\ No newline at end of file
diff --git a/pkgs/development/mobile/androidenv/repository-7.xml b/pkgs/development/mobile/androidenv/repository-7.xml
new file mode 100644
index 00000000000..7bbbaf1e362
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/repository-7.xml
@@ -0,0 +1,1030 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Copyright (C) 2009 The Android Open Source Project
+ *
+ * Licensed under the Apache License, version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+-->
+<sdk:sdk-repository xmlns:sdk="http://schemas.android.com/sdk/android/repository/7" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+    <sdk:license id="android-sdk-license" type="text">Terms and Conditions
+
+This is the Android Software Development Kit License Agreement.
+
+
+1. Introduction
+
+
+1.1 The Android Software Development Kit (referred to in this License Agreement as the &quot;SDK&quot; and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of this License Agreement. This License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
+
+1.2 &quot;Android&quot; means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
+
+1.3 &quot;Google&quot; means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
+
+
+2. Accepting this License Agreement
+
+
+2.1 In order to use the SDK, you must first agree to this License Agreement. You may not use the SDK if you do not accept this License Agreement.
+
+2.2 By clicking to accept, you hereby agree to the terms of this License Agreement.
+
+2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries including the country in which you are resident or from which you use the SDK.
+
+2.4 If you are agreeing to be bound by this License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to this License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
+
+
+3. SDK License from Google
+
+
+3.1 Subject to the terms of this License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable and non-exclusive license to use the SDK solely to develop applications to run on the Android platform.
+
+3.2 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. &quot;Intellectual Property Rights&quot; means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
+
+3.3 You may not use the SDK for any purpose not expressly permitted by this License Agreement.  Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
+
+3.4 You agree that you will not take any actions that may cause or result in the fragmentation of Android, including but not limited to distributing, participating in the creation of, or promoting in any way a software development kit derived from the SDK.
+
+3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not this License Agreement.
+
+3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
+
+3.7 Nothing in this License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
+
+3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
+
+
+4. Use of the SDK by You
+
+
+4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under this License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
+
+4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) this License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
+
+4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
+
+4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
+
+4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
+
+4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under this License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
+
+
+5. Your Developer Credentials
+
+
+5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
+
+
+6. Privacy and Information
+
+
+6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
+
+6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
+
+
+7. Third Party Applications
+
+
+7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
+
+7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
+
+7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, this License Agreement does not affect your legal relationship with these third parties.
+
+
+8. Using Android APIs
+
+
+8.1 Google Data APIs
+
+8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
+
+8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
+
+
+9. Terminating this License Agreement
+
+
+9.1 This License Agreement will continue to apply until terminated by either you or Google as set out below.
+
+9.2 If you want to terminate this License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
+
+9.3 Google may at any time, terminate this License Agreement with you if:
+(A) you have breached any provision of this License Agreement; or
+(B) Google is required to do so by law; or
+(C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or
+(D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
+
+9.4 When this License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst this License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
+
+
+10. DISCLAIMER OF WARRANTIES
+
+
+10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED &quot;AS IS&quot; AND &quot;AS AVAILABLE&quot; WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
+
+10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
+
+10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+
+
+11. LIMITATION OF LIABILITY
+
+
+11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
+
+
+12. Indemnification
+
+
+12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with this License Agreement.
+
+
+13. Changes to the License Agreement
+
+
+13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
+
+
+14. General Legal Terms
+
+
+14.1 This License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
+
+14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in this License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
+
+14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of this License Agreement is invalid, then that provision will be removed from this License Agreement without affecting the rest of this License Agreement. The remaining provisions of this License Agreement will continue to be valid and enforceable.
+
+14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to this License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of this License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to this License Agreement.
+
+14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
+
+14.6 The rights granted in this License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under this License Agreement without the prior written approval of the other party.
+
+14.7 This License Agreement, and your relationship with Google under this License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from this License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
+
+November 13, 2012
+    </sdk:license>
+
+    <!-- PLATFORMS ........................ -->
+
+    <sdk:platform>
+        <sdk:version>1.1</sdk:version>
+        <sdk:api-level>2</sdk:api-level>
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android SDK Platform 1.1_r1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/android-1.1.html</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>46828615</sdk:size>
+                <sdk:checksum type="sha1">a4060f29ed39fc929c302836d488998c53c3002e</sdk:checksum>
+                <sdk:url>android-1.1_r1-windows.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>45584305</sdk:size>
+                <sdk:checksum type="sha1">e21dbcff45b7356657449ebb3c7e941be2bb5ebe</sdk:checksum>
+                <sdk:url>android-1.1_r1-macosx.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>45476658</sdk:size>
+                <sdk:checksum type="sha1">c054d25c9b4c6251fa49c2f9c54336998679d3fe</sdk:checksum>
+                <sdk:url>android-1.1_r1-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated manually from earlier versions -->
+
+    <sdk:platform>
+        <sdk:version>1.5</sdk:version>
+        <sdk:api-level>3</sdk:api-level>
+        <sdk:revision>04</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>6</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 1.5_r3</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/android-1.5.html</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>54624370</sdk:size>
+                <sdk:checksum type="sha1">5bb106d2e40d481edd337b0833093843e15fe49a</sdk:checksum>
+                <sdk:url>android-1.5_r04-windows.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>52440607</sdk:size>
+                <sdk:checksum type="sha1">d3a67c2369afa48b6c3c7624de5031c262018d1e</sdk:checksum>
+                <sdk:url>android-1.5_r04-macosx.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>53348669</sdk:size>
+                <sdk:checksum type="sha1">5c134b7df5f4b8bd5b61ba93bdaebada8fa3468c</sdk:checksum>
+                <sdk:url>android-1.5_r04-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <sdk:version>1.6</sdk:version>
+        <sdk:api-level>4</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>03</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>6</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 1.6_r2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/android-1.6.html</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>63454485</sdk:size>
+                <sdk:checksum type="sha1">483ed088e45bbdf3444baaf9250c8b02e5383cb0</sdk:checksum>
+                <sdk:url>android-1.6_r03-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>62418496</sdk:size>
+                <sdk:checksum type="sha1">bdafad44f5df9f127979bdb21a1fdd87ee3cd625</sdk:checksum>
+                <sdk:url>android-1.6_r03-macosx.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>64654625</sdk:size>
+                <sdk:checksum type="sha1">ce0b5e4ffaf12ca4fd07c2da71a8a1ab4a03dc22</sdk:checksum>
+                <sdk:url>android-1.6_r03-windows.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Thu Oct 22 10:16:34 PDT 2009 using eclair-sdk 17704: Platform. Addon. Tools. Doc. -->
+
+    <sdk:platform>
+        <sdk:version>2.0</sdk:version>
+        <sdk:api-level>5</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>3</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.0, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/android-2.0.html</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>75095268</sdk:size>
+                <sdk:checksum type="sha1">be9be6a99ca32875c96ec7f91160ca9fce7e3c7d</sdk:checksum>
+                <sdk:url>android-2.0_r01-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>74956356</sdk:size>
+                <sdk:checksum type="sha1">2a866d0870dbba18e0503cd41e5fae988a21b314</sdk:checksum>
+                <sdk:url>android-2.0_r01-macosx.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>76288040</sdk:size>
+                <sdk:checksum type="sha1">aeb623217ff88b87216d6eb7dbc846ed53f68f57</sdk:checksum>
+                <sdk:url>android-2.0_r01-windows.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Mon Nov 23 14:08:02 PST 2009 using eclair-release 20723: Platform. Addon. -->
+
+    <sdk:platform>
+        <sdk:version>2.0.1</sdk:version>
+        <sdk:api-level>6</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>4</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.0.1_r1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/android-2.0.1.html</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>79192618</sdk:size>
+                <sdk:checksum type="sha1">ce2c971dce352aa28af06bda92a070116aa5ae1a</sdk:checksum>
+                <sdk:url>android-2.0.1_r01-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>79035527</sdk:size>
+                <sdk:checksum type="sha1">c3096f80d75a6fc8cb38ef8a18aec920e53d42c0</sdk:checksum>
+                <sdk:url>android-2.0.1_r01-macosx.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>80385601</sdk:size>
+                <sdk:checksum type="sha1">255781ebe4509d9707d0e77edda2815e2bc216e6</sdk:checksum>
+                <sdk:url>android-2.0.1_r01-windows.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Thu May  6 15:57:41 PDT 2010 using eclair 35983: Platform. -->
+
+    <sdk:platform>
+        <sdk:version>2.1</sdk:version>
+        <sdk:api-level>7</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>03</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>8</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.1_r3</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>70142829</sdk:size>
+                <sdk:checksum type="sha1">5ce51b023ac19f8738500b1007a1da5de2349a1e</sdk:checksum>
+                <sdk:url>android-2.1_r03-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Wed Jun 30 16:13:06 PDT 2010 using froyo-release 43546: Platform. Addon. -->
+
+    <sdk:platform>
+        <sdk:version>2.2</sdk:version>
+        <sdk:api-level>8</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>03</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>8</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.2_r3</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>74652366</sdk:size>
+                <sdk:checksum type="sha1">231262c63eefdff8fd0386e9ccfefeb27a8f9202</sdk:checksum>
+                <sdk:url>android-2.2_r03-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Thu Jan 20 09:40:59 PST 2011 using gingerbread-sdk-release 93351: Platform. -->
+
+    <sdk:platform>
+        <sdk:version>2.3.1</sdk:version>
+        <sdk:api-level>9</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>02</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>8</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.3.1_r2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>78732563</sdk:size>
+                <sdk:checksum type="sha1">209f8a7a8b2cb093fce858b8b55fed3ba5206773</sdk:checksum>
+                <sdk:url>android-2.3.1_r02-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Fri Feb  4 16:41:27 PST 2011 using gingerbread-release 101070: Platform. -->
+
+    <sdk:platform>
+        <sdk:version>2.3.3</sdk:version>
+        <sdk:api-level>10</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>02</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>8</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 2.3.3._r2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>85470907</sdk:size>
+                <sdk:checksum type="sha1">887e37783ec32f541ea33c2c649dda648e8e6fb3</sdk:checksum>
+                <sdk:url>android-2.3.3_r02-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Thu Feb 17 08:41:10 PST 2011 using honeycomb 104254: Platform. -->
+
+    <sdk:platform>
+        <sdk:version>3.0</sdk:version>
+        <sdk:api-level>11</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>02</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>10</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 3.0, revision 2</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>104513908</sdk:size>
+                <sdk:checksum type="sha1">2c7d4bd13f276e76f6bbd87315fe27aba351dd37</sdk:checksum>
+                <sdk:url>android-3.0_r02-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Wed May  4 19:39:17 PDT 2011 using honeycomb-mr1 123685: Platform.
+         r2: layoutlib.jar from 3.0 to fix issue with ADT 10.
+    -->
+
+    <sdk:platform>
+        <sdk:version>3.1</sdk:version>
+        <sdk:api-level>12</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>03</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>11</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 3.1, revision 3</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>106472351</sdk:size>
+                <sdk:checksum type="sha1">4a50a6679cd95bb68bb5fc032e754cd7c5e2b1bf</sdk:checksum>
+                <sdk:url>android-3.1_r03-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- Generated on Fri Jul 15 11:50:12 PDT 2011 using honeycomb-mr2-release 140714: Platform. -->
+
+    <sdk:platform>
+        <sdk:version>3.2</sdk:version>
+        <sdk:api-level>13</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:min-tools-rev>
+            <sdk:major>12</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:description>Android SDK Platform 3.2, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>108426536</sdk:size>
+                <sdk:checksum type="sha1">6189a500a8c44ae73a439604363de93591163cd9</sdk:checksum>
+                <sdk:url>android-3.2_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:layoutlib>
+            <sdk:api>4</sdk:api>
+        </sdk:layoutlib>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <!-- Generated at Thu Dec 15 16:53:11 2011 from git_ics-mr0 @ 238991 -->
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Android SDK Platform 4.0</sdk:description>
+        <sdk:version>4.0</sdk:version>
+        <sdk:api-level>14</sdk:api-level>
+        <sdk:layoutlib>
+            <sdk:api>7</sdk:api>
+            <sdk:revision>1</sdk:revision>
+        </sdk:layoutlib>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>45919570</sdk:size>
+                <sdk:checksum type="sha1">41ba83b51e886461628c41b1b4d47762e0688ed5</sdk:checksum>
+                <sdk:url>android-14_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <!-- Generated at Fri Mar 16 11:22:43 2012 from ics-mr1 @ 291902 -->
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Android SDK Platform 4.0.3</sdk:description>
+        <sdk:version>4.0.3</sdk:version>
+        <sdk:api-level>15</sdk:api-level>
+        <sdk:min-tools-rev>
+            <sdk:major>15</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:layoutlib>
+            <sdk:api>7</sdk:api>
+            <sdk:revision>1</sdk:revision>
+        </sdk:layoutlib>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>44414679</sdk:size>
+                <sdk:checksum type="sha1">23da24610a8da51054c5391001c51ce43a778b97</sdk:checksum>
+                <sdk:url>android-15_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <!-- Generated at Tue Oct  9 13:42:01 2012 from git_jb-dev @ 495790 -->
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Android SDK Platform 4.1</sdk:description>
+        <sdk:version>4.1.2</sdk:version>
+        <sdk:api-level>16</sdk:api-level>
+        <sdk:min-tools-rev>
+            <sdk:major>20</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:layoutlib>
+            <sdk:api>8</sdk:api>
+            <sdk:revision>1</sdk:revision>
+        </sdk:layoutlib>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>47995505</sdk:size>
+                <sdk:checksum type="sha1">80d9ffef58168f9bccd862830e2ee51f686b167e</sdk:checksum>
+                <sdk:url>android-16_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <sdk:platform>
+        <!-- Generated at Mon Nov 12 17:12:35 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android SDK Platform 4.2</sdk:description>
+        <sdk:version>4.2</sdk:version>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:min-tools-rev>
+            <sdk:major>21</sdk:major>
+        </sdk:min-tools-rev>
+        <sdk:layoutlib>
+            <sdk:api>9</sdk:api>
+            <sdk:revision>1</sdk:revision>
+        </sdk:layoutlib>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>47886130</sdk:size>
+                <sdk:checksum type="sha1">c2e7c8c8db40e06b804ddb1725ac2c3555b55025</sdk:checksum>
+                <sdk:url>android-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform>
+
+    <!-- SYSTEM IMAGES ........................ -->
+
+    <sdk:system-image>
+        <!-- Generated at Wed Dec  7 13:47:01 2011 from git_ics-mr0 @ 229537 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android SDK Platform 4.0</sdk:description>
+        <sdk:api-level>14</sdk:api-level>
+        <sdk:abi>armeabi-v7a</sdk:abi>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>99621822</sdk:size>
+                <sdk:checksum type="sha1">d8991b0c06b18d7d6ed4169d67460ee1add6661b</sdk:checksum>
+                <sdk:url>sysimg_armv7a-14_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:system-image>
+
+    <sdk:system-image>
+        <!-- Generated at Fri Mar 30 10:43:23 2012 from ics-mr1 @ 302030 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:description>Android SDK Platform 4.0.3</sdk:description>
+        <sdk:api-level>15</sdk:api-level>
+        <sdk:abi>armeabi-v7a</sdk:abi>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>96227377</sdk:size>
+                <sdk:checksum type="sha1">1bf977d6cb4e0ad38dceac0c4863d1caa21f326e</sdk:checksum>
+                <sdk:url>sysimg_armv7a-15_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:system-image>
+
+    <sdk:system-image>
+        <!-- Generated at Tue Oct  9 13:43:08 2012 from git_jb-dev @ 495790 -->
+        <sdk:revision>3</sdk:revision>
+        <sdk:description>Android SDK Platform 4.1</sdk:description>
+        <sdk:api-level>16</sdk:api-level>
+        <sdk:abi>armeabi-v7a</sdk:abi>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>112528368</sdk:size>
+                <sdk:checksum type="sha1">d1cddb23f17aad5821a089c403d4cddad2cf9ef7</sdk:checksum>
+                <sdk:url>sysimg_armv7a-16_r03.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:system-image>
+
+    <sdk:system-image>
+        <!-- Generated at Mon Nov 12 17:14:39 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:description>Android SDK Platform 4.2</sdk:description>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:abi>armeabi-v7a</sdk:abi>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>116831648</sdk:size>
+                <sdk:checksum type="sha1">45b9344473e0a6d063c2b1fe58d8cd47d307905e</sdk:checksum>
+                <sdk:url>sysimg_armv7a-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:system-image>
+
+    <!-- SAMPLES ........................ -->
+
+    <!-- Generated on Mon Feb 22 13:39:38 PST 2010 using eclair 25887: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>7</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 7, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>7677831</sdk:size>
+                <sdk:checksum type="sha1">51e4907f60f248ede5c58b54ce7b6ae0b473e0ca</sdk:checksum>
+                <sdk:url>samples-2.1_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Tue May 11 19:15:20 PDT 2010 using froyo 36658: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>8</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 8, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>7969716</sdk:size>
+                <sdk:checksum type="sha1">d16d8bf2dd84cedf73b98b948d66461c8f19d6fb</sdk:checksum>
+                <sdk:url>samples-2.2_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Tue Nov 30 19:39:34 PST 2010 using gingerbread 79962: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>9</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 9, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:obsolete/>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>8516326</sdk:size>
+                <sdk:checksum type="sha1">36f7dd6c8b5dbb50b3cf3e3ac5209f3fe55db2aa</sdk:checksum>
+                <sdk:url>samples-2.3_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Tue Feb  8 17:37:15 PST 2011 using gingerbread 102121: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>10</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 10, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>8539583</sdk:size>
+                <sdk:checksum type="sha1">93b0c3f3bdf5b07f1f115100b4954f0665297a0d</sdk:checksum>
+                <sdk:url>samples-2.3.3_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Thu Feb 17 08:45:49 PST 2011 using honeycomb 104254: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>11</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 11, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>11976920</sdk:size>
+                <sdk:checksum type="sha1">3749ace584631270268d65bb1d0ad61b0d691682</sdk:checksum>
+                <sdk:url>samples-3.0_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Wed May  4 19:49:56 PDT 2011 using honeycomb-mr1 123685: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>12</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 12, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>12150514</sdk:size>
+                <sdk:checksum type="sha1">df0ace37cbca73373fe94080f94c71557cac73a7</sdk:checksum>
+                <sdk:url>samples-3.1_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- Generated on Fri Jul 15 11:52:24 PDT 2011 using honeycomb-mr2 142871: Samples. -->
+
+    <sdk:sample>
+        <sdk:api-level>13</sdk:api-level>
+        <sdk:codename/>
+        <sdk:revision>01</sdk:revision>
+        <sdk:description>Android SDK Samples for Android API 13, revision 1</sdk:description>
+        <sdk:desc-url>http://developer.android.com/sdk/</sdk:desc-url>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>12193502</sdk:size>
+                <sdk:checksum type="sha1">078bcf1abc1cb8921f3fa482c252963a782bed60</sdk:checksum>
+                <sdk:url>samples-3.2_r01-linux.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <sdk:sample>
+        <!-- Generated at Wed Dec  7 13:48:27 2011 from git_ics-mr0 @ 234950 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:api-level>14</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>16253619</sdk:size>
+                <sdk:checksum type="sha1">1312c22ab0b650e26835cc3945d4ff8cea183416</sdk:checksum>
+                <sdk:url>samples-14_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <sdk:sample>
+        <!-- Generated at Fri Mar 16 11:27:52 2012 from ics-mr1 @ 291902 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:api-level>15</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>16366656</sdk:size>
+                <sdk:checksum type="sha1">042f368c5b09eca4d278264e6dbf9c12c5f73d1f</sdk:checksum>
+                <sdk:url>samples-15_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <sdk:sample>
+        <!-- Generated at Sun Jun 24 14:02:06 2012 from git_jb-release @ 391408 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>16</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>14729945</sdk:size>
+                <sdk:checksum type="sha1">dce3a2d41db50a381ef47ee8bddbe928520e685e</sdk:checksum>
+                <sdk:url>samples-16_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <sdk:sample>
+        <!-- Generated at Mon Nov 12 17:18:09 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>14840030</sdk:size>
+                <sdk:checksum type="sha1">12d58cb26503610fc05bd7618c434cc6f983bc41</sdk:checksum>
+                <sdk:url>samples-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:sample>
+
+    <!-- PLATFORM-TOOLS ........................ -->
+
+    <sdk:platform-tool>
+        <!-- Generated at Mon Nov 12 17:13:48 2012 from git_jb-mr1-dev @ 527242 -->
+        <sdk:revision>
+            <sdk:major>16</sdk:major>
+        </sdk:revision>
+        <sdk:archives>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>11938435</sdk:size>
+                <sdk:checksum type="sha1">0d6245b685c7d303cf4a054a3d373c4427b7ad01</sdk:checksum>
+                <sdk:url>platform-tools_r16-windows.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>12676089</sdk:size>
+                <sdk:checksum type="sha1">84d563ae5e324f223f335f11bf511bf6207c05fb</sdk:checksum>
+                <sdk:url>platform-tools_r16-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>13147351</sdk:size>
+                <sdk:checksum type="sha1">fbb0f8d2786a83b8c3eb6df402e706e136db8fed</sdk:checksum>
+                <sdk:url>platform-tools_r16-macosx.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:platform-tool>
+
+    <!-- TOOLS ........................ -->
+
+    <sdk:tool>
+        <!-- Generated at Mon Nov 12 17:07:47 2012 from git_tools_r21 @ 519525 -->
+        <sdk:revision>
+            <sdk:major>21</sdk:major>
+        </sdk:revision>
+        <sdk:min-platform-tools-rev>
+            <sdk:major>16</sdk:major>
+        </sdk:min-platform-tools-rev>
+        <sdk:archives>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>98982670</sdk:size>
+                <sdk:checksum type="sha1">57bbfadcedbef44fc322e5e037666393668cf3fe</sdk:checksum>
+                <sdk:url>tools_r21-windows.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>91495104</sdk:size>
+                <sdk:checksum type="sha1">013b9c04407a9d73b8bf3c574327fbe870acd264</sdk:checksum>
+                <sdk:url>tools_r21-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>65767130</sdk:size>
+                <sdk:checksum type="sha1">fcfa3a6932f2ed0d970a0ca959bb2b4972f7d46d</sdk:checksum>
+                <sdk:url>tools_r21-macosx.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:tool>
+
+    <sdk:tool>
+        <!-- Generated at Fri Nov 30 13:45:55 2012 from git_tools_r21 @ 539280 -->
+        <sdk:revision>
+            <sdk:major>21</sdk:major>
+            <sdk:minor>0</sdk:minor>
+            <sdk:micro>1</sdk:micro>
+            <sdk:preview>1</sdk:preview>
+        </sdk:revision>
+        <sdk:min-platform-tools-rev>
+            <sdk:major>16</sdk:major>
+        </sdk:min-platform-tools-rev>
+        <sdk:archives>
+            <sdk:archive arch="any" os="windows">
+                <sdk:size>98998088</sdk:size>
+                <sdk:checksum type="sha1">1503aaf2c91cb07c0240a2db3af0de027941a4f6</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-windows.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="linux">
+                <sdk:size>91510079</sdk:size>
+                <sdk:checksum type="sha1">183670a7f9878d8d3693d5fcf32e1357b69f0fed</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-linux.zip</sdk:url>
+            </sdk:archive>
+            <sdk:archive arch="any" os="macosx">
+                <sdk:size>65777178</sdk:size>
+                <sdk:checksum type="sha1">109d4f287904875f067e021be3fd1f549e6afb67</sdk:checksum>
+                <sdk:url>tools_r21.0.1_rc1-macosx.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:tool>
+
+    <!-- DOCS ........................ -->
+
+    <sdk:doc>
+        <!-- Generated at Mon Nov 12 17:17:53 2012 from git_jb-mr1-dev @ 528390 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>171564393</sdk:size>
+                <sdk:checksum type="sha1">fb988cdd2beaac0dd47dc630821ccc30557c67e5</sdk:checksum>
+                <sdk:url>docs-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:doc>
+
+    <!-- SOURCES ........................ -->
+
+    <sdk:source>
+        <!-- Generated at Wed Dec  7 13:48:11 2011 from git_ics-mr0 @ 234950 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>14</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>16152383</sdk:size>
+                <sdk:checksum type="sha1">eaf4ed7dcac46e68516a1b4aa5b0d9e5a39a7555</sdk:checksum>
+                <sdk:url>sources-14_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:source>
+
+    <sdk:source>
+        <!-- Generated at Fri Mar 30 10:43:44 2012 from ics-mr1 @ 302030 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:api-level>15</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>16468746</sdk:size>
+                <sdk:checksum type="sha1">e5992a5747c9590783fbbdd700337bf0c9f6b1fa</sdk:checksum>
+                <sdk:url>sources-15_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:source>
+
+    <sdk:source>
+        <!-- Generated at Thu Jul 19 18:39:42 2012 from git_jb-release @ 403059 -->
+        <sdk:revision>2</sdk:revision>
+        <sdk:api-level>16</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>17876720</sdk:size>
+                <sdk:checksum type="sha1">0f83c14ed333c45d962279ab5d6bc98a0269ef84</sdk:checksum>
+                <sdk:url>sources-16_r02.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:source>
+
+    <sdk:source>
+        <!-- Generated at Mon Nov 12 17:16:08 2012 from git_jb-mr1-dev @ 526865 -->
+        <sdk:revision>1</sdk:revision>
+        <sdk:api-level>17</sdk:api-level>
+        <sdk:archives>
+            <sdk:archive arch="any" os="any">
+                <sdk:size>18976816</sdk:size>
+                <sdk:checksum type="sha1">6f1f18cd2d2b1852d7f6892df9cee3823349d43a</sdk:checksum>
+                <sdk:url>sources-17_r01.zip</sdk:url>
+            </sdk:archive>
+        </sdk:archives>
+        <sdk:uses-license ref="android-sdk-license"/>
+    </sdk:source>
+</sdk:sdk-repository>
diff --git a/pkgs/development/mobile/androidenv/support.nix b/pkgs/development/mobile/androidenv/support.nix
new file mode 100644
index 00000000000..2e9690de7a2
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/support.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation {
+  name = "android-support-r11";
+  src = fetchurl {
+    url = https://dl-ssl.google.com/android/repository/support_r11.zip;
+    sha1 = "d30d182d8e4c86bb4464c03a83ccffce7bc84ecd";
+  };
+  
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    unzip $src
+  '';
+  
+  buildInputs = [ unzip ];
+}
\ No newline at end of file
diff --git a/pkgs/development/mobile/androidenv/sysimages.nix b/pkgs/development/mobile/androidenv/sysimages.nix
new file mode 100644
index 00000000000..b35b4298983
--- /dev/null
+++ b/pkgs/development/mobile/androidenv/sysimages.nix
@@ -0,0 +1,50 @@
+
+{stdenv, fetchurl, unzip}:
+
+let
+  buildSystemImage = args:
+    stdenv.mkDerivation (args // {   
+      buildInputs = [ unzip ];
+      buildCommand = ''
+        mkdir -p $out
+        cd $out
+        unzip $src
+    '';
+  });
+in
+{
+    
+  sysimg_14 = buildSystemImage {
+    name = "armeabi-v7a-14";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/sysimg_armv7a-14_r02.zip;
+      sha1 = "d8991b0c06b18d7d6ed4169d67460ee1add6661b";
+    };
+  };
+    
+  sysimg_15 = buildSystemImage {
+    name = "armeabi-v7a-15";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/sysimg_armv7a-15_r02.zip;
+      sha1 = "1bf977d6cb4e0ad38dceac0c4863d1caa21f326e";
+    };
+  };
+    
+  sysimg_16 = buildSystemImage {
+    name = "armeabi-v7a-16";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/sysimg_armv7a-16_r03.zip;
+      sha1 = "d1cddb23f17aad5821a089c403d4cddad2cf9ef7";
+    };
+  };
+    
+  sysimg_17 = buildSystemImage {
+    name = "armeabi-v7a-17";
+    src = fetchurl {
+      url = https://dl-ssl.google.com/android/repository/sysimg_armv7a-17_r01.zip;
+      sha1 = "45b9344473e0a6d063c2b1fe58d8cd47d307905e";
+    };
+  };
+    
+}
+  
\ No newline at end of file
diff --git a/pkgs/development/mobile/titaniumenv/build-app.nix b/pkgs/development/mobile/titaniumenv/build-app.nix
new file mode 100644
index 00000000000..24bb1d2d93a
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/build-app.nix
@@ -0,0 +1,130 @@
+{stdenv, androidsdk, titaniumsdk, xcodewrapper}:
+{ appId, name, appName ? null, src, target, androidPlatformVersions ? [ "8" ]
+, release ? false, androidKeyStore ? null, androidKeyAlias ? null, androidKeyStorePassword ? null
+, iosKeyFile ? null, iosCertificateName ? null, iosCertificate ? null, iosCertificatePassword ? null, iosDistribute ? false
+}:
+
+assert (release && target == "android") -> androidKeyStore != null && androidKeyAlias != null && androidKeyStorePassword != null;
+assert (release && target == "iphone") -> iosKeyFile != null && iosCertificateName != null && iosCertificate != null && iosCertificatePassword != null;
+
+let
+  androidsdkComposition = androidsdk {
+    platformVersions = androidPlatformVersions;
+    useGoogleAPIs = true;
+  };
+  
+  deleteKeychain = "security delete-keychain $keychainName";
+  
+  _appName = if appName == null then name else appName;
+in
+stdenv.mkDerivation {
+  name = stdenv.lib.replaceChars [" "] [""] name;
+  inherit src;
+  
+  buildInputs = [] ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") xcodewrapper;
+
+  buildPhase = ''
+    export HOME=$TMPDIR
+
+    mkdir -p $out
+    
+    ${if target == "android" then
+        if release then
+          ''${titaniumsdk}/mobilesdk/*/*/android/builder.py distribute "${_appName}" ${androidsdkComposition}/libexec/android-sdk-* $(pwd) ${appId} ${androidKeyStore} ${androidKeyStorePassword} ${androidKeyAlias} $out''
+        else
+          ''${titaniumsdk}/mobilesdk/*/*/android/builder.py build "${_appName}" ${androidsdkComposition}/libexec/android-sdk-* $(pwd) ${appId}''
+
+      else if target == "iphone" then
+        if iosDistribute then ''
+            export HOME=/Users/$(whoami)
+            export keychainName=$(basename $out)
+            
+            # Create a keychain with the component hash name (should always be unique)
+            security create-keychain -p "" $keychainName
+            security default-keychain -s $keychainName
+            security unlock-keychain -p "" $keychainName
+            security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
+
+            provisioningId=$(grep UUID -A1 -a ${iosKeyFile} | grep -o "[-A-Z0-9]\{36\}")
+   
+            # Ensure that the requested provisioning profile can be found
+            
+            if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision" ]
+            then
+                mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+                cp ${iosKeyFile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
+            fi
+            
+            ${titaniumsdk}/mobilesdk/*/*/iphone/builder.py distribute 6.0 $(pwd) ${appId} "${_appName}" "$provisioningId" "${iosCertificateName}" $out universal "$HOME/Library/Keychains/$keychainName"
+            
+            # Remove our generated keychain
+            
+            ${deleteKeychain}
+          ''
+        else
+            if release then
+              ''
+                export HOME=/Users/$(whoami)
+                export keychainName=$(basename $out)
+            
+                # Create a keychain with the component hash name (should always be unique)
+                security create-keychain -p "" $keychainName
+                security default-keychain -s $keychainName
+                security unlock-keychain -p "" $keychainName
+                security import ${iosCertificate} -k $keychainName -P "${iosCertificatePassword}" -A
+
+                provisioningId=$(grep UUID -A1 -a ${iosKeyFile} | grep -o "[-A-Z0-9]\{36\}")
+   
+                # Ensure that the requested provisioning profile can be found
+            
+                if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision" ]
+                then
+                    mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+                    cp ${iosKeyFile} "$HOME/Library/MobileDevice/Provisioning Profiles/$provisioningId.mobileprovision"
+                fi
+            
+                ${titaniumsdk}/mobilesdk/*/*/iphone/builder.py adhoc 6.0 $(pwd) ${appId} "${_appName}" "$provisioningId" "${iosCertificateName}" universal "$HOME/Library/Keychains/$keychainName"
+            
+                # Remove our generated keychain
+            
+                ${deleteKeychain}
+          ''
+        else
+          ''
+            # Copy all sources to the output store directory.
+            # Why? Debug application include *.js files, which are symlinked into their
+            # sources. If they are not copied, we have dangling references to the
+            # temp folder.
+            
+            cp -av * $out
+            cd $out
+            ${titaniumsdk}/mobilesdk/*/*/iphone/builder.py build 6.0 $(pwd) ${appId} "${_appName}" universal
+          ''
+
+      else throw "Target: ${target} is not supported!"}
+  '';
+  
+  installPhase = ''
+    mkdir -p $out
+    
+    ${if target == "android" && release then ""
+      else
+        if target == "android" then
+          ''cp $(ls build/android/bin/*.apk | grep -v '\-unsigned.apk') $out''
+        else if target == "iphone" && release then
+           ''
+             cp -av build/iphone/build/* $out
+             mkdir -p $out/nix-support
+             echo "file binary-dist \"$(echo $out/Release-iphoneos/*.ipa)\"" > $out/nix-support/hydra-build-products
+           ''
+        else if target == "iphone" then ""
+        else throw "Target: ${target} is not supported!"}
+    
+    ${if target == "android" then ''
+        mkdir -p $out/nix-support
+        echo "file binary-dist \"$(ls $out/*.apk)\"" > $out/nix-support/hydra-build-products
+    '' else ""}
+  '';
+  
+  failureHook = stdenv.lib.optionalString (release && target == "iphone") deleteKeychain;
+}
diff --git a/pkgs/development/mobile/titaniumenv/default.nix b/pkgs/development/mobile/titaniumenv/default.nix
new file mode 100644
index 00000000000..b7b5a048b97
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/default.nix
@@ -0,0 +1,26 @@
+{pkgs, pkgs_i686, version ? "3.1"}:
+
+let
+  titaniumexpr = if version == "2.1" then
+    ./titaniumsdk-2.1.nix
+  else if version == "3.1" then
+    ./titaniumsdk.nix
+  else
+    throw "Unknown Titanium SDK version: ${version}";
+in
+rec {
+  androidenv = pkgs.androidenv;
+
+  xcodeenv = if pkgs.stdenv.system == "x86_64-darwin" then pkgs.xcodeenv else null;
+  
+  titaniumsdk = import titaniumexpr {
+    inherit (pkgs) stdenv fetchurl unzip makeWrapper python jdk;
+  };
+  
+  buildApp = import ./build-app.nix {
+    inherit (pkgs) stdenv;
+    inherit (androidenv) androidsdk;
+    inherit (xcodeenv) xcodewrapper;
+    inherit titaniumsdk;
+  };
+}
diff --git a/pkgs/development/mobile/titaniumenv/examples/default.nix b/pkgs/development/mobile/titaniumenv/examples/default.nix
new file mode 100644
index 00000000000..9a5736b37ac
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/default.nix
@@ -0,0 +1,42 @@
+{ nixpkgs ? <nixpkgs>
+, system ? builtins.currentSystem
+, version ? "3.1"
+}:
+
+let
+  pkgs = import nixpkgs { inherit system; };
+  pkgs_darwin_x86_64 = import nixpkgs { system = "x86_64-darwin"; };
+  versionString = pkgs.stdenv.lib.replaceChars [ "." ] [ "_" ] version;
+in
+rec {
+  kitchensink_android = import ./kitchensink {
+    inherit (pkgs) fetchgit;
+    titaniumenv = builtins.getAttr "titaniumenv_${versionString}" pkgs;
+    target = "android";
+  };
+  
+  kitchensink_iphone = import ./kitchensink {
+    inherit (pkgs_darwin_x86_64) fetchgit;
+    titaniumenv = builtins.getAttr "titaniumenv_${versionString}" pkgs_darwin_x86_64;
+    target = "iphone";
+  };
+  
+  emulate_kitchensink = import ./emulate-kitchensink {
+    inherit (pkgs.titaniumenv) androidenv;
+    kitchensink = kitchensink_android;
+  };
+  
+  simulate_kitchensink_iphone = import ./simulate-kitchensink {
+    inherit (pkgs_darwin_x86_64) stdenv;
+    inherit (pkgs_darwin_x86_64.titaniumenv) xcodeenv;
+    kitchensink = kitchensink_iphone;
+    device = "iPhone";
+  };
+  
+  simulate_kitchensink_ipad = import ./simulate-kitchensink {
+    inherit (pkgs_darwin_x86_64) stdenv;
+    inherit (pkgs_darwin_x86_64.titaniumenv) xcodeenv;
+    kitchensink = kitchensink_iphone;
+    device = "iPad";
+  };
+}
diff --git a/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix
new file mode 100644
index 00000000000..5187b0e0238
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/emulate-kitchensink/default.nix
@@ -0,0 +1,10 @@
+{androidenv, kitchensink}:
+
+androidenv.emulateApp {
+  name = "emulate-${kitchensink.name}";
+  app = kitchensink;
+  platformVersion = "16";
+  useGoogleAPIs = true;
+  package = "com.appcelerator.kitchensink";
+  activity = "KitchensinkActivity";
+}
diff --git a/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
new file mode 100644
index 00000000000..b195bfcae7a
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/kitchensink/default.nix
@@ -0,0 +1,25 @@
+{titaniumenv, fetchgit, target, androidPlatformVersions ? [ "11" ]}:
+
+titaniumenv.buildApp {
+  name = "KitchenSink-${target}";
+  appName = "KitchenSink";
+  appId = "com.appcelerator.kitchensink";
+  src = fetchgit {
+    url = https://github.com/appcelerator/KitchenSink.git;
+    rev = "b68757ef6639e3da564e21038dc9c1aee1f80907";
+    sha256 = "17yabdkl0p6pf2a2lcgw1kid2smwc8rnpx0i9fa4avj6930cbh5i";
+  };
+  
+  inherit target androidPlatformVersions;
+  
+  /*release = true;
+  androidKeyStore = /home/sander/keystore;
+  androidKeyAlias = "sander";
+  androidKeyStorePassword = "foobar";*/
+  
+  /*release = true;
+  iosKeyFile = /Users/sander/Downloads/profile.mobileprovision;
+  iosCertificateName = "My Company";
+  iosCertificate = /Users/sander/Downloads/c.p12;
+  iosCertificatePassword = "";*/
+}
diff --git a/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix
new file mode 100644
index 00000000000..a5ab8d59a74
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/examples/simulate-kitchensink/default.nix
@@ -0,0 +1,9 @@
+{stdenv, xcodeenv, kitchensink, device}:
+
+xcodeenv.simulateApp {
+  name = "simulate-${kitchensink.name}-${stdenv.lib.replaceChars [" " "(" ")"] ["_" "" ""] device}";
+  appName = "KitchenSink";
+  app = kitchensink;
+  inherit device;
+  baseDir = "build/iphone/build/Debug-iphonesimulator";
+}
diff --git a/pkgs/development/mobile/titaniumenv/fixnativelibs.sed b/pkgs/development/mobile/titaniumenv/fixnativelibs.sed
new file mode 100644
index 00000000000..76b330136b6
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/fixnativelibs.sed
@@ -0,0 +1 @@
+s|\t\t\t\t\t\t\t\tapk_zip.write(native_lib, path_in_zip)|\t\t\t\t\t\t\t\tinfo = zipfile.ZipInfo(path_in_zip)\n\t\t\t\t\t\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\t\t\t\t\tinfo.create_system = 3\n\t\t\t\t\t\t\t\tf = open(native_lib)\n\t\t\t\t\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\t\t\t\t\tf.close()|
diff --git a/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed b/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed
new file mode 100644
index 00000000000..c849aaa611c
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/fixselfruntimev8.sed
@@ -0,0 +1 @@
+s|apk_zip.write(os.path.join(lib_source_dir, fname), lib_dest_dir + fname)|info = zipfile.ZipInfo(lib_dest_dir + fname)\n\t\t\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\t\tinfo.create_system = 3\n\t\t\t\t\tf = open(os.path.join(lib_source_dir, fname))\n\t\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\t\tf.close()|
diff --git a/pkgs/development/mobile/titaniumenv/fixso.sed b/pkgs/development/mobile/titaniumenv/fixso.sed
new file mode 100644
index 00000000000..9a3bb0389a7
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/fixso.sed
@@ -0,0 +1 @@
+s|apk_zip.write(os.path.join(lib_source_dir, fname), lib_dest_dir + fname)|info = zipfile.ZipInfo(lib_dest_dir + fname)\n\t\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\t\tinfo.create_system = 3\n\t\t\t\tf = open(os.path.join(lib_source_dir, fname))\n\t\t\t\tapk_zip.writestr(info, f.read())\n\t\t\t\tf.close()|
diff --git a/pkgs/development/mobile/titaniumenv/fixtiprofiler.sed b/pkgs/development/mobile/titaniumenv/fixtiprofiler.sed
new file mode 100644
index 00000000000..e9a8f5b5baa
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/fixtiprofiler.sed
@@ -0,0 +1 @@
+s|apk_zip.write(os.path.join(lib_source_dir, 'libtiprofiler.so'), lib_dest_dir + 'libtiprofiler.so')|info = zipfile.ZipInfo(lib_dest_dir + 'libtiprofiler.so')\n\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\tinfo.create_system = 3\n\t\t\tf = open(os.path.join(lib_source_dir, 'libtiprofiler.so'))\n\t\t\tapk_zip.writestr(info, f.read())\n\t\t\tf.close()\n|
diff --git a/pkgs/development/mobile/titaniumenv/fixtiverify.sed b/pkgs/development/mobile/titaniumenv/fixtiverify.sed
new file mode 100644
index 00000000000..8e1114769c8
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/fixtiverify.sed
@@ -0,0 +1 @@
+s|apk_zip.write(os.path.join(lib_source_dir, 'libtiverify.so'), lib_dest_dir + 'libtiverify.so')|info = zipfile.ZipInfo(lib_dest_dir + 'libtiverify.so')\n\t\t\tinfo.compress_type = zipfile.ZIP_DEFLATED\n\t\t\tinfo.create_system = 3\n\t\t\tf = open(os.path.join(lib_source_dir, 'libtiverify.so'))\n\t\t\tapk_zip.writestr(info, f.read())\n\t\t\tf.close()|
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix
new file mode 100644
index 00000000000..414b444fb46
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk-2.1.nix
@@ -0,0 +1,60 @@
+{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
+
+stdenv.mkDerivation {
+  name = "titanium-mobilesdk-2.1.4.v20121109124659";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/2_1_X/mobilesdk-2.1.4.v20121109124659-linux.zip;
+    sha1 = "381eb4b06b5a261ddf336c52d4714e5626142697";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/2_1_X/mobilesdk-2.1.4.v20121109124659-osx.zip;
+    sha1 = "1cef5803f0c7b7bb35feb88d3f91bbb191e3953e";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+  
+  buildInputs = [ unzip makeWrapper ];
+  
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    yes y | unzip $src
+    
+    # Fix shebang header for python scripts
+    
+    find . -name \*.py | while read i
+    do
+        sed -i -e "s|#!/usr/bin/env python|#!${python}/bin/python|" $i
+    done
+   
+    # Zip files do not support timestamps lower than 1980. We have to apply a few work-arounds to cope with that
+    # Yes, I know it's nasty :-)
+    
+    cd mobilesdk/*/*/android
+    
+    sed -i -f ${./fixtiverify.sed} builder.py
+    sed -i -f ${./fixselfruntimev8.sed} builder.py
+    sed -i -f ${./fixnativelibs.sed} builder.py
+    
+    # Patch some executables
+    
+    ${if stdenv.system == "i686-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64
+      ''
+      else ""}
+    
+    # Wrap builder script
+    
+    wrapProgram `pwd`/builder.py \
+      --prefix PYTHONPATH : ${python.modules.sqlite3}/lib/python*/site-packages \
+      --prefix PATH : ${jdk}/bin \
+      --prefix JAVA_HOME : ${jdk}
+  '' + stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+    # 'ditto' utility is needed to copy stuff to the Xcode organizer. Dirty, but this allows it to work.
+    sed -i -e "s|ditto|/usr/bin/ditto|g" $out/mobilesdk/osx/*/iphone/builder.py
+  '';
+}
diff --git a/pkgs/development/mobile/titaniumenv/titaniumsdk.nix b/pkgs/development/mobile/titaniumenv/titaniumsdk.nix
new file mode 100644
index 00000000000..edae828bd08
--- /dev/null
+++ b/pkgs/development/mobile/titaniumenv/titaniumsdk.nix
@@ -0,0 +1,61 @@
+{stdenv, fetchurl, unzip, makeWrapper, python, jdk}:
+
+stdenv.mkDerivation {
+  name = "titanium-mobilesdk-3.1.0.v20130415184552";
+  src = if (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux") then fetchurl {
+    url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/3_1_X/mobilesdk-3.1.0.v20130415184552-linux.zip;
+    sha1 = "7a8b34b92f6c3eff33eefb9a1b6b0d2e3670001d";
+  }
+  else if stdenv.system == "x86_64-darwin" then fetchurl {
+    url = http://builds.appcelerator.com.s3.amazonaws.com/mobile/3_1_X/mobilesdk-3.1.0.v20130415184552-osx.zip;
+    sha1 = "e0ed7e399a104e0838e245550197bf787a66bf98";
+  }
+  else throw "Platform: ${stdenv.system} not supported!";
+  
+  buildInputs = [ unzip makeWrapper ];
+  
+  buildCommand = ''
+    mkdir -p $out
+    cd $out
+    yes y | unzip $src
+    
+    # Fix shebang header for python scripts
+    
+    find . -name \*.py | while read i
+    do
+        sed -i -e "s|#!/usr/bin/env python|#!${python}/bin/python|" $i
+    done
+   
+    # Zip files do not support timestamps lower than 1980. We have to apply a few work-arounds to cope with that
+    # Yes, I know it's nasty :-)
+    
+    cd mobilesdk/*/*/android
+    
+    sed -i -f ${./fixtiverify.sed} builder.py
+    sed -i -f ${./fixtiprofiler.sed} builder.py
+    sed -i -f ${./fixso.sed} builder.py
+    sed -i -f ${./fixnativelibs.sed} builder.py
+    
+    # Patch some executables
+    
+    ${if stdenv.system == "i686-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux.so.2 titanium_prep.linux32
+      ''
+      else if stdenv.system == "x86_64-linux" then
+      ''
+        patchelf --set-interpreter ${stdenv.gcc.libc}/lib/ld-linux-x86-64.so.2 titanium_prep.linux64
+      ''
+      else ""}
+    
+    # Wrap builder script
+    
+    wrapProgram `pwd`/builder.py \
+      --prefix PYTHONPATH : ${python.modules.sqlite3}/lib/python*/site-packages \
+      --prefix PATH : ${jdk}/bin \
+      --prefix JAVA_HOME : ${jdk}
+  '' + stdenv.lib.optionalString (stdenv.system == "x86_64-darwin") ''
+    # 'ditto' utility is needed to copy stuff to the Xcode organizer. Dirty, but this allows it to work.
+    sed -i -e "s|ditto|/usr/bin/ditto|g" $out/mobilesdk/osx/*/iphone/builder.py
+  '';
+}
diff --git a/pkgs/development/mobile/xcodeenv/build-app.nix b/pkgs/development/mobile/xcodeenv/build-app.nix
new file mode 100644
index 00000000000..ac6bbc7f282
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/build-app.nix
@@ -0,0 +1,98 @@
+{stdenv, xcodewrapper}:
+{ name
+, src
+, sdkVersion ? "6.1"
+, target ? null
+, configuration ? null
+, scheme ? null
+, sdk ? null
+, arch ? null
+, xcodeFlags ? ""
+, release ? false
+, codeSignIdentity ? null
+, certificateFile ? null
+, certificatePassword ? null
+, provisioningProfile ? null
+, generateIPA ? false
+, generateXCArchive ? false
+}:
+
+assert release -> codeSignIdentity != null && certificateFile != null && certificatePassword != null && provisioningProfile != null;
+
+let
+  # Set some default values here
+  
+  _target = if target == null then name else target;
+  _scheme = if scheme == null then name else scheme;
+
+  _configuration = if configuration == null
+    then
+      if release then "Release" else "Debug"
+    else configuration;
+    
+  _arch = if arch == null
+    then
+      if release then "armv7" else "i386"
+    else arch;
+
+  _sdk = if sdk == null
+    then
+      if release then "iphoneos" + sdkVersion else "iphonesimulator" + sdkVersion
+    else sdk;
+
+  # The following is to prevent repetition
+  deleteKeychain = "security delete-keychain $keychainName";
+in
+stdenv.mkDerivation {
+  name = stdenv.lib.replaceChars [" "] [""] name;
+  inherit src;
+  buildInputs = [ xcodewrapper ];
+  buildPhase = ''
+    ${stdenv.lib.optionalString release ''
+        export HOME=/Users/$(whoami)
+        keychainName="$(basename $out)"
+        
+        # Create a keychain
+        security create-keychain -p "" $keychainName
+        security default-keychain -s $keychainName
+        security unlock-keychain -p "" $keychainName
+        
+        # Import the certificate into the keychain
+        security import ${certificateFile} -k $keychainName -P "${certificatePassword}" -A 
+
+        # Determine provisioning ID
+        PROVISIONING_PROFILE=$(grep UUID -A1 -a ${provisioningProfile} | grep -o "[-A-Z0-9]\{36\}")
+
+        if [ ! -f "$HOME/Library/MobileDevice/Provisioning Profiles/$PROVISIONING_PROFILE.mobileprovision" ]
+        then
+            # Copy provisioning profile into the home directory
+            mkdir -p "$HOME/Library/MobileDevice/Provisioning Profiles"
+            cp ${provisioningProfile} "$HOME/Library/MobileDevice/Provisioning Profiles/$PROVISIONING_PROFILE.mobileprovision"
+        fi
+        
+        # Check whether the identity can be found
+        security find-identity -p codesigning $keychainName
+      ''}
+
+    # Do the building
+    xcodebuild -target ${_target} -configuration ${_configuration} -scheme ${_scheme} -sdk ${_sdk} -arch ${_arch} ONLY_ACTIVE_ARCH=NO CONFIGURATION_TEMP_DIR=$TMPDIR CONFIGURATION_BUILD_DIR=$out ${if generateXCArchive then "archive" else ""} ${xcodeFlags} ${if release then ''"CODE_SIGN_IDENTITY=${codeSignIdentity}" PROVISIONING_PROFILE=$PROVISIONING_PROFILE OTHER_CODE_SIGN_FLAGS="--keychain $HOME/Library/Keychains/$keychainName"'' else ""}
+    
+    ${stdenv.lib.optionalString release ''
+      ${stdenv.lib.optionalString generateIPA ''
+        # Produce an IPA file
+        xcrun -sdk iphoneos PackageApplication -v $out/*.app -o "$out/${name}.ipa"
+        
+        # Add IPA to Hydra build products
+        mkdir -p $out/nix-support
+        echo "file binary-dist \"$(echo $out/*.ipa)\"" > $out/nix-support/hydra-build-products
+      ''}
+      
+      # Delete our temp keychain
+      ${deleteKeychain}
+    ''}
+  '';
+  
+  failureHook = stdenv.lib.optionalString release deleteKeychain;
+  
+  installPhase = "true";
+}
diff --git a/pkgs/development/mobile/xcodeenv/default.nix b/pkgs/development/mobile/xcodeenv/default.nix
new file mode 100644
index 00000000000..7f834688e63
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/default.nix
@@ -0,0 +1,15 @@
+{stdenv}:
+
+rec {
+  xcodewrapper = import ./xcodewrapper.nix {
+    inherit stdenv;
+  };
+
+  buildApp = import ./build-app.nix {
+    inherit stdenv xcodewrapper;
+  };
+
+  simulateApp = import ./simulate-app.nix {
+    inherit stdenv xcodewrapper;
+  };
+}
diff --git a/pkgs/development/mobile/xcodeenv/simulate-app.nix b/pkgs/development/mobile/xcodeenv/simulate-app.nix
new file mode 100644
index 00000000000..96f70ea3832
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/simulate-app.nix
@@ -0,0 +1,20 @@
+{stdenv, xcodewrapper}:
+{name, appName ? null, app, device ? "iPhone", baseDir ? ""}:
+
+let
+  _appName = if appName == null then name else appName;
+in
+stdenv.mkDerivation {
+  name = stdenv.lib.replaceChars [" "] [""] name;
+  buildCommand = ''
+    ensureDir $out/bin
+    cat > $out/bin/run-test-simulator << "EOF"
+    #! ${stdenv.shell} -e
+
+    cd "${app}/${baseDir}/${_appName}.app"
+    "$(readlink "${xcodewrapper}/bin/iPhone Simulator")" -SimulateApplication './${_appName}' -SimulateDevice '${device}'
+    EOF
+    chmod +x $out/bin/run-test-simulator
+  '';
+}
+
diff --git a/pkgs/development/mobile/xcodeenv/xcodewrapper.nix b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
new file mode 100644
index 00000000000..77d2c4c867e
--- /dev/null
+++ b/pkgs/development/mobile/xcodeenv/xcodewrapper.nix
@@ -0,0 +1,21 @@
+{stdenv, version ? "4.6"}:
+
+stdenv.mkDerivation {
+  name = "xcode-wrapper-"+version;
+  buildCommand = ''
+    ensureDir $out/bin
+    cd $out/bin
+    ln -s /usr/bin/xcode-select
+    ln -s /usr/bin/xcodebuild
+    ln -s /usr/bin/xcrun
+    ln -s /usr/bin/security
+    ln -s "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator"
+
+    # Check if we have the xcodebuild version that we want
+    if [ -z "$($out/bin/xcodebuild -version | grep ${version})" ]
+    then
+        echo "We require xcodebuild version: ${version}"
+        exit 1
+    fi
+  '';
+}
diff --git a/pkgs/development/ocaml-modules/extlib/default.nix b/pkgs/development/ocaml-modules/extlib/default.nix
index a520f8196d8..d59dbae45fe 100644
--- a/pkgs/development/ocaml-modules/extlib/default.nix
+++ b/pkgs/development/ocaml-modules/extlib/default.nix
@@ -4,11 +4,10 @@ stdenv.mkDerivation {
   name = "ocaml-extlib-1.5.2";
 
   src = fetchurl {
-    url = "http://ocaml-extlib.googlecode.com/files/extlib-1.5.2.tar.gz";
-    sha256 = "ca6d69adeba4242ce41c02a23746ba1e464c0bbec66e2d16b02c3c6e85dc10aa";
+    url = http://ocaml-extlib.googlecode.com/files/extlib-1.5.3.tar.gz;
+    sha256 = "c095eef4202a8614ff1474d4c08c50c32d6ca82d1015387785cf03d5913ec021";
   };
 
-  patches = [ ./hashtable-ocaml4-compat.patch ];
   buildInputs = [ocaml findlib];
 
   createFindlibDestdir = true;
@@ -19,9 +18,9 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    homepage = "http://code.google.com/p/ocaml-extlib/";
+    homepage = http://code.google.com/p/ocaml-extlib/;
     description = "Enhancements to the OCaml Standard Library modules";
-    license = "LGPL";
+    license = stdenv.lib.licenses.lgpl21;
     platforms = ocaml.meta.platforms;
   };
 }
diff --git a/pkgs/development/ocaml-modules/extlib/hashtable-ocaml4-compat.patch b/pkgs/development/ocaml-modules/extlib/hashtable-ocaml4-compat.patch
deleted file mode 100644
index c587f2b6cd3..00000000000
--- a/pkgs/development/ocaml-modules/extlib/hashtable-ocaml4-compat.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-Revision 396 from the official extlib repository.
-
---- extlib/extHashtbl.ml	(revision 395)
-+++ extlib/extHashtbl.ml	(working copy)
-@@ -32,6 +32,7 @@
- 	}
- 
- 	include Hashtbl
-+	let create n = Hashtbl.create (* no seed *) n
- 
- 	external h_conv : ('a, 'b) t -> ('a, 'b) h_t = "%identity"
- 	external h_make : ('a, 'b) h_t -> ('a, 'b) t = "%identity"
\ No newline at end of file
diff --git a/pkgs/development/ocaml-modules/lablgtkmathview/configure.patch b/pkgs/development/ocaml-modules/lablgtkmathview/configure.patch
deleted file mode 100644
index b841e8f4382..00000000000
--- a/pkgs/development/ocaml-modules/lablgtkmathview/configure.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- configure	2010-09-02 10:58:16.128236964 -0400
-+++ configure.old	2010-09-02 10:57:42.368111615 -0400
-@@ -1637,9 +1637,9 @@
- echo "$as_me:$LINENO: result: $ac_cv_file__usr_include_caml_mlvalues_h" >&5
- echo "${ECHO_T}$ac_cv_file__usr_include_caml_mlvalues_h" >&6
- if test $ac_cv_file__usr_include_caml_mlvalues_h = yes; then
--  OCAML_INCLUDE_DIR=/usr/include
-+  OCAML_INCLUDE_DIR=/usr/include/caml
- else
--  OCAML_INCLUDE_DIR=$OCAML_LIB_DIR
-+  OCAML_INCLUDE_DIR=$OCAML_LIB_DIR/caml
- 
- fi
- 
diff --git a/pkgs/development/ocaml-modules/ocamlnet/default.nix b/pkgs/development/ocaml-modules/ocamlnet/default.nix
index e4dc43743f3..4d9e934b628 100644
--- a/pkgs/development/ocaml-modules/ocamlnet/default.nix
+++ b/pkgs/development/ocaml-modules/ocamlnet/default.nix
@@ -2,15 +2,14 @@
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
-  version = "3.1";
 in
 
 stdenv.mkDerivation {
-  name = "ocamlnet-${version}";
+  name = "ocamlnet-3.6";
 
   src = fetchurl {
-    url = "http://download.camlcity.org/download/ocamlnet-${version}.tar.gz";
-    sha256 = "0kdc2540ad84j6haj9jxlwryz9cb8q8kjdr48f2wgvcaii38v9f5";
+    url = http://download.camlcity.org/download/ocamlnet-3.6.tar.gz;
+    sha256 = "306c20aee6512be3564c0f39872b70f929c06e1e893cfcf528ac47ae35cf7a69";
   };
 
   buildInputs = [ncurses ocaml findlib ocaml_pcre camlzip openssl ocaml_ssl];
diff --git a/pkgs/development/ocaml-modules/ounit/default.nix b/pkgs/development/ocaml-modules/ounit/default.nix
index 8f21ba649bf..533f1ec8d1c 100644
--- a/pkgs/development/ocaml-modules/ounit/default.nix
+++ b/pkgs/development/ocaml-modules/ounit/default.nix
@@ -5,11 +5,11 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "ounit-1.1.0";
+  name = "ounit-1.1.2";
 
   src = fetchurl {
-    url = http://forge.ocamlcore.org/frs/download.php/495/ounit-1.1.0.tar.gz;
-    sha256 = "12vybg9xlw5c8ip23p8cljfzhkdsm25482sf1yh46fcqq8p2jmqx";
+    url = http://forge.ocamlcore.org/frs/download.php/886/ounit-1.1.2.tar.gz;
+    sha256 = "e6bc1b0cdbb5b5552d85bee653e23aafe20bb97fd7cd229c867d01ff999888e3";
   };
 
   buildInputs = [ocaml findlib];
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://www.xs4all.nl/~mmzeeman/ocaml/;
     description = "Unit test framework for OCaml";
-    license = "MIT/X11";
+    license = stdenv.lib.licenses.mit;
     platforms = ocaml.meta.platforms;
     maintainers = [
       stdenv.lib.maintainers.z77z
diff --git a/pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix b/pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix
deleted file mode 100644
index 6515efada6f..00000000000
--- a/pkgs/development/perl-modules/Compress-Raw-Bzip2/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{ fetchurl, buildPerlPackage, bzip2 }:
-
-buildPerlPackage rec {
-  name = "Compress-Raw-Bzip2-2.049";
-
-  src = fetchurl {
-    url = "mirror://cpan/modules/by-module/Compress/${name}.tar.gz";
-    sha256 = "7881473e0ab5ecc6ce609382e4f7466fb32217e928eef27e7084702bb07ac172";
-  };
-
-  # Don't build a private copy of bzip2.
-  BUILD_BZIP2 = false;
-  BZIP2_LIB = "${bzip2}/lib";
-  BZIP2_INCLUDE = "${bzip2}/include";
-}
diff --git a/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix b/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
index c2c7b5f8363..70c2a294d6f 100644
--- a/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
+++ b/pkgs/development/perl-modules/Compress-Raw-Zlib/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, buildPerlPackage, zlib, stdenv }:
 
 buildPerlPackage rec {
-  name = "Compress-Raw-Zlib-2.051";
+  name = "Compress-Raw-Zlib-2.060";
 
   src = fetchurl {
     url = "mirror://cpan/modules/by-module/Compress/${name}.tar.gz";
-    sha256 = "16c7e0d2ed339c0b5ffe787bbcc9fc063ce6f2145d8cd6a18d0c79fa68d36c09";
+    sha256 = "03z2vqcdpysanqnh9m714fs2mcfshzbkd8i11w359h69h5q0kms3";
   };
 
   preConfigure = ''
@@ -19,4 +19,8 @@ buildPerlPackage rec {
   '';
 
   doCheck = !stdenv.isDarwin;
+
+  meta = {
+    license = "perl5";
+  };
 }
diff --git a/pkgs/development/perl-modules/DBD-Pg/default.nix b/pkgs/development/perl-modules/DBD-Pg/default.nix
index 0d0cb1accc5..be5faa330ae 100644
--- a/pkgs/development/perl-modules/DBD-Pg/default.nix
+++ b/pkgs/development/perl-modules/DBD-Pg/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, buildPerlPackage, DBI, postgresql }:
 
 buildPerlPackage rec {
-  name = "DBD-Pg-2.19.2";
+  name = "DBD-Pg-2.19.3";
 
   src = fetchurl {
     url = "mirror://cpan/modules/by-module/DBD/${name}.tar.gz";
-    sha256 = "0scnhbp0lfclbppbsfzmcyw32z8jhb9calvbg9q3gk4kli1119j9";
+    sha256 = "0ai6p2094hrh6kjlwfjvpw2z8wqa3scr4ba3p6rqza3z9c9hsd9p";
   };
 
   buildInputs = [ postgresql ];
@@ -13,5 +13,10 @@ buildPerlPackage rec {
 
   makeMakerFlags = "POSTGRES_HOME=${postgresql}";
 
-  meta.platforms = stdenv.lib.platforms.linux;
+  meta = {
+    homepage = http://search.cpan.org/dist/DBD-Pg/;
+    description = "DBI PostgreSQL interface";
+    license = "perl";
+    platforms = stdenv.lib.platforms.linux;
+  };
 }
diff --git a/pkgs/development/perl-modules/DBD-SQLite/default.nix b/pkgs/development/perl-modules/DBD-SQLite/default.nix
index bbe50182b90..332a3bd0e8f 100644
--- a/pkgs/development/perl-modules/DBD-SQLite/default.nix
+++ b/pkgs/development/perl-modules/DBD-SQLite/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, buildPerlPackage, DBI, sqlite }:
 
 buildPerlPackage rec {
-  name = "DBD-SQLite-1.35";
+  name = "DBD-SQLite-1.37";
 
   src = fetchurl {
     url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-    sha256 = "0zdwnj0jmkaqb2grkh451g1jc8nsdy4sf6lhn8xd0my0a3pd227z";
+    sha256 = "0197kvlziaj2wfdbzlhdlqmzvb29fmfyy6y2isbbwlg0b0f7ccd1";
   };
 
   propagatedBuildInputs = [ DBI ];
@@ -17,6 +17,11 @@ buildPerlPackage rec {
     ./external-sqlite.patch
   ];
 
+  preBuild =
+    ''
+      substituteInPlace Makefile --replace -L/usr/lib ""
+    '';
+
   postInstall =
     ''
       # Prevent warnings from `strip'.
diff --git a/pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch b/pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch
new file mode 100644
index 00000000000..6b634d0d242
--- /dev/null
+++ b/pkgs/development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch
@@ -0,0 +1,12 @@
+diff -Naur Google-ProtocolBuffers-0.08-orig/lib/Google/ProtocolBuffers/Compiler.pm Google-ProtocolBuffers-0.08/lib/Google/ProtocolBuffers/Compiler.pm
+--- Google-ProtocolBuffers-0.08-orig/lib/Google/ProtocolBuffers/Compiler.pm	2008-10-23 13:46:01.000000000 -0400
++++ Google-ProtocolBuffers-0.08/lib/Google/ProtocolBuffers/Compiler.pm	2013-01-16 13:52:09.855063997 -0500
+@@ -16,7 +16,7 @@
+ 

+ my $grammar = <<'END_OF_GRAMMAR';

+ 

+-proto       :   <skip: qr!  (?: //.*\n | \s+ )*  !x>

++proto       :   <skip: qr!  (?: //.*?\n | \s+ | /\*.*?\*/\s* )*  !xs>

+                 ## list of top level declarations. 

+                 ## Skip empty declarations and ";".

+                 (message | extend | enum | import | package | option | service | syntax | ";")(s) /\Z/

diff --git a/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch b/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch
new file mode 100644
index 00000000000..06207a8b733
--- /dev/null
+++ b/pkgs/development/perl-modules/catalyst-plugin-static-simple-etag.patch
@@ -0,0 +1,37 @@
+Send an ETag header, and honour the If-None-Match request header
+
+diff -ru -x '*~' Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm
+--- Catalyst-Plugin-Static-Simple-0.30-orig/lib/Catalyst/Plugin/Static/Simple.pm	2012-05-04 18:49:30.000000000 +0200
++++ Catalyst-Plugin-Static-Simple-0.30/lib/Catalyst/Plugin/Static/Simple.pm	2013-02-25 22:57:18.667150181 +0100
+@@ -187,16 +187,27 @@
+     my $type      = $c->_ext_to_type( $full_path );
+     my $stat      = stat $full_path;
+ 
+-    $c->res->headers->content_type( $type );
+-    $c->res->headers->content_length( $stat->size );
+-    $c->res->headers->last_modified( $stat->mtime );
+     # Tell Firefox & friends its OK to cache, even over SSL:
+-    $c->res->headers->header('Cache-control' => 'public');
++    #$c->res->headers->header('Cache-control' => 'public');
++
++    $c->res->headers->last_modified( $stat->mtime );
+     # Optionally, set a fixed expiry time:
+     if ($config->{expires}) {
+         $c->res->headers->expires(time() + $config->{expires});
+     }
+ 
++    if ($config->{send_etag}) {
++        my $etag = '"' . $stat->mtime . '-' . $stat->ino . '-'. $stat->size . '"';
++        $c->res->headers->header('ETag' => $etag);
++        if (($c->req->header('If-None-Match') // "") eq $etag) {
++            $c->res->status(304);
++            return 1;
++        }
++    }
++
++    $c->res->headers->content_type( $type );
++    $c->res->headers->content_length( $stat->size );
++
+     my $fh = IO::File->new( $full_path, 'r' );
+     if ( defined $fh ) {
+         binmode $fh;
diff --git a/pkgs/development/perl-modules/generic/builder.sh b/pkgs/development/perl-modules/generic/builder.sh
index df2fe853b4a..7c51bf1b591 100644
--- a/pkgs/development/perl-modules/generic/builder.sh
+++ b/pkgs/development/perl-modules/generic/builder.sh
@@ -33,8 +33,8 @@ postFixup() {
     # dependencies in the user environment (since Perl modules don't
     # have something like an RPATH, so the only way to find the
     # dependencies is to have them in the PERL5LIB variable).
-    if test -e $out/nix-support/propagated-build-native-inputs; then
-        ln -s $out/nix-support/propagated-build-native-inputs $out/nix-support/propagated-user-env-packages
+    if test -e $out/nix-support/propagated-native-build-inputs; then
+        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
     fi
 }
 
diff --git a/pkgs/development/perl-modules/module-pluggable.patch b/pkgs/development/perl-modules/module-pluggable.patch
index defe8e01ff6..51a029c106b 100644
--- a/pkgs/development/perl-modules/module-pluggable.patch
+++ b/pkgs/development/perl-modules/module-pluggable.patch
@@ -1,65 +1,27 @@
-diff -rc Module-Pluggable-3.5-orig/lib/Module/Pluggable/Object.pm Module-Pluggable-3.5/lib/Module/Pluggable/Object.pm
-*** Module-Pluggable-3.5-orig/lib/Module/Pluggable/Object.pm	2007-01-30 00:13:00.000000000 +0100
---- Module-Pluggable-3.5/lib/Module/Pluggable/Object.pm	2007-03-13 14:29:34.000000000 +0100
-***************
-*** 136,147 ****
-          my $sp = catdir($dir, (split /::/, $searchpath));
-  
-          # if it doesn't exist or it's not a dir then skip it
-!         next unless ( -e $sp && -d _ ); # Use the cached stat the second time
-  
-          my @files = $self->find_files($sp);
-  
-          # foreach one we've found 
-          foreach my $file (@files) {
-              # untaint the file; accept .pm only
-              next unless ($file) = ($file =~ /(.*$file_regex)$/); 
-              # parse the file to get the name
---- 136,148 ----
-          my $sp = catdir($dir, (split /::/, $searchpath));
-  
-          # if it doesn't exist or it's not a dir then skip it
-!         next unless ( -d $sp );
-  
-          my @files = $self->find_files($sp);
-  
-          # foreach one we've found 
-          foreach my $file (@files) {
-+              
-              # untaint the file; accept .pm only
-              next unless ($file) = ($file =~ /(.*$file_regex)$/); 
-              # parse the file to get the name
-***************
-*** 161,167 ****
-  
-              my $err = $self->handle_finding_plugin($plugin);
-              carp "Couldn't require $plugin : $err" if $err;
-!              
-              push @plugins, $plugin;
-          }
-  
---- 162,168 ----
-  
-              my $err = $self->handle_finding_plugin($plugin);
-              carp "Couldn't require $plugin : $err" if $err;
-! 
-              push @plugins, $plugin;
-          }
-  
-***************
-*** 201,207 ****
-                               (my $path = $File::Find::name) =~ s#^\\./##;
-                               push @files, $path;
-                             }
-!                       }, $search_path );
-      }
-      #chdir $cwd;
-      return @files;
---- 202,208 ----
-                               (my $path = $File::Find::name) =~ s#^\\./##;
-                               push @files, $path;
-                             }
-!                       }, "$search_path/." );
-      }
-      #chdir $cwd;
-      return @files;
+diff -ru Module-Pluggable-4.8/lib/Module/Pluggable/Object.pm Module-Pluggable-4.8-new/lib/Module/Pluggable/Object.pm
+--- Module-Pluggable-4.8/lib/Module/Pluggable/Object.pm	2013-05-28 01:30:06.000000000 +0200
++++ Module-Pluggable-4.8-new/lib/Module/Pluggable/Object.pm	2013-06-02 23:24:52.704125205 +0200
+@@ -180,12 +180,13 @@
+         my $sp = catdir($dir, (split /::/, $searchpath));
+ 
+         # if it doesn't exist or it's not a dir then skip it
+-        next unless ( -e $sp && -d _ ); # Use the cached stat the second time
++        next unless ( -d $sp );
+ 
+         my @files = $self->find_files($sp);
+ 
+         # foreach one we've found 
+         foreach my $file (@files) {
++             
+             # untaint the file; accept .pm only
+             next unless ($file) = ($file =~ /(.*$file_regex)$/); 
+             # parse the file to get the name
+@@ -314,7 +315,7 @@
+                              (my $path = $File::Find::name) =~ s#^\\./##;
+                              push @files, $path;
+                            }
+-                      }, $search_path );
++                      }, "$search_path/." );
+     }
+     #chdir $cwd;
+     return @files;
diff --git a/pkgs/development/perl-modules/starman-dont-change-name.patch b/pkgs/development/perl-modules/starman-dont-change-name.patch
deleted file mode 100644
index 82454cfdd16..00000000000
--- a/pkgs/development/perl-modules/starman-dont-change-name.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Changing the process name breaks applying libcgroup rules, so don't do it.
-
-diff -ru -x '*~' Starman-0.2014-orig/lib/Starman/Server.pm Starman-0.2014/lib/Starman/Server.pm
---- Starman-0.2014-orig/lib/Starman/Server.pm	2011-08-27 01:19:43.000000000 +0200
-+++ Starman-0.2014/lib/Starman/Server.pm	2011-11-25 13:30:24.570434653 +0100
-@@ -100,7 +100,7 @@
- 
- sub run_parent {
-     my $self = shift;
--    $0 = "starman master " . join(" ", @{$self->{options}{argv} || []});
-+    #$0 = "starman master " . join(" ", @{$self->{options}{argv} || []});
-     $self->SUPER::run_parent(@_);
- }
- 
-@@ -113,7 +113,7 @@
-         DEBUG && warn "[$$] Initializing the PSGI app\n";
-         $self->{app} = $self->{options}->{psgi_app_builder}->();
-     }
--    $0 = "starman worker " . join(" ", @{$self->{options}{argv} || []});
-+    #$0 = "starman worker " . join(" ", @{$self->{options}{argv} || []});
- }
- 
- sub post_accept_hook {
diff --git a/pkgs/development/perl-modules/template-toolkit-nix-store.patch b/pkgs/development/perl-modules/template-toolkit-nix-store.patch
deleted file mode 100644
index 402f1cb41be..00000000000
--- a/pkgs/development/perl-modules/template-toolkit-nix-store.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -rc Template-Toolkit-2.20-orig/lib/Template/Provider.pm Template-Toolkit-2.20/lib/Template/Provider.pm
-*** Template-Toolkit-2.20-orig/lib/Template/Provider.pm	2008-08-06 11:32:02.000000000 +0200
---- Template-Toolkit-2.20/lib/Template/Provider.pm	2008-11-28 16:37:36.000000000 +0100
-***************
-*** 936,942 ****
-  sub _template_modified {
-      my $self = shift;
-      my $template = shift || return;
-!     return (stat( $template ))[9];
-  }
-  
-  #------------------------------------------------------------------------
---- 936,945 ----
-  sub _template_modified {
-      my $self = shift;
-      my $template = shift || return;
-!     # Nix specific hack: timestamps of 0 (1-1-1970) should not be
-!     # treated as undefined, so return 1 instead.
-!     my $t = (stat( $template ))[9]; 
-!     return (defined $t && $t == 0) ? 1 : $t;
-  }
-  
-  #------------------------------------------------------------------------
diff --git a/pkgs/development/python-modules/dbus/default.nix b/pkgs/development/python-modules/dbus/default.nix
index 0183944e201..bfce358a2aa 100644
--- a/pkgs/development/python-modules/dbus/default.nix
+++ b/pkgs/development/python-modules/dbus/default.nix
@@ -1,16 +1,22 @@
-{ stdenv, fetchurl, python, pkgconfig, dbus, dbus_glib }:
+{ stdenv, fetchurl, python, pkgconfig, dbus, dbus_glib, dbus_tools }:
 
 stdenv.mkDerivation rec {
-  name = "dbus-python-0.84.0";
+  name = "dbus-python-1.1.1";
 
   src = fetchurl {
     url = "http://dbus.freedesktop.org/releases/dbus-python/${name}.tar.gz";
-    sha256 = "01jrmj7ps79dkd6f8bzm17vxzpad1ixwmcb1liy64xm9y6mcfnxq";
+    sha256 = "122yj5y0mndk9axh735qvwwckck6s6x0q84dw6p97mplp17wl5w9";
   };
 
-  buildInputs = [ python pkgconfig dbus dbus_glib ];
+  postPatch = "patchShebangs .";
+
+  buildInputs = [ python pkgconfig dbus dbus_glib ]
+    ++ stdenv.lib.optional doCheck dbus_tools;
+
+  doCheck = false; # https://bugs.freedesktop.org/show_bug.cgi?id=57140
 
   meta = {
     description = "Python DBus bindings";
+    license = "MIT";
   };
 }
diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix
index 4e0b6100231..f72fbff1806 100644
--- a/pkgs/development/python-modules/generic/default.nix
+++ b/pkgs/development/python-modules/generic/default.nix
@@ -3,12 +3,14 @@
    (http://pypi.python.org/pypi/setuptools/), which represents a large
    number of Python packages nowadays.  */
 
-{ python, setuptools, wrapPython, lib }:
+{ python, setuptools, wrapPython, lib, offlineDistutils, recursivePthLoader }:
 
 { name, namePrefix ? "python-"
 
 , buildInputs ? []
 
+, propagatedBuildInputs ? []
+
 , # List of packages that should be added to the PYTHONPATH
   # environment variable in programs built by this function.  Packages
   # in the standard `propagatedBuildInputs' variable are also added.
@@ -19,9 +21,11 @@
 
 , installCommand ?
     ''
-      easy_install --prefix="$out" .
+      easy_install --always-unzip --prefix="$out" .
     ''
-    
+
+, preConfigure ? "true"
+
 , buildPhase ? "true"
 
 , doCheck ? true
@@ -33,8 +37,11 @@
       runHook postCheck
     ''
 
+, preInstall ? ""
 , postInstall ? ""
 
+, meta ? {}
+
 , ... } @ attrs:
 
 # Keep extra attributes from ATTR, e.g., `patchPhase', etc.
@@ -43,26 +50,56 @@ python.stdenv.mkDerivation (attrs // {
 
   name = namePrefix + name;
 
+  # default to python's platforms and add maintainer(s) to every
+  # package
+  meta = {
+    platforms = python.meta.platforms;
+  } // meta // {
+    maintainers = (meta.maintainers or []) ++ [ lib.maintainers.chaoflow ];
+  };
+
+  # checkPhase after installPhase to run tests on installed packages
+  phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase";
+
   buildInputs = [ python wrapPython setuptools ] ++ buildInputs ++ pythonPath;
 
-  pythonPath = [ setuptools] ++ pythonPath;
+  propagatedBuildInputs = propagatedBuildInputs ++ [ recursivePthLoader ];
+
+  pythonPath = [ setuptools ] ++ pythonPath;
 
-  # XXX: Should we run `easy_install --always-unzip'?  It doesn't seem
-  # to have a noticeable impact on small scripts.
-  installPhase = ''
+  preConfigure = ''
+    PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+    ${preConfigure}
+  '';
+
+  installPhase = preInstall + ''
     mkdir -p "$out/lib/${python.libPrefix}/site-packages"
 
     echo "installing \`${name}' with \`easy_install'..."
     export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
     ${installCommand}
 
+    # A pth file might have been generated to load the package from
+    # within its own site-packages, rename this package not to
+    # collide with others.
+    eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
+    if [ -e "$eapth" ]; then
+        # move colliding easy_install.pth to specifically named one
+        mv "$eapth" $(dirname "$eapth")/${name}.pth
+    fi
+
+    # Remove any site.py files generated by easy_install as these
+    # cause collisions. If pth files are to be processed a
+    # corresponding site.py needs to be included in the PYTHONPATH.
+    rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
+
     ${postInstall}
   '';
 
   postFixup =
     ''
       wrapPythonPrograms
-    
+
       # If a user installs a Python package, she probably also wants its
       # dependencies in the user environment (since Python modules don't
       # have something like an RPATH, so the only way to find the
@@ -70,5 +107,12 @@ python.stdenv.mkDerivation (attrs // {
       if test -e $out/nix-support/propagated-build-inputs; then
           ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
       fi
+
+      createBuildInputsPth build-inputs "$buildInputStrings"
+      for inputsfile in propagated-build-inputs propagated-native-build-inputs; do
+        if test -e $out/nix-support/$inputsfile; then
+            createBuildInputsPth $inputsfile "$(cat $out/nix-support/$inputsfile)"
+        fi
+      done
     '';
 })
diff --git a/pkgs/development/python-modules/generic/wrap.sh b/pkgs/development/python-modules/generic/wrap.sh
index 65f3229ca7c..6b02369927b 100644
--- a/pkgs/development/python-modules/generic/wrap.sh
+++ b/pkgs/development/python-modules/generic/wrap.sh
@@ -37,7 +37,7 @@ _addToPythonPath() {
     pythonPathsSeen[$dir]=1
     addToSearchPath program_PYTHONPATH $dir/lib/@libPrefix@/site-packages
     addToSearchPath program_PATH $dir/bin
-    local prop="$dir/nix-support/propagated-build-native-inputs"
+    local prop="$dir/nix-support/propagated-native-build-inputs"
     if [ -e $prop ]; then
         local i
         for i in $(cat $prop); do
@@ -45,3 +45,19 @@ _addToPythonPath() {
         done
     fi
 }
+
+createBuildInputsPth() {
+    local category="$1"
+    local inputs="$2"
+    if [ foo"$inputs" != foo ]; then
+        for x in $inputs; do
+            if $(echo -n $x |grep -q python-recursive-pth-loader); then
+                continue
+            fi
+            if test -d "$x"/lib/@libPrefix@/site-packages; then
+                echo $x/lib/@libPrefix@/site-packages \
+                    >> "$out"/lib/@libPrefix@/site-packages/${name}-nix-python-$category.pth
+            fi
+        done
+    fi
+}
diff --git a/pkgs/development/python-modules/gyp/no-darwin-cflags.patch b/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
new file mode 100644
index 00000000000..d81ea0d1c12
--- /dev/null
+++ b/pkgs/development/python-modules/gyp/no-darwin-cflags.patch
@@ -0,0 +1,53 @@
+Index: gyp/pylib/gyp/xcode_emulation.py
+===================================================================
+--- gyp/pylib/gyp/xcode_emulation.py	(revision 1635)
++++ gyp/pylib/gyp/xcode_emulation.py	(working copy)
+@@ -280,9 +280,6 @@
+     if self._Test('GCC_CHAR_IS_UNSIGNED_CHAR', 'YES', default='NO'):
+       cflags.append('-funsigned-char')
+ 
+-    if self._Test('GCC_CW_ASM_SYNTAX', 'YES', default='YES'):
+-      cflags.append('-fasm-blocks')
+-
+     if 'GCC_DYNAMIC_NO_PIC' in self._Settings():
+       if self._Settings()['GCC_DYNAMIC_NO_PIC'] == 'YES':
+         cflags.append('-mdynamic-no-pic')
+@@ -292,9 +289,6 @@
+       # mdynamic-no-pic by default for executable and possibly static lib
+       # according to mento
+ 
+-    if self._Test('GCC_ENABLE_PASCAL_STRINGS', 'YES', default='YES'):
+-      cflags.append('-mpascal-strings')
+-
+     self._Appendf(cflags, 'GCC_OPTIMIZATION_LEVEL', '-O%s', default='s')
+ 
+     if self._Test('GCC_GENERATE_DEBUGGING_SYMBOLS', 'YES', default='YES'):
+@@ -311,12 +305,6 @@
+     if self._Test('GCC_SYMBOLS_PRIVATE_EXTERN', 'YES', default='NO'):
+       cflags.append('-fvisibility=hidden')
+ 
+-    if self._Test('GCC_TREAT_WARNINGS_AS_ERRORS', 'YES', default='NO'):
+-      cflags.append('-Werror')
+-
+-    if self._Test('GCC_WARN_ABOUT_MISSING_NEWLINE', 'YES', default='NO'):
+-      cflags.append('-Wnewline-eof')
+-
+     self._AppendPlatformVersionMinFlags(cflags)
+ 
+     # TODO:
+@@ -334,7 +322,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    cflags.append('-arch ' + archs[0])
+ 
+     if archs[0] in ('i386', 'x86_64'):
+       if self._Test('GCC_ENABLE_SSE3_EXTENSIONS', 'YES', default='NO'):
+@@ -570,7 +557,6 @@
+       # TODO: Supporting fat binaries will be annoying.
+       self._WarnUnimplemented('ARCHS')
+       archs = ['i386']
+-    ldflags.append('-arch ' + archs[0])
+ 
+     # Xcode adds the product directory by default.
+     ldflags.append('-L' + product_dir)
diff --git a/pkgs/development/python-modules/gyp/no-xcode.patch b/pkgs/development/python-modules/gyp/no-xcode.patch
new file mode 100644
index 00000000000..951be7b005a
--- /dev/null
+++ b/pkgs/development/python-modules/gyp/no-xcode.patch
@@ -0,0 +1,66 @@
+Index: pylib/gyp/xcode_emulation.py
+diff --git a/pylib/gyp/xcode_emulation.py b/pylib/gyp/xcode_emulation.py
+index b2aab986a427d5285d70558bf97f0a42bfe1556e..20592c73fae660009aac621097cf3c4fb61d6cb6 100644
+--- a/pylib/gyp/xcode_emulation.py
++++ b/pylib/gyp/xcode_emulation.py
+@@ -236,8 +236,14 @@ class XcodeSettings(object):
+     if sdk_root.startswith('/'):
+       return sdk_root
+     if sdk_root not in XcodeSettings._sdk_path_cache:
+-      XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
+-          sdk_root, 'Path')
++      try:
++        XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
++            sdk_root, 'Path')
++      except:
++        # if this fails it's because xcodebuild failed, which means
++        # the user is probably on a CLT-only system, where there
++        # is no valid SDK root
++        XcodeSettings._sdk_path_cache[sdk_root] = None
+     return XcodeSettings._sdk_path_cache[sdk_root]
+ 
+   def _AppendPlatformVersionMinFlags(self, lst):
+@@ -340,10 +346,11 @@ class XcodeSettings(object):
+ 
+     cflags += self._Settings().get('WARNING_CFLAGS', [])
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      cflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
++    if sdk_root:
++      config = self.spec['configurations'][self.configname]
++      framework_dirs = config.get('mac_framework_dirs', [])
++      for directory in framework_dirs:
++        cflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
+ 
+     self.configname = None
+     return cflags
+@@ -573,10 +580,11 @@ class XcodeSettings(object):
+     for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []):
+       ldflags.append('-Wl,-rpath,' + rpath)
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
++    if self._SdkPath():
++      config = self.spec['configurations'][self.configname]
++      framework_dirs = config.get('mac_framework_dirs', [])
++      for directory in framework_dirs:
++        ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
+ 
+     self.configname = None
+     return ldflags
+@@ -701,7 +709,10 @@ class XcodeSettings(object):
+         l = '-l' + m.group(1)
+       else:
+         l = library
+-    return l.replace('$(SDKROOT)', self._SdkPath())
++    if self._SdkPath():
++      return l.replace('$(SDKROOT)', self._SdkPath())
++    else:
++      return l
+ 
+   def AdjustLibraries(self, libraries):
+     """Transforms entries like 'Cocoa.framework' in libraries into entries like
diff --git a/pkgs/development/python-modules/offline-distutils/default.nix b/pkgs/development/python-modules/offline-distutils/default.nix
new file mode 100644
index 00000000000..269f67bf5cd
--- /dev/null
+++ b/pkgs/development/python-modules/offline-distutils/default.nix
@@ -0,0 +1,21 @@
+# Used during module installation to prevent easy_install and python
+# setup.py install/test from downloading
+
+{ stdenv, python }:
+
+stdenv.mkDerivation {
+  name = "python-offline-distutils-${python.version}";
+
+  buildInputs = [ python ];
+
+  unpackPhase = "true";
+  installPhase = ''
+    dst="$out/lib/${python.libPrefix}/site-packages"
+    ensureDir $dst/distutils
+    ln -s ${python}/lib/${python.libPrefix}/distutils/* $dst/distutils/
+    cat <<EOF > $dst/distutils/distutils.cfg
+[easy_install]
+allow-hosts = None
+EOF
+  '';
+}
diff --git a/pkgs/development/python-modules/pil/default.nix b/pkgs/development/python-modules/pil/default.nix
index 4cf4576c0ce..1dfdfee08fb 100644
--- a/pkgs/development/python-modules/pil/default.nix
+++ b/pkgs/development/python-modules/pil/default.nix
@@ -1,9 +1,9 @@
-{ fetchurl, stdenv, python, libjpeg, zlib, freetype }:
+{ fetchurl, stdenv, python, buildPythonPackage, libjpeg, zlib, freetype }:
 
 let version = "1.1.7"; in
 
-stdenv.mkDerivation {
-  name = "python-imaging-${version}";
+buildPythonPackage {
+  name = "imaging-${version}";
   
   src = fetchurl {
     url = "http://effbot.org/downloads/Imaging-${version}.tar.gz";
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
 
   buildPhase   = "python setup.py build_ext -i";
   checkPhase   = "python selftest.py";
-  installPhase = "python setup.py install --prefix=$out";
+  #installPhase = "python setup.py install --prefix=$out";
 
   meta = {
     homepage = http://www.pythonware.com/products/pil/;
diff --git a/pkgs/development/python-modules/pycairo/default.nix b/pkgs/development/python-modules/pycairo/default.nix
index 8aebf1d7829..1e8ceed6878 100644
--- a/pkgs/development/python-modules/pycairo/default.nix
+++ b/pkgs/development/python-modules/pycairo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, python, pkgconfig, cairo, x11}:
+{ stdenv, fetchurl, python, pkgconfig, cairo, x11 }:
 
 stdenv.mkDerivation {
   name = "pycairo-1.8.8";
@@ -7,5 +7,5 @@ stdenv.mkDerivation {
     sha256 = "0q18hd4ai4raljlvd76ylgi30kxpr2qq83ka6gzwh0ya8fcmjlig";
   };
 
-  buildInputs = [python pkgconfig cairo x11];
+  buildInputs = [ python pkgconfig cairo x11 ];
 }
diff --git a/pkgs/development/python-modules/pycrypto/2.5.nix b/pkgs/development/python-modules/pycrypto/2.5.nix
new file mode 100644
index 00000000000..de192c64b72
--- /dev/null
+++ b/pkgs/development/python-modules/pycrypto/2.5.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, python, buildPythonPackage, gmp }:
+
+buildPythonPackage rec {
+  name = "pycrypto-2.5";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/p/pycrypto/${name}.tar.gz";
+    md5 = "783e45d4a1a309e03ab378b00f97b291";
+  };
+
+  buildInputs = [ python gmp ];
+
+  buildPhase =
+    ''
+      python ./setup.py build_ext --library-dirs=${gmp}/lib
+    '';
+
+#  installPhase =
+#    ''
+#      python ./setup.py install --prefix=$out
+#    '';
+
+  meta = {
+    homepage = "http://www.pycrypto.org/";
+    description = "Python Cryptography Toolkit";
+    platforms = stdenv.lib.platforms.gnu;
+  };
+}
diff --git a/pkgs/development/python-modules/pycrypto/default.nix b/pkgs/development/python-modules/pycrypto/default.nix
index 9c756c9ed64..0ad1663da65 100644
--- a/pkgs/development/python-modules/pycrypto/default.nix
+++ b/pkgs/development/python-modules/pycrypto/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchurl, python, gmp }:
+{ stdenv, fetchurl, python, buildPythonPackage, gmp }:
 
-stdenv.mkDerivation rec {
+buildPythonPackage rec {
   name = "pycrypto-2.6";
+  namePrefix = "";
 
   src = fetchurl {
     url = "http://pypi.python.org/packages/source/p/pycrypto/${name}.tar.gz";
@@ -10,14 +11,16 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ python gmp ];
 
-  buildPhase = "true";
-
-  installPhase =
+  buildPhase =
     ''
       python ./setup.py build_ext --library-dirs=${gmp}/lib
-      python ./setup.py install --prefix=$out
     '';
 
+#  installPhase =
+#    ''
+#      python ./setup.py install --prefix=$out
+#    '';
+
   meta = {
     homepage = "http://www.pycrypto.org/";
     description = "Python Cryptography Toolkit";
diff --git a/pkgs/development/python-modules/pygobject/3.nix b/pkgs/development/python-modules/pygobject/3.nix
new file mode 100644
index 00000000000..b5b8f8408aa
--- /dev/null
+++ b/pkgs/development/python-modules/pygobject/3.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, python, pkgconfig, glib, gobjectIntrospection, pycairo, cairo }:
+ 
+stdenv.mkDerivation rec {
+  name = "pygobject-3.0.4";
+   
+  src = fetchurl {
+    url = "http://ftp.gnome.org/pub/GNOME/sources/pygobject/3.0/${name}.tar.xz";
+    sha256 = "f457b1d7f6b8bfa727593c3696d2b405da66b4a8d34cd7d3362ebda1221f0661";
+  };
+
+  configureFlags = "--disable-introspection";
+
+  buildInputs = [ python pkgconfig glib gobjectIntrospection pycairo cairo ];
+
+  meta = {
+    homepage = http://live.gnome.org/PyGObject;
+    description = "Python bindings for Glib";
+  };
+}
diff --git a/pkgs/development/python-modules/pygobject/default.nix b/pkgs/development/python-modules/pygobject/default.nix
index 4ef851f5b3e..8d6a1368d8b 100644
--- a/pkgs/development/python-modules/pygobject/default.nix
+++ b/pkgs/development/python-modules/pygobject/default.nix
@@ -1,27 +1,23 @@
 { stdenv, fetchurl, python, pkgconfig, glib }:
 
 stdenv.mkDerivation rec {
-  name = "pygobject-2.27.0";
+  name = "pygobject-2.28.6";
   
   src = fetchurl {
-    url = "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.27/${name}.tar.bz2";
-    sha256 = "18mq4mj9s9sw12m6gbbc4iffrq993c7q09v9yahlnamrqn3bv53m";
+    url = "http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.28/${name}.tar.xz";
+    sha256 = "1f5dfxjnil2glfwxnqr14d2cjfbkghsbsn8n04js2c2icr7iv2pv";
   };
 
   configureFlags = "--disable-introspection";
 
   buildInputs = [ python pkgconfig glib ];
 
+  # in a "normal" setup, pygobject and pygtk are installed into the
+  # same site-packages: we need a pth file for both. pygtk.py would be
+  # used to select a specific version, in our setup it should have no
+  # effect, but we leave it in case somebody expects and calls it.
   postInstall = ''
-    # All python code is installed into a "gtk-2.0" sub-directory. That
-    # sub-directory may be useful on systems which share several library
-    # versions in the same prefix, i.e. /usr/local, but on Nix that directory
-    # is useless. Furthermore, its existence makes it very hard to guess a
-    # proper $PYTHONPATH that allows "import gtk" to succeed.
-    cd $(toPythonPath $out)/gtk-2.0
-    for n in *; do
-      ln -s "gtk-2.0/$n" "../$n"
-    done
+    mv $out/lib/${python.libPrefix}/site-packages/{pygtk.pth,${name}.pth}
   '';
 
   meta = {
diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix
index 81147fff17d..07d57591f1a 100644
--- a/pkgs/development/python-modules/pygtk/default.nix
+++ b/pkgs/development/python-modules/pygtk/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, makeWrapper, python, pkgconfig, glib, gtk, pygobject, pycairo
-, libglade ? null }:
+{ stdenv, fetchurl, python, pkgconfig, glib, gtk, pygobject, pycairo
+, buildPythonPackage, libglade ? null }:
 
-stdenv.mkDerivation rec {
+buildPythonPackage rec {
   name = "pygtk-2.22.0";
 
   src = fetchurl {
@@ -10,26 +10,35 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ makeWrapper python pkgconfig glib gtk ]
+    [ pkgconfig glib gtk ]
     ++ stdenv.lib.optional (libglade != null) libglade;
 
   propagatedBuildInputs = [ pygobject pycairo ];
 
+  installCommand = "make install";
+  checkPhase = stdenv.lib.optionalString (libglade == null)
+    ''
+      sed -i -e "s/glade = importModule('gtk.glade', buildDir)//" \
+             tests/common.py
+      sed -i -e "s/, glade$//" \
+             -e "s/.*testGlade.*//" \
+             -e "s/.*(glade.*//" \
+             tests/test_api.py
+    '' + ''
+      sed -i -e "s/sys.path.insert(0, os.path.join(buildDir, 'gtk'))//" \
+             -e "s/sys.path.insert(0, buildDir)//" \
+             tests/common.py
+      make check
+    '';
+  # XXX: TypeError: Unsupported type: <class 'gtk._gtk.WindowType'>
+  # The check phase was not executed in the previous
+  # non-buildPythonPackage setup - not sure why not.
+  doCheck = false;
+
   postInstall = ''
     rm $out/bin/pygtk-codegen-2.0
     ln -s ${pygobject}/bin/pygobject-codegen-2.0  $out/bin/pygtk-codegen-2.0
-
-    # All python code is installed into a "gtk-2.0" sub-directory. That
-    # sub-directory may be useful on systems which share several library
-    # versions in the same prefix, i.e. /usr/local, but on Nix that directory
-    # is useless. Furthermore, its existence makes it very hard to guess a
-    # proper $PYTHONPATH that allows "import gtk" to succeed.
-    cd $(toPythonPath $out)/gtk-2.0
-    for n in *; do
-      ln -s "gtk-2.0/$n" "../$n"
-    done
-
-    wrapProgram $out/bin/pygtk-demo --prefix PYTHONPATH ":" \
-        $(toPythonPath "${pygobject} ${pycairo} $out")
+    ln -s ${pygobject}/lib/${python.libPrefix}/site-packages/${pygobject.name}.pth \
+                  $out/lib/${python.libPrefix}/site-packages/${name}.pth
   '';
 }
diff --git a/pkgs/development/python-modules/pyopenssl/default.nix b/pkgs/development/python-modules/pyopenssl/default.nix
index 0e282cf71f3..1d4fe53117c 100644
--- a/pkgs/development/python-modules/pyopenssl/default.nix
+++ b/pkgs/development/python-modules/pyopenssl/default.nix
@@ -2,15 +2,15 @@ a :
 let
   fetchurl = a.fetchurl;
 
-  version = a.lib.attrByPath ["version"] "0.10" a;
+  version = a.lib.attrByPath ["version"] "0.13" a;
   propagatedBuildInputs = with a; [
     openssl python
   ];
 in
 rec {
   src = fetchurl {
-    url = "http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-0.10.tar.gz";
-    sha256 = "4514f8960389042ca2587f9cb801a13f7990387753fc678680b0c084719b5b60";
+    url = "http://pypi.python.org/packages/source/p/pyOpenSSL/pyOpenSSL-${version}.tar.gz";
+    sha256 = "21e12b03abaa0e04ecc8cd9c251598f71bae11c9f385304234e4ea5618c6163b";
   };
 
   inherit propagatedBuildInputs;
diff --git a/pkgs/development/python-modules/pyqt/default.nix b/pkgs/development/python-modules/pyqt/default.nix
index 9b1d74ff616..7d9679349e8 100644
--- a/pkgs/development/python-modules/pyqt/default.nix
+++ b/pkgs/development/python-modules/pyqt/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, python, sip, qt4, pythonDBus, pkgconfig, lndir, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "PyQt-x11-gpl-4.9.1";
+  name = "PyQt-x11-gpl-4.10.1";
   
   src = fetchurl {
     urls = [
       "http://www.riverbankcomputing.co.uk/static/Downloads/PyQt4/${name}.tar.gz"
-      "http://pkgs.fedoraproject.org/lookaside/pkgs/PyQt4/PyQt-x11-gpl-4.9.1.tar.gz/7f495dc49f71e3bfb64bf942e0d8bb3c/PyQt-x11-gpl-4.9.1.tar.gz"
+      "http://pkgs.fedoraproject.org/lookaside/pkgs/PyQt4/PyQt-x11-gpl-4.10.1.tar.gz/e5973c4ec0b0469f329bc00209d2ad9c/PyQt-x11-gpl-4.10.1.tar.gz"
     ];
-    sha256 = "1ccvc80z8a0k0drvba9ngivsnv2k2nn5317yf86w1zwh45zmb0zj";
+    sha256 = "05psk23x6bc83hrkw7h88a14jxhvfbxms0c8yrdar8xqvkv8cdb2";
   };
   
   configurePhase = ''
diff --git a/pkgs/development/python-modules/python-gudev/default.nix b/pkgs/development/python-modules/python-gudev/default.nix
deleted file mode 100644
index c9105555f9d..00000000000
--- a/pkgs/development/python-modules/python-gudev/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{stdenv, fetchgit, python, autoconf, automake, libtool, pygobject, pkgconfig, udev}:
-
-stdenv.mkDerivation {
-  name = "python-gudev-147.2";
-  src = fetchgit {
-    url = git://github.com/nzjrs/python-gudev.git;
-    rev = "refs/tags/147.2";
-    sha256 = "5b9766fcb88855a77ac8bb416ca3b51f55ac7d82b0e189f88c59cacb11586c15";
-  };
-
-  buildInputs = [ python autoconf automake libtool pygobject pkgconfig udev ];
-
-  preConfigure = ''
-    sed -e 's@/usr/bin/file@file@g' -i configure.ac
-    sh autogen.sh
-  '';
-
-  meta = {
-    homepage = http://www.freedesktop.org/software/systemd/gudev/;
-    description = "Python binding to the GUDev udev helper library.";
-    license = "GPLv3+";
-    maintainers = with stdenv.lib.maintainers; [qknight];
-    platforms = with stdenv.lib.platforms; all;
-  };
-}
diff --git a/pkgs/development/python-modules/python-sip/default.nix b/pkgs/development/python-modules/python-sip/default.nix
index 34daf294358..fa958971cf3 100644
--- a/pkgs/development/python-modules/python-sip/default.nix
+++ b/pkgs/development/python-modules/python-sip/default.nix
@@ -1,11 +1,14 @@
 { stdenv, fetchurl, python }:
 
 stdenv.mkDerivation rec {
-  name = "sip-4.13.2";
+  name = "sip-4.14.6";
   
   src = fetchurl {
-    url = "http://www.riverbankcomputing.co.uk/static/Downloads/sip4/${name}.tar.gz";
-    sha256 = "1gzff61bi22g6fkdg9iya4q2qfdkwxs19v4rhhf8x4bm7hszbhsb";
+    urls = [
+      "http://www.riverbankcomputing.co.uk/static/Downloads/sip4/${name}.tar.gz"
+      "http://pkgs.fedoraproject.org/repo/pkgs/sip/${name}.tar.gz/d6493b9f0a7911566545f694327314c4/${name}.tar.gz"
+    ];
+    sha256 = "1bwdd5xhrx8dx8rr86r043ddlbg7gd1vh0pm2nxw5l1yprwa7paa";
   };
   
   configurePhase = "python ./configure.py -d $out/lib/${python.libPrefix}/site-packages -b $out/bin -e $out/include";
diff --git a/pkgs/development/python-modules/recursive-pth-loader/default.nix b/pkgs/development/python-modules/recursive-pth-loader/default.nix
new file mode 100644
index 00000000000..959882be938
--- /dev/null
+++ b/pkgs/development/python-modules/recursive-pth-loader/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, python }:
+
+stdenv.mkDerivation rec {
+  name = "python-recursive-pth-loader-1.0";
+
+  unpackPhase = "true";
+
+  buildInputs = [ python ];
+
+  installPhase =
+    ''
+      dst=$out/lib/${python.libPrefix}/site-packages
+      mkdir -p $dst
+      cat ${./sitecustomize.py} >> $dst/sitecustomize.py
+    '';
+
+  meta = {
+      description = "Enable recursive processing of pth files anywhere in sys.path";
+  };
+}
diff --git a/pkgs/development/python-modules/recursive-pth-loader/sitecustomize.py b/pkgs/development/python-modules/recursive-pth-loader/sitecustomize.py
new file mode 100644
index 00000000000..057e779803c
--- /dev/null
+++ b/pkgs/development/python-modules/recursive-pth-loader/sitecustomize.py
@@ -0,0 +1,46 @@
+"""Recursively load pth files in site-packages of sys.path
+
+- iterate over sys.path
+- check for pth in dirs that end in site-packages
+- ignore import statements in pth files
+- add dirs listed in pth files right after current sys.path element,
+  they will be processed in next iteration
+"""
+
+import os
+import site
+import sys
+
+
+for path_idx, sitedir in enumerate(sys.path):
+    # ignore non-site-packages
+    if not sitedir.endswith('site-packages'):
+        continue
+
+    # find pth files
+    try:
+        names = os.listdir(sitedir)
+    except os.error:
+        continue
+    dotpth = os.extsep + "pth"
+    pths = [name for name in names if name.endswith(dotpth)]
+
+    for pth in pths:
+        fullname = os.path.join(sitedir, pth)
+        try:
+            f = open(fullname, "rU")
+        except IOError:
+            continue
+
+        with f:
+            for n, line in enumerate(f):
+                if line.startswith("#"):
+                    continue
+
+                if line.startswith(("import ", "import\t")):
+                    continue
+
+                line = line.rstrip()
+                dir, dircase = site.makepath(sitedir, line)
+                if not dircase in sys.path:
+                    sys.path.insert(path_idx+1, dir)
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index 50b73aaf8f6..92c39afc249 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -1,10 +1,13 @@
 { stdenv, fetchurl, python, wrapPython }:
 
 stdenv.mkDerivation rec {
-  name = "setuptools-0.6c11";
+  shortName = "setuptools-${version}";
+  name = "python-${shortName}";
+
+  version = "0.6c11";
 
   src = fetchurl {
-    url = "http://pypi.python.org/packages/source/s/setuptools/${name}.tar.gz";
+    url = "http://pypi.python.org/packages/source/s/setuptools/${shortName}.tar.gz";
     sha256 = "1lx1hwxkhipyh206bgl90ddnfcnb68bzcvyawczbf833fadyl3v3";
   };
 
diff --git a/pkgs/development/python-modules/setuptools/site.nix b/pkgs/development/python-modules/setuptools/site.nix
new file mode 100644
index 00000000000..34e7b478595
--- /dev/null
+++ b/pkgs/development/python-modules/setuptools/site.nix
@@ -0,0 +1,16 @@
+# Propagated by buildPythonPackge to process pth files
+
+{ stdenv, python, setuptools }:
+
+stdenv.mkDerivation {
+  name = "python-setuptools-site-${setuptools.version}";
+
+  buildInputs = [ python setuptools ];
+
+  unpackPhase = "true";
+  installPhase = ''
+    dst="$out/lib/${python.libPrefix}/site-packages"
+    ensureDir $dst
+    ln -s ${setuptools}/lib/${python.libPrefix}/site-packages/site.* $dst/
+  '';
+}
diff --git a/pkgs/development/python-modules/virtualenv-change-prefix.patch b/pkgs/development/python-modules/virtualenv-change-prefix.patch
index 5093fdbead9..d3e588bd1cd 100644
--- a/pkgs/development/python-modules/virtualenv-change-prefix.patch
+++ b/pkgs/development/python-modules/virtualenv-change-prefix.patch
@@ -1,29 +1,32 @@
 Without this patch `virtualenv --python=python2.7 .` fails with an error because it notices that the python readline.so is not in the same path as python2.7. I assume this is to avoid copying the wrong file on systems where it is possible to find incompatible libraries by accident. Adding "/nix/store" to the prefix fixes this problem. Unfortunately readline is still not available if you just run `virtualenv .`.
 
-
---- virtualenv-1.6.4/virtualenv.py	2012-05-20 00:40:38.070649647 +0200
-+++ virtualenv-1.6.4/virtualenv.py	2012-05-20 00:45:10.596242604 +0200
-@@ -951,13 +951,7 @@
+--- virtualenv-1.8.4/virtualenv.py        2013-01-16 23:43:37.583615220 +0100
++++ virtualenv-1.8.4/virtualenv.py        2013-01-16 23:44:47.885973431 +0100
+@@ -1135,17 +1135,7 @@
  
  
  def change_prefix(filename, dst_prefix):
 -    prefixes = [sys.prefix]
 -
--    if sys.platform == "darwin":
+-    if is_darwin:
 -        prefixes.extend((
 -            os.path.join("/Library/Python", sys.version[:3], "site-packages"),
 -            os.path.join(sys.prefix, "Extras", "lib", "python"),
--            os.path.join("~", "Library", "Python", sys.version[:3], "site-packages")))
+-            os.path.join("~", "Library", "Python", sys.version[:3], "site-packages"),
+-            # Python 2.6 no-frameworks
+-            os.path.join("~", ".local", "lib","python", sys.version[:3], "site-packages"),
+-            # System Python 2.7 on OSX Mountain Lion
+-            os.path.join("~", "Library", "Python", sys.version[:3], "lib", "python", "site-packages")))
 +    prefixes = ["/nix/store", sys.prefix]
  
      if hasattr(sys, 'real_prefix'):
          prefixes.append(sys.real_prefix)
-@@ -968,6 +962,8 @@
-             _, relpath = filename.split(src_prefix, 1)
-             assert relpath[0] == os.sep
-             relpath = relpath[1:]
-+            if src_prefix == "/nix/store":
-+                relpath = "/".join(relpath.split("/")[1:])
+@@ -1162,6 +1152,8 @@
+             if src_prefix != os.sep: # sys.prefix == "/"
+                 assert relpath[0] == os.sep
+                 relpath = relpath[1:]
++                if src_prefix == "/nix/store":
++                    relpath = "/".join(relpath.split("/")[1:])
              return join(dst_prefix, relpath)
      assert False, "Filename %s does not start with any of these prefixes: %s" % \
          (filename, prefixes)
diff --git a/pkgs/development/python-modules/zope/default.nix b/pkgs/development/python-modules/zope/default.nix
deleted file mode 100644
index c01945bf472..00000000000
--- a/pkgs/development/python-modules/zope/default.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{stdenv, fetchurl, python}:
-
-stdenv.mkDerivation rec {
-  version = "3.4.0";
-  name = "zope-${version}";
-  src = fetchurl {
-    url = "http://www.zope.org/Products/Zope3/${version}/Zope-${version}.tgz";
-    sha256 = "3e834e8749945d8fc0a67bb724f2cf0c671f04f477e24fb8edb74828e331901d";
-  };
-  patches = [
-    ./zope_python-2.4.4.patch
-    ./zope_python-readline.patch
-  ];
-  buildInputs = [python];
-}
diff --git a/pkgs/development/python-modules/zope/zope_python-2.4.4.patch b/pkgs/development/python-modules/zope/zope_python-2.4.4.patch
deleted file mode 100644
index 22360412964..00000000000
--- a/pkgs/development/python-modules/zope/zope_python-2.4.4.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -r 8833d4892dfc Zope-3.2.1/configure
---- a/configure	Mon Aug 18 14:55:39 2008 +0200
-+++ b/configure	Mon Aug 18 14:57:39 2008 +0200
-@@ -21,7 +21,7 @@ prefix="$DEFAULT_PREFIX"
- 
- # Place the optimal target version number (as returned by sys.version)
- # below
--TARGET="2.4.2"
-+TARGET="2.4.4"
- 
- # Order a list of "acceptable" python version numbers (as returned by
- # sys.version) below in "best" to "worst" order, not including the
diff --git a/pkgs/development/python-modules/zope/zope_python-readline.patch b/pkgs/development/python-modules/zope/zope_python-readline.patch
deleted file mode 100644
index 4775cfba49b..00000000000
--- a/pkgs/development/python-modules/zope/zope_python-readline.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -r 8833d4892dfc Zope-3.2.1/Dependencies/zope.publisher-Zope-3.2.1/zope.publisher/http.py
---- a/Dependencies/zope.publisher-Zope-3.2.1/zope.publisher/http.py	Mon Aug 18 14:55:39 2008 +0200
-+++ b/Dependencies/zope.publisher-Zope-3.2.1/zope.publisher/http.py	Mon Aug 18 16:37:02 2008 +0200
-@@ -198,7 +198,7 @@ class HTTPInputStream(object):
-         self.cacheStream.write(data)
-         return data
- 
--    def readline(self):
-+    def readline(self, size=None):
-         data = self.stream.readline()
-         self.cacheStream.write(data)
-         return data
diff --git a/pkgs/development/qtcreator/default.nix b/pkgs/development/qtcreator/default.nix
new file mode 100644
index 00000000000..add0c08e95a
--- /dev/null
+++ b/pkgs/development/qtcreator/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, qt48 }:
+
+let
+  baseVersion = "2.7";
+  revision = "1";
+  version = "${baseVersion}.${revision}";
+  qt4_for_qtcreator = qt48.override {
+    developerBuild = true;
+  };
+in
+
+stdenv.mkDerivation rec {
+  name = "qtcreator-${version}";
+
+  src = fetchurl {
+    url = "http://download.qt-project.org/official_releases/qtcreator/${baseVersion}/${version}/qt-creator-${version}-src.tar.gz";
+    sha256 = "04vn7y3dkk9vi1rsmsxby57mvc2h9n5q842hayq2mdlsax4qnhjv";
+  };
+
+  buildInputs = [ qt4_for_qtcreator ];
+
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    qmake -spec linux-g++ "QT_PRIVATE_HEADERS=${qt4_for_qtcreator}/include" qtcreator.pro
+  '';
+
+  installFlags = "INSTALL_ROOT=$(out)";
+
+  meta = {
+    description = "Qt Creator is a cross-platform IDE tailored to the needs of Qt developers.";
+    longDescription = ''
+        Qt Creator is a cross-platform IDE (integrated development environment) tailored to the needs of Qt developers.
+        It includes features such as an advanced code editor, a visual debugger and a GUI designer.
+      '';
+    homepage = "http://qt-project.org/wiki/Category:Tools::QtCreator";
+    license = "LGPL";
+
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/tools/analysis/radare/lua.patch b/pkgs/development/tools/analysis/radare/lua.patch
deleted file mode 100644
index 3a2ca0d505d..00000000000
--- a/pkgs/development/tools/analysis/radare/lua.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/plug/hack/Makefile b/src/plug/hack/Makefile
-index b05d8dd..d6c73f9 100644
---- a/src/plug/hack/Makefile
-+++ b/src/plug/hack/Makefile
-@@ -7,7 +7,6 @@ PERL_LIBS=`perl -MExtUtils::Embed -e ldopts` -lncurses
- PY_CFLAGS=-I${PREFIX}/include/python2.5/ -I/usr/include/python2.5/
- PY_LIBS=-lpython2.5
- LUA_CFLAGS=-I${PREFIX}/include/lua5.1/ -I/usr/include/lua5.1/
--LUA_LIBS=
- RUBY_CFLAGS=-I/usr/lib/ruby/1.8/i386-linux
- RUBY_LIBS=-lruby18
- SO=${SHARED_EXT}
diff --git a/pkgs/development/tools/analysis/smatch/default.nix b/pkgs/development/tools/analysis/smatch/default.nix
new file mode 100644
index 00000000000..3bf45900034
--- /dev/null
+++ b/pkgs/development/tools/analysis/smatch/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchgit, sqlite, pkgconfig, perl
+, buildllvmsparse ? true
+, buildc2xml ? true
+, llvm ? null, libxml2 ? null
+}:
+
+assert buildllvmsparse -> llvm != null;
+assert buildc2xml -> libxml2 != null;
+
+stdenv.mkDerivation {
+  name = "smatch-20120924";
+
+  src = fetchgit {
+    url = git://repo.or.cz/smatch.git;
+    rev = "23656e3e578b700cbf96d043f039e6341a3ba5b9";
+    sha256 = "09a44967d4cff026c67062f778e251d0b432af132e9d59a47b7d3167f379adfa";
+  };
+
+  buildInputs = [sqlite pkgconfig perl]
+   ++ stdenv.lib.optional buildllvmsparse llvm
+   ++ stdenv.lib.optional buildc2xml libxml2;
+
+  preBuild =
+    '' sed -i Makefile \
+           -e "s|^PREFIX=.*|PREFIX = $out|g"
+    '';
+
+  meta = {
+    description = "A semantic analysis tool for C";
+    homepage = "http://smatch.sourceforge.net/";
+    license = "free"; /* OSL, see http://www.opensource.org */
+  };
+}
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index a625de6ffdc..e4f04623ebb 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl, perl, gdb }:
 
 stdenv.mkDerivation (rec {
-  name = "valgrind-3.7.0";
+  name = "valgrind-3.8.1";
 
   src = fetchurl {
     url = "http://valgrind.org/downloads/${name}.tar.bz2";
-    sha256 = "1xnb4jiimscwriw3jd1lkk0m9x4glqpijj9jb4ngx08l1wrw0qjx";
+    sha256 = "1nsqk70ry3221sd62s4f0njcrncppszs4xxjcak13lxyfq2y0fs7";
   };
 
+  patches = [ ./glibc-2.17.patch ];
+
   # Perl is needed for `cg_annotate'.
   # GDB is needed to provide a sane default for `--db-command'.
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   buildInputs = stdenv.lib.optional (!stdenv.isDarwin) gdb;
 
   configureFlags =
diff --git a/pkgs/development/tools/analysis/valgrind/glibc-2.17.patch b/pkgs/development/tools/analysis/valgrind/glibc-2.17.patch
new file mode 100644
index 00000000000..bee1abe71f1
--- /dev/null
+++ b/pkgs/development/tools/analysis/valgrind/glibc-2.17.patch
@@ -0,0 +1,78 @@
+commit 3781ac11ff374b3517011c1710ec517d52f25cd2
+Author: tom <tom@a5019735-40e9-0310-863c-91ae7b9d1cf9>
+Date:   Mon Jan 14 09:48:49 2013 +0000
+
+    Accept glibc 2.17 as valid.
+    
+    
+    git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13228 a5019735-40e9-0310-863c-91ae7b9d1cf9
+
+diff --git a/configure.in b/configure.in
+index e0fb12d..0f3b3df 100644
+--- a/configure.in
++++ b/configure.in
+@@ -906,6 +906,13 @@ case "${GLIBC_VERSION}" in
+ 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ 	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
++     2.17)
++	AC_MSG_RESULT(2.17 family)
++	AC_DEFINE([GLIBC_2_17], 1, [Define to 1 if you're using glibc 2.17.x])
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
+      darwin)
+ 	AC_MSG_RESULT(Darwin)
+ 	AC_DEFINE([DARWIN_LIBC], 1, [Define to 1 if you're using Darwin])
+@@ -919,7 +926,7 @@ case "${GLIBC_VERSION}" in
+ 
+      *)
+ 	AC_MSG_RESULT([unsupported version ${GLIBC_VERSION}])
+-	AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.16])
++	AC_MSG_ERROR([Valgrind requires glibc version 2.2 - 2.17])
+ 	AC_MSG_ERROR([or Darwin libc])
+ 	;;
+ esac
+diff -ur valgrind-3.8.1/config.h.in valgrind-3.8.1/config.h.in
+--- valgrind-3.8.1/config.h.in	2013-01-16 17:15:33.531018561 +0100
++++ valgrind-3.8.1/config.h.in	2013-01-16 17:19:21.000000000 +0100
+@@ -48,6 +48,9 @@
+ /* Define to 1 if you're using glibc 2.16.x */
+ #undef GLIBC_2_16
+ 
++/* Define to 1 if you're using glibc 2.17.x */
++#undef GLIBC_2_17
++
+ /* Define to 1 if you're using glibc 2.2.x */
+ #undef GLIBC_2_2
+ 
+diff -ur valgrind-3.8.1/configure valgrind-3.8.1/configure
+--- valgrind-3.8.1/configure	2013-01-16 17:15:33.563018480 +0100
++++ valgrind-3.8.1/configure	2013-01-16 17:19:21.373643238 +0100
+@@ -6610,6 +6610,16 @@
+ 	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
+ 	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
+ 	;;
++     2.17)
++	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 2.17 family" >&5
++$as_echo "2.17 family" >&6; }
++
++$as_echo "#define GLIBC_2_17 1" >>confdefs.h
++
++	DEFAULT_SUPP="glibc-2.X.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="glibc-2.34567-NPTL-helgrind.supp ${DEFAULT_SUPP}"
++	DEFAULT_SUPP="glibc-2.X-drd.supp ${DEFAULT_SUPP}"
++	;;
+      darwin)
+ 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
+ $as_echo "Darwin" >&6; }
+@@ -6630,7 +6640,7 @@
+      *)
+ 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported version ${GLIBC_VERSION}" >&5
+ $as_echo "unsupported version ${GLIBC_VERSION}" >&6; }
+-	as_fn_error "Valgrind requires glibc version 2.2 - 2.16" "$LINENO" 5
++	as_fn_error "Valgrind requires glibc version 2.2 - 2.17" "$LINENO" 5
+ 	as_fn_error "or Darwin libc" "$LINENO" 5
+ 	;;
+ esac
diff --git a/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix b/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix
deleted file mode 100644
index 668a6c4d6b5..00000000000
--- a/pkgs/development/tools/build-managers/apache-ant/core-apache-ant.nix
+++ /dev/null
@@ -1,12 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation {
-  name = "core-apache-ant-1.6.5";
-  realname = "apache-ant-1.6.5";
-
-  builder = ./core-builder.sh;
-  src = fetchurl {
-    url = http://apache.surfnet.nl/ant/binaries/apache-ant-1.6.5-bin.tar.bz2;
-    md5 = "26031ee1a2fd248ad0cc2e7f17c44c39";
-  };
-}
diff --git a/pkgs/development/tools/build-managers/apache-ant/core-builder.sh b/pkgs/development/tools/build-managers/apache-ant/core-builder.sh
deleted file mode 100644
index fad5e047f94..00000000000
--- a/pkgs/development/tools/build-managers/apache-ant/core-builder.sh
+++ /dev/null
@@ -1,51 +0,0 @@
-source $stdenv/setup || exit 1
-
-# unpack the binary distribution
-tar jxf $src || exit 1
-mkdir -p $out
-mv apache-ant-*/* $out || exit 1
-
-# remove crap in the root directory
-
-for file in $out/*
-do
-  if test -f $file ; then
-    rm $file
-  fi
-done
-rm -rf $out/docs
-
-# prevent the use of hacky scripts. This will be handled in Nix.
-rm $out/bin/* || exit 1
-
-# add core-ant script. This script is to be invoked with all
-# appropiate variables and will try to be clever or user-friendlt=y.
-
-cat >> $out/bin/core-ant <<EOF
-#! /bin/sh
-
-
-# Variables:
-#   JAVA_HOME
-#   JAVACMD
-#   ANT_OPTS, NIX_ANT_OPTS
-#   ANT_ARGS
-
-ANT_HOME=$out
- 
-if [ -z "\$LOCALCLASSPATH" ] ; then
-    LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar
-else
-    LOCALCLASSPATH=\$ANT_HOME/lib/ant-launcher.jar:\$LOCALCLASSPATH
-fi
-
-if [ -n "\$JIKESPATH" ]; then
-  exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" -Djikes.class.path="\$JIKESPATH" org.apache.tools.ant.launch.Launcher \$ANT_ARGS -lib "$CLASSPATH" "\$@"
-else
-  exec "\$JAVACMD" \$NIX_ANT_OPTS \$ANT_OPTS -classpath "\$LOCALCLASSPATH" -Dant.home="\${ANT_HOME}" org.apache.tools.ant.launch.Launcher \$ANT_ARGS -lib "$CLASSPATH" "\$@"
-  fi
-fi
-EOF
-
-chmod a+x $out/bin/core-ant
-
diff --git a/pkgs/development/tools/build-managers/buildbot-slave/default.nix b/pkgs/development/tools/build-managers/buildbot-slave/default.nix
new file mode 100644
index 00000000000..b28c4d9296f
--- /dev/null
+++ b/pkgs/development/tools/build-managers/buildbot-slave/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, buildPythonPackage, fetchurl, coreutils, twisted }:
+
+buildPythonPackage (rec {
+  name = "buildbot-slave-0.8.7p1";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://buildbot.googlecode.com/files/${name}.tar.gz";
+    sha256 = "1p7a0srab6ifljh9vi25awvxfrxljj9s0hi1jipiiykyhjihgnxv";
+  };
+
+  patchPhase = ''
+    substituteInPlace buildslave/scripts/logwatcher.py --replace /usr/bin/tail ${coreutils}/bin/tail
+  '';
+
+  propagatedBuildInputs = [ twisted ];
+
+  # What's up with this?! 'trial' should be 'test', no?
+  #
+  # running tests
+  # usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
+  #    or: setup.py --help [cmd1 cmd2 ...]
+  #    or: setup.py --help-commands
+  #    or: setup.py cmd --help
+  #
+  # error: invalid command 'trial'
+  doCheck = false;
+
+  postInstall = ''
+    mkdir -p "$out/share/man/man1"
+    cp docs/buildslave.1 "$out/share/man/man1"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://buildbot.net/;
+
+    license = "GPLv2+";
+
+    description = "Continuous integration system that automates the build/test cycle";
+
+    longDescription =
+      '' The BuildBot is a system to automate the compile/test cycle
+         required by most software projects to validate code changes.  By
+         automatically rebuilding and testing the tree each time something
+         has changed, build problems are pinpointed quickly, before other
+         developers are inconvenienced by the failure.  The guilty
+         developer can be identified and harassed without human
+         intervention.  By running the builds on a variety of platforms,
+         developers who do not have the facilities to test their changes
+         everywhere before checkin will at least know shortly afterwards
+         whether they have broken the build or not.  Warning counts, lint
+         checks, image size, compile time, and other build parameters can
+         be tracked over time, are more visible, and are therefore easier
+         to improve.
+
+         The overall goal is to reduce tree breakage and provide a platform
+         to run tests or code-quality checks that are too annoying or
+         pedantic for any human to waste their time with.  Developers get
+         immediate (and potentially public) feedback about their changes,
+         encouraging them to be more careful about testing before checking
+         in code.
+      '';
+    maintainers = with maintainers; [ bjornfor ];
+    platforms = platforms.all;
+  };
+})
diff --git a/pkgs/development/tools/build-managers/buildbot/default.nix b/pkgs/development/tools/build-managers/buildbot/default.nix
index 71862ec1cf7..8058c8dbd96 100644
--- a/pkgs/development/tools/build-managers/buildbot/default.nix
+++ b/pkgs/development/tools/build-managers/buildbot/default.nix
@@ -1,12 +1,20 @@
-{ fetchurl, stdenv, buildPythonPackage, twisted, texinfo }:
+{ stdenv, buildPythonPackage, fetchurl, twisted, dateutil, jinja2
+, sqlalchemy , sqlalchemy_migrate
+, enableDebugClient ? false, pygobject ? null, pyGtkGlade ? null
+}:
+
+# enableDebugClient enables "buildbot debugclient", a Gtk-based debug control
+# panel. Its mostly for developers.
+
+assert enableDebugClient -> pygobject != null && pyGtkGlade != null;
 
 buildPythonPackage (rec {
-  name = "buildbot-0.7.11p3";
+  name = "buildbot-0.8.7p1";
   namePrefix = "";
 
   src = fetchurl {
-    url = "mirror://sourceforge/buildbot/${name}.tar.gz";
-    sha256 = "0h77ijf5iqvc8bnfxpsh3hvpr7wj23pkcywd3hcyphv1wwlhmhjv";
+    url = "http://buildbot.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0xjpk8510fhryl1g4mczz319h62il8hw9rh1rzvsfmffgf43zvld";
   };
 
   patchPhase =
@@ -19,25 +27,35 @@ buildPythonPackage (rec {
        done
     '';
 
-  buildInputs = [ texinfo ];
-  propagatedBuildInputs = [ twisted ];
+  buildInputs = [ ];
 
-  # FIXME: Some tests fail.
+  propagatedBuildInputs =
+    [ twisted dateutil jinja2 sqlalchemy sqlalchemy_migrate
+    ] ++ stdenv.lib.optional enableDebugClient [ pygobject pyGtkGlade ];
+
+  # What's up with this?! 'trial' should be 'test', no?
+  #
+  # running tests
+  # usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
+  #    or: setup.py --help [cmd1 cmd2 ...]
+  #    or: setup.py --help-commands
+  #    or: setup.py cmd --help
+  #
+  # error: invalid command 'trial'
   doCheck = false;
 
-  postInstall =
-    '' mkdir -p "$out/share/info"
-       make -C docs buildbot.info
-       cp -v "docs/buildbot.info"* "$out/share/info"
-    '';
+  postInstall = ''
+    mkdir -p "$out/share/man/man1"
+    cp docs/buildbot.1 "$out/share/man/man1"
+  '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://buildbot.net/;
 
     license = "GPLv2+";
 
     # Of course, we don't really need that on NixOS.  :-)
-    description = "BuildBot, a system to automate the software compile/test cycle";
+    description = "Continuous integration system that automates the build/test cycle";
 
     longDescription =
       '' The BuildBot is a system to automate the compile/test cycle
@@ -62,7 +80,7 @@ buildPythonPackage (rec {
          in code.
       '';
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.all;
+    maintainers = with maintainers; [ ludo bjornfor ];
+    platforms = platforms.all;
   };
 })
diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix
index cab217fef97..d66149a9509 100644
--- a/pkgs/development/tools/build-managers/cmake/default.nix
+++ b/pkgs/development/tools/build-managers/cmake/default.nix
@@ -7,7 +7,7 @@ with stdenv.lib;
 let
   os = stdenv.lib.optionalString;
   majorVersion = "2.8";
-  minorVersion = "7";
+  minorVersion = "9";
   version = "${majorVersion}.${minorVersion}";
 in
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "${meta.homepage}files/v${majorVersion}/cmake-${version}.tar.gz";
-    sha256 = "17zmxh0gyis6w05d2km0swlvy94h3w10jgra0fpa5qcg7l2j628k";
+    sha256 = "1yg68ng732cfm5c0h91chqwhg06zdh45bybm353kd1myk5rwqgfw";
   };
 
   patches =
diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
index 32e0b76f608..175e538e519 100755
--- a/pkgs/development/tools/build-managers/cmake/setup-hook.sh
+++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh
@@ -42,12 +42,12 @@ cmakeConfigurePhase() {
 
     echo "cmake flags: $cmakeFlags ${cmakeFlagsArray[@]}"
 
-    cmake ${cmakeDir:-.} $cmakeFlags ${cmakeFlagsArray[@]}
+    cmake ${cmakeDir:-.} $cmakeFlags "${cmakeFlagsArray[@]}"
 
     eval "$postConfigure"
 }
 
-if [ -z "$dontUseCmakeConfigure" ]; then
+if [ -z "$dontUseCmakeConfigure" -a ! -v configurePhase ]; then
     configurePhase=cmakeConfigurePhase
 fi
 
diff --git a/pkgs/development/tools/build-managers/gnumake/3.81.nix b/pkgs/development/tools/build-managers/gnumake/3.81.nix
index d28198821e3..56d2326c916 100644
--- a/pkgs/development/tools/build-managers/gnumake/3.81.nix
+++ b/pkgs/development/tools/build-managers/gnumake/3.81.nix
@@ -23,6 +23,7 @@ stdenv.mkDerivation {
       # /usr/include and friends.
       ./impure-dirs.patch
     ];
+  patchFlags = "-p0";
 
   meta = {
     description = "GNU Make, a program controlling the generation of non-source files from sources";
diff --git a/pkgs/development/tools/build-managers/gnumake/MAKEFLAGS-reexec.patch b/pkgs/development/tools/build-managers/gnumake/MAKEFLAGS-reexec.patch
new file mode 100644
index 00000000000..a2f59657d4c
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/MAKEFLAGS-reexec.patch
@@ -0,0 +1,14 @@
+http://bugs.gentoo.org/331975
+https://savannah.gnu.org/bugs/?30723
+
+--- main.c	2010/07/19 07:10:53	1.243
++++ main.c	2010/08/10 07:35:34	1.244
+@@ -2093,7 +2093,7 @@
+             const char *pv = define_makeflags (1, 1);
+             char *p = alloca (sizeof ("MAKEFLAGS=") + strlen (pv) + 1);
+             sprintf (p, "MAKEFLAGS=%s", pv);
+-            putenv (p);
++            putenv (allocated_variable_expand (p));
+           }
+ 
+ 	  if (ISDB (DB_BASIC))
diff --git a/pkgs/development/tools/build-managers/gnumake/archives-many-objs.patch b/pkgs/development/tools/build-managers/gnumake/archives-many-objs.patch
new file mode 100644
index 00000000000..73c0381ced4
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/archives-many-objs.patch
@@ -0,0 +1,48 @@
+diff -u -p -r1.193 -r1.194
+--- read.c	13 Jul 2010 01:20:42 -0000	1.193
++++ read.c	14 Aug 2010 02:50:14 -0000	1.194
+@@ -3028,7 +3028,7 @@ parse_file_seq (char **stringp, unsigned
+             {
+               /* This looks like the first element in an open archive group.
+                  A valid group MUST have ')' as the last character.  */
+-              const char *e = p + nlen;
++              const char *e = p;
+               do
+                 {
+                   e = next_token (e);
+@@ -3084,19 +3084,19 @@ parse_file_seq (char **stringp, unsigned
+          Go to the next item in the string.  */
+       if (flags & PARSEFS_NOGLOB)
+         {
+-          NEWELT (concat (2, prefix, tp));
++          NEWELT (concat (2, prefix, tmpbuf));
+           continue;
+         }
+ 
+       /* If we get here we know we're doing glob expansion.
+          TP is a string in tmpbuf.  NLEN is no longer used.
+          We may need to do more work: after this NAME will be set.  */
+-      name = tp;
++      name = tmpbuf;
+ 
+       /* Expand tilde if applicable.  */
+-      if (tp[0] == '~')
++      if (tmpbuf[0] == '~')
+ 	{
+-	  tildep = tilde_expand (tp);
++	  tildep = tilde_expand (tmpbuf);
+ 	  if (tildep != 0)
+             name = tildep;
+ 	}
+@@ -3152,7 +3152,10 @@ parse_file_seq (char **stringp, unsigned
+             else
+               {
+                 /* We got a chain of items.  Attach them.  */
+-                (*newp)->next = found;
++                if (*newp)
++                  (*newp)->next = found;
++                else
++                  *newp = found;
+ 
+                 /* Find and set the new end.  Massage names if necessary.  */
+                 while (1)
diff --git a/pkgs/development/tools/build-managers/gnumake/construct-command-line.patch b/pkgs/development/tools/build-managers/gnumake/construct-command-line.patch
new file mode 100644
index 00000000000..aa4a1afe3fd
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/construct-command-line.patch
@@ -0,0 +1,71 @@
+https://savannah.gnu.org/bugs/?23922
+
+From 6f3684710a0f832533191f8657a57bc2fbba90ba Mon Sep 17 00:00:00 2001
+From: eliz <eliz>
+Date: Sat, 7 May 2011 08:29:13 +0000
+Subject: [PATCH]  job.c (construct_command_argv_internal): Don't assume
+ shellflags  is always non-NULL.  Escape-protect characters
+ special to the  shell when copying the value of SHELL into
+ new_line.  Fixes  Savannah bug #23922.
+
+---
+ ChangeLog |  7 +++++++
+ job.c     | 23 ++++++++++++++++-------
+ 2 files changed, 23 insertions(+), 7 deletions(-)
+
+diff --git job.c job.c
+index 67b402d..c2ce84d 100644
+--- job.c
++++ job.c
+@@ -2844,12 +2844,12 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ 
+     unsigned int shell_len = strlen (shell);
+     unsigned int line_len = strlen (line);
+-    unsigned int sflags_len = strlen (shellflags);
++    unsigned int sflags_len = shellflags ? strlen (shellflags) : 0;
+     char *command_ptr = NULL; /* used for batch_mode_shell mode */
+     char *new_line;
+ 
+ # ifdef __EMX__ /* is this necessary? */
+-    if (!unixy_shell)
++    if (!unixy_shell && shellflags)
+       shellflags[0] = '/'; /* "/c" */
+ # endif
+ 
+@@ -2911,19 +2911,28 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ 
+ 	new_argv = xmalloc (4 * sizeof (char *));
+ 	new_argv[0] = xstrdup(shell);
+-	new_argv[1] = xstrdup(shellflags);
++	new_argv[1] = xstrdup(shellflags ? shellflags : "");
+ 	new_argv[2] = line;
+ 	new_argv[3] = NULL;
+ 	return new_argv;
+       }
+ 
+-    new_line = alloca (shell_len + 1 + sflags_len + 1
++    new_line = alloca ((shell_len*2) + 1 + sflags_len + 1
+                              + (line_len*2) + 1);
+     ap = new_line;
+-    memcpy (ap, shell, shell_len);
+-    ap += shell_len;
++    /* Copy SHELL, escaping any characters special to the shell.  If
++       we don't escape them, construct_command_argv_internal will
++       recursively call itself ad nauseam, or until stack overflow,
++       whichever happens first.  */
++    for (p = shell; *p != '\0'; ++p)
++      {
++	if (strchr (sh_chars, *p) != 0)
++	  *(ap++) = '\\';
++	*(ap++) = *p;
++      }
+     *(ap++) = ' ';
+-    memcpy (ap, shellflags, sflags_len);
++    if (shellflags)
++      memcpy (ap, shellflags, sflags_len);
+     ap += sflags_len;
+     *(ap++) = ' ';
+     command_ptr = ap;
+-- 
+1.7.12
+
diff --git a/pkgs/development/tools/build-managers/gnumake/copy-on-expand.patch b/pkgs/development/tools/build-managers/gnumake/copy-on-expand.patch
new file mode 100644
index 00000000000..3f202b4db96
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/copy-on-expand.patch
@@ -0,0 +1,58 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.58
+date: 2011-08-29 12:20:19 -0400;  author: psmith;  state: Exp;  lines: +7 -13;  commitid: MdH0jSxpuIy7mqxv;
+Save strings we're expanding in case an embedded eval causes them
+to be freed (if they're the value of a variable that's reset for example).
+See Savannah patch #7534
+
+Index: expand.c
+===================================================================
+RCS file: /sources/make/make/expand.c,v
+retrieving revision 1.57
+retrieving revision 1.58
+diff -u -p -r1.57 -r1.58
+--- expand.c	7 May 2011 20:03:49 -0000	1.57
++++ expand.c	29 Aug 2011 16:20:19 -0000	1.58
+@@ -197,7 +197,7 @@ variable_expand_string (char *line, cons
+ {
+   struct variable *v;
+   const char *p, *p1;
+-  char *abuf = NULL;
++  char *save;
+   char *o;
+   unsigned int line_offset;
+ 
+@@ -212,16 +212,11 @@ variable_expand_string (char *line, cons
+       return (variable_buffer);
+     }
+ 
+-  /* If we want a subset of the string, allocate a temporary buffer for it.
+-     Most of the functions we use here don't work with length limits.  */
+-  if (length > 0 && string[length] != '\0')
+-    {
+-      abuf = xmalloc(length+1);
+-      memcpy(abuf, string, length);
+-      abuf[length] = '\0';
+-      string = abuf;
+-    }
+-  p = string;
++  /* We need a copy of STRING: due to eval, it's possible that it will get
++     freed as we process it (it might be the value of a variable that's reset
++     for example).  Also having a nil-terminated string is handy.  */
++  save = length < 0 ? xstrdup (string) : xstrndup (string, length);
++  p = save;
+ 
+   while (1)
+     {
+@@ -411,8 +406,7 @@ variable_expand_string (char *line, cons
+       ++p;
+     }
+ 
+-  if (abuf)
+-    free (abuf);
++  free (save);
+ 
+   variable_buffer_output (o, "", 1);
+   return (variable_buffer + line_offset);
diff --git a/pkgs/development/tools/build-managers/gnumake/darwin-library_search-dylib.patch b/pkgs/development/tools/build-managers/gnumake/darwin-library_search-dylib.patch
new file mode 100644
index 00000000000..de7e4f61521
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/darwin-library_search-dylib.patch
@@ -0,0 +1,17 @@
+Fixed default libpatttern on Darwin, imported from prefix overlay.
+Got merged upstream:
+https://savannah.gnu.org/bugs/?37197
+--- default.c.orig	2009-05-02 12:25:24 +0200
++++ default.c	2009-05-02 12:25:58 +0200
+@@ -509,7 +509,11 @@
+ #ifdef __MSDOS__
+     ".LIBPATTERNS", "lib%.a $(DJDIR)/lib/lib%.a",
+ #else
++#ifdef __APPLE__
++    ".LIBPATTERNS", "lib%.dylib lib%.a",
++#else
+     ".LIBPATTERNS", "lib%.so lib%.a",
++#endif
+ #endif
+ #endif
+ 
diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix
index cf33e7a5bbc..4f3c7defa48 100644
--- a/pkgs/development/tools/build-managers/gnumake/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
 
   /* On Darwin, there are 3 test failures that haven't been investigated
      yet.  */
-  doCheck = !stdenv.isDarwin;
+  doCheck = !stdenv.isDarwin && !stdenv.isFreeBSD;
 
   patches =
     [
@@ -24,7 +24,21 @@ stdenv.mkDerivation {
       # Likewise, when searching for included Makefiles, don't look in
       # /usr/include and friends.
       ./impure-dirs.patch
+
+      # a bunch of patches from Gentoo, mostly should be from upstream (unreleased)
+      ./archives-many-objs.patch
+      ./MAKEFLAGS-reexec.patch
+      ./memory-corruption.patch
+      ./glob-speedup.patch
+      ./copy-on-expand.patch
+      ./oneshell.patch
+      ./parallel-remake.patch
+      ./intermediate-parallel.patch
+      ./construct-command-line.patch
+      ./long-command-line.patch
+      ./darwin-library_search-dylib.patch
     ];
+  patchFlags = "-p0";
 
   meta = {
     description = "GNU Make, a program controlling the generation of non-source files from sources";
diff --git a/pkgs/development/tools/build-managers/gnumake/glob-speedup.patch b/pkgs/development/tools/build-managers/gnumake/glob-speedup.patch
new file mode 100644
index 00000000000..45971f33590
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/glob-speedup.patch
@@ -0,0 +1,104 @@
+change from upstream to speed up by skipping unused globs
+https://bugs.gentoo.org/382845
+
+http://cvs.savannah.gnu.org/viewvc/make/read.c?root=make&r1=1.198&r2=1.200
+
+Revision 1.200
+Sat May 7 14:36:12 2011 UTC (4 months, 1 week ago) by psmith 
+Branch: MAIN 
+Changes since 1.199: +1 -1 lines 
+Inverted the boolean test from what I wanted it to be.  Added a
+regression test to make sure this continues to work.
+
+Revision 1.199
+Mon May 2 00:18:06 2011 UTC (4 months, 2 weeks ago) by psmith 
+Branch: MAIN 
+Changes since 1.198: +35 -25 lines 
+Avoid invoking glob() unless the filename has potential globbing
+characters in it, for performance improvements.
+
+--- read.c	2011/04/29 15:27:39	1.198
++++ read.c	2011/05/07 14:36:12	1.200
+@@ -2901,6 +2901,7 @@
+       const char *name;
+       const char **nlist = 0;
+       char *tildep = 0;
++      int globme = 1;
+ #ifndef NO_ARCHIVES
+       char *arname = 0;
+       char *memname = 0;
+@@ -3109,32 +3110,40 @@
+ 	}
+ #endif /* !NO_ARCHIVES */
+ 
+-      switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
+-	{
+-	case GLOB_NOSPACE:
+-	  fatal (NILF, _("virtual memory exhausted"));
+-
+-	case 0:
+-          /* Success.  */
+-          i = gl.gl_pathc;
+-          nlist = (const char **)gl.gl_pathv;
+-          break;
+-
+-        case GLOB_NOMATCH:
+-          /* If we want only existing items, skip this one.  */
+-          if (flags & PARSEFS_EXISTS)
+-            {
+-              i = 0;
+-              break;
+-            }
+-          /* FALLTHROUGH */
+-
+-	default:
+-          /* By default keep this name.  */
++      /* glob() is expensive: don't call it unless we need to.  */
++      if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL)
++        {
++          globme = 0;
+           i = 1;
+           nlist = &name;
+-          break;
+-	}
++        }
++      else
++        switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl))
++          {
++          case GLOB_NOSPACE:
++            fatal (NILF, _("virtual memory exhausted"));
++
++          case 0:
++            /* Success.  */
++            i = gl.gl_pathc;
++            nlist = (const char **)gl.gl_pathv;
++            break;
++
++          case GLOB_NOMATCH:
++            /* If we want only existing items, skip this one.  */
++            if (flags & PARSEFS_EXISTS)
++              {
++                i = 0;
++                break;
++              }
++            /* FALLTHROUGH */
++
++          default:
++            /* By default keep this name.  */
++            i = 1;
++            nlist = &name;
++            break;
++          }
+ 
+       /* For each matched element, add it to the list.  */
+       while (i-- > 0)
+@@ -3174,7 +3183,8 @@
+ #endif /* !NO_ARCHIVES */
+           NEWELT (concat (2, prefix, nlist[i]));
+ 
+-      globfree (&gl);
++      if (globme)
++        globfree (&gl);
+ 
+ #ifndef NO_ARCHIVES
+       if (arname)
diff --git a/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch b/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
index 433f61108db..f6646f1d012 100644
--- a/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
+++ b/pkgs/development/tools/build-managers/gnumake/impure-dirs.patch
@@ -1,6 +1,6 @@
-diff -rc make-3.81-orig/read.c make-3.81/read.c
-*** make-3.81-orig/read.c	2006-03-17 15:24:20.000000000 +0100
---- make-3.81/read.c	2007-05-24 17:16:31.000000000 +0200
+diff -rc read.c read.c
+*** read.c	2006-03-17 15:24:20.000000000 +0100
+--- read.c	2007-05-24 17:16:31.000000000 +0200
 ***************
 *** 99,107 ****
 --- 99,109 ----
@@ -15,9 +15,9 @@ diff -rc make-3.81-orig/read.c make-3.81/read.c
   #endif
       0
     };
-diff -rc make-3.81-orig/remake.c make-3.81/remake.c
-*** make-3.81-orig/remake.c	2006-03-20 03:36:37.000000000 +0100
---- make-3.81/remake.c	2007-05-24 17:06:54.000000000 +0200
+diff -rc reremake.c
+*** remake.c	2006-03-20 03:36:37.000000000 +0100
+--- remake.c	2007-05-24 17:06:54.000000000 +0200
 ***************
 *** 1452,1460 ****
 --- 1452,1462 ----
diff --git a/pkgs/development/tools/build-managers/gnumake/intermediate-parallel.patch b/pkgs/development/tools/build-managers/gnumake/intermediate-parallel.patch
new file mode 100644
index 00000000000..9bb7add0bde
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/intermediate-parallel.patch
@@ -0,0 +1,46 @@
+diff --git remake.c remake.c
+index c0bf709..b1ddd23 100644
+--- remake.c
++++ remake.c
+@@ -612,6 +612,10 @@ update_file_1 (struct file *file, unsigned int depth)
+                 d->file->dontcare = file->dontcare;
+               }
+ 
++            /* We may have already considered this file, when we didn't know
++               we'd need to update it.  Force update_file() to consider it and
++               not prune it.  */
++            d->file->considered = !considered;
+ 
+ 	    dep_status |= update_file (d->file, depth);
+ 
+diff --git tests/scripts/features/parallelism tests/scripts/features/parallelism
+index d4250f0..76d24a7 100644
+--- tests/scripts/features/parallelism
++++ tests/scripts/features/parallelism
+@@ -214,6 +214,23 @@ rm main.x");
+     rmfiles(qw(foo.y foo.y.in main.bar));
+ }
+ 
++# Ensure intermediate/secondary files are not pruned incorrectly.
++# See Savannah bug #30653
++
++utouch(-15, 'file2');
++utouch(-10, 'file4');
++utouch(-5,  'file1');
++
++run_make_test(q!
++.INTERMEDIATE: file3
++file4: file3 ; @mv -f $< $@
++file3: file2 ; touch $@
++file2: file1 ; @touch $@
++!,
++              '--no-print-directory -j2', "touch file3");
++
++#rmfiles('file1', 'file2', 'file3', 'file4');
++
+ if ($all_tests) {
+     # Jobserver FD handling is messed up in some way.
+     # Savannah bug #28189
+-- 
+1.7.12
+
diff --git a/pkgs/development/tools/build-managers/gnumake/log-3.81.patch b/pkgs/development/tools/build-managers/gnumake/log-3.81.patch
index 0f3ed6d7299..b98d85a0826 100644
--- a/pkgs/development/tools/build-managers/gnumake/log-3.81.patch
+++ b/pkgs/development/tools/build-managers/gnumake/log-3.81.patch
@@ -1,6 +1,6 @@
-diff -rc make-3.81-orig/job.c make-3.81/job.c
-*** make-3.81-orig/job.c	2006-03-20 04:03:04.000000000 +0100
---- make-3.81/job.c	2009-01-19 19:37:28.000000000 +0100
+diff -rc job.c job.c
+*** job.c	2006-03-20 04:03:04.000000000 +0100
+--- job.c	2009-01-19 19:37:28.000000000 +0100
 ***************
 *** 1083,1089 ****
        appear.  */
@@ -18,9 +18,9 @@ diff -rc make-3.81-orig/job.c make-3.81/job.c
   
     /* Tell update_goal_chain that a command has been started on behalf of
        this target.  It is important that this happens here and not in
-diff -rc make-3.81-orig/main.c make-3.81/main.c
-*** make-3.81-orig/main.c	2006-03-20 03:36:37.000000000 +0100
---- make-3.81/main.c	2009-01-19 19:41:41.000000000 +0100
+diff -rc main.c main.c
+*** main.c	2006-03-20 03:36:37.000000000 +0100
+--- main.c	2009-01-19 19:41:41.000000000 +0100
 ***************
 *** 886,891 ****
 --- 886,900 ----
@@ -87,9 +87,9 @@ diff -rc make-3.81-orig/main.c make-3.81/main.c
 + int enable_nested_output = 0;
 + int stdout_nesting_level = 0;
 + int stderr_nesting_level = 0;
-diff -rc make-3.81-orig/make.h make-3.81/make.h
-*** make-3.81-orig/make.h	2006-02-16 00:54:43.000000000 +0100
---- make-3.81/make.h	2009-01-19 19:32:03.000000000 +0100
+diff -rc make.h
+*** make.h	2006-02-16 00:54:43.000000000 +0100
+--- make.h	2009-01-19 19:32:03.000000000 +0100
 ***************
 *** 609,611 ****
 --- 609,614 ----
@@ -99,9 +99,9 @@ diff -rc make-3.81-orig/make.h make-3.81/make.h
 + extern int enable_nested_output;
 + extern int stdout_nesting_level;
 + extern int stderr_nesting_level;
-diff -rc make-3.81-orig/remake.c make-3.81/remake.c
-*** make-3.81-orig/remake.c	2006-03-20 03:36:37.000000000 +0100
---- make-3.81/remake.c	2009-01-19 19:39:40.000000000 +0100
+diff -rc reremake.c
+*** remake.c	2006-03-20 03:36:37.000000000 +0100
+--- remake.c	2009-01-19 19:39:40.000000000 +0100
 ***************
 *** 1120,1126 ****
 --- 1120,1137 ----
diff --git a/pkgs/development/tools/build-managers/gnumake/log.patch b/pkgs/development/tools/build-managers/gnumake/log.patch
index ca0d6340790..e6197fd8e78 100644
--- a/pkgs/development/tools/build-managers/gnumake/log.patch
+++ b/pkgs/development/tools/build-managers/gnumake/log.patch
@@ -1,6 +1,6 @@
-diff -rc make-3.81-orig/job.c make-3.81/job.c
-*** make-3.81-orig/job.c	2006-03-20 04:03:04.000000000 +0100
---- make-3.81/job.c	2009-01-19 19:37:28.000000000 +0100
+diff -rc job.c job.c
+*** job.c	2006-03-20 04:03:04.000000000 +0100
+--- job.c	2009-01-19 19:37:28.000000000 +0100
 ***************
 *** 1083,1089 ****
        appear.  */
@@ -18,9 +18,9 @@ diff -rc make-3.81-orig/job.c make-3.81/job.c
   
     /* Tell update_goal_chain that a command has been started on behalf of
        this target.  It is important that this happens here and not in
-diff -rc make-3.81-orig/main.c make-3.81/main.c
-*** make-3.81-orig/main.c	2006-03-20 03:36:37.000000000 +0100
---- make-3.81/main.c	2009-01-19 19:41:41.000000000 +0100
+diff -rc main.c main.c
+*** main.c	2006-03-20 03:36:37.000000000 +0100
+--- main.c	2009-01-19 19:41:41.000000000 +0100
 ***************
 *** 886,891 ****
 --- 886,900 ----
@@ -87,9 +87,9 @@ diff -rc make-3.81-orig/main.c make-3.81/main.c
 + int enable_nested_output = 0;
 + int stdout_nesting_level = 0;
 + int stderr_nesting_level = 0;
-diff -rc make-3.81-orig/make.h make-3.81/make.h
-*** make-3.81-orig/make.h	2006-02-16 00:54:43.000000000 +0100
---- make-3.81/make.h	2009-01-19 19:32:03.000000000 +0100
+diff -rc make.h
+*** make.h	2006-02-16 00:54:43.000000000 +0100
+--- make.h	2009-01-19 19:32:03.000000000 +0100
 ***************
 *** 609,611 ****
 --- 609,614 ----
@@ -99,9 +99,9 @@ diff -rc make-3.81-orig/make.h make-3.81/make.h
 + extern int enable_nested_output;
 + extern int stdout_nesting_level;
 + extern int stderr_nesting_level;
-diff -rc make-3.81-orig/remake.c make-3.81/remake.c
-*** make-3.81-orig/remake.c	2006-03-20 03:36:37.000000000 +0100
---- make-3.81/remake.c	2009-01-19 19:39:40.000000000 +0100
+diff -rc reremake.c
+*** remake.c	2006-03-20 03:36:37.000000000 +0100
+--- remake.c	2009-01-19 19:39:40.000000000 +0100
 ***************
 *** 1120,1126 ****
 --- 1120,1137 ----
diff --git a/pkgs/development/tools/build-managers/gnumake/long-command-line.patch b/pkgs/development/tools/build-managers/gnumake/long-command-line.patch
new file mode 100644
index 00000000000..39ea05843bf
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/long-command-line.patch
@@ -0,0 +1,54 @@
+https://savannah.gnu.org/bugs/?36451
+
+From a95796de3a491d8acfc8ea94c217b90531161786 Mon Sep 17 00:00:00 2001
+From: psmith <psmith>
+Date: Sun, 9 Sep 2012 23:25:07 +0000
+Subject: [PATCH] Keep the command line on the heap to avoid stack overflow.
+ Fixes Savannah bug #36451.
+
+---
+ ChangeLog |  3 +++
+ job.c     | 13 +++++++++----
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git job.c job.c
+index 754576b..f7b7d51 100644
+--- job.c
++++ job.c
+@@ -2984,8 +2984,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ 	return new_argv;
+       }
+ 
+-    new_line = alloca ((shell_len*2) + 1 + sflags_len + 1
+-                             + (line_len*2) + 1);
++    new_line = xmalloc ((shell_len*2) + 1 + sflags_len + 1
++                        + (line_len*2) + 1);
+     ap = new_line;
+     /* Copy SHELL, escaping any characters special to the shell.  If
+        we don't escape them, construct_command_argv_internal will
+@@ -3052,8 +3052,11 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+ 	*ap++ = *p;
+       }
+     if (ap == new_line + shell_len + sflags_len + 2)
+-      /* Line was empty.  */
+-      return 0;
++      {
++        /* Line was empty.  */
++        free (new_line);
++        return 0;
++      }
+     *ap = '\0';
+ 
+ #ifdef WINDOWS32
+@@ -3194,6 +3197,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
+       fatal (NILF, _("%s (line %d) Bad shell context (!unixy && !batch_mode_shell)\n"),
+             __FILE__, __LINE__);
+ #endif
++
++    free (new_line);
+   }
+ #endif	/* ! AMIGA */
+ 
+-- 
+1.7.12
+
diff --git a/pkgs/development/tools/build-managers/gnumake/memory-corruption.patch b/pkgs/development/tools/build-managers/gnumake/memory-corruption.patch
new file mode 100644
index 00000000000..b28c07353ec
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/memory-corruption.patch
@@ -0,0 +1,37 @@
+--- function.c	2011/04/18 01:25:20	1.121
++++ function.c	2011/05/02 12:35:01	1.122
+@@ -706,7 +706,7 @@
+   const char *word_iterator = argv[0];
+   char buf[20];
+ 
+-  while (find_next_token (&word_iterator, (unsigned int *) 0) != 0)
++  while (find_next_token (&word_iterator, NULL) != 0)
+     ++i;
+ 
+   sprintf (buf, "%d", i);
+@@ -1133,21 +1133,14 @@
+ 
+   /* Find the maximum number of words we'll have.  */
+   t = argv[0];
+-  wordi = 1;
+-  while (*t != '\0')
++  wordi = 0;
++  while ((p = find_next_token (&t, NULL)) != 0)
+     {
+-      char c = *(t++);
+-
+-      if (! isspace ((unsigned char)c))
+-        continue;
+-
++      ++t;
+       ++wordi;
+-
+-      while (isspace ((unsigned char)*t))
+-        ++t;
+     }
+ 
+-  words = xmalloc (wordi * sizeof (char *));
++  words = xmalloc ((wordi == 0 ? 1 : wordi) * sizeof (char *));
+ 
+   /* Now assign pointers to each string in the array.  */
+   t = argv[0];
diff --git a/pkgs/development/tools/build-managers/gnumake/oneshell.patch b/pkgs/development/tools/build-managers/gnumake/oneshell.patch
new file mode 100644
index 00000000000..fbade127ce6
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/oneshell.patch
@@ -0,0 +1,24 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.245
+date: 2010-08-13 22:50:14 -0400;  author: psmith;  state: Exp;  lines: +1 -1;  commitid: 4UaslPqQHZTs5wKu;
+- Add oneshell to $(.FEATURES) (forgot that!)
+
+Index: main.c
+===================================================================
+RCS file: /sources/make/make/main.c,v
+retrieving revision 1.244
+retrieving revision 1.245
+diff -u -p -r1.244 -r1.245
+--- main.c	10 Aug 2010 07:35:34 -0000	1.244
++++ main.c	14 Aug 2010 02:50:14 -0000	1.245
+@@ -1138,7 +1138,7 @@ main (int argc, char **argv, char **envp
+      a macro and some compilers (MSVC) don't like conditionals in macros.  */
+   {
+     const char *features = "target-specific order-only second-expansion"
+-                           " else-if shortest-stem undefine"
++                           " else-if shortest-stem undefine oneshell"
+ #ifndef NO_ARCHIVES
+                            " archives"
+ #endif
diff --git a/pkgs/development/tools/build-managers/gnumake/parallel-remake.patch b/pkgs/development/tools/build-managers/gnumake/parallel-remake.patch
new file mode 100644
index 00000000000..a19fe7b7d62
--- /dev/null
+++ b/pkgs/development/tools/build-managers/gnumake/parallel-remake.patch
@@ -0,0 +1,39 @@
+fix from upstream cvs
+
+----------------------------
+revision 1.247
+date: 2011-09-18 19:39:26 -0400;  author: psmith;  state: Exp;  lines: +5 -3;  commitid: 07NxO4T5PiWC82Av;
+When we re-exec the master makefile in a jobserver environment, ensure
+that MAKEFLAGS is set properly so the re-exec'd make runs in parallel.
+See Savannah bug #33873.
+
+Index: main.c
+===================================================================
+RCS file: /sources/make/make/main.c,v
+retrieving revision 1.246
+retrieving revision 1.247
+diff -u -p -r1.246 -r1.247
+--- main.c	29 Aug 2010 23:05:27 -0000	1.246
++++ main.c	18 Sep 2011 23:39:26 -0000	1.247
+@@ -2089,6 +2089,11 @@ main (int argc, char **argv, char **envp
+ 
+           ++restarts;
+ 
++          /* If we're re-exec'ing the first make, put back the number of
++             job slots so define_makefiles() will get it right.  */
++          if (master_job_slots)
++            job_slots = master_job_slots;
++
+           /* Reset makeflags in case they were changed.  */
+           {
+             const char *pv = define_makeflags (1, 1);
+@@ -2825,9 +2830,6 @@ define_makeflags (int all, int makefile)
+ 		       && (*(unsigned int *) cs->value_ptr ==
+ 			   *(unsigned int *) cs->noarg_value))
+ 		ADD_FLAG ("", 0); /* Optional value omitted; see below.  */
+-	      else if (cs->c == 'j')
+-		/* Special case for `-j'.  */
+-		ADD_FLAG ("1", 1);
+ 	      else
+ 		{
+ 		  char *buf = alloca (30);
diff --git a/pkgs/development/tools/build-managers/leiningen/builder.sh b/pkgs/development/tools/build-managers/leiningen/builder.sh
index df7ace8e4f3..c4b7002a718 100644
--- a/pkgs/development/tools/build-managers/leiningen/builder.sh
+++ b/pkgs/development/tools/build-managers/leiningen/builder.sh
@@ -10,7 +10,7 @@ out_bin=$out/bin/lein
 
 cp -v $src $out_bin
 cp -v $jarsrc $out/lib
-cp -v $clojuresrc $out/lib
+cp -v $clojure/lib/java/* $out/lib
 
 for p in $patches;
 do
diff --git a/pkgs/development/tools/build-managers/leiningen/default.nix b/pkgs/development/tools/build-managers/leiningen/default.nix
index e5a20b46046..bf1a275046e 100644
--- a/pkgs/development/tools/build-managers/leiningen/default.nix
+++ b/pkgs/development/tools/build-managers/leiningen/default.nix
@@ -1,39 +1,35 @@
-{stdenv, fetchurl, makeWrapper, openjdk, rlwrap}:
+{stdenv, fetchurl, makeWrapper, openjdk, rlwrap, clojure }:
 
 stdenv.mkDerivation rec {
   pname = "leiningen";
-  version = "1.7.1";
+  version = "2.1.2";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "https://raw.github.com/technomancy/leiningen/${version}/bin/lein-pkg";
-    sha256 = "7684b899edd6004abafd8e26d2b43d5691217f1aaca535fb94bde1594c8129a5";
+    sha256 = "10s4xpwrhd8wz3h2vj8ay4rf2hw8vzswfkr8ckckk3fhjcn130dy";
   };
 
   jarsrc = fetchurl {
-    url = "https://github.com/downloads/technomancy/leiningen/leiningen-${version}-standalone.jar";
-    sha256 = "5d167b7572b9652d44c2b58a13829704842d976fd2236530ef552194e6c12150";
+    url = "https://leiningen.s3.amazonaws.com/downloads/${pname}-${version}-standalone.jar";
+    sha256 = "08jq21zpsgwsmsz7lpfxidj2s3mv8i23fjwyl9qc6dngskkx45sa";
   };
 
-  clojuresrc = fetchurl {
-    url = "http://build.clojure.org/releases/org/clojure/clojure/1.2.1/clojure-1.2.1.jar";
-    sha256 = "b38853254a2df9138b2e2c12be0dca3600fa7e2a951fed05fc3ba2d9141a3fb0";
-  };
-
-  patches = [ ./lein-rlwrap.patch ./lein.patch ];
+  patches = ./lein_2.1.2.patch;
 
-  inherit rlwrap;
+  inherit rlwrap clojure;
 
   builder = ./builder.sh;
 
   buildInputs = [ makeWrapper ];
 
-  propagatedBuildInputs = [ openjdk ];
+  propagatedBuildInputs = [ openjdk clojure ];
 
   meta = {
     homepage = https://github.com/technomancy/leiningen;
     description = "Project automation for Clojure";
     license = "EPL";
     platforms = stdenv.lib.platforms.unix;
+    maintainer = with stdenv.lib.maintainers; [the-kenny];
   };
 }
diff --git a/pkgs/development/tools/build-managers/leiningen/lein-rlwrap.patch b/pkgs/development/tools/build-managers/leiningen/lein-rlwrap.patch
deleted file mode 100644
index 208199f355d..00000000000
--- a/pkgs/development/tools/build-managers/leiningen/lein-rlwrap.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From f14307932a316952fae8517c0fcb0962cd204e9a Mon Sep 17 00:00:00 2001
-From: Michel Alexandre Salim <michel@sylvestre.me>
-Date: Fri, 4 May 2012 10:56:38 +0700
-Subject: [PATCH] lein-pkg: require rlwrap unconditionally, unless run inside
- Emacs or a dumb terminal;   chmod to 755 as this is an
- executable script
-
----
- bin/lein-pkg |   10 ++++++----
- 1 file changed, 6 insertions(+), 4 deletions(-)
- mode change 100644 => 100755 bin/lein-pkg
-
-diff --git a/bin/lein-pkg b/bin/lein-pkg
-old mode 100644
-new mode 100755
-index 8563da6..1b90ebe
---- lein-pkg.orig
-+++ lein-pkg
-@@ -3,6 +3,11 @@
- # This variant of the lein script is meant for downstream packagers.
- # It has all the cross-platform stuff stripped out as well as the
- # logic for running from checkouts and self-upgrading.
-+#
-+# Note to packagers:
-+# rlwrap is now required unless running inside Emacs or in a dumb
-+# terminal (this is to improve the 'lein repl' experience).
-+# Make sure that your packaging pulls in rlwrap as a dependency
- 
- export LEIN_VERSION="1.7.1"
- 
-@@ -103,10 +108,7 @@ fi
- 
- # Use rlwrap if appropriate
- if ([ -z $INSIDE_EMACS ] && [ "$TERM" != "dumb" ]); then
--    which rlwrap > /dev/null
--    if [ $? -eq 0 ]; then
--        RLWRAP="rlwrap -r -m -q '\"'" # custom quote chars
--    fi
-+    RLWRAP="rlwrap -r -m -q '\"'" # custom quote chars
-     RLWRAP_CLJ_WORDS_FILE=${RLWRAP_CLJ_WORDS_FILE:-"${HOME}/.clj_completions"}
-     RLWRAP_CLJ_WORDS_OPTION=""
-     if [ -r "${RLWRAP_CLJ_WORDS_FILE}" ]; then
--- 
-1.7.9.5
-
diff --git a/pkgs/development/tools/build-managers/leiningen/lein.patch b/pkgs/development/tools/build-managers/leiningen/lein.patch
deleted file mode 100644
index b62701e2519..00000000000
--- a/pkgs/development/tools/build-managers/leiningen/lein.patch
+++ /dev/null
@@ -1,35 +0,0 @@
---- lein-pkg	2012-05-04 11:02:41.524912828 +0700
-+++ lein-pkg-nix	2012-05-04 11:03:11.062543558 +0700
-@@ -76,30 +76,14 @@
- LEIN_PLUGIN_PATH="$(echo "$DEV_PLUGINS" | tr \\n :)"
- LEIN_USER_PLUGIN_PATH="$(echo "$(unique_user_plugins)" | tr \\n :)"
- CLASSPATH="$CLASSPATH:$LEIN_PLUGIN_PATH:$LEIN_USER_PLUGIN_PATH:test/:src/:resources/"
--CLOJURE_JAR="/usr/share/java/clojure-1.2.jar:/usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar"
-+CLOJURE_JAR="$(dirname $0)/../lib/*clojure-1.2.1.jar"
- 
- # apply context specific CLASSPATH entries
- if [ -f .lein-classpath ]; then
-     CLASSPATH="`cat .lein-classpath`:$CLASSPATH"
- fi
- 
--SHARE_JARS="ant ant-launcher classworlds clojure-1.2 clojure-contrib \
--lucene-memory maven-ant-tasks maven-artifact maven-artifact-manager \
--maven-error-diagnostics maven-model maven-settings maven-project maven-profile \
--maven-repository-metadata plexus-container-default-alpha plexus-interpolation \
--plexus-utils wagon-file wagon-http-lightweight wagon-http-shared wagon-provider-api \
--xml-apis lucene-core lucene-highlighter clucy robert-hooke lancet \
--backport-util-concurrent" # NFI why that last one is necessary
--for JAR in $SHARE_JARS; do
--    CLASSPATH="$CLASSPATH":"/usr/share/java/$JAR.jar"
--done
--
--# Do not use installed leiningen jar during self-compilation
--if ! { [ "$1" = "compile" ] &&
--        grep -qsE 'defproject leiningen[[:space:]]+"[[:digit:].]+"' \
--            project.clj ;}; then
--    CLASSPATH="$CLASSPATH":/usr/share/java/leiningen-$LEIN_VERSION.jar
--fi
-+CLASSPATH="$CLASSPATH:$(dirname $0)/../lib/*"
- 
- if [ $DEBUG ]; then
-     echo $CLASSPATH
diff --git a/pkgs/development/tools/build-managers/leiningen/lein_2.1.2.patch b/pkgs/development/tools/build-managers/leiningen/lein_2.1.2.patch
new file mode 100644
index 00000000000..23f6b624776
--- /dev/null
+++ b/pkgs/development/tools/build-managers/leiningen/lein_2.1.2.patch
@@ -0,0 +1,4 @@
+46c47
+< LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar
+---
+> LEIN_JAR=$(find $(dirname $0)/../lib -name *-standalone.jar | head -n 1)
diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix
new file mode 100644
index 00000000000..c4a8b83a7cf
--- /dev/null
+++ b/pkgs/development/tools/build-managers/ninja/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, unzip, python, asciidoc, re2c }:
+
+stdenv.mkDerivation rec {
+  name = "ninja-${version}";
+  version = "1.2.0";
+
+  src = fetchurl {
+    name = "${name}.zip";
+    url = "https://github.com/martine/ninja/archive/v${version}.zip";
+    sha256 = "15ynh806ah37bqb57hcs3mj2g82900sncp6n3bssfggb4azgjlh3";
+  };
+
+  buildInputs = [ python asciidoc unzip re2c ];
+
+  buildPhase = ''
+    python bootstrap.py
+    asciidoc doc/manual.asciidoc
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ninja $out/bin/
+
+    mkdir -p $out/share/doc/ninja
+    cp doc/manual.asciidoc $out/share/doc/ninja/
+    cp doc/manual.html $out/share/doc/ninja/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Small build system with a focus on speed";
+    longDescription = ''
+      Ninja is a small build system with a focus on speed. It differs from
+      other build systems in two major respects: it is designed to have its
+      input files generated by a higher-level build system, and it is designed
+      to run builds as fast as possible.
+    '';
+    homepage = http://martine.github.io/ninja/;
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/development/tools/build-managers/sbt/default.nix b/pkgs/development/tools/build-managers/sbt/default.nix
new file mode 100644
index 00000000000..90045b97352
--- /dev/null
+++ b/pkgs/development/tools/build-managers/sbt/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, writeScript, bash, jre }:
+
+let 
+
+  sbt = writeScript "sbt.sh" ''
+    #!${bash}/bin/bash
+    ${jre}/bin/java -Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled \
+      -XX:MaxPermSize=384M -jar @out@/lib/sbt-launch.jar "$@"
+  '';
+
+in stdenv.mkDerivation rec {
+  name = "sbt-${version}";
+
+  version = "0.12.3";
+
+  src = fetchurl {
+    url = "http://scalasbt.artifactoryonline.com/scalasbt/sbt-native-packages/org/scala-sbt/sbt/${version}/sbt.tgz";
+    sha256 = "154ydaxd6ink5sy4flzpyh47nnhgkxwpzmml8q16am7655fpib08";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib $out/bin
+    mv bin/sbt-launch.jar $out/lib/
+    cp ${sbt} $out/bin/sbt
+    substituteInPlace $out/bin/sbt --replace @out@ $out
+  '';
+}
diff --git a/pkgs/development/tools/casperjs/default.nix b/pkgs/development/tools/casperjs/default.nix
new file mode 100644
index 00000000000..f140f0d7862
--- /dev/null
+++ b/pkgs/development/tools/casperjs/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchgit, python, phantomjs }:
+
+stdenv.mkDerivation rec {
+  name = "casperjs-1.0.0-RC5";
+
+  src = fetchgit {
+    url = "git://github.com/n1k0/casperjs.git";
+    rev = "refs/tags/1.0.0-RC5";
+    sha256 = "e7fd6b94b4b304416159196208dea7f6e8841a667df102eb378a698a92f0f2c7";
+  };
+
+  patchPhase = ''
+    substituteInPlace bin/casperjs --replace "/usr/bin/env python" "${python}/bin/python" \
+                                   --replace "'phantomjs'" "'${phantomjs}/bin/phantomjs'"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/casperjs $out/bin
+    cp -a . $out/share/casperjs/.
+    ln -s $out/share/casperjs/bin/casperjs $out/bin
+  '';
+
+  meta = {
+    description = "Navigation scripting & testing utility for PhantomJS.";
+    longDescription = ''
+      CasperJS is a navigation scripting & testing utility for PhantomJS.
+      It eases the process of defining a full navigation scenario and provides useful high-level
+      functions, methods & syntaxic sugar for doing common tasks such as:
+      - defining & ordering navigation steps
+      - filling forms
+      - clicking links
+      - capturing screenshots of a page (or an area)
+      - making assertions on remote DOM
+      - logging & events
+      - downloading base64 encoded resources, even binary ones
+      - catching errors and react accordingly
+      - writing functional test suites, exporting results as JUnit XML (xUnit)
+    '';
+
+    homepage = http://casperjs.org;
+    license = stdenv.lib.licenses.mit;
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/tools/documentation/docutils/default.nix b/pkgs/development/tools/documentation/docutils/default.nix
index 1630b0f4072..f6edcf54463 100644
--- a/pkgs/development/tools/documentation/docutils/default.nix
+++ b/pkgs/development/tools/documentation/docutils/default.nix
@@ -2,7 +2,7 @@ a :
 let 
   fetchurl = a.fetchurl;
 
-  version = a.lib.attrByPath ["version"] "0.5" a; 
+  version = a.lib.attrByPath ["version"] "0.10" a; 
   buildInputs = with a; [
     python pil makeWrapper 
   ];
@@ -10,7 +10,7 @@ in
 rec {
   src = fetchurl {
     url = "http://prdownloads.sourceforge.net/docutils/docutils-${version}.tar.gz";
-    sha256 = "03k1dakb5j1xi1xd62vqqy7dkgd1fhr4ahmvvmd5g87wxn2gjz3l";
+    sha256 = "0gk0733w34zibzvi6paqqfbbajzaxajc4z5i5wpxlwv73gk281ip";
   };
 
   inherit buildInputs;
diff --git a/pkgs/development/tools/documentation/doxygen/1.7.nix b/pkgs/development/tools/documentation/doxygen/1.7.nix
index 86f2e8cf2b2..f530ed70e37 100644
--- a/pkgs/development/tools/documentation/doxygen/1.7.nix
+++ b/pkgs/development/tools/documentation/doxygen/1.7.nix
@@ -47,6 +47,6 @@ stdenv.mkDerivation {
     '';
 
     maintainers = [stdenv.lib.maintainers.simons];
-    platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
+    platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix
index 07893987bbf..4f2ef6df849 100644
--- a/pkgs/development/tools/documentation/doxygen/default.nix
+++ b/pkgs/development/tools/documentation/doxygen/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, perl, flex, bison, qt4 }:
 
 let
-  name = "doxygen-1.8.1";
+  name = "doxygen-1.8.3.1";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "ftp://ftp.stack.nl/pub/users/dimitri/${name}.src.tar.gz";
-    sha256 = "0qmprax8d5fwx6sc7x9l06ilh2ffgvm6xs0rh54k3v5q5879r7mg";
+    sha256 = "0m9bwxg9g2h5fp9as0l0rmibm9ing39nssfrn3608v0v21l9yx0c";
   };
 
   patches = [ ./tmake.patch ];
@@ -47,6 +47,6 @@ stdenv.mkDerivation {
     '';
 
     maintainers = [stdenv.lib.maintainers.simons];
-    platforms = if (qt4 != null) then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
+    platforms = if qt4 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
index ad1be726578..374002e8d6c 100644
--- a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
+++ b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
@@ -14,5 +14,5 @@ stdenv.mkDerivation {
   pythonPath = [ libxml2Python ];
   postInstall = "wrapPythonPrograms";
 
-  buildNativeInputs = [ pkgconfig intltool pythonPackages.wrapPython ];
+  nativeBuildInputs = [ pkgconfig intltool pythonPackages.wrapPython ];
 }
diff --git a/pkgs/development/tools/documentation/haddock/2.10.0.nix b/pkgs/development/tools/documentation/haddock/2.10.0.nix
index 5c608c440aa..cfda3b66704 100644
--- a/pkgs/development/tools/documentation/haddock/2.10.0.nix
+++ b/pkgs/development/tools/documentation/haddock/2.10.0.nix
@@ -7,7 +7,9 @@ cabal.mkDerivation (self: {
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ Cabal filepath ghcPaths xhtml ];
+  testDepends = [ Cabal filepath ];
   buildTools = [ alex happy ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/haddock/";
     description = "A documentation-generation tool for Haskell libraries";
diff --git a/pkgs/development/tools/documentation/haddock/2.11.0.nix b/pkgs/development/tools/documentation/haddock/2.11.0.nix
new file mode 100644
index 00000000000..968efe2260b
--- /dev/null
+++ b/pkgs/development/tools/documentation/haddock/2.11.0.nix
@@ -0,0 +1,20 @@
+{ cabal, alex, Cabal, filepath, ghcPaths, happy, xhtml }:
+
+cabal.mkDerivation (self: {
+  pname = "haddock";
+  version = "2.11.0";
+  sha256 = "0a29n6y9lmk5w78f6j8s7pg0m0k3wm7bx5r2lhk7bnzkr5f7rkcd";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ Cabal filepath ghcPaths xhtml ];
+  testDepends = [ Cabal filepath ];
+  buildTools = [ alex happy ];
+  doCheck = false;
+  meta = {
+    homepage = "http://www.haskell.org/haddock/";
+    description = "A documentation-generation tool for Haskell libraries";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/tools/documentation/haddock/2.12.0.nix b/pkgs/development/tools/documentation/haddock/2.12.0.nix
new file mode 100644
index 00000000000..12907a64d21
--- /dev/null
+++ b/pkgs/development/tools/documentation/haddock/2.12.0.nix
@@ -0,0 +1,20 @@
+{ cabal, alex, Cabal, deepseq, filepath, ghcPaths, happy, xhtml }:
+
+cabal.mkDerivation (self: {
+  pname = "haddock";
+  version = "2.12.0";
+  sha256 = "00kdmpa6vhn6x790641ln40v3pn7aj4ws6pq854n1iyg5ly3ridn";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ Cabal deepseq filepath ghcPaths xhtml ];
+  testDepends = [ Cabal filepath ];
+  buildTools = [ alex happy ];
+  doCheck = false;
+  meta = {
+    homepage = "http://www.haskell.org/haddock/";
+    description = "A documentation-generation tool for Haskell libraries";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/tools/documentation/haddock/2.13.2.nix b/pkgs/development/tools/documentation/haddock/2.13.2.nix
new file mode 100644
index 00000000000..95890f5bd43
--- /dev/null
+++ b/pkgs/development/tools/documentation/haddock/2.13.2.nix
@@ -0,0 +1,20 @@
+{ cabal, alex, Cabal, deepseq, filepath, ghcPaths, happy, xhtml }:
+
+cabal.mkDerivation (self: {
+  pname = "haddock";
+  version = "2.13.2";
+  sha256 = "1qwj13ks3fzar14s587svv1pdiwk80m7x5pzn74v3jrqkn0xbrr5";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [ Cabal deepseq filepath ghcPaths xhtml ];
+  testDepends = [ Cabal deepseq filepath ];
+  buildTools = [ alex happy ];
+  doCheck = false;
+  meta = {
+    homepage = "http://www.haskell.org/haddock/";
+    description = "A documentation-generation tool for Haskell libraries";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/tools/documentation/haddock/2.4.2.nix b/pkgs/development/tools/documentation/haddock/2.4.2.nix
index dd7b9de9725..811ffd2855d 100644
--- a/pkgs/development/tools/documentation/haddock/2.4.2.nix
+++ b/pkgs/development/tools/documentation/haddock/2.4.2.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ Cabal filepath ghcPaths ];
   buildTools = [ alex happy ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/haddock/";
     description = "A documentation-generation tool for Haskell libraries";
diff --git a/pkgs/development/tools/documentation/haddock/2.7.2.nix b/pkgs/development/tools/documentation/haddock/2.7.2.nix
index c94b3e43b7e..8dd3460b6f8 100644
--- a/pkgs/development/tools/documentation/haddock/2.7.2.nix
+++ b/pkgs/development/tools/documentation/haddock/2.7.2.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self : {
   sha256 = "4eaaaf62785f0ba3d37ba356cfac4679faef91c0902d8cdbf42837cbe5daab82";
   extraBuildInputs = [alex happy makeWrapper];
   propagatedBuildInputs = [ghcPaths];
+  doCheck = false;
 
   postInstall = ''
    wrapProgram $out/bin/haddock --add-flags "\$(${self.ghc.GHCGetPackages} ${self.ghc.ghcVersion} \"\$(dirname \$0)\" \"--optghc=-package-conf --optghc=\")"
@@ -17,9 +18,6 @@ cabal.mkDerivation (self : {
     description = "A documentation-generation tool for Haskell libraries";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/tools/documentation/haddock/2.9.2.nix b/pkgs/development/tools/documentation/haddock/2.9.2.nix
index c6543936ab3..61e457426de 100644
--- a/pkgs/development/tools/documentation/haddock/2.9.2.nix
+++ b/pkgs/development/tools/documentation/haddock/2.9.2.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self : {
   sha256 = "189vvp173pqc69zgzqqx6vyhvsc13p1s86ql60rs1j5qlhh8ajg8";
   extraBuildInputs = [alex happy makeWrapper];
   propagatedBuildInputs = [ghcPaths xhtml];
+  doCheck = false;
 
   postInstall = ''
    wrapProgram $out/bin/haddock --add-flags "\$(${self.ghc.GHCGetPackages} ${self.ghc.ghcVersion} \"\$(dirname \$0)\" \"--optghc=-package-conf --optghc=\")"
@@ -19,7 +20,6 @@ cabal.mkDerivation (self : {
     platforms = self.ghc.meta.platforms;
     maintainers = [
       self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
     ];
   };
 })
diff --git a/pkgs/development/tools/documentation/haddock/2.9.4.nix b/pkgs/development/tools/documentation/haddock/2.9.4.nix
index 15ed35f5758..8a57dd851c2 100644
--- a/pkgs/development/tools/documentation/haddock/2.9.4.nix
+++ b/pkgs/development/tools/documentation/haddock/2.9.4.nix
@@ -1,4 +1,5 @@
-{ cabal, alex, Cabal, filepath, ghcPaths, happy, xhtml }:
+{ cabal, alex, Cabal, filepath, ghcPaths, happy, regexCompat, xhtml
+}:
 
 cabal.mkDerivation (self: {
   pname = "haddock";
@@ -7,7 +8,9 @@ cabal.mkDerivation (self: {
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ Cabal filepath ghcPaths xhtml ];
+  testDepends = [ Cabal filepath regexCompat ];
   buildTools = [ alex happy ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/haddock/";
     description = "A documentation-generation tool for Haskell libraries";
diff --git a/pkgs/development/tools/documentation/xdoc/builder.sh b/pkgs/development/tools/documentation/xdoc/builder.sh
deleted file mode 100644
index 4bc414ff7bf..00000000000
--- a/pkgs/development/tools/documentation/xdoc/builder.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-source $stdenv/setup
-
-configureFlags="--with-aterm=$aterm --with-sglr=$sglr --with-pgen=$pgen
- --with-pt-support=$ptsupport --with-asf-library=$asflibrary --with-strategoxt=$strategoxt --with-graphviz=$graphviz --with-svn=$subversion"
-genericBuild
diff --git a/pkgs/development/tools/documentation/xdoc/default.nix b/pkgs/development/tools/documentation/xdoc/default.nix
deleted file mode 100644
index cc56d7e133e..00000000000
--- a/pkgs/development/tools/documentation/xdoc/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, strategoxt, aterm, sdf, subversion, graphviz}: 
-
-stdenv.mkDerivation {
-  name = "xdoc-0.1";
-  src = fetchurl {
-    url = http://machina.nl/xdoc/xdoc-0.1.tar.gz;
-    md5 = "6f601254013d5fe3d2fdbd33b827001a";
-  };
-  builder = ./builder.sh;
-  inherit aterm strategoxt subversion graphviz ;
-  inherit (sdf) sglr pgen ptsupport asflibrary;
-  buildInputs = [aterm sdf.pgen strategoxt];
-}
diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix
new file mode 100644
index 00000000000..24896aa5826
--- /dev/null
+++ b/pkgs/development/tools/gnulib/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchgit }:
+
+stdenv.mkDerivation {
+  name = "gnulib-0.0-7952-g439b0e9";
+
+  src = fetchgit {
+    url = "http://git.savannah.gnu.org/r/gnulib.git";
+    rev = "439b0e925f9ffb6fe58481717def708af96a9321";
+    sha256 = "0xvnqn3323w0wnd1p7dhkcd4mihfh2dby88kv2dsclszppd9g4dc";
+  };
+
+  buildPhase = ":";
+
+  installPhase = "mkdir -p $out; mv * $out/";
+
+  meta = {
+    homepage = "http://www.gnu.org/software/gnulib/";
+    description = "central location for code to be shared among GNU packages";
+    license = stdenv.lib.licenses.gpl3Plus;
+  };
+}
diff --git a/pkgs/development/tools/haskell/BNFC-meta/default.nix b/pkgs/development/tools/haskell/BNFC-meta/default.nix
index 1b0397ead1b..d39544342b3 100644
--- a/pkgs/development/tools/haskell/BNFC-meta/default.nix
+++ b/pkgs/development/tools/haskell/BNFC-meta/default.nix
@@ -2,12 +2,11 @@
 
 cabal.mkDerivation (self: {
   pname = "BNFC-meta";
-  version = "0.3.0.3";
-  sha256 = "06k8jnb4gw96gc0ffmczbywn4q2n87zwqa0pl0ada3ldvwaagv4l";
+  version = "0.4.0.1";
+  sha256 = "0x31a25njbgd3r8shh7rrqa9qq66iqjhh82k538p9bd2hblg30ka";
   buildDepends = [ alexMeta happyMeta haskellSrcMeta syb ];
-  noHaddock = true;
   meta = {
-    description = "Deriving Quasi-Quoters from BNF Grammars";
+    description = "Deriving Parsers and Quasi-Quoters from BNF Grammars";
     license = self.stdenv.lib.licenses.gpl2;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/development/tools/haskell/BNFC/default.nix b/pkgs/development/tools/haskell/BNFC/default.nix
index e737a02a4ac..3cb85b86acb 100644
--- a/pkgs/development/tools/haskell/BNFC/default.nix
+++ b/pkgs/development/tools/haskell/BNFC/default.nix
@@ -1,14 +1,16 @@
-{ cabal, mtl }:
+{ cabal, mtl, fetchurl }:
 
 cabal.mkDerivation (self: {
   pname = "BNFC";
-  version = "2.4.2.1";
-  sha256 = "0a6ic9mqkxk2gql7dzik2bhm5iikgx035wxlz8iafxf45159dl14";
-  isLibrary = false;
+  version = "2.6.0.3";
+  sha256 = "0i38rwslkvnicnlxbrxybnwkgfin04lnr4q12lcvli4ldp2ylfjq";
+  isLibrary = true;
   isExecutable = true;
   buildDepends = [ mtl ];
+  patches = [ (fetchurl { url = "https://github.com/BNFC/bnfc/pull/3.patch"; sha256 = "103l04ylzswgxrmpv5zy6dd0jyr96z21mdkpgk1z4prvn8wjl624"; }) ];
+  patchFlags = "-p2";
   meta = {
-    homepage = "http://www.cse.chalmers.se/research/group/Language-technology/BNFC/";
+    homepage = "http://bnfc.digitalgrammars.com/";
     description = "A compiler front-end generator";
     license = "GPL";
     platforms = self.ghc.meta.platforms;
diff --git a/pkgs/development/tools/haskell/SourceGraph/default.nix b/pkgs/development/tools/haskell/SourceGraph/default.nix
index 731722126ca..17d19106481 100644
--- a/pkgs/development/tools/haskell/SourceGraph/default.nix
+++ b/pkgs/development/tools/haskell/SourceGraph/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "SourceGraph";
-  version = "0.7.0.2";
-  sha256 = "0cdspzsz15r83fjry9467z67h6vvnjh31fip6gf64k74gdjkfisl";
+  version = "0.7.0.5";
+  sha256 = "0lbgs5a0ivn44bmc242hynsvczvxq2snz1fyjf13mrpfx8j5n8gk";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/alex-meta/default.nix b/pkgs/development/tools/haskell/alex-meta/default.nix
index 661c9c7895b..5bb298e739a 100644
--- a/pkgs/development/tools/haskell/alex-meta/default.nix
+++ b/pkgs/development/tools/haskell/alex-meta/default.nix
@@ -2,10 +2,9 @@
 
 cabal.mkDerivation (self: {
   pname = "alex-meta";
-  version = "0.3.0.3";
-  sha256 = "08w7z2iq2s557vi9kp2x8qp1lwvh49skffbjm8kxrf2bn2il5q48";
+  version = "0.3.0.5";
+  sha256 = "0f41q5l6z1dcpfx8rxacv4f544zcw7pgvq935mnzzha9fvsxqzk4";
   buildDepends = [ haskellSrcMeta QuickCheck ];
-  noHaddock = true;
   meta = {
     description = "Quasi-quoter for Alex lexers";
     license = self.stdenv.lib.licenses.bsd3;
diff --git a/pkgs/development/tools/haskell/cabal-dev/default.nix b/pkgs/development/tools/haskell/cabal-dev/default.nix
new file mode 100644
index 00000000000..fef9892bce8
--- /dev/null
+++ b/pkgs/development/tools/haskell/cabal-dev/default.nix
@@ -0,0 +1,21 @@
+{ cabal, Cabal, cabalInstall, filepath, HTTP, mtl, network, setenv
+, tar, transformers, zlib
+}:
+
+cabal.mkDerivation (self: {
+  pname = "cabal-dev";
+  version = "0.9.2";
+  sha256 = "1372bpn8s7d7nm01ggp3m98ldrynidbchk3p14yrjysvxwr3l6q8";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    Cabal filepath HTTP mtl network setenv tar transformers zlib
+  ];
+  buildTools = [ cabalInstall ];
+  meta = {
+    homepage = "http://github.com/creswick/cabal-dev";
+    description = "Manage sandboxed Haskell build environments";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/cabal2ghci/default.nix b/pkgs/development/tools/haskell/cabal2ghci/default.nix
new file mode 100644
index 00000000000..cd7bf9dc9d1
--- /dev/null
+++ b/pkgs/development/tools/haskell/cabal2ghci/default.nix
@@ -0,0 +1,21 @@
+{ cabal, Cabal, cmdargs, stylishHaskell, systemFileio
+, systemFilepath, text, unorderedContainers, yaml
+}:
+
+cabal.mkDerivation (self: {
+  pname = "cabal2ghci";
+  version = "0.0.1.0";
+  sha256 = "0l5225gwm6j25694cp94d4z31i1p68pq6js3psbr7m204q409dr5";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    Cabal cmdargs stylishHaskell systemFileio systemFilepath text
+    unorderedContainers yaml
+  ];
+  jailbreak = true;
+  meta = {
+    description = "A tool to generate .ghci file from .cabal";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/cabal2nix/default.nix b/pkgs/development/tools/haskell/cabal2nix/default.nix
index b5983dec6fb..96803e139ba 100644
--- a/pkgs/development/tools/haskell/cabal2nix/default.nix
+++ b/pkgs/development/tools/haskell/cabal2nix/default.nix
@@ -1,12 +1,14 @@
-{ cabal, Cabal, filepath, hackageDb, HTTP, mtl, regexPosix }:
+{ cabal, Cabal, doctest, filepath, hackageDb, HTTP, mtl, regexPosix
+}:
 
 cabal.mkDerivation (self: {
   pname = "cabal2nix";
-  version = "1.38";
-  sha256 = "1kybxrkddbzr1cqpqplbflhakf9njb9hvamhdwvlanlk8985h8jg";
+  version = "1.51";
+  sha256 = "0la1bhdxrzn1phjyca7h54vimwf4jy5ryclwrnivbcxkncrk9lig";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal filepath hackageDb HTTP mtl regexPosix ];
+  testDepends = [ doctest ];
   meta = {
     homepage = "http://github.com/NixOS/cabal2nix";
     description = "Convert Cabal files into Nix build instructions";
diff --git a/pkgs/development/tools/haskell/happy-meta/default.nix b/pkgs/development/tools/haskell/happy-meta/default.nix
index 3b9a6d4c983..a3d885c6008 100644
--- a/pkgs/development/tools/haskell/happy-meta/default.nix
+++ b/pkgs/development/tools/haskell/happy-meta/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "happy-meta";
-  version = "0.2.0.4";
-  sha256 = "1s1inv2l2hwdlvypn6wpiadmi5y5mpcjawiqjb1hv0d8y43dpz54";
+  version = "0.2.0.5";
+  sha256 = "103hi87azqv11l8lq1rv0v9v88sl227g31snvkn8db6b4cfrwrxk";
   buildDepends = [ haskellSrcMeta mtl ];
   meta = {
     description = "Quasi-quoter for Happy parsers";
diff --git a/pkgs/development/tools/haskell/haskdogs/default.nix b/pkgs/development/tools/haskell/haskdogs/default.nix
index d67fb302d31..c05368c3980 100644
--- a/pkgs/development/tools/haskell/haskdogs/default.nix
+++ b/pkgs/development/tools/haskell/haskdogs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "haskdogs";
-  version = "0.3";
-  sha256 = "0aji59sazlhn5yardgrsdpf85fvb0mwn4bpslcjxr7mnmpa7j0kz";
+  version = "0.3.2";
+  sha256 = "0vl3c66ki9j9ncs2rapdn80kbfk0l3y97qwfraqlnjycdl10sm6r";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [ Cabal filepath HSH ];
diff --git a/pkgs/development/tools/haskell/hlint/default.nix b/pkgs/development/tools/haskell/hlint/default.nix
index bb61bbaa7dc..7b3953b0716 100644
--- a/pkgs/development/tools/haskell/hlint/default.nix
+++ b/pkgs/development/tools/haskell/hlint/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hlint";
-  version = "1.8.31";
-  sha256 = "0d7m7viqf1cawbafiy4nj67hkavlxkv537qypy2vlhr502fispa4";
+  version = "1.8.45";
+  sha256 = "14j77bjmdsxz5z0ka6mhnr2j29kpr5a39kbdq8ziga668wihdrz9";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -14,7 +14,7 @@ cabal.mkDerivation (self: {
   meta = {
     homepage = "http://community.haskell.org/~ndm/hlint/";
     description = "Source code suggestions";
-    license = "GPL";
+    license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
diff --git a/pkgs/development/tools/haskell/hslogger/default.nix b/pkgs/development/tools/haskell/hslogger/default.nix
index 4128f6b7d09..4443637def4 100644
--- a/pkgs/development/tools/haskell/hslogger/default.nix
+++ b/pkgs/development/tools/haskell/hslogger/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "hslogger";
-  version = "1.2.0";
-  sha256 = "17ipnz7zd403x2gi2086chrgcnk76304hdxr5mv4phg4rm8w226y";
+  version = "1.2.1";
+  sha256 = "1vfdf7i6fd4mb3rn57z3wn7bhw4z5g47f4vggb4sms5rg4zqqly5";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ mtl network time ];
diff --git a/pkgs/development/tools/haskell/jailbreak-cabal/default.nix b/pkgs/development/tools/haskell/jailbreak-cabal/default.nix
new file mode 100644
index 00000000000..ea61fd9b6ed
--- /dev/null
+++ b/pkgs/development/tools/haskell/jailbreak-cabal/default.nix
@@ -0,0 +1,16 @@
+{ cabal, Cabal }:
+
+cabal.mkDerivation (self: {
+  pname = "jailbreak-cabal";
+  version = "1.1";
+  sha256 = "0x0dkzfjsgqpjmldgami46ki9k7pgy7ll4slms0kdc89qryzp7dg";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ Cabal ];
+  meta = {
+    homepage = "http://github.com/peti/jailbreak-cabal";
+    description = "Strip version restrictions from build dependencies in Cabal files";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/keter/default.nix b/pkgs/development/tools/haskell/keter/default.nix
new file mode 100644
index 00000000000..f9d09abcc3f
--- /dev/null
+++ b/pkgs/development/tools/haskell/keter/default.nix
@@ -0,0 +1,28 @@
+{ cabal, attoparsec, blazeBuilder, caseInsensitive, conduit
+, dataDefault, filepath, hinotify, httpConduit, httpReverseProxy
+, httpTypes, mtl, network, networkConduit, networkConduitTls
+, random, regexTdfa, systemFileio, systemFilepath, tar, text, time
+, transformers, unixCompat, unixProcessConduit, wai, waiAppStatic
+, yaml, zlib
+}:
+
+cabal.mkDerivation (self: {
+  pname = "keter";
+  version = "0.3.6.1";
+  sha256 = "0jww64q74kx5h69mnv9wgc4kx0nlb06r7lf651gjkai8mf9dkqf2";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    attoparsec blazeBuilder caseInsensitive conduit dataDefault
+    filepath hinotify httpConduit httpReverseProxy httpTypes mtl
+    network networkConduit networkConduitTls random regexTdfa
+    systemFileio systemFilepath tar text time transformers unixCompat
+    unixProcessConduit wai waiAppStatic yaml zlib
+  ];
+  meta = {
+    homepage = "http://www.yesodweb.com/";
+    description = "Web application deployment manager, focusing on Haskell web frameworks";
+    license = self.stdenv.lib.licenses.mit;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/packunused/default.nix b/pkgs/development/tools/haskell/packunused/default.nix
new file mode 100644
index 00000000000..814c2774cb2
--- /dev/null
+++ b/pkgs/development/tools/haskell/packunused/default.nix
@@ -0,0 +1,16 @@
+{ cabal, Cabal, cmdargs, filepath, haskellSrcExts }:
+
+cabal.mkDerivation (self: {
+  pname = "packunused";
+  version = "0.1.0.0";
+  sha256 = "131x99id3jcxglj24p5sjb6mnhphj925pp4jdjy09y6ai7wss3rs";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ Cabal cmdargs filepath haskellSrcExts ];
+  meta = {
+    homepage = "https://github.com/hvr/packunused";
+    description = "Tool for detecting redundant Cabal package dependencies";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/splot/default.nix b/pkgs/development/tools/haskell/splot/default.nix
new file mode 100644
index 00000000000..4bd47b8decd
--- /dev/null
+++ b/pkgs/development/tools/haskell/splot/default.nix
@@ -0,0 +1,21 @@
+{ cabal, bytestringLexing, cairo, Chart, colour, HUnit, mtl
+, strptime, time, vcsRevision
+}:
+
+cabal.mkDerivation (self: {
+  pname = "splot";
+  version = "0.3.8";
+  sha256 = "188v9c070wn6gr47k5q55gsiph0lj96d96bss76gz7znknfj9rm3";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    bytestringLexing cairo Chart colour HUnit mtl strptime time
+    vcsRevision
+  ];
+  meta = {
+    homepage = "http://www.haskell.org/haskellwiki/Splot";
+    description = "A tool for visualizing the lifecycle of many concurrent multi-staged processes";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/tar/0.4.0.0.nix b/pkgs/development/tools/haskell/tar/0.4.0.0.nix
deleted file mode 100644
index 7f6b70a52e6..00000000000
--- a/pkgs/development/tools/haskell/tar/0.4.0.0.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{ cabal, filepath }:
-
-cabal.mkDerivation (self: {
-  pname = "tar";
-  version = "0.4.0.0";
-  sha256 = "04qijdfyiqb64q58g0bf46qfgaxqjl3kl68x6z31cv36p3hpplx3";
-  buildDepends = [ filepath ];
-  meta = {
-    description = "Reading, writing and manipulating \".tar\" archive files.";
-    license = self.stdenv.lib.licenses.bsd3;
-    platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
-  };
-})
diff --git a/pkgs/development/tools/haskell/threadscope/default.nix b/pkgs/development/tools/haskell/threadscope/default.nix
index f0d80e84c5a..4928c40e129 100644
--- a/pkgs/development/tools/haskell/threadscope/default.nix
+++ b/pkgs/development/tools/haskell/threadscope/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "threadscope";
-  version = "0.2.1";
-  sha256 = "08s9fbwg33rgbqjdx7n90q83livfay9khr2ddjwj8brw8k1wkmxg";
+  version = "0.2.2";
+  sha256 = "07cmza391hjq77lx8m9g2287bzsh5ffka3s07fr49v6x6hivsic3";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/development/tools/haskell/timeplot/default.nix b/pkgs/development/tools/haskell/timeplot/default.nix
new file mode 100644
index 00000000000..62a03cae14e
--- /dev/null
+++ b/pkgs/development/tools/haskell/timeplot/default.nix
@@ -0,0 +1,23 @@
+{ cabal, bytestringLexing, cairo, Chart, colour, dataAccessor
+, dataAccessorTemplate, regexTdfa, strptime, time, transformers
+, vcsRevision
+}:
+
+cabal.mkDerivation (self: {
+  pname = "timeplot";
+  version = "1.0.20";
+  sha256 = "0zlpqfd1l1ss9jjjb967a7jnn1h560ygv8zfiikcx6iagsjmysh2";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    bytestringLexing cairo Chart colour dataAccessor
+    dataAccessorTemplate regexTdfa strptime time transformers
+    vcsRevision
+  ];
+  meta = {
+    homepage = "http://haskell.org/haskellwiki/Timeplot";
+    description = "A tool for visualizing time series from log files";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+  };
+})
diff --git a/pkgs/development/tools/haskell/uuagc/cabal.nix b/pkgs/development/tools/haskell/uuagc/cabal.nix
index 24eded529b3..ea981ad423b 100644
--- a/pkgs/development/tools/haskell/uuagc/cabal.nix
+++ b/pkgs/development/tools/haskell/uuagc/cabal.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "uuagc-cabal";
-  version = "1.0.2.0";
-  sha256 = "0nvnyc6c1611rziglpp0ywqkgg9sgfi9ph33ya33k5zv3jxxh1q0";
+  version = "1.0.4.0";
+  sha256 = "0m6q8lfbrzcdxd923s175x0z1rnniv7gk08ninzpq16fisscr4lf";
   buildDepends = [ Cabal filepath mtl uulib ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/HUT/WebHome";
diff --git a/pkgs/development/tools/haskell/uuagc/default.nix b/pkgs/development/tools/haskell/uuagc/default.nix
index 833189b89ac..69c956ef1de 100644
--- a/pkgs/development/tools/haskell/uuagc/default.nix
+++ b/pkgs/development/tools/haskell/uuagc/default.nix
@@ -1,16 +1,12 @@
-{ cabal, filepath, haskellSrcExts, mtl, uuagcBootstrap, uuagcCabal
-, uulib
-}:
+{ cabal, filepath, haskellSrcExts, mtl, uuagcCabal, uulib }:
 
 cabal.mkDerivation (self: {
   pname = "uuagc";
-  version = "0.9.40.3";
-  sha256 = "053p7cbis843zn0qg8imc77xnfj4kna8wwfanxbj8kcapcqvwihl";
+  version = "0.9.42.3";
+  sha256 = "0rn0wqccg2v4akh3wj16s5y60fscdfjpvrpsmvbc2vfq2v33y53n";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [
-    filepath haskellSrcExts mtl uuagcBootstrap uuagcCabal uulib
-  ];
+  buildDepends = [ filepath haskellSrcExts mtl uuagcCabal uulib ];
   meta = {
     homepage = "http://www.cs.uu.nl/wiki/HUT/WebHome";
     description = "Attribute Grammar System of Universiteit Utrecht";
diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix
new file mode 100644
index 00000000000..f0c32fc0e9e
--- /dev/null
+++ b/pkgs/development/tools/jq/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="jq";
+    version="1.3";
+    name="${baseName}-${version}";
+    hash="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2";
+    url="http://stedolan.github.io/jq/download/source/jq-1.3.tar.gz";
+    sha256="1mzy9cj3d19y1m56mwk6slls543gnlhz8302hmnxkhdzdb1j6gv2";
+  };
+  buildInputs = [
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  meta = {
+    inherit (s) version;
+    description = ''A lightweight and flexible command-line JSON processor'';
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/tools/jq/default.upstream b/pkgs/development/tools/jq/default.upstream
new file mode 100644
index 00000000000..1ad914d717e
--- /dev/null
+++ b/pkgs/development/tools/jq/default.upstream
@@ -0,0 +1 @@
+url http://stedolan.github.io/jq/download/
diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix
index b11aba8ade7..25fa29526c9 100644
--- a/pkgs/development/tools/misc/autogen/default.nix
+++ b/pkgs/development/tools/misc/autogen/default.nix
@@ -1,16 +1,16 @@
-{ fetchurl, stdenv, guile, which }:
+{ fetchurl, stdenv, guile, which, libffi }:
 
-let version = "5.15"; in
+let version = "5.17"; in
 
   stdenv.mkDerivation {
     name = "autogen-${version}";
 
     src = fetchurl {
       url = "mirror://gnu/autogen/rel${version}/autogen-${version}.tar.gz";
-      sha256 = "8a37effa66d285471851e445d3bdeb60c0940f9efd7852828ebb8116e1c5cc1f";
+      sha256 = "065mg9gfb605wxbsk3inf93528ygcjgg6j8ml51691f6ghj363ff";
     };
 
-    buildInputs = [ guile which ];
+    buildInputs = [ guile which libffi ];
 
     patchPhase =
       '' for i in $(find -name \*.in)
@@ -22,7 +22,7 @@ let version = "5.15"; in
     # The tests rely on being able to find `libopts.a'.
     configureFlags = "--enable-static";
 
-    doCheck = true;
+    #doCheck = true; # 2 tests fail because of missing /dev/tty
 
     meta = {
       description = "GNU AutoGen, an automated text and program generation tool";
@@ -46,7 +46,7 @@ let version = "5.15"; in
         documentation of program options.
       '';
 
-      license = "GPLv3+";
+      licenses = ["GPLv3+" "LGPLv3+" ];
 
       homepage = http://www.gnu.org/software/autogen/;
 
diff --git a/pkgs/development/tools/misc/automake/automake-1.11.x.nix b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
index 7c9d06baa54..91c27deb8b8 100644
--- a/pkgs/development/tools/misc/automake/automake-1.11.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? true}:
+{ stdenv, fetchurl, perl, autoconf, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "automake-1.11.6";
@@ -19,8 +19,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [perl autoconf makeWrapper];
 
-  inherit doCheck;
-
   # Disable indented log output from Make, otherwise "make.test" will
   # fail.
   preCheck = "unset NIX_INDENT_MAKE";
diff --git a/pkgs/development/tools/misc/automake/automake-1.12.x.nix b/pkgs/development/tools/misc/automake/automake-1.12.x.nix
index e2db84d2fc3..bd609c4a40d 100644
--- a/pkgs/development/tools/misc/automake/automake-1.12.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.12.x.nix
@@ -1,7 +1,7 @@
-{stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? true}:
+{ stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? false }:
 
 stdenv.mkDerivation rec {
-  name = "automake-1.12.2";
+  name = "automake-1.12.4";
 
   # TODO: Remove the `aclocal' wrapper when $ACLOCAL_PATH support is
   # available upstream; see
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/automake/${name}.tar.xz";
-    sha256 = "5fb56e918189b377a22368e19baaf70252bd85a9969ed5f8a8373f49e8faf07f";
+    sha256 = "0wppdm0wfizs6nmiwlkigcmh2pn33dywdkl7b407j3pvwn622vsi";
   };
 
   buildInputs = [perl autoconf makeWrapper];
diff --git a/pkgs/development/tools/misc/automake/automake-1.13.x.nix b/pkgs/development/tools/misc/automake/automake-1.13.x.nix
new file mode 100644
index 00000000000..3556b4f47aa
--- /dev/null
+++ b/pkgs/development/tools/misc/automake/automake-1.13.x.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? false }:
+
+stdenv.mkDerivation rec {
+  name = "automake-1.13.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/automake/${name}.tar.xz";
+    sha256 = "12yi1bzkipi7qdmkdy77pazljsa9z7q66hi6c4rq73p7hbv6rkbf";
+  };
+
+  buildInputs = [ perl autoconf ];
+
+  setupHook = ./setup-hook.sh;
+
+  # Disable indented log output from Make, otherwise "make.test" will
+  # fail.
+  preCheck = "unset NIX_INDENT_MAKE";
+  inherit doCheck;
+
+  # The test suite can run in parallel.
+  enableParallelBuilding = true;
+
+  # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
+  # "fixed" path in generated files!
+  dontPatchShebangs = true;
+
+  meta = {
+    homepage = "http://www.gnu.org/software/automake/";
+    description = "GNU Automake, a GNU standard-compliant makefile generator";
+    license = "GPLv2+";
+
+    longDescription = ''
+      GNU Automake is a tool for automatically generating
+      `Makefile.in' files compliant with the GNU Coding
+      Standards.  Automake requires the use of Autoconf.
+    '';
+
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/development/tools/misc/automake/default.nix b/pkgs/development/tools/misc/automake/default.nix
deleted file mode 100644
index c37a829e3bc..00000000000
--- a/pkgs/development/tools/misc/automake/default.nix
+++ /dev/null
@@ -1 +0,0 @@
-import ./automake-1.10.x.nix
diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix
index 353cd9f40bc..e1afceebaa2 100644
--- a/pkgs/development/tools/misc/binutils/default.nix
+++ b/pkgs/development/tools/misc/binutils/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, noSysDirs, zlib, cross ? null, gold ? false, bison ? null, flex2535 ? null, bc ? null, dejagnu ? null }:
 
-let basename = "binutils-2.21.1a"; in
+let basename = "binutils-2.23.1"; in
 stdenv.mkDerivation rec {
   name = basename + stdenv.lib.optionalString (cross != null) "-${cross.config}";
 
   src = fetchurl {
     url = "mirror://gnu/binutils/${basename}.tar.bz2";
-    sha256 = "0m7nmd7gc9d9md43wbrv65hz6lbi2crqwryzpigv19ray1lzmv6d";
+    sha256 = "06bs5v5ndb4g5qx96d52lc818gkbskd1m0sz57314v887sqfbcia";
   };
 
   patches = [
@@ -14,11 +14,16 @@ stdenv.mkDerivation rec {
     # RUNPATH instead of RPATH on binaries.  This is important because
     # RUNPATH can be overriden using LD_LIBRARY_PATH at runtime.
     ./new-dtags.patch
+
+    # Since binutils 2.22, DT_NEEDED flags aren't copied for dynamic outputs.
+    # That requires upstream changes for things to work. So we can patch it to
+    # get the old behaviour by now.
+    ./dtneeded.patch
   ];
 
   buildInputs =
     [ zlib ]
-    ++ stdenv.lib.optional gold [dejagnu flex2535 bison /* Some Gold tests require this: */ bc];
+    ++ stdenv.lib.optional gold bison;
 
   inherit noSysDirs;
 
diff --git a/pkgs/development/tools/misc/binutils/dtneeded.patch b/pkgs/development/tools/misc/binutils/dtneeded.patch
new file mode 100644
index 00000000000..3754ec569ee
--- /dev/null
+++ b/pkgs/development/tools/misc/binutils/dtneeded.patch
@@ -0,0 +1,12 @@
+diff --git a/ld/ldmain.c b/ld/ldmain.c
+index 15f8ebf..f71241e 100644
+--- a/ld/ldmain.c
++++ b/ld/ldmain.c
+@@ -298,6 +298,7 @@ main (int argc, char **argv)
+   lang_init ();
+   ldemul_before_parse ();
+   lang_has_input_file = FALSE;
++  input_flags.add_DT_NEEDED_for_dynamic = TRUE;
+   parse_args (argc, argv);
+ 
+   if (config.hash_table_size != 0)
diff --git a/pkgs/development/tools/misc/cflow/default.nix b/pkgs/development/tools/misc/cflow/default.nix
index 041191640bd..d9be5802fa9 100644
--- a/pkgs/development/tools/misc/cflow/default.nix
+++ b/pkgs/development/tools/misc/cflow/default.nix
@@ -15,11 +15,10 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ gettext ] ++
-
     # We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
     stdenv.lib.optional
       (! (stdenv.lib.lists.any (x: stdenv.system == x)
-              [ "i686-darwin" "i686-cygwin" ]))
+              [ "i686-cygwin" ]))
       emacs;
 
   doCheck = true;
diff --git a/pkgs/development/tools/misc/coccinelle/default.nix b/pkgs/development/tools/misc/coccinelle/default.nix
index 0b5fa4b8d61..d31e2ec5f3b 100644
--- a/pkgs/development/tools/misc/coccinelle/default.nix
+++ b/pkgs/development/tools/misc/coccinelle/default.nix
@@ -1,9 +1,9 @@
-{ fetchurl, stdenv, python, ncurses, ocamlPackages, makeWrapper }:
+{ fetchurl, stdenv, python, ncurses, ocamlPackages, pkgconfig, makeWrapper }:
 
 let
 
-  name = "coccinelle-1.0.0-rc12";
-  sha256 = "03b8930a53623ec79dc2486e9b6a569e373958cf46074c5f1d0028c70708498d";
+  name = "coccinelle-1.0.0-rc15";
+  sha256 = "07fab4e17512925b958890bb13c0809797074f2e44a1107b0074bdcc156b9596";
 
 in stdenv.mkDerivation {
   inherit name;
@@ -15,12 +15,15 @@ in stdenv.mkDerivation {
 
   buildInputs = with ocamlPackages; [
     ocaml findlib menhir
-    ocaml_pcre ocaml_sexplib pycaml
-    python ncurses makeWrapper
+    ocaml_pcre pycaml
+    python ncurses pkgconfig
+    makeWrapper
   ];
 
-  configureFlagsArray = [ "--enable-release" ];
-
+  # TODO: is the generation of this wrapper truly/still needed?
+  # I don't have a non-NixOS system, so I cannot verify this, but shouldn't
+  # libpython know where to find its modules? (the path is for example in
+  # its Sys-module).
   postInstall =
     # On non-NixOS systems, Coccinelle would end up looking up Python modules
     # in the wrong directory.
@@ -31,6 +34,8 @@ in stdenv.mkDerivation {
        done
     '';
 
+  configureFlags = "--enable-release";
+
   meta = {
     description = "Coccinelle, a program to apply C code semantic patches";
 
diff --git a/pkgs/development/tools/misc/cpphs/default.nix b/pkgs/development/tools/misc/cpphs/default.nix
index 4fbce76474c..2e419f67eb0 100644
--- a/pkgs/development/tools/misc/cpphs/default.nix
+++ b/pkgs/development/tools/misc/cpphs/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "cpphs";
-  version = "1.14";
-  sha256 = "1lscgylcbbny60lx36xwm8y22jmbv23159pfn8n87kbskq6cpk0z";
+  version = "1.16";
+  sha256 = "1fv91s3h2s76h1hadb3mmnkg0rrfakmbfsrw6q522kshvpk2wmmp";
   isLibrary = true;
   isExecutable = true;
   meta = {
diff --git a/pkgs/development/tools/misc/cppi/default.nix b/pkgs/development/tools/misc/cppi/default.nix
index 0ae8b8c76c5..f9246df9e56 100644
--- a/pkgs/development/tools/misc/cppi/default.nix
+++ b/pkgs/development/tools/misc/cppi/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "cppi-1.16";
+  name = "cppi-1.18";
 
   src = fetchurl {
     url = "mirror://gnu/cppi/${name}.tar.xz";
-    sha256 = "16i4j80wam7p189xc9i2ijrcgjn684296rym6ja3nlqv8rv90lm8";
+    sha256 = "1jk42cjaggk71rimjnx3qpmb6hivps0917vl3z7wbxk3i2whb98j";
   };
 
   doCheck = true;
diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix
index b9d2c10f537..3a83b1ba325 100644
--- a/pkgs/development/tools/misc/cscope/default.nix
+++ b/pkgs/development/tools/misc/cscope/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = "--with-ncurses=${ncurses}";
 
   buildInputs = [ ncurses ];
-  buildNativeInputs = [ pkgconfig emacs ];
+  nativeBuildInputs = [ pkgconfig emacs ];
 
   postInstall = ''
     # Install Emacs mode.
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   crossAttrs = {
     postInstall = "";
-    propagatedBuildInputs = [ ncurses.hostDrv ];
+    propagatedBuildInputs = [ ncurses.crossDrv ];
   };
 
   meta = {
diff --git a/pkgs/development/tools/misc/ctags/default.nix b/pkgs/development/tools/misc/ctags/default.nix
index 57718088080..80def733cf8 100644
--- a/pkgs/development/tools/misc/ctags/default.nix
+++ b/pkgs/development/tools/misc/ctags/default.nix
@@ -1,24 +1,26 @@
-{stdenv, fetchurl, sourceFromHead, automake, autoconf}:
+{ stdenv, fetchsvn, automake, autoconf}:
 
 stdenv.mkDerivation rec {
-  name = "ctags-svn";
-  # REGION AUTO UPDATE:      { name="ctags"; type = "svn"; url = "https://ctags.svn.sourceforge.net/svnroot/ctags/trunk"; }
-  src= sourceFromHead "ctags-749.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/ctags-749.tar.gz"; sha256 = "01dd4bf2e55dbedc38def81febef60eece912cb7624df1c0a2cf1ed6e4bc4ecf"; });
-  # END
+  name = "ctags-${revision}";
+  revision = "804";
 
-  preConfigure = ''
-    autoheader
-    autoconf
-  '';
+  src = fetchsvn {
+    url = "http://ctags.svn.sourceforge.net/svnroot/ctags/trunk";
+    rev = revision;
+    sha256 = "16gln1mah2jqp32ki1z0187dwkbjx1xcnmyiardcq6c9w3p4qwcr";
+  };
 
   buildInputs = [ automake autoconf ];
 
+  preConfigure = "autoreconf -i";
+
   # don't use $T(E)MP which is set to the build directory
   configureFlags="--enable-tmpdir=/tmp";
 
   meta = {
+    homepage = "http://ctags.sourceforge.net/";
     description = "Exuberant Ctags, a tool for fast source code browsing";
+    license = stdenv.lib.licenses.gpl2Plus;
 
     longDescription = ''
       Ctags generates an index (or tag) file of language objects found
@@ -29,9 +31,8 @@ stdenv.mkDerivation rec {
       programming languages are supported.
     '';
 
-    homepage = http://ctags.sourceforge.net/;
-
-    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 
 }
diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix
index a46c7a695f2..565d7835f05 100644
--- a/pkgs/development/tools/misc/distcc/default.nix
+++ b/pkgs/development/tools/misc/distcc/default.nix
@@ -1,46 +1,77 @@
-{ stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk
+{ stdenv, fetchurl, popt, avahi, pkgconfig, python, gtk, runCommand, gcc
 , sysconfDir ? ""   # set this parameter to override the default value $out/etc
 , static ? false
 }:
 
-let name    = "distcc";
-    version = "3.1";
-in
+let
+  name    = "distcc";
+  version = "3.1";
+  distcc = stdenv.mkDerivation {
+    name = "${name}-${version}";
+    src = fetchurl {
+      url = "http://distcc.googlecode.com/files/${name}-${version}.tar.bz2";
+      sha256 = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89";
+    };
 
-stdenv.mkDerivation {
-  name = "${name}-${version}";
-  src = fetchurl {
-    url = "http://distcc.googlecode.com/files/${name}-${version}.tar.bz2";
-    sha256 = "f55dbafd76bed3ce57e1bbcdab1329227808890d90f4c724fcd2d53f934ddd89";
-  };
+    buildInputs = [popt avahi pkgconfig python gtk];
+    preConfigure =
+    ''
+      configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
+                            CXXFLAGS="-O2 -fno-strict-aliasing"
+          --mandir=$out/share/man
+                            ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
+                            ${if static then "LDFLAGS=-static" else ""}
+                            --with${if static == true || popt == null then "" else "out"}-included-popt
+                            --with${if avahi != null then "" else "out"}-avahi
+                            --with${if gtk != null then "" else "out"}-gtk
+                            --without-gnome
+                            --enable-rfc2553
+                            --disable-Werror   # a must on gcc 4.6
+                           )
+      installFlags="sysconfdir=$out/etc";
+    '';
+    patches = [ ./20-minute-io-timeout.patch ];
 
-  buildInputs = [popt avahi pkgconfig python gtk];
-  preConfigure =
-  ''
-    configureFlagsArray=( CFLAGS="-O2 -fno-strict-aliasing"
-                          CXXFLAGS="-O2 -fno-strict-aliasing"
-			  --mandir=$out/share/man
-                          ${if sysconfDir == "" then "" else "--sysconfdir=${sysconfDir}"}
-                          ${if static then "LDFLAGS=-static" else ""}
-                          --with${if static == true || popt == null then "" else "out"}-included-popt
-                          --with${if avahi != null then "" else "out"}-avahi
-                          --with${if gtk != null then "" else "out"}-gtk
-                          --without-gnome
-                          --enable-rfc2553
-                         )
-    installFlags="sysconfdir=$out/etc";
-  '';
-  patches = [ ./20-minute-io-timeout.patch ];
+    # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
+    doCheck = false;
 
-  # The test suite fails because it uses hard-coded paths, i.e. /usr/bin/gcc.
-  doCheck = false;
+    passthru = {
+      # A derivation that provides gcc and g++ commands, but that
+      # will end up calling distcc for the given cacheDir
+      #
+      # extraConfig is meant to be sh lines exporting environment
+      # variables like DISTCC_HOSTS, DISTCC_DIR, ...
+      links = extraConfig : (runCommand "distcc-links"
+          { inherit (gcc) langC langCC; }
+        ''
+          mkdir -p $out/bin
+          if [ $langC -eq 1 ]; then
+            cat > $out/bin/gcc << EOF
+            #!/bin/sh
+            ${extraConfig}
+            exec ${distcc}/bin/distcc gcc "\$@"
+          EOF
+            chmod +x $out/bin/gcc
+          fi
+          if [ $langCC -eq 1 ]; then
+            cat > $out/bin/g++ << EOF
+            #!/bin/sh
+            ${extraConfig}
+            exec ${distcc}/bin/distcc g++ "\$@"
+          EOF
+            chmod +x $out/bin/g++
+          fi
+        '');
+    };
 
-  meta = {
-    description = "a fast, free distributed C/C++ compiler";
-    homepage = "http://distcc.org";
-    license = "GPL";
+    meta = {
+      description = "a fast, free distributed C/C++ compiler";
+      homepage = "http://distcc.org";
+      license = "GPL";
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+      platforms = stdenv.lib.platforms.linux;
+      maintainers = [ stdenv.lib.maintainers.simons ];
+    };
   };
-}
+in
+  distcc
diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix
new file mode 100644
index 00000000000..117480670c3
--- /dev/null
+++ b/pkgs/development/tools/misc/distcc/masq.nix
@@ -0,0 +1,41 @@
+{ stdenv, gccRaw, binutils }:
+
+stdenv.mkDerivation {
+  name = "distcc-masq-${gccRaw.name}";
+
+  phases = [ "installPhase" ];
+  installPhase = ''
+    ensureDir $out/bin
+
+    bin=${gccRaw}/bin
+
+    shopt -s nullglob
+    if [ -f $bin/gcc ]; then
+      ln -s $bin/gcc $out/bin
+    else
+      for a in $bin/*-gcc; do
+        ln -s $bin/*-gcc $out/bin/gcc
+        ln -s $bin/*-gcc $out/bin/cc
+      done
+    fi
+
+    if [ -f $bin/g++ ]; then
+      ln -s $bin/g++ $out/bin
+    else
+      for a in $bin/*-g++; do
+        ln -sf $bin/*-g++ $out/bin/g++
+        ln -sf $bin/*-g++ $out/bin/c++
+      done
+    fi
+
+    bbin=${binutils}/bin
+    if [ -f $bbin/as ]; then
+      ln -s $bbin/as $out/bin
+    else
+      for a in $bbin/*-as; do
+        ln -sf $bbin/*-as $out/bin/as
+      done
+    fi
+    
+  '';
+}
diff --git a/pkgs/development/tools/misc/elfutils/default.nix b/pkgs/development/tools/misc/elfutils/default.nix
index 61b4647552d..526a66e0280 100644
--- a/pkgs/development/tools/misc/elfutils/default.nix
+++ b/pkgs/development/tools/misc/elfutils/default.nix
@@ -21,14 +21,16 @@ stdenv.mkDerivation rec {
 
   # We need bzip2 in NativeInputs because otherwise we can't unpack the src,
   # as the host-bzip2 will be in the path.
-  buildNativeInputs = [m4 bison flex gettext bzip2];
+  nativeBuildInputs = [m4 bison flex gettext bzip2];
   buildInputs = [zlib bzip2];
 
+  configureFlags = "--disable-werror";
+
   crossAttrs = {
 
-    /* Having bzip2 will harm, because anything using elfutils 
+    /* Having bzip2 will harm, because anything using elfutils
        as buildInput cross-building, will not be able to run 'bzip2' */
-    propagatedBuildInputs = [ zlib.hostDrv ];
+    propagatedBuildInputs = [ zlib.crossDrv ];
 
     # This program does not cross-build fine. So I only cross-build some parts
     # I need for the linux perf tool.
@@ -64,7 +66,7 @@ stdenv.mkDerivation rec {
       cp version.h $out/include
     '';
   };
-  
+
   dontAddDisableDepTrack = true;
 
   meta = {
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index 08fde14eb53..45bd988a471 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -8,11 +8,11 @@
 
 let
 
-  basename = "gdb-7.5";
+  basename = "gdb-7.6";
 
   # Whether (cross-)building for GNU/Hurd.  This is an approximation since
-  # having `stdenv ? cross' doesn't tell us if we're building `hostDrv' and
-  # `buildDrv'.
+  # having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
+  # `nativeDrv'.
   isGNU =
       stdenv.system == "i686-gnu"
       || (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
@@ -27,12 +27,12 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnu/gdb/${basename}.tar.bz2";
-    md5 = "24a6779a9fe0260667710de1b082ef61";
+    md5 = "fda57170e4d11cdde74259ca575412a8";
   };
 
   # I think python is not a native input, but I leave it
   # here while I will not need it cross building
-  buildNativeInputs = [ texinfo python ]
+  nativeBuildInputs = [ texinfo python ]
     ++ stdenv.lib.optional isGNU mig;
 
   buildInputs = [ ncurses readline gmp mpfr expat ]
@@ -51,8 +51,8 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     # Do not add --with-python here to avoid cross building it.
     configureFlags =
-      '' --with-gmp=${gmp.hostDrv} --with-mpfr=${mpfr.hostDrv} --with-system-readline
-         --with-expat --with-libexpat-prefix=${expat.hostDrv} --without-python
+      '' --with-gmp=${gmp.crossDrv} --with-mpfr=${mpfr.crossDrv} --with-system-readline
+         --with-expat --with-libexpat-prefix=${expat.crossDrv} --without-python
       '' + stdenv.lib.optionalString (target != null)
          " --target=${target.config}";
   };
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index 1f026f12f52..d1b0d0e376e 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     && !stdenv.isSunOS;                    # XXX: `test-setlocale2.sh' fails
 
   # Upstream is aware of it; it may be in the next release.
-  patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ];
+  patches = [ ./s_isdir.patch ./readlink-EINVAL.patch ./no-gets.patch ];
 
   meta = {
     homepage = http://www.gnu.org/software/m4/;
diff --git a/pkgs/development/tools/misc/gnum4/no-gets.patch b/pkgs/development/tools/misc/gnum4/no-gets.patch
new file mode 100644
index 00000000000..456c08b56c3
--- /dev/null
+++ b/pkgs/development/tools/misc/gnum4/no-gets.patch
@@ -0,0 +1,26 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-devel/m4/files/m4-1.4.16-no-gets.patch?revision=1.1
+
+https://bugs.gentoo.org/424978
+
+hack until m4 pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/development/tools/misc/gob2/default.nix b/pkgs/development/tools/misc/gob2/default.nix
index 4308a559268..c86a65f33b6 100644
--- a/pkgs/development/tools/misc/gob2/default.nix
+++ b/pkgs/development/tools/misc/gob2/default.nix
@@ -1,10 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, glib, bison, flex }:
+{ stdenv, fetchurl_gnome, pkgconfig, glib, bison, flex }:
 
 stdenv.mkDerivation rec {
-  name = "gob2-2.0.18";
+  name = src.pkgname;
 
-  src = fetchurl {
-    url = "http://ftp.5z.com/pub/gob/${name}.tar.gz";
+  src = fetchurl_gnome {
+    project = "gob2";
+    major = "2"; minor = "0"; patchlevel = "18"; extension = "gz";
     sha256 = "1r242s3rsxyqiw2ic2gdpvvrx903jgjd1aa4mkl26in5k9zk76fa";
   };
 
diff --git a/pkgs/development/tools/misc/intltool/default.nix b/pkgs/development/tools/misc/intltool/default.nix
new file mode 100644
index 00000000000..0ca8b6eb071
--- /dev/null
+++ b/pkgs/development/tools/misc/intltool/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, perl, perlXMLParser}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="intltool";
+    version="0.50.2";
+    name="intltool-0.50.2";
+    hash="01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7";
+    url="https://launchpad.net/intltool/trunk/0.50.2/+download/intltool-0.50.2.tar.gz";
+    sha256="01j4yd7i84n9nk4ccs6yifg84pp68nr9by57jdbhj7dpdxf5rwk7";
+  };
+  propagatedBuildInputs = [perl perlXMLParser];
+  buildInputs = [];
+  in
+stdenv.mkDerivation rec {
+  inherit (s) name version;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  inherit propagatedBuildInputs buildInputs;
+
+  meta = {
+    description = "Translation helper tool";
+    homepage = "http://launchpad.net/intltool/";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    inherit (s) version;
+  };
+}
diff --git a/pkgs/development/tools/misc/intltool/default.upstream b/pkgs/development/tools/misc/intltool/default.upstream
new file mode 100644
index 00000000000..4a2965b036a
--- /dev/null
+++ b/pkgs/development/tools/misc/intltool/default.upstream
@@ -0,0 +1,2 @@
+attribute_name intltool_standalone
+url https://launchpad.net/intltool/+download
diff --git a/pkgs/development/tools/misc/itstool/default.nix b/pkgs/development/tools/misc/itstool/default.nix
index 2b85260e82a..f97404f7a01 100644
--- a/pkgs/development/tools/misc/itstool/default.nix
+++ b/pkgs/development/tools/misc/itstool/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, python, libxml2Python }:
 
 stdenv.mkDerivation rec {
-  name = "itstool-1.1.1";
+  name = "itstool-1.2.0";
 
   src = fetchurl {
     url = "http://files.itstool.org/itstool/${name}.tar.bz2";
-    sha256 = "1jchgcgxvqwkhr61q0j08adl1k8hw86dzbl207gzmns9fa7vmzqg";
+    sha256 = "1akq75aflihm3y7js8biy7b5mw2g11vl8yq90gydnwlwp0zxdzj6";
   };
 
   buildInputs = [ python ];
-  
+
   patchPhase =
     ''
       sed -e '/import libxml2/i import sys\
diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix
index 544434634a5..0252750bf12 100644
--- a/pkgs/development/tools/misc/libtool/libtool2.nix
+++ b/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0649qfpzkswgcj9vqkkr9rn4nlcx80faxpyqscy2k1x9c94f93dk";
   };
 
-  buildNativeInputs = [ lzma m4 perl ];
+  nativeBuildInputs = [ lzma m4 perl ];
 
   outputs = [ "out" "lib" ];
 
diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix
index a7d5ad0e393..bdd35dc50f0 100644
--- a/pkgs/development/tools/misc/lsof/default.nix
+++ b/pkgs/development/tools/misc/lsof/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "lsof-4.86";
+  name = "lsof-4.87";
 
   src = fetchurl {
-    url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_4.86.tar.bz2;
-    sha256 = "13e52b8e87dddf1b2e219004e315d755c659217ce6ffc6a5f1102969f1c4dd0c";
+    url = ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_4.87.tar.bz2;
+    sha256 = "0b6si72sml7gr9784ak491cxxbm9mx5bh174yg6rrirbv04kgpfz";
   };
 
   unpackPhase = "tar xvjf $src; cd lsof_*; tar xvf lsof_*.tar; sourceRoot=$( echo lsof_*/); ";
diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix
new file mode 100644
index 00000000000..da44a7d73a5
--- /dev/null
+++ b/pkgs/development/tools/misc/luarocks/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, lua, curl}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="luarocks";
+    version="2.0.13";
+    name="${baseName}-${version}";
+    hash="1cpdi61dwcc2i4bwrn7bb8fibkd1s75jrr0bjcbs8p76rn6hkb2y";
+    url="http://luarocks.org/releases/luarocks-2.0.13-rc1.tar.gz";
+    sha256="1cpdi61dwcc2i4bwrn7bb8fibkd1s75jrr0bjcbs8p76rn6hkb2y";
+  };
+  buildInputs = [
+    lua curl
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  meta = {
+    inherit (s) version;
+    description = ''A package manager for Lua'';
+    license = stdenv.lib.licenses.mit ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/tools/misc/luarocks/default.upstream b/pkgs/development/tools/misc/luarocks/default.upstream
new file mode 100644
index 00000000000..e69de1fe889
--- /dev/null
+++ b/pkgs/development/tools/misc/luarocks/default.upstream
@@ -0,0 +1 @@
+url http://luarocks.org/releases/
diff --git a/pkgs/development/tools/misc/openocd/default.nix b/pkgs/development/tools/misc/openocd/default.nix
index 4b01c9d33e8..c87bd9d5535 100644
--- a/pkgs/development/tools/misc/openocd/default.nix
+++ b/pkgs/development/tools/misc/openocd/default.nix
@@ -1,41 +1,24 @@
-{stdenv, fetchurl, libftdi}:
+{stdenv, fetchurl, libftdi, libusb1 }:
 
-let
-  # The "GuruPlug installer" from Marvell.  See
-  # <http://www.plugcomputer.org/index.php/us/resources/downloads?func=select&id=16>,
-  # linked from <http://www.globalscaletechnologies.com/t-downloads.aspx>.
-  guruplug_installer = fetchurl {
-    url = "http://www.plugcomputer.org/index.php/us/resources/downloads?func=download&id=65&chk=d6878f4bf86070f7b4f7bc93317fcb0f&no_html=1";
-    sha256 = "1nps9li9k1kxb31f9x6d114hh0a3bx886abvgh8vg004ni996hlv";
-    name = "guruplug-installer.tar.gz";
-  };
-in
-stdenv.mkDerivation {
-  name = "openocd-0.4.0";
+stdenv.mkDerivation rec {
+  name = "openocd-${version}";
+  version = "0.7.0";
 
   src = fetchurl {
-    url = "http://download.berlios.de/openocd/openocd-0.4.0.tar.bz2";
-    sha256 = "1c9j8s3mqgw5spv6nd4lqfkd1l9jmjipi0ya054vnjfsy2617kzv";
+    url = "http://downloads.sourceforge.net/project/openocd/openocd/${version}/openocd-${version}.tar.bz2";
+    sha256 = "0qwfyd821sy5p0agz0ybgn5nd7vplipw4mhm485ldj1hcmw7n8sj";
   };
 
-  configureFlags = [ "--enable-ft2232_libftdi" "--disable-werror" ];
-
-  buildInputs = [ libftdi ];
+  configureFlags = [ "--enable-ft2232_libftdi"
+                     "--enable-jlink"
+                     "--enable-rlink"
+                     "--enable-ulink"
+                     "--enable-stlink" ];
 
-  # Copy the GuruPlug stuff.
-  # XXX: Unfortunately, these files were written for OpenOCD 0.2.0 and don't
-  # work with 0.4.0.
-  # postInstall =
-  #   '' tar xf "${guruplug_installer}"
-  #      for dir in interface target board
-  #      do
-  #        cp -v "guruplug-installer/openocd/$dir/"* \
-  #              "$out/share/openocd/scripts/$dir/"
-  #      done
-  #   '';
+  buildInputs = [ libftdi libusb1 ];
 
   meta = {
-    homepage = http://openocd.berlios.de;
+    homepage = http://openocd.sourceforge.net/;
     description = "OpenOCD, an on-chip debugger";
 
     longDescription =
@@ -49,7 +32,7 @@ stdenv.mkDerivation {
       '';
 
     license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [ viric bjornfor ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/tools/misc/premake/3.nix b/pkgs/development/tools/misc/premake/3.nix
new file mode 100644
index 00000000000..94a2880e134
--- /dev/null
+++ b/pkgs/development/tools/misc/premake/3.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, unzip}:
+
+let baseName = "premake";
+  version  = "3.7";
+in
+
+stdenv.mkDerivation {
+  name = "${baseName}-${version}";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/sourceforge/premake/${baseName}-src-${version}.zip";
+    sha256 = "b59841a519e75d5b6566848a2c5be2f91455bf0cc6ae4d688fcbd4c40db934d5";
+  };
+
+  buildInputs = [unzip];
+
+  installPhase = ''
+    install -Dm755 bin/premake $out/bin/premake
+  '';
+
+  meta = {
+    homepage = http://industriousone.com/premake;
+    description = "A simple build configuration and project generation tool using lua";
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/development/tools/misc/premake/default.nix b/pkgs/development/tools/misc/premake/default.nix
index 4f534bd8664..8dce23aa959 100644
--- a/pkgs/development/tools/misc/premake/default.nix
+++ b/pkgs/development/tools/misc/premake/default.nix
@@ -1,26 +1,32 @@
 {stdenv, fetchurl, unzip}:
 
 let baseName = "premake";
-    version  = "3.7";
+  version  = "4.3";
 in
 
 stdenv.mkDerivation {
   name = "${baseName}-${version}";
 
   src = fetchurl {
-    url = "http://downloads.sourceforge.net/sourceforge/premake/${baseName}-src-${version}.zip";
-    sha256 = "b59841a519e75d5b6566848a2c5be2f91455bf0cc6ae4d688fcbd4c40db934d5";
+    url = "mirror://sourceforge/${baseName}/${baseName}-${version}-src.zip";
+    sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn";
   };
 
   buildInputs = [unzip];
 
+  buildPhase = ''
+    make -C build/gmake.unix/
+  '';
+
   installPhase = ''
-    install -Dm755 bin/premake $out/bin/premake
+    install -Dm755 bin/release/premake4 $out/bin/premake4
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://industriousone.com/premake;
     description = "A simple build configuration and project generation tool using lua";
     license = stdenv.lib.licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
   };
 }
diff --git a/pkgs/development/tools/misc/saleae-logic/default.nix b/pkgs/development/tools/misc/saleae-logic/default.nix
new file mode 100644
index 00000000000..8fcf254e8ca
--- /dev/null
+++ b/pkgs/development/tools/misc/saleae-logic/default.nix
@@ -0,0 +1,91 @@
+# Saleae logic analyzer software
+#
+# Suggested udev rules to be able to access the Logic device without being root:
+#   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="0925", ATTR{idProduct}=="3881", MODE="0666"
+#   SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="21a9", ATTR{idProduct}=="1001", MODE="0666"
+
+{ stdenv, fetchurl, unzip, glib, libSM, libICE, gtk, libXext, libXft
+, fontconfig, libXrender, libXfixes, libX11, libXi, libXrandr, libXcursor
+, freetype, libXinerama
+, makeDesktopItem
+}:
+
+let
+
+  libPath = stdenv.lib.makeLibraryPath [
+    glib libSM libICE gtk libXext libXft fontconfig libXrender libXfixes libX11
+    libXi libXrandr libXcursor freetype libXinerama
+  ];
+
+in
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  pname = "saleae-logic";
+  version = "1.1.15";
+  name = "${pname}-${version}";
+
+  src =
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+	name = "saleae-logic-${version}-32bit.zip";
+	url = "http://downloads.saleae.com/Logic%20${version}%20(32-bit).zip";
+	sha256 = "0h13my4xgv8v8l12shimhhn54nn0dldbxz1gpbx92ysd8q8x1q79";
+      }
+    else if stdenv.system == "x86_64-linux" then
+      fetchurl {
+	name = "saleae-logic-${version}-64bit.zip";
+	url = "http://downloads.saleae.com/Logic%20${version}%20(64-bit).zip";
+	sha256 = "1phnjsmaj1gflx7shh8wfrd8dnhn43s3v7bck41h8yj4nd4ax69z";
+      }
+    else
+      abort "Saleae Logic software requires i686-linux or x86_64-linux";
+
+  desktopItem = makeDesktopItem {
+    name = "saleae-logic";
+    exec = "saleae-logic";
+    icon = ""; # the package contains no icon
+    comment = "Software for Saleae logic analyzers";
+    desktopName = "Saleae Logic";
+    genericName = "Logic analyzer";
+    categories = "Application;Development";
+  };
+
+  buildInputs = [ unzip ];
+
+  installPhase = ''
+    # Copy prebuilt app to $out
+    mkdir "$out"
+    cp -r * "$out"
+
+    # Patch it
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" "$out/Logic"
+    patchelf --set-rpath "${stdenv.gcc.gcc}/lib:${stdenv.gcc.gcc}/lib64:${libPath}:\$ORIGIN/Analyzers:\$ORIGIN" "$out/Logic"
+
+    # Build the LD_PRELOAD library that makes Logic work from a read-only directory
+    mkdir -p "$out/lib"
+    gcc -shared -fPIC -DOUT=\"$out\" "${./preload.c}" -o "$out/lib/preload.so" -ldl
+
+    # Make wrapper script that uses the LD_PRELOAD library
+    mkdir -p "$out/bin"
+    cat > "$out/bin/saleae-logic" << EOF
+    #!${stdenv.shell}
+    export LD_PRELOAD="$out/lib/preload.so"
+    exec "$out/Logic" "\$@"
+    EOF
+    chmod a+x "$out"/bin/saleae-logic
+
+    # Copy the generated .desktop file
+    mkdir -p "$out/share/applications"
+    cp "$desktopItem"/share/applications/* "$out/share/applications/"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software for Saleae logic analyzers";
+    homepage = http://www.saleae.com/;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/development/tools/misc/saleae-logic/preload.c b/pkgs/development/tools/misc/saleae-logic/preload.c
new file mode 100644
index 00000000000..6b3632db97b
--- /dev/null
+++ b/pkgs/development/tools/misc/saleae-logic/preload.c
@@ -0,0 +1,114 @@
+/*
+ * LD_PRELOAD trick to make Saleae Logic work from a read-only installation
+ * directory.
+ *
+ * Saleae Logic tries to write to the ./Settings/settings.xml file, relative to
+ * its installation directory. Because the nix store is read-only, we have to
+ * redirect access to this file somewhere else. Here's the map:
+ *
+ *   $out/Settings/settings.xml => $HOME/.saleae-logic-settings.xml
+ *
+ * This also makes the software multi-user aware :-)
+ *
+ * NOTE: The next Logic version is supposed to have command line parameters for
+ * configuring where the Settings/ directory is located, but until then we have
+ * to use this.
+ *
+ * Usage:
+ *   gcc -shared -fPIC -DOUT="$out" preload.c -o preload.so -ldl
+ *   LD_PRELOAD=$PWD/preload.so ./result/Logic
+ *
+ * To see the paths that are modified at runtime, set the environment variable
+ * PRELOAD_DEBUG to 1 (or anything really; debugging is on as long as the
+ * variable exists).
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+
+#ifndef OUT
+#error Missing OUT define - path to the installation directory.
+#endif
+
+typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
+typedef FILE *(*fopen64_func_t)(const char *path, const char *mode);
+
+/*
+ * Redirect $out/Settings/settings.xml => $HOME/.saleae-logic-settings.xml. No
+ * other paths are changed. Path is truncated if bigger than PATH_MAX.
+ *
+ * @param pathname Original file path.
+ * @param buffer Pointer to a buffer of size PATH_MAX bytes that this function
+ * will write the new redirected path to (if needed).
+ *
+ * @return Pointer to the resulting path. It will either be equal to the
+ * pathname or buffer argument.
+ */
+static const char *redirect(const char *pathname, char *buffer)
+{
+	const char *homepath;
+	const char *new_path;
+	static char have_warned;
+
+	homepath = getenv("HOME");
+	if (!homepath) {
+		homepath = "/";
+		if (!have_warned && getenv("PRELOAD_DEBUG")) {
+			fprintf(stderr, "preload_debug: WARNING: HOME is unset, using \"/\" (root) instead.\n");
+			have_warned = 1;
+		}
+	}
+
+	new_path = pathname;
+	if (strcmp(OUT "/Settings/settings.xml", pathname) == 0) {
+		snprintf(buffer, PATH_MAX, "%s/.saleae-logic-settings.xml", homepath);
+		buffer[PATH_MAX-1] = '\0';
+		new_path = buffer;
+	}
+
+	return new_path;
+}
+
+FILE *fopen(const char *pathname, const char *mode)
+{
+	FILE *fp;
+	const char *path;
+	char buffer[PATH_MAX];
+	fopen_func_t orig_fopen;
+
+	orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
+	path = redirect(pathname, buffer);
+	fp = orig_fopen(path, mode);
+
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: fopen(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
+	}
+
+	return fp;
+}
+
+FILE *fopen64(const char *pathname, const char *mode)
+{
+	FILE *fp;
+	const char *path;
+	char buffer[PATH_MAX];
+	fopen64_func_t orig_fopen64;
+
+	orig_fopen64 = (fopen64_func_t)dlsym(RTLD_NEXT, "fopen64");
+	path = redirect(pathname, buffer);
+	fp = orig_fopen64(path, mode);
+
+	if (path != pathname && getenv("PRELOAD_DEBUG")) {
+		fprintf(stderr, "preload_debug: fopen64(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
+	}
+
+	return fp;
+}
diff --git a/pkgs/development/tools/misc/stlink/default.nix b/pkgs/development/tools/misc/stlink/default.nix
new file mode 100644
index 00000000000..675f8f7f2af
--- /dev/null
+++ b/pkgs/development/tools/misc/stlink/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchgit, autoconf, automake, libtool, pkgconfig, libusb1 }:
+
+# IMPORTANT: You need permissions to access the stlink usb devices. Here are
+# example udev rules for stlink v1 and v2 so you don't need to have root
+# permissions (copied from <stlink>/49-stlink*.rules):
+#
+# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE:="0666", SYMLINK+="stlinkv1_%n"
+# SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3748", MODE:="0666", SYMLINK+="stlinkv2_%n"
+
+stdenv.mkDerivation {
+  name = "stlink-git20130306";
+
+  src = fetchgit {
+    url = git://github.com/texane/stlink.git;
+    rev = "5be889e3feb75fc7f594012c4855b4dc16940050";
+  };
+
+  buildInputs = [ autoconf automake libtool pkgconfig libusb1 ];
+  preConfigure = "./autogen.sh";
+
+  meta = with stdenv.lib; {
+    description = "In-circuit debug and programming for ST-Link devices";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix
index 3589ffb5a07..d5bb2b06e12 100644
--- a/pkgs/development/tools/misc/strace/default.nix
+++ b/pkgs/development/tools/misc/strace/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "158iwk0pl2mfw93m1843xb7a2zb8p6lh0qim07rca6f1ff4dk764";
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     homepage = http://strace.sourceforge.net/;
diff --git a/pkgs/development/tools/misc/sysbench/default.nix b/pkgs/development/tools/misc/sysbench/default.nix
new file mode 100644
index 00000000000..f09ab2af7d1
--- /dev/null
+++ b/pkgs/development/tools/misc/sysbench/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, mysql, libxslt, zlib, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "sysbench-0.4.12";
+  buildInputs = [ autoreconfHook mysql libxslt zlib ];
+  src = fetchurl {
+    url = mirror://sourceforge/sysbench/sysbench-0.4.12.tar.gz;
+    sha256 = "17pa4cw7wxvlb4mba943lfs3b3jdi64mlnaf4n8jq09y35j79yl3";
+  };
+  preAutoreconf = ''
+    touch NEWS AUTHORS
+  '';
+
+  meta = {
+    description = "SysBench is a modular, cross-platform and multi-threaded benchmark tool.";
+    license = "GPLv2";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/tools/misc/tcptrack/default.nix b/pkgs/development/tools/misc/tcptrack/default.nix
new file mode 100644
index 00000000000..43ff8df70d2
--- /dev/null
+++ b/pkgs/development/tools/misc/tcptrack/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, ncurses, libpcap }:
+
+stdenv.mkDerivation rec {
+  name = "tcptrack-${version}";
+  version = "1.4.2";
+
+  src = fetchurl {
+    # TODO: find better URL
+    url = http://pkgs.fedoraproject.org/repo/pkgs/tcptrack/tcptrack-1.4.2.tar.gz/dacf71a6b5310caf1203a2171b598610/tcptrack-1.4.2.tar.gz;
+    sha256 = "0jbh20kjaqdiasy5s9dk53dv4vpnbh31kqcmhwz9vi3qqzhv21v6";
+  };
+
+  buildInputs = [ ncurses libpcap ];
+
+  meta = with stdenv.lib; {
+    description = "libpcap based program for live TCP connection monitoring";
+    homepage = http://www.rhythm.cx/~steve/devel/tcptrack/; # dead link
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
+  };
+}
diff --git a/pkgs/development/tools/misc/texinfo/default.nix b/pkgs/development/tools/misc/texinfo/4.13a.nix
index 111f2d14200..9a41d296342 100644
--- a/pkgs/development/tools/misc/texinfo/default.nix
+++ b/pkgs/development/tools/misc/texinfo/4.13a.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ ncurses ];
-  buildNativeInputs = [ lzma ];
+  nativeBuildInputs = [ lzma ];
 
   # Disabled because we don't have zdiff in the stdenv bootstrap.
   #doCheck = true;
diff --git a/pkgs/development/tools/misc/texinfo/5.1.nix b/pkgs/development/tools/misc/texinfo/5.1.nix
new file mode 100644
index 00000000000..cca368f619a
--- /dev/null
+++ b/pkgs/development/tools/misc/texinfo/5.1.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, ncurses, perl }:
+
+stdenv.mkDerivation rec {
+  name = "texinfo-5.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/texinfo/${name}.tar.xz";
+    sha256 = "0864v5i488x3mb3v5p6nhy2kw0mqkzpa3b0453iibj81zlpq078q";
+  };
+
+  buildInputs = [ ncurses perl ];
+
+  preInstall = ''
+    installFlags="TEXMF=$out/texmf";
+    installTargets="install install-tex";
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://www.gnu.org/software/texinfo/";
+    description = "GNU Texinfo, the GNU documentation system";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      Texinfo is the official documentation format of the GNU project.
+      It was invented by Richard Stallman and Bob Chassell many years
+      ago, loosely based on Brian Reid's Scribe and other formatting
+      languages of the time.  It is used by many non-GNU projects as
+      well.
+
+      Texinfo uses a single source file to produce output in a number
+      of formats, both online and printed (dvi, html, info, pdf, xml,
+      etc.).  This means that instead of writing different documents
+      for online information and another for a printed manual, you
+      need write only one document.  And when the work is revised, you
+      need revise only that one document.  The Texinfo system is
+      well-integrated with GNU Emacs.
+    '';
+  };
+}
diff --git a/pkgs/development/tools/misc/xxdiff/default.nix b/pkgs/development/tools/misc/xxdiff/default.nix
index 1a44cd4bcbf..ac1bc2f1abc 100644
--- a/pkgs/development/tools/misc/xxdiff/default.nix
+++ b/pkgs/development/tools/misc/xxdiff/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchhg, qt4, flex, bison }:
+{ stdenv, fetchhg, qt4, flex, bison, docutils }:
 
 stdenv.mkDerivation {
-  name = "xxdiff-4.0-beta1-20110723";
+  name = "xxdiff-2013.03.08";
 
   src = fetchhg {
     name = "xxdiff";
-    tag = "fdc247a7d9e5";
+    tag = "6a86d8353eef";
     url = https://hg.furius.ca/public/xxdiff;
-    sha256 = "7ae7d81becc25b1adabc9383bb5b9005dddb31510cdc404ce8a0d6ff6c3dc47e";
+    sha256 = "1c1krgmf1cfkrmg48w6zw61wgy01xm171ifkkh6givm8v6c8i340";
   };
 
-  buildNativeInputs = [ flex bison qt4 ];
+  nativeBuildInputs = [ flex bison qt4 docutils ];
 
   buildInputs = [ qt4 ];
 
@@ -23,4 +23,7 @@ stdenv.mkDerivation {
     '';
 
   installPhase = "mkdir -pv $out/bin; cp -v ../bin/xxdiff $out/bin";
+
+  meta.platforms = stdenv.lib.platforms.linux;
+
 }
diff --git a/pkgs/development/tools/neoload/default.nix b/pkgs/development/tools/neoload/default.nix
new file mode 100644
index 00000000000..384e724dfad
--- /dev/null
+++ b/pkgs/development/tools/neoload/default.nix
@@ -0,0 +1,93 @@
+{ stdenv, fetchurl, writeTextFile, jre, makeWrapper, licenseAccepted ? false }:
+
+# If you happen to use this software on the XMonad window manager, you will have issues with
+# grey windows, no resizing, menus not showing and other glitches.
+# This can be fixed by setting a different WM name:
+# http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#Using_SetWMName
+
+if !licenseAccepted then throw ''
+    You have to accept the neoload EULA at
+    https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
+    by setting nixpkgs config option 'neoload.accept_license = true';
+  ''
+else assert licenseAccepted;
+
+# the installer is very picky and demands 1.7.0.07
+let dotInstall4j = writeTextFile { name = "dot-install4j"; text = ''
+      JRE_VERSION	${jre}	1	7	0	7
+      JRE_INFO	${jre}	94
+    ''; };
+
+    responseVarfile = writeTextFile { name = "response.varfile"; text = ''
+      sys.programGroupDisabled$Boolean=false
+      sys.component.Monitor\ Agent$Boolean=true
+      sys.component.Common$Boolean=true
+      sys.component.Controller$Boolean=true
+      sys.languageId=en
+      sys.component.Load\ Generator$Boolean=true
+      sys.installationTypeId=Controller
+      sys.installationDir=INSTALLDIR/lib/neoload
+      sys.symlinkDir=INSTALLDIR/bin
+    ''; };
+
+in stdenv.mkDerivation rec {
+  name = "neoload-4.1.3";
+
+  src = fetchurl (
+    if stdenv.system == "x86_64-linux" then
+      { url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_3_linux_x64.sh;
+        sha256 = "0qqp7iy6xpaqg535hk21yqmxi0inin5v160sa7nwxh41dq0li5xx"; }
+    else
+      { url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_3_linux_x86.sh;
+        sha256 = "0rvy6l9znha3wf8cn406lwvv2qshqnls9kasi68r4wgysr1hh662"; } );
+
+  buildInputs = [ makeWrapper ];
+  phases = [ "installPhase" ];
+
+  # TODO: load generator / monitoring agent only builds
+
+  installPhase = ''
+    mkdir -p $out/lib/neoload
+    ln -s ${jre} $out/lib/neoload/jre
+
+    # the installer wants to use its internal JRE
+    # disable this. The extra spaces are needed because the installer carries
+    # a binary payload, so should not change in size
+    sed -e 's/^if \[ -f jre.tar.gz/if false          /' $src > installer
+    chmod a+x installer
+
+    cp ${dotInstall4j} .install4j
+    chmod u+w .install4j
+
+    sed -e "s|INSTALLDIR|$out|" ${responseVarfile} > response.varfile
+
+    export HOME=`pwd`
+    export INSTALL4J_JAVA_HOME=${jre}
+    bash -ic './installer -q -varfile response.varfile'
+
+    for i in $out/bin/*; do
+      wrapProgram $i --run 'cp ${dotInstall4j} ~/.install4j' \
+                     --run 'chmod u+w ~/.install4j'
+    done
+
+    mkdir -p $out/share/applications
+    for i in $out/lib/neoload/*.desktop; do
+      name=$(basename "$i")
+      sed -e 's|/lib/neoload/bin|/bin|' "$i" > "$out/share/applications/$name"
+    done
+    rm $out/lib/neoload/*.desktop $out/lib/neoload/uninstall
+
+  '';
+
+  meta = {
+    description = "load testing software for Web applications to realistically simulate user activity and analyze server behavior";
+
+    homepage = https://www.neotys.com/product/overview-neoload.html;
+
+    # https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
+    license = stdenv.lib.licenses.unfree;
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/development/tools/node/npm2nix/default.nix b/pkgs/development/tools/node/npm2nix/default.nix
deleted file mode 100644
index 8300a7e2bc3..00000000000
--- a/pkgs/development/tools/node/npm2nix/default.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, coffeescript }:
-
-let version = "0.1"; in
-
-stdenv.mkDerivation rec {
-  name = "npm2nix-${version}";
-
-  src = fetchurl {
-    url = "https://bitbucket.org/shlevy/npm2nix/get/${version}.tar.bz2";
-    sha256 = "14rfs114k02yc9gx0bcjqy67f9cqgkrr1dccwlzl09q9b6qs1k3k";
-  };
-
-  phases = [ "unpackPhase" "installPhase" ];
-
-  installPhase = ''
-    mkdir -p $out/bin
-    sed 's|#!/usr/bin/env coffee|#!${coffeescript}/bin/coffee|' npm2nix.coffee \
-      > $out/bin/npm2nix
-    chmod +x $out/bin/npm2nix
-  '';
-
-  meta = {
-    description = "A tool to generate nix expressions from npm packages";
-    maintainer = stdenv.lib.maintainers.shlevy;
-  };
-}
diff --git a/pkgs/development/tools/ocaml/camlp5/default.nix b/pkgs/development/tools/ocaml/camlp5/default.nix
index 315bca38f36..74b3368293c 100644
--- a/pkgs/development/tools/ocaml/camlp5/default.nix
+++ b/pkgs/development/tools/ocaml/camlp5/default.nix
@@ -2,28 +2,18 @@
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
-  pname = "camlp5";
-  version = "6.02.3";
-  webpage = http://pauillac.inria.fr/~ddr/camlp5/;
   metafile = ./META;
 in
 
 stdenv.mkDerivation {
 
-  name = "${pname}${if transitional then "_transitional" else ""}-${version}";
+  name = "camlp5${if transitional then "_transitional" else ""}-6.06";
 
   src = fetchurl {
-    url = "${webpage}/distrib/src/${pname}-${version}.tgz";
-    sha256 = "1z9bwh267117br0vlhirv9yy2niqp2n25zfnl14wg6kgg9bqx7rj";
+    url = http://pauillac.inria.fr/~ddr/camlp5/distrib/src/camlp5-6.06.tgz;
+    sha256 = "763f89ee6cde4ca063a50708c3fe252d55ea9f8037e3ae9801690411ea6180c5";
   };
 
-  patches = fetchurl {
-    url = "${webpage}/distrib/src/patch-${version}-1";
-    sha256 = "159qpvr07mnn72yqwx24c6mw7hs6bl77capsii7apg9dcxar8w7v";
-  };
-
-  patchFlags = "-p 0";
-
   buildInputs = [ ocaml ];
 
   prefixKey = "-prefix ";
@@ -41,8 +31,8 @@ stdenv.mkDerivation {
       Camlp5 is a preprocessor and pretty-printer for OCaml programs.
       It also provides parsing and printing tools.
     '';
-    homepage = "${webpage}";
-    license = "BSD";
+    homepage = http://pauillac.inria.fr/~ddr/camlp5/;
+    license = stdenv.lib.licenses.bsd3;
     platforms = ocaml.meta.platforms;
     maintainers = [
       stdenv.lib.maintainers.z77z
diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix
index 3170712b9ba..aee0040f815 100644
--- a/pkgs/development/tools/ocaml/findlib/default.nix
+++ b/pkgs/development/tools/ocaml/findlib/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   buildInputs = [m4 ncurses ocaml];
 
-  patches = [ ./ldconf.patch ];
+  patches = [ ./ldconf.patch ./install_topfind.patch ];
 
   dontAddPrefix=true;
 
@@ -24,7 +24,6 @@ stdenv.mkDerivation {
       -mandir $out/share/man
       -sitelib $out/lib/ocaml/${ocaml_version}/site-lib
       -config $out/etc/findlib.conf
-      -no-topfind
     )
   '';
 
diff --git a/pkgs/development/tools/ocaml/findlib/install_topfind.patch b/pkgs/development/tools/ocaml/findlib/install_topfind.patch
new file mode 100644
index 00000000000..4729885bcef
--- /dev/null
+++ b/pkgs/development/tools/ocaml/findlib/install_topfind.patch
@@ -0,0 +1,12 @@
+--- findlib-1.3.3/src/findlib/Makefile
++++ findlib-1.3.3/src/findlib/Makefile
+@@ -82,7 +82,7 @@ clean:
+ install: all
+ 	mkdir -p "$(prefix)$(OCAML_SITELIB)/$(NAME)"
+ 	mkdir -p "$(prefix)$(OCAMLFIND_BIN)"
+-	test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_CORE_STDLIB)"
++	test $(INSTALL_TOPFIND) -eq 0 || cp topfind "$(prefix)$(OCAML_SITELIB)"
+ 	files=`$(TOP)/tools/collect_files $(TOP)/Makefile.config findlib.cmi findlib.mli findlib.cma topfind.cmi topfind.mli fl_package_base.mli fl_package_base.cmi fl_metascanner.mli fl_metascanner.cmi fl_metatoken.cmi findlib_top.cma findlib.cmxa findlib.a META` && \
+ 	cp $$files "$(prefix)$(OCAML_SITELIB)/$(NAME)"
+ 	f="ocamlfind$(EXEC_SUFFIX)"; { test -f ocamlfind_opt$(EXEC_SUFFIX) && f="ocamlfind_opt$(EXEC_SUFFIX)"; }; \
+
diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix
new file mode 100644
index 00000000000..c36d0004992
--- /dev/null
+++ b/pkgs/development/tools/ocaml/opam/default.nix
@@ -0,0 +1,60 @@
+{ stdenv, fetchgit, fetchurl, ocaml, unzip, ncurses, curl }:
+
+let
+  srcs = {
+    cudf = fetchurl {
+      url = "https://gforge.inria.fr/frs/download.php/31910/cudf-0.6.3.tar.gz";
+      sha256 = "6e9f1bafe859df85c854679e2904a8172945d2bf2d676c8ae3ecb72fe6de0665";
+    };
+    extlib = fetchurl {
+      url = "http://ocaml-extlib.googlecode.com/files/extlib-1.5.3.tar.gz";
+      sha256 = "c095eef4202a8614ff1474d4c08c50c32d6ca82d1015387785cf03d5913ec021";
+    };
+    ocaml_re = fetchurl {
+      url = "https://github.com/ocaml/ocaml-re/archive/ocaml-re-1.2.0.tar.gz";
+      sha256 = "a34dd9d6136731436a963bbab5c4bbb16e5d4e21b3b851d34887a3dec451999f";
+    };
+    ocamlgraph = fetchurl {
+      url = "http://ocamlgraph.lri.fr/download/ocamlgraph-1.8.1.tar.gz";
+      sha256 = "ba6388ffc2c15139b0f26330ef6dd922f0ff0f364eee99a3202bf1cd93512b43";
+    };
+    dose3 = fetchurl {
+      url = "https://gforge.inria.fr/frs/download.php/31595/dose3-3.1.2.tar.gz";
+      sha256 = "3a07a08345be157c98cb26021d7329c72c2b95c99cfdff79887690656ec9f1a3";
+    };
+    cmdliner = fetchurl {
+      url = "http://erratique.ch/software/cmdliner/releases/cmdliner-0.9.3.tbz";
+      sha256 = "5421559aa12b4debffef947f7e1039c22e9dffd87a4aa68445a687a20764ae81";
+    };
+    opam = fetchurl {
+      url = "https://github.com/OCamlPro/opam/archive/1.0.0.zip";
+      sha256 = "f8d94a91c2b8d110fa5e3b0a87c512a860acbae110654498a164c5c888c40bda";
+    };
+  };
+in
+stdenv.mkDerivation rec {
+  name = "opam-1.0.0";
+
+  buildInputs = [unzip curl ncurses ocaml];
+
+  src = srcs.opam;
+
+  postUnpack = ''
+    ln -sv ${srcs.cudf} $sourceRoot/src_ext/${srcs.cudf.name}
+    ln -sv ${srcs.extlib} $sourceRoot/src_ext/${srcs.extlib.name}
+    ln -sv ${srcs.ocaml_re} $sourceRoot/src_ext/${srcs.ocaml_re.name}
+    ln -sv ${srcs.ocamlgraph} $sourceRoot/src_ext/${srcs.ocamlgraph.name}
+    ln -sv ${srcs.dose3} $sourceRoot/src_ext/${srcs.dose3.name}
+    ln -sv ${srcs.cmdliner} $sourceRoot/src_ext/${srcs.cmdliner.name}
+  '';
+
+  makeFlags = ["HOME=$(TMPDIR)"];
+
+  doCheck = false;
+
+  meta = {
+    maintainers = stdenv.lib.maintainers.orbitz;
+    description = "A package manager for ocaml";
+    platforms   = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/tools/parsing/Ebnf2ps/default.nix b/pkgs/development/tools/parsing/Ebnf2ps/default.nix
index 81815500c61..82d998c2fcb 100644
--- a/pkgs/development/tools/parsing/Ebnf2ps/default.nix
+++ b/pkgs/development/tools/parsing/Ebnf2ps/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self: {
   pname = "Ebnf2ps";
-  version = "1.0.10";
-  sha256 = "0xim32bnfapfs53lvmdz2af08rqd15lp5b0rh6yjqm7n1g2061zs";
+  version = "1.0.11";
+  sha256 = "0n0maihalnrks3l7ay1i16p6i7f69xv33jxhlsyshzck0v64qivb";
   isLibrary = false;
   isExecutable = true;
   buildTools = [ happy ];
@@ -12,9 +12,6 @@ cabal.mkDerivation (self: {
     description = "Peter's Syntax Diagram Drawing Tool";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [
-      self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
-    ];
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
   };
 })
diff --git a/pkgs/development/tools/parsing/alex/2.3.1.nix b/pkgs/development/tools/parsing/alex/2.3.1.nix
index e1d77561eb1..7dc17cd4153 100644
--- a/pkgs/development/tools/parsing/alex/2.3.1.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.1.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = false;
   isExecutable = true;
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.2.nix b/pkgs/development/tools/parsing/alex/2.3.2.nix
index 5a79036b082..5d10dbd6995 100644
--- a/pkgs/development/tools/parsing/alex/2.3.2.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.2.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = false;
   isExecutable = true;
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.3.nix b/pkgs/development/tools/parsing/alex/2.3.3.nix
index b0b40fecbed..bbe413d478f 100644
--- a/pkgs/development/tools/parsing/alex/2.3.3.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.3.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = false;
   isExecutable = true;
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/2.3.5.nix b/pkgs/development/tools/parsing/alex/2.3.5.nix
index cda27316792..3fb843e6955 100644
--- a/pkgs/development/tools/parsing/alex/2.3.5.nix
+++ b/pkgs/development/tools/parsing/alex/2.3.5.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = false;
   isExecutable = true;
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/3.0.1.nix b/pkgs/development/tools/parsing/alex/3.0.1.nix
index 85e0474b745..cdcaead8635 100644
--- a/pkgs/development/tools/parsing/alex/3.0.1.nix
+++ b/pkgs/development/tools/parsing/alex/3.0.1.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ QuickCheck ];
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/3.0.2.nix b/pkgs/development/tools/parsing/alex/3.0.2.nix
index ec56c74db77..9011db12c7d 100644
--- a/pkgs/development/tools/parsing/alex/3.0.2.nix
+++ b/pkgs/development/tools/parsing/alex/3.0.2.nix
@@ -8,6 +8,7 @@ cabal.mkDerivation (self: {
   isExecutable = true;
   buildDepends = [ QuickCheck ];
   buildTools = [ perl ];
+  doCheck = false;
   meta = {
     homepage = "http://www.haskell.org/alex/";
     description = "Alex is a tool for generating lexical analysers in Haskell";
diff --git a/pkgs/development/tools/parsing/alex/3.0.5.nix b/pkgs/development/tools/parsing/alex/3.0.5.nix
new file mode 100644
index 00000000000..f85aa42d165
--- /dev/null
+++ b/pkgs/development/tools/parsing/alex/3.0.5.nix
@@ -0,0 +1,19 @@
+{ cabal, fetchurl, perl, QuickCheck }:
+
+cabal.mkDerivation (self: {
+  pname = "alex";
+  version = "3.0.5";
+  sha256 = "0ncnp7cl7dlfcrwzzcp8j59i9j5r66wim1yib9g3b3jkl0bn8cn3";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ QuickCheck ];
+  buildTools = [ perl ];
+  patches = [ (fetchurl { url="https://github.com/simonmar/alex/pull/21.patch"; sha256="0apv3rk00gwkf5rqw3467bg6pnamr07zdksbp9khhzzi73k9aq4f"; }) ];
+  meta = {
+    homepage = "http://www.haskell.org/alex/";
+    description = "Alex is a tool for generating lexical analysers in Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/tools/parsing/bison/bison-1.875.nix b/pkgs/development/tools/parsing/bison/bison-1.875.nix
deleted file mode 100644
index 3ee12a252ce..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-1.875.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-assert m4 != null;
-
-stdenv.mkDerivation {
-  name = "bison-1.875";
-  src = fetchurl {
-    url = mirror://gnu/bison/bison-1.875.tar.bz2;
-    md5 = "b7f8027b249ebd4dd0cc948943a71af0";
-  };
-  buildInputs = [m4];
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.3.nix b/pkgs/development/tools/parsing/bison/bison-2.3.nix
deleted file mode 100644
index fcf4ed10795..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.3.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-assert m4 != null;
-
-stdenv.mkDerivation {
-  name = "bison-2.3";
-  src = fetchurl {
-    url = mirror://gnu/bison/bison-2.3.tar.bz2;
-    md5 = "c18640c6ec31a169d351e3117ecce3ec";
-  };
-
-  buildNativeInputs = [m4];
-  propagatedBuildInputs = [m4];
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv2+";
-  };
- 
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.4.nix b/pkgs/development/tools/parsing/bison/bison-2.4.nix
deleted file mode 100644
index a79a5e96381..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.4.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{stdenv, fetchurl, m4}:
-
-stdenv.mkDerivation rec {
-  name = "bison-2.4.3";
-
-  src = fetchurl {
-    url = "mirror://gnu/bison/${name}.tar.bz2";
-    sha256 = "019s3pdzggb71g7p7dgajhh53gh0h6nfl4yrzrs0jzsc37ph4lwk";
-  };
-
-  buildNativeInputs = [m4];
-
-  doCheck = true;
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-  };
-
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.5.nix b/pkgs/development/tools/parsing/bison/bison-2.5.nix
deleted file mode 100644
index ea50b859020..00000000000
--- a/pkgs/development/tools/parsing/bison/bison-2.5.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ stdenv, fetchurl, m4, perl }:
-
-stdenv.mkDerivation rec {
-  name = "bison-2.5";
-
-  src = fetchurl {
-    url = "mirror://gnu/bison/${name}.tar.bz2";
-    sha256 = "1f1rai3v6k6xjii94964iq0alhc2hxwapqa363nfj8rbxvv0sdqa";
-  };
-
-  buildNativeInputs = [ m4 ]
-    ++ stdenv.lib.optional doCheck perl;
-  propagatedBuildInputs = [ m4 ];
-
-  M4 = "${m4}/bin/m4";
-
-  doCheck = true;
-
-  meta = {
-    description = "GNU Bison, a Yacc-compatible parser generator";
-
-    longDescription = ''
-      Bison is a general-purpose parser generator that converts an
-      annotated context-free grammar into an LALR(1) or GLR parser for
-      that grammar.  Once you are proficient with Bison, you can use
-      it to develop a wide range of language parsers, from those used
-      in simple desk calculators to complex programming languages.
-
-      Bison is upward compatible with Yacc: all properly-written Yacc
-      grammars ought to work with Bison with no change.  Anyone
-      familiar with Yacc should be able to use Bison with little
-      trouble.  You need to be fluent in C or C++ programming in order
-      to use Bison.
-    '';
-
-    homepage = http://www.gnu.org/software/bison/;
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-  };
-
-  passthru = { glrSupport = true; };
-}
diff --git a/pkgs/development/tools/parsing/bison/bison-2.6.nix b/pkgs/development/tools/parsing/bison/default.nix
index ea43d30410e..b397a22443a 100644
--- a/pkgs/development/tools/parsing/bison/bison-2.6.nix
+++ b/pkgs/development/tools/parsing/bison/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
-  name = "bison-2.6.2";
+  name = "bison-2.6.5";
 
   src = fetchurl {
     url = "mirror://gnu/bison/${name}.tar.xz";
-    sha256 = "79503f80397c30ac81b62eca5ffeaccaed72fdfeddb76257efcf8c3ca24be03d";
+    sha256 = "8640d5b51aad462db6863711f333a9159836853e0b1e79fdef708c6efb5cd52b";
   };
 
-  buildNativeInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl;
+  nativeBuildInputs = [ m4 ] ++ stdenv.lib.optional doCheck perl;
   propagatedBuildInputs = [ m4 ];
 
   doCheck = true;
diff --git a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix b/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
index 66ece227c92..21180e7d185 100644
--- a/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/flex-2.5.35.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "0ysff249mwhq0053bw3hxh58djc0gy7vjan2z1krrf9n5d5vvv0b";
   };
   buildInputs = [yacc];
-  propagatedBuildNativeInputs = [m4];
+  propagatedNativeBuildInputs = [m4];
 
   crossAttrs = {
     preConfigure = ''
diff --git a/pkgs/development/tools/parsing/happy/1.18.10.nix b/pkgs/development/tools/parsing/happy/1.18.10.nix
new file mode 100644
index 00000000000..d342d3381c8
--- /dev/null
+++ b/pkgs/development/tools/parsing/happy/1.18.10.nix
@@ -0,0 +1,18 @@
+{ cabal, mtl, perl }:
+
+cabal.mkDerivation (self: {
+  pname = "happy";
+  version = "1.18.10";
+  sha256 = "0jq6p5vvdh4wbam80q2d6j2fa6bmbgnbmqk1w9904x06g7vj1jf1";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ mtl ];
+  buildTools = [ perl ];
+  meta = {
+    homepage = "http://www.haskell.org/happy/";
+    description = "Happy is a parser generator for Haskell";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/development/tools/parsing/re2c/default.nix b/pkgs/development/tools/parsing/re2c/default.nix
new file mode 100644
index 00000000000..b7ed4fb8934
--- /dev/null
+++ b/pkgs/development/tools/parsing/re2c/default.nix
@@ -0,0 +1,13 @@
+{stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "re2c-0.13.5";
+  src = fetchurl {
+    url = mirror://sourceforge/re2c/re2c/0.13.5/re2c-0.13.5.tar.gz;
+    sha256 = "1336c54b3cacjxg3grxdraq6a00yidr04z90605fhxglk89rbagk";
+  };
+
+  meta = {
+    description = "Re2c is a tool for writing very fast and very flexible scanners.";
+  };
+}
diff --git a/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.5.1.nix b/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.5.1.nix
deleted file mode 100644
index 4b93aa24baf..00000000000
--- a/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.5.1.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl, aterm}:
-
-stdenv.mkDerivation {
-  name = "toolbuslib-0.5.1";
-  src = fetchurl {
-    url = http://www.cwi.nl/projects/MetaEnv/toolbuslib/toolbuslib-0.5.1.tar.gz;
-    md5 = "1c7c7cce870f813bef60bbffdf061c90";
-  };
-  buildInputs = [aterm];
-}
-
diff --git a/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.6.nix b/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.6.nix
deleted file mode 100644
index c49ac9f0663..00000000000
--- a/pkgs/development/tools/parsing/toolbuslib/toolbuslib-0.6.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl, aterm}:
-
-stdenv.mkDerivation {
-  name = "toolbuslib-0.6";
-  src = fetchurl {
-    url = http://www.cwi.nl/projects/MetaEnv/toolbuslib/toolbuslib-0.6.tar.gz;
-    md5 = "e117c574b428408ad172b1ad904ff430";
-  };
-  buildInputs = [aterm];
-}
-
diff --git a/pkgs/development/tools/phantomjs/default.nix b/pkgs/development/tools/phantomjs/default.nix
new file mode 100644
index 00000000000..5d9433cc5ca
--- /dev/null
+++ b/pkgs/development/tools/phantomjs/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, upx, freetype, fontconfig }:
+
+assert stdenv.lib.elem stdenv.system [ "i686-linux" "x86_64-linux" ];
+
+stdenv.mkDerivation rec {
+  name = "phantomjs-1.7.0";
+
+  # I chose to use the binary build for now.
+  # The source version is quite nasty to compile
+  # because it has bundled a lot of external libraries (like QT and Webkit)
+  # and no easy/nice way to use the system versions of these
+
+  src = if stdenv.system == "i686-linux" then
+          fetchurl {
+            url = "http://phantomjs.googlecode.com/files/${name}-linux-i686.tar.bz2";
+            sha256 = "045d80lymjxnsssa0sgp5pgkahm651jk69ibk3mjczk3ykc1k91f";
+          }
+        else # x86_64-linux
+          fetchurl {
+            url = "http://phantomjs.googlecode.com/files/${name}-linux-x86_64.tar.bz2";
+            sha256 = "1m14czhi3b388didn0a881glsx8bnsg9gnxgj5lghr4l5mgqyrd7";
+          };
+
+  nativeBuildInputs = stdenv.lib.optional (stdenv.system == "x86_64-linux") upx;
+
+  buildPhase = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") ''
+    upx -d bin/phantomjs
+  '' + ''
+    patchelf \
+      --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${freetype}/lib:${fontconfig}/lib:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib \
+      bin/phantomjs
+  '';
+
+  dontStrip = true;
+
+  installPhase = ''
+    mkdir -p $out/share/doc/phantomjs
+    cp -a bin $out
+    cp -a ChangeLog examples LICENSE.BSD README.md third-party.txt $out/share/doc/phantomjs
+  '';
+
+  meta = {
+    description = "Headless WebKit with JavaScript API";
+    longDescription = ''
+      PhantomJS is a headless WebKit with JavaScript API.
+      It has fast and native support for various web standards:
+      DOM handling, CSS selector, JSON, Canvas, and SVG.
+
+      PhantomJS is an optimal solution for:
+      - Headless Website Testing
+      - Screen Capture
+      - Page Automation
+      - Network Monitoring
+    '';
+
+    homepage = http://phantomjs.org/;
+    license = stdenv.lib.licenses.bsd3;
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = ["i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix
index 4e4bcd3f9b6..af83765c7a2 100644
--- a/pkgs/development/tools/profiling/oprofile/default.nix
+++ b/pkgs/development/tools/profiling/oprofile/default.nix
@@ -6,11 +6,11 @@
 assert withGUI -> qt4 != null;
 
 stdenv.mkDerivation rec {
-  name = "oprofile-0.9.7";
+  name = "oprofile-0.9.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/oprofile/${name}.tar.gz";
-    sha256 = "09ymfgcvp6372xnxdbq664ba8f4nzz4cxlya7wi8s1gabmym0nyb";
+    sha256 = "1g31lwgpacql6w5z1z2f31pgwzn14rgsbh7kmmdmsgm2l47r0idb";
   };
 
   patchPhase = ''
@@ -23,8 +23,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ binutils zlib popt makeWrapper gawk which gnugrep pkgconfig ]
     ++ stdenv.lib.optionals withGUI [ qt4 ];
 
-  configureFlags =
-    [ "--with-kernel-support"
+  configureFlags = [
       "--disable-shared"   # needed because only the static libbfd is available
     ]
     ++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix
index 154561e27e1..b6750f88937 100644
--- a/pkgs/development/tools/profiling/sysprof/default.nix
+++ b/pkgs/development/tools/profiling/sysprof/default.nix
@@ -1,44 +1,24 @@
-{ fetchurl, stdenv, kernel, binutils
+{ fetchurl, stdenv, binutils
 , pkgconfig, gtk, glib, pango, libglade }:
 
 stdenv.mkDerivation rec {
-  name = "sysprof-1.0.12-${kernel.version}";
+  name = "sysprof-1.2.0";
 
   src = fetchurl {
-    url = "http://www.daimi.au.dk/~sandmann/sysprof/sysprof-1.0.12.tar.gz";
-    sha256 = "0f0z1dh97swlrkw3cbv5k2jhy5rk7wxv55hp7yhysw3idgp8wbmz";
+    url = "http://www.sysprof.com/sysprof-1.2.0.tar.gz";
+    sha256 = "1wb4d844rsy8qjg3z5m6rnfm72da4xwzrrkkb1q5r10sq1pkrw5s";
   };
 
   buildInputs = [ binutils pkgconfig gtk glib pango libglade ];
 
-  patches = [ ./configure.patch ];
-
-  preConfigure = ''
-    kernelVersion=$(cd "${kernel}/lib/modules" && echo *)
-    echo "assuming Linux kernel version \`$kernelVersion'"
-
-    sed -i "module/Makefile" \
-        -e"s|^[[:blank:]]*KDIR[[:blank:]]*:=.*$|KDIR := ${kernel}/lib/modules/$kernelVersion/build|g ;
-	   s|\$(KMAKE) modules_install|install sysprof-module.ko $out/share/sysprof/module|g ;
-	   s|\\[ -e /sbin/depmod.*$|true|g"
-
-    # XXX: We won't run `depmod' after installing the module.
-  '';
-
-  configureFlags = "--enable-kernel-module";
-
-  preInstall = ''
-    mkdir -p "$out/share/sysprof/module"
-  '';
-
   meta = {
-    homepage = http://www.daimi.au.dk/~sandmann/sysprof/;
+    homepage = http://sysprof.com/;
     description = "Sysprof, a system-wide profiler for Linux";
     license = "GPLv2+";
 
     longDescription = ''
-      Sysprof is a sampling CPU profiler for Linux that uses a kernel
-      module to profile the entire system, not just a single
+      Sysprof is a sampling CPU profiler for Linux that uses the perf_event_open
+      system call to profile the entire system, not just a single
       application.  Sysprof handles shared libraries and applications
       do not need to be recompiled.  In fact they don't even have to
       be restarted.
diff --git a/pkgs/development/tools/pydb/default.nix b/pkgs/development/tools/pydb/default.nix
index 7aa2d57955f..23f0dea4453 100644
--- a/pkgs/development/tools/pydb/default.nix
+++ b/pkgs/development/tools/pydb/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation {
   name = "pydb-1.26";
 
   src = fetchurl {
-    url =  "mirror://sourceforge.net/sourceforge/bashdb/pydb-1.26.tar.bz2";
+    url =  "mirror://sourceforge/sourceforge/bashdb/pydb-1.26.tar.bz2";
     sha256 = "1wlkz1hd5d4gkzhkjkzcm650c1lchj28hj36jx96mklglm41h4q1";
   };
 
diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix
new file mode 100644
index 00000000000..063af69a7f3
--- /dev/null
+++ b/pkgs/development/tools/selenium/chromedriver/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, cairo, fontconfig, freetype, gdk_pixbuf, glib
+, glibc, gtk, libX11, makeWrapper, nspr, nss, pango, unzip
+}:
+
+# note: there is a i686 version available as well
+assert stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "chromedriver_linux64_26.0.1383.0";
+
+  src = fetchurl {
+    url = "http://chromedriver.googlecode.com/files/${name}.zip";
+    sha256 = "0fh4r2rcpjc3nfrdyj256kjlyc0b6mhxqwxcah73q4vm1kjax8rs";
+  };
+
+  buildInputs = [
+    cairo fontconfig freetype gdk_pixbuf glib gtk libX11 makeWrapper
+    nspr nss pango unzip
+  ];
+
+  unpackPhase = "unzip $src";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv chromedriver $out/bin
+    patchelf --set-interpreter ${glibc}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver
+    wrapProgram "$out/bin/chromedriver" \
+      --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64:${cairo}/lib:${fontconfig}/lib:${freetype}/lib:${gdk_pixbuf}/lib:${glib}/lib:${gtk}/lib:${libX11}/lib:${nspr}/lib:${nss}/lib:${pango}/lib:\$LD_LIBRARY_PATH"
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://code.google.com/p/chromedriver/;
+    description = "A WebDriver server for running Selenium tests on Chrome";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
\ No newline at end of file
diff --git a/pkgs/development/web/nodejs/build-node-package.nix b/pkgs/development/web/nodejs/build-node-package.nix
index 98136709170..d260b290016 100644
--- a/pkgs/development/web/nodejs/build-node-package.nix
+++ b/pkgs/development/web/nodejs/build-node-package.nix
@@ -1,7 +1,19 @@
-{ stdenv, nodejs }:
+{ stdenv, runCommand, nodejs, neededNatives}:
 
-args @ { src, deps, ... }:
+args @ { name, src, deps ? [], flags ? [], ... }:
 
+with stdenv.lib;
+
+let
+  npmFlags = concatStringsSep " " (map (v: "--${v}") flags);
+
+  sources = runCommand "node-sources" {} ''
+    tar xf ${nodejs.src}
+    mv *node* $out
+  '';
+
+  requireName = (builtins.parseDrvName name).name;
+in
 stdenv.mkDerivation ({
   unpackPhase = "true";
 
@@ -17,14 +29,16 @@ stdenv.mkDerivation ({
 
   buildPhase = ''
     runHook preBuild
-    ${nodejs}/bin/npm --registry http://www.example.com install ${src}    
+    npm --registry http://www.example.com --nodedir=${sources} install ${src} ${npmFlags}
     runHook postBuild
   '';
 
   installPhase = ''
     runHook preInstall
-    mkdir $out
-    mv node_modules $out
+    mkdir -p $out/node_modules
+    mv node_modules/${requireName} $out/node_modules
+    mv node_modules/.bin $out/node_modules 2>/dev/null || true
+    mv node_modules $out/node_modules/${requireName}
     if [ -d "$out/node_modules/.bin" ]; then
       ln -sv node_modules/.bin $out/bin
       find -L $out/node_modules/.bin/* -type f -print0 | \
@@ -36,4 +50,10 @@ stdenv.mkDerivation ({
   preFixup = ''
     find $out -type f -print0 | xargs -0 sed -i 's|${src}|${src.name}|g'
   '';
-} // args)
+} // args // {
+  # Run the node setup hook when this package is a build input
+  propagatedNativeBuildInputs = (args.propagatedNativeBuildInputs or []) ++ [ nodejs ];
+
+  # Make buildNodePackage useful with --run-env
+  nativeBuildInputs = (args.nativeBuildInputs or []) ++ deps ++ neededNatives;
+} )
diff --git a/pkgs/development/web/nodejs/default.nix b/pkgs/development/web/nodejs/default.nix
index 75e0df0e89e..6660cccc6fb 100644
--- a/pkgs/development/web/nodejs/default.nix
+++ b/pkgs/development/web/nodejs/default.nix
@@ -1,55 +1,57 @@
-{ stdenv, fetchurl, openssl, python, zlib, v8, linkV8Headers ? false, utillinux }:
+{ stdenv, fetchurl, openssl, python, zlib, v8, utillinux, http_parser, c-ares, pkgconfig, runCommand }:
 
 let
+  dtrace = runCommand "dtrace-native" {} ''
+    mkdir -p $out/bin
+    ln -sv /usr/sbin/dtrace $out/bin
+  '';
+
+  version = "0.10.10";
 
-  espipe_patch = fetchurl {
-    url = https://github.com/joyent/libuv/commit/0ac2fdc55455794e057e4999a2e785ca8fbfb1b2.patch;
-    sha256 = "0mqgbsz23b3zp19dwk12ys14b031hssmlp40dylb7psj937qcpzi";
+  # !!! Should we also do shared libuv?
+  deps = {
+    inherit v8 openssl zlib;
+    cares = c-ares;
+    http-parser = http_parser;
   };
 
-in
+  sharedConfigureFlags = name: [
+    "--shared-${name}"
+    "--shared-${name}-includes=${builtins.getAttr name deps}/include"
+    "--shared-${name}-libpath=${builtins.getAttr name deps}/lib"
+  ];
 
-stdenv.mkDerivation rec {
-  version = "0.8.8";
+  inherit (stdenv.lib) concatMap optional optionals maintainers licenses platforms;
+in stdenv.mkDerivation {
   name = "nodejs-${version}";
 
   src = fetchurl {
     url = "http://nodejs.org/dist/v${version}/node-v${version}.tar.gz";
-    sha256 = "0cri5r191l5pw8a8pf3gs7hfjm3rrz6kdnm3l8wghmp9p12p0aq9";
+    sha256 = "0p6ii9xgshv2aak1rb4hq54pszdjxip0nr5r9a3axirs5hfyfkd5";
   };
 
-  configureFlags = [
-    "--openssl-includes=${openssl}/include"
-    "--openssl-libpath=${openssl}/lib"
-    "--shared-v8"
-    "--shared-v8-includes=${v8}/includes"
-    "--shared-v8-libpath=${v8}/lib"
-  ];
-
-  patches = stdenv.lib.optional stdenv.isDarwin ./no-arch-flag.patch;
+  configureFlags = concatMap sharedConfigureFlags (builtins.attrNames deps);
 
   prePatch = ''
-    sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i tools/{*.py,waf-light,node-waf} configure
-    pushd deps/uv
-    patch -p 1 < ${espipe_patch}
-    popd
+    sed -e 's|^#!/usr/bin/env python$|#!${python}/bin/python|g' -i configure
   '';
 
-  postInstall = ''
-    sed -e 's|^#!/usr/bin/env node$|#!'$out'/bin/node|' -i $out/lib/node_modules/npm/bin/npm-cli.js
-  '' + stdenv.lib.optionalString linkV8Headers '' # helps binary npms
-    ln -s ${v8}/include/* $out/include
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
-    install_name_tool -change libv8.dylib ${v8}/lib/libv8.dylib $out/bin/node
-  '';
+  patches = if stdenv.isDarwin then [ ./no-xcode.patch ] else null;
+
+  postPatch = if stdenv.isDarwin then ''
+    (cd tools/gyp; patch -Np1 -i ${../../python-modules/gyp/no-darwin-cflags.patch})
+  '' else null;
 
-  buildInputs = [ python openssl v8 zlib ] ++ stdenv.lib.optional stdenv.isLinux utillinux;
+  buildInputs = [ python ]
+    ++ (optional stdenv.isLinux utillinux)
+    ++ optionals stdenv.isDarwin [ pkgconfig openssl dtrace ];
+  setupHook = ./setup-hook.sh;
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "Event-driven I/O framework for the V8 JavaScript engine";
     homepage = http://nodejs.org;
     license = licenses.mit;
-    maintainers = [ maintainers.goibhniu ];
+    maintainers = [ maintainers.goibhniu maintainers.shlevy ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/web/nodejs/no-arch-flag.patch b/pkgs/development/web/nodejs/no-arch-flag.patch
deleted file mode 100644
index bbe96c0c552..00000000000
--- a/pkgs/development/web/nodejs/no-arch-flag.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -Naur node-v0.6.10-orig/wscript node-v0.6.10/wscript
---- node-v0.6.10-orig/wscript	2012-02-02 19:56:42.000000000 -0500
-+++ node-v0.6.10/wscript	2012-02-25 14:18:50.000000000 -0500
-@@ -443,17 +443,6 @@
-   if sys.platform.startswith("darwin"):
-     # used by platform_darwin_*.cc
-     conf.env.append_value('LINKFLAGS', ['-framework','Carbon'])
--    # cross compile for architecture specified by DEST_CPU
--    if 'DEST_CPU' in conf.env:
--      arch = conf.env['DEST_CPU']
--      # map supported_archs to GCC names:
--      arch_mappings = {'ia32': 'i386', 'x64': 'x86_64'}
--      if arch in arch_mappings:
--        arch = arch_mappings[arch]
--      flags = ['-arch', arch]
--      conf.env.append_value('CCFLAGS', flags)
--      conf.env.append_value('CXXFLAGS', flags)
--      conf.env.append_value('LINKFLAGS', flags)
-   if 'DEST_CPU' in conf.env:
-     arch = conf.env['DEST_CPU']
-     # TODO: -m32 is only available on 64 bit machines, so check host type
diff --git a/pkgs/development/web/nodejs/no-xcode.patch b/pkgs/development/web/nodejs/no-xcode.patch
new file mode 100644
index 00000000000..47a37bfaf3c
--- /dev/null
+++ b/pkgs/development/web/nodejs/no-xcode.patch
@@ -0,0 +1,78 @@
+diff --git a/tools/gyp/pylib/gyp/xcode_emulation.py b/tools/gyp/pylib/gyp/xcode_emulation.py
+index 806f92b..5256856 100644
+--- a/tools/gyp/pylib/gyp/xcode_emulation.py
++++ b/tools/gyp/pylib/gyp/xcode_emulation.py
+@@ -224,8 +224,7 @@ class XcodeSettings(object):
+ 
+   def _GetSdkVersionInfoItem(self, sdk, infoitem):
+     job = subprocess.Popen(['xcodebuild', '-version', '-sdk', sdk, infoitem],
+-                           stdout=subprocess.PIPE,
+-                           stderr=subprocess.STDOUT)
++                           stdout=subprocess.PIPE)
+     out = job.communicate()[0]
+     if job.returncode != 0:
+       sys.stderr.write(out + '\n')
+@@ -234,9 +233,17 @@ class XcodeSettings(object):
+ 
+   def _SdkPath(self):
+     sdk_root = self.GetPerTargetSetting('SDKROOT', default='macosx')
++    if sdk_root.startswith('/'):
++      return sdk_root
+     if sdk_root not in XcodeSettings._sdk_path_cache:
+-      XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
+-          sdk_root, 'Path')
++      try:
++        XcodeSettings._sdk_path_cache[sdk_root] = self._GetSdkVersionInfoItem(
++            sdk_root, 'Path')
++      except:
++        # if this fails it's because xcodebuild failed, which means
++        # the user is probably on a CLT-only system, where there
++        # is no valid SDK root
++        XcodeSettings._sdk_path_cache[sdk_root] = None
+     return XcodeSettings._sdk_path_cache[sdk_root]
+ 
+   def _AppendPlatformVersionMinFlags(self, lst):
+@@ -339,10 +346,11 @@ class XcodeSettings(object):
+ 
+     cflags += self._Settings().get('WARNING_CFLAGS', [])
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      cflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
++    if 'SDKROOT' in self._Settings():
++      config = self.spec['configurations'][self.configname]
++      framework_dirs = config.get('mac_framework_dirs', [])
++      for directory in framework_dirs:
++        cflags.append('-F' + directory.replace('$(SDKROOT)', sdk_root))
+ 
+     self.configname = None
+     return cflags
+@@ -572,10 +580,11 @@ class XcodeSettings(object):
+     for rpath in self._Settings().get('LD_RUNPATH_SEARCH_PATHS', []):
+       ldflags.append('-Wl,-rpath,' + rpath)
+ 
+-    config = self.spec['configurations'][self.configname]
+-    framework_dirs = config.get('mac_framework_dirs', [])
+-    for directory in framework_dirs:
+-      ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
++    if 'SDKROOT' in self._Settings():
++      config = self.spec['configurations'][self.configname]
++      framework_dirs = config.get('mac_framework_dirs', [])
++      for directory in framework_dirs:
++        ldflags.append('-F' + directory.replace('$(SDKROOT)', self._SdkPath()))
+ 
+     self.configname = None
+     return ldflags
+@@ -700,7 +709,10 @@ class XcodeSettings(object):
+         l = '-l' + m.group(1)
+       else:
+         l = library
+-    return l.replace('$(SDKROOT)', self._SdkPath())
++    if self._SdkPath():
++      return l.replace('$(SDKROOT)', self._SdkPath())
++    else:
++      return l
+ 
+   def AdjustLibraries(self, libraries):
+     """Transforms entries like 'Cocoa.framework' in libraries into entries like
diff --git a/pkgs/development/web/nodejs/setup-hook.sh b/pkgs/development/web/nodejs/setup-hook.sh
new file mode 100644
index 00000000000..c2888471044
--- /dev/null
+++ b/pkgs/development/web/nodejs/setup-hook.sh
@@ -0,0 +1,5 @@
+addNodePath () {
+    addToSearchPath NODE_PATH $1/node_modules
+}
+
+envHooks=(${envHooks[@]} addNodePath)
diff --git a/pkgs/development/web/plone/4.1.6.nix b/pkgs/development/web/plone/4.1.6.nix
new file mode 100644
index 00000000000..23a0cc34f90
--- /dev/null
+++ b/pkgs/development/web/plone/4.1.6.nix
@@ -0,0 +1,5141 @@
+# DO NOT EDIT THIS FILE!
+#
+# Nix expressions autogenerated with:
+#   bin/pypi2nix -n plone43Packages -d Plone -d mailinglogger -d zc.recipe.egg -d plone.recipe.zope2instance -d Pillow -i setuptools -i zc_buildout -i pillow -e plone/4.1.6.json -p plone/4.1.6.txt -o plone/4.1.6.nix
+
+{ pkgs, pythonPackages }:
+
+let plone43Packages = pythonPackages.python.modules // rec {
+  inherit (pythonPackages) buildPythonPackage setuptools zc_buildout pillow;
+  inherit (pkgs) fetchurl stdenv;
+
+  plone_app_portlets = buildPythonPackage rec {
+    name = "plone.app.portlets-2.1.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.portlets/plone.app.portlets-2.1.8.zip";
+      md5 = "cfdcd1c2261103f8ce823813b2ca54ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface zope_traversing plone_app_form datetime zope_container zope_lifecycleevent zope_annotation five_customerize zope_i18nmessageid zope_publisher products_genericsetup plone_i18n feedparser zope_event zope_browser zope_contentprovider plone_memoize zope2 zope_schema acquisition transaction products_pluggableauthservice zope_site zope_component plone_app_vocabularies plone_portlets plone_app_i18n zope_configuration zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope2 = buildPythonPackage rec {
+    name = "Zope2-2.13.15";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/Zope2/Zope2-2.13.15.zip";
+      md5 = "dc43f1fa82a3aa044466143c5524143c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_traversing multimapping zope_size zope_contenttype zope_browserpage datetime zope_component zope_sendmail zope_lifecycleevent products_zctextindex products_standardcachemanagers persistence products_mimetools zope_i18nmessageid zope_publisher missing zope_viewlet zope_sequencesort zope_testbrowser docutils zope_event products_pythonscripts zope_browser zope_structuredtext zope_contentprovider zope_browsermenu zope_tal zope_exceptions products_mailhost products_btreefolder2 zopeundo zconfig record accesscontrol pytz products_ofsp zope_schema zexceptions zope_processlifetime acquisition extensionclass zope_proxy zope_site zope_container zope_pagetemplate zdaemon zope_browserresource zope_deferredimport initgroups zope_security zope_configuration zope_i18n products_zcatalog restrictedpython zodb3 documenttemplate setuptools zope_ptresource zlog tempstorage transaction zope_tales zope_location products_externalmethod ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_btreefolder2 = buildPythonPackage rec {
+    name = "Products.BTreeFolder2-2.13.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.BTreeFolder2/Products.BTreeFolder2-2.13.3.tar.gz";
+      md5 = "f57c85673036af7ccd34c3fa251f6bb2";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ accesscontrol zope_container zodb3 zope_event persistence setuptools zope_lifecycleevent acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pythonscripts = buildPythonPackage rec {
+    name = "Products.PythonScripts-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PythonScripts/Products.PythonScripts-2.13.0.zip";
+      md5 = "db1fad6815cb238a58dbbab8d5e95667";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol datetime restrictedpython documenttemplate setuptools zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zopeundo = buildPythonPackage rec {
+    name = "ZopeUndo-2.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZopeUndo/ZopeUndo-2.12.0.zip";
+      md5 = "2b8da09d1b98d5558f62e12f6e52c401";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  datetime = buildPythonPackage rec {
+    name = "DateTime-2.12.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DateTime/DateTime-2.12.6.zip";
+      md5 = "b2ade6cd7e85dd0c38c770f015c42500";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface pytz ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_session = buildPythonPackage rec {
+    name = "plone.session-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.session/plone.session-3.5.3.zip";
+      md5 = "f95872454735abc8f27c3dcbc9434c11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_pluggableauthservice plone_keyring zope_interface setuptools zope_component plone_protect ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_container = buildPythonPackage rec {
+    name = "zope.container-3.11.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.container/zope.container-3.11.2.tar.gz";
+      md5 = "fc66d85a17b8ffb701091c9328983dcc";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_filerepresentation zope_i18nmessageid zope_publisher zope_broken zope_interface zope_size zope_dottedname zope_security zope_location zope_lifecycleevent zope_component zodb3 zope_event setuptools zope_schema zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_folder = buildPythonPackage rec {
+    name = "plone.folder-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.folder/plone.folder-1.0.1.zip";
+      md5 = "acb3958b623c0da35fdb259c94120396";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonepas = buildPythonPackage rec {
+    name = "Products.PlonePAS-4.0.13";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlonePAS/Products.PlonePAS-4.0.13.zip";
+      md5 = "93da488c71a2b8a1751f1733cbc235f1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_genericsetup plone_memoize plone_i18n plone_session zope2 setuptools products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_locales = buildPythonPackage rec {
+    name = "plone.app.locales-4.0.13";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.locales/plone.app.locales-4.0.13.zip";
+      md5 = "276fcceff2b567a32293de373e182d1f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sequencesort = buildPythonPackage rec {
+    name = "zope.sequencesort-3.4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sequencesort/zope.sequencesort-3.4.0.tar.gz";
+      md5 = "cfc35fc426a47f5c0ee43c416224b864";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_genericsetup = buildPythonPackage rec {
+    name = "Products.GenericSetup-1.6.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.GenericSetup/Products.GenericSetup-1.6.6.tar.gz";
+      md5 = "f9ce78d543052179ebc3cedcc3c5852f";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope_formlib five_localsitemanager zope2 setuptools eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  kss_core = buildPythonPackage rec {
+    name = "kss.core-1.6.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/k/kss.core/kss.core-1.6.3.zip";
+      md5 = "e9e0974851499556b7d09d79e1e14f11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_security zope_datetime zope_app_component zope_app_publication zope_pagetemplate zope_interface zope_location zope_app_publisher zope_contenttype zope_configuration zope_publisher zope_component zope_event setuptools zope_app_pagetemplate zope_schema zope_lifecycleevent zope_app_folder zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tal = buildPythonPackage rec {
+    name = "zope.tal-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tal/zope.tal-3.5.2.zip";
+      md5 = "13869f292ba36b294736b7330b1396fd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_cachepurging = buildPythonPackage rec {
+    name = "plone.cachepurging-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.cachepurging/plone.cachepurging-1.0.3.tar.gz";
+      md5 = "26d47c4e2dccfb1992feb259e7e01c11";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 five_globalrequest zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_securemailhost = buildPythonPackage rec {
+    name = "Products.SecureMailHost-1.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.SecureMailHost/Products.SecureMailHost-1.1.2.zip";
+      md5 = "7db0f1fa867bd0df972082f502a7a707";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_portaltransforms = buildPythonPackage rec {
+    name = "Products.PortalTransforms-2.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PortalTransforms/Products.PortalTransforms-2.0.7.zip";
+      md5 = "bd3568fa71e8941d049514ba91b3292e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_structuredtext products_mimetypesregistry zodb3 products_cmfdefault plone_intelligenttext setuptools markdown products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_memoize = buildPythonPackage rec {
+    name = "plone.memoize-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.memoize/plone.memoize-1.1.1.zip";
+      md5 = "d07cd14b976160e1f26a859e3370147e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope_annotation zope_ramcache setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  docutils = buildPythonPackage rec {
+    name = "docutils-0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/docutils/docutils-0.7.tar.gz";
+      md5 = "9aec716baf15d06b5aa57cf8d5591c15";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_formlib = buildPythonPackage rec {
+    name = "five.formlib-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.formlib/five.formlib-1.0.4.zip";
+      md5 = "09fcecbb7e0ed4a31a4f19787c1a78b4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_app_form zope_formlib zope_interface zope_location zope_publisher zope_component extensionclass zope_event setuptools zope_schema zope_lifecycleevent zope_browser zope2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zexceptions = buildPythonPackage rec {
+    name = "zExceptions-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zExceptions/zExceptions-2.13.0.zip";
+      md5 = "4c679696c959040d8e656ef85ae40136";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_publisher zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfuid = buildPythonPackage rec {
+    name = "Products.CMFUid-2.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFUid/Products.CMFUid-2.2.1.tar.gz";
+      md5 = "e20727959351dffbf0bac80613eee110";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  restrictedpython = buildPythonPackage rec {
+    name = "RestrictedPython-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/RestrictedPython/RestrictedPython-3.6.0.zip";
+      md5 = "aa75a7dcc7fbc966357837cc66cacec6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  feedparser = buildPythonPackage rec {
+    name = "feedparser-5.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/feedparser/feedparser-5.0.1.zip";
+      md5 = "cefffeba66b658d3cc7c1d66b92c6a1a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browser = buildPythonPackage rec {
+    name = "zope.browser-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browser/zope.browser-1.3.zip";
+      md5 = "4ff0ddbf64c45bfcc3189e35f4214ded";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdefault = buildPythonPackage rec {
+    name = "Products.CMFDefault-2.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDefault/Products.CMFDefault-2.2.2.tar.gz";
+      md5 = "87d0a1637afb1d09731b376f72236e31";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_genericsetup products_cmfcore five_formlib setuptools zope2 eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_dateutil = buildPythonPackage rec {
+    name = "python-dateutil-1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz";
+      md5 = "0dcb1de5e5cad69490a3b6ab63f0cfa5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_error = buildPythonPackage rec {
+    name = "zope.error-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.error/zope.error-3.7.4.tar.gz";
+      md5 = "281445a906458ff5f18f56923699a127";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_exceptions setuptools zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_monkeypatcher = buildPythonPackage rec {
+    name = "collective.monkeypatcher-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.monkeypatcher/collective.monkeypatcher-1.0.1.zip";
+      md5 = "4d4f20f9b8bb84b24afadc4f56f6dc2c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetools = buildPythonPackage rec {
+    name = "Products.MIMETools-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MIMETools/Products.MIMETools-2.13.0.zip";
+      md5 = "ad5372fc1190599a19493db0864448ec";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ documenttemplate setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deprecation = buildPythonPackage rec {
+    name = "zope.deprecation-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deprecation/zope.deprecation-3.4.1.tar.gz";
+      md5 = "8a47b0f8e1fa4e833007e5b8351bb1d4";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unidecode = buildPythonPackage rec {
+    name = "Unidecode-0.04.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.1.tar.gz";
+      md5 = "c4c9ed8d40cff25c390ff5d5112b9308";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcore = buildPythonPackage rec {
+    name = "Products.CMFCore-2.2.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCore/Products.CMFCore-2.2.6.tar.gz";
+      md5 = "ae649fd2d54755691148c86d2e02c8ae";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_zsqlmethods five_localsitemanager setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_localsitemanager = buildPythonPackage rec {
+    name = "five.localsitemanager-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.localsitemanager/five.localsitemanager-2.0.5.zip";
+      md5 = "5e3a658e6068832bd802018ebc83f2d4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_site zope_interface zope_location zope_component zodb3 zope_event setuptools zope_lifecycleevent zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_configuration = buildPythonPackage rec {
+    name = "zope.configuration-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.configuration/zope.configuration-3.7.4.zip";
+      md5 = "5b0271908ef26c05059eda76928896ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_batching = buildPythonPackage rec {
+    name = "z3c.batching-1.1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.batching/z3c.batching-1.1.0.tar.gz";
+      md5 = "d1dc834781d228127ca6d15301757863";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_form = buildPythonPackage rec {
+    name = "z3c.form-2.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.form/z3c.form-2.5.1.tar.gz";
+      md5 = "f029f83dd226f695f55049ed1ecee95e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_pagetemplate zope_interface zope_location zope_security zope_configuration zope_component zope_event setuptools zope_schema zope_lifecycleevent zope_browser zope_i18n zope_traversing zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcalendar = buildPythonPackage rec {
+    name = "Products.CMFCalendar-2.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCalendar/Products.CMFCalendar-2.2.2.tar.gz";
+      md5 = "49458e68dc3b6826ea9a3576ac014419";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfdefault zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_extendedpathindex = buildPythonPackage rec {
+    name = "Products.ExtendedPathIndex-2.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExtendedPathIndex/Products.ExtendedPathIndex-2.9.zip";
+      md5 = "7dfd5a6c3abc87f91cbaab3798038e1f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_schemaextender = buildPythonPackage rec {
+    name = "archetypes.schemaextender-2.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.schemaextender/archetypes.schemaextender-2.1.1.zip";
+      md5 = "3659dd72db341b629308d90f135031df";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zconfig = buildPythonPackage rec {
+    name = "ZConfig-2.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZConfig/ZConfig-2.9.0.zip";
+      md5 = "5c932690a70c8907efd240cdd76a7bc4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_copypastemove = buildPythonPackage rec {
+    name = "zope.copypastemove-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.copypastemove/zope.copypastemove-3.7.0.tar.gz";
+      md5 = "f335940686d15cfc5520c42f2494a924";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_container zope_copy zope_interface zope_location zope_exceptions zope_component zope_event setuptools zope_lifecycleevent zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentmenu = buildPythonPackage rec {
+    name = "plone.app.contentmenu-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentmenu/plone.app.contentmenu-2.0.5.tar.gz";
+      md5 = "50de3ddf80d602ab79064d652275c2e7";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_app_publisher zope_publisher products_cmfdynamicviewfti zope_interface plone_memoize plone_app_content zope_component zope2 acquisition setuptools zope_i18n plone_locking products_cmfcore zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluginregistry = buildPythonPackage rec {
+    name = "Products.PluginRegistry-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluginRegistry/Products.PluginRegistry-1.3.tar.gz";
+      md5 = "5b166193ca1eb84dfb402051f779ebab";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplacefulworkflow = buildPythonPackage rec {
+    name = "Products.CMFPlacefulWorkflow-1.5.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlacefulWorkflow/Products.CMFPlacefulWorkflow-1.5.7.zip";
+      md5 = "7617fcd9d2590c0d2f1b6cff08addc8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_i18nmessageid products_plonetestcase products_genericsetup zope_interface zope_testing zope_component setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_outputfilters = buildPythonPackage rec {
+    name = "plone.outputfilters-1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.outputfilters/plone.outputfilters-1.2.zip";
+      md5 = "052ec24783b6ca7b5e55e50c7b57d3a2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_portaltransforms products_mimetypesregistry products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_publisher = buildPythonPackage rec {
+    name = "zope.publisher-3.12.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.publisher/zope.publisher-3.12.6.tar.gz";
+      md5 = "495131970cc7cb14de8e517fb3857ade";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_contenttype zope_proxy zope_interface zope_location zope_exceptions zope_security zope_configuration zope_component zope_event setuptools zope_browser zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_security = buildPythonPackage rec {
+    name = "zope.security-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.security/zope.security-3.7.4.tar.gz";
+      md5 = "072ab8d11adc083eace11262da08630c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema zope_interface zope_location zope_configuration zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zdaemon = buildPythonPackage rec {
+    name = "zdaemon-2.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zdaemon/zdaemon-2.0.7.tar.gz";
+      md5 = "291a875f82e812110557eb6704af8afe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_annotation = buildPythonPackage rec {
+    name = "zope.annotation-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.annotation/zope.annotation-3.5.0.tar.gz";
+      md5 = "4238153279d3f30ab5613438c8e76380";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy zope_interface zope_location zope_component zodb3 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmftestcase = buildPythonPackage rec {
+    name = "Products.CMFTestCase-0.9.11";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFTestCase/Products.CMFTestCase-0.9.11.zip";
+      md5 = "19ed5008a93eff36b853780dd0bca119";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope2 products_genericsetup zope_site zope_interface zope_component zodb3 products_cmfdefault products_cmfcalendar setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_structuredtext = buildPythonPackage rec {
+    name = "zope.structuredtext-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.structuredtext/zope.structuredtext-3.5.1.tar.gz";
+      md5 = "eabbfb983485d0879322bc878d2478a0";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zodb3 = buildPythonPackage rec {
+    name = "ZODB3-3.10.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-3.10.5.tar.gz";
+      md5 = "6f180c6897a1820948fee2a6290503cd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface transaction zconfig zope_event zdaemon zc_lockfile ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  documenttemplate = buildPythonPackage rec {
+    name = "DocumentTemplate-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DocumentTemplate/DocumentTemplate-2.13.2.zip";
+      md5 = "07bb086c77c1dfe94125ad2efbba94b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zope_sequencesort zexceptions restrictedpython zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_globalrequest = buildPythonPackage rec {
+    name = "zope.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.globalrequest/zope.globalrequest-1.0.zip";
+      md5 = "ae6ff02db5ba89c1fb96ed7a73ca1cfa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_customerize = buildPythonPackage rec {
+    name = "plone.app.customerize-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.customerize/plone.app.customerize-1.2.2.zip";
+      md5 = "6a3802c4e8fbd955597adc6a8298febf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope2 zope_publisher zope_interface plone_browserlayer plone_portlets zope_component setuptools five_customerize products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdifftool = buildPythonPackage rec {
+    name = "Products.CMFDiffTool-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDiffTool/Products.CMFDiffTool-2.0.2.zip";
+      md5 = "c12ba4fb9912a9a5a046b07b5b1cf69d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testbrowser = buildPythonPackage rec {
+    name = "zope.testbrowser-3.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testbrowser/zope.testbrowser-3.11.1.tar.gz";
+      md5 = "64abbee892121e7f1a91aed12cfc155a";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface mechanize pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_contentmigration = buildPythonPackage rec {
+    name = "Products.contentmigration-2.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.contentmigration/Products.contentmigration-2.1.1.zip";
+      md5 = "3231b92976728ced7b9699472fe0cc43";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_intelligenttext = buildPythonPackage rec {
+    name = "plone.intelligenttext-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.intelligenttext/plone.intelligenttext-2.0.1.zip";
+      md5 = "bec8ed2107d3c1b63a60d49a1a88ddeb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_classic = buildPythonPackage rec {
+    name = "plonetheme.classic-1.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.classic/plonetheme.classic-1.1.2.tar.gz";
+      md5 = "b1305c82931e9e19ce910318c8e1dc55";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_kupu = buildPythonPackage rec {
+    name = "Products.kupu-1.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.kupu/Products.kupu-1.5.0.zip";
+      md5 = "0952b721f77fdb38bd0bbc0a52943cbd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid products_genericsetup zope_interface products_portaltransforms products_cmfcore products_archetypes products_mimetypesregistry setuptools products_cmfplone zope_schema zope_i18n plone_outputfilters ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_authentication = buildPythonPackage rec {
+    name = "zope.authentication-3.7.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.authentication/zope.authentication-3.7.1.zip";
+      md5 = "7d6bb340610518f2fc71213cfeccda68";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18n = buildPythonPackage rec {
+    name = "zope.i18n-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18n/zope.i18n-3.7.4.tar.gz";
+      md5 = "a6fe9d9ad53dd7e94e87cd58fb67d3b7";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_i18nmessageid pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_componentvocabulary = buildPythonPackage rec {
+    name = "zope.componentvocabulary-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.componentvocabulary/zope.componentvocabulary-1.0.1.tar.gz";
+      md5 = "1c8fa82ca1ab1f4b0bd2455a31fde22b";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_ofsp = buildPythonPackage rec {
+    name = "Products.OFSP-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.OFSP/Products.OFSP-2.13.2.zip";
+      md5 = "c76d40928753c2ee56db873304e65bd5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol persistence setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_datetime = buildPythonPackage rec {
+    name = "zope.datetime-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.datetime/zope.datetime-3.4.1.tar.gz";
+      md5 = "4dde22d34f41a0a4f0c5a345e6d11ee9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_form = buildPythonPackage rec {
+    name = "plone.app.form-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.form/plone.app.form-2.0.5.tar.gz";
+      md5 = "ecac76663325511a110837e7ad7c24a6";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_app_form zope_site zope_formlib plone_app_vocabularies zope2 datetime zope_component zope_event five_formlib setuptools zope_interface zope_schema zope_lifecycleevent zope_browser zope_i18n plone_locking products_cmfcore acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_passwordresettool = buildPythonPackage rec {
+    name = "Products.PasswordResetTool-2.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PasswordResetTool/Products.PasswordResetTool-2.0.8.zip";
+      md5 = "f6658bec0ba11a34f53e8ef49461ad4a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface plone_memoize datetime zope_component setuptools zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_jquerytools = buildPythonPackage rec {
+    name = "plone.app.jquerytools-1.3.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.jquerytools/plone.app.jquerytools-1.3.2.zip";
+      md5 = "326470a34e07aa98c40d75ec22484572";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope2 products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_validation = buildPythonPackage rec {
+    name = "Products.validation-2.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.validation/Products.validation-2.0.zip";
+      md5 = "afa217e2306637d1dccbebf337caa8bf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime setuptools zope_i18n acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_registry = buildPythonPackage rec {
+    name = "plone.registry-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.registry/plone.registry-1.0.1.zip";
+      md5 = "6be3d2ec7e2d170e29b8c0bc65049aff";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_dottedname zope_component zodb3 zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_pagetemplate = buildPythonPackage rec {
+    name = "zope.app.pagetemplate-3.11.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.pagetemplate/zope.app.pagetemplate-3.11.2.tar.gz";
+      md5 = "2d304729c0d6a9ab67dd5ea852f19476";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_browserpage zope_traversing zope_tales zope_size zope_pagetemplate zope_dublincore zope_security zope_component zope_configuration setuptools zope_interface zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_viewlet = buildPythonPackage rec {
+    name = "zope.viewlet-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.viewlet/zope.viewlet-3.7.2.tar.gz";
+      md5 = "367e03096df57e2f9b74fff43f7901f9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_i18nmessageid zope_publisher zope_interface zope_location zope_security zope_configuration zope_component zope_event setuptools zope_schema zope_traversing zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_static = buildPythonPackage rec {
+    name = "plone.portlet.static-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.static/plone.portlet.static-2.0.1.zip";
+      md5 = "63a5f5555cd9d829e995bd7fe23a44b3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 plone_app_portlets zope_formlib zope_interface setuptools plone_i18n plone_portlets zope_component plone_app_form zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_collection = buildPythonPackage rec {
+    name = "plone.portlet.collection-2.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.collection/plone.portlet.collection-2.0.4.tar.gz";
+      md5 = "39ba9a24e240ffe30c3a0d1984b771f1";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ plone_memoize setuptools plone_app_vocabularies plone_app_form plone_portlets plone_app_portlets ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_users = buildPythonPackage rec {
+    name = "plone.app.users-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.users/plone.app.users-1.1.3.tar.gz";
+      md5 = "21b1ac5c3a8ff554f1cbf593fd1d3600";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_app_form setuptools zope_site zope_formlib zope_interface plone_app_controlpanel plone_app_layout zope2 zope_component products_statusmessages products_cmfdefault five_formlib plone_protect zodb3 zope_schema products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_theme = buildPythonPackage rec {
+    name = "plone.theme-2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.theme/plone.theme-2.1.zip";
+      md5 = "c592d0d095e9fc76cc81597cdf6d0c37";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_publisher zope_interface zope_traversing zope_component products_cmfdefault setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18nmessageid = buildPythonPackage rec {
+    name = "zope.i18nmessageid-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-3.5.3.tar.gz";
+      md5 = "cb84bf61c2b7353e3b7578057fbaa264";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_folder = buildPythonPackage rec {
+    name = "plone.app.folder-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.folder/plone.app.folder-1.0.4.zip";
+      md5 = "90fbe9c841a2f01d06979a1869c12fce";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_folder setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zcatalog = buildPythonPackage rec {
+    name = "Products.ZCatalog-2.13.23";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCatalog/Products.ZCatalog-2.13.23.zip";
+      md5 = "d425171516dfc70e543a4e2b852301cb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_testing extensionclass missing zope_dottedname restrictedpython datetime record persistence zodb3 documenttemplate setuptools zope_interface zope_schema products_zctextindex zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_autoinclude = buildPythonPackage rec {
+    name = "z3c.autoinclude-0.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.autoinclude/z3c.autoinclude-0.3.4.zip";
+      md5 = "6a615ae18c12b459bceb3ae28e8e7709";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_dottedname zope_configuration zc_buildout setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_processlifetime = buildPythonPackage rec {
+    name = "zope.processlifetime-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.processlifetime/zope.processlifetime-1.0.tar.gz";
+      md5 = "69604bfd668a01ebebdd616a8f26ccfe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_uuid = buildPythonPackage rec {
+    name = "plone.uuid-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.uuid/plone.uuid-1.0.3.zip";
+      md5 = "183fe2911a7d6c9f6b3103855e98ad8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_browserpage zope_publisher setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_kss = buildPythonPackage rec {
+    name = "archetypes.kss-1.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.kss/archetypes.kss-1.7.2.zip";
+      md5 = "a8502140123b74f1b7ed4f36d3e56ff3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_traversing = buildPythonPackage rec {
+    name = "zope.traversing-3.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.traversing/zope.traversing-3.13.2.zip";
+      md5 = "eaad8fc7bbef126f9f8616b074ec00aa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_proxy zope_location zope_interface zope_security zope_component setuptools zope_publisher zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_gettext = buildPythonPackage rec {
+    name = "python-gettext-1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-gettext/python-gettext-1.2.zip";
+      md5 = "cd4201d440126d1296d1d2bc2b4795f3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unittest2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_stringinterp = buildPythonPackage rec {
+    name = "plone.stringinterp-1.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.stringinterp/plone.stringinterp-1.0.5.tar.gz";
+      md5 = "a60848a07b35c14639ca6aa0d9c4d66b";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18n products_cmfcore setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_container = buildPythonPackage rec {
+    name = "zope.app.container-3.9.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.container/zope.app.container-3.9.2.tar.gz";
+      md5 = "1e286c59f0166e517d67ddd723641c84";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_copypastemove zope_exceptions zope_component zope_dublincore zope_location zope_browsermenu zope_size zope_security zope_publisher zope_container zope_browserpage zope_event setuptools zope_interface zope_lifecycleevent zope_browser zope_i18n zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonelanguagetool = buildPythonPackage rec {
+    name = "Products.PloneLanguageTool-3.2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneLanguageTool/Products.PloneLanguageTool-3.2.4.tar.gz";
+      md5 = "6cdc7d49a0b76051b80ca915289ad72d";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  eggtestinfo = buildPythonPackage rec {
+    name = "eggtestinfo-0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/eggtestinfo/eggtestinfo-0.3.tar.gz";
+      md5 = "6f0507aee05f00c640c0d64b5073f840";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mailinglogger = buildPythonPackage rec {
+    name = "mailinglogger-3.3.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mailinglogger/mailinglogger-3.3.3.tar.gz";
+      md5 = "1e5897227b7990ee0c2d98f1ad33b072";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  missing = buildPythonPackage rec {
+    name = "Missing-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Missing/Missing-2.13.1.zip";
+      md5 = "9823cff54444cbbcaef8fc45d8e42572";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deferredimport = buildPythonPackage rec {
+    name = "zope.deferredimport-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deferredimport/zope.deferredimport-3.5.3.tar.gz";
+      md5 = "68fce3bf4f011d4a840902fd763884ee";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tales = buildPythonPackage rec {
+    name = "zope.tales-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tales/zope.tales-3.5.2.tar.gz";
+      md5 = "1c5060bd766a0a18632b7879fc9e4e1e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools zope_tal ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zsqlmethods = buildPythonPackage rec {
+    name = "Products.ZSQLMethods-2.13.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZSQLMethods/Products.ZSQLMethods-2.13.4.zip";
+      md5 = "bd1ad8fd4a9d4f8b4681401dd5b71dc1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass missing zope_interface datetime zope2 record transaction acquisition setuptools zodb3 persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_statusmessages = buildPythonPackage rec {
+    name = "Products.statusmessages-4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.statusmessages/Products.statusmessages-4.0.zip";
+      md5 = "265324b0a58a032dd0ed038103ed0473";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_annotation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_i18n = buildPythonPackage rec {
+    name = "plone.i18n-2.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.i18n/plone.i18n-2.0.6.zip";
+      md5 = "651e8cbc2cea201276777ab56337a3ee";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unidecode zope_publisher zope_interface zope_component setuptools zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_transformchain = buildPythonPackage rec {
+    name = "plone.transformchain-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.transformchain/plone.transformchain-1.0.2.tar.gz";
+      md5 = "18f836f28ad78ee69ab5d182a1b7664a";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluggableauthservice = buildPythonPackage rec {
+    name = "Products.PluggableAuthService-1.8.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluggableAuthService/Products.PluggableAuthService-1.8.0.tar.gz";
+      md5 = "76de2b0c95e8159c7edfe94e3fd6eb8a";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_pluginregistry zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  borg_localrole = buildPythonPackage rec {
+    name = "borg.localrole-3.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/b/borg.localrole/borg.localrole-3.0.2.zip";
+      md5 = "04082694dfda9ae5cda62747b8ac7ccf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_deferredimport zope_interface plone_memoize zope_component setuptools products_pluggableauthservice zope_annotation products_cmfcore acquisition products_plonepas ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  elementtree = buildPythonPackage rec {
+    name = "elementtree-1.2.7-20070827-preview";
+    src = fetchurl {
+      url = "http://effbot.org/media/downloads/elementtree-1.2.7-20070827-preview.zip";
+      md5 = "30e2fe5edd143f347e03a8baf5d60f8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_content = buildPythonPackage rec {
+    name = "zope.app.content-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.content/zope.app.content-3.5.1.tar.gz";
+      md5 = "0ac6a6fcb5dd6f845759f998d8e8cbb3";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_componentvocabulary zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_sunburst = buildPythonPackage rec {
+    name = "plonetheme.sunburst-1.1.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.sunburst/plonetheme.sunburst-1.1.6.tar.gz";
+      md5 = "43d3a8c79c4605dd489ed24c93cdd21f";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlets = buildPythonPackage rec {
+    name = "plone.portlets-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlets/plone.portlets-2.0.2.zip";
+      md5 = "8a719cb0495081415fe03f3c8820d6b0";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_publisher zope_site zope_container zope_interface plone_memoize zope_component zodb3 setuptools zope_schema zope_annotation zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_proxy = buildPythonPackage rec {
+    name = "zope.proxy-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.proxy/zope.proxy-3.6.1.zip";
+      md5 = "a400b0a26624b17fa889dbcaa989d440";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_archetypes = buildPythonPackage rec {
+    name = "Products.Archetypes-1.7.14";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Archetypes/Products.Archetypes-1.7.14.zip";
+      md5 = "275eb51788761fdd3b24ad836deb4311";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller products_cmftestcase zope_interface zope_contenttype datetime zope_component products_mimetypesregistry plone_app_folder zope2 zope_lifecycleevent zope_i18nmessageid zope_publisher products_genericsetup products_validation products_portaltransforms products_cmfquickinstallertool products_placelesstranslationservice zope_event acquisition products_dcworkflow products_cmfdefault zope_tal plone_folder products_statusmessages zope_schema zope_viewlet products_cmfcalendar extensionclass zope_datetime products_marshall zope_site zope_deferredimport zodb3 plone_uuid setuptools transaction zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_dublincore = buildPythonPackage rec {
+    name = "zope.dublincore-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dublincore/zope.dublincore-3.7.0.tar.gz";
+      md5 = "2e34e42e454d896feb101ac74af62ded";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_datetime zope_interface zope_location zope_security zope_component pytz setuptools zope_schema zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  initgroups = buildPythonPackage rec {
+    name = "initgroups-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/i/initgroups/initgroups-2.13.0.zip";
+      md5 = "38e842dcab8445f65e701fec75213acd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_schema = buildPythonPackage rec {
+    name = "zope.schema-4.2.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.schema/zope.schema-4.2.0.tar.gz";
+      md5 = "d1ecf5a29e8572eee28450fd9c2150da";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_publisher = buildPythonPackage rec {
+    name = "zope.app.publisher-3.10.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.publisher/zope.app.publisher-3.10.2.zip";
+      md5 = "66e9110e2967d8d204a65a98e2227404";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_componentvocabulary zope_datetime zope_browsermenu zope_interface zope_browserresource zope_security zope_configuration zope_component zope_browserpage zope_publisher setuptools zope_ptresource zope_schema zope_location ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_scale = buildPythonPackage rec {
+    name = "plone.scale-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.scale/plone.scale-1.2.2.zip";
+      md5 = "7c59522b4806ee24f5e0a5fa69c523a5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_copy = buildPythonPackage rec {
+    name = "zope.copy-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.copy/zope.copy-3.5.0.tar.gz";
+      md5 = "a9836a5d36cd548be45210eb00407337";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_event = buildPythonPackage rec {
+    name = "zope.event-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.event/zope.event-3.5.2.tar.gz";
+      md5 = "6e8af2a16157a74885d4f0d88137cefb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  acquisition = buildPythonPackage rec {
+    name = "Acquisition-2.13.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/Acquisition/Acquisition-2.13.8.zip";
+      md5 = "8c33160c157b50649e2b2b3224622579";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_linkintegrity = buildPythonPackage rec {
+    name = "plone.app.linkintegrity-1.4.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.linkintegrity/plone.app.linkintegrity-1.4.5.zip";
+      md5 = "206edc1a0b8e7755560578bee95043a8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_resourceregistries = buildPythonPackage rec {
+    name = "Products.ResourceRegistries-2.0.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ResourceRegistries/Products.ResourceRegistries-2.0.9.zip";
+      md5 = "bd6f31bb793ac5894b89763a2ac45ca0";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface datetime zope_component zodb3 setuptools zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_browserlayer = buildPythonPackage rec {
+    name = "plone.browserlayer-2.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.browserlayer/plone.browserlayer-2.1.1.tar.gz";
+      md5 = "10d5737682c3287241aab286d1477050";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_traversing zope_component setuptools products_genericsetup products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  markdown = buildPythonPackage rec {
+    name = "Markdown-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.3.zip";
+      md5 = "122418893e21e91109edbf6e082f830d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_formwidget_query = buildPythonPackage rec {
+    name = "z3c.formwidget.query-0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.formwidget.query/z3c.formwidget.query-0.5.tar.gz";
+      md5 = "a049d9f3b11bcdc48d37379e8883c5bb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_app_form z3c_form zope_interface zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_z3cform = buildPythonPackage rec {
+    name = "plone.app.z3cform-0.5.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.z3cform/plone.app.z3cform-0.5.8.zip";
+      md5 = "af8f85f81cb127d6531b191f9cef063b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 plone_z3cform zope_interface z3c_formwidget_query collective_z3cform_datetimewidget kss_core zope_component setuptools plone_app_kss ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_viewletmanager = buildPythonPackage rec {
+    name = "plone.app.viewletmanager-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.viewletmanager/plone.app.viewletmanager-2.0.2.zip";
+      md5 = "2e60a9239f70ccf40bc57a58c5fc2dd7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_site zope_interface zope_component zodb3 acquisition setuptools zope_viewlet zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ramcache = buildPythonPackage rec {
+    name = "zope.ramcache-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ramcache/zope.ramcache-1.0.zip";
+      md5 = "87289e15f0e51f50704adda1557c02a7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zodb3 zope_testing setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_vocabularies = buildPythonPackage rec {
+    name = "plone.app.vocabularies-2.1.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.vocabularies/plone.app.vocabularies-2.1.6.zip";
+      md5 = "3880f2f3310ce0b59cb6146d563047ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_app_form zope_site products_archetypes zope_interface zope_component setuptools zope_schema zope_browser zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_cache = buildPythonPackage rec {
+    name = "zope.app.cache-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.cache/zope.app.cache-3.7.0.zip";
+      md5 = "8dd74574e869ce236ced0de7e349bb5c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_ramcache zope_app_form zope_interface zope_traversing zope_publisher zope_component zodb3 zope_proxy setuptools zope_schema zope_componentvocabulary zope_app_pagetemplate zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_folder = buildPythonPackage rec {
+    name = "zope.app.folder-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.folder/zope.app.folder-3.5.2.tar.gz";
+      md5 = "5ba3a2a7ec527a7eb0cc3c2eb7bb75e9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_container zope_app_content zope_site setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_discussion = buildPythonPackage rec {
+    name = "plone.app.discussion-2.1.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.discussion/plone.app.discussion-2.1.6.zip";
+      md5 = "60fda796ae3bab6c728805050e63a8f5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_uuid zope_site plone_indexer zope_container collective_monkeypatcher zope_interface plone_app_z3cform plone_app_layout plone_z3cform plone_app_registry zope_component zodb3 zope_event setuptools z3c_form zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zlog = buildPythonPackage rec {
+    name = "zLOG-2.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zLOG/zLOG-2.11.1.tar.gz";
+      md5 = "68073679aaa79ac5a7b6a5c025467147";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone = buildPythonPackage rec {
+    name = "Plone-4.1.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Plone/Plone-4.1.6.zip";
+      md5 = "a7585cd8f8608ec251829f1e9c03f1ff";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone products_kupu plone_app_caching setuptools products_cmfplacefulworkflow plone_app_openid plone_app_iterate wicked ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_standardcachemanagers = buildPythonPackage rec {
+    name = "Products.StandardCacheManagers-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.StandardCacheManagers/Products.StandardCacheManagers-2.13.0.zip";
+      md5 = "c5088b2b62bd26d63d9579a04369cb73";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_component transaction setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_fieldsets = buildPythonPackage rec {
+    name = "plone.fieldsets-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.fieldsets/plone.fieldsets-2.0.1.zip";
+      md5 = "ae0cf4288466efb440a205764e2f5280";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_formlib zope_interface zope_component five_formlib setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_referencebrowserwidget = buildPythonPackage rec {
+    name = "archetypes.referencebrowserwidget-2.4.11";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.referencebrowserwidget/archetypes.referencebrowserwidget-2.4.11.zip";
+      md5 = "81029c17d051c0e76c2a3543a90b345c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_jquerytools zope_component zope_interface plone_app_form zope_formlib setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_zcmlhook = buildPythonPackage rec {
+    name = "z3c.zcmlhook-1.0b1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.zcmlhook/z3c.zcmlhook-1.0b1.tar.gz";
+      md5 = "7b6c80146f5930409eb0b355ddf3daeb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_configuration setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_recipe_zope2instance = buildPythonPackage rec {
+    name = "plone.recipe.zope2instance-4.1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.recipe.zope2instance/plone.recipe.zope2instance-4.1.9.zip";
+      md5 = "ad90efc7948107ab63efac46ab589569";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zc_buildout zc_recipe_egg mailinglogger setuptools zope2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_supermodel = buildPythonPackage rec {
+    name = "plone.supermodel-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.supermodel/plone.supermodel-1.1.1.zip";
+      md5 = "301bf89f7e75d372d9175c0b76ac752b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_deferredimport zope_interface zope_dottedname zope_component z3c_zcmlhook setuptools zope_schema elementtree ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_registry = buildPythonPackage rec {
+    name = "plone.app.registry-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.registry/plone.app.registry-1.0.1.tar.gz";
+      md5 = "e2bef48f39750a4c2b2afcc883b8badf";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 plone_registry products_genericsetup elementtree zope_interface plone_app_z3cform zope_dottedname zope_component products_statusmessages plone_supermodel setuptools plone_autoform products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_pagetemplate = buildPythonPackage rec {
+    name = "zope.pagetemplate-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.pagetemplate/zope.pagetemplate-3.5.2.tar.gz";
+      md5 = "caa27a15351bc2ae11f5eecb5531e6c5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_traversing zope_tales zope_security zope_component setuptools zope_tal zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfformcontroller = buildPythonPackage rec {
+    name = "Products.CMFFormController-3.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFFormController/Products.CMFFormController-3.0.2.zip";
+      md5 = "dab913bfda518714046c811e2dfe2c34";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_tales products_cmfcore zope2 setuptools zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_openid = buildPythonPackage rec {
+    name = "plone.openid-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.openid/plone.openid-2.0.1.zip";
+      md5 = "d4c36926a6dbefed035ed92c29329ce1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_pluggableauthservice python_openid zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_size = buildPythonPackage rec {
+    name = "zope.size-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.size/zope.size-3.4.1.tar.gz";
+      md5 = "55d9084dfd9dcbdb5ad2191ceb5ed03d";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetypesregistry = buildPythonPackage rec {
+    name = "Products.MimetypesRegistry-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MimetypesRegistry/Products.MimetypesRegistry-2.0.3.zip";
+      md5 = "b04aeeb9d49836272efc9ad0226d6118";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_contenttype zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_imaging = buildPythonPackage rec {
+    name = "plone.app.imaging-1.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.imaging/plone.app.imaging-1.0.6.zip";
+      md5 = "8d494cd69b3f6be7fcb9e21c20277765";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_marshall = buildPythonPackage rec {
+    name = "Products.Marshall-2.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Marshall/Products.Marshall-2.1.1.zip";
+      md5 = "5de4b78af86ea43dc4c60314ac8f681e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_contenttype datetime extensionclass plone_uuid setuptools zope2 products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ptresource = buildPythonPackage rec {
+    name = "zope.ptresource-3.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ptresource/zope.ptresource-3.9.0.tar.gz";
+      md5 = "f4645e51c15289d3fdfb4139039e18e9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_pagetemplate zope_interface zope_browserresource zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_component = buildPythonPackage rec {
+    name = "zope.app.component-3.9.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.component/zope.app.component-3.9.3.tar.gz";
+      md5 = "bc2dce245d2afe462529c350956711e0";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_component zope_site zope_deprecation zope_interface zope_traversing zope_exceptions zope_security zope_formlib zope_componentvocabulary setuptools zope_schema zope_app_pagetemplate zope_publisher zope_app_container ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  multimapping = buildPythonPackage rec {
+    name = "MultiMapping-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/MultiMapping/MultiMapping-2.13.0.zip";
+      md5 = "d69c5904c105b9f2f085d4103e0f0586";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mailhost = buildPythonPackage rec {
+    name = "Products.MailHost-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MailHost/Products.MailHost-2.13.1.zip";
+      md5 = "1102e523435d8bf78a15b9ddb57478e1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_kss = buildPythonPackage rec {
+    name = "plone.app.kss-1.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.kss/plone.app.kss-1.6.2.zip";
+      md5 = "4849de5b67ca1694791f7d916cfc4dc8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope_i18nmessageid zope2 setuptools products_archetypes zope_deprecation zope_interface kss_core zope_component products_statusmessages acquisition plone_app_portlets products_dcworkflow zope_lifecycleevent zope_i18n plone_locking products_cmfcore zope_contentprovider plone_portlets ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  pytz = buildPythonPackage rec {
+    name = "pytz-2012c";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pytz/pytz-2012c.zip";
+      md5 = "115c950275d185f69f05d5441b1c2151";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_i18n = buildPythonPackage rec {
+    name = "plone.app.i18n-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.i18n/plone.app.i18n-2.0.1.zip";
+      md5 = "39f5a8dbfe102c0309abe30a0e77f639";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_indexer = buildPythonPackage rec {
+    name = "plone.indexer-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.indexer/plone.indexer-1.0.2.zip";
+      md5 = "538aeee1f9db78bc8c85ae1bcb0153ed";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface products_cmfcore setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externalmethod = buildPythonPackage rec {
+    name = "Products.ExternalMethod-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalMethod/Products.ExternalMethod-2.13.0.zip";
+      md5 = "15ba953ef6cb632eb571977651252ea6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_upgrade = buildPythonPackage rec {
+    name = "plone.app.upgrade-1.1.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.upgrade/plone.app.upgrade-1.1.7.zip";
+      md5 = "c40910e7df831070cdba94039fbdfc11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller zope_interface products_cmfactionicons products_cmfeditions products_archetypes products_mimetypesregistry plone_app_folder products_cmfuid products_securemailhost zope_ramcache products_genericsetup products_cmfdifftool five_localsitemanager products_cmfquickinstallertool products_portaltransforms products_cmfdefault acquisition products_dcworkflow products_zcatalog borg_localrole products_contentmigration products_resourceregistries plone_portlets products_atcontenttypes zope2 plone_app_portlets products_pluggableauthservice products_cmfcalendar products_plonepas transaction zope_app_cache zope_site zope_component zope_location products_plonelanguagetool plone_session setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserpage = buildPythonPackage rec {
+    name = "zope.browserpage-3.12.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserpage/zope.browserpage-3.12.2.tar.gz";
+      md5 = "a543ef3cb1b42f7233b3fca23dc9ea60";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_pagetemplate zope_interface zope_traversing zope_component zope_security zope_configuration zope_publisher setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atcontenttypes = buildPythonPackage rec {
+    name = "Products.ATContentTypes-2.1.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATContentTypes/Products.ATContentTypes-2.1.7.zip";
+      md5 = "2dd578f1f2e23e06aaa20c70ce47b62f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface plone_memoize datetime products_archetypes products_mimetypesregistry plone_app_folder zope2 zope_i18nmessageid zope_publisher products_genericsetup plone_i18n products_portaltransforms products_cmfdefault products_atreferencebrowserwidget zope_tal zconfig archetypes_referencebrowserwidget transaction products_validation acquisition extensionclass zope_component plone_app_layout zodb3 setuptools zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfeditions = buildPythonPackage rec {
+    name = "Products.CMFEditions-2.1.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFEditions/Products.CMFEditions-2.1.7.tar.gz";
+      md5 = "a5d248705523b90526dfdfa605276943";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_cmfdifftool plone_app_blob zope_interface products_genericsetup zope_dottedname products_zopeversioncontrol datetime products_cmfuid zodb3 products_cmfcore setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_interface = buildPythonPackage rec {
+    name = "zope.interface-3.6.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.7.zip";
+      md5 = "9df962180fbbb54eb1875cff9fe436e5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_content = buildPythonPackage rec {
+    name = "plone.app.content-2.0.11";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.content/plone.app.content-2.0.11.zip";
+      md5 = "a48bc7e7a06ca80e538706ad394125a1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_publisher zope_container zope_interface plone_memoize plone_i18n products_atcontenttypes zope_component zope_event products_cmfcore setuptools zope_schema zope_lifecycleevent zope_i18n zope_viewlet acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfquickinstallertool = buildPythonPackage rec {
+    name = "Products.CMFQuickInstallerTool-3.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFQuickInstallerTool/Products.CMFQuickInstallerTool-3.0.6.tar.gz";
+      md5 = "af34adb87ddf2b6da48eff8b70ca2989";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 products_genericsetup zope_interface datetime zope_component setuptools zope_annotation products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_autoform = buildPythonPackage rec {
+    name = "plone.autoform-1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.autoform/plone.autoform-1.2.zip";
+      md5 = "f6d73e2d46d3f19601e919ce1f0ef10c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form zope_interface zope_dottedname zope_security setuptools plone_supermodel zope_schema plone_z3cform ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentrules = buildPythonPackage rec {
+    name = "plone.app.contentrules-2.1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentrules/plone.app.contentrules-2.1.5.zip";
+      md5 = "b43c695ac824140f2cb5a07ec6a38e07";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_traversing plone_app_form zope_component zope_lifecycleevent zope_annotation zope_i18nmessageid products_genericsetup zope_event products_cmfdefault zope_browser plone_app_kss plone_uuid products_archetypes plone_memoize zope2 products_atcontenttypes plone_stringinterp products_statusmessages plone_contentrules zope_schema acquisition transaction zope_site zope_container plone_app_vocabularies zope_publisher kss_core zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  record = buildPythonPackage rec {
+    name = "Record-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/Record/Record-2.13.0.zip";
+      md5 = "cfed6a89d4fb2c9cb995e9084c3071b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonetestcase = buildPythonPackage rec {
+    name = "Products.PloneTestCase-0.9.14";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneTestCase/Products.PloneTestCase-0.9.14.zip";
+      md5 = "c9539a7901c7d5418e69642ecd1b9d33";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_testing zope2 products_genericsetup zope_site zope_interface products_atcontenttypes zope_component zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  wicked = buildPythonPackage rec {
+    name = "wicked-1.1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/w/wicked/wicked-1.1.9.zip";
+      md5 = "78ab0e6dbe28eadaae11c869d6169f69";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_container zope_traversing setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_blob = buildPythonPackage rec {
+    name = "plone.app.blob-1.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.blob/plone.app.blob-1.5.2.zip";
+      md5 = "4ba2e753d3355b929891d2cd0f5fb33d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale plone_app_imaging zodb3 setuptools archetypes_schemaextender zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdynamicviewfti = buildPythonPackage rec {
+    name = "Products.CMFDynamicViewFTI-4.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDynamicViewFTI/Products.CMFDynamicViewFTI-4.0.2.zip";
+      md5 = "d29f89c3c83b3694c6f76b8c7d9b3bb2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass products_genericsetup zope_interface zope_app_publisher zope_component zope2 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_keyring = buildPythonPackage rec {
+    name = "plone.keyring-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.keyring/plone.keyring-2.0.1.zip";
+      md5 = "f3970e9bddb2cc65e461a2c62879233f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_container zope_location zodb3 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contentprovider = buildPythonPackage rec {
+    name = "zope.contentprovider-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contentprovider/zope.contentprovider-3.7.2.tar.gz";
+      md5 = "1bb2132551175c0123f17939a793f812";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_interface zope_location zope_tales zope_component zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atreferencebrowserwidget = buildPythonPackage rec {
+    name = "Products.ATReferenceBrowserWidget-3.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATReferenceBrowserWidget/Products.ATReferenceBrowserWidget-3.0.zip";
+      md5 = "157bdd32155c8353450c17c649aad042";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_deprecation archetypes_referencebrowserwidget setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserresource = buildPythonPackage rec {
+    name = "zope.browserresource-3.10.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserresource/zope.browserresource-3.10.3.zip";
+      md5 = "dbfde30e82dbfa1a74c5da0cb5a4772d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_traversing zope_contenttype zope_configuration zope_publisher setuptools zope_schema zope_i18n zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_caching = buildPythonPackage rec {
+    name = "plone.caching-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.caching/plone.caching-1.0.zip";
+      md5 = "2c2e3b27d13b9101c92dfed222fde36c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid five_globalrequest z3c_caching zope_interface zope2 zope_component setuptools plone_transformchain zope_schema plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_locales = buildPythonPackage rec {
+    name = "zope.app.locales-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.locales/zope.app.locales-3.6.2.tar.gz";
+      md5 = "bd2b4c6040e768f33004b1210d3207fa";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_placelesstranslationservice = buildPythonPackage rec {
+    name = "Products.PlacelessTranslationService-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlacelessTranslationService/Products.PlacelessTranslationService-2.0.3.zip";
+      md5 = "a94635eb712563c5a002520713f5d6dc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zope_publisher zope_deferredimport zope_deprecation zope_interface python_gettext datetime zope_component zodb3 setuptools zope_annotation zope_i18n zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_z3cform = buildPythonPackage rec {
+    name = "plone.z3cform-0.7.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.z3cform/plone.z3cform-0.7.8.zip";
+      md5 = "da891365156a5d5824d4e504465886a2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_batching z3c_form zope_i18n zope_component collective_monkeypatcher setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_lifecycleevent = buildPythonPackage rec {
+    name = "zope.lifecycleevent-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.lifecycleevent/zope.lifecycleevent-3.6.2.tar.gz";
+      md5 = "3ba978f3ba7c0805c81c2c79ea3edb33";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_form = buildPythonPackage rec {
+    name = "zope.app.form-4.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.form/zope.app.form-4.0.2.tar.gz";
+      md5 = "3d2b164d9d37a71490a024aaeb412e91";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_schema transaction zope_datetime zope_browsermenu zope_interface zope_exceptions zope_security zope_configuration zope_publisher zope_component zope_formlib zope_browser setuptools zope_proxy zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_tinymce = buildPythonPackage rec {
+    name = "Products.TinyMCE-1.2.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.TinyMCE/Products.TinyMCE-1.2.12.zip";
+      md5 = "0a6ae43c75950878691d9136c356df18";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_imaging elementtree plone_outputfilters setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_z3cform_datetimewidget = buildPythonPackage rec {
+    name = "collective.z3cform.datetimewidget-1.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.z3cform.datetimewidget/collective.z3cform.datetimewidget-1.0.5.tar.gz";
+      md5 = "3c6703fa6ef43bc749411c90a5e1fc77";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ z3c_form zope_deprecation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_protect = buildPythonPackage rec {
+    name = "plone.protect-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.protect/plone.protect-2.0.2.zip";
+      md5 = "74925ffb08782e72f9b1e850fa78fffa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component plone_keyring zope2 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_dcworkflow = buildPythonPackage rec {
+    name = "Products.DCWorkflow-2.2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.DCWorkflow/Products.DCWorkflow-2.2.4.tar.gz";
+      md5 = "c90a16c4f3611015592ba8173a5f1863";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mechanize = buildPythonPackage rec {
+    name = "mechanize-0.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip";
+      md5 = "a497ad4e875f7506ffcf8ad3ada4c2fc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_iterate = buildPythonPackage rec {
+    name = "plone.app.iterate-2.1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.iterate/plone.app.iterate-2.1.5.zip";
+      md5 = "7b7b9fcac73dfdd0edee042eec8d6489";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope_i18nmessageid zodb3 products_archetypes zope_interface plone_memoize products_cmfeditions datetime zope_component products_statusmessages zope_event setuptools products_dcworkflow zope_schema products_cmfplacefulworkflow zope_annotation zope2 plone_locking products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  accesscontrol = buildPythonPackage rec {
+    name = "AccessControl-2.13.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/AccessControl/AccessControl-2.13.7.zip";
+      md5 = "b64088eecdc488e6b2a5b6eced2cfaa6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_security zope_testing extensionclass zope_publisher restrictedpython zope_interface zope_deferredimport zope_schema zope_configuration datetime record transaction acquisition zodb3 zope_component zexceptions persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testing = buildPythonPackage rec {
+    name = "zope.testing-3.9.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testing/zope.testing-3.9.7.tar.gz";
+      md5 = "8999f3d143d416dc3c8b2a5bd6f33e28";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_exceptions setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externaleditor = buildPythonPackage rec {
+    name = "Products.ExternalEditor-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalEditor/Products.ExternalEditor-1.0.zip";
+      md5 = "015350455d140233cb3aa4846cae2571";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_publication = buildPythonPackage rec {
+    name = "zope.app.publication-3.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.publication/zope.app.publication-3.12.0.zip";
+      md5 = "d8c521287f52fb9f40fa9b8c2acb4675";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_authentication zope_publisher zope_interface zope_location zope_traversing zope_component zope_error zodb3 setuptools zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_filerepresentation = buildPythonPackage rec {
+    name = "zope.filerepresentation-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.filerepresentation/zope.filerepresentation-3.6.1.tar.gz";
+      md5 = "4a7a434094f4bfa99a7f22e75966c359";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_globalrequest = buildPythonPackage rec {
+    name = "five.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.globalrequest/five.globalrequest-1.0.tar.gz";
+      md5 = "87f8996bd21d4aa156aa26e7d21b8744";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_globalrequest zope2 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_exceptions = buildPythonPackage rec {
+    name = "zope.exceptions-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.exceptions/zope.exceptions-3.6.2.tar.gz";
+      md5 = "d7234d99d728abe3d9275346e8d24fd9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_layout = buildPythonPackage rec {
+    name = "plone.app.layout-2.1.13";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.layout/plone.app.layout-2.1.13.tar.gz";
+      md5 = "b8652d42bb04ee1977ff6bbb15b38857";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_deprecation zope_interface plone_memoize zope_dottedname datetime zope_component zope_annotation zope_publisher plone_i18n products_cmfdefault plone_app_controlpanel plone_app_viewletmanager plone_portlets plone_app_portlets zope_schema zope_viewlet acquisition zope2 setuptools zope_i18n plone_locking products_cmfcore products_cmfeditions ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contenttype = buildPythonPackage rec {
+    name = "zope.contenttype-3.5.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contenttype/zope.contenttype-3.5.5.zip";
+      md5 = "c6ac80e6887de4108a383f349fbdf332";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_customerize = buildPythonPackage rec {
+    name = "five.customerize-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.customerize/five.customerize-1.0.3.zip";
+      md5 = "32f597c2fa961f7dcc84b23e655d928e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing transaction zope_publisher zope_site zope_pagetemplate zope_interface zope_traversing zope_dottedname plone_portlets zope_component zope_componentvocabulary setuptools zope_app_pagetemplate zope_schema zope_lifecycleevent zope2 zope_viewlet acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_site = buildPythonPackage rec {
+    name = "zope.site-3.9.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.site/zope.site-3.9.2.tar.gz";
+      md5 = "36a0b8dfbd713ed452ce6973ab0a3ddb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_location zope_interface zope_security zope_container zope_event setuptools zope_lifecycleevent zope_annotation zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_uuid = buildPythonPackage rec {
+    name = "plone.app.uuid-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.uuid/plone.app.uuid-1.0.zip";
+      md5 = "9ca8dcfb09a8a0d6bbee0f28073c3d3f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_indexer zope_interface zope_publisher plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unittest2 = buildPythonPackage rec {
+    name = "unittest2-0.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.zip";
+      md5 = "1527fb89e38343945af1166342d851ee";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  persistence = buildPythonPackage rec {
+    name = "Persistence-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Persistence/Persistence-2.13.2.zip";
+      md5 = "92693648ccdc59c8fc71f7f06b1d228c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zopeversioncontrol = buildPythonPackage rec {
+    name = "Products.ZopeVersionControl-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZopeVersionControl/Products.ZopeVersionControl-1.1.3.zip";
+      md5 = "238239102f3ac798ee4f4c53343a561f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction zope_interface datetime zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_location = buildPythonPackage rec {
+    name = "zope.location-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.location/zope.location-3.9.1.tar.gz";
+      md5 = "1684a8f986099d15296f670c58e713d8";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_schema zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browsermenu = buildPythonPackage rec {
+    name = "zope.browsermenu-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browsermenu/zope.browsermenu-3.9.1.zip";
+      md5 = "a47c7b1e786661c912a1150bf8d1f83f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_interface zope_traversing zope_component zope_security zope_configuration zope_pagetemplate setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_workflow = buildPythonPackage rec {
+    name = "plone.app.workflow-2.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.workflow/plone.app.workflow-2.0.6.zip";
+      md5 = "7e217af9bd7a9e6cd4dbe9791dd844ad";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_genericsetup zope_site zope_interface plone_memoize zope_testing datetime kss_core zope_component products_cmfcore products_statusmessages zope2 setuptools products_dcworkflow zope_schema zope_i18n plone_app_kss acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_locking = buildPythonPackage rec {
+    name = "plone.locking-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.locking/plone.locking-2.0.3.tar.gz";
+      md5 = "73b8a045121ad14e2e0ed3fc2713fa63";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime zope_component zodb3 setuptools zope_schema zope_annotation zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_dottedname = buildPythonPackage rec {
+    name = "zope.dottedname-3.4.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dottedname/zope.dottedname-3.4.6.tar.gz";
+      md5 = "62d639f75b31d2d864fe5982cb23959c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_cachedescriptors = buildPythonPackage rec {
+    name = "zope.cachedescriptors-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.cachedescriptors/zope.cachedescriptors-3.5.1.zip";
+      md5 = "263459a95238fd61d17e815d97ca49ce";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_lockfile = buildPythonPackage rec {
+    name = "zc.lockfile-1.0.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.lockfile/zc.lockfile-1.0.0.tar.gz";
+      md5 = "6cf83766ef9935c33e240b0904c7a45e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_contentrules = buildPythonPackage rec {
+    name = "plone.contentrules-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.contentrules/plone.contentrules-2.0.1.zip";
+      md5 = "3ae91cb7a21749e14f4cd7564dcf1619";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_container zope_interface zope_testing zope_configuration zope_component zope_componentvocabulary setuptools zodb3 zope_schema zope_lifecycleevent zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sendmail = buildPythonPackage rec {
+    name = "zope.sendmail-3.7.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sendmail/zope.sendmail-3.7.5.tar.gz";
+      md5 = "8a513ecf2b41cad849f6607bf16d6818";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_interface zope_configuration setuptools zope_schema zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_formlib = buildPythonPackage rec {
+    name = "zope.formlib-4.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.formlib/zope.formlib-4.0.6.zip";
+      md5 = "eed9c94382d11a4dececd0a48ac1d3f2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_schema zope_datetime zope_interface zope_traversing zope_security zope_component pytz zope_event zope_browser setuptools zope_lifecycleevent zope_i18n zope_browserpage ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_caching = buildPythonPackage rec {
+    name = "plone.app.caching-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.caching/plone.app.caching-1.0.3.zip";
+      md5 = "37429bd0fb79814ac1b3383acb215226";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize zope_publisher plone_protect zope_pagetemplate zope_interface plone_app_z3cform plone_app_registry products_cmfcore zope_component z3c_form products_statusmessages plone_caching z3c_zcmlhook setuptools python_dateutil zope2 plone_cachepurging plone_registry products_genericsetup acquisition products_cmfdynamicviewfti ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplone = buildPythonPackage rec {
+    name = "Products.CMFPlone-4.1.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlone/Products.CMFPlone-4.1.6.zip";
+      md5 = "ac1e1b42c429b9d1d0b9c8b620d7723d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti plone_app_blob products_dcworkflow products_extendedpathindex zope_dottedname datetime zope_traversing products_tinymce zope_publisher plone_app_contentmenu plonetheme_classic plone_fieldsets products_cmfdefault five_localsitemanager products_externaleditor products_pluginregistry products_cmfeditions products_resourceregistries zope_tal plone_app_jquerytools products_genericsetup acquisition plone_app_vocabularies zope_location products_plonelanguagetool borg_localrole kss_core zope_i18n products_cmfuid plone_theme plone_memoize plone_app_i18n zope_component products_mimetypesregistry plone_app_folder plone_registry zope_i18nmessageid plone_app_upgrade products_cmfdifftool plone_app_layout products_portaltransforms plone_app_controlpanel plone_app_locales plone_app_linkintegrity zope2 plone_contentrules plone_app_portlets products_plonepas zope_pagetemplate zodb3 plone_locking products_cmfformcontroller zope_deprecation plone_app_form products_cmfquickinstallertool five_customerize plone_app_redirector plone_i18n plone_app_registry products_placelesstranslationservice z3c_autoinclude zope_interface zope_event plone_app_viewletmanager zope_structuredtext plone_app_customerize zope_app_locales plone_portlets products_statusmessages products_cmfcalendar extensionclass products_pluggableauthservice plone_indexer zope_deferredimport zope_container plone_app_workflow plone_browserlayer setuptools plone_portlet_collection plone_app_contentrules products_cmfactionicons products_archetypes plone_app_users plone_intelligenttext products_passwordresettool plone_app_content plonetheme_sunburst archetypes_kss plone_app_kss plone_protect zope_tales plone_app_uuid archetypes_referencebrowserwidget products_atcontenttypes transaction zope_site plone_app_discussion plone_portlet_static plone_session products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  transaction = buildPythonPackage rec {
+    name = "transaction-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/transaction/transaction-1.1.1.tar.gz";
+      md5 = "30b062baa34fe1521ad979fb088c8c55";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_controlpanel = buildPythonPackage rec {
+    name = "plone.app.controlpanel-2.1.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.controlpanel/plone.app.controlpanel-2.1.4.zip";
+      md5 = "254da507958dcb54b60bcc9e37360c94";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface plone_memoize zope_component plone_app_workflow zope_annotation zope_ramcache zope_publisher products_portaltransforms plone_fieldsets zope_event products_cmfdefault zope_cachedescriptors plone_app_form zope_app_form setuptools products_statusmessages zope_schema zope2 acquisition products_plonepas zope_site products_archetypes plone_app_vocabularies zope_formlib zodb3 plone_protect zope_i18n plone_locking products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_redirector = buildPythonPackage rec {
+    name = "plone.app.redirector-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.redirector/plone.app.redirector-1.1.3.zip";
+      md5 = "7d441340a83b8ed72a03bc16148a5f21";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_component = buildPythonPackage rec {
+    name = "zope.component-3.9.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.component/zope.component-3.9.5.tar.gz";
+      md5 = "22780b445b1b479701c05978055d1c82";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_broken = buildPythonPackage rec {
+    name = "zope.broken-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.broken/zope.broken-3.6.0.zip";
+      md5 = "eff24d7918099a3e899ee63a9c31bee6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_recipe_egg = buildPythonPackage rec {
+    name = "zc.recipe.egg-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.recipe.egg/zc.recipe.egg-1.2.2.tar.gz";
+      md5 = "fe5ad0f1c0fc3d4348286534e1b9cec5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zc_buildout setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_openid = buildPythonPackage rec {
+    name = "plone.app.openid-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.openid/plone.app.openid-2.0.2.tar.gz";
+      md5 = "ae0748f91cab0612a498926d405d8edd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_plonepas zope_i18nmessageid zope2 setuptools plone_openid zope_interface plone_portlets zope_component plone_app_portlets products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_caching = buildPythonPackage rec {
+    name = "z3c.caching-2.0a1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.caching/z3c.caching-2.0a1.tar.gz";
+      md5 = "17f250b5084c2324a7d15c6810ee628e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_openid = buildPythonPackage rec {
+    name = "python-openid-2.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-openid/python-openid-2.2.5.zip";
+      md5 = "f89d9d4f4dccfd33b5ce34eb4725f751";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  tempstorage = buildPythonPackage rec {
+    name = "tempstorage-2.12.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tempstorage/tempstorage-2.12.1.zip";
+      md5 = "8389f6c9a653a0ee2b82138502e28487";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfactionicons = buildPythonPackage rec {
+    name = "Products.CMFActionIcons-2.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFActionIcons/Products.CMFActionIcons-2.1.3.tar.gz";
+      md5 = "ab1dc62404ed11aea84dc0d782b2235e";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zctextindex = buildPythonPackage rec {
+    name = "Products.ZCTextIndex-2.13.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCTextIndex/Products.ZCTextIndex-2.13.3.zip";
+      md5 = "bf95ea9fa2831237fa3c3d38fafdec96";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol transaction zope_interface zexceptions zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  extensionclass = buildPythonPackage rec {
+    name = "ExtensionClass-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/E/ExtensionClass/ExtensionClass-2.13.2.zip";
+      md5 = "0236e6d7da9e8b87b9ba45f1b8f930b8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+}; in plone43Packages
diff --git a/pkgs/development/web/plone/4.2.5.nix b/pkgs/development/web/plone/4.2.5.nix
new file mode 100644
index 00000000000..6006e5908b2
--- /dev/null
+++ b/pkgs/development/web/plone/4.2.5.nix
@@ -0,0 +1,5394 @@
+# DO NOT EDIT THIS FILE!
+#
+# Nix expressions autogenerated with:
+#   bin/pypi2nix -n plone43Packages -d Plone -d mailinglogger -d zc.recipe.egg -d plone.recipe.zope2instance -d Pillow -i setuptools -i zc_buildout -i pillow -e plone/4.2.5.json -p plone/4.2.5.txt -o plone/4.2.5.nix
+
+{ pkgs, pythonPackages }:
+
+let plone43Packages = pythonPackages.python.modules // rec {
+  inherit (pythonPackages) buildPythonPackage setuptools zc_buildout pillow;
+  inherit (pkgs) fetchurl stdenv;
+
+  plone_app_portlets = buildPythonPackage rec {
+    name = "plone.app.portlets-2.3.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.portlets/plone.app.portlets-2.3.8.zip";
+      md5 = "3d18ff10053f5a04670f22e6359d2804";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface zope_traversing plone_app_form datetime zope_container zope_lifecycleevent zope_annotation five_customerize zope_i18nmessageid zope_publisher products_genericsetup plone_i18n feedparser zope_event zope_browser zope_contentprovider plone_memoize zope2 zope_schema acquisition transaction products_pluggableauthservice zope_site zope_component plone_app_vocabularies plone_portlets plone_app_i18n zope_configuration zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope2 = buildPythonPackage rec {
+    name = "Zope2-2.13.19";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/Zope2/Zope2-2.13.19.zip";
+      md5 = "26fee311aace7c12e406543ea91eb42a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_traversing multimapping zope_size zope_contenttype zope_browserpage datetime zope_component zope_sendmail zope_lifecycleevent products_zctextindex products_standardcachemanagers persistence products_mimetools zope_i18nmessageid zope_publisher missing zope_viewlet zope_sequencesort zope_testbrowser docutils zope_event products_pythonscripts zope_browser zope_structuredtext zope_contentprovider zope_browsermenu zope_tal zope_exceptions products_mailhost products_btreefolder2 zopeundo zconfig record accesscontrol pytz products_ofsp zope_schema zexceptions zope_processlifetime acquisition extensionclass zope_proxy zope_site zope_container zope_pagetemplate zdaemon zope_browserresource zope_deferredimport initgroups zope_security zope_configuration zope_i18n products_zcatalog restrictedpython zodb3 documenttemplate setuptools zope_ptresource zlog tempstorage transaction zope_tales zope_location products_externalmethod ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_btreefolder2 = buildPythonPackage rec {
+    name = "Products.BTreeFolder2-2.13.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.BTreeFolder2/Products.BTreeFolder2-2.13.3.tar.gz";
+      md5 = "f57c85673036af7ccd34c3fa251f6bb2";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ accesscontrol zope_container zodb3 zope_event persistence setuptools zope_lifecycleevent acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pythonscripts = buildPythonPackage rec {
+    name = "Products.PythonScripts-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PythonScripts/Products.PythonScripts-2.13.2.zip";
+      md5 = "04c86f2c45a29a162297a80dac61d14f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol datetime restrictedpython documenttemplate setuptools zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zopeundo = buildPythonPackage rec {
+    name = "ZopeUndo-2.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZopeUndo/ZopeUndo-2.12.0.zip";
+      md5 = "2b8da09d1b98d5558f62e12f6e52c401";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  datetime = buildPythonPackage rec {
+    name = "DateTime-2.12.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DateTime/DateTime-2.12.7.zip";
+      md5 = "72a8bcf80b52211ae7fdfe36c693d70c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface pytz ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_session = buildPythonPackage rec {
+    name = "plone.session-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.session/plone.session-3.5.3.zip";
+      md5 = "f95872454735abc8f27c3dcbc9434c11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_pluggableauthservice plone_keyring zope_interface setuptools zope_component plone_protect ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_container = buildPythonPackage rec {
+    name = "zope.container-3.11.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.container/zope.container-3.11.2.tar.gz";
+      md5 = "fc66d85a17b8ffb701091c9328983dcc";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_filerepresentation zope_i18nmessageid zope_publisher zope_broken zope_interface zope_size zope_dottedname zope_security zope_location zope_lifecycleevent zope_component zodb3 zope_event setuptools zope_schema zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_folder = buildPythonPackage rec {
+    name = "plone.folder-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.folder/plone.folder-1.0.4.zip";
+      md5 = "1674ff18b7a9452d0c2063cf11c679b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope_interface plone_memoize zope_container setuptools zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonepas = buildPythonPackage rec {
+    name = "Products.PlonePAS-4.0.16";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlonePAS/Products.PlonePAS-4.0.16.zip";
+      md5 = "f504cdfb5d1e9703cf526f6f03c9a1c5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_genericsetup plone_memoize plone_i18n plone_session zope2 setuptools products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_locales = buildPythonPackage rec {
+    name = "plone.app.locales-4.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.locales/plone.app.locales-4.2.5.zip";
+      md5 = "baf48a0a5278a18fa1c2848d3470464f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sequencesort = buildPythonPackage rec {
+    name = "zope.sequencesort-3.4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sequencesort/zope.sequencesort-3.4.0.tar.gz";
+      md5 = "cfc35fc426a47f5c0ee43c416224b864";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_genericsetup = buildPythonPackage rec {
+    name = "Products.GenericSetup-1.7.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.GenericSetup/Products.GenericSetup-1.7.3.tar.gz";
+      md5 = "c48967c81c880ed33ee16a14caab3b11";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_formlib five_localsitemanager zope2 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  kss_core = buildPythonPackage rec {
+    name = "kss.core-1.6.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/k/kss.core/kss.core-1.6.5.zip";
+      md5 = "87e66e78c3bbd7af3ecce5b2fef935ae";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_security zope_datetime zope_site zope_pagetemplate zope_interface zope_browserresource zope_contenttype zope_configuration zope_publisher zope_component zope_browserpage zope_event setuptools zope_schema zope_lifecycleevent zope_location zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tal = buildPythonPackage rec {
+    name = "zope.tal-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tal/zope.tal-3.5.2.zip";
+      md5 = "13869f292ba36b294736b7330b1396fd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_cachepurging = buildPythonPackage rec {
+    name = "plone.cachepurging-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.cachepurging/plone.cachepurging-1.0.4.zip";
+      md5 = "886814ac4deef0f1ed99a2eb60864264";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 five_globalrequest zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_protect = buildPythonPackage rec {
+    name = "plone.protect-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.protect/plone.protect-2.0.2.zip";
+      md5 = "74925ffb08782e72f9b1e850fa78fffa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component plone_keyring zope2 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_portaltransforms = buildPythonPackage rec {
+    name = "Products.PortalTransforms-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PortalTransforms/Products.PortalTransforms-2.1.2.zip";
+      md5 = "9f429f3c3b9e0019d0f6c9b7a8a9376e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_structuredtext products_mimetypesregistry zodb3 products_cmfdefault plone_intelligenttext setuptools markdown products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_memoize = buildPythonPackage rec {
+    name = "plone.memoize-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.memoize/plone.memoize-1.1.1.zip";
+      md5 = "d07cd14b976160e1f26a859e3370147e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope_annotation zope_ramcache setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  docutils = buildPythonPackage rec {
+    name = "docutils-0.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/docutils/docutils-0.9.1.tar.gz";
+      md5 = "b0d5cd5298fedf9c62f5fd364a274d56";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_formlib = buildPythonPackage rec {
+    name = "five.formlib-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.formlib/five.formlib-1.0.4.zip";
+      md5 = "09fcecbb7e0ed4a31a4f19787c1a78b4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_app_form zope_formlib zope_interface zope_location zope_publisher zope_component extensionclass zope_event setuptools zope_schema zope_lifecycleevent zope_browser zope2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zexceptions = buildPythonPackage rec {
+    name = "zExceptions-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zExceptions/zExceptions-2.13.0.zip";
+      md5 = "4c679696c959040d8e656ef85ae40136";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_publisher zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfuid = buildPythonPackage rec {
+    name = "Products.CMFUid-2.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFUid/Products.CMFUid-2.2.1.tar.gz";
+      md5 = "e20727959351dffbf0bac80613eee110";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  restrictedpython = buildPythonPackage rec {
+    name = "RestrictedPython-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/RestrictedPython/RestrictedPython-3.6.0.zip";
+      md5 = "aa75a7dcc7fbc966357837cc66cacec6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_theming = buildPythonPackage rec {
+    name = "plone.app.theming-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.theming/plone.app.theming-1.0.4.zip";
+      md5 = "2da6d810e0d5f295dd0daa2b60731a1b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone plone_resource repoze_xmliter plone_app_registry plone_transformchain zope_traversing lxml setuptools five_globalrequest diazo plone_subrequest ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  feedparser = buildPythonPackage rec {
+    name = "feedparser-5.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/feedparser/feedparser-5.0.1.zip";
+      md5 = "cefffeba66b658d3cc7c1d66b92c6a1a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browser = buildPythonPackage rec {
+    name = "zope.browser-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browser/zope.browser-1.3.zip";
+      md5 = "4ff0ddbf64c45bfcc3189e35f4214ded";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdefault = buildPythonPackage rec {
+    name = "Products.CMFDefault-2.2.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDefault/Products.CMFDefault-2.2.3.tar.gz";
+      md5 = "fe7d2d3906ee0e3b484e4a02401576ab";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_genericsetup products_cmfcore five_formlib setuptools zope2 eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_dateutil = buildPythonPackage rec {
+    name = "python-dateutil-1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz";
+      md5 = "0dcb1de5e5cad69490a3b6ab63f0cfa5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_error = buildPythonPackage rec {
+    name = "zope.error-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.error/zope.error-3.7.4.tar.gz";
+      md5 = "281445a906458ff5f18f56923699a127";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_exceptions setuptools zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetools = buildPythonPackage rec {
+    name = "Products.MIMETools-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MIMETools/Products.MIMETools-2.13.0.zip";
+      md5 = "ad5372fc1190599a19493db0864448ec";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ documenttemplate setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deprecation = buildPythonPackage rec {
+    name = "zope.deprecation-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deprecation/zope.deprecation-3.4.1.tar.gz";
+      md5 = "8a47b0f8e1fa4e833007e5b8351bb1d4";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unidecode = buildPythonPackage rec {
+    name = "Unidecode-0.04.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.1.tar.gz";
+      md5 = "c4c9ed8d40cff25c390ff5d5112b9308";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcore = buildPythonPackage rec {
+    name = "Products.CMFCore-2.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCore/Products.CMFCore-2.2.7.tar.gz";
+      md5 = "9320a4023b8575097feacfd4a400e930";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_genericsetup zope_app_publication products_zsqlmethods zope2 setuptools five_localsitemanager ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_localsitemanager = buildPythonPackage rec {
+    name = "five.localsitemanager-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.localsitemanager/five.localsitemanager-2.0.5.zip";
+      md5 = "5e3a658e6068832bd802018ebc83f2d4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_site zope_interface zope_location zope_component zodb3 zope_event setuptools zope_lifecycleevent zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_configuration = buildPythonPackage rec {
+    name = "zope.configuration-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.configuration/zope.configuration-3.7.4.zip";
+      md5 = "5b0271908ef26c05059eda76928896ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_batching = buildPythonPackage rec {
+    name = "z3c.batching-1.1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.batching/z3c.batching-1.1.0.tar.gz";
+      md5 = "d1dc834781d228127ca6d15301757863";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcalendar = buildPythonPackage rec {
+    name = "Products.CMFCalendar-2.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCalendar/Products.CMFCalendar-2.2.2.tar.gz";
+      md5 = "49458e68dc3b6826ea9a3576ac014419";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfdefault zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_extendedpathindex = buildPythonPackage rec {
+    name = "Products.ExtendedPathIndex-3.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExtendedPathIndex/Products.ExtendedPathIndex-3.1.zip";
+      md5 = "00c048a4b103200bdcbda61fa22c66df";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol transaction zope2 setuptools zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_schemaextender = buildPythonPackage rec {
+    name = "archetypes.schemaextender-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.schemaextender/archetypes.schemaextender-2.1.2.zip";
+      md5 = "865aa5b4b6b26e3bb650d89ddfe77c87";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zconfig = buildPythonPackage rec {
+    name = "ZConfig-2.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZConfig/ZConfig-2.9.0.zip";
+      md5 = "5c932690a70c8907efd240cdd76a7bc4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_copypastemove = buildPythonPackage rec {
+    name = "zope.copypastemove-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.copypastemove/zope.copypastemove-3.7.0.tar.gz";
+      md5 = "f335940686d15cfc5520c42f2494a924";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_container zope_copy zope_interface zope_location zope_exceptions zope_component zope_event setuptools zope_lifecycleevent zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentmenu = buildPythonPackage rec {
+    name = "plone.app.contentmenu-2.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentmenu/plone.app.contentmenu-2.0.8.zip";
+      md5 = "8ba463f1a164c454c70d26507e5bd22a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_publisher products_cmfdynamicviewfti zope_browsermenu zope_interface plone_memoize plone_app_content zope_component acquisition setuptools zope_i18n plone_locking products_cmfcore zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluginregistry = buildPythonPackage rec {
+    name = "Products.PluginRegistry-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluginRegistry/Products.PluginRegistry-1.3.tar.gz";
+      md5 = "5b166193ca1eb84dfb402051f779ebab";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplacefulworkflow = buildPythonPackage rec {
+    name = "Products.CMFPlacefulWorkflow-1.5.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlacefulWorkflow/Products.CMFPlacefulWorkflow-1.5.9.zip";
+      md5 = "9041e1f52eab5b348c0dfa85be438722";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_i18nmessageid products_plonetestcase products_genericsetup zope_interface zope_testing zope_component setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_outputfilters = buildPythonPackage rec {
+    name = "plone.outputfilters-1.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.outputfilters/plone.outputfilters-1.8.zip";
+      md5 = "a5ef28580f7fa7f2dc1768893995b0f7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_portaltransforms products_mimetypesregistry products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_publisher = buildPythonPackage rec {
+    name = "zope.publisher-3.12.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.publisher/zope.publisher-3.12.6.tar.gz";
+      md5 = "495131970cc7cb14de8e517fb3857ade";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_contenttype zope_proxy zope_interface zope_location zope_exceptions zope_security zope_configuration zope_component zope_event setuptools zope_browser zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_security = buildPythonPackage rec {
+    name = "zope.security-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.security/zope.security-3.7.4.tar.gz";
+      md5 = "072ab8d11adc083eace11262da08630c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema zope_interface zope_location zope_configuration zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zdaemon = buildPythonPackage rec {
+    name = "zdaemon-2.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zdaemon/zdaemon-2.0.7.tar.gz";
+      md5 = "291a875f82e812110557eb6704af8afe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_annotation = buildPythonPackage rec {
+    name = "zope.annotation-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.annotation/zope.annotation-3.5.0.tar.gz";
+      md5 = "4238153279d3f30ab5613438c8e76380";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy zope_interface zope_location zope_component zodb3 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  repoze_xmliter = buildPythonPackage rec {
+    name = "repoze.xmliter-0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/repoze.xmliter/repoze.xmliter-0.5.zip";
+      md5 = "99da76bcbad6fbaced4a273bde29b10e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_form = buildPythonPackage rec {
+    name = "plone.app.form-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.form/plone.app.form-2.1.2.zip";
+      md5 = "8017f8f782d992825ed71d16b126c4e7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema zope_site plone_app_vocabularies zope2 datetime zope_component zope_event five_formlib setuptools zope_interface zope_lifecycleevent zope_formlib zope_browser zope_i18n plone_locking products_cmfcore acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_structuredtext = buildPythonPackage rec {
+    name = "zope.structuredtext-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.structuredtext/zope.structuredtext-3.5.1.tar.gz";
+      md5 = "eabbfb983485d0879322bc878d2478a0";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_validation = buildPythonPackage rec {
+    name = "Products.validation-2.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.validation/Products.validation-2.0.zip";
+      md5 = "afa217e2306637d1dccbebf337caa8bf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime setuptools zope_i18n acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zodb3 = buildPythonPackage rec {
+    name = "ZODB3-3.10.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-3.10.5.tar.gz";
+      md5 = "6f180c6897a1820948fee2a6290503cd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface transaction zconfig zope_event zdaemon zc_lockfile ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  documenttemplate = buildPythonPackage rec {
+    name = "DocumentTemplate-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DocumentTemplate/DocumentTemplate-2.13.2.zip";
+      md5 = "07bb086c77c1dfe94125ad2efbba94b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zope_sequencesort zexceptions restrictedpython zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_search = buildPythonPackage rec {
+    name = "plone.app.search-1.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.search/plone.app.search-1.0.8.zip";
+      md5 = "80dffacba718ab809d28147b5b6b0892";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_contentlisting setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  diazo = buildPythonPackage rec {
+    name = "diazo-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/diazo/diazo-1.0.3.zip";
+      md5 = "d3c2b017af521db4c86fb360c86e0bc8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml experimental_cssselect setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_globalrequest = buildPythonPackage rec {
+    name = "zope.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.globalrequest/zope.globalrequest-1.0.zip";
+      md5 = "ae6ff02db5ba89c1fb96ed7a73ca1cfa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_customerize = buildPythonPackage rec {
+    name = "plone.app.customerize-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.customerize/plone.app.customerize-1.2.2.zip";
+      md5 = "6a3802c4e8fbd955597adc6a8298febf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope2 zope_publisher zope_interface plone_browserlayer plone_portlets zope_component setuptools five_customerize products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdifftool = buildPythonPackage rec {
+    name = "Products.CMFDiffTool-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDiffTool/Products.CMFDiffTool-2.0.2.zip";
+      md5 = "c12ba4fb9912a9a5a046b07b5b1cf69d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testbrowser = buildPythonPackage rec {
+    name = "zope.testbrowser-3.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testbrowser/zope.testbrowser-3.11.1.tar.gz";
+      md5 = "64abbee892121e7f1a91aed12cfc155a";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface mechanize pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_contentmigration = buildPythonPackage rec {
+    name = "Products.contentmigration-2.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.contentmigration/Products.contentmigration-2.1.3.zip";
+      md5 = "e15b9777593157f060b50638b0253be1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_intelligenttext = buildPythonPackage rec {
+    name = "plone.intelligenttext-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.intelligenttext/plone.intelligenttext-2.0.2.zip";
+      md5 = "51688fa0815b49e00334e3ef948328ba";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfquickinstallertool = buildPythonPackage rec {
+    name = "Products.CMFQuickInstallerTool-3.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFQuickInstallerTool/Products.CMFQuickInstallerTool-3.0.6.tar.gz";
+      md5 = "af34adb87ddf2b6da48eff8b70ca2989";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 products_genericsetup zope_interface datetime zope_component setuptools zope_annotation products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_kupu = buildPythonPackage rec {
+    name = "Products.kupu-1.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.kupu/Products.kupu-1.5.1.zip";
+      md5 = "b884fcc7f510426974d8d3c4333da4f4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid products_genericsetup zope_app_component zope_interface products_portaltransforms products_cmfcore products_archetypes products_mimetypesregistry setuptools products_cmfplone zope_schema zope_i18n plone_outputfilters ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_authentication = buildPythonPackage rec {
+    name = "zope.authentication-3.7.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.authentication/zope.authentication-3.7.1.zip";
+      md5 = "7d6bb340610518f2fc71213cfeccda68";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18n = buildPythonPackage rec {
+    name = "zope.i18n-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18n/zope.i18n-3.7.4.tar.gz";
+      md5 = "a6fe9d9ad53dd7e94e87cd58fb67d3b7";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_i18nmessageid pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_componentvocabulary = buildPythonPackage rec {
+    name = "zope.componentvocabulary-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.componentvocabulary/zope.componentvocabulary-1.0.1.tar.gz";
+      md5 = "1c8fa82ca1ab1f4b0bd2455a31fde22b";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_ofsp = buildPythonPackage rec {
+    name = "Products.OFSP-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.OFSP/Products.OFSP-2.13.2.zip";
+      md5 = "c76d40928753c2ee56db873304e65bd5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol persistence setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_datetime = buildPythonPackage rec {
+    name = "zope.datetime-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.datetime/zope.datetime-3.4.1.tar.gz";
+      md5 = "4dde22d34f41a0a4f0c5a345e6d11ee9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  experimental_cssselect = buildPythonPackage rec {
+    name = "experimental.cssselect-0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/experimental.cssselect/experimental.cssselect-0.3.zip";
+      md5 = "3fecdcf1fbc3ea6025e115a56a262957";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_passwordresettool = buildPythonPackage rec {
+    name = "Products.PasswordResetTool-2.0.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PasswordResetTool/Products.PasswordResetTool-2.0.12.zip";
+      md5 = "db87c166732a5800f25e33f27a23b7b4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface plone_memoize datetime zope_component setuptools zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_jquerytools = buildPythonPackage rec {
+    name = "plone.app.jquerytools-1.3.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.jquerytools/plone.app.jquerytools-1.3.2.zip";
+      md5 = "326470a34e07aa98c40d75ec22484572";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope2 products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_viewletmanager = buildPythonPackage rec {
+    name = "plone.app.viewletmanager-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.viewletmanager/plone.app.viewletmanager-2.0.3.zip";
+      md5 = "1dbc51c7664ce3e6ca4dcca1b7b86082";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_site zope_interface zope_component zodb3 acquisition setuptools plone_app_vocabularies zope_viewlet zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_registry = buildPythonPackage rec {
+    name = "plone.registry-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.registry/plone.registry-1.0.1.zip";
+      md5 = "6be3d2ec7e2d170e29b8c0bc65049aff";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_dottedname zope_component zodb3 zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_pagetemplate = buildPythonPackage rec {
+    name = "zope.app.pagetemplate-3.11.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.pagetemplate/zope.app.pagetemplate-3.11.2.tar.gz";
+      md5 = "2d304729c0d6a9ab67dd5ea852f19476";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_browserpage zope_traversing zope_tales zope_size zope_pagetemplate zope_dublincore zope_security zope_component zope_configuration setuptools zope_interface zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_viewlet = buildPythonPackage rec {
+    name = "zope.viewlet-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.viewlet/zope.viewlet-3.7.2.tar.gz";
+      md5 = "367e03096df57e2f9b74fff43f7901f9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_i18nmessageid zope_publisher zope_interface zope_location zope_security zope_configuration zope_component zope_event setuptools zope_schema zope_traversing zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_static = buildPythonPackage rec {
+    name = "plone.portlet.static-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.static/plone.portlet.static-2.0.2.zip";
+      md5 = "ec0dc691b4191a41ff97779b117f9985";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 plone_app_portlets zope_formlib zope_interface setuptools plone_i18n plone_portlets zope_component plone_app_form zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_collection = buildPythonPackage rec {
+    name = "plone.portlet.collection-2.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.collection/plone.portlet.collection-2.1.3.zip";
+      md5 = "5f0006dbb3e0b56870383dfdedc49228";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools plone_app_vocabularies plone_app_form plone_portlets plone_app_portlets ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_users = buildPythonPackage rec {
+    name = "plone.app.users-1.1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.users/plone.app.users-1.1.5.zip";
+      md5 = "97895d8dbdf885784be1afbf5b8b364c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid setuptools zope_site zope_formlib zope_interface plone_app_controlpanel plone_app_layout zope2 zope_component products_statusmessages products_cmfdefault five_formlib plone_protect zodb3 zope_schema products_cmfcore products_plonepas ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_querystring = buildPythonPackage rec {
+    name = "plone.app.querystring-1.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.querystring/plone.app.querystring-1.0.7.zip";
+      md5 = "b501910b23def9b58e8309d1e469eb6f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_i18n zope_publisher setuptools zope_globalrequest plone_app_vocabularies zope_dottedname plone_app_layout datetime plone_registry zope_component plone_app_contentlisting zope_interface zope_schema plone_app_registry products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_theme = buildPythonPackage rec {
+    name = "plone.theme-2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.theme/plone.theme-2.1.zip";
+      md5 = "c592d0d095e9fc76cc81597cdf6d0c37";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_publisher zope_interface zope_traversing zope_component products_cmfdefault setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18nmessageid = buildPythonPackage rec {
+    name = "zope.i18nmessageid-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-3.5.3.tar.gz";
+      md5 = "cb84bf61c2b7353e3b7578057fbaa264";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_folder = buildPythonPackage rec {
+    name = "plone.app.folder-1.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.folder/plone.app.folder-1.0.5.zip";
+      md5 = "8ea860daddb4c93c0b7f2b5f7106fef0";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_folder setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zcatalog = buildPythonPackage rec {
+    name = "Products.ZCatalog-2.13.23";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCatalog/Products.ZCatalog-2.13.23.zip";
+      md5 = "d425171516dfc70e543a4e2b852301cb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_testing extensionclass missing zope_dottedname restrictedpython datetime record persistence zodb3 documenttemplate setuptools zope_interface zope_schema products_zctextindex zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_autoinclude = buildPythonPackage rec {
+    name = "z3c.autoinclude-0.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.autoinclude/z3c.autoinclude-0.3.4.zip";
+      md5 = "6a615ae18c12b459bceb3ae28e8e7709";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_dottedname zope_configuration zc_buildout setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_processlifetime = buildPythonPackage rec {
+    name = "zope.processlifetime-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.processlifetime/zope.processlifetime-1.0.tar.gz";
+      md5 = "69604bfd668a01ebebdd616a8f26ccfe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_uuid = buildPythonPackage rec {
+    name = "plone.uuid-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.uuid/plone.uuid-1.0.3.zip";
+      md5 = "183fe2911a7d6c9f6b3103855e98ad8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_browserpage zope_publisher setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_kss = buildPythonPackage rec {
+    name = "archetypes.kss-1.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.kss/archetypes.kss-1.7.2.zip";
+      md5 = "a8502140123b74f1b7ed4f36d3e56ff3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_traversing = buildPythonPackage rec {
+    name = "zope.traversing-3.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.traversing/zope.traversing-3.13.2.zip";
+      md5 = "eaad8fc7bbef126f9f8616b074ec00aa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_proxy zope_location zope_interface zope_security zope_component setuptools zope_publisher zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_gettext = buildPythonPackage rec {
+    name = "python-gettext-1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-gettext/python-gettext-1.2.zip";
+      md5 = "cd4201d440126d1296d1d2bc2b4795f3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unittest2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_securemailhost = buildPythonPackage rec {
+    name = "Products.SecureMailHost-1.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.SecureMailHost/Products.SecureMailHost-1.1.2.zip";
+      md5 = "7db0f1fa867bd0df972082f502a7a707";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_container = buildPythonPackage rec {
+    name = "zope.app.container-3.9.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.container/zope.app.container-3.9.2.tar.gz";
+      md5 = "1e286c59f0166e517d67ddd723641c84";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_copypastemove zope_exceptions zope_component zope_dublincore zope_location zope_browsermenu zope_size zope_security zope_publisher zope_container zope_browserpage zope_event setuptools zope_interface zope_lifecycleevent zope_browser zope_i18n zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonelanguagetool = buildPythonPackage rec {
+    name = "Products.PloneLanguageTool-3.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneLanguageTool/Products.PloneLanguageTool-3.2.7.zip";
+      md5 = "bd9eb6278bf76e8cbce99437ca362164";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  eggtestinfo = buildPythonPackage rec {
+    name = "eggtestinfo-0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/eggtestinfo/eggtestinfo-0.3.tar.gz";
+      md5 = "6f0507aee05f00c640c0d64b5073f840";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mailinglogger = buildPythonPackage rec {
+    name = "mailinglogger-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mailinglogger/mailinglogger-3.7.0.tar.gz";
+      md5 = "f865f0df6059ce23062b7457d01dbac5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  missing = buildPythonPackage rec {
+    name = "Missing-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Missing/Missing-2.13.1.zip";
+      md5 = "9823cff54444cbbcaef8fc45d8e42572";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deferredimport = buildPythonPackage rec {
+    name = "zope.deferredimport-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deferredimport/zope.deferredimport-3.5.3.tar.gz";
+      md5 = "68fce3bf4f011d4a840902fd763884ee";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tales = buildPythonPackage rec {
+    name = "zope.tales-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tales/zope.tales-3.5.2.tar.gz";
+      md5 = "1c5060bd766a0a18632b7879fc9e4e1e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools zope_tal ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zsqlmethods = buildPythonPackage rec {
+    name = "Products.ZSQLMethods-2.13.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZSQLMethods/Products.ZSQLMethods-2.13.4.zip";
+      md5 = "bd1ad8fd4a9d4f8b4681401dd5b71dc1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass missing zope_interface datetime zope2 record transaction acquisition setuptools zodb3 persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_statusmessages = buildPythonPackage rec {
+    name = "Products.statusmessages-4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.statusmessages/Products.statusmessages-4.0.zip";
+      md5 = "265324b0a58a032dd0ed038103ed0473";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_annotation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_i18n = buildPythonPackage rec {
+    name = "plone.i18n-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.i18n/plone.i18n-2.0.5.zip";
+      md5 = "ef36aa9a294d507abb37787f9f7700bd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unidecode zope_publisher zope_interface zope_component setuptools zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_querywidget = buildPythonPackage rec {
+    name = "archetypes.querywidget-1.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.querywidget/archetypes.querywidget-1.0.8.zip";
+      md5 = "3416b6b4948c624e1b5b8dd8d7e33f59";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_jquerytools plone_app_querystring setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_transformchain = buildPythonPackage rec {
+    name = "plone.transformchain-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.transformchain/plone.transformchain-1.0.3.zip";
+      md5 = "f5fb7ca894249e3e666501c4fae52a6c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluggableauthservice = buildPythonPackage rec {
+    name = "Products.PluggableAuthService-1.10.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluggableAuthService/Products.PluggableAuthService-1.10.0.tar.gz";
+      md5 = "1a1db6b1d9dd34f8b93a8a3104385a37";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_pluginregistry zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  borg_localrole = buildPythonPackage rec {
+    name = "borg.localrole-3.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/b/borg.localrole/borg.localrole-3.0.2.zip";
+      md5 = "04082694dfda9ae5cda62747b8ac7ccf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_deferredimport zope_interface plone_memoize zope_component setuptools products_pluggableauthservice zope_annotation products_cmfcore acquisition products_plonepas ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  elementtree = buildPythonPackage rec {
+    name = "elementtree-1.2.7-20070827-preview";
+    src = fetchurl {
+      url = "http://effbot.org/media/downloads/elementtree-1.2.7-20070827-preview.zip";
+      md5 = "30e2fe5edd143f347e03a8baf5d60f8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_content = buildPythonPackage rec {
+    name = "zope.app.content-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.content/zope.app.content-3.5.1.tar.gz";
+      md5 = "0ac6a6fcb5dd6f845759f998d8e8cbb3";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_componentvocabulary zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_sunburst = buildPythonPackage rec {
+    name = "plonetheme.sunburst-1.2.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.sunburst/plonetheme.sunburst-1.2.8.zip";
+      md5 = "be02660c869e04ac8cf6ade3559f2516";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlets = buildPythonPackage rec {
+    name = "plone.portlets-2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlets/plone.portlets-2.1.zip";
+      md5 = "12b9a33f787756a48617c2d2dd63c538";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_publisher zope_site zope_container zope_interface plone_memoize zope_component zodb3 setuptools zope_schema zope_annotation zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_proxy = buildPythonPackage rec {
+    name = "zope.proxy-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.proxy/zope.proxy-3.6.1.zip";
+      md5 = "a400b0a26624b17fa889dbcaa989d440";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_archetypes = buildPythonPackage rec {
+    name = "Products.Archetypes-1.8.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Archetypes/Products.Archetypes-1.8.6.zip";
+      md5 = "74be68879b27228c084a9be869132a98";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller zope_interface zope_contenttype datetime zope_component products_mimetypesregistry plone_app_folder zope2 zope_lifecycleevent zope_i18nmessageid zope_publisher products_genericsetup products_validation products_portaltransforms products_cmfquickinstallertool products_placelesstranslationservice zope_event acquisition products_dcworkflow products_cmfdefault zope_tal plone_folder products_zsqlmethods products_statusmessages zope_schema zope_viewlet products_cmfcalendar extensionclass zope_datetime products_marshall zope_site zope_deferredimport zodb3 plone_uuid setuptools transaction zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_dublincore = buildPythonPackage rec {
+    name = "zope.dublincore-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dublincore/zope.dublincore-3.7.0.tar.gz";
+      md5 = "2e34e42e454d896feb101ac74af62ded";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_datetime zope_interface zope_location zope_security zope_component pytz setuptools zope_schema zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  initgroups = buildPythonPackage rec {
+    name = "initgroups-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/i/initgroups/initgroups-2.13.0.zip";
+      md5 = "38e842dcab8445f65e701fec75213acd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_schema = buildPythonPackage rec {
+    name = "zope.schema-4.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.schema/zope.schema-4.2.1.zip";
+      md5 = "bfa0460b68df0dbbf7a5dc793b0eecc6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_publisher = buildPythonPackage rec {
+    name = "zope.app.publisher-3.10.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.publisher/zope.app.publisher-3.10.2.zip";
+      md5 = "66e9110e2967d8d204a65a98e2227404";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_componentvocabulary zope_datetime zope_browsermenu zope_interface zope_browserresource zope_security zope_configuration zope_component zope_browserpage zope_publisher setuptools zope_ptresource zope_schema zope_location ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_scale = buildPythonPackage rec {
+    name = "plone.scale-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.scale/plone.scale-1.2.2.zip";
+      md5 = "7c59522b4806ee24f5e0a5fa69c523a5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_copy = buildPythonPackage rec {
+    name = "zope.copy-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.copy/zope.copy-3.5.0.tar.gz";
+      md5 = "a9836a5d36cd548be45210eb00407337";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_event = buildPythonPackage rec {
+    name = "zope.event-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.event/zope.event-3.5.2.tar.gz";
+      md5 = "6e8af2a16157a74885d4f0d88137cefb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  acquisition = buildPythonPackage rec {
+    name = "Acquisition-2.13.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/Acquisition/Acquisition-2.13.8.zip";
+      md5 = "8c33160c157b50649e2b2b3224622579";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unittest2 = buildPythonPackage rec {
+    name = "unittest2-0.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.zip";
+      md5 = "1527fb89e38343945af1166342d851ee";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_resource = buildPythonPackage rec {
+    name = "plone.resource-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.resource/plone.resource-1.0.2.zip";
+      md5 = "594d41e3acd913ae92f2e9ef96503b9f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ python_dateutil zope_filerepresentation zope2 zope_publisher z3c_caching zope_interface zope_traversing zope_configuration zope_component plone_caching setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_linkintegrity = buildPythonPackage rec {
+    name = "plone.app.linkintegrity-1.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.linkintegrity/plone.app.linkintegrity-1.5.1.zip";
+      md5 = "89701634d59c3b1a6fc61e5a21c4de52";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_resourceregistries = buildPythonPackage rec {
+    name = "Products.ResourceRegistries-2.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ResourceRegistries/Products.ResourceRegistries-2.2.7.zip";
+      md5 = "954e31a168a1eb3153e2fd4e590bb9ba";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface datetime plone_app_registry zope_component zodb3 setuptools zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_browserlayer = buildPythonPackage rec {
+    name = "plone.browserlayer-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.browserlayer/plone.browserlayer-2.1.2.zip";
+      md5 = "bce02f4907a4f29314090c525e5fc28e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_traversing zope_component setuptools products_genericsetup products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  markdown = buildPythonPackage rec {
+    name = "Markdown-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.3.zip";
+      md5 = "122418893e21e91109edbf6e082f830d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_formwidget_query = buildPythonPackage rec {
+    name = "z3c.formwidget.query-0.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.formwidget.query/z3c.formwidget.query-0.9.zip";
+      md5 = "d9f7960b1a5a81d8ba5241530f496522";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid z3c_form zope_interface zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_z3cform = buildPythonPackage rec {
+    name = "plone.app.z3cform-0.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.z3cform/plone.app.z3cform-0.6.2.zip";
+      md5 = "2e77f5e03d48a6fb2eb9994edb871917";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 plone_z3cform zope_interface z3c_formwidget_query collective_z3cform_datetimewidget kss_core zope_component zope_browserpage setuptools plone_app_kss zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_referencebrowserwidget = buildPythonPackage rec {
+    name = "archetypes.referencebrowserwidget-2.4.17";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.referencebrowserwidget/archetypes.referencebrowserwidget-2.4.17.zip";
+      md5 = "bb7552f5ccfddcd068649d7b8162020c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_jquerytools zope_component zope_interface plone_app_form zope_formlib setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentlisting = buildPythonPackage rec {
+    name = "plone.app.contentlisting-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentlisting/plone.app.contentlisting-1.0.4.zip";
+      md5 = "fa6eb45c4ffd0eb3817ad4813ca24916";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ramcache = buildPythonPackage rec {
+    name = "zope.ramcache-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ramcache/zope.ramcache-1.0.zip";
+      md5 = "87289e15f0e51f50704adda1557c02a7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zodb3 zope_testing setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_vocabularies = buildPythonPackage rec {
+    name = "plone.app.vocabularies-2.1.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.vocabularies/plone.app.vocabularies-2.1.10.tar.gz";
+      md5 = "166a0d6f9a3e3cd753efa56aaef585be";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_site zope_formlib zope_interface zope_component setuptools zope_schema zope_browser zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_cache = buildPythonPackage rec {
+    name = "zope.app.cache-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.cache/zope.app.cache-3.7.0.zip";
+      md5 = "8dd74574e869ce236ced0de7e349bb5c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_ramcache zope_app_form zope_interface zope_traversing zope_publisher zope_component zodb3 zope_proxy setuptools zope_schema zope_componentvocabulary zope_app_pagetemplate zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_discussion = buildPythonPackage rec {
+    name = "plone.app.discussion-2.1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.discussion/plone.app.discussion-2.1.9.zip";
+      md5 = "0c87aa53d4288d031cf384838bc03782";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_uuid zope_site plone_indexer collective_monkeypatcher zope_interface plone_app_z3cform zope_container plone_app_layout plone_z3cform plone_app_registry zope_component zodb3 zope_event setuptools z3c_form zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zlog = buildPythonPackage rec {
+    name = "zLOG-2.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zLOG/zLOG-2.11.1.tar.gz";
+      md5 = "68073679aaa79ac5a7b6a5c025467147";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone = buildPythonPackage rec {
+    name = "Plone-4.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Plone/Plone-4.2.5.zip";
+      md5 = "1330b7966ffb86f962f4c0bfe56ba594";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone products_kupu plone_app_caching zope_app_publisher zope_app_component zope_copypastemove plone_app_theming setuptools products_cmfplacefulworkflow zope_app_container plone_app_openid plone_app_iterate wicked ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_standardcachemanagers = buildPythonPackage rec {
+    name = "Products.StandardCacheManagers-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.StandardCacheManagers/Products.StandardCacheManagers-2.13.0.zip";
+      md5 = "c5088b2b62bd26d63d9579a04369cb73";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_component transaction setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_fieldsets = buildPythonPackage rec {
+    name = "plone.fieldsets-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.fieldsets/plone.fieldsets-2.0.2.zip";
+      md5 = "4158c8a1f784fcb5cecbd63deda7222f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_formlib zope_interface zope_component five_formlib setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_monkeypatcher = buildPythonPackage rec {
+    name = "collective.monkeypatcher-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.monkeypatcher/collective.monkeypatcher-1.0.1.zip";
+      md5 = "4d4f20f9b8bb84b24afadc4f56f6dc2c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_zcmlhook = buildPythonPackage rec {
+    name = "z3c.zcmlhook-1.0b1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.zcmlhook/z3c.zcmlhook-1.0b1.tar.gz";
+      md5 = "7b6c80146f5930409eb0b355ddf3daeb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_configuration setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_recipe_zope2instance = buildPythonPackage rec {
+    name = "plone.recipe.zope2instance-4.2.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.recipe.zope2instance/plone.recipe.zope2instance-4.2.10.zip";
+      md5 = "787fad7fa44757de74a50a91e9bcfcb5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zodb3 mailinglogger zc_buildout setuptools zope2 zc_recipe_egg ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_supermodel = buildPythonPackage rec {
+    name = "plone.supermodel-1.1.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.supermodel/plone.supermodel-1.1.4.zip";
+      md5 = "00b3d723bb1a48116fe3bf8754f17085";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_deferredimport zope_interface zope_dottedname zope_component z3c_zcmlhook setuptools zope_schema elementtree ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_registry = buildPythonPackage rec {
+    name = "plone.app.registry-1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.registry/plone.app.registry-1.1.zip";
+      md5 = "0fdbb01e9ff71108f1be262c39b41b81";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 plone_registry products_genericsetup elementtree plone_supermodel plone_app_z3cform zope_dottedname zope_component products_statusmessages setuptools zope_interface plone_autoform products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_pagetemplate = buildPythonPackage rec {
+    name = "zope.pagetemplate-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.pagetemplate/zope.pagetemplate-3.5.2.tar.gz";
+      md5 = "caa27a15351bc2ae11f5eecb5531e6c5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_traversing zope_tales zope_security zope_component setuptools zope_tal zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfformcontroller = buildPythonPackage rec {
+    name = "Products.CMFFormController-3.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFFormController/Products.CMFFormController-3.0.3.zip";
+      md5 = "6573df7dcb39e3b63ba22abe2acd639e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_tales products_cmfcore zope2 setuptools zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_openid = buildPythonPackage rec {
+    name = "plone.openid-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.openid/plone.openid-2.0.1.zip";
+      md5 = "d4c36926a6dbefed035ed92c29329ce1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_pluggableauthservice python_openid zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_size = buildPythonPackage rec {
+    name = "zope.size-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.size/zope.size-3.4.1.tar.gz";
+      md5 = "55d9084dfd9dcbdb5ad2191ceb5ed03d";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetypesregistry = buildPythonPackage rec {
+    name = "Products.MimetypesRegistry-2.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MimetypesRegistry/Products.MimetypesRegistry-2.0.4.zip";
+      md5 = "898166bb2aaececc8238ad4ee4826793";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_contenttype zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_imaging = buildPythonPackage rec {
+    name = "plone.app.imaging-1.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.imaging/plone.app.imaging-1.0.7.zip";
+      md5 = "27c24477bdcbcebeba6cd83419a57aa6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_marshall = buildPythonPackage rec {
+    name = "Products.Marshall-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Marshall/Products.Marshall-2.1.2.zip";
+      md5 = "bde4d7f75195c1ded8371554b04d2541";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_contenttype datetime extensionclass plone_uuid setuptools zope2 products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ptresource = buildPythonPackage rec {
+    name = "zope.ptresource-3.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ptresource/zope.ptresource-3.9.0.tar.gz";
+      md5 = "f4645e51c15289d3fdfb4139039e18e9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_pagetemplate zope_interface zope_browserresource zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_component = buildPythonPackage rec {
+    name = "zope.app.component-3.9.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.component/zope.app.component-3.9.3.tar.gz";
+      md5 = "bc2dce245d2afe462529c350956711e0";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_component zope_site zope_deprecation zope_interface zope_traversing zope_exceptions zope_security zope_formlib zope_componentvocabulary setuptools zope_schema zope_app_pagetemplate zope_publisher zope_app_container ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  multimapping = buildPythonPackage rec {
+    name = "MultiMapping-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/MultiMapping/MultiMapping-2.13.0.zip";
+      md5 = "d69c5904c105b9f2f085d4103e0f0586";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mailhost = buildPythonPackage rec {
+    name = "Products.MailHost-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MailHost/Products.MailHost-2.13.1.zip";
+      md5 = "1102e523435d8bf78a15b9ddb57478e1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_kss = buildPythonPackage rec {
+    name = "plone.app.kss-1.7.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.kss/plone.app.kss-1.7.1.zip";
+      md5 = "97a35086fecfe25e55b65042eb35e796";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope_i18nmessageid zope2 setuptools zope_deprecation zope_interface plone_app_layout kss_core zope_component products_statusmessages acquisition plone_app_portlets products_dcworkflow zope_lifecycleevent zope_i18n plone_locking products_cmfcore zope_contentprovider plone_portlets ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  pytz = buildPythonPackage rec {
+    name = "pytz-2012g";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pytz/pytz-2012g.zip";
+      md5 = "1a9b24da1ab6328074b48fc3d4525078";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_i18n = buildPythonPackage rec {
+    name = "plone.app.i18n-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.i18n/plone.app.i18n-2.0.2.zip";
+      md5 = "a10026573463dfc1899bf4062cebdbf2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_indexer = buildPythonPackage rec {
+    name = "plone.indexer-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.indexer/plone.indexer-1.0.2.zip";
+      md5 = "538aeee1f9db78bc8c85ae1bcb0153ed";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface products_cmfcore setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externalmethod = buildPythonPackage rec {
+    name = "Products.ExternalMethod-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalMethod/Products.ExternalMethod-2.13.0.zip";
+      md5 = "15ba953ef6cb632eb571977651252ea6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_upgrade = buildPythonPackage rec {
+    name = "plone.app.upgrade-1.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.upgrade/plone.app.upgrade-1.2.5.zip";
+      md5 = "8da18e8173668cad813dd8bb5a35ee9e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller zope_interface products_cmfactionicons products_cmfeditions products_archetypes products_mimetypesregistry plone_app_folder products_cmfuid products_securemailhost zope_ramcache products_genericsetup products_cmfdifftool five_localsitemanager products_cmfquickinstallertool products_portaltransforms products_cmfdefault acquisition products_dcworkflow products_zcatalog borg_localrole products_contentmigration products_resourceregistries plone_portlets products_atcontenttypes zope2 plone_app_portlets products_pluggableauthservice products_cmfcalendar products_plonepas transaction zope_app_cache zope_site zope_component zope_location products_plonelanguagetool plone_session setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserpage = buildPythonPackage rec {
+    name = "zope.browserpage-3.12.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserpage/zope.browserpage-3.12.2.tar.gz";
+      md5 = "a543ef3cb1b42f7233b3fca23dc9ea60";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_pagetemplate zope_interface zope_traversing zope_component zope_security zope_configuration zope_publisher setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atcontenttypes = buildPythonPackage rec {
+    name = "Products.ATContentTypes-2.1.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATContentTypes/Products.ATContentTypes-2.1.12.zip";
+      md5 = "ef38ce0769a5f44e272623f8f118a669";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface plone_memoize datetime products_archetypes products_mimetypesregistry plone_app_folder zope2 zope_i18nmessageid zope_publisher products_genericsetup plone_i18n products_portaltransforms products_cmfdefault products_atreferencebrowserwidget zope_tal zconfig archetypes_referencebrowserwidget transaction products_validation acquisition extensionclass zope_component plone_app_layout zodb3 setuptools zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfeditions = buildPythonPackage rec {
+    name = "Products.CMFEditions-2.2.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFEditions/Products.CMFEditions-2.2.8.zip";
+      md5 = "1806f2e17e2527fad9364670b343bd11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_cmfdifftool zope_copy zope_interface products_genericsetup zope_dottedname products_zopeversioncontrol datetime products_cmfuid zodb3 products_cmfcore setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_interface = buildPythonPackage rec {
+    name = "zope.interface-3.6.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.7.zip";
+      md5 = "9df962180fbbb54eb1875cff9fe436e5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_content = buildPythonPackage rec {
+    name = "plone.app.content-2.0.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.content/plone.app.content-2.0.12.zip";
+      md5 = "2f14a85fb66d73e0b699b839caaaad26";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_publisher zope_container zope_interface plone_memoize plone_i18n zope_component zope_event products_cmfcore setuptools zope_schema zope_lifecycleevent zope_i18n zope_viewlet acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_classic = buildPythonPackage rec {
+    name = "plonetheme.classic-1.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.classic/plonetheme.classic-1.2.5.zip";
+      md5 = "9dc15871937f9cdf94cdfdb9be77a221";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_autoform = buildPythonPackage rec {
+    name = "plone.autoform-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.autoform/plone.autoform-1.3.zip";
+      md5 = "4cb2935ba9cda3eb3ee801ad8cda7c60";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form zope_interface zope_dottedname zope_security setuptools plone_supermodel zope_schema plone_z3cform ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentrules = buildPythonPackage rec {
+    name = "plone.app.contentrules-2.1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentrules/plone.app.contentrules-2.1.9.zip";
+      md5 = "74d2fed9095a7c5f890b6f27de78dafc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_traversing plone_app_form zope_component zope_lifecycleevent zope_annotation zope_i18nmessageid products_genericsetup zope_event products_cmfdefault zope_browser plone_app_kss plone_uuid plone_memoize zope2 plone_stringinterp products_statusmessages plone_contentrules zope_schema acquisition transaction zope_site zope_container plone_app_vocabularies zope_publisher kss_core zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  record = buildPythonPackage rec {
+    name = "Record-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/Record/Record-2.13.0.zip";
+      md5 = "cfed6a89d4fb2c9cb995e9084c3071b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonetestcase = buildPythonPackage rec {
+    name = "Products.PloneTestCase-0.9.15";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneTestCase/Products.PloneTestCase-0.9.15.zip";
+      md5 = "ddd5810937919ab5233ebd64893c8bae";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_testing zope2 products_genericsetup zope_site zope_interface products_atcontenttypes zope_component zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_stringinterp = buildPythonPackage rec {
+    name = "plone.stringinterp-1.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.stringinterp/plone.stringinterp-1.0.7.zip";
+      md5 = "81909716210c6ac3fd0ee87f45ea523d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18n products_cmfcore setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  wicked = buildPythonPackage rec {
+    name = "wicked-1.1.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/w/wicked/wicked-1.1.10.zip";
+      md5 = "f65611f11d547d7dc8e623bf87d3929d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_container zope_traversing setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_blob = buildPythonPackage rec {
+    name = "plone.app.blob-1.5.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.blob/plone.app.blob-1.5.7.zip";
+      md5 = "135bc404212981c445d5bbb6a749b155";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale plone_app_imaging zodb3 setuptools archetypes_schemaextender zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdynamicviewfti = buildPythonPackage rec {
+    name = "Products.CMFDynamicViewFTI-4.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDynamicViewFTI/Products.CMFDynamicViewFTI-4.0.3.zip";
+      md5 = "7d39d416b41b2d93954bc73d9d0e077f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass products_genericsetup zope_browsermenu zope_interface zope_component zope2 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_keyring = buildPythonPackage rec {
+    name = "plone.keyring-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.keyring/plone.keyring-2.0.1.zip";
+      md5 = "f3970e9bddb2cc65e461a2c62879233f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_container zope_location zodb3 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contentprovider = buildPythonPackage rec {
+    name = "zope.contentprovider-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contentprovider/zope.contentprovider-3.7.2.tar.gz";
+      md5 = "1bb2132551175c0123f17939a793f812";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_interface zope_location zope_tales zope_component zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_jquery = buildPythonPackage rec {
+    name = "plone.app.jquery-1.4.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.jquery/plone.app.jquery-1.4.4.zip";
+      md5 = "a12d56f3dfd2ba6840bf21a6bd860b90";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atreferencebrowserwidget = buildPythonPackage rec {
+    name = "Products.ATReferenceBrowserWidget-3.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATReferenceBrowserWidget/Products.ATReferenceBrowserWidget-3.0.zip";
+      md5 = "157bdd32155c8353450c17c649aad042";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_deprecation archetypes_referencebrowserwidget setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserresource = buildPythonPackage rec {
+    name = "zope.browserresource-3.10.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserresource/zope.browserresource-3.10.3.zip";
+      md5 = "dbfde30e82dbfa1a74c5da0cb5a4772d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_traversing zope_contenttype zope_configuration zope_publisher setuptools zope_schema zope_i18n zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_caching = buildPythonPackage rec {
+    name = "plone.caching-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.caching/plone.caching-1.0.zip";
+      md5 = "2c2e3b27d13b9101c92dfed222fde36c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid five_globalrequest z3c_caching zope_interface zope2 zope_component setuptools plone_transformchain zope_schema plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_locales = buildPythonPackage rec {
+    name = "zope.app.locales-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.locales/zope.app.locales-3.6.2.tar.gz";
+      md5 = "bd2b4c6040e768f33004b1210d3207fa";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_placelesstranslationservice = buildPythonPackage rec {
+    name = "Products.PlacelessTranslationService-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlacelessTranslationService/Products.PlacelessTranslationService-2.0.3.zip";
+      md5 = "a94635eb712563c5a002520713f5d6dc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zope_publisher zope_deferredimport zope_deprecation zope_interface python_gettext datetime zope_component zodb3 setuptools zope_annotation zope_i18n zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_z3cform = buildPythonPackage rec {
+    name = "plone.z3cform-0.7.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.z3cform/plone.z3cform-0.7.8.zip";
+      md5 = "da891365156a5d5824d4e504465886a2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_batching z3c_form zope_i18n zope_component collective_monkeypatcher setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_lifecycleevent = buildPythonPackage rec {
+    name = "zope.lifecycleevent-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.lifecycleevent/zope.lifecycleevent-3.6.2.tar.gz";
+      md5 = "3ba978f3ba7c0805c81c2c79ea3edb33";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_form = buildPythonPackage rec {
+    name = "zope.app.form-4.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.form/zope.app.form-4.0.2.tar.gz";
+      md5 = "3d2b164d9d37a71490a024aaeb412e91";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_schema transaction zope_datetime zope_browsermenu zope_interface zope_exceptions zope_security zope_configuration zope_publisher zope_component zope_formlib zope_browser setuptools zope_proxy zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_tinymce = buildPythonPackage rec {
+    name = "Products.TinyMCE-1.2.15";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.TinyMCE/Products.TinyMCE-1.2.15.zip";
+      md5 = "108b919bfcff711d2116e41eccbede58";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_app_component plone_app_imaging zope_app_content setuptools elementtree plone_outputfilters ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_z3cform_datetimewidget = buildPythonPackage rec {
+    name = "collective.z3cform.datetimewidget-1.2.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.z3cform.datetimewidget/collective.z3cform.datetimewidget-1.2.3.zip";
+      md5 = "439117021c93f26c677510504ee245d3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form zope_deprecation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_form = buildPythonPackage rec {
+    name = "z3c.form-2.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.form/z3c.form-2.5.1.tar.gz";
+      md5 = "f029f83dd226f695f55049ed1ecee95e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_pagetemplate zope_interface zope_location zope_security zope_configuration zope_component zope_event setuptools zope_schema zope_lifecycleevent zope_browser zope_i18n zope_traversing zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_dcworkflow = buildPythonPackage rec {
+    name = "Products.DCWorkflow-2.2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.DCWorkflow/Products.DCWorkflow-2.2.4.tar.gz";
+      md5 = "c90a16c4f3611015592ba8173a5f1863";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mechanize = buildPythonPackage rec {
+    name = "mechanize-0.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip";
+      md5 = "a497ad4e875f7506ffcf8ad3ada4c2fc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_iterate = buildPythonPackage rec {
+    name = "plone.app.iterate-2.1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.iterate/plone.app.iterate-2.1.9.zip";
+      md5 = "db598cfc0986737145ddc7e6b70a1794";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope_i18nmessageid zodb3 products_archetypes zope_interface plone_memoize products_cmfeditions datetime zope_component products_dcworkflow products_statusmessages zope_event setuptools products_cmfplacefulworkflow zope_schema zope_lifecycleevent zope_annotation zope2 plone_locking products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  accesscontrol = buildPythonPackage rec {
+    name = "AccessControl-2.13.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/AccessControl/AccessControl-2.13.12.zip";
+      md5 = "b9205bceb8386deceab51f758bc4784a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_security zope_testing extensionclass zope_publisher restrictedpython zope_interface zope_deferredimport zope_schema zope_configuration datetime record transaction acquisition zodb3 zope_component zexceptions persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testing = buildPythonPackage rec {
+    name = "zope.testing-3.9.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testing/zope.testing-3.9.7.tar.gz";
+      md5 = "8999f3d143d416dc3c8b2a5bd6f33e28";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_exceptions setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externaleditor = buildPythonPackage rec {
+    name = "Products.ExternalEditor-1.1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalEditor/Products.ExternalEditor-1.1.0.zip";
+      md5 = "475fea6e0b958c0c51cfdbfef2f4e623";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_publication = buildPythonPackage rec {
+    name = "zope.app.publication-3.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.publication/zope.app.publication-3.12.0.zip";
+      md5 = "d8c521287f52fb9f40fa9b8c2acb4675";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_authentication zope_publisher zope_interface zope_location zope_traversing zope_component zope_error zodb3 setuptools zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_filerepresentation = buildPythonPackage rec {
+    name = "zope.filerepresentation-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.filerepresentation/zope.filerepresentation-3.6.1.tar.gz";
+      md5 = "4a7a434094f4bfa99a7f22e75966c359";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_globalrequest = buildPythonPackage rec {
+    name = "five.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.globalrequest/five.globalrequest-1.0.tar.gz";
+      md5 = "87f8996bd21d4aa156aa26e7d21b8744";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_globalrequest zope2 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_exceptions = buildPythonPackage rec {
+    name = "zope.exceptions-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.exceptions/zope.exceptions-3.6.2.tar.gz";
+      md5 = "d7234d99d728abe3d9275346e8d24fd9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_layout = buildPythonPackage rec {
+    name = "plone.app.layout-2.2.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.layout/plone.app.layout-2.2.9.zip";
+      md5 = "9ad17aaae1e37de2a427cbebc0565166";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_deprecation zope_interface plone_memoize zope_dottedname datetime zope_component zope_annotation zope_publisher plone_i18n products_cmfdefault plone_app_controlpanel plone_app_viewletmanager plone_portlets plone_app_portlets zope_schema zope_viewlet acquisition zope2 setuptools zope_i18n plone_locking products_cmfcore products_cmfeditions ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contenttype = buildPythonPackage rec {
+    name = "zope.contenttype-3.5.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contenttype/zope.contenttype-3.5.5.zip";
+      md5 = "c6ac80e6887de4108a383f349fbdf332";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_customerize = buildPythonPackage rec {
+    name = "five.customerize-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.customerize/five.customerize-1.0.3.zip";
+      md5 = "32f597c2fa961f7dcc84b23e655d928e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing transaction zope_publisher zope_site zope_pagetemplate zope_interface zope_traversing zope_dottedname plone_portlets zope_component zope_componentvocabulary setuptools zope_app_pagetemplate zope_schema zope_lifecycleevent zope2 zope_viewlet acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_subrequest = buildPythonPackage rec {
+    name = "plone.subrequest-1.6.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.subrequest/plone.subrequest-1.6.7.zip";
+      md5 = "cc12f68a22565415b10dbeef0020baa4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_globalrequest five_globalrequest setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_site = buildPythonPackage rec {
+    name = "zope.site-3.9.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.site/zope.site-3.9.2.tar.gz";
+      md5 = "36a0b8dfbd713ed452ce6973ab0a3ddb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_location zope_interface zope_security zope_container zope_event setuptools zope_lifecycleevent zope_annotation zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_uuid = buildPythonPackage rec {
+    name = "plone.app.uuid-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.uuid/plone.app.uuid-1.0.zip";
+      md5 = "9ca8dcfb09a8a0d6bbee0f28073c3d3f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_indexer zope_interface zope_publisher plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfactionicons = buildPythonPackage rec {
+    name = "Products.CMFActionIcons-2.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFActionIcons/Products.CMFActionIcons-2.1.3.tar.gz";
+      md5 = "ab1dc62404ed11aea84dc0d782b2235e";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  persistence = buildPythonPackage rec {
+    name = "Persistence-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Persistence/Persistence-2.13.2.zip";
+      md5 = "92693648ccdc59c8fc71f7f06b1d228c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zopeversioncontrol = buildPythonPackage rec {
+    name = "Products.ZopeVersionControl-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZopeVersionControl/Products.ZopeVersionControl-1.1.3.zip";
+      md5 = "238239102f3ac798ee4f4c53343a561f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction zope_interface datetime zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_location = buildPythonPackage rec {
+    name = "zope.location-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.location/zope.location-3.9.1.tar.gz";
+      md5 = "1684a8f986099d15296f670c58e713d8";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_schema zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browsermenu = buildPythonPackage rec {
+    name = "zope.browsermenu-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browsermenu/zope.browsermenu-3.9.1.zip";
+      md5 = "a47c7b1e786661c912a1150bf8d1f83f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_interface zope_traversing zope_component zope_security zope_configuration zope_pagetemplate setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_workflow = buildPythonPackage rec {
+    name = "plone.app.workflow-2.0.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.workflow/plone.app.workflow-2.0.10.zip";
+      md5 = "350ea680ccf7eb9b1598927cafad4f38";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_genericsetup zope_site zope_interface plone_memoize zope_testing datetime kss_core zope_component products_cmfcore products_statusmessages zope2 setuptools products_dcworkflow zope_schema zope_i18n acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_locking = buildPythonPackage rec {
+    name = "plone.locking-2.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.locking/plone.locking-2.0.4.zip";
+      md5 = "a7f8b8db78f57272d351d7fe0d067eb2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime zope_component zodb3 setuptools zope_schema zope_annotation zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_dottedname = buildPythonPackage rec {
+    name = "zope.dottedname-3.4.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dottedname/zope.dottedname-3.4.6.tar.gz";
+      md5 = "62d639f75b31d2d864fe5982cb23959c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_cachedescriptors = buildPythonPackage rec {
+    name = "zope.cachedescriptors-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.cachedescriptors/zope.cachedescriptors-3.5.1.zip";
+      md5 = "263459a95238fd61d17e815d97ca49ce";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_collection = buildPythonPackage rec {
+    name = "plone.app.collection-1.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.collection/plone.app.collection-1.0.8.zip";
+      md5 = "8bbd299daa04b35ecfad3c13afa7aba0";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_portlet_collection zope_i18nmessageid transaction plone_app_contentlisting zope_component plone_app_vocabularies plone_app_form products_validation zope_configuration plone_portlets setuptools products_archetypes zope2 plone_app_portlets zope_interface zope_schema products_cmfquickinstallertool archetypes_querywidget products_cmfcore zope_formlib ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_lockfile = buildPythonPackage rec {
+    name = "zc.lockfile-1.0.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.lockfile/zc.lockfile-1.0.0.tar.gz";
+      md5 = "6cf83766ef9935c33e240b0904c7a45e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  lxml = buildPythonPackage rec {
+    name = "lxml-2.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/l/lxml/lxml-2.3.4.tar.gz";
+      md5 = "61d4ad80726b984b35c9a81aa2510b4d";
+    };
+    buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_contentrules = buildPythonPackage rec {
+    name = "plone.contentrules-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.contentrules/plone.contentrules-2.0.2.zip";
+      md5 = "a32370656c4fd58652fcd8a234db69c5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_container zope_interface zope_testing zope_configuration zope_component zope_componentvocabulary setuptools zodb3 zope_schema zope_lifecycleevent zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sendmail = buildPythonPackage rec {
+    name = "zope.sendmail-3.7.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sendmail/zope.sendmail-3.7.5.tar.gz";
+      md5 = "8a513ecf2b41cad849f6607bf16d6818";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_interface zope_configuration setuptools zope_schema zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_formlib = buildPythonPackage rec {
+    name = "zope.formlib-4.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.formlib/zope.formlib-4.0.6.zip";
+      md5 = "eed9c94382d11a4dececd0a48ac1d3f2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_schema zope_datetime zope_interface zope_traversing zope_security zope_component pytz zope_event zope_browser setuptools zope_lifecycleevent zope_i18n zope_browserpage ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_caching = buildPythonPackage rec {
+    name = "plone.app.caching-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.caching/plone.app.caching-1.1.3.zip";
+      md5 = "1975506ecf8d42944946dbb2b8f8dc01";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti z3c_form zope_interface plone_memoize zope_component plone_caching zope_publisher products_genericsetup plone_app_registry z3c_zcmlhook setuptools plone_app_z3cform products_statusmessages python_dateutil plone_cachepurging acquisition zope2 zope_pagetemplate zope_browserresource plone_protect plone_registry products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplone = buildPythonPackage rec {
+    name = "Products.CMFPlone-4.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlone/Products.CMFPlone-4.2.5.zip";
+      md5 = "dab2fb239699598e6b48b060b07a8c7e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti plone_app_blob products_dcworkflow products_extendedpathindex zope_dottedname datetime zope_traversing zope_app_container products_tinymce zope_publisher plonetheme_classic plone_fieldsets products_cmfdefault five_localsitemanager plone_app_contentlisting products_externaleditor products_pluginregistry products_cmfeditions products_resourceregistries zope_tal plone_app_jquerytools products_genericsetup acquisition plone_app_vocabularies zope_location zope_deferredimport products_plonelanguagetool borg_localrole kss_core zope_i18n plone_browserlayer plone_theme plone_memoize plone_app_contentmenu plone_app_i18n zope_component products_mimetypesregistry plone_app_folder plone_registry zope_i18nmessageid z3c_autoinclude plone_app_upgrade products_cmfdifftool five_customerize plone_app_search products_portaltransforms plone_app_controlpanel plone_app_locales plone_app_linkintegrity zope2 plone_contentrules plone_app_portlets products_plonepas zope_pagetemplate zodb3 plone_locking products_cmfformcontroller zope_deprecation plone_app_form plone_app_layout products_cmfquickinstallertool archetypes_querywidget plone_app_redirector plone_i18n plone_app_registry products_placelesstranslationservice plone_app_users zope_interface zope_event plone_app_viewletmanager zope_structuredtext zope_app_publisher plone_app_customerize zope_app_locales plone_portlets products_statusmessages products_cmfcalendar extensionclass products_pluggableauthservice plone_indexer products_cmfuid zope_container plone_app_workflow setuptools plone_portlet_collection plone_app_contentrules products_cmfactionicons products_archetypes plone_intelligenttext plone_app_collection products_passwordresettool plone_app_content plonetheme_sunburst archetypes_kss plone_app_kss plone_protect zope_app_component zope_tales plone_app_uuid archetypes_referencebrowserwidget products_atcontenttypes plone_app_jquery transaction zope_site plone_app_discussion plone_portlet_static zope_copypastemove plone_session products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  transaction = buildPythonPackage rec {
+    name = "transaction-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/transaction/transaction-1.1.1.tar.gz";
+      md5 = "30b062baa34fe1521ad979fb088c8c55";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_controlpanel = buildPythonPackage rec {
+    name = "plone.app.controlpanel-2.2.11";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.controlpanel/plone.app.controlpanel-2.2.11.zip";
+      md5 = "401c8880865f398c281953f5837108b9";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface plone_memoize zope_component plone_app_workflow zope_annotation zope_ramcache zope_publisher products_portaltransforms plone_fieldsets zope_event products_cmfdefault zope_cachedescriptors plone_app_form setuptools products_statusmessages zope_schema zope2 acquisition products_plonepas zope_site plone_app_vocabularies zope_formlib zodb3 plone_protect zope_i18n plone_locking products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_redirector = buildPythonPackage rec {
+    name = "plone.app.redirector-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.redirector/plone.app.redirector-1.1.3.zip";
+      md5 = "7d441340a83b8ed72a03bc16148a5f21";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_component = buildPythonPackage rec {
+    name = "zope.component-3.9.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.component/zope.component-3.9.5.tar.gz";
+      md5 = "22780b445b1b479701c05978055d1c82";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_broken = buildPythonPackage rec {
+    name = "zope.broken-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.broken/zope.broken-3.6.0.zip";
+      md5 = "eff24d7918099a3e899ee63a9c31bee6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_recipe_egg = buildPythonPackage rec {
+    name = "zc.recipe.egg-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.recipe.egg/zc.recipe.egg-1.2.2.tar.gz";
+      md5 = "fe5ad0f1c0fc3d4348286534e1b9cec5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zc_buildout setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_openid = buildPythonPackage rec {
+    name = "plone.app.openid-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.openid/plone.app.openid-2.0.2.tar.gz";
+      md5 = "ae0748f91cab0612a498926d405d8edd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_plonepas zope_i18nmessageid zope2 setuptools plone_openid zope_interface plone_portlets zope_component plone_app_portlets products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_caching = buildPythonPackage rec {
+    name = "z3c.caching-2.0a1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.caching/z3c.caching-2.0a1.tar.gz";
+      md5 = "17f250b5084c2324a7d15c6810ee628e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_openid = buildPythonPackage rec {
+    name = "python-openid-2.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-openid/python-openid-2.2.5.zip";
+      md5 = "f89d9d4f4dccfd33b5ce34eb4725f751";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  tempstorage = buildPythonPackage rec {
+    name = "tempstorage-2.12.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tempstorage/tempstorage-2.12.2.zip";
+      md5 = "7a2b76b39839e229249b1bb175604480";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zodb3 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zctextindex = buildPythonPackage rec {
+    name = "Products.ZCTextIndex-2.13.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCTextIndex/Products.ZCTextIndex-2.13.4.zip";
+      md5 = "8bbfa5fcd3609246990a9314d6f826b4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol transaction zope_interface zexceptions zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  extensionclass = buildPythonPackage rec {
+    name = "ExtensionClass-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/E/ExtensionClass/ExtensionClass-2.13.2.zip";
+      md5 = "0236e6d7da9e8b87b9ba45f1b8f930b8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+}; in plone43Packages
diff --git a/pkgs/development/web/plone/4.3.0.nix b/pkgs/development/web/plone/4.3.0.nix
new file mode 100644
index 00000000000..6dd85a17994
--- /dev/null
+++ b/pkgs/development/web/plone/4.3.0.nix
@@ -0,0 +1,5417 @@
+# DO NOT EDIT THIS FILE!
+#
+# Nix expressions autogenerated with:
+#   bin/pypi2nix -n plone43Packages -d Plone -d mailinglogger -d zc.recipe.egg -d plone.recipe.zope2instance -d Pillow -i setuptools -i zc_buildout -i pillow -e plone/4.3.0.json -p plone/4.3.0.txt -o plone/4.3.0.nix
+
+{ pkgs, pythonPackages }:
+
+let plone43Packages = pythonPackages.python.modules // rec {
+  inherit (pythonPackages) buildPythonPackage setuptools zc_buildout pillow;
+  inherit (pkgs) fetchurl stdenv;
+
+  plone_app_portlets = buildPythonPackage rec {
+    name = "plone.app.portlets-2.4.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.portlets/plone.app.portlets-2.4.3.zip";
+      md5 = "2222bde82199670b40a6d1a242ce100a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface zope_traversing plone_app_form datetime zope_container zope_lifecycleevent zope_annotation five_customerize zope_i18nmessageid zope_publisher products_genericsetup plone_i18n feedparser zope_event zope_browser zope_contentprovider plone_memoize zope2 zope_schema acquisition transaction products_pluggableauthservice zope_site zope_component plone_app_vocabularies plone_portlets plone_app_i18n zope_configuration zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope2 = buildPythonPackage rec {
+    name = "Zope2-2.13.19";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/Zope2/Zope2-2.13.19.zip";
+      md5 = "26fee311aace7c12e406543ea91eb42a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_traversing multimapping zope_size zope_contenttype zope_browserpage datetime zope_component zope_sendmail zope_lifecycleevent products_zctextindex products_standardcachemanagers persistence products_mimetools zope_i18nmessageid zope_publisher missing zope_viewlet zope_sequencesort zope_testbrowser docutils zope_event products_pythonscripts zope_browser zope_structuredtext zope_contentprovider zope_browsermenu zope_tal zope_exceptions products_mailhost products_btreefolder2 zopeundo zconfig record accesscontrol pytz products_ofsp zope_schema zexceptions zope_processlifetime acquisition extensionclass zope_proxy zope_site zope_container zope_pagetemplate zdaemon zope_browserresource zope_deferredimport initgroups zope_security zope_configuration zope_i18n products_zcatalog restrictedpython zodb3 documenttemplate setuptools zope_ptresource zlog tempstorage transaction zope_tales zope_location products_externalmethod ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_btreefolder2 = buildPythonPackage rec {
+    name = "Products.BTreeFolder2-2.13.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.BTreeFolder2/Products.BTreeFolder2-2.13.3.tar.gz";
+      md5 = "f57c85673036af7ccd34c3fa251f6bb2";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ accesscontrol zope_container zodb3 zope_event persistence setuptools zope_lifecycleevent acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pythonscripts = buildPythonPackage rec {
+    name = "Products.PythonScripts-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PythonScripts/Products.PythonScripts-2.13.2.zip";
+      md5 = "04c86f2c45a29a162297a80dac61d14f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol datetime restrictedpython documenttemplate setuptools zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zopeundo = buildPythonPackage rec {
+    name = "ZopeUndo-2.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZopeUndo/ZopeUndo-2.12.0.zip";
+      md5 = "2b8da09d1b98d5558f62e12f6e52c401";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  datetime = buildPythonPackage rec {
+    name = "DateTime-3.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DateTime/DateTime-3.0.3.zip";
+      md5 = "5ebf0a8e3775b744c5de2e6685b37ae9";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface pytz ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_session = buildPythonPackage rec {
+    name = "plone.session-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.session/plone.session-3.5.3.zip";
+      md5 = "f95872454735abc8f27c3dcbc9434c11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_pluggableauthservice plone_keyring zope_interface setuptools zope_component plone_protect ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_container = buildPythonPackage rec {
+    name = "zope.container-3.11.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.container/zope.container-3.11.2.tar.gz";
+      md5 = "fc66d85a17b8ffb701091c9328983dcc";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_filerepresentation zope_i18nmessageid zope_publisher zope_broken zope_interface zope_size zope_dottedname zope_security zope_location zope_lifecycleevent zope_component zodb3 zope_event setuptools zope_schema zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_folder = buildPythonPackage rec {
+    name = "plone.folder-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.folder/plone.folder-1.0.4.zip";
+      md5 = "1674ff18b7a9452d0c2063cf11c679b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope_interface plone_memoize zope_container setuptools zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonepas = buildPythonPackage rec {
+    name = "Products.PlonePAS-4.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlonePAS/Products.PlonePAS-4.1.1.zip";
+      md5 = "32db1808c3ad42e82542b65eb95c3c71";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_genericsetup plone_memoize plone_i18n plone_session zope2 setuptools products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_locales = buildPythonPackage rec {
+    name = "plone.app.locales-4.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.locales/plone.app.locales-4.3.zip";
+      md5 = "932a31c6d6c7328dca87ed2fcf25f5a8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sequencesort = buildPythonPackage rec {
+    name = "zope.sequencesort-3.4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sequencesort/zope.sequencesort-3.4.0.tar.gz";
+      md5 = "cfc35fc426a47f5c0ee43c416224b864";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_genericsetup = buildPythonPackage rec {
+    name = "Products.GenericSetup-1.7.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.GenericSetup/Products.GenericSetup-1.7.3.tar.gz";
+      md5 = "c48967c81c880ed33ee16a14caab3b11";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_formlib five_localsitemanager zope2 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_theme = buildPythonPackage rec {
+    name = "plone.theme-2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.theme/plone.theme-2.1.zip";
+      md5 = "c592d0d095e9fc76cc81597cdf6d0c37";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_publisher zope_interface zope_traversing zope_component products_cmfdefault setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tal = buildPythonPackage rec {
+    name = "zope.tal-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tal/zope.tal-3.5.2.zip";
+      md5 = "13869f292ba36b294736b7330b1396fd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_cachepurging = buildPythonPackage rec {
+    name = "plone.cachepurging-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.cachepurging/plone.cachepurging-1.0.4.zip";
+      md5 = "886814ac4deef0f1ed99a2eb60864264";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 five_globalrequest zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_protect = buildPythonPackage rec {
+    name = "plone.protect-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.protect/plone.protect-2.0.2.zip";
+      md5 = "74925ffb08782e72f9b1e850fa78fffa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component plone_keyring zope2 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_portaltransforms = buildPythonPackage rec {
+    name = "Products.PortalTransforms-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PortalTransforms/Products.PortalTransforms-2.1.2.zip";
+      md5 = "9f429f3c3b9e0019d0f6c9b7a8a9376e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_structuredtext products_mimetypesregistry zodb3 products_cmfdefault plone_intelligenttext setuptools markdown products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_memoize = buildPythonPackage rec {
+    name = "plone.memoize-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.memoize/plone.memoize-1.1.1.zip";
+      md5 = "d07cd14b976160e1f26a859e3370147e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope_annotation zope_ramcache setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  docutils = buildPythonPackage rec {
+    name = "docutils-0.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/docutils/docutils-0.9.1.tar.gz";
+      md5 = "b0d5cd5298fedf9c62f5fd364a274d56";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_formlib = buildPythonPackage rec {
+    name = "five.formlib-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.formlib/five.formlib-1.0.4.zip";
+      md5 = "09fcecbb7e0ed4a31a4f19787c1a78b4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_app_form zope_formlib zope_interface zope_location zope_publisher zope_component extensionclass zope_event setuptools zope_schema zope_lifecycleevent zope_browser zope2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zexceptions = buildPythonPackage rec {
+    name = "zExceptions-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zExceptions/zExceptions-2.13.0.zip";
+      md5 = "4c679696c959040d8e656ef85ae40136";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_publisher zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfuid = buildPythonPackage rec {
+    name = "Products.CMFUid-2.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFUid/Products.CMFUid-2.2.1.tar.gz";
+      md5 = "e20727959351dffbf0bac80613eee110";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  restrictedpython = buildPythonPackage rec {
+    name = "RestrictedPython-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/RestrictedPython/RestrictedPython-3.6.0.zip";
+      md5 = "aa75a7dcc7fbc966357837cc66cacec6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_theming = buildPythonPackage rec {
+    name = "plone.app.theming-1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.theming/plone.app.theming-1.1.zip";
+      md5 = "be281b5b740f8e35c73ba15adcd0f98d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone plone_subrequest repoze_xmliter plone_app_registry plone_transformchain zope_traversing lxml docutils roman plone_resource setuptools five_globalrequest diazo plone_resourceeditor ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  feedparser = buildPythonPackage rec {
+    name = "feedparser-5.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/feedparser/feedparser-5.0.1.zip";
+      md5 = "cefffeba66b658d3cc7c1d66b92c6a1a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browser = buildPythonPackage rec {
+    name = "zope.browser-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browser/zope.browser-1.3.zip";
+      md5 = "4ff0ddbf64c45bfcc3189e35f4214ded";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdefault = buildPythonPackage rec {
+    name = "Products.CMFDefault-2.2.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDefault/Products.CMFDefault-2.2.3.tar.gz";
+      md5 = "fe7d2d3906ee0e3b484e4a02401576ab";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_genericsetup products_cmfcore five_formlib setuptools zope2 eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_dateutil = buildPythonPackage rec {
+    name = "python-dateutil-1.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-dateutil/python-dateutil-1.5.tar.gz";
+      md5 = "0dcb1de5e5cad69490a3b6ab63f0cfa5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_error = buildPythonPackage rec {
+    name = "zope.error-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.error/zope.error-3.7.4.tar.gz";
+      md5 = "281445a906458ff5f18f56923699a127";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_exceptions setuptools zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetools = buildPythonPackage rec {
+    name = "Products.MIMETools-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MIMETools/Products.MIMETools-2.13.0.zip";
+      md5 = "ad5372fc1190599a19493db0864448ec";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ documenttemplate setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deprecation = buildPythonPackage rec {
+    name = "zope.deprecation-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deprecation/zope.deprecation-3.4.1.tar.gz";
+      md5 = "8a47b0f8e1fa4e833007e5b8351bb1d4";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplacefulworkflow = buildPythonPackage rec {
+    name = "Products.CMFPlacefulWorkflow-1.5.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlacefulWorkflow/Products.CMFPlacefulWorkflow-1.5.9.zip";
+      md5 = "9041e1f52eab5b348c0dfa85be438722";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_i18nmessageid products_plonetestcase products_genericsetup zope_interface zope_testing zope_component setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unidecode = buildPythonPackage rec {
+    name = "Unidecode-0.04.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/U/Unidecode/Unidecode-0.04.1.tar.gz";
+      md5 = "c4c9ed8d40cff25c390ff5d5112b9308";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcore = buildPythonPackage rec {
+    name = "Products.CMFCore-2.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCore/Products.CMFCore-2.2.7.tar.gz";
+      md5 = "9320a4023b8575097feacfd4a400e930";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_genericsetup zope_app_publication products_zsqlmethods zope2 setuptools five_localsitemanager ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_localsitemanager = buildPythonPackage rec {
+    name = "five.localsitemanager-2.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.localsitemanager/five.localsitemanager-2.0.5.zip";
+      md5 = "5e3a658e6068832bd802018ebc83f2d4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_site zope_interface zope_location zope_component zodb3 zope_event setuptools zope_lifecycleevent zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_configuration = buildPythonPackage rec {
+    name = "zope.configuration-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.configuration/zope.configuration-3.7.4.zip";
+      md5 = "5b0271908ef26c05059eda76928896ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfcalendar = buildPythonPackage rec {
+    name = "Products.CMFCalendar-2.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFCalendar/Products.CMFCalendar-2.2.2.tar.gz";
+      md5 = "49458e68dc3b6826ea9a3576ac014419";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfdefault zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_extendedpathindex = buildPythonPackage rec {
+    name = "Products.ExtendedPathIndex-3.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExtendedPathIndex/Products.ExtendedPathIndex-3.1.zip";
+      md5 = "00c048a4b103200bdcbda61fa22c66df";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol transaction zope2 setuptools zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_schemaextender = buildPythonPackage rec {
+    name = "archetypes.schemaextender-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.schemaextender/archetypes.schemaextender-2.1.2.zip";
+      md5 = "865aa5b4b6b26e3bb650d89ddfe77c87";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zconfig = buildPythonPackage rec {
+    name = "ZConfig-2.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZConfig/ZConfig-2.9.0.zip";
+      md5 = "5c932690a70c8907efd240cdd76a7bc4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentmenu = buildPythonPackage rec {
+    name = "plone.app.contentmenu-2.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentmenu/plone.app.contentmenu-2.0.8.zip";
+      md5 = "8ba463f1a164c454c70d26507e5bd22a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_publisher products_cmfdynamicviewfti zope_browsermenu zope_interface plone_memoize plone_app_content zope_component acquisition setuptools zope_i18n plone_locking products_cmfcore zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluginregistry = buildPythonPackage rec {
+    name = "Products.PluginRegistry-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluginRegistry/Products.PluginRegistry-1.3.tar.gz";
+      md5 = "5b166193ca1eb84dfb402051f779ebab";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_alterego = buildPythonPackage rec {
+    name = "plone.alterego-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.alterego/plone.alterego-1.0.zip";
+      md5 = "b7b6dbcbba00505d98d5aba83e016408";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_outputfilters = buildPythonPackage rec {
+    name = "plone.outputfilters-1.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.outputfilters/plone.outputfilters-1.9.zip";
+      md5 = "5ce62a45272c5501bf7d99325d2352c6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_portaltransforms products_mimetypesregistry products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_publisher = buildPythonPackage rec {
+    name = "zope.publisher-3.12.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.publisher/zope.publisher-3.12.6.tar.gz";
+      md5 = "495131970cc7cb14de8e517fb3857ade";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_contenttype zope_proxy zope_interface zope_location zope_exceptions zope_security zope_configuration zope_component zope_event setuptools zope_browser zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_security = buildPythonPackage rec {
+    name = "zope.security-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.security/zope.security-3.7.4.tar.gz";
+      md5 = "072ab8d11adc083eace11262da08630c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema zope_interface zope_location zope_configuration zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zdaemon = buildPythonPackage rec {
+    name = "zdaemon-2.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zdaemon/zdaemon-2.0.7.tar.gz";
+      md5 = "291a875f82e812110557eb6704af8afe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_annotation = buildPythonPackage rec {
+    name = "zope.annotation-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.annotation/zope.annotation-3.5.0.tar.gz";
+      md5 = "4238153279d3f30ab5613438c8e76380";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy zope_interface zope_location zope_component zodb3 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  repoze_xmliter = buildPythonPackage rec {
+    name = "repoze.xmliter-0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/repoze.xmliter/repoze.xmliter-0.5.zip";
+      md5 = "99da76bcbad6fbaced4a273bde29b10e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_form = buildPythonPackage rec {
+    name = "plone.app.form-2.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.form/plone.app.form-2.2.2.zip";
+      md5 = "6101e6a5bd4de6cc8cdef09ced2743eb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema zope_site plone_app_vocabularies zope2 datetime zope_component zope_event five_formlib setuptools zope_interface zope_lifecycleevent zope_formlib zope_browser zope_i18n plone_locking products_cmfcore acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_structuredtext = buildPythonPackage rec {
+    name = "zope.structuredtext-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.structuredtext/zope.structuredtext-3.5.1.tar.gz";
+      md5 = "eabbfb983485d0879322bc878d2478a0";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zodb3 = buildPythonPackage rec {
+    name = "ZODB3-3.10.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-3.10.5.tar.gz";
+      md5 = "6f180c6897a1820948fee2a6290503cd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface transaction zconfig zope_event zdaemon zc_lockfile ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_batching = buildPythonPackage rec {
+    name = "plone.batching-1.0b1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.batching/plone.batching-1.0b1.zip";
+      md5 = "813a7d2d89fedf4f8e90e0c8da949c48";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  documenttemplate = buildPythonPackage rec {
+    name = "DocumentTemplate-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/DocumentTemplate/DocumentTemplate-2.13.2.zip";
+      md5 = "07bb086c77c1dfe94125ad2efbba94b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zope_sequencesort zexceptions restrictedpython zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_search = buildPythonPackage rec {
+    name = "plone.app.search-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.search/plone.app.search-1.1.3.zip";
+      md5 = "396677c3fba762077360ed97b14071e6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_contentlisting setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  diazo = buildPythonPackage rec {
+    name = "diazo-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/diazo/diazo-1.0.3.zip";
+      md5 = "d3c2b017af521db4c86fb360c86e0bc8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml experimental_cssselect setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_globalrequest = buildPythonPackage rec {
+    name = "zope.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.globalrequest/zope.globalrequest-1.0.zip";
+      md5 = "ae6ff02db5ba89c1fb96ed7a73ca1cfa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_customerize = buildPythonPackage rec {
+    name = "plone.app.customerize-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.customerize/plone.app.customerize-1.2.2.zip";
+      md5 = "6a3802c4e8fbd955597adc6a8298febf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope2 zope_publisher zope_interface plone_browserlayer plone_portlets zope_component setuptools five_customerize products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdifftool = buildPythonPackage rec {
+    name = "Products.CMFDiffTool-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDiffTool/Products.CMFDiffTool-2.0.2.zip";
+      md5 = "c12ba4fb9912a9a5a046b07b5b1cf69d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testbrowser = buildPythonPackage rec {
+    name = "zope.testbrowser-3.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testbrowser/zope.testbrowser-3.11.1.tar.gz";
+      md5 = "64abbee892121e7f1a91aed12cfc155a";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface mechanize pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_contentmigration = buildPythonPackage rec {
+    name = "Products.contentmigration-2.1.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.contentmigration/Products.contentmigration-2.1.4.zip";
+      md5 = "711f9d4ea3cc2130acaa74efb0f9da5e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_intelligenttext = buildPythonPackage rec {
+    name = "plone.intelligenttext-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.intelligenttext/plone.intelligenttext-2.0.2.zip";
+      md5 = "51688fa0815b49e00334e3ef948328ba";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_classic = buildPythonPackage rec {
+    name = "plonetheme.classic-1.3.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.classic/plonetheme.classic-1.3.1.zip";
+      md5 = "8f78a3e79dce692a568c5fbc58ba742a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_authentication = buildPythonPackage rec {
+    name = "zope.authentication-3.7.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.authentication/zope.authentication-3.7.1.zip";
+      md5 = "7d6bb340610518f2fc71213cfeccda68";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18n = buildPythonPackage rec {
+    name = "zope.i18n-3.7.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18n/zope.i18n-3.7.4.tar.gz";
+      md5 = "a6fe9d9ad53dd7e94e87cd58fb67d3b7";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_i18nmessageid pytz setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_componentvocabulary = buildPythonPackage rec {
+    name = "zope.componentvocabulary-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.componentvocabulary/zope.componentvocabulary-1.0.1.tar.gz";
+      md5 = "1c8fa82ca1ab1f4b0bd2455a31fde22b";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_security zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_ofsp = buildPythonPackage rec {
+    name = "Products.OFSP-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.OFSP/Products.OFSP-2.13.2.zip";
+      md5 = "c76d40928753c2ee56db873304e65bd5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol persistence setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_datetime = buildPythonPackage rec {
+    name = "zope.datetime-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.datetime/zope.datetime-3.4.1.tar.gz";
+      md5 = "4dde22d34f41a0a4f0c5a345e6d11ee9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  experimental_cssselect = buildPythonPackage rec {
+    name = "experimental.cssselect-0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/experimental.cssselect/experimental.cssselect-0.3.zip";
+      md5 = "3fecdcf1fbc3ea6025e115a56a262957";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_passwordresettool = buildPythonPackage rec {
+    name = "Products.PasswordResetTool-2.0.13";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PasswordResetTool/Products.PasswordResetTool-2.0.13.zip";
+      md5 = "c87de8564cea91eb21c620669ef1a660";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface plone_memoize datetime zope_component setuptools zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_jquerytools = buildPythonPackage rec {
+    name = "plone.app.jquerytools-1.5.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.jquerytools/plone.app.jquerytools-1.5.5.zip";
+      md5 = "7a4957a3a8482e4963e49e2d02772e33";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_component zope2 products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_validation = buildPythonPackage rec {
+    name = "Products.validation-2.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.validation/Products.validation-2.0.zip";
+      md5 = "afa217e2306637d1dccbebf337caa8bf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime setuptools zope_i18n acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_registry = buildPythonPackage rec {
+    name = "plone.registry-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.registry/plone.registry-1.0.1.zip";
+      md5 = "6be3d2ec7e2d170e29b8c0bc65049aff";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface zope_dottedname zope_component zodb3 zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_static = buildPythonPackage rec {
+    name = "plone.portlet.static-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.static/plone.portlet.static-2.0.2.zip";
+      md5 = "ec0dc691b4191a41ff97779b117f9985";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 plone_app_portlets zope_formlib zope_interface setuptools plone_i18n plone_portlets zope_component plone_app_form zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_viewlet = buildPythonPackage rec {
+    name = "zope.viewlet-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.viewlet/zope.viewlet-3.7.2.tar.gz";
+      md5 = "367e03096df57e2f9b74fff43f7901f9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_i18nmessageid zope_publisher zope_interface zope_location zope_security zope_configuration zope_component zope_event setuptools zope_schema zope_traversing zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlet_collection = buildPythonPackage rec {
+    name = "plone.portlet.collection-2.1.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlet.collection/plone.portlet.collection-2.1.4.zip";
+      md5 = "00a139248309043e7b539dee5462e105";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools plone_app_vocabularies plone_app_form plone_portlets plone_app_portlets ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_users = buildPythonPackage rec {
+    name = "plone.app.users-1.2a2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.users/plone.app.users-1.2a2.zip";
+      md5 = "a96e42e34d97162363cb3bbc8483d2ba";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid setuptools zope_site zope_formlib zope_interface plone_app_controlpanel plone_app_layout zope2 zope_component products_statusmessages products_cmfdefault five_formlib plone_protect zodb3 zope_schema products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_querystring = buildPythonPackage rec {
+    name = "plone.app.querystring-1.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.querystring/plone.app.querystring-1.0.8.zip";
+      md5 = "3ad2155da0dd5c6b99643551ad494607";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_i18n zope_publisher setuptools zope_globalrequest plone_app_vocabularies zope_dottedname plone_app_layout datetime plone_registry zope_component plone_app_contentlisting zope_interface zope_schema plone_app_registry products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_i18nmessageid = buildPythonPackage rec {
+    name = "zope.i18nmessageid-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-3.5.3.tar.gz";
+      md5 = "cb84bf61c2b7353e3b7578057fbaa264";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_folder = buildPythonPackage rec {
+    name = "plone.app.folder-1.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.folder/plone.app.folder-1.0.5.zip";
+      md5 = "8ea860daddb4c93c0b7f2b5f7106fef0";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_folder setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zcatalog = buildPythonPackage rec {
+    name = "Products.ZCatalog-2.13.23";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCatalog/Products.ZCatalog-2.13.23.zip";
+      md5 = "d425171516dfc70e543a4e2b852301cb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_testing extensionclass missing zope_dottedname restrictedpython datetime record persistence zodb3 documenttemplate setuptools zope_interface zope_schema products_zctextindex zexceptions acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_openid = buildPythonPackage rec {
+    name = "python-openid-2.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-openid/python-openid-2.2.5.zip";
+      md5 = "f89d9d4f4dccfd33b5ce34eb4725f751";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_autoinclude = buildPythonPackage rec {
+    name = "z3c.autoinclude-0.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.autoinclude/z3c.autoinclude-0.3.4.zip";
+      md5 = "6a615ae18c12b459bceb3ae28e8e7709";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_dottedname zope_configuration zc_buildout setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_processlifetime = buildPythonPackage rec {
+    name = "zope.processlifetime-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.processlifetime/zope.processlifetime-1.0.tar.gz";
+      md5 = "69604bfd668a01ebebdd616a8f26ccfe";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_uuid = buildPythonPackage rec {
+    name = "plone.uuid-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.uuid/plone.uuid-1.0.3.zip";
+      md5 = "183fe2911a7d6c9f6b3103855e98ad8a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_browserpage zope_publisher setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_dexterity = buildPythonPackage rec {
+    name = "plone.dexterity-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.dexterity/plone.dexterity-2.1.2.zip";
+      md5 = "3404947376be89f18e54bbfb5c0d3595";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface plone_memoize zope_dottedname zope_container zope_lifecycleevent plone_synchronize zope_annotation plone_autoform plone_behavior plone_folder zope_publisher products_cmfdefault zope_filerepresentation zope_browser plone_rfc822 zope_size plone_alterego products_statusmessages zope_schema zope2 zope_component zope_location zope_security plone_z3cform zodb3 plone_supermodel plone_uuid setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_synchronize = buildPythonPackage rec {
+    name = "plone.synchronize-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.synchronize/plone.synchronize-1.0.1.zip";
+      md5 = "d25e86ace8daa0816861296c3288c4fb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_traversing = buildPythonPackage rec {
+    name = "zope.traversing-3.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.traversing/zope.traversing-3.13.2.zip";
+      md5 = "eaad8fc7bbef126f9f8616b074ec00aa";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_proxy zope_location zope_interface zope_security zope_component setuptools zope_publisher zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  python_gettext = buildPythonPackage rec {
+    name = "python-gettext-1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-gettext/python-gettext-1.2.zip";
+      md5 = "cd4201d440126d1296d1d2bc2b4795f3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unittest2 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_securemailhost = buildPythonPackage rec {
+    name = "Products.SecureMailHost-1.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.SecureMailHost/Products.SecureMailHost-1.1.2.zip";
+      md5 = "7db0f1fa867bd0df972082f502a7a707";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonelanguagetool = buildPythonPackage rec {
+    name = "Products.PloneLanguageTool-3.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneLanguageTool/Products.PloneLanguageTool-3.2.7.zip";
+      md5 = "bd9eb6278bf76e8cbce99437ca362164";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  eggtestinfo = buildPythonPackage rec {
+    name = "eggtestinfo-0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/eggtestinfo/eggtestinfo-0.3.tar.gz";
+      md5 = "6f0507aee05f00c640c0d64b5073f840";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mailinglogger = buildPythonPackage rec {
+    name = "mailinglogger-3.7.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mailinglogger/mailinglogger-3.7.0.tar.gz";
+      md5 = "f865f0df6059ce23062b7457d01dbac5";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  missing = buildPythonPackage rec {
+    name = "Missing-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Missing/Missing-2.13.1.zip";
+      md5 = "9823cff54444cbbcaef8fc45d8e42572";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_deferredimport = buildPythonPackage rec {
+    name = "zope.deferredimport-3.5.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deferredimport/zope.deferredimport-3.5.3.tar.gz";
+      md5 = "68fce3bf4f011d4a840902fd763884ee";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_proxy setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_tales = buildPythonPackage rec {
+    name = "zope.tales-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.tales/zope.tales-3.5.2.tar.gz";
+      md5 = "1c5060bd766a0a18632b7879fc9e4e1e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools zope_tal ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zsqlmethods = buildPythonPackage rec {
+    name = "Products.ZSQLMethods-2.13.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZSQLMethods/Products.ZSQLMethods-2.13.4.zip";
+      md5 = "bd1ad8fd4a9d4f8b4681401dd5b71dc1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass missing zope_interface datetime zope2 record transaction acquisition setuptools zodb3 persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_statusmessages = buildPythonPackage rec {
+    name = "Products.statusmessages-4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.statusmessages/Products.statusmessages-4.0.zip";
+      md5 = "265324b0a58a032dd0ed038103ed0473";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_annotation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_i18n = buildPythonPackage rec {
+    name = "plone.i18n-2.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.i18n/plone.i18n-2.0.6.zip";
+      md5 = "651e8cbc2cea201276777ab56337a3ee";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ unidecode zope_publisher zope_interface zope_component setuptools zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_querywidget = buildPythonPackage rec {
+    name = "archetypes.querywidget-1.0.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.querywidget/archetypes.querywidget-1.0.8.zip";
+      md5 = "3416b6b4948c624e1b5b8dd8d7e33f59";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_jquerytools plone_app_querystring setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_transformchain = buildPythonPackage rec {
+    name = "plone.transformchain-1.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.transformchain/plone.transformchain-1.0.3.zip";
+      md5 = "f5fb7ca894249e3e666501c4fae52a6c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_pluggableauthservice = buildPythonPackage rec {
+    name = "Products.PluggableAuthService-1.10.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PluggableAuthService/Products.PluggableAuthService-1.10.0.tar.gz";
+      md5 = "1a1db6b1d9dd34f8b93a8a3104385a37";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_pluginregistry zope2 products_genericsetup setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  borg_localrole = buildPythonPackage rec {
+    name = "borg.localrole-3.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/b/borg.localrole/borg.localrole-3.0.2.zip";
+      md5 = "04082694dfda9ae5cda62747b8ac7ccf";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_deferredimport zope_interface plone_memoize zope_component setuptools products_pluggableauthservice zope_annotation products_cmfcore acquisition products_plonepas ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  archetypes_referencebrowserwidget = buildPythonPackage rec {
+    name = "archetypes.referencebrowserwidget-2.4.17";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/archetypes.referencebrowserwidget/archetypes.referencebrowserwidget-2.4.17.zip";
+      md5 = "bb7552f5ccfddcd068649d7b8162020c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_jquerytools zope_component zope_interface plone_app_form zope_formlib setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_globalrequest = buildPythonPackage rec {
+    name = "five.globalrequest-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.globalrequest/five.globalrequest-1.0.tar.gz";
+      md5 = "87f8996bd21d4aa156aa26e7d21b8744";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_globalrequest zope2 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_rfc822 = buildPythonPackage rec {
+    name = "plone.rfc822-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.rfc822/plone.rfc822-1.0.1.zip";
+      md5 = "b5b79bb5a9181da624a7e88940a45424";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_component python_dateutil setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plonetheme_sunburst = buildPythonPackage rec {
+    name = "plonetheme.sunburst-1.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plonetheme.sunburst/plonetheme.sunburst-1.4.1.zip";
+      md5 = "e2008dae3dad458dd7bf3be10e95160b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_portlets = buildPythonPackage rec {
+    name = "plone.portlets-2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.portlets/plone.portlets-2.2.zip";
+      md5 = "5b7e06bee6e40af83694b82e1fee8c2d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_publisher zope_site zope_container zope_interface plone_memoize zope_component zodb3 setuptools zope_schema zope_annotation zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_proxy = buildPythonPackage rec {
+    name = "zope.proxy-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.proxy/zope.proxy-3.6.1.zip";
+      md5 = "a400b0a26624b17fa889dbcaa989d440";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_archetypes = buildPythonPackage rec {
+    name = "Products.Archetypes-1.8.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Archetypes/Products.Archetypes-1.8.7.zip";
+      md5 = "b8a6b04a2f01251e0da1681199511537";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller zope_interface zope_contenttype datetime zope_component products_mimetypesregistry plone_app_folder zope2 zope_lifecycleevent zope_i18nmessageid zope_publisher products_genericsetup products_validation products_portaltransforms products_cmfquickinstallertool products_placelesstranslationservice zope_event acquisition products_dcworkflow products_cmfdefault zope_tal plone_folder products_zsqlmethods products_statusmessages zope_schema zope_viewlet products_cmfcalendar extensionclass zope_datetime products_marshall zope_site zope_deferredimport zodb3 plone_uuid setuptools transaction zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  initgroups = buildPythonPackage rec {
+    name = "initgroups-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/i/initgroups/initgroups-2.13.0.zip";
+      md5 = "38e842dcab8445f65e701fec75213acd";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_schema = buildPythonPackage rec {
+    name = "zope.schema-4.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.schema/zope.schema-4.2.2.tar.gz";
+      md5 = "e7e581af8193551831560a736a53cf58";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_scale = buildPythonPackage rec {
+    name = "plone.scale-1.3.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.scale/plone.scale-1.3.1.zip";
+      md5 = "05f3e5f79237ef9c318730a7c9b367be";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_copy = buildPythonPackage rec {
+    name = "zope.copy-3.5.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.copy/zope.copy-3.5.0.tar.gz";
+      md5 = "a9836a5d36cd548be45210eb00407337";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  roman = buildPythonPackage rec {
+    name = "roman-1.4.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/roman/roman-1.4.0.tar.gz";
+      md5 = "4f8832ed4108174b159c2afb4bd1d1dd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_event = buildPythonPackage rec {
+    name = "zope.event-3.5.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.event/zope.event-3.5.2.tar.gz";
+      md5 = "6e8af2a16157a74885d4f0d88137cefb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  acquisition = buildPythonPackage rec {
+    name = "Acquisition-2.13.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/Acquisition/Acquisition-2.13.8.zip";
+      md5 = "8c33160c157b50649e2b2b3224622579";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_resource = buildPythonPackage rec {
+    name = "plone.resource-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.resource/plone.resource-1.0.2.zip";
+      md5 = "594d41e3acd913ae92f2e9ef96503b9f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ python_dateutil zope_filerepresentation zope2 zope_publisher z3c_caching zope_interface zope_traversing zope_configuration zope_component plone_caching setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_linkintegrity = buildPythonPackage rec {
+    name = "plone.app.linkintegrity-1.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.linkintegrity/plone.app.linkintegrity-1.5.1.zip";
+      md5 = "89701634d59c3b1a6fc61e5a21c4de52";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_resourceregistries = buildPythonPackage rec {
+    name = "Products.ResourceRegistries-2.2.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ResourceRegistries/Products.ResourceRegistries-2.2.7.zip";
+      md5 = "954e31a168a1eb3153e2fd4e590bb9ba";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_interface datetime plone_app_registry zope_component zodb3 setuptools zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_browserlayer = buildPythonPackage rec {
+    name = "plone.browserlayer-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.browserlayer/plone.browserlayer-2.1.2.zip";
+      md5 = "bce02f4907a4f29314090c525e5fc28e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_traversing zope_component setuptools products_genericsetup products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  markdown = buildPythonPackage rec {
+    name = "Markdown-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Markdown/Markdown-2.0.3.zip";
+      md5 = "122418893e21e91109edbf6e082f830d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_formwidget_query = buildPythonPackage rec {
+    name = "z3c.formwidget.query-0.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.formwidget.query/z3c.formwidget.query-0.9.zip";
+      md5 = "d9f7960b1a5a81d8ba5241530f496522";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid z3c_form zope_interface zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_z3cform = buildPythonPackage rec {
+    name = "plone.app.z3cform-0.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.z3cform/plone.app.z3cform-0.7.2.zip";
+      md5 = "aa8d1d45f8072ccfbfe0a608cd7144b6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 setuptools plone_z3cform zope_interface z3c_formwidget_query collective_z3cform_datetimewidget zope_component zope_browserpage plone_protect zope_traversing ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_viewletmanager = buildPythonPackage rec {
+    name = "plone.app.viewletmanager-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.viewletmanager/plone.app.viewletmanager-2.0.3.zip";
+      md5 = "1dbc51c7664ce3e6ca4dcca1b7b86082";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 products_genericsetup zope_site zope_interface zope_component zodb3 acquisition setuptools plone_app_vocabularies zope_viewlet zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentlisting = buildPythonPackage rec {
+    name = "plone.app.contentlisting-1.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentlisting/plone.app.contentlisting-1.0.4.zip";
+      md5 = "fa6eb45c4ffd0eb3817ad4813ca24916";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ramcache = buildPythonPackage rec {
+    name = "zope.ramcache-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ramcache/zope.ramcache-1.0.zip";
+      md5 = "87289e15f0e51f50704adda1557c02a7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zodb3 zope_testing setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_vocabularies = buildPythonPackage rec {
+    name = "plone.app.vocabularies-2.1.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.vocabularies/plone.app.vocabularies-2.1.10.tar.gz";
+      md5 = "166a0d6f9a3e3cd753efa56aaef585be";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_site zope_formlib zope_interface zope_component setuptools zope_schema zope_browser zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_discussion = buildPythonPackage rec {
+    name = "plone.app.discussion-2.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.discussion/plone.app.discussion-2.2.5.zip";
+      md5 = "a6c3a6e5590943f6ac63a49f8e075cdb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_app_uuid zope_site plone_indexer collective_monkeypatcher zope_interface plone_app_z3cform zope_container plone_app_layout plone_z3cform plone_app_registry zope_component zodb3 zope_event setuptools z3c_form zope_lifecycleevent zope_annotation plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zlog = buildPythonPackage rec {
+    name = "zLOG-2.11.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zLOG/zLOG-2.11.1.tar.gz";
+      md5 = "68073679aaa79ac5a7b6a5c025467147";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zconfig ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone = buildPythonPackage rec {
+    name = "Plone-4.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Plone/Plone-4.3.zip";
+      md5 = "be27f5d87cf44338be6f209459b13b70";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone plone_app_caching plone_app_dexterity plone_app_theming setuptools products_cmfplacefulworkflow plone_app_openid plone_app_iterate wicked ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_standardcachemanagers = buildPythonPackage rec {
+    name = "Products.StandardCacheManagers-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.StandardCacheManagers/Products.StandardCacheManagers-2.13.0.zip";
+      md5 = "c5088b2b62bd26d63d9579a04369cb73";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol zope_component transaction setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_fieldsets = buildPythonPackage rec {
+    name = "plone.fieldsets-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.fieldsets/plone.fieldsets-2.0.2.zip";
+      md5 = "4158c8a1f784fcb5cecbd63deda7222f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_formlib zope_interface zope_component five_formlib setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_monkeypatcher = buildPythonPackage rec {
+    name = "collective.monkeypatcher-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.monkeypatcher/collective.monkeypatcher-1.0.1.zip";
+      md5 = "4d4f20f9b8bb84b24afadc4f56f6dc2c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_zcmlhook = buildPythonPackage rec {
+    name = "z3c.zcmlhook-1.0b1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.zcmlhook/z3c.zcmlhook-1.0b1.tar.gz";
+      md5 = "7b6c80146f5930409eb0b355ddf3daeb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_component zope_configuration setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_recipe_zope2instance = buildPythonPackage rec {
+    name = "plone.recipe.zope2instance-4.2.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.recipe.zope2instance/plone.recipe.zope2instance-4.2.10.zip";
+      md5 = "787fad7fa44757de74a50a91e9bcfcb5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zodb3 mailinglogger zc_buildout setuptools zope2 zc_recipe_egg ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_supermodel = buildPythonPackage rec {
+    name = "plone.supermodel-1.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.supermodel/plone.supermodel-1.2.1.zip";
+      md5 = "b60d1553b297d41d9e2181afe15da4f4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ lxml zope_deferredimport zope_interface zope_dottedname zope_component z3c_zcmlhook setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_registry = buildPythonPackage rec {
+    name = "plone.app.registry-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.registry/plone.app.registry-1.2.2.zip";
+      md5 = "d4659a2c4cfb3a66cd6c7ff1ca17be7f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid lxml plone_registry products_genericsetup plone_supermodel plone_app_z3cform zope_dottedname zope_component zope2 setuptools zope_interface products_statusmessages plone_autoform products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_pagetemplate = buildPythonPackage rec {
+    name = "zope.pagetemplate-3.6.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.pagetemplate/zope.pagetemplate-3.6.3.zip";
+      md5 = "834a4bf702c05fba1e669677b4dc871f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface zope_traversing zope_tales zope_security zope_component setuptools zope_tal zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfformcontroller = buildPythonPackage rec {
+    name = "Products.CMFFormController-3.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFFormController/Products.CMFFormController-3.0.3.zip";
+      md5 = "6573df7dcb39e3b63ba22abe2acd639e";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_tales products_cmfcore zope2 setuptools zope_structuredtext acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_openid = buildPythonPackage rec {
+    name = "plone.openid-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.openid/plone.openid-2.0.1.zip";
+      md5 = "d4c36926a6dbefed035ed92c29329ce1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_pluggableauthservice python_openid zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_content = buildPythonPackage rec {
+    name = "zope.app.content-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.content/zope.app.content-3.5.1.tar.gz";
+      md5 = "0ac6a6fcb5dd6f845759f998d8e8cbb3";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface zope_componentvocabulary zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_size = buildPythonPackage rec {
+    name = "zope.size-3.4.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.size/zope.size-3.4.1.tar.gz";
+      md5 = "55d9084dfd9dcbdb5ad2191ceb5ed03d";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mimetypesregistry = buildPythonPackage rec {
+    name = "Products.MimetypesRegistry-2.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MimetypesRegistry/Products.MimetypesRegistry-2.0.4.zip";
+      md5 = "898166bb2aaececc8238ad4ee4826793";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_interface zope_contenttype zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_imaging = buildPythonPackage rec {
+    name = "plone.app.imaging-1.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.imaging/plone.app.imaging-1.0.7.zip";
+      md5 = "27c24477bdcbcebeba6cd83419a57aa6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_marshall = buildPythonPackage rec {
+    name = "Products.Marshall-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.Marshall/Products.Marshall-2.1.2.zip";
+      md5 = "bde4d7f75195c1ded8371554b04d2541";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction products_genericsetup zope_interface zope_contenttype datetime extensionclass plone_uuid setuptools zope2 products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_ptresource = buildPythonPackage rec {
+    name = "zope.ptresource-3.9.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.ptresource/zope.ptresource-3.9.0.tar.gz";
+      md5 = "f4645e51c15289d3fdfb4139039e18e9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_pagetemplate zope_interface zope_browserresource zope_security setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfactionicons = buildPythonPackage rec {
+    name = "Products.CMFActionIcons-2.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFActionIcons/Products.CMFActionIcons-2.1.3.tar.gz";
+      md5 = "ab1dc62404ed11aea84dc0d782b2235e";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  multimapping = buildPythonPackage rec {
+    name = "MultiMapping-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/MultiMapping/MultiMapping-2.13.0.zip";
+      md5 = "d69c5904c105b9f2f085d4103e0f0586";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_mailhost = buildPythonPackage rec {
+    name = "Products.MailHost-2.13.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.MailHost/Products.MailHost-2.13.1.zip";
+      md5 = "1102e523435d8bf78a15b9ddb57478e1";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  pytz = buildPythonPackage rec {
+    name = "pytz-2012g";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pytz/pytz-2012g.zip";
+      md5 = "1a9b24da1ab6328074b48fc3d4525078";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_i18n = buildPythonPackage rec {
+    name = "plone.app.i18n-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.i18n/plone.app.i18n-2.0.2.zip";
+      md5 = "a10026573463dfc1899bf4062cebdbf2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_indexer = buildPythonPackage rec {
+    name = "plone.indexer-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.indexer/plone.indexer-1.0.2.zip";
+      md5 = "538aeee1f9db78bc8c85ae1bcb0153ed";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface products_cmfcore setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externalmethod = buildPythonPackage rec {
+    name = "Products.ExternalMethod-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalMethod/Products.ExternalMethod-2.13.0.zip";
+      md5 = "15ba953ef6cb632eb571977651252ea6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol extensionclass zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_upgrade = buildPythonPackage rec {
+    name = "plone.app.upgrade-1.3.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.upgrade/plone.app.upgrade-1.3.1.zip";
+      md5 = "ebbfe71e31e40df535c8c1a2bc6133e6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfformcontroller zope_interface products_cmfactionicons products_cmfeditions products_archetypes products_mimetypesregistry plone_app_folder products_cmfuid products_securemailhost zope_ramcache products_genericsetup products_cmfdifftool five_localsitemanager products_cmfquickinstallertool products_portaltransforms products_cmfdefault acquisition products_dcworkflow products_zcatalog borg_localrole products_contentmigration products_resourceregistries plone_portlets zope2 plone_app_portlets products_cmfcalendar products_plonepas transaction products_pluggableauthservice zope_site zope_component zope_location products_plonelanguagetool plone_session setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserpage = buildPythonPackage rec {
+    name = "zope.browserpage-3.12.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserpage/zope.browserpage-3.12.2.tar.gz";
+      md5 = "a543ef3cb1b42f7233b3fca23dc9ea60";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_pagetemplate zope_interface zope_traversing zope_component zope_security zope_configuration zope_publisher setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_resourceeditor = buildPythonPackage rec {
+    name = "plone.resourceeditor-1.0b4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.resourceeditor/plone.resourceeditor-1.0b4.zip";
+      md5 = "6e419868c2ea94a322dd631a1b0b753c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_resource zope2 zope_publisher zope_interface zope_component setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atcontenttypes = buildPythonPackage rec {
+    name = "Products.ATContentTypes-2.1.12";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATContentTypes/Products.ATContentTypes-2.1.12.zip";
+      md5 = "ef38ce0769a5f44e272623f8f118a669";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_interface plone_memoize datetime products_archetypes products_mimetypesregistry plone_app_folder zope2 zope_i18nmessageid zope_publisher products_genericsetup plone_i18n products_portaltransforms products_cmfdefault products_atreferencebrowserwidget zope_tal zconfig archetypes_referencebrowserwidget transaction products_validation acquisition extensionclass zope_component plone_app_layout zodb3 setuptools zope_i18n products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfeditions = buildPythonPackage rec {
+    name = "Products.CMFEditions-2.2.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFEditions/Products.CMFEditions-2.2.8.zip";
+      md5 = "1806f2e17e2527fad9364670b343bd11";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_cmfdifftool zope_copy zope_interface products_genericsetup zope_dottedname products_zopeversioncontrol datetime products_cmfuid zodb3 products_cmfcore setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_interface = buildPythonPackage rec {
+    name = "zope.interface-3.6.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.7.zip";
+      md5 = "9df962180fbbb54eb1875cff9fe436e5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_content = buildPythonPackage rec {
+    name = "plone.app.content-2.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.content/plone.app.content-2.1.1.zip";
+      md5 = "96d9967254ea616783ca8b340a542d46";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_publisher zope_container plone_batching zope_interface plone_memoize plone_i18n zope_component zope_event products_cmfcore setuptools zope_schema zope_lifecycleevent zope_i18n zope_viewlet acquisition products_cmfdefault ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfquickinstallertool = buildPythonPackage rec {
+    name = "Products.CMFQuickInstallerTool-3.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFQuickInstallerTool/Products.CMFQuickInstallerTool-3.0.6.tar.gz";
+      md5 = "af34adb87ddf2b6da48eff8b70ca2989";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 products_genericsetup zope_interface datetime zope_component setuptools zope_annotation products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_autoform = buildPythonPackage rec {
+    name = "plone.autoform-1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.autoform/plone.autoform-1.3.zip";
+      md5 = "4cb2935ba9cda3eb3ee801ad8cda7c60";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form zope_interface zope_dottedname zope_security setuptools plone_supermodel zope_schema plone_z3cform ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_contentrules = buildPythonPackage rec {
+    name = "plone.app.contentrules-3.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.contentrules/plone.app.contentrules-3.0.1.zip";
+      md5 = "08138cb6e3f15a2a9d43990f55fdae5f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_traversing plone_app_form zope_component zope_lifecycleevent zope_annotation zope_i18nmessageid products_genericsetup zope_event products_cmfdefault zope_browser plone_uuid plone_memoize zope2 plone_stringinterp products_statusmessages plone_contentrules zope_schema acquisition transaction zope_site zope_container plone_app_vocabularies zope_publisher zope_formlib zodb3 five_formlib setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  record = buildPythonPackage rec {
+    name = "Record-2.13.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/R/Record/Record-2.13.0.zip";
+      md5 = "cfed6a89d4fb2c9cb995e9084c3071b7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_behavior = buildPythonPackage rec {
+    name = "plone.behavior-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.behavior/plone.behavior-1.0.2.zip";
+      md5 = "4459b91287ebc2f2cf4fa38728b2a739";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_configuration zope_component setuptools zope_schema zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_plonetestcase = buildPythonPackage rec {
+    name = "Products.PloneTestCase-0.9.16";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PloneTestCase/Products.PloneTestCase-0.9.16.zip";
+      md5 = "968a265bede995f485988158e4e6dd7f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfplone zope_testing zope2 products_genericsetup zope_site zope_interface products_atcontenttypes zope_component zodb3 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_stringinterp = buildPythonPackage rec {
+    name = "plone.stringinterp-1.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.stringinterp/plone.stringinterp-1.0.7.zip";
+      md5 = "81909716210c6ac3fd0ee87f45ea523d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18n products_cmfcore setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_formwidget_namedfile = buildPythonPackage rec {
+    name = "plone.formwidget.namedfile-1.0.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.formwidget.namedfile/plone.formwidget.namedfile-1.0.5.zip";
+      md5 = "7d39a5760d679c89d8e41abbc295240f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form plone_z3cform plone_namedfile setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_blob = buildPythonPackage rec {
+    name = "plone.app.blob-1.5.8";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.blob/plone.app.blob-1.5.8.zip";
+      md5 = "7e575d8df137cd19067cc95845aae604";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_scale plone_app_imaging zodb3 setuptools archetypes_schemaextender zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfdynamicviewfti = buildPythonPackage rec {
+    name = "Products.CMFDynamicViewFTI-4.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFDynamicViewFTI/Products.CMFDynamicViewFTI-4.0.4.zip";
+      md5 = "0358cdcfcaaafd6ff407a49752c8066b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass products_genericsetup zope_browsermenu zope_interface zope_component zope2 setuptools products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_keyring = buildPythonPackage rec {
+    name = "plone.keyring-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.keyring/plone.keyring-2.0.1.zip";
+      md5 = "f3970e9bddb2cc65e461a2c62879233f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_container zope_location zodb3 setuptools zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contentprovider = buildPythonPackage rec {
+    name = "zope.contentprovider-3.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contentprovider/zope.contentprovider-3.7.2.tar.gz";
+      md5 = "1bb2132551175c0123f17939a793f812";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_publisher zope_interface zope_location zope_tales zope_component zope_event setuptools zope_schema ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_jquery = buildPythonPackage rec {
+    name = "plone.app.jquery-1.7.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.jquery/plone.app.jquery-1.7.2.tar.gz";
+      md5 = "e204cf45456d26217263531832b5bdac";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_cmfcore setuptools products_genericsetup ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_atreferencebrowserwidget = buildPythonPackage rec {
+    name = "Products.ATReferenceBrowserWidget-3.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ATReferenceBrowserWidget/Products.ATReferenceBrowserWidget-3.0.zip";
+      md5 = "157bdd32155c8353450c17c649aad042";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_deprecation archetypes_referencebrowserwidget setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browserresource = buildPythonPackage rec {
+    name = "zope.browserresource-3.10.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browserresource/zope.browserresource-3.10.3.zip";
+      md5 = "dbfde30e82dbfa1a74c5da0cb5a4772d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface zope_location zope_traversing zope_contenttype zope_configuration zope_publisher setuptools zope_schema zope_i18n zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_caching = buildPythonPackage rec {
+    name = "plone.caching-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.caching/plone.caching-1.0.zip";
+      md5 = "2c2e3b27d13b9101c92dfed222fde36c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid five_globalrequest z3c_caching zope_interface zope2 zope_component setuptools plone_transformchain zope_schema plone_registry ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_locales = buildPythonPackage rec {
+    name = "zope.app.locales-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.locales/zope.app.locales-3.6.2.tar.gz";
+      md5 = "bd2b4c6040e768f33004b1210d3207fa";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_i18nmessageid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_placelesstranslationservice = buildPythonPackage rec {
+    name = "Products.PlacelessTranslationService-2.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.PlacelessTranslationService/Products.PlacelessTranslationService-2.0.3.zip";
+      md5 = "a94635eb712563c5a002520713f5d6dc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zope_publisher zope_deferredimport zope_deprecation zope_interface python_gettext datetime zope_component zodb3 setuptools zope_annotation zope_i18n zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_z3cform = buildPythonPackage rec {
+    name = "plone.z3cform-0.8.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.z3cform/plone.z3cform-0.8.0.zip";
+      md5 = "bdb23dd162544964d2f8f8f5f002e874";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_component plone_batching zope_i18n z3c_form zope_browserpage setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_lifecycleevent = buildPythonPackage rec {
+    name = "zope.lifecycleevent-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.lifecycleevent/zope.lifecycleevent-3.6.2.tar.gz";
+      md5 = "3ba978f3ba7c0805c81c2c79ea3edb33";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_form = buildPythonPackage rec {
+    name = "zope.app.form-4.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.form/zope.app.form-4.0.2.tar.gz";
+      md5 = "3d2b164d9d37a71490a024aaeb412e91";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_browserpage zope_schema transaction zope_datetime zope_browsermenu zope_interface zope_exceptions zope_security zope_configuration zope_publisher zope_component zope_formlib zope_browser setuptools zope_proxy zope_i18n ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_tinymce = buildPythonPackage rec {
+    name = "Products.TinyMCE-1.3.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.TinyMCE/Products.TinyMCE-1.3.3.zip";
+      md5 = "3a88b1d1cbd34b860fbe6b3de979e2ea";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_archetypes plone_app_imaging plone_namedfile plone_app_layout zope_schema products_resourceregistries zope_app_content plone_caching setuptools plone_outputfilters ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  collective_z3cform_datetimewidget = buildPythonPackage rec {
+    name = "collective.z3cform.datetimewidget-1.2.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/collective.z3cform.datetimewidget/collective.z3cform.datetimewidget-1.2.3.zip";
+      md5 = "439117021c93f26c677510504ee245d3";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ z3c_form zope_deprecation zope_i18n setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_form = buildPythonPackage rec {
+    name = "z3c.form-3.0.0a3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.form/z3c.form-3.0.0a3.zip";
+      md5 = "557032834c90b71cf55b1068ee41472b";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_site zope_pagetemplate zope_interface zope_browserresource six zope_security zope_configuration zope_component zope_event zope_traversing setuptools zope_schema zope_lifecycleevent zope_browser zope_i18n zope_location zope_contentprovider ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_dcworkflow = buildPythonPackage rec {
+    name = "Products.DCWorkflow-2.2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.DCWorkflow/Products.DCWorkflow-2.2.4.tar.gz";
+      md5 = "c90a16c4f3611015592ba8173a5f1863";
+    };
+    buildInputs = [ eggtestinfo ];
+    propagatedBuildInputs = [ zope2 products_cmfcore setuptools products_genericsetup eggtestinfo ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  mechanize = buildPythonPackage rec {
+    name = "mechanize-0.2.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mechanize/mechanize-0.2.5.zip";
+      md5 = "a497ad4e875f7506ffcf8ad3ada4c2fc";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_iterate = buildPythonPackage rec {
+    name = "plone.app.iterate-2.1.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.iterate/plone.app.iterate-2.1.10.zip";
+      md5 = "8bd270d8a3c9509e524a06e092a9b4c4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_viewlet zope_i18nmessageid zodb3 products_archetypes zope_interface plone_memoize products_cmfeditions datetime zope_component products_dcworkflow products_statusmessages zope_event setuptools products_cmfplacefulworkflow zope_schema zope_lifecycleevent zope_annotation zope2 plone_locking products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  accesscontrol = buildPythonPackage rec {
+    name = "AccessControl-3.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/A/AccessControl/AccessControl-3.0.6.zip";
+      md5 = "a8ce472482adabf9ec969f3971a39a19";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_security zope_testing extensionclass zope_publisher restrictedpython zope_interface zope_deferredimport zope_schema zope_configuration datetime record transaction acquisition zodb3 zope_component zexceptions persistence ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_testing = buildPythonPackage rec {
+    name = "zope.testing-3.9.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testing/zope.testing-3.9.7.tar.gz";
+      md5 = "8999f3d143d416dc3c8b2a5bd6f33e28";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_exceptions setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_externaleditor = buildPythonPackage rec {
+    name = "Products.ExternalEditor-1.1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ExternalEditor/Products.ExternalEditor-1.1.0.zip";
+      md5 = "475fea6e0b958c0c51cfdbfef2f4e623";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_app_publication = buildPythonPackage rec {
+    name = "zope.app.publication-3.12.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.app.publication/zope.app.publication-3.12.0.zip";
+      md5 = "d8c521287f52fb9f40fa9b8c2acb4675";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_authentication zope_publisher zope_interface zope_location zope_traversing zope_component zope_error zodb3 setuptools zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_filerepresentation = buildPythonPackage rec {
+    name = "zope.filerepresentation-3.6.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.filerepresentation/zope.filerepresentation-3.6.1.tar.gz";
+      md5 = "4a7a434094f4bfa99a7f22e75966c359";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_schema zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  six = buildPythonPackage rec {
+    name = "six-1.2.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/s/six/six-1.2.0.tar.gz";
+      md5 = "2a5d1afc79912832ac78fd38e3d75d7e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_dexterity = buildPythonPackage rec {
+    name = "plone.app.dexterity-2.0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.dexterity/plone.app.dexterity-2.0.7.zip";
+      md5 = "3187fc0a9082847d773eeec9bce6d217";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ collective_z3cform_datetimewidget zope_interface zope_component plone_dexterity plone_autoform plone_behavior lxml zope_publisher products_genericsetup plone_supermodel plone_namedfile plone_app_content plone_app_textfield plone_app_z3cform plone_rfc822 plone_formwidget_namedfile z3c_form plone_portlets plone_app_uuid zope_browserpage plone_contentrules products_cmfplone zope_schema products_atcontenttypes zope2 plone_app_layout plone_schemaeditor plone_z3cform setuptools products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_exceptions = buildPythonPackage rec {
+    name = "zope.exceptions-3.6.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.exceptions/zope.exceptions-3.6.2.tar.gz";
+      md5 = "d7234d99d728abe3d9275346e8d24fd9";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_layout = buildPythonPackage rec {
+    name = "plone.app.layout-2.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.layout/plone.app.layout-2.3.4.zip";
+      md5 = "817819f27ad46fcb8a9d66e988fa08f2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti zope_deprecation zope_interface plone_memoize zope_dottedname datetime zope_component zope_annotation zope_publisher plone_i18n products_cmfdefault plone_app_viewletmanager plone_portlets plone_app_portlets zope_schema zope_viewlet acquisition zope2 setuptools zope_i18n plone_locking products_cmfcore products_cmfeditions ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_contenttype = buildPythonPackage rec {
+    name = "zope.contenttype-3.5.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contenttype/zope.contenttype-3.5.5.zip";
+      md5 = "c6ac80e6887de4108a383f349fbdf332";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  five_customerize = buildPythonPackage rec {
+    name = "five.customerize-1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/five.customerize/five.customerize-1.1.zip";
+      md5 = "80772212a2d55150a6c070fc4638b0c7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing transaction zope_publisher zope_site zope_pagetemplate zope_interface zope_traversing zope_dottedname plone_portlets zope_component zope_componentvocabulary setuptools zope_schema zope_lifecycleevent zope2 zope_viewlet acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_subrequest = buildPythonPackage rec {
+    name = "plone.subrequest-1.6.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.subrequest/plone.subrequest-1.6.7.zip";
+      md5 = "cc12f68a22565415b10dbeef0020baa4";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_globalrequest five_globalrequest setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_site = buildPythonPackage rec {
+    name = "zope.site-3.9.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.site/zope.site-3.9.2.tar.gz";
+      md5 = "36a0b8dfbd713ed452ce6973ab0a3ddb";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_location zope_interface zope_security zope_container zope_event setuptools zope_lifecycleevent zope_annotation zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  wicked = buildPythonPackage rec {
+    name = "wicked-1.1.10";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/w/wicked/wicked-1.1.10.zip";
+      md5 = "f65611f11d547d7dc8e623bf87d3929d";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_container zope_traversing setuptools zope_lifecycleevent ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_schemaeditor = buildPythonPackage rec {
+    name = "plone.schemaeditor-1.3.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.schemaeditor/plone.schemaeditor-1.3.2.zip";
+      md5 = "ab9cb4e929f305063dc8f33e9a33fd21";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope2 zope_publisher zope_container z3c_form zope_interface zope_component setuptools zope_schema zope_lifecycleevent plone_autoform plone_z3cform ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_uuid = buildPythonPackage rec {
+    name = "plone.app.uuid-1.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.uuid/plone.app.uuid-1.0.zip";
+      md5 = "9ca8dcfb09a8a0d6bbee0f28073c3d3f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_indexer zope_interface zope_publisher plone_uuid setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  unittest2 = buildPythonPackage rec {
+    name = "unittest2-0.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/u/unittest2/unittest2-0.5.1.zip";
+      md5 = "1527fb89e38343945af1166342d851ee";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  persistence = buildPythonPackage rec {
+    name = "Persistence-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Persistence/Persistence-2.13.2.zip";
+      md5 = "92693648ccdc59c8fc71f7f06b1d228c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ extensionclass zodb3 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zopeversioncontrol = buildPythonPackage rec {
+    name = "Products.ZopeVersionControl-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZopeVersionControl/Products.ZopeVersionControl-1.1.3.zip";
+      md5 = "238239102f3ac798ee4f4c53343a561f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ transaction zope_interface datetime zodb3 setuptools zope2 acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_location = buildPythonPackage rec {
+    name = "zope.location-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.location/zope.location-3.9.1.tar.gz";
+      md5 = "1684a8f986099d15296f670c58e713d8";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_schema zope_component setuptools zope_proxy ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_browsermenu = buildPythonPackage rec {
+    name = "zope.browsermenu-3.9.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browsermenu/zope.browsermenu-3.9.1.zip";
+      md5 = "a47c7b1e786661c912a1150bf8d1f83f";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_interface zope_traversing zope_component zope_security zope_configuration zope_pagetemplate setuptools zope_schema zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_workflow = buildPythonPackage rec {
+    name = "plone.app.workflow-2.1.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.workflow/plone.app.workflow-2.1.2.zip";
+      md5 = "8da95b396f3a9ec54895085ef12202a7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction products_genericsetup zope_site zope_interface plone_memoize zope_testing datetime zope_component products_statusmessages zope2 setuptools products_dcworkflow zope_schema zope_i18n products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_locking = buildPythonPackage rec {
+    name = "plone.locking-2.0.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.locking/plone.locking-2.0.4.zip";
+      md5 = "a7f8b8db78f57272d351d7fe0d067eb2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope2 zope_interface datetime zope_component zodb3 setuptools zope_schema zope_annotation zope_viewlet products_cmfcore acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_dottedname = buildPythonPackage rec {
+    name = "zope.dottedname-3.4.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dottedname/zope.dottedname-3.4.6.tar.gz";
+      md5 = "62d639f75b31d2d864fe5982cb23959c";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_cachedescriptors = buildPythonPackage rec {
+    name = "zope.cachedescriptors-3.5.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.cachedescriptors/zope.cachedescriptors-3.5.1.zip";
+      md5 = "263459a95238fd61d17e815d97ca49ce";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_collection = buildPythonPackage rec {
+    name = "plone.app.collection-1.0.9";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.collection/plone.app.collection-1.0.9.zip";
+      md5 = "bde68dc585ca0a4715ab55d4b4afcf9a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_portlet_collection zope_i18nmessageid transaction plone_app_contentlisting zope_component plone_app_vocabularies plone_app_form products_validation zope_configuration plone_portlets setuptools products_archetypes zope2 plone_app_portlets zope_interface zope_schema products_cmfquickinstallertool archetypes_querywidget products_cmfcore zope_formlib ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_lockfile = buildPythonPackage rec {
+    name = "zc.lockfile-1.0.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.lockfile/zc.lockfile-1.0.0.tar.gz";
+      md5 = "6cf83766ef9935c33e240b0904c7a45e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  lxml = buildPythonPackage rec {
+    name = "lxml-2.3.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/l/lxml/lxml-2.3.6.tar.gz";
+      md5 = "d5d886088e78b1bdbfd66d328fc2d0bc";
+    };
+    buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_contentrules = buildPythonPackage rec {
+    name = "plone.contentrules-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.contentrules/plone.contentrules-2.0.2.zip";
+      md5 = "a32370656c4fd58652fcd8a234db69c5";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_container zope_interface zope_testing zope_configuration zope_component zope_componentvocabulary setuptools zodb3 zope_schema zope_lifecycleevent zope_annotation ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_sendmail = buildPythonPackage rec {
+    name = "zope.sendmail-3.7.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sendmail/zope.sendmail-3.7.5.tar.gz";
+      md5 = "8a513ecf2b41cad849f6607bf16d6818";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_i18nmessageid transaction zope_interface zope_configuration setuptools zope_schema zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_formlib = buildPythonPackage rec {
+    name = "zope.formlib-4.0.6";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.formlib/zope.formlib-4.0.6.zip";
+      md5 = "eed9c94382d11a4dececd0a48ac1d3f2";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_i18nmessageid zope_publisher zope_schema zope_datetime zope_interface zope_traversing zope_security zope_component pytz zope_event zope_browser setuptools zope_lifecycleevent zope_i18n zope_browserpage ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_caching = buildPythonPackage rec {
+    name = "plone.app.caching-1.1.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.caching/plone.app.caching-1.1.3.zip";
+      md5 = "1975506ecf8d42944946dbb2b8f8dc01";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti z3c_form zope_interface plone_memoize zope_component plone_caching zope_publisher products_genericsetup plone_app_registry z3c_zcmlhook setuptools plone_app_z3cform products_statusmessages python_dateutil plone_cachepurging acquisition zope2 zope_pagetemplate zope_browserresource plone_protect plone_registry products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_cmfplone = buildPythonPackage rec {
+    name = "Products.CMFPlone-4.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.CMFPlone/Products.CMFPlone-4.3.zip";
+      md5 = "25be0a93702c242ed5985cebde34f872";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ products_cmfdynamicviewfti plone_app_blob products_dcworkflow products_extendedpathindex zope_dottedname datetime zope_traversing products_tinymce zope_publisher plonetheme_classic plone_batching plone_fieldsets products_cmfdefault acquisition plone_app_contentlisting products_externaleditor products_pluginregistry products_cmfeditions products_resourceregistries zope_tal plone_app_jquerytools products_genericsetup pillow five_localsitemanager plone_app_vocabularies zope_location zope_deferredimport products_plonelanguagetool borg_localrole zope_i18n plone_browserlayer plone_theme plone_memoize plone_app_contentmenu plone_app_i18n zope_component products_mimetypesregistry plone_app_customerize plone_app_folder plone_registry zope_i18nmessageid plone_app_upgrade products_cmfdifftool five_customerize plone_app_search products_portaltransforms plone_app_controlpanel plone_app_locales plone_app_linkintegrity zope2 plone_contentrules plone_app_portlets products_plonepas zope_pagetemplate zodb3 plone_locking products_cmfformcontroller zope_deprecation plone_app_form plone_app_layout products_cmfquickinstallertool archetypes_querywidget plone_app_redirector plone_i18n plone_app_registry products_placelesstranslationservice plone_app_users zope_interface zope_event plone_app_viewletmanager zope_structuredtext z3c_autoinclude zope_app_locales plone_portlets products_statusmessages products_cmfcalendar extensionclass products_pluggableauthservice plone_indexer products_cmfuid zope_container plone_app_workflow setuptools plone_portlet_collection plone_app_contentrules products_cmfactionicons products_archetypes plone_intelligenttext plone_app_collection products_passwordresettool plone_app_content plonetheme_sunburst plone_protect zope_tales plone_app_uuid archetypes_referencebrowserwidget products_atcontenttypes plone_app_jquery transaction zope_site plone_app_discussion plone_portlet_static plone_session products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  transaction = buildPythonPackage rec {
+    name = "transaction-1.1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/transaction/transaction-1.1.1.tar.gz";
+      md5 = "30b062baa34fe1521ad979fb088c8c55";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_controlpanel = buildPythonPackage rec {
+    name = "plone.app.controlpanel-2.3.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.controlpanel/plone.app.controlpanel-2.3.4.zip";
+      md5 = "d01b8c188498080a52275de2a50b25eb";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zope_interface plone_memoize zope_component plone_app_workflow zope_annotation zope_ramcache zope_publisher products_portaltransforms plone_fieldsets zope_event products_cmfdefault zope_cachedescriptors plone_app_form setuptools products_statusmessages zope_schema zope2 acquisition products_plonepas zope_site plone_app_vocabularies zope_formlib zodb3 plone_protect zope_i18n plone_locking products_cmfcore ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_redirector = buildPythonPackage rec {
+    name = "plone.app.redirector-1.2a1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.redirector/plone.app.redirector-1.2a1.zip";
+      md5 = "b63b6443b4bbc5562bddcb43600349f7";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ plone_memoize setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_component = buildPythonPackage rec {
+    name = "zope.component-3.9.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.component/zope.component-3.9.5.tar.gz";
+      md5 = "22780b445b1b479701c05978055d1c82";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_event setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zope_broken = buildPythonPackage rec {
+    name = "zope.broken-3.6.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.broken/zope.broken-3.6.0.zip";
+      md5 = "eff24d7918099a3e899ee63a9c31bee6";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_interface setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_namedfile = buildPythonPackage rec {
+    name = "plone.namedfile-2.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.namedfile/plone.namedfile-2.0.1.zip";
+      md5 = "9739c2fe25977d7e050a85eaed9e776a";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_traversing zope_security zope_component zope_browserpage setuptools plone_rfc822 ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_openid = buildPythonPackage rec {
+    name = "plone.app.openid-2.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.openid/plone.app.openid-2.0.2.tar.gz";
+      md5 = "ae0748f91cab0612a498926d405d8edd";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ products_plonepas zope_i18nmessageid zope2 setuptools plone_openid zope_interface plone_portlets zope_component plone_app_portlets products_cmfcore products_pluggableauthservice ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  z3c_caching = buildPythonPackage rec {
+    name = "z3c.caching-2.0a1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/z3c.caching/z3c.caching-2.0a1.tar.gz";
+      md5 = "17f250b5084c2324a7d15c6810ee628e";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zope_interface zope_component zope_event setuptools zope_lifecycleevent zope_browser ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  plone_app_textfield = buildPythonPackage rec {
+    name = "plone.app.textfield-1.2.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/plone.app.textfield/plone.app.textfield-1.2.2.zip";
+      md5 = "f832887a40826d6f68c48b48f071fb9c";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_schema zope_interface zodb3 setuptools zope_component ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  tempstorage = buildPythonPackage rec {
+    name = "tempstorage-2.12.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tempstorage/tempstorage-2.12.2.zip";
+      md5 = "7a2b76b39839e229249b1bb175604480";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ zope_testing zodb3 setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  zc_recipe_egg = buildPythonPackage rec {
+    name = "zc.recipe.egg-1.3.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.recipe.egg/zc.recipe.egg-1.3.2.tar.gz";
+      md5 = "1cb6af73f527490dde461d3614a36475";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ zc_buildout setuptools ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  products_zctextindex = buildPythonPackage rec {
+    name = "Products.ZCTextIndex-2.13.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Products.ZCTextIndex/Products.ZCTextIndex-2.13.3.zip";
+      md5 = "bf95ea9fa2831237fa3c3d38fafdec96";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [ accesscontrol transaction zope_interface zexceptions zodb3 persistence setuptools acquisition ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+  extensionclass = buildPythonPackage rec {
+    name = "ExtensionClass-2.13.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/E/ExtensionClass/ExtensionClass-2.13.2.zip";
+      md5 = "0236e6d7da9e8b87b9ba45f1b8f930b8";
+    };
+    buildInputs = [ pkgs.unzip ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+    
+    meta = {
+      description = "UNKNOWN";
+      homepage = "UNKNOWN";
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+    };
+  };
+
+}; in plone43Packages
diff --git a/pkgs/games/LambdaHack/default.nix b/pkgs/games/LambdaHack/default.nix
index f7375172f06..48c4809e5cd 100644
--- a/pkgs/games/LambdaHack/default.nix
+++ b/pkgs/games/LambdaHack/default.nix
@@ -1,15 +1,19 @@
-{ cabal, binary, ConfigFile, filepath, gtk, mtl, random, zlib }:
+{ cabal, binary, ConfigFile, filepath, gtk, miniutter, mtl, random
+, text, zlib
+}:
 
 cabal.mkDerivation (self: {
   pname = "LambdaHack";
-  version = "0.2.1";
-  sha256 = "1d2mnpy8fl9m5584rbskgary18mqibivwmlz9gfv87gg0lzhw2ab";
+  version = "0.2.6.5";
+  sha256 = "114s3adqs5mh566dbn0bb20v088wgg8arsm6m8hs9vx8j3jc8nx5";
   isLibrary = true;
   isExecutable = true;
-  buildDepends = [ binary ConfigFile filepath gtk mtl random zlib ];
+  buildDepends = [
+    binary ConfigFile filepath gtk miniutter mtl random text zlib
+  ];
   meta = {
     homepage = "http://github.com/kosmikus/LambdaHack";
-    description = "A roguelike game engine in early and very active development";
+    description = "A roguelike game engine in early and active development";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
     maintainers = [ self.stdenv.lib.maintainers.andres ];
diff --git a/pkgs/games/alienarena/default.nix b/pkgs/games/alienarena/default.nix
index aa7d2f1e914..856d9afe0f9 100644
--- a/pkgs/games/alienarena/default.nix
+++ b/pkgs/games/alienarena/default.nix
@@ -1,17 +1,22 @@
 { stdenv, fetchurl, pkgconfig, libjpeg, libX11, libXxf86vm, curl, libogg
 , libvorbis, freetype, openal, mesa }:
+
 stdenv.mkDerivation rec {
   name = "alienarena-7.52";
+
   src = fetchurl {
     url = "http://icculus.org/alienarena/Files/alienarena-7_52-linux20110929.tar.gz";
     sha256 = "1s1l3apxsxnd8lyi568y38a1fcdr0gwmc3lkgq2nkc676k4gki3m";
   };
+
   buildInputs = [ pkgconfig libjpeg libX11 curl libogg libvorbis
                   freetype openal mesa libXxf86vm ];
+
   patchPhase = ''
     substituteInPlace ./configure \
       --replace libopenal.so.1 ${openal}/lib/libopenal.so.1
   '';
+
   meta = {
     description = "A free, stand-alone first-person shooter computer game";
     longDescription = ''
@@ -27,6 +32,6 @@ stdenv.mkDerivation rec {
     # Engine is under GPLv2, everything else is under
     license = [ "unfree-redistributable" ];
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/andyetitmoves/default.nix b/pkgs/games/andyetitmoves/default.nix
index 6234d3702f7..cf3f6e1563b 100644
--- a/pkgs/games/andyetitmoves/default.nix
+++ b/pkgs/games/andyetitmoves/default.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     cp -r * $out/opt/andyetitmoves/
 
     fullPath=${stdenv.gcc.gcc}/lib64
-    for i in $buildNativeInputs; do
+    for i in $nativeBuildInputs; do
       fullPath=$fullPath''${fullPath:+:}$i/lib
     done
 
diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix
new file mode 100644
index 00000000000..41d70533437
--- /dev/null
+++ b/pkgs/games/anki/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, lib, fetchurl
+, python, pyqt4, pythonPackages
+# This little flag adds a huge number of dependencies, but we assume that
+# everyone wants Anki to draw plots with statistics by default.
+, plotsSupport ? true }:
+
+let
+    py = pythonPackages;
+in
+
+stdenv.mkDerivation rec {
+    name = "anki-2.0.3";
+    src = fetchurl {
+      url = "http://ankisrs.net/download/mirror/${name}.tgz";
+      sha256 = "f40ee4ef29c91101cf9978ce7bd4c513f13ca7c77497a3fb50b8128adf3a5178";
+    };
+
+    pythonPath = [ pyqt4 py.pysqlite py.sqlalchemy ]
+              ++ lib.optional plotsSupport py.matplotlib;
+
+    buildInputs = [ python py.wrapPython ];
+
+    preConfigure = ''
+      substituteInPlace anki \
+        --replace /usr/share/ $out/share/
+
+      substituteInPlace Makefile \
+        --replace PREFIX=/usr PREFIX=$out \
+        --replace /local/bin/ /bin/
+
+      sed -i '/xdg-mime/ d' Makefile
+    '';
+
+    preInstall = ''
+      mkdir -p $out/bin
+      mkdir -p $out/share/pixmaps
+      mkdir -p $out/share/applications
+      mkdir -p $out/share/man/man1
+    '';
+
+    postInstall = ''
+      wrapPythonPrograms
+    '';
+
+    meta = {
+      homepage = http://ankisrs.net/;
+      description = "Spaced repetition flashcard program";
+      # Copy-pasted from the homepage
+      longDescription = ''
+        Anki is a program which makes remembering things easy. Because it is a lot
+        more efficient than traditional study methods, you can either greatly
+        decrease your time spent studying, or greatly increase the amount you learn.
+
+        Anyone who needs to remember things in their daily life can benefit from
+        Anki. Since it is content-agnostic and supports images, audio, videos and 
+        scientific markup (via LaTeX), the possibilities are endless. For example:
+
+        * learning a language
+        * studying for medical and law exams
+        * memorizing people's names and faces
+        * brushing up on geography
+        * mastering long poems
+        * even practicing guitar chords!
+      '';
+      license = "GPLv3";
+      platforms = stdenv.lib.platforms.all;
+    };
+}
diff --git a/pkgs/games/blobby/default.nix b/pkgs/games/blobby/default.nix
index b9f5f5d7e2a..5c10154998d 100644
--- a/pkgs/games/blobby/default.nix
+++ b/pkgs/games/blobby/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, SDL, SDL_image, mesa, cmake, physfs, boost, zip, zlib}:
 stdenv.mkDerivation rec {
-  version = "2.0-RC1";
+  version = "2.0-rc3";
   name = "blobby-volley-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/project/blobby/Blobby%20Volley%202%20%28Linux%29/1.0RC1/blobby2-linux-1.0rc1.tar.gz";
-    sha256 = "1cb56bd31vqkc12cmzp43q2aai99505isq2mii95jp0rzdqks4fy";
+    url = "mirror://sourceforge/project/blobby/Blobby%20Volley%202%20%28Linux%29/1.0RC3/blobby2-linux-1.0rc3.tar.gz";
+    sha256 = "10f50b2ygw8cb9mp33wpdwv9p6lc10qlwc1xd44bbcby1d9v5ga5";
   };
 
   buildInputs = [SDL SDL_image mesa cmake physfs boost zip zlib];
diff --git a/pkgs/games/bsdgames/default.nix b/pkgs/games/bsdgames/default.nix
index 38a32da9537..59423d7a5a6 100644
--- a/pkgs/games/bsdgames/default.nix
+++ b/pkgs/games/bsdgames/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ncurses, openssl, flex, bison, miscfiles}:
+{stdenv, fetchurl, ncurses, openssl, flex, bison, less, miscfiles}:
 
 stdenv.mkDerivation {
   name = "bsd-games-2.17";
@@ -26,12 +26,19 @@ stdenv.mkDerivation {
     bsd_games_cfg_fortune_dir=$out/share/games/fortune
     bsd_games_cfg_quiz_dir=$out/share/games/quiz
     bsd_games_cfg_gamesdir=$out/bin
+    bsd_games_cfg_sbindir=$out/bin
+    bsd_games_cfg_usrbindir=$out/bin
+    bsd_games_cfg_libexecdir=$out/lib/games/dm
+    bsd_games_cfg_docdir=$out/share/doc/bsd-games
+    bsd_games_cfg_sharedir=$out/share/games
+    bsd_games_cfg_varlibdir=.
     bsd_games_cfg_non_interactive=y
     bsd_games_cfg_no_build_dirs="dab hack phantasia sail"
     bsd_games_cfg_dictionary_src=${miscfiles}/share/dict/words
+    bsd_games_cfg_pager=${less}
     EOF
 
-    sed -e s/getline/sdgames_local_getline/g -i $(grep getline -rl .)
+    sed -e s/getline/bsdgames_local_getline/g -i $(grep getline -rl .)
   '';
 
   postConfigure = ''
diff --git a/pkgs/games/d1x-rebirth/default.nix b/pkgs/games/d1x-rebirth/default.nix
new file mode 100644
index 00000000000..471eca78cf1
--- /dev/null
+++ b/pkgs/games/d1x-rebirth/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, scons, pkgconfig, SDL, mesa, physfs, SDL_mixer }:
+
+stdenv.mkDerivation rec {
+  name = "d1x-rebirth-0.57.3";
+  src = fetchurl {
+    url = "http://www.dxx-rebirth.com/download/dxx/d1x-rebirth_v0.57.3-src.tar.gz";
+    sha256 = "07dbjza5flsczdsas0adb5xhn13gmhlpixa8ycp8hjm20y9kw1za";
+  };
+
+  buildInputs = [ scons pkgconfig SDL mesa physfs SDL_mixer ];
+
+  installPhase = ''
+    scons prefix=$out install
+  '';
+
+  meta = {
+    homepage = http://www.dxx-rebirth.com/;
+    description = "Source Port of the Descent 1 engine";
+    license = "BSD"; # Parallax license, like BSD I think
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/games/d2x-rebirth/default.nix b/pkgs/games/d2x-rebirth/default.nix
new file mode 100644
index 00000000000..b52e2995198
--- /dev/null
+++ b/pkgs/games/d2x-rebirth/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl, scons, pkgconfig, SDL, mesa, physfs, SDL_mixer }:
+
+stdenv.mkDerivation rec {
+  name = "d2x-rebirth-0.57.3";
+  src = fetchurl {
+    url = "http://www.dxx-rebirth.com/download/dxx/d2x-rebirth_v0.57.3-src.tar.gz";
+    sha256 = "0yyandmxz12bbpnd746nddjlqh5i7dylwm006shixis3w3giz77c";
+  };
+
+  buildInputs = [ scons pkgconfig SDL mesa physfs SDL_mixer ];
+
+  installPhase = ''
+    scons prefix=$out install
+  '';
+
+  meta = {
+    homepage = http://www.dxx-rebirth.com/;
+    description = "Source Port of the Descent 2 engine";
+    license = "BSD"; # Parallax license, like BSD I think
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/games/dhewm3/default.nix b/pkgs/games/dhewm3/default.nix
new file mode 100644
index 00000000000..6036d7fabd5
--- /dev/null
+++ b/pkgs/games/dhewm3/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl, unzip, cmake, SDL, mesa, zlib, libjpeg, libogg, libvorbis
+, openalSoft, curl }:
+
+stdenv.mkDerivation rec {
+  hash = "92a41322f4aa8bd45395d8088721c9a2bf43c79b";
+  name = "dhewm3-20130113-${hash}";
+  src = fetchurl {
+    url = "https://github.com/dhewm/dhewm3/zipball/${hash}";
+    sha256 = "0c17k60xhimpqi1xi9s1l7jbc97pqjnk4lgwyjb0agc3dkr73zwd";
+  };
+
+  # Add mesa linking
+  patchPhase = ''
+    sed -i 's/\<idlib\()\?\)$/idlib GL\1/' CMakeLists.txt
+  '';
+
+  unpackPhase = ''
+    unzip ${src}
+    cd */neo
+  '';
+
+  buildInputs = [ unzip cmake SDL mesa zlib libjpeg libogg libvorbis openalSoft
+    curl ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = https://github.com/dhewm/dhewm3;
+    description = "Doom 3 port to SDL";
+    license = "GPLv3";
+  };
+
+}
diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix
index 6eab8acce75..b8a215e3b49 100644
--- a/pkgs/games/eduke32/default.nix
+++ b/pkgs/games/eduke32/default.nix
@@ -1,14 +1,14 @@
-{stdenv, fetchurl, SDL, SDL_mixer, libvorbis, mesa, gtk, pkgconfig, nasm, makeDesktopItem}:
+{stdenv, fetchurl, SDL, SDL_mixer, libvorbis, mesa, gtk, pkgconfig, nasm, libvpx, flac, makeDesktopItem}:
 
 stdenv.mkDerivation rec {
-  name = "eduke32-1944";
+  name = "eduke32-3542";
   
   src = fetchurl {
-    url = http://dukeworld.duke4.net/eduke32/synthesis/20110724-1944/eduke32_src_20110724-1944.tar.bz2;
-    sha256 = "0y2y9agydfkdq4krp4lz22br3p23as6hrqhq7l9djw0pm2y76fqh";
+    url = http://dukeworld.duke4.net/eduke32/synthesis/20130303-3542/eduke32_src_20130303-3542.tar.bz2;
+    sha256 = "0v1q2bkmpnac5l9x97nnlhrrb95518vmhxx48zv3ncvmpafl1mqc";
   };
   
-  buildInputs = [ SDL SDL_mixer libvorbis mesa gtk pkgconfig ]
+  buildInputs = [ SDL SDL_mixer libvorbis mesa gtk pkgconfig libvpx flac ]
     ++ stdenv.lib.optional (stdenv.system == "i686-linux") nasm;
   
   NIX_CFLAGS_COMPILE = "-I${SDL}/include/SDL";
diff --git a/pkgs/games/exult/snapshot.nix b/pkgs/games/exult/snapshot.nix
deleted file mode 100644
index 95643af6a62..00000000000
--- a/pkgs/games/exult/snapshot.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ stdenv, fetchurl, SDL, SDL_mixer, zlib, libpng, unzip
-, autoconf, automake, libtool, bison, flex
-}:
-
-stdenv.mkDerivation {
-  name = "exult-1.4-pre-svn-20080712-0500";
-  
-  builder = ./builder.sh;
-  
-  src = fetchurl {
-    url = http://www.math.leidenuniv.nl/~wpalenst/cvs/exult-20080712-0500.tar.gz;
-    sha256 = "186z8qb713yr1wfasfbpgz2wfqwmbh2d6lmgz1v8lhmwmfpkzgc4";
-  };
-
-  buildInputs = [
-    SDL SDL_mixer zlib libpng unzip
-    # The following are only needed because we're building from SVN.
-    autoconf automake libtool bison flex
-  ];
-  
-  NIX_CFLAGS_COMPILE = "-I${SDL_mixer}/include/SDL";
-
-  preConfigure = ''
-    ./autogen.sh
-  '';
-  
-  # Digital recordings of the music on an original Roland MT-32.  So
-  # we don't need actual MIDI playback capability.
-  musicFiles = [
-    (fetchurl {
-      url = mirror://sourceforge/exult/U7MusicOGG_1of2.zip;
-      md5 = "7746d1a9164fd67509107797496553bf";
-    })
-    (fetchurl {
-      url = mirror://sourceforge/exult/U7MusicOGG_2of2.zip;
-      md5 = "cdae5956d7c52f35e90317913a660123";
-    })
-  ];
-
-  meta = {
-    homepage = http://exult.sourceforge.net/;
-    description = "A reimplementation of the Ultima VII game engine (pre-release)";
-  };
-}
diff --git a/pkgs/games/flightgear/default.nix b/pkgs/games/flightgear/default.nix
index fe90156d84c..fa0bb9bb4f7 100644
--- a/pkgs/games/flightgear/default.nix
+++ b/pkgs/games/flightgear/default.nix
@@ -1,23 +1,23 @@
 x@{builderDefsPackage
   , freeglut, freealut, mesa, libICE, libjpeg, openal, openscenegraph, plib
   , libSM, libunwind, libX11, xproto, libXext, xextproto, libXi, inputproto
-  , libXmu, libXt, simgear, zlib, boost
+  , libXmu, libXt, simgear, zlib, boost, cmake, libpng
   , ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
     [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    baseName="FlightGear";
-    version="2.0.0";
+    baseName="flightgear";
+    version="2.10.0";
     name="${baseName}-${version}";
-    extension="tar.gz";
+    extension="tar.bz2";
     url="http://ftp.linux.kiev.ua/pub/fgfs/Source/${name}.${extension}";
-    hash="17h7ns955xkd0cakfk22aym0id65rd8kylcamkmycbgnnhs4b1wg";
+    hash="0pq5nwyxwp8ar5rr0jh8p04bv0i9i841m374jwd748csnsn28zh6";
   };
 in
 rec {
@@ -35,14 +35,14 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall" "deployData"];
+  phaseNames = ["doCmake" "doMakeInstall" "deployData"];
 
   deployData = a.fullDepEntry ''
     mkdir -p "$out/share/FlightGear"
     cd "$out/share/FlightGear"
     tar xvf ${datasrc}
   '' ["minInit" "defEnsureDir"];
-      
+
   meta = {
     description = "A flight simulator";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix
index 7aaf3238308..049f10ad15b 100644
--- a/pkgs/games/freeciv/default.nix
+++ b/pkgs/games/freeciv/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n3ak0y9hj9kha0r3cdbi8zb47vrgal1jsbblamqgwwwgzy8cri3";
   };
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ zlib bzip2 ]
     ++ optionals sdlClient [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx freetype ]
diff --git a/pkgs/games/freedink/default.nix b/pkgs/games/freedink/default.nix
index f41063272ce..a30ff7e2f87 100644
--- a/pkgs/games/freedink/default.nix
+++ b/pkgs/games/freedink/default.nix
@@ -1,24 +1,46 @@
 { stdenv, fetchurl, SDL, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx
-, pkgconfig, fontconfig, libzip, zip, zlib }:
+, pkgconfig, intltool, fontconfig, libzip, zip, zlib }:
 
-stdenv.mkDerivation rec {
-  name = "freedink-1.08.20101114";
+let
+  version = "1.08.20121209";
+
+  freedink_data = stdenv.mkDerivation rec {
+    name = "freedink-data-${version}";
+
+    src = fetchurl {
+      url = "mirror://gnu/freedink/${name}.tar.gz";
+      sha256 = "1mhns09l1s898x18ahbcy9gabrmgsr8dv7pm0a2ivid8mhxahn1j";
+    };
+
+    prePatch = "substituteInPlace Makefile --replace /usr/local $out";
+  };
+
+in stdenv.mkDerivation rec {
+  name = "freedink-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/freedink/${name}.tar.gz";
-    sha256 = "0h3i7p7awk5flymh22xaazm2r56hv86z2il2gmbzrr6xh434zffa";
+    sha256 = "19xximbcm6506kvpf3s0q96697kmzca3yrjdr6dgphklp33zqsqr";
   };
 
-  buildInputs = [ SDL SDL_mixer SDL_image SDL_ttf SDL_gfx pkgconfig fontconfig libzip zip zlib] ;
+  buildInputs = [
+    SDL SDL_mixer SDL_image SDL_ttf SDL_gfx
+    pkgconfig intltool fontconfig libzip zip zlib
+  ];
+
+  postInstall = ''
+    mkdir -p "$out/share/"
+    ln -s ${freedink_data}/share/dink "$out/share/"
+  '';
 
   meta = {
-    description = "GNU FreeDink, a free, portable and enhanced version of the Dink Smallwood game engine. ";
+    description = "A free, portable and enhanced version of the Dink Smallwood game engine";
 
-    longDescription =
-      '' GNU FreeDink is a new and portable version of the Dink Smallwood
-	 game engine, which runs the original game as well as its D-Mods,
-	 with close compatibility, under multiple platforms.
-       '';
+    longDescription = ''
+      GNU FreeDink is a new and portable version of the Dink Smallwood
+      game engine, which runs the original game as well as its D-Mods,
+      with close compatibility, under multiple platforms.
+    '';
 
     homepage = http://www.freedink.org/;
     license = "GPLv3+";
diff --git a/pkgs/games/fsg/default.nix b/pkgs/games/fsg/default.nix
index ba6b65d602b..7a9dc110540 100644
--- a/pkgs/games/fsg/default.nix
+++ b/pkgs/games/fsg/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation {
   name = "fsg-4.4";
 
   src = fetchurl {
-    url = http://www.piettes.com/fallingsandgame/fsg-src-4.4.tar.gz;
+    #url = http://www.piettes.com/fallingsandgame/fsg-src-4.4.tar.gz;
+    url = http://www.sourcefiles.org/Games/Simulation/Other/fsg-src-4.4.tar.gz;
     sha256 = "1756y01rkvd3f1pkj88jqh83fqcfl2fy0c48mcq53pjzln9ycv8c";
   };
 
@@ -38,7 +39,7 @@ stdenv.mkDerivation {
   installPhase = ''
     mkdir -p $out/bin $out/libexec
     cp sand $out/libexec
-    echo -e '#! /bin/sh\nLC_ALL=C '$out'/libexec/sand "$@"' >$out/bin/fsg
+    echo -e '#!${stdenv.shell}\nLC_ALL=C '$out'/libexec/sand "$@"' >$out/bin/fsg
     chmod a+x $out/bin/fsg
   '';
 
diff --git a/pkgs/games/gnuchess/default.nix b/pkgs/games/gnuchess/default.nix
index 24556d83148..ae7938c02b8 100644
--- a/pkgs/games/gnuchess/default.nix
+++ b/pkgs/games/gnuchess/default.nix
@@ -1,36 +1,29 @@
-{builderDefsPackage, flex} @ x:
-builderDefsPackage 
-(a :  
-let 
-  fetchurl = a.fetchurl;
-
-  version = a.lib.attrByPath ["version"] "5.07" a; 
-  buildInputs = with a; [
+{stdenv, fetchurl, flex}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="gnuchess";
+    version="6.0.3";
+    name="${baseName}-${version}";
+    hash="01ff8qd8pk39c6pv24wbcqkx78kvay8rxvgxqq9cqp9gqv39jfkw";
+    url="http://ftp.gnu.org/gnu/chess/gnuchess-6.0.3.tar.gz";
+    sha256="01ff8qd8pk39c6pv24wbcqkx78kvay8rxvgxqq9cqp9gqv39jfkw";
+  };
+  buildInputs = [
     flex
   ];
 in
-rec {
+stdenv.mkDerivation rec {
+  inherit (s) name version;
   src = fetchurl {
-    url = "mirror://gnu/chess/gnuchess-${version}.tar.gz";
-    sha256 = "0zh15m35fzbsrk1aann9pwlkv54dwb00snx99pk3xbg5bwkf125k";
+    inherit (s) url sha256;
   };
-
   inherit buildInputs;
-  configureFlags = [];
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "preBuild" "doMakeInstall"];
-
-  preBuild = a.fullDepEntry (''
-    sed -i src/input.c -e 's/static pthread_t/pthread_t/'
-    sed -i "s@gnuchess@$out/bin/gnuchess@" -i src/gnuchessx
-
-
-    sed -e s/getline/gnuchess_local_getline/g -i $(grep getline -rl .)
-  '') ["minInit" "doUnpack"];
-      
-  name = "gnuchess-" + version;
   meta = {
-    description = "GNU Chess playing program";
+    inherit (s) version;
+    description = "GNU Chess engine";
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl3Plus;
   };
-}) x
+}
diff --git a/pkgs/games/gnuchess/default.upstream b/pkgs/games/gnuchess/default.upstream
new file mode 100644
index 00000000000..e1d1d5f2eeb
--- /dev/null
+++ b/pkgs/games/gnuchess/default.upstream
@@ -0,0 +1 @@
+url http://ftp.gnu.org/gnu/chess/
diff --git a/pkgs/games/gtypist/default.nix b/pkgs/games/gtypist/default.nix
index 8fd2e28e77b..d0793a8d13d 100644
--- a/pkgs/games/gtypist/default.nix
+++ b/pkgs/games/gtypist/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   patches = [ (fetchurl {
     url = "http://projects.archlinux.org/svntogit/community.git/plain/trunk/ncurses.patch?h=packages/gtypist";
-    sha256 = "1chdr4xkm140cjwv1n3ydk04qdwgycd12d9adz2sjc58lybqp7sy";
+    sha256 = "14crgh21gghszwijxjvixpijqzsgn62wx6kz28zkjskdw0p5vij1";
   })];
 
   meta = {
diff --git a/pkgs/games/lincity/ng.nix b/pkgs/games/lincity/ng.nix
new file mode 100644
index 00000000000..4e886466777
--- /dev/null
+++ b/pkgs/games/lincity/ng.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl
+, zlib, jam, pkgconfig, gettext, libxml2, libxslt, xproto, libX11, mesa, SDL
+, SDL_mixer, SDL_image, SDL_ttf, SDL_gfx, physfs
+}:
+let s = # Generated upstream information
+  rec {
+    baseName="lincity";
+    version="2.0";
+    name="lincity-2.0";
+    hash="01k6n304qj0z5zmqr49gqirp0jmx2b0cpisgkxk1ga67vyjhdcm6";
+    url="http://download.berlios.de/lincity-ng/lincity-ng-2.0.tar.bz2";
+    sha256="01k6n304qj0z5zmqr49gqirp0jmx2b0cpisgkxk1ga67vyjhdcm6";
+  };
+  buildInputs = [zlib jam pkgconfig gettext libxml2 libxslt xproto libX11 mesa 
+    SDL SDL_mixer SDL_image SDL_ttf SDL_gfx physfs];
+in 
+stdenv.mkDerivation rec {
+  inherit (s) name version;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+
+  inherit buildInputs;
+
+  buildPhase = "jam";
+  installPhase="jam install";
+
+  meta = {
+    documentation = ''City building game'';
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    inherit (s) version;
+  };
+}
diff --git a/pkgs/games/lincity/ng.upstream b/pkgs/games/lincity/ng.upstream
new file mode 100644
index 00000000000..d73d1a2c419
--- /dev/null
+++ b/pkgs/games/lincity/ng.upstream
@@ -0,0 +1,5 @@
+target ng.nix
+attribute_name lincity_ng
+url https://fedorahosted.org/LinCity-NG/wiki/Downloads
+version_link tar.bz2
+version_link tar.bz2
diff --git a/pkgs/games/minecraft/default.nix b/pkgs/games/minecraft/default.nix
index 3281f07335b..1f80998da92 100644
--- a/pkgs/games/minecraft/default.nix
+++ b/pkgs/games/minecraft/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, jre, libX11, libXext, libXcursor, libXrandr, libXxf86vm
-, mesa, openal}:
+, mesa, openal, alsaOss }:
 
 stdenv.mkDerivation {
-  name = "minecraft-1.3.1";
+  name = "minecraft-1.4.7";
 
   src = fetchurl {
     url = "https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar";
-    sha256 = "0j8a889w174vwgcxl4yqgp2kbqqha3x505fn7izz38srlx59gnwj";
+    sha256 = "92db974aa759a3f17f3cd61550fa5010e335c57dd813dad9e39b9cc013420a49";
   };
 
   phases = "installPhase";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
     # wrapper for minecraft
     export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:${jre}/lib/${jre.architecture}/:${libX11}/lib/:${libXext}/lib/:${libXcursor}/lib/:${libXrandr}/lib/:${libXxf86vm}/lib/:${mesa}/lib/:${openal}/lib/
-    ${jre}/bin/java -jar $out/minecraft.jar
+    ${alsaOss}/bin/aoss ${jre}/bin/java -jar $out/minecraft.jar
     EOF
 
     chmod +x $out/bin/minecraft
diff --git a/pkgs/games/minetest/default.nix b/pkgs/games/minetest/default.nix
new file mode 100644
index 00000000000..3b06cd8694c
--- /dev/null
+++ b/pkgs/games/minetest/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchgit, cmake, irrlicht3843, libpng12, bzip2,
+  libjpeg, libXxf86vm, mesa, openal, libvorbis, x11 }:
+
+let
+  version = "0.4.4";
+  sources = {
+    src = fetchgit {
+      url = "https://github.com/celeron55/minetest.git";
+      rev = "ab06fca4bed26f3dc97d5e5cff437d075d7acff8";
+    };
+    data = fetchgit {
+      url = "https://github.com/celeron55/minetest_game.git";
+      rev = "3928eccf74af0288d12ffb14f8222fae479bc06b";
+    };
+  };
+in stdenv.mkDerivation {
+  name = "minetest-${version}";
+  
+  src = sources.src;
+  
+  cmakeFlags = [
+    "-DIRRLICHT_INCLUDE_DIR=${irrlicht3843}/include/irrlicht"
+  ];
+  
+  buildInputs = [
+    cmake irrlicht3843 libpng12 bzip2 libjpeg
+    libXxf86vm mesa openal libvorbis x11
+  ];
+  
+  postInstall = ''
+    mkdir -pv $out/share/minetest/games/minetest_game/
+    cp -rv ${sources.data}/* $out/share/minetest/games/minetest_game/
+  '';
+  
+  meta = {
+    homepage = "http://minetest.net/";
+    description = "Minetest is an infinite-world block sandbox game.";
+    license = "LGPLv2.1+";
+  };
+}
diff --git a/pkgs/games/naev/default.nix b/pkgs/games/naev/default.nix
index 36ccbf98274..4516afaef6d 100644
--- a/pkgs/games/naev/default.nix
+++ b/pkgs/games/naev/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ SDL SDL_mixer openal libxml2 libvorbis libpng mesa zlib ];
 
-  buildNativeInputs = [ pkgconfig makeWrapper ];
+  nativeBuildInputs = [ pkgconfig makeWrapper ];
 
   NIX_CFLAGS_COMPILE="-include ${zlib}/include/zlib.h";
 
@@ -36,6 +36,6 @@ stdenv.mkDerivation {
     homepage = http://www.naev.org;
     license = "GPLv3+";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/games/oilrush/default.nix b/pkgs/games/oilrush/default.nix
index 4605f04e3ae..b96fd7c3e9f 100644
--- a/pkgs/games/oilrush/default.nix
+++ b/pkgs/games/oilrush/default.nix
@@ -1,11 +1,12 @@
-{ stdenv, getConfig, fetchurl, libX11, libXext, libXinerama, libXrandr
+{ stdenv, config, fetchurl, libX11, libXext, libXinerama, libXrandr
 , libXrender, fontconfig, freetype, openal }:
+
 stdenv.mkDerivation {
   name = "oilrush";
   src = 
   let
-    url = getConfig [ "oilrush" "url" ] null;
-    sha256 = getConfig [ "oilrush" "sha256" ] null;
+    url = config.oilrush.url or null;
+    sha256 = config.oilrush.sha256 or null;
   in
     assert url != null && sha256 != null;
     fetchurl { inherit url sha256; };
@@ -66,7 +67,7 @@ stdenv.mkDerivation {
       of Tower Defense. 
     '';
     homepage = http://oilrush-game.com/;
-    license = [ "proprietary" ];
+    license = "unfree";
     #maintainers = with stdenv.lib.maintainers; [ astsmtl ];
     #platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/games/openlierox/default.nix b/pkgs/games/openlierox/default.nix
index 751941bdfc1..0c7e46ae074 100644
--- a/pkgs/games/openlierox/default.nix
+++ b/pkgs/games/openlierox/default.nix
@@ -1,56 +1,39 @@
-a :  
-let 
-  fetchurl = a.fetchurl;
-
-  version = a.lib.attrByPath ["version"] "0.57beta8" a; 
-  buildInputs = with a; [
-    libX11 xproto gd SDL SDL_image SDL_mixer zlib libxml2
-    pkgconfig
-  ];
-
-in
-rec {
+{ stdenv, fetchurl, libX11, xproto, gd, SDL, SDL_image, SDL_mixer, zlib
+, libxml2, pkgconfig, curl, cmake, libzip }:
+
+stdenv.mkDerivation {
+  name = "openlierox-0.58rc3";
+
   src = fetchurl {
-    url = "http://downloads.sourceforge.net/project/openlierox/openlierox/OpenLieroX%200.57%20Beta8/OpenLieroX_0.57_beta8.src.tar.bz2";
-    sha256 = "1a3p03bi5v2mca7323mrckab9wsj83fjfcr6akrh9a6nlljcdn8d";
+    url = "mirror://sourceforge/openlierox/OpenLieroX_0.58_rc3.src.tar.bz2";
+    sha256 = "1k35xppfqi3qfysv81xq3hj4qdy9j2ciinbkfdcmwclcsf3nh94z";
   };
 
-  inherit buildInputs;
-  configureFlags = [];
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doInstall"];
-
-  setParams = a.noDepEntry (''
-    export SYSTEM_DATA_DIR="$out/share"
-    export BIN_DIR="$out/bin"
-    export DOC_DIR="$out/share/doc"
-    export PIXMAP_DIR="$out/share/pixmap"
-
-    export HAWKNL_BUILTIN=1
-    export LIBZIP_BUILTIN=1
-    export X11=1
-    export DEBUG=1
-  '');
-  
-  doBuild=a.fullDepEntry (''
-    sed -re 's/ -1/ 255 /g' -i *.sh
-
-    source functions.sh
-    export INCLUDE_PATH=$(echo $NIX_CFLAGS_COMPILE | grep_param -I)
-    
-    bash compile.sh
-  '') ["doUnpack" "addInputs" "setParams"];
-
-  doInstall = a.fullDepEntry (''
-    mkdir -p $BIN_DIR $SYSTEM_DATA_DIR $DOC_DIR $PIXMAP_DIR
-    bash install.sh
-  '') ["doBuild" "addInputs" "setParams" "defEnsureDir"];
-      
-  name = "openlierox-" + version;
+  NIX_CFLAGS_COMPILE = "-I${libxml2}/include/libxml2";
+
+  # The breakpad fails to build on x86_64, and it's only to report bugs upstream
+  cmakeFlags = [ "-DBREAKPAD=0" ];
+
+  preConfigure = ''
+    cmakeFlags="$cmakeFlags -DSYSTEM_DATA_DIR=$out/share"
+  '';
+
+  patchPhase = ''
+    sed -i s,curl/types.h,curl/curl.h, include/HTTP.h src/common/HTTP.cpp
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin $out/share/OpenLieroX
+    cp bin/* $out/bin
+    cp -R ../share/gamedir/* $out/share/OpenLieroX
+  '';
+
+  buildInputs = [ libX11 xproto gd SDL SDL_image SDL_mixer zlib libxml2
+    pkgconfig curl cmake libzip ];
+
   meta = {
+    homepage = http://openlierox.net;
     description = "Real-time game with Worms-like shooting";
-    maintainers = [
-    ];
+    license = "LGPLv2+";
   };
 }
diff --git a/pkgs/games/openttd/default.nix b/pkgs/games/openttd/default.nix
index 66c296b487a..616adf00224 100644
--- a/pkgs/games/openttd/default.nix
+++ b/pkgs/games/openttd/default.nix
@@ -1,22 +1,42 @@
-{stdenv, fetchurl, SDL, libpng, zlib}:
+{stdenv, fetchurl, pkgconfig, SDL, libpng, zlib, xz, freetype, fontconfig}:
 
 stdenv.mkDerivation rec {
   name = "openttd-${version}";
-  version = "0.6.0";
+  version = "1.2.2";
 
   src = fetchurl {
-    url = "mirror://sf/openttd/${name}-source.tar.bz2";
-    md5 = "dcf63687c73ff56887049fedaf6c6019";
+    url = "http://binaries.openttd.org/releases/${version}/${name}-source.tar.xz";
+    sha256 = "158znfx389bhs9gd2hadnbc2a32z4ma1vz8704cmw9yh0fmhbcap";
   };
 
-  buildInputs = [SDL libpng];
+  buildInputs = [SDL libpng pkgconfig xz zlib freetype fontconfig];
   prefixKey = "--prefix-dir=";
-  configureFlags = "--with-zlib=${zlib}/lib/libz.a";
+
+  configureFlags = ''
+    --with-zlib=${zlib}/lib/libz.a 
+    --without-liblzo2
+  '';
+
   makeFlags = "INSTALL_PERSONAL_DIR=";
 
+  postInstall = ''
+    mv $out/games/ $out/bin
+  '';
+
   meta = {
     description = ''OpenTTD is an open source clone of the Microprose game "Transport Tycoon Deluxe".'';
+    longDescription = ''
+      OpenTTD is a transportation economics simulator. In single player mode,
+      players controll a transportation business, and use rail, road, sea, and air
+      transport to move goods and people around the simulated world. 
+
+      In multiplayer networked mode, players may:
+        - play competitively as different businesses
+        - play cooperatively controling the same business
+        - observe as spectators
+    '';
     homepage = http://www.openttd.org/;
     license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/games/pingus/default.nix b/pkgs/games/pingus/default.nix
new file mode 100644
index 00000000000..43cdc2031bf
--- /dev/null
+++ b/pkgs/games/pingus/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, scons, SDL, SDL_image, boost, libpng, SDL_mixer, pkgconfig
+, mesa}:
+let
+  buildInputs = [scons SDL SDL_image boost libpng SDL_mixer pkgconfig mesa];
+  s = # Generated upstream information
+  rec {
+    baseName="pingus";
+    version="0.7.6";
+    name="pingus-0.7.6";
+    hash="0q34d2k6anzqvb0mf67x85q92lfx9jr71ry13dlp47jx0x9i573m";
+    url="http://pingus.googlecode.com/files/pingus-0.7.6.tar.bz2";
+    sha256="0q34d2k6anzqvb0mf67x85q92lfx9jr71ry13dlp47jx0x9i573m";
+  };
+in
+stdenv.mkDerivation rec {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  makeFlags = '' PREFIX="$(out)" '';
+  meta = {
+    inherit (s) version;
+    description = ''A puzzle game with mechanics similar to Lemmings'';
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    license = stdenv.lib.licenses.gpl3;
+  };
+}
diff --git a/pkgs/games/pingus/default.upstream b/pkgs/games/pingus/default.upstream
new file mode 100644
index 00000000000..6b4eb31aa5f
--- /dev/null
+++ b/pkgs/games/pingus/default.upstream
@@ -0,0 +1 @@
+url http://pingus.seul.org/download.html
diff --git a/pkgs/games/prboom/default.nix b/pkgs/games/prboom/default.nix
index f66e2295a22..95ad53cb1ae 100644
--- a/pkgs/games/prboom/default.nix
+++ b/pkgs/games/prboom/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ SDL SDL_mixer SDL_net mesa ];
   crossAttrs = {
-    propagatedBuildInputs = [ SDL.hostDrv SDL_mixer.hostDrv SDL_net.hostDrv ];
+    propagatedBuildInputs = [ SDL.crossDrv SDL_mixer.crossDrv SDL_net.crossDrv ];
     configureFlags = "--disable-gl --disable-cpu-opt --without-x --disable-sdltest
       ac_cv_type_uid_t=yes ac_cv_type_gid_t=yes";
 
diff --git a/pkgs/games/rili/default.nix b/pkgs/games/rili/default.nix
new file mode 100644
index 00000000000..934213279fa
--- /dev/null
+++ b/pkgs/games/rili/default.nix
@@ -0,0 +1,31 @@
+{stdenv, fetchurl, SDL_mixer, SDL, autoconf, automake}:
+
+stdenv.mkDerivation {
+  name = "ri_li-2.0.1"; 
+  
+  src = fetchurl {
+    url = mirror://sourceforge/ri-li/Ri-li-2.0.1.tar.bz2;
+    sha256 = "f71ccc20c37c601358d963e087ac0d524de8c68e96df09c3aac1ae65edd38dbd";
+  };
+
+  patches = [ ./moderinze_cpp.patch ];
+
+  preConfigure = ''
+    export CPPFLAGS="-I${SDL}/include -I${SDL}/include/SDL -I${SDL_mixer}/include"
+    autoreconf -i
+  '';
+  
+  buildInputs = [SDL SDL_mixer autoconf automake];
+  
+  meta = {
+    homepage = http://ri-li.sourceforge.net;
+    license = "GPL2+";
+    description = "A children's train game";
+    longDescription = ''
+     Ri-li is an arcade game licensed under the GPL (General Public License).
+You drive a toy wood engine in many levels and you must collect all the coaches
+to win.
+    '';
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/games/rili/moderinze_cpp.patch b/pkgs/games/rili/moderinze_cpp.patch
new file mode 100644
index 00000000000..3d076afb39e
--- /dev/null
+++ b/pkgs/games/rili/moderinze_cpp.patch
@@ -0,0 +1,391 @@
+diff -r -u Ri-li-2.0.1.orig/src/audio.cc Ri-li-2.0.1/src/audio.cc
+--- Ri-li-2.0.1.orig/src/audio.cc	2012-01-22 00:40:56.928609371 -0800
++++ Ri-li-2.0.1/src/audio.cc	2012-01-22 00:28:33.360636539 -0800
+@@ -22,8 +22,8 @@
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+ #include <stdlib.h>
+-#include <iostream.h>
+-#include <string.h>
++#include <iostream>
++#include <string>
+ 
+ #include "audio.h"
+ #include "utils.h"
+@@ -57,7 +57,7 @@
+   char PathFile[512];
+ 
+   if(Mix_OpenAudio(22050,AUDIO_S16,1,1024)) {
+-    cerr <<"Enable to init Sound card ! "<<SDL_GetError()<<endl;
++    std::cerr <<"Enable to init Sound card ! "<<SDL_GetError()<<std::endl;
+     return false;
+   }
+   
+diff -r -u Ri-li-2.0.1.orig/src/ecran.cc Ri-li-2.0.1/src/ecran.cc
+--- Ri-li-2.0.1.orig/src/ecran.cc	2007-11-02 04:48:16.000000000 -0700
++++ Ri-li-2.0.1/src/ecran.cc	2012-01-22 00:13:54.422798653 -0800
+@@ -21,7 +21,7 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <math.h>
+diff -r -u Ri-li-2.0.1.orig/src/editeur.cc Ri-li-2.0.1/src/editeur.cc
+--- Ri-li-2.0.1.orig/src/editeur.cc	2007-11-02 04:48:17.000000000 -0700
++++ Ri-li-2.0.1/src/editeur.cc	2012-01-22 00:28:59.632635579 -0800
+@@ -25,10 +25,10 @@
+ #include <windows.h>
+ #endif
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include <SDL/SDL.h>
+ 
+@@ -374,7 +374,7 @@
+     
+     // Sauve le niveau
+     if(Niveau.Save()==false) {
+-      cerr <<"ERREUR Saving levels!"<<endl;
++      std::cerr <<"ERREUR Saving levels!"<<std::endl;
+       exit(-1);
+     }
+     
+diff -r -u Ri-li-2.0.1.orig/src/jeux.cc Ri-li-2.0.1/src/jeux.cc
+--- Ri-li-2.0.1.orig/src/jeux.cc	2007-11-02 04:48:17.000000000 -0700
++++ Ri-li-2.0.1/src/jeux.cc	2012-01-22 00:14:08.422798143 -0800
+@@ -25,10 +25,10 @@
+ #include <windows.h>
+ #endif
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include <SDL/SDL.h>
+ 
+diff -r -u Ri-li-2.0.1.orig/src/loco.cc Ri-li-2.0.1/src/loco.cc
+--- Ri-li-2.0.1.orig/src/loco.cc	2007-11-02 04:48:18.000000000 -0700
++++ Ri-li-2.0.1/src/loco.cc	2012-01-22 00:14:17.878797797 -0800
+@@ -21,10 +21,10 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include "preference.h"
+ #include "loco.h"
+diff -r -u Ri-li-2.0.1.orig/src/main.cc Ri-li-2.0.1/src/main.cc
+--- Ri-li-2.0.1.orig/src/main.cc	2007-11-02 04:48:19.000000000 -0700
++++ Ri-li-2.0.1/src/main.cc	2012-01-22 00:29:40.080634136 -0800
+@@ -23,8 +23,8 @@
+ 
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <iostream.h>
+-#include <string.h>
++#include <iostream>
++#include <string>
+ #include <SDL/SDL.h>
+ #include <SDL/SDL_mixer.h>
+ 
+@@ -115,7 +115,7 @@
+  
+   // Initilise SDL
+   if( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_AUDIO|SDL_INIT_NOPARACHUTE) < 0 ) {
+-    cerr <<"Impossible d'initialiser SDL:"<<SDL_GetError()<<endl;
++    std::cerr <<"Impossible d'initialiser SDL:"<<SDL_GetError()<<std::endl;
+     exit(-1);
+   }
+   // Ferme le programme correctement quant quit
+@@ -125,7 +125,7 @@
+   sdlVideoInfo=(SDL_VideoInfo*)SDL_GetVideoInfo();
+ 
+   if(sdlVideoInfo->vfmt->BitsPerPixel==8) {
+-    cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<endl;
++    std::cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<std::endl;
+     exit(-1);
+   }
+   
+@@ -145,7 +145,7 @@
+   sdlVideo=SDL_SetVideoMode(800,600,sdlVideoInfo->vfmt->BitsPerPixel,vOption);
+ 
+   if(sdlVideo==NULL) {
+-    cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<endl;
++    std::cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<std::endl;
+     exit(-1);
+   }
+   // Change le nom de la fenetre
+diff -r -u Ri-li-2.0.1.orig/src/menu.cc Ri-li-2.0.1/src/menu.cc
+--- Ri-li-2.0.1.orig/src/menu.cc	2007-11-02 04:48:19.000000000 -0700
++++ Ri-li-2.0.1/src/menu.cc	2012-01-22 00:30:04.752633198 -0800
+@@ -21,10 +21,10 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include "preference.h"
+ #include "menu.h"
+ #include "sprite.h"
+@@ -92,7 +92,7 @@
+   // Teste la resolution video
+   sdlVideoInfo=(SDL_VideoInfo*)SDL_GetVideoInfo();
+   if(sdlVideoInfo->vfmt->BitsPerPixel==8) {
+-    cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<endl;
++    std::cerr <<"Impossible d'utiliser 8bits pour la vidéo !"<<std::endl;
+     exit(-1);
+   }
+   
+@@ -112,7 +112,7 @@
+   if(Pref.FullScreen) vOption|=SDL_FULLSCREEN;
+   sdlVideo=SDL_SetVideoMode(800,600,sdlVideoInfo->vfmt->BitsPerPixel,vOption);
+   if(sdlVideo==NULL) {
+-    cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<endl;
++    std::cerr <<"Impossible de passer dans le mode vidéo 800x600 !"<<std::endl;
+     exit(-1);
+   }
+   
+diff -r -u Ri-li-2.0.1.orig/src/mouse.cc Ri-li-2.0.1/src/mouse.cc
+--- Ri-li-2.0.1.orig/src/mouse.cc	2007-11-02 04:48:20.000000000 -0700
++++ Ri-li-2.0.1/src/mouse.cc	2012-01-22 00:14:36.438797120 -0800
+@@ -21,7 +21,7 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include "mouse.h"
+ #include "preference.h"
+diff -r -u Ri-li-2.0.1.orig/src/sprite.cc Ri-li-2.0.1/src/sprite.cc
+--- Ri-li-2.0.1.orig/src/sprite.cc	2007-11-02 04:48:20.000000000 -0700
++++ Ri-li-2.0.1/src/sprite.cc	2012-01-22 00:30:43.640631779 -0800
+@@ -21,10 +21,10 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ #include <math.h>
+ #include "sprite.h"
+ #include "preference.h"
+@@ -84,7 +84,7 @@
+   strcpy(PathFile,Langue[Pref.Langue]);
+   GetPath(PathFile);
+   if(FileExiste(PathFile)==false) {
+-    cerr <<"Impossible de trouver "<<Langue[Pref.Langue]<<endl;
++    std::cerr <<"Impossible de trouver "<<Langue[Pref.Langue]<<std::endl;
+     return false;
+   }
+   L=ChargeFichier(PathFile,Buf);
+@@ -128,7 +128,7 @@
+   // *** Charge le fichier des langues ***
+   // *************************************
+   if(FileExiste(PathFile)==false) {
+-    cerr <<"Impossible de trouver 'language.dat'"<<endl;
++    std::cerr <<"Impossible de trouver 'language.dat'"<<std::endl;
+     return false;
+   }
+   L=ChargeFichier(PathFile,Buf);
+@@ -163,7 +163,7 @@
+   strcpy(PathFile,"sprites.dat");
+   GetPath(PathFile);
+   if(FileExiste(PathFile)==false) {
+-    cerr <<"Impossible de trouver 'sprites.dat'"<<endl;
++    std::cerr <<"Impossible de trouver 'sprites.dat'"<<std::endl;
+     return false;
+   }
+   L=ChargeFichier(PathFile,Buf);
+@@ -352,7 +352,7 @@
+     Image[i]=SDL_CreateRGBSurface((Dim[i].bpp-3)*SDL_SRCALPHA,Dim[i].L,Dim[i].H,Dim[i].bpp*8,
+ 				  0xff,0xff00,0xff0000,0xff000000*(Dim[i].bpp-3));
+     if(Image[i]<=NULL) {
+-      cerr <<"Impossible de créer une Surface SDL!"<<endl;
++      std::cerr <<"Impossible de créer une Surface SDL!"<<std::endl;
+       return false;
+     }
+     
+@@ -486,7 +486,7 @@
+   Image[0]=SDL_CreateRGBSurface((Dim[0].bpp-3)*SDL_SRCALPHA,Dim[0].L,Dim[0].H,Dim[0].bpp*8,
+ 				0xff,0xff00,0xff0000,0xff000000*(Dim[0].bpp-3));
+   if(Image[0]<=NULL) {
+-    cerr <<"Impossible de créer une Surface SDL!"<<endl;
++    std::cerr <<"Impossible de créer une Surface SDL!"<<std::endl;
+     return false;
+   }
+   return true;
+diff -r -u Ri-li-2.0.1.orig/src/tableau.cc Ri-li-2.0.1/src/tableau.cc
+--- Ri-li-2.0.1.orig/src/tableau.cc	2007-11-02 04:48:21.000000000 -0700
++++ Ri-li-2.0.1/src/tableau.cc	2012-01-22 00:14:50.710796598 -0800
+@@ -21,7 +21,7 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include "preference.h"
+diff -r -u Ri-li-2.0.1.orig/src/utils.cc Ri-li-2.0.1/src/utils.cc
+--- Ri-li-2.0.1.orig/src/utils.cc	2007-11-02 04:48:22.000000000 -0700
++++ Ri-li-2.0.1/src/utils.cc	2012-01-22 00:31:30.944630051 -0800
+@@ -21,10 +21,10 @@
+ //    with this program; if not, write to the Free Software Foundation, Inc.,
+ //    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ 
+-#include <iostream.h>
++#include <iostream>
+ #include <stdio.h>
+ #include <stdlib.h>
+-#include <string.h>
++#include <string>
+ 
+ #ifdef WINDOWS
+ #include <windows.h>
+@@ -77,7 +77,7 @@
+ 
+   file=fopen(Path,"r");
+   if(!file) {
+-    cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<endl;
++    std::cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<std::endl;
+     perror("fopen");
+     return -1;
+   }
+@@ -93,7 +93,7 @@
+ 
+   Buf=new unsigned char [L+1];
+   if(Buf==NULL) {
+-    cerr <<"ERREUR: Memoire insuffisante!"<<endl;
++    std::cerr <<"ERREUR: Memoire insuffisante!"<<std::endl;
+     fclose(file);
+     return -1;
+   }
+@@ -104,7 +104,7 @@
+   while(Compt>1024) {
+     AfficheChargeur();
+     if( fread(Po,1,1024,file) != 1024 ) {
+-      cerr <<"ERREUR de lecture du fichier '"<<Path<<"'"<<endl;
++      std::cerr <<"ERREUR de lecture du fichier '"<<Path<<"'"<<std::endl;
+       perror("fread");
+       fclose(file);
+       delete [] Buf;
+@@ -131,13 +131,13 @@
+ 
+   file=_lopen(Path,OF_READ);
+   if(file==-1) {
+-    cerr <<"Impossible d'ouvrir "<<Path<<endl;
++    std::cerr <<"Impossible d'ouvrir "<<Path<<std::endl;
+     exit(-1);
+   }
+   
+   long L=(long)_llseek(file,0,SEEK_END);
+   if(L==-1) {
+-    cerr <<"Impossible de trouver la longueur du fichier"<<endl;
++    std::cerr <<"Impossible de trouver la longueur du fichier"<<std::endl;
+     perror("lseek");
+     _lclose(file);
+     return -1;
+@@ -146,7 +146,7 @@
+   
+   Buf=new unsigned char [L+1];
+   if(Buf==NULL) {
+-    cerr <<"ERREUR: Memoire insuffisante!"<<endl;
++    std::cerr <<"ERREUR: Memoire insuffisante!"<<std::endl;
+     _lclose(file);
+     return -1;
+   }
+@@ -169,14 +169,14 @@
+   
+   file=fopen(Path,"w");
+   if(!file) {
+-    cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<endl;
++    std::cerr <<"ERREUR: Impossible d'ouvrir '"<<Path<<"'"<<std::endl;
+     perror("fopen");
+     return false;
+   }
+   
+   while(L>512) {
+     if( fwrite(Buf,1,512,file) != 512 ) {
+-      cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<endl;
++      std::cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<std::endl;
+       perror("fwrite");
+       fclose(file);
+       return false;
+@@ -187,7 +187,7 @@
+ 
+   if(L>0) {
+     if( fwrite(Buf,1,(size_t)L,file) != (size_t)L ) {
+-      cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<endl;
++      std::cerr <<"ERREUR d'ecriture du fichier '"<<Path<<"'"<<std::endl;
+       perror("fwrite");
+       fclose(file);
+       return false;
+@@ -208,7 +208,7 @@
+ 
+   file=_lcreat(Path,0);
+   if(!file) {
+-    cerr <<"ERREUR: Impossible de créer le fichier '"<<Path<<"'"<<endl;
++    std::cerr <<"ERREUR: Impossible de créer le fichier '"<<Path<<"'"<<std::endl;
+     return false;
+   }
+   
+@@ -216,7 +216,7 @@
+   _lclose(file);
+ 
+   if(Lec!=L) {
+-    cerr <<"Problème d'ecriture du fichier '"<<Path<<"' ecris="<<Lec<<" au lieux de ="<<L<<endl;
++    std::cerr <<"Problème d'ecriture du fichier '"<<Path<<"' ecris="<<Lec<<" au lieux de ="<<L<<std::endl;
+     return false;
+   }
+ 
+@@ -250,7 +250,7 @@
+   sprintf(Path,"/usr/share/games/Ri-li/%s",Provi);
+   if(FileExiste(Path)) return;
+   
+-  cerr <<"Impossible de trouver le fichier '"<<Provi<<endl;
++  std::cerr <<"Impossible de trouver le fichier '"<<Provi<<std::endl;
+   exit(-1);
+ }
+ #endif
+@@ -266,7 +266,7 @@
+   sprintf(Path,"PROGDIR:%s",Provi);
+   if(FileExiste(Path)) return;
+   
+-  cerr <<"Impossible de trouver le fichier '"<<Path<<endl;
++  std::cerr <<"Impossible de trouver le fichier '"<<Path<<std::endl;
+   exit(-1);
+ }
+ #endif
+@@ -282,7 +282,7 @@
+   sprintf(Path,"Ri-li.app/Contents/Resources/%s",Provi);
+   if(FileExiste(Path)) return;
+   
+-  cerr <<"Impossible de trouver le fichier '"<<Path<<endl;
++  std::cerr <<"Impossible de trouver le fichier '"<<Path<<std::endl;
+   exit(-1);
+ }
+ #endif
diff --git a/pkgs/games/scid/default.nix b/pkgs/games/scid/default.nix
new file mode 100644
index 00000000000..91ceb74b0c5
--- /dev/null
+++ b/pkgs/games/scid/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, tcl, tk, libX11, zlib, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "scid-${version}";
+  version = "4.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/scid/scid-4.3.tar.bz2";
+    sha256 = "0zb5qp04x8w4gn2kvfdfq2p44kmzfcqn7v167dixz6nlyxg41hrw";
+  };
+
+  buildInputs = [ tcl tk libX11 zlib makeWrapper ];
+
+  prePatch = ''
+    sed -i -e '/^ *set headerPath *{/a ${tcl}/include ${tk}/include' \
+           -e '/^ *set libraryPath *{/a ${tcl}/lib ${tk}/lib' \
+           -e '/^ *set x11Path *{/a ${libX11}/lib/' \
+           configure
+
+    sed -i -e '/^ *set scidShareDir/s|\[file.*|"'"$out/share"'"|' \
+      tcl/config.tcl
+  '';
+
+  configureFlags = [
+    "BINDIR=$(out)/bin"
+    "SHAREDIR=$(out)/share"
+  ];
+
+  dontPatchShebangs = true;
+
+  postFixup = ''
+    for cmd in sc_addmove sc_eco sc_epgn scidpgn \
+               sc_import sc_spell sc_tree spliteco
+    do
+      sed -i -e '1c#!'"$out"'/bin/tcscid' "$out/bin/$cmd"
+    done
+
+    sed -i -e '1c#!${tcl}/bin/tcslsh' "$out/bin/spf2spi"
+    sed -i -e '1c#!${tk}/bin/wish' "$out/bin/sc_remote"
+    sed -i -e '1c#!'"$out"'/bin/tkscid' "$out/bin/scid"
+
+    for cmd in $out/bin/*
+    do
+      wrapProgram "$cmd" \
+        --set TCLLIBPATH "${tcl}/${tcl.libdir}" \
+        --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
+    done
+  '';
+
+  meta = {
+    description = "Chess database with play and training functionality";
+    homepage = "http://scid.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/games/scorched3d/default.nix b/pkgs/games/scorched3d/default.nix
index 63fae5df0fc..3848f22ed20 100644
--- a/pkgs/games/scorched3d/default.nix
+++ b/pkgs/games/scorched3d/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     [ mesa openal freealut wxGTK freetype fftwSinglePrec SDL_net zlib libpng libjpeg
     libogg libvorbis ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   patches = [ ./file-existence.patch ];
 
diff --git a/pkgs/games/sgt-puzzles/default.nix b/pkgs/games/sgt-puzzles/default.nix
index 83d012d35f1..b8043525719 100644
--- a/pkgs/games/sgt-puzzles/default.nix
+++ b/pkgs/games/sgt-puzzles/default.nix
@@ -10,8 +10,8 @@ in
 rec {
   src = fetchsvn {
    url = svn://svn.tartarus.org/sgt/puzzles;
-   rev = "9437";
-   sha256 = "4820ce1e54e017a64dd9cb8991c020d0628329605a37af2a99b78bffbde43e85";
+   rev = "9689";
+   sha256 = "33285a971fee67324f8867de22582931135d8b8ee4cc2c41c46c3ba81eb99cb7";
   } + "/";
 
   inherit buildInputs;
@@ -27,6 +27,7 @@ rec {
 
   setVars = a.noDepEntry ''
     export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error=variadic-macros"
   '';
 
   /* doConfigure should be removed if not needed */
diff --git a/pkgs/games/simutrans/default.nix b/pkgs/games/simutrans/default.nix
index c0f9d213762..65a61cb6cab 100644
--- a/pkgs/games/simutrans/default.nix
+++ b/pkgs/games/simutrans/default.nix
@@ -1,78 +1,96 @@
-{ stdenv, fetchurl, unzip, zlib, libpng, bzip2, SDL, SDL_mixer } :
+{ stdenv, fetchurl, unzip, zlib, libpng, bzip2, SDL, SDL_mixer, makeWrapper } :
 
 let
-  # This is the default "pakset" of objects, images, text, music, etc.
-  pak64 = fetchurl {
-    url = http://sourceforge.net/projects/simutrans/files/pak64/110-0-1/simupak64-110-0-1.zip/download;
-    name = "pak64.zip";
-    sha256 = "0gs6k9dbbhh60g2smsx2jza65vyss616bpngwpvilrvb5rzzrxcq";
-  };
+  result = withPak (mkPak pak128);
+
+  ver_1 = "112";
+  ver_2 = "1";
+  ver_h2 = "${ver_1}-${ver_2}";
 
-  # The source distribution seems to be missing some text files.
-  # So we will get them from the binary Linux release (which apparently has them).
-  langtab = fetchurl {
-    url = http://sourceforge.net/projects/simutrans/files/simutrans/110-0-1/simulinux-110-0-1.zip/download;
-    name = "simulinux-110-0-1.zip";
-    sha256 = "15z13kazdzhfzwxry7a766xkkdzaidvscylzrjkx3nnbcq6461s4";
+  # "pakset" of objects, images, text, music, etc.
+  mkPak = src: stdenv.mkDerivation {
+    name = "simutrans-pakset";
+    inherit src;
+    unpackPhase = "true";
+    buildInputs = [ unzip ];
+    installPhase = ''
+      mkdir -p $out
+      cd $out
+      unzip ${src}
+      mv simutrans/*/* .
+      rm -rf simutrans
+    '';
+  };
+  pak64 = fetchurl {
+    url = "mirror://sourceforge/simutrans/pak64/${ver_h2}/simupak64-${ver_h2}.zip";
+    sha256 = "1197rl2534wx9wdafarlr42qjw6pyghz4bynq2g68pi10h8csypw";
   };
-in
-stdenv.mkDerivation rec {
-  pname = "simutrans";
-  version = "110.0.1";
-  name = "${pname}-${version}";
-
-  src = fetchurl {
-    url = "http://github.com/aburch/simutrans/tarball/v110.0.1";
-    name = "${name}.tar.gz";
-    sha256 = "ab0e42e5013d6d2fd5d3176b39dc45e482583b3bad178aac1188bf2ec88feb51";
+  pak128 = fetchurl {
+    url = "mirror://sourceforge/simutrans/pak128/pak128%20for%20${ver_1}/pak128-2.2.0--${ver_1}.0.zip";
+    sha256 = "13rwv9q3fa3ac0k11ds7zkpd00k4mn14rb0cknknvyz46icb9n80";
   };
 
-  buildInputs = [ zlib libpng bzip2 SDL SDL_mixer unzip ];
+  withPak = pak: stdenv.mkDerivation {
+    inherit (binaries) name;
+    unpackPhase = "true";
+    buildInputs = [ makeWrapper ];
+    installPhase = ''makeWrapper "${binaries}/bin/simutrans" "$out/bin/simutrans" --add-flags -objects --add-flags "${pak}"'';
+    inherit (binaries) meta;
+  };
 
-  prePatch = ''
-    # Use ~/.simutrans instead of ~/simutrans
-    sed -i 's@%s/simutrans@%s/.simutrans@' simsys_s.cc
-  '';
+  binaries = stdenv.mkDerivation rec {
+    pname = "simutrans";
+    name = "${pname}-${ver_1}.${ver_2}";
 
-  preConfigure = ''
-    # Configuration as per the readme.txt
-    sed -i 's@#BACKEND = sdl@BACKEND = sdl@' config.template
-    sed -i 's@#COLOUR_DEPTH = 16@COLOUR_DEPTH = 16@' config.template
-    sed -i 's@#OSTYPE = linux@OSTYPE = linux@' config.template
-    sed -i 's@#OPTIMISE = 1@OPTIMISE = 1@' config.template
+    src = fetchurl {
+      url = "mirror://sourceforge/simutrans/simutrans/${ver_h2}/simutrans-src-${ver_h2}.zip";
+      sha256 = "1xrxpd5m2dc9bk8w21smfj28r41ji1qaihjwkwrifgz6rhg19l5c";
+    };
+    sourceRoot = ".";
 
-    cp config.template config.default
-  '';
+    buildInputs = [ zlib libpng bzip2 SDL SDL_mixer unzip ];
 
-  installPhase = ''
-    # Erase the source distribution object definitions, will be replaced with langtab.
-    rm -r simutrans
+    preConfigure = ''
+      # Configuration as per the readme.txt
+      sed \
+        -e 's@#BACKEND = sdl@BACKEND = sdl@' \
+        -e 's@#COLOUR_DEPTH = 16@COLOUR_DEPTH = 16@' \
+        -e 's@#OSTYPE = linux@OSTYPE = linux@' \
+        < config.template > config.default
 
-    # Default pakset and binary release core objects.
-    unzip ${pak64}
-    unzip ${langtab}
+      # Different default data dir
+      sed -i -e 's:argv\[0\]:"'$out'/share/simutrans/":' \
+        simmain.cc
 
-    mv sim simutrans/
+      # Use ~/.simutrans instead of ~/simutrans ##not working
+      #sed -i -e 's@%s/simutrans@%s/.simutrans@' simsys_s.cc
 
-    mkdir -p $out/simutrans
-    cp -r simutrans $out
+      # No optimization overriding
+      sed -i -e '/-O$/d' Makefile
+    '';
 
-    mkdir -p $out/bin
-    ln -s $out/simutrans/sim $out/bin/simutrans
-  '';
+    installPhase = ''
+      mkdir -p $out/share/
+      mv simutrans $out/share/
 
-  meta = {
-    description = "Simutrans is a simulation game in which the player strives to run a successful transport system.";
-    longDescription = ''
-      Simutrans is a cross-platform simulation game in which the
-      player strives to run a successful transport system by
-      transporting goods, passengers, and mail between
-      places. Simutrans is an open source remake of Transport Tycoon.
+      mkdir -p $out/bin/
+      mv build/default/sim $out/bin/simutrans
     '';
 
-    homepage = http://www.simutrans.com/;
-    license = "Artistic";
-    maintainers = [ stdenv.lib.maintainers.kkallio ];
-    platforms = stdenv.lib.platforms.linux;
+    meta = {
+      description = "A simulation game in which the player strives to run a successful transport system";
+      longDescription = ''
+        Simutrans is a cross-platform simulation game in which the
+        player strives to run a successful transport system by
+        transporting goods, passengers, and mail between
+        places. Simutrans is an open source remake of Transport Tycoon.
+      '';
+
+      homepage = http://www.simutrans.com/;
+      license = "Artistic";
+      maintainers = [ stdenv.lib.maintainers.kkallio ];
+      platforms = stdenv.lib.platforms.linux;
+    };
   };
-}
+
+in result
diff --git a/pkgs/games/six/default.nix b/pkgs/games/six/default.nix
deleted file mode 100644
index a95ed6c50c6..00000000000
--- a/pkgs/games/six/default.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ stdenv, fetchurl, arts, kdelibs, libX11, libXext, libXt, perl, qt3, zlib }:
-
-let
-
-    versionNumber = "0.5.3";
-
-in
-
-stdenv.mkDerivation {
-
-  name = "six-${versionNumber}";
-
-  src = fetchurl {
-    url = "http://six.retes.hu/download/six-${versionNumber}.tar.gz";
-    sha256 = "0hialm0kxr11rp5z452whjmxp2vaqqj668d0dfs32fd10ggi8wj4";
-  };
-
-  meta = {
-    description = "Six - A Hex playing program for KDE";
-    homepage = http://six.retes.hu/;
-    license = "GPLv2";
-    platforms = stdenv.lib.platforms.linux;
-  };
-
-  buildInputs = [ arts kdelibs libX11 libXext libXt perl qt3 zlib ];
-
-  # Supress some warnings which are less useful to us when making packages.
-  NIX_CFLAGS_COMPILE = "-Wno-conversion -Wno-parentheses";
-
-  # Without "--x-libraries=", we get the error
-  # "impure path `/usr/lib' used in link".
-  configureFlags = "--x-libraries=";
-
-  patches = [ ./gcc43-includes.patch ];
-}
diff --git a/pkgs/games/six/gcc43-includes.patch b/pkgs/games/six/gcc43-includes.patch
deleted file mode 100644
index 83096bb0da2..00000000000
--- a/pkgs/games/six/gcc43-includes.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-This patch makes six compile with gcc 4.3 by including more header files.  It
-is based on the advice at <http://gcc.gnu.org/gcc-4.3/porting_to.html>.
-
---- a/six/carrier.h
-+++ b/six/carrier.h
-@@ -2,6 +2,7 @@
- #ifndef CARRIER_H
- #define CARRIER_H
-
-+#include <cstring>
- #include <iostream>
- #include <vector>
-
-diff --git a/six/hexgame.cpp b/six/hexgame.cpp
-index 720e977..5d0dafe 100644
---- a/six/hexgame.cpp
-+++ b/six/hexgame.cpp
-@@ -3,6 +3,7 @@
- #include <cassert>
- #include <cctype>
- #include <cstdio>
-+#include <cstdlib>
-
- #include <string>
-
-diff --git a/six/main.cpp b/six/main.cpp
-index 7fb5c21..b925a0c 100644
---- a/six/main.cpp
-+++ b/six/main.cpp
-@@ -4,6 +4,8 @@
- #include "carrier.h"
- #include "misc.h"
-
-+#include <cstdlib>
-+
- #include <kapp.h>
- #include <dcopclient.h>
- #include <kaboutdata.h>
diff --git a/pkgs/games/speed-dreams/default.nix b/pkgs/games/speed-dreams/default.nix
index e14b9b26a4f..e920b8c633e 100644
--- a/pkgs/games/speed-dreams/default.nix
+++ b/pkgs/games/speed-dreams/default.nix
@@ -30,6 +30,6 @@ stdenv.mkDerivation rec {
     homepage = http://speed-dreams.sourceforge.net/;
     license = "GPLv2+";
     maintainers = with stdenv.lib.maintainers; [viric raskin];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/spring/default.nix b/pkgs/games/spring/default.nix
index 09eb41f7267..ba45360ccb6 100644
--- a/pkgs/games/spring/default.nix
+++ b/pkgs/games/spring/default.nix
@@ -6,11 +6,11 @@
 stdenv.mkDerivation rec {
 
   name = "spring-${version}";
-  version = "0.88.0";
+  version = "94.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/springrts/spring_88.0_src.tar.lzma";
-    sha256 = "f203114b849a83795fe2d413d01c843b6f5b50df0832ce570bc476502f89e6fa";
+    url = "mirror://sourceforge/springrts/spring_${version}_src.tar.lzma";
+    sha256 = "19myqwpz4mi4zdlcv8318dps0ymmw7qpawhq1rgk73ycmaiyaaka";
   };
 
   buildInputs = [ cmake lzma boost libdevil zlib p7zip openal libvorbis freetype SDL
diff --git a/pkgs/games/spring/springlobby.nix b/pkgs/games/spring/springlobby.nix
index 4e06c31442a..e6051a12a26 100644
--- a/pkgs/games/spring/springlobby.nix
+++ b/pkgs/games/spring/springlobby.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, cmake, wxGTK, openal, pkgconfig, curl, libtorrentRasterbar
+{ stdenv, fetchurl, cmake, wxGTK, openal, pkgconfig, curl, libtorrentRasterbar, libpng, libX11
 , gettext, bash, gawk, boost}:
 stdenv.mkDerivation rec {
 
   name = "springlobby-${version}";
-  version = "0.146";
+  version = "0.169";
 
   src = fetchurl {
     url = "http://www.springlobby.info/tarballs/springlobby-${version}.tar.bz2";
-    sha256 = "55899baf6732e48bfaa36d80974aa135c051d2cbb6fe92fbcffd80440639eedf";
+    sha256 = "1wr8q2ha3wh718rr5rg7l6v404nf1rgkg4wkja77rfqy7r18zn7g";
   };
 
-  buildInputs = [ cmake wxGTK openal pkgconfig curl gettext libtorrentRasterbar boost];
+  buildInputs = [ cmake wxGTK openal pkgconfig curl gettext libtorrentRasterbar boost libpng libX11 ];
 
   prePatch = ''
     substituteInPlace tools/regen_config_header.sh --replace "#!/usr/bin/env bash" "#!${bash}/bin/bash"
diff --git a/pkgs/games/stuntrally/default.nix b/pkgs/games/stuntrally/default.nix
index 69609b1bbfb..31fd25a5150 100644
--- a/pkgs/games/stuntrally/default.nix
+++ b/pkgs/games/stuntrally/default.nix
@@ -1,15 +1,33 @@
-{ fetchurl, stdenv, cmake, boost, ogre, myguiSvn, ois, SDL, libvorbis, pkgconfig
-, makeWrapper }:
+{ fetchgit, stdenv, cmake, boost, ogre, mygui, ois, SDL, libvorbis, pkgconfig
+, makeWrapper, enet, libXcursor }:
 
 stdenv.mkDerivation rec {
-  name = "stunt-rally-1.4";
+  name = "stunt-rally-1.8";
 
-  src = fetchurl {
-    url = mirror://sourceforge/stuntrally/StuntRally-1.4-sources.tar.bz2;
-    sha256 = "1am5af4l1qliyrq1183sqvwzqwcjx0v6gkzsxhfmk6ygp7yhw7kq";
+  src = fetchgit {
+    url = git://github.com/stuntrally/stuntrally.git;
+    rev = "refs/tags/1.8";
+    sha256 = "0p8p83xx8q33kymsqnmxqca4jdfyg9rwrsac790z56gdbc7gnahm";
   };
 
-  buildInputs = [ cmake boost ogre myguiSvn ois SDL libvorbis pkgconfig makeWrapper ];
+  tracks = fetchgit {
+    url = git://github.com/stuntrally/tracks.git;
+    rev = "refs/tags/1.8";
+    sha256 = "1gcrs21nn0v3hvhrw8dc0wh1knn5qh66cjx7a1igiciiadmi2s3l";
+  };
+
+  patchPhase = ''
+    sed -i 's/materials/materials material_templates/' data/CMakeLists.txt
+  '';
+
+  preConfigure = ''
+    mkdir data/tracks
+    cp -R $tracks/* data/tracks
+  '';
+
+  buildInputs = [ cmake boost ogre mygui ois SDL libvorbis pkgconfig makeWrapper enet
+    libXcursor
+  ];
 
   # I think they suppose cmake should give them OGRE_PLUGIN_DIR defined, but
   # the cmake code I saw is not ready for that. Therefore, we use the env var.
diff --git a/pkgs/games/super-tux-kart/default.nix b/pkgs/games/super-tux-kart/default.nix
index 0c92ffbcdbb..46f22d332cc 100644
--- a/pkgs/games/super-tux-kart/default.nix
+++ b/pkgs/games/super-tux-kart/default.nix
@@ -1,24 +1,27 @@
-{ fetchurl, stdenv, plib, SDL, openal, freealut, mesa
-, libvorbis, libogg, gettext, irrlicht3843, libXxf86vm, curl, pkgconfig
-, fribidi }:
+{ fetchurl, cmake, stdenv, plib, SDL, openal, freealut, mesa
+, libvorbis, libogg, gettext, libXxf86vm, curl, pkgconfig
+, fribidi, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
-  name = "supertuxkart-0.7.3";
+  name = "supertuxkart-0.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/supertuxkart/${name}-src.tar.bz2";
-    sha256 = "0njrs2qyhbiqdbsqk9jx0sl8nhdwmipf1i91k23rv1biwrim9yq7";
+    sha256 = "12sbml4wxg2x2wgnnkxfisj96a9gcsaj3fj27kdk8yj524ikv7xr";
   };
 
   buildInputs = [
-    plib SDL openal freealut mesa libvorbis libogg gettext irrlicht3843
-    libXxf86vm curl pkgconfig fribidi
+    plib SDL openal freealut mesa libvorbis libogg gettext
+    libXxf86vm curl pkgconfig fribidi autoconf automake libtool cmake
   ];
 
-  configureFlags = [ "--with-irrlicht=${irrlicht3843}" ];
+  enableParallelBuilding = true;
 
-  postInstall = ''
-    mv $out/games $out/bin
+  preConfigure = ''
+    echo Building internal Irrlicht
+    cd lib/irrlicht/source/Irrlicht/
+    NDEBUG=1 make ''${enableParallelBuilding:+-j''${NIX_BUILD_CORES} -l''${NIX_BUILD_CORES}}
+    cd -
   '';
 
   meta = {
diff --git a/pkgs/games/the-butterfly-effect/default.nix b/pkgs/games/the-butterfly-effect/default.nix
index 5fc5e9be84e..979fcd1a48c 100644
--- a/pkgs/games/the-butterfly-effect/default.nix
+++ b/pkgs/games/the-butterfly-effect/default.nix
@@ -41,7 +41,7 @@ rec {
     mkdir -p "$out/share/tbe"
     cp -r . "$out/share/tbe/build-dir"
     mkdir -p "$out/bin"
-    echo '#! /bin/sh' >> "$out/bin/tbe"
+    echo '#!${a.stdenv.shell}' >> "$out/bin/tbe"
     echo "$out/share/tbe/build-dir/tbe \"\$@\"" >> "$out/bin/tbe"
     chmod a+x "$out/bin/tbe"
   '' ["minInit" "doMake" "defEnsureDir"];
diff --git a/pkgs/games/torcs/default.nix b/pkgs/games/torcs/default.nix
index cf740def511..f5b713ae337 100644
--- a/pkgs/games/torcs/default.nix
+++ b/pkgs/games/torcs/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ mesa freeglut libX11 plib openal freealut libXrandr xproto
     libXext libSM libICE libXi libXt libXrender libXxf86vm libpng zlib libvorbis ];
 
-  buildNativeInputs = [ bash ];
+  nativeBuildInputs = [ bash ];
 
   installTargets = "install datainstall";
 
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     homepage = http://torcs.sourceforge.net/;
     license = "GPLv2+";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/ufoai/default.nix b/pkgs/games/ufoai/default.nix
index 85440f88901..d9955aec3eb 100644
--- a/pkgs/games/ufoai/default.nix
+++ b/pkgs/games/ufoai/default.nix
@@ -1,53 +1,35 @@
-{stdenv, fetchurl, SDL, mesa, SDL_image, SDL_ttf, SDL_mixer, libpng, libjpeg, zlib
-, curl, libvorbis, libtheora, xvidcore, pkgconfig, gtk, glib, libxml2, gtksourceview
-, gtkglext, openal, gettext, p7zip }:
+{ stdenv, fetchurl, libtheora, xvidcore, mesa, SDL, SDL_ttf, SDL_mixer
+, curl, libjpeg, libpng, gettext, cunit, enableEditor?false }:
 
 stdenv.mkDerivation rec {
-  name = "ufoai-2.3";
+  name = "ufoai-2.4";
   src = fetchurl {
-    url = mirror://sourceforge/ufoai/ufoai-2.3-source.tar.bz2;
-    sha256 = "1pb41q5wx180l6xv8gm1sw8b7cji42znnb6qpjaap6vpgc8k3hp9";
+    url = "mirror://sourceforge/ufoai/${name}-source.tar.bz2";
+    sha256 = "0kxrbcjrharcwz319s90m789i4my9285ihp5ax6kfhgif2vn2ji5";
   };
 
   srcData = fetchurl {
-    url = mirror://sourceforge/ufoai/ufoai-2.3-data.tar;
-    sha256 = "0952kx6cbi4y89fbz1ig32rvsmfhzqpvdf79rq4axag9d3i5qlqf";
+    url = "mirror://sourceforge/ufoai/${name}-data.tar";
+    sha256 = "1drhh08cqqkwv1yz3z4ngkplr23pqqrdx6cp8c3isy320gy25cvb";
   };
 
-  srcI18n = fetchurl {
-    url = mirror://sourceforge/ufoai/ufoai-2.3-i18n.tar.bz2;
-    sha256 = "14fzv8a4xng6kfl6aw8yzz6vl2j5vryxija5b2yz75jbfpa94i09";
-  };
-
-  # for the xvidcore static lib
-  NIX_CFLAGS_COMPILE = "-pthread -lm";
-
-  # Order is important, x libs include a libpng version that fails for ufoai
-  buildInputs = [ libpng SDL mesa SDL_image SDL_ttf SDL_mixer libjpeg zlib curl libvorbis
-    libtheora xvidcore pkgconfig glib gtk gtkglext gtksourceview libxml2 openal gettext
-    p7zip ];
-
-  enableParallelBuilding = true;
-
-  preConfigure = ''
-    tar xvf $srcI18n
-  '';
+  preConfigure = ''tar xvf "${srcData}"'';
 
-  configureFlags = "--enable-release";
+  configureFlags = [ "--enable-release" "--enable-sse" ]
+    ++ stdenv.lib.optional enableEditor "--enable-uforadiant";
 
-  postInstall = ''
-    pushd $out/share/ufoai
-    tar xvf $srcData
-    popd
-  '';
+  buildInputs = [
+    libtheora xvidcore mesa SDL SDL_ttf SDL_mixer
+    curl libjpeg libpng gettext cunit
+  ];
 
-  installTargets = "install_exec";
+  NIX_CFLAGS_LINK = "-lgcc_s"; # to avoid occasional runtime error in finding libgcc_s.so.1
 
   meta = {
-    homepage = http://www.ultimatestunts.nl/;
-    description = "Squad-based tactical strategy game in the tradition of X-Com";
+    homepage = http://ufoai.org;
+    description = "A squad-based tactical strategy game in the tradition of X-Com";
     license = "GPLv2+";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/unvanquished/default.nix b/pkgs/games/unvanquished/default.nix
new file mode 100644
index 00000000000..6d1c8e5607c
--- /dev/null
+++ b/pkgs/games/unvanquished/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchurl, cmake, mesa, SDL, libjpeg, libpng, glew, libwebp, ncurses
+, gmp, curl, nettle, openal, speex, libogg, libvorbis, libtheora, xvidcore
+, makeWrapper }:
+stdenv.mkDerivation rec {
+  name = "unvanquished-${version}";
+  version = "0.13.1";
+  src = fetchurl {
+    url = "https://github.com/Unvanquished/Unvanquished/archive/v${version}.tar.gz";
+    sha256 = "1k7mlpwalimn6xb2s760f124xncpg455qvls6z3x0ii5x0wc1mp2";
+  };
+  buildInputs = [ cmake mesa SDL libjpeg libpng glew libwebp ncurses gmp curl
+                  nettle openal speex libogg libvorbis libtheora xvidcore 
+                  makeWrapper ];
+  preConfigure = ''prefix="$prefix/opt"'';
+  postInstall = ''
+    # cp -r ../main "$prefix/Unvanquished/"
+    mkdir -p "$out/bin"
+    substituteInPlace download-pk3.sh --replace /bin/bash ${stdenv.shell}
+    cp -v download-pk3.sh "$out/bin/unvanquished-download-pk3"
+    makeWrapper "$prefix/Unvanquished/daemon" "$out/bin/unvanquished" \
+                --run '[ -f ~/.Unvanquished/main/md5sums ] &&
+                       cd ~/.Unvanquished/main/ &&
+                       md5sum --quiet -c md5sums ||
+                       unvanquished-download-pk3' \
+                --run "cd '$prefix/Unvanquished'"
+    makeWrapper "$prefix/Unvanquished/daemonded" "$out/bin/unvanquished-ded" \
+                --run '[ -f ~/.Unvanquished/main/md5sums ] &&
+                       cd ~/.Unvanquished/main/ &&
+                       md5sum --quiet -c md5sums ||
+                       unvanquished-download-pk3' \
+                --run "cd '$prefix/Unvanquished'"
+  '';
+
+  meta = {
+    description = "A FLOSS FPS combining RTS elements with a futuristic, sci-fi setting.";
+    longDescription = ''
+      Unvanquished is a free, open-source first-person shooter
+      combining real-time strategy elements with a futuristic, sci-fi
+      setting. It is available for Windows, Linux, and Mac OS X.
+
+      Features:
+
+      * Two teams
+        Play as either the technologically advanced humans or the highly
+        adaptable aliens, with a fresh gameplay experience on both
+        sides.
+
+      * Build a base
+        Construct and maintain your base with a variety of useful
+        structures, or group up with teammates to take on the other
+        team.
+
+      * Level up
+        Earn rewards for victories against the other team, whether it's
+        a deadly new weapon or access to a whole new alien form.
+
+      * Customize
+        Compatibility with Quake 3 file formats and modification tools
+        allows for extensive customization of the game and its
+        setting.
+    '';
+    homepage = http://unvanquished.net;
+    #license = "unknown";
+    maintainers = with stdenv.lib.maintainers; [ astsmtl ];
+    # This package can take a lot of disk space, so unavailable from channel
+    #platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/games/uqm/3dovideo.nix b/pkgs/games/uqm/3dovideo.nix
new file mode 100644
index 00000000000..4aab9aed42c
--- /dev/null
+++ b/pkgs/games/uqm/3dovideo.nix
@@ -0,0 +1,64 @@
+{ stdenv, requireFile, writeText, fetchgit, haskellPackages }:
+
+with stdenv.lib;
+
+let
+  makeSpin = num: let
+    padded = (optionalString (lessThan num 10) "0") + toString num;
+  in "slides.spins.${padded} = 3DOVID:" +
+     "addons/3dovideo/spins/ship${padded}.duk:" +
+     "addons/3dovideo/spins/spin.aif:" +
+     "addons/3dovideo/spins/ship${padded}.aif:89";
+
+  videoRMP = writeText "3dovideo.rmp" (''
+    slides.ending = 3DOVID:addons/3dovideo/ending/victory.duk
+    slides.intro = 3DOVID:addons/3dovideo/intro/intro.duk
+  '' + concatMapStrings makeSpin (range 0 24));
+
+  helper = with haskellPackages; cabal.mkDerivation (self: {
+    pname = "uqm3donix";
+    version = "0.1.0.0";
+
+    src = fetchgit {
+      url = "git://github.com/aszlig/uqm3donix.git";
+      rev = "97fc4fd736dcf9fe03e6e5a2c347c5bdc71c8366";
+      sha256 = "09ws6j21mxkcjx444fxkf8a3q17jj6i7h2i9pf5ky52f6xds1h0j";
+    };
+
+    isLibrary = false;
+    isExecutable = true;
+
+    buildDepends = [ binary filepath tar ];
+
+    meta = {
+      description = "Extract video files from a Star Control II 3DO image";
+      license = self.stdenv.lib.licenses.bsd3;
+      platforms = self.ghc.meta.platforms;
+    };
+  });
+
+in stdenv.mkDerivation {
+  name = "uqm-3dovideo";
+
+  src = requireFile rec {
+    name = "videos.tar";
+    sha256 = "044h0cl69r0kc43vk4n0akk0prwzb7inq324h5yfqb38sd4zkds1";
+    message = ''
+      In order to get the intro and ending sequences from the 3DO version, you
+      need to have the original 3DO Star Control II CD. Create an image from the
+      CD and use uqm3donix* to extract a tarball with the videos from it. The
+      reason for this is because the 3DO uses its own proprietary disk format.
+
+      Save the file as videos.tar and use "nix-prefetch-url file://${name}" to
+      add it to the Nix store.
+
+      [*] ${helper}/bin/uqm3donix CDIMAGE ${name}
+    '';
+  };
+
+  buildCommand = ''
+    mkdir -vp "$out"
+    tar xf "$src" -C "$out" --strip-components=3
+    cp "${videoRMP}" "$out/3dovideo.rmp"
+  '';
+}
diff --git a/pkgs/games/uqm/default.nix b/pkgs/games/uqm/default.nix
new file mode 100644
index 00000000000..1f82c75f9cf
--- /dev/null
+++ b/pkgs/games/uqm/default.nix
@@ -0,0 +1,89 @@
+{ stdenv, fetchurl
+, pkgconfig, mesa
+, SDL, SDL_image, libpng, zlib, libvorbis, libogg, libmikmod, unzip
+, use3DOVideos ? false, requireFile ? null, writeText ? null
+, fetchgit ? null, haskellPackages ? null
+}:
+
+assert use3DOVideos -> requireFile != null && writeText != null
+                    && fetchgit != null && haskellPackages != null;
+
+let
+  videos = import ./3dovideo.nix {
+    inherit stdenv requireFile writeText fetchgit haskellPackages;
+  };
+in stdenv.mkDerivation rec {
+  name = "uqm-${version}";
+  version = "0.7.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sc2/uqm-${version}-source.tgz";
+    sha256 = "a3695c5f7f0be7ec9c0f80ec569907b382023a1fee6e635532bd53b7b53bb221";
+  };
+
+  content = fetchurl {
+    url = "mirror://sourceforge/sc2/uqm-${version}-content.uqm";
+    sha256 = "b8f6db8ba29f0628fb1d5c233830896b19f441aee3744bda671ea264b44da3bf";
+  };
+
+  voice = fetchurl {
+    url = "mirror://sourceforge/sc2/uqm-${version}-voice.uqm";
+    sha256 = "bcccf801b4ba37594ff6217b292744ea586ee2d447e927804842ccae8b73c979";
+  };
+
+  music = fetchurl {
+    url = "mirror://sourceforge/sc2/uqm-${version}-3domusic.uqm";
+    sha256 = "c57085e64dad4bddf8a679a9aa2adf63f2156d5f6cbabe63af80519033dbcb82";
+  };
+
+
+ /* uses pthread_cancel(), which requires libgcc_s.so.1 to be
+    loadable at run-time. Adding the flag below ensures that the
+    library can be found. Obviously, though, this is a hack. */
+  NIX_LDFLAGS="-lgcc_s";
+
+  buildInputs = [SDL SDL_image libpng libvorbis libogg libmikmod unzip pkgconfig mesa];
+
+  postUnpack = ''
+    mkdir -p uqm-${version}/content/packages
+    mkdir -p uqm-${version}/content/addons
+    cp $content uqm-${version}/content/packages/uqm-0.7.0-content.uqm
+    cp $music uqm-${version}/content/addons/uqm-0.7.0-3domusic.uqm
+    cp $voice uqm-${version}/content/addons/uqm-0.7.0-voice.uqm
+  '' + stdenv.lib.optionalString use3DOVideos ''
+    ln -s "${videos}" "uqm-${version}/content/addons/3dovideo"
+  '';
+
+  /* uqm has a 'unique' build system with a root script incidentally called
+ * 'build.sh'. */
+
+  configurePhase = ''
+    echo "INPUT_install_prefix_VALUE='$out'" >> config.state
+    echo "INPUT_install_bindir_VALUE='$out/bin'" >> config.state
+    echo "INPUT_install_libdir_VALUE='$out/lib'" >> config.state
+    echo "INPUT_install_sharedir_VALUE='$out/share'" >> config.state
+    PREFIX=$out ./build.sh uqm config
+  '';
+
+  buildPhase = ''
+    ./build.sh uqm
+  '';
+
+  installPhase = ''
+    ./build.sh uqm install
+    sed -i $out/bin/uqm -e "s%/usr/local/games/%$out%g"
+  '';
+
+  meta = {
+    description = "Remake of Star Control II";
+    longDescription = ''
+    The goals for the The Ur-Quan Masters project are:
+      - to bring Star Control II to modern platforms, thereby making a lot of people happy
+      - to make game translations easy, thereby making even more people happy
+      - to adapt the code so that people can more easily make their own spin-offs, thereby making zillions more people happy!
+    '';
+    homepage = http://sc2.sourceforge.net/;
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/games/urbanterror/default.nix b/pkgs/games/urbanterror/default.nix
index 875dfc93bb1..535e575fdc4 100644
--- a/pkgs/games/urbanterror/default.nix
+++ b/pkgs/games/urbanterror/default.nix
@@ -1,72 +1,49 @@
 { stdenv, fetchurl, unzip, SDL, mesa, openal, curl }:
 stdenv.mkDerivation rec {
   name = "urbanterror-${version}";
-  version = "4.1";
-  src1 = fetchurl {
-    url = "http://ftp.snt.utwente.nl/pub/games/urbanterror/UrbanTerror_41_FULL.zip";
-    sha256 = "0pr6xpwq8zllc0xsdxl8cfd0zz5fhggw5fsbrizygr6hhdvra1jp";
-  };
-  src2 = fetchurl {
-    url = "http://ftp.snt.utwente.nl/pub/games/urbanterror/iourbanterror/source/complete/ioUrbanTerrorSource_2007_12_20.zip";
-    sha256 = "1s1wq9m7shhvvk7s4400yrmz7dys501i4c9ln1mglc9dhmi8dmcn";
-  };
+  version = "4.2.009";
+  srcs =
+    [ (fetchurl {
+         url = "http://download.urbanterror.info/urt/42/zips/UrbanTerror42_full_009.zip";
+         sha256 = "0m423zy6l1z4kxz55knlh1ypnqq58ghh08i8ziv4lm00ygm6mx2i";
+       })
+      (fetchurl {
+         url = "https://github.com/Barbatos/ioq3-for-UrbanTerror-4/archive/release-4.2.007.tar.gz";
+         sha256 = "1299j0i94697m2bbcgraxfbb7q1g6nc43l1xqlgqvcsjp799mwwn";
+       })
+    ];
   buildInputs = [ unzip SDL mesa openal curl ];
-  unpackPhase = ''
-    mkdir urbanterror
-    cd urbanterror
-    unzip $src1
-    unzip $src2
-  '';
-  patches = [ ./l_script.patch ];
-  patchPhase = ''
-    for d in ioUrbanTerrorClientSource ioUrbanTerrorServerSource
-    do
-      cd "$d"
-      patch -p 0 < "''${patches[0]}"
-      cd ..
-    done
-  '';
+  sourceRoot = "ioq3-for-UrbanTerror-4-release-4.2.007";
   configurePhase = ''
-    cd ioUrbanTerrorClientSource
     echo "USE_OPENAL = 1" > Makefile.local
     echo "USE_OPENAL_DLOPEN = 0" >> Makefile.local
     echo "USE_CURL = 1" >> Makefile.local
     echo "USE_CURL_DLOPEN = 0" >> Makefile.local
-    substituteInPlace code/tools/asm/Makefile --replace -Werror ""
-    cd ..
-  '';
-  buildPhase = ''
-    for d in ioUrbanTerrorClientSource ioUrbanTerrorServerSource
-    do
-      cd $d
-      make
-      cd ..
-    done
   '';
   installPhase = ''
     destDir="$out/opt/urbanterror"
     mkdir -p "$destDir"
     mkdir -p "$out/bin"
-    cp -v ioUrbanTerrorClientSource/build/release-linux-*/ioUrbanTerror.* \
-          "$destDir/ioUrbanTerror"
-    cp -v ioUrbanTerrorServerSource/build/release-linux-*/ioUrTded.* \
-          "$destDir/ioUrTded"
-    cp -rv UrbanTerror/q3ut4 "$destDir"
+    cp -v build/release-linux-*/Quake3-UrT.* \
+          "$destDir/Quake3-UrT"
+    cp -v build/release-linux-*/Quake3-UrT-Ded.* \
+          "$destDir/Quake3-UrT-Ded"
+    cp -rv ../UrbanTerror42/q3ut4 "$destDir"
     cat << EOF > "$out/bin/urbanterror"
-    #!/bin/sh
+    #! ${stdenv.shell}
     cd "$destDir"
-    exec ./ioUrbanTerror "\$@"
+    exec ./Quake3-UrT "\$@"
     EOF
     chmod +x "$out/bin/urbanterror"
     cat << EOF > "$out/bin/urbanterror-ded"
-    #!/bin/sh
+    #! ${stdenv.shell}
     cd "$destDir"
-    exec ./ioUrTded "\$@"
+    exec ./Quake3-UrT-Ded "\$@"
     EOF
     chmod +x "$out/bin/urbanterror-ded"
   '';
   postFixup = ''
-    p=$out/opt/urbanterror/ioUrbanTerror
+    p=$out/opt/urbanterror/Quake3-UrT
     cur_rpath=$(patchelf --print-rpath $p)
     patchelf --set-rpath $cur_rpath:${mesa}/lib $p
   '';
@@ -82,6 +59,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.urbanterror.net;
     license = [ "unfree-redistributable" ];
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/games/urbanterror/l_script.patch b/pkgs/games/urbanterror/l_script.patch
deleted file mode 100644
index 8aa176cca8c..00000000000
--- a/pkgs/games/urbanterror/l_script.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ur code/botlib/l_script.c kode/botlib/l_script.c
---- code/botlib/l_script.c	2007-10-09 02:47:26.000000000 +0400
-+++ kode/botlib/l_script.c	2012-04-16 02:02:55.170360236 +0400
-@@ -1118,7 +1118,7 @@
- {
- 	if (*string == '\"')
- 	{
--		strcpy(string, string+1);
-+		memmove(string, string+1, strlen(string) - 1);
- 	} //end if
- 	if (string[strlen(string)-1] == '\"')
- 	{
-@@ -1135,7 +1135,7 @@
- {
- 	if (*string == '\'')
- 	{
--		strcpy(string, string+1);
-+		memmove(string, string+1, strlen(string) - 1);
- 	} //end if
- 	if (string[strlen(string)-1] == '\'')
- 	{
diff --git a/pkgs/games/vdrift/default.nix b/pkgs/games/vdrift/default.nix
index 0f9da888382..97bd1ab432d 100644
--- a/pkgs/games/vdrift/default.nix
+++ b/pkgs/games/vdrift/default.nix
@@ -2,13 +2,21 @@
   asio, boost, SDL_gfx, pkgconfig, bullet, curl, libarchive }:
 
 stdenv.mkDerivation rec {
-  name = "vdrift-2011-10-22";
+  version = "2012-07-22";
+  name = "vdrift-${version}";
+  patch = "c"; # see https://github.com/VDrift/vdrift/issues/110
 
   src = fetchurl {
     url = "mirror://sourceforge/vdrift/${name}.tar.bz2";
-    sha256 = "0vg1v1590jbln6k236kxn2sfgclvc6g34kykhh4nq9q3l1xgy38s";
+    sha256 = "1yqkc7y4s4g5ylw501bf0c03la7kfddjdk4yyi1xkcwy3pmgw2al";
   };
 
+  patches = fetchurl {
+    url = "mirror://sourceforge/vdrift/${name}${patch}_patch.diff";
+    sha256 = "08mfg4xxkzyp6602cgqyjzc3rn0zsaa3ddjkpd44b83drv19lriy";
+  };
+  patchFlags = "-p0";
+
   buildInputs = [ scons mesa SDL freeglut SDL_image glew libvorbis asio boost
     SDL_gfx pkgconfig bullet curl libarchive ];
 
@@ -23,6 +31,6 @@ stdenv.mkDerivation rec {
     homepage = http://vdrift.net/;
     license = "GPLv2+";
     maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/vessel/default.nix b/pkgs/games/vessel/default.nix
new file mode 100644
index 00000000000..e6f3523fa24
--- /dev/null
+++ b/pkgs/games/vessel/default.nix
@@ -0,0 +1,84 @@
+{ stdenv, requireFile, SDL, pulseaudio, alsaLib }:
+
+stdenv.mkDerivation rec {
+  name = "vessel-12082012";
+
+  goBuyItNow = '' 
+    We cannot download the full version automatically, as you require a license.
+    Once you bought a license, you need to add your downloaded version to the nix store.
+    You can do this by using "nix-prefetch-url file://${name}-bin" in the
+    directory where you saved it.
+  ''; 
+
+  src = if (stdenv.isi686) then
+    requireFile {
+      message = goBuyItNow;
+      name = "${name}-bin";
+      sha256 = "1vpwcrjiln2mx43h7ib3jnccyr3chk7a5x2bw9kb4lw8ycygvg96";
+    } else throw "unsupported platform ${stdenv.s:ystem} only i686-linux supported for now.";
+
+  phases = "installPhase";
+  ld_preload = ./isatty.c;
+
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc stdenv.gcc.libc ] 
+    + ":" + stdenv.lib.makeLibraryPath [ SDL pulseaudio alsaLib ] ;
+
+  installPhase = ''
+    ensureDir $out/libexec/strangeloop/vessel/
+    ensureDir $out/bin
+
+    # allow scripting of the mojoinstaller
+    gcc -fPIC -shared -o isatty.so $ld_preload
+
+    echo @@@ 
+    echo @@@ this next step appears to hang for a while
+    echo @@@ 
+
+    # if we call ld.so $(bin) we don't need to set the ELF interpreter, and save a patchelf step. 
+    LD_PRELOAD=./isatty.so $(cat $NIX_GCC/nix-support/dynamic-linker) $src << IM_A_BOT
+    n
+    $out/libexec/strangeloop/vessel/
+    IM_A_BOT
+
+    # use nix SDL libraries
+    rm $out/libexec/strangeloop/vessel/x86/libSDL*
+    rm $out/libexec/strangeloop/vessel/x86/libstdc++*
+
+    # props to Ethan Lee (the Vessel porter) for understanding
+    # how $ORIGIN works in rpath. There is hope for humanity. 
+    patchelf \
+      --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
+      $out/libexec/strangeloop/vessel/x86/vessel.x86
+
+    # we need to libs to find their deps
+    for lib in $out/libexec/strangeloop/vessel/x86/lib* ; do
+    patchelf \
+      --set-rpath $libPath:$out/libexec/strangeloop/vessel/x86/ \
+      $lib
+    done
+
+    cat > $out/bin/Vessel << EOW
+    #!/bin/sh
+    cd $out/libexec/strangeloop/vessel/
+    exec ./x86/vessel.x86
+    EOW
+
+    chmod +x $out/bin/Vessel
+  '';
+
+  meta = {
+    description = "A fluid physics based puzzle game";
+    longDescription = ''
+      Living liquid machines have overrun this world of unstoppable progress,
+      and it is the role of their inventor, Arkwright, to stop the chaos they are
+      causing. Vessel is a game about a man with the power to bring ordinary matter
+      to life, and all the consequences that ensue.
+    '';
+    homepage = http://www.strangeloopgames.com;
+    license = [ "unfree" ];
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+    platforms = [ "i686-linux"] ;
+  };
+
+}
diff --git a/pkgs/games/vessel/isatty.c b/pkgs/games/vessel/isatty.c
new file mode 100644
index 00000000000..38ee2b6ce2e
--- /dev/null
+++ b/pkgs/games/vessel/isatty.c
@@ -0,0 +1,6 @@
+// We override isatty to help 'automate' installers. 
+
+// Some installers (mojoinstall) have a stdio GUI that refuses to run if you
+// feed it a file on stdin. This should help that. 
+
+int isatty(int fd) { return 1; }
diff --git a/pkgs/games/warsow/default.nix b/pkgs/games/warsow/default.nix
index c584319bdc9..aeb7e37cd7e 100644
--- a/pkgs/games/warsow/default.nix
+++ b/pkgs/games/warsow/default.nix
@@ -1,43 +1,45 @@
-{ stdenv, fetchurl, unzip, pkgconfig, zlib, curl, libjpeg, libvorbis
-, libXxf86dga, libXxf86vm, libXinerama, SDL, mesa, openal
+{ stdenv, fetchurl, unzip, pkgconfig, zlib, curl, libjpeg, libpng, libvorbis
+, libtheora, libXxf86dga, libXxf86vm, libXinerama, SDL, mesa, openal, freetype
+, makeWrapper
 }:
 stdenv.mkDerivation rec {
   name = "warsow-${version}";
-  version = "0.62";
-  mversion = "0.61";  # sometimes only engine is updated
+  version = "1.03";
+  mversion = "1.02";  # sometimes only engine is updated
   src1 = fetchurl {
-    url = "http://www.zcdn.org/dl/warsow_${version}_sdk.zip";
-    sha256 = "0nb1z55lzmwarnn71dcyg9b3k7r7wxagqxks8a7rnlq7acsnra71";
+    url = "http://www.warsow.net:1337/~warsow/${version}/warsow_${version}_sdk.tar.gz";
+    sha256 = "0z6r5v30p8fxbszmkxssv5fnnjw7w5wfn7wfgbwvmy87ayi7mkcq";
   };
   src2 = fetchurl {
-    url = "http://www.zcdn.org/dl/warsow_${mversion}_unified.zip";
-    sha256 = "1b5bv4dsly7i7c4fqlkckv4da1knxl9m3kg8nlgkgr8waczgvazv";
+    url = "http://www.warsow.net:1337/~warsow/${mversion}/warsow_${mversion}.tar.gz";
+    sha256 = "0ai5v1h5g9nq21ixz23v0qsj9dr7dbiz7l8r34mq4c3z6ili8zpy";
   };
   unpackPhase = ''
-    mkdir warsow_${version}_sdk
+    tar xf "$src1"
     cd warsow_${version}_sdk
-    unzip $src1
-    unzip $src2
+    tar xf "$src2"
     mkdir -p source/release/
-    mv warsow_${mversion}_unified/basewsw source/release/
+    mv warsow_${mversion}/basewsw source/release/
     cd source
   '';
   patchPhase = ''
     substituteInPlace snd_openal/snd_main.c --replace libopenal.so.1 ${openal}/lib/libopenal.so.1
   '';
-  buildInputs = [ unzip pkgconfig zlib curl libjpeg libvorbis libXxf86dga
-                  libXxf86vm libXinerama SDL mesa openal ];
+  buildInputs = [ unzip pkgconfig zlib curl libjpeg libpng libvorbis libtheora
+                  libXxf86dga libXxf86vm libXinerama SDL mesa openal makeWrapper
+                ];
   installPhase = ''
     dest=$out/opt/warsow
     cd release
-    for f in warsow wsw_server wswtv_server; do
-        substituteInPlace $f --replace BINARY_DIR= BINARY_DIR=$dest
-    done
     mkdir -p $dest
     mkdir -p $out/bin
-    cp -v {warsow,wsw_server,wswtv_server}.* $dest
+    cp -v {warsow,wsw_server,wswtv_server}* $dest
     cp -rv basewsw libs $dest
-    cp -v warsow wsw_server wswtv_server $out/bin
+    # Since 1.03 some modules are _always_ downloaded from server, thus
+    makeWrapper $dest/warsow $out/bin/warsow \
+      --suffix-each LD_LIBRARY_PATH ':' "${freetype}/lib"
+    makeWrapper $dest/wsw_server $out/bin/wsw_server
+    makeWrapper $dest/wswtv_server $out/bin/wswtv_server
   '';
   postFixup = ''
     p=$out/opt/warsow/warsow.*
diff --git a/pkgs/games/wesnoth/default.nix b/pkgs/games/wesnoth/default.nix
index 2bac3cba198..b8e53b0cefb 100644
--- a/pkgs/games/wesnoth/default.nix
+++ b/pkgs/games/wesnoth/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "wesnoth";
-  version = "1.10.2";
+  version = "1.10.5";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/sourceforge/${pname}/${name}.tar.bz2";
-    sha256 = "0hawzq85sq0kdddj0s7y6kpx043g1hsl7cvyw1xcxqh45hkgw2ix";
+    sha256 = "1rvlr8c3vzhgd33vzc1hfhiil6d7hc3px8r8p79vmp3kwi3d49zn";
   };
 
   buildInputs = [ SDL SDL_image SDL_mixer SDL_net SDL_ttf pango gettext zlib boost fribidi
diff --git a/pkgs/games/widelands/boost_and_cmake_die_die_die.patch b/pkgs/games/widelands/boost_and_cmake_die_die_die.patch
new file mode 100644
index 00000000000..f008be35e37
--- /dev/null
+++ b/pkgs/games/widelands/boost_and_cmake_die_die_die.patch
@@ -0,0 +1,11 @@
+--- widelands-build17-src.old/CMakeLists.txt	2012-04-23 02:46:49.000000000 -0700
++++ widelands-build17-src/CMakeLists.txt	2012-07-14 19:49:14.000000000 -0700
+@@ -140,8 +140,6 @@
+ else (WL_UNIT_TESTS)
+   message(STATUS "Disabled Unit Tests")
+   set (Boost_FIND_COMPONENTS signals)
+-  set (Boost_USE_STATIC_LIBS   ON)
+-  set (Boost_USE_MULTITHREADED ON)
+   set (Boost_DETAILED_FAILURE_MSG ON)
+   find_package(Boost 1.35.0 COMPONENTS signals REQUIRED)
+ endif (WL_UNIT_TESTS)
diff --git a/pkgs/games/widelands/default.nix b/pkgs/games/widelands/default.nix
index 74d1f87e0be..e20adc8faa7 100644
--- a/pkgs/games/widelands/default.nix
+++ b/pkgs/games/widelands/default.nix
@@ -13,11 +13,11 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="widelands";
-    version="build16";
+    version="build17";
     name="${baseName}-${version}";
     project="${baseName}";
-    url="http://launchpad.net/${project}/${version}/${version}/+download/${name}-src.tar.bz2";
-    hash="0pb2d73c6hynhp1x54rcfbibrrri7lyxjybd1hicn503qcakrnyq";
+    url="https://launchpadlibrarian.net/102893896/widelands-build17-src.tar.bz2";
+    hash="be48b3b8f342a537b39a3aec2f7702250a6a47e427188ba3bece67d7d90f3cc5";
   };
 in
 rec {
@@ -30,7 +30,9 @@ rec {
   inherit buildInputs;
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["killBuildDir" "doCmake" "doMakeInstall" "createScript"];
+  phaseNames = ["killBuildDir" "doPatch"  "doCmake" "doMakeInstall" "createScript"];
+
+  patches = [ ./boost_and_cmake_die_die_die.patch ]; 
       
   killBuildDir = a.fullDepEntry ''
     rm -r build
@@ -38,6 +40,7 @@ rec {
 
   cmakeFlags = [
     "-DLUA_LIBRARIES=-llua"
+    "-DWL_PORTABLE=true"
   ];
 
   createScript = a.fullDepEntry ''
@@ -50,12 +53,18 @@ rec {
 
   meta = {
     description = "Widelands RTS with multiple-goods economy";
+    longDescription = ''
+      Widelands is a real time strategy game based on "The Settlers" and "The
+      Settlers II". It has a single player campaign mode, as well as a networked
+      multiplayer mode. 
+    '';
+
     maintainers = with a.lib.maintainers;
     [
       raskin
+      jcumming
     ];
-    platforms = with a.lib.platforms;
-      linux;
+    #platforms = a.lib.platforms.linux;
     license = a.lib.licenses.gpl2Plus;
   };
   passthru = {
diff --git a/pkgs/games/worldofgoo/default.nix b/pkgs/games/worldofgoo/default.nix
new file mode 100644
index 00000000000..216ec0d8041
--- /dev/null
+++ b/pkgs/games/worldofgoo/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, config, requireFile, fetchurl
+, libX11, libXext, libXau, libxcb, libXdmcp , SDL, SDL_mixer, libvorbis, mesa
+, demo ? false }:
+
+# TODO: add i686 support
+
+stdenv.mkDerivation rec {
+  name = if demo 
+    then "WorldOfGooDemo-1.41"
+    else "WorldofGoo-1.41";
+
+  arch = if stdenv.system == "x86_64-linux" then "supported"
+    else throw "Sorry. World of Goo only is only supported on x86_64 now.";
+
+  goBuyItNow = '' 
+    We cannot download the full version automatically, as you require a license.
+    Once you bought a license, you need to add your downloaded version to the nix store.
+    You can do this by using "nix-prefetch-url file://WorldOfGooSetup.1.41.tar.gz" in the
+    directory where you saved it.
+
+    Or you can install the demo version: 'nix-env -i -A pkgs.worldofgoo_demo'. 
+  ''; 
+
+  getTheDemo = ''
+    We cannot download the demo version automatically, please go to
+    http://worldofgoo.com/dl2.php?lk=demo, then add it to your nix store.
+    You can do this by using "nix-prefetch-url file://WorldOfGooDemo.1.41.tar.gz" in the
+    directory where you saved it.
+  '';
+
+  src = if demo 
+    then 
+      requireFile {
+         message = getTheDemo;
+         name = "WorldOfGooDemo.1.41.tar.gz";
+         sha256 = "0ndcix1ckvcj47sgndncr3hxjcg402cbd8r16rhq4cc43ibbaxri";
+       }
+    else
+      requireFile {
+        message = goBuyItNow;
+        name = "WorldOfGooSetup.1.41.tar.gz";
+        sha256 = "0rj5asx4a2x41ncwdby26762my1lk1gaqar2rl8dijfnpq8qlnk7";
+      };
+
+  phases = "unpackPhase installPhase";
+
+  # XXX: stdenv.lib.makeLibraryPath doesn't pick up /lib64
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.gcc.gcc stdenv.gcc.libc ] 
+    + ":" + stdenv.lib.makeLibraryPath [libX11 libXext libXau libxcb libXdmcp SDL SDL_mixer libvorbis mesa ]
+    + ":" + stdenv.gcc.gcc + "/lib64";
+
+  installPhase = ''
+    ensureDir $out/libexec/2dboy/WorldOfGoo/
+    ensureDir $out/bin
+
+    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" --set-rpath $libPath ./WorldOfGoo.bin64
+
+    cp -r * $out/libexec/2dboy/WorldOfGoo/
+
+    #makeWrapper doesn't do cd. :(
+
+    cat > $out/bin/WorldofGoo << EOF
+    #!/bin/sh
+    cd $out/libexec/2dboy/WorldOfGoo
+    exec ./WorldOfGoo.bin64
+    EOF
+    chmod +x $out/bin/WorldofGoo
+  '';
+
+  meta = {
+    description = "A physics based puzzle game";
+    longDescription = ''
+      World of Goo is a physics based puzzle / construction game. The millions of Goo
+      Balls who live in the beautiful World of Goo don't know that they are in a
+      game, or that they are extremely delicious.
+    '';
+    homepage = http://worldofgoo.com;
+    license = [ "unfree" ];
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+    platforms = [ "x86_64-linux"] ;
+  };
+
+}
diff --git a/pkgs/games/xboard/default.nix b/pkgs/games/xboard/default.nix
index a1a65165326..21870fc3777 100644
--- a/pkgs/games/xboard/default.nix
+++ b/pkgs/games/xboard/default.nix
@@ -1,33 +1,33 @@
-a:  
-let 
-  fetchurl = a.fetchurl;
-
-  buildInputs = with a; [
+{stdenv, fetchurl, libX11, xproto, libXt, libXaw, libSM, libICE, libXmu
+, libXext, gnuchess, texinfo, libXpm, pkgconfig, librsvg, cairo
+}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="xboard";
+    version="4.7.1";
+    name="${baseName}-${version}";
+    hash="0hnav2swswaf0463c4wnmgwaif3g42f2a1mqyqc5fa1py32iy6ry";
+    url="http://ftp.gnu.org/gnu/xboard/xboard-4.7.1.tar.gz";
+    sha256="0hnav2swswaf0463c4wnmgwaif3g42f2a1mqyqc5fa1py32iy6ry";
+  };
+  buildInputs = [
     libX11 xproto libXt libXaw libSM libICE libXmu 
-    libXext gnuchess texinfo libXpm
+    libXext gnuchess texinfo libXpm pkgconfig librsvg 
+    cairo
   ];
-
-  s = import ./src-for-default.nix;
 in
-rec {
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
   src = fetchurl {
-    inherit(s) url;
-    sha256 = s.hash;
+    inherit (s) url sha256;
   };
-
-  inherit buildInputs;
-  configureFlags = [];
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "preBuild" "doMakeInstall"];
-
-  preBuild = a.fullDepEntry(''
-    sed -e '/FIRST_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h
-    sed -e '/SECOND_CHESS_PROGRAM/s@gnuchessx@${a.gnuchess}/bin/gnuchessx@' -i xboard.h
-  '') ["doUnpack" "minInit"];
-      
-  inherit(s) name;
   meta = {
-    description = "XBoard - a chess board compatible with GNU Chess";
+    inherit (s) version;
+    description = ''GUI for chess engines'';
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl3Plus;
   };
 }
diff --git a/pkgs/games/xboard/default.upstream b/pkgs/games/xboard/default.upstream
new file mode 100644
index 00000000000..1e649bba505
--- /dev/null
+++ b/pkgs/games/xboard/default.upstream
@@ -0,0 +1 @@
+url http://ftp.gnu.org/gnu/xboard/
diff --git a/pkgs/games/xboard/src-for-default.nix b/pkgs/games/xboard/src-for-default.nix
deleted file mode 100644
index d648dfe5abb..00000000000
--- a/pkgs/games/xboard/src-for-default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-rec {
-   version="4.4.2";
-   name="xboard-4.4.2";
-   hash="1ihg39nnwp90w410rzwxj9layadavz08gc9m2b1jg5z5c6ky28zp";
-   url="http://ftp.gnu.org/gnu/xboard/xboard-${version}.tar.gz";
-   advertisedUrl="http://ftp.gnu.org/gnu/xboard/xboard-4.4.2.tar.gz";
-  
-  
-}
diff --git a/pkgs/games/xboard/src-info-for-default.nix b/pkgs/games/xboard/src-info-for-default.nix
deleted file mode 100644
index 8d0386671a1..00000000000
--- a/pkgs/games/xboard/src-info-for-default.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  downloadPage = "http://ftp.gnu.org/gnu/xboard/?C=T,M;O=D";
-  baseName = "xboard";
-}
diff --git a/pkgs/games/xmoto/default.nix b/pkgs/games/xmoto/default.nix
index 229d58029de..ed37227bb03 100644
--- a/pkgs/games/xmoto/default.nix
+++ b/pkgs/games/xmoto/default.nix
@@ -15,9 +15,7 @@ rec {
   configureFlags = [];
 
   /* doConfigure should be removed if not needed */
-  phaseNames = [ "doPatch" "doConfigure" "doMakeInstall"];
-
-  patches = [ ./r3402.patch ];
+  phaseNames = [ "doConfigure" "doMakeInstall"];
 
   meta = {
     description = "X-Moto - obstacled race game";
diff --git a/pkgs/games/xmoto/r3402.patch b/pkgs/games/xmoto/r3402.patch
deleted file mode 100644
index 787e5625b5f..00000000000
--- a/pkgs/games/xmoto/r3402.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Index: a/src/image/tim_png.cpp
-===================================================================
---- a/src/image/tim_png.cpp	(revision 3401)
-+++ b/src/image/tim_png.cpp	(revision 3402)
-@@ -25,7 +25,8 @@
- #include <stdio.h>
- #include <string.h>
- #include "tim.h"
--#include "png.h"
-+#include <png.h>
-+#include <zlib.h>
- 
- /*==============================================================================
- Types
-Index: ChangeLog
-===================================================================
---- a/ChangeLog	(revision 3401)
-+++ b/ChangeLog	(revision 3402)
-@@ -1,3 +1,7 @@
-+X-Moto 0.5.10 2012-
-+--------------------------------
-+ * libpng patch by Kelly Anderson
-+
- X-Moto 0.5.9 2011-11-13
- --------------------------------
-  * fix a compilation error with libxml
diff --git a/pkgs/games/xmoto/src-for-default.nix b/pkgs/games/xmoto/src-for-default.nix
index 7d85cdbe528..60de24e16c7 100644
--- a/pkgs/games/xmoto/src-for-default.nix
+++ b/pkgs/games/xmoto/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="0.5.9";
-   name="xmoto-0.5.9";
-   hash="1r1kl3w2scncw754lgsfa7i6hh4mg39zc3bcvd1iqcmdfr25gmvl";
+   version="0.5.10";
+   name="xmoto-0.5.10";
+   hash="07lyvwb8v75hzp4iqvnxzabzrmwkd3ignfzpm4dgr9asd3j3h91d";
    url="http://download.tuxfamily.org/xmoto/xmoto/${version}/xmoto-${version}-src.tar.gz";
-   advertisedUrl="http://download.tuxfamily.org/xmoto/xmoto/0.5.9/xmoto-0.5.9-src.tar.gz";
+   advertisedUrl="http://download.tuxfamily.org/xmoto/xmoto/0.5.10/xmoto-0.5.10-src.tar.gz";
   
   
 }
diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix
index 3553649dccb..957d7b2c7f4 100644
--- a/pkgs/games/xonotic/default.nix
+++ b/pkgs/games/xonotic/default.nix
@@ -1,29 +1,37 @@
 { stdenv, fetchurl, unzip, SDL, libjpeg, zlib, libvorbis, curl }:
+
 stdenv.mkDerivation rec {
   name = "xonotic-0.5.0";
+
   src = fetchurl {
     url = "http://dl.xonotic.org/${name}.zip";
     sha256 = "03vkbddffnz6ws3gkwc3qvi6icfsyiqq0dqw2vw5hj2kidm25rsq";
   };
+
   # Commented out things needed to build cl-release because of errors.
   #buildInputs = [ libX11 libXpm libXext xf86dgaproto libXxf86dga libXxf86vm mesa ];
   buildInputs = [ unzip SDL libjpeg ];
+
   sourceRoot = "Xonotic/source/darkplaces";
+
   #patchPhase = ''
   #  substituteInPlace glquake.h \
   #    --replace 'typedef char GLchar;' '/*typedef char GLchar;*/'
   #'';
-  NIX_LDFLAGS="
+
+  NIX_LDFLAGS = ''
     -rpath ${zlib}/lib
     -rpath ${libvorbis}/lib
     -rpath ${curl}/lib
-  ";
+  '';
+
   buildPhase = ''
     DP_FS_BASEDIR="$out/share/xonotic"
     #make DP_FS_BASEDIR=$DP_FS_BASEDIR cl-release
     make DP_FS_BASEDIR=$DP_FS_BASEDIR sdl-release
     make DP_FS_BASEDIR=$DP_FS_BASEDIR sv-release
   '';
+
   installPhase = ''
     mkdir -p "$out/bin"
     cp darkplaces-dedicated "$out/bin/xonotic-dedicated"
@@ -32,7 +40,9 @@ stdenv.mkDerivation rec {
     mkdir -p "$out/share/xonotic"
     mv data "$out/share/xonotic"
   '';
+
   dontPatchELF = true;
+
   meta = {
     description = "A free fast-paced first-person shooter";
     longDescription = ''
@@ -46,6 +56,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.xonotic.org;
     license = with stdenv.lib.licenses; gpl2Plus;
     maintainers = with stdenv.lib.maintainers; [ astsmtl ];
-    platforms = with stdenv.lib.platforms; linux;
+    #platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/games/xsokoban/default.nix b/pkgs/games/xsokoban/default.nix
index b8917b4d41c..b8c6096b756 100644
--- a/pkgs/games/xsokoban/default.nix
+++ b/pkgs/games/xsokoban/default.nix
@@ -20,6 +20,7 @@ rec {
   phaseNames = ["preConfigure" "doConfigure" "preBuild" "doMakeInstall"];
 
   preConfigure = a.fullDepEntry (''
+    sed -e 's/getline/my_getline/' -i score.c
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${a.libXpm}/include/X11"
     for i in  $NIX_CFLAGS_COMPILE; do echo $i; ls ''${i#-I}; done
     chmod a+rw config.h
@@ -28,8 +29,8 @@ rec {
     echo '#define OWNER "'$(whoami)'"' >> config.h
     echo '#define ROOTDIR "'$out/lib/xsokoban'"' >> config.h
     echo '#define ANYLEVEL 1' >> config.h
-    echo '#define SCOREFILE "/tmp/.xsokoban-score"' >> config.h
-    echo '#define LOCKFILE "/tmp/.xsokoban-score-lock"' >> config.h
+    echo '#define SCOREFILE ".xsokoban-score"' >> config.h
+    echo '#define LOCKFILE ".xsokoban-score-lock"' >> config.h
 
     sed -e 's/getpass[(][^)]*[)]/PASSWORD/' -i main.c
     sed -e '/if [(]owner[)]/iowner=1;' -i main.c
diff --git a/pkgs/games/zdoom/default.nix b/pkgs/games/zdoom/default.nix
index 4bf8c526f58..59a88191d2e 100644
--- a/pkgs/games/zdoom/default.nix
+++ b/pkgs/games/zdoom/default.nix
@@ -1,11 +1,19 @@
-{stdenv, fetchsvn, cmake, SDL, nasm, p7zip, zlib, flac, fmod, libjpeg}:
+{stdenv, fetchurl, cmake, SDL, nasm, p7zip, zlib, flac, fmod, libjpeg}:
 
 stdenv.mkDerivation {
-  name = "zdoom-svn-1424";
-  src = fetchsvn {
-    url = http://mancubus.net/svn/hosted/zdoom/zdoom/trunk;
-    rev = 1424;
+  name = "zdoom-2.6.1";
+  src = fetchurl {
+    url = http://zdoom.org/files/zdoom/2.6/zdoom-2.6.1-src.7z;
+    sha256 = "1ha7hygwf243vkgw0dfh4dxphf5vffb3kkci1p1p75a7r1g1bir8";
   };
+
+  # XXX: shouldn't inclusion of p7zip handle this?
+  unpackPhase = ''
+  mkdir zdoom
+  cd zdoom
+  7z x $src
+  '';
+
   buildInputs = [cmake nasm SDL p7zip zlib flac fmod libjpeg];
 
   cmakeFlags = [ "-DSDL_INCLUDE_DIR=${SDL}/include/SDL" ];
diff --git a/pkgs/games/zoom/default.nix b/pkgs/games/zoom/default.nix
index 1ca39ebc73b..fdf3aa91e2b 100644
--- a/pkgs/games/zoom/default.nix
+++ b/pkgs/games/zoom/default.nix
@@ -3,11 +3,11 @@
 # !!! assert freetype == xlibs.freetype
 
 stdenv.mkDerivation {
-  name = "zoom-1.0.2alpha1";
+  name = "zoom-1.1.5";
   
   src = fetchurl {
-    url = http://www.logicalshift.demon.co.uk/unix/zoom/zoom-1.0.2alpha1.tar.gz;
-    md5 = "91b2fe444028178aa3b23bd0e3ae1a61";
+    url = http://www.logicalshift.co.uk/unix/zoom/zoom-1.1.5.tar.gz;
+    sha256 = "1g6van7f7sg3zfcz80mncnnbccyg2hnm0hq4x558vpsm0lf7z5pj";
   };
   
   buildInputs = [perl expat x11 freetype];
diff --git a/pkgs/lib/attrsets.nix b/pkgs/lib/attrsets.nix
index de6eccbec1f..f562a2f7df4 100644
--- a/pkgs/lib/attrsets.nix
+++ b/pkgs/lib/attrsets.nix
@@ -5,7 +5,8 @@ with {
   inherit (import ./trivial.nix) or;
   inherit (import ./default.nix) fold;
   inherit (import ./strings.nix) concatStringsSep;
-  inherit (import ./lists.nix) concatMap concatLists;
+  inherit (import ./lists.nix) concatMap concatLists all deepSeqList;
+  inherit (import ./misc.nix) maybeAttr;
 };
 
 rec {
@@ -23,7 +24,7 @@ rec {
       then attrByPath (tail attrPath) default (getAttr attr e)
       else default;
 
-      
+
   /* Return nested attribute set in which an attribute is set.  For instance
      ["x" "y"] applied with some value v returns `x.y = v;' */
   setAttrByPath = attrPath: value:
@@ -36,7 +37,7 @@ rec {
   getAttrFromPath = attrPath: set:
     let errorMsg = "cannot find attribute `" + concatStringsSep "." attrPath + "'";
     in attrByPath attrPath (abort errorMsg) set;
-      
+
 
   /* Return the specified attributes from a set.
 
@@ -79,6 +80,18 @@ rec {
     listToAttrs (fold (n: ys: let v = getAttr n set; in if pred n v then [(nameValuePair n v)] ++ ys else ys) [] (attrNames set));
 
 
+  /* foldAttrs: apply fold functions to values grouped by key. Eg accumulate values as list:
+     foldAttrs (n: a: [n] ++ a) [] [{ a = 2; } { a = 3; }]
+     => { a = [ 2 3 ]; }
+  */
+  foldAttrs = op: nul: list_of_attrs:
+    fold (n: a:
+        fold (name: o:
+          o // (listToAttrs [{inherit name; value = op (getAttr name n) (maybeAttr name nul a); }])
+        ) a (attrNames n)
+    ) {} list_of_attrs;
+
+
   /* Recursively collect sets that verify a given predicate named `pred'
      from the set `attrs'.  The recursion is stopped when the predicate is
      verified.
@@ -108,7 +121,7 @@ rec {
      builtins.listToAttrs. */
   nameValuePair = name: value: { inherit name value; };
 
-  
+
   /* Apply a function to each element in an attribute set.  The
      function takes two arguments --- the attribute name and its value
      --- and returns the new value for the attribute.  The result is a
@@ -126,7 +139,7 @@ rec {
   /* Like `mapAttrs', but allows the name of each attribute to be
      changed in addition to the value.  The applied function should
      return both the new name and value as a `nameValuePair'.
-     
+
      Example:
        mapAttrs' (name: value: nameValuePair ("foo_" + name) ("bar-" + value))
           { x = "a"; y = "b"; }
@@ -134,11 +147,11 @@ rec {
   */
   mapAttrs' = f: set:
     listToAttrs (map (attr: f attr (getAttr attr set)) (attrNames set));
-        
+
 
   /* Call a function for each attribute in the given set and return
      the result in a list.
-  
+
      Example:
        mapAttrsToList (name: value: name + value)
           { x = "a"; y = "b"; }
@@ -146,7 +159,7 @@ rec {
   */
   mapAttrsToList = f: attrs:
     map (name: f name (getAttr name attrs)) (attrNames attrs);
-    
+
 
   /* Like `mapAttrs', except that it recursively applies itself to
      attribute sets.  Also, the first argument of the argument
@@ -163,7 +176,7 @@ rec {
   */
   mapAttrsRecursive = mapAttrsRecursiveCond (as: true);
 
-  
+
   /* Like `mapAttrsRecursive', but it takes an additional predicate
      function that tells it whether to recursive into an attribute
      set.  If it returns false, `mapAttrsRecursiveCond' does not
@@ -181,7 +194,7 @@ rec {
          (as: !(as ? "type" && as.type == "derivation"))
          (x: ... do something ...)
          attrs
-     */
+  */
   mapAttrsRecursiveCond = cond: f: set:
     let
       recurse = path: set:
@@ -195,6 +208,17 @@ rec {
     in recurse [] set;
 
 
+  /* Generate an attribute set by mapping a function over a list of
+     attribute names.
+
+     Example:
+       genAttrs [ "foo" "bar" ] (name: "x_" + name)
+       => { foo = "x_foo"; bar = "x_bar"; }
+  */
+  genAttrs = names: f:
+    listToAttrs (map (n: nameValuePair n (f n)) names);
+
+
   /* Check whether the argument is a derivation. */
   isDerivation = x: isAttrs x && x ? type && x.type == "derivation";
 
@@ -247,7 +271,7 @@ rec {
 
        returns: {
          foo.bar = 1; # 'foo.*' from the second set
-         foo.quz = 2; # 
+         foo.quz = 2; #
          bar = 3;     # 'bar' from the first set
          baz = 4;     # 'baz' from the second set
        }
@@ -264,9 +288,9 @@ rec {
       );
     in f [] [rhs lhs];
 
-  /* Does the same as the update operator '//' and keep siblings attribute.
-     This recusion stop when one of the attribute value is not an attribute
-     set, in which case the right hand side value takes precedence over the
+  /* A recursive variant of the update operator ‘//’.  The recusion
+     stops when one of the attribute values is not an attribute set,
+     in which case the right hand side value takes precedence over the
      left hand side value.
 
      Example:
@@ -301,4 +325,5 @@ rec {
   overrideExisting = old: new:
     old // listToAttrs (map (attr: nameValuePair attr (attrByPath [attr] (getAttr attr old) new)) (attrNames old));
 
+  deepSeqAttrs = x: y: deepSeqList (attrValues x) y;
 }
diff --git a/pkgs/lib/customisation.nix b/pkgs/lib/customisation.nix
index 54965ffb580..bfa61169efb 100644
--- a/pkgs/lib/customisation.nix
+++ b/pkgs/lib/customisation.nix
@@ -33,23 +33,20 @@ rec {
      
   overrideDerivation = drv: f:
     let
-      # Filter out special attributes.
-      drop = [ "meta" "passthru" "outPath" "drvPath" "hostDrv" "buildDrv" "type" "override" "deepOverride" "origArgs" "drvAttrs" "outputName" "all" "out" ]
-              # also drop functions such as .merge .override etc
-             ++ lib.filter (n: isFunction (getAttr n drv)) (attrNames drv);
-      attrs = removeAttrs drv drop;
-      newDrv = derivation (attrs // (f drv));
-    in newDrv //
-      { meta = if drv ? meta then drv.meta else {};
+      newDrv = derivation (drv.drvAttrs // (f drv));
+    in addPassthru newDrv (
+      { meta = drv.meta or {};
         passthru = if drv ? passthru then drv.passthru else {};
       }
       //
-      (if (drv ? hostDrv && drv ? buildDrv)
+      (drv.passthru or {})
+      //
+      (if (drv ? crossDrv && drv ? nativeDrv)
        then {
-         hostDrv = overrideDerivation drv.hostDrv f;
-         buildDrv = overrideDerivation drv.buildDrv f;
+         crossDrv = overrideDerivation drv.crossDrv f;
+         nativeDrv = overrideDerivation drv.nativeDrv f;
        }
-       else { });
+       else { }));
 
 
   # usage: (you can use override multiple times)
@@ -99,4 +96,21 @@ rec {
     let f = if builtins.isFunction fn then fn else import fn; in
     makeOverridable f ((builtins.intersectAttrs (builtins.functionArgs f) autoArgs) // args);
 
+  /* Add attributes to each output of a derivation without changing the derivation itself */
+  addPassthru = drv: passthru:
+    let
+      outputs = drv.outputs or [ "out" ];
+
+      commonAttrs = drv // (builtins.listToAttrs outputsList) //
+        ({ all = map (x: x.value) outputsList; }) // passthru;
+
+      outputToAttrListElement = outputName:
+        { name = outputName;
+          value = commonAttrs // {
+            inherit (builtins.getAttr outputName drv) outPath drvPath type outputName;
+          };
+        };
+
+      outputsList = map outputToAttrListElement outputs;
+  in builtins.getAttr drv.outputName commonAttrs;
 }
diff --git a/pkgs/lib/debug.nix b/pkgs/lib/debug.nix
index b78f946c5d4..d627bc861ab 100644
--- a/pkgs/lib/debug.nix
+++ b/pkgs/lib/debug.nix
@@ -95,7 +95,7 @@ rec {
           else if isInt x then true
           else if x == null then true
           else true; # a (store) path?
-    in if (traverse x) then x else throw "else never reached";
+    in if traverse x then x else throw "else never reached";
 
   # example: (traceCallXml "myfun" id 3) will output something like
   # calling myfun arg 1: 3 result: 3
diff --git a/pkgs/lib/licenses.nix b/pkgs/lib/licenses.nix
index dc88f887cc7..89edcd738f4 100644
--- a/pkgs/lib/licenses.nix
+++ b/pkgs/lib/licenses.nix
@@ -4,12 +4,24 @@
    * add it to this list. The URL mentioned above is a good source for inspiration.
    */
 
+  agpl3 = {
+    shortName = "AGPLv3";
+    fullName = "GNU Affero General Public License version 3 only";
+    url = https://www.gnu.org/licenses/agpl.html;
+  };
+
+  agpl3Plus = {
+    shortName = "AGPLv3+";
+    fullName = "GNU Affero General Public License version 3 or later";
+    url = https://www.gnu.org/licenses/agpl.html;
+  };
+
   asl20 = {
     shortName = "ASL2.0";
     fullName = "Apache Software License 2.0";
     url = http://www.apache.org/licenses/LICENSE-2.0;
   };
-  
+
   boost = {
     shortName = "boost";
     fullName = "Boost Software License";
@@ -19,13 +31,13 @@
   bsd2 = {
     shortName = "BSD-2";
     fullName = "BSD license (2 clause)";
-    url = http://www.freebsd.org/copyright/freebsd-license.html;
+    url = http://opensource.org/licenses/BSD-2-Clause;
   };
 
   bsd3 = {
     shortName = "BSD-3";
     fullName = "BSD license (3 clause)";
-    url = http://www.opensource.org/licenses/bsd-license.php;
+    url = http://opensource.org/licenses/BSD-3-Clause;
   };
 
   bsdOriginal = {
@@ -34,6 +46,12 @@
     url = https://fedoraproject.org/wiki/Licensing/BSD;
   };
 
+  cddl = {
+    shortName = "CDDL";
+    fullName = "Common Development Distribution License ";
+    url = http://www.opensolaris.org/os/licensing/cddllicense.txt;
+  };
+
   cpl10 = {
     shortName = "CPL 1.0";
     fullName = "Common Public License version 1.0";
@@ -51,13 +69,13 @@
     fullName = "GNU General Public License version 2 only";
     url = http://www.gnu.org/licenses/old-licenses/gpl-2.0.html;
   };
-    
+
   gpl2Oss = {
     shortName = "GPLv2+OSS";
     fullName = "GNU General Public License version 2 only (with OSI approved licenses linking exception)";
     url = http://www.mysql.com/about/legal/licensing/foss-exception;
   };
-  
+
   gpl2Plus = {
     shortName = "GPLv2+";
     fullName = "GNU General Public License version 2 or later";
@@ -69,7 +87,7 @@
     fullName = "GNU General Public License version 3 only";
     url = http://www.fsf.org/licensing/licenses/gpl.html;
   };
-  
+
   gpl3Plus = {
     shortName = "GPLv3+";
     fullName = "GNU General Public License version 3 or later";
@@ -105,80 +123,99 @@
     fullName = "libtiff license";
     url = https://fedoraproject.org/wiki/Licensing/libtiff;
   };
-  
+
   lgpl2 = {
     shortName = "LGPLv2";
     fullName = "GNU Library General Public License version 2";
     url = http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html;
   };
-  
+
   lgpl2Plus = {
     shortName = "LGPLv2+";
     fullName = "GNU Library General Public License version 2 or later";
     url = http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html;
   };
-  
+
   lgpl21 = {
     shortName = "LGPLv2.1";
     fullName = "GNU Lesser General Public License version 2.1 only";
     url = http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html;
   };
-  
+
   lgpl21Plus = {
     shortName = "LGPLv2.1+";
     fullName = "GNU Lesser General Public License version 2.1 or later";
     url = http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html;
   };
-  
+
   lgpl3 = {
     shortName = "LGPLv3";
     fullName = "GNU Lesser General Public License version 3 only";
     url = http://www.fsf.org/licensing/licenses/lgpl.html;
   };
-  
+
   lgpl3Plus = {
     shortName = "LGPLv3+";
     fullName = "GNU Lesser General Public License version 3 or later";
     url = http://www.fsf.org/licensing/licenses/lgpl.html;
   };
-  
+
   mit = {
     shortName = "MIT";
     fullName = "MIT/X11 license";
     url = http://www.opensource.org/licenses/mit-license.php;
   };
-  
+
   mpl11 = {
     shortName = "MPL1.1";
     fullName = "Mozilla Public License version 1.1";
     url = http://www.mozilla.org/MPL/MPL-1.1.html;
   };
-  
+
   openssl = {
     shortName = "openssl";
     fullName = "OpenSSL license";
     url = http://www.openssl.org/source/license.html;
   };
-  
+
   publicDomain = {
     shortName = "Public Domain";
     fullname = "Public Domain";
   };
-  
+
   psfl = {
     shortName = "PSFL";
     fullName = "Python Software Foundation License";
     url = http://docs.python.org/license.html;
   };
 
-  proprietary = {
-    shortName = "Proprietary";
-    fullName = "Proprietary (non redistributable) license";
+  tcltk = {
+    shortName = "Tcl/Tk";
+    fullName = "Tcl/Tk license";
+    url = http://www.tcl.tk/software/tcltk/license.html;
   };
-  
+
+  unfree = "unfree";
+
+  unfreeRedistributable = "unfree-redistributable";
+
+  unfreeRedistributableFirmware = "unfree-redistributable-firmware";
+
   zlib = {
     shortName = "zlib";
     fullName = "zlib license";
     url = http://www.gzip.org/zlib/zlib_license.html;
   };
+
+  zpt20 = {
+    shortName = "ZPT2.0";
+    fullName = "Zope Public License 2.0";
+    url = "http://old.zope.org/Resources/License/ZPL-2.0";
+  };
+
+  zpt21 = {
+    shortName = "ZPT2.1";
+    fullName = "Zope Public License 2.1";
+    url = "http://old.zope.org/Resources/License/ZPL-2.1";
+  };
 }
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix
index b9eba9ab478..3c01b165fc1 100644
--- a/pkgs/lib/lists.nix
+++ b/pkgs/lib/lists.nix
@@ -1,4 +1,7 @@
 # General list operations.
+with {
+  inherit (import ./trivial.nix) deepSeq;
+};
 
 rec {
   inherit (builtins) head tail length isList add sub lessThan;
@@ -89,10 +92,6 @@ rec {
   remove = e: filter (x: x != e);
 
   
-  # Given two lists, removes all elements of the first list from the second list
-  removeList = l: filter (x: elem x l);
-
-
   # Return true if `list' has an element `x'.
   elem =
     builtins.elem or
@@ -190,7 +189,7 @@ rec {
         else let
           part = partition (strictLess (head l)) (tail l);
         in
-          qs part.wrong ([(head l)] ++ qs part.right []);
+          qs part.wrong ([(head l)] ++ qs part.right concat);
     in
       qs list [];
 
@@ -220,4 +219,5 @@ rec {
       ++ zipTwoLists (tail xs) (tail ys)
     else [];
 
+  deepSeqList = xs: y: if any (x: deepSeq x false) xs then y else y;
 }
diff --git a/pkgs/lib/maintainers.nix b/pkgs/lib/maintainers.nix
index 127295a2feb..e861203fb15 100644
--- a/pkgs/lib/maintainers.nix
+++ b/pkgs/lib/maintainers.nix
@@ -10,21 +10,28 @@
   andres = "Andres Loeh <ksnixos@andres-loeh.de>";
   antono = "Antono Vasiljev <self@antono.info>";
   astsmtl = "Alexander Tsamutali <astsmtl@yandex.ru>";
+  aszlig = "aszlig <aszlig@redmoonstudios.org>";
+  bbenoist = "Baptist BENOIST <return_0@live.com>";
   bjg = "Brian Gough <bjg@gnu.org>";
+  bjornfor = "Bjørn Forsman <bjorn.forsman@gmail.com>";
   bluescreen303 = "Mathijs Kwik <mathijs@bluescreen303.nl>";
   chaoflow = "Florian Friesdorf <flo@chaoflow.net>";
   coconnor = "Corey O'Connor <coreyoconnor@gmail.com>";
-  eelco = "Eelco Dolstra <e.dolstra@tudelft.nl>";
+  eelco = "Eelco Dolstra <eelco.dolstra@logicblox.com>";
   garbas = "Rok Garbas <rok@garbas.si>";
   goibhniu = "Cillian de Róiste <cillian.deroiste@gmail.com>";
   guibert = "David Guibert <david.guibert@gmail.com>";
+  iElectric = "Domen Kozar <domen@dev.si>";
+  jcumming = "Jack Cummings <jack@mudshark.org>";
   kkallio = "Karn Kallio <tierpluspluslists@gmail.com>";
   ludo = "Ludovic Courtès <ludo@gnu.org>";
   marcweber = "Marc Weber <marco-oweber@gmx.de>";
   mornfall = "Petr RoÄkai <me@mornfall.net>";
   neznalek = "Vladimír Čunát <vcunat@gmail.com>";
+  offline = "Jaka Hudoklin <jakahudoklin@gmail.com>";
+  orbitz = "Malcolm Matalka <mmatalka@gmail.com>";
   page = "Carles Pagès <page@cubata.homelinux.net>";
-  phreedom = "Evgeny Egorochkin <phreedom.stdin@gmail.com>";
+  phreedom = "Evgeny Egorochkin <phreedom@yandex.ru>";
   pierron = "Nicolas B. Pierron <nixos@nbp.name>";
   piotr = "Piotr Pietraszkiewicz <ppietrasa@gmail.com>";
   qknight = "Joachim Schiele <js@lastlog.de>";
@@ -35,7 +42,9 @@
   sander = "Sander van der Burg <s.vanderburg@tudelft.nl>";
   shlevy = "Shea Levy <shea@shealevy.com>";
   simons = "Peter Simons <simons@cryp.to>";
+  smironov = "Sergey Mironov <ierton@gmail.com>";
   thammers = "Tobias Hammerschmidt <jawr@gmx.de>";
+  the-kenny = "Moritz Ulrich <moritz@tarn-vedra.de>";
   urkud = "Yury G. Kudryashov <urkud+nix@ya.ru>";
   viric = "Lluís Batlle i Rossell <viric@viric.name>";
   winden = "Antonio Vargas Gonzalez <windenntw@gmail.com>";
diff --git a/pkgs/lib/meta.nix b/pkgs/lib/meta.nix
index 0c5841dd717..a5afce9e0cb 100644
--- a/pkgs/lib/meta.nix
+++ b/pkgs/lib/meta.nix
@@ -43,6 +43,6 @@ rec {
   /* Increase the nix-env priority of the package, i.e., this
      version/variant of the package will be preferred.
   */
-  hiPrio = drv: addMetaAttrs { priority = "110"; } drv;
+  hiPrio = drv: addMetaAttrs { priority = "-10"; } drv;
   
 }
diff --git a/pkgs/lib/misc.nix b/pkgs/lib/misc.nix
index 39a3ad258b0..0f4c0d0de95 100644
--- a/pkgs/lib/misc.nix
+++ b/pkgs/lib/misc.nix
@@ -53,7 +53,7 @@ rec {
           f :        # the function applied to the arguments
           initial :  # you pass attrs, the functions below are passing a function taking the fix argument
     let
-        takeFixed = if (isFunction initial) then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
+        takeFixed = if isFunction initial then initial else (fixed : initial); # transform initial to an expression always taking the fixed argument
         tidy = args : 
             let # apply all functions given in "applyPreTidy" in sequence
                 applyPreTidyFun = fold ( n : a : x : n ( a x ) ) lib.id (maybeAttr "applyPreTidy" [] args);
@@ -106,11 +106,11 @@ rec {
   # shortcut for attrByPath ["name"] default attrs
   maybeAttrNullable = name: default: attrs:
     if attrs == null then default else 
-    if (__hasAttr name attrs) then (__getAttr name attrs) else default;
+    if __hasAttr name attrs then (__getAttr name attrs) else default;
 
   # shortcut for attrByPath ["name"] default attrs
   maybeAttr = name: default: attrs:
-    if (__hasAttr name attrs) then (__getAttr name attrs) else default;
+    if __hasAttr name attrs then (__getAttr name attrs) else default;
 
 
   # Return the second argument if the first one is true or the empty version
@@ -120,14 +120,14 @@ rec {
     else if builtins.isList val then []
     else if builtins.isAttrs val then {}
     # else if builtins.isString val then ""
-    else if (val == true || val == false) then false
+    else if val == true || val == false then false
     else null;
 
     
   # Return true only if there is an attribute and it is true.
   checkFlag = attrSet: name:
-        if (name == "true") then true else
-        if (name == "false") then false else
+        if name == "true" then true else
+        if name == "false" then false else
         if (elem name (attrByPath ["flags"] [] attrSet)) then true else
         attrByPath [name] false attrSet ;
 
@@ -170,7 +170,7 @@ rec {
 
   uniqListExt = {inputList, outputList ? [],
     getter ? (x : x), compare ? (x: y: x==y)}:
-        if (inputList == []) then outputList else
+        if inputList == [] then outputList else
         let x=head inputList; 
         isX = y: (compare (getter y) (getter x));
         newOutputList = outputList ++
@@ -226,7 +226,7 @@ rec {
                  in innerClosePropagation
                       acc'
                       (uniqList { inputList = (maybeAttrNullable "propagatedBuildInputs" [] y)
-                                           ++ (maybeAttrNullable "propagatedBuildNativeInputs" [] y)
+                                           ++ (maybeAttrNullable "propagatedNativeBuildInputs" [] y)
                                            ++ ys;
                                   acc = acc';
                                 }
@@ -315,9 +315,48 @@ rec {
       )
     ];
   mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
+  # merge attrs based on version key into mkDerivation args, see mergeAttrBy to learn about smart merge defaults
+  #
+  # This function is best explained by an example:
+  #
+  #     {version ? "2.x"} :
+  #
+  #     mkDerivation (mergeAttrsByVersion "package-name" version 
+  #       { # version specific settings
+  #         "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool];  };
+  #         "2.x" = { src = ..; };
+  #       }
+  #       {  // shared settings
+  #          buildInputs = [ common build inputs ];
+  #          meta = { .. }
+  #       }
+  #     )
+  #
+  # Please note that e.g. Eelco Dolstra usually prefers having one file for
+  # each version. On the other hand there are valuable additional design goals
+  #  - readability
+  #  - do it once only
+  #  - try to avoid duplication
+  #
+  # Marc Weber and Michael Raskin sometimes prefer keeping older
+  # versions around for testing and regression tests - as long as its cheap to
+  # do so.
+  #
+  # Very often it just happens that the "shared" code is the bigger part.
+  # Then using this function might be appropriate.
+  #
+  # Be aware that its easy to cause recompilations in all versions when using
+  # this function - also if derivations get too complex splitting into multiple
+  # files is the way to go.
+  #
+  # See misc.nix -> versionedDerivation
+  # discussion: nixpkgs: pull/310
+  mergeAttrsByVersion = name: version: attrsByVersion: base:
+    mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];
+
   # sane defaults (same name as attr name so that inherit can be used)
   mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
-    listToAttrs (map (n : nameValuePair n lib.concat) [ "buildNativeInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" ])
+    listToAttrs (map (n : nameValuePair n lib.concat) [ "nativeBuildInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" ])
     // listToAttrs (map (n : nameValuePair n lib.mergeAttrs) [ "passthru" "meta" "cfg" "flags" ])
     // listToAttrs (map (n : nameValuePair n (a: b: "${a}\n${b}") ) [ "preConfigure" "postInstall" ])
   ;
@@ -362,7 +401,7 @@ rec {
         cfgWithDefaults = (listToAttrs (map (n : nameValuePair (flagName n) false) (attrNames args2.flags)))
                           // args2.cfg;
         opts = attrValues (mapAttrs (a : v :
-                let v2 = if (v ? set || v ? unset) then v else { set = v; };
+                let v2 = if v ? set || v ? unset then v else { set = v; };
                     n = if (getAttr (flagName a) cfgWithDefaults) then "set" else "unset";
                     attr = maybeAttr n {} v2; in
                 if (maybeAttr "assertion" true attr)
diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix
index 25cb956a0ea..286178a0fa7 100644
--- a/pkgs/lib/modules.nix
+++ b/pkgs/lib/modules.nix
@@ -21,22 +21,26 @@ rec {
   || builtins.isList x
   );
 
+
   importIfPath = path:
     if isPath path then
       import path
     else
       path;
 
+
   applyIfFunction = f: arg:
     if builtins.isFunction f then
       f arg
     else
       f;
 
+
   isModule = m:
        (m ? config && isAttrs m.config && ! isOption m.config)
     || (m ? options && isAttrs m.options && ! isOption m.options);
 
+
   # Convert module to a set which has imports / options and config
   # attributes.
   unifyModuleSyntax = m:
@@ -88,8 +92,7 @@ rec {
           # used by generic closure to avoid duplicated imports.
           key =
             if isPath m then m
-            else if m' ? key then m'.key
-            else newModuleName origin index;
+            else m'.key or (newModuleName origin index);
         };
 
       getImports = m: m.imports or [];
@@ -107,15 +110,6 @@ rec {
         operator = m: imap (moduleImport m) (getImports m);
       });
 
-  selectDeclsAndDefs = modules:
-    lib.concatMap (m:
-      if m ? config || m ? options then
-         [ (m.options or {}) ]
-      ++ [ (m.config or {}) ]
-      else
-        [ m ]
-    ) modules;
-
 
   moduleApply = funs: module:
     lib.mapAttrs (name: value:
@@ -126,6 +120,7 @@ rec {
         value
     ) module;
 
+
   # Handle mkMerge function left behind after a delay property.
   moduleFlattenMerge = module:
     if module ? config &&
@@ -137,6 +132,7 @@ rec {
     else
       [ module ];
 
+
   # Handle mkMerge attributes which are left behind by previous delay
   # properties and convert them into a list of modules. Delay properties
   # inside the config attribute of a module and create a second module if a
@@ -146,8 +142,9 @@ rec {
   delayModule = module:
     map (moduleApply { config = delayProperties; }) (moduleFlattenMerge module);
 
+
   evalDefinitions = opt: values:
-    if opt ? type && opt.type.delayOnGlobalEval then
+    if opt.type.delayOnGlobalEval or false then
       map (delayPropertiesWithIter opt.type.iter opt.name)
         (evalLocalProperties values)
     else
@@ -171,17 +168,20 @@ rec {
       map (selectModule name) modules
     );
 
+
   modulesNames = modules:
     lib.concatMap (m: []
     ++ optionals (m ? options) (lib.attrNames m.options)
     ++ optionals (m ? config) (lib.attrNames m.config)
     ) modules;
 
+
   moduleZip = funs: modules:
     lib.mapAttrs (name: fun:
       fun (catAttrs name modules)
     ) funs;
 
+
   moduleMerge = path: modules:
     let modules_ = modules; in
     let
@@ -234,7 +234,6 @@ rec {
               source = m.key;
             }) declarations;
 
-
           hasOptions = values != [];
           isOption = any lib.isOption values;
 
@@ -303,8 +302,7 @@ rec {
               let opt = option.decl; in
               opt.apply (
                 if isNotDefined then
-                  if opt ? default then opt.default
-                  else throw "Not defined."
+                  opt.default or (throw "Not defined.")
                 else opt.merge defs
               )
             );
@@ -342,16 +340,16 @@ rec {
 
   fixMergeModules = initModules: {...}@args:
     lib.fix (result:
-      # This trick avoid an infinite loop because names of attribute are
-      # know and it is not require to evaluate the result of moduleMerge to
-      # know which attribute are present as argument.
+      # This trick avoids an infinite loop because names of attribute
+      # are know and it is not required to evaluate the result of
+      # moduleMerge to know which attributes are present as arguments.
       let module = { inherit (result) options config; }; in
-
       moduleMerge "" (
         moduleClosure initModules (module // args)
       )
     );
 
+
   # Visit all definitions to raise errors related to undeclared options.
   checkModule = path: {config, options, ...}@m:
     let
diff --git a/pkgs/lib/options.nix b/pkgs/lib/options.nix
index 59bda41a623..3a8cc0006ef 100644
--- a/pkgs/lib/options.nix
+++ b/pkgs/lib/options.nix
@@ -90,10 +90,17 @@ rec {
             # Evaluate sub-modules.
             subModuleMerge = path: vals:
               lib.fix (args:
-                let result = recurseInto path (optionConfig vals args); in {
-                  inherit (result) config options;
+                let
+                  result = recurseInto path (optionConfig vals args);
                   name = lib.removePrefix (opt.name + ".") path;
-                }
+                  extraArgs = opt.extraArgs or {};
+                  individualExtraArgs = opt.individualExtraArgs or {};
+                in {
+                  inherit (result) config options;
+                  inherit name;
+                } //
+                  (opt.extraArgs or {}) //
+                  (if hasAttr name individualExtraArgs then getAttr name individualExtraArgs else {})
               );
 
             # Add _options in sub-modules to make it viewable from other
@@ -158,6 +165,14 @@ rec {
         // optionalAttrs (opt1 ? extraConfigs || opt2 ? extraConfigs) {
             extraConfigs = opt1.extraConfigs or [] ++ opt2.extraConfigs or [];
           }
+        // optionalAttrs (opt1 ? extraArgs || opt2 ? extraArgs) {
+            extraArgs = opt1.extraArgs or {} // opt2.extraArgs or {};
+          }
+        // optionalAttrs (opt1 ? individualExtraArgs || opt2 ? individualExtraArgs) {
+            individualExtraArgs = zipAttrsWith (name: values:
+              if length values == 1 then head values else (head values // (head (tail values)))
+            ) [ (opt1.individualExtraArgs or {}) (opt2.individualExtraArgs or {}) ];
+          }
       )) {} opts;
 
   
diff --git a/pkgs/lib/platforms.nix b/pkgs/lib/platforms.nix
index 45e863458d4..8be37d7ed1e 100644
--- a/pkgs/lib/platforms.nix
+++ b/pkgs/lib/platforms.nix
@@ -2,9 +2,8 @@ let lists = import ./lists.nix; in
 
 rec {
   gnu = linux; /* ++ hurd ++ kfreebsd ++ ... */
-  linux = ["i686-linux" "x86_64-linux" "powerpc-linux" "armv5tel-linux"
-    "armv7l-linux" "mips64el-linux"];
-  darwin = ["i686-darwin" "powerpc-darwin" "x86_64-darwin"];
+  linux = ["i686-linux" "x86_64-linux" "powerpc-linux" "armv5tel-linux" "armv7l-linux" "mips64el-linux"];
+  darwin = ["x86_64-darwin"];
   freebsd = ["i686-freebsd" "x86_64-freebsd" "powerpc-freebsd"];
   openbsd = ["i686-openbsd" "x86_64-openbsd"];
   netbsd = ["i686-netbsd" "x86_64-netbsd"];
@@ -13,5 +12,5 @@ rec {
   all = linux ++ darwin ++ cygwin ++ freebsd ++ openbsd;
   none = [];
   allBut = platform: lists.filter (x: platform != x) all;
-  mesaPlatforms = linux;
+  mesaPlatforms = ["i686-linux" "x86_64-linux" "x86_64-darwin" "armv5tel-linux" "armv6l-linux"];
 }
diff --git a/pkgs/lib/properties.nix b/pkgs/lib/properties.nix
index 0d864b0c553..eeac27ae70c 100644
--- a/pkgs/lib/properties.nix
+++ b/pkgs/lib/properties.nix
@@ -25,7 +25,7 @@ rec {
   # contains a _type attribute and a list of functions which are used to
   # evaluate this property.  The content attribute is used to stack properties
   # on top of each other.
-  # 
+  #
   # The optional functions which may be contained in the property attribute
   # are:
   #  - onDelay: run on a copied property.
@@ -41,7 +41,7 @@ rec {
   # property and call the function `nul' on the final value which is not a
   # property.  The stack is traversed in reversed order.  The `op' function
   # should expect a property with a content which have been modified.
-  # 
+  #
   # Warning: The `op' function expects only one argument in order to avoid
   # calls to mkProperties as the argument is already a valid property which
   # contains the result of the folding inside the content attribute.
@@ -100,12 +100,10 @@ rec {
   triggerPropertiesDelay = name: attrs:
     let
       callOnDelay = p@{property, ...}:
-        lib.addErrorContext "while calling an `onDelay' function:" (
-          if property ? onDelay then
-            property.onDelay name p
-          else
-            p
-        );
+        if property ? onDelay then
+          property.onDelay name p
+        else
+          p;
     in
       foldProperty callOnDelay id attrs;
 
@@ -123,9 +121,7 @@ rec {
       };
 
       callOnGlobalDelay = property: content:
-        lib.addErrorContext "while calling an `onGlobalDelay' function:" (
-          property.onGlobalDelay name content
-        );
+        property.onGlobalDelay name content;
     in
       fold callOnGlobalDelay attrs globalDelayFuns;
 
@@ -136,28 +132,25 @@ rec {
   evalProperties = valList:
     if valList != [] then
       filter (x: !isNotdef x) (
-        lib.addErrorContext "while evaluating properties:" (
-          triggerPropertiesGlobalEval (
-            evalLocalProperties valList
-      )))
+        triggerPropertiesGlobalEval (
+          evalLocalProperties valList
+        )
+      )
     else
       valList;
 
   evalLocalProperties = valList:
     filter (x: !isNotdef x) (
-      lib.addErrorContext "while evaluating local properties:" (
-        map triggerPropertiesEval valList
-    ));
+      map triggerPropertiesEval valList
+    );
 
   # Call onEval function
   triggerPropertiesEval = val:
     foldProperty (p@{property, ...}:
-      lib.addErrorContext "while calling an `onEval' function:" (
-        if property ? onEval then
-          property.onEval p
-        else
-          p
-      )
+      if property ? onEval then
+        property.onEval p
+      else
+        p
     ) id val;
 
   # Call onGlobalEval function
@@ -176,10 +169,7 @@ rec {
           ) [] valList;
       };
 
-      callOnGlobalEval = property: valList:
-        lib.addErrorContext "while calling an `onGlobalEval' function:" (
-          property.onGlobalEval valList
-        );
+      callOnGlobalEval = property: valList: property.onGlobalEval valList;
     in
       fold callOnGlobalEval valList globalEvalFuns;
 
@@ -225,45 +215,11 @@ rec {
     inherit content;
   };
 
-  # Create a "ThenElse" property which contains choices being chosen by
-  # the evaluation of an "If" statement.
-  isThenElse = attrs: (typeOf attrs) == "then-else";
-  mkThenElse = attrs:
-    assert attrs ? thenPart && attrs ? elsePart;
-    __trace "Obsolete usage of mkThenElse, replace it by mkMerge."
-    mkProperty {
-      property = {
-        _type = "then-else";
-        onEval = val: throw "Missing mkIf statement.";
-        inherit (attrs) thenPart elsePart;
-      };
-      content = mkNotdef;
-    };
-
-  # Create an "Always" property removing/ ignoring all "If" statement.
-  isAlways = attrs: (typeOf attrs) == "always";
-  mkAlways = value:
-    mkProperty {
-      property = {
-        _type = "always";
-        onEval = p@{content, ...}: content;
-        inherit value;
-      };
-      content = mkNotdef;
-    };
-
   mkAssert = assertion: message: content:
     mkIf
       (if assertion then true else throw "\nFailed assertion: ${message}")
       content;
 
-  # Remove all "If" statement defined on a value.
-  rmIf = foldProperty (
-      foldFilter isIf
-        ({content, ...}: content)
-        id
-    ) id;
-
   # Evaluate the "If" statements when either "ThenElse" or "Always"
   # statement is encountered.  Otherwise it removes multiple If statements and
   # replaces them by one "If" statement where the condition is the list of all
@@ -274,8 +230,8 @@ rec {
       # in the attribute list and attrs.
       ifProps =
         foldProperty
-          (foldFilter (p: isIf p || isThenElse p || isAlways p)
-            # then, push the codition inside the list list
+          (foldFilter (p: isIf p)
+            # then, push the condition inside the list list
             (p@{property, content, ...}:
               { inherit (content) attrs;
                 list = [property] ++ content.list;
@@ -297,19 +253,7 @@ rec {
           mkIf condition content
         else
           let p = head list; in
-
-          # evaluate the condition.
-          if isThenElse p then
-            if condition then
-              copyProperties content p.thenPart
-            else
-              copyProperties content p.elsePart
-          # ignore the condition.
-          else if isAlways p then
-            copyProperties content p.value
-          # otherwise (isIf)
-          else
-            evalIf content (condition && p.condition) (tail list);
+          evalIf content (condition && p.condition) (tail list);
     in
       evalIf ifProps.attrs true ifProps.list;
 
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index fb2752d97c1..6c4adfaa1a7 100644
--- a/pkgs/lib/strings.nix
+++ b/pkgs/lib/strings.nix
@@ -155,4 +155,25 @@ rec {
   # Return true iff string v1 denotes a version older than v2.
   versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1;
 
+
+  # Get the version of the specified derivation, as specified in its
+  # ‘name’ attribute.
+  getVersion = drv: (builtins.parseDrvName drv.name).version;
+
+
+  # Extract name with version from URL. Ask for separator which is
+  # supposed to start extension
+  nameFromURL = url: sep: let
+    components = splitString "/" url;
+    filename = lib.last components;
+    name = builtins.head (splitString sep filename);
+  in
+  assert ! eqStrings name filename;
+  name;
+
+
+  # Create an --{enable,disable}-<feat> string that can be passed to
+  # standard GNU Autoconf scripts.
+  enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
+
 }
diff --git a/pkgs/lib/tests.nix b/pkgs/lib/tests.nix
index 835298ddb9e..298bdffc379 100644
--- a/pkgs/lib/tests.nix
+++ b/pkgs/lib/tests.nix
@@ -58,6 +58,13 @@ runTests {
     ([ 1 2 3 ] == (take 4 [  1 2 3 ]))
   ];
 
+  testFoldAttrs = {
+    expr = foldAttrs (n: a: [n] ++ a) [] [
+    { a = 2; b = 7; }
+    { a = 3;        c = 8; }
+    ];
+    expected = { a = [ 2 3 ]; b = [7]; c = [8];};
+  };
 
   testOverridableDelayableArgsTest = {
     expr = 
@@ -97,5 +104,10 @@ runTests {
         ];
     expected = true;
   };
+
+  testSort = {
+    expr = sort builtins.lessThan [ 40 2 30 42 ];
+    expected = [2 30 40 42];
+  };
   
 }
diff --git a/pkgs/lib/trivial.nix b/pkgs/lib/trivial.nix
index af47a8c8841..8af3474f2a6 100644
--- a/pkgs/lib/trivial.nix
+++ b/pkgs/lib/trivial.nix
@@ -1,3 +1,8 @@
+with {
+  inherit (import ./lists.nix) deepSeqList;
+  inherit (import ./attrsets.nix) deepSeqAttrs;
+};
+
 rec {
 
   # Identity function.
@@ -22,4 +27,12 @@ rec {
   # evaluation of its first argument.
   seq = x: y: if x == null then y else y;
   
+  # Like `seq', but recurses into lists and attribute sets to force evaluation
+  # of all list elements/attributes.
+  deepSeq = x: y:
+    if builtins.isList x
+      then deepSeqList x y
+    else if builtins.isAttrs x
+      then deepSeqAttrs x y
+      else seq x y;
 }
diff --git a/pkgs/lib/types.nix b/pkgs/lib/types.nix
index 38ae7b43630..6ddac61d91b 100644
--- a/pkgs/lib/types.nix
+++ b/pkgs/lib/types.nix
@@ -11,7 +11,7 @@ with import ./trivial.nix;
 rec {
 
   hasType = x: isAttrs x && x ? _type;
-  typeOf = x: if hasType x then x._type else "";
+  typeOf = x: x._type or "";
 
   setType = typeName: value: value // {
     _type = typeName;
@@ -68,6 +68,14 @@ rec {
       merge = lib.concatStrings;
     };
 
+    # Like ‘string’, but add newlines between every value.  Useful for
+    # configuration file contents.
+    lines = mkOptionType {
+      name = "string";
+      check = lib.traceValIfNot builtins.isString;
+      merge = lib.concatStringsSep "\n";
+    };
+
     envVar = mkOptionType {
       name = "environment variable";
       inherit (string) check;
@@ -176,6 +184,20 @@ rec {
       fold = op: nul: v: if v == null then nul else elemType.fold op nul v;
     };
 
+    functionTo = elemType: mkOptionType {
+      name = "function that evaluates to a(n) ${elemType.name}";
+      check = lib.traceValIfNot builtins.isFunction;
+      merge = fns:
+        args: elemType.merge (map (fn: fn args) fns);
+      # These are guesses, I don't fully understand iter, fold, delayOnGlobalEval
+      iter = f: path: v:
+        args: elemType.iter f path (v args);
+      fold = op: nul: v:
+        args: elemType.fold op nul (v args);
+      inherit (elemType) delayOnGlobalEval;
+      hasOptions = false;
+    };
+
     # !!! this should be a type constructor that takes the options as
     # an argument.
     optionSet = mkOptionType {
diff --git a/pkgs/misc/cups/default.nix b/pkgs/misc/cups/default.nix
index 9ba33b07b38..6cc13aa3013 100644
--- a/pkgs/misc/cups/default.nix
+++ b/pkgs/misc/cups/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, zlib, libjpeg, libpng, libtiff, pam, openssl
-, dbus, libusb, acl }:
+, dbus, libusb1, acl }:
 
-let version = "1.5.2"; in
+let version = "1.5.4"; in
 
 stdenv.mkDerivation {
   name = "cups-${version}";
@@ -10,10 +10,10 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://ftp.easysw.com/pub/cups/${version}/cups-${version}-source.tar.bz2";
-    sha256 = "1yw7l5rq93zg91akqf68b871frrs4q0krc9cx43ly7v3ih8all5i";
+    md5 = "de3006e5cf1ee78a9c6145ce62c4e982";
   };
 
-  buildInputs = [ pkgconfig zlib libjpeg libpng libtiff libusb ]
+  buildInputs = [ pkgconfig zlib libjpeg libpng libtiff libusb1 ]
     ++ stdenv.lib.optionals stdenv.isLinux [ pam dbus acl ] ;
 
   propagatedBuildInputs = [ openssl ];
@@ -43,6 +43,6 @@ stdenv.mkDerivation {
     description = "A standards-based printing system for UNIX";
     license = stdenv.lib.licenses.gpl2; # actually LGPL for the library and GPL for the rest
     maintainers = [ stdenv.lib.maintainers.urkud stdenv.lib.maintainers.simons ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/misc/cups/drivers/samsung/builder.sh b/pkgs/misc/cups/drivers/samsung/builder.sh
new file mode 100644
index 00000000000..58e1c0cd781
--- /dev/null
+++ b/pkgs/misc/cups/drivers/samsung/builder.sh
@@ -0,0 +1,35 @@
+source $stdenv/setup
+
+arch=$(uname -m)
+# replace i[3456]86 with i386
+echo arch | egrep -q '^i[3456]86$' && arch=i386
+arch=i386
+unpackPhase
+patchPhase
+
+set -v
+
+echo $arch
+cd cdroot/Linux
+mkdir -p $out/opt
+cp -r $arch/at_root/* $out
+cp -r $arch/at_opt/* $out/opt
+#cp -r noarch/at_root/* $out
+cp -r noarch/at_opt/* $out/opt
+
+cd $out
+#test -d usr/lib64 && ln -s usr/lib64 lib || 
+ln -s usr/lib lib
+mkdir -p share/cups
+cd share/cups
+ln -s ../../opt/share/* .
+ln -s ppd model
+
+cd $out/lib/cups/filter
+for i in $(ls); do
+    echo patching $i...
+    patchelf --set-interpreter $(cat $NIX_GCC/nix-support/dynamic-linker) $i || echo "(couldn't set interpreter)"
+    patchelf --set-rpath $cups/lib:$gcc/lib:$glibc/lib $i  # This might not be necessary.
+done
+
+ln -s $ghostscript/bin/gs $out/lib/cups/filter
diff --git a/pkgs/misc/cups/drivers/samsung/default.nix b/pkgs/misc/cups/drivers/samsung/default.nix
new file mode 100644
index 00000000000..ab0c0dc25e4
--- /dev/null
+++ b/pkgs/misc/cups/drivers/samsung/default.nix
@@ -0,0 +1,35 @@
+# Tested on linux-x86_64.  Might work on linux-i386.  Probably won't work on anything else.
+
+# To use this driver in NixOS, add it to printing.drivers in configuration.nix.
+# configuration.nix might look like this when you're done:
+# { pkgs, ... }: {
+#   printing = {
+#     enable = true;
+#     drivers = [ pkgs.samsungUnifiedLinuxDriver ];
+#   };
+#   (more stuff)
+# }
+# (This advice was tested on 2010 August 2.)
+
+{stdenv, fetchurl, cups, gcc, ghostscript, glibc, patchelf}:
+
+stdenv.mkDerivation rec {
+  name = "samsung-UnifiedLinuxDriver-0.92";
+
+  src = fetchurl {
+    url = "http://downloadcenter.samsung.com/content/DR/200911/20091103171827750/UnifiedLinuxDriver_0.92.tar.gz";
+    sha256 = "0p2am0p8xvm339mad07c4j77gz31m63z76sy6d9hgwmxy2prbqfq";
+  };
+
+  buildInputs = [ cups gcc ghostscript glibc patchelf ];
+
+  inherit cups gcc ghostscript glibc;
+
+  builder = ./builder.sh;
+
+  meta = {
+    description = "Samsung's Linux drivers; includes binaries without source code";
+    homepage = "http://www.samsung.com/";
+    license = "samsung";  # Binary-only
+  };
+}
diff --git a/pkgs/misc/drivers/foomatic-filters/default.nix b/pkgs/misc/drivers/foomatic-filters/default.nix
index 867f4f440d5..ff03770014d 100644
--- a/pkgs/misc/drivers/foomatic-filters/default.nix
+++ b/pkgs/misc/drivers/foomatic-filters/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, perl, cups, coreutils, gnused }:
+{ stdenv, fetchurl, pkgconfig, perl, cups, dbus }:
 
 stdenv.mkDerivation rec {
-  name = "foomatic-filters-4.0.6";
+  name = "foomatic-filters-4.0.12";
 
   src = fetchurl {
     url = "http://www.openprinting.org/download/foomatic/${name}.tar.gz";
-    sha256 = "0wa9hlq7s99sh50kl6bj8j0vxrz7pcbwdnqs1yfjjhqshfh7hsav";
+    sha256 = "17w26r15094j4fqifa7f7i7jad4gsy9zdlq69kffrykcw31qx3q8";
   };
 
-  buildInputs = [ perl cups ];
+  buildInputs = [ pkgconfig perl cups dbus ];
 
   preConfigure =
     ''
diff --git a/pkgs/misc/drivers/gutenprint/bin.nix b/pkgs/misc/drivers/gutenprint/bin.nix
index d78e1674d87..1def4b7d1c9 100644
--- a/pkgs/misc/drivers/gutenprint/bin.nix
+++ b/pkgs/misc/drivers/gutenprint/bin.nix
@@ -56,6 +56,9 @@ stdenv.mkDerivation {
       patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
           --set-rpath $libPath $p
     done
+    
+    mkdir $out/lib
+    ln -s $out/cups/lib $out/lib/cups
   '';
 
   meta = {
diff --git a/pkgs/misc/drivers/hplip/default.nix b/pkgs/misc/drivers/hplip/default.nix
index 514655bd727..5b9ef87a129 100644
--- a/pkgs/misc/drivers/hplip/default.nix
+++ b/pkgs/misc/drivers/hplip/default.nix
@@ -1,5 +1,5 @@
-{stdenv, fetchurl, cups, zlib, libjpeg, libusb, python, saneBackends, dbus
-, pkgconfig, polkit, qtSupport ? true, qt4
+{stdenv, fetchurl, cups, zlib, libjpeg, libusb, pythonPackages, saneBackends, dbus
+, pkgconfig, polkit, qtSupport ? true, qt4, pythonDBus, pyqt4, net_snmp
 }:
 
 stdenv.mkDerivation rec {
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
 
   prePatch = ''
     sed -i s,/etc/sane.d,$out/etc/sane.d/, Makefile.in
+    sed -i s,/etc/hp/,$out/etc/hp/, base/g.py
   '';
 
   # --disable-network-build Until we have snmp
@@ -28,7 +29,7 @@ stdenv.mkDerivation rec {
       --with-systraydir=$out/xdg/autostart
       --with-mimedir=$out/etc/cups
       --enable-policykit
-      --disable-network-build"
+    "
 
     export makeFlags="
       halpredir=$out/share/hal/fdi/preprobe/10osvendor
@@ -41,8 +42,27 @@ stdenv.mkDerivation rec {
     ";
   '';
 
-  buildInputs = [libjpeg cups libusb python saneBackends dbus pkgconfig] ++
-    stdenv.lib.optional qtSupport qt4;
+  postInstall = ''
+    wrapPythonPrograms
+    '';
+
+  buildInputs = [
+      libjpeg
+      cups
+      libusb
+      pythonPackages.python
+      pythonPackages.wrapPython
+      saneBackends
+      dbus
+      pkgconfig
+      net_snmp
+    ] ++ stdenv.lib.optional qtSupport qt4;
+
+  pythonPath = with pythonPackages; [
+      pythonDBus
+      pygobject
+      recursivePthLoader
+    ] ++ stdenv.lib.optional qtSupport pyqt4;
 
   meta = with stdenv.lib; {
     description = "Print, scan and fax HP drivers for Linux";
diff --git a/pkgs/misc/emulators/dlx/default.nix b/pkgs/misc/emulators/dlx/default.nix
new file mode 100644
index 00000000000..c23b60c29b3
--- /dev/null
+++ b/pkgs/misc/emulators/dlx/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation {
+  name = "dlx-2012.07.08";
+
+  src = fetchurl {
+    url = "http://www.davidviner.com/zip/dlx/dlx.zip";
+    sha256 = "0q5hildq2xcig7yrqi26n7fqlanyssjirm7swy2a9icfxpppfpkn";
+  };
+
+  buildInputs = [ unzip ];
+
+  makeFlags = "LINK=gcc CFLAGS=-O2";
+
+  installPhase = ''
+    mkdir -p $out/include/dlx $out/share/dlx/{examples,doc} $out/bin
+    mv -v masm mon dasm $out/bin/
+    mv -v *.i auto.a $out/include/dlx/
+    mv -v *.a *.m $out/share/dlx/examples/
+    mv -v README.txt MANUAL.TXT $out/share/dlx/doc/
+  '';
+
+  meta = {
+    homepage = "http://www.davidviner.com/dlx.php";
+    description = "DLX Simulator";
+    license = "GPL-2";
+  };
+}
diff --git a/pkgs/misc/emulators/hatari/default.nix b/pkgs/misc/emulators/hatari/default.nix
new file mode 100644
index 00000000000..e4eeff9cd54
--- /dev/null
+++ b/pkgs/misc/emulators/hatari/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, zlib, SDL, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "hatari-1.6.2";
+
+  src = fetchurl {
+    url = "http://download.tuxfamily.org/hatari/1.6.2/${name}.tar.bz2";
+    sha256 = "0gqvfqqd0lg3hi261rwh6gi2b5kmza480kfzx43d4l49xcq09pi0";
+  };
+
+  # For pthread_cancel
+  cmakeFlags = "-DCMAKE_EXE_LINKER_FLAGS=-lgcc_s";
+
+  buildInputs = [ zlib SDL cmake ];
+
+  meta = {
+    homepage = "http://hatari.tuxfamily.org/";
+    description = "Hatari is an Atari ST/STE/TT/Falcon emulator.";
+    license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/misc/emulators/mupen64plus/1.5.nix b/pkgs/misc/emulators/mupen64plus/1.5.nix
new file mode 100644
index 00000000000..d67121fe430
--- /dev/null
+++ b/pkgs/misc/emulators/mupen64plus/1.5.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl, which, pkgconfig, SDL, gtk, mesa, SDL_ttf}:
+
+stdenv.mkDerivation {
+  name = "mupen64plus-1.5";
+  src = fetchurl {
+    url = http://mupen64plus.googlecode.com/files/Mupen64Plus-1-5-src.tar.gz;
+    sha256 = "0gygfgyr2sg4yx77ijk133d1ra0v1yxi4xjxrg6kp3zdjmhdmcjq";
+  };
+  
+  buildInputs = [ which pkgconfig SDL gtk mesa SDL_ttf ];
+  
+  preConfigure = ''
+    # Some C++ incompatibility fixes
+    sed -i -e 's|char \* extstr = strstr|const char * extstr = strstr|' glide64/Main.cpp
+    sed -i -e 's|char \* extstr = strstr|const char * extstr = strstr|' glide64/Combine.cpp
+
+    # Fix some hardcoded paths
+    sed -i -e "s|/usr/local|$out|g" main/main.c
+
+    # Remove PATH environment variable from install script
+    sed -i -e "s|export PATH=|#export PATH=|" ./install.sh
+  '';
+  
+  buildPhase = "make all";
+  installPhase = "PREFIX=$out make install";
+  
+  meta = {
+    description = "A Nintendo 64 Emulator";
+    license = "GPLv2+";
+    homepage = http://code.google.com/p/mupen64plus;
+    maintainers = [ stdenv.lib.maintainers.sander ];
+  };
+}
diff --git a/pkgs/misc/emulators/wine/build_winetricks.sh b/pkgs/misc/emulators/wine/build_winetricks.sh
new file mode 100644
index 00000000000..2d19e749f2d
--- /dev/null
+++ b/pkgs/misc/emulators/wine/build_winetricks.sh
@@ -0,0 +1,17 @@
+#!bash
+source $stdenv/setup
+mkdir -p $out/bin
+cp $src/src/winetricks $out/bin/winetricks
+chmod +x $out/bin/winetricks
+cd $out/bin
+patch -u -p0 < $patch
+
+mkdir -p "$out/share/man/man1"
+cp "$src/src/winetricks.1" "$out/share/man/man1/"
+
+patchShebangs "$out"
+
+substituteInPlace "$out/bin/winetricks" --replace "/usr/bin/perl" `which perl`
+
+# add stuff to PATH
+sed -i "2i PATH=\"${pathAdd}:\${PATH}\"" "$out/bin/winetricks"
diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix
index b35660daf5e..31ed420fe56 100644
--- a/pkgs/misc/emulators/wine/default.nix
+++ b/pkgs/misc/emulators/wine/default.nix
@@ -1,22 +1,23 @@
 { stdenv, fetchurl, xlibs, flex, bison, mesa, alsaLib
 , ncurses, libpng, libjpeg, lcms, freetype, fontconfig, fontforge
-, libxml2, libxslt, openssl, gnutls
+, libxml2, libxslt, openssl, gnutls, cups
 }:
 
 assert stdenv.isLinux;
 assert stdenv.gcc.gcc != null;
 
 stdenv.mkDerivation rec {
-  name = "wine-1.5.10";
+  version = "1.5.31";
+  name = "wine-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/wine/${name}.tar.bz2";
-    sha256 = "04wydwc8q49bw8brlklx2nbgr453lx7bbfass5zn88xbz997lppk";
+    sha256 = "1hlj1r3xi1mbqblkiwrcphvvb8rd50qig25jhyid58qp3r2lf9a6";
   };
 
   gecko = fetchurl {
-    url = "mirror://sourceforge/wine/wine_gecko-1.5-x86.msi";
-    sha256 = "2e372a1b87ff2a22ad5127400ece4b09e55591d9f84e00bb562d294898a49b5c";
+    url = "mirror://sourceforge/wine/wine_gecko-1.9-x86.msi";
+    sha256 = "10p7djsf85xjk8rzg3hgw5fskrn8402y2aijy701xwm4hy9ga79g";
   };
 
   buildInputs = [
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
     xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr
     xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite
     alsaLib ncurses libpng libjpeg lcms fontforge
-    libxml2 libxslt openssl gnutls
+    libxml2 libxslt openssl gnutls cups
   ];
 
   # Wine locates a lot of libraries dynamically through dlopen().  Add
@@ -34,7 +35,7 @@ stdenv.mkDerivation rec {
     freetype fontconfig stdenv.gcc.gcc mesa mesa.libdrm
     xlibs.libXinerama xlibs.libXrender xlibs.libXrandr
     xlibs.libXcursor xlibs.libXcomposite libpng libjpeg
-    openssl gnutls
+    openssl gnutls cups
   ];
 
   # Don't shrink the ELF RPATHs in order to keep the extra RPATH
@@ -48,6 +49,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.winehq.org/";
     license = "LGPL";
+    inherit version;
     description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
     maintainers = [stdenv.lib.maintainers.raskin stdenv.lib.maintainers.simons];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/misc/emulators/wine/default.upstream b/pkgs/misc/emulators/wine/default.upstream
new file mode 100644
index 00000000000..e23f341c28a
--- /dev/null
+++ b/pkgs/misc/emulators/wine/default.upstream
@@ -0,0 +1,8 @@
+url http://sourceforge.net/projects/wine/files/Source/
+version_link '[.]tar[.][^./]+/download$'
+SF_redirect
+do_overwrite () {
+  ensure_hash
+  set_var_value version "$CURRENT_VERSION"
+  set_var_value sha256 "$CURRENT_HASH"
+}
diff --git a/pkgs/misc/emulators/wine/wine-warcraft.nix b/pkgs/misc/emulators/wine/wine-warcraft.nix
deleted file mode 100644
index 3573c0ba4fe..00000000000
--- a/pkgs/misc/emulators/wine/wine-warcraft.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ stdenv, fetchgit, xlibs, flex, bison, mesa, alsaLib
-, ncurses, libpng, libjpeg, lcms, freetype, fontconfig, fontforge
-, libxml2, libxslt, openssl, gnutls
-}:
-
-assert stdenv.isLinux;
-assert stdenv.gcc.gcc != null;
-
-stdenv.mkDerivation rec {
-  name = "wine-warcraft-${version}";
-  version = "1.1.19";
-
-  src = fetchgit {
-    url = git://repo.or.cz/wine/warcraft3.git;
-    rev = "38faaffd99331b71284d8da5f76f38625107ed6d";
-  };
-
-  buildInputs = [
-    xlibs.xlibs flex bison xlibs.libXi mesa
-    xlibs.libXcursor xlibs.libXinerama xlibs.libXrandr
-    xlibs.libXrender xlibs.libXxf86vm xlibs.libXcomposite
-    xlibs.xf86vidmodeproto
-    alsaLib ncurses libpng libjpeg lcms fontforge
-    libxml2 libxslt openssl gnutls
-  ];
-
-  # Wine locates a lot of libraries dynamically through dlopen().  Add
-  # them to the RPATH so that the user doesn't have to set them in
-  # LD_LIBRARY_PATH.
-  NIX_LDFLAGS = map (path: "-rpath ${path}/lib ") [
-    freetype fontconfig stdenv.gcc.gcc mesa mesa.libdrm
-    xlibs.libXinerama xlibs.libXrender xlibs.libXrandr
-    xlibs.libXcursor xlibs.libXcomposite xlibs.libXxf86vm
-    xlibs.xf86vidmodeproto
-    openssl gnutls
-  ];
-
-  # Don't shrink the ELF RPATHs in order to keep the extra RPATH
-  # elements specified above.
-  dontPatchELF = true;
-
-  meta = with stdenv.lib; {
-    homepage = "http://www.winehq.org/";
-    license = "LGPL";
-    description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix with patches for Warcraft 3";
-    maintainers = [ maintainers.phreedom ];
-    platforms = [ "i686-linux" ];
-  };
-}
diff --git a/pkgs/misc/emulators/wine/winetricks.nix b/pkgs/misc/emulators/wine/winetricks.nix
new file mode 100644
index 00000000000..71cc2767f69
--- /dev/null
+++ b/pkgs/misc/emulators/wine/winetricks.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchsvn, wine, perl, which, coreutils, zenity, curl, cabextract, unzip, p7zip } :
+
+stdenv.mkDerivation rec {
+  rev = "939";
+  name = "winetricks-${rev}";
+
+  src = fetchsvn {
+    url = "http://winetricks.googlecode.com/svn/trunk";
+    inherit rev;
+    sha256 = "01v13qw4sxmfm09g9amqycnzy743gdrhvv23rjr9255dzlrj1s8f";
+  };
+
+  buildInputs = [ perl which ];
+
+  pathAdd = stdenv.lib.concatStringsSep "/bin:" # coreutils is for sha1sum
+    [ wine perl which coreutils zenity curl cabextract unzip p7zip ]
+    + "/bin";
+
+  patch = ./winetricks.patch;
+
+  builder = ./build_winetricks.sh;
+
+  meta = {
+    description = "A script to install DLLs needed to work around problems in Wine";
+    license = "LGPLv2.1";
+    homepage = http://code.google.com/p/winetricks/;
+  };
+}
+
diff --git a/pkgs/misc/emulators/wine/winetricks.patch b/pkgs/misc/emulators/wine/winetricks.patch
new file mode 100644
index 00000000000..f419a0dcee4
--- /dev/null
+++ b/pkgs/misc/emulators/wine/winetricks.patch
@@ -0,0 +1,21 @@
+--- upstream-winetricks 2013-01-12 13:26:12.333076904 -0800
++++ winetricks 2013-01-12 14:37:39.675092352 -0800
+@@ -3398,7 +3398,7 @@
+     WINETRICKS_OPT_SHAREDPREFIX=${WINETRICKS_OPT_SHAREDPREFIX:-0}
+ 
+     # Mac folks tend to not have sha1sum, but we can make do with openssl
+-    if [ -x "`which sha1sum 2>/dev/null`" ]
++    if [ -e "`which sha1sum 2>/dev/null`" ]
+     then
+         WINETRICKS_SHA1SUM="sha1sum"
+     elif [ -x "`which openssl 2>/dev/null`" ]
+@@ -3628,7 +3628,7 @@
+ if ! test "$WINETRICKS_LIB"
+ then
+     WINETRICKS_SRCDIR=`dirname "$0"`
+-    WINETRICKS_SRCDIR=`cd "$WINETRICKS_SRCDIR"; /bin/pwd`
++    WINETRICKS_SRCDIR=`cd "$WINETRICKS_SRCDIR"; pwd`
+ 
+     # Which GUI helper to use (none/zenity/kdialog).  See winetricks_detect_gui.
+     WINETRICKS_GUI=none
+
diff --git a/pkgs/misc/emulators/wxmupen64plus/default.nix b/pkgs/misc/emulators/wxmupen64plus/default.nix
new file mode 100644
index 00000000000..a85d0fb389e
--- /dev/null
+++ b/pkgs/misc/emulators/wxmupen64plus/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl, python, wxGTK29, mupen64plus, SDL, libX11, mesa}:
+
+stdenv.mkDerivation {
+  name = "wxmupen64plus-0.3";
+  src = fetchurl {
+    url = "https://bitbucket.org/auria/wxmupen64plus/get/0.3.tar.bz2";
+    sha256 = "1mnxi4k011dd300k35li2p6x4wccwi6im21qz8dkznnz397ps67c";
+  };
+  
+  buildInputs = [ python wxGTK29 SDL libX11 mesa ];
+
+  configurePhase = ''
+    tar xf ${mupen64plus.src}
+    APIDIR=$(eval echo `pwd`/mupen64plus*/source/mupen64plus-core/src/api)
+    export CXXFLAGS="-I${libX11}/include/X11 -DLIBDIR=\\\"${mupen64plus}/lib/\\\""
+    export LDFLAGS="-lwx_gtk2u_adv-2.9"
+    python waf configure --mupenapi=$APIDIR --wxconfig=`type -P wx-config` --prefix=$out
+  '';
+
+  buildPhase = "python waf";
+  installPhase = "python waf install";
+  
+  meta = {
+    description = "GUI for the Mupen64Plus 2.0 emulator";
+    license = "GPLv2+";
+    homepage = https://bitbucket.org/auria/wxmupen64plus/wiki/Home;
+  };
+}
diff --git a/pkgs/misc/ghostscript/default.nix b/pkgs/misc/ghostscript/default.nix
index 0a028660f7f..ac171b2ff81 100644
--- a/pkgs/misc/ghostscript/default.nix
+++ b/pkgs/misc/ghostscript/default.nix
@@ -9,7 +9,7 @@ assert cupsSupport -> cups != null;
 
 let
   meta = {
-    homepage = http://www.gnu.org/software/ghostscript/;
+    homepage = "http://www.gnu.org/software/ghostscript/";
     description = "GNU Ghostscript, a PostScript interpreter";
 
     longDescription = ''
@@ -27,7 +27,7 @@ let
     maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.viric ];
   };
 
-  gnuForkData = rec {
+  gnuForkSrc = rec {
     name = "ghostscript-9.04.1";
     src = fetchurl {
       url = "mirror://gnu/ghostscript/gnu-${name}.tar.bz2";
@@ -38,14 +38,14 @@ let
     patches = [ ./purity.patch ];
   };
 
-  mainlineData = {
+  mainlineSrc = {
     name = "ghostscript-9.05";
     src = fetchurl {
-      url = http://downloads.ghostscript.com/public/ghostscript-9.05.tar.bz2;
+      url = "http://downloads.ghostscript.com/public/ghostscript-9.05.tar.bz2";
       sha256 = "1b6fi76x6pn9dmr9k9lh8kimn968dmh91k824fmm59d5ycm22h8g";
     };
     meta = meta // {
-      homepage = http://www.ghostscript.com/;
+      homepage = "http://www.ghostscript.com/";
       description = "GPL Ghostscript, a PostScript interpreter";
     };
 
@@ -55,7 +55,7 @@ let
     patches = [ ./purity-9.05.patch ];
   };
 
-  variant = if gnuFork then gnuForkData else mainlineData;
+  variant = if gnuFork then gnuForkSrc else mainlineSrc;
 
 in
 
@@ -64,11 +64,11 @@ stdenv.mkDerivation rec {
 
   fonts = [
     (fetchurl {
-      url = mirror://gnu/ghostscript/gnu-gs-fonts-std-6.0.tar.gz;
+      url = "mirror://gnu/ghostscript/gnu-gs-fonts-std-6.0.tar.gz";
       sha256 = "1lxr1y52r26qjif8kdqkfhsb5llakdcx3f5b9ppdyn59bb83ivsc";
     })
     (fetchurl {
-      url = mirror://gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz;
+      url = "mirror://gnu/ghostscript/gnu-gs-fonts-other-6.0.tar.gz";
       sha256 = "1cxaah3r52qq152bbkiyj2f7dx1rf38vsihlhjmrvzlr8v6cqil1";
     })
     # ... add other fonts here
diff --git a/pkgs/misc/ghostscript/libpng-1.5.patch b/pkgs/misc/ghostscript/libpng-1.5.patch
deleted file mode 100644
index b00305804a0..00000000000
--- a/pkgs/misc/ghostscript/libpng-1.5.patch
+++ /dev/null
@@ -1,198 +0,0 @@
-$NetBSD: patch-ak,v 1.5 2011/01/15 14:08:10 wiz Exp $
-
-Fix build with png-1.5. From John Bowler.
-
-See also http://bugs.ghostscript.com/show_bug.cgi?id=692060
-
---- a/base/gdevpng.c.orig	2008-07-17 02:34:01.000000000 +0000
-+++ b/base/gdevpng.c
-@@ -36,12 +36,14 @@
- #include "gdevpccm.h"
- #include "gscdefs.h"
- 
--#define PNG_INTERNAL
- /*
-  * libpng versions 1.0.3 and later allow disabling access to the stdxxx
-  * files while retaining support for FILE * I/O.
-+ *
-+ * This is a misunderstanding - this is a build time option for libpng,
-+ * it has no effect on a user of libpng.
-  */
--#define PNG_NO_CONSOLE_IO
-+/*#define PNG_NO_CONSOLE_IO*/
- /*
-  * Earlier libpng versions require disabling FILE * I/O altogether.
-  * This produces a compiler warning about no prototype for png_init_io.
-@@ -280,7 +282,7 @@ png_print_page(gx_device_printer * pdev,
- 	goto done;
-     }
-     /* set error handling */
--    if (setjmp(png_ptr->jmpbuf)) {
-+    if (setjmp(png_jmpbuf(png_ptr))) {
- 	/* If we get here, we had a problem reading the file */
- 	code = gs_note_error(gs_error_VMerror);
- 	goto done;
-@@ -290,19 +292,12 @@ png_print_page(gx_device_printer * pdev,
-     png_init_io(png_ptr, file);
- 
-     /* set the file information here */
--    info_ptr->width = pdev->width;
--    info_ptr->height = pdev->height;
--    /* resolution is in pixels per meter vs. dpi */
--    info_ptr->x_pixels_per_unit =
--	(png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54));
--    info_ptr->y_pixels_per_unit =
--	(png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54));
--    info_ptr->phys_unit_type = PNG_RESOLUTION_METER;
--    info_ptr->valid |= PNG_INFO_pHYs;
-     switch (depth) {
- 	case 32:
--	    info_ptr->bit_depth = 8;
--	    info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	8, PNG_COLOR_TYPE_RGB_ALPHA,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- 	    png_set_invert_alpha(png_ptr);
- 	    {   gx_device_pngalpha *ppdev = (gx_device_pngalpha *)pdev;
- 		png_color_16 background;
-@@ -315,57 +310,69 @@ png_print_page(gx_device_printer * pdev,
- 	    }
- 	    break;
- 	case 48:
--	    info_ptr->bit_depth = 16;
--	    info_ptr->color_type = PNG_COLOR_TYPE_RGB;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	16, PNG_COLOR_TYPE_RGB,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- #if defined(ARCH_IS_BIG_ENDIAN) && (!ARCH_IS_BIG_ENDIAN) 
- 	    png_set_swap(png_ptr);
- #endif
- 	    break;
- 	case 24:
--	    info_ptr->bit_depth = 8;
--	    info_ptr->color_type = PNG_COLOR_TYPE_RGB;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	8, PNG_COLOR_TYPE_RGB,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- 	    break;
- 	case 8:
--	    info_ptr->bit_depth = 8;
--	    if (gx_device_has_color(pdev))
--		info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
--	    else
--		info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	8, gx_device_has_color(pdev) ?
-+			PNG_COLOR_TYPE_PALETTE : PNG_COLOR_TYPE_GRAY,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- 	    break;
- 	case 4:
--	    info_ptr->bit_depth = 4;
--	    info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	4, PNG_COLOR_TYPE_PALETTE,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- 	    break;
- 	case 1:
--	    info_ptr->bit_depth = 1;
--	    info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
-+	    png_set_IHDR(png_ptr, info_ptr, pdev->width, pdev->height,
-+	    	1, PNG_COLOR_TYPE_GRAY,
-+		PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT,
-+		PNG_FILTER_TYPE_DEFAULT);
- 	    /* invert monocrome pixels */
- 	    png_set_invert_mono(png_ptr);
- 	    break;
-+	default:
-+	    png_error(png_ptr, "invalid bit depth");
-     }
- 
-+    /* resolution is in pixels per meter vs. dpi */
-+    png_set_pHYs(png_ptr, info_ptr, 
-+	(png_uint_32) (pdev->HWResolution[0] * (100.0 / 2.54)),
-+	(png_uint_32) (pdev->HWResolution[1] * (100.0 / 2.54)),
-+	PNG_RESOLUTION_METER);
-+
-     /* set the palette if there is one */
--    if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
-+    if (png_get_color_type(png_ptr, info_ptr)  == PNG_COLOR_TYPE_PALETTE) {
- 	int i;
- 	int num_colors = 1 << depth;
- 	gx_color_value rgb[3];
-+	png_color palette[256];
-+
-+	if (num_colors > 256)
-+	    num_colors = 256;
- 
--	info_ptr->palette =
--	    (void *)gs_alloc_bytes(mem, 256 * sizeof(png_color),
--				   "png palette");
--	if (info_ptr->palette == 0) {
--	    code = gs_note_error(gs_error_VMerror);
--	    goto done;
--	}
--	info_ptr->num_palette = num_colors;
--	info_ptr->valid |= PNG_INFO_PLTE;
- 	for (i = 0; i < num_colors; i++) {
- 	    (*dev_proc(pdev, map_color_rgb)) ((gx_device *) pdev,
- 					      (gx_color_index) i, rgb);
--	    info_ptr->palette[i].red = gx_color_value_to_byte(rgb[0]);
--	    info_ptr->palette[i].green = gx_color_value_to_byte(rgb[1]);
--	    info_ptr->palette[i].blue = gx_color_value_to_byte(rgb[2]);
-+	    palette[i].red = gx_color_value_to_byte(rgb[0]);
-+	    palette[i].green = gx_color_value_to_byte(rgb[1]);
-+	    palette[i].blue = gx_color_value_to_byte(rgb[2]);
- 	}
-+	png_set_PLTE(png_ptr, info_ptr, palette, num_colors);
-     }
-     /* add comment */
-     strncpy(software_key, "Software", sizeof(software_key));
-@@ -375,15 +382,14 @@ png_print_page(gx_device_printer * pdev,
-     text_png.key = software_key;
-     text_png.text = software_text;
-     text_png.text_length = strlen(software_text);
--    info_ptr->text = &text_png;
--    info_ptr->num_text = 1;
-+    png_set_text(png_ptr, info_ptr, &text_png, 1);
- 
-     /* write the file information */
-     png_write_info(png_ptr, info_ptr);
- 
-     /* don't write the comments twice */
--    info_ptr->num_text = 0;
--    info_ptr->text = NULL;
-+    /*info_ptr->num_text = 0;*/
-+    /*info_ptr->text = NULL;*/
- 
-     /* Write the contents of the image. */
-     for (y = 0; y < height; y++) {
-@@ -395,7 +401,7 @@ png_print_page(gx_device_printer * pdev,
-     png_write_end(png_ptr, info_ptr);
- 
-     /* if you alloced the palette, free it here */
--    gs_free_object(mem, info_ptr->palette, "png palette");
-+    /*gs_free_object(mem, info_ptr->palette, "png palette");*/
- 
-   done:
-     /* free the structures */
-@@ -405,6 +411,7 @@ png_print_page(gx_device_printer * pdev,
-     return code;
- }
- 
-+#if 0 /* not required in 1.5 */
- /*
-  * Patch around a static reference to a never-used procedure.
-  * This could be avoided if we were willing to edit pngconf.h to
-@@ -422,6 +429,7 @@ png_push_fill_buffer(png_structp png_ptr
- {
- }
- #endif
-+#endif
- 
- static int
- pngalpha_open(gx_device * pdev)
diff --git a/pkgs/misc/jackaudio/default.nix b/pkgs/misc/jackaudio/default.nix
index 7447421fc94..826924b8e8e 100644
--- a/pkgs/misc/jackaudio/default.nix
+++ b/pkgs/misc/jackaudio/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl, alsaLib, dbus, expat, libsamplerate
 , libsndfile, makeWrapper, pkgconfig, python, pythonDBus
-, firewireSupport ? false, ffado ? null }:
+, firewireSupport ? false, ffado ? null, bash }:
 
 assert firewireSupport -> ffado != null;
 
 stdenv.mkDerivation rec {
   name = "jackdbus-${version}";
-  version = "1.9.8";
+  version = "1.9.9.5";
 
   src = fetchurl {
-    url = "http://www.grame.fr/~letz/jack-1.9.8.tgz";
-    sha256 = "0788092zxrivcfnfg15brpjkf14x8ma8cwjz4k0b9xdxajn2wwac";
+    urls = [
+      https://dl.dropbox.com/u/28869550/jack-1.9.9.5.tar.bz2
+    ];
+    sha256 = "1ggba69jsfg7dmjzlyqz58y2wa92lm3vwdy4r15bs7mvxb65mvv5";
   };
 
   buildInputs =
@@ -18,8 +20,11 @@ stdenv.mkDerivation rec {
       pkgconfig python pythonDBus
     ] ++ (stdenv.lib.optional firewireSupport ffado);
 
+  patchPhase = ''
+    substituteInPlace svnversion_regenerate.sh --replace /bin/bash ${bash}/bin/bash
+  '';
+
   configurePhase = ''
-    cd jack-1.9.8
     python waf configure --prefix=$out --dbus --alsa ${if firewireSupport then "--firewire" else ""}
   '';
 
diff --git a/pkgs/misc/lilypond/default.nix b/pkgs/misc/lilypond/default.nix
index 65575af4c39..6d5d87faad6 100644
--- a/pkgs/misc/lilypond/default.nix
+++ b/pkgs/misc/lilypond/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, ghostscript, texinfo, imagemagick, texi2html, guile
 , python, gettext, flex, perl, bison, pkgconfig, texLive, dblatex
 , fontconfig, freetype, pango, fontforge, help2man, zip, netpbm, groff 
-, fetchsvn }:
+, fetchsvn, makeWrapper }:
 
 stdenv.mkDerivation rec{
-  majorVersion="2.14";
+  majorVersion="2.16";
   minorVersion="2";
   version="${majorVersion}.${minorVersion}";
   name = "lilypond-${version}";
@@ -16,21 +16,23 @@ stdenv.mkDerivation rec{
 
   src = fetchurl {
     url = "http://download.linuxaudio.org/lilypond/sources/v${majorVersion}/lilypond-${version}.tar.gz";
-    # 2.15.42
-    # sha256 = "0cm2fq1cr9d24w5xkz6ik6qnby516dfahz4cw47xx8mb5qsa4drd";
-    sha256 = "15i6k3fjc29wvchayn31khxhpppzd4g6ivbk7l43fakj8lw6nfi4";
+    sha256 = "1jx11bk3rk3w7bnh0829yy280627ywsvwg6fhdm0fqwkiz7jchqz";
   };
 
   preConfigure=''
     sed -e "s@mem=mf2pt1@mem=$PWD/mf/mf2pt1@" -i scripts/build/mf2pt1.pl
   '';
 
+  postInstall = ''
+     for f in $out/bin/*; do wrapProgram $f --set GUILE_AUTO_COMPILE 0; done
+  '';
+
   configureFlags = [ "--disable-documentation" "--with-ncsb-dir=${urwfonts}"];
 
   buildInputs =
     [ ghostscript texinfo imagemagick texi2html guile dblatex zip netpbm
       python gettext flex perl bison pkgconfig texLive fontconfig freetype pango
-      fontforge help2man groff
+      fontforge help2man groff makeWrapper
     ];
 
   meta = { 
diff --git a/pkgs/misc/maven/3.0.nix b/pkgs/misc/maven/3.0.nix
deleted file mode 100644
index 3d14a064a94..00000000000
--- a/pkgs/misc/maven/3.0.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{stdenv, fetchurl, jdk, makeWrapper}:
-
-assert jdk != null;
-
-stdenv.mkDerivation {
-	name = "apache-maven-3.0.3";
-	builder = ./builder.sh;
-	src = fetchurl {
-		url = mirror://apache/maven/binaries/apache-maven-3.0.3-bin.tar.gz;
-		sha256 = "b845479bd5d6d821210d3530c65da628a118abedd176492741e1d9bc5e400e2a";
-	};
-	
-        buildInputs = [makeWrapper]; 
-	inherit jdk;
-}
diff --git a/pkgs/misc/maven/default.nix b/pkgs/misc/maven/default.nix
index 85794901650..ec2b57e222a 100644
--- a/pkgs/misc/maven/default.nix
+++ b/pkgs/misc/maven/default.nix
@@ -3,11 +3,11 @@
 assert jdk != null;
 
 stdenv.mkDerivation {
-	name = "apache-maven-2.2.1";
+	name = "apache-maven-3.0.4";
 	builder = ./builder.sh;
 	src = fetchurl {
-		url = mirror://apache/maven/binaries/apache-maven-2.2.1-bin.tar.gz;
-		sha256 = "0xnk08ndf1jx458sr5dfr8rh7wi92kyn887vqyzjm1ka91cnb8xr";
+		url = mirror://apache/maven/binaries/apache-maven-3.0.4-bin.tar.gz;
+		sha256 = "0bxa7x8ifm8590nxifhsh3sxzm6aicbczyx21vibg3606ih8fnnk";
 	};
 	
         buildInputs = [makeWrapper]; 
diff --git a/pkgs/misc/maven/maven-1.0.nix b/pkgs/misc/maven/maven-1.0.nix
deleted file mode 100644
index 2c84b6f006c..00000000000
--- a/pkgs/misc/maven/maven-1.0.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{stdenv, fetchurl, jdk}:
-
-assert jdk != null;
-
-stdenv.mkDerivation {
-	name = "maven-1.0.2";
-        mavenBinary = "maven";
-	builder = ./builder.sh;
-	src = fetchurl {
-		url = http://apache.cs.uu.nl/dist/maven/binaries/maven-1.0.2.tar.bz2;
-		md5 = "81a6b4393e550635efe19e95cea38718";
-	};
-	makeWrapper = ../../build-support/make-wrapper/make-wrapper.sh;
-	
-	inherit jdk;
-}
diff --git a/pkgs/misc/misc.nix b/pkgs/misc/misc.nix
index df4a0ce8102..87be974ca96 100644
--- a/pkgs/misc/misc.nix
+++ b/pkgs/misc/misc.nix
@@ -6,6 +6,10 @@ in
 
 {
 
+  # description see mergeAttrsByVersion in lib/misc.nix
+  versionedDerivation = name: version: attrsByVersion: base:
+    pkgs.stdenv.mkDerivation (stdenv.lib.mergeAttrsByVersion name version attrsByVersion base);
+
   /*
     Usage example creating a derivation installing ruby, sup and a lib:
 
diff --git a/pkgs/misc/my-env/default.nix b/pkgs/misc/my-env/default.nix
index 990606668fe..ac2dc7f8cda 100644
--- a/pkgs/misc/my-env/default.nix
+++ b/pkgs/misc/my-env/default.nix
@@ -12,7 +12,7 @@
   }
 
   # Then you can install it by:  
-  #  $ nix-env -i sdl-env
+  #  $ nix-env -i env-sdl
   # And you can load it simply calling:  
   #  $ load-env-sdl
   # and this will update your env vars to have 'make' and 'gcc' finding the SDL
@@ -59,12 +59,12 @@
 { mkDerivation, substituteAll, pkgs }:
     { stdenv ? pkgs.stdenv, name, buildInputs ? []
     , propagatedBuildInputs ? [], gcc ? stdenv.gcc, cTags ? [], extraCmds ? ""
-    , shell ? "${pkgs.bashInteractive}/bin/bash"}:
+    , cleanupCmds ? "", shell ? "${pkgs.bashInteractive}/bin/bash"}:
 
 mkDerivation {
   # The setup.sh script from stdenv will expect the native build inputs in
-  # the buildNativeInputs environment variable.
-  buildNativeInputs = [ ] ++ buildInputs;
+  # the nativeBuildInputs environment variable.
+  nativeBuildInputs = [ ] ++ buildInputs;
   # Trick to bypass the stdenv usual change of propagatedBuildInputs => propagatedNativeBuildInputs
   propagatedBuildInputs2 = propagatedBuildInputs;
 
@@ -87,7 +87,7 @@ mkDerivation {
         -e 's@trap.*@@' \
         -i "$s"
     cat >> "$out/dev-envs/''${name/env-/}" << EOF
-      buildNativeInputs="$buildNativeInputs"
+      nativeBuildInputs="$nativeBuildInputs"
       propagatedBuildInputs="$propagatedBuildInputs2"
       # the setup-new script wants to write some data to a temp file.. so just let it do that and tidy up afterwards
       tmp="\$("${pkgs.coreutils}/bin/mktemp" -d)"
@@ -95,6 +95,8 @@ mkDerivation {
       phases=
       # only do all the setup stuff in nix-support/*
       set +e
+      # This prevents having -rpath /lib in NIX_LDFLAGS
+      export NIX_NO_SELF_RPATH=1
       if [[ -z "\$ZSH_VERSION" ]]; then
         source "$s"
       else
@@ -131,8 +133,16 @@ mkDerivation {
       fi
       rm -fr "\$tmp"
       ${extraCmds}
+
+      nix_cleanup() {
+        :
+        ${cleanupCmds}
+      }
+
       export PATH
       echo $name loaded
+
+      trap nix_cleanup EXIT
     EOF
 
     mkdir -p $out/bin
diff --git a/pkgs/misc/my-env/loadenv.sh b/pkgs/misc/my-env/loadenv.sh
index c116c14d8fe..5d126f0c29b 100644
--- a/pkgs/misc/my-env/loadenv.sh
+++ b/pkgs/misc/my-env/loadenv.sh
@@ -10,4 +10,5 @@ export buildInputs
 export NIX_STRIP_DEBUG=0
 export TZ="$OLDTZ"
 
-exec @shell@ --norc
+@shell@ --norc
+
diff --git a/pkgs/misc/rosegarden/default.nix b/pkgs/misc/rosegarden/default.nix
deleted file mode 100644
index dd4e351a020..00000000000
--- a/pkgs/misc/rosegarden/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-x@{builderDefsPackage
-  , automake, pkgconfig, libX11, libSM, imake, qt4, alsaLib, jackaudio
-  , ladspaH, liblrdf, dssi, liblo, fftwSinglePrec, libsndfile, libsamplerate
-  , xproto, libICE, perl, makedepend, librdf_raptor, lilypond, flac, libunwind
-  , ...}:
-builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
-
-  buildInputs = map (n: builtins.getAttr n x)
-    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
-  sourceInfo = rec {
-    baseName="rosegarden";
-    version="10.10";
-    project="${baseName}";
-    name="${baseName}-${version}";
-    url="mirror://sourceforge/project/${project}/${baseName}/${version}/${name}.tar.bz2";
-    hash="1ia74kzkw1yr3h8q4lrccx49hcy2961rni3h4css7r6hdl9xq909";
-  };
-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"];
-      
-  configureFlags = [
-    "--with-qtdir=${qt4}"
-  ];
-
-  setVars = a.noDepEntry ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lz -ldl -lX11"
-  '';
-
-  meta = {
-    description = "A music editor and MIDI sequencer";
-    maintainers = with a.lib.maintainers;
-    [
-      raskin
-    ];
-    platforms = with a.lib.platforms;
-      linux;
-    license = a.lib.licenses.gpl2;
-  };
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://sourceforge.net/projects/rosegarden/files/rosegarden/";
-    };
-  };
-}) x
-
diff --git a/pkgs/misc/sane-backends/default.nix b/pkgs/misc/sane-backends/default.nix
deleted file mode 100644
index 31372aa8418..00000000000
--- a/pkgs/misc/sane-backends/default.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null
-, gt68xxFirmware ? null }:
-let
-  firmware = gt68xxFirmware {inherit fetchurl;};
-in
-assert hotplugSupport -> (stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux");
-
-stdenv.mkDerivation {
-  name = "sane-backends-1.0.22";
-  
-  src = fetchurl {
-    url = http://alioth.debian.org/frs/download.php/3503/sane-backends-1.0.22.tar.gz;
-    sha256 = "0m0cz4ljw9asqvpryl6gx1ndwf7ll2qinlvql9whnzs901la314z";
-  };
-  
-  udevSupport = hotplugSupport;
-
-  buildInputs = if libusb != null then [libusb] else [];
-
-  postInstall = ''
-    if test "$udevSupport" = "1"; then
-      mkdir -p $out/etc/udev/rules.d/
-      ./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
-      cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
-    fi
-  '';
-
-  preInstall =
-    if gt68xxFirmware != null then 
-      "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
-      " \${out}/share/sane/gt68xx/" + firmware.name
-    else "";
-}
diff --git a/pkgs/misc/sane-backends/snapshot.nix b/pkgs/misc/sane-backends/snapshot.nix
deleted file mode 100644
index 636ae37ec05..00000000000
--- a/pkgs/misc/sane-backends/snapshot.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{ stdenv, fetchurl, hotplugSupport ? true, libusb ? null
-, gt68xxFirmware ? null }:
-let
-  firmware = gt68xxFirmware {inherit fetchurl;};
-in
-assert hotplugSupport -> stdenv.system == "i686-linux";
-
-stdenv.mkDerivation {
-  name = "sane-backends-1.0.22.git201111204";
-  
-  src = fetchurl {
-    url = http://www.sane-project.org/snapshots/sane-backends-git20111204.tar.gz;
-    sha256 = "00b3fi8zjrq3in0wndz1xcz228mgfhwhh2knmyjsikr88hal0m47";
-  };
-  
-  udevSupport = hotplugSupport;
-
-  buildInputs = if libusb != null then [libusb] else [];
-
-  postInstall = ''
-    if test "$udevSupport" = "1"; then
-      mkdir -p $out/etc/udev/rules.d/
-      ./tools/sane-desc -m udev > $out/etc/udev/rules.d/60-libsane.rules || \
-      cp tools/udev/libsane.rules $out/etc/udev/rules.d/60-libsane.rules
-    fi
-  '';
-
-  preInstall =
-    if gt68xxFirmware != null then 
-      "mkdir -p \${out}/share/sane/gt68xx ; ln -s " + firmware.fw +
-      " \${out}/share/sane/gt68xx/" + firmware.name
-    else "";
-}
diff --git a/pkgs/misc/sane-front/default.nix b/pkgs/misc/sane-front/default.nix
deleted file mode 100644
index 9427d17ac64..00000000000
--- a/pkgs/misc/sane-front/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl, saneBackends, libX11, gtk,
-	pkgconfig, libusb ? null}:
-stdenv.mkDerivation {
-  name = "sane-frontend";
-
-  src = fetchurl {
-    url = ftp://ftp.sane-project.org/pub/sane/sane-frontends-1.0.14/sane-frontends-1.0.14.tar.gz;
-    md5 = "c63bf7b0bb5f530cf3c08715db721cd3";
-  };
-
-  preConfigure = ''
-    sed -e '/SANE_CAP_ALWAYS_SETTABLE/d' -i src/gtkglue.c
-  '';
-
-  buildInputs = [saneBackends libX11 gtk pkgconfig] ++ 
-	(if (libusb != null) then [libusb] else []);
-}
diff --git a/pkgs/misc/screensavers/rss-glx/builder.sh b/pkgs/misc/screensavers/rss-glx/builder.sh
deleted file mode 100644
index a0c138d5e04..00000000000
--- a/pkgs/misc/screensavers/rss-glx/builder.sh
+++ /dev/null
@@ -1,31 +0,0 @@
-source $stdenv/setup
-
-# This is a very dirty hack to prevent the binaries from putting the
-# Mesa libraries in their RPATHs.
-mkdir -p $out/tmp
-ln -s $mesa/lib/* $out/tmp/
-mkdir -p $out/lib
-ln -s $mesa/lib/libGLU* $out/lib/
-export NIX_LDFLAGS="-L$out/tmp $NIX_LDFLAGS"
-
-genericBuild
-
-rm -rf $out/tmp
-
-
-# Add a wrapper around each program to use the appropriate OpenGL driver.
-mkdir -p $out/bin/.orig
-
-for i in $(cd $out/bin && ls); do
-    mv $out/bin/$i $out/bin/.orig/$i
-    cat >$out/bin/$i <<EOF
-#! $SHELL -e
-
-mesa=$mesa
-
-$(cat $mesaSwitch)
-
-exec $out/bin/.orig/$i "\$@"
-EOF
-    chmod +x $out/bin/$i
-done
diff --git a/pkgs/misc/screensavers/rss-glx/default.nix b/pkgs/misc/screensavers/rss-glx/default.nix
index fb7cf569fdf..bc1504ab2e9 100644
--- a/pkgs/misc/screensavers/rss-glx/default.nix
+++ b/pkgs/misc/screensavers/rss-glx/default.nix
@@ -3,8 +3,6 @@
 stdenv.mkDerivation {
   name = "rss-glx-0.8.1";
   
-  #builder = ./builder.sh;
-
   src = fetchurl {
     url = mirror://sourceforge/rss-glx/rss-glx_0.8.1.tar.bz2;
     md5 = "a2bdf0e10ee4e89c8975f313c5c0ba6f";
diff --git a/pkgs/misc/screensavers/xscreensaver/default.nix b/pkgs/misc/screensavers/xscreensaver/default.nix
index cf4f81ea407..e3932744286 100644
--- a/pkgs/misc/screensavers/xscreensaver/default.nix
+++ b/pkgs/misc/screensavers/xscreensaver/default.nix
@@ -4,12 +4,12 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "5.18";
+  version = "5.19";
   name = "xscreensaver-${version}";
 
   src = fetchurl {
     url = "http://www.jwz.org/xscreensaver/${name}.tar.gz";
-    sha256 = "3d70edb8f46511f5427f21b4ba4d8323f336888f60268d16731f5231c6883db9";
+    sha256 = "fd62ea0f996abe1bea3770dd7141681454521b49302f9bced8af9c2ee428c0e0";
   };
 
   buildInputs =
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ''
       # Fix build error in version 5.18. Remove this patch when updating
       # to a later version.
-      sed -i -e '/AF_LINK/d' hacks/glx/sonar-icmp.c
+      #sed -i -e '/AF_LINK/d' hacks/glx/sonar-icmp.c
       # Fix path to GTK.
       sed -e 's%@GTK_DATADIR@%@datadir@% ; s%@PO_DATADIR@%@datadir@%' \
 	  -i driver/Makefile.in po/Makefile.in.in
diff --git a/pkgs/misc/solfege/default.nix b/pkgs/misc/solfege/default.nix
new file mode 100644
index 00000000000..0449f72c997
--- /dev/null
+++ b/pkgs/misc/solfege/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchurl, pkgconfig, python, pygtk, gettext, texinfo
+, ghostscript, pysqlite, librsvg, gdk_pixbuf, txt2man, timidity, mpg123
+, alsaUtils, vorbisTools, csound, lilypond
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  name = "solfege-3.22.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/solfege/${name}.tar.gz";
+    sha256 = "10klrhdb1n67xd4bndk6z6idyf0pvwz7hcdg9ibalms7ywl3b23x";
+  };
+
+  buildInputs = [ pkgconfig python pygtk gettext texinfo
+    ghostscript pysqlite librsvg gdk_pixbuf txt2man makeWrapper
+  ];
+
+  preBuild = ''
+    sed -i -e 's|wav_player=.*|wav_player=${alsaUtils}/bin/aplay|' \
+           -e 's|midi_player=.*|midi_player=${timidity}/bin/timidity|' \
+           -e 's|mp3_player=.*|mp3_player=${mpg123}/bin/mpg123|' \
+           -e 's|ogg_player=.*|ogg_player=${vorbisTools}/bin/ogg123|' \
+           -e 's|csound=.*|csound=${csound}/bin/csound|' \
+           -e 's|lilypond-book=.*|lilypond-book=${lilypond}/bin/lilypond-book|' \
+           default.config
+  '';
+
+  postInstall = ''
+      set -x
+      find "${librsvg}" "${gdk_pixbuf}" -name loaders.cache -print0 | xargs -0 cat > "$out/gdk-pixbuf.loaders"
+      wrapProgram "$out/bin/solfege" \
+          --prefix PYTHONPATH ':' "$PYTHONPATH" \
+          --set GDK_PIXBUF_MODULE_FILE "$out/gdk-pixbuf.loaders"
+  '';
+
+  meta = {
+    description = "Ear training program";
+    homepage = http://www.solfege.org/;
+    license = stdenv.lib.licenses.gpl3;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ bjornfor ];
+  };
+}
diff --git a/pkgs/misc/source-and-tags/default.nix b/pkgs/misc/source-and-tags/default.nix
index e3993d0daea..ece31bbaa74 100644
--- a/pkgs/misc/source-and-tags/default.nix
+++ b/pkgs/misc/source-and-tags/default.nix
@@ -4,8 +4,8 @@ args: with args; {
                                       || x ? meta && x.meta ? sourceWithTags );
   # hack because passthru doesn't work the way I'd expect. Don't have time to spend on this right now
   # that's why I'm abusing meta for the same purpose in ghcsAndLibs
-  sourceWithTagsFromDerivation = x : if (x ? passthru && x.passthru ? sourceWithTags ) then x.passthru.sourceWithTags
-                                     else if (x ? meta && x.meta ? sourceWithTags ) then x.meta.sourceWithTags
+  sourceWithTagsFromDerivation = x : if x ? passthru && x.passthru ? sourceWithTags  then x.passthru.sourceWithTags
+                                     else if x ? meta && x.meta ? sourceWithTags  then x.meta.sourceWithTags
                                        else null;
 
   # createTagFiles =  [ { name  = "my_tag_name_without_suffix", tagCmd = "ctags -R . -o \$TAG_FILE"; } ]
diff --git a/pkgs/misc/themes/gtk2/oxygen-gtk/default.nix b/pkgs/misc/themes/gtk2/oxygen-gtk/default.nix
index 9910768b547..185532589c6 100644
--- a/pkgs/misc/themes/gtk2/oxygen-gtk/default.nix
+++ b/pkgs/misc/themes/gtk2/oxygen-gtk/default.nix
@@ -2,12 +2,12 @@
   cmake, dbus_glib, glib, gtk, gdk_pixbuf, pkgconfig, xorg }:
 
 stdenv.mkDerivation rec {
-  version = "1.1.1";
-  name = "oxygen-gtk-${version}";
+  version = "1.3.2.1";
+  name = "oxygen-gtk2-${version}";
 
   src = fetchurl {
-    url = "mirror://kde/stable/oxygen-gtk/${version}/src/${name}.tar.bz2";
-    sha256 = "66d571f08ec999f56de412f42a0395c9dc60b73adaaece96c6da6e98353fe379";
+    url = "mirror://kde/stable/oxygen-gtk2/${version}/src/${name}.tar.bz2";
+    sha256 = "19l0dhjswvm7y99pvbd3qnz37k0p5y2slljy8mm4r8awjff3v4qi";
   };
 
   buildInputs = [ cmake dbus_glib glib gtk gdk_pixbuf
diff --git a/pkgs/misc/uboot/default.nix b/pkgs/misc/uboot/default.nix
index 7525c28e740..5928406eb54 100644
--- a/pkgs/misc/uboot/default.nix
+++ b/pkgs/misc/uboot/default.nix
@@ -20,14 +20,14 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "uboot-2009.11";
+  name = "uboot-2012.07";
    
   src = fetchurl {
-    url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2009.11.tar.bz2";
-    sha256 = "1rld7q3ww89si84g80hqskd1z995lni5r5xc4d4322n99wqiarh6";
+    url = "ftp://ftp.denx.de/pub/u-boot/u-boot-2012.07.tar.bz2";
+    sha256 = "15nli6h9a127ldizsck3g4ysy5j4m910wawspgpadz4vjyk213p0";
   };
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
@@ -40,6 +40,15 @@ stdenv.mkDerivation {
     cp tools/{envcrc,mkimage} $out/bin
   '';
 
+  # They have 'errno.h' included by a "-idirafter". As the gcc
+  # wrappers add the glibc include as "-idirafter", the only way
+  # we can make the glibc take priority is to -include errno.h.
+  postPatch = if stdenv ? glibc && stdenv.glibc != null then ''
+    sed -i 's,$(HOSTCPPFLAGS),-include ${stdenv.glibc}/include/errno.h $(HOSTCPPFLAGS),' config.mk
+  '' else "";
+
+  patches = [ ./sheevaplug-sdio.patch ./sheevaplug-config.patch ];
+
   configurePhase =
     assert platform ? uboot && platform.uboot != null;
     assert (platform ? ubootConfig);
diff --git a/pkgs/misc/uboot/guruplug.nix b/pkgs/misc/uboot/guruplug.nix
index 0e63a56073b..b1f4cab7b73 100644
--- a/pkgs/misc/uboot/guruplug.nix
+++ b/pkgs/misc/uboot/guruplug.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
     fi
   '';
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
diff --git a/pkgs/misc/uboot/sheevaplug-config.patch b/pkgs/misc/uboot/sheevaplug-config.patch
new file mode 100644
index 00000000000..487756217bf
--- /dev/null
+++ b/pkgs/misc/uboot/sheevaplug-config.patch
@@ -0,0 +1,57 @@
+diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
+index 7c8497c..b0da1e5 100644
+--- a/include/configs/sheevaplug.h
++++ b/include/configs/sheevaplug.h
+@@ -50,7 +50,6 @@
+ #define CONFIG_CMD_MII
+ #define CONFIG_CMD_MMC
+ #define CONFIG_CMD_NAND
+-#define CONFIG_JFFS2_NAND
+ #define CONFIG_CMD_PING
+ #define CONFIG_CMD_USB
+ /*
+@@ -73,25 +72,36 @@
+  * it has to be rounded to sector size
+  */
+ #define CONFIG_ENV_SIZE			0x20000	/* 128k */
+-#define CONFIG_ENV_ADDR			0xa0000
+-#define CONFIG_ENV_OFFSET		0xa0000	/* env starts here */
++#define CONFIG_ENV_ADDR			0x60000
++#define CONFIG_ENV_OFFSET		0x60000	/* env starts here */
+ 
+ /*
+  * Default environment variables
+  */
+-#define CONFIG_BOOTCOMMAND		"${x_bootcmd_kernel}; "	\
++#define CONFIG_BOOTCOMMAND		"${x_bootcmd_ubi0}; "	\
++	"${x_bootcmd_ubi1}; " \
++	"${x_bootcmd_ubi2}; " \
++	"${x_bootcmd_ubi3}; " \
+ 	"setenv bootargs ${x_bootargs} ${x_bootargs_root}; "	\
+-	"${x_bootcmd_usb}; bootm 0x6400000;"
++	"${x_bootcmd_usb}; bootm 0x200000 0x1100000;"
+ 
+ #define CONFIG_MTDPARTS		"orion_nand:512k(uboot),"	\
+-	"0x1ff00000@512k(rootfs) rw\0"
++	"0x1ff00000@512k(rootfs)\0"
++#define CONFIG_MTDPARTSK		"orion_nand:512k(uboot),"	\
++	"0x1ff00000@512k(rootfs)rw\0"
+ 
+ #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
+-	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
++	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTSK	\
++	"mtdparts=mtdparts="CONFIG_MTDPARTS	\
+ 	"mtdids=nand0=orion_nand\0"	\
+-	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
++	"ipaddr=192.168.1.4\0"	\
++	"x_bootcmd_ubi0=ubi part nand0,1\0" \
++	"x_bootcmd_ubi1=ubifsmount rootfs\0" \
++	"x_bootcmd_ubi2=ubifsload 0x200000 /nixos-kernel\0" \
++	"x_bootcmd_ubi3=ubifsload 0x1100000 /nixos-initrd\0" \
+ 	"x_bootcmd_usb=usb start\0" \
+-	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
++	"x_bootargs_root=ubi.mtd=rootfs root=ubi0:rootfs rw rootfstype=ubifs " \
++	"init=/boot/nixos-init systemConfig=/boot/default/system\0"
+ 
+ /*
+  * Ethernet Driver configuration
diff --git a/pkgs/misc/uboot/sheevaplug-sdio.patch b/pkgs/misc/uboot/sheevaplug-sdio.patch
new file mode 100644
index 00000000000..3a4ea2933a3
--- /dev/null
+++ b/pkgs/misc/uboot/sheevaplug-sdio.patch
@@ -0,0 +1,1091 @@
+diff --git a/arch/arm/include/asm/arch-kirkwood/config.h b/arch/arm/include/asm/arch-kirkwood/config.h
+index a9499b7..1294d7f 100644
+--- a/arch/arm/include/asm/arch-kirkwood/config.h
++++ b/arch/arm/include/asm/arch-kirkwood/config.h
+@@ -66,6 +66,7 @@
+ #define MV_SATA_BASE		KW_SATA_BASE
+ #define MV_SATA_PORT0_OFFSET	KW_SATA_PORT0_OFFSET
+ #define MV_SATA_PORT1_OFFSET	KW_SATA_PORT1_OFFSET
++#define MV_SDIO_BASE		KW_SDIO_BASE
+ 
+ /*
+  * NAND configuration
+@@ -107,6 +108,14 @@
+ #endif /* CONFIG_CMD_NET */
+ 
+ /*
++ * SDIO/MMC Card Configuration
++ */
++#ifdef CONFIG_CMD_MMC
++#define CONFIG_MMC
++#define CONFIG_MV_SDIO
++#endif /* CONFIG_CMD_MMC */
++
++/*
+  * USB/EHCI
+  */
+ #ifdef CONFIG_CMD_USB
+diff --git a/arch/arm/include/asm/arch-kirkwood/kirkwood.h b/arch/arm/include/asm/arch-kirkwood/kirkwood.h
+index 47771d5..343214b 100644
+--- a/arch/arm/include/asm/arch-kirkwood/kirkwood.h
++++ b/arch/arm/include/asm/arch-kirkwood/kirkwood.h
+@@ -55,6 +55,7 @@
+ #define KW_EGIGA0_BASE			(KW_REGISTER(0x72000))
+ #define KW_EGIGA1_BASE			(KW_REGISTER(0x76000))
+ #define KW_SATA_BASE			(KW_REGISTER(0x80000))
++#define KW_SDIO_BASE			(KW_REGISTER(0x90000))
+ 
+ /* Kirkwood Sata controller has two ports */
+ #define KW_SATA_PORT0_OFFSET		0x2000
+diff --git a/drivers/mmc/Makefile b/drivers/mmc/Makefile
+index c567737..081d5f4 100644
+--- a/drivers/mmc/Makefile
++++ b/drivers/mmc/Makefile
+@@ -34,6 +34,7 @@ COBJS-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+ COBJS-$(CONFIG_MMC_SPI) += mmc_spi.o
+ COBJS-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
+ COBJS-$(CONFIG_MV_SDHCI) += mv_sdhci.o
++COBJS-$(CONFIG_MV_SDIO) += mv_sdio.o
+ COBJS-$(CONFIG_MXC_MMC) += mxcmmc.o
+ COBJS-$(CONFIG_MXS_MMC) += mxsmmc.o
+ COBJS-$(CONFIG_OMAP_HSMMC) += omap_hsmmc.o
+diff --git a/drivers/mmc/mv_sdio.c b/drivers/mmc/mv_sdio.c
+new file mode 100644
+index 0000000..35969d3
+--- /dev/null
++++ b/drivers/mmc/mv_sdio.c
+@@ -0,0 +1,675 @@
++/*
++ * (C) Copyright 2009
++ * Marvell Semiconductor <www.marvell.com>
++ * Written-by: Gérald Kerma <geraker@gmail.com>
++ *
++ * (C) Copyright 2003
++ * Kyle Harris, Nexus Technologies, Inc. kharris@nexus-tech.net
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ */
++
++#include <config.h>
++#include <common.h>
++#include <malloc.h>
++#include <mmc.h>
++#include <asm/errno.h>
++#include <part.h>
++#include <asm/io.h>
++#ifdef CONFIG_KIRKWOOD
++#include <asm/arch/kirkwood.h>
++#endif
++#include "mv_sdio.h"
++
++#ifdef CONFIG_MMC
++
++#define DRIVER_NAME "mv-sdio"
++
++#ifdef DEBUG
++#define pr_debug(fmt, args...) printf(fmt, ##args)
++#else
++#define pr_debug(...) do { } while(0)
++#endif
++
++//static mv_sdio_t *mvsd = (mv_sdio_t *)mmc->priv;
++static mv_sdio_t *mvsd = (mv_sdio_t *)MV_SDIO_BASE;
++	
++static int is_sdhc;
++extern int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
++static block_dev_desc_t mmc_dev;
++block_dev_desc_t * mmc_get_dev(int dev)
++{
++	return ((block_dev_desc_t *)&mmc_dev);
++}
++
++/*
++ * FIXME needs to read cid and csd info to determine block size
++ * and other parameters
++ */
++static uchar mmc_buf[MMC_BLOCK_SIZE];
++static mv_mmc_csd_t mv_mmc_csd;
++static int mmc_ready = 0;
++
++/* MMC_DEFAULT_RCA should probably be just 1, but this may break other code
++   that expects it to be shifted. */
++static u_int16_t rca = 0;
++
++/* used for debug */
++static u_int32_t mv_mmc_size(const struct mv_mmc_csd *csd)
++{
++	u_int32_t block_len, mult, blocknr;
++
++	block_len = csd->read_bl_len << 12;
++	mult = csd->c_size_mult1 << 8;
++	blocknr = (csd->c_size+1) * mult;
++
++	return blocknr * block_len;
++}
++
++static int isprint (unsigned char ch)
++{
++	if (ch >= 32 && ch < 127)
++		return (1);
++
++	return (0);
++}
++
++static int toprint(char *dst, char c)
++{
++	if (isprint(c)) {
++		*dst = c;
++		return 1;
++	}
++
++	return sprintf(dst,"\\x%02x", c);
++
++}
++
++static void print_mmc_cid(mv_mmc_cid_t *cid)
++{
++	printf("MMC found. Card desciption is:\n");
++	printf("Manufacturer ID = %02x%02x%02x\n",
++		cid->id[0], cid->id[1], cid->id[2]);
++	printf("HW/FW Revision = %x %x\n",cid->hwrev, cid->fwrev);
++	cid->hwrev = cid->fwrev = 0;	/* null terminate string */
++	printf("Product Name = %s\n",cid->name);
++	printf("Serial Number = %02x%02x%02x\n",
++		cid->sn[0], cid->sn[1], cid->sn[2]);
++	printf("Month = %d\n",cid->month);
++	printf("Year = %d\n",1997 + cid->year);
++}
++
++static void print_sd_cid(mv_sd_cid_t *cid)
++{
++	int len;
++	char tbuf[64];
++
++	printf("SD%s found. Card desciption is:\n", is_sdhc?"HC":"");
++
++	len = 0;
++	len += toprint(&tbuf[len], cid->oid_0);
++	len += toprint(&tbuf[len], cid->oid_1);
++	tbuf[len] = 0;
++
++	printf("Manufacturer:       0x%02x, OEM \"%s\"\n",
++	    cid->mid, tbuf);
++
++	len = 0;
++	len += toprint(&tbuf[len], cid->pnm_0);
++	len += toprint(&tbuf[len], cid->pnm_1);
++	len += toprint(&tbuf[len], cid->pnm_2);
++	len += toprint(&tbuf[len], cid->pnm_3);
++	len += toprint(&tbuf[len], cid->pnm_4);
++	tbuf[len] = 0;
++
++	printf("Product name:       \"%s\", revision %d.%d\n",
++		tbuf,
++	    cid->prv >> 4, cid->prv & 15);
++
++	printf("Serial number:      %u\n",
++	    cid->psn_0 << 24 | cid->psn_1 << 16 | cid->psn_2 << 8 |
++	    cid->psn_3);
++	printf("Manufacturing date: %d/%d\n",
++	    cid->mdt_1 & 15,
++	    2000+((cid->mdt_0 & 15) << 4)+((cid->mdt_1 & 0xf0) >> 4));
++
++	printf("CRC:                0x%02x, b0 = %d\n",
++	    cid->crc >> 1, cid->crc & 1);
++}
++
++static void mvsdio_set_clock(unsigned int clock)
++{
++	unsigned int m;
++
++	m = MVSDMMC_BASE_FAST_CLOCK/(2*clock) - 1;
++
++	pr_debug("mvsdio_set_clock: dividor = 0x%x clock=%d\n",
++		      m, clock);
++
++
++	writew(m & 0x7ff, &mvsd->CLK_DIV);
++
++	if (isprint(1))
++	udelay(10*1000);
++}
++
++/****************************************************/
++static ulong * mv_mmc_cmd(ulong cmd, ulong arg, ushort xfermode, ushort resptype, ushort waittype)
++/****************************************************/
++{
++	static ulong resp[4];
++	ushort done ;
++	int err = 0 ;
++	ulong curr, start, diff, hz;
++	ushort response[8];
++
++	pr_debug("mv_mmc_cmd %x, arg: %x,xfer: %x,resp: %x, wait : %x\n"
++	, (unsigned int)cmd, (unsigned int)arg, xfermode, resptype, waittype);
++
++
++	/* clear status */
++	writew(0xffff, &mvsd->NOR_INTR_STATUS);
++	writew(0xffff, &mvsd->ERR_INTR_STATUS);
++
++	start = get_timer(0);
++	hz = CONFIG_SYS_HZ;
++
++	while((readw(&mvsd->PRESENT_STATE0) & CARD_BUSY)) {
++		curr = get_timer(0);
++		diff = (long) curr - (long) start;
++		if (diff > (3*hz))
++		{
++			/* 3 seconds timeout, card busy, can't sent cmd */
++			printf("card too busy \n");
++			return 0;
++		}
++	}
++
++	writew((ushort)(arg&0xffff), &mvsd->ARG_LOW);
++	writew((ushort)(arg>>16), &mvsd->ARG_HI);
++	writew(xfermode, &mvsd->XFER_MODE);
++	if( (cmd == MMC_CMD_READ_BLOCK) || (cmd == 25) )
++	{
++		writew(((cmd << 8) | resptype | 0x3c ) , &mvsd->CMD);
++	pr_debug("cmd reg : %x\n", readw(&mvsd->CMD)) ;
++
++	}
++	else
++	{
++		writew(((cmd << 8) | resptype ), &mvsd->CMD);
++	}
++
++	done = readw(&mvsd->NOR_INTR_STATUS) & waittype;
++	start = get_timer(0);
++
++	while( done!=waittype)
++	{
++		done = readw(&mvsd->NOR_INTR_STATUS) & waittype;
++
++		if( readw(&mvsd->NOR_INTR_STATUS) & 0x8000 )
++		{		
++			pr_debug("Error! cmd : %d, err : %04x\n", (unsigned int)cmd, readw(&mvsd->ERR_INTR_STATUS)) ;
++
++			return 0 ;	/* error happen */
++		}
++
++		curr = get_timer(0);
++		diff = (long) curr - (long) start;
++		if (diff > (3*hz))
++		{
++			pr_debug("cmd timeout, status : %04x\n", readw(&mvsd->NOR_INTR_STATUS));
++			pr_debug("xfer mode : %04x\n", readw(&mvsd->XFER_MODE));
++
++			err = 1 ;
++			break;
++		}
++	}
++
++	response[0] = readw(&mvsd->RSP0);
++	response[1] = readw(&mvsd->RSP1);
++	response[2] = readw(&mvsd->RSP2);
++	response[3] = readw(&mvsd->RSP3);
++	response[4] = readw(&mvsd->RSP4);
++	response[5] = readw(&mvsd->RSP5);
++	response[6] = readw(&mvsd->RSP6);
++	response[7] = readw(&mvsd->RSP7);
++
++	memset(resp, 0, sizeof(resp));
++
++	switch (resptype & 0x3) {
++		case SDIO_CMD_RSP_48:
++		case SDIO_CMD_RSP_48BUSY:
++			resp[0] = ((response[2] & 0x3f) << (8 - 8)) |
++				((response[1] & 0xffff) << (14 - 8)) |
++				((response[0] & 0x3ff) << (30 - 8));
++			resp[1] = ((response[0] & 0xfc00) >> 10);
++			break;
++
++		case SDIO_CMD_RSP_136:
++			resp[3] = ((response[7] & 0x3fff) << 8)	|
++				((response[6] & 0x3ff) << 22);
++			resp[2] = ((response[6] & 0xfc00) >> 10)	|
++				((response[5] & 0xffff) << 6)	|
++				((response[4] & 0x3ff) << 22);
++			resp[1] = ((response[4] & 0xfc00) >> 10)	|
++				((response[3] & 0xffff) << 6)	|
++				((response[2] & 0x3ff) << 22);
++			resp[0] = ((response[2] & 0xfc00) >> 10)	|
++				((response[1] & 0xffff) << 6)	|
++				((response[0] & 0x3ff) << 22);
++			break;
++		default:
++			return 0;
++	}
++	int i;
++	pr_debug("MMC resp :");
++	for (i=0; i<4; ++i ) {
++		pr_debug(" %08x", (unsigned int)resp[i]);
++	}
++	pr_debug("\n");
++	if( err )
++		return NULL ;
++	else
++		return resp;
++}
++
++/****************************************************/
++static int mv_mmc_block_read(uchar *dst, ulong src, ulong len)
++/****************************************************/
++{
++	ulong *resp;
++
++	if (len == 0) {
++		return 0;
++	}
++
++	if (is_sdhc) {
++		/* SDHC: use block address */
++		src >>= 9;
++	}
++
++	pr_debug("mmc_block_rd dst %lx src %lx len %d\n", (ulong)dst, src, (int)len);
++
++	/* prepare for dma transfer */
++	writew(((ulong)(dst))&0xffff,&mvsd->SYS_ADDR_LOW);
++	writew(((ulong)(dst)>>16)&0xffff,&mvsd->SYS_ADDR_HI);
++	writew(len,&mvsd->BLK_SIZE);
++	writew(1,&mvsd->BLK_COUNT);
++	
++	/* send read command */
++	resp = mv_mmc_cmd(MMC_CMD_READ_BLOCK, src, 0x10 ,
++			SDIO_CMD_RSP_48, SDIO_NOR_XFER_DONE);
++	if (!resp) {
++		pr_debug("mv_mmc_block_read: mmc read block cmd fails\n");
++		return -EIO;
++	}
++
++	return 0;
++}
++
++/****************************************************/
++int mv_mmc_read(ulong src, uchar *dst, int size)
++/****************************************************/
++{
++	ulong end, part_start, part_end, part_len, aligned_start, aligned_end;
++	ulong mmc_block_size, mmc_block_address;
++
++	if (size == 0) {
++		return 0;
++	}
++
++	if (!mmc_ready) {
++		printf("Please initial the MMC first\n");
++		return -1;
++	}
++
++	mmc_block_size = MMC_BLOCK_SIZE;
++	mmc_block_address = ~(mmc_block_size - 1);
++
++	end = src + size;
++	part_start = ~mmc_block_address & src;
++	part_end = ~mmc_block_address & end;
++	aligned_start = mmc_block_address & src;
++	aligned_end = mmc_block_address & end;
++
++	/* all block aligned accesses */
++	pr_debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++	(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++	if (part_start) {
++		part_len = mmc_block_size - part_start;
++		pr_debug("ps src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++		(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++		if ((mv_mmc_block_read(mmc_buf, aligned_start, mmc_block_size)) < 0) {
++			return -1;
++		}
++		memcpy(dst, mmc_buf+part_start, part_len);
++		dst += part_len;
++		src += part_len;
++	}
++	pr_debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++	(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++	for (; src < aligned_end; aligned_start +=mmc_block_size, src += mmc_block_size, dst += mmc_block_size) {
++		pr_debug("al src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++		(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++		if ((mv_mmc_block_read(mmc_buf, aligned_start, mmc_block_size)) < 0) {
++		 	printf("mmc block read error\n");
++			return -1;
++		}
++		memcpy(dst, mmc_buf, mmc_block_size);
++	}
++	pr_debug("src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++	(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++	if (part_end && src < end) {
++		pr_debug("pe src %lx dst %lx end %lx pstart %lx pend %lx astart %lx aend %lx\n",
++		(long unsigned int)src,(ulong)dst, end, part_start, part_end, aligned_start, aligned_end);
++
++		if ((mv_mmc_block_read(mmc_buf, aligned_end, mmc_block_size)) < 0) {
++			return -1;
++		}
++		memcpy(dst, mmc_buf, part_end);
++	}
++	return 0;
++}
++
++/****************************************************/
++static ulong mv_mmc_bread(int dev_num, ulong blknr, ulong blkcnt, ulong *dst)
++/****************************************************/
++{
++	int mmc_block_size = MMC_BLOCK_SIZE;
++	ulong src = blknr * mmc_block_size;
++
++	mv_mmc_read(src, (uchar *)dst, blkcnt*mmc_block_size);
++	return blkcnt;
++}
++
++/****************************************************/
++int mmc_legacy_init(int verbose)
++/****************************************************/
++{
++	int retries, rc = -ENODEV;
++	ulong *resp;
++	int sd_ver20;
++	int is_sd;
++	ushort reg;
++	uchar cidbuf[64];
++
++	sd_ver20 = 0;
++	is_sdhc = 0;
++	is_sd = 0;
++
++	/* Initial Host Ctrl : Timeout : max , Normal Speed mode, 4-bit data mode */
++	/* Big Endian, SD memory Card, Push_pull CMD Line */
++	writew( SDIO_HOST_CTRL_TMOUT(0xf) |
++		SDIO_HOST_CTRL_DATA_WIDTH_4_BITS |
++		SDIO_HOST_CTRL_BIG_ENDIAN |
++		SDIO_HOST_CTRL_PUSH_PULL_EN |
++		SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY ,
++		&mvsd->HOST_CTRL);
++
++	writew( 0, &mvsd->CLK_CTRL);
++
++	/* enable status */
++	writew( 0xffff, &mvsd->NOR_STATUS_EN);
++	writew( 0xffff, &mvsd->ERR_STATUS_EN);
++
++	/* disable interrupts */
++	writew( 0, &mvsd->NOR_INTR_EN);
++	writew( 0, &mvsd->ERR_INTR_EN);
++
++	writew( 0x100, &mvsd->SW_RESET);
++	udelay(10000);
++
++	mv_mmc_csd.c_size = 0;
++
++	/* reset */
++	retries = 10;
++	resp = mv_mmc_cmd(0, 0, 0, SDIO_CMD_RSP_NONE, SDIO_NOR_CMD_DONE );
++	pr_debug("cmd 0 resp : %08x %08x %08x %08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++	pr_debug ("trying to detect SD card version\n");
++
++	resp = mv_mmc_cmd(8, 0x000001aa, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++	pr_debug("cmd 8 resp : %08x %08x %08x %08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++	if (resp && (resp[0] & 0x1ff)==0x1aa) {
++		pr_debug ("SD version 2.0 card detected\n");
++
++		sd_ver20 = 1;
++	}
++
++	if (sd_ver20)
++		retries = 50;
++	else
++		retries = 10;
++
++	while (retries--) {
++		resp = mv_mmc_cmd(55, 0, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++		pr_debug("cmd 55 resp : %08x %08x %08x %08x\n",
++		(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++		if (sd_ver20)
++			resp = mv_mmc_cmd(41, 0x40300000, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++		else
++			resp = mv_mmc_cmd(41, 0x00300000, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++
++		pr_debug("cmd 41 resp : %08x %08x %08x %08x\n",
++		(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++		if (resp && (resp[0] & 0x80000000)) {
++			pr_debug ("detected SD card\n");
++
++			is_sd = 1;
++			break;
++		}
++
++		udelay(100*1000);
++	}
++
++	if (retries <= 0 && !is_sd) {
++		pr_debug ("failed to detect SD card, trying MMC\n");
++
++		retries = 10;
++		while (retries--) {
++			resp = mv_mmc_cmd(1, 0, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++			pr_debug("cmd 01 resp : %08x %08x %08x %08x\n",
++			(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++			if (resp && (resp[0] & 0x80000000)) {
++				printf ("detected MMC card\n");
++				reg = readw(&mvsd->HOST_CTRL);
++				reg &= ~(0x3<<1);
++				reg |= SDIO_HOST_CTRL_CARD_TYPE_IO_MMC;
++				writew( reg, &mvsd->HOST_CTRL);
++				break;
++			}
++
++			udelay(100*1000);
++		}
++	}
++		
++	if (retries <= 0) {
++		pr_debug ("detect fails\n");
++
++		return -ENODEV;
++	}
++
++	/* try to get card id */
++	resp = mv_mmc_cmd(2, 0, 0, SDIO_CMD_RSP_136, SDIO_NOR_CMD_DONE );
++	pr_debug("cmd 2 resp : %08x %08x %08x %08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++	if (resp == NULL) {
++		pr_debug ("read cid fails\n");
++
++		return -ENODEV;
++	}
++
++	if (is_sd) {
++		mv_sd_cid_t *cid = (mv_sd_cid_t *) resp;
++
++		memcpy(cidbuf, resp, sizeof(mv_sd_cid_t));
++
++		sprintf((char *) mmc_dev.vendor,
++			"Man %02x OEM %c%c \"%c%c%c%c%c\"",
++			cid->mid, cid->oid_0, cid->oid_1,
++			cid->pnm_0, cid->pnm_1, cid->pnm_2, cid->pnm_3, cid->pnm_4);
++
++		sprintf((char *) mmc_dev.product, "%d",
++			(cid->psn_0 << 24) | (cid->psn_1 <<16) | (cid->psn_2 << 8) | (cid->psn_3 << 8));
++		
++		sprintf((char *) mmc_dev.revision, "%d.%d", cid->prv>>4, cid->prv & 0xff);
++		
++	} else {
++		/* TODO configure mmc driver depending on card attributes */
++		mv_mmc_cid_t *cid = (mv_mmc_cid_t *) resp;
++
++		memcpy(cidbuf, resp, sizeof(mv_sd_cid_t));
++
++
++		sprintf((char *) mmc_dev.vendor,
++			"Man %02x%02x%02x Snr %02x%02x%02x",
++			cid->id[0], cid->id[1], cid->id[2],
++			cid->sn[0], cid->sn[1], cid->sn[2]);
++		sprintf((char *) mmc_dev.product, "%s", cid->name);
++		sprintf((char *) mmc_dev.revision, "%x %x", cid->hwrev, cid->fwrev);
++	}
++	
++	/* fill in device description */
++	mmc_dev.if_type = IF_TYPE_MMC;
++	mmc_dev.part_type = PART_TYPE_DOS;
++	mmc_dev.dev = 0;
++	mmc_dev.lun = 0;
++	mmc_dev.type = 0;
++
++	/* FIXME fill in the correct size (is set to 128MByte) */
++	mmc_dev.blksz = MMC_BLOCK_SIZE;
++	mmc_dev.lba = 0x10000;
++
++	mmc_dev.removable = 0;
++	mmc_dev.block_read = (unsigned long) mv_mmc_bread;
++
++	/* MMC exists, get CSD too */
++	resp = mv_mmc_cmd(MMC_CMD_SET_RCA, 0, 0, SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++	if (resp == NULL) {
++		pr_debug ("set rca fails\n");
++
++		return -ENODEV;
++	}
++	pr_debug("cmd3 resp : 0x%08x 0x%08x 0x%08x 0x%08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3]);
++
++
++	if (is_sd)
++		rca = resp[0] >> 16;
++	else
++		rca = 0;
++
++	resp = mv_mmc_cmd(MMC_CMD_SEND_CSD, rca<<16, 0, SDIO_CMD_RSP_136,SDIO_NOR_CMD_DONE );
++	pr_debug("cmd 9 resp : %08x %08x %08x %08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++	if (resp == NULL) {
++		pr_debug ("read csd fails\n");
++
++		return -ENODEV;
++	}
++
++	memcpy(&mv_mmc_csd, (mv_mmc_csd_t *) resp, sizeof(mv_mmc_csd_t));
++	rc = 0;
++	mmc_ready = 1;
++
++	/* FIXME add verbose printout for csd */
++	pr_debug ("size = %u\n", mv_mmc_size(&mv_mmc_csd));
++
++
++	resp = mv_mmc_cmd(7, rca<<16, 0, SDIO_CMD_RSP_48BUSY, SDIO_NOR_CMD_DONE);
++	if (resp == NULL) {
++		pr_debug ("select card fails\n");
++
++		return -ENODEV;
++	}
++	pr_debug("cmd 7 resp : %08x %08x %08x %08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3] );
++
++
++	if (is_sd) {
++		resp = mv_mmc_cmd(55, rca<<16, 0,  SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++		if (resp == NULL) {
++			pr_debug ("cmd55 fails\n");
++
++			return -ENODEV;
++		}
++		pr_debug("cmd55 resp : 0x%08x 0x%08x 0x%08x 0x%08x\n",
++		(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3]);
++
++
++		resp = mv_mmc_cmd(6, (rca<<16) | 0x2 , 0, SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++		if (resp == NULL) {
++			pr_debug ("cmd55 fails\n");
++
++			return -ENODEV;
++		}
++	pr_debug("cmd6 resp : 0x%08x 0x%08x 0x%08x 0x%08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3]);
++
++	}
++
++	resp = (ulong *) &mv_mmc_csd;
++	pr_debug("csd: 0x%08x 0x%08x 0x%08x 0x%08x\n",
++	(unsigned int)resp[0], (unsigned int)resp[1], (unsigned int)resp[2], (unsigned int)resp[3]);
++
++
++	/* check SDHC */
++	if ((resp[0]&0xf0000000)==0x40000000)
++		is_sdhc = 1;
++
++	/* set block len */
++	resp = mv_mmc_cmd(MMC_CMD_SET_BLOCKLEN, MMC_BLOCK_SIZE, 0, SDIO_CMD_RSP_48, SDIO_NOR_CMD_DONE );
++	if (!resp) {
++		pr_debug("mv_mmc_block_read: set blk len fails\n");
++	 	return -ENODEV;
++	}
++
++	if (verbose) {
++		if (is_sd)
++			print_sd_cid((mv_sd_cid_t *) cidbuf);
++		else
++			print_mmc_cid((mv_mmc_cid_t *) cidbuf);
++	}
++
++	mvsdio_set_clock(CONFIG_SYS_MMC_CLK_PP);
++
++	fat_register_device(&mmc_dev,1); /* partitions start counting with 1 */
++
++	return 0;
++}
++
++#endif	/* CONFIG_MMC */
+diff --git a/drivers/mmc/mv_sdio.h b/drivers/mmc/mv_sdio.h
+new file mode 100644
+index 0000000..9707000
+--- /dev/null
++++ b/drivers/mmc/mv_sdio.h
+@@ -0,0 +1,310 @@
++/*
++ * (C) Copyright 2009
++ * Marvell Semiconductor <www.marvell.com>
++ * Written-by: Gérald Kerma <geraker@gmail.com>
++ *
++ * See file CREDITS for list of people who contributed to this
++ * project.
++ *
++ * This program is free software; you can redistribute it and/or
++ * modify it under the terms of the GNU General Public License as
++ * published by the Free Software Foundation; either version 2 of
++ * the License, or (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
++ * MA 02110-1301 USA
++ */
++
++#ifndef _MVSDIO_INCLUDE
++#define _MVSDIO_INCLUDE
++
++//#define SDIO_REG(x) (MV_SDIO_BASE + (x))
++
++#define MVSDMMC_DMA_SIZE			65536
++#define MVSDMMC_CMD_TIMEOUT			2 /* 100 usec*/
++
++/*
++ * Clock rates
++ */
++
++#define MVSD_CLOCKRATE_MAX			50000000
++#define MVSD_BASE_DIV_MAX			0x7ff
++
++#define CONFIG_SYS_MMC_CLK_PP			25000000
++
++/*
++ * The base MMC clock rate
++ */
++
++#define MVSDMMC_CLOCKRATE_MIN			100000
++#define MVSDMMC_CLOCKRATE_MAX			MVSD_CLOCKRATE_MAX
++#define MVSDMMC_BASE_FAST_CLOCK			CONFIG_SYS_TCLK
++
++
++/*
++ * SDIO register
++ */
++#ifndef __ASSEMBLY__
++
++/*
++ * Structure for struct SoC access.
++ * Names starting with '_' are fillers.
++ */
++typedef struct mv_sdio {
++	/*	reg			Offset */
++	u32	SYS_ADDR_LOW;		/* 0x00 */
++	u32	SYS_ADDR_HI;		/* 0x04 */
++	u32	BLK_SIZE;		/* 0x08 */
++	u32	BLK_COUNT;		/* 0x0c */
++	u32	ARG_LOW;		/* 0x10 */
++	u32	ARG_HI;			/* 0x14 */
++	u32	XFER_MODE;		/* 0x18 */
++	u32	CMD;			/* 0x1c */
++	u32	RSP0;			/* 0x20 */
++	u32	RSP1;			/* 0x24 */
++	u32	RSP2;			/* 0x28 */
++	u32	RSP3;			/* 0x2c */
++	u32	RSP4;			/* 0x30 */
++	u32	RSP5;			/* 0x34 */
++	u32	RSP6;			/* 0x38 */
++	u32	RSP7;			/* 0x3c */
++	u32	BUF_DATA_PORT;		/* 0x40 */
++	u32	RSVED;			/* 0x44 */
++	u32	PRESENT_STATE0;		/* 0x48 */
++	u32	PRESENT_STATE1;		/* 0x4c */
++	u32	HOST_CTRL;		/* 0x50 */
++	u32	BLK_GAP_CTRL;		/* 0x54 */
++	u32	CLK_CTRL;		/* 0x58 */
++	u32	SW_RESET;		/* 0x5c */
++	u32	NOR_INTR_STATUS;	/* 0x60 */
++	u32	ERR_INTR_STATUS;	/* 0x64 */
++	u32	NOR_STATUS_EN;		/* 0x68 */
++	u32	ERR_STATUS_EN;		/* 0x6c */
++	u32	NOR_INTR_EN;		/* 0x70 */
++	u32	ERR_INTR_EN;		/* 0x74 */
++	u32	AUTOCMD12_ERR_STATUS;	/* 0x78 */
++	u32	CURR_BYTE_LEFT;		/* 0x7c */
++	u32	CURR_BLK_LEFT;		/* 0x80 */
++	u32	AUTOCMD12_ARG_LOW;	/* 0x84 */
++	u32	AUTOCMD12_ARG_HI;	/* 0x88 */
++	u32	AUTOCMD12_INDEX;	/* 0x8c */
++	u32	AUTO_RSP0;		/* 0x90 */
++	u32	AUTO_RSP1;		/* 0x94 */
++	u32	AUTO_RSP2;		/* 0x98 */
++	u32	_9c;			/* 0x9c */
++	u32	_a0[0x78];		/* 0xa0 */
++	u32	CLK_DIV;		/* 0x128 */
++
++} mv_sdio_t;
++
++#endif /* __ASSEMBLY__ */
++
++/*
++ * SDIO_PRESENT_STATE
++ */
++
++#define CARD_BUSY				(1 << 1)
++#define CMD_INHIBIT				(1 << 0)
++#define CMD_TXACTIVE				(1 << 8)
++#define CMD_RXACTIVE				(1 << 9)
++#define CMD_AUTOCMD12ACTIVE			(1 << 14)
++
++#define CMD_BUS_BUSY				(CMD_AUTOCMD12ACTIVE|	\
++						CMD_RXACTIVE|	\
++						CMD_TXACTIVE|	\
++						CMD_INHIBIT|	\
++						CARD_BUSY)
++
++/*
++ * SDIO_CMD
++ */
++
++#define SDIO_CMD_RSP_NONE			(0 << 0)
++#define SDIO_CMD_RSP_136			(1 << 0)
++#define SDIO_CMD_RSP_48				(2 << 0)
++#define SDIO_CMD_RSP_48BUSY			(3 << 0)
++
++#define SDIO_CMD_CHECK_DATACRC16		(1 << 2)
++#define SDIO_CMD_CHECK_CMDCRC			(1 << 3)
++#define SDIO_CMD_INDX_CHECK			(1 << 4)
++#define SDIO_CMD_DATA_PRESENT			(1 << 5)
++#define SDIO_UNEXPECTED_RESP			(1 << 7)
++
++
++/*
++ * SDIO_XFER_MODE
++ */
++
++#define SDIO_XFER_MODE_STOP_CLK			(1 << 5)
++#define SDIO_XFER_MODE_HW_WR_DATA_EN		(1 << 1)
++#define SDIO_XFER_MODE_AUTO_CMD12		(1 << 2)
++#define SDIO_XFER_MODE_INT_CHK_EN		(1 << 3)
++#define SDIO_XFER_MODE_TO_HOST			(1 << 4)
++
++
++/*
++ * SDIO_HOST_CTRL
++ */
++
++#define SDIO_HOST_CTRL_PUSH_PULL_EN 		(1 << 0)
++
++#define SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY 	(0 << 1)
++#define SDIO_HOST_CTRL_CARD_TYPE_IO_ONLY 	(1 << 1)
++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MEM_COMBO 	(2 << 1)
++#define SDIO_HOST_CTRL_CARD_TYPE_IO_MMC 	(3 << 1)
++#define SDIO_HOST_CTRL_CARD_TYPE_MASK	 	(3 << 1)
++
++#define SDIO_HOST_CTRL_BIG_ENDIAN 		(1 << 3)
++#define SDIO_HOST_CTRL_LSB_FIRST 		(1 << 4)
++#define SDIO_HOST_CTRL_ID_MODE_LOW_FREQ 	(1 << 5)
++#define SDIO_HOST_CTRL_HALF_SPEED 		(1 << 6)
++#define SDIO_HOST_CTRL_DATA_WIDTH_4_BITS 	(1 << 9)
++#define SDIO_HOST_CTRL_HI_SPEED_EN 		(1 << 10)
++
++
++#define SDIO_HOST_CTRL_TMOUT_MASK 		(0xf << 11)
++#define SDIO_HOST_CTRL_TMOUT_MAX 		(0xf << 11)
++#define SDIO_HOST_CTRL_TMOUT(x) 		((x) << 11)
++#define SDIO_HOST_CTRL_TMOUT_EN 		(1 << 15)
++
++#define SDIO_HOST_CTRL_DFAULT_OPEN_DRAIN 	\
++		(SDIO_HOST_CTRL_TMOUT(x)(0xf))
++#define SDIO_HOST_CTRL_DFAULT_PUSH_PULL 	\
++		(SDIO_HOST_CTRL_TMOUT(x)(0xf) | SDIO_HOST_CTRL_PUSH_PULL_EN)
++
++
++/*
++ * NOR status bits
++ */
++
++#define SDIO_NOR_ERROR				(1 << 15)
++#define SDIO_NOR_UNEXP_RSP			(1 << 14)
++#define SDIO_NOR_AUTOCMD12_DONE			(1 << 13)
++#define SDIO_NOR_SUSPEND_ON			(1 << 12)
++#define SDIO_NOR_LMB_FF_8W_AVAIL		(1 << 11)
++#define SDIO_NOR_LMB_FF_8W_FILLED		(1 << 10)
++#define SDIO_NOR_READ_WAIT_ON			(1 << 9)
++#define SDIO_NOR_CARD_INT			(1 << 8)
++#define SDIO_NOR_READ_READY			(1 << 5)
++#define SDIO_NOR_WRITE_READY			(1 << 4)
++#define SDIO_NOR_DMA_INI			(1 << 3)
++#define SDIO_NOR_BLK_GAP_EVT			(1 << 2)
++#define SDIO_NOR_XFER_DONE			(1 << 1)
++#define SDIO_NOR_CMD_DONE			(1 << 0)
++
++
++/*
++ * ERR status bits
++ */
++
++#define SDIO_ERR_CRC_STATUS			(1 << 14)
++#define SDIO_ERR_CRC_STARTBIT			(1 << 13)
++#define SDIO_ERR_CRC_ENDBIT			(1 << 12)
++#define SDIO_ERR_RESP_TBIT			(1 << 11)
++#define SDIO_ERR_SIZE				(1 << 10)
++#define SDIO_ERR_CMD_STARTBIT			(1 << 9)
++#define SDIO_ERR_AUTOCMD12			(1 << 8)
++#define SDIO_ERR_DATA_ENDBIT			(1 << 6)
++#define SDIO_ERR_DATA_CRC			(1 << 5)
++#define SDIO_ERR_DATA_TIMEOUT			(1 << 4)
++#define SDIO_ERR_CMD_INDEX			(1 << 3)
++#define SDIO_ERR_CMD_ENDBIT			(1 << 2)
++#define SDIO_ERR_CMD_CRC			(1 << 1)
++#define SDIO_ERR_CMD_TIMEOUT			(1 << 0)
++
++#define SDIO_ERR_INTR_MASK			0xFFFF
++
++
++#define MMC_BLOCK_SIZE                  512
++#define MMC_CMD_RESET                   0
++#define MMC_CMD_SEND_OP_COND            1
++#define MMC_CMD_ALL_SEND_CID            2
++#define MMC_CMD_SET_RCA                 3
++#define MMC_CMD_SELECT_CARD		7
++#define MMC_CMD_SEND_CSD                9
++#define MMC_CMD_SEND_CID                10
++#define MMC_CMD_SEND_STATUS             13
++#define MMC_CMD_SET_BLOCKLEN            16
++#define MMC_CMD_READ_BLOCK              17
++#define MMC_CMD_RD_BLK_MULTI            18
++#define MMC_CMD_WRITE_BLOCK             24
++#define MMC_MAX_BLOCK_SIZE              512
++
++typedef struct mv_mmc_cid
++{
++	/* FIXME: BYTE_ORDER */
++	uchar year:4,
++	month:4;
++	uchar sn[3];
++	uchar fwrev:4,
++	hwrev:4;
++	uchar name[6];
++	uchar id[3];
++} mv_mmc_cid_t;
++
++typedef struct mv_mmc_csd
++{
++	uchar   ecc:2,
++		file_format:2,
++		tmp_write_protect:1,
++		perm_write_protect:1,
++		copy:1,
++		file_format_grp:1;
++	uint64_t content_prot_app:1,
++		rsvd3:4,
++		write_bl_partial:1,
++		write_bl_len:4,
++		r2w_factor:3,
++		default_ecc:2,
++		wp_grp_enable:1,
++		wp_grp_size:5,
++		erase_grp_mult:5,
++		erase_grp_size:5,
++		c_size_mult1:3,
++		vdd_w_curr_max:3,
++		vdd_w_curr_min:3,
++		vdd_r_curr_max:3,
++		vdd_r_curr_min:3,
++		c_size:12,
++		rsvd2:2,
++		dsr_imp:1,
++		read_blk_misalign:1,
++		write_blk_misalign:1,
++		read_bl_partial:1;
++	ushort  read_bl_len:4,
++		ccc:12;
++	uchar   tran_speed;
++	uchar   nsac;
++	uchar   taac;
++	uchar   rsvd1:2,
++		spec_vers:4,
++		csd_structure:2;
++} mv_mmc_csd_t;
++
++typedef struct {
++	char		pnm_0;	/* product name */
++	char		oid_1;	/* OEM/application ID */
++	char		oid_0;
++	uint8_t		mid;	/* manufacturer ID */
++	char		pnm_4;
++	char		pnm_3;
++	char		pnm_2;
++	char		pnm_1;
++	uint8_t		psn_2;	/* product serial number */
++	uint8_t		psn_1;
++	uint8_t		psn_0;	/* MSB */
++	uint8_t		prv;	/* product revision */
++	uint8_t		crc;	/* CRC7 checksum, b0 is unused and set to 1 */
++	uint8_t		mdt_1;	/* manufacturing date, LSB, RRRRyyyy yyyymmmm */
++	uint8_t		mdt_0;	/* MSB */
++	uint8_t		psn_3;	/* LSB */
++} mv_sd_cid_t;
++
++#endif /* _MVSDIO_INCLUDE */
+diff --git a/include/configs/sheevaplug.h b/include/configs/sheevaplug.h
+index 83dd8ff..7c8497c 100644
+--- a/include/configs/sheevaplug.h
++++ b/include/configs/sheevaplug.h
+@@ -1,3 +1,4 @@
++
+ /*
+  * (C) Copyright 2009
+  * Marvell Semiconductor <www.marvell.com>
+@@ -47,7 +48,9 @@
+ #define CONFIG_CMD_DHCP
+ #define CONFIG_CMD_ENV
+ #define CONFIG_CMD_MII
++#define CONFIG_CMD_MMC
+ #define CONFIG_CMD_NAND
++#define CONFIG_JFFS2_NAND
+ #define CONFIG_CMD_PING
+ #define CONFIG_CMD_USB
+ /*
+@@ -70,8 +73,8 @@
+  * it has to be rounded to sector size
+  */
+ #define CONFIG_ENV_SIZE			0x20000	/* 128k */
+-#define CONFIG_ENV_ADDR			0x60000
+-#define CONFIG_ENV_OFFSET		0x60000	/* env starts here */
++#define CONFIG_ENV_ADDR			0xa0000
++#define CONFIG_ENV_OFFSET		0xa0000	/* env starts here */
+ 
+ /*
+  * Default environment variables
+@@ -81,10 +84,11 @@
+ 	"${x_bootcmd_usb}; bootm 0x6400000;"
+ 
+ #define CONFIG_MTDPARTS		"orion_nand:512k(uboot),"	\
+-	"3m@1m(kernel),1m@4m(psm),13m@5m(rootfs) rw\0"
++	"0x1ff00000@512k(rootfs) rw\0"
+ 
+ #define CONFIG_EXTRA_ENV_SETTINGS	"x_bootargs=console"	\
+ 	"=ttyS0,115200 mtdparts="CONFIG_MTDPARTS	\
++	"mtdids=nand0=orion_nand\0"	\
+ 	"x_bootcmd_kernel=nand read 0x6400000 0x100000 0x300000\0" \
+ 	"x_bootcmd_usb=usb start\0" \
+ 	"x_bootargs_root=root=/dev/mtdblock3 rw rootfstype=jffs2\0"
diff --git a/pkgs/misc/uboot/sheevaplug.nix b/pkgs/misc/uboot/sheevaplug.nix
index ad8029d9020..4d4f61c40a7 100644
--- a/pkgs/misc/uboot/sheevaplug.nix
+++ b/pkgs/misc/uboot/sheevaplug.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
     fi
   '';
 
-  buildNativeInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   dontStrip = true;
 
diff --git a/pkgs/os-specific/darwin/native-x11-and-opengl/default.nix b/pkgs/os-specific/darwin/native-x11-and-opengl/default.nix
new file mode 100644
index 00000000000..cee03741dce
--- /dev/null
+++ b/pkgs/os-specific/darwin/native-x11-and-opengl/default.nix
@@ -0,0 +1,12 @@
+{ stdenv, writeScript }:
+
+assert stdenv.isDarwin;
+
+stdenv.mkDerivation rec {
+  name = "darwin-native-x11-and-opengl";
+
+  builder = writeScript "${name}-builder.sh" ''
+    /bin/mkdir -p $out
+    /bin/ln -sv /usr/X11/{bin,lib,include,share} $out/
+  '';
+}
diff --git a/pkgs/os-specific/gnu/default.nix b/pkgs/os-specific/gnu/default.nix
index 0a42b83a46f..27b1cdd3e8a 100644
--- a/pkgs/os-specific/gnu/default.nix
+++ b/pkgs/os-specific/gnu/default.nix
@@ -3,7 +3,7 @@
 args@{ fetchgit, stdenv, autoconf, automake, automake111x, libtool
 , texinfo, glibcCross, hurdPartedCross, libuuid, samba_light
 , gccCrossStageStatic, gccCrossStageFinal
-, forceBuildDrv, forceSystem, newScope, platform, config, crossSystem
+, forceNativeDrv, forceSystem, newScope, platform, config, crossSystem
 , overrides ? {} }:
 
 with args;
@@ -12,18 +12,18 @@ let
   callPackage = newScope gnu;
 
   gnu = {
-    hurdCross = forceBuildDrv(callPackage ./hurd {
+    hurdCross = forceNativeDrv (callPackage ./hurd {
       inherit fetchgit stdenv autoconf libtool texinfo
         glibcCross hurdPartedCross;
       inherit (gnu) machHeaders mig;
-      libuuid = libuuid.hostDrv;
+      libuuid = libuuid.crossDrv;
       automake = automake111x;
       headersOnly = false;
       cross = assert crossSystem != null; crossSystem;
       gccCross = gccCrossStageFinal;
     });
 
-    hurdCrossIntermediate = forceBuildDrv(callPackage ./hurd {
+    hurdCrossIntermediate = forceNativeDrv (callPackage ./hurd {
       inherit fetchgit stdenv autoconf libtool texinfo glibcCross;
       inherit (gnu) machHeaders mig;
       hurdPartedCross = null;
@@ -58,7 +58,7 @@ let
       hurd = null;
     };
 
-    libpthreadCross = forceBuildDrv(callPackage ./libpthread {
+    libpthreadCross = forceNativeDrv (callPackage ./libpthread {
       inherit fetchgit stdenv autoconf automake libtool glibcCross;
       inherit (gnu) machHeaders hurdHeaders;
       hurd = gnu.hurdCrossIntermediate;
@@ -85,7 +85,7 @@ let
       stdenv = (forceSystem "i686-linux").stdenv;
     };
 
-    # XXX: Use this one for its `.hostDrv'.  Using the one above from
+    # XXX: Use this one for its `.crossDrv'.  Using the one above from
     # `x86_64-linux' leads to building a different cross-toolchain because of
     # the `forceSystem'.
     mig_raw = callPackage ./mig {};
diff --git a/pkgs/os-specific/gnu/libpthread/default.nix b/pkgs/os-specific/gnu/libpthread/default.nix
index 08838f17aff..3eaa6336ec2 100644
--- a/pkgs/os-specific/gnu/libpthread/default.nix
+++ b/pkgs/os-specific/gnu/libpthread/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation ({
     inherit rev;
   };
 
-  buildNativeInputs = [ autoconf automake libtool ];
+  nativeBuildInputs = [ autoconf automake libtool ];
   buildInputs = [ machHeaders hurdHeaders ]
    ++ stdenv.lib.optional (!headersOnly) hurd
    ++ stdenv.lib.optional (gccCross != null) gccCross;
diff --git a/pkgs/os-specific/gnu/mach/default.nix b/pkgs/os-specific/gnu/mach/default.nix
index f5120fca478..54c6429955b 100644
--- a/pkgs/os-specific/gnu/mach/default.nix
+++ b/pkgs/os-specific/gnu/mach/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation ({
     # <http://lists.gnu.org/archive/html/bug-hurd/2010-05/msg00137.html>.
     ++ [ "--enable-dependency-tracking" ];
 
-  buildNativeInputs = [ autoconf automake texinfo ]
+  nativeBuildInputs = [ autoconf automake texinfo ]
     ++ stdenv.lib.optional (mig != null) mig;
 
   preConfigure = "autoreconf -vfi";
diff --git a/pkgs/os-specific/gnu/mig/default.nix b/pkgs/os-specific/gnu/mig/default.nix
index f7b798a7624..9ee188b0c8c 100644
--- a/pkgs/os-specific/gnu/mig/default.nix
+++ b/pkgs/os-specific/gnu/mig/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
 
   patches = [ ./noyywrap.patch ];
 
-  buildNativeInputs = [ autoconf automake flex bison machHeaders ];
+  nativeBuildInputs = [ autoconf automake flex bison machHeaders ];
 
   preConfigure = "autoreconf -vfi";
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     postInstall =
       # Fix the shebang to point to the cross-built shell.
       '' sed -i "$out/bin/mig" \
-             -e 's|^#!/.*|#!${bash.hostDrv}/bin/sh|g'
+             -e 's|^#!/.*|#!${bash.crossDrv}/bin/sh|g'
       '';
   };
 
diff --git a/pkgs/os-specific/gnu/unionfs/default.nix b/pkgs/os-specific/gnu/unionfs/default.nix
index f35fed282b6..946e4c0c109 100644
--- a/pkgs/os-specific/gnu/unionfs/default.nix
+++ b/pkgs/os-specific/gnu/unionfs/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "CC=i586-pc-gnu-gcc" ];
   buildInputs = [ hurd machHeaders ];
-  buildNativeInputs = [ mig ];
+  nativeBuildInputs = [ mig ];
 
   installPhase =
     '' mkdir -p "$out/hurd"
diff --git a/pkgs/os-specific/linux/acpi-call/default.nix b/pkgs/os-specific/linux/acpi-call/default.nix
index 0689663832e..43902aded67 100644
--- a/pkgs/os-specific/linux/acpi-call/default.nix
+++ b/pkgs/os-specific/linux/acpi-call/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchgit, kernel }:
+{ stdenv, fetchgit, kernelDev }:
 
 stdenv.mkDerivation {
-  name = "acpi-call-${kernel.version}";
+  name = "acpi-call-${kernelDev.version}";
 
   src = fetchgit {
     url = "git://github.com/mkottman/acpi_call.git";
@@ -12,12 +12,12 @@ stdenv.mkDerivation {
   preBuild = ''
     sed -e 's/break/true/' -i test_off.sh
     sed -e 's@/bin/bash@.bin/sh@' -i test_off.sh
-    sed -e "s@/lib/modules/\$(.*)@${kernel}/lib/modules/${kernel.modDirVersion}@" -i Makefile
+    sed -e "s@/lib/modules/\$(.*)@${kernelDev}/lib/modules/${kernelDev.modDirVersion}@" -i Makefile
   '';
  
   installPhase = ''
-    mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
-    cp acpi_call.ko $out/lib/modules/${kernel.modDirVersion}/misc
+    mkdir -p $out/lib/modules/${kernelDev.modDirVersion}/misc
+    cp acpi_call.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
     mkdir -p $out/bin
     cp test_off.sh $out/bin/test_discrete_video_off.sh
     chmod a+x $out/bin/test_discrete_video_off.sh
diff --git a/pkgs/os-specific/linux/acpi/default.nix b/pkgs/os-specific/linux/acpi/default.nix
index 84ee4486807..6bb44d7db44 100644
--- a/pkgs/os-specific/linux/acpi/default.nix
+++ b/pkgs/os-specific/linux/acpi/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "acpi-1.5";
-  
+  name = "acpi-${version}";
+  version = "1.6";
+
   src = fetchurl {
-    url = "http://ftp.de.debian.org/debian/pool/main/a/acpi/acpi_1.5.orig.tar.gz";
-    sha256 = "1pb020j627ldjm1askqfzp6cjxrs79ail8svihanv7pgbg5r3zsp";
+    url = "mirror://sourceforge/acpiclient/${version}/${name}.tar.gz";
+    sha256 = "0cawznhkzb51yxa599d1xkw05nklmjrrmd79vmjkkzf4002d4qgd";
   };
 
   meta = {
@@ -15,7 +16,7 @@ stdenv.mkDerivation rec {
       the "old" `apm' command on ACPI systems.  It includes
       battery and thermal information.
     '';
-    homepage = http://grahame.angrygoats.net/acpi.shtml;
+    homepage = http://sourceforge.net/projects/acpiclient/;
     license = "GPLv2+";
   };
 }
diff --git a/pkgs/os-specific/linux/acpid/default.nix b/pkgs/os-specific/linux/acpid/default.nix
index 40db323c522..fe1792478d6 100644
--- a/pkgs/os-specific/linux/acpid/default.nix
+++ b/pkgs/os-specific/linux/acpid/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "acpid-1.0.10";
-  
+  name = "acpid-2.0.17";
+
   src = fetchurl {
-    url = "mirror://sourceforge/acpid/${name}.tar.gz";
-    sha256 = "0q27adx0c0bzvy9f9zfny69iaay3b4b79b693fhaq1bkvph3qw12";
+    url = "http://tedfelix.com/linux/${name}.tar.xz";
+    sha256 = "0gksl6z3sb6yyk7bdmldxsrncvprd3rny0i8ggl4m95nvv3x5drn";
   };
 
   preBuild = ''
@@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    homepage = http://acpid.sourceforge.net/;
+    homepage = http://tedfelix.com/linux/acpid-netlink.html;
     description = "A daemon for delivering ACPI events to userspace programs";
-    license = "GPLv2+";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/os-specific/linux/alsa-lib/default.nix b/pkgs/os-specific/linux/alsa-lib/default.nix
index 36d9fa2ba9e..26d32594fba 100644
--- a/pkgs/os-specific/linux/alsa-lib/default.nix
+++ b/pkgs/os-specific/linux/alsa-lib/default.nix
@@ -1,18 +1,26 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "alsa-lib-1.0.25";
-  
+  name = "alsa-lib-1.0.26";
+
   src = fetchurl {
-    url = "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2";
-    sha256 = "1rl6wa06d1jiqnrshyqh5qb1lwg6dh8m1ilyaink21j1y1f806js";
+    urls = [
+     "ftp://ftp.alsa-project.org/pub/lib/${name}.tar.bz2"
+     "http://alsa.cybermirror.org/lib/${name}.tar.bz2"
+    ];
+    sha256 = "0zbfkwqn7ixa71lsna9llq6i2gic540h8r8r0rjdphrwc1hq37wc";
   };
-  
+
   configureFlags = "--disable-xmlto";
-  
+
   # Fix pcm.h file in order to prevent some compilation bugs
+  # 2: see http://stackoverflow.com/questions/3103400/how-to-overcome-u-int8-t-vs-uint8-t-issue-efficiently
   postPatch = ''
     sed -i -e 's|//int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);|/\*int snd_pcm_mixer_element(snd_pcm_t \*pcm, snd_mixer_t \*mixer, snd_mixer_elem_t \*\*elem);\*/|' include/pcm.h
+
+
+    sed -i -e '1i#include <stdint.h>' include/pcm.h
+    sed -i -e 's/u_int\([0-9]*\)_t/uint\1_t/g' include/pcm.h
   '';
 
   crossAttrs = {
@@ -20,7 +28,7 @@ stdenv.mkDerivation rec {
       sed -i s/extern/static/g include/iatomic.h
     '';
   };
-  
+
   meta = {
     description = "ALSA, the Advanced Linux Sound Architecture libraries";
 
diff --git a/pkgs/os-specific/linux/alsa-oss/default.nix b/pkgs/os-specific/linux/alsa-oss/default.nix
new file mode 100644
index 00000000000..98bf4374b4f
--- /dev/null
+++ b/pkgs/os-specific/linux/alsa-oss/default.nix
@@ -0,0 +1,33 @@
+{stdenv, fetchurl, alsaLib, gettext, ncurses, libsamplerate}:
+
+stdenv.mkDerivation rec {
+  name = "alsa-oss-1.0.25";
+
+  src = fetchurl {
+    url = "ftp://ftp.alsa-project.org/pub/oss-lib/${name}.tar.bz2";
+    # url = "http://alsa.cybermirror.org/oss-lib/${name}.tar.bz2";
+    sha256 = "ed823b8e42599951d896c1709615d4cf7cb1cb3a7c55c75ccee82e24ccaf28e3";
+  };
+
+  buildInputs = [ alsaLib ncurses libsamplerate ];
+  nativeBuildInputs = [ gettext ];
+
+  configureFlags = "--disable-xmlto";
+
+  installFlags = "ASOUND_STATE_DIR=$(TMPDIR)/dummy";
+
+  preConfigure =
+    ''
+    '';
+
+  meta = {
+    description = "ALSA, the Advanced Linux Sound Architecture alsa-oss emulation";
+
+    longDescription = ''
+      The Advanced Linux Sound Architecture (ALSA) provides audio and
+      MIDI functionality to the Linux-based operating system.
+    '';
+
+    homepage = http://www.alsa-project.org/;
+  };
+}
diff --git a/pkgs/os-specific/linux/alsa-plugins/default.nix b/pkgs/os-specific/linux/alsa-plugins/default.nix
index 180f9153043..fb17b47b506 100644
--- a/pkgs/os-specific/linux/alsa-plugins/default.nix
+++ b/pkgs/os-specific/linux/alsa-plugins/default.nix
@@ -1,11 +1,14 @@
 { stdenv, fetchurl, lib, pkgconfig, alsaLib, pulseaudio ? null, jackaudio ? null }:
 
 stdenv.mkDerivation rec {
-  name = "alsa-plugins-1.0.25";
+  name = "alsa-plugins-1.0.26";
 
   src = fetchurl {
-    url = "ftp://ftp.alsa-project.org/pub/plugins/${name}.tar.bz2";
-    sha256 = "1assar5k8zb2srqdcph6a54daqfymlyygdm5fcs6isaydpyp9qx0";
+    urls = [
+      "ftp://ftp.alsa-project.org/pub/plugins/${name}.tar.bz2"
+      "http://alsa.cybermirror.org/plugins/${name}.tar.bz2"
+    ];
+    sha256 = "07wz3kl6isabk15ddpzz820pqlgvw6q0m7knnbgv9780s8s52l83";
   };
 
   buildInputs =
diff --git a/pkgs/os-specific/linux/alsa-utils/default.nix b/pkgs/os-specific/linux/alsa-utils/default.nix
index ca3a45bddfd..c121b227eee 100644
--- a/pkgs/os-specific/linux/alsa-utils/default.nix
+++ b/pkgs/os-specific/linux/alsa-utils/default.nix
@@ -1,20 +1,27 @@
-{stdenv, fetchurl, alsaLib, gettext, ncurses}:
+{stdenv, fetchurl, alsaLib, gettext, ncurses, libsamplerate}:
 
 stdenv.mkDerivation rec {
-  name = "alsa-utils-1.0.25";
-  
+  name = "alsa-utils-1.0.26";
+
   src = fetchurl {
-    url = "ftp://ftp.alsa-project.org/pub/utils/${name}.tar.bz2";
-    sha256 = "0b1hbdq1bdkbz72zdfy5cgp75jqpysb0mqb0n9wy5gsbccpnlrrf";
+    # url = "ftp://ftp.alsa-project.org/pub/utils/${name}.tar.bz2";
+    url = "http://alsa.cybermirror.org/utils/${name}.tar.bz2";
+    sha256 = "1rw1n3w8syqky9i7kwy5xd2rzfdbihxas32vwfxpb177lqx2lpzq";
   };
-  
-  buildInputs = [ alsaLib ncurses ];
-  buildNativeInputs = [ gettext ];
-  
+
+  buildInputs = [ alsaLib ncurses libsamplerate ];
+  nativeBuildInputs = [ gettext ];
+
   configureFlags = "--disable-xmlto --with-udev-rules-dir=$(out)/lib/udev/rules.d";
 
   installFlags = "ASOUND_STATE_DIR=$(TMPDIR)/dummy";
 
+  preConfigure =
+    ''
+      # Ensure that ‘90-alsa-restore.rules.in’ gets rebuilt.
+      rm alsactl/90-alsa-restore.rules
+    '';
+
   meta = {
     description = "ALSA, the Advanced Linux Sound Architecture utils";
 
diff --git a/pkgs/os-specific/linux/apparmor/capability.patch b/pkgs/os-specific/linux/apparmor/capability.patch
new file mode 100644
index 00000000000..c8f2b511d95
--- /dev/null
+++ b/pkgs/os-specific/linux/apparmor/capability.patch
@@ -0,0 +1,16 @@
+Description: allow parser to build even when not on Linux.
+Author: Kees Cook <kees@debian.org>
+
+Index: apparmor-debian/common/Make.rules
+===================================================================
+--- apparmor-debian.orig/common/Make.rules	2012-05-05 14:41:25.967259523 -0700
++++ apparmor-debian/common/Make.rules	2012-05-05 14:41:28.451291053 -0700
+@@ -160,7 +160,7 @@
+ CAPABILITIES=$(shell echo "\#include <linux/capability.h>" | cpp -dM | LC_ALL=C sed -n -e '/CAP_EMPTY_SET/d' -e 's/^\#define[ \t]\+CAP_\([A-Z0-9_]\+\)[ \t]\+\([0-9xa-f]\+\)\(.*\)$$/CAP_\1/p' | sort)
+ 
+ .PHONY: list_capabilities
+-list_capabilities: /usr/include/linux/capability.h
++list_capabilities:
+ 	@echo "$(CAPABILITIES)"
+ 
+ # =====================
diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index 8a7d2b9e458..da71eb8c709 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -1,34 +1,44 @@
 { stdenv, fetchurl
 , autoconf, automake, libtool, makeWrapper
-, perl, bison, flex, glibc, gettext, which, rpm, tetex, LocaleGettext, bash, pam, TermReadKey, RpcXML, swig}:
+, perl, bison, flex, glibc, gettext, which, rpm, tetex, LocaleGettext
+, bash, pam, TermReadKey, RpcXML, swig, python}:
 stdenv.mkDerivation rec {
 
   name = "apparmor-${version}";
-  version = "2.6.1";
+  version = "2.8.1";
 
   src = fetchurl {
-    url = "http://launchpad.net/apparmor/2.6/2.6.1/+download/${name}.tar.gz";
-    sha256 = "1x7225xgzyc5agbn41xsip236anr1kmaw70xc94pag82q7c1bc4w";
+    url = "http://launchpad.net/apparmor/2.8/${version}/+download/${name}.tar.gz";
+    sha256 = "1r0a5k14jbiik28m5gql0f3dbxl252jya7i120rrsbzqqnvw6nw7";
   };
 
-  buildInputs = [ autoconf automake libtool perl bison flex gettext which rpm tetex LocaleGettext pam TermReadKey RpcXML swig makeWrapper ];
+  buildInputs = [
+    autoconf automake libtool perl bison flex gettext which rpm tetex
+    LocaleGettext pam TermReadKey RpcXML swig makeWrapper python ];
 
   prePatch = ''
     substituteInPlace libraries/libapparmor/src/Makefile.in --replace "/usr/include" "${glibc}/include"
     substituteInPlace libraries/libapparmor/src/Makefile.am --replace "/usr/include" "${glibc}/include"
     substituteInPlace common/Make.rules --replace "/usr/bin/pod2man" "${perl}/bin/pod2man"
     substituteInPlace common/Make.rules --replace "/usr/bin/pod2html" "${perl}/bin/pod2html"
+    substituteInPlace common/Make.rules --replace "cpp -dM" "cpp -dM -I${glibc}/include"
 
     substituteInPlace parser/Makefile --replace "/usr/bin/bison" "${bison}/bin/bison"
     substituteInPlace parser/Makefile --replace "/usr/bin/flex" "${flex}/bin/flex"
     substituteInPlace parser/Makefile --replace "/usr/include/bits/socket.h" "${glibc}/include/bits/socket.h"
     substituteInPlace parser/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
+    #substituteInPlace parser/utils/vim/Makefile --replace "/usr/include/linux/capability.h" "${glibc}/include/linux/capability.h"
+
+    # for some reason pdf documentation doesn't build
+    substituteInPlace parser/Makefile --replace "manpages htmlmanpages pdf" "manpages htmlmanpages"
 
     substituteInPlace parser/tst/gen-xtrans.pl --replace "/usr/bin/perl" "${perl}/bin/perl"
     substituteInPlace parser/tst/Makefile --replace "/usr/bin/prove" "${perl}/bin/prove"
     substituteInPlace parser/tst/Makefile --replace "./caching.sh" "${bash}/bin/bash ./caching.sh"
   '';
 
+  patches = ./capability.patch;
+
   buildPhase =''
     PERL5LIB=$PERL5LIB:$out/lib/perl5/site_perl:$out/lib
 
@@ -41,7 +51,7 @@ stdenv.mkDerivation rec {
     ensureDir $out/lib/perl5/site_perl/
     cp swig/perl/LibAppArmor.pm $out/lib/perl5/site_perl/
     cp swig/perl/LibAppArmor.bs $out/lib/perl5/site_perl/
-# this is automatically copied elsewhere....
+    # this is automatically copied elsewhere....
 
     cd ../../utils
     make
@@ -60,27 +70,18 @@ stdenv.mkDerivation rec {
     make install DESTDIR=$out
 
     cd ../../profiles
-LD_LIBRARY_PATH=$out/lib    make
-#LD_LIBRARY_PATH=$out/lib    make check	# depends on the parser having been built first
+    LD_LIBRARY_PATH=$out/lib    make
+    #LD_LIBRARY_PATH=$out/lib    make check	# depends on the parser having been built first
     make install DESTDIR=$out
 
+    cd ..
+    cp -r  kernel-patches $out
   '';
   installPhase = ''
     for i in $out/bin/*;  do
       wrapProgram $i --prefix PERL5LIB : "$PERL5LIB:$out/lib/perl5/5.10.1/i686-linux-thread-multi/"
     done
   '';
-  passthru = {
-    linux_2_6_37_patch = {
-      name= "apparmor";
-      features.apparmor = true;
-      patch = [
-	"${src}/kernel-patches/2.6.37/0001-AppArmor-compatibility-patch-for-v5-network-controll.patch"
-	"${src}/kernel-patches/2.6.37/0002-AppArmor-compatibility-patch-for-v5-interface.patch"
-	"${src}/kernel-patches/2.6.37/0003-AppArmor-Allow-dfa-backward-compatibility-with-broke.patch"
-      ];
-    };
-  };
 
   meta = with stdenv.lib; {
     homepage = http://apparmor.net/;
diff --git a/pkgs/os-specific/linux/atheros/0.9.4.nix b/pkgs/os-specific/linux/atheros/0.9.4.nix
index 87470da9649..341bdc3f1bb 100644
--- a/pkgs/os-specific/linux/atheros/0.9.4.nix
+++ b/pkgs/os-specific/linux/atheros/0.9.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, builderDefs, kernel }:
+{ stdenv, fetchurl, builderDefs, kernelDev }:
 	let localDefs = builderDefs.passthru.function {
 		src = /* put a fetchurl here */
 		fetchurl {
@@ -8,7 +8,7 @@
 
 		buildInputs = [];
 		configureFlags = [];
-		makeFlags = [''KERNELPATH=${kernel}/lib/modules/*/build'' ''DESTDIR=$out''];
+		makeFlags = [''KERNELPATH=${kernelDev}/lib/modules/*/build'' ''DESTDIR=$out''];
 	};
 	in with localDefs;
 let 
@@ -17,7 +17,7 @@ postInstall = fullDepEntry (''
 '') [minInit doMakeInstall];
 in
 stdenv.mkDerivation rec {
-	name = "atheros-0.9.4-${kernel.version}";
+	name = "atheros-0.9.4-${kernelDev.version}";
 	builder = writeScript (name + "-builder")
 		(textClosure localDefs [doMakeInstall 
 			postInstall doForceShare doPropagate]);
diff --git a/pkgs/os-specific/linux/atheros/inj.patch b/pkgs/os-specific/linux/atheros/inj.patch
deleted file mode 100644
index baae9b88aa4..00000000000
--- a/pkgs/os-specific/linux/atheros/inj.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-diff -Naur madwifi/ath/if_ath.c madwifi_rawtx/ath/if_ath.c
---- madwifi/ath/if_ath.c	2008-06-24 17:20:58.000000000 -0400
-+++ madwifi_rawtx/ath/if_ath.c	2008-06-24 17:20:12.000000000 -0400
-@@ -2950,6 +2950,7 @@
- ath_tx_startraw(struct net_device *dev, struct ath_buf *bf, struct sk_buff *skb)
- {
- 	struct ath_softc *sc = dev->priv;
-+	struct ieee80211com *ic = &sc->sc_ic;
- 	struct ath_hal *ah = sc->sc_ah;
- 	struct ieee80211_phy_params *ph = &(SKB_CB(skb)->phy); 
- 	const HAL_RATE_TABLE *rt;
-@@ -2962,7 +2963,8 @@
- 	struct ieee80211_frame *wh;
- 
- 	wh = (struct ieee80211_frame *)skb->data;
--	try0 = ph->try[0];
-+//	try0 = ph->try[0];
-+	try0 = (ic->ic_opmode == IEEE80211_M_MONITOR) ? 1 : ph->try[0];
- 	rt = sc->sc_currates;
- 	txrate = dot11_to_ratecode(sc, rt, ph->rate[0]);
- 	power = ph->power > 60 ? 60 : ph->power;
-@@ -2986,7 +2988,8 @@
- 	rt = sc->sc_currates;
- 	KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode));
- 
--	if (IEEE80211_IS_MULTICAST(wh->i_addr1)) {
-+	if (IEEE80211_IS_MULTICAST(wh->i_addr1) || ((ic->ic_opmode == 
-+IEEE80211_M_MONITOR) && (skb->data[1]&3) != 0x01) ) {
- 		flags |= HAL_TXDESC_NOACK;	/* no ack on broad/multicast */
- 		sc->sc_stats.ast_tx_noack++;
- 		try0 = 1;
-
diff --git a/pkgs/os-specific/linux/atheros/r3867.nix b/pkgs/os-specific/linux/atheros/r3867.nix
deleted file mode 100644
index 95a834dd67a..00000000000
--- a/pkgs/os-specific/linux/atheros/r3867.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-args : with args;
-	let localDefs = builderDefs.passthru.function {
-		src = fetchurl {
-			url = http://snapshots.madwifi.org/madwifi-trunk/madwifi-trunk-r3867-20080924.tar.gz;
-			sha256 = "0m48p5mqx1d3aimjjiy251fii7x7y15ch5n74hvq4hygc6bcjf79";
-		};
-
-		buildInputs = [];
-		configureFlags = [];
-		makeFlags = [''KERNELPATH=${kernel}/lib/modules/*/build'' ''DESTDIR=$out''];
-		hal20080528 = fetchurl {
-		  url = http://people.freebsd.org/~sam/ath_hal-20080528.tgz;
-		  sha256 = "1a6glkd8n46876hl48ib08p81qwsvrk4153j4b9xrxgid6f8bar9";
-		};
-		injectionPatchFile = ./inj.patch;
-	};
-	in with localDefs;
-let
-preBuild = fullDepEntry (''
-	echo Replacing HAL.
-	tar xvf ${hal20080528}
-	rm -r hal
-	mv ath_hal-* hal
-'') ["minInit" "doUnpack"];
-postInstall = fullDepEntry (''
-	ln -s $out/usr/local/bin $out/bin
-'') [minInit doMakeInstall];
-in
-stdenv.mkDerivation rec {
-	name = "atheros-"+version;
-	patches = lib.optional
-		(lib.attrByPath ["injectionPatch"] false args)
-		injectionPatchFile;
-	builder = writeScript (name + "-builder")
-		(textClosure localDefs 
-			((lib.optional 
-				(lib.attrByPath ["freshHAL"] false args)
-				preBuild)
-			++ [doPatch doMakeInstall postInstall
-			doForceShare doPropagate]));
-	meta = {
-		description = "Atheros WiFi driver";
-		inherit src;
-	};
-}
diff --git a/pkgs/os-specific/linux/ati-drivers/builder.sh b/pkgs/os-specific/linux/ati-drivers/builder.sh
index b05093d8915..abb78549cee 100644
--- a/pkgs/os-specific/linux/ati-drivers/builder.sh
+++ b/pkgs/os-specific/linux/ati-drivers/builder.sh
@@ -2,13 +2,14 @@
 # TODO gentoo removes some tools because there are xorg sources (?)
 
 source $stdenv/setup
+set -x
 
 die(){ echo $@; exit 1; }
 
-
 # custom unpack:
-cp $src archive
-sh archive --extract .
+unzip $src
+run_file=$(echo amd-driver-installer-*)
+sh $run_file --extract .
 
 
 kernelVersion=$(cd ${kernel}/lib/modules && ls)
@@ -68,7 +69,7 @@ setModVersions(){
 # On kernels with the fix, use arch_compat_alloc_user_space instead
 # of compat_alloc_user_space since the latter is GPL-only
 
-COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
+COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
 
 for src_file in \
     $kernelBuild/arch/x86/include/asm/compat.h \
@@ -123,6 +124,8 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   echo .lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
   echo 'This is a dummy file created to suppress this warning: could not find /lib/modules/fglrx/build_mod/2.6.x/.libfglrx_ip.a.GCC4.cmd for /lib/modules/fglrx/build_mod/2.6.x/libfglrx_ip.a.GCC4' > lib${MODULE}_ip.a.GCC${GCC_MAJOR}.cmd
 
+  sed -i -e "s@COMPAT_ALLOC_USER_SPACE@$COMPAT_ALLOC_USER_SPACE@" ../kcl_ioctl.c
+
   make CC=${CC} \
       LIBIP_PREFIX=$(echo "$LIBIP_PREFIX" | sed -e 's|^\([^/]\)|../\1|') \
       MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
@@ -143,12 +146,12 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   cp -r common/usr/share $out
   cp -r common/usr/X11R6 $out
 
-  cp -r arch/$arch/lib $out/lib
+  # cp -r arch/$arch/lib $out/lib
 
   # what are those files used for?
   cp -r common/etc $out
 
-  DIR_DEPENDING_ON_XORG_VERSION=x750_64a
+  DIR_DEPENDING_ON_XORG_VERSION=xpic_64a
   cp -r $DIR_DEPENDING_ON_XORG_VERSION/usr/X11R6/$lib_arch/* $out/lib/xorg
 
   t=$out/lib/modules/${kernelVersion}/kernel/drivers/misc
@@ -164,12 +167,18 @@ GCC_MAJOR="`gcc --version | grep -o -e ") ." | head -1 | cut -d " " -f 2`"
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri $out/lib
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/modules/dri/* $out/lib
   cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/*.so.* $out/lib
+  cp -r $TMP/arch/$arch/usr/X11R6/$lib_arch/fglrx/fglrx-libGL.so.1.2 $out/lib/fglrx-libGL.so.1.2
+
   cp -r $TMP/arch/$arch/usr/$lib_arch/* $out/lib
 
   # cp -r $TMP/arch/$arch/usr/$lib_arch/* $out/lib
   ln -s libatiuki.so.1.0 $out/lib/libatiuki.so.1
-  ln -s libGL.so.1.2 $out/lib/libGL.so.1
+  ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so.1
+  ln -s fglrx-libGL.so.1.2 $out/lib/libGL.so
+
   ln -s libfglrx_gamma.so.1.0 $out/lib/libfglrx_gamma.so.1
+  # make xorg use the ati version
+  ln -s $out/lib/xorg/modules/extensions/{fglrx/fglrx-libglx.so,libglx.so}
 
 }
 
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index a53058de6a0..ff508deed12 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchurl, kernel, xlibs, which, imake
+{ stdenv, fetchurl, kernelDev, xlibs, which, imake
 , mesa # for fgl_glxgears
 , libXxf86vm, xf86vidmodeproto # for fglrx_gamma
 , xorg, makeWrapper, glibc, patchelf
+, unzip
 }:
 
 # If you want to use a different Xorg version probably
@@ -16,10 +17,13 @@
 
 # http://wiki.cchtml.com/index.php/Main_Page
 
+# There is one issue left:
+# /usr/lib/dri/fglrx_dri.so must point to /run/opengl-driver/lib/fglrx_dri.so
+
 assert stdenv.system == "x86_64-linux";
 
 stdenv.mkDerivation rec {
-  name = "ati-drivers-${version}-${kernel.version}";
+  name = "ati-drivers-${version}-${kernelDev.version}";
   version = "10-11-x86";
 
   builder = ./builder.sh;
@@ -27,18 +31,25 @@ stdenv.mkDerivation rec {
   inherit libXxf86vm xf86vidmodeproto;
 
   src = fetchurl {
-    url = https://www2.ati.com/drivers/linux/ati-driver-installer-10-11-x86.x86_64.run;
-    sha256 = "1z33w831ayx1j5lm9d1xv6whkmzsz9v8li3s8c96hwnwki6zpimr";
+    url = http://www2.ati.com/drivers/linux/amd-driver-installer-12-8-x86.x86_64.zip;
+    sha256 = "0hdv89vdap6v0dnwhddizfmlkwyh0j910sp4wyj2lq5pn9rm2lk2";
+
+    # beta
+    # url = "http://www2.ati.com/drivers/beta/amd-driver-installer-12-9-beta-x86.x86_64.zip";
+    # sha256 = "02dmflzfrgr07fa1hv34m7ad8pra21xv7qbk500gqm6v8s9vbplk";
   };
 
   buildInputs =
     [ xlibs.libXext xlibs.libX11
       xlibs.libXrandr which imake makeWrapper
       patchelf
+      unzip
     ];
-    
-  inherit kernel glibc /* glibc only used for setting interpreter */;
-  
+
+  kernel = kernelDev;
+
+  inherit glibc /* glibc only used for setting interpreter */;
+
   LD_LIBRARY_PATH = stdenv.lib.concatStringsSep ":"
     [ "${xorg.libXrandr}/lib"
       "${xorg.libXrender}/lib"
@@ -49,11 +60,11 @@ stdenv.mkDerivation rec {
   inherit mesa; # only required to build examples
 
   meta = {
-    description = "ati drivers";
+    description = "ATI drivers";
     homepage = http://support.amd.com/us/gpudownload/Pages/index.aspx;
     license = "unfree";
     maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = [ "x86_64-linux" ];
+    #platforms = [ "x86_64-linux" ];
   };
 
   # moved assertions here because the name is evaluated when the NixOS manual is generated
diff --git a/pkgs/os-specific/linux/atop/default.nix b/pkgs/os-specific/linux/atop/default.nix
new file mode 100644
index 00000000000..39ba5dc3973
--- /dev/null
+++ b/pkgs/os-specific/linux/atop/default.nix
@@ -0,0 +1,39 @@
+{stdenv, fetchurl, zlib, ncurses}:
+
+stdenv.mkDerivation rec {
+  version = "2.0.2";
+  name = "atop-${version}";
+
+  src = fetchurl {
+    url = "http://www.atoptool.nl/download/atop-${version}.tar.gz";
+    sha256 = "029lfa2capz1lg3m3rnyrgb8v6jm4znin84vjh2f0zkwvvhdn856";
+  };
+
+  buildInputs = [zlib ncurses];
+
+  makeFlags = [
+    ''SCRPATH=$out/etc/atop''
+    ''LOGPATH=/var/log/atop''
+    ''INIPATH=$out/etc/rc.d/init.d''
+    ''CRNPATH=$out/etc/cron.d''
+    ''ROTPATH=$out/etc/logrotate.d''
+  ];
+
+  preConfigure = ''
+    sed -e "s@/usr/@$out/@g" -i $(find . -type f )
+    sed -e "/mkdir.*LOGPATH/s@mkdir@echo missing dir @" -i Makefile
+    sed -e "/touch.*LOGPATH/s@touch@echo should have created @" -i Makefile
+    sed -e 's/chown/true/g' -i Makefile
+    sed -e '/chkconfig/d' -i Makefile
+  '';
+
+  meta = {
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    description = ''Console system performance monitor'';
+
+    longDescription = ''
+      Atop is an ASCII full-screen performance monitor that is capable of reporting the activity of all processes (even if processes have finished during the interval), daily logging of system and process activity for long-term analysis, highlighting overloaded system resources by using colors, etc. At regular intervals, it shows system-level activity related to the CPU, memory, swap, disks and network layers, and for every active process it shows the CPU utilization, memory growth, disk utilization, priority, username, state, and exit code.
+    '';
+  };
+}
diff --git a/pkgs/os-specific/linux/aufs-util/2.1.nix b/pkgs/os-specific/linux/aufs-util/2.1.nix
deleted file mode 100644
index 87541def9ad..00000000000
--- a/pkgs/os-specific/linux/aufs-util/2.1.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ stdenv, fetchgit, kernel, aufs }:
-
-assert aufs != null;
-
-let version = "20110217"; in
-
-stdenv.mkDerivation {
-  name = "aufs2.1-util-${version}-${kernel.version}";
-
-  src = fetchgit {
-    url = "git://git.c3sl.ufpr.br/aufs/aufs2-util.git";
-    rev = "0f0cf3f2ae39906fd4b5376cdaa24e9fe64a03f4";
-    sha256 = "0fce5601b67efe8b5652a813ae612348bf4503aa71056cd31a5ed0406632e364";
-  };
-
-  buildInputs = [ aufs ];
-
-  makeFlags =
-    [ "KDIR=${kernel}/lib/modules/${kernel.version}/build"
-      "Install=install"
-      "DESTDIR=$(out)"
-    ];
-
-  postInstall =
-    ''
-      mv $out/usr/* $out
-      rmdir $out/usr
-
-      cp aufs.shlib $out/lib/
-
-      substituteInPlace $out/bin/aubrsync \
-        --replace /sbin/mount $out/sbin/mount \
-        --replace /usr/lib/aufs.shlib $out/lib/aufs.shlib
-    '';
-
-  meta = {
-    description = "Utilities for AUFS2.1";
-    homepage = http://aufs.sourceforge.net/;
-    maintainers = [ stdenv.lib.maintainers.eelco  ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/aufs-util/2.nix b/pkgs/os-specific/linux/aufs-util/2.nix
index 501dcbf4b94..130cfd85ee7 100644
--- a/pkgs/os-specific/linux/aufs-util/2.nix
+++ b/pkgs/os-specific/linux/aufs-util/2.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, kernel, aufs }:
+{ stdenv, fetchurl, kernelDev, aufs }:
 
 assert aufs != null;
 
 let version = "20100506"; in
 
 stdenv.mkDerivation {
-  name = "aufs2-util-${version}-${kernel.version}";
+  name = "aufs2-util-${version}-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://nixos.org/tarballs/aufs2-util-git-${version}.tar.bz2";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   buildInputs = [ aufs ];
 
   makeFlags =
-    [ "KDIR=${kernel}/lib/modules/${kernel.version}/build"
+    [ "KDIR=${kernelDev}/lib/modules/${kernelDev.version}/build"
       "Install=install"
       "DESTDIR=$(out)"
     ];
diff --git a/pkgs/os-specific/linux/aufs-util/3.nix b/pkgs/os-specific/linux/aufs-util/3.nix
index 8eefc1b0f4a..9997c2743a5 100644
--- a/pkgs/os-specific/linux/aufs-util/3.nix
+++ b/pkgs/os-specific/linux/aufs-util/3.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchgit, kernel, aufs }:
+{ stdenv, fetchgit, kernelDev, aufs }:
 
 assert aufs != null;
 
 stdenv.mkDerivation {
-  name = "aufs3-util-${aufs.patch.version}-${kernel.version}";
+  name = "aufs3-util-${aufs.patch.version}-${kernelDev.version}";
 
   src = fetchgit {
     url = git://aufs.git.sourceforge.net/gitroot/aufs/aufs-util.git;
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   buildInputs = [ aufs ];
 
   makeFlags =
-    [ "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build"
+    [ "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
       "Install=install"
       "DESTDIR=$(out)"
     ];
@@ -34,8 +34,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Utilities for AUFS3";
     homepage = http://aufs.sourceforge.net/;
-    maintainers = [ stdenv.lib.maintainers.eelco 
-                    stdenv.lib.maintainers.shlevy ];
+    maintainers = [ stdenv.lib.maintainers.eelco  ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/aufs/2.1.nix b/pkgs/os-specific/linux/aufs/2.1.nix
deleted file mode 100644
index 1539775a2a1..00000000000
--- a/pkgs/os-specific/linux/aufs/2.1.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ stdenv, kernel, fetchgit, perl }:
-
-assert kernel.features ? aufsBase;
-
-let version = 
-  if (builtins.lessThan (builtins.compareVersions kernel.version "2.6.38") 0) 
-  then "20110303"
-  else "20110408"; in
-
-stdenv.mkDerivation {
-  name = "aufs2.1-${version}-${kernel.version}";
-
-  src =
-  if (builtins.lessThan (builtins.compareVersions kernel.version "2.6.38") 0) 
-  then
-    fetchgit {
-      url = "git://git.c3sl.ufpr.br/aufs/aufs2-standalone.git";
-      rev = "aceef6c84dbe5798bf46904252727b9588eafaf6";
-      sha256 = "50a8cb39af5fee82e88b65351cac52b6ab95a68c45e0a98da9fa1925b28f048d";
-    }
-  else
-    fetchgit {
-      url = "git://git.c3sl.ufpr.br/aufs/aufs2-standalone.git";
-      rev = "01cb6101f477339bc95e6b47e3618bb29ecc68db";
-      sha256 = "4af3c4b1e99ef58abe8530665309021d541ee840ee54f442606cc418646a1faf";
-    };
-
-  buildInputs = [ perl ];
-
-  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.version}/build";
-
-  installPhase =
-    ''
-      mkdir -p $out/lib/modules/${kernel.version}/misc
-      cp -v aufs.ko $out/lib/modules/${kernel.version}/misc
-
-      # Install the headers because aufs2.1-util requires them.
-      cp -av usr/include $out/
-    '';
-
-  meta = {
-    description = "Another Unionfs implementation for Linux (second generation)";
-    homepage = http://aufs.sourceforge.net/;
-    maintainers = [ stdenv.lib.maintainers.eelco
-                    stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/aufs/2.nix b/pkgs/os-specific/linux/aufs/2.nix
index 4d80ddae0b8..87d16c113a5 100644
--- a/pkgs/os-specific/linux/aufs/2.nix
+++ b/pkgs/os-specific/linux/aufs/2.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, kernel, perl, fetchgit }:
+{ stdenv, fetchurl, kernelDev, perl, fetchgit }:
 
-assert kernel.features ? aufsBase;
+assert kernelDev.features ? aufsBase;
 
 let version = "20100522"; in
 
 stdenv.mkDerivation {
-  name = "aufs2-${version}-${kernel.version}";
+  name = "aufs2-${version}-${kernelDev.version}";
 
   src = 
-  if (builtins.lessThan (builtins.compareVersions kernel.version "2.6.35") 0) then
+  if (builtins.lessThan (builtins.compareVersions kernelDev.version "2.6.35") 0) then
     fetchurl {
       url = "http://nixos.org/tarballs/aufs2-standalone-git-${version}.tar.bz2";
       sha256 = "1g4mw4qx2xzpygdwjiw36bkhfz1hi7wxx7w79n2h0lr5grzzdnd6";
@@ -22,12 +22,12 @@ stdenv.mkDerivation {
 
   buildInputs = [ perl ];
 
-  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.version}/build";
+  makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.version}/build";
 
   installPhase =
     ''
-      mkdir -p $out/lib/modules/${kernel.version}/misc
-      cp aufs.ko $out/lib/modules/${kernel.version}/misc
+      mkdir -p $out/lib/modules/${kernelDev.version}/misc
+      cp aufs.ko $out/lib/modules/${kernelDev.version}/misc
 
       # Install the headers because aufs2-util requires them.
       cp -prvd include $out/
diff --git a/pkgs/os-specific/linux/aufs/3.nix b/pkgs/os-specific/linux/aufs/3.nix
index 83de1faa8fe..2f566d3abff 100644
--- a/pkgs/os-specific/linux/aufs/3.nix
+++ b/pkgs/os-specific/linux/aufs/3.nix
@@ -1,4 +1,4 @@
-{ stdenv, kernel, perl }:
+{ stdenv, kernelDev, perl }:
 
 let
 
@@ -7,25 +7,25 @@ let
       (if x.features ? aufs3 then x.features.aufs3 else false)
     else false;
   featureAbort = abort "This kernel does not have aufs 3 support";
-  patch = stdenv.lib.findFirst aufsPredicate featureAbort kernel.kernelPatches;
+  patch = stdenv.lib.findFirst aufsPredicate featureAbort kernelDev.kernelPatches;
 
 in
 
 stdenv.mkDerivation {
-  name = "aufs3-${patch.version}-${kernel.version}";
+  name = "aufs3-${patch.version}-${kernelDev.version}";
 
   src = patch.patch.src;
 
   buildInputs = [ perl ];
 
-  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build";
+  makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
 
-  NIX_CFLAGS_COMPILE="-I${kernel}/lib/modules/${kernel.modDirVersion}/build/include/generated";
+  NIX_CFLAGS_COMPILE="-I${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build/include/generated";
 
   installPhase =
     ''
-      mkdir -p $out/lib/modules/${kernel.modDirVersion}/misc
-      cp -v aufs.ko $out/lib/modules/${kernel.modDirVersion}/misc
+      mkdir -p $out/lib/modules/${kernelDev.modDirVersion}/misc
+      cp -v aufs.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
 
       # Install the headers because aufs3-util requires them.
       mkdir -p $out/include/linux
@@ -33,12 +33,12 @@ stdenv.mkDerivation {
     '';
 
   passthru = { inherit patch; };
+
   meta = {
     description = "Another Unionfs implementation for Linux (third generation)";
     homepage = http://aufs.sourceforge.net/;
     maintainers = [ stdenv.lib.maintainers.eelco
-                    stdenv.lib.maintainers.raskin
-                    stdenv.lib.maintainers.shlevy ];
+                    stdenv.lib.maintainers.raskin ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/batman-adv/batctl.nix b/pkgs/os-specific/linux/batman-adv/batctl.nix
new file mode 100644
index 00000000000..2ff9d214bbb
--- /dev/null
+++ b/pkgs/os-specific/linux/batman-adv/batctl.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchurl}:
+
+let
+  ver = "2013.2.0";
+in
+stdenv.mkDerivation rec {
+  name = "batctl-${ver}";
+
+  src = fetchurl {
+    url = "http://downloads.open-mesh.org/batman/releases/batman-adv-${ver}/${name}.tar.gz";
+    sha1 = "0ba6520c813c9dd2e59e6205e8ea2e60a0c85f52";
+  };
+
+  preBuild = ''
+    makeFlags=PREFIX=$out
+  '';
+
+  meta = {
+    homepage = http://www.open-mesh.org/projects/batman-adv/wiki/Wiki;
+    description = "B.A.T.M.A.N. routing protocol in a linux kernel module for layer 2, control tool";
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/batman-adv/default.nix b/pkgs/os-specific/linux/batman-adv/default.nix
new file mode 100644
index 00000000000..693f0067701
--- /dev/null
+++ b/pkgs/os-specific/linux/batman-adv/default.nix
@@ -0,0 +1,24 @@
+{stdenv, fetchurl, kernelDev }:
+
+stdenv.mkDerivation rec {
+  name = "batman-adv-2013.2.0";
+
+  src = fetchurl {
+    url = "http://downloads.open-mesh.org/batman/releases/${name}/${name}.tar.gz";
+    sha1 = "7d2aff2ad118cbc5452de43f7e9da8374521ec0e";
+  };
+
+  preBuild = ''
+    makeFlags="KERNELPATH=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build"
+    sed -i -e "s,INSTALL_MOD_DIR=,INSTALL_MOD_PATH=$out INSTALL_MOD_DIR=," \
+      -e /depmod/d Makefile
+  '';
+
+  meta = {
+    homepage = http://www.open-mesh.org/projects/batman-adv/wiki/Wiki;
+    description = "B.A.T.M.A.N. routing protocol in a linux kernel module for layer 2";
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/bbswitch/default.nix b/pkgs/os-specific/linux/bbswitch/default.nix
index 04fba890bc5..692ec0df5bd 100644
--- a/pkgs/os-specific/linux/bbswitch/default.nix
+++ b/pkgs/os-specific/linux/bbswitch/default.nix
@@ -1,8 +1,9 @@
-{ stdenv, fetchurl, kernel }:
+{ stdenv, fetchurl, kernelDev }:
 
 let
-  baseName = "bbswitch-0.4.2";
-  name = "${baseName}-${kernel.version}";
+  baseName = "bbswitch";
+  version = "0.6";
+  name = "${baseName}-${version}-${kernelDev.version}";
 
 in
 
@@ -10,19 +11,19 @@ stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "http://github.com/downloads/Bumblebee-Project/bbswitch/${baseName}.tar.gz";
-    sha256 = "06j3cm1rk3lcbv54k0magrijykrzmkrna8n5cc274iz59842lga3";
+    url = "https://github.com/Bumblebee-Project/${baseName}/archive/v${version}.tar.gz";
+    sha256 = "1y1wggfrlpxybz5cvrbvvpqa2hh6ncazzdlg9c94sx40n6p5dcf4";
   };
 
   preBuild = ''
     substituteInPlace Makefile \
-      --replace "\$(shell uname -r)" "${kernel.modDirVersion}" \
-      --replace "/lib/modules" "${kernel}/lib/modules"
+      --replace "\$(shell uname -r)" "${kernelDev.modDirVersion}" \
+      --replace "/lib/modules" "${kernelDev}/lib/modules"
   '';
- 
+
   installPhase = ''
-    ensureDir $out/lib/modules/${kernel.modDirVersion}/misc
-    cp bbswitch.ko $out/lib/modules/${kernel.modDirVersion}/misc
+    ensureDir $out/lib/modules/${kernelDev.modDirVersion}/misc
+    cp bbswitch.ko $out/lib/modules/${kernelDev.modDirVersion}/misc
 
     ensureDir $out/bin
     tee $out/bin/discrete_vga_poweroff << EOF
diff --git a/pkgs/os-specific/linux/blcr/default.nix b/pkgs/os-specific/linux/blcr/default.nix
index 8c77cffe177..d0d81abb244 100644
--- a/pkgs/os-specific/linux/blcr/default.nix
+++ b/pkgs/os-specific/linux/blcr/default.nix
@@ -1,24 +1,26 @@
-{ stdenv, fetchurl, kernel, perl, makeWrapper }:
+{ stdenv, fetchurl, kernelDev, perl, makeWrapper }:
 
 # BLCR 0.8.4 works for kernel version up to 2.6.38 (including 2.6.38.x)
+# BLCR 0.8.5 should works for kernel version up to 3.7.1
+
 assert stdenv.isLinux;
-assert builtins.compareVersions "2.6.39" kernel.version == 1;
+assert builtins.compareVersions "3.7.2" kernelDev.version == 1;
 
 stdenv.mkDerivation {
-  name = "blcr-0.8.4-${kernel.version}";
+  name = "blcr_${kernelDev.version}-0.8.5";
 
   src = fetchurl {
-    url = https://ftg.lbl.gov/assets/projects/CheckpointRestart/downloads/blcr-0.8.4.tar.gz;
-    sha256 = "d851da66627d9212ac37bc9ea2aba40008ff2dc51d45dbd395ca2e403c3d78cf";
+    url = http://crd.lbl.gov/assets/Uploads/FTG/Projects/CheckpointRestart/downloads/blcr-0.8.5.tar.gz;
+    sha256 = "01a809nfbr715pnidlslv55pxadm3021l97p98zkqy8chyrnkjb0";
   };
 
   buildInputs = [ perl makeWrapper ];
 
   preConfigure = ''
     configureFlagsArray=(
-      --with-linux=${kernel}/lib/modules/${kernel.modDirVersion}/build
-      --with-kmod-dir=$out/lib/modules/${kernel.modDirVersion}
-      --with-system-map=${kernel}/System.map
+      --with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
+      --with-kmod-dir=$out/lib/modules/${kernelDev.modDirVersion}
+      --with-system-map=${kernelDev}/System.map
     )
   '';
 
diff --git a/pkgs/os-specific/linux/bluez/bluez5.nix b/pkgs/os-specific/linux/bluez/bluez5.nix
new file mode 100644
index 00000000000..561f2d8e1e7
--- /dev/null
+++ b/pkgs/os-specific/linux/bluez/bluez5.nix
@@ -0,0 +1,71 @@
+{ stdenv, fetchurl, pkgconfig, dbus, glib, libusb, alsaLib, python, makeWrapper
+, pythonDBus, pygobject, readline, libsndfile, udev, libical, systemd }:
+
+assert stdenv.isLinux;
+
+let
+  pythonpath = "${pythonDBus}/lib/${python.libPrefix}/site-packages:"
+    + "${pygobject}/lib/${python.libPrefix}/site-packages";
+in
+   
+stdenv.mkDerivation rec {
+  name = "bluez-5.3";
+   
+  src = fetchurl {
+    url = "mirror://kernel/linux/bluetooth/${name}.tar.xz";
+    sha256 = "41b0559e3a8436a739eb7cc79156ca91daf8c115f57971b6bcb422ee0213db42";
+  };
+
+  buildInputs =
+    [ pkgconfig dbus.libs glib libusb alsaLib python makeWrapper
+      readline libsndfile udev libical
+      # Disables GStreamer; not clear what it gains us other than a
+      # zillion extra dependencies.
+      # gstreamer gst_plugins_base 
+    ];
+
+  preConfigure = ''
+      substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
+      substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
+    '';
+
+  configureFlags = [
+    "--localstatedir=/var"
+    "--enable-library"
+    "--enable-cups"
+    "--with-dbusconfdir=$(out)/etc"
+    "--with-dbussystembusdir=$(out)/share/dbus-1/system-services"
+    "--with-dbussessionbusdir=$(out)/share/dbus-1/services"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--with-systemduserunitdir=$(out)/etc/systemd/user"
+    "--with-udevdir=$(out)/lib/udev"
+    ];
+
+  # Work around `make install' trying to create /var/lib/bluetooth.
+  installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
+
+  makeFlags = "rulesdir=$(out)/lib/udev/rules.d";
+
+  # FIXME: Move these into a separate package to prevent Bluez from
+  # depending on Python etc.
+  postInstall = ''
+    pushd test
+    for a in \
+            simple-agent \
+            test-adapter \
+            test-device \
+            test-thermometer \
+            list-devices \
+            monitor-bluetooth \
+            ; do
+      cp $a $out/bin/bluez-$a
+      wrapProgram $out/bin/bluez-$a --prefix PYTHONPATH : ${pythonpath}
+    done
+    popd
+  '';
+
+  meta = {
+    homepage = http://www.bluez.org/;
+    description = "Bluetooth support for Linux";
+  };
+}
diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix
index 10187986111..3b876322f1f 100644
--- a/pkgs/os-specific/linux/bluez/default.nix
+++ b/pkgs/os-specific/linux/bluez/default.nix
@@ -9,11 +9,11 @@ let
 in
    
 stdenv.mkDerivation rec {
-  name = "bluez-4.98";
+  name = "bluez-4.101";
    
   src = fetchurl {
     url = "mirror://kernel/linux/bluetooth/${name}.tar.gz";
-    sha256 = "9a5b655bada7c7a1921cb3bac83b8a32bbe49893e4c7a1377cdc1b0d35f7d233";
+    sha256 = "11vldy255zkmmpj0g0a1m6dy9bzsmyd7vxy02cdfdw79ml888wsr";
   };
 
   buildInputs =
diff --git a/pkgs/os-specific/linux/broadcom-sta/default.nix b/pkgs/os-specific/linux/broadcom-sta/default.nix
index 041141cdad2..43ba9dfc2b5 100644
--- a/pkgs/os-specific/linux/broadcom-sta/default.nix
+++ b/pkgs/os-specific/linux/broadcom-sta/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kernel }:
+{ stdenv, fetchurl, kernelDev }:
 
 let version = "5_100_82_112";
     bits = if stdenv.system == "i686-linux" then "32" else
@@ -6,7 +6,7 @@ let version = "5_100_82_112";
 in
 
 stdenv.mkDerivation {
-  name = "broadcom-sta-${version}-${kernel.version}";
+  name = "broadcom-sta-${version}-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://www.broadcom.com/docs/linux_sta/hybrid-portsrc_x86_${bits}-v${version}.tar.gz";
@@ -15,13 +15,13 @@ stdenv.mkDerivation {
       else "1qsarnry10f5m8a73wbr9cg2ifs00sqg6x0ay59l72vl9hb2zlww";
   };
 
-  buildInputs = [ kernel ];
+  buildInputs = [ kernelDev ];
   patches =
     [ ./makefile.patch ./linux-2.6.39.patch ./linux-3.2.patch
       ./linux-3.4.patch ./license.patch
     ];
 
-  makeFlags = "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/build";
+  makeFlags = "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build";
 
   unpackPhase =
     ''
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   installPhase =
     ''
-      binDir="$out/lib/modules/${kernel.modDirVersion}/kernel/net/wireless/"
+      binDir="$out/lib/modules/${kernelDev.modDirVersion}/kernel/net/wireless/"
       docDir="$out/share/doc/broadcom-sta/"
       mkdir -p "$binDir" "$docDir"
       cp wl.ko "$binDir"
diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix
index 0848cb33253..a24e0fd2307 100644
--- a/pkgs/os-specific/linux/busybox/default.nix
+++ b/pkgs/os-specific/linux/busybox/default.nix
@@ -44,6 +44,9 @@ stdenv.mkDerivation rec {
     sha256 = "10k8kgrprll9hxfm9gc3jl7kkq79g6l2pygn5snqwqg5v80zy4zb";
   };
 
+  # Remove this patch after the next busybox update.
+  patches = [ ./include-missing-sys-resource-header.patch ];
+
   configurePhase = ''
     make defconfig
     ${configParser}
@@ -60,7 +63,7 @@ stdenv.mkDerivation rec {
     extraCrossConfig = ''
       CONFIG_CROSS_COMPILER_PREFIX "${stdenv.cross.config}-"
     '' +
-      (if (stdenv.cross.platform.kernelMajor == "2.4") then ''
+      (if stdenv.cross.platform.kernelMajor == "2.4" then ''
         CONFIG_IONICE n
       '' else "");
   };
diff --git a/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch b/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch
new file mode 100644
index 00000000000..8163a86e3cd
--- /dev/null
+++ b/pkgs/os-specific/linux/busybox/include-missing-sys-resource-header.patch
@@ -0,0 +1,12 @@
+diff --git a/include/libbb.h b/include/libbb.h
+index f12800f..e7806c2 100644
+--- a/include/libbb.h
++++ b/include/libbb.h
+@@ -40,6 +40,7 @@
+ #include <sys/poll.h>
+ #include <sys/ioctl.h>
+ #include <sys/mman.h>
++#include <sys/resource.h>
+ #include <sys/socket.h>
+ #include <sys/stat.h>
+ #include <sys/time.h>
diff --git a/pkgs/os-specific/linux/checkpolicy/default.nix b/pkgs/os-specific/linux/checkpolicy/default.nix
index a69249b216d..9125c84bd7a 100644
--- a/pkgs/os-specific/linux/checkpolicy/default.nix
+++ b/pkgs/os-specific/linux/checkpolicy/default.nix
@@ -2,11 +2,12 @@
 stdenv.mkDerivation rec {
 
   name = "checkpolicy-${version}";
-  version = "2.0.23";
+  version = "2.1.11";
+  inherit (libsepol) se_release se_url;
 
   src = fetchurl {
-    url = "http://userspace.selinuxproject.org/releases/20101221/devel/checkpolicy-2.0.23.tar.gz";
-    sha256 = "1n34ggacds7xap039r6hqkxmkd4g2wgfkxjdnv3lirq3cqqi8cnd";
+    url = "${se_url}/${se_release}/checkpolicy-${version}.tar.gz";
+    sha256 = "1wahs32l4jjlg0s3lyihdhvwmsy7yyvq5pk96q9lsiilc5vvrb06";
   };
 
   buildInputs = [ libsepol libselinux bison flex ];
@@ -14,10 +15,8 @@ stdenv.mkDerivation rec {
   preBuild = '' makeFlags="$makeFlags LEX=flex LIBDIR=${libsepol}/lib PREFIX=$out" '';
 
   meta = with stdenv.lib; {
-    homepage = http://userspace.selinuxproject.org/;
     description = "SELinux policy compiler";
     license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
+    inherit (libsepol.meta) homepage platforms maintainers;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/os-specific/linux/cifs-utils/default.nix b/pkgs/os-specific/linux/cifs-utils/default.nix
index 63eafb93e30..0f8801ef58e 100644
--- a/pkgs/os-specific/linux/cifs-utils/default.nix
+++ b/pkgs/os-specific/linux/cifs-utils/default.nix
@@ -1,18 +1,20 @@
 { stdenv, fetchurl }:
-   
+
 stdenv.mkDerivation rec {
-  name = "cifs-utils-5.3";
-   
+  name = "cifs-utils-5.6";
+
   src = fetchurl {
     url = "ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/${name}.tar.bz2";
-    sha256 = "68e969c4107a872e2848992732dc11eafc7bdf084bec894c0ba677572de49b32";
+    sha256 = "0f619nw1163bcmfc83mmqj31qdkl68wfm81vynx3d8q0m0k1ll7i";
   };
 
+  patches = [ ./find-systemd-ask-password-via-path.patch ];
+
   makeFlags = "root_sbindir=$(out)/sbin";
 
   meta = {
     homepage = http://www.samba.org/linux-cifs/cifs-utils/;
     description = "Tools for managing Linux CIFS client filesystems";
-    platforms = stdenv.lib.platforms.linux;    
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch b/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch
new file mode 100644
index 00000000000..428cb75edad
--- /dev/null
+++ b/pkgs/os-specific/linux/cifs-utils/find-systemd-ask-password-via-path.patch
@@ -0,0 +1,22 @@
+diff -ubr cifs-utils-5.9-orig/mount.cifs.c cifs-utils-5.9/mount.cifs.c
+--- cifs-utils-5.9-orig/mount.cifs.c	2013-03-05 10:53:19.375464790 +0100
++++ cifs-utils-5.9/mount.cifs.c	2013-03-05 11:41:40.704946110 +0100
+@@ -1634,7 +1634,7 @@
+ }
+ 
+ /*
+- * If systemd is running and /bin/systemd-ask-password --
++ * If systemd is running and systemd-ask-password --
+  * is available, then use that else fallback on getpass(..)
+  *
+  * Returns: @input or NULL on error
+@@ -1657,7 +1657,7 @@
+ 		FILE *ask_pass_fp = NULL;
+ 
+ 		cmd = ret = NULL;
+-		if (asprintf(&cmd, "/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
++		if (asprintf(&cmd, "/run/current-system/sw/bin/systemd-ask-password \"%s\"", prompt) >= 0) {
+ 			ask_pass_fp = popen (cmd, "re");
+ 			free (cmd);
+ 		}
+Only in cifs-utils-5.9/: mount.cifs.c.orig
diff --git a/pkgs/os-specific/linux/conky/curl-types-h.patch b/pkgs/os-specific/linux/conky/curl-types-h.patch
deleted file mode 100644
index ba99da23b46..00000000000
--- a/pkgs/os-specific/linux/conky/curl-types-h.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-curl removed <curl/types.h> header
-diff --git a/src/ccurl_thread.c b/src/ccurl_thread.c
-index 10e73a6..9bea299 100644
---- a/src/ccurl_thread.c
-+++ b/src/ccurl_thread.c
-@@ -33,7 +33,6 @@
- #endif /* DEBUG */
- 
- #include <curl/curl.h>
--#include <curl/types.h>
- #include <curl/easy.h>
- 
- /*
-diff --git a/src/eve.c b/src/eve.c
-index dc07264..f62a5f6 100644
---- a/src/eve.c
-+++ b/src/eve.c
-@@ -37,7 +37,6 @@
- #include <libxml/xmlwriter.h>
- 
- #include <curl/curl.h>
--#include <curl/types.h>
- #include <curl/easy.h>
- 
- #include <time.h>
diff --git a/pkgs/os-specific/linux/conky/default.nix b/pkgs/os-specific/linux/conky/default.nix
index fda361d6c74..086b792b4cd 100644
--- a/pkgs/os-specific/linux/conky/default.nix
+++ b/pkgs/os-specific/linux/conky/default.nix
@@ -1,24 +1,26 @@
-{stdenv, fetchurl, pkgconfig, libxml2, curl, wirelesstools, glib, openssl}:
+{ stdenv, fetchurl, pkgconfig, libxml2, curl, wirelesstools, glib, openssl
+, ncurses }:
 
 stdenv.mkDerivation rec {
-  name = "conky-1.8.1";
+  name = "conky-1.9.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/conky/${name}.tar.bz2";
-    sha256 = "0hsybra4qzaqzny6n66m7768vbwkikajcvcbsqgnnnb9527jfnpq";
+    sha256 = "0vxvjmi3cdvnp994sv5zcdyncfn0mlxa71p2wm9zpyrmy58bbwds";
   };
 
-  buildInputs = [ pkgconfig libxml2 curl wirelesstools glib openssl ];
-  configureFlags =
-    (map (x: "--disable-${x}") [ "x11" "xdamage" "own-window" "xft" "lua" "ncurses" ])
-    ++ (map (x: "--enable-${x}") [ "mpd" "double-buffer" "wlan" "rss" ]);
+  patches = [ ./stdbool.patch ];
 
-  patches = [ ./curl-types-h.patch ];
+  buildInputs = [ pkgconfig libxml2 curl wirelesstools glib openssl ncurses ];
+  configureFlags =
+    (map (x: "--disable-${x}") [ "x11" "xdamage" "own-window" "xft" "lua" ])
+    ++ (map (x: "--enable-${x}") [ "mpd" "double-buffer" "wlan" "rss"
+                                   "weather-metar" "weather-xoap" ]);
 
   meta = {
     homepage = http://conky.sourceforge.net/;
     description = "Conky is an advanced, highly configurable system monitor complied without X based on torsmo";
     maintainers = [ stdenv.lib.maintainers.guibert ];
+    license = stdenv.lib.licenses.gpl3Plus;
   };
 }
-
diff --git a/pkgs/os-specific/linux/conky/stdbool.patch b/pkgs/os-specific/linux/conky/stdbool.patch
new file mode 100644
index 00000000000..3f0b714a1f0
--- /dev/null
+++ b/pkgs/os-specific/linux/conky/stdbool.patch
@@ -0,0 +1,12 @@
+diff --git a/src/conky.c b/src/conky.c
+index 5848b61..69a3d45 100644
+--- a/src/conky.c
++++ b/src/conky.c
+@@ -34,6 +34,7 @@
+ #include "common.h"
+ #include "timed_thread.h"
+ #include <stdarg.h>
++#include <stdbool.h>
+ #include <math.h>
+ #include <time.h>
+ #include <locale.h>
diff --git a/pkgs/os-specific/linux/consoletools/default.nix b/pkgs/os-specific/linux/consoletools/default.nix
new file mode 100644
index 00000000000..537cc386402
--- /dev/null
+++ b/pkgs/os-specific/linux/consoletools/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchgit, SDL }:
+
+stdenv.mkDerivation rec {
+  name = "linuxconsoletools-${version}";
+  version = "1.4.3";
+
+  src = fetchgit {
+    url = "git://linuxconsole.git.sourceforge.net/gitroot/linuxconsole/linuxconsole";
+    rev = "dac2cae0e5795ddc27b76a92767dd9e07a10621e";
+    sha256 = "350b008e614923dbd548fcaaf2842b39433acdcf595e2ce8aaf1599f076d331d";
+  };
+
+  buildInputs = [ SDL ];
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/linuxconsole/";
+    description = "A set of tools for joysticks and serial peripherals";
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    longDescription = ''
+      The included tools are:
+
+      ffcfstress(1)  - force-feedback stress test
+      ffmvforce(1)   - force-feedback orientation test
+      ffset(1)       - force-feedback configuration tool
+      fftest(1)      - general force-feedback test
+      jstest(1)      - joystick test
+      jscal(1)       - joystick calibration tool
+      inputattach(1) - connects legacy serial devices to the input layer
+    '';
+  };
+}
diff --git a/pkgs/os-specific/linux/cpufrequtils/default.nix b/pkgs/os-specific/linux/cpufrequtils/default.nix
index 35bf57c269e..85907ff0212 100644
--- a/pkgs/os-specific/linux/cpufrequtils/default.nix
+++ b/pkgs/os-specific/linux/cpufrequtils/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, libtool, gettext }:
 
-assert stdenv.isLinux && stdenv.system != "powerpc-linux";
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
 stdenv.mkDerivation {
   name = "cpufrequtils-008";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/utils/kernel/cpufreq/cpufrequtils-008.tar.gz";
+    url = http://ftp.be.debian.org/pub/linux/utils/kernel/cpufreq/cpufrequtils-008.tar.gz;
     md5 = "52d3e09e47ffef634833f7fab168eccf";
   };
 
diff --git a/pkgs/os-specific/linux/cryptodev/default.nix b/pkgs/os-specific/linux/cryptodev/default.nix
new file mode 100644
index 00000000000..e80256f7299
--- /dev/null
+++ b/pkgs/os-specific/linux/cryptodev/default.nix
@@ -0,0 +1,30 @@
+{ fetchurl, stdenv, kernelDev, onlyHeaders ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "cryptodev-linux-1.5";
+  name = "${pname}-${kernelDev.version}";
+
+  src = fetchurl {
+    url = "http://download.gna.org/cryptodev-linux/${pname}.tar.gz";
+    sha256 = "13hybl5p0ck0vgi2gxmiwa2810gcfk78kdy17ai8nczj8il15mn0";
+  };
+
+  buildPhase = if !onlyHeaders then ''
+    make -C ${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build \
+      SUBDIRS=`pwd` INSTALL_PATH=$out
+  '' else ":";
+
+  installPhase = stdenv.lib.optionalString (!onlyHeaders) ''
+    make -C ${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build \
+      INSTALL_MOD_PATH=$out SUBDIRS=`pwd` modules_install
+  '' + ''
+    mkdir -p $out/include/crypto
+    cp crypto/cryptodev.h $out/include/crypto
+  '';
+
+  meta = {
+    description = "Device that allows access to Linux kernel cryptographic drivers";
+    homepage = http://home.gna.org/cryptodev-linux/;
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix
index 9e762f64904..6d612f8cdbd 100644
--- a/pkgs/os-specific/linux/cryptsetup/default.nix
+++ b/pkgs/os-specific/linux/cryptsetup/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, devicemapper, libgcrypt, libuuid, pkgconfig, popt }:
 
 stdenv.mkDerivation rec {
-  name = "cryptsetup-1.5.0";
+  name = "cryptsetup-1.5.1";
 
   src = fetchurl {
     url = "http://cryptsetup.googlecode.com/files/${name}.tar.bz2";
-    sha256 = "1l7qcmaq092k28k8sbw845hs6jwn0f05h68rmb7iwh52232m8wa0";
+    sha256 = "0dib3nw6ifd7d7hr9k4iyaha3hz0pkzairqa38l3fndkr9w3zlhn";
   };
 
   configureFlags = "--enable-cryptsetup-reencrypt";
diff --git a/pkgs/os-specific/linux/e1000e/default.nix b/pkgs/os-specific/linux/e1000e/default.nix
index 709befd9dc5..8d1320afc68 100644
--- a/pkgs/os-specific/linux/e1000e/default.nix
+++ b/pkgs/os-specific/linux/e1000e/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, fetchurl, kernel }:
+{ stdenv, fetchurl, kernelDev }:
 
 stdenv.mkDerivation {
-  name = "e1000e-1.5.1-${kernel.version}";
+  name = "e1000e-1.5.1-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://downloads.sourceforge.net/e1000/e1000e-1.5.1.tar.gz";
     sha256 = "0nzjlarpqcpm5y112n3vzra4qv32hiygpfkk10y8g4nln4adhqsw";
   };
 
-  buildInputs = [ kernel ];
+  buildInputs = [ kernelDev ];
 
   configurePhase = ''
     cd src
-    kernel_version=$( cd ${kernel}/lib/modules && echo * )
-    sed -i -e 's|/lib/modules|${kernel}/lib/modules|' Makefile
+    kernel_version=$( cd ${kernelDev}/lib/modules && echo * )
+    sed -i -e 's|/lib/modules|${kernelDev}/lib/modules|' Makefile
     export makeFlags="BUILD_KERNEL=$kernel_version"
   '';
 
diff --git a/pkgs/os-specific/linux/ebtables/default.nix b/pkgs/os-specific/linux/ebtables/default.nix
index 1f0539add93..eec456ff5ad 100644
--- a/pkgs/os-specific/linux/ebtables/default.nix
+++ b/pkgs/os-specific/linux/ebtables/default.nix
@@ -1,22 +1,27 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "ebtables-2.0.9-2";
+  name = "ebtables-${version}";
+  version = "2.0.10-4";
 
   src = fetchurl {
-    url = mirror://sourceforge/ebtables/ebtables-v2.0.9-2.tar.gz;
-    sha256 = "18yni9zzhfi1ygkgifzj8qpn95cwwiw7j6b3wsl1bij39mj5z1cq";
+    url = "mirror://sourceforge/ebtables/ebtables-v${version}.tar.gz";
+    sha256 = "0pa5ljlk970yfyhpf3iqwfpbc30j8mgn90fapw9cfz909x47nvyw";
   };
 
   makeFlags =
-    "LIBDIR=$(out)/lib BINDIR=$(out)/sbin MANDIR=$(out)/share/man " +
-    "ETCDIR=$(out)/etc INITDIR=$(TMPDIR) SYSCONFIGDIR=$(out)/etc/sysconfig";
+    [ "LIBDIR=$(out)/lib" "BINDIR=$(out)/sbin" "MANDIR=$(out)/share/man"
+      "ETCDIR=$(out)/etc" "INITDIR=$(TMPDIR)" "SYSCONFIGDIR=$(out)/etc/sysconfig"
+      "LOCALSTATEDIR=/var"
+    ];
 
   preBuild =
     ''
       substituteInPlace Makefile --replace '-o root -g root' ""
     '';
 
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
   preInstall = "mkdir -p $out/etc/sysconfig";
 
   meta = {
diff --git a/pkgs/os-specific/linux/eject/default.nix b/pkgs/os-specific/linux/eject/default.nix
deleted file mode 100644
index eec1ec5342c..00000000000
--- a/pkgs/os-specific/linux/eject/default.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{stdenv, fetchurl, gettext}:
-
-stdenv.mkDerivation {
-  name = "eject-2.1.5";
-  #builder = ./builder.sh;
-  src = fetchurl {
-    url = http://ca.geocities.com/jefftranter@rogers.com/eject-2.1.5.tar.gz;
-    sha256 = "0mgy5wp40rsalfkxs6mvsg3s7yaqf2iq49iv4axf9zac9037k7zg";
-  };
-  buildInputs = [gettext];
-  preBuild = "
-    makeFlagsArray=(PREFIX=$out)
-  ";
-}
diff --git a/pkgs/os-specific/linux/exmap/default.nix b/pkgs/os-specific/linux/exmap/default.nix
index c39b2acf4e1..1b372ca3dbf 100644
--- a/pkgs/os-specific/linux/exmap/default.nix
+++ b/pkgs/os-specific/linux/exmap/default.nix
@@ -1,7 +1,7 @@
-{ fetchurl, stdenv, kernel, pkgconfig, gtkmm, boost, pcre }:
+{ fetchurl, stdenv, kernelDev, pkgconfig, gtkmm, boost, pcre }:
 
 stdenv.mkDerivation rec {
-  name = "exmap-0.10-${kernel.version}";
+  name = "exmap-0.10-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://www.berthels.co.uk/exmap/download/${name}.tgz";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   patchPhase = ''
     substituteInPlace "kernel/Makefile" \
       --replace '/lib/modules/$(shell uname -r)/build' \
-                ${kernel}/lib/modules/*/build
+                ${kernelDev}/lib/modules/*/build
 
     # The `proc_root' variable (the root of `/proc') is no longer exported
     # since 2.6.26.  Fortunately, one can pass `NULL' instead of `&proc_root'.
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     substituteInPlace "src/Makefile" --replace "-Werror" ""
   '';
 
-  buildInputs = [ kernel pkgconfig gtkmm boost pcre ];
+  buildInputs = [ kernelDev pkgconfig gtkmm boost pcre ];
 
   buildPhase = "make build";
 
diff --git a/pkgs/os-specific/linux/fbterm/default.nix b/pkgs/os-specific/linux/fbterm/default.nix
index 0201422cdf9..59f93e836c4 100644
--- a/pkgs/os-specific/linux/fbterm/default.nix
+++ b/pkgs/os-specific/linux/fbterm/default.nix
@@ -1,37 +1,33 @@
-a :  
-let 
-  fetchurl = a.fetchurl;
-  
-  buildInputs = with a; [
-    gpm freetype fontconfig pkgconfig ncurses
-  ];
-  s = import ./src-for-default.nix; 
+{stdenv, fetchurl, gpm, freetype, fontconfig, pkgconfig, ncurses}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="fbterm";
+    version="1.7.0";
+    name="fbterm-1.7.0";
+    hash="0pciv5by989vzvjxsv1jsv4bdp4m8j0nfbl29jm5fwi12w4603vj";
+    url="http://fbterm.googlecode.com/files/fbterm-1.7.0.tar.gz";
+    sha256="0pciv5by989vzvjxsv1jsv4bdp4m8j0nfbl29jm5fwi12w4603vj";
+  };
+  buildInputs = [gpm freetype fontconfig pkgconfig ncurses];
 in
-rec {
-  src = a.fetchUrlFromSrcInfo s; 
-  inherit(s) name;
+stdenv.mkDerivation {
+  inherit (s) name version;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
   inherit buildInputs;
-  configureFlags = [];
-
-  fixInc = a.fullDepEntry (''
+  preConfigure = ''
     sed -e '/ifdef SYS_signalfd/atypedef long long loff_t;' -i src/fbterm.cpp
-  '') ["doUnpack" "minInit"];
-
-  fixMakeInstall = a.fullDepEntry (''
     sed -e '/install-exec-hook:/,/^[^\t]/{d}; /.NOEXPORT/iinstall-exec-hook:\
     ' -i src/Makefile.in
-  '') ["doUnpack" "minInit"];
-
-  setVars = a.noDepEntry (''
     export HOME=$PWD;
     export NIX_LDFLAGS="$NIX_LDFLAGS -lfreetype"
-  '') ;
-
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["setVars" "fixInc" "fixMakeInstall" "doConfigure" "doMakeInstall"];
-      
+  '';
   meta = {
+    inherit (s) version;
     description = "Framebuffer terminal emulator";
-    maintainers = [a.lib.maintainers.raskin];
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/fbterm/default.upstream b/pkgs/os-specific/linux/fbterm/default.upstream
new file mode 100644
index 00000000000..387ef8862fb
--- /dev/null
+++ b/pkgs/os-specific/linux/fbterm/default.upstream
@@ -0,0 +1,3 @@
+url http://code.google.com/p/fbterm/downloads/list
+version_link '[.]tar[.][a-z0-9]+$'
+process 'code[.]google[.]com//' ''
diff --git a/pkgs/os-specific/linux/fbterm/src-for-default.nix b/pkgs/os-specific/linux/fbterm/src-for-default.nix
deleted file mode 100644
index 6705404ac9f..00000000000
--- a/pkgs/os-specific/linux/fbterm/src-for-default.nix
+++ /dev/null
@@ -1,9 +0,0 @@
-rec {
-   version="1.7";
-   name="fbterm-1.7";
-   hash="19qjb2zb4gwr1jlybmalaw3y3zybvc8vliwj85dfabmill1k1afh";
-   url="http://fbterm.googlecode.com/files/fbterm-${version}.tar.gz";
-   advertisedUrl="http://fbterm.googlecode.com/files/fbterm-1.7.tar.gz";
-  
-  
-}
diff --git a/pkgs/os-specific/linux/fbterm/src-info-for-default.nix b/pkgs/os-specific/linux/fbterm/src-info-for-default.nix
deleted file mode 100644
index b0c439714fb..00000000000
--- a/pkgs/os-specific/linux/fbterm/src-info-for-default.nix
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  downloadPage = "http://code.google.com/p/fbterm/";
-  baseName = "fbterm";
-}
diff --git a/pkgs/os-specific/linux/fbterm/stdenv.nix b/pkgs/os-specific/linux/fbterm/stdenv.nix
deleted file mode 100644
index e257a7d46eb..00000000000
--- a/pkgs/os-specific/linux/fbterm/stdenv.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-# Quick version to be able to cross-build fbterm meanwhile builderDefs cannot
-# cross-build with an equivalent to the stdenvCross adapter.
-{ stdenv, fetchurl, gpm, freetype, fontconfig, pkgconfig, ncurses }:
-
-let
-  version="1.7";
-  name="fbterm-1.7";
-  hash="19qjb2zb4gwr1jlybmalaw3y3zybvc8vliwj85dfabmill1k1afh";
-  url="http://fbterm.googlecode.com/files/fbterm-${version}.tar.gz";
-in
-
-stdenv.mkDerivation {
-  inherit name;
-
-  src = fetchurl {
-    inherit url;
-    sha256 = hash;
-  };
-
-  buildNativeInputs = [ ncurses ];
-  buildInputs = [ gpm freetype fontconfig pkgconfig ];
-
-  preConfigure = ''
-    sed -e '/ifdef SYS_signalfd/atypedef long long loff_t;' -i src/fbterm.cpp
-
-    sed -e '/install-exec-hook:/,/^[^\t]/{d}; /.NOEXPORT/iinstall-exec-hook:\
-    ' -i src/Makefile.in
-
-    export HOME=$PWD;
-
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lfreetype"
-    # This is only relevant cross-building
-    export NIX_CROSS_LDFLAGS="$NIX_CROSS_LDFLAGS -lfreetype"
-  '';
-}
diff --git a/pkgs/os-specific/linux/ffado/default.nix b/pkgs/os-specific/linux/ffado/default.nix
index a78599c6a20..834f98960df 100644
--- a/pkgs/os-specific/linux/ffado/default.nix
+++ b/pkgs/os-specific/linux/ffado/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchsvn, dbus, dbus_cplusplus, expat, glibmm, libconfig
+{ stdenv, fetchurl, dbus, dbus_cplusplus, expat, glibmm, libconfig
 , libavc1394, libiec61883, libraw1394, libxmlxx, makeWrapper, pkgconfig
 , pyqt4, python, pythonDBus, qt4, scons }:
 
 stdenv.mkDerivation rec {
-  name = "libffado-svn-1995";
+  name = "libffado-${version}";
+  version = "2.1.0";
 
-  src = fetchsvn {
-    url = "http://subversion.ffado.org/ffado/trunk/libffado";
-    rev = "1995";
+  src = fetchurl {
+    url = "http://www.ffado.org/files/${name}.tgz";
+    sha256 = "11cxmy31c19720j2171l735rpg7l8i41icsgqscfd2vkbscfmh6y";
   };
 
   buildInputs =
@@ -18,13 +19,16 @@ stdenv.mkDerivation rec {
 
   patches = [ ./enable-mixer-and-dbus.patch ];
 
-  preBuild = "export PYLIBSUFFIX=lib/${python.libPrefix}/site-packages";
-
   # TODO fix ffado-diag, it doesn't seem to use PYPKGDIR
-  buildPhase = "scons PYPKGDIR=$out/$PYLIBSUFFIX";
+  buildPhase = ''
+    export PYLIBSUFFIX=lib/${python.libPrefix}/site-packages
+    scons PYPKGDIR=$out/$PYLIBSUFFIX DEBUG=False
+    sed -e "s#/usr/local#$out#" -i support/mixer-qt4/ffado/config.py
+    '';
+
   installPhase = ''
     scons PREFIX=$out LIBDIR=$out/lib SHAREDIR=$out/share/libffado \
-      PYPKGDIR=$out/$PYLIBSUFFIX install
+      PYPKGDIR=$out/$PYLIBSUFFIX UDEVDIR=$out/lib/udev/rules.d install
 
     sed -e "s#/usr/local#$out#g" -i $out/bin/ffado-diag
 
diff --git a/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch b/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch
index 44c0b991e0a..480e0f45a92 100644
--- a/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch
+++ b/pkgs/os-specific/linux/ffado/enable-mixer-and-dbus.patch
@@ -1,24 +1,25 @@
---- libffado-r2117/SConstruct	1970-01-01 01:00:01.000000000 +0100
-+++ libffado-r2117/SConstruct	2012-04-06 18:26:45.521100690 +0200
-@@ -314,10 +314,8 @@
+--- libffado-2.1.0/SConstruct	1970-01-01 01:00:01.000000000 +0100
++++ libffado-2.1.0/SConstruct	2012-09-30 16:50:23.603283095 +0000
+@@ -349,11 +349,9 @@
+ # Optional checks follow:
  #
  
- # PyQT checks
+-# PyQT checks
 -build_mixer = False
 -if conf.CheckForApp( 'which pyuic4' ) and conf.CheckForPyModule( 'dbus' ) and conf.CheckForPyModule( 'PyQt4' ) and conf.CheckForPyModule( 'dbus.mainloop.qt' ):
 -    env['PYUIC4'] = True
 -    build_mixer = True
 +env['PYUIC4'] = True
 +build_mixer = True
++
  
  if conf.CheckForApp( 'xdg-desktop-menu --help' ):
      env['XDG_TOOLS'] = True
-@@ -348,7 +346,8 @@
+@@ -384,7 +382,7 @@
      name2 = pkg.replace("+","").replace(".","").replace("-","").upper()
      env['%s_FLAGS' % name2] = conf.GetPKGFlags( pkg, pkgs[pkg] )
  
 -if not env['DBUS1_FLAGS'] or not env['DBUSC1_FLAGS'] or not conf.CheckForApp('which dbusxx-xml2cpp'):
-+
 +if False:
      env['DBUS1_FLAGS'] = ""
      env['DBUSC1_FLAGS'] = ""
diff --git a/pkgs/os-specific/linux/firmware/amd-ucode/default.nix b/pkgs/os-specific/linux/firmware/amd-ucode/default.nix
index 685b44a1651..dc5959d400d 100644
--- a/pkgs/os-specific/linux/firmware/amd-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/amd-ucode/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
 
-  name = "amd-ucode-2012-01-17";
+  name = "amd-ucode-2012-09-10";
 
   src = fetchurl {
     url = "http://www.amd64.org/pub/microcode/${name}.tar";
-    sha256 = "0mqnbs87khv6p874cbyf9nb8i4gc592ws67lyzhc4chmwvc9ln47";
+    sha256 = "065phvhx5hx5ssdd1x2p5m1yv26ak7l5aaw6yk6h95x9mxn5r111";
   };
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
index 1c4173c72fd..f941d9275c0 100644
--- a/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
+++ b/pkgs/os-specific/linux/firmware/b43-firmware/5.1.138.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Firmware for cards supported by the b43 kernel module";
     homepage = http://wireless.kernel.org/en/users/Drivers/b43;
-    license = stdenv.lib.licenses.proprietary;
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.shlevy ];
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/bcm43xx/default.nix b/pkgs/os-specific/linux/firmware/bcm43xx/default.nix
index edc15a360ff..fb43c7d67e1 100644
--- a/pkgs/os-specific/linux/firmware/bcm43xx/default.nix
+++ b/pkgs/os-specific/linux/firmware/bcm43xx/default.nix
@@ -2,13 +2,13 @@
 
 let
   src1 = fetchurl {
-    url = "https://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=brcm/bcm43xx_hdr-0.fw;hb=15888a2eab052ac3d3f49334e4f6f05f347a516e";
+    url = "http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=blob_plain;f=brcm/bcm43xx_hdr-0.fw;hb=15888a2eab052ac3d3f49334e4f6f05f347a516e";
     sha256 = "d02549964d21dd90fc35806483b9fc871d93d7d38ae1a70a9ce006103c2a3de3";
     name = "bcm43xx_hdr-0.fw";
   };
 
   src2 = fetchurl {
-    url = "https://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=brcm/bcm43xx-0.fw;hb=15888a2eab052ac3d3f49334e4f6f05f347a516e";
+    url = "https://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=blob_plain;f=brcm/bcm43xx-0.fw;hb=15888a2eab052ac3d3f49334e4f6f05f347a516e";
     sha256 = "f90f685903127e4db431fe1efccefebf77272712bd4bfe46d1d1d5825ee52797";
     name = "bcm43xx-0.fw";
   };
diff --git a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
index e2ba47abb9a..24906f2b0db 100644
--- a/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
+++ b/pkgs/os-specific/linux/firmware/firmware-linux-nonfree/default.nix
@@ -6,25 +6,25 @@
 { stdenv, fetchurl, buildEnv, dpkg }:
 
 let
-  version = "0.35";
+  version = "0.38";
 
   packages = [
-    { name = "linux-nonfree"; sha256 = "8c0701500e5252e3e05ad0e5403cc5295899ccb2d6d731380b5f4c2d90003ed1"; }
-    { name = "atheros"; sha256 = "df411d76e3d55cb256b0974df16cf18f316c1325f33670fbc9e36abba5aa46c0"; }
-    { name = "bnx2"; sha256 = "124e74aa6ce477f7b6a0b5eff3870b0104fd885b4bdfb9977175e75bdb9a7525"; }
-    { name = "bnx2x"; sha256 = "4cbcf3422a9aaa6e31704770c724179765dceabd2e6867e24cf47039925e6545"; }
-    { name = "brcm80211"; sha256 = "eefba7ba31c018d514ea15878cfd7bca36a65b0df3e9024fc3875a990678a684"; }
-    { name = "intelwimax"; sha256 = "436a3bd128224f43988630318aa3e74abfbe838916e1e10a602ddc468b75d843"; }
-    { name = "ipw2x00"; sha256 = "9c214e3a9f7f7d710b5cb30282d5ca2b2ccafc3bb208dfe7e18de16d3aadc7a3"; }
-    { name = "ivtv"; sha256 = "ced47d8b87ff8ff70a8c32492cc4fb5818860ef018b5c04a4415ab26c9b16300"; }
-    { name = "iwlwifi"; sha256 = "5d9615ec128b59cc5834e0261ea74127c0bc64bafabdaef1028a8f1acf611568"; }
-    { name = "libertas"; sha256 = "b109fb5c392928ac5495f8ce1d0f41d123b193031f8b548e8b68e9563db37016"; }
-    { name = "linux"; sha256 = "8e87f75c120904f2ca5fd9017e4503c23d8705b9ccaeb570374d1747163620ab"; }
-    { name = "myricom"; sha256 = "4c9e19d8b2cea97eb05f9d577537dba81aa36ac06c6da9bbed0bfa20434b7acc"; }
-    { name = "netxen"; sha256 = "3bd129229cf548a533c79cb55deefa7e4919e09fcc1f655773f4fa5078d81b9b"; }
-    { name = "qlogic"; sha256 = "213d098435c657115d2754ef5ead52e64f5fa05be4dcbcb0d5d3ca745376959c"; }
-    { name = "ralink"; sha256 = "51f3001ed15ca72bb088297b9e6e4a821ba6250f0ccc8886d77d2f5386a21836"; }
-    { name = "realtek"; sha256 = "a6338f5cd8bbe9627fa994016ebb0a91b40914021bec280ddc8f8a56eab22287"; }
+    { name = "ipw2x00"; sha256 = "1bdial90l1928sfw3j1fz5cbsav8lz9riv38d02bawq9rzvb5dx0"; }
+    { name = "bnx2x"; sha256 = "1a8jwwa6yldj2pgnsghhdkb8c0s64wzg0vx8y3cj11lhbh2ag2i7"; }
+    { name = "linux-nonfree"; sha256 = "0dr91sswvkh0lk80d6byxjavkqcsickqf8xqhdd82j9mm7bjg7ld"; }
+    { name = "intelwimax"; sha256 = "1156c7a301lk2a4d699dmvwzh4k3rfbxl4fx4raafy8a15lbw8mn"; }
+    { name = "iwlwifi"; sha256 = "1q6gl2x4lj83hn8acamlj7s4j8vjd02798a6i52f4r7x0042f58a"; }
+    { name = "bnx2"; sha256 = "0rpsrmywh97azqmsx4qgxyqcvdn5414m9cg92pd7h9xfmm38nscd"; }
+    { name = "qlogic"; sha256 = "02438jzzybicg0bvl2jc3qnn0r4f1pfpyxbf70cmas9sfxb7s3az"; }
+    { name = "libertas"; sha256 = "0b8n1igx6hpxlav73xs8r6qs2v95r9hx4lqqzy0h5iy7md9xs9y4"; }
+    { name = "ivtv"; sha256 = "1vb1jbxdggy2vj1xlncfzyynpra1y62bb3n30ybafjnx88p6f2hi"; }
+    { name = "linux"; sha256 = "0ijd49rf7cg0lniqm9sqz2g4i9jmc9vyz6wv9jlwrvnbl8hhy5vy"; }
+    { name = "netxen"; sha256 = "19d5d3ibhb22p4mh22lnl441v8xyb1pyfi5h36vsjpccivzkgd2f"; }
+    { name = "myricom"; sha256 = "0vq2rvc71j96q684r1bh0528xnrxa1xzh2sdhqfrgip9ihdsp3ml"; }
+    { name = "atheros"; sha256 = "04zy5j48b83garmnfxiqgmm3yv1pfpbldxp69zm24pfxcwyvx3hm"; }
+    { name = "brcm80211"; sha256 = "0kgw6q18i46npmjxv4ymww8dr7nn140xrrqjrbnfhzgha3y2yylg"; }
+    { name = "ralink"; sha256 = "0kbzbc4vpn6mvvkm4q7mfqg0bsj6akfpypxk98s7kbidmyj577q2"; }
+    { name = "realtek"; sha256 = "1ac9vlrzprp0j2mdmp1zi47wg2i76vmi288sm3vwlvp4s6ymm077"; }
   ];
 
   fetchPackage =
@@ -60,7 +60,8 @@ in stdenv.mkDerivation {
   meta = {
     description = "Binary firmware collection packaged by Debian";
     homepage = "http://packages.debian.org/sid/firmware-linux-nonfree";
-    license = "unfree-redistributable-firmware";
+    license = stdenv.lib.licenses.unfreeRedistributableFirmware;
+    platforms = stdenv.lib.platforms.linux;
     priority = 10; # low priority so that other packages can override this big package
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix
index 2660c0b2493..8acb75c3ed6 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-1000-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-1000-ucode-128.50.3.1";
   
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/${name}.tgz";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
     sha256 = "7e81ddad18acec19364c9df22496e8afae99a2e1490b2b178e420b52d443728d";
   };
   
@@ -26,6 +27,6 @@ stdenv.mkDerivation rec {
       driver found in recent kernels.
     '';
 
-    homepage = http://intellinuxwireless.org/;
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-2030-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-2030-ucode/default.nix
new file mode 100644
index 00000000000..bc9c8efe063
--- /dev/null
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-2030-ucode/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "iwlwifi-2030-ucode-18.168.6.1";
+
+  src = fetchurl {
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
+    sha256 = "0b69jpb46fk63ybyyb8lbh99j1d29ayp8fl98l18iqy3q7mx4ry8";
+  };
+
+  buildPhase = "true";
+
+  installPhase = ''
+    mkdir -p "$out"
+    chmod -x *
+    cp * "$out"
+  '';
+
+  meta = {
+    description = "Firmware for the Intel 2030 Series wireless card";
+
+    longDescription = ''
+      This package provides the Intel 2030 Series wireless card
+      firmware. It contains the `iwlwifi-2030-6.ucode' file.
+    '';
+
+    homepage = http://intellinuxwireless.org/;
+  };
+}
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/default.nix
index 3e3ad74adb3..266c7795d23 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-4965-ucode-228.57.1.21";
   
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/" + name + ".tgz";
+    url = "wireless.kernel.org/en/users/Drivers/iwlegacy?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
     sha256 = "1rry0kpzszxk60h5gb94advzi009010xb332iyvfpaiwbj6aiyas";
   };
   
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/version-2.nix b/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/version-2.nix
index e1771c7a5cf..3e15374c65f 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/version-2.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-4965-ucode/version-2.nix
@@ -1,11 +1,12 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "iwlwifi-4965-ucode-228.57.2.21";
+  name = "iwlwifi-4965-ucode-228.61.2.24";
   
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/" + name + ".tgz";
-    sha256 = "1ss8r9l8j28n4zplpcwf81n74yy7p4q9dldnblmh4g0h9nyr8nf0";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlegacy?action=AttachFile&do=get&target=iwlwifi-4965-ucode-228.61.2.24.tgz";
+    name = "iwlwifi-4965-ucode-228.61.2.24.tgz";
+    sha256 = "1n5af3cci0v40w4gr0hplqr1lfvhghlbzdbf60d6185vpcny2l5m";
   };
   
   buildPhase = "true";
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-5000-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-5000-ucode/default.nix
index 49269fffe47..8805f1393fb 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-5000-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-5000-ucode/default.nix
@@ -4,8 +4,9 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-5000-ucode-8.83.5.1-1";
   
   src = fetchurl {
-    url = "http://www.intellinuxwireless.org/iwlwifi/downloads/${name}.tar.gz";
-    sha256 = "0n4f6wsppspvvdpcab52n2piczhgfq7a4y7gazxzzlj5halchnx3";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=iwlwifi-5000-ucode-8.83.5.1-1.tgz";
+    name = "iwlwifi-5000-ucode-8.83.5.1-1.tgz";
+    sha256 = "0pkzr4gflp3j0jm4rw66jypk3xn4bvpgdsnxjqwanyd64aj6naxg";
   };
   
   buildPhase = "true";
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix
index 0d409bd8427..dca427cbff5 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-5150-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-5150-ucode-8.24.2.2";
   
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-5150-ucode-8.24.2.2.tgz";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
     sha256 = "d253e6ff6624639aded67c82df98b2bc4a66eb66400848d5614921d513540cf9";
   };
   
@@ -24,6 +25,6 @@ stdenv.mkDerivation rec {
       firmware.  It contains the `iwlwifi-5150-2.ucode' file.
     '';
 
-    homepage = http://intellinuxwireless.org/;
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-6000-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-6000-ucode/default.nix
index e5f3effa4b7..2e88f1bba74 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-6000-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-6000-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-6000-ucode-9.221.4.1";
 
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/${name}.tgz";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
     sha256 = "7f04623231663dc4ee63df32fd890bfa9514dce1fab9dc7a25fda90350da836b";
   };
 
@@ -24,6 +25,6 @@ stdenv.mkDerivation rec {
       firmware. It contains the `iwlwifi-6000-4.ucode' file.
     '';
 
-    homepage = http://intellinuxwireless.org/;
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix
index e5fe73ca498..ef259b70975 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-6000g2a-ucode/default.nix
@@ -1,11 +1,12 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "iwlwifi-6000g2a-ucode-17.168.5.3";
+  name = "iwlwifi-6000g2a-ucode-18.168.6.1";
 
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/${name}.tgz";
-    sha256 = "febbbc0851db17296d35e5ca1d9266c1a14e9a9ae6ce41a36578c44971ae79f9";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
+    sha256 = "a7f2615756addafbf3e6912cb0265f9650b2807d1ccdf54b620735772725bbe9";
   };
 
   buildPhase = "true";
@@ -17,13 +18,12 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
     description = "Firmware for the Intel 6000 Series Gen2 wireless card";
 
     longDescription = ''
       This package provides the Intel 6000 Series wireless card
       firmware. It contains the `iwlwifi-6000g2a-5.ucode' file.
     '';
-
-    homepage = http://intellinuxwireless.org/;
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix
index b3a2a810bf7..0fee3acd0a3 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi-6000g2b-ucode/default.nix
@@ -4,7 +4,8 @@ stdenv.mkDerivation rec {
   name = "iwlwifi-6000g2b-ucode-17.168.5.2";
 
   src = fetchurl {
-    url = "http://intellinuxwireless.org/iwlwifi/downloads/${name}.tgz";
+    url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=${name}.tgz";
+    name = "${name}.tgz";
     sha256 = "5e4afdf070bfef549e50e62187f22dc2e40f5d9fe8b9a77561f8f3efb0d1d052";
   };
 
@@ -24,6 +25,6 @@ stdenv.mkDerivation rec {
       firmware. It contains the `iwlwifi-6000g2b-4.ucode' file.
     '';
 
-    homepage = http://intellinuxwireless.org/;
+    homepage = http://wireless.kernel.org/en/users/Drivers/iwlwifi;
   };
 }
diff --git a/pkgs/os-specific/linux/firmware/radeon-r700/default.nix b/pkgs/os-specific/linux/firmware/radeon-r700/default.nix
index 09342f687e9..79b16b1dcea 100644
--- a/pkgs/os-specific/linux/firmware/radeon-r700/default.nix
+++ b/pkgs/os-specific/linux/firmware/radeon-r700/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://people.freedesktop.org/~agd5f/radeon_ucode/R700_rlc.bin";
-    sha256 = "1lbgrlbhqijizg16z0g0qa6ggznpdy844cawnwdp1b0fkwhrbkga";
+    sha256 = "1sbpq39cvjnpfp1iamhq9k9266jkaaywnm8d2pw95ayw56a77976";
   };
 
   unpackPhase = "true";
diff --git a/pkgs/os-specific/linux/firmware/raspberrypi/default.nix b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix
new file mode 100644
index 00000000000..02d7194b500
--- /dev/null
+++ b/pkgs/os-specific/linux/firmware/raspberrypi/default.nix
@@ -0,0 +1,23 @@
+{stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "raspberrypi-firmware-20160106";
+
+  src = fetchurl {
+    url = "https://github.com/raspberrypi/firmware/archive/4ade27942e.tar.gz";
+    sha256 = "0f4p920vr7dcj4hprgil8baqqbnsjx1jykz0pkdx29mqy0n0xanl";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share/raspberrypi/boot
+    cp -R boot/* $out/share/raspberrypi/boot
+    cp -R hardfp/opt/vc/* $out
+    cp opt/vc/LICENCE $out/share/raspberrypi
+  '';
+  
+  meta = {
+    description = "Firmware for the Raspberry Pi board";
+    homepage = https://github.com/raspberrypi;
+    license = "non-free";
+  };
+}
diff --git a/pkgs/os-specific/linux/firmware/rtl8168e-2/default.nix b/pkgs/os-specific/linux/firmware/rtl8168e-2/default.nix
index a73ae978597..dbd2fa45b7b 100644
--- a/pkgs/os-specific/linux/firmware/rtl8168e-2/default.nix
+++ b/pkgs/os-specific/linux/firmware/rtl8168e-2/default.nix
@@ -1,8 +1,9 @@
 { stdenv, fetchurl }:
 
+# http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git
 let
   src = fetchurl {
-    url = "http://git.kernel.org/?p=linux/kernel/git/dwmw2/linux-firmware.git;a=blob_plain;f=rtl_nic/rtl8168e-2.fw";
+    url = "http://git.kernel.org/?p=linux/kernel/git/firmware/linux-firmware.git;a=blob_plain;f=rtl_nic/rtl8168e-2.fw";
     sha256 = "11lkwc6r6f5pi8clxajp43j6dzapydgxaxaschribpvhn8lrjj0a";
     name = "rtl8168e-2.fw";
   };
diff --git a/pkgs/os-specific/linux/frandom/default.nix b/pkgs/os-specific/linux/frandom/default.nix
index 7894e86ded9..10876e96fc8 100644
--- a/pkgs/os-specific/linux/frandom/default.nix
+++ b/pkgs/os-specific/linux/frandom/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, kernel }:
+{ stdenv, fetchurl, kernelDev }:
 
 let baseName = "frandom-1.1";
 in
 
 stdenv.mkDerivation rec {
-  name = "${baseName}-${kernel.version}";
+  name = "${baseName}-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://sourceforge.net/projects/frandom/files/${baseName}.tar.gz";
@@ -12,14 +12,14 @@ stdenv.mkDerivation rec {
   };
 
   preBuild = ''
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
+    kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
     substituteInPlace Makefile \
       --replace "\$(shell uname -r)" "$kernelVersion" \
-      --replace "/lib/modules" "${kernel}/lib/modules"
+      --replace "/lib/modules" "${kernelDev}/lib/modules"
   '';
  
   installPhase = ''
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
+    kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
     ensureDir $out/lib/modules/$kernelVersion/misc
     cp frandom.ko $out/lib/modules/$kernelVersion/misc
 
diff --git a/pkgs/os-specific/linux/fuse/default.nix b/pkgs/os-specific/linux/fuse/default.nix
index 2a0dfb220ec..bd2507ec1bc 100644
--- a/pkgs/os-specific/linux/fuse/default.nix
+++ b/pkgs/os-specific/linux/fuse/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, utillinux }:
 
 stdenv.mkDerivation rec {
-  name = "fuse-2.8.7";
+  name = "fuse-2.9.2";
   
   builder = ./builder.sh;
   
   src = fetchurl {
     url = "mirror://sourceforge/fuse/${name}.tar.gz";
-    sha256 = "17dlp6p7kcd8kav3rylmn1a1rqbnri4iawl78mmcm1szllck6w90";
+    sha256 = "1z6fg593hy1j7mynhckx43gqkkg2nwpmwwv860337nl77zxji9w1";
   };
   
   configureFlags = "--disable-kernel-module";
diff --git a/pkgs/os-specific/linux/gogoclient/default.nix b/pkgs/os-specific/linux/gogoclient/default.nix
index d1a4bf9feb6..09a449bbede 100644
--- a/pkgs/os-specific/linux/gogoclient/default.nix
+++ b/pkgs/os-specific/linux/gogoclient/default.nix
@@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
   name = "${baseName}-${version}";
 
   src = fetchurl {
-    url = http://gogo6.com/downloads/gogoc-1_2-RELEASE.tar.gz;
+    #url = http://gogo6.com/downloads/gogoc-1_2-RELEASE.tar.gz;
+    url = http://pkgs.fedoraproject.org/repo/pkgs/gogoc/gogoc-1_2-RELEASE.tar.gz/41177ed683cf511cc206c7782c37baa9/gogoc-1_2-RELEASE.tar.gz;
     sha256 = "a0ef45c0bd1fc9964dc8ac059b7d78c12674bf67ef641740554e166fa99a2f49";
   };
   patches = [./gcc46-include-fix.patch ./config-paths.patch ];
@@ -24,10 +25,11 @@ stdenv.mkDerivation rec {
     rm $out/bin/gogoc.conf.sample
 
     substituteInPlace "$out/template/linux.sh" \
-      --replace "/sbin/ifconfig" "${nettools}/sbin/ifconfig" \
-      --replace "/sbin/route"    "${nettools}/sbin/route" \
+      --replace "/sbin/ifconfig" "${nettools}/bin/ifconfig" \
+      --replace "/sbin/route"    "${nettools}/bin/route" \
       --replace "/sbin/ip"       "${iproute}/sbin/ip" \
       --replace "/sbin/sysctl"   "${procps}/sbin/sysctl"
+    sed -i -e 's/^.*Exec \$route -A.*$/& metric 128/' $out/template/linux.sh
   '';
 
   meta = {
diff --git a/pkgs/os-specific/linux/google-authenticator/default.nix b/pkgs/os-specific/linux/google-authenticator/default.nix
new file mode 100644
index 00000000000..d7acc6778b4
--- /dev/null
+++ b/pkgs/os-specific/linux/google-authenticator/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, pam }:
+
+stdenv.mkDerivation rec {
+  name = "google-authenticator-1.0";
+
+  src = fetchurl {
+    url = "https://google-authenticator.googlecode.com/files/libpam-${name}-source.tar.bz2";
+    sha1 = "017b7d89989f1624e360abe02d6b27a6298d285d";
+  };
+
+  buildInputs = [ pam ];
+
+  installPhase = ''
+    ensureDir $out/bin $out/lib/security
+    cp pam_google_authenticator.so $out/lib/security
+    cp google-authenticator $out/bin
+  '';
+
+  meta = {
+    homepage = https://code.google.com/p/google-authenticator/;
+    description = "Two-step verification, with pam module";
+    license = "ASL2.0";
+  };
+}
diff --git a/pkgs/os-specific/linux/hal/default.nix b/pkgs/os-specific/linux/hal/default.nix
deleted file mode 100644
index f1757be94cf..00000000000
--- a/pkgs/os-specific/linux/hal/default.nix
+++ /dev/null
@@ -1,63 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, python, pciutils, expat
-, libusb, dbus, dbus_glib, glib, libuuid, perl
-, perlXMLParser, gettext, zlib, gperf, consolekit, policykit
-, libsmbios, dmidecode, udev, utillinux, pmutils, usbutils
-, eject, upstart
-}:
-
-assert stdenv ? glibc;
-
-let
-  isPC = stdenv.isi686 || stdenv.isx86_64;
-  changeDmidecode = if isPC then
-    "--replace /usr/sbin/dmidecode ${dmidecode}/sbin/dmidecode"
-    else "";
-in
-stdenv.mkDerivation rec {
-  name = "hal-0.5.14";
-
-  src = fetchurl {
-    url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
-    sha256 = "00ld3afcbh4ckb8sli63mm2w69zh6ip4axhy1lxyybgiabxaqfij";
-  };
-
-  buildInputs = [
-    pkgconfig python pciutils expat libusb dbus.libs dbus_glib glib
-    libuuid perl perlXMLParser gettext zlib gperf
-    consolekit policykit
-  ];
-
-  # !!! Hm, maybe the pci/usb.ids location should be in /etc, so that
-  # we don't have to rebuild HAL when we update the PCI/USB IDs.
-  configureFlags = ''
-    --with-pci-ids=${pciutils}/share
-    --with-usb-ids=${usbutils}/share
-    --localstatedir=/var
-    --with-eject=${eject}/bin/eject
-    --with-linux-input-header=${stdenv.glibc}/include/linux/input.h
-    --enable-umount-helper
-  '';
-
-  propagatedBuildInputs = [ libusb ]
-    ++ stdenv.lib.optional isPC libsmbios;
-
-  preConfigure = ''
-    for i in hald/linux/probing/probe-smbios.c hald/linux/osspec.c \
-             hald/linux/coldplug.c hald/linux/blockdev.c \
-             tools/hal-storage-mount.c ./tools/hal-storage-shared.c \
-             tools/hal-system-power-pm-is-supported.c \
-             tools/linux/hal-*-linux
-    do
-      substituteInPlace $i \
-        ${changeDmidecode} \
-        ${if udev != null then "--replace /sbin/udevadm ${udev}/sbin/udevadm" else ""} \
-        --replace /bin/mount ${utillinux}/bin/mount \
-        --replace /bin/umount ${utillinux}/bin/umount \
-        --replace /usr/bin/pm-is-supported ${pmutils}/bin/pm-is-supported \
-        --replace /usr/sbin/pm ${pmutils}/sbin/pm \
-        --replace /sbin/shutdown ${upstart}/sbin/shutdown
-    done
-  '';
-
-  installFlags = "slashsbindir=$(out)/sbin";
-}
diff --git a/pkgs/os-specific/linux/hal/hal-evt.nix b/pkgs/os-specific/linux/hal/hal-evt.nix
deleted file mode 100644
index a49f4fcc0f8..00000000000
--- a/pkgs/os-specific/linux/hal/hal-evt.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ stdenv, fetchurl, libxml2, pkgconfig, boolstuff, hal, dbus_glib }:
-
-stdenv.mkDerivation {
-  name = "hal-evt-0.1.4";
-
-  src = fetchurl {
-    url = http://savannah.nongnu.org/download/halevt/halevt-0.1.4.tar.gz;
-    sha256 = "173dphyzpicjz5pnw0d6wmibvib5h99nh1gmyvcqpgvf8la5vrps";
-  };
-
-  buildInputs = [ libxml2 pkgconfig boolstuff hal dbus_glib ];
-
-  meta = { 
-    description = "Execute commands on hal events";
-    homepage = http://www.nongnu.org/halevt/;
-    license = "GPLv2";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/hal/info.nix b/pkgs/os-specific/linux/hal/info.nix
deleted file mode 100644
index 1a4e41c776f..00000000000
--- a/pkgs/os-specific/linux/hal/info.nix
+++ /dev/null
@@ -1,15 +0,0 @@
-{stdenv, fetchurl, pkgconfig}:
-
-stdenv.mkDerivation rec {
-  name = "hal-info-20091130";
-  
-  src = fetchurl {
-    url = "http://hal.freedesktop.org/releases/${name}.tar.gz";
-    sha256 = "092jhzpxa2h8djf8pijql92m70q87yds22686ryrfna3xbm90niv";
-  };
-
-  meta = {
-    homepage = http://www.freedesktop.org/wiki/Software/hal;
-    description = "Hardware data and quirks for HAL";
-  };
-}
diff --git a/pkgs/os-specific/linux/hal/synaptics.nix b/pkgs/os-specific/linux/hal/synaptics.nix
deleted file mode 100644
index 20c4d1ec24f..00000000000
--- a/pkgs/os-specific/linux/hal/synaptics.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv}:
-stdenv.mkDerivation {
-  name = "hal-info-synaptics";
-  buildCommand = ''
-    mkdir -p $out/share/hal/fdi/information/15-osvendor/
-    cat << EOF > $out/share/hal/fdi/information/15-osvendor/10-x11-synaptics.fdi
-<?xml version="1.0" encoding="UTF-8"?>
-       <deviceinfo version="0.2">
-           <device>
-               <match key="info.capabilities" contains="input.touchpad">
-                   <merge key="input.x11_driver" type="string">synaptics</merge>
-                   <merge key="input.x11_options.AlwaysCore" type="string">true</merge>
-                   <merge key="input.x11_options.Protocol" type="string">event</merge>
-               </match>
-           </device>
-       </deviceinfo>
-EOF
-  '';
-}
diff --git a/pkgs/os-specific/linux/hostapd/default.nix b/pkgs/os-specific/linux/hostapd/default.nix
index 39f92d99b7f..b8e5055f056 100644
--- a/pkgs/os-specific/linux/hostapd/default.nix
+++ b/pkgs/os-specific/linux/hostapd/default.nix
@@ -1,21 +1,23 @@
-{ stdenv, fetchurl, libnl1, openssl }:
+{ stdenv, fetchurl, libnl, openssl, pkgconfig }:
 stdenv.mkDerivation rec {
 
   name = "hostapd-${version}";
-  version = "0.7.3";
+  version = "1.0";
 
   src = fetchurl {
-    url = http://w1.fi/releases/hostapd-0.7.3.tar.gz;
-    sha256 = "0rqmjs4k50qjp2d0k71lg5vsh34w07w985cxjqklq6kyyf0jgsri";
+    url = "http://w1.fi/releases/${name}.tar.gz";
+    sha256 = "1k6z2g0g324593a7ybd76bywvj0gnf9cybqaj2sq5ks6gv5rsbh0";
   };
 
-  buildInputs = [ libnl1 openssl ];
+  buildInputs = [ libnl openssl pkgconfig ];
 
   configurePhase = ''
     cd hostapd
-    substituteInPlace defconfig --replace "#CONFIG_DRIVER_NL80211" "CONFIG_DRIVER_NL80211"
-    substituteInPlace Makefile --replace "/usr/local/bin/" "$out/bin/"
+    substituteInPlace Makefile --replace "/usr/local/bin" "$out/bin"
     mv defconfig .config
+    echo CONFIG_LIBNL32=y | tee -a .config
+    echo CONFIG_IEEE80211N=y | tee -a .config
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags libnl-3.0)"
   '';
   preInstall = "mkdir -p $out/bin";
 
@@ -26,4 +28,4 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.linux;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/os-specific/linux/htop/default.nix b/pkgs/os-specific/linux/htop/default.nix
index 52db202a15f..613adb5f5d2 100644
--- a/pkgs/os-specific/linux/htop/default.nix
+++ b/pkgs/os-specific/linux/htop/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, ncurses }:
 
 stdenv.mkDerivation rec {
-  name = "htop-1.0.1";
+  name = "htop-1.0.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/htop/${name}.tar.gz";
-    sha256 = "1wh62mb102nxd5h3pnzakdf0lcyapv1yq44ndcc9wpw30az2rnq7";
+    sha256 = "18fqrhvnm7h4c3939av8lpiwrwxbyw6hcly0jvq0vkjf0ixnaq7f";
   };
 
   buildInputs = [ ncurses ];
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
     description = "An interactive process viewer for Linux";
     homepage = "http://htop.sourceforge.net";
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.rob ];
+    maintainers = [ stdenv.lib.maintainers.rob stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index cc5339ba900..4ea4152e30d 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -1,34 +1,39 @@
-{fetchurl, stdenv, flex, bison, db4, iptables}:
+{ fetchurl, stdenv, flex, bison, db4, iptables, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "iproute2-2.6.35";
+  name = "iproute2-3.8.0";
 
   src = fetchurl {
-    url = "http://pkgs.fedoraproject.org/repo/pkgs/iproute/iproute2-2.6.35.tar.bz2/b0f281b3124bf04669e18f5fe16d4934/iproute2-2.6.35.tar.bz2";
-    sha256 = "18why1wy0v859axgrlfxn80zmskss0410hh9rf5gn9cr29zg9cla";
+    url = "mirror://kernel/linux/utils/net/iproute2/${name}.tar.xz";
+    sha256 = "0kqy30wz2krbg4y7750hjq5218hgy2vj9pm5qzkn1bqskxs4b4ap";
   };
 
-  patches = [ ./vpnc.patch ];
+  patches = [ ./vpnc.patch ./no-werror.patch ];
 
   preConfigure =
     ''
       patchShebangs ./configure
       sed -e '/ARPDDIR/d' -i Makefile
     '';
+
   postConfigure = "cat Config";
 
   makeFlags = "DESTDIR= LIBDIR=$(out)/lib SBINDIR=$(out)/sbin"
-   + " CONFDIR=$(out)/etc DOCDIR=$(out)/share/doc/${name}"
-  + " MANDIR=$(out)/share/man";
+    + " CONFDIR=$(out)/etc DOCDIR=$(out)/share/doc/${name}"
+    + " MANDIR=$(out)/share/man";
+
+  buildInputs = [ db4 iptables ];
+  nativeBuildInputs = [ bison flex pkgconfig ];
+
+  enableParallelBuilding = true;
 
-  buildInputs = [db4 iptables];
-  buildNativeInputs = [bison flex db4];
+  # Get rid of useless TeX/SGML docs.
+  postInstall = "rm -rf $out/share/doc";
 
   meta = {
-    homepage =
-      http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2;
-    description = "A collection of utilities for controlling TCP / IP"
-      + " networking and traffic control in Linux";
+    homepage = http://www.linuxfoundation.org/collaborate/workgroups/networking/iproute2;
+    description = "A collection of utilities for controlling TCP/IP networking and traffic control in Linux";
     platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/os-specific/linux/iproute/no-werror.patch b/pkgs/os-specific/linux/iproute/no-werror.patch
new file mode 100644
index 00000000000..593b56b8de0
--- /dev/null
+++ b/pkgs/os-specific/linux/iproute/no-werror.patch
@@ -0,0 +1,12 @@
+diff -ubr iproute2-3.8.0-orig/Makefile iproute2-3.8.0/Makefile
+--- iproute2-3.8.0-orig/Makefile	2013-04-06 00:03:21.072827860 +0200
++++ iproute2-3.8.0/Makefile	2013-04-06 00:03:25.353837862 +0200
+@@ -30,7 +30,7 @@
+ HOSTCC = gcc
+ DEFINES += -D_GNU_SOURCE
+ CCOPTS = -O2
+-WFLAGS := -Wall -Wstrict-prototypes -Werror -Wmissing-prototypes
++WFLAGS := -Wall -Wstrict-prototypes -Wmissing-prototypes
+ WFLAGS += -Wmissing-declarations -Wold-style-definition
+ 
+ CFLAGS = $(WFLAGS) $(CCOPTS) -I../include $(DEFINES)
diff --git a/pkgs/os-specific/linux/ipsec-tools/default.nix b/pkgs/os-specific/linux/ipsec-tools/default.nix
new file mode 100644
index 00000000000..00676319b03
--- /dev/null
+++ b/pkgs/os-specific/linux/ipsec-tools/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, linuxHeaders, readline, openssl, flex, krb5, pam }:
+
+# TODO: These tools are supposed to work under NetBSD and FreeBSD as
+# well, so I guess it's not appropriate to place this expression in
+# "os-specific/linux/ipsec-tools". Since I cannot verify that the
+# expression actually builds on those platforms, I'll leave it here for
+# the time being.
+
+stdenv.mkDerivation rec {
+  name = "ipsec-tools-0.8.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ipsec-tools/${name}.tar.bz2";
+    sha256 = "2359a24aa8eda9ca7043fc47950c8e6b7f58a07c5d5ad316aa7de2bc5e3a8717";
+  };
+
+  buildInputs = [ readline openssl flex krb5 pam ];
+
+  patches = [ ./dont-create-localstatedir-during-install.patch ];
+
+  configureFlags = ''
+    --sysconfdir=/etc --localstatedir=/var
+    --with-kernel-headers=${linuxHeaders}/include
+    --disable-security-context
+    --enable-adminport
+    --enable-dpd
+    --enable-frag
+    --enable-gssapi
+    --enable-hybrid
+    --enable-natt
+    --enable-shared
+    --enable-stats
+  '';
+
+  meta = {
+    homepage = "http://ipsec-tools.sourceforge.net/";
+    description = "Port of KAME's IPsec utilities to the Linux-2.6 IPsec implementation";
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [stdenv.lib.maintainers.simons];
+  };
+}
diff --git a/pkgs/os-specific/linux/ipsec-tools/dont-create-localstatedir-during-install.patch b/pkgs/os-specific/linux/ipsec-tools/dont-create-localstatedir-during-install.patch
new file mode 100644
index 00000000000..16b80c36d6a
--- /dev/null
+++ b/pkgs/os-specific/linux/ipsec-tools/dont-create-localstatedir-during-install.patch
@@ -0,0 +1,13 @@
+diff -ubr ipsec-tools-0.8.0-orig/src/racoon/Makefile.in ipsec-tools-0.8.0/src/racoon/Makefile.in
+--- ipsec-tools-0.8.0-orig/src/racoon/Makefile.in	2012-10-20 13:01:07.700903316 +0200
++++ ipsec-tools-0.8.0/src/racoon/Makefile.in	2012-10-20 13:01:13.177832616 +0200
+@@ -1085,9 +1085,6 @@
+ 	uninstall-sbinPROGRAMS
+ 
+ 
+-install-exec-local:
+-	${mkinstalldirs} $(DESTDIR)${adminsockdir}
+-
+ # special object rules
+ crypto_openssl_test.o: crypto_openssl.c
+ 	$(COMPILE) -DEAYDEBUG -o crypto_openssl_test.o -c $(srcdir)/crypto_openssl.c
diff --git a/pkgs/os-specific/linux/iptables/default.nix b/pkgs/os-specific/linux/iptables/default.nix
index a1dace598fe..78d8ee52fb1 100644
--- a/pkgs/os-specific/linux/iptables/default.nix
+++ b/pkgs/os-specific/linux/iptables/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "iptables-1.4.10";
+  name = "iptables-1.4.16.2";
 
   src = fetchurl {
     url = "http://www.netfilter.org/projects/iptables/files/${name}.tar.bz2";
-    md5 = "f382fe693f0b59d87bd47bea65eca198";
+    md5 = "57220bb26866a713073e5614f88071fc";
   };
 
   # Install header files required by miniupnpd.
diff --git a/pkgs/os-specific/linux/iputils/default.nix b/pkgs/os-specific/linux/iputils/default.nix
index a50aefaec97..5ca3a6a0a5c 100644
--- a/pkgs/os-specific/linux/iputils/default.nix
+++ b/pkgs/os-specific/linux/iputils/default.nix
@@ -1,26 +1,45 @@
-{ stdenv, fetchurl, libsysfs, openssl }:
+{ stdenv, fetchurl, libsysfs, gnutls, openssl, libcap, sp, docbook_sgml_dtd_31
+, SGMLSpm }:
 
 assert stdenv ? glibc;
 
-stdenv.mkDerivation {
-  name = "iputils-20101006";
-  
+let
+  time = "20121221";
+in
+stdenv.mkDerivation rec {
+  name = "iputils-${time}";
+
   src = fetchurl {
-    url = http://www.skbuff.net/iputils/iputils-s20101006.tar.bz2;
-    sha256 = "1rvfvdnmzlmgy9a6xv5v4n785zmn10v2l7yaq83rdfgbh1ng8fpx";
+    url = "http://www.skbuff.net/iputils/iputils-s${time}.tar.bz2";
+    sha256 = "17riqp8dh8dvx32zv3hyrghpxz6xnxa6vai9b4yc485nqngm83s5";
   };
 
-  buildInputs = [ libsysfs openssl ];
+  prePatch = ''
+    sed -i s/sgmlspl/sgmlspl.pl/ doc/Makefile
+  '';
+
+  makeFlags = "USE_GNUTLS=no";
+
+  buildInputs = [ libsysfs openssl libcap sp docbook_sgml_dtd_31 SGMLSpm ];
 
-  # Urgh, it uses Make's `-l' dependency "feature". 
-  makeFlags = "VPATH=${libsysfs}/lib:${stdenv.glibc}/lib:${openssl}/lib";
+  buildFlags = "man all ninfod";
+
+  # Stdenv doesn't handle symlinks well for that
+  dontGzipMan = true;
 
   installPhase =
     ''
-      mkdir -p $out/sbin
-      cp -p arping ping ping6 rdisc tracepath tracepath6 traceroute6 $out/sbin/
+      mkdir -p $out/sbin $out/bin
+      cp -p ping ping6 tracepath tracepath6 traceroute6 $out/bin/
+      cp -p clockdiff arping rdisc ninfod/ninfod $out/sbin/
+
+      mkdir -p $out/share/man/man8
+      cp -p doc/clockdiff.8 doc/arping.8 doc/ping.8 doc/rdisc.8 \
+        doc/tracepath.8 doc/ninfod.8 $out/share/man/man8
+      ln -s $out/share/man/man8/{ping,ping6}.8
+      ln -s $out/share/man/man8/{tracepath,tracepath6}.8
     '';
-    
+
   meta = {
     homepage = http://www.skbuff.net/iputils/;
     description = "A set of small useful utilities for Linux networking";
diff --git a/pkgs/os-specific/linux/iscsitarget/default.nix b/pkgs/os-specific/linux/iscsitarget/default.nix
index 214fae01cfc..e07409aa08d 100644
--- a/pkgs/os-specific/linux/iscsitarget/default.nix
+++ b/pkgs/os-specific/linux/iscsitarget/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, kernel, module_init_tools}:
+{ stdenv, fetchurl, kernelDev, module_init_tools}:
 
 stdenv.mkDerivation rec {
-  name = "iscsitarget-1.4.20.2-${kernel.version}";
+  name = "iscsitarget-1.4.20.2-${kernelDev.version}";
   
   src = fetchurl {
     url = "mirror://sourceforge/iscsitarget/iscsitarget/1.4.20.2/${name}.tar.gz";
     sha256 = "126kp0yc7vmvdbaw2xfav89340b0h91dvvyib5qbvyrq40n8wg0g";
   };
   
-  KSRC = "${kernel}/lib/modules/*/build";
+  KSRC = "${kernelDev}/lib/modules/*/build";
   
   DESTDIR = "$(out)";
   
diff --git a/pkgs/os-specific/linux/iw/default.nix b/pkgs/os-specific/linux/iw/default.nix
index 7110754357c..ac8d4824c62 100644
--- a/pkgs/os-specific/linux/iw/default.nix
+++ b/pkgs/os-specific/linux/iw/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, libnl, pkgconfig}:
 
-stdenv.mkDerivation {
-  name = "iw-3.6";
+stdenv.mkDerivation rec {
+  name = "iw-3.10";
 
   src = fetchurl {
-    url = http://wireless.kernel.org/download/iw/iw-3.6.tar.bz2;
-    sha256 = "0my8nv6liya0b15nqn8wq2kxwjy7x6k65a9x1121zwqxq5m064fz";
+    url = "https://www.kernel.org/pub/software/network/iw/${name}.tar.xz";
+    sha256 = "1sagsrl2s0d3ar3q2yc5qxk2d47zgn551akwcs9f4a5prw9f4vj5";
   };
 
   buildInputs = [ libnl pkgconfig ];
diff --git a/pkgs/os-specific/linux/iwlwifi/default.nix b/pkgs/os-specific/linux/iwlwifi/default.nix
index c993886c21d..1a28720f004 100644
--- a/pkgs/os-specific/linux/iwlwifi/default.nix
+++ b/pkgs/os-specific/linux/iwlwifi/default.nix
@@ -1,9 +1,9 @@
-{stdenv, fetchurl, kernel}:
+{stdenv, fetchurl, kernelDev}:
 
 let version = "1.2.25"; in
 
 stdenv.mkDerivation rec {
-  name = "iwlwifi-${version}-${kernel.version}";
+  name = "iwlwifi-${version}-${kernelDev.version}";
 
   src = fetchurl {
     url = "http://www.intellinuxwireless.org/iwlwifi/downloads/iwlwifi-${version}.tgz";
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
     # Urgh, we need the complete kernel sources for some header
     # files.  So unpack the original kernel source tarball and copy
     # the configured include directory etc. on top of it.
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
-    kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/source)
-    tar xvfj ${kernel.src}
+    kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
+    kernelBuild=$(echo ${kernelDev}/lib/modules/$kernelVersion/source)
+    tar xvfj ${kernelDev.src}
     kernelSource=$(echo $(pwd)/linux-*)
     cp -prd $kernelBuild/* $kernelSource
 
diff --git a/pkgs/os-specific/linux/jujuutils/default.nix b/pkgs/os-specific/linux/jujuutils/default.nix
index c52aae291eb..7c688943ea8 100644
--- a/pkgs/os-specific/linux/jujuutils/default.nix
+++ b/pkgs/os-specific/linux/jujuutils/default.nix
@@ -1,18 +1,18 @@
-{stdenv, fetchurl, linuxHeaders}:
+{ stdenv, fetchurl, linuxHeaders }:
 
 stdenv.mkDerivation {
   name = "jujuutils-0.2";
 
   src = fetchurl {
-    url = http://jujuutils.googlecode.com/files/jujuutils-0.2.tar.gz;
+    url = "http://jujuutils.googlecode.com/files/jujuutils-0.2.tar.gz";
     sha256 = "1r74m7s7rs9d6y7cffi7mdap3jf96qwm1v6jcw53x5cikgmfxn4x";
   };
 
   buildInputs = [ linuxHeaders ];
 
   meta = {
+    homepage = "http://code.google.com/p/jujuutils/";
     description = "Utilities around FireWire devices connected to a Linux computer";
     license = "GPLv2";
-    homepage = http://code.google.com/p/jujuutils/;
   };
 }
diff --git a/pkgs/os-specific/linux/kernel-headers/2.4.nix b/pkgs/os-specific/linux/kernel-headers/2.4.nix
index c5926ff2e47..9457769f5ef 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.4.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.4.nix
@@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
 
 let
   version = "2.4.37.9";
-  kernelHeadersBaseConfig = if (cross == null) then
+  kernelHeadersBaseConfig = if cross == null then
       stdenv.platform.kernelHeadersBaseConfig
     else
       cross.platform.kernelHeadersBaseConfig;
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     sha256 = "08rca9lcb5l5w483hgaqk8pi2njd7cmwpkifjqxwlb3g8liz4r5g";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
index b576b68773c..1ba03010f8a 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.6.28.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     sha256 = "0hifjh75sinifr5138v22zwbpqln6lhn65k8b57a1dyzlqca7cl9";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.arch else
diff --git a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
index a2fc597eaac..100dd0c611b 100644
--- a/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
+++ b/pkgs/os-specific/linux/kernel-headers/2.6.32.nix
@@ -4,7 +4,7 @@ assert cross == null -> stdenv.isLinux;
 
 let
   version = "2.6.32.16";
-  kernelHeadersBaseConfig = if (cross == null) then
+  kernelHeadersBaseConfig = if cross == null then
       stdenv.platform.kernelHeadersBaseConfig
     else
       cross.platform.kernelHeadersBaseConfig;
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     sha256 = "1ndvqvfaxachsklzzr5db1bzvfhnzz8diddrm1zlv7171fzmn13j";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
diff --git a/pkgs/os-specific/linux/kernel-headers/3.3.5.nix b/pkgs/os-specific/linux/kernel-headers/3.7.nix
index f4dd28dab03..4371bf7df9c 100644
--- a/pkgs/os-specific/linux/kernel-headers/3.3.5.nix
+++ b/pkgs/os-specific/linux/kernel-headers/3.7.nix
@@ -3,22 +3,25 @@
 assert cross == null -> stdenv.isLinux;
 
 let
-  version = "3.3.5";
-  kernelHeadersBaseConfig = if cross == null then
-      stdenv.platform.kernelHeadersBaseConfig
-    else
-      cross.platform.kernelHeadersBaseConfig;
+
+  version = "3.7.1";
+
+  kernelHeadersBaseConfig =
+    if cross == null
+    then stdenv.platform.kernelHeadersBaseConfig
+    else cross.platform.kernelHeadersBaseConfig;
+
 in
 
 stdenv.mkDerivation {
   name = "linux-headers-${version}";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0i74jn47f6vs5kcvk8abvz3k08z32c9bbqw0sdjkdxwvr4jbczpv";
+    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2";
+    sha256 = "1bb1dxj1i6j7pj926kfy6pz58kw03swyyikl9f3fq3jnswispaj2";
   };
 
-  targetConfig = if (cross != null) then cross.config else null;
+  targetConfig = if cross != null then cross.config else null;
 
   platform =
     if cross != null then cross.platform.kernelArch else
@@ -33,15 +36,15 @@ stdenv.mkDerivation {
 
   extraIncludeDirs =
     if cross != null then
-	(if cross.arch == "powerpc" then ["ppc"] else [])
+        (if cross.arch == "powerpc" then ["ppc"] else [])
     else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
 
   buildPhase = ''
     if test -n "$targetConfig"; then
        export ARCH=$platform
     fi
-    make ${kernelHeadersBaseConfig}
-    make mrproper headers_check
+    make ${kernelHeadersBaseConfig} SHELL=bash
+    make mrproper headers_check SHELL=bash
   '';
 
   installPhase = ''
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
deleted file mode 100644
index 3fb5ef8ef2d..00000000000
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{ stdenv, fetchurl, perl, cross ? null }:
-
-assert cross == null -> stdenv.isLinux;
-
-let
-  version = "2.6.35.14";
-  kernelHeadersBaseConfig = if cross == null then
-      stdenv.platform.kernelHeadersBaseConfig
-    else
-      cross.platform.kernelHeadersBaseConfig;
-in
-
-stdenv.mkDerivation {
-  name = "linux-headers-${version}";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v2.6/longterm/v2.6.35/linux-${version}.tar.bz2";
-    sha256 = "1wzml7s9karfbk2yi36g1r8fyaq4d4f16yizc68zgchv0xzj39zl";
-  };
-
-  targetConfig = if (cross != null) then cross.config else null;
-
-  platform =
-    if cross != null then cross.platform.kernelArch else
-    if stdenv.system == "i686-linux" then "i386" else
-    if stdenv.system == "x86_64-linux" then "x86_64" else
-    if stdenv.system == "powerpc-linux" then "powerpc" else
-    if stdenv.isArm then "arm" else
-    if stdenv.platform ? kernelArch then stdenv.platform.kernelArch else
-    abort "don't know what the kernel include directory is called for this platform";
-
-  buildInputs = [perl];
-
-  extraIncludeDirs =
-    if cross != null then
-	(if cross.arch == "powerpc" then ["ppc"] else [])
-    else if stdenv.system == "powerpc-linux" then ["ppc"] else [];
-
-  buildPhase = ''
-    if test -n "$targetConfig"; then
-       export ARCH=$platform
-    fi
-    make ${kernelHeadersBaseConfig}
-    make mrproper headers_check
-  '';
-
-  installPhase = ''
-    make INSTALL_HDR_PATH=$out headers_install
-
-    # Some builds (e.g. KVM) want a kernel.release.
-    mkdir -p $out/include/config
-    echo "${version}-default" > $out/include/config/kernel.release
-  '';
-
-  # !!! hacky
-  fixupPhase = ''
-    ln -s asm $out/include/asm-$platform
-    if test "$platform" = "i386" -o "$platform" = "x86_64"; then
-      ln -s asm $out/include/asm-x86
-    fi
-  '';
-}
diff --git a/pkgs/os-specific/linux/kernel/aufs2-35.patch b/pkgs/os-specific/linux/kernel/aufs2-35.patch
deleted file mode 100644
index 30776e64106..00000000000
--- a/pkgs/os-specific/linux/kernel/aufs2-35.patch
+++ /dev/null
@@ -1,351 +0,0 @@
-aufs2 base patch for linux-2.6.35
-
-diff --git a/fs/namei.c b/fs/namei.c
-index 868d0cb..6e92c81 100644
---- a/fs/namei.c
-+++ b/fs/namei.c
-@@ -1178,7 +1178,7 @@ out:
-  * needs parent already locked. Doesn't follow mounts.
-  * SMP-safe.
-  */
--static struct dentry *lookup_hash(struct nameidata *nd)
-+struct dentry *lookup_hash(struct nameidata *nd)
- {
- 	int err;
- 
-@@ -1190,5 +1190,5 @@
- 
--static int __lookup_one_len(const char *name, struct qstr *this,
-+int __lookup_one_len(const char *name, struct qstr *this,
- 		struct dentry *base, int len)
- {
- 	unsigned long hash;
-diff --git a/fs/splice.c b/fs/splice.c
-index efdbfec..e01a51e 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -1104,8 +1104,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
- /*
-  * Attempt to initiate a splice from pipe to file.
-  */
--static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
--			   loff_t *ppos, size_t len, unsigned int flags)
-+long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-+		    loff_t *ppos, size_t len, unsigned int flags)
- {
- 	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
- 				loff_t *, size_t, unsigned int);
-@@ -1132,9 +1132,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- /*
-  * Attempt to initiate a splice from a file to a pipe.
-  */
--static long do_splice_to(struct file *in, loff_t *ppos,
--			 struct pipe_inode_info *pipe, size_t len,
--			 unsigned int flags)
-+long do_splice_to(struct file *in, loff_t *ppos,
-+		  struct pipe_inode_info *pipe, size_t len,
-+		  unsigned int flags)
- {
- 	ssize_t (*splice_read)(struct file *, loff_t *,
- 			       struct pipe_inode_info *, size_t, unsigned int);
-diff --git a/include/linux/namei.h b/include/linux/namei.h
-index 05b441d..91bc74e 100644
---- a/include/linux/namei.h
-+++ b/include/linux/namei.h
-@@ -73,6 +73,9 @@ extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
- extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
- 		int (*open)(struct inode *, struct file *));
- 
-+extern struct dentry *lookup_hash(struct nameidata *nd);
-+extern int __lookup_one_len(const char *name, struct qstr *this,
-+			    struct dentry *base, int len);
- extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
- 
- extern int follow_down(struct path *);
-diff --git a/include/linux/splice.h b/include/linux/splice.h
-index 997c3b4..be9a153 100644
---- a/include/linux/splice.h
-+++ b/include/linux/splice.h
-@@ -89,4 +89,10 @@ extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
- extern void splice_shrink_spd(struct pipe_inode_info *,
- 				struct splice_pipe_desc *);
- 
-+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-+			   loff_t *ppos, size_t len, unsigned int flags);
-+extern long do_splice_to(struct file *in, loff_t *ppos,
-+			 struct pipe_inode_info *pipe, size_t len,
-+			 unsigned int flags);
-+
- #endif
-aufs2 standalone patch for linux-2.6.35
-
-diff --git a/fs/namei.c b/fs/namei.c
-index 6e92c81..334130e 100644
---- a/fs/namei.c
-+++ b/fs/namei.c
-@@ -348,6 +348,7 @@ int deny_write_access(struct file * file)
- 
- 	return 0;
- }
-+EXPORT_SYMBOL(deny_write_access);
- 
- /**
-  * path_get - get a reference to a path
-@@ -1187,6 +1188,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
- 		return ERR_PTR(err);
- 	return __lookup_hash(&nd->last, nd->path.dentry, nd);
- }
-+EXPORT_SYMBOL(lookup_hash);
- 
- int __lookup_one_len(const char *name, struct qstr *this,
- 		struct dentry *base, int len)
-@@ -1209,6 +1211,7 @@ int __lookup_one_len(const char *name, struct qstr *this,
- 	this->hash = end_name_hash(hash);
- 	return 0;
- }
-+EXPORT_SYMBOL(__lookup_one_len);
- 
- /**
-  * lookup_one_len - filesystem helper to lookup single pathname component
-diff --git a/fs/namespace.c b/fs/namespace.c
-index 88058de..397afcc 100644
---- a/fs/namespace.c
-+++ b/fs/namespace.c
-@@ -1279,6 +1279,7 @@ int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
- 	}
- 	return 0;
- }
-+EXPORT_SYMBOL(iterate_mounts);
- 
- static void cleanup_group_ids(struct vfsmount *mnt, struct vfsmount *end)
- {
-diff --git a/fs/notify/group.c b/fs/notify/group.c
-index 0e16771..3fab10a 100644
---- a/fs/notify/group.c
-+++ b/fs/notify/group.c
-@@ -22,6 +22,7 @@
- #include <linux/srcu.h>
- #include <linux/rculist.h>
- #include <linux/wait.h>
-+#include <linux/module.h>
- 
- #include <linux/fsnotify_backend.h>
- #include "fsnotify.h"
-@@ -169,6 +170,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
- 	fsnotify_recalc_global_mask();
- 	fsnotify_destroy_group(group);
- }
-+EXPORT_SYMBOL(fsnotify_put_group);
- 
- /*
-  * Simply run the fsnotify_groups list and find a group which matches
-@@ -252,3 +254,4 @@ struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, __u32 mask,
- 
- 	return group;
- }
-+EXPORT_SYMBOL(fsnotify_obtain_group);
-diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
-index 0399bcb..74cdc13 100644
---- a/fs/notify/inode_mark.c
-+++ b/fs/notify/inode_mark.c
-@@ -105,6 +105,7 @@ void fsnotify_put_mark(struct fsnotify_mark_entry *entry)
- 	if (atomic_dec_and_test(&entry->refcnt))
- 		entry->free_mark(entry);
- }
-+EXPORT_SYMBOL(fsnotify_put_mark);
- 
- /*
-  * Recalculate the mask of events relevant to a given inode locked.
-@@ -215,6 +216,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
- 	if (unlikely(atomic_dec_and_test(&group->num_marks)))
- 		fsnotify_final_destroy_group(group);
- }
-+EXPORT_SYMBOL(fsnotify_destroy_mark_by_entry);
- 
- /*
-  * Given a group, destroy all of the marks associated with that group.
-@@ -281,6 +283,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou
- 	}
- 	return NULL;
- }
-+EXPORT_SYMBOL(fsnotify_find_mark_entry);
- 
- /*
-  * Nothing fancy, just initialize lists and locks and counters.
-@@ -297,6 +300,7 @@ void fsnotify_init_mark(struct fsnotify_mark_entry *entry,
- 	entry->inode = NULL;
- 	entry->free_mark = free_mark;
- }
-+EXPORT_SYMBOL(fsnotify_init_mark);
- 
- /*
-  * Attach an initialized mark entry to a given group and inode.
-@@ -352,6 +356,7 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
- 
- 	return ret;
- }
-+EXPORT_SYMBOL(fsnotify_add_mark);
- 
- /**
-  * fsnotify_unmount_inodes - an sb is unmounting.  handle any watched inodes.
-diff --git a/fs/open.c b/fs/open.c
-index 5463266..d248ead 100644
---- a/fs/open.c
-+++ b/fs/open.c
-@@ -59,6 +59,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
- 	mutex_unlock(&dentry->d_inode->i_mutex);
- 	return ret;
- }
-+EXPORT_SYMBOL(do_truncate);
- 
- static long do_sys_truncate(const char __user *pathname, loff_t length)
- {
-diff --git a/fs/splice.c b/fs/splice.c
-index e01a51e..4806358 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -1128,6 +1128,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- 
- 	return splice_write(pipe, out, ppos, len, flags);
- }
-+EXPORT_SYMBOL(do_splice_from);
- 
- /*
-  * Attempt to initiate a splice from a file to a pipe.
-@@ -1154,6 +1155,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
- 
- 	return splice_read(in, ppos, pipe, len, flags);
- }
-+EXPORT_SYMBOL(do_splice_to);
- 
- /**
-  * splice_direct_to_actor - splices data directly between two non-pipes
-diff --git a/security/commoncap.c b/security/commoncap.c
-index 4e01599..3611e1b 100644
---- a/security/commoncap.c
-+++ b/security/commoncap.c
-@@ -951,3 +951,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
- 	}
- 	return ret;
- }
-+EXPORT_SYMBOL(cap_file_mmap);
-diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 8d9c48f..29108aa 100644
---- a/security/device_cgroup.c
-+++ b/security/device_cgroup.c
-@@ -515,6 +515,7 @@ found:
- 
- 	return -EPERM;
- }
-+EXPORT_SYMBOL(devcgroup_inode_permission);
- 
- int devcgroup_inode_mknod(int mode, dev_t dev)
- {
-diff --git a/security/security.c b/security/security.c
-index 351942a..6ba84a8 100644
---- a/security/security.c
-+++ b/security/security.c
-@@ -376,6 +376,7 @@ int security_path_mkdir(struct path *dir, struct dentry *dentry, int mode)
- 		return 0;
- 	return security_ops->path_mkdir(dir, dentry, mode);
- }
-+EXPORT_SYMBOL(security_path_mkdir);
- 
- int security_path_rmdir(struct path *dir, struct dentry *dentry)
- {
-@@ -383,6 +384,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
- 		return 0;
- 	return security_ops->path_rmdir(dir, dentry);
- }
-+EXPORT_SYMBOL(security_path_rmdir);
- 
- int security_path_unlink(struct path *dir, struct dentry *dentry)
- {
-@@ -390,6 +392,7 @@ int security_path_unlink(struct path *dir, struct dentry *dentry)
- 		return 0;
- 	return security_ops->path_unlink(dir, dentry);
- }
-+EXPORT_SYMBOL(security_path_unlink);
- 
- int security_path_symlink(struct path *dir, struct dentry *dentry,
- 			  const char *old_name)
-@@ -398,6 +401,7 @@ int security_path_symlink(struct path *dir, struct dentry *dentry,
- 		return 0;
- 	return security_ops->path_symlink(dir, dentry, old_name);
- }
-+EXPORT_SYMBOL(security_path_symlink);
- 
- int security_path_link(struct dentry *old_dentry, struct path *new_dir,
- 		       struct dentry *new_dentry)
-@@ -406,6 +410,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
- 		return 0;
- 	return security_ops->path_link(old_dentry, new_dir, new_dentry);
- }
-+EXPORT_SYMBOL(security_path_link);
- 
- int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
- 			 struct path *new_dir, struct dentry *new_dentry)
-@@ -416,6 +421,7 @@ int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
- 	return security_ops->path_rename(old_dir, old_dentry, new_dir,
- 					 new_dentry);
- }
-+EXPORT_SYMBOL(security_path_rename);
- 
- int security_path_truncate(struct path *path, loff_t length,
- 			   unsigned int time_attrs)
-@@ -424,6 +430,7 @@ int security_path_truncate(struct path *path, loff_t length,
- 		return 0;
- 	return security_ops->path_truncate(path, length, time_attrs);
- }
-+EXPORT_SYMBOL(security_path_truncate);
- 
- int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
- 			mode_t mode)
-@@ -432,6 +439,7 @@ int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt,
- 		return 0;
- 	return security_ops->path_chmod(dentry, mnt, mode);
- }
-+EXPORT_SYMBOL(security_path_chmod);
- 
- int security_path_chown(struct path *path, uid_t uid, gid_t gid)
- {
-@@ -439,6 +447,7 @@ int security_path_chown(struct path *path, uid_t uid, gid_t gid)
- 		return 0;
- 	return security_ops->path_chown(path, uid, gid);
- }
-+EXPORT_SYMBOL(security_path_chown);
- 
- int security_path_chroot(struct path *path)
- {
-@@ -515,6 +524,7 @@ int security_inode_readlink(struct dentry *dentry)
- 		return 0;
- 	return security_ops->inode_readlink(dentry);
- }
-+EXPORT_SYMBOL(security_inode_readlink);
- 
- int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd)
- {
-@@ -529,6 +539,7 @@ int security_inode_permission(struct inode *inode, int mask)
- 		return 0;
- 	return security_ops->inode_permission(inode, mask);
- }
-+EXPORT_SYMBOL(security_inode_permission);
- 
- int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
- {
-@@ -622,6 +633,7 @@ int security_file_permission(struct file *file, int mask)
- {
- 	return security_ops->file_permission(file, mask);
- }
-+EXPORT_SYMBOL(security_file_permission);
- 
- int security_file_alloc(struct file *file)
- {
-@@ -649,6 +661,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
- 		return ret;
- 	return ima_file_mmap(file, prot);
- }
-+EXPORT_SYMBOL(security_file_mmap);
- 
- int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
- 			    unsigned long prot)
diff --git a/pkgs/os-specific/linux/kernel/aufs2.patch b/pkgs/os-specific/linux/kernel/aufs2.patch
deleted file mode 100644
index 191972c760c..00000000000
--- a/pkgs/os-specific/linux/kernel/aufs2.patch
+++ /dev/null
@@ -1,354 +0,0 @@
-From:
-http://git.c3sl.ufpr.br/gitweb?p=aufs/aufs2-standalone.git;a=blob;f=aufs2-base.patch;hb=eb0355d5b8ff5b04ad217a86d8c677f265675436
-http://git.c3sl.ufpr.br/gitweb?p=aufs/aufs2-standalone.git;a=blob;f=aufs2-standalone.patch;hb=a9c3ab997b526d76bdd23391b3ddc1fdf28edd46
-
-aufs2 base patch for linux-2.6.32
-
-diff --git a/fs/namei.c b/fs/namei.c
-index d11f404..7d28f56 100644
---- a/fs/namei.c
-+++ b/fs/namei.c
-@@ -1219,7 +1219,7 @@ out:
-  * needs parent already locked. Doesn't follow mounts.
-  * SMP-safe.
-  */
--static struct dentry *lookup_hash(struct nameidata *nd)
-+struct dentry *lookup_hash(struct nameidata *nd)
- {
- 	int err;
- 
-@@ -1229,7 +1229,7 @@ static struct dentry *lookup_hash(struct nameidata *nd)
- 	return __lookup_hash(&nd->last, nd->path.dentry, nd);
- }
- 
--static int __lookup_one_len(const char *name, struct qstr *this,
-+int __lookup_one_len(const char *name, struct qstr *this,
- 		struct dentry *base, int len)
- {
- 	unsigned long hash;
-diff --git a/fs/splice.c b/fs/splice.c
-index 7394e9e..77184f0 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -1051,8 +1051,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
- /*
-  * Attempt to initiate a splice from pipe to file.
-  */
--static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
--			   loff_t *ppos, size_t len, unsigned int flags)
-+long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-+		    loff_t *ppos, size_t len, unsigned int flags)
- {
- 	ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
- 				loff_t *, size_t, unsigned int);
-@@ -1078,9 +1078,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- /*
-  * Attempt to initiate a splice from a file to a pipe.
-  */
--static long do_splice_to(struct file *in, loff_t *ppos,
--			 struct pipe_inode_info *pipe, size_t len,
--			 unsigned int flags)
-+long do_splice_to(struct file *in, loff_t *ppos,
-+		  struct pipe_inode_info *pipe, size_t len,
-+		  unsigned int flags)
- {
- 	ssize_t (*splice_read)(struct file *, loff_t *,
- 			       struct pipe_inode_info *, size_t, unsigned int);
-diff --git a/include/linux/namei.h b/include/linux/namei.h
-index ec0f607..1438153 100644
---- a/include/linux/namei.h
-+++ b/include/linux/namei.h
-@@ -75,6 +75,9 @@ extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry
- extern struct file *nameidata_to_filp(struct nameidata *nd, int flags);
- extern void release_open_intent(struct nameidata *);
- 
-+extern struct dentry *lookup_hash(struct nameidata *nd);
-+extern int __lookup_one_len(const char *name, struct qstr *this,
-+			    struct dentry *base, int len);
- extern struct dentry *lookup_one_len(const char *, struct dentry *, int);
- extern struct dentry *lookup_one_noperm(const char *, struct dentry *);
- 
-diff --git a/include/linux/splice.h b/include/linux/splice.h
-index 18e7c7c..8393b5c 100644
---- a/include/linux/splice.h
-+++ b/include/linux/splice.h
-@@ -82,4 +82,10 @@ extern ssize_t splice_to_pipe(struct pipe_inode_info *,
- extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
- 				      splice_direct_actor *);
- 
-+extern long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
-+			   loff_t *ppos, size_t len, unsigned int flags);
-+extern long do_splice_to(struct file *in, loff_t *ppos,
-+			 struct pipe_inode_info *pipe, size_t len,
-+			 unsigned int flags);
-+
- #endif
-
-aufs2 standalone patch for linux-2.6.32
-
-diff --git a/fs/namei.c b/fs/namei.c
-index 7d28f56..0f6117c 100644
---- a/fs/namei.c
-+++ b/fs/namei.c
-@@ -350,6 +350,7 @@ int deny_write_access(struct file * file)
- 
- 	return 0;
- }
-+EXPORT_SYMBOL(deny_write_access);
- 
- /**
-  * path_get - get a reference to a path
-@@ -1228,6 +1229,7 @@ struct dentry *lookup_hash(struct nameidata *nd)
- 		return ERR_PTR(err);
- 	return __lookup_hash(&nd->last, nd->path.dentry, nd);
- }
-+EXPORT_SYMBOL(lookup_hash);
- 
- int __lookup_one_len(const char *name, struct qstr *this,
- 		struct dentry *base, int len)
-@@ -1250,6 +1252,7 @@ int __lookup_one_len(const char *name, struct qstr *this,
- 	this->hash = end_name_hash(hash);
- 	return 0;
- }
-+EXPORT_SYMBOL(__lookup_one_len);
- 
- /**
-  * lookup_one_len - filesystem helper to lookup single pathname component
-diff --git a/fs/namespace.c b/fs/namespace.c
-index bdc3cb4..a2cadcf 100644
---- a/fs/namespace.c
-+++ b/fs/namespace.c
-@@ -39,6 +39,7 @@
- 
- /* spinlock for vfsmount related operations, inplace of dcache_lock */
- __cacheline_aligned_in_smp DEFINE_SPINLOCK(vfsmount_lock);
-+EXPORT_SYMBOL(vfsmount_lock);
- 
- static int event;
- static DEFINE_IDA(mnt_id_ida);
-diff --git a/fs/notify/group.c b/fs/notify/group.c
-index 0e16771..3fab10a 100644
---- a/fs/notify/group.c
-+++ b/fs/notify/group.c
-@@ -22,6 +22,7 @@
- #include <linux/srcu.h>
- #include <linux/rculist.h>
- #include <linux/wait.h>
-+#include <linux/module.h>
- 
- #include <linux/fsnotify_backend.h>
- #include "fsnotify.h"
-@@ -169,6 +170,7 @@ void fsnotify_put_group(struct fsnotify_group *group)
- 	fsnotify_recalc_global_mask();
- 	fsnotify_destroy_group(group);
- }
-+EXPORT_SYMBOL(fsnotify_put_group);
- 
- /*
-  * Simply run the fsnotify_groups list and find a group which matches
-@@ -252,3 +254,4 @@ struct fsnotify_group *fsnotify_obtain_group(unsigned int group_num, __u32 mask,
- 
- 	return group;
- }
-+EXPORT_SYMBOL(fsnotify_obtain_group);
-diff --git a/fs/notify/inode_mark.c b/fs/notify/inode_mark.c
-index 3165d85..4586162 100644
---- a/fs/notify/inode_mark.c
-+++ b/fs/notify/inode_mark.c
-@@ -106,6 +106,7 @@ void fsnotify_put_mark(struct fsnotify_mark_entry *entry)
- 	if (atomic_dec_and_test(&entry->refcnt))
- 		entry->free_mark(entry);
- }
-+EXPORT_SYMBOL(fsnotify_put_mark);
- 
- /*
-  * Recalculate the mask of events relevant to a given inode locked.
-@@ -216,6 +217,7 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
- 	if (unlikely(atomic_dec_and_test(&group->num_marks)))
- 		fsnotify_final_destroy_group(group);
- }
-+EXPORT_SYMBOL(fsnotify_destroy_mark_by_entry);
- 
- /*
-  * Given a group, destroy all of the marks associated with that group.
-@@ -282,6 +284,7 @@ struct fsnotify_mark_entry *fsnotify_find_mark_entry(struct fsnotify_group *grou
- 	}
- 	return NULL;
- }
-+EXPORT_SYMBOL(fsnotify_find_mark_entry);
- 
- /*
-  * Nothing fancy, just initialize lists and locks and counters.
-@@ -298,6 +301,7 @@ void fsnotify_init_mark(struct fsnotify_mark_entry *entry,
- 	entry->inode = NULL;
- 	entry->free_mark = free_mark;
- }
-+EXPORT_SYMBOL(fsnotify_init_mark);
- 
- /*
-  * Attach an initialized mark entry to a given group and inode.
-@@ -353,6 +357,7 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
- 
- 	return ret;
- }
-+EXPORT_SYMBOL(fsnotify_add_mark);
- 
- /**
-  * fsnotify_unmount_inodes - an sb is unmounting.  handle any watched inodes.
-diff --git a/fs/open.c b/fs/open.c
-index 4f01e06..ef09031 100644
---- a/fs/open.c
-+++ b/fs/open.c
-@@ -223,6 +223,7 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
- 	mutex_unlock(&dentry->d_inode->i_mutex);
- 	return ret;
- }
-+EXPORT_SYMBOL(do_truncate);
- 
- static long do_sys_truncate(const char __user *pathname, loff_t length)
- {
-diff --git a/fs/splice.c b/fs/splice.c
-index 77184f0..8479d95 100644
---- a/fs/splice.c
-+++ b/fs/splice.c
-@@ -1074,6 +1074,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
- 
- 	return splice_write(pipe, out, ppos, len, flags);
- }
-+EXPORT_SYMBOL(do_splice_from);
- 
- /*
-  * Attempt to initiate a splice from a file to a pipe.
-@@ -1099,6 +1100,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
- 
- 	return splice_read(in, ppos, pipe, len, flags);
- }
-+EXPORT_SYMBOL(do_splice_to);
- 
- /**
-  * splice_direct_to_actor - splices data directly between two non-pipes
-diff --git a/security/commoncap.c b/security/commoncap.c
-index fe30751..813108d 100644
---- a/security/commoncap.c
-+++ b/security/commoncap.c
-@@ -1014,3 +1014,4 @@ int cap_file_mmap(struct file *file, unsigned long reqprot,
- 	}
- 	return ret;
- }
-+EXPORT_SYMBOL(cap_file_mmap);
-diff --git a/security/device_cgroup.c b/security/device_cgroup.c
-index 6cf8fd2..008e0d8 100644
---- a/security/device_cgroup.c
-+++ b/security/device_cgroup.c
-@@ -514,6 +514,7 @@ found:
- 
- 	return -EPERM;
- }
-+EXPORT_SYMBOL(devcgroup_inode_permission);
- 
- int devcgroup_inode_mknod(int mode, dev_t dev)
- {
-diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c
-index b85e61b..a23fad4 100644
---- a/security/integrity/ima/ima_main.c
-+++ b/security/integrity/ima/ima_main.c
-@@ -324,6 +324,7 @@ int ima_file_mmap(struct file *file, unsigned long prot)
- 					 MAY_EXEC, FILE_MMAP);
- 	return 0;
- }
-+EXPORT_SYMBOL(ima_file_mmap);
- 
- /**
-  * ima_bprm_check - based on policy, collect/store measurement.
-diff --git a/security/security.c b/security/security.c
-index c4c6732..092cd90 100644
---- a/security/security.c
-+++ b/security/security.c
-@@ -386,6 +386,7 @@ int security_path_mkdir(struct path *path, struct dentry *dentry, int mode)
- 		return 0;
- 	return security_ops->path_mkdir(path, dentry, mode);
- }
-+EXPORT_SYMBOL(security_path_mkdir);
- 
- int security_path_rmdir(struct path *path, struct dentry *dentry)
- {
-@@ -393,6 +394,7 @@ int security_path_rmdir(struct path *path, struct dentry *dentry)
- 		return 0;
- 	return security_ops->path_rmdir(path, dentry);
- }
-+EXPORT_SYMBOL(security_path_rmdir);
- 
- int security_path_unlink(struct path *path, struct dentry *dentry)
- {
-@@ -400,6 +402,7 @@ int security_path_unlink(struct path *path, struct dentry *dentry)
- 		return 0;
- 	return security_ops->path_unlink(path, dentry);
- }
-+EXPORT_SYMBOL(security_path_unlink);
- 
- int security_path_symlink(struct path *path, struct dentry *dentry,
- 			  const char *old_name)
-@@ -408,6 +411,7 @@ int security_path_symlink(struct path *path, struct dentry *dentry,
- 		return 0;
- 	return security_ops->path_symlink(path, dentry, old_name);
- }
-+EXPORT_SYMBOL(security_path_symlink);
- 
- int security_path_link(struct dentry *old_dentry, struct path *new_dir,
- 		       struct dentry *new_dentry)
-@@ -416,6 +420,7 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir,
- 		return 0;
- 	return security_ops->path_link(old_dentry, new_dir, new_dentry);
- }
-+EXPORT_SYMBOL(security_path_link);
- 
- int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
- 			 struct path *new_dir, struct dentry *new_dentry)
-@@ -426,6 +431,7 @@ int security_path_rename(struct path *old_dir, struct dentry *old_dentry,
- 	return security_ops->path_rename(old_dir, old_dentry, new_dir,
- 					 new_dentry);
- }
-+EXPORT_SYMBOL(security_path_rename);
- 
- int security_path_truncate(struct path *path, loff_t length,
- 			   unsigned int time_attrs)
-@@ -434,6 +440,7 @@ int security_path_truncate(struct path *path, loff_t length,
- 		return 0;
- 	return security_ops->path_truncate(path, length, time_attrs);
- }
-+EXPORT_SYMBOL(security_path_truncate);
- #endif
- 
- int security_inode_create(struct inode *dir, struct dentry *dentry, int mode)
-@@ -505,6 +512,7 @@ int security_inode_readlink(struct dentry *dentry)
- 		return 0;
- 	return security_ops->inode_readlink(dentry);
- }
-+EXPORT_SYMBOL(security_inode_readlink);
- 
- int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd)
- {
-@@ -519,6 +527,7 @@ int security_inode_permission(struct inode *inode, int mask)
- 		return 0;
- 	return security_ops->inode_permission(inode, mask);
- }
-+EXPORT_SYMBOL(security_inode_permission);
- 
- int security_inode_setattr(struct dentry *dentry, struct iattr *attr)
- {
-@@ -619,6 +628,7 @@ int security_file_permission(struct file *file, int mask)
- {
- 	return security_ops->file_permission(file, mask);
- }
-+EXPORT_SYMBOL(security_file_permission);
- 
- int security_file_alloc(struct file *file)
- {
-@@ -641,6 +651,7 @@ int security_file_mmap(struct file *file, unsigned long reqprot,
- {
- 	return security_ops->file_mmap(file, reqprot, prot, flags, addr, addr_only);
- }
-+EXPORT_SYMBOL(security_file_mmap);
- 
- int security_file_mprotect(struct vm_area_struct *vma, unsigned long reqprot,
- 			    unsigned long prot)
diff --git a/pkgs/os-specific/linux/kernel/builder.sh b/pkgs/os-specific/linux/kernel/builder.sh
index 4c095bf8bbc..14d8108ba16 100644
--- a/pkgs/os-specific/linux/kernel/builder.sh
+++ b/pkgs/os-specific/linux/kernel/builder.sh
@@ -140,6 +140,10 @@ installPhase() {
         (cd arch/$archDir/include && cp -a asm/* $includeDir/asm/ || true)
         (cd arch/$archDir/include && cp -a generated/asm/* $includeDir/asm/ || true)
         (cd arch/$archDir/include/asm/mach-generic && cp -a * $includeDir/ || true)
+            # include files for special arm architectures 
+            if [ "$archDir" == "arm" ]; then
+                cp -a --parents arch/arm/mach-*/include $out/lib/modules/$version/build
+            fi
         fi
     fi
 
diff --git a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.15.patch b/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.15.patch
deleted file mode 100644
index 4e399af8300..00000000000
--- a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.15.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/fs/cifs/transport.c	2011-04-12 15:16:00.253887813 +0200
-+++ b/fs/cifs/transport.c	2011-04-12 15:17:22.650296413 +0200
-@@ -247,9 +247,9 @@
- 				    n_vec - first_vec, total_len);
- 		if ((rc == -ENOSPC) || (rc == -EAGAIN)) {
- 			i++;
--			if(i >= 14) {
-+			if(i >= 119) {
- 				cERROR(1,
--				   ("sends on sock %p stuck for 15 seconds",
-+				   ("sends on sock %p stuck for 120 seconds",
- 				    ssocket));
- 				rc = -EAGAIN;
- 				break;
-@@ -421,12 +421,12 @@
- 	else if (long_op == 2) /* writes past end of file can take loong time */
- 		timeout = 180 * HZ;
- 	else if (long_op == 1)
--		timeout = 45 * HZ; /* should be greater than 
-+		timeout = 120 * HZ; /* should be greater than 
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op > 2) {
- 		timeout = MAX_SCHEDULE_TIMEOUT;
- 	} else
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	/* wait for 15 seconds or until woken up due to response arriving or 
- 	   due to last connection to this server being unmounted */
- 	if (signal_pending(current)) {
-@@ -687,12 +687,12 @@
- 	else if (long_op == 2) /* writes past end of file can take loong time */
- 		timeout = 180 * HZ;
- 	else if (long_op == 1)
--		timeout = 45 * HZ; /* should be greater than 
-+		timeout = 120 * HZ; /* should be greater than 
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op > 2) {
- 		timeout = MAX_SCHEDULE_TIMEOUT;
- 	} else
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	/* wait for 15 seconds or until woken up due to response arriving or 
- 	   due to last connection to this server being unmounted */
- 	if (signal_pending(current)) {
diff --git a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.29.patch b/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.29.patch
deleted file mode 100644
index b2dac3f016c..00000000000
--- a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.29.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-diff -ru -x '*~' /tmp/linux-2.6.32.14/fs/cifs/transport.c linux-2.6.32.14/fs/cifs/transport.c
---- /tmp/linux-2.6.32.14/fs/cifs/transport.c	2010-05-26 23:29:57.000000000 +0200
-+++ linux-2.6.32.14/fs/cifs/transport.c	2010-06-20 22:03:13.000000000 +0200
-@@ -166,9 +166,9 @@
- 			   after the retries we will kill the socket and
- 			   reconnect which may clear the network problem.
- 			*/
--			if ((i >= 14) || (!server->noblocksnd && (i > 2))) {
-+			if ((i >= 119) || (!server->noblocksnd && (i > 2))) {
- 				cERROR(1,
--				   ("sends on sock %p stuck for 15 seconds",
-+				   ("sends on sock %p stuck for 120 seconds",
- 				    ssocket));
- 				rc = -EAGAIN;
- 				break;
-@@ -459,11 +459,11 @@
- 		goto out;
- 
- 	if (long_op == CIFS_STD_OP)
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */
- 		timeout = 180 * HZ;
- 	else if (long_op == CIFS_LONG_OP)
--		timeout = 45 * HZ; /* should be greater than
-+		timeout = 120 * HZ; /* should be greater than
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op == CIFS_ASYNC_OP)
- 		goto out;
-@@ -651,7 +651,7 @@
- 		goto out;
- 
- 	if (long_op == CIFS_STD_OP)
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	/* wait for 15 seconds or until woken up due to response arriving or
- 	   due to last connection to this server being unmounted */
- 	else if (long_op == CIFS_ASYNC_OP)
-@@ -659,7 +659,7 @@
- 	else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */
- 		timeout = 180 * HZ;
- 	else if (long_op == CIFS_LONG_OP)
--		timeout = 45 * HZ; /* should be greater than
-+		timeout = 120 * HZ; /* should be greater than
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op == CIFS_BLOCKING_OP)
- 		timeout = 0x7FFFFFFF; /* large but no so large as to wrap */
diff --git a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.35.patch b/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.35.patch
deleted file mode 100644
index 8043739ee9a..00000000000
--- a/pkgs/os-specific/linux/kernel/cifs-timeout-2.6.35.patch
+++ /dev/null
@@ -1,45 +0,0 @@
---- /tmp/linux-2.6.32.14/fs/cifs/transport.c	2010-11-22 20:01:26.000000000 +0100
-+++ linux-2.6.32.14/fs/cifs/transport.c	2011-03-29 15:31:14.926510480 +0200
-@@ -166,8 +166,8 @@
- 			   after the retries we will kill the socket and
- 			   reconnect which may clear the network problem.
- 			*/
--			if ((i >= 14) || (!server->noblocksnd && (i > 2))) {
--				cERROR(1, "sends on sock %p stuck for 15 seconds",
-+			if ((i >= 119) || (!server->noblocksnd && (i > 2))) {
-+				cERROR(1, "sends on sock %p stuck for 119 seconds",
- 				    ssocket);
- 				rc = -EAGAIN;
- 				break;
-@@ -458,11 +458,11 @@
- 		goto out;
- 
- 	if (long_op == CIFS_STD_OP)
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	else if (long_op == CIFS_VLONG_OP) /* e.g. slow writes past EOF */
- 		timeout = 180 * HZ;
- 	else if (long_op == CIFS_LONG_OP)
--		timeout = 45 * HZ; /* should be greater than
-+		timeout = 120 * HZ; /* should be greater than
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op == CIFS_ASYNC_OP)
- 		goto out;
-@@ -650,7 +650,7 @@
- 		goto out;
- 
- 	if (long_op == CIFS_STD_OP)
--		timeout = 15 * HZ;
-+		timeout = 120 * HZ;
- 	/* wait for 15 seconds or until woken up due to response arriving or
- 	   due to last connection to this server being unmounted */
- 	else if (long_op == CIFS_ASYNC_OP)
-@@ -658,7 +658,7 @@
- 	else if (long_op == CIFS_VLONG_OP) /* writes past EOF can be slow */
- 		timeout = 180 * HZ;
- 	else if (long_op == CIFS_LONG_OP)
--		timeout = 45 * HZ; /* should be greater than
-+		timeout = 120 * HZ; /* should be greater than
- 			servers oplock break timeout (about 43 seconds) */
- 	else if (long_op == CIFS_BLOCKING_OP)
- 		timeout = 0x7FFFFFFF; /* large but no so large as to wrap */
diff --git a/pkgs/os-specific/linux/kernel/dell-rfkill.patch b/pkgs/os-specific/linux/kernel/dell-rfkill.patch
deleted file mode 100644
index 32f890c84f6..00000000000
--- a/pkgs/os-specific/linux/kernel/dell-rfkill.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-Ensure that the dell-bluetooth device does not stay in the "hard
-blocked" state.
-
-From https://patchwork.kernel.org/patch/37539/
-
-diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
-index 74909c4..cf40c4e 100644
---- a/drivers/platform/x86/dell-laptop.c
-+++ b/drivers/platform/x86/dell-laptop.c
-@@ -197,8 +197,11 @@  static void dell_rfkill_query(struct rfkill *rfkill, void *data)
- 	dell_send_request(&buffer, 17, 11);
- 	status = buffer.output[1];
- 
--	if (status & BIT(bit))
--		rfkill_set_hw_state(rfkill, !!(status & BIT(16)));
-+	/*
-+	 * Don't change state unless the read-only HW rfkill switch is disabled.
-+	 */
-+	if (status & BIT(16))
-+		rfkill_set_hw_state(rfkill, !!(status & BIT(bit)));
- }
- 
- static const struct rfkill_ops dell_rfkill_ops = {
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 9e8ee74acb1..50469eb5383 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -27,9 +27,6 @@
   # optionally be compressed with gzip or bzip2.
   kernelPatches ? []
 
-, # Whether to build a User-Mode Linux kernel.
-  userModeLinux ? false
-
 , # Allows you to set your own kernel version suffix (e.g.,
   # "-my-kernel").
   localVersion ? ""
@@ -42,6 +39,8 @@
 , # After the builder did a 'make all' (kernel + modules)
   # we force building the target asked: bzImage/zImage/uImage/...
   postBuild ? "make $makeFlags $kernelTarget; make $makeFlags -C scripts unifdef"
+
+, extraNativeBuildInputs ? []
 , ...
 }:
 
@@ -63,7 +62,7 @@ let
 in
 
 stdenv.mkDerivation {
-  name = if userModeLinux then "user-mode-linux-${version}" else "linux-${version}";
+  name = "linux-${version}";
 
   enableParallelBuilding = true;
 
@@ -84,9 +83,10 @@ stdenv.mkDerivation {
   kernelConfig = kernelConfigFun config;
 
   # For UML and non-PC, just ignore all options that don't apply (We are lazy).
-  ignoreConfigErrors = (userModeLinux || stdenv.platform.name != "pc");
+  ignoreConfigErrors = stdenv.platform.name != "pc";
+
+  nativeBuildInputs = [ perl mktemp ] ++ extraNativeBuildInputs;
 
-  buildNativeInputs = [ perl mktemp ];
   buildInputs = lib.optional (stdenv.platform.uboot != null)
     (ubootChooser stdenv.platform.uboot);
 
@@ -98,7 +98,6 @@ stdenv.mkDerivation {
   # Should we trust platform.kernelArch? We can only do
   # that once we differentiate i686/x86_64 in platforms.
   arch =
-    if userModeLinux then "um" else
     if stdenv.system == "i686-linux" then "i386" else
     if stdenv.system == "x86_64-linux" then "x86_64" else
     if stdenv.isArm then "arm" else
@@ -123,20 +122,18 @@ stdenv.mkDerivation {
 
       # The substitution of crossAttrs happens *after* the stdenv cross adapter sets
       # the parameters for the usual stdenv. Thus, we need to specify
-      # the ".hostDrv" in the buildInputs here.
-      buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).hostDrv;
+      # the ".crossDrv" in the buildInputs here.
+      buildInputs = lib.optional (cp.uboot != null) (ubootChooser cp.uboot).crossDrv;
     };
 
   meta = {
     description =
-      (if userModeLinux then
-        "User-Mode Linux"
-       else
-        "The Linux kernel") +
+      "The Linux kernel" +
       (if kernelPatches == [] then "" else
         " (with patches: "
         + lib.concatStrings (lib.intersperse ", " (map (x: x.name) kernelPatches))
         + ")");
+    inherit version;
     license = "GPLv2";
     homepage = http://www.kernel.org/;
     maintainers = [
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.15.nix b/pkgs/os-specific/linux/kernel/linux-2.6.15.nix
deleted file mode 100644
index 2dd67f46167..00000000000
--- a/pkgs/os-specific/linux/kernel/linux-2.6.15.nix
+++ /dev/null
@@ -1,48 +0,0 @@
-{ stdenv, fetchurl, extraConfig ? "", ... } @ args:
-
-let
-  configWithPlatform = kernelPlatform:
-  ''
-    # Don't include any debug features.
-    DEBUG_KERNEL n
-
-    # Support drivers that need external firmware.
-    STANDALONE n
-
-    # Make /proc/config.gz available.
-    IKCONFIG_PROC y
-
-    # Optimize with -O2, not -Os.
-    CC_OPTIMIZE_FOR_SIZE n
-
-    # Enable various subsystems.
-    MTD_COMPLEX_MAPPINGS y # needed for many devices
-
-    # Networking options.
-    IP_PNP n
-    IPV6_PRIVACY y
-
-    # Filesystem options - in particular, enable extended attributes and
-    # ACLs for all filesystems that support them.
-    CIFS_XATTR y
-    CIFS_POSIX y
-
-    ${extraConfig}
-  '';
-in
-
-import ./generic.nix (rec {
-  version = "2.6.15.7";
-  postBuild = "make $makeFlags $kernelTarget";
-
-  src = fetchurl {
-    url = "ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-${version}.tar.bz2";
-      sha256 = "43e0c251924324749b06464512532c3002d6294520faabdba5b3aea4e840b48b";
-  };
-
-  config = configWithPlatform stdenv.platform;
-  configCross = configWithPlatform stdenv.cross.platform;
-}
-
-// removeAttrs args ["extraConfig"]
-)
\ No newline at end of file
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.32-xen.nix b/pkgs/os-specific/linux/kernel/linux-2.6.32-xen.nix
deleted file mode 100644
index 20e14ccf5e2..00000000000
--- a/pkgs/os-specific/linux/kernel/linux-2.6.32-xen.nix
+++ /dev/null
@@ -1,222 +0,0 @@
-{ stdenv, fetchurl, extraConfig ? "", ... } @ args:
-
-let
-  configWithPlatform = kernelPlatform:
-    ''
-      # Don't include any debug features.
-      DEBUG_KERNEL n
-
-      # Support drivers that need external firmware.
-      STANDALONE n
-
-      # Make /proc/config.gz available.
-      IKCONFIG_PROC y
-
-      # Optimize with -O2, not -Os.
-      CC_OPTIMIZE_FOR_SIZE n
-
-      # Enable the kernel's built-in memory tester.
-      MEMTEST y
-
-      # Include the CFQ I/O scheduler in the kernel, rather than as a
-      # module, so that the initrd gets a good I/O scheduler.
-      IOSCHED_CFQ y
-
-      # Disable some expensive (?) features.
-      FTRACE n
-      KPROBES n
-      NUMA? n
-      PM_TRACE_RTC n
-
-      # Enable various subsystems.
-      ACCESSIBILITY y # Accessibility support
-      AUXDISPLAY y # Auxiliary Display support
-      DONGLE y # Serial dongle support
-      HIPPI y
-      MTD_COMPLEX_MAPPINGS y # needed for many devices
-      NET_POCKET y # enable pocket and portable adapters
-      SCSI_LOWLEVEL y # enable lots of SCSI devices
-      SCSI_LOWLEVEL_PCMCIA y
-      SPI y # needed for many devices
-      SPI_MASTER y
-      WAN y
-
-      # Networking options.
-      IP_PNP n
-      IPV6_PRIVACY y
-      NETFILTER_ADVANCED y
-      IP_VS_PROTO_TCP y
-      IP_VS_PROTO_UDP y
-      IP_VS_PROTO_ESP y
-      IP_VS_PROTO_AH y
-      IP_DCCP_CCID3 n # experimental
-      CLS_U32_PERF y
-      CLS_U32_MARK y
-
-      # Wireless networking.
-      IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
-      IWLWIFI_LEDS? y
-      IWLWIFI_SPECTRUM_MEASUREMENT y
-      IWL3945_SPECTRUM_MEASUREMENT y
-      IWL4965 y # Intel Wireless WiFi 4965AGN
-      IWL5000 y # Intel Wireless WiFi 5000AGN
-      HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
-      HOSTAP_FIRMWARE_NVRAM y
-
-      # Some settings to make sure that fbcondecor works - in particular,
-      # disable tileblitting and the drivers that need it.
-
-      # Enable various FB devices.
-      FB y
-      FB_EFI y
-      FB_NVIDIA_I2C y # Enable DDC Support
-      FB_RIVA_I2C y
-      FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
-      FB_ATY_GX y # Mach64 GX support
-      FB_SAVAGE_I2C y
-      FB_SAVAGE_ACCEL y
-      FB_SIS_300 y
-      FB_SIS_315 y
-      FB_3DFX_ACCEL y
-      FB_GEODE y
-
-      # Video configuration
-      # The intel drivers already require KMS
-      DRM_I915_KMS y
-
-      # Sound.
-      SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
-      SND_HDA_INPUT_BEEP y # Support digital beep via input layer
-      SND_USB_CAIAQ_INPUT y
-      PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
-
-      # USB serial devices.
-      USB_SERIAL_GENERIC y # USB Generic Serial Driver
-      USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
-      USB_SERIAL_KEYSPAN_USA28 y
-      USB_SERIAL_KEYSPAN_USA28X y
-      USB_SERIAL_KEYSPAN_USA28XA y
-      USB_SERIAL_KEYSPAN_USA28XB y
-      USB_SERIAL_KEYSPAN_USA19 y
-      USB_SERIAL_KEYSPAN_USA18X y
-      USB_SERIAL_KEYSPAN_USA19W y
-      USB_SERIAL_KEYSPAN_USA19QW y
-      USB_SERIAL_KEYSPAN_USA19QI y
-      USB_SERIAL_KEYSPAN_USA49W y
-      USB_SERIAL_KEYSPAN_USA49WLC y
-
-      # Filesystem options - in particular, enable extended attributes and
-      # ACLs for all filesystems that support them.
-      EXT2_FS_XATTR y # Ext2 extended attributes
-      EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
-      EXT2_FS_SECURITY y # Ext2 Security Labels
-      EXT2_FS_XIP y # Ext2 execute in place support
-      EXT4_FS_POSIX_ACL y
-      EXT4_FS_SECURITY y
-      REISERFS_FS_XATTR y
-      REISERFS_FS_POSIX_ACL y
-      REISERFS_FS_SECURITY y
-      JFS_POSIX_ACL y
-      JFS_SECURITY y
-      XFS_QUOTA y
-      XFS_POSIX_ACL y
-      XFS_RT y # XFS Realtime subvolume support
-      OCFS2_DEBUG_MASKLOG n
-      OCFS2_FS_POSIX_ACL y
-      BTRFS_FS_POSIX_ACL y
-      UBIFS_FS_XATTR y
-      UBIFS_FS_ADVANCED_COMPR y
-      NFSD_V2_ACL y
-      NFSD_V3 y
-      NFSD_V3_ACL y
-      NFSD_V4 y
-      CIFS_XATTR y
-      CIFS_POSIX y
-
-      # Security related features.
-      STRICT_DEVMEM y # Filter access to /dev/mem
-      SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
-
-      # Misc. options.
-      8139TOO_8129 y
-      8139TOO_PIO n # PIO is slower
-      AIC79XX_DEBUG_ENABLE n
-      AIC7XXX_DEBUG_ENABLE n
-      AIC94XX_DEBUG n
-      B43_PCMCIA y
-      BLK_DEV_BSG n
-      BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
-      BLK_DEV_IDEACPI y # IDE ACPI support
-      BLK_DEV_INTEGRITY y
-      BSD_PROCESS_ACCT_V3 y
-      BT_HCIUART_BCSP y
-      BT_HCIUART_H4 y # UART (H4) protocol support
-      BT_HCIUART_LL y
-      BT_RFCOMM_TTY y # RFCOMM TTY support
-      CPU_FREQ_DEBUG n
-      CRASH_DUMP n
-      DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
-      FUSION y # Fusion MPT device support
-      IDE_GD_ATAPI y # ATAPI floppy support
-      IRDA_ULTRA y # Ultra (connectionless) protocol
-      JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
-      JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
-      JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
-      JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
-      KALLSYMS_EXTRA_PASS n
-      LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
-      LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
-      LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
-      LOGO n # not needed
-      MEDIA_ATTACH y
-      MEGARAID_NEWGEN y
-      MICROCODE_AMD y
-      MODVERSIONS y
-      MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
-      MTRR_SANITIZER y
-      NET_FC y # Fibre Channel driver support
-      PCI_LEGACY y
-      PPP_MULTILINK y # PPP multilink support
-      REGULATOR y # Voltage and Current Regulator Support
-      SCSI_LOGGING y # SCSI logging facility
-      SERIAL_8250 y # 8250/16550 and compatible serial support
-      SLIP_COMPRESSED y # CSLIP compressed headers
-      SLIP_SMART y
-      THERMAL_HWMON y # Hardware monitoring support
-      USB_DEBUG n
-      USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
-      X86_CHECK_BIOS_CORRUPTION y
-      X86_MCE y
-
-      # Enable Xen Dom0 support.
-      XEN_DOM0 y
-      XEN_PCI_PASSTHROUGH y
-
-      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
-      ${extraConfig}
-    '';
-in
-
-import ./generic.nix (
-
-  rec {
-    version = "2.6.32.24-xen-179eca5";
-    localVersion = "-xen-179eca5";
-  
-    src = fetchurl {
-      url = "http://nixos.org/tarballs/linux-${version}.tar.bz2";
-      sha256 = "09a7xh4hvw0hzq67dqdxn8p4rkd907937xvshx30rg4ab6717scf";
-    };
-
-    config = configWithPlatform stdenv.platform;
-    configCross = configWithPlatform stdenv.cross.platform;
-
-    features.iwlwifi = true;
-
-    meta.description = "Linux kernel suitable for Xen Domain 0";
-  }
-
-  // removeAttrs args ["extraConfig"]
-)
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix b/pkgs/os-specific/linux/kernel/linux-2.6.32.nix
deleted file mode 100644
index a7cb499a993..00000000000
--- a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix
+++ /dev/null
@@ -1,215 +0,0 @@
-{ stdenv, fetchurl, extraConfig ? "", ... } @ args:
-
-let
-  configWithPlatform = kernelPlatform:
-    ''
-      # Don't include any debug features.
-      DEBUG_KERNEL n
-
-      # Support drivers that need external firmware.
-      STANDALONE n
-
-      # Make /proc/config.gz available.
-      IKCONFIG_PROC y
-
-      # Optimize with -O2, not -Os.
-      CC_OPTIMIZE_FOR_SIZE n
-
-      # Enable the kernel's built-in memory tester.
-      MEMTEST y
-
-      # Include the CFQ I/O scheduler in the kernel, rather than as a
-      # module, so that the initrd gets a good I/O scheduler.
-      IOSCHED_CFQ y
-
-      # Disable some expensive (?) features.
-      FTRACE n
-      KPROBES n
-      NUMA? n
-      PM_TRACE_RTC n
-
-      # Enable various subsystems.
-      ACCESSIBILITY y # Accessibility support
-      AUXDISPLAY y # Auxiliary Display support
-      DONGLE y # Serial dongle support
-      HIPPI y
-      MTD_COMPLEX_MAPPINGS y # needed for many devices
-      NET_POCKET y # enable pocket and portable adapters
-      SCSI_LOWLEVEL y # enable lots of SCSI devices
-      SCSI_LOWLEVEL_PCMCIA y
-      SPI y # needed for many devices
-      SPI_MASTER y
-      WAN y
-
-      # Networking options.
-      IP_PNP n
-      IPV6_PRIVACY y
-      NETFILTER_ADVANCED y
-      IP_VS_PROTO_TCP y
-      IP_VS_PROTO_UDP y
-      IP_VS_PROTO_ESP y
-      IP_VS_PROTO_AH y
-      IP_DCCP_CCID3 n # experimental
-      CLS_U32_PERF y
-      CLS_U32_MARK y
-
-      # Wireless networking.
-      IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
-      IWLWIFI_LEDS? y
-      IWLWIFI_SPECTRUM_MEASUREMENT y
-      IWL3945_SPECTRUM_MEASUREMENT y
-      IWL4965 y # Intel Wireless WiFi 4965AGN
-      IWL5000 y # Intel Wireless WiFi 5000AGN
-      HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
-      HOSTAP_FIRMWARE_NVRAM y
-
-      # Some settings to make sure that fbcondecor works - in particular,
-      # disable tileblitting and the drivers that need it.
-
-      # Enable various FB devices.
-      FB y
-      FB_EFI y
-      FB_NVIDIA_I2C y # Enable DDC Support
-      FB_RIVA_I2C y
-      FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
-      FB_ATY_GX y # Mach64 GX support
-      FB_SAVAGE_I2C y
-      FB_SAVAGE_ACCEL y
-      FB_SIS_300 y
-      FB_SIS_315 y
-      FB_3DFX_ACCEL y
-      FB_GEODE y
-
-      # Video configuration
-      # The intel drivers already require KMS
-      DRM_I915_KMS y
-
-      # Sound.
-      SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
-      SND_HDA_INPUT_BEEP y # Support digital beep via input layer
-      SND_USB_CAIAQ_INPUT y
-      PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
-
-      # USB serial devices.
-      USB_SERIAL_GENERIC y # USB Generic Serial Driver
-      USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
-      USB_SERIAL_KEYSPAN_USA28 y
-      USB_SERIAL_KEYSPAN_USA28X y
-      USB_SERIAL_KEYSPAN_USA28XA y
-      USB_SERIAL_KEYSPAN_USA28XB y
-      USB_SERIAL_KEYSPAN_USA19 y
-      USB_SERIAL_KEYSPAN_USA18X y
-      USB_SERIAL_KEYSPAN_USA19W y
-      USB_SERIAL_KEYSPAN_USA19QW y
-      USB_SERIAL_KEYSPAN_USA19QI y
-      USB_SERIAL_KEYSPAN_USA49W y
-      USB_SERIAL_KEYSPAN_USA49WLC y
-
-      # Filesystem options - in particular, enable extended attributes and
-      # ACLs for all filesystems that support them.
-      EXT2_FS_XATTR y # Ext2 extended attributes
-      EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
-      EXT2_FS_SECURITY y # Ext2 Security Labels
-      EXT2_FS_XIP y # Ext2 execute in place support
-      EXT4_FS_POSIX_ACL y
-      EXT4_FS_SECURITY y
-      REISERFS_FS_XATTR y
-      REISERFS_FS_POSIX_ACL y
-      REISERFS_FS_SECURITY y
-      JFS_POSIX_ACL y
-      JFS_SECURITY y
-      XFS_QUOTA y
-      XFS_POSIX_ACL y
-      XFS_RT y # XFS Realtime subvolume support
-      OCFS2_DEBUG_MASKLOG n
-      OCFS2_FS_POSIX_ACL y
-      BTRFS_FS_POSIX_ACL y
-      UBIFS_FS_XATTR y
-      UBIFS_FS_ADVANCED_COMPR y
-      NFSD_V2_ACL y
-      NFSD_V3 y
-      NFSD_V3_ACL y
-      NFSD_V4 y
-      CIFS_XATTR y
-      CIFS_POSIX y
-
-      # Security related features.
-      STRICT_DEVMEM y # Filter access to /dev/mem
-      SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
-
-      # Misc. options.
-      8139TOO_8129 y
-      8139TOO_PIO n # PIO is slower
-      AIC79XX_DEBUG_ENABLE n
-      AIC7XXX_DEBUG_ENABLE n
-      AIC94XX_DEBUG n
-      B43_PCMCIA y
-      BLK_DEV_BSG n
-      BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
-      BLK_DEV_IDEACPI y # IDE ACPI support
-      BLK_DEV_INTEGRITY y
-      BSD_PROCESS_ACCT_V3 y
-      BT_HCIUART_BCSP y
-      BT_HCIUART_H4 y # UART (H4) protocol support
-      BT_HCIUART_LL y
-      BT_RFCOMM_TTY y # RFCOMM TTY support
-      CPU_FREQ_DEBUG n
-      CRASH_DUMP n
-      DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
-      FUSION y # Fusion MPT device support
-      IDE_GD_ATAPI y # ATAPI floppy support
-      IRDA_ULTRA y # Ultra (connectionless) protocol
-      JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
-      JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
-      JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
-      JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
-      KALLSYMS_EXTRA_PASS n
-      LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
-      LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
-      LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
-      LOGO n # not needed
-      MEDIA_ATTACH y
-      MEGARAID_NEWGEN y
-      MICROCODE_AMD y
-      MODVERSIONS y
-      MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
-      MTRR_SANITIZER y
-      NET_FC y # Fibre Channel driver support
-      PCI_LEGACY y
-      PPP_MULTILINK y # PPP multilink support
-      REGULATOR y # Voltage and Current Regulator Support
-      SCSI_LOGGING y # SCSI logging facility
-      SERIAL_8250 y # 8250/16550 and compatible serial support
-      SLIP_COMPRESSED y # CSLIP compressed headers
-      SLIP_SMART y
-      THERMAL_HWMON y # Hardware monitoring support
-      USB_DEBUG n
-      USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
-      X86_CHECK_BIOS_CORRUPTION y
-      X86_MCE y
-
-      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
-      ${extraConfig}
-    '';
-in
-
-import ./generic.nix (
-
-  rec {
-    version = "2.6.32.57";
-  
-    src = fetchurl {
-      url = "mirror://kernel/linux/kernel/v2.6/longterm/v2.6.32/linux-${version}.tar.bz2";
-      sha256 = "1pbwjdignv5qdzpiv3ijs5g95l86ss7jrslak12jfxly13lanzzh";
-    };
-
-    config = configWithPlatform stdenv.platform;
-    configCross = configWithPlatform stdenv.cross.platform;
-
-    features.iwlwifi = true;
-  }
-
-  // removeAttrs args ["extraConfig"]
-)
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.35.nix b/pkgs/os-specific/linux/kernel/linux-2.6.35.nix
deleted file mode 100644
index 1b8f9fded70..00000000000
--- a/pkgs/os-specific/linux/kernel/linux-2.6.35.nix
+++ /dev/null
@@ -1,222 +0,0 @@
-{ stdenv, fetchurl, extraConfig ? "", ... } @ args:
-
-let
-  configWithPlatform = kernelPlatform:
-    ''
-      # Don't include any debug features.
-      DEBUG_KERNEL n
-
-      # Support drivers that need external firmware.
-      STANDALONE n
-
-      # Make /proc/config.gz available.
-      IKCONFIG_PROC y
-
-      # Optimize with -O2, not -Os.
-      CC_OPTIMIZE_FOR_SIZE n
-
-      # Enable the kernel's built-in memory tester.
-      MEMTEST y
-
-      # Include the CFQ I/O scheduler in the kernel, rather than as a
-      # module, so that the initrd gets a good I/O scheduler.
-      IOSCHED_CFQ y
-      BLK_CGROUP y # required by CFQ
-
-      # Disable some expensive (?) features.
-      FTRACE n
-      KPROBES n
-      NUMA? n
-      PM_TRACE_RTC n
-
-      # Enable various subsystems.
-      ACCESSIBILITY y # Accessibility support
-      AUXDISPLAY y # Auxiliary Display support
-      DONGLE y # Serial dongle support
-      HIPPI y
-      MTD_COMPLEX_MAPPINGS y # needed for many devices
-      NET_POCKET y # enable pocket and portable adapters
-      SCSI_LOWLEVEL y # enable lots of SCSI devices
-      SCSI_LOWLEVEL_PCMCIA y
-      SPI y # needed for many devices
-      SPI_MASTER y
-      WAN y
-
-      # Networking options.
-      IP_PNP n
-      IPV6_PRIVACY y
-      NETFILTER_ADVANCED y
-      IP_VS_PROTO_TCP y
-      IP_VS_PROTO_UDP y
-      IP_VS_PROTO_ESP y
-      IP_VS_PROTO_AH y
-      IP_DCCP_CCID3 n # experimental
-      CLS_U32_PERF y
-      CLS_U32_MARK y
-
-      # Wireless networking.
-      IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
-      IWL4965 y # Intel Wireless WiFi 4965AGN
-      IWL5000 y # Intel Wireless WiFi 5000AGN
-      HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
-      HOSTAP_FIRMWARE_NVRAM y
-
-      # Some settings to make sure that fbcondecor works - in particular,
-      # disable tileblitting and the drivers that need it.
-
-      # Enable various FB devices.
-      FB y
-      FB_EFI y
-      FB_NVIDIA_I2C y # Enable DDC Support
-      FB_RIVA_I2C y
-      FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
-      FB_ATY_GX y # Mach64 GX support
-      FB_SAVAGE_I2C y
-      FB_SAVAGE_ACCEL y
-      FB_SIS_300 y
-      FB_SIS_315 y
-      FB_3DFX_ACCEL y
-      FB_GEODE y
-
-      # Video configuration
-      # The intel drivers already require KMS
-      DRM_I915_KMS y
-
-      # Sound.
-      SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
-      SND_HDA_INPUT_BEEP y # Support digital beep via input layer
-      SND_USB_CAIAQ_INPUT y
-      PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
-
-      # USB serial devices.
-      USB_SERIAL_GENERIC y # USB Generic Serial Driver
-      USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
-      USB_SERIAL_KEYSPAN_USA28 y
-      USB_SERIAL_KEYSPAN_USA28X y
-      USB_SERIAL_KEYSPAN_USA28XA y
-      USB_SERIAL_KEYSPAN_USA28XB y
-      USB_SERIAL_KEYSPAN_USA19 y
-      USB_SERIAL_KEYSPAN_USA18X y
-      USB_SERIAL_KEYSPAN_USA19W y
-      USB_SERIAL_KEYSPAN_USA19QW y
-      USB_SERIAL_KEYSPAN_USA19QI y
-      USB_SERIAL_KEYSPAN_USA49W y
-      USB_SERIAL_KEYSPAN_USA49WLC y
-
-      # Filesystem options - in particular, enable extended attributes and
-      # ACLs for all filesystems that support them.
-      EXT2_FS_XATTR y # Ext2 extended attributes
-      EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
-      EXT2_FS_SECURITY y # Ext2 Security Labels
-      EXT2_FS_XIP y # Ext2 execute in place support
-      EXT4_FS_POSIX_ACL y
-      EXT4_FS_SECURITY y
-      REISERFS_FS_XATTR y
-      REISERFS_FS_POSIX_ACL y
-      REISERFS_FS_SECURITY y
-      JFS_POSIX_ACL y
-      JFS_SECURITY y
-      XFS_QUOTA y
-      XFS_POSIX_ACL y
-      XFS_RT y # XFS Realtime subvolume support
-      OCFS2_DEBUG_MASKLOG n
-      BTRFS_FS_POSIX_ACL y
-      UBIFS_FS_XATTR y
-      UBIFS_FS_ADVANCED_COMPR y
-      NFSD_V2_ACL y
-      NFSD_V3 y
-      NFSD_V3_ACL y
-      NFSD_V4 y
-      CIFS_XATTR y
-      CIFS_POSIX y
-
-      # Security related features.
-      STRICT_DEVMEM y # Filter access to /dev/mem
-      SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
-
-      # Misc. options.
-      8139TOO_8129 y
-      8139TOO_PIO n # PIO is slower
-      AIC79XX_DEBUG_ENABLE n
-      AIC7XXX_DEBUG_ENABLE n
-      AIC94XX_DEBUG n
-      B43_PCMCIA y
-      BLK_DEV_BSG n
-      BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
-      BLK_DEV_IDEACPI y # IDE ACPI support
-      BLK_DEV_INTEGRITY y
-      BSD_PROCESS_ACCT_V3 y
-      BT_HCIUART_BCSP y
-      BT_HCIUART_H4 y # UART (H4) protocol support
-      BT_HCIUART_LL y
-      BT_RFCOMM_TTY y # RFCOMM TTY support
-      CPU_FREQ_DEBUG n
-      CRASH_DUMP n
-      DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
-      FUSION y # Fusion MPT device support
-      IDE_GD_ATAPI y # ATAPI floppy support
-      IRDA_ULTRA y # Ultra (connectionless) protocol
-      JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
-      JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
-      JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
-      JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
-      KALLSYMS_EXTRA_PASS n
-      LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
-      LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
-      LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
-      LOGO n # not needed
-      MEDIA_ATTACH y
-      MEGARAID_NEWGEN y
-      MICROCODE_AMD y
-      MODVERSIONS y
-      MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
-      MTRR_SANITIZER y
-      NET_FC y # Fibre Channel driver support
-      PPP_MULTILINK y # PPP multilink support
-      REGULATOR y # Voltage and Current Regulator Support
-      SCSI_LOGGING y # SCSI logging facility
-      SERIAL_8250 y # 8250/16550 and compatible serial support
-      SLIP_COMPRESSED y # CSLIP compressed headers
-      SLIP_SMART y
-      THERMAL_HWMON y # Hardware monitoring support
-      USB_DEBUG n
-      USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
-      X86_CHECK_BIOS_CORRUPTION y
-      X86_MCE y
-
-      # Allow up to 128 GiB of RAM in Xen domains.
-      XEN_MAX_DOMAIN_MEMORY 128
-
-      # PROC_EVENTS requires that the netlink connector is not built
-      # as a module.  This is required by libcgroup's cgrulesengd.
-      CONNECTOR y
-      PROC_EVENTS y
-
-      # Devtmpfs support.
-      DEVTMPFS y
-
-      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
-      ${extraConfig}
-    '';
-in
-
-import ./generic.nix (
-
-  rec {
-    version = "2.6.35.14";
-  
-    src = fetchurl {
-      url = "mirror://kernel/linux/kernel/v2.6/longterm/v2.6.35/linux-${version}.tar.bz2";
-      sha256 = "1wzml7s9karfbk2yi36g1r8fyaq4d4f16yizc68zgchv0xzj39zl";
-    };
-
-    config = configWithPlatform stdenv.platform;
-    configCross = configWithPlatform stdenv.cross.platform;
-
-    features.iwlwifi = true;
-  }
-
-  // removeAttrs args ["extraConfig"]
-)
diff --git a/pkgs/os-specific/linux/kernel/linux-3.0.nix b/pkgs/os-specific/linux/kernel/linux-3.0.nix
index e2ed7fc8c5d..9f1a36db7dd 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.0.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.0.nix
@@ -1,4 +1,4 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
+args @ { stdenv, fetchurl, extraConfig ? ""
 , perl, mktemp, module_init_tools
 , ... }:
 
@@ -173,6 +173,7 @@ let
       CRASH_DUMP n
       DMAR? n # experimental
       DVB_DYNAMIC_MINORS y # we use udev
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -230,15 +231,15 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.0.31";
-  
+    version = "3.0.80";
+
     preConfigure = ''
       substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
     '';
 
     src = fetchurl {
-      url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2";
-      sha256 = "1b5ix1fc55m6vsr28dh5xi89fphl3m3kmvaniq9div5rj8f6kv0f";
+      url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
+      sha256 = "0f3md117bh8n5izkhjd2jp096jqmwz6wpxn7rf8x2x9cz4jz0cqx";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.2.nix b/pkgs/os-specific/linux/kernel/linux-3.2.nix
index bea68decf64..9f16fc78b09 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.2.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.2.nix
@@ -1,4 +1,4 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
+args @ { stdenv, fetchurl, extraConfig ? ""
 , perl, mktemp, module_init_tools
 , ... }:
 
@@ -146,8 +146,10 @@ let
       NFSD_V3 y
       NFSD_V3_ACL y
       NFSD_V4 y
+      NFS_FSCACHE y
       CIFS_XATTR y
       CIFS_POSIX y
+      CIFS_FSCACHE y
 
       # Security related features.
       STRICT_DEVMEM y # Filter access to /dev/mem
@@ -174,6 +176,7 @@ let
       CRASH_DUMP n
       DMAR? n # experimental
       DVB_DYNAMIC_MINORS y # we use udev
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -237,8 +240,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.2.28";
-    testing = false;
+    version = "3.2.46";
 
     modDirVersion = version;
 
@@ -247,8 +249,8 @@ import ./generic.nix (
     '';
 
     src = fetchurl {
-      url = "mirror://kernel/linux/kernel/v3.0/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0v4mbqf0mgnshhkq3symlliaz1jwa7vx7195r3qls390plc9g0nl";
+      url = "mirror://kernel/linux/kernel/v3.0/linux-${version}.tar.xz";
+      sha256 = "1yxkkiay2a84113zjxyf680fz5l0ihvjq3fcik8hfibrb5x2rhgr";
     };
 
     config = configWithPlatform stdenv.platform;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.4.nix b/pkgs/os-specific/linux/kernel/linux-3.4.nix
index 7d421af4917..cd7e9f2b375 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.4.nix
@@ -1,4 +1,4 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
+args @ { stdenv, fetchurl, extraConfig ? ""
 , perl, mktemp, module_init_tools
 , ... }:
 
@@ -148,8 +148,10 @@ let
       NFSD_V3 y
       NFSD_V3_ACL y
       NFSD_V4 y
+      NFS_FSCACHE y
       CIFS_XATTR y
       CIFS_POSIX y
+      CIFS_FSCACHE y
 
       # Security related features.
       STRICT_DEVMEM y # Filter access to /dev/mem
@@ -161,6 +163,7 @@ let
       AIC79XX_DEBUG_ENABLE n
       AIC7XXX_DEBUG_ENABLE n
       AIC94XX_DEBUG n
+      AUDIT_LOGINUID_IMMUTABLE y
       B43_PCMCIA y
       BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
       BLK_DEV_IDEACPI y # IDE ACPI support
@@ -175,6 +178,7 @@ let
       DMAR? n # experimental
       DVB_DYNAMIC_MINORS y # we use udev
       EFI_STUB y # EFI bootloader in the bzImage itself
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -231,6 +235,9 @@ let
       # Devtmpfs support.
       DEVTMPFS y
 
+      # Easier debug of NFS issues
+      SUNRPC_DEBUG y
+
       ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
       ${extraConfig}
     '';
@@ -239,7 +246,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.4.9";
+    version = "3.4.47";
     testing = false;
 
     preConfigure = ''
@@ -248,7 +255,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "02rnzpnfs7hfsglrgwr1450ssj47da1w079rmvzh1k0apy7qdpzm";
+      sha256 = "0hdrwzhfnm3c26i2iaw2rfhi7rl89n7dpvbznn29k27p3ifi3rp6";
     };
 
     config = configWithPlatform stdenv.platform;
@@ -256,6 +263,8 @@ import ./generic.nix (
 
     features.iwlwifi = true;
     features.efiBootStub = true;
+    features.needsCifsUtils = true;
+    features.netfilterRPFilter = true;
   }
 
   // removeAttrs args ["extraConfig"]
diff --git a/pkgs/os-specific/linux/kernel/linux-3.5.nix b/pkgs/os-specific/linux/kernel/linux-3.7.nix
index 8e347595f22..8f77334901d 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.5.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.7.nix
@@ -1,4 +1,4 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
+args @ { stdenv, fetchurl, extraConfig ? ""
 , perl, mktemp, module_init_tools
 , ... }:
 
@@ -71,13 +71,14 @@ let
 
       # Wireless networking.
       IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
+      IPW2200_MONITOR? y # support promiscuous mode
       HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
       HOSTAP_FIRMWARE_NVRAM y
       ATH9K_PCI y # Detect Atheros AR9xxx cards on PCI(e) bus
       ATH9K_AHB y # Ditto, AHB bus
       B43_PHY_HT y
       BCMA_HOST_PCI y
+      CFG80211_WEXT y # Without it, ipw2200 drivers don't build
 
       # Some settings to make sure that fbcondecor works - in particular,
       # disable tileblitting and the drivers that need it.
@@ -148,8 +149,10 @@ let
       NFSD_V3 y
       NFSD_V3_ACL y
       NFSD_V4 y
+      NFS_FSCACHE y
       CIFS_XATTR y
       CIFS_POSIX y
+      CIFS_FSCACHE y
 
       # Security related features.
       STRICT_DEVMEM y # Filter access to /dev/mem
@@ -161,6 +164,7 @@ let
       AIC79XX_DEBUG_ENABLE n
       AIC7XXX_DEBUG_ENABLE n
       AIC94XX_DEBUG n
+      AUDIT_LOGINUID_IMMUTABLE y
       B43_PCMCIA y
       BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
       BLK_DEV_IDEACPI y # IDE ACPI support
@@ -173,8 +177,9 @@ let
       BT_RFCOMM_TTY y # RFCOMM TTY support
       CRASH_DUMP n
       DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
+      DVB_DYNAMIC_MINORS? y # we use udev
       EFI_STUB y # EFI bootloader in the bzImage itself
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -186,7 +191,7 @@ let
       LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
       LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
       LOGO n # not needed
-      MEDIA_ATTACH y
+      MEDIA_ATTACH? y
       MEGARAID_NEWGEN y
       MICROCODE_AMD y
       MODVERSIONS y
@@ -210,8 +215,8 @@ let
       # Linux Containers
       RT_GROUP_SCHED? y
       CGROUP_DEVICE? y
-      CGROUP_MEM_RES_CTLR? y
-      CGROUP_MEM_RES_CTLR_SWAP? y
+      MEMCG? y
+      MEMCG_SWAP? y
       DEVPTS_MULTIPLE_INSTANCES? y
 
       # Enable staging drivers.  These are somewhat experimental, but
@@ -232,6 +237,14 @@ let
       # Devtmpfs support.
       DEVTMPFS y
 
+      # Media support
+      MEDIA_CAMERA_SUPPORT? y
+      MEDIA_RC_SUPPORT? y
+      MEDIA_USB_SUPPORT y
+
+      # Easier debug of NFS issues
+      SUNRPC_DEBUG y
+
       ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
       ${extraConfig}
     '';
@@ -240,7 +253,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.5.2";
+    version = "3.7.10";
     testing = false;
 
     preConfigure = ''
@@ -249,7 +262,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "13dzx7gqm0n7s73bq87ibhmydrfsngyps9sczkcy1sh56rrkv0x6";
+      sha256 = "1l8b40z95ahc2v9babmhrbi8jn2bhwkapq0libq0z21iipqsya4v";
     };
 
     config = configWithPlatform stdenv.platform;
@@ -257,6 +270,9 @@ import ./generic.nix (
 
     features.iwlwifi = true;
     features.efiBootStub = true;
+    features.needsCifsUtils = true;
+    features.canDisableNetfilterConntrackHelpers = true;
+    features.netfilterRPFilter = true;
   }
 
   // removeAttrs args ["extraConfig"]
diff --git a/pkgs/os-specific/linux/kernel/linux-3.3.nix b/pkgs/os-specific/linux/kernel/linux-3.8.nix
index c56df955b79..6681438edd5 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.3.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.8.nix
@@ -1,4 +1,4 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
+args @ { stdenv, fetchurl, extraConfig ? ""
 , perl, mktemp, module_init_tools
 , ... }:
 
@@ -71,11 +71,14 @@ let
 
       # Wireless networking.
       IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
+      IPW2200_MONITOR? y # support promiscuous mode
       HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
       HOSTAP_FIRMWARE_NVRAM y
       ATH9K_PCI y # Detect Atheros AR9xxx cards on PCI(e) bus
       ATH9K_AHB y # Ditto, AHB bus
+      B43_PHY_HT y
+      BCMA_HOST_PCI y
+      CFG80211_WEXT y # Without it, ipw2200 drivers don't build
 
       # Some settings to make sure that fbcondecor works - in particular,
       # disable tileblitting and the drivers that need it.
@@ -140,14 +143,16 @@ let
       XFS_RT y # XFS Realtime subvolume support
       OCFS2_DEBUG_MASKLOG n
       BTRFS_FS_POSIX_ACL y
-      UBIFS_FS_XATTR y
+      UBIFS_FS_XATTR? y
       UBIFS_FS_ADVANCED_COMPR y
       NFSD_V2_ACL y
       NFSD_V3 y
       NFSD_V3_ACL y
       NFSD_V4 y
+      NFS_FSCACHE y
       CIFS_XATTR y
       CIFS_POSIX y
+      CIFS_FSCACHE y
 
       # Security related features.
       STRICT_DEVMEM y # Filter access to /dev/mem
@@ -159,6 +164,7 @@ let
       AIC79XX_DEBUG_ENABLE n
       AIC7XXX_DEBUG_ENABLE n
       AIC94XX_DEBUG n
+      AUDIT_LOGINUID_IMMUTABLE y
       B43_PCMCIA y
       BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
       BLK_DEV_IDEACPI y # IDE ACPI support
@@ -171,8 +177,9 @@ let
       BT_RFCOMM_TTY y # RFCOMM TTY support
       CRASH_DUMP n
       DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
+      DVB_DYNAMIC_MINORS? y # we use udev
       EFI_STUB y # EFI bootloader in the bzImage itself
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -184,7 +191,7 @@ let
       LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
       LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
       LOGO n # not needed
-      MEDIA_ATTACH y
+      MEDIA_ATTACH? y
       MEGARAID_NEWGEN y
       MICROCODE_AMD y
       MODVERSIONS y
@@ -200,14 +207,16 @@ let
       THERMAL_HWMON y # Hardware monitoring support
       USB_DEBUG n
       USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
+      USB_EHCI_TT_NEWSCHED y # Improved transaction translator scheduling
       X86_CHECK_BIOS_CORRUPTION y
       X86_MCE y
+      XEN_DOM0 y
 
       # Linux Containers
       RT_GROUP_SCHED? y
       CGROUP_DEVICE? y
-      CGROUP_MEM_RES_CTLR? y
-      CGROUP_MEM_RES_CTLR_SWAP? y
+      MEMCG? y
+      MEMCG_SWAP? y
       DEVPTS_MULTIPLE_INSTANCES? y
 
       # Enable staging drivers.  These are somewhat experimental, but
@@ -228,6 +237,17 @@ let
       # Devtmpfs support.
       DEVTMPFS y
 
+      # Media support
+      MEDIA_SUPPORT y
+      MEDIA_DIGITAL_TV_SUPPORT y
+
+      MEDIA_CAMERA_SUPPORT? y
+      MEDIA_RC_SUPPORT? y
+      MEDIA_USB_SUPPORT y
+
+      # Easier debug of NFS issues
+      SUNRPC_DEBUG y
+
       ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
       ${extraConfig}
     '';
@@ -236,7 +256,7 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.3.8";
+    version = "3.8.13";
     testing = false;
 
     preConfigure = ''
@@ -245,7 +265,7 @@ import ./generic.nix (
 
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
-      sha256 = "0bgppngf711mlxp0jcsnv5xc0xxc8vs5rzc1czkv2igrfb1kvrnz";
+      sha256 = "0pznsj89020fjl8dhcyf7r5bh95b27727gs0ri9has4i2z63blbw";
     };
 
     config = configWithPlatform stdenv.platform;
@@ -253,6 +273,9 @@ import ./generic.nix (
 
     features.iwlwifi = true;
     features.efiBootStub = true;
+    features.needsCifsUtils = true;
+    features.canDisableNetfilterConntrackHelpers = true;
+    features.netfilterRPFilter = true;
   }
 
   // removeAttrs args ["extraConfig"]
diff --git a/pkgs/os-specific/linux/kernel/linux-3.1.nix b/pkgs/os-specific/linux/kernel/linux-3.9.nix
index 76e2942c6a3..66ef05878bc 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.1.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.9.nix
@@ -1,5 +1,5 @@
-args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? ""
-, perl, mktemp, module_init_tools
+args @ { stdenv, fetchurl, extraConfig ? ""
+, perl, mktemp, module_init_tools, bc
 , ... }:
 
 let
@@ -12,7 +12,7 @@ let
       TIMER_STATS y
       USB_SUSPEND y
       BACKTRACE_SELF_TEST n
-      CPU_NOTIFIER_ERROR_INJECT n
+      CPU_NOTIFIER_ERROR_INJECT? n
       DEBUG_DEVRES n
       DEBUG_NX_TEST n
       DEBUG_STACK_USAGE n
@@ -37,19 +37,20 @@ let
       IOSCHED_CFQ y
       BLK_CGROUP y # required by CFQ
 
+      # Enable NUMA.
+      NUMA? y
+
       # Disable some expensive (?) features.
       FTRACE n
       KPROBES n
-      NUMA? n
       PM_TRACE_RTC n
 
       # Enable various subsystems.
       ACCESSIBILITY y # Accessibility support
       AUXDISPLAY y # Auxiliary Display support
       DONGLE y # Serial dongle support
-      HIPPI y
+      HIPPI? y
       MTD_COMPLEX_MAPPINGS y # needed for many devices
-      NET_POCKET y # enable pocket and portable adapters
       SCSI_LOWLEVEL y # enable lots of SCSI devices
       SCSI_LOWLEVEL_PCMCIA y
       SPI y # needed for many devices
@@ -70,11 +71,14 @@ let
 
       # Wireless networking.
       IPW2100_MONITOR y # support promiscuous mode
-      IPW2200_MONITOR y # support promiscuous mode
+      IPW2200_MONITOR? y # support promiscuous mode
       HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
       HOSTAP_FIRMWARE_NVRAM y
       ATH9K_PCI y # Detect Atheros AR9xxx cards on PCI(e) bus
       ATH9K_AHB y # Ditto, AHB bus
+      B43_PHY_HT y
+      BCMA_HOST_PCI y
+      CFG80211_WEXT y # Without it, ipw2200 drivers don't build
 
       # Some settings to make sure that fbcondecor works - in particular,
       # disable tileblitting and the drivers that need it.
@@ -96,7 +100,7 @@ let
       # Video configuration
       # Enable KMS for devices whose X.org driver supports it.
       DRM_I915_KMS y
-      DRM_RADEON_KMS y
+      DRM_RADEON_KMS? y
       # Hybrid graphics support
       VGA_SWITCHEROO y
 
@@ -139,14 +143,16 @@ let
       XFS_RT y # XFS Realtime subvolume support
       OCFS2_DEBUG_MASKLOG n
       BTRFS_FS_POSIX_ACL y
-      UBIFS_FS_XATTR y
+      UBIFS_FS_XATTR? y
       UBIFS_FS_ADVANCED_COMPR y
       NFSD_V2_ACL y
       NFSD_V3 y
       NFSD_V3_ACL y
       NFSD_V4 y
+      NFS_FSCACHE y
       CIFS_XATTR y
       CIFS_POSIX y
+      CIFS_FSCACHE y
 
       # Security related features.
       STRICT_DEVMEM y # Filter access to /dev/mem
@@ -158,6 +164,7 @@ let
       AIC79XX_DEBUG_ENABLE n
       AIC7XXX_DEBUG_ENABLE n
       AIC94XX_DEBUG n
+      AUDIT_LOGINUID_IMMUTABLE y
       B43_PCMCIA y
       BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
       BLK_DEV_IDEACPI y # IDE ACPI support
@@ -166,13 +173,13 @@ let
       BT_HCIUART_BCSP y
       BT_HCIUART_H4 y # UART (H4) protocol support
       BT_HCIUART_LL y
-      BT_L2CAP y
-      BT_SCO y # audio support
       BT_RFCOMM m
       BT_RFCOMM_TTY y # RFCOMM TTY support
       CRASH_DUMP n
       DMAR? n # experimental
-      DVB_DYNAMIC_MINORS y # we use udev
+      DVB_DYNAMIC_MINORS? y # we use udev
+      EFI_STUB y # EFI bootloader in the bzImage itself
+      FHANDLE y # used by systemd
       FUSION y # Fusion MPT device support
       IDE_GD_ATAPI y # ATAPI floppy support
       IRDA_ULTRA y # Ultra (connectionless) protocol
@@ -184,7 +191,7 @@ let
       LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
       LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
       LOGO n # not needed
-      MEDIA_ATTACH y
+      MEDIA_ATTACH? y
       MEGARAID_NEWGEN y
       MICROCODE_AMD y
       MODVERSIONS y
@@ -200,14 +207,16 @@ let
       THERMAL_HWMON y # Hardware monitoring support
       USB_DEBUG n
       USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
+      USB_EHCI_TT_NEWSCHED y # Improved transaction translator scheduling
       X86_CHECK_BIOS_CORRUPTION y
       X86_MCE y
+      XEN_DOM0 y
 
       # Linux Containers
       RT_GROUP_SCHED? y
       CGROUP_DEVICE? y
-      CGROUP_MEM_RES_CTLR? y
-      CGROUP_MEM_RES_CTLR_SWAP? y
+      MEMCG? y
+      MEMCG_SWAP? y
       DEVPTS_MULTIPLE_INSTANCES? y
 
       # Enable staging drivers.  These are somewhat experimental, but
@@ -219,9 +228,23 @@ let
       CONNECTOR y
       PROC_EVENTS y
 
+      # Tracing
+      FTRACE y
+      FUNCTION_TRACER y
+      FTRACE_SYSCALLS y
+      SCHED_TRACER y
+
       # Devtmpfs support.
       DEVTMPFS y
 
+      # Media support
+      MEDIA_CAMERA_SUPPORT? y
+      MEDIA_RC_SUPPORT? y
+      MEDIA_USB_SUPPORT y
+
+      # Easier debug of NFS issues
+      SUNRPC_DEBUG y
+
       ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
       ${extraConfig}
     '';
@@ -230,21 +253,28 @@ in
 import ./generic.nix (
 
   rec {
-    version = "3.1.10";
+    version = "3.9.4";
+    testing = false;
 
     preConfigure = ''
       substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
     '';
-  
+
     src = fetchurl {
-      url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.bz2";
-      sha256 = "1vcpbh7wnc9smw2l5ci27a5p0rgmc1a5dc6a1aljm6f6wcfic8lz";
+      url = "mirror://kernel/linux/kernel/v3.x/${if testing then "testing/" else ""}linux-${version}.tar.xz";
+      sha256 = "121n82731il7c329psa21xzg8yci7j4w3f2px6v2gh3z82ijkc4i";
     };
 
     config = configWithPlatform stdenv.platform;
     configCross = configWithPlatform stdenv.cross.platform;
 
     features.iwlwifi = true;
+    features.efiBootStub = true;
+    features.needsCifsUtils = true;
+    features.canDisableNetfilterConntrackHelpers = true;
+    features.netfilterRPFilter = true;
+
+    extraNativeBuildInputs = [bc];
   }
 
   // removeAttrs args ["extraConfig"]
diff --git a/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix b/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix
new file mode 100644
index 00000000000..cf88544abd5
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux-rpi-3.6.nix
@@ -0,0 +1,44 @@
+args @ {
+  stdenv, fetchurl, extraConfig ? "" , perl, mktemp, module_init_tools, ...
+}:
+
+let
+  configWithPlatform = kernelPlatform :
+    ''
+      ${if kernelPlatform ? kernelExtraConfig then kernelPlatform.kernelExtraConfig else ""}
+      ${extraConfig}
+    '';
+
+  rev = "91a3be5b2b";
+in
+
+import ./generic.nix (
+
+  rec {
+    version = "3.6.y-${rev}";
+    testing = false;
+
+    preConfigure = ''
+      substituteInPlace scripts/depmod.sh --replace '-b "$INSTALL_MOD_PATH"' ""
+    '';
+
+    src = fetchurl {
+      url = "https://api.github.com/repos/raspberrypi/linux/tarball/${rev}";
+      name = "linux-raspberrypi-${version}.tar.gz";
+      sha256 = "04370b1da7610622372940decdc13ddbba2a58c9da3c3bd3e7df930a399f140d";
+    };
+
+    config = configWithPlatform stdenv.platform;
+    configCross = configWithPlatform stdenv.cross.platform;
+
+    features.iwlwifi = true;
+    #features.efiBootStub = true;
+    #features.needsCifsUtils = true;
+    #features.canDisableNetfilterConntrackHelpers = true;
+    #features.netfilterRPFilter = true;
+
+    extraMeta.platforms = [];
+  }
+
+  // removeAttrs args ["extraConfig"]
+)
diff --git a/pkgs/os-specific/linux/kernel/linux.upstream.template b/pkgs/os-specific/linux/kernel/linux.upstream.template
new file mode 100644
index 00000000000..624b83d45b3
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/linux.upstream.template
@@ -0,0 +1,13 @@
+url "http://www.kernel.org/pub/linux/kernel/v3.x/${LINUX_VERSION_RC:+testing/}"
+version_link "linux-${LINUX_VERSION}.*tar[.]xz\$"
+version '.*linux-([0-9.]+(-rc[0-9]+)?)[.]tar.*' '\1'
+target "linux-${LINUX_VERSION}.nix"
+name "linux_${LINUX_VERSION/./_}"
+
+do_overwrite() {
+  ensure_hash
+  set_var_value version "$CURRENT_VERSION"
+  set_var_value sha256 "$CURRENT_HASH"
+  [ -n "$LINUX_VERSION_RC" ] && set_var_value testing true '' '' 1
+  [ -z "$LINUX_VERSION_RC" ] && set_var_value testing false '' '' 1
+}
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 52e284827d0..29eb170287a 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -1,4 +1,4 @@
-{ stdenv, runCommand, nettools, perl, kmod, writeTextFile }:
+{ stdenv, runCommand, nettools, bc, perl, kmod, writeTextFile }:
 
 with stdenv.lib;
 
@@ -8,16 +8,13 @@ let
   readConfig = configFile:
     let
       configAttrs = import "${runCommand "config.nix" {} ''
-        (. ${configFile}
-        echo "{"
-        for var in `set`; do
-            if [[ "$var" =~ ^CONFIG_ ]]; then
-                IFS="="
-                set -- $var
-                echo "\"$1\" = \"''${*:2}\";"
-            fi
-        done
-        echo "}") > $out
+        echo "{" > "$out"
+        while IFS='=' read key val; do
+          [ "x''${key#CONFIG_}" != "x$key" ] || continue
+          no_firstquote="''${val#\"}";
+          echo '  "'"$key"'" = "'"''${no_firstquote%\"}"'";' >> "$out"
+        done < "${configFile}"
+        echo "}" >> $out
       ''}";
 
       config = configAttrs // rec {
@@ -78,16 +75,6 @@ let
     "INSTALL_PATH=$(out)"
   ] ++ (optional isModular "INSTALL_MOD_PATH=$(out)")
   ++ optional installsFirmware "INSTALL_FW_PATH=$(out)/lib/firmware";
-in
-
-stdenv.mkDerivation {
-  name = "linux-${version}";
-
-  enableParallelBuilding = true;
-
-  passthru = {
-    inherit version modDirVersion config kernelPatches src;
-  };
 
   sourceRoot = stdenv.mkDerivation {
     name = "linux-${version}-source";
@@ -111,21 +98,35 @@ stdenv.mkDerivation {
       mv $sourceRoot $out
     '';
   };
+in
+
+stdenv.mkDerivation {
+  name = "linux-${version}";
+
+  enableParallelBuilding = true;
+
+  outputs = if isModular then [ "out" "dev" ] else null;
+
+  passthru = {
+    inherit version modDirVersion config kernelPatches src;
+  };
+
+  inherit sourceRoot;
 
   unpackPhase = ''
     mkdir build
     export buildRoot="$(pwd)/build"
-    ln -sv ${configfile} $buildRoot/.config
-    cd $sourceRoot
+    cd ${sourceRoot}
   '';
 
   configurePhase = ''
     runHook preConfigure
+    ln -sv ${configfile} $buildRoot/.config
     make $makeFlags "''${makeFlagsArray[@]}" oldconfig
     runHook postConfigure
   '';
 
-  buildNativeInputs = [ perl nettools ];
+  nativeBuildInputs = [ perl bc nettools ];
 
   makeFlags = commonMakeFlags ++ [
    "INSTALLKERNEL=${installkernel stdenv.platform.kernelTarget}"
@@ -143,17 +144,23 @@ stdenv.mkDerivation {
     make modules_install $makeFlags "''${makeFlagsArray[@]}" \
       $installFlags "''${installFlagsArray[@]}"
     rm -f $out/lib/modules/${modDirVersion}/build
-    mv $buildRoot $out/lib/modules/${modDirVersion}/build
+    mkdir -p $dev/lib/modules/${modDirVersion}
+    mv $out/lib/modules/${modDirVersion}/source $dev/lib/modules/${modDirVersion}/source
+    mv $buildRoot $dev/lib/modules/${modDirVersion}/build
   '' else optionalString installsFirmware ''
     make firmware_install $makeFlags "''${makeFlagsArray[@]}" \
       $installFlags "''${installFlagsArray[@]}"
   '');
 
-  postFixup = optionalString isModular ''
+  postFixup = if isModular then ''
     if [ -z "$dontStrip" ]; then
         find $out -name "*.ko" -print0 | xargs -0 -r strip -S
+        # Remove all references to the source directory to avoid unneeded
+        # runtime dependencies
+        find $out -name "*.ko" -print0 | xargs -0 -r sed -i \
+          "s|${sourceRoot}|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-${sourceRoot.name}|g"
     fi
-  '';
+  '' else null;
 
   meta = {
     description = "The Linux kernel";
diff --git a/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch b/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch
new file mode 100644
index 00000000000..fcb6f9177c7
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch
@@ -0,0 +1,17 @@
+Dirty patch that makes ext3 work again on 3.5 and 3.6 kernels,
+on mips n32.
+
+http://www.linux-mips.org/archives/linux-mips/2012-11/msg00030.html
+
+diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
+index 92490e9..bf63d7b 100644
+--- a/fs/ext3/dir.c
++++ b/fs/ext3/dir.c
+@@ -228,6 +228,7 @@ out:
+ 
+ static inline int is_32bit_api(void)
+ {
++	return 1;
+ #ifdef CONFIG_COMPAT
+ 	return is_compat_task();
+ #else
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index 7aa365a67de..73146d8b67d 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -1,25 +1,7 @@
-{ stdenv, fetchurl, fetchgit }:
+{ stdenv, fetchurl, fetchgit, apparmor }:
 
 let
 
-  fbcondecorConfig =
-    ''
-      FB_CON_DECOR y
-
-      # fbcondecor is picky about some other settings.
-      FB y
-      FB_TILEBLITTING n
-      FB_MATROX n
-      FB_S3 n
-      FB_VT8623 n
-      FB_ARK n
-      FB_CFB_FILLRECT y
-      FB_CFB_COPYAREA y
-      FB_CFB_IMAGEBLIT y
-      FB_VESA y
-      FRAMEBUFFER_CONSOLE y
-    '';
-
   makeTuxonicePatch = { version, kernelVersion, sha256,
     url ? "http://tuxonice.net/files/tuxonice-${version}-for-${kernelVersion}.patch.bz2" }:
     { name = "tuxonice-${kernelVersion}";
@@ -54,80 +36,40 @@ let
       '';
     };
 
+  makeAppArmorPatch = {apparmor, version}:
+    stdenv.mkDerivation {
+      name = "apparmor-${version}.patch";
+      phases = ["installPhase"];
+      installPhase = ''
+        cat ${apparmor}/kernel-patches/${version}/* > $out
+      '';
+    };
 in
 
 rec {
 
+  apparmor_3_2 = rec {
+    version = "3.2";
+    name = "apparmor-${version}";
+    patch = makeAppArmorPatch { inherit apparmor version; };
+    features.apparmor = true;
+  };
+
   sec_perm_2_6_24 =
     { name = "sec_perm-2.6.24";
       patch = ./sec_perm-2.6.24.patch;
       features.secPermPatch = true;
     };
 
-  fbcondecor_2_6_31 =
-    { name = "fbcondecor-0.9.6-2.6.31.2";
-      patch = fetchurl {
-        url = http://dev.gentoo.org/~spock/projects/fbcondecor/archive/fbcondecor-0.9.6-2.6.31.2.patch;
-        sha256 = "1avk0yn0y2qbpsxf31r6d14y4a1mand01r4k4i71yfxvpqcgxka9";
-      };
-      extraConfig = fbcondecorConfig;
-      features.fbConDecor = true;
-    };
-
-  fbcondecor_2_6_35 =
-    rec {
-      name = "fbcondecor-0.9.6-2.6.35-rc4";
-      patch = fetchurl {
-        url = "http://dev.gentoo.org/~spock/projects/fbcondecor/archive/${name}.patch";
-        sha256 = "0dlks1arr3b3hlmw9k1a1swji2x655why61sa0aahm62faibsg1r";
-      };
-      extraConfig = fbcondecorConfig;
-      features.fbConDecor = true;
-    };
-
-  aufs2_2_6_32 =
-    { # From http://git.c3sl.ufpr.br/gitweb?p=aufs/aufs2-standalone.git;a=tree;h=refs/heads/aufs2-32;hb=aufs2-32
-      # Note that this merely the patch needed to build AUFS2 as a
-      # standalone package.
-      name = "aufs2";
-      patch = ./aufs2.patch;
-      features.aufsBase = true;
-      features.aufs2 = true;
-    };
-
-  aufs2_2_6_35 =
-    { # From http://git.c3sl.ufpr.br/gitweb?p=aufs/aufs2-standalone.git;a=tree;h=refs/heads/aufs2-35;hb=aufs2-35
-      # Note that this merely the patch needed to build AUFS2 as a
-      # standalone package.
-      name = "aufs2";
-      patch = ./aufs2-35.patch;
-      features.aufsBase = true;
-      features.aufs2 = true;
-    };
-
   aufs3_0 = rec {
     name = "aufs3.0";
-    version = "3.0";
-    utilRev = "cabe3601001ab3838215116c32715c9de9412e62";
-    utilHash = "7fc6cfe1e69a0b2438eaee056e15d42a2d6be396a637fcfb1b89858fcecc832f";
-    patch = makeAufs3StandalonePatch {
-      inherit version;
-      rev = "517b27621cdfb793959acac849dae9888338526a";
-      sha256 = "8085200ac78d0c1e082d4c721a09f4a4c1d96ae86e307075836d09c3e7d502df";
-    };
-    features.aufsBase = true;
-    features.aufs3 = true;
-  };
-
-  aufs3_1 = rec {
-    name = "aufs3.1";
-    version = "3.1";
-    utilRev = "cabe3601001ab3838215116c32715c9de9412e62";
-    utilHash = "7fc6cfe1e69a0b2438eaee056e15d42a2d6be396a637fcfb1b89858fcecc832f";
+    version = "3.0.20121210";
+    utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
+    utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "7386b57432ec5e73632a5375804239b02b6c00f0";
-      sha256 = "af4e9ad890e1b72d14170c97d8ead53291f09e275db600932724e6181530be2d";
+      rev = "0627c706d69778f5c74be982f28c746153b8cdf7";
+      sha256 = "7008ff64f5adc2b3a30fcbb090bcbfaac61b778af38493b6144fc7d768a6514d";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -135,27 +77,13 @@ rec {
 
   aufs3_2 = rec {
     name = "aufs3.2";
-    version = "3.2";
-    utilRev = "a953b0218667e06b722f4c41df29edacd8dc8e1f";
-    utilHash = "28ac4c1a07b2c30fb61a6facc9cedcf67b14f303baedf1b121aeb6293ea49eb4";
-    patch = makeAufs3StandalonePatch {
-      inherit version;
-      rev = "9c4bbeb58f0ecc235ea820ae320efa2c0006e033";
-      sha256 = "5363a7f5fbadaef9457e743a5781f2525332c4bbb91693ca2596ab2d8f7860ea";
-    };
-    features.aufsBase = true;
-    features.aufs3 = true;
-  };
-
-  aufs3_3 = rec {
-    name = "aufs3.3";
-    version = "3.3.20120730";
+    version = "3.2.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "ff0c9f1c002ef564d7bd52dd56a9b72f4ee7ce0c";
-      sha256 = "cfa1a06669c984e1b8755da649aac40152e8018ee87939c5f0825100e45e196e";
+      rev = "0bf50c3b82f98e2ddc4c9ba0657f28ebfa8d15cb";
+      sha256 = "bc4b65cb77c62744db251da98488fdf4962f14a144c045cea6cbbbd42718ff89";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -163,27 +91,28 @@ rec {
 
   aufs3_4 = rec {
     name = "aufs3.4";
-    version = "3.4.20120730";
+    version = "3.4.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "8d7338df43d5e5372424813679c7531cf96ec260";
-      sha256 = "37880124df88791d51089277230df0816fc5545c9752be3fa5173385489362c6";
+      rev = "2faacd9baffb37df3b9062cc554353eebe68df1e";
+      sha256 = "3ecf97468f5e85970d9fd2bfc61e38c7f5ae2c6dde0045d5a17de085c411d452";
     };
     features.aufsBase = true;
     features.aufs3 = true;
   };
 
-  aufs3_5 = rec {
-    name = "aufs3.5";
-    version = "3.5.20120813";
+  # not officially released yet, but 3.x seems to work fine
+  aufs3_7 = rec {
+    name = "aufs3.7";
+    version = "3.x.20121210";
     utilRev = "91af15f977d12e02165759620005f6ce1a4d7602";
     utilHash = "dda4df89828dcf0e4012d88b4aa3eda8c30af69d6530ff5fedc2411de872c996";
     patch = makeAufs3StandalonePatch {
       inherit version;
-      rev = "85b5f7059bc8a1759989408a13fc56f92e0d6d31";
-      sha256 = "2be13407a2291c7e69658f10a6fb7672751c906a27ac700a2e5e05dbada97cc5";
+      rev = "8d24d728c7eb54dd624bccd8e87afa826670142c";
+      sha256 = "02dcb46e02b2a6b90c1601b5747614276074488c9308625c3a52ab74cad997a5";
     };
     features.aufsBase = true;
     features.aufs3 = true;
@@ -191,24 +120,6 @@ rec {
 
   # Increase the timeout on CIFS requests from 15 to 120 seconds to
   # make CIFS more resilient to high load on the CIFS server.
-  cifs_timeout_2_6_15 =
-    { name = "cifs-timeout";
-      patch = ./cifs-timeout-2.6.15.patch;
-      features.cifsTimeout = true;
-    };
-
-  cifs_timeout_2_6_29 =
-    { name = "cifs-timeout";
-      patch = ./cifs-timeout-2.6.29.patch;
-      features.cifsTimeout = true;
-    };
-
-  cifs_timeout_2_6_35 =
-    { name = "cifs-timeout";
-      patch = ./cifs-timeout-2.6.35.patch;
-      features.cifsTimeout = true;
-    };
-
   cifs_timeout_2_6_38 =
     { name = "cifs-timeout";
       patch = ./cifs-timeout-2.6.38.patch;
@@ -221,21 +132,6 @@ rec {
       features.noXsave = true;
     };
 
-  dell_rfkill =
-    { name = "dell-rfkill";
-      patch = ./dell-rfkill.patch;
-    };
-
-  perf3_5 =
-    { name = "perf-3.5";
-      patch = ./perf-3.5.patch;
-    };
-
-  sheevaplug_modules_2_6_35 =
-    { name = "sheevaplug_modules-2.6.35";
-      patch = ./sheevaplug_modules-2.6.35.patch;
-    };
-
   mips_fpureg_emu =
     { name = "mips-fpureg-emulation";
       patch = ./mips-fpureg-emulation.patch;
@@ -246,6 +142,11 @@ rec {
       patch = ./mips-fpu-sigill.patch;
     };
 
+  mips_ext3_n32 =
+    { name = "mips-ext3-n32";
+      patch = ./mips-ext3-n32.patch;
+    };
+
   guruplug_defconfig =
     { # Default configuration for the GuruPlug.  From
       # <http://www.openplug.org/plugwiki/images/c/c6/Guruplug-patchset-2.6.33.2.tar.bz2>.
diff --git a/pkgs/os-specific/linux/kernel/perf-3.5.patch b/pkgs/os-specific/linux/kernel/perf-3.5.patch
deleted file mode 100644
index 6d62a1db80e..00000000000
--- a/pkgs/os-specific/linux/kernel/perf-3.5.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-http://permalink.gmane.org/gmane.linux.kernel.perf.user/960
-
-Fix to build perf.
-
-diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
-index 9f6cebd..d5491f1 100644
---- a/tools/perf/util/evsel.c
-+++ b/tools/perf/util/evsel.c
-@@ -15,7 +15,7 @@
- #include "cpumap.h"
- #include "thread_map.h"
- #include "target.h"
--#include "../../include/linux/perf_event.h"
-+#include "../../../include/linux/perf_event.h"
-
- #define FD(e, x, y) (*(int *)xyarray__entry(e->fd, x, y))
- #define GROUP_FD(group_fd, cpu) (*(int *)xyarray__entry(group_fd, cpu, 0))
diff --git a/pkgs/os-specific/linux/kernel/perf.nix b/pkgs/os-specific/linux/kernel/perf.nix
index 01d989e75b1..ebbf9557245 100644
--- a/pkgs/os-specific/linux/kernel/perf.nix
+++ b/pkgs/os-specific/linux/kernel/perf.nix
@@ -1,13 +1,13 @@
-{ stdenv, kernel, elfutils, python, perl, newt, slang, asciidoc, xmlto
+{ stdenv, kernelDev, elfutils, python, perl, newt, slang, asciidoc, xmlto
 , docbook_xsl, docbook_xml_dtd_45, libxslt, flex, bison, pkgconfig
 , withGtk ? false, gtk ? null }:
 
 assert withGtk -> gtk != null;
 
 stdenv.mkDerivation {
-  name = "perf-linux-${kernel.version}";
+  name = "perf-linux-${kernelDev.version}";
 
-  inherit (kernel) src patches;
+  inherit (kernelDev) src patches;
 
   preConfigure = ''
     cd tools/perf
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   '';
 
   # perf refers both to newt and slang
-  buildNativeInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt flex bison ];
+  nativeBuildInputs = [ asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt flex bison ];
   buildInputs = [ elfutils python perl newt slang pkgconfig] ++
     stdenv.lib.optional withGtk gtk;
 
@@ -27,9 +27,9 @@ stdenv.mkDerivation {
   crossAttrs = {
     /* I don't want cross-python or cross-perl -
        I don't know if cross-python even works */
-    propagatedBuildInputs = [ elfutils.hostDrv newt.hostDrv ];
+    propagatedBuildInputs = [ elfutils.crossDrv newt.crossDrv ];
     makeFlags = "CROSS_COMPILE=${stdenv.cross.config}-";
-    elfutils = elfutils.hostDrv;
+    elfutils = elfutils.crossDrv;
   };
 
   meta = {
diff --git a/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch b/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch
deleted file mode 100644
index 5b62fb90670..00000000000
--- a/pkgs/os-specific/linux/kernel/sheevaplug_modules-2.6.35.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-http://www.mail-archive.com/armedslack@lists.armedslack.org/msg00212.html
-
-From d0679c730395d0bde9a46939e7ba255b4ba7dd7c Mon Sep 17 00:00:00 2001
-From: Andi Kleen <andi@firstfloor.org>
-Date: Tue, 2 Feb 2010 14:40:02 -0800
-Subject: [PATCH] kbuild: move -fno-dwarf2-cfi-asm to powerpc only
-
-Better dwarf2 unwind information is a good thing, it allows better
-debugging with kgdb and crash and helps systemtap.
-
-Commit 003086497f07f7f1e67c0c295e261740f822b377 ("Build with
--fno-dwarf2-cfi-asm") disabled some CFI information globally to work
-around a module loader bug on powerpc.
-
-But this disables the better unwind tables for all architectures, not just
-powerpc.  Move the workaround to powerpc and also add a suitable comment
-that's it really a workaround.
-
-This improves dwarf2 unwind tables on x86 at least.
-
-Signed-off-by: Andi Kleen <ak@linux.intel.com>
-Cc: Kyle McMartin <kyle@mcmartin.ca>
-Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-Signed-off-by: Michal Marek <mmarek@suse.cz>
----
- Makefile              |    3 ---
- arch/powerpc/Makefile |    5 +++++
- 2 files changed, 5 insertions(+), 3 deletions(-)
-
-diff --git a/Makefile b/Makefile
-index 03053c6..2e74a68 100644
---- a/Makefile
-+++ b/Makefile
-@@ -579,6 +579,9 @@ KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
- # disable invalid "can't wrap" optimizations for signed / pointers
- KBUILD_CFLAGS	+= $(call cc-option,-fno-strict-overflow)
- 
-+# revert to pre-gcc-4.4 behaviour of .eh_frame
-+KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
-+
- # conserve stack if available
- KBUILD_CFLAGS   += $(call cc-option,-fconserve-stack)
- 
-diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
-index 1a54a3b..42dcd3f 100644
---- a/arch/powerpc/Makefile
-+++ b/arch/powerpc/Makefile
-@@ -112,11 +112,6 @@ KBUILD_CFLAGS += $(call cc-option,-mspe=no)
- # kernel considerably.
- KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
- 
--# FIXME: the module load should be taught about the additional relocs
--# generated by this.
--# revert to pre-gcc-4.4 behaviour of .eh_frame
--KBUILD_CFLAGS	+= $(call cc-option,-fno-dwarf2-cfi-asm)
--
- # Never use string load/store instructions as they are
- # often slow when they are implemented at all
- KBUILD_CFLAGS		+= -mno-string
--- 
-1.7.3.1
-
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix
index 781bb67edca..97bdd9ebacb 100644
--- a/pkgs/os-specific/linux/klibc/default.nix
+++ b/pkgs/os-specific/linux/klibc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross, kernel ? null }:
+{ stdenv, fetchurl, perl, bison, mktemp, linuxHeaders, linuxHeadersCross, kernelDev ? null }:
 
 assert stdenv.isLinux;
 
@@ -8,7 +8,7 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "klibc-${version}${stdenv.lib.optionalString (kernel != null) "-${kernel.version}"}";
+  name = "klibc-${version}${stdenv.lib.optionalString (kernelDev != null) "-${kernelDev.version}"}";
 
   src = fetchurl {
     url = "mirror://kernel/linux/libs/klibc/1.5/klibc-${version}.tar.bz2";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   # So it cannot run the 'make headers_install' it wants to run.
   # We don't install the headers, so klibc will not be useful as libc, but
   # usually in nixpkgs we only use the userspace tools comming with klibc.
-  prePatch = stdenv.lib.optionalString (kernel == null) ''
+  prePatch = stdenv.lib.optionalString (kernelDev == null) ''
     sed -i -e /headers_install/d scripts/Kbuild.install
   '';
   
@@ -49,15 +49,15 @@ stdenv.mkDerivation {
     echo "CONFIG_AEABI=y" >> defconfig
     makeFlags=$(eval "echo $makeFlags")
 
-  '' + (if kernel == null then ''
+  '' + (if kernelDev == null then ''
     mkdir linux
     cp -prsd $linuxHeaders/include linux/
     chmod -R u+w linux/include/
   '' else ''
-    tar xvf ${kernel.src}
+    tar xvf ${kernelDev.src}
     mv linux* linux
     cd linux
-    ln -sv ${kernel}/config .config
+    ln -sv ${kernelDev}/config .config
     make prepare
     cd ..
   '');
@@ -70,5 +70,5 @@ stdenv.mkDerivation {
     cp usr/dash/sh $dir/
   '';
   
-  buildNativeInputs = [ perl bison mktemp ];
+  nativeBuildInputs = [ perl bison mktemp ];
 }
diff --git a/pkgs/os-specific/linux/kmod/default.nix b/pkgs/os-specific/linux/kmod/default.nix
index afa19491ce5..96d756bc7d2 100644
--- a/pkgs/os-specific/linux/kmod/default.nix
+++ b/pkgs/os-specific/linux/kmod/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, xz, zlib, pkgconfig }:
+{ stdenv, fetchurl, xz, zlib, pkgconfig, libxslt }:
 
 stdenv.mkDerivation rec {
-  name = "kmod-9";
+  name = "kmod-12";
 
   src = fetchurl {
     url = "mirror://kernel/linux/utils/kernel/kmod/${name}.tar.xz";
-    sha256 = "1kyfplx0gygzxp5dn81yk3cn8zzraqm497vis04r1g1dnry2c1q6";
+    sha256 = "c6189dd8c5a1e8d9224e8506bd188c0cd5dfa119fd6b7e5869b3640cbe8bf92f";
   };
 
   # Disable xz/zlib support to prevent needing them in the initrd.
   
-  buildInputs = [ pkgconfig /* xz zlib */ ];
+  buildInputs = [ pkgconfig libxslt /* xz zlib */ ];
 
   configureFlags = [ "--sysconfdir=/etc" /* "--with-xz" "--with-zlib" */ ];
 
diff --git a/pkgs/os-specific/linux/kqemu/default.nix b/pkgs/os-specific/linux/kqemu/default.nix
index c703ca4e4a4..97b7c495bb3 100644
--- a/pkgs/os-specific/linux/kqemu/default.nix
+++ b/pkgs/os-specific/linux/kqemu/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, kernel, perl }:
+{ stdenv, fetchurl, kernelDev, perl }:
 
 stdenv.mkDerivation rec {
-  name = "kqemu-1.4.0pre1-${kernel.version}";
+  name = "kqemu-1.4.0pre1-${kernelDev.version}";
   
   src = fetchurl {
     url = "http://www.nongnu.org/qemu/${name}.tar.gz";
@@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ perl ];
   
-  configureFlags = [ ''--PREFIX=$out'' ''--kernel-path=$(ls -d ${kernel}/lib/modules/*/build)'' ];
+  configureFlags = [ ''--PREFIX=$out'' ''--kernel-path=$(ls -d ${kernelDev}/lib/modules/*/build)'' ];
   
   preConfigure = '' 
     sed -e '/#include/i#include <linux/sched.h>' -i kqemu-linux.c
 
     sed -e 's/memset/mymemset/g; s/memcpy/mymemcpy/g; s/void [*]my/static void *my/g' -i common/kernel.c
-    sed -e 's/`uname -r`/'"$(basename ${kernel}/lib/modules/*)"'/' -i install.sh
+    sed -e 's/`uname -r`/'"$(basename ${kernelDev}/lib/modules/*)"'/' -i install.sh
     sed -e '/kernel_path=/akernel_path=$out$kernel_path' -i install.sh
     sed -e '/depmod/d' -i install.sh
     cat install.sh
diff --git a/pkgs/os-specific/linux/kudzu/builder.sh b/pkgs/os-specific/linux/kudzu/builder.sh
deleted file mode 100644
index 002bac8a1db..00000000000
--- a/pkgs/os-specific/linux/kudzu/builder.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-source $stdenv/setup
-
-export DESTDIR=$out
-
-preInstall() {
-  mkdir -p $out
-  mkdir -p $out/etc
-  mkdir -p $out/sbin
-  mkdir -p $out/usr
-  make install-program
-}
-
-genericBuild
diff --git a/pkgs/os-specific/linux/kudzu/default.nix b/pkgs/os-specific/linux/kudzu/default.nix
deleted file mode 100644
index 5cc8161bd94..00000000000
--- a/pkgs/os-specific/linux/kudzu/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, pciutils, python, popt, gettext}:
-
-stdenv.mkDerivation {
-  name = "kudzu-1.2.16";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://losser.labs.cs.uu.nl/~armijn/.nix/kudzu-1.2.16.tar.gz;
-    md5 = "5fc786dd558064fd9c9cb3e5be10e799";
-  };
-  buildInputs = [pciutils python popt gettext];
-  inherit python;
-  patches = [./kudzu-python.patch];
-}
diff --git a/pkgs/os-specific/linux/kudzu/kudzu-python.patch b/pkgs/os-specific/linux/kudzu/kudzu-python.patch
deleted file mode 100644
index 553d998f517..00000000000
--- a/pkgs/os-specific/linux/kudzu/kudzu-python.patch
+++ /dev/null
@@ -1,21 +0,0 @@
-diff -ruN kudzu-1.2.16/Makefile kudzu-1.2.16.new/Makefile
---- kudzu-1.2.16/Makefile	2005-10-28 21:57:55.000000000 +0200
-+++ kudzu-1.2.16.new/Makefile	2005-12-23 19:55:12.000000000 +0100
-@@ -17,7 +17,7 @@
- 
- CVSTAG = kudzu-r$(subst .,-,$(VERSION))
- 
--PYTHONVERS = $(shell ls /usr/include/python*/Python.h | sed "s|/usr/include/||g"| sed "s|/Python.h||g")
-+PYTHONVERS = $(shell ls $(python)/include/python*/Python.h | sed "s|$(python)/include/||g"| sed "s|/Python.h||g")
- 
- CFLAGS += -I. -DVERSION=\"$(VERSION)\"
- 
-@@ -84,7 +84,7 @@
- 	for ver in $(PYTHONVERS) ; do \
- 		if [ ! -f "$$ver/_kudzumodule.so" -o libkudzu.a -nt "$$ver/_kudzumodule.so" ]; then \
- 			mkdir -p $$ver ;\
--			$(CC) $(CFLAGS) -I/usr/include/$$ver -fpic -c -o $$ver/kudzumodule.o kudzumodule.c ;\
-+			$(CC) $(CFLAGS) -I$(python)/include/$$ver -fpic -c -o $$ver/kudzumodule.o kudzumodule.c ;\
- 	        	$(CC) -o $$ver/_kudzumodule.so $$ver/kudzumodule.o -shared -Wl,-soname,_kudzumodule.so -L. -lkudzu -lpci ;\
- 		fi ; \
- 	done
diff --git a/pkgs/os-specific/linux/libcap-ng/default.nix b/pkgs/os-specific/linux/libcap-ng/default.nix
new file mode 100644
index 00000000000..bbeb2851ea3
--- /dev/null
+++ b/pkgs/os-specific/linux/libcap-ng/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, python }:
+
+assert stdenv.isLinux;
+
+stdenv.mkDerivation rec {
+  name = "libcap-ng-${version}";
+  version = "0.7.3";
+
+  src = fetchurl {
+    url = "${meta.homepage}/${name}.tar.gz";
+    sha256 = "1cavlcrpqi4imkmagjhw65br8rv2fsbhf68mm3lczr51sg44392w";
+  };
+
+  buildInputs = [ python ]; # ToDo? optional swig for python bindings
+
+  meta = {
+    description = "Library for working with POSIX capabilities";
+    homepage = http://people.redhat.com/sgrubb/libcap-ng/;
+    platforms = stdenv.lib.platforms.linux;
+    license = "LGPLv2.1";
+  };
+}
diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix
index 667fe63bba7..92f15c1ade3 100644
--- a/pkgs/os-specific/linux/libcap/default.nix
+++ b/pkgs/os-specific/linux/libcap/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "03q50j6bg65cc501q87qh328ncav1i8qw2bjig99vxmmfx4bvsvk";
   };
   
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   propagatedBuildInputs = [ attr ];
 
   preConfigure = "cd libcap";
diff --git a/pkgs/os-specific/linux/libcgroup/default.nix b/pkgs/os-specific/linux/libcgroup/default.nix
index 0246f6729b1..6323d8c4f23 100644
--- a/pkgs/os-specific/linux/libcgroup/default.nix
+++ b/pkgs/os-specific/linux/libcgroup/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pam ];
 
-  buildNativeInputs = [ yacc flex ];
+  nativeBuildInputs = [ yacc flex ];
 
   meta = {
     description = "Library and tools to manage Linux's cgroup resource management system";
diff --git a/pkgs/os-specific/linux/libnl/default.nix b/pkgs/os-specific/linux/libnl/default.nix
index 35f05e9d009..6fe31c63178 100644
--- a/pkgs/os-specific/linux/libnl/default.nix
+++ b/pkgs/os-specific/linux/libnl/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, bison, flex}:
 
 stdenv.mkDerivation rec {
-  name = "libnl-3.0";
+  name = "libnl-3.2.13";
 
   src = fetchurl {
     url = "${meta.homepage}files/${name}.tar.gz";
-    sha256 = "1vac10m3w0m5lsypjcrhs2dzwng82nkbzqz8g8kyzkxb3qz5ql3s";
+    sha256 = "1ydw42lsd572qwrfgws97n76hyvjdpanwrxm03lysnhfxkna1ssd";
   };
 
   buildInputs = [ bison flex ];
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch
deleted file mode 100644
index bb09b362660..00000000000
--- a/pkgs/os-specific/linux/libnl/libnl-1.1-flags.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- libnl-1.1/lib/Makefile.orig	2008-01-14 16:48:45.000000000 +0100
-+++ libnl-1.1/lib/Makefile	2009-05-26 09:47:42.000000000 +0200
-@@ -48,7 +48,7 @@
- 
- $(OUT_SLIB): ../Makefile.opts $(OBJ)
- 	@echo "  LD $(OUT_SLIB)"; \
--	$(CC) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
-+	$(CC) $(CFLAGS) $(LDFLAGS) -shared -Wl,-soname,libnl.so.1 -o $(OUT_SLIB) $(OBJ) $(LIBNL_LIB) -lc
- 	@echo "  LN $(OUT_SLIB) $(LN1_SLIB)"; \
- 	rm -f $(LN1_SLIB) ; $(LN) -s $(OUT_SLIB) $(LN1_SLIB)
- 	@echo "  LN $(LN1_SLIB) $(LN_SLIB)"; \
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch
deleted file mode 100644
index 79dd039a338..00000000000
--- a/pkgs/os-specific/linux/libnl/libnl-1.1-glibc-2.8-ULONG_MAX.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-https://bugs.gentoo.org/show_bug.cgi?id=225393
-
---- libnl-1.1/include/netlink-local.h	2008-06-09 07:54:20 +0000
-+++ libnl-1.1/include/netlink-local.h	2008-06-09 07:54:47 +0000
-@@ -26,6 +26,7 @@
- #include <sys/socket.h>
- #include <inttypes.h>
- #include <assert.h>
-+#include <limits.h>
- 
- #include <arpa/inet.h>
- #include <netdb.h>
-
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch
deleted file mode 100644
index 855a6ab3912..00000000000
--- a/pkgs/os-specific/linux/libnl/libnl-1.1-minor-leaks.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From: Patrick McHardy <kaber@trash.net>
-Date: Fri, 18 Jan 2008 16:55:49 +0000 (+0100)
-Subject: [LIBNL]: Fix minor memleaks on exit
-X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=b64f15d6f947839236fa276d473d238f8c9b9d57;hp=e91bb2ffb090955d443e643a25b250bf3d33534a
-
-[LIBNL]: Fix minor memleaks on exit
-
-Make valgrind happy ...
-
-Signed-off-by: Patrick McHardy <kaber@trash.net>
----
-
-diff --git a/lib/route/route_utils.c b/lib/route/route_utils.c
-index a12d169..1386cda 100644
---- a/lib/route/route_utils.c
-+++ b/lib/route/route_utils.c
-@@ -63,6 +63,11 @@ static void __init init_routing_table_names(void)
- 	add_routing_table_name(RT_TABLE_LOCAL, "local");
- };
- 
-+static void __exit release_routing_table_names(void)
-+{
-+	__trans_list_clear(&table_names);
-+}
-+
- int rtnl_route_read_table_names(const char *path)
- {
- 	__trans_list_clear(&table_names);
-@@ -104,6 +109,11 @@ static void __init init_proto_names(void)
- 	add_proto_name(RTPROT_STATIC, "static");
- };
- 
-+static void __exit release_proto_names(void)
-+{
-+	__trans_list_clear(&proto_names);
-+}
-+
- int rtnl_route_read_protocol_names(const char *path)
- {
- 	__trans_list_clear(&proto_names);
diff --git a/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch b/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch
deleted file mode 100644
index c4c2fc6382d..00000000000
--- a/pkgs/os-specific/linux/libnl/libnl-1.1-vlan-header.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From: Patrick McHardy <kaber@trash.net>
-Date: Fri, 18 Jan 2008 16:55:48 +0000 (+0100)
-Subject: [LIBNL]: Add if_vlan.h
-X-Git-Url: http://git.kernel.org/?p=libs%2Fnetlink%2Flibnl.git;a=commitdiff_plain;h=e91bb2ffb090955d443e643a25b250bf3d33534a;hp=7f6b7a8eea0334b34d58dec72c66121a76f08958
-
-[LIBNL]: Add if_vlan.h
-
-vlan support needs VLAN_FLAG_REORDER_HDR, which is not available in
-older if_vlan.h versions. Add the current version from the kernel.
-
-Signed-off-by: Patrick McHardy <kaber@trash.net>
----
-
-diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
-new file mode 100644
-index 0000000..068cd7b
---- /dev/null
-+++ include/linux/if_vlan.h
-@@ -0,0 +1,61 @@
-+/*
-+ * VLAN		An implementation of 802.1Q VLAN tagging.
-+ *
-+ * Authors:	Ben Greear <greearb@candelatech.com>
-+ *
-+ *		This program is free software; you can redistribute it and/or
-+ *		modify it under the terms of the GNU General Public License
-+ *		as published by the Free Software Foundation; either version
-+ *		2 of the License, or (at your option) any later version.
-+ *
-+ */
-+
-+#ifndef _LINUX_IF_VLAN_H_
-+#define _LINUX_IF_VLAN_H_
-+
-+
-+/* VLAN IOCTLs are found in sockios.h */
-+
-+/* Passed in vlan_ioctl_args structure to determine behaviour. */
-+enum vlan_ioctl_cmds {
-+	ADD_VLAN_CMD,
-+	DEL_VLAN_CMD,
-+	SET_VLAN_INGRESS_PRIORITY_CMD,
-+	SET_VLAN_EGRESS_PRIORITY_CMD,
-+	GET_VLAN_INGRESS_PRIORITY_CMD,
-+	GET_VLAN_EGRESS_PRIORITY_CMD,
-+	SET_VLAN_NAME_TYPE_CMD,
-+	SET_VLAN_FLAG_CMD,
-+	GET_VLAN_REALDEV_NAME_CMD, /* If this works, you know it's a VLAN device, btw */
-+	GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
-+};
-+
-+enum vlan_flags {
-+	VLAN_FLAG_REORDER_HDR	= 0x1,
-+};
-+
-+enum vlan_name_types {
-+	VLAN_NAME_TYPE_PLUS_VID, /* Name will look like:  vlan0005 */
-+	VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like:  eth1.0005 */
-+	VLAN_NAME_TYPE_PLUS_VID_NO_PAD, /* Name will look like:  vlan5 */
-+	VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD, /* Name will look like:  eth0.5 */
-+	VLAN_NAME_TYPE_HIGHEST
-+};
-+
-+struct vlan_ioctl_args {
-+	int cmd; /* Should be one of the vlan_ioctl_cmds enum above. */
-+	char device1[24];
-+
-+        union {
-+		char device2[24];
-+		int VID;
-+		unsigned int skb_priority;
-+		unsigned int name_type;
-+		unsigned int bind_type;
-+		unsigned int flag; /* Matches vlan_dev_info flags */
-+        } u;
-+
-+	short vlan_qos;
-+};
-+
-+#endif /* !(_LINUX_IF_VLAN_H_) */
diff --git a/pkgs/os-specific/linux/libnl/v1.nix b/pkgs/os-specific/linux/libnl/v1.nix
deleted file mode 100644
index f3f7f3fa732..00000000000
--- a/pkgs/os-specific/linux/libnl/v1.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{stdenv, fetchurl, bison, flex}:
-
-stdenv.mkDerivation rec {
-  name = "libnl-1.1";
-
-  src = fetchurl {
-    url = "${meta.homepage}files/${name}.tar.gz";
-    sha256 = "1hzd48z8h8abkclq90wb7cciynpg3pwgyd0gzb5g12ndnv7s9kim";
-  };
-
-  buildInputs = [ bison flex ];
-  postConfigure = "type -tp flex";
-
-  patches = [
-    ./libnl-1.1-flags.patch
-    ./libnl-1.1-glibc-2.8-ULONG_MAX.patch
-    ./libnl-1.1-minor-leaks.patch
-    ./libnl-1.1-vlan-header.patch
-  ];
-
-  meta = {
-    homepage = "http://www.infradead.org/~tgr/libnl/";
-    description = "Linux NetLink interface library";
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/libnl/v2.nix b/pkgs/os-specific/linux/libnl/v2.nix
deleted file mode 100644
index cb5c022c3d4..00000000000
--- a/pkgs/os-specific/linux/libnl/v2.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv, fetchurl, bison, flex}:
-
-stdenv.mkDerivation rec {
-  name = "libnl-2.0";
-
-  src = fetchurl {
-    url = "${meta.homepage}files/${name}.tar.gz";
-    sha256 = "173sr25xpsakdvjcg62790v6kwcgxj5r0js2lx6hg89w7n8dqh2s";
-  };
-
-  buildInputs = [ bison flex ];
-
-  meta = {
-    homepage = "http://www.infradead.org/~tgr/libnl/";
-    description = "Linux NetLink interface library";
-    maintainers = [ stdenv.lib.maintainers.urkud ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/libselinux/default.nix b/pkgs/os-specific/linux/libselinux/default.nix
index 4be88a20e24..873065d5424 100644
--- a/pkgs/os-specific/linux/libselinux/default.nix
+++ b/pkgs/os-specific/linux/libselinux/default.nix
@@ -1,15 +1,34 @@
-{stdenv, fetchurl, libsepol}:
+{ stdenv, fetchurl, pkgconfig, libsepol, pcre }:
 
 stdenv.mkDerivation rec {
   name = "libselinux-${version}";
-  version = "2.0.98";
+  version = "2.1.12";
+  inherit (libsepol) se_release se_url;
 
   src = fetchurl {
-    url = "http://userspace.selinuxproject.org/releases/20101221/devel/${name}.tar.gz";
-    sha256 = "00irm7nyakgi4z8d6dlm6c70fkbl6rzk5w1w0ny2c564yw0d0dlz";
+    url = "${se_url}/${se_release}/libselinux-${version}.tar.gz";
+    sha256 = "17navgvljgq35bljzcdwjdj3khajc27s15binr51xkp0h29qgbcd";
   };
 
-  buildInputs = [ libsepol ];
+  patch_src = fetchurl {
+    url = "http://dev.gentoo.org/~swift/patches/libselinux/patchbundle-${name}-r2.tar.gz";
+    sha256 = "08zaas8iwyf4w9ll1ylyv4gril1nfarckd5h1l53563sxzyf7dqh";
+  };
+
+  patches = [ ./fPIC.patch ]; # libsemanage seems to need -fPIC everywhere
+
+  buildInputs = [ pkgconfig libsepol pcre ];
 
-  preBuild = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
+  prePatch = ''
+    tar xvf ${patch_src}
+    for p in gentoo-patches/*.patch; do
+      patch -p1 < "$p"
+    done
+  '';
+
+  preInstall = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
+
+  meta = {
+    inherit (libsepol.meta) homepage platforms maintainers;
+  };
 }
diff --git a/pkgs/os-specific/linux/libselinux/fPIC.patch b/pkgs/os-specific/linux/libselinux/fPIC.patch
new file mode 100644
index 00000000000..fdc1fa41a33
--- /dev/null
+++ b/pkgs/os-specific/linux/libselinux/fPIC.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile b/src/Makefile
+index ac019df..00432b9 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -132,7 +132,7 @@ $(AUDIT2WHYSO): $(AUDIT2WHYLOBJ)
+ 	$(CC) $(CFLAGS) $(LDFLAGS) -shared -o $@ $^ -L. -lselinux $(LIBDIR)/libsepol.a -L$(LIBDIR)
+ 
+ %.o:  %.c policy.h
+-	$(CC) $(CFLAGS) $(TLSFLAGS) -c -o $@ $<
++	$(CC) $(CFLAGS) $(TLSFLAGS) -fPIC -c -o $@ $<
+ 
+ %.lo:  %.c policy.h
+ 	$(CC) $(CFLAGS) -fPIC -DSHARED -c -o $@ $<
diff --git a/pkgs/os-specific/linux/libsemanage/default.nix b/pkgs/os-specific/linux/libsemanage/default.nix
index 22e177191a5..28908189cf3 100644
--- a/pkgs/os-specific/linux/libsemanage/default.nix
+++ b/pkgs/os-specific/linux/libsemanage/default.nix
@@ -2,24 +2,24 @@
 stdenv.mkDerivation rec {
 
   name = "libsemanage-${version}";
-  version = "2.0.46";
+  version = "2.1.9";
+  inherit (libsepol) se_release se_url;
 
   src = fetchurl {
-    url = "http://userspace.selinuxproject.org/releases/20101221/devel/${name}.tar.gz";
-    sha256 = "03ljdw48pn8vlk4h26w8z247c9wykp2198s1ksmxrai3avyz87wf";
+    url = "${se_url}/${se_release}/libsemanage-${version}.tar.gz";
+    sha256 = "1k1my3n1pj30c5887spykcdk1brgxfpxmrz6frxjyhaijxzx20bg";
   };
 
-  NIX_LDFLAGS = "-lsepol";
-
   makeFlags = "PREFIX=$(out) DESTDIR=$(out)";
 
+  NIX_CFLAGS_COMPILE = "-fstack-protector-all";
+  NIX_CFLAGS_LINK = "-lsepol";
+
   buildInputs = [ libsepol libselinux ustr bzip2 bison flex ];
 
   meta = with stdenv.lib; {
-    homepage = http://userspace.selinuxproject.org/;
+    inherit (libsepol.meta) homepage platforms maintainers;
     description = "Policy management tools for SELinux";
     license = licenses.lgpl21;
-    maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/os-specific/linux/libsepol/default.nix b/pkgs/os-specific/linux/libsepol/default.nix
index 1751994e3de..d41d1cbe752 100644
--- a/pkgs/os-specific/linux/libsepol/default.nix
+++ b/pkgs/os-specific/linux/libsepol/default.nix
@@ -1,13 +1,24 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libsepol-${version}";
-  version = "2.0.42";
+  version = "2.1.8";
+  se_release = "20120924";
+  se_url = "${meta.homepage}/releases";
 
   src = fetchurl {
-    url = "http://userspace.selinuxproject.org/releases/20101221/devel/${name}.tar.gz";
-    sha256 = "0sg61mb9qhyh4vplasar6nwd6j123v453zss93qws3h95fhrfc08";
+    url = "${se_url}/${se_release}/libsepol-${version}.tar.gz";
+    sha256 = "1w38q3lmha5m9aps9w844i51yw4b8q1vhpng2kdywn2n8cpdvvk3";
   };
 
   preBuild = '' makeFlags="$makeFlags PREFIX=$out DESTDIR=$out" '';
+
+  passthru = { inherit se_release se_url meta; };
+
+  meta = with stdenv.lib; {
+    homepage = http://userspace.selinuxproject.org;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.phreedom ];
+    license = "GPLv2";
+  };
 }
diff --git a/pkgs/os-specific/linux/lvm2/assume-uevent-generated.patch b/pkgs/os-specific/linux/lvm2/assume-uevent-generated.patch
new file mode 100644
index 00000000000..4098d042fd5
--- /dev/null
+++ b/pkgs/os-specific/linux/lvm2/assume-uevent-generated.patch
@@ -0,0 +1,39 @@
+Work around LVM/cryptsetup errors like:
+
+  semid 32768: semop failed for cookie 0xd4d41f4: incorrect semaphore state
+  Failed to set a proper state for notification semaphore identified by cookie value 223166964 (0xd4d41f4) to initialize waiting for incoming notifications.
+
+and (when running "cryptsetup --debug"):
+
+  Uevent not generated! Calling udev_complete internally to avoid process lock-up.
+
+Here for some reason libdm *thinks* that the uevent hasn't been
+emitted, so it calls udev_complete.  But the uevent actually *has*
+been emitted, so udev calls ‘dmsetup udevcomplete’ as well, leading to
+a race.
+
+This is probably a reoccurence of the problem described here:
+
+  http://www.redhat.com/archives/dm-devel/2011-August/msg00075.html
+  http://www.redhat.com/archives/linux-lvm/2011-September/msg00023.html
+
+which was fixed in the kernel, so it's not clear why it's surfacing
+again.  Maybe netlink_broadcast_filtered() has started returning some
+other bogus error code.
+  
+diff -ru -x '*~' LVM2.2.02.98/libdm/ioctl/libdm-iface.c LVM2.2.02.98-new/libdm/ioctl/libdm-iface.c
+--- LVM2.2.02.98/libdm/ioctl/libdm-iface.c	2012-10-15 10:24:58.000000000 -0400
++++ LVM2.2.02.98-new/libdm/ioctl/libdm-iface.c	2012-10-15 14:19:06.774363736 -0400
+@@ -1754,9 +1754,12 @@
+ 
+ 	if (ioctl_with_uevent && dm_udev_get_sync_support() &&
+ 	    !_check_uevent_generated(dmi)) {
++		log_debug("warning: Uevent might not be generated!");
++#if 0
+ 		log_debug("Uevent not generated! Calling udev_complete "
+ 			  "internally to avoid process lock-up.");
+ 		_udev_complete(dmt);
++#endif
+ 	}
+ 
+ 	if (!_dm_ioctl_unmangle_names(dmt->type, dmi))
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index 1ebebfd634b..ec68304c935 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, udev, utillinux, coreutils }:
 
 let
-  v = "2.02.97";
+  v = "2.02.98";
 in
 
 stdenv.mkDerivation {
@@ -9,9 +9,11 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "ftp://sources.redhat.com/pub/lvm2/old/LVM2.${v}.tgz";
-    sha256 = "0azwa555dgvixbdw055yj8cj1q6kd0a36nms005iz7la5q0q5npd";
+    sha256 = "0r6q6z8ip6q5qgkzng0saljassp4912k6i21ra10vq7pzrc0l0vi";
   };
 
+  patches = [ ./assume-uevent-generated.patch ];
+
   configureFlags =
     "--disable-readline --enable-udev_rules --enable-udev_sync --enable-pkgconfig --enable-applib";
 
diff --git a/pkgs/applications/virtualization/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix
index 26180b84368..c2a9deaa11f 100644
--- a/pkgs/applications/virtualization/lxc/default.nix
+++ b/pkgs/os-specific/linux/lxc/default.nix
@@ -1,37 +1,33 @@
-{ stdenv, fetchurl, libcap, perl, docbook2x, docbook_xml_dtd_45 }:
+{ stdenv, fetchurl, libcap, apparmor, perl, docbook2x, docbook_xml_dtd_45 }:
 
-let
-  name = "lxc-0.7.5";
-in
-stdenv.mkDerivation{
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "lxc-0.9.0";
 
   src = fetchurl {
     url = "http://lxc.sf.net/download/lxc/${name}.tar.gz";
-    sha256 = "019ec63f250c874bf7625b1f1bf555b1a6e3a947937a4fca73100abddf829b1c";
+    sha256 = "0821clxymkgp71n720xj5ngs22s2v8jks68f5j4vypycwvm6f5qy";
   };
 
-  buildInputs = [ libcap perl docbook2x ];
+  buildInputs = [ libcap apparmor perl docbook2x ];
 
   patches = [
-   ./dont-run-ldconfig.patch
-   ./fix-documentation-build.patch
-   ./fix-sgml-documentation.patch
+    ./dont-run-ldconfig.patch
+    ./install-localstatedir-in-store.patch
+    ./support-db2x.patch
   ];
 
   preConfigure = "export XML_CATALOG_FILES=${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
 
-  configureFlags = "--localstatedir=/var";
-
-  postInstall = ''
-    cd "$out/lib"
-    lib=liblxc.so.?.*
-    ln -s $lib $(echo $lib | sed -re 's/(liblxc[.]so[.].)[.].*/\1/')
-  '';
+  configureFlags = [
+    "--localstatedir=/var"
+    "--enable-doc"
+    "--enable-tests"
+    "--enable-apparmor"
+  ];
 
   meta = {
     homepage = "http://lxc.sourceforge.net";
-    description = "lightweight virtual system mechanism";
+    description = "userspace tools for Linux Containers, a lightweight virtualization system";
     license = stdenv.lib.licenses.lgpl21Plus;
 
     longDescription = ''
@@ -42,7 +38,6 @@ stdenv.mkDerivation{
       mechanisms to Linux’s existing process management infrastructure.
     '';
 
-
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
diff --git a/pkgs/os-specific/linux/lxc/dont-run-ldconfig.patch b/pkgs/os-specific/linux/lxc/dont-run-ldconfig.patch
new file mode 100644
index 00000000000..6904eec5175
--- /dev/null
+++ b/pkgs/os-specific/linux/lxc/dont-run-ldconfig.patch
@@ -0,0 +1,22 @@
+diff -ubr lxc-0.9.0-orig/src/lxc/Makefile.am lxc-0.9.0/src/lxc/Makefile.am
+--- lxc-0.9.0-orig/src/lxc/Makefile.am	2013-04-15 10:50:22.898102973 +0200
++++ lxc-0.9.0/src/lxc/Makefile.am	2013-04-15 10:50:44.264862808 +0200
+@@ -193,7 +193,6 @@
+ 	mkdir -p $(DESTDIR)$(datadir)/lxc
+ 	install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
+ 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
+-	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
+ 	cd $(DESTDIR)$(libdir); \
+ 	ln -sf liblxc.so.$(VERSION) liblxc.so.$(firstword $(subst ., ,$(VERSION))); \
+ 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
+diff -ubr lxc-0.9.0-orig/src/lxc/Makefile.in lxc-0.9.0/src/lxc/Makefile.in
+--- lxc-0.9.0-orig/src/lxc/Makefile.in	2013-04-15 10:50:22.898102973 +0200
++++ lxc-0.9.0/src/lxc/Makefile.in	2013-04-15 10:51:08.755810177 +0200
+@@ -1519,7 +1519,6 @@
+ 	mkdir -p $(DESTDIR)$(datadir)/lxc
+ 	install -c -m 644 lxc.functions $(DESTDIR)$(datadir)/lxc
+ 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
+-	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
+ 	cd $(DESTDIR)$(libdir); \
+ 	ln -sf liblxc.so.$(VERSION) liblxc.so.$(firstword $(subst ., ,$(VERSION))); \
+ 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
diff --git a/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch b/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch
new file mode 100644
index 00000000000..061875aa3b6
--- /dev/null
+++ b/pkgs/os-specific/linux/lxc/install-localstatedir-in-store.patch
@@ -0,0 +1,28 @@
+diff -ubr lxc-0.9.0-orig/Makefile.am lxc-0.9.0/Makefile.am
+--- lxc-0.9.0-orig/Makefile.am	2013-04-15 10:50:22.899103057 +0200
++++ lxc-0.9.0/Makefile.am	2013-04-15 10:58:41.189504254 +0200
+@@ -25,8 +25,8 @@
+ pcdata_DATA = lxc.pc
+ 
+ install-data-local:
+-	$(MKDIR_P) $(DESTDIR)$(LXCPATH)
+-	$(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/lxc
++	$(MKDIR_P) $(out)$(LXCPATH)
++	$(MKDIR_P) $(out)$(localstatedir)/cache/lxc
+ 
+ ChangeLog::
+ 	@touch ChangeLog
+diff -ubr lxc-0.9.0-orig/Makefile.in lxc-0.9.0/Makefile.in
+--- lxc-0.9.0-orig/Makefile.in	2013-04-15 10:50:22.899103057 +0200
++++ lxc-0.9.0/Makefile.in	2013-04-15 10:58:58.817870957 +0200
+@@ -805,8 +805,8 @@
+ 
+ 
+ install-data-local:
+-	$(MKDIR_P) $(DESTDIR)$(LXCPATH)
+-	$(MKDIR_P) $(DESTDIR)$(localstatedir)/cache/lxc
++	$(MKDIR_P) $(out)$(LXCPATH)
++	$(MKDIR_P) $(out)$(localstatedir)/cache/lxc
+ 
+ ChangeLog::
+ 	@touch ChangeLog
diff --git a/pkgs/os-specific/linux/lxc/support-db2x.patch b/pkgs/os-specific/linux/lxc/support-db2x.patch
new file mode 100644
index 00000000000..8be7f5f0a92
--- /dev/null
+++ b/pkgs/os-specific/linux/lxc/support-db2x.patch
@@ -0,0 +1,29 @@
+diff -ubr lxc-0.9.0-orig/configure lxc-0.9.0/configure
+--- lxc-0.9.0-orig/configure	2013-04-15 10:50:22.899103057 +0200
++++ lxc-0.9.0/configure	2013-04-15 11:08:08.696539776 +0200
+@@ -4792,7 +4792,7 @@
+ 
+ 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for docbook2x-man" >&5
+ $as_echo_n "checking for docbook2x-man... " >&6; }
+-	for name in docbook2x-man db2x_docbook2man; do
++	for name in docbook2x-man db2x_docbook2man docbook2man; do
+ 		if "$name" --help >/dev/null 2>&1; then
+ 			db2xman="$name"
+ 			break;
+@@ -8353,4 +8353,3 @@
+   { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+ fi
+-
+diff -ubr lxc-0.9.0-orig/configure.ac lxc-0.9.0/configure.ac
+--- lxc-0.9.0-orig/configure.ac	2013-04-15 10:50:22.896102806 +0200
++++ lxc-0.9.0/configure.ac	2013-04-15 11:07:52.399582819 +0200
+@@ -67,7 +67,7 @@
+ 	db2xman=""
+ 
+ 	AC_MSG_CHECKING(for docbook2x-man)
+-	for name in docbook2x-man db2x_docbook2man; do
++	for name in docbook2x-man db2x_docbook2man docbook2man; do
+ 		if "$name" --help >/dev/null 2>&1; then
+ 			db2xman="$name"
+ 			break;
diff --git a/pkgs/os-specific/linux/mcelog/default.nix b/pkgs/os-specific/linux/mcelog/default.nix
index 82c502ede72..b60b6134fdd 100644
--- a/pkgs/os-specific/linux/mcelog/default.nix
+++ b/pkgs/os-specific/linux/mcelog/default.nix
@@ -25,9 +25,13 @@ in stdenv.mkDerivation {
 
   makeFlags = "prefix=$(out) etcprefix=$(out) DOCDIR=$(out)/share/doc";
 
+  preInstall = ''
+    ensureDir $out/share/doc
+  '';
+
   meta = {
     description = "Tool to display logged machine check exceptions";
     homepage = http://mcelog.org/;
     license = stdenv.lib.licenses.gpl2;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/os-specific/linux/mdadm/default.nix b/pkgs/os-specific/linux/mdadm/default.nix
index a88107ae73d..1653c018ce1 100644
--- a/pkgs/os-specific/linux/mdadm/default.nix
+++ b/pkgs/os-specific/linux/mdadm/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   # Enable incremental activation of swraid arrays from udev.
   patches = [ ./udev.patch ];
 
-  buildNativeInputs = [ groff ];
+  nativeBuildInputs = [ groff ];
 
   preConfigure = "sed -e 's@/lib/udev@\${out}/lib/udev@' -e 's@ -Werror @ @' -i Makefile";
 
diff --git a/pkgs/os-specific/linux/microcode/converter.nix b/pkgs/os-specific/linux/microcode/converter.nix
index 7b1ff08be0c..49babc6ca57 100644
--- a/pkgs/os-specific/linux/microcode/converter.nix
+++ b/pkgs/os-specific/linux/microcode/converter.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "microcode2ucode-20120205";
   src = fetchurl {
-    url = "sources.gentoo.org/sys-apps/microcode-data/files/intel-microcode2ucode.c";
+    url = "http://pkgs.fedoraproject.org/repo/pkgs/microcode_ctl/intel-microcode2ucode.c/0efc5f6c74a4d7e61ca22683c93c98cf/intel-microcode2ucode.c";
     sha256 = "c51b1b1d8b4b28e7d5d007917c1e444af1a2ff04a9408aa9067c0e57d70164de";
   };
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   buildPhase = ''
     gcc -Wall -O2 $src -o intel-microcode2ucode
   '';
-  
+
   installPhase = ''
     ensureDir "$out/bin"
     cp intel-microcode2ucode "$out/bin/"
diff --git a/pkgs/os-specific/linux/module-init-tools/default.nix b/pkgs/os-specific/linux/module-init-tools/default.nix
index 077d08f899d..240150b09dd 100644
--- a/pkgs/os-specific/linux/module-init-tools/default.nix
+++ b/pkgs/os-specific/linux/module-init-tools/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation {
 
   src = [
     (fetchurl {
-      url = mirror://kernel/linux/utils/kernel/module-init-tools/module-init-tools-3.16.tar.bz2;
+      url = http://ftp.be.debian.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.16.tar.bz2;
       sha256 = "0jxnz9ahfic79rp93l5wxcbgh4pkv85mwnjlbv1gz3jawv5cvwp1";
     })
 
diff --git a/pkgs/os-specific/linux/modutils/default.nix b/pkgs/os-specific/linux/modutils/default.nix
deleted file mode 100644
index 3a063408a2f..00000000000
--- a/pkgs/os-specific/linux/modutils/default.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{stdenv, fetchurl, bison, flex}:
-
-stdenv.mkDerivation {
-  name = "modutils-2.4.27";
-  src = fetchurl {
-    url = mirror://kernel/linux/utils/kernel/modutils/v2.4/modutils-2.4.27.tar.bz2;
-    md5 = "bac989c74ed10f3bf86177fc5b4b89b6";
-  };
-  buildInputs = [bison flex];
-}
diff --git a/pkgs/os-specific/linux/mountall/default.nix b/pkgs/os-specific/linux/mountall/default.nix
index 67d7801fdb2..4cad810cc5f 100644
--- a/pkgs/os-specific/linux/mountall/default.nix
+++ b/pkgs/os-specific/linux/mountall/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, autoconf, automake, libtool, gettext }:
+{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, gettext, autoreconfHook }:
 
 stdenv.mkDerivation {
   name = "mountall-2.35";
@@ -10,9 +10,7 @@ stdenv.mkDerivation {
 
   patches = [ ./no-plymouth.patch ./fix-usr1-race.patch ];
 
-  preConfigure = "rm -R aclocal.m4; gettextize -f; autoreconf -vfi";
-
-  buildInputs = [ pkgconfig libnih dbus.libs udev autoconf automake libtool gettext ];
+  buildInputs = [ pkgconfig libnih dbus.libs udev gettext autoreconfHook ];
 
   makeFlags = "initramfshookdir=$(out)/share/initramfs-tools/hooks upstart_jobs_initramfs_configdir=$(out)/share/initramfs-tools/event-driven/upstart-jobs";
 
diff --git a/pkgs/os-specific/linux/ndiswrapper/default.nix b/pkgs/os-specific/linux/ndiswrapper/default.nix
index c41649e0285..109faac97c5 100644
--- a/pkgs/os-specific/linux/ndiswrapper/default.nix
+++ b/pkgs/os-specific/linux/ndiswrapper/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, kernel, perl }:
+{ stdenv, fetchurl, kernelDev, perl }:
 
 stdenv.mkDerivation {
-  name = "ndiswrapper-1.56-${kernel.version}";
+  name = "ndiswrapper-1.56-${kernelDev.version}";
 
   # need at least .config and include 
-  inherit kernel;
+  kernel = kernelDev;
 
   buildPhase = "
     echo make KBUILD=$(echo \$kernel/lib/modules/*/build);
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     sha256 = "10yqg1a08v6z1qm1qr1v4rbhl35c90gzrazapr09vp372hky8f57";
   };
 
-  buildInputs = [ kernel perl ];
+  buildInputs = [ kernelDev perl ];
 
   # this is a patch against svn head, not stable version
   patches = [./prefix.patch];
diff --git a/pkgs/os-specific/linux/net-tools/config.h b/pkgs/os-specific/linux/net-tools/config.h
index b060bea12c2..dedaac6247d 100644
--- a/pkgs/os-specific/linux/net-tools/config.h
+++ b/pkgs/os-specific/linux/net-tools/config.h
@@ -38,6 +38,7 @@
 #define HAVE_AFECONET 0
 #define HAVE_AFDECnet 0
 #define HAVE_AFASH 0
+#define HAVE_AFBLUETOOTH 0
 
 /* 
  * 
@@ -49,20 +50,23 @@
 #define HAVE_HWSLIP 1
 #define HAVE_HWPPP 1
 #define HAVE_HWTUNNEL 1
-#define HAVE_HWSTRIP 1
-#define HAVE_HWTR 1
+#define HAVE_HWSTRIP 0
+#define HAVE_HWTR 0
 #define HAVE_HWAX25 0
 #define HAVE_HWROSE 0
 #define HAVE_HWNETROM 1
 #define HAVE_HWX25 0
 #define HAVE_HWFR 1
-#define HAVE_HWSIT 0
+#define HAVE_HWSIT 1
 #define HAVE_HWFDDI 0
 #define HAVE_HWHIPPI 0
 #define HAVE_HWASH 0
 #define HAVE_HWHDLCLAPB 0
 #define HAVE_HWIRDA 1
 #define HAVE_HWEC 0
+#define HAVE_HWEC 0
+#define HAVE_HWEUI64 1
+#define HAVE_HWIB 1
 
 /* 
  * 
@@ -72,3 +76,4 @@
 #define HAVE_FW_MASQUERADE 0
 #define HAVE_IP_TOOLS 0
 #define HAVE_MII 0
+#define HAVE_SELINUX 0
diff --git a/pkgs/os-specific/linux/net-tools/default.nix b/pkgs/os-specific/linux/net-tools/default.nix
index 59af976a71b..9386b50969f 100644
--- a/pkgs/os-specific/linux/net-tools/default.nix
+++ b/pkgs/os-specific/linux/net-tools/default.nix
@@ -1,15 +1,13 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "net-tools-1.60";
-  
+stdenv.mkDerivation rec {
+  name = "net-tools-1.60_p20120127084908";
+
   src = fetchurl {
-    url = http://www.tazenda.demon.co.uk/phil/net-tools/net-tools-1.60.tar.bz2;
-    md5 = "888774accab40217dde927e21979c165";
+    url = "mirror://gentoo/distfiles/${name}.tar.xz";
+    sha256 = "408a51964aa142a4f45c4cffede2478abbd5630a7c7346ba0d3611059a2a3c94";
   };
 
-  patches = [ ./net-tools-labels.patch ];
-  
   preBuild =
     ''
       cp ${./config.h} config.h
diff --git a/pkgs/os-specific/linux/net-tools/net-tools-labels.patch b/pkgs/os-specific/linux/net-tools/net-tools-labels.patch
deleted file mode 100644
index 82c3a27d9c6..00000000000
--- a/pkgs/os-specific/linux/net-tools/net-tools-labels.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff -ruN net-tools-1.60/hostname.c net-tools-1.60-new/hostname.c
---- net-tools-1.60/hostname.c	2001-04-08 19:04:23.000000000 +0200
-+++ net-tools-1.60-new/hostname.c	2004-12-17 14:48:15.624174382 +0100
-@@ -98,6 +98,7 @@
- 	    fprintf(stderr, _("%s: name too long\n"), program_name);
- 	    break;
- 	default:
-+	    break;
- 	}
- 	exit(1);
-     };
-@@ -117,6 +118,7 @@
- 	    fprintf(stderr, _("%s: name too long\n"), program_name);
- 	    break;
- 	default:
-+	    break;
- 	}
- 	exit(1);
-     };
-@@ -174,6 +176,7 @@
- 	printf("%s\n", hp->h_name);
- 	break;
-     default:
-+	break;
-     }
- }
- 
-diff -ruN net-tools-1.60/lib/inet_sr.c net-tools-1.60-new/lib/inet_sr.c
---- net-tools-1.60/lib/inet_sr.c	2000-02-20 22:46:45.000000000 +0100
-+++ net-tools-1.60-new/lib/inet_sr.c	2004-12-17 14:37:15.416349441 +0100
-@@ -105,6 +105,7 @@
-     case 2:
-        isnet = 0; break;
-     default:
-+	break;
-     }
- 
-     /* Fill in the other fields. */
diff --git a/pkgs/os-specific/linux/netatop/default.nix b/pkgs/os-specific/linux/netatop/default.nix
new file mode 100644
index 00000000000..4ca8235f3ae
--- /dev/null
+++ b/pkgs/os-specific/linux/netatop/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, kernelDev, zlib }:
+
+stdenv.mkDerivation {
+  name = "netatop-${kernelDev.version}-0.2";
+
+  src = fetchurl {
+    url = http://www.atoptool.nl/download/netatop-0.2.tar.gz;
+    sha256 = "0ya4qys2qpw080sbgixyx1kawdx1c3smnxwmqcchn0hg9hhndvc0";
+  };
+
+  buildInputs = [ zlib ];
+
+  preConfigure = ''
+    patchShebangs mkversion
+    sed -i -e 's,^KERNDIR.*,KERNDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build,' \
+        */Makefile
+    sed -i -e 's,/lib/modules.*extra,'$out'/lib/modules/${kernelDev.modDirVersion}/extra,' \
+        -e s,/usr,$out, \
+        -e /init.d/d \
+        -e /depmod/d \
+        Makefile
+  '';
+
+  preInstall = ''
+    ensureDir $out/bin $out/share/man/man{4,8}
+    ensureDir $out/lib/modules/${kernelDev.modDirVersion}/extra
+  '';
+      
+  meta = {
+    description = "Network monitoring module for atop";
+    homepage = http://www.atoptool.nl/downloadnetatop.php;
+    license = "GPL2";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix
index 6429d8092cf..42bacd41be0 100644
--- a/pkgs/os-specific/linux/nfs-utils/default.nix
+++ b/pkgs/os-specific/linux/nfs-utils/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, tcpWrapper, utillinux, libcap, libtirpc, libevent, libnfsidmap
+{ fetchurl, stdenv, tcp_wrappers, utillinux, libcap, libtirpc, libevent, libnfsidmap
 , lvm2, e2fsprogs }:
 
 stdenv.mkDerivation rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ tcpWrapper utillinux libcap libtirpc libevent libnfsidmap
+    [ tcp_wrappers utillinux libcap libtirpc libevent libnfsidmap
       lvm2 e2fsprogs
     ];
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     '';
 
   # One test fails on mips.
-  doCheck = if stdenv.isMips then false else true;
+  doCheck = !stdenv.isMips;
 
   meta = {
     description = "Linux user-space NFS utilities";
diff --git a/pkgs/os-specific/linux/nss_ldap/crashes.patch b/pkgs/os-specific/linux/nss_ldap/crashes.patch
new file mode 100644
index 00000000000..48250141e82
--- /dev/null
+++ b/pkgs/os-specific/linux/nss_ldap/crashes.patch
@@ -0,0 +1,104 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=488857
+
+
+Distinguish between contexts that are somewhat persistent and one-offs
+which are used to fulfill part of a larger request.
+
+diff -up nss_ldap-253/ldap-grp.c nss_ldap-253/ldap-grp.c
+--- nss_ldap-253/ldap-grp.c	2009-05-08 13:30:43.000000000 -0400
++++ nss_ldap-253/ldap-grp.c	2009-05-08 13:34:41.000000000 -0400
+@@ -857,7 +857,7 @@ ng_chase (const char *dn, ldap_initgroup
+   LA_STRING (a) = dn;
+   LA_TYPE (a) = LA_TYPE_STRING;
+ 
+-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
++  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
+     {
+       return NSS_UNAVAIL;
+     }
+@@ -930,7 +930,7 @@ ng_chase_backlink (const char ** members
+   LA_STRING_LIST (a) = filteredMembersOf;
+   LA_TYPE (a) = LA_TYPE_STRING_LIST_OR;
+ 
+-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
++  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
+     {
+       free (filteredMembersOf);
+       return NSS_UNAVAIL;
+diff -up nss_ldap-253/ldap-netgrp.c nss_ldap-253/ldap-netgrp.c
+--- nss_ldap-253/ldap-netgrp.c	2009-05-08 13:31:35.000000000 -0400
++++ nss_ldap-253/ldap-netgrp.c	2009-05-08 13:33:14.000000000 -0400
+@@ -691,7 +691,7 @@ do_innetgr_nested (ldap_innetgr_args_t *
+   LA_TYPE (a) = LA_TYPE_STRING;
+   LA_STRING (a) = nested;	/* memberNisNetgroup */
+ 
+-  if (_nss_ldap_ent_context_init_locked (&ctx) == NULL)
++  if (_nss_ldap_ent_context_init_internal_locked (&ctx) == NULL)
+     {
+       debug ("<== do_innetgr_nested: failed to initialize context");
+       return NSS_UNAVAIL;
+diff -up nss_ldap-253/ldap-nss.c nss_ldap-253/ldap-nss.c
+--- nss_ldap-253/ldap-nss.c	2009-05-08 13:27:17.000000000 -0400
++++ nss_ldap-253/ldap-nss.c	2009-05-08 14:05:51.000000000 -0400
+@@ -1961,6 +1961,7 @@ _nss_ldap_ent_context_init_locked (ent_c
+ 	  debug ("<== _nss_ldap_ent_context_init_locked");
+ 	  return NULL;
+ 	}
++      ctx->ec_internal = 0;
+       *pctx = ctx;
+     }
+   else
+@@ -1990,6 +1991,15 @@ _nss_ldap_ent_context_init_locked (ent_c
+ 
+   return ctx;
+ }
++ent_context_t *
++_nss_ldap_ent_context_init_internal_locked (ent_context_t ** pctx)
++{
++  ent_context_t *ctx;
++  ctx = _nss_ldap_ent_context_init_locked (pctx);
++  if (ctx != NULL)
++    ctx->ec_internal = 1;
++  return ctx;
++}
+ 
+ /*
+  * Clears a given context; we require the caller
+@@ -2031,7 +2041,8 @@ _nss_ldap_ent_context_release (ent_conte
+ 
+   LS_INIT (ctx->ec_state);
+ 
+-  if (_nss_ldap_test_config_flag (NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT))
++  if (!ctx->ec_internal &&
++      _nss_ldap_test_config_flag (NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT))
+     {
+       do_close ();
+     }
+diff -up nss_ldap-253/ldap-nss.h nss_ldap-253/ldap-nss.h
+--- nss_ldap-253/ldap-nss.h	2009-05-08 13:35:47.000000000 -0400
++++ nss_ldap-253/ldap-nss.h	2009-05-08 13:52:25.000000000 -0400
+@@ -560,6 +560,8 @@ struct ent_context
+   ldap_state_t ec_state;	/* eg. for services */
+   int ec_msgid;			/* message ID */
+   LDAPMessage *ec_res;		/* result chain */
++  int ec_internal;		/* this context is just a part of a larger
++				 * query for information */
+   ldap_service_search_descriptor_t *ec_sd;	/* current sd */
+   struct berval *ec_cookie;     /* cookie for paged searches */
+ };
+@@ -744,6 +746,15 @@ ent_context_t *_nss_ldap_ent_context_ini
+ ent_context_t *_nss_ldap_ent_context_init_locked (ent_context_t **);
+ 
+ /*
++ * _nss_ldap_ent_context_init_internal_locked() has the same
++ * behaviour, except it marks the context as one that's being
++ * used to fetch additional data used in answering a request, i.e.
++ * that this isn't the "main" context
++ */
++
++ent_context_t *_nss_ldap_ent_context_init_internal_locked (ent_context_t **);
++
++/*
+  * _nss_ldap_ent_context_release() is used to manually free a context 
+  */
+ void _nss_ldap_ent_context_release (ent_context_t *);
diff --git a/pkgs/os-specific/linux/nss_ldap/default.nix b/pkgs/os-specific/linux/nss_ldap/default.nix
index 7c8b526b4c3..cc0382b58f4 100644
--- a/pkgs/os-specific/linux/nss_ldap/default.nix
+++ b/pkgs/os-specific/linux/nss_ldap/default.nix
@@ -1,13 +1,24 @@
-{stdenv, fetchurl, openldap}:
+{stdenv, fetchurl, openldap, perl}:
    
 stdenv.mkDerivation {
-  name = "nss_ldap-260";
+  name = "nss_ldap-265";
    
   src = fetchurl {
-    url = http://www.padl.com/download/nss_ldap-260.tar.gz;
-    sha256 = "0kn022js39mqmy7g5ba911q46223vk7vcf51x28rbl86lp32zv4v";
+    url = http://www.padl.com/download/nss_ldap-265.tar.gz;
+    sha256 = "1a16q9p97d2blrj0h6vl1xr7dg7i4s8x8namipr79mshby84vdbp";
   };
 
+  preConfigure = ''
+    patchShebangs ./vers_string
+    sed -i s,vers_string,./vers_string, Makefile*
+  '';
+
+  patches = [ ./crashes.patch ];
+
+  postPatch = ''
+    patch -p0 < ${./nss_ldap-265-glibc-2.16.patch}
+  '';
+
   preInstall = ''
     installFlagsArray=(INST_UID=$(id -u) INST_GID=$(id -g) LIBC_VERS=2.5 NSS_VERS=2 NSS_LDAP_PATH_CONF=$out/etc/ldap.conf)
     substituteInPlace Makefile \
@@ -16,5 +27,5 @@ stdenv.mkDerivation {
     mkdir -p $out/etc
   '';
 
-  buildInputs = [openldap];
+  buildInputs = [ openldap perl ];
 }
diff --git a/pkgs/os-specific/linux/nss_ldap/nss_ldap-265-glibc-2.16.patch b/pkgs/os-specific/linux/nss_ldap/nss_ldap-265-glibc-2.16.patch
new file mode 100644
index 00000000000..8b0b9289327
--- /dev/null
+++ b/pkgs/os-specific/linux/nss_ldap/nss_ldap-265-glibc-2.16.patch
@@ -0,0 +1,139 @@
+https://github.com/archlinuxarm/PKGBUILDs/issues/296
+
+Fixes the bug causing a segfault on nscd and sshd:
+symbol lookup error: /usr/lib/libnss_ldap.so.2: undefined symbol: __libc_lock_lock
+
+--- ldap-nss.c.orig	2012-10-17 12:32:03.908730283 +0000
++++ ldap-nss.c	2012-10-17 12:38:10.906767283 +0000
+@@ -148,7 +148,7 @@
+  */
+ static ldap_session_t __session = { NULL, NULL, 0, LS_UNINITIALIZED };
+ 
+-#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE___LIBC_ONCE)
+ static pthread_once_t __once = PTHREAD_ONCE_INIT;
+ #endif
+ 
+@@ -168,7 +168,7 @@
+ static int __ssl_initialized = 0;
+ #endif /* HAVE_LDAPSSL_CLIENT_INIT */
+ 
+-#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE___LIBC_ONCE)
+ /*
+  * Prepare for fork(); lock mutex.
+  */
+@@ -519,7 +519,7 @@
+ }
+ #endif /* HAVE_NSSWITCH_H */
+ 
+-#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#if defined(HAVE_PTHREAD_ATFORK) || defined(HAVE___LIBC_ONCE)
+ static void
+ do_atfork_prepare (void)
+ {
+@@ -553,7 +553,7 @@
+ #ifdef HAVE_PTHREAD_ATFORK
+   (void) pthread_atfork (do_atfork_prepare, do_atfork_parent,
+ 			 do_atfork_child);
+-#elif defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#elif defined(HAVE___LIBC_ATFORK)
+   (void) __libc_atfork (do_atfork_prepare, do_atfork_parent, do_atfork_child);
+ #endif
+ 
+@@ -1119,7 +1119,7 @@
+     }
+ 
+ #ifndef HAVE_PTHREAD_ATFORK
+-#if defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#if defined(HAVE___LIBC_ONCE)
+   /*
+    * This bogosity is necessary because Linux uses different
+    * PIDs for different threads (like IRIX, which we don't
+@@ -1151,7 +1151,7 @@
+     pid = -1;			/* linked against libpthreads, don't care */
+ #else
+   pid = getpid ();
+-#endif /* HAVE_LIBC_LOCK_H || HAVE_BITS_LIBC_LOCK_H */
++#endif /* HAVE___LIBC_ONCE */
+ #endif /* HAVE_PTHREAD_ATFORK */
+ 
+   euid = geteuid ();
+@@ -1161,7 +1161,7 @@
+   syslog (LOG_DEBUG,
+ 	  "nss_ldap: __session.ls_state=%d, __session.ls_conn=%p, __euid=%i, euid=%i",
+ 	  __session.ls_state, __session.ls_conn, __euid, euid);
+-#elif defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#elif defined(HAVE___LIBC_ONCE)
+   syslog (LOG_DEBUG,
+ 	  "nss_ldap: libpthreads=%s, __session.ls_state=%d, __session.ls_conn=%p, __pid=%i, pid=%i, __euid=%i, euid=%i",
+  	  ((__pthread_once == NULL || __pthread_atfork == NULL) ? "FALSE" : "TRUE"),
+@@ -1185,11 +1185,11 @@
+     }
+   else
+ #ifndef HAVE_PTHREAD_ATFORK
+-#if defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#if defined(HAVE___LIBC_ONCE)
+   if ((__pthread_once == NULL || __pthread_atfork == NULL) && __pid != pid)
+ #else
+   if (__pid != pid)
+-#endif /* HAVE_LIBC_LOCK_H || HAVE_BITS_LIBC_LOCK_H */
++#endif /* HAVE___LIBC_ONCE */
+     {
+       do_close_no_unbind ();
+     }
+@@ -1250,9 +1250,9 @@
+       debug ("<== do_init (pthread_once failed)");
+       return NSS_UNAVAIL;
+     }
+-#elif defined(HAVE_PTHREAD_ATFORK) && ( defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H) )
++#elif defined(HAVE_PTHREAD_ATFORK) && defined(HAVE___LIBC_ONCE)
+   __libc_once (__once, do_atfork_setup);
+-#elif defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#elif defined(HAVE___LIBC_ONCE)
+   /*
+    * Only install the pthread_atfork() handlers i
+    * we are linked against libpthreads. Otherwise,
+--- ldap-nss.h.orig	2012-10-17 12:33:05.681379283 +0000
++++ ldap-nss.h	2012-10-17 12:34:06.337050753 +0000
+@@ -671,7 +671,7 @@
+ #define NSS_LDAP_LOCK(m)		mutex_lock(&m)
+ #define NSS_LDAP_UNLOCK(m)		mutex_unlock(&m)
+ #define NSS_LDAP_DEFINE_LOCK(m)		static mutex_t m = DEFAULTMUTEX
+-#elif defined(HAVE_LIBC_LOCK_H) || defined(HAVE_BITS_LIBC_LOCK_H)
++#elif defined(HAVE___LIBC_LOCK_LOCK) && defined(HAVE___LIBC_LOCK_UNLOCK)
+ #define NSS_LDAP_LOCK(m)		__libc_lock_lock(m)
+ #define NSS_LDAP_UNLOCK(m)		__libc_lock_unlock(m)
+ #define NSS_LDAP_DEFINE_LOCK(m)		static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER
+--- ldap-nss.c.orig	2012-10-17 12:58:20.270783283 +0000
++++ ldap-nss.c	2012-10-17 12:58:43.699267283 +0000
+@@ -156,7 +156,7 @@
+ static FILE *__debugfile;
+ #endif /* LBER_OPT_LOG_PRINT_FILE */
+ 
+-#ifndef HAVE_PTHREAD_ATFORK
++#if !defined(HAVE_PTHREAD_ATFORK) || !defined(HAVE___LIBC_ONCE)
+ /* 
+  * Process ID that opened the session.
+  */
+--- configure.in.orig	2012-10-17 12:59:31.707235283 +0000
++++ configure.in	2012-10-17 13:00:15.854289283 +0000
+@@ -255,6 +255,7 @@
+ AC_CHECK_FUNCS(pthread_once)
+ AC_CHECK_FUNCS(ether_aton)
+ AC_CHECK_FUNCS(ether_ntoa)
++AC_CHECK_FUNCS(__libc_once __libc_atfork __libc_lock_lock __libc_lock_unlock)
+ 
+ AC_MSG_CHECKING(for struct ether_addr)
+ AC_TRY_COMPILE([#include <sys/types.h>
+--- ldap-nss.c.orig	2012-10-17 13:02:01.418010283 +0000
++++ ldap-nss.c	2012-10-17 13:03:25.017240283 +0000
+@@ -1102,7 +1102,7 @@
+ do_init (void)
+ {
+   ldap_config_t *cfg;
+-#ifndef HAVE_PTHREAD_ATFORK
++#if !defined(HAVE_PTHREAD_ATFORK) || !defined(HAVE___LIBC_ONCE)
+   pid_t pid;
+ #endif
+   uid_t euid;
diff --git a/pkgs/os-specific/linux/nvidia-x11/acpixf.patch b/pkgs/os-specific/linux/nvidia-x11/acpixf.patch
deleted file mode 100644
index c94641c6919..00000000000
--- a/pkgs/os-specific/linux/nvidia-x11/acpixf.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-diff -pur 96.43.20/conftest.sh 96.43.20-3.4/conftest.sh
---- 96.43.20/conftest.sh	2011-07-18 10:51:11.000000000 +0400
-+++ 96.43.20-3.4/conftest.sh	2012-06-16 00:04:22.870746239 +0400
-@@ -908,6 +908,7 @@ compile_test() {
-             #
-             echo "$CONFTEST_PREAMBLE
-             #include <acpi/acpi.h>
-+            #include <acpi/acpixf.h>
-             void conftest_acpi_walk_namespace(void) {
-                 acpi_walk_namespace();
-             }" > conftest$$.c
-@@ -923,6 +924,7 @@ compile_test() {
- 
-             echo "$CONFTEST_PREAMBLE
-             #include <acpi/acpi.h>
-+            #include <acpi/acpixf.h>
-             void conftest_acpi_walk_namespace(void) {
-                 acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
-             }" > conftest$$.c
-@@ -939,6 +941,7 @@ compile_test() {
- 
-             echo "$CONFTEST_PREAMBLE
-             #include <acpi/acpi.h>
-+            #include <acpi/acpixf.h>
-             void conftest_acpi_walk_namespace(void) {
-                 acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
-             }" > conftest$$.c
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder-legacy304.sh b/pkgs/os-specific/linux/nvidia-x11/builder-legacy304.sh
new file mode 100755
index 00000000000..bb8beab29c5
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia-x11/builder-legacy304.sh
@@ -0,0 +1,101 @@
+source $stdenv/setup
+
+dontPatchELF=1 # must keep libXv, $out in RPATH
+
+
+unpackFile() {
+    sh $src -x
+}
+
+
+buildPhase() {
+    if test -z "$libsOnly"; then
+        # Create the module.
+        echo "Building linux driver against kernel: $kernel";
+        cd kernel
+        kernelVersion=$(cd $kernel/lib/modules && ls)
+        sysSrc=$(echo $kernel/lib/modules/$kernelVersion/build/)
+        unset src # used by the nv makefile
+        # Hack necessary to compile on 2.6.28.
+        export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$sysSrc/include/asm/mach-default -I$sysSrc/include/generated"
+        make SYSSRC=$sysSrc module
+        cd ..
+    fi
+}
+
+
+installPhase() {
+
+    # Install libGL and friends.
+    mkdir -p $out/lib/vendors
+
+    for f in \
+      libcuda libGL libnvcuvid libnvidia-cfg libnvidia-compiler \
+      libnvidia-glcore libnvidia-ml libnvidia-opencl \
+      libnvidia-tls libOpenCL libnvidia-tls libvdpau_nvidia
+    do
+      cp -prd $f.* $out/lib/
+      ln -snf $f.so.$versionNumber $out/lib/$f.so
+      ln -snf $f.so.$versionNumber $out/lib/$f.so.1
+    done
+
+    cp -p nvidia.icd $out/lib/vendors/
+    cp -prd tls $out/lib/
+    cp -prd libOpenCL.so.1.0.0 $out/lib/
+    ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so
+    ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so.1
+
+    patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
+    patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.*
+    patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
+
+    if test -z "$libsOnly"; then
+
+        # Install the kernel module.
+        mkdir -p $out/lib/modules/$kernelVersion/misc
+        cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc
+
+        # Install the X driver.
+        mkdir -p $out/lib/xorg/modules
+        cp -p libnvidia-wfb.* $out/lib/xorg/modules/
+        mkdir -p $out/lib/xorg/modules/drivers
+        cp -p nvidia_drv.so $out/lib/xorg/modules/drivers
+        mkdir -p $out/lib/xorg/modules/extensions
+        cp -p libglx.so.* $out/lib/xorg/modules/extensions
+
+        ln -snf libnvidia-wfb.so.$versionNumber $out/lib/xorg/modules/libnvidia-wfb.so.1
+        ln -snf libglx.so.$versionNumber $out/lib/xorg/modules/extensions/libglx.so
+
+        patchelf --set-rpath $out/lib $out/lib/xorg/modules/extensions/libglx.so.*.*
+
+        # Install the programs.
+        mkdir -p $out/bin
+
+        for i in nvidia-settings nvidia-xconfig; do
+	    cp $i $out/bin/$i
+	    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+	        --set-rpath $out/lib:$programPath:$glPath $out/bin/$i
+        done
+
+        # Header files etc.
+        mkdir -p $out/include/nvidia
+        cp -p *.h $out/include/nvidia
+
+        mkdir -p $out/share/man/man1
+        cp -p *.1.gz $out/share/man/man1
+
+        mkdir -p $out/share/applications
+        cp -p *.desktop $out/share/applications
+
+        mkdir -p $out/share/pixmaps
+        cp -p nvidia-settings.png $out/share/pixmaps
+
+        # Patch the `nvidia-settings.desktop' file.
+        substituteInPlace $out/share/applications/nvidia-settings.desktop \
+            --replace '__UTILS_PATH__' $out/bin \
+            --replace '__PIXMAP_PATH__' $out/share/pixmaps
+    fi
+}
+
+
+genericBuild
diff --git a/pkgs/os-specific/linux/nvidia-x11/builder.sh b/pkgs/os-specific/linux/nvidia-x11/builder.sh
index ace9d50cdee..c1e60a79082 100755
--- a/pkgs/os-specific/linux/nvidia-x11/builder.sh
+++ b/pkgs/os-specific/linux/nvidia-x11/builder.sh
@@ -4,7 +4,9 @@ dontPatchELF=1 # must keep libXv, $out in RPATH
 
 
 unpackFile() {
-    sh $src -x
+    skip=$(sed 's/^skip=//; t; d' $src)
+    tail -n +$skip $src | xz -d | tar xvf -
+    sourceRoot=.
 }
 
 
@@ -27,28 +29,31 @@ buildPhase() {
 installPhase() {
 
     # Install libGL and friends.
-    mkdir -p $out/lib
-    cp -prd libcuda.* libGL.* libnvidia-cfg.* libnvidia-compiler.* libnvidia-tls.* libnvidia-glcore.* libOpenCL.* libXv* libvdpau_nvidia* tls $out/lib/
-    
-    ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so
-    ln -snf libnvidia-glcore.so.$versionNumber $out/lib/libnvidia-glcore.so.1
-    ln -snf libGL.so.$versionNumber $out/lib/libGL.so
-    ln -snf libGL.so.$versionNumber $out/lib/libGL.so.1
-    ln -snf libnvidia-cfg.so.$versionNumber $out/lib/libnvidia-cfg.so.1
-    ln -snf libnvidia-tls.so.$versionNumber $out/lib/libnvidia-tls.so.1
-    ln -snf libnvidia-tls.so.$versionNumber $out/lib/tls/libnvidia-tls.so.1
-    ln -snf libXvMCNVIDIA.so.$versionNumber $out/lib/libXvMCNVIDIA_dynamic.so.1
-    ln -snf libcuda.so.$versionNumber $out/lib/libcuda.so.1
-    ln -snf libcuda.so.1 $out/lib/libcuda.so
-    ln -snf libvdpau_nvidia.so.$versionNumber $out/lib/libvdpau_nvidia.so
+    mkdir -p $out/lib/vendors
+
+    for f in \
+      libcuda libGL libnvcuvid libnvidia-cfg libnvidia-compiler \
+      libnvidia-encode libnvidia-glcore libnvidia-ml libnvidia-opencl \
+      libnvidia-tls libOpenCL libnvidia-tls libvdpau_nvidia
+    do
+      cp -prd $f.* $out/lib/
+      ln -snf $f.so.$versionNumber $out/lib/$f.so
+      ln -snf $f.so.$versionNumber $out/lib/$f.so.1
+    done
+
+    cp -p nvidia.icd $out/lib/vendors/
+    cp -prd tls $out/lib/
+    cp -prd libOpenCL.so.1.0.0 $out/lib/
+    ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so
+    ln -snf libOpenCL.so.1.0.0 $out/lib/libOpenCL.so.1
 
     patchelf --set-rpath $out/lib:$glPath $out/lib/libGL.so.*.*
-    patchelf --set-rpath $out/lib:$glPath $out/lib/libXvMCNVIDIA.so.*.*
     patchelf --set-rpath $out/lib:$glPath $out/lib/libvdpau_nvidia.so.*.*
     patchelf --set-rpath $cudaPath $out/lib/libcuda.so.*.*
-    
+    patchelf --set-rpath $openclPath $out/lib/libnvidia-opencl.so.*.*
+
     if test -z "$libsOnly"; then
-        
+
         # Install the kernel module.
         mkdir -p $out/lib/modules/$kernelVersion/misc
         cp kernel/nvidia.ko $out/lib/modules/$kernelVersion/misc
@@ -74,7 +79,7 @@ installPhase() {
 	    patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
 	        --set-rpath $out/lib:$programPath:$glPath $out/bin/$i
         done
-    
+
         # Header files etc.
         mkdir -p $out/include/nvidia
         cp -p *.h $out/include/nvidia
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index 8714c342f1a..809ae316516 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kernel ? null, xlibs, zlib, perl
+{ stdenv, fetchurl, kernelDev ? null, xlibs, zlib, perl
 , gtk, atk, pango, glib, gdk_pixbuf
 , # Whether to build the libraries only (i.e. not the kernel module or
   # nvidia-settings).  Used to support 32-bit binaries on 64-bit
@@ -8,29 +8,31 @@
 
 with stdenv.lib;
 
-let versionNumber = "304.37"; in
+let versionNumber = "319.17"; in
 
 stdenv.mkDerivation {
-  name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernel.version}"}";
-  
+  name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernelDev.version}"}";
+
   builder = ./builder.sh;
-  
+
+  patches = [ ./version-test.patch ];
+
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
-        sha256 = "0dxka66vp15xgm7z9v6x01gdvyvj3l9c33sa7zyahdxbr6h78cdb";
+        sha256 = "1ja5hc74dff8nhsccqhd5km732a8mafdv7xvzj39asw2r3ma37bp";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
-        sha256 = "1xjg91sh7zyn6djdm78wdfas8j7cqn96nyy5zavsnd9jh7v1i0gp";
+        sha256 = "0a6yir07x38b0z51pi7kqgsaidhsib781rd53bpkkkk33yzviaqj";
       }
     else throw "nvidia-x11 does not support platform ${stdenv.system}";
 
   inherit versionNumber libsOnly;
 
-  kernel = if libsOnly then null else kernel;
+  kernel = if libsOnly then null else kernelDev;
 
   dontStrip = true;
 
@@ -38,6 +40,8 @@ stdenv.mkDerivation {
 
   cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
 
+  openclPath = stdenv.lib.makeLibraryPath [zlib];
+
   programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath
     [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
 
@@ -46,6 +50,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://www.nvidia.com/object/unix.html;
     description = "X.org driver and kernel module for NVIDIA graphics cards";
-    license = "unfree";
+    license = stdenv.lib.licenses.unfreeRedistributable;
   };
 }
diff --git a/pkgs/os-specific/linux/nvidia-x11/generated.patch b/pkgs/os-specific/linux/nvidia-x11/generated.patch
deleted file mode 100644
index 6cf7a93c644..00000000000
--- a/pkgs/os-specific/linux/nvidia-x11/generated.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -pur 173.14.31/conftest.sh 173.14.31-3.3/conftest.sh
---- 173.14.31/conftest.sh	2011-07-18 09:49:58.000000000 +0400
-+++ 173.14.31-3.3/conftest.sh	2012-04-09 19:33:34.407928432 +0400
-@@ -123,7 +123,7 @@ build_cflags() {
-     CFLAGS="$BASE_CFLAGS $MACH_CFLAGS $OUTPUT_CFLAGS -I$HEADERS $AUTOCONF_CFLAGS"
- 
-     if [ "$ARCH" = "i386" -o "$ARCH" = "x86_64" ]; then
--        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include"
-+        CFLAGS="$CFLAGS -I$SOURCES/arch/x86/include -I$SOURCES/arch/x86/include/generated"
-     fi
-     if [ -n "$BUILD_PARAMS" ]; then
-         CFLAGS="$CFLAGS -D$BUILD_PARAMS"
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy173.nix b/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
index 0112270f3bf..a03e3d4ca7e 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
@@ -1,13 +1,13 @@
-{stdenv, fetchurl, kernel, xlibs, zlib, gtk, atk, pango, glib, gdk_pixbuf}:
+{stdenv, fetchurl, kernelDev, xlibs, zlib, gtk, atk, pango, glib, gdk_pixbuf}:
 
 let 
 
-  versionNumber = "173.14.35";
+  versionNumber = "173.14.36";
 
 in
 
 stdenv.mkDerivation {
-  name = "nvidia-x11-${versionNumber}-${kernel.version}";
+  name = "nvidia-x11-${versionNumber}-${kernelDev.version}";
   
   builder = ./builder-legacy.sh;
   
@@ -15,16 +15,18 @@ stdenv.mkDerivation {
     if stdenv.system == "i686-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
-        sha256 = "16kjxj2bn78cgyb4xq39zajjv1hx1z5dw50n9r17w14ifq7i09id";
+        sha256 = "19wnikms9wradf1kmaywnp7hykrdm4xqz2ka7az66s3ma096y95c";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
-        sha256 = "0mk7pj7in090dx2v5yzkd7qkaf0qvz3jv4cmpiflpmzmg9p15x8n";
+        sha256 = "1xf1w6qvqw0a3vd807hp3cgqmzm1wkpz2by52p0qgpjqld421k2s";
       }
     else throw "nvidia-x11 does not support platform ${stdenv.system}";
 
-  inherit versionNumber kernel;
+  kernel = kernelDev;
+
+  inherit versionNumber;
 
   dontStrip = true;
 
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy304.nix b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
new file mode 100644
index 00000000000..e2739b291d4
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, kernelDev ? null, xlibs, zlib, perl
+, gtk, atk, pango, glib, gdk_pixbuf
+, # Whether to build the libraries only (i.e. not the kernel module or
+  # nvidia-settings).  Used to support 32-bit binaries on 64-bit
+  # Linux.
+  libsOnly ? false
+}:
+
+with stdenv.lib;
+
+let versionNumber = "304.84"; in
+
+stdenv.mkDerivation {
+  name = "nvidia-x11-${versionNumber}${optionalString (!libsOnly) "-${kernelDev.version}"}";
+
+  builder = ./builder-legacy304.sh;
+
+  src =
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}.run";
+        sha256 = "14hfx3rhf3vf3x3klkhz5qkjrg51r22nqqdzffilcwkxdjfg10j1";
+      }
+    else if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-no-compat32.run";
+        sha256 = "1ixxkykl78g874g537apvxalggp3kw0mm5q69rl99jlw6jibbm80";
+      }
+    else throw "nvidia-x11 does not support platform ${stdenv.system}";
+
+  inherit versionNumber libsOnly;
+
+  kernel = if libsOnly then null else kernelDev;
+
+  dontStrip = true;
+
+  glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
+
+  cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.gcc.gcc];
+
+  programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath
+    [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
+
+  buildInputs = [ perl ];
+
+  meta = {
+    homepage = http://www.nvidia.com/object/unix.html;
+    description = "X.org driver and kernel module for NVIDIA graphics cards";
+    license = "unfree";
+  };
+}
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy96.nix b/pkgs/os-specific/linux/nvidia-x11/legacy96.nix
index fd27a989c07..32fc3632b05 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy96.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy96.nix
@@ -1,13 +1,13 @@
-{stdenv, fetchurl, kernel, xlibs, zlib, gtk, atk, pango, glib}:
+{stdenv, fetchurl, kernelDev, xlibs, zlib, gtk, atk, pango, glib}:
 
 let 
 
-  versionNumber = "96.43.20";
+  versionNumber = "96.43.23";
 
 in
 
 stdenv.mkDerivation {
-  name = "nvidia-x11-${versionNumber}-${kernel.version}";
+  name = "nvidia-x11-${versionNumber}-${kernelDev.version}";
   
   builder = ./builder-legacy.sh;
   
@@ -15,26 +15,18 @@ stdenv.mkDerivation {
     if stdenv.system == "i686-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86/${versionNumber}/NVIDIA-Linux-x86-${versionNumber}-pkg0.run";
-        sha256 = "05vm36jnydp4cfdkfvrvxczd64i3f0pp0yp7dn8y8pklrxi80xxw";
+        sha256 = "0hi10h26l51mknr57zsdg0zaxcqdz1lp3hsz0hi1c1vkpbsavrji";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "http://us.download.nvidia.com/XFree86/Linux-x86_64/${versionNumber}/NVIDIA-Linux-x86_64-${versionNumber}-pkg0.run";
-        sha256 = "0a8ninp4wyql3xh6z93dzhbacvz7g0h8gs4pg5279a0i6h05wb1w";
+        sha256 = "09vynha40rsxpklj1m0qjfg853ckdpi9g87h06irikh405x57kzp";
       }
     else throw "nvidia-x11 does not support platform ${stdenv.system}";
 
-  inherit versionNumber kernel;
-
-  # Only for kernels 3.4 and over
-  # Patches taken from arch linux AUR 
-  # https://aur.archlinux.org/packages.php?ID=57698
-  kpatches = stdenv.lib.optionals (stdenv.lib.strings.versionOlder "3.4" kernel.version)
-    [ ./acpixf.patch
-      ./generated.patch
-      ./patchlevel.patch
-      ./switch_to.patch
-    ];
+  kernel = kernelDev;
+
+  inherit versionNumber;
 
   dontStrip = true;
 
diff --git a/pkgs/os-specific/linux/nvidia-x11/patchlevel.patch b/pkgs/os-specific/linux/nvidia-x11/patchlevel.patch
deleted file mode 100644
index 256922ca966..00000000000
--- a/pkgs/os-specific/linux/nvidia-x11/patchlevel.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-diff -pur 96.43.20-t1/conftest.sh 96.43.20-t2/conftest.sh
---- 96.43.20-t1/conftest.sh	2012-06-16 17:14:47.206589267 +0400
-+++ 96.43.20-t2/conftest.sh	2012-06-16 15:35:45.049203248 +0400
-@@ -1303,10 +1303,14 @@ case "$5" in
-         MAKEFILE=$HEADERS/../Makefile
- 
-         if [ -f $MAKEFILE ]; then
-+            VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
-             PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
- 
--            if [ -z "$PATCHLEVEL" ]; then
-+            if [ -z "$PATCHLEVEL" -o -z "$VERSION" ]; then
-                 exit 1
-+            elif [ "$VERSION" = '3' ]; then
-+                echo 6
-+                exit 0                
-             else
-                 echo $PATCHLEVEL
-                 exit 0
-@@ -1426,10 +1430,11 @@ case "$5" in
-                 # kernel older than 2.6.6, that's all we require to
-                 # build the module.
-                 #
-+                VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
-                 PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
-                 SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
- 
--                if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
-+                if [ "$VERSION" = '2' -a -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
-                         -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
-                     SELECTED_MAKEFILE=Makefile.kbuild
-                     RET=0
-@@ -1525,11 +1530,12 @@ case "$5" in
-                 # This source tree is not configured, but includes
-                 # the top-level Makefile.
-                 #
-+                VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
-                 PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
-                 SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
- 
--                if [ -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
--                    echo 2.$PATCHLEVEL.$SUBLEVEL
-+                if [ -n "$VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" ]; then
-+                    echo $VERSION.$PATCHLEVEL.$SUBLEVEL
-                     RET=0
-                 fi
-             fi
-diff -pur 96.43.20-t1/Makefile.kbuild 96.43.20-t2/Makefile.kbuild
---- 96.43.20-t1/Makefile.kbuild	2011-07-18 10:51:11.000000000 +0400
-+++ 96.43.20-t2/Makefile.kbuild	2012-06-16 17:08:11.694605133 +0400
-@@ -132,7 +132,7 @@ MODULE_ROOT := /lib/modules/$(KERNEL_UNA
- #
- 
- TOPDIR ?= $(KERNEL_SOURCES)
--PATCHLEVEL ?= $(shell $(CONFTEST) kernel_patch_level)
-+PATCHLEVEL := $(shell $(CONFTEST) kernel_patch_level)
- 
- #
- # Linux 2.4 uses the .o module extension. Linux 2.6, however, uses the .ko
diff --git a/pkgs/os-specific/linux/nvidia-x11/switch_to.patch b/pkgs/os-specific/linux/nvidia-x11/switch_to.patch
deleted file mode 100644
index 51ffa7f83f1..00000000000
--- a/pkgs/os-specific/linux/nvidia-x11/switch_to.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -pur 173.14.31-3.3/conftest.sh 173.14.31-3.4/conftest.sh
---- 173.14.31-3.3/conftest.sh	2012-04-09 19:33:34.407928432 +0400
-+++ 173.14.31-3.4/conftest.sh	2012-04-10 19:50:36.052346728 +0400
-@@ -465,7 +465,7 @@ compile_test() {
-             # and if it as an 'event' member.
-             #
-             echo "$CONFTEST_PREAMBLE
--            #include <asm/system.h>
-+            #include <asm/switch_to.h>
-             #include <linux/pm.h>
-             void conftest_pm_message_t(pm_message_t state) {
-                 pm_message_t *p = &state;
-diff -pur 173.14.31-3.3/nv-linux.h 173.14.31-3.4/nv-linux.h
---- 173.14.31-3.3/nv-linux.h	2011-07-18 09:49:58.000000000 +0400
-+++ 173.14.31-3.4/nv-linux.h	2012-04-10 19:53:04.853776013 +0400
-@@ -92,7 +92,7 @@
- #include <linux/timer.h>
- 
- #include <asm/div64.h>              /* do_div()                         */
--#include <asm/system.h>             /* cli, sli, save_flags             */
-+#include <asm/switch_to.h>          /* cli, sli, save_flags             */
- #include <asm/io.h>                 /* ioremap, virt_to_phys            */
- #include <asm/uaccess.h>            /* access_ok                        */
- #include <asm/page.h>               /* PAGE_OFFSET                      */
diff --git a/pkgs/os-specific/linux/nvidia-x11/version-test.patch b/pkgs/os-specific/linux/nvidia-x11/version-test.patch
new file mode 100644
index 00000000000..9b6908ee5c0
--- /dev/null
+++ b/pkgs/os-specific/linux/nvidia-x11/version-test.patch
@@ -0,0 +1,19 @@
+diff -Naur NVIDIA-Linux-x86_64-310.32-no-compat32/kernel/conftest.sh NVIDIA-patched/kernel/conftest.sh
+--- NVIDIA-Linux-x86_64-310.32-no-compat32/kernel/conftest.sh	2013-01-14 18:11:17.000000000 -0430
++++ NVIDIA-patched/kernel/conftest.sh	2013-02-05 14:44:50.757999124 -0430
+@@ -1699,11 +1699,13 @@
+                 # kernel older than 2.6.6, that's all we require to
+                 # build the module.
+                 #
++                VERSION=$(grep "^VERSION =" $MAKEFILE | cut -d " " -f 3)
+                 PATCHLEVEL=$(grep "^PATCHLEVEL =" $MAKEFILE | cut -d " " -f 3)
+                 SUBLEVEL=$(grep "^SUBLEVEL =" $MAKEFILE | cut -d " " -f 3)
+ 
+-                if [ -n "$PATCHLEVEL" -a $PATCHLEVEL -ge 6 \
+-                        -a -n "$SUBLEVEL" -a $SUBLEVEL -le 5 ]; then
++                if [ -n "$VERSION" -a -n "$PATCHLEVEL" -a -n "$SUBLEVEL" \
++                     -a "$VERSION" -ge 3 -o "$VERSION" -eq 2 -a "$PATCHLEVEL" -ge 7 \
++                     -o "$PATCHLEVEL" -eq 6 -a "$SUBLEVEL" -ge 6 ]; then 
+                     SELECTED_MAKEFILE=Makefile.kbuild
+                     RET=0
+                 fi
diff --git a/pkgs/os-specific/linux/open-iscsi/default.nix b/pkgs/os-specific/linux/open-iscsi/default.nix
index eccdde30b13..60e0e4d189c 100644
--- a/pkgs/os-specific/linux/open-iscsi/default.nix
+++ b/pkgs/os-specific/linux/open-iscsi/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, kernel}:
+{ stdenv, fetchurl, kernelDev}:
 
 stdenv.mkDerivation rec {
-  name = "open-iscsi-2.0-871-${kernel.version}";
+  name = "open-iscsi-2.0-871-${kernelDev.version}";
   
   src = fetchurl {
     url = "http://www.open-iscsi.org/bits/${name}.tar.gz";
     sha256 = "1jvx1agybaj4czhz41bz37as076spicsmlh5pjksvwl2mr38gsmw";
   };
   
-  KSRC = "${kernel}/lib/modules/*/build";
+  KSRC = "${kernelDev}/lib/modules/*/build";
   DESTDIR = "$(out)";
   
   preConfigure = ''
diff --git a/pkgs/os-specific/linux/otpw/default.nix b/pkgs/os-specific/linux/otpw/default.nix
new file mode 100644
index 00000000000..fe5f938b75b
--- /dev/null
+++ b/pkgs/os-specific/linux/otpw/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pam }:
+
+stdenv.mkDerivation rec {
+  name = "otpw-1.3";
+
+  src = fetchurl {
+    url = "http://www.cl.cam.ac.uk/~mgk25/download/${name}.tar.gz";
+    sha256 = "1k3hc7xbxz6hkc55kvddi3cibafwf93ivn58sy1l888d3l5dwmrk";
+  };
+
+  patchPhase = ''
+    sed -i 's/^CFLAGS.*/CFLAGS=-O2 -fPIC/' Makefile
+    sed -i -e 's,PATH=.*;,,' conf.h
+    sed -i -e '/ENTROPY_ENV/d' otpw-gen.c
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin $out/lib/security $out/share/man/man{1,8}
+    cp pam_*.so $out/lib/security
+    cp otpw-gen $out/bin
+    cp *.1 $out/share/man/man1
+    cp *.8 $out/share/man/man8
+  '';
+
+  buildInputs = [ pam ];
+
+  meta = {
+    homepage = http://www.cl.cam.ac.uk/~mgk25/otpw.html;
+    description = "A one-time password login package";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/os-specific/linux/ov511/default.nix b/pkgs/os-specific/linux/ov511/default.nix
deleted file mode 100644
index 628261e6c5f..00000000000
--- a/pkgs/os-specific/linux/ov511/default.nix
+++ /dev/null
@@ -1 +0,0 @@
-import ./ov511-2.30-default.nix
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.30-builder.sh b/pkgs/os-specific/linux/ov511/ov511-2.30-builder.sh
deleted file mode 100644
index 21a2ac725ca..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.30-builder.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-source $stdenv/setup
-
-hashname=$(basename $kernel)
-echo $hashname
-if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
-  hashname=$(echo "$hashname" | cut -c -32)
-fi
-
-stripHash $kernel
-version=$(echo $strippedName | cut -c 7-)-$hashname
-
-echo "version $version"
-
-export version
-
-mkdir -p $out/lib/modules/$version/kernel/drivers/usb/media/
-
-genericBuild
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix b/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix
deleted file mode 100644
index 4b2cd1ed5b2..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.30-default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, kernel}:
-
-stdenv.mkDerivation {
-  name = "ov511-2.30";
-  builder = ./ov511-2.30-builder.sh;
-  src = fetchurl {
-    url = http://nixos.org/tarballs/ov511-2.30.tar.bz2;
-    md5 = "9eacf9e54f2f54a59ddbf14221a53f2a";
-  };
-  patches = [./ov511-kernel.patch ./ov511-2.32-kdir.patch];
-  inherit kernel;
-  NIX_GLIBC_FLAGS_SET=1;
-}
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.32-builder.sh b/pkgs/os-specific/linux/ov511/ov511-2.32-builder.sh
deleted file mode 100644
index 636b19a95af..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.32-builder.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-source $stdenv/setup
-
-hashname=$(basename $kernel)
-echo $hashname
-if echo "$hashname" | grep -q '^[a-z0-9]\{32\}-'; then
-  hashname=$(echo "$hashname" | cut -c -32)
-fi
-
-stripHash $kernel
-version=$(echo $strippedName | cut -c 7-)-$hashname
-
-echo "version $version"
-
-export version
-
-mkdir -p $out/lib/modules/$version/kernel/drivers/usb/media/
-
-genericBuild
-
-echo "b0rken"
-
-exit 1
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.32-default.nix b/pkgs/os-specific/linux/ov511/ov511-2.32-default.nix
deleted file mode 100644
index 6af69d882db..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.32-default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{stdenv, fetchurl, kernel}:
-
-stdenv.mkDerivation {
-  name = "ov511-2.32";
-  builder = ./ov511-2.32-builder.sh;
-  src = fetchurl {
-    url = http://www.ovcam.org/ov511/download/2.xx/distros/ov511-2.32.tar.bz2;
-    md5 = "6a08025311649356242761641a1df0f2";
-  };
-  patches = [./ov511-kernel.patch ./ov511-2.32.patch ./ov511-2.32-kdir.patch];
-  inherit kernel;
-  NIX_GLIBC_FLAGS_SET=1;
-}
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.32-kdir.patch b/pkgs/os-specific/linux/ov511/ov511-2.32-kdir.patch
deleted file mode 100644
index e0a1175a7ff..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.32-kdir.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -rc ov511-2.32/Makefile ov511-2.32.new/Makefile
-*** ov511-2.32/Makefile	2006-03-28 17:47:31.000000000 +0200
---- ov511-2.32.new/Makefile	2006-07-17 09:46:17.000000000 +0200
-***************
-*** 114,120 ****
-  
-  else  # We were called from command line
-  
-! KDIR := /lib/modules/$(shell uname -r)/build
-  PWD  := $(shell pwd)
-  
-  default:
---- 114,120 ----
-  
-  else  # We were called from command line
-  
-! KDIR := $(kernel)/lib/modules/$(version)/build
-  PWD  := $(shell pwd)
-  
-  default:
diff --git a/pkgs/os-specific/linux/ov511/ov511-2.32.patch b/pkgs/os-specific/linux/ov511/ov511-2.32.patch
deleted file mode 100644
index 55e78afaeaa..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-2.32.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -rc ov511-2.32/tuner.c ov511-2.32.new/tuner.c
-*** ov511-2.32/tuner.c	Mon Apr  3 15:16:27 2006
---- ov511-2.32.new/tuner.c	Mon Jul 17 00:26:57 2006
-***************
-*** 1029,1035 ****
-  static struct i2c_client client_template =
-  {
-  	.name   = "(tuner unset)",
-- 	.flags  = I2C_CLIENT_ALLOW_USE,
-          .driver = &driver,
-  };
-  
---- 1029,1034 ----
diff --git a/pkgs/os-specific/linux/ov511/ov511-kernel.patch b/pkgs/os-specific/linux/ov511/ov511-kernel.patch
deleted file mode 100644
index eca39e90fce..00000000000
--- a/pkgs/os-specific/linux/ov511/ov511-kernel.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-diff -rc ov511-2.32/do_install.sh ov511-2.32.new/do_install.sh
-*** ov511-2.32/do_install.sh	2003-11-12 09:24:29.000000000 +0100
---- ov511-2.32.new/do_install.sh	2006-07-16 19:44:56.000000000 +0200
-***************
-*** 8,15 ****
-  
-  UNAME=`uname -r`
-  
-! INSTALL_PATH_2_4=/lib/modules/$UNAME/kernel/drivers/usb/
-! INSTALL_PATH_2_6=/lib/modules/$UNAME/kernel/drivers/usb/media/
-  
-  MAJMIN=`echo $UNAME | cut -d . -f 1-2`
-  
---- 8,15 ----
-  
-  UNAME=`uname -r`
-  
-! INSTALL_PATH_2_4=$out/lib/modules/$version/kernel/drivers/usb/
-! INSTALL_PATH_2_6=$out/lib/modules/$version/kernel/drivers/usb/media/
-  
-  MAJMIN=`echo $UNAME | cut -d . -f 1-2`
-  
-***************
-*** 35,41 ****
-  	install $MODULE $INSTALL_PATH
-  done
-  
-! echo Finding module dependencies
-! /sbin/depmod -ae
-  
-  echo All done!
---- 35,41 ----
-  	install $MODULE $INSTALL_PATH
-  done
-  
-! #echo Finding module dependencies
-! #/sbin/depmod -ae
-  
-  echo All done!
diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix
index c18ea2b1f2b..43300425c00 100644
--- a/pkgs/os-specific/linux/pam/default.nix
+++ b/pkgs/os-specific/linux/pam/default.nix
@@ -1,24 +1,21 @@
-{ stdenv, fetchurl, flex, cracklib, libxcrypt }:
+{ stdenv, fetchurl, flex, cracklib }:
 
 stdenv.mkDerivation rec {
-  name = "linux-pam-1.1.1";
+  name = "linux-pam-1.1.6";
 
   src = fetchurl {
-    url = mirror://kernel/linux/libs/pam/library/Linux-PAM-1.1.1.tar.bz2;
-    sha256 = "015r3xdkjpqwcv4lvxavq0nybdpxhfjycqpzbx8agqd5sywkx3b0";
+    url = https://fedorahosted.org/releases/l/i/linux-pam/Linux-PAM-1.1.6.tar.bz2;
+    sha256 = "1hlz2kqvbjisvwyicdincq7nz897b9rrafyzccwzqiqg53b8gf5s";
   };
 
-  buildNativeInputs = [ flex ];
-  buildInputs = [ cracklib ]
-    ++ stdenv.lib.optional
-      (!stdenv.isArm && stdenv.system != "mips64el-linux")
-      libxcrypt;
+  nativeBuildInputs = [ flex ];
+
+  buildInputs = [ cracklib ];
 
   crossAttrs = {
-    # Skip libxcrypt cross-building, as it fails for mips and arm
-    propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
+    propagatedBuildInputs = [ flex.crossDrv cracklib.crossDrv ];
     preConfigure = preConfigure + ''
-      ar x ${flex.hostDrv}/lib/libfl.a
+      ar x ${flex.crossDrv}/lib/libfl.a
       mv libyywrap.o libyywrap-target.o
       ar x ${flex}/lib/libfl.a
       mv libyywrap.o libyywrap-host.o
@@ -27,13 +24,13 @@ stdenv.mkDerivation rec {
     '';
     postConfigure = ''
       sed -e "s@ $PWD/libyywrap-target.o@ $PWD/libyywrap-host.o@" -i doc/specs/Makefile
-    ''; 
+    '';
   };
 
   postInstall = ''
     mv -v $out/sbin/unix_chkpwd{,.orig}
     ln -sv /var/setuid-wrappers/unix_chkpwd $out/sbin/unix_chkpwd
-    '';
+  '';
 
   preConfigure = ''
     configureFlags="$configureFlags --includedir=$out/include/security"
diff --git a/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix b/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
index 34600870671..db6f04674a0 100644
--- a/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
+++ b/pkgs/os-specific/linux/pam_ssh_agent_auth/default.nix
@@ -1,17 +1,27 @@
 { stdenv, fetchurl, pam, openssl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "pam_ssh_agent_auth-0.9.3";
+  name = "pam_ssh_agent_auth-0.9.5";
 
   src = fetchurl {
     url = "mirror://sourceforge/pamsshagentauth/${name}.tar.bz2";
-    sha256 = "19p5mzplnr9g9vlp16nipf5rjw4v8zncvimarwgix958yml7j08h";
+    sha256 = "1aihfyj17nvqhf0d5i0dg2lsly3r24xjyx0sfqpf60s0libkp4y0";
   };
 
+  patches =
+    [ # Allow multiple colon-separated authorized keys files to be
+      # specified in the file= option.
+      ./multiple-key-files.patch
+    ];
+
   buildInputs = [ pam openssl perl ];
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://pamsshagentauth.sourceforge.net/;
     description = "PAM module for authentication through the SSH agent";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch b/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch
new file mode 100644
index 00000000000..dc97b7d54f7
--- /dev/null
+++ b/pkgs/os-specific/linux/pam_ssh_agent_auth/multiple-key-files.patch
@@ -0,0 +1,338 @@
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.c pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.c
+--- pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.c	2012-12-17 19:29:16.014226336 +0000
+@@ -69,14 +69,14 @@
+     return cookie;
+ }
+ 
+-int
++const char *
+ pamsshagentauth_find_authorized_keys(uid_t uid)
+ {
+     Identity *id;
+     Key *key;
+     AuthenticationConnection *ac;
+     char *comment;
+-    uint8_t retval = 0;
++    const char *key_file = 0;
+ 
+     OpenSSL_add_all_digests();
+     session_id2 = pamsshagentauth_session_id2_gen();
+@@ -90,13 +90,11 @@
+                 id->key = key;
+                 id->filename = comment;
+                 id->ac = ac;
+-                if(userauth_pubkey_from_id(id)) {
+-                    retval = 1;
+-                }
++                key_file = userauth_pubkey_from_id(id);
+                 pamsshagentauth_xfree(id->filename);
+                 pamsshagentauth_key_free(id->key);
+                 pamsshagentauth_xfree(id);
+-                if(retval == 1)
++                if(key_file)
+                     break;
+             }
+         }
+@@ -107,5 +105,5 @@
+     }
+     pamsshagentauth_xfree(session_id2);
+     EVP_cleanup();
+-    return retval;
++    return key_file;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.h pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.h
+--- pam_ssh_agent_auth-0.9.4-orig/iterate_ssh_agent_keys.h	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/iterate_ssh_agent_keys.h	2012-12-17 19:28:57.454334806 +0000
+@@ -31,6 +31,6 @@
+ #ifndef _ITERATE_SSH_AGENT_KEYS_H
+ #define _ITERATE_SSH_AGENT_KEYS_H
+ 
+-int pamsshagentauth_find_authorized_keys(uid_t);
++const char * pamsshagentauth_find_authorized_keys(uid_t);
+ 
+ #endif
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.c pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.c
+--- pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.c	2012-12-17 19:30:24.013830673 +0000
+@@ -60,7 +60,6 @@
+ 
+ #define strncasecmp_literal(A,B) strncasecmp( A, B, sizeof(B) - 1)
+ 
+-char           *authorized_keys_file = NULL;
+ uint8_t         allow_user_owned_authorized_keys_file = 0;
+ 
+ #if ! HAVE___PROGNAME || HAVE_BUNDLE
+@@ -161,15 +160,13 @@
+         goto cleanexit;
+     }
+ 
+-    if(authorized_keys_file_input && user) {
+-        /*
+-         * user is the name of the target-user, and so must be used for validating the authorized_keys file
+-         */
+-        parse_authorized_key_file(user, authorized_keys_file_input);
+-    } else {
+-        pamsshagentauth_verbose("Using default file=/etc/security/authorized_keys");
+-        authorized_keys_file = pamsshagentauth_xstrdup("/etc/security/authorized_keys");
+-    }
++    if (!authorized_keys_file_input || !user)
++        authorized_keys_file_input = "/etc/security/authorized_keys";
++
++    /*
++     * user is the name of the target-user, and so must be used for validating the authorized_keys file
++     */
++    parse_authorized_key_files(user, authorized_keys_file_input);
+ 
+     /* 
+      * PAM_USER and PAM_RUSER do not necessarily have to get set by the calling application, and we may be unable to divine the latter.
+@@ -177,16 +174,17 @@
+      */
+ 
+     if(user && strlen(ruser) > 0) {
+-        pamsshagentauth_verbose("Attempting authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++        pamsshagentauth_verbose("Attempting authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file_input);
+ 
+         /* 
+          * this pw_uid is used to validate the SSH_AUTH_SOCK, and so must be the uid of the ruser invoking the program, not the target-user
+          */
+-        if(pamsshagentauth_find_authorized_keys(getpwnam(ruser)->pw_uid)) {
+-            pamsshagentauth_logit("Authenticated: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++        const char *key_file;
++        if((key_file = pamsshagentauth_find_authorized_keys(getpwnam(ruser)->pw_uid))) {
++            pamsshagentauth_logit("Authenticated: `%s' as `%s' using %s", ruser, user, key_file);
+             retval = PAM_SUCCESS;
+         } else {
+-            pamsshagentauth_logit("Failed Authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file);
++            pamsshagentauth_logit("Failed Authentication: `%s' as `%s' using %s", ruser, user, authorized_keys_file_input);
+         }
+     } else {
+         pamsshagentauth_logit("No %s specified, cannot continue with this form of authentication", (user) ? "ruser" : "user" );
+@@ -198,7 +196,7 @@
+     free(__progname);
+ #endif
+ 
+-    free(authorized_keys_file);
++    free_authorized_key_files();
+ 
+     return retval;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.pod pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.pod
+--- pam_ssh_agent_auth-0.9.4-orig/pam_ssh_agent_auth.pod	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_ssh_agent_auth.pod	2012-12-17 19:52:35.968965448 +0000
+@@ -26,7 +26,7 @@
+ 
+ =item file=<path to authorized_keys>
+ 
+-Specify the path to the authorized_keys file(s) you would like to use for authentication. Subject to tilde and % EXPANSIONS (below) 
++Specify the path(s) to the authorized_keys file(s) you would like to use for authentication. Subject to tilde and % EXPANSIONS (below). Paths are separated using colons.
+ 
+ =item allow_user_owned_authorized_keys_file
+ 
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.c pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.c
+--- pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.c	2012-12-17 19:32:20.830157313 +0000
+@@ -79,66 +79,96 @@
+ 
+ #include "identity.h"
+ #include "pam_user_key_allowed2.h"
++#include "pam_user_authorized_keys.h"
+ 
+-extern char    *authorized_keys_file;
++#define MAX_AUTHORIZED_KEY_FILES 16
++
++char           *authorized_keys_files[MAX_AUTHORIZED_KEY_FILES];
++unsigned int    nr_authorized_keys_files = 0;
+ extern uint8_t  allow_user_owned_authorized_keys_file;
+ uid_t           authorized_keys_file_allowed_owner_uid;
+ 
+ void
+-parse_authorized_key_file(const char *user, const char *authorized_keys_file_input)
++parse_authorized_key_files(const char *user, const char *authorized_keys_file_input)
+ {
+-    char            fqdn[HOST_NAME_MAX] = "";
++    const char      *pos = authorized_keys_file_input;
+     char            hostname[HOST_NAME_MAX] = "";
+-    char            auth_keys_file_buf[4096] = "";
+-    char           *slash_ptr = NULL;
+-    char            owner_uname[128] = "";
+-    size_t          owner_uname_len = 0;
+-
+-    /*
+-     * temporary copy, so that both tilde expansion and percent expansion both get to apply to the path
+-     */
+-    strncat(auth_keys_file_buf, authorized_keys_file_input, sizeof(auth_keys_file_buf) - 1);
++    char            fqdn[HOST_NAME_MAX] = "";
++
++#if HAVE_GETHOSTNAME
++    *hostname = '\0';
++    gethostname(fqdn, HOST_NAME_MAX);
++    strncat(hostname, fqdn, strcspn(fqdn,"."));
++#endif
+ 
+-    if(allow_user_owned_authorized_keys_file)
+-        authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++    while (pos) {
++        const char     *colon = strchr(pos, ':');
++        char            auth_keys_file_buf[4096] = "";
++        char           *slash_ptr = NULL;
++        char            owner_uname[128] = "";
++        size_t          owner_uname_len = 0;
++
++        strncat(auth_keys_file_buf, pos, sizeof(auth_keys_file_buf) - 1);
++        if (colon) {
++            auth_keys_file_buf[colon - pos] = 0;
++            pos = colon + 1;
++        } else {
++            pos = 0;
++        }
+ 
+-    if(*auth_keys_file_buf == '~') {
+-        if(*(auth_keys_file_buf+1) == '/') {
++        if(allow_user_owned_authorized_keys_file)
+             authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++
++        if(*auth_keys_file_buf == '~') {
++            if(*(auth_keys_file_buf+1) == '/') {
++                authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++            }
++            else {
++                slash_ptr = strchr(auth_keys_file_buf,'/');
++                if(!slash_ptr)
++                    pamsshagentauth_fatal("cannot expand tilde in path without a `/'");
++
++                owner_uname_len = slash_ptr - auth_keys_file_buf - 1;
++                if(owner_uname_len > (sizeof(owner_uname) - 1) ) 
++                    pamsshagentauth_fatal("Username too long");
++
++                strncat(owner_uname, auth_keys_file_buf + 1, owner_uname_len);
++                if(!authorized_keys_file_allowed_owner_uid)
++                    authorized_keys_file_allowed_owner_uid = getpwnam(owner_uname)->pw_uid;
++            }
++            char *tmp = pamsshagentauth_tilde_expand_filename(auth_keys_file_buf, authorized_keys_file_allowed_owner_uid);
++            strncpy(auth_keys_file_buf, tmp, sizeof(auth_keys_file_buf) - 1 );
++            pamsshagentauth_xfree(tmp);
+         }
+-        else {
+-            slash_ptr = strchr(auth_keys_file_buf,'/');
+-            if(!slash_ptr)
+-                pamsshagentauth_fatal("cannot expand tilde in path without a `/'");
+-
+-            owner_uname_len = slash_ptr - auth_keys_file_buf - 1;
+-            if(owner_uname_len > (sizeof(owner_uname) - 1) ) 
+-                pamsshagentauth_fatal("Username too long");
+-
+-            strncat(owner_uname, auth_keys_file_buf + 1, owner_uname_len);
+-            if(!authorized_keys_file_allowed_owner_uid)
+-                authorized_keys_file_allowed_owner_uid = getpwnam(owner_uname)->pw_uid;
++
++        if(strstr(auth_keys_file_buf, "%h")) {
++            authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
+         }
+-        authorized_keys_file = pamsshagentauth_tilde_expand_filename(auth_keys_file_buf, authorized_keys_file_allowed_owner_uid);
+-        strncpy(auth_keys_file_buf, authorized_keys_file, sizeof(auth_keys_file_buf) - 1 );
+-        pamsshagentauth_xfree(authorized_keys_file) /* when we percent_expand later, we'd step on this, so free it immediately */;
+-    }
+ 
+-    if(strstr(auth_keys_file_buf, "%h")) {
+-        authorized_keys_file_allowed_owner_uid = getpwnam(user)->pw_uid;
++        if (nr_authorized_keys_files >= MAX_AUTHORIZED_KEY_FILES)
++            pamsshagentauth_fatal("Too many authorized key files");
++        authorized_keys_files[nr_authorized_keys_files++] =
++            pamsshagentauth_percent_expand(auth_keys_file_buf, "h", getpwnam(user)->pw_dir, "H", hostname, "f", fqdn, "u", user, NULL);
+     }
++}
+ 
+-#if HAVE_GETHOSTNAME
+-    *hostname = '\0';
+-    gethostname(fqdn, HOST_NAME_MAX);
+-    strncat(hostname, fqdn, strcspn(fqdn,"."));
+-#endif
+-    authorized_keys_file = pamsshagentauth_percent_expand(auth_keys_file_buf, "h", getpwnam(user)->pw_dir, "H", hostname, "f", fqdn, "u", user, NULL);
++void
++free_authorized_key_files()
++{
++    unsigned int n;
++    for (n = 0; n < nr_authorized_keys_files; n++)
++        free(authorized_keys_files[n]);
++    nr_authorized_keys_files = 0;
+ }
+ 
+-int
++const char *
+ pam_user_key_allowed(Key * key)
+ {
+-    return pam_user_key_allowed2(getpwuid(authorized_keys_file_allowed_owner_uid), key, authorized_keys_file)
+-        || pam_user_key_allowed2(getpwuid(0), key, authorized_keys_file);
++    unsigned int n;
++    for (n = 0; n < nr_authorized_keys_files; n++) {
++        if (pam_user_key_allowed2(getpwuid(authorized_keys_file_allowed_owner_uid), key, authorized_keys_files[n])
++            || pam_user_key_allowed2(getpwuid(0), key, authorized_keys_files[n]))
++            return authorized_keys_files[n];
++    }
++    return 0;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.h pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.h
+--- pam_ssh_agent_auth-0.9.4-orig/pam_user_authorized_keys.h	2010-01-13 02:17:01.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/pam_user_authorized_keys.h	2012-12-17 19:24:34.477894517 +0000
+@@ -28,11 +28,12 @@
+  */
+ 
+ 
+-#ifndef _PAM_USER_KEY_ALLOWED_H
+-#define _PAM_USER_KEY_ALLOWED_H
++#ifndef _PAM_USER_AUTHORIZED_KEYS_H
++#define _PAM_USER_AUTHORIZED_KEYS_H
+ 
+ #include "identity.h"
+-int pam_user_key_allowed(Key *);
+-void parse_authorized_key_file(const char *, const char *);
++const char * pam_user_key_allowed(Key *);
++void parse_authorized_key_files(const char *, const char *);
++void free_authorized_key_files();
+ 
+ #endif
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.c pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.c
+--- pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.c	2012-06-28 01:47:49.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.c	2012-12-17 19:27:30.813843933 +0000
+@@ -51,7 +51,7 @@
+ extern u_char  *session_id2;
+ extern uint8_t  session_id_len;
+ 
+-int
++const char *
+ userauth_pubkey_from_id(Identity * id)
+ {
+     Buffer          b = { 0 };
+@@ -59,11 +59,12 @@
+     u_char         *pkblob = NULL, *sig = NULL;
+     u_int           blen = 0, slen = 0;
+     int             authenticated = 0;
++    const char     *key_file;
+ 
+     pkalg = (char *) key_ssh_name(id->key);
+ 
+     /* first test if this key is even allowed */
+-    if(! pam_user_key_allowed(id->key))
++    if(!(key_file = pam_user_key_allowed(id->key)))
+         goto user_auth_clean_exit;
+ 
+     if(pamsshagentauth_key_to_blob(id->key, &pkblob, &blen) == 0)
+@@ -96,5 +97,5 @@
+     if(pkblob != NULL)
+         pamsshagentauth_xfree(pkblob);
+     CRYPTO_cleanup_all_ex_data();
+-    return authenticated;
++    return authenticated ? key_file : 0;
+ }
+diff -ru -x '*~' pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.h pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.h
+--- pam_ssh_agent_auth-0.9.4-orig/userauth_pubkey_from_id.h	2010-01-13 02:17:01.000000000 +0000
++++ pam_ssh_agent_auth-0.9.4/userauth_pubkey_from_id.h	2012-12-17 19:25:54.893412987 +0000
+@@ -32,6 +32,6 @@
+ #define _USERAUTH_PUBKEY_FROM_ID_H
+ 
+ #include <identity.h>
+-int userauth_pubkey_from_id(Identity *);
++const char * userauth_pubkey_from_id(Identity *);
+ 
+ #endif
diff --git a/pkgs/os-specific/linux/pam_unix2/default.nix b/pkgs/os-specific/linux/pam_unix2/default.nix
deleted file mode 100644
index c2eec4a2e4b..00000000000
--- a/pkgs/os-specific/linux/pam_unix2/default.nix
+++ /dev/null
@@ -1,16 +0,0 @@
-{ stdenv, fetchurl, pam, libxcrypt }:
-   
-stdenv.mkDerivation {
-  name = "pam_unix2-2.6";
-   
-  src = fetchurl {
-    url = ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2/pam_unix2-2.6.tar.bz2;
-    sha256 = "067xnyd3q8ik73glxwyx1lydk4bgl78lzq44mnqqp4jrpnpd04ml";
-  };
-
-  buildInputs = [ pam ] ++ stdenv.lib.optional (!stdenv.isArm) libxcrypt;
-
-  meta = {
-    homepage = ftp://ftp.suse.com/pub/people/kukuk/pam/pam_unix2;
-  };
-}
diff --git a/pkgs/os-specific/linux/plymouth/default.nix b/pkgs/os-specific/linux/plymouth/default.nix
new file mode 100644
index 00000000000..bf3da195467
--- /dev/null
+++ b/pkgs/os-specific/linux/plymouth/default.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, cairo, gtk, libdrm, libpng, makeWrapper, pango, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "plymouth-${version}";
+  version = "0.8.8";
+
+  src = fetchurl {
+    url = "http://www.freedesktop.org/software/plymouth/releases/${name}.tar.bz2";
+    sha256 = "16vm3llgci7h63jaclfskj1ii61d8psq7ny2mncml6m3sghs9b8v";
+  };
+
+  buildInputs = [ cairo gtk libdrm libpng makeWrapper pango pkgconfig ];
+
+  configurePhase = ''
+    export DESTDIR=$out
+    ./configure \
+      -bindir=$out/bin \
+      -sbindir=$out/sbin \
+      --prefix=$out \
+      --exec-prefix=$out \
+      --libdir=$out/lib \
+      --libexecdir=$out/lib \
+      --enable-tracing \
+      --sysconfdir=/etc \
+      --localstatedir=/var \
+      --without-system-root-install \
+      --enable-gtk
+  '';
+#      --enable-systemd-integration
+#      -datadir=/share \
+#      --with-rhgb-compat-link \
+
+  preInstall = "mkdir -p $out/bin $out/sbin";
+
+  postInstall = ''
+    cd $out/$out
+    mv bin/* $out/bin
+    mv sbin/* $out/sbin
+
+    rmdir bin
+    rmdir sbin
+    mv * $out/
+    sed -e "s#> $output##" \
+      -e "s#> /dev/stderr##" \
+      -i $out/lib/plymouth/plymouth-populate-initrd
+    wrapProgram $out/lib/plymouth/plymouth-populate-initrd \
+      --set PATH $PATH:$out/bin:$out/sbin
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.freedesktop.org/wiki/Software/Plymouth;
+    description = "A graphical boot animation";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/os-specific/linux/pm-utils/default.nix b/pkgs/os-specific/linux/pm-utils/default.nix
index f20cadabc53..e3b6168be9b 100644
--- a/pkgs/os-specific/linux/pm-utils/default.nix
+++ b/pkgs/os-specific/linux/pm-utils/default.nix
@@ -8,8 +8,8 @@ let
 
   sbinPath = stdenv.lib.makeSearchPath "sbin"
     [ procps ];
-    
-in 
+
+in
 
 stdenv.mkDerivation rec {
   name = "pm-utils-1.4.1";
@@ -30,15 +30,26 @@ stdenv.mkDerivation rec {
       substituteInPlace pm/pm-functions.in --replace '/sbin:/usr/sbin:/bin:/usr/bin' '$PATH:${binPath}:${sbinPath}'
 
       substituteInPlace src/pm-action.in --replace 'tr ' '${coreutils}/bin/tr '
-      
+
       substituteInPlace pm/sleep.d/00logging --replace /bin/uname "$(type -P uname)"
 
       substituteInPlace pm/sleep.d/90clock --replace /sbin/hwclock hwclock
     '';
 
+  postInstall =
+    ''
+      # Remove some hooks that have doubtful usefulness.  See
+      # http://zinc.canonical.com/~cking/power-benchmarking/pm-utils-results/results.txt.
+      # In particular, journal-commit breaks things if you have
+      # read-only bind mounts, since it ends up remounting the
+      # underlying filesystem read-only.
+      rm $out/lib/pm-utils/power.d/{journal-commit,readahead}
+    '';
+
   meta = {
     homepage = http://pm-utils.freedesktop.org/wiki/;
     description = "A small collection of scripts that handle suspend and resume on behalf of HAL";
     license = "GPLv2";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/pmtools/default.nix b/pkgs/os-specific/linux/pmtools/default.nix
new file mode 100644
index 00000000000..13a6e87319e
--- /dev/null
+++ b/pkgs/os-specific/linux/pmtools/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "pmtools-20071116";
+
+  src = fetchurl {
+    url = "http://www.lesswatts.org/patches/linux_acpi/${name}.tar.gz";
+    sha256 = "91751774976e39f6237efd0326eb35196a9346220b92ad35894a33283e872748";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/pmtools
+    cp acpidump/acpidump acpixtract/acpixtract madt/madt $out/bin/
+    cp README $out/share/pmtools/
+  '';
+
+  meta = {
+    homepage = http://www.lesswatts.org/projects/acpi/utilities.php;
+    description = "Linux ACPI utilities";
+    license = "GPLv2";
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/os-specific/linux/policycoreutils/default.nix b/pkgs/os-specific/linux/policycoreutils/default.nix
index b75405b4272..e49525a42bf 100644
--- a/pkgs/os-specific/linux/policycoreutils/default.nix
+++ b/pkgs/os-specific/linux/policycoreutils/default.nix
@@ -1,25 +1,39 @@
-{ stdenv, fetchurl, libsepol, libselinux }:
+{ stdenv, fetchurl, intltool, pcre, libcap_ng, libcgroup
+, libsepol, libselinux, libsemanage
+, python, sepolgen }:
 stdenv.mkDerivation rec {
 
   name = "policycoreutils-${version}";
-  version = "2.0.85";
+  version = "2.1.13";
+  inherit (libsepol) se_release se_url;
 
   src = fetchurl {
-    url = http://userspace.selinuxproject.org/releases/20101221/devel/policycoreutils-2.0.85.tar.gz;
-    sha256 = "01q5ifacg24k9jdz85j9m17ps2l1p7abvh8pzy6qz55y68rycifb";
+    url = "${se_url}/${se_release}/policycoreutils-${version}.tar.gz";
+    sha256 = "1145nbpwndmhma08vvj1j75bjd8xhjal0vjpazlrw78iyc30y11l";
   };
 
-  buildInputs = [ libsepol libselinux ];
+  patchPhase = ''
+    substituteInPlace po/Makefile --replace /usr/bin/install install
+  '';
 
-  NIX_LDFLAGS = "-lsepol";
+  buildInputs = [ intltool pcre libcap_ng libcgroup
+    libsepol libselinux  libsemanage
+    python sepolgen # ToDo? these are optional
+  ];
 
-  makeFlags = "LOCALEDIR=$(out)/share/locale";
+  preBuild = ''
+    mkdir -p "$out/lib" && cp -s "${libsepol}/lib/libsepol.a" "$out/lib"
+  '';
+
+  NIX_CFLAGS_COMPILE = "-fstack-protector-all";
+  NIX_LDFLAGS = "-lsepol -lpcre";
+
+  makeFlags = "PREFIX=$(out) DESTDIR=$(out) LOCALEDIR=$(out)/share/locale";
 
   meta = with stdenv.lib; {
-    homepage = http://userspace.selinuxproject.org/;
     description = "SELinux policy core utilities";
     license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
+    inherit (libsepol.meta) homepage platforms maintainers;
   };
-}
\ No newline at end of file
+}
+
diff --git a/pkgs/os-specific/linux/powertop/default.nix b/pkgs/os-specific/linux/powertop/default.nix
index d175c5f0478..4de8ad6db0f 100644
--- a/pkgs/os-specific/linux/powertop/default.nix
+++ b/pkgs/os-specific/linux/powertop/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchurl, gettext, libnl1, ncurses, pciutils, pkgconfig, zlib }:
+{ stdenv, fetchurl, gettext, libnl, ncurses, pciutils, pkgconfig, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "powertop-2.0";
+  name = "powertop-2.2";
+
   src = fetchurl {
-    url = "https://01.org/powertop/sites/default/files/downloads/${name}.tar.bz2";
-    sha256 = "7af51d320856b3446bcc314c9414385f3b05b9360f650883b0210cd3b12c5c1c";
+    url = "https://01.org/powertop/sites/default/files/downloads/${name}.tar.gz";
+    sha256 = "0a5haxawcjrlwwxx4j5kd4ad05gjmcr13v8gswfwfxcn7fyf2f8k";
   };
 
-  buildInputs = [ gettext libnl1 ncurses pciutils pkgconfig zlib ];
+  buildInputs = [ gettext libnl ncurses pciutils pkgconfig zlib ];
 
   meta = {
     description = "Analyze power consumption on Intel-based laptops";
diff --git a/pkgs/os-specific/linux/procps-ng/default.nix b/pkgs/os-specific/linux/procps-ng/default.nix
new file mode 100644
index 00000000000..6099505f1d6
--- /dev/null
+++ b/pkgs/os-specific/linux/procps-ng/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation {
+  name = "procps-ng-3.3.6";
+
+  src = fetchurl {
+    url = mirror://sourceforge/procps-ng/procps-ng-3.3.6.tar.xz;
+    sha256 = "0k0j3ilzfpw8n3y058ymgfmafdfqqqwpqm7nh7a35xlk6zgw96nh";
+  };
+
+  buildInputs = [ ncurses ];
+
+  makeFlags = "usrbin_execdir=$(out)/bin";
+
+  enableParallelBuilding = true;
+
+  crossAttrs = {
+    CC = stdenv.cross.config + "-gcc";
+  };
+
+  meta = {
+    homepage = http://sourceforge.net/projects/procps-ng/;
+    description = "Utilities that give information about processes using the /proc filesystem";
+    priority = 10; # less than coreutils, which also provides "kill" and "uptime"
+  };
+}
diff --git a/pkgs/os-specific/linux/pwdutils/default.nix b/pkgs/os-specific/linux/pwdutils/default.nix
deleted file mode 100644
index 98b9ab70735..00000000000
--- a/pkgs/os-specific/linux/pwdutils/default.nix
+++ /dev/null
@@ -1,42 +0,0 @@
-{ stdenv, fetchurl, pam, gnutls, libnscd }:
-
-stdenv.mkDerivation rec {
-  name = "pwdutils-3.2.6";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/utils/net/NIS/${name}.tar.bz2";
-    sha256 = "1pyawvv9x0hiachn1mb257s6hm92dh1ykczgp7ik8z6jl020z3n7";
-  };
-
-  buildInputs = [ pam gnutls libnscd ];
-
-  patches = [ ./sys-stat-h.patch ];
-
-  postPatch =
-    '' for i in src/tst-*
-       do
-         sed -i "$i" -e's|/bin/bash|/bin/sh|g'
-       done
-    '';
-
-  configureFlags = "--disable-ldap --enable-gnutls --exec-prefix=$(out)";
-
-  # FIXME: The test suite seems to make assumptions that don't hold in Nix
-  # chroots.
-  doCheck = false;
-
-  meta = {
-    description = "Linux pwdutils, utilities to manage passwd information";
-
-    longDescription =
-      '' Pwdutils is a collection of utilities to manage the passwd
-         information stored in local files, NIS, NIS+ or LDAP and can replace
-         the shadow suite complete.
-      '';
-
-    license = "GPLv2";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/os-specific/linux/pwdutils/sys-stat-h.patch b/pkgs/os-specific/linux/pwdutils/sys-stat-h.patch
deleted file mode 100644
index 5b5bc8440d5..00000000000
--- a/pkgs/os-specific/linux/pwdutils/sys-stat-h.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Fix builds with current glibc git, which appears to be stricter
-about <sys/stat.h>.
-
---- pwdutils-3.2.6/src/useradd.c~	2008-10-16 13:46:07.000000000 +0200
-+++ pwdutils-3.2.6/src/useradd.c	2010-04-26 11:24:43.000000000 +0200
-@@ -18,6 +18,7 @@
- #include "config.h"
- #endif
- 
-+#include <sys/stat.h>
- #include <time.h>
- #include <utmp.h>
- #include <fcntl.h>
-
---- pwdutils-3.2.6/src/userdel.c~	2006-11-29 14:20:39.000000000 +0100
-+++ pwdutils-3.2.6/src/userdel.c	2010-04-26 11:26:08.000000000 +0200
-@@ -18,6 +18,7 @@
- #include "config.h"
- #endif
- 
-+#include <sys/stat.h>
- #include <time.h>
- #include <utmp.h>
- #include <fcntl.h>
-
-diff -ubB --show-c-function pwdutils-3.2.6/src/usermod.c\~ pwdutils-3.2.6/src/usermod.c
---- pwdutils-3.2.6/src/usermod.c~	2006-11-29 14:20:41.000000000 +0100
-+++ pwdutils-3.2.6/src/usermod.c	2010-04-26 11:27:41.000000000 +0200
-@@ -18,6 +18,7 @@
- #include "config.h"
- #endif
- 
-+#include <sys/stat.h>
- #include <time.h>
- #include <utmp.h>
- #include <fcntl.h>
-
diff --git a/pkgs/os-specific/linux/qemu-kvm/default.nix b/pkgs/os-specific/linux/qemu-kvm/default.nix
index f6709bb439f..eeaeacd4660 100644
--- a/pkgs/os-specific/linux/qemu-kvm/default.nix
+++ b/pkgs/os-specific/linux/qemu-kvm/default.nix
@@ -1,41 +1,39 @@
 { stdenv, fetchurl, attr, zlib, SDL, alsaLib, pkgconfig, pciutils, libuuid, vde2
-, libjpeg, libpng, ncurses, python, glib, libaio, mesa }:
+, libjpeg, libpng, ncurses, python, glib, libaio, mesa, perl, texinfo
+, spice, spice_protocol, spiceSupport ? false }:
 
 assert stdenv.isLinux;
 
-let version = "1.0.1"; in
+let version = "1.2.0"; in
 
 stdenv.mkDerivation rec {
   name = "qemu-kvm-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/kvm/qemu-kvm/${version}/${name}.tar.gz";
-    sha256 = "0kxzwaw8h71mqcm46angpyx8gd58ascrxnr861k068xg89ix5g2p";
+    sha256 = "018vb5nmk2fsm143bs2bl2wirhasd4b10d7jchl32zik4inbk2p9";
   };
 
-  patches = [ ./smb-tmpdir.patch ./qemu-img-fix-corrupt-vdi.patch ];
+  buildInputs =
+    [ attr zlib SDL alsaLib pkgconfig pciutils libuuid vde2 libjpeg libpng
+      ncurses python glib libaio mesa texinfo perl
+    ] ++ stdenv.lib.optionals spiceSupport [ spice_protocol spice ];
+
+  patches = [ ./fix-librt-check.patch ./fix-usb-passthrough.patch ];
 
-  postPatch =
-    '' for i in $(find kvm -type f)
-       do
-         sed -i "$i" \
-             -e 's|/bin/bash|/bin/sh|g ;
-                 s|/usr/bin/python|${python}/bin/python|g ;
-                 s|/bin/rm|rm|g'
+  postPatch = "patchShebangs .;"
+    + stdenv.lib.optionalString spiceSupport ''
+       for i in configure spice-qemu-char.c ui/spice-input.c ui/spice-core.c ui/qemu-spice.h; do
+         substituteInPlace $i --replace '#include <spice.h>' '#include <spice/spice.h>'
        done
     '';
 
   configureFlags =
     [ "--audio-drv-list=alsa"
       "--smbd=smbd"                               # use `smbd' from $PATH
-    ];
-
-  enableParallelBuilding = true;
-
-  buildInputs =
-    [ attr zlib SDL alsaLib pkgconfig pciutils libuuid vde2 libjpeg libpng
-      ncurses python glib libaio mesa
-    ];
+      "--enable-docs"
+      "--python=${python}/bin/python"
+    ] ++ stdenv.lib.optional spiceSupport "--enable-spice";
 
   postInstall =
     ''
@@ -45,6 +43,10 @@ stdenv.mkDerivation rec {
       ln -sv $(cd $out/bin && echo qemu-system-*) $out/bin/qemu-kvm
     '';
 
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://www.linux-kvm.org/;
     description = "A full virtualization solution for Linux on x86 hardware containing virtualization extensions";
diff --git a/pkgs/os-specific/linux/qemu-kvm/fix-librt-check.patch b/pkgs/os-specific/linux/qemu-kvm/fix-librt-check.patch
new file mode 100644
index 00000000000..57de288723e
--- /dev/null
+++ b/pkgs/os-specific/linux/qemu-kvm/fix-librt-check.patch
@@ -0,0 +1,72 @@
+commit 8bacde8d86a09699207d85d4bab06162aed18dc4
+Author: Natanael Copa <natanael.copa@gmail.com>
+Date:   Wed Sep 12 09:06:51 2012 +0000
+
+    configure: properly check if -lrt and -lm is needed
+    
+    Fixes build against uClibc.
+    
+    uClibc provides 2 versions of clock_gettime(), one with realtime
+    support and one without (this is so you can avoid linking in -lrt
+    unless actually needed). This means that the clock_gettime() don't
+    need -lrt. We still need it for timer_create() so we check for this
+    function in addition.
+    
+    We also need check if -lm is needed for isnan().
+    
+    Both -lm and -lrt are needed for libs_qga.
+    
+    Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
+    Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
+
+diff --git a/configure b/configure
+index 7656c32..9ab13db 100755
+--- a/configure
++++ b/configure
+@@ -2671,17 +2671,44 @@ fi
+ 
+ 
+ ##########################################
++# Do we need libm
++cat > $TMPC << EOF
++#include <math.h>
++int main(void) { return isnan(sin(0.0)); }
++EOF
++if compile_prog "" "" ; then
++  :
++elif compile_prog "" "-lm" ; then
++  LIBS="-lm $LIBS"
++  libs_qga="-lm $libs_qga"
++else
++  echo
++  echo "Error: libm check failed"
++  echo
++  exit 1
++fi
++
++##########################################
+ # Do we need librt
++# uClibc provides 2 versions of clock_gettime(), one with realtime
++# support and one without. This means that the clock_gettime() don't
++# need -lrt. We still need it for timer_create() so we check for this
++# function in addition.
+ cat > $TMPC <<EOF
+ #include <signal.h>
+ #include <time.h>
+-int main(void) { return clock_gettime(CLOCK_REALTIME, NULL); }
++int main(void) {
++  timer_create(CLOCK_REALTIME, NULL, NULL);
++  return clock_gettime(CLOCK_REALTIME, NULL);
++}
+ EOF
+ 
+ if compile_prog "" "" ; then
+   :
+-elif compile_prog "" "-lrt" ; then
++# we need pthread for static linking. use previous pthread test result
++elif compile_prog "" "-lrt $pthread_lib" ; then
+   LIBS="-lrt $LIBS"
++  libs_qga="-lrt $libs_qga"
+ fi
+ 
+ if test "$darwin" != "yes" -a "$mingw32" != "yes" -a "$solaris" != yes -a \
diff --git a/pkgs/os-specific/linux/qemu-kvm/fix-usb-passthrough.patch b/pkgs/os-specific/linux/qemu-kvm/fix-usb-passthrough.patch
new file mode 100644
index 00000000000..a73df310629
--- /dev/null
+++ b/pkgs/os-specific/linux/qemu-kvm/fix-usb-passthrough.patch
@@ -0,0 +1,45 @@
+https://bugs.launchpad.net/qemu/+bug/1033727
+
+From: Hans de Goede <hdegoede@redhat.com>
+Date: Wed, 12 Sep 2012 13:08:40 +0000 (+0200)
+Subject: uhci: Don't queue up packets after one with the SPD flag set
+X-Git-Tag: v1.3.0-rc0~483^2
+X-Git-Url: http://git.qemu.org/?p=qemu.git;a=commitdiff_plain;h=72a04d0c178f01908d74539230d9de64ffc6da19
+Bug-Debian: http://bugs.debian.org/683983
+
+uhci: Don't queue up packets after one with the SPD flag set
+
+Don't queue up packets after a packet with the SPD (short packet detect)
+flag set. Since we won't know if the packet will actually be short until it
+has completed, and if it is short we should stop the queue.
+
+This fixes a miniature photoframe emulating a USB cdrom with the windows
+software for it not working.
+
+Signed-off-by: Hans de Goede <hdegoede@redhat.com>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+---
+
+diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
+index c7c8786..cdc8bc3 100644
+--- a/hw/usb/hcd-uhci.c
++++ b/hw/usb/hcd-uhci.c
+@@ -1000,6 +1000,9 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td)
+         }
+         assert(ret == TD_RESULT_ASYNC_START);
+         assert(int_mask == 0);
++        if (ptd.ctrl & TD_CTRL_SPD) {
++            break;
++        }
+         plink = ptd.link;
+     }
+ }
+@@ -1097,7 +1100,7 @@ static void uhci_process_frame(UHCIState *s)
+ 
+         case TD_RESULT_ASYNC_START:
+             trace_usb_uhci_td_async(curr_qh & ~0xf, link & ~0xf);
+-            if (is_valid(td.link)) {
++            if (is_valid(td.link) && !(td.ctrl & TD_CTRL_SPD)) {
+                 uhci_fill_queue(s, &td);
+             }
+             link = curr_qh ? qh.link : td.link;
diff --git a/pkgs/os-specific/linux/qemu-kvm/qemu-img-fix-corrupt-vdi.patch b/pkgs/os-specific/linux/qemu-kvm/qemu-img-fix-corrupt-vdi.patch
deleted file mode 100644
index 446a69a146b..00000000000
--- a/pkgs/os-specific/linux/qemu-kvm/qemu-img-fix-corrupt-vdi.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-From http://patchwork.ozlabs.org/patch/137186/
-
-diff -ru qemu-kvm-0.15.1-orig/block/vdi.c qemu-kvm-0.15.1/block/vdi.c
---- qemu-kvm-0.15.1-orig/block/vdi.c	2011-10-19 15:54:48.000000000 +0200
-+++ qemu-kvm-0.15.1/block/vdi.c	2012-02-25 18:15:36.114574574 +0100
-@@ -1,7 +1,7 @@
- /*
-  * Block driver for the Virtual Disk Image (VDI) format
-  *
-- * Copyright (c) 2009 Stefan Weil
-+ * Copyright (c) 2009, 2012 Stefan Weil
-  *
-  * This program is free software: you can redistribute it and/or modify
-  * it under the terms of the GNU General Public License as published by
-@@ -767,8 +767,12 @@
-             acb->header_modified = 1;
-         }
-         acb->bmap_last = block_index;
-+        /* Copy data to be written to new block and zero unused parts. */
-+        memset(block, 0, sector_in_block * SECTOR_SIZE);
-         memcpy(block + sector_in_block * SECTOR_SIZE,
-                acb->buf, n_sectors * SECTOR_SIZE);
-+        memset(block + (sector_in_block + n_sectors) * SECTOR_SIZE, 0,
-+               (s->block_sectors - n_sectors - sector_in_block) * SECTOR_SIZE);
-         acb->hd_iov.iov_base = (void *)block;
-         acb->hd_iov.iov_len = s->block_size;
-         qemu_iovec_init_external(&acb->hd_qiov, &acb->hd_iov, 1);
diff --git a/pkgs/os-specific/linux/qemu-kvm/smb-tmpdir.patch b/pkgs/os-specific/linux/qemu-kvm/smb-tmpdir.patch
deleted file mode 100644
index 6d6c7831d15..00000000000
--- a/pkgs/os-specific/linux/qemu-kvm/smb-tmpdir.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-Honour $TMPDIR for the qemu-smb temporary directory.
-
-diff -rc -x '*~' qemu-kvm-0.12.2-orig/net/slirp.c qemu-kvm-0.12.2/net/slirp.c
-*** qemu-kvm-0.12.2-orig/net/slirp.c	2010-02-01 19:05:24.000000000 +0100
---- qemu-kvm-0.12.2/net/slirp.c	2010-02-01 19:05:54.000000000 +0100
-***************
-*** 476,486 ****
-                       struct in_addr vserver_addr)
-  {
-      static int instance;
-!     char smb_conf[128];
-!     char smb_cmdline[128];
-      FILE *f;
-  
-!     snprintf(s->smb_dir, sizeof(s->smb_dir), "/tmp/qemu-smb.%ld-%d",
-               (long)getpid(), instance++);
-      if (mkdir(s->smb_dir, 0700) < 0) {
-          qemu_error("could not create samba server dir '%s'\n", s->smb_dir);
---- 476,489 ----
-                       struct in_addr vserver_addr)
-  {
-      static int instance;
-!     char smb_conf[1024];
-!     char smb_cmdline[1024];
-      FILE *f;
-  
-!     char *tmpdir = getenv("TMPDIR");
-! 
-!     snprintf(s->smb_dir, sizeof(s->smb_dir), "%s/qemu-smb.%ld-%d",
-!              tmpdir ? tmpdir : "/tmp",
-               (long)getpid(), instance++);
-      if (mkdir(s->smb_dir, 0700) < 0) {
-          qemu_error("could not create samba server dir '%s'\n", s->smb_dir);
diff --git a/pkgs/os-specific/linux/reptyr/default.nix b/pkgs/os-specific/linux/reptyr/default.nix
new file mode 100644
index 00000000000..573f1a578c7
--- /dev/null
+++ b/pkgs/os-specific/linux/reptyr/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchgit}:
+stdenv.mkDerivation rec {
+  version = "0.4";
+  name = "reptyr-${version}";
+  src = fetchgit {
+    url = "https://github.com/nelhage/reptyr.git";
+    rev = "refs/tags/${name}";
+    sha256 = "2d2814c210e4bde6f9bcf3aa20477287d7e4a5aa7ee09110b37d2eaaf7e5ecae";
+  };
+  makeFlags = ["PREFIX=$(out)"];
+  meta = {
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = stdenv.lib.licenses.mit;
+    description = ''A Linux tool to change controlling pty of a process'';
+  };
+}
diff --git a/pkgs/os-specific/linux/sepolgen/default.nix b/pkgs/os-specific/linux/sepolgen/default.nix
index a17a4153c47..7139ec98c28 100644
--- a/pkgs/os-specific/linux/sepolgen/default.nix
+++ b/pkgs/os-specific/linux/sepolgen/default.nix
@@ -1,22 +1,22 @@
-{ stdenv, fetchurl, python }:
-stdenv.mkDerivation rec {
+{ stdenv, fetchurl, libsepol, python }:
 
+stdenv.mkDerivation rec {
   name = "sepolgen-${version}";
-  version = "1.0.23";
+  version = "1.1.8";
+  inherit (libsepol) se_release se_url;
 
   src = fetchurl {
-    url = http://userspace.selinuxproject.org/releases/20101221/devel/sepolgen-1.0.23.tar.gz;
-    sha256 = "04d11l091iclp8lnay9as7y473ydrjz7171h95ddsbn0ihj5if2p";
+    url = "${se_url}/${se_release}/sepolgen-${version}.tar.gz";
+    sha256 = "1sssc9d4wz7l23yczlzplsmdr891sqr9w34ccn1bfwlnc4q63xdm";
   };
 
+  makeFlags = "PREFIX=$(out) DESTDIR=$(out) PYTHONLIBDIR=lib/${python.libPrefix}/site-packages";
+
   buildInputs = [ python ];
-  preBuild = '' makeFlags="$makeFlags DESTDIR=$out PACKAGEDIR=$out/lib/${python.libPrefix}/site-packages/sepolgen" '';
 
   meta = with stdenv.lib; {
-    homepage = http://userspace.selinuxproject.org/;
-    description = "Python module for SELinux policy generation";
+    inherit (libsepol.meta) homepage platforms maintainers;
+    description = "SELinux policy generation library";
     license = licenses.gpl2;
-    maintainers = [ maintainers.phreedom ];
-    platforms = platforms.linux;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/os-specific/linux/shadow/default.nix b/pkgs/os-specific/linux/shadow/default.nix
index d401a04e6b9..1055fccd8aa 100644
--- a/pkgs/os-specific/linux/shadow/default.nix
+++ b/pkgs/os-specific/linux/shadow/default.nix
@@ -7,6 +7,11 @@ let
     then glibcCross
     else assert stdenv ? glibc; stdenv.glibc;
 
+  dots_in_usernames = fetchurl {
+    url = http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/sys-apps/shadow/files/shadow-4.1.3-dots-in-usernames.patch;
+    sha256 = "1fj3rg6x3jppm5jvi9y7fhd2djbi4nc5pgwisw00xlh4qapgz692";
+  };
+
 in
 
 stdenv.mkDerivation rec {
@@ -19,7 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optional (pam != null && stdenv.isLinux) pam;
 
-  patches = [ ./keep-path.patch ];
+  patches = [ ./keep-path.patch dots_in_usernames ];
 
   # Assume System V `setpgrp (void)', which is the default on GNU variants
   # (`AC_FUNC_SETPGRP' is not cross-compilation capable.)
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
new file mode 100644
index 00000000000..75ff2893972
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, kernelDev, perl, autoconf, automake, libtool, coreutils, gawk }:
+
+stdenv.mkDerivation {
+  name = "spl-0.6.1-${kernelDev.version}";
+  src = fetchurl {
+    url = "http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-0.6.1.tar.gz";
+    sha256 = "1bnianc00bkpdbcmignzqfv9yr8h6vj56wfl7lkhi9a5m5b3xakb";
+  };
+
+  patches = [ ./install_prefix.patch ];
+
+  buildInputs = [ perl kernelDev autoconf automake libtool ];
+
+  preConfigure = ''
+    ./autogen.sh
+
+    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
+    substituteInPlace ./module/spl/spl-module.c  --replace /bin/mknod mknod 
+
+    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
+    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+    substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+  '';
+
+  configureFlags = ''
+     --with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
+     --with-linux-obj=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build
+  '';
+
+  meta = {
+    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
+
+    longDescription = ''
+      This kernel module is a porting layer for ZFS to work inside the linux
+      kernel. 
+    '';
+
+    homepage = http://zfsonlinux.org/;
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/os-specific/linux/spl/install_prefix.patch b/pkgs/os-specific/linux/spl/install_prefix.patch
new file mode 100644
index 00000000000..6b3bd515bd0
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/install_prefix.patch
@@ -0,0 +1,274 @@
+diff -rc spl-0.6.1.orig/include/fs/Makefile.am spl-0.6.1/include/fs/Makefile.am
+*** spl-0.6.1.orig/include/fs/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/fs/Makefile.am	2013-04-05 22:10:41.436764000 -0700
+***************
+*** 8,13 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/fs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 8,13 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/fs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/linux/Makefile.am spl-0.6.1/include/linux/Makefile.am
+*** spl-0.6.1.orig/include/linux/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/linux/Makefile.am	2013-04-05 22:10:27.789139000 -0700
+***************
+*** 23,28 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/linux
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 23,28 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/linux
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/Makefile.am spl-0.6.1/include/Makefile.am
+*** spl-0.6.1.orig/include/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/Makefile.am	2013-04-05 22:10:45.108623000 -0700
+***************
+*** 16,21 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 16,21 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/rpc/Makefile.am spl-0.6.1/include/rpc/Makefile.am
+*** spl-0.6.1.orig/include/rpc/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/rpc/Makefile.am	2013-04-05 22:11:08.724410000 -0700
+***************
+*** 9,14 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/rpc
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 9,14 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/rpc
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/sharefs/Makefile.am spl-0.6.1/include/sharefs/Makefile.am
+*** spl-0.6.1.orig/include/sharefs/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/sharefs/Makefile.am	2013-04-05 22:10:38.852722000 -0700
+***************
+*** 8,13 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/sharefs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 8,13 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/sharefs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/sys/fm/Makefile.am spl-0.6.1/include/sys/fm/Makefile.am
+*** spl-0.6.1.orig/include/sys/fm/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/sys/fm/Makefile.am	2013-04-05 22:10:59.964334000 -0700
+***************
+*** 9,14 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/sys/fm
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 9,14 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/sys/fm
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/sys/fs/Makefile.am spl-0.6.1/include/sys/fs/Makefile.am
+*** spl-0.6.1.orig/include/sys/fs/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/sys/fs/Makefile.am	2013-04-05 22:10:57.860366000 -0700
+***************
+*** 8,13 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/sys/fs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 8,13 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/sys/fs
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/sys/Makefile.am spl-0.6.1/include/sys/Makefile.am
+*** spl-0.6.1.orig/include/sys/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/sys/Makefile.am	2013-04-05 22:11:05.788303000 -0700
+***************
+*** 104,110 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/sys
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+  
+--- 104,110 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/sys
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+  
+diff -rc spl-0.6.1.orig/include/sys/sysevent/Makefile.am spl-0.6.1/include/sys/sysevent/Makefile.am
+*** spl-0.6.1.orig/include/sys/sysevent/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/sys/sysevent/Makefile.am	2013-04-05 22:10:54.364458000 -0700
+***************
+*** 8,13 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/sys/sysevent
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 8,13 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/sys/sysevent
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/util/Makefile.am spl-0.6.1/include/util/Makefile.am
+*** spl-0.6.1.orig/include/util/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/util/Makefile.am	2013-04-05 22:10:49.452569000 -0700
+***************
+*** 9,14 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/util
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 9,14 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/util
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/include/vm/Makefile.am spl-0.6.1/include/vm/Makefile.am
+*** spl-0.6.1.orig/include/vm/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/include/vm/Makefile.am	2013-04-05 22:10:47.444535000 -0700
+***************
+*** 10,15 ****
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/spl-$(VERSION)/include/vm
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+--- 10,15 ----
+  EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/libexec/spl/include/vm
+  kernel_HEADERS = $(KERNEL_H)
+  endif
+diff -rc spl-0.6.1.orig/Makefile.am spl-0.6.1/Makefile.am
+*** spl-0.6.1.orig/Makefile.am	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/Makefile.am	2013-04-05 22:09:52.429676000 -0700
+***************
+*** 9,18 ****
+  if CONFIG_KERNEL
+  SUBDIRS += module
+  
+! extradir = /usr/src/spl-$(VERSION)
+  extra_HEADERS = spl.release.in spl_config.h.in
+  
+! kerneldir = /usr/src/spl-$(VERSION)/$(LINUX_VERSION)
+  nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
+  endif
+  
+--- 9,18 ----
+  if CONFIG_KERNEL
+  SUBDIRS += module
+  
+! extradir = @prefix@/libexec/spl
+  extra_HEADERS = spl.release.in spl_config.h.in
+  
+! kerneldir = @prefix@/libexec/spl/$(LINUX_VERSION)
+  nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
+  endif
+  
+diff -rc spl-0.6.1.orig/module/Makefile.in spl-0.6.1/module/Makefile.in
+*** spl-0.6.1.orig/module/Makefile.in	2013-03-26 09:37:39.000000000 -0700
+--- spl-0.6.1/module/Makefile.in	2013-03-28 10:21:59.093481000 -0700
+***************
+*** 21,41 ****
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+! 		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
+  		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
+  	@# Remove extraneous build products when packaging
+! 	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+  	if [ -n $$kmoddir ]; then \
+  		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
+  
+  modules_uninstall:
+  	@# Uninstall the kernel modules
+! 	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
+  	list='$(subdir-m)'; for subdir in $$list; do \
+  		$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
+  	done
+--- 21,41 ----
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+! 		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
+  		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
+  	@# Remove extraneous build products when packaging
+! 	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+  	if [ -n $$kmoddir ]; then \
+  		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
+  
+  modules_uninstall:
+  	@# Uninstall the kernel modules
+! 	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
+  	list='$(subdir-m)'; for subdir in $$list; do \
+  		$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
+  	done
diff --git a/pkgs/os-specific/linux/sysfsutils/default.nix b/pkgs/os-specific/linux/sysfsutils/default.nix
index cecb65f50a2..bf6dafae10a 100644
--- a/pkgs/os-specific/linux/sysfsutils/default.nix
+++ b/pkgs/os-specific/linux/sysfsutils/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "sysfsutils-2.1.0";
 
   src = fetchurl {
-    url = "http://kent.dl.sourceforge.net/sourceforge/linux-diag/${name}.tar.gz";
+    url = "mirror://sourceforge/linux-diag/${name}.tar.gz";
     sha256 = "e865de2c1f559fff0d3fc936e660c0efaf7afe662064f2fb97ccad1ec28d208a";
   };
 
diff --git a/pkgs/os-specific/linux/sysklogd/systemd.patch b/pkgs/os-specific/linux/sysklogd/systemd.patch
index ecdf2b57ebf..0a7fb166bd7 100644
--- a/pkgs/os-specific/linux/sysklogd/systemd.patch
+++ b/pkgs/os-specific/linux/sysklogd/systemd.patch
@@ -1,9 +1,8 @@
 Based on http://ftp.free.org/mirrors/rsync.frugalware.org/frugalware-testing/source/apps-extra/sysklogd/sysklogd-1.5-systemd.diff
 
-diff --git a/Makefile b/Makefile
-index 9a114b8..aef1fd6 100644
---- a/Makefile
-+++ b/Makefile
+diff -ruN -x '*~' sysklogd-1.5-old/Makefile sysklogd-1.5/Makefile
+--- sysklogd-1.5-old/Makefile	2007-05-30 17:28:48.000000000 +0200
++++ sysklogd-1.5/Makefile	2013-05-09 16:01:14.428638113 +0200
 @@ -20,7 +20,7 @@
  CC= gcc
  #SKFLAGS= -g -DSYSV -Wall
@@ -13,7 +12,7 @@ index 9a114b8..aef1fd6 100644
  # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
  # -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
  # $(shell getconf LFS_SKFLAGS)
-@@ -79,8 +79,8 @@ test: syslog_tst ksym oops.ko tsyslogd
+@@ -79,8 +79,8 @@
  
  install: install_man install_exec
  
@@ -24,7 +23,7 @@ index 9a114b8..aef1fd6 100644
  
  klogd:	klogd.o syslog.o pidfile.o ksym.o ksym_mod.o
  	${CC} ${LDFLAGS} -o klogd klogd.o syslog.o pidfile.o ksym.o \
-@@ -101,6 +101,9 @@ syslogd.o: syslogd.c version.h
+@@ -101,6 +101,9 @@
  syslog.o: syslog.c
  	${CC} ${SKFLAGS} ${SYSLOG_FLAGS} -c syslog.c
  
@@ -34,11 +33,9 @@ index 9a114b8..aef1fd6 100644
  klogd.o: klogd.c klogd.h version.h
  	${CC} ${SKFLAGS} ${KLOGD_FLAGS} $(DEB) -c klogd.c
  
-diff --git a/sd-daemon.c b/sd-daemon.c
-new file mode 100644
-index 0000000..6d1eebf
---- /dev/null
-+++ b/sd-daemon.c
+diff -ruN -x '*~' sysklogd-1.5-old/sd-daemon.c sysklogd-1.5/sd-daemon.c
+--- sysklogd-1.5-old/sd-daemon.c	1970-01-01 01:00:00.000000000 +0100
++++ sysklogd-1.5/sd-daemon.c	2013-05-09 16:01:14.429638107 +0200
 @@ -0,0 +1,436 @@
 +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 +
@@ -476,11 +473,9 @@ index 0000000..6d1eebf
 +        return a.st_dev != b.st_dev;
 +#endif
 +}
-diff --git a/sd-daemon.h b/sd-daemon.h
-new file mode 100644
-index 0000000..d0a0a94
---- /dev/null
-+++ b/sd-daemon.h
+diff -ruN -x '*~' sysklogd-1.5-old/sd-daemon.h sysklogd-1.5/sd-daemon.h
+--- sysklogd-1.5-old/sd-daemon.h	1970-01-01 01:00:00.000000000 +0100
++++ sysklogd-1.5/sd-daemon.h	2013-05-09 16:01:14.429638107 +0200
 @@ -0,0 +1,265 @@
 +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
 +
@@ -747,11 +742,10 @@ index 0000000..d0a0a94
 +#endif
 +
 +#endif
-diff --git a/syslogd.c b/syslogd.c
-index acfd8f1..9bfa8c7 100644
---- a/syslogd.c
-+++ b/syslogd.c
-@@ -551,6 +551,7 @@ static char sccsid[] = "@(#)syslogd.c	5.27 (Berkeley) 10/10/88";
+diff -ruN -x '*~' sysklogd-1.5-old/syslogd.c sysklogd-1.5/syslogd.c
+--- sysklogd-1.5-old/syslogd.c	2007-07-04 21:04:01.000000000 +0200
++++ sysklogd-1.5/syslogd.c	2013-05-09 16:04:32.106602589 +0200
+@@ -551,6 +551,7 @@
  
  #if defined(__linux__)
  #include <paths.h>
@@ -759,7 +753,7 @@ index acfd8f1..9bfa8c7 100644
  #endif
  
  #ifndef UTMP_FILE
-@@ -965,8 +966,11 @@ int main(argc, argv)
+@@ -965,8 +966,11 @@
  			}
  			signal (SIGTERM, SIG_DFL);
  			num_fds = getdtablesize();
@@ -773,7 +767,7 @@ index acfd8f1..9bfa8c7 100644
  			untty();
  		}
  		else
-@@ -1253,6 +1257,60 @@ static int create_unix_socket(const char *path)
+@@ -1253,6 +1257,60 @@
  	if (path[0] == '\0')
  		return -1;
  
@@ -834,17 +828,18 @@ index acfd8f1..9bfa8c7 100644
  	(void) unlink(path);
  
  	memset(&sunx, 0, sizeof(sunx));
-@@ -2254,7 +2311,12 @@ void die(sig)
+@@ -2254,9 +2312,11 @@
  	if (InetInuse) close(inetm);
  
  	/* Clean-up files. */
 -        for (i = 0; i < nfunix; i++)
+-		if (funixn[i] && funix[i] != -1)
+-			(void)unlink(funixn[i]);
 +	i = 0;
 +#if defined(__linux__)
 +	if (sd_listen_fds(0) > 0)
 +		i = 1;
 +#endif
-+	for (; i < nfunix; i++)
- 		if (funixn[i] && funix[i] != -1)
- 			(void)unlink(funixn[i]);
  #ifndef TESTING
+ 	(void) remove_pid(PidFile);
+ #endif
diff --git a/pkgs/os-specific/linux/syslinux/default.nix b/pkgs/os-specific/linux/syslinux/default.nix
index 1287da097ca..98917f943f5 100644
--- a/pkgs/os-specific/linux/syslinux/default.nix
+++ b/pkgs/os-specific/linux/syslinux/default.nix
@@ -1,16 +1,18 @@
-{ stdenv, fetchurl, nasm, perl }:
+{ stdenv, fetchurl, nasm, perl, libuuid }:
 
 stdenv.mkDerivation rec {
-  name = "syslinux-4.03";
-  
+  name = "syslinux-4.06";
+
   src = fetchurl {
     url = "mirror://kernel/linux/utils/boot/syslinux/4.xx/${name}.tar.bz2";
-    sha256 = "0f6s1cnibw6j0jh9bn5qsx3vsar9l1w9b3xfjkvzglgr4kinfmf6";
+    sha256 = "09md61npd5z64rv5s3knl4qsn2bqsn57irm5izk6snf46r77gdyv";
   };
 
   patches = [ ./perl-deps.patch ];
-  
-  buildInputs = [ nasm perl ];
+
+  buildInputs = [ nasm perl libuuid ];
+
+  enableParallelBuilding = true;
 
   preBuild =
     ''
@@ -18,4 +20,9 @@ stdenv.mkDerivation rec {
       substituteInPlace gpxe/src/Makefile --replace /usr/bin/perl $(type -P perl)
       makeFlagsArray=(BINDIR=$out/bin SBINDIR=$out/sbin LIBDIR=$out/lib INCDIR=$out/include DATADIR=$out/share MANDIR=$out/share/man PERL=perl)
     '';
+
+  meta = {
+    homepage = http://www.syslinux.org/;
+    description = "A lightweight bootloader";
+  };
 }
diff --git a/pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch b/pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch
new file mode 100644
index 00000000000..bcc8d8f32f7
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch
@@ -0,0 +1,26 @@
+From 8f861550827e750fb56954c3f91a2f565abb42bb Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 15:44:33 +0100
+Subject: [PATCH 1/9] Make "systemctl daemon-reexec" do the right thing on
+ NixOS
+
+---
+ src/core/main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/main.c b/src/core/main.c
+index 7fc06be..7575223 100644
+--- a/src/core/main.c
++++ b/src/core/main.c
+@@ -1857,7 +1857,7 @@ finish:
+                         char_array_0(sfd);
+ 
+                         i = 0;
+-                        args[i++] = SYSTEMD_BINARY_PATH;
++                        args[i++] = "/run/current-system/systemd/lib/systemd/systemd";
+                         if (switch_root_dir)
+                                 args[i++] = "--switched-root";
+                         args[i++] = arg_running_as == SYSTEMD_SYSTEM ? "--system" : "--user";
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch b/pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch
new file mode 100644
index 00000000000..27ac6183efc
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0002-Ignore-duplicate-paths-in-systemctl-start.patch
@@ -0,0 +1,25 @@
+From 2afcee0b4da066fb5f8fc00b749d88f5bd9df3d3 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 15:45:01 +0100
+Subject: [PATCH 2/9] Ignore duplicate paths in "systemctl start"
+
+---
+ src/systemctl/systemctl.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
+index 3cca861..16791a2 100644
+--- a/src/systemctl/systemctl.c
++++ b/src/systemctl/systemctl.c
+@@ -1867,7 +1867,7 @@ static int start_unit_one(
+                         return log_oom();
+ 
+                 r = set_consume(s, p);
+-                if (r < 0) {
++                if (r < 0 && r != -EEXIST) {
+                         log_error("Failed to add path to set.");
+                         return r;
+                 }
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch b/pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch
new file mode 100644
index 00000000000..ad162fa789a
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0003-Start-device-units-for-uninitialised-encrypted-devic.patch
@@ -0,0 +1,32 @@
+From b288ca7d376e3a78368a2b59529ebe5ba812babf Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 15:46:30 +0100
+Subject: [PATCH 3/9] Start device units for uninitialised encrypted devices
+
+This is necessary because the NixOS service that initialises the
+filesystem depends on the appearance of the device unit.  Also, this
+makes more sense to me: the device is ready; it's the filesystem
+that's not, but taking care of that is the responsibility of the mount
+unit.  (However, this ignores the fsck unit, so it's not perfect...)
+---
+ rules/99-systemd.rules.in | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/rules/99-systemd.rules.in b/rules/99-systemd.rules.in
+index d17bdd9..040b10e 100644
+--- a/rules/99-systemd.rules.in
++++ b/rules/99-systemd.rules.in
+@@ -14,10 +14,6 @@ KERNEL=="vport*", TAG+="systemd"
+ SUBSYSTEM=="block", KERNEL!="ram*|loop*", TAG+="systemd"
+ SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", ENV{SYSTEMD_READY}="0"
+ 
+-# Ignore encrypted devices with no identified superblock on it, since
+-# we are probably still calling mke2fs or mkswap on it.
+-SUBSYSTEM=="block", KERNEL!="ram*|loop*", ENV{DM_UUID}=="CRYPT-*", ENV{ID_PART_TABLE_TYPE}=="", ENV{ID_FS_USAGE}=="", ENV{SYSTEMD_READY}="0"
+-
+ # Ignore raid devices that are not yet assembled and started
+ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", TEST!="md/array_state", ENV{SYSTEMD_READY}="0"
+ SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", KERNEL=="md*", ATTR{md/array_state}=="|clear|inactive", ENV{SYSTEMD_READY}="0"
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0004-Set-switch-to-configuration-hints-for-some-units.patch b/pkgs/os-specific/linux/systemd/0004-Set-switch-to-configuration-hints-for-some-units.patch
new file mode 100644
index 00000000000..7fe18f378f9
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0004-Set-switch-to-configuration-hints-for-some-units.patch
@@ -0,0 +1,74 @@
+From 7a498e661f3d111fa09700a6cfa62cfd6733b1cc Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 15:48:19 +0100
+Subject: [PATCH 4/9] Set switch-to-configuration hints for some units
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Target units like local-fs.target need ‘X-StopOnReconfiguration=yes’
+to ensure dependencies *on* that target properly take into account the
+dependencies *of* the target.
+
+‘X-RestartIfChanged=no’ is necessary for systemd-journald.service
+because restarting it causes services connected to journald to stop
+logging.
+
+‘X-RestartIfChanged=no’ is necessary for systemd-user-sessions.service
+to prevent all user sessions from being killed when this unit changes.
+---
+ units/local-fs.target                  | 2 ++
+ units/remote-fs.target                 | 2 ++
+ units/systemd-journald.service.in      | 5 +++++
+ units/systemd-user-sessions.service.in | 3 +++
+ 4 files changed, 12 insertions(+)
+
+diff --git a/units/local-fs.target b/units/local-fs.target
+index 18c3d74..a09054c 100644
+--- a/units/local-fs.target
++++ b/units/local-fs.target
+@@ -11,3 +11,5 @@ Documentation=man:systemd.special(7)
+ After=local-fs-pre.target
+ OnFailure=emergency.target
+ OnFailureIsolate=no
++
++X-StopOnReconfiguration=yes
+diff --git a/units/remote-fs.target b/units/remote-fs.target
+index 09213e8..47b4cf5 100644
+--- a/units/remote-fs.target
++++ b/units/remote-fs.target
+@@ -10,5 +10,7 @@ Description=Remote File Systems
+ Documentation=man:systemd.special(7)
+ After=remote-fs-pre.target
+ 
++X-StopOnReconfiguration=yes
++
+ [Install]
+ WantedBy=multi-user.target
+diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
+index ab2e50c..9563a7d 100644
+--- a/units/systemd-journald.service.in
++++ b/units/systemd-journald.service.in
+@@ -24,3 +24,8 @@ CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_SYS_PTRACE CAP_SYSLOG C
+ # Increase the default a bit in order to allow many simultaneous
+ # services being run since we keep one fd open per service.
+ LimitNOFILE=16384
++
++# Don't restart journald, since that causes services connected to
++# journald to stop logging (see
++# https://bugs.freedesktop.org/show_bug.cgi?id=56043).
++X-RestartIfChanged=no
+diff --git a/units/systemd-user-sessions.service.in b/units/systemd-user-sessions.service.in
+index 0869e73..b6ed958 100644
+--- a/units/systemd-user-sessions.service.in
++++ b/units/systemd-user-sessions.service.in
+@@ -15,3 +15,6 @@ Type=oneshot
+ RemainAfterExit=yes
+ ExecStart=@rootlibexecdir@/systemd-user-sessions start
+ ExecStop=@rootlibexecdir@/systemd-user-sessions stop
++
++# Restart kills all active sessions.
++X-RestartIfChanged=no
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch b/pkgs/os-specific/linux/systemd/0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
new file mode 100644
index 00000000000..78683f0cf08
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
@@ -0,0 +1,33 @@
+From e6bbe5fa858bd8196c8e1f264904679e6bda426d Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 15:56:03 +0100
+Subject: [PATCH 5/9] sysinit.target: Drop the dependency on local-fs.target
+ and swap.target
+
+Having all services with DefaultDependencies=yes depend on
+local-fs.target is annoying, because some of those services might be
+necessary to mount local filesystems.  For instance, Charon's
+send-keys feature requires sshd to be running in order to receive LUKS
+encryption keys, which in turn requires dhcpcd, and so on.  So we drop
+this dependency (and swap.target as well for consistency).  If
+services require a specific mount, they should use RequiresMountsFor
+in any case.
+---
+ units/sysinit.target | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/units/sysinit.target b/units/sysinit.target
+index 8f4fb8f..e0f0147 100644
+--- a/units/sysinit.target
++++ b/units/sysinit.target
+@@ -9,6 +9,5 @@
+ Description=System Initialization
+ Documentation=man:systemd.special(7)
+ Conflicts=emergency.service emergency.target
+-Wants=local-fs.target swap.target
+-After=local-fs.target swap.target emergency.service emergency.target
++After=emergency.service emergency.target
+ RefuseManualStart=yes
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0006-Don-t-call-plymouth-quit.patch b/pkgs/os-specific/linux/systemd/0006-Don-t-call-plymouth-quit.patch
new file mode 100644
index 00000000000..e440f6113dc
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0006-Don-t-call-plymouth-quit.patch
@@ -0,0 +1,38 @@
+From 4731a9074538e9e24d2b81fc737917b064e194e6 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 8 Jan 2013 18:36:28 +0100
+Subject: [PATCH 6/9] Don't call "plymouth quit"
+
+NixOS doesn't use Plymouth (yet).
+---
+ units/emergency.service.in | 1 -
+ units/rescue.service.m4.in | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/units/emergency.service.in b/units/emergency.service.in
+index 442f0e0..6b7eafd 100644
+--- a/units/emergency.service.in
++++ b/units/emergency.service.in
+@@ -15,7 +15,6 @@ Before=shutdown.target
+ [Service]
+ Environment=HOME=/root
+ WorkingDirectory=/root
+-ExecStartPre=-/bin/plymouth quit
+ ExecStartPre=-/bin/echo -e 'Welcome to emergency mode! After logging in, type "journalctl -xb" to view\\nsystem logs, "systemctl reboot" to reboot, "systemctl default" to try again\\nto boot into default mode.'
+ ExecStart=-/sbin/sulogin
+ ExecStopPost=@SYSTEMCTL@ --fail --no-block default
+diff --git a/units/rescue.service.m4.in b/units/rescue.service.m4.in
+index 269797a..2c640f4 100644
+--- a/units/rescue.service.m4.in
++++ b/units/rescue.service.m4.in
+@@ -16,7 +16,6 @@ Before=shutdown.target
+ [Service]
+ Environment=HOME=/root
+ WorkingDirectory=/root
+-ExecStartPre=-/bin/plymouth quit
+ ExecStartPre=-/bin/echo -e 'Welcome to rescue mode! Type "systemctl default" or ^D to enter default mode.\\nType "journalctl -xb" to view system logs. Type "systemctl reboot" to reboot.'
+ ExecStart=-/sbin/sulogin
+ ExecStopPost=-@SYSTEMCTL@ --fail --no-block default
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0007-Ignore-IPv6-link-local-addresses.patch b/pkgs/os-specific/linux/systemd/0007-Ignore-IPv6-link-local-addresses.patch
new file mode 100644
index 00000000000..9c322c9fc59
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0007-Ignore-IPv6-link-local-addresses.patch
@@ -0,0 +1,37 @@
+From f0c362873860526579bf9bda216005fd5a0936dd Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Mon, 4 Feb 2013 12:41:14 +0100
+Subject: [PATCH 7/9] Ignore IPv6 link-local addresses
+
+Returning IPv6 link-local addresses is a bad idea, because they only
+work if an application connects specifically over the corresponding
+interface.  So you get errors like:
+
+  $ curl -6 http://my-machine/
+  curl: (7) Failed to connect to fe80::d6be:d9ff:fe1b:8477: Invalid argument
+
+To prevent this, this patch filters out link-local addresses.  So if
+you don't have a routable IPv6 address, nss-myhostname will fall back
+to returning ::1.
+---
+ src/nss-myhostname/netlink.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/nss-myhostname/netlink.c b/src/nss-myhostname/netlink.c
+index b1ef912..4f2ab5c 100644
+--- a/src/nss-myhostname/netlink.c
++++ b/src/nss-myhostname/netlink.c
+@@ -113,6 +113,10 @@ static int read_reply(int fd, struct address **list, unsigned *n_list) {
+                     ifaddrmsg->ifa_scope == RT_SCOPE_NOWHERE)
+                         continue;
+ 
++                if (ifaddrmsg->ifa_family == AF_INET6 &&
++                    ifaddrmsg->ifa_scope == RT_SCOPE_LINK)
++                        continue;
++
+                 if (ifaddrmsg->ifa_flags & IFA_F_DEPRECATED)
+                         continue;
+ 
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch b/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch
new file mode 100644
index 00000000000..803227031f7
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0008-Don-t-try-to-unmount-nix-or-nix-store.patch
@@ -0,0 +1,28 @@
+From 0112df74e576dd683c132ec33861b7099dc94454 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Fri, 12 Apr 2013 13:16:57 +0200
+Subject: [PATCH 8/9] Don't try to unmount /nix or /nix/store
+
+They'll still be remounted read-only.
+
+https://github.com/NixOS/nixos/issues/126
+---
+ src/core/umount.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/core/umount.c b/src/core/umount.c
+index 1e95ad7..9f0e471 100644
+--- a/src/core/umount.c
++++ b/src/core/umount.c
+@@ -435,6 +435,8 @@ static int mount_points_list_umount(MountPoint **head, bool *changed, bool log_e
+                  * anyway, since we are running from it. They have
+                  * already been remounted ro. */
+                 if (path_equal(m->path, "/")
++                    || path_equal(m->path, "/nix")
++                    || path_equal(m->path, "/nix/store")
+ #ifndef HAVE_SPLIT_USR
+                     || path_equal(m->path, "/usr")
+ #endif
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/0009-Start-ctrl-alt-del.target-irreversibly.patch b/pkgs/os-specific/linux/systemd/0009-Start-ctrl-alt-del.target-irreversibly.patch
new file mode 100644
index 00000000000..d0bade9ba5b
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/0009-Start-ctrl-alt-del.target-irreversibly.patch
@@ -0,0 +1,27 @@
+From ed7c22c76e1399861ec8e0216f08a7f9419eea50 Mon Sep 17 00:00:00 2001
+From: Eelco Dolstra <eelco.dolstra@logicblox.com>
+Date: Tue, 7 May 2013 14:03:13 +0200
+Subject: [PATCH 9/9] Start ctrl-alt-del.target irreversibly
+
+This makes ctrl-alt-del reboots more robust, just like "systemctl
+reboot".
+---
+ src/core/manager.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/manager.c b/src/core/manager.c
+index c7f8f20..0508628 100644
+--- a/src/core/manager.c
++++ b/src/core/manager.c
+@@ -1372,7 +1372,7 @@ static int manager_process_signal_fd(Manager *m) {
+ 
+                 case SIGINT:
+                         if (m->running_as == SYSTEMD_SYSTEM) {
+-                                manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE);
++                                manager_start_target(m, SPECIAL_CTRL_ALT_DEL_TARGET, JOB_REPLACE_IRREVERSIBLY);
+                                 break;
+                         }
+ 
+-- 
+1.8.2.1
+
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index e6e5822c9ea..2482f808cac 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -1,66 +1,97 @@
 { stdenv, fetchurl, pkgconfig, intltool, gperf, libcap, dbus, kmod
-, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, usbutils, pciutils
-, glib, kbd
+, xz, pam, acl, cryptsetup, libuuid, m4, utillinux
+, glib, kbd, libxslt, coreutils, libgcrypt, sysvtools, docbook_xsl
 }:
 
 assert stdenv.gcc.libc or null != null;
 
 stdenv.mkDerivation rec {
-  name = "systemd-188";
+  name = "systemd-203";
 
   src = fetchurl {
     url = "http://www.freedesktop.org/software/systemd/${name}.tar.xz";
-    sha256 = "0nr1cg1mizbwcafjcqw3c30mx6xdv596jpbgjlxr6myvc5hfsfg8";
+    sha256 = "07gvn3rpski8sh1nz16npjf2bvj0spsjdwc5px9685g2pi6kxcb1";
   };
 
-  patches = [ ./fail-after-reaching-respawn-limit.patch ];
+  patches =
+    [ ./0001-Make-systemctl-daemon-reexec-do-the-right-thing-on-N.patch
+      ./0002-Ignore-duplicate-paths-in-systemctl-start.patch
+      ./0003-Start-device-units-for-uninitialised-encrypted-devic.patch
+      ./0004-Set-switch-to-configuration-hints-for-some-units.patch
+      ./0005-sysinit.target-Drop-the-dependency-on-local-fs.targe.patch
+      ./0006-Don-t-call-plymouth-quit.patch
+      ./0007-Ignore-IPv6-link-local-addresses.patch
+      ./0008-Don-t-try-to-unmount-nix-or-nix-store.patch
+      ./0009-Start-ctrl-alt-del.target-irreversibly.patch
+    ] ++ stdenv.lib.optional stdenv.isArm ./libc-bug-accept4-arm.patch;
 
   buildInputs =
     [ pkgconfig intltool gperf libcap dbus kmod xz pam acl
-      /* cryptsetup */ libuuid m4 usbutils pciutils glib
+      /* cryptsetup */ libuuid m4 glib libxslt libgcrypt docbook_xsl
     ];
 
   configureFlags =
     [ "--localstatedir=/var"
       "--sysconfdir=/etc"
-      "--with-distro=other"
       "--with-rootprefix=$(out)"
+      "--with-kbd-loadkeys=${kbd}/bin/loadkeys"
+      "--with-kbd-setfont=${kbd}/bin/setfont"
       "--with-rootprefix=$(out)"
       "--with-dbusinterfacedir=$(out)/share/dbus-1/interfaces"
       "--with-dbuspolicydir=$(out)/etc/dbus-1/system.d"
       "--with-dbussystemservicedir=$(out)/share/dbus-1/system-services"
       "--with-dbussessionservicedir=$(out)/share/dbus-1/services"
-      "--with-firmware-path=/root/test-firmware:/var/run/current-system/firmware"
-      "--with-pci-ids-path=${pciutils}/share/pci.ids"
+      "--with-firmware-path=/root/test-firmware:/run/current-system/firmware"
       "--with-tty-gid=3" # tty in NixOS has gid 3
     ];
 
   preConfigure =
     ''
       # FIXME: patch this in systemd properly (and send upstream).
-      for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c; do
+      # FIXME: use sulogin from util-linux once updated.
+      for i in src/remount-fs/remount-fs.c src/core/mount.c src/core/swap.c src/fsck/fsck.c units/emergency.service.in units/rescue.service.m4.in src/journal/cat.c; do
         test -e $i
         substituteInPlace $i \
           --replace /bin/mount ${utillinux}/bin/mount \
           --replace /bin/umount ${utillinux}/bin/umount \
           --replace /sbin/swapon ${utillinux}/sbin/swapon \
           --replace /sbin/swapoff ${utillinux}/sbin/swapoff \
-          --replace /sbin/fsck ${utillinux}/sbin/fsck
+          --replace /sbin/fsck ${utillinux}/sbin/fsck \
+          --replace /bin/echo ${coreutils}/bin/echo \
+          --replace /bin/cat ${coreutils}/bin/cat \
+          --replace /sbin/sulogin ${sysvtools}/sbin/sulogin
       done
+
+      substituteInPlace src/journal/catalog.c \
+        --replace /usr/lib/systemd/catalog/ $out/lib/systemd/catalog/
     '';
 
+  PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
+
   NIX_CFLAGS_COMPILE =
-    [ "-DKBD_LOADKEYS=\"${kbd}/bin/loadkeys\""
-      "-DKBD_SETFONT=\"${kbd}/bin/setfont\""
-      # Can't say ${polkit}/bin/pkttyagent here because that would
+    [ # Can't say ${polkit}/bin/pkttyagent here because that would
       # lead to a cyclic dependency.
-      "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
+      "-UPOLKIT_AGENT_BINARY_PATH" "-DPOLKIT_AGENT_BINARY_PATH=\"/run/current-system/sw/bin/pkttyagent\""
       "-fno-stack-protector"
+
+      # Work around our kernel headers being too old.  FIXME: remove
+      # this after the next stdenv update.
+      "-DFS_NOCOW_FL=0x00800000"
+
+      # Set the release_agent on /sys/fs/cgroup/systemd to the
+      # currently running systemd (/run/current-system/systemd) so
+      # that we don't use an obsolete/garbage-collected release agent.
+      "-USYSTEMD_CGROUP_AGENT_PATH" "-DSYSTEMD_CGROUP_AGENT_PATH=\"/run/current-system/systemd/lib/systemd/systemd-cgroups-agent\""
     ];
 
-  makeFlags = "CPPFLAGS=-I${stdenv.gcc.libc}/include";
+  # Use /var/lib/udev rather than /etc/udev for the generated hardware
+  # database.  Upstream doesn't want this (see commit
+  # 1e1954f53386cb773e2a152748dd31c4d36aa2d8) because using /var is
+  # forbidden in early boot, but in NixOS the initrd guarantees that
+  # /var is mounted.
+  makeFlags = "hwdb_bin=/var/lib/udev/hwdb.bin";
 
-  installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc";
+  installFlags = "localstatedir=$(TMPDIR)/var sysconfdir=$(out)/etc sysvinitdir=$(TMPDIR)/etc/init.d";
 
   # Get rid of configuration-specific data.
   postInstall =
@@ -75,7 +106,14 @@ stdenv.mkDerivation rec {
       for i in init halt poweroff runlevel reboot shutdown; do
         ln -s $out/bin/systemctl $out/sbin/$i
       done
-    '';
+
+      # Fix reference to /bin/false in the D-Bus services.
+      for i in $out/share/dbus-1/system-services/*.service; do
+        substituteInPlace $i --replace /bin/false ${coreutils}/bin/false
+      done
+
+      rm -rf $out/etc/rpm
+    ''; # */
 
   enableParallelBuilding = true;
 
@@ -88,7 +126,9 @@ stdenv.mkDerivation rec {
   passthru.interfaceVersion = 2;
 
   meta = {
-    homepage = http://www.freedesktop.org/wiki/Software/systemd;
+    homepage = "http://www.freedesktop.org/wiki/Software/systemd";
     description = "A system and service manager for Linux";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/os-specific/linux/systemd/fail-after-reaching-respawn-limit.patch b/pkgs/os-specific/linux/systemd/fail-after-reaching-respawn-limit.patch
deleted file mode 100644
index 7271b5578d5..00000000000
--- a/pkgs/os-specific/linux/systemd/fail-after-reaching-respawn-limit.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/src/core/service.c b/src/core/service.c
-index 1c127bd..eafdbe5 100644
---- a/src/core/service.c
-+++ b/src/core/service.c
-@@ -2487,6 +2487,7 @@ static int service_start(Unit *u) {
-         r = service_start_limit_test(s);
-         if (r < 0) {
-                 service_notify_sockets_dead(s, true);
-+                service_set_state(s, SERVICE_FAILED);
-                 return r;
-         }
- 
diff --git a/pkgs/os-specific/linux/systemd/libc-bug-accept4-arm.patch b/pkgs/os-specific/linux/systemd/libc-bug-accept4-arm.patch
new file mode 100644
index 00000000000..7cde2260189
--- /dev/null
+++ b/pkgs/os-specific/linux/systemd/libc-bug-accept4-arm.patch
@@ -0,0 +1,81 @@
+Based on a patch for udev in
+nixpkgs(upstart)/pkgs/os-specific/linux/udev/pre-accept4-kernel.patch
+
+It was taken from:
+https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/udev-oxnas/pre-accept4-kernel.patch
+
+Basically, ARM implemented accept4() only in 2.6.36. Nixpkgs now uses
+linux headers from 2.6.35. And the particular nixpkgs glibc version had a bug,
+not checking about 2.6.36 for accept4 on arm.
+
+diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
+index 7b88f74..a9f7b62 100644
+--- a/src/journal/journald-stream.c
++++ b/src/journal/journald-stream.c
+@@ -347,10 +347,12 @@ int stdout_stream_new(Server *s) {
+         int fd, r;
+         socklen_t len;
+         struct epoll_event ev;
++        int flgs;
+ 
+         assert(s);
+ 
+-        fd = accept4(s->stdout_fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC);
++        //fd = accept4(s->stdout_fd, NULL, NULL, SOCK_NONBLOCK|SOCK_CLOEXEC);
++        fd = accept(s->stdout_fd, NULL, NULL);
+         if (fd < 0) {
+                 if (errno == EAGAIN)
+                         return 0;
+@@ -359,6 +361,11 @@ int stdout_stream_new(Server *s) {
+                 return -errno;
+         }
+ 
++        // Since we don't have accept4
++        flgs = fcntl(fd, F_GETFL, NULL);
++        if(flgs >= 0) fcntl(fd, F_SETFL, flgs | O_NONBLOCK);
++        fcntl(fd, F_SETFD, FD_CLOEXEC);
++
+         if (s->n_stdout_streams >= STDOUT_STREAMS_MAX) {
+                 log_warning("Too many stdout streams, refusing connection.");
+                 close_nointr_nofail(fd);
+diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
+index a235912..c05e4b4 100644
+--- a/src/udev/udev-ctrl.c
++++ b/src/udev/udev-ctrl.c
+@@ -15,6 +15,7 @@
+ #include <stddef.h>
+ #include <string.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ #include <sys/types.h>
+ #include <sys/poll.h>
+ #include <sys/socket.h>
+@@ -181,6 +182,7 @@ struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl)
+         struct ucred ucred;
+         socklen_t slen;
+         const int on = 1;
++        int flgs;
+ 
+         conn = calloc(1, sizeof(struct udev_ctrl_connection));
+         if (conn == NULL)
+@@ -188,13 +190,19 @@ struct udev_ctrl_connection *udev_ctrl_get_connection(struct udev_ctrl *uctrl)
+         conn->refcount = 1;
+         conn->uctrl = uctrl;
+ 
+-        conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
++        //conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
++        conn->sock = accept(uctrl->sock, NULL, NULL);
+         if (conn->sock < 0) {
+                 if (errno != EINTR)
+                         log_error("unable to receive ctrl connection: %m\n");
+                 goto err;
+         }
+ 
++        // Since we don't have accept4
++        flgs = fcntl(conn->sock, F_GETFL, NULL);
++        if(flgs >= 0) fcntl(conn->sock, F_SETFL, flgs | O_NONBLOCK);
++        fcntl(conn->sock, F_SETFD, FD_CLOEXEC);
++
+         /* check peer credential of connection */
+         slen = sizeof(ucred);
+         if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
diff --git a/pkgs/os-specific/linux/sysvinit/default.nix b/pkgs/os-specific/linux/sysvinit/default.nix
index 7b3ea62ea2d..7b4ecbb027e 100644
--- a/pkgs/os-specific/linux/sysvinit/default.nix
+++ b/pkgs/os-specific/linux/sysvinit/default.nix
@@ -4,12 +4,12 @@ let version = "2.88dsf"; in
 
 stdenv.mkDerivation {
   name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
-  
+
   src = fetchurl {
     url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
     sha256 = "068mvzaz808a673zigyaqb63xc8bndh2klk16zi5c83rw70wifv0";
   };
-  
+
   prePatch = ''
     # Patch some minimal hard references, so halt/shutdown work
     sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
@@ -26,17 +26,20 @@ stdenv.mkDerivation {
       substituteInPlace src/Makefile --replace /usr /
     '';
 
-  postInstall = stdenv.lib.optionalString withoutInitTools
-    ''  
-      mv $out/sbin/killall5 $out/bin
-      ln -sf killall5 $out/bin/pidof
-      rm -rf $out/sbin
+  postInstall = ''
+    mv $out/sbin/killall5 $out/bin
+    ln -sf killall5 $out/bin/pidof
+  ''
+    + stdenv.lib.optionalString withoutInitTools
+    ''
+      shopt -s extglob
+      rm -rf $out/sbin/!(sulogin)
       rm -rf $out/include
       rm -rf $out/share/man/man5
       rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5')
       rm $out/bin/{mountpoint,wall} $out/share/man/man1/{mountpoint.1,wall.1}
     '';
-    
+
   meta = {
     homepage = http://www.nongnu.org/sysvinit/;
     description = "Utilities related to booting and shutdown";
diff --git a/pkgs/os-specific/linux/tcp-wrapper/builder.sh b/pkgs/os-specific/linux/tcp-wrappers/builder.sh
index 7ea574fcf23..7ea574fcf23 100644
--- a/pkgs/os-specific/linux/tcp-wrapper/builder.sh
+++ b/pkgs/os-specific/linux/tcp-wrappers/builder.sh
diff --git a/pkgs/os-specific/linux/tcp-wrapper/default.nix b/pkgs/os-specific/linux/tcp-wrappers/default.nix
index a3f79cd05a8..a3f79cd05a8 100644
--- a/pkgs/os-specific/linux/tcp-wrapper/default.nix
+++ b/pkgs/os-specific/linux/tcp-wrappers/default.nix
diff --git a/pkgs/os-specific/linux/tp_smapi/default.nix b/pkgs/os-specific/linux/tp_smapi/default.nix
index 224b808721b..140021605ea 100644
--- a/pkgs/os-specific/linux/tp_smapi/default.nix
+++ b/pkgs/os-specific/linux/tp_smapi/default.nix
@@ -1,23 +1,23 @@
-{stdenv, fetchurl, kernel}:
+{stdenv, fetchurl, kernelDev}:
 
 stdenv.mkDerivation {
-  name = "tp_smapi-0.41-${kernel.version}";
+  name = "tp_smapi-0.41-${kernelDev.version}";
 
   src = fetchurl {
     url = "https://github.com/downloads/evgeni/tp_smapi/tp_smapi-0.41.tar.gz";
     sha256 = "6aef02b92d10360ac9be0db29ae390636be55017990063a092a285c70b54e666";
   };
 
-  buildInputs = [ kernel ];
+  buildInputs = [ kernelDev ];
 
   makeFlags = [
-    "KBASE=${kernel}/lib/modules/${kernel.modDirVersion}"
+    "KBASE=${kernelDev}/lib/modules/${kernelDev.modDirVersion}"
     "SHELL=/bin/sh"
   ];
 
   installPhase = ''
-    install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
-    install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernel.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
+    install -v -D -m 644 thinkpad_ec.ko "$out/lib/modules/${kernelDev.modDirVersion}/kernel/drivers/firmware/thinkpad_ec.ko"
+    install -v -D -m 644 tp_smapi.ko "$out/lib/modules/${kernelDev.modDirVersion}/kernel/drivers/firmware/tp_smapi.ko"
   '';
 
   dontStrip = true;
diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix
index 1ad392ad6fa..e7cce315e8c 100644
--- a/pkgs/os-specific/linux/uclibc/default.nix
+++ b/pkgs/os-specific/linux/uclibc/default.nix
@@ -33,8 +33,8 @@ let
     }
   '';
 
-  archMakeFlag = if (cross != null) then "ARCH=${cross.arch}" else "";
-  crossMakeFlag = if (cross != null) then "CROSS=${cross.config}-" else "";
+  archMakeFlag = if cross != null then "ARCH=${cross.arch}" else "";
+  crossMakeFlag = if cross != null then "CROSS=${cross.config}-" else "";
 
   # UCLIBC_SUSV4_LEGACY defines 'tmpnam', needed for gcc libstdc++ builds.
   nixConfig = ''
@@ -74,7 +74,7 @@ stdenv.mkDerivation {
   '';
 
   # Cross stripping hurts.
-  dontStrip = if (cross != null) then true else false;
+  dontStrip = cross != null;
 
   makeFlags = [ crossMakeFlag "VERBOSE=1" ];
 
diff --git a/pkgs/os-specific/linux/udev/173.nix b/pkgs/os-specific/linux/udev/173.nix
deleted file mode 100644
index 795826cf6bf..00000000000
--- a/pkgs/os-specific/linux/udev/173.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ stdenv, fetchurl, gperf, pkgconfig, glib, acl
-, libusb, usbutils, pciutils }:
-
-assert stdenv ? glibc;
-
-stdenv.mkDerivation rec {
-  name = "udev-173";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/utils/kernel/hotplug/${name}.tar.bz2";
-    sha256 = "1bxadi4bi11v8ipzj22wknv8hsb0wgdb99bx3w9w33rgl4aq78bh";
-  };
-
-  buildInputs = [ gperf pkgconfig glib acl libusb usbutils ];
-
-  configureFlags =
-    ''
-      --with-pci-ids-path=${pciutils}/share/pci.ids
-      --enable-udev_acl --enable-edd
-      --disable-introspection --libexecdir=$(out)/lib/udev
-      --with-firmware-path=/root/test-firmware:/var/run/current-system/firmware
-    '';
-
-  # Workaround for the Linux kernel headers being too old.
-  NIX_CFLAGS_COMPILE = "-DBTN_TRIGGER_HAPPY=0x2c0";
-
-  postInstall =
-    ''
-      # The path to rule_generator.functions in write_cd_rules and
-      # write_net_rules is broken.  Also, don't store the mutable
-      # persistant rules in /etc/udev/rules.d but in
-      # /var/lib/udev/rules.d.
-      for i in $out/lib/udev/write_cd_rules $out/lib/udev/write_net_rules; do
-        substituteInPlace $i \
-          --replace /lib/udev $out/lib/udev \
-          --replace /etc/udev/rules.d /var/lib/udev/rules.d
-      done
-
-      # Don't set PATH to /bin:/sbin; won't work in NixOS.
-      sed -e '/PATH=/d' -i $out/lib/udev/rule_generator.functions
-
-      ln -sv $out/lib/ConsoleKit $out/etc/ConsoleKit
-
-      rm -frv $out/share/gtk-doc
-    '';
-
-  patches = [ ./custom-rules.patch ] ++
-    [(fetchurl {
-      url = https://bugs.archlinux.org/task/25356?getfile=7281;
-      sha256 = "01xib1pfdbwacgx8dqxgrf67a0mwkpm4kxy9f9v3df93v0m4pmbm";
-    })] ++
-    stdenv.lib.optional stdenv.isArm ./pre-accept4-kernel.patch;
-
-  meta = {
-    homepage = http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html;
-    description = "Udev manages the /dev filesystem";
-  };
-}
diff --git a/pkgs/os-specific/linux/udev/custom-rules.patch b/pkgs/os-specific/linux/udev/custom-rules.patch
deleted file mode 100644
index 647691acfb1..00000000000
--- a/pkgs/os-specific/linux/udev/custom-rules.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-commit c49ec33ba0f1a7f11b188913bb4895360ced67f8
-Author: Yury G. Kudryashov <urkud.urkud@gmail.com>
-Date:   Tue Aug 16 16:28:56 2011 +0400
-
-    Upstream considers presence of rules_dir=... in udev.conf as a very special case.
-    In particular, they disable /dev/.udev/*. Re-enable it.
-
-diff --git a/udev/udev-rules.c b/udev/udev-rules.c
-index 6bf2726..c1ae1f3 100644
---- a/udev/udev-rules.c
-+++ b/udev/udev-rules.c
-@@ -1812,6 +1812,7 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
- 	struct udev_list file_list;
- 	struct udev_list_entry *file_loop;
- 	struct token end_token;
-+	char runpathrules[UTIL_PATH_SIZE];
- 
- 	rules = calloc(1, sizeof(struct udev_rules));
- 	if (rules == NULL)
-@@ -1854,22 +1855,21 @@ struct udev_rules *udev_rules_new(struct udev *udev, int resolve_names)
- 	rules->trie_nodes_cur = 1;
- 
- 	if (udev_get_rules_path(udev) == NULL) {
--		char filename[UTIL_PATH_SIZE];
- 
- 		/* /lib/udev -- default/package rules */
- 		add_matching_files(udev, &file_list, LIBEXECDIR "/rules.d", ".rules");
- 
- 		/* /etc/udev -- system-specific/user/admin rules */
- 		add_matching_files(udev, &file_list, SYSCONFDIR "/udev/rules.d", ".rules");
--
--		/* /run/udev -- throw-away/temporary rules */
--		util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
--		add_matching_files(udev, &file_list, filename, ".rules");
- 	} else {
- 		/* custom rules files location for testing */
- 		add_matching_files(udev, &file_list, udev_get_rules_path(udev), ".rules");
- 	}
- 
-+	/* /run/udev -- throw-away/temporary rules */
-+	util_strscpyl(runpathrules, sizeof(runpathrules), udev_get_run_path(udev), "/rules.d", NULL);
-+	add_matching_files(udev, &file_list, runpathrules, ".rules");
-+
- 	/* add all filenames to the string buffer */
- 	udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
- 		const char *filename = udev_list_entry_get_value(file_loop);
-diff --git a/udev/udevd.c b/udev/udevd.c
-index f1a31e7..45d10b6 100644
---- a/udev/udevd.c
-+++ b/udev/udevd.c
-@@ -1198,6 +1198,8 @@ int main(int argc, char *argv[])
- 	struct epoll_event ep_ctrl, ep_inotify, ep_signal, ep_netlink, ep_worker;
- 	struct udev_ctrl_connection *ctrl_conn = NULL;
- 	int rc = 1;
-+	char filename[UTIL_PATH_SIZE];
-+	struct stat statbuf;
- 
- 	udev = udev_new();
- 	if (udev == NULL)
-@@ -1480,23 +1482,21 @@ int main(int argc, char *argv[])
- 		inotify_add_watch(fd_inotify, udev_get_rules_path(udev),
- 				  IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
- 	} else {
--		char filename[UTIL_PATH_SIZE];
--		struct stat statbuf;
- 
- 		inotify_add_watch(fd_inotify, LIBEXECDIR "/rules.d",
- 				  IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
- 		inotify_add_watch(fd_inotify, SYSCONFDIR "/udev/rules.d",
- 				  IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
-+	}
- 
--		/* watch dynamic rules directory */
--		util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
--		if (stat(filename, &statbuf) != 0) {
--			util_create_path(udev, filename);
--			mkdir(filename, 0755);
--		}
--		inotify_add_watch(fd_inotify, filename,
--				  IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
-+	/* watch dynamic rules directory */
-+	util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/rules.d", NULL);
-+	if (stat(filename, &statbuf) != 0) {
-+		util_create_path(udev, filename);
-+		mkdir(filename, 0755);
- 	}
-+	inotify_add_watch(fd_inotify, filename,
-+			  IN_DELETE | IN_MOVE | IN_CLOSE_WRITE);
- 	udev_watch_restore(udev);
- 
- 	/* block and listen to all signals on signalfd */
diff --git a/pkgs/os-specific/linux/udev/pre-accept4-kernel.patch b/pkgs/os-specific/linux/udev/pre-accept4-kernel.patch
deleted file mode 100644
index 2cf549d99a7..00000000000
--- a/pkgs/os-specific/linux/udev/pre-accept4-kernel.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From:
-https://github.com/archlinuxarm/PKGBUILDs/blob/master/core/udev-oxnas/pre-accept4-kernel.patch
-
-diff -urN a/udev/udev-ctrl.c b/udev/udev-ctrl.c
---- a/udev/udev-ctrl.c	2011-10-09 17:10:32.000000000 -0600
-+++ b/udev/udev-ctrl.c	2011-10-25 15:11:09.000000000 -0600
-@@ -15,6 +15,7 @@
- #include <stddef.h>
- #include <string.h>
- #include <unistd.h>
-+#include <fcntl.h>
- #include <sys/types.h>
- #include <sys/poll.h>
- #include <sys/socket.h>
-@@ -182,6 +183,7 @@
- 	struct ucred ucred;
- 	socklen_t slen;
- 	const int on = 1;
-+	int flgs;
- 
- 	conn = calloc(1, sizeof(struct udev_ctrl_connection));
- 	if (conn == NULL)
-@@ -189,13 +191,19 @@
- 	conn->refcount = 1;
- 	conn->uctrl = uctrl;
- 
--	conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
-+//	conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
-+	conn->sock = accept(uctrl->sock, NULL, NULL);
- 	if (conn->sock < 0) {
- 		if (errno != EINTR)
- 			err(uctrl->udev, "unable to receive ctrl connection: %m\n");
- 		goto err;
- 	}
- 
-+// Since we don't have accept4
-+	flgs = fcntl(conn->sock, F_GETFL, NULL);
-+	if(flgs >= 0) fcntl(conn->sock, F_SETFL, flgs | O_NONBLOCK);
-+	fcntl(conn->sock, F_SETFD, FD_CLOEXEC);
-+
- 	/* check peer credential of connection */
- 	slen = sizeof(ucred);
- 	if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
diff --git a/pkgs/os-specific/linux/udisks/default.nix b/pkgs/os-specific/linux/udisks/1-default.nix
index 4987e90429c..b53af52755f 100644
--- a/pkgs/os-specific/linux/udisks/default.nix
+++ b/pkgs/os-specific/linux/udisks/1-default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1xgqifddwaavmjc8c30i0mdffyirsld7c6qhfyjw7f9khwv8jjw5";
   };
 
-  patches = [ ./purity.patch ];
+  patches = [ ./purity.patch ./no-pci-db.patch ];
 
   postPatch =
     ''
@@ -26,15 +26,10 @@ stdenv.mkDerivation rec {
       lvm2 libatasmart intltool libuuid libxslt docbook_xsl
     ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags = "--localstatedir=/var --enable-lvm2";
 
-  preConfigure =
-    ''
-      # Ensure that udisks can find the necessary programs.
-    '';
-
   meta = {
     homepage = http://www.freedesktop.org/wiki/Software/udisks;
     description = "A daemon and command-line utility for querying and manipulating storage devices";
diff --git a/pkgs/os-specific/linux/udisks/2-default.nix b/pkgs/os-specific/linux/udisks/2-default.nix
new file mode 100644
index 00000000000..28cdbe18978
--- /dev/null
+++ b/pkgs/os-specific/linux/udisks/2-default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl, pkgconfig, intltool
+, expat, acl, udev, glib, libatasmart, polkit
+, libxslt, docbook_xsl, utillinux, mdadm
+}:
+
+stdenv.mkDerivation rec {
+  name = "udisks-2.1.0";
+
+  src = fetchurl {
+    url = "http://udisks.freedesktop.org/releases/${name}.tar.bz2";
+    sha256 = "1a0mipihilscv9jwy59xrqn2kkri9p12a09anpjdld83l7jhh0ii";
+  };
+
+  patches = [ ./force-path.patch ];
+
+  # FIXME remove /var/run/current-system/sw/* references
+  # FIXME add references to parted, cryptsetup, etc (see the sources)
+  postPatch =
+    ''
+      substituteInPlace src/main.c --replace \
+        "@path@" \
+        "${utillinux}/bin:${mdadm}/sbin:/var/run/current-system/sw/bin:/var/run/current-system/sw/sbin"
+    '';
+
+  nativeBuildInputs = [ pkgconfig intltool ];
+
+  propagatedBuildInputs = [ expat acl udev glib libatasmart polkit ]; # in closure anyway
+
+  buildInputs = [ libxslt docbook_xsl ];
+
+  configureFlags = [
+    "--localstatedir=/var"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/systemd"
+    "--with-udevdir=$(out)/lib/udev"
+  ];
+
+  meta = {
+    homepage = http://www.freedesktop.org/wiki/Software/udisks;
+    description = "A daemon and command-line utility for querying and manipulating storage devices";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/udisks/force-path.patch b/pkgs/os-specific/linux/udisks/force-path.patch
new file mode 100644
index 00000000000..16c7ea5322f
--- /dev/null
+++ b/pkgs/os-specific/linux/udisks/force-path.patch
@@ -0,0 +1,13 @@
+diff -ruN udisks-2.1.0.orig/src/main.c udisks-2.1.0/src/main.c
+--- udisks-2.1.0.orig/src/main.c	2013-04-02 10:43:41.629332135 +0000
++++ udisks-2.1.0/src/main.c	2013-04-02 11:04:55.635342823 +0000
+@@ -140,8 +140,7 @@
+         }
+     }
+ 
+-  if (g_getenv ("PATH") == NULL)
+-    g_setenv ("PATH", "/usr/bin:/bin:/usr/sbin:/sbin", TRUE);
++  g_setenv ("PATH", "@path@", TRUE);
+ 
+   udisks_notice ("udisks daemon version %s starting", PACKAGE_VERSION);
+ 
diff --git a/pkgs/os-specific/linux/udisks/no-pci-db.patch b/pkgs/os-specific/linux/udisks/no-pci-db.patch
new file mode 100644
index 00000000000..b323b515c40
--- /dev/null
+++ b/pkgs/os-specific/linux/udisks/no-pci-db.patch
@@ -0,0 +1,13 @@
+Systemd no longer has the pci-db program.
+
+diff -ru -x '*~' udisks-1.0.4-orig/data/80-udisks.rules udisks-1.0.4/data/80-udisks.rules
+--- udisks-1.0.4-orig/data/80-udisks.rules	2011-08-25 23:31:20.000000000 +0200
++++ udisks-1.0.4/data/80-udisks.rules	2012-12-13 13:06:52.189650854 +0100
+@@ -3,7 +3,6 @@
+ 
+ # import names for PCI storage controllers
+ #
+-SUBSYSTEM=="pci", ACTION=="add|change", ENV{ID_MODEL_FROM_DATABASE}=="", ATTR{class}=="0x01*", IMPORT{program}="pci-db %p"
+ 
+ # Set eSATA port type for known eSATA CardBus adapters - first we want to ensure
+ # the device is on a cardbus controller (upper PCI device) - then we check
diff --git a/pkgs/os-specific/linux/uml-utilities/builder.sh b/pkgs/os-specific/linux/uml-utilities/builder.sh
deleted file mode 100644
index 00b40278889..00000000000
--- a/pkgs/os-specific/linux/uml-utilities/builder.sh
+++ /dev/null
@@ -1,17 +0,0 @@
-buildinputs=""
-source $stdenv/setup
-
-tar xvfj $src
-cd tools
-[ -n "$tunctl" ] && sed -e '1s/.*/TUNCTL = tunctl/' -i Makefile
-[ -z "$mconsole" ] && sed -e 's/mconsole//' -i Makefile
-
-mkdir $out
-mkdir $out/bin
-mkdir $out/lib
-mkdir $out/lib/uml
-make BIN_DIR=$out/bin LIB_DIR=$out/lib/uml
-make BIN_DIR=$out/bin LIB_DIR=$out/lib/uml install
-ln -s $out/lib/uml/port-helper $out/bin/port-helper
-[ -z "$tunctl" ] || [ -f $out/bin/tunctl ] || fail_no_tunctl
-[ -z "$mconsole" ] || [ -f $out/bin/uml_mconsole ] || fail_no_mconsole
diff --git a/pkgs/os-specific/linux/uml-utilities/default.nix b/pkgs/os-specific/linux/uml-utilities/default.nix
deleted file mode 100644
index 4ed7c6e8a3a..00000000000
--- a/pkgs/os-specific/linux/uml-utilities/default.nix
+++ /dev/null
@@ -1,13 +0,0 @@
-{lib, stdenv, fetchurl, linuxHeaders , readline, tunctl ? false, mconsole ? false}:
-
-stdenv.mkDerivation {
-  inherit tunctl mconsole;
-  buildInputs = lib.optional tunctl linuxHeaders
-            ++ lib.optional mconsole readline;
-  name = "uml-utilities-20040114";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://nixos.org/tarballs/uml_utilities_20040114.tar.bz2;
-    md5 = "1fd5b791ef32c6a3ed4ae42c4a53a316";
-  };
-}
diff --git a/pkgs/os-specific/linux/upower/default.nix b/pkgs/os-specific/linux/upower/default.nix
index 2f870e5d999..8f244c3d645 100644
--- a/pkgs/os-specific/linux/upower/default.nix
+++ b/pkgs/os-specific/linux/upower/default.nix
@@ -1,23 +1,23 @@
 { stdenv, fetchurl, pkgconfig, glib, dbus, dbus_glib, dbus_tools, polkit
 , intltool, libxslt, docbook_xsl, udev, libusb1, pmutils
-, useSystemd ? false, systemd ? null
+, useSystemd ? true, systemd
 }:
 
 assert stdenv.isLinux;
 
 stdenv.mkDerivation rec {
-  name = "upower-0.9.18";
+  name = "upower-0.9.19";
 
   src = fetchurl {
     url = "http://upower.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "13q6cw2d45qp077g3bjng4yhrvm6g1y9347dkf53kscm5xfm18d1";
+    sha256 = "053yahks5c7nwdxwx8q6nqp3mxbqldmc844mzyvc3ws9635zmisl";
   };
 
   buildInputs =
     [ dbus_glib polkit intltool libxslt docbook_xsl udev libusb1 ]
     ++ stdenv.lib.optional useSystemd systemd;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   configureFlags =
     [ "--with-backend=linux" "--localstatedir=/var" ]
diff --git a/pkgs/os-specific/linux/upstart/cfgdir.patch b/pkgs/os-specific/linux/upstart/cfgdir.patch
deleted file mode 100644
index 2a29b36412c..00000000000
--- a/pkgs/os-specific/linux/upstart/cfgdir.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-diff -rc upstart-0.3.0-orig/init/main.c upstart-0.3.0/init/main.c
-*** upstart-0.3.0-orig/init/main.c	2006-10-13 14:35:16.000000000 +0200
---- upstart-0.3.0/init/main.c	2006-11-19 21:41:01.000000000 +0100
-***************
-*** 206,215 ****
-  	control_open ();
-  
-  	/* Read configuration */
-! 	cfg_watch_dir (NULL, CFG_DIR, NULL);
-  
-  	/* Set the PATH environment variable */
-! 	setenv ("PATH", PATH, TRUE);
-  
-  
-  	/* Generate and run the startup event or read the state from the
---- 206,217 ----
-  	control_open ();
-  
-  	/* Read configuration */
-!         char *cfg_dir = getenv("UPSTART_CFG_DIR");
-!         if (!cfg_dir) cfg_dir = CFG_DIR;
-! 	cfg_watch_dir (NULL, cfg_dir, NULL);
-  
-  	/* Set the PATH environment variable */
-! 	/* setenv ("PATH", PATH, TRUE); */
-  
-  
-  	/* Generate and run the startup event or read the state from the
-diff -rc upstart-0.3.0-orig/util/initctl.c upstart-0.3.0/util/initctl.c
-*** upstart-0.3.0-orig/util/initctl.c	2006-10-13 16:18:06.000000000 +0200
---- upstart-0.3.0/util/initctl.c	2006-11-20 16:53:21.000000000 +0100
-***************
-*** 95,105 ****
-  		} else if (! strcmp (command->command, "stop")) {
-  			msg.type = UPSTART_JOB_STOP;
-  			msg.job_stop.name = *arg;
-- 			break;
-  		} else if (! strcmp (command->command, "status")) {
-  			msg.type = UPSTART_JOB_QUERY;
-  			msg.job_stop.name = *arg;
-- 			break;
-  		}
-  
-  		/* Send the message */
---- 95,103 ----
diff --git a/pkgs/os-specific/linux/usbutils/default.nix b/pkgs/os-specific/linux/usbutils/default.nix
index 96ae5b93aa8..5af28876dc1 100644
--- a/pkgs/os-specific/linux/usbutils/default.nix
+++ b/pkgs/os-specific/linux/usbutils/default.nix
@@ -1,25 +1,25 @@
-{ stdenv, fetchurl, pkgconfig, libusb }:
+{ stdenv, fetchurl, pkgconfig, libusb1 }:
 
 let
 
   # Obtained from http://www.linux-usb.org/usb.ids.bz2.
   usbids = fetchurl {
-    url = http://nixos.org/tarballs/usb.ids.20100720.bz2;
-    sha256 = "0krncssk0b10z6grw305824zma953l3g2rb7jkk25mb78pw5fd5d";
+    url = http://nixos.org/tarballs/usb.ids.20120920.bz2;
+    sha256 = "0sz860g7grf6kx22p49s6j8h85c69ymcw16a8110klzfl9hl9hli";
   };
 
 in
 
 stdenv.mkDerivation rec {
-  name = "usbutils-0.86";
-  
+  name = "usbutils-006";
+
   src = fetchurl {
-    url = "mirror://kernel/linux/utils/usb/usbutils/${name}.tar.gz";
-    sha256 = "1x0jkiwrgdb8qwy21iwhxpc8k61apxqp1901h866d1ydsakbxcmk";
+    url = mirror://kernel/linux/utils/usb/usbutils/usbutils-006.tar.xz;
+    sha256 = "03pd57vv8c6x0hgjqcbrxnzi14h8hcghmapg89p8k5zpwpkvbdfr";
   };
-  
-  buildInputs = [ pkgconfig libusb ];
-  
+
+  buildInputs = [ pkgconfig libusb1 ];
+
   preBuild = "bunzip2 < ${usbids} > usb.ids";
 
   meta = {
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 75a117961f0..8b9a87d0e6f 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -1,19 +1,15 @@
-{ stdenv, fetchurl, zlib, ncurses ? null, perl ? null }:
+{ stdenv, fetchurl, zlib, ncurses ? null, perl ? null, pam }:
 
 stdenv.mkDerivation rec {
-  name = "util-linux-2.20.1";
+  name = "util-linux-2.22.2";
 
   src = fetchurl {
-    # This used to be mirror://kernel/linux/utils/util-linux, but it
-    # disappeared in the kernel.org meltdown.
-    url = "mirror://gentoo/distfiles/${name}.tar.bz2";
-    sha256 = "1q5vjcvw4f067c63vj2n3xggvk5prm11571x6vnqiav47vdbqvni";
+    url = "http://www.kernel.org/pub/linux/utils/util-linux/v2.22/${name}.tar.bz2";
+    sha256 = "0vf3ifb45gr4cd27pmmxk8y5b3r0920mv16fv0vfwz5705xa2qvl";
   };
 
   outputs = [ "dev" "out" "bin" ];
 
-  patches = [ ./linux-specific-header.patch ];
-
   crossAttrs = {
     # Work around use of `AC_RUN_IFELSE'.
     preConfigure = "export scanf_cv_type_modifier=ms";
@@ -23,13 +19,27 @@ stdenv.mkDerivation rec {
   # (/sbin/mount.*) through an environment variable, but that's
   # somewhat risky because we have to consider that mount can setuid
   # root...
+  # --enable-libmount-mount  fixes the behaviour being /etc/mtab a symlink to /proc/monunts
+  #     http://pl.digipedia.org/usenet/thread/19513/1924/
   configureFlags = ''
-    --disable-use-tty-group
     --enable-write
+    --enable-last
+    --enable-mesg
+    --enable-ddate
+    --disable-use-tty-group
     --enable-fs-paths-default=/var/setuid-wrappers:/var/run/current-system/sw/sbin:/sbin
     ${if ncurses == null then "--without-ncurses" else ""}
   '';
 
-  buildInputs = [ zlib ] ++ stdenv.lib.optional (ncurses != null) ncurses
-             ++ stdenv.lib.optional (perl != null) perl;
+  buildInputs =
+    [ zlib pam ]
+    ++ stdenv.lib.optional (ncurses != null) ncurses
+    ++ stdenv.lib.optional (perl != null) perl;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = http://www.kernel.org/pub/linux/utils/util-linux/;
+    description = "A set of system utilities for Linux";
+  };
 }
diff --git a/pkgs/os-specific/linux/util-linux/linux-specific-header.patch b/pkgs/os-specific/linux/util-linux/linux-specific-header.patch
deleted file mode 100644
index 8d0b57dea3f..00000000000
--- a/pkgs/os-specific/linux/util-linux/linux-specific-header.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-The <asm/param.h> header is Linux-only and breaks GNU/Hurd builds.
-
---- util-linux-2.20.1/term-utils/write.c	2012-03-07 23:06:14.000000000 +0100
-+++ util-linux-2.20.1/term-utils/write.c	2012-03-07 23:06:19.000000000 +0100
-@@ -57,7 +57,9 @@
- #include <sys/param.h>
- #include <sys/stat.h>
- #include <paths.h>
--#include <asm/param.h>
-+#ifdef __linux__
-+# include <asm/param.h>
-+#endif
- #include <getopt.h>
- #include "c.h"
- #include "carefulputc.h"
-
diff --git a/pkgs/os-specific/linux/v4l-utils/default.nix b/pkgs/os-specific/linux/v4l-utils/default.nix
index ea63dadc8bd..8e6584465d0 100644
--- a/pkgs/os-specific/linux/v4l-utils/default.nix
+++ b/pkgs/os-specific/linux/v4l-utils/default.nix
@@ -4,30 +4,22 @@
 assert withQt4 -> qt4 != null;
 
 stdenv.mkDerivation rec {
-  name = "v4l-utils-0.8.8";
+  name = "v4l-utils-0.9.3";
 
   src = fetchurl {
     url = "http://linuxtv.org/downloads/v4l-utils/${name}.tar.bz2";
-    sha256 = "0zx8f1npsl6g5vjah1gwydg1j5azl74kr83ifbjhshgmnvscd92z";
+    sha256 = "0gaag38x47wlvmp4j60wgf9ma1rxzfyg7i12zxxxi4m3cpcb0bah";
   };
 
-  buildInputs = [ libjpeg which ] ++ stdenv.lib.optional withQt4 qt4;
+  buildInputs = [ which ];
+  propagatedBuildInputs = [ libjpeg ] ++ stdenv.lib.optional withQt4 qt4;
 
-  # The keytable wants to touch /etc files and udev scripts in /lib.
-  # I skip it.
-  patchPhase = ''
-    sed -i s/keytable// utils/Makefile
-  '';
-
-  installPhase = ''
-    make PREFIX=$out install
-  '';
+  preConfigure = ''configureFlags="--with-udevdir=$out/lib/udev"'';
 
   meta = {
     homepage = http://linuxtv.org/projects.php;
     description = "V4L utils and libv4l, that provides common image formats regardless of the v4l device";
-    # (The libs are of LGPLv2.1+, some other pieces are GPL)
-    license = "free";
+    license = "free"; # The libs are of LGPLv2.1+, some other pieces are GPL.
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
diff --git a/pkgs/os-specific/linux/v86d/default.nix b/pkgs/os-specific/linux/v86d/default.nix
index aedfe9ac686..698a7ab4ec8 100644
--- a/pkgs/os-specific/linux/v86d/default.nix
+++ b/pkgs/os-specific/linux/v86d/default.nix
@@ -1,10 +1,11 @@
-{stdenv, fetchurl, klibc, kernel, withKlibc ? true}:
+{stdenv, fetchurl, klibc, kernelDev, withKlibc ? true}:
 
 stdenv.mkDerivation rec {
-  name = "v86d-0.1.10-${kernel.version}";
+  name = "v86d-${version}-${kernelDev.version}";
+  version = "0.1.10";
 
   src = fetchurl {
-    url = "http://dev.gentoo.org/~spock/projects/uvesafb/archive/${name}.tar.bz2";
+    url = "mirror://gentoo/distfiles//v86d-${version}.tar.bz2";
     sha256 = "0p3kwqjis941pns9948dxfnjnl5lwd8f2b6x794whs7g32p68jb3";
   };
 
@@ -17,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = if withKlibc then [ "--with-klibc" ] else [ "--default" ];
 
   makeFlags = [
-    "KDIR=${kernel}/lib/modules/${kernel.modDirVersion}/source"
+    "KDIR=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/source"
     "DESTDIR=$(out)"
   ];
 
@@ -25,7 +26,6 @@ stdenv.mkDerivation rec {
     description = "A userspace helper that runs x86 code in an emulated environment";
     homepage = http://dev.gentoo.org/~spock/projects/uvesafb/;
     license = "BSD";
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/os-specific/linux/wis-go7007/default.nix b/pkgs/os-specific/linux/wis-go7007/default.nix
index 4fff3ed37c0..7f27196ba6b 100644
--- a/pkgs/os-specific/linux/wis-go7007/default.nix
+++ b/pkgs/os-specific/linux/wis-go7007/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, kernel, ncurses, fxload}:
+{stdenv, fetchurl, kernelDev, ncurses, fxload}:
 
 let
 
@@ -12,7 +12,7 @@ let
 in   
 
 stdenv.mkDerivation {
-  name = "wis-go7007-0.9.8-${kernel.version}";
+  name = "wis-go7007-0.9.8-${kernelDev.version}";
 
   src = fetchurl {
     url = http://gentoo.osuosl.org/distfiles/wis-go7007-linux-0.9.8.tar.bz2;
@@ -50,9 +50,9 @@ stdenv.mkDerivation {
     # Urgh, we need the complete kernel sources for some header
     # files.  So unpack the original kernel source tarball and copy
     # the configured include directory etc. on top of it.
-    kernelVersion=$(cd ${kernel}/lib/modules && ls)
-    kernelBuild=$(echo ${kernel}/lib/modules/$kernelVersion/source)
-    tar xvfj ${kernel.src}
+    kernelVersion=$(cd ${kernelDev}/lib/modules && ls)
+    kernelBuild=$(echo ${kernelDev}/lib/modules/$kernelVersion/source)
+    tar xvfj ${kernelDev.src}
     kernelSource=$(echo $(pwd)/linux-*)
     cp -prd $kernelBuild/* $kernelSource
 
diff --git a/pkgs/os-specific/linux/wpa_supplicant/default.nix b/pkgs/os-specific/linux/wpa_supplicant/default.nix
index 522478ed5b7..8f441303c25 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/default.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/default.nix
@@ -1,54 +1,54 @@
-{ stdenv, fetchurl, openssl, dbus_libs, pkgconfig, libnl1 }:
+{ stdenv, fetchurl, lib, openssl, dbus_libs, pkgconfig, libnl
+, readlineSupport ? true, readline
+}:
+
+assert readlineSupport -> readline != null;
 
 stdenv.mkDerivation rec {
-  version = "0.7.3";
-  
+  version = "1.1";
+
   name = "wpa_supplicant-${version}";
 
   src = fetchurl {
-    url = "http://hostap.epitest.fi/releases/wpa_supplicant-${version}.tar.gz";
-    sha256 = "0hwlsn512q2ps8wxxjmkjfdg3vjqqb9mxnnwfv1wqijkm3551kfh";
+    url = "http://hostap.epitest.fi/releases/${name}.tar.gz";
+    sha256 = "00lyifj8cz7qyal6dy1dxbpk3g3bywvdarik8gbj9ds7zmfbwkd5";
   };
-  
+
+  extraConfig =
+    ''
+      CONFIG_DEBUG_SYSLOG=y
+      CONFIG_CTRL_IFACE_DBUS=y
+      CONFIG_CTRL_IFACE_DBUS_NEW=y
+      CONFIG_CTRL_IFACE_DBUS_INTRO=y
+      CONFIG_DRIVER_NL80211=y
+      CONFIG_LIBNL32=y
+      ${stdenv.lib.optionalString readlineSupport "CONFIG_READLINE=y"}
+    '';
+
   preBuild = ''
     cd wpa_supplicant
     cp -v defconfig .config
-    echo CONFIG_DEBUG_SYSLOG=y | tee -a .config
-    echo CONFIG_CTRL_IFACE_DBUS=y | tee -a .config
-    echo CONFIG_CTRL_IFACE_DBUS_NEW=y | tee -a .config
-    echo CONFIG_CTRL_IFACE_DBUS_INTRO=y | tee -a .config
-    echo CONFIG_DRIVER_NL80211=y | tee -a .config
+    echo "$extraConfig" >> .config
+    cat .config
     substituteInPlace Makefile --replace /usr/local $out
   '';
 
-  buildInputs = [ openssl dbus_libs libnl1 ];
-
-  buildNativeInputs = [ pkgconfig ];
-
-  patches =
-    [ # Upstream patch required for NetworkManager-0.9
-      (fetchurl {
-        url = "http://w1.fi/gitweb/gitweb.cgi?p=hostap-07.git;a=commitdiff_plain;h=b80b5639935d37b95d00f86b57f2844a9c775f57";
-        name = "wpa_supplicant-nm-0.9.patch";
-        sha256 = "1pqba0l4rfhba5qafvvbywi9x1qmphs944p704bh1flnx7cz6ya8";
-      })
-      # wpa_supplicant crashes when controlled through dbus (wicd/nm)
-      # see: https://bugzilla.redhat.com/show_bug.cgi?id=678625
-      (fetchurl {
-        url = "https://bugzilla.redhat.com/attachment.cgi?id=491018";
-        name = "dbus-assertion-fix.patch";
-        sha256 = "6206d79bcd800d56cae73e2a01a27ac2bee961512f77e5d62a59256a9919077a";
-      })
-    ];
+  buildInputs = [ openssl dbus_libs libnl ]
+    ++ lib.optional readlineSupport readline;
+
+  nativeBuildInputs = [ pkgconfig ];
+
+  patches = [ ./libnl.patch ];
 
   postInstall = ''
     mkdir -p $out/share/man/man5 $out/share/man/man8
     cp -v doc/docbook/*.5 $out/share/man/man5/
     cp -v doc/docbook/*.8 $out/share/man/man8/
-    mkdir -p $out/etc/dbus-1/system.d $out/share/dbus-1/system-services
+    mkdir -p $out/etc/dbus-1/system.d $out/share/dbus-1/system-services $out/etc/systemd/system
     cp -v dbus/*service $out/share/dbus-1/system-services
     sed -e "s@/sbin/wpa_supplicant@$out&@" -i $out/share/dbus-1/system-services/*
     cp -v dbus/dbus-wpa_supplicant.conf $out/etc/dbus-1/system.d
+    cp -v systemd/*.service $out/etc/systemd/system
   ''; # */
 
   meta = {
diff --git a/pkgs/os-specific/linux/wpa_supplicant/gui.nix b/pkgs/os-specific/linux/wpa_supplicant/gui.nix
index 12ec08361a6..29591bf0335 100644
--- a/pkgs/os-specific/linux/wpa_supplicant/gui.nix
+++ b/pkgs/os-specific/linux/wpa_supplicant/gui.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ qt4 ];
 
-  buildNativeInputs = [ inkscape ];
+  nativeBuildInputs = [ inkscape ];
 
   prePatch = "cd wpa_supplicant/wpa_gui-qt4";
 
diff --git a/pkgs/os-specific/linux/wpa_supplicant/libnl.patch b/pkgs/os-specific/linux/wpa_supplicant/libnl.patch
new file mode 100644
index 00000000000..ede6dad721c
--- /dev/null
+++ b/pkgs/os-specific/linux/wpa_supplicant/libnl.patch
@@ -0,0 +1,13 @@
+diff -up wpa_supplicant-1.0-rc2/src/drivers/drivers.mak.foo wpa_supplicant-1.0-rc2/src/drivers/drivers.mak
+--- wpa_supplicant-1.0-rc2/src/drivers/drivers.mak.foo	2012-03-02 16:11:43.176448714 -0600
++++ wpa_supplicant-1.0-rc2/src/drivers/drivers.mak	2012-03-02 16:12:29.759866341 -0600
+@@ -48,7 +48,7 @@ NEED_RFKILL=y
+ ifdef CONFIG_LIBNL32
+   DRV_LIBS += -lnl-3
+   DRV_LIBS += -lnl-genl-3
+-  DRV_CFLAGS += -DCONFIG_LIBNL20
++  DRV_CFLAGS += -DCONFIG_LIBNL20 `pkg-config --cflags libnl-3.0`
+ else
+   ifdef CONFIG_LIBNL_TINY
+     DRV_LIBS += -lnl-tiny
+
diff --git a/pkgs/os-specific/linux/x86info/default.nix b/pkgs/os-specific/linux/x86info/default.nix
new file mode 100644
index 00000000000..297991ff4d9
--- /dev/null
+++ b/pkgs/os-specific/linux/x86info/default.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, pciutils, python}:
+
+stdenv.mkDerivation rec {
+  version = "1.30";
+  name = "x86info-${version}";
+
+  src = fetchurl {
+    url = "http://codemonkey.org.uk/projects/x86info/${name}.tgz";
+    sha256 = "0a4lzka46nabpsrg3n7akwr46q38f96zfszd73xcback1s2hjc7y";
+  };
+
+  preConfigure = "patchShebangs .";
+
+  buildInputs = [ pciutils python ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp x86info lsmsr $out/bin
+  '';
+
+  meta = {
+    description = "An identification utility for the x86 series of processors.";
+    longDescription =
+    ''
+      x86info will identify all Intel/AMD/Centaur/Cyrix/VIA CPUs. It leverages
+      the cpuid kernel module where possible.  it supports parsing model specific
+      registers (MSRs) via the msr kernel module.  it will approximate processor
+      frequency, and identify the cache sizes and layout. 
+    '';
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2;
+    homepage = http://codemonkey.org.uk/projects/x86info/;
+    maintainers = with stdenv.lib.maintainers; [jcumming];
+  };
+}
diff --git a/pkgs/os-specific/linux/xf86-input-mtrack/default.nix b/pkgs/os-specific/linux/xf86-input-mtrack/default.nix
index 405f722f70f..4f74ce57ea8 100644
--- a/pkgs/os-specific/linux/xf86-input-mtrack/default.nix
+++ b/pkgs/os-specific/linux/xf86-input-mtrack/default.nix
@@ -10,10 +10,11 @@
 , xorgserver
 , xproto
 , inputproto
+, pixman
 }:
 
 stdenv.mkDerivation {
-  name = "xf86-input-mtrack-0.2.0";
+  name = "xf86-input-mtrack-0.3.0";
 
   preConfigure = "autoreconf -vfi";
 
@@ -27,12 +28,15 @@ stdenv.mkDerivation {
     xorgserver
     xproto
     inputproto
+    pixman
   ];
 
+  CFLAGS = "-I${pixman}/include/pixman-1";
+
   src = fetchurl {
     name = "xf86-input-mtrack.tar.gz";
-    url = "https://github.com/BlueDragonX/xf86-input-mtrack/tarball/v0.2.0";
-    sha256 = "1zvd68dxpjn44ys7ysi3yc95xdjw1rz0s3xwlh3fzpw1ib3wrr3x";
+    url = "https://github.com/BlueDragonX/xf86-input-mtrack/tarball/v0.3.0";
+    sha256 = "174rdw7gv0wsnjgmwpx4pgjn1zfbylflda4k2dzff6phzxj9yl6v";
   };
 
   meta = {
@@ -45,3 +49,4 @@ stdenv.mkDerivation {
     maintainers = [ stdenv.lib.maintainers.shlevy ];
   };
 }
+
diff --git a/pkgs/os-specific/linux/xf86-input-wacom/default.nix b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
index 98446c70867..63e4fb1ca73 100644
--- a/pkgs/os-specific/linux/xf86-input-wacom/default.nix
+++ b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
@@ -1,17 +1,17 @@
 { stdenv, fetchurl
 , file, inputproto, libX11, libXext, libXi, libXrandr, libXrender
-, ncurses, pkgconfig, randrproto, xorgserver, xproto, udev }:
+, ncurses, pkgconfig, randrproto, xorgserver, xproto, udev, libXinerama, pixman }:
 
 stdenv.mkDerivation rec {
-  name = "xf86-input-wacom-0.11.1";
+  name = "xf86-input-wacom-0.19.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/linuxwacom/${name}.tar.bz2";
-    sha256 = "1jmnrkf89a3jjbpn17gyndlv9lqc0n7qwyi22hraxypq213gjclx";
+    sha256 = "1lkvhirjysx0d2154jrwqc2i8jrqdjrlzjv7grbnm2cg5vpg7n53";
   };
 
   buildInputs = [ inputproto libX11 libXext libXi libXrandr libXrender
-    ncurses pkgconfig randrproto xorgserver xproto udev ];
+    ncurses pkgconfig randrproto xorgserver xproto udev libXinerama pixman ];
 
   preConfigure = ''
     mkdir -p $out/share/X11/xorg.conf.d
@@ -19,6 +19,8 @@ stdenv.mkDerivation rec {
     --with-sdkdir=$out/include/xorg --with-xorg-conf-dir=$out/share/X11/xorg.conf.d"
   '';
 
+  CFLAGS = "-I${pixman}/include/pixman-1";
+
   meta = with stdenv.lib; {
     maintainers = [ maintainers.goibhniu maintainers.urkud ];
     description = "Wacom digitizer driver for X11";
diff --git a/pkgs/os-specific/linux/xf86-video-nested/default.nix b/pkgs/os-specific/linux/xf86-video-nested/default.nix
index 6ed04f490c0..0d0639390a7 100644
--- a/pkgs/os-specific/linux/xf86-video-nested/default.nix
+++ b/pkgs/os-specific/linux/xf86-video-nested/default.nix
@@ -1,30 +1,31 @@
 { stdenv, fetchgit, autoconf, automake, fontsproto, libX11, libXext
-, libtool, pkgconfig, renderproto, utilmacros, xorgserver
+, libtool, pixman, pkgconfig, renderproto, utilmacros, xorgserver
 }:
 
 stdenv.mkDerivation {
-  name = "xf86-video-nested-2011-09-12";
+  name = "xf86-video-nested-2012-06-15";
 
-  # Breaks at 8d80f2e415e9e58ca481fe52ae8f2290e25de898 for Xorg 7.6
   src = fetchgit {
     url = git://anongit.freedesktop.org/xorg/driver/xf86-video-nested;
-    rev = "fceee1716625badf698ca27dd5788a4deb8533bc";
-    sha256 = "6b3544ddcf40602364fd0e528f6e677c37ef8d08f6c4e756caea7e29abf200f7"; 
+    rev = "ad48dc6eb98776a8a886f26f31c0110352fa1da4";
+    sha256 = "43a102405acdcdb346ab197b33c8fa724d2140f33754f8ee3941a0eea152735c";
   };
 
-  # Fixed in e123277d10337a1c3b853118df0d1becdddf3b77
-  patchPhase = "sed -e 's/Werror/Werror -Wno-extra-portability/g' -i configure.ac";
-
-  buildInputs = 
-    [ autoconf automake fontsproto libX11 libXext libtool pkgconfig
-      renderproto utilmacros xorgserver
+  buildInputs =
+    [ autoconf automake fontsproto libX11 libXext libtool pixman
+      pkgconfig renderproto utilmacros xorgserver
     ];
 
-  configureScript = "./autogen.sh";
+
+  configurePhase = ''
+    autoreconf -fvi
+    ./configure --prefix=$out CFLAGS="-I${pixman}/include/pixman-1"
+  '';
 
   meta = {
-    homepage = git://anongit.freedesktop.org/xorg/driver/xf86-video-nested;
-    description = "Driver to run Xorg on top of Xorg or something else";
+    homepage = http://cgit.freedesktop.org/xorg/driver/xf86-video-nested;
+    description = "A driver to run Xorg on top of Xorg or something else";
     maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/os-specific/linux/xf86-video-nouveau/default.nix b/pkgs/os-specific/linux/xf86-video-nouveau/default.nix
index e92b7f8003d..876daa7a1ec 100644
--- a/pkgs/os-specific/linux/xf86-video-nouveau/default.nix
+++ b/pkgs/os-specific/linux/xf86-video-nouveau/default.nix
@@ -3,7 +3,7 @@
 , autoconf
 , automake
 , libtool
-, xorgserver, xproto, fontsproto, xf86driproto, renderproto, videoproto
+, xorgserver, xproto, fontsproto, xf86driproto, renderproto, videoproto, pixman
 , utilmacros
 , libdrm
 , pkgconfig }:
@@ -21,12 +21,14 @@ stdenv.mkDerivation {
     autoconf
     automake
     libtool
-    xorgserver xproto fontsproto xf86driproto renderproto videoproto
+    xorgserver xproto fontsproto xf86driproto renderproto videoproto pixman
     utilmacros
     libdrm
     pkgconfig
   ];
 
+  NIX_CFLAGS_COMPILE = "-I${pixman}/include/pixman-1";
+
   preConfigure = "autoreconf -vfi";
 
   meta = {
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
new file mode 100644
index 00000000000..ac07474d3f4
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, kernelDev, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
+
+stdenv.mkDerivation {
+  name = "zfs-0.6.1-${kernelDev.version}";
+
+  src = fetchurl {
+    url = http://archive.zfsonlinux.org/downloads/zfsonlinux/zfs/zfs-0.6.1.tar.gz;
+    sha256 = "1ykph9d4p70mam6lvcx0zld6d34gch15dsilds5ncbxh0m52knl0";
+  };
+
+  patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ];
+
+  buildInputs = [ kernelDev spl perl autoconf automake libtool zlib libuuid coreutils ];
+
+  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
+  NIX_CFLAGS_LINK = "-lgcc_s";
+
+  preConfigure = ''
+    ./autogen.sh
+
+    substituteInPlace ./module/zfs/zfs_ctldir.c    --replace "umount -t zfs"     "${utillinux}/bin/umount -t zfs"
+    substituteInPlace ./module/zfs/zfs_ctldir.c    --replace "mount -t zfs"      "${utillinux}/bin/mount -t zfs"
+    substituteInPlace ./lib/libzfs/libzfs_mount.c  --replace "/bin/umount"       "${utillinux}/bin/umount"
+    substituteInPlace ./lib/libzfs/libzfs_mount.c  --replace "/bin/mount"        "${utillinux}/bin/mount"
+    substituteInPlace ./udev/rules.d/*             --replace "/lib/udev/vdev_id" "$out/lib/udev/vdev_id"
+    substituteInPlace ./cmd/ztest/ztest.c          --replace "/usr/sbin/ztest"   "$out/sbin/ztest"
+    substituteInPlace ./cmd/ztest/ztest.c          --replace "/usr/sbin/zdb"     "$out/sbin/zdb"
+  '';
+
+  configureFlags = ''
+    --with-linux=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build 
+    --with-linux-obj=${kernelDev}/lib/modules/${kernelDev.modDirVersion}/build 
+    --with-spl=${spl}/libexec/spl
+  '';
+
+  meta = {
+    description = "ZFS Filesystem Linux Kernel module";
+    longDescription = ''
+      ZFS is a filesystem that combines a logical volume manager with a
+      Copy-On-Write filesystem with data integrity detection and repair,
+      snapshotting, cloning, block devices, deduplication, and more. 
+      '';
+    homepage = http://zfsonlinux.org/;
+    license = stdenv.lib.licenses.cddl;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch b/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch
new file mode 100644
index 00000000000..49ad88fc3a4
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/mount_zfs_prefix.patch
@@ -0,0 +1,24 @@
+diff -crN '--exclude=.git' zfs-0.60-rc11/cmd/mount_zfs/Makefile.am zfs/cmd/mount_zfs/Makefile.am
+*** zfs-0.60-rc11/cmd/mount_zfs/Makefile.am 2012-10-22 10:26:07.066205000 -0700
+--- zfs/cmd/mount_zfs/Makefile.am 2012-10-22 11:16:21.859286000 -0700
+***************
+*** 7,14 ****
+  #
+  # Ignore the prefix for the mount helper.  It must be installed in /sbin/
+  # because this path is hardcoded in the mount(8) for security reasons.
+  #
+- sbindir=/sbin
+  sbin_PROGRAMS = mount.zfs
+
+  mount_zfs_SOURCES = \
+--- 7,16 ----
+  #
+  # Ignore the prefix for the mount helper.  It must be installed in /sbin/
+  # because this path is hardcoded in the mount(8) for security reasons.
++ #
++ # ... except on nixos, where it really is /var/run/current-system/sw/sbin,
++ # which is where this will end up if we put it in ${out}/sbin.
+  #
+  sbin_PROGRAMS = mount.zfs
+
+  mount_zfs_SOURCES = \
diff --git a/pkgs/os-specific/linux/zfs/nix-build.patch b/pkgs/os-specific/linux/zfs/nix-build.patch
new file mode 100644
index 00000000000..af4b94e355d
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/nix-build.patch
@@ -0,0 +1,214 @@
+diff -rc zfs-0.6.1.orig/include/linux/Makefile.am zfs-0.6.1/include/linux/Makefile.am
+*** zfs-0.6.1.orig/include/linux/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/linux/Makefile.am	2013-03-28 11:07:10.099129000 -0700
+***************
+*** 16,21 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include/linux
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 16,21 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include/linux
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/include/Makefile.am zfs-0.6.1/include/Makefile.am
+*** zfs-0.6.1.orig/include/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/Makefile.am	2013-03-28 11:07:38.810870000 -0700
+***************
+*** 28,33 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 28,33 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/include/sys/fm/fs/Makefile.am zfs-0.6.1/include/sys/fm/fs/Makefile.am
+*** zfs-0.6.1.orig/include/sys/fm/fs/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/sys/fm/fs/Makefile.am	2013-03-28 11:07:36.074756000 -0700
+***************
+*** 13,18 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include/sys/fm/fs
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 13,18 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include/sys/fm/fs
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/include/sys/fm/Makefile.am zfs-0.6.1/include/sys/fm/Makefile.am
+*** zfs-0.6.1.orig/include/sys/fm/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/sys/fm/Makefile.am	2013-03-28 11:07:32.265896000 -0700
+***************
+*** 16,21 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include/sys/fm
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 16,21 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include/sys/fm
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/include/sys/fs/Makefile.am zfs-0.6.1/include/sys/fs/Makefile.am
+*** zfs-0.6.1.orig/include/sys/fs/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/sys/fs/Makefile.am	2013-03-28 11:07:27.592339000 -0700
+***************
+*** 13,18 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include/sys/fs
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 13,18 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include/sys/fs
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/include/sys/Makefile.am zfs-0.6.1/include/sys/Makefile.am
+*** zfs-0.6.1.orig/include/sys/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/include/sys/Makefile.am	2013-03-28 11:07:19.045717000 -0700
+***************
+*** 91,96 ****
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = /usr/src/zfs-$(VERSION)/include/sys
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+--- 91,96 ----
+  endif
+  
+  if CONFIG_KERNEL
+! kerneldir = @prefix@/include/sys
+  kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+  endif
+diff -rc zfs-0.6.1.orig/Makefile.am zfs-0.6.1/Makefile.am
+*** zfs-0.6.1.orig/Makefile.am	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/Makefile.am	2013-04-05 23:49:39.763623000 -0700
+***************
+*** 9,18 ****
+  if CONFIG_KERNEL
+  SUBDIRS += module
+  
+! extradir = /usr/src/zfs-$(VERSION)
+  extra_HEADERS = zfs.release.in zfs_config.h.in
+  
+! kerneldir = /usr/src/zfs-$(VERSION)/$(LINUX_VERSION)
+  nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
+  endif
+  
+--- 9,18 ----
+  if CONFIG_KERNEL
+  SUBDIRS += module
+  
+! extradir = @prefix@/libexec/zfs-$(VERSION)
+  extra_HEADERS = zfs.release.in zfs_config.h.in
+  
+! kerneldir = @prefix@/zfs-$(VERSION)/$(LINUX_VERSION)
+  nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
+  endif
+  
+diff -rc zfs-0.6.1.orig/module/Makefile.in zfs-0.6.1/module/Makefile.in
+*** zfs-0.6.1.orig/module/Makefile.in	2013-03-26 09:37:47.000000000 -0700
+--- zfs-0.6.1/module/Makefile.in	2013-04-05 23:50:41.497876000 -0700
+***************
+*** 18,26 ****
+  	@# installed devel headers, or they may be in the module
+  	@# subdirectory when building against the spl source tree.
+  	@if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
+! 		/bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
+  	elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
+! 		/bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
+  	else \
+  		echo -e "\n" \
+  		"*** Missing spl symbols ensure you have built the spl:\n" \
+--- 18,26 ----
+  	@# installed devel headers, or they may be in the module
+  	@# subdirectory when building against the spl source tree.
+  	@if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
+! 		cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
+  	elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
+! 		cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
+  	else \
+  		echo -e "\n" \
+  		"*** Missing spl symbols ensure you have built the spl:\n" \
+***************
+*** 28,33 ****
+--- 28,35 ----
+  		"*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
+  		exit 1; \
+  	fi
++ 	@# when copying a file out of the nix store, we need to make it writable again. 
++ 	chmod +w @SPL_SYMBOLS@
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
+  
+  clean:
+***************
+*** 42,62 ****
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+! 		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
+  		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
+  	@# Remove extraneous build products when packaging
+! 	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+  	if [ -n $$kmoddir ]; then \
+  		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
+  
+  modules_uninstall:
+  	@# Uninstall the kernel modules
+! 	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
+  	list='$(subdir-m)'; for subdir in $$list; do \
+  		$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
+  	done
+--- 44,64 ----
+  modules_install:
+  	@# Install the kernel modules
+  	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+! 		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
+  		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR)
+  	@# Remove extraneous build products when packaging
+! 	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+  	if [ -n $$kmoddir ]; then \
+  		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+  	fi
+! 	sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+  	if [ -f $$sysmap ]; then \
+  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+  	fi
+  
+  modules_uninstall:
+  	@# Uninstall the kernel modules
+! 	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
+  	list='$(subdir-m)'; for subdir in $$list; do \
+  		$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
+  	done
diff --git a/pkgs/os-specific/windows/jom/default.nix b/pkgs/os-specific/windows/jom/default.nix
index 2cdd63cc0eb..8f8477d1864 100644
--- a/pkgs/os-specific/windows/jom/default.nix
+++ b/pkgs/os-specific/windows/jom/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ qt48 ];
-  buildNativeInputs = [ flex /*cmake*/ ];
+  nativeBuildInputs = [ flex /*cmake*/ ];
 
   QTDIR = qt48;
   configurePhase = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   
   crossAttrs = {
     # cmakeFlags = "-DWIN32=1 -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_RC_COMPILER=${stdenv.cross.config}-windres";
-    QTDIR = qt48.hostDrv;
+    QTDIR = qt48.crossDrv;
     preBuild = ''
       export NIX_CROSS_CFLAGS_COMPILE=-fpermissive
     '';
diff --git a/pkgs/os-specific/windows/pthread-w32/default.nix b/pkgs/os-specific/windows/pthread-w32/default.nix
index 39afd119643..cd417eb9ad0 100644
--- a/pkgs/os-specific/windows/pthread-w32/default.nix
+++ b/pkgs/os-specific/windows/pthread-w32/default.nix
@@ -28,6 +28,14 @@ stdenv.mkDerivation {
        cp -v pthread.h semaphore.h sched.h "$out/include"
     '';
 
+  postFixup =
+    # By default `mingw_headers' is propagated.  Prevent that, because
+    # otherwise MinGW headers appear twice in `-I', and thus the
+    # "#include_next <float.h>" in MinGW's <float.h> picks up itself instead
+    # of picking up GCC's (hence, FLT_RADIX is left undefined, for instance.)
+    '' rm -f "$out/nix-support/propagated-build-inputs"
+    '';
+
   meta = {
     description = "POSIX threads for Woe32";
 
diff --git a/pkgs/os-specific/windows/w32api/default.nix b/pkgs/os-specific/windows/w32api/default.nix
index a4f4245125d..2a5af71b5ec 100644
--- a/pkgs/os-specific/windows/w32api/default.nix
+++ b/pkgs/os-specific/windows/w32api/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation ({
     sha256 = "09rhnl6zikmdyb960im55jck0rdy5z9nlg3akx68ixn7khf3j8wb";
   };
 
-  buildNativeInputs = [ xz ];
+  nativeBuildInputs = [ xz ];
 
 } //
 (if onlyHeaders then {
diff --git a/pkgs/servers/amqp/rabbitmq-server/default.nix b/pkgs/servers/amqp/rabbitmq-server/default.nix
index 1d93c0c5f22..59788be15d1 100644
--- a/pkgs/servers/amqp/rabbitmq-server/default.nix
+++ b/pkgs/servers/amqp/rabbitmq-server/default.nix
@@ -1,16 +1,18 @@
 { stdenv, fetchurl, erlang, python, libxml2, libxslt, xmlto
-, docbook_xml_dtd_45, docbook_xsl }:
+, docbook_xml_dtd_45, docbook_xsl, zip, unzip }:
 
 stdenv.mkDerivation rec {
-  name = "rabbitmq-server-2.4.0";
+  name = "rabbitmq-server-${version}";
+
+  version = "3.0.3";
 
   src = fetchurl {
-    url = "http://www.rabbitmq.com/releases/rabbitmq-server/v2.4.0/${name}.tar.gz";
-    sha256 = "0zvyyqw9kpzi791hvv8qj1aw0fpx5m5cgqfvffxfrdz8daxx3nma";
+    url = "http://www.rabbitmq.com/releases/rabbitmq-server/v${version}/${name}.tar.gz";
+    sha256 = "07mp57xvszdrlgw8rgn9r9dpa6vdqdjk7f1dyh6a9sdg8s9fby38";
   };
 
   buildInputs =
-    [ erlang python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl ];
+    [ erlang python libxml2 libxslt xmlto docbook_xml_dtd_45 docbook_xsl zip unzip ];
 
   preBuild =
     ''
@@ -20,6 +22,14 @@ stdenv.mkDerivation rec {
 
   installFlags = "TARGET_DIR=$(out)/libexec/rabbitmq SBIN_DIR=$(out)/sbin MAN_DIR=$(out)/share/man";
 
+  preInstall =
+    ''
+      sed -i \
+        -e 's|SYS_PREFIX=|SYS_PREFIX=''${SYS_PREFIX-''${HOME}/.rabbitmq/${version}}|' \
+        -e 's|CONF_ENV_FILE=''${SYS_PREFIX}\(.*\)|CONF_ENV_FILE=\1|' \
+        scripts/rabbitmq-defaults
+    '';
+
   postInstall =
     ''
       echo 'PATH=${erlang}/bin:${PATH:+:}$PATH' >> $out/sbin/rabbitmq-env
diff --git a/pkgs/servers/dico/default.nix b/pkgs/servers/dico/default.nix
index ac897554ce2..d711d8a75ca 100644
--- a/pkgs/servers/dico/default.nix
+++ b/pkgs/servers/dico/default.nix
@@ -1,16 +1,16 @@
 { fetchurl, stdenv, libtool, gettext, zlib, readline, gsasl
-, guile, python }:
+, guile, python, pcre }:
 
 stdenv.mkDerivation rec {
-  name = "dico-2.1";
+  name = "dico-2.2";
 
   src = fetchurl {
-    url = "mirror://gnu/dico/${name}.tar.gz";
-    sha256 = "0cs4jxnz6g5xqrhkbnycn7jl9fs8jfjh33vza7i68m8qmjwx2vza";
+    url = "mirror://gnu/dico/${name}.tar.xz";
+    sha256 = "04pjks075x20d19l623mj50bw64g8i41s63z4kzzqcbg9qg96x64";
   };
 
   # XXX: Add support for GNU SASL.
-  buildInputs = [ libtool gettext zlib readline gsasl guile python ];
+  buildInputs = [ libtool gettext zlib readline gsasl guile python pcre ];
 
   doCheck = true;
 
diff --git a/pkgs/servers/dict/dictd-wiktionary.nix b/pkgs/servers/dict/dictd-wiktionary.nix
new file mode 100644
index 00000000000..48aaf187605
--- /dev/null
+++ b/pkgs/servers/dict/dictd-wiktionary.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchurl, python, dict, glibcLocales, writeScript}:
+
+stdenv.mkDerivation rec {
+  version = "20121021";
+  name = "dict-db-wiktionary-${version}";
+  data = fetchurl {
+    url = "http://dumps.wikimedia.org/enwiktionary/${version}/enwiktionary-${version}-pages-articles.xml.bz2";
+    sha256 = "1i4xwdpc2bx58495iy62iz0kn50c3qmnh4qribi82f2rd4qkfjd2";
+  };
+
+  convert = ./wiktionary2dict.py;
+  buildInputs = [python dict glibcLocales];
+
+  builder = writeScript "wiktionary-builder.sh" ''
+    source $stdenv/setup
+
+    ensureDir $out/share/dictd/
+    cd $out/share/dictd
+
+    export LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive
+    python -O ${convert} ${data}
+    dictzip wiktionary-en.dict
+    echo en_US.UTF-8 > locale
+  '';
+
+  meta = {
+    description = "DICT version of English Wiktionary";
+    homepage = http://en.wiktionary.org/;
+    maintainers = [ stdenv.lib.maintainers.mornfall ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/servers/dict/dictd-wordnet.nix b/pkgs/servers/dict/dictd-wordnet.nix
new file mode 100644
index 00000000000..063868ddc6e
--- /dev/null
+++ b/pkgs/servers/dict/dictd-wordnet.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchsvn, python, wordnet, writeScript}:
+
+stdenv.mkDerivation rec {
+  version = "542";
+  name = "dict-db-wordnet-${version}";
+
+  buildInputs = [python wordnet];
+  convert = ./wordnet_structures.py;
+
+  builder = writeScript "builder.sh" ''
+    . ${stdenv}/setup
+    ensureDir $out/share/dictd/
+    cd $out/share/dictd
+
+    for i in ${wordnet}/dict/data.*; do
+      DATA="$DATA `echo $i | sed -e s,data,index,` $i";
+    done
+
+    python ${convert} $DATA
+    echo en_US.UTF-8 > locale
+  '';
+
+  meta = {
+    description = "dictd-compatible version of WordNet";
+
+    longDescription =
+      '' WordNet® is a large lexical database of English. This package makes
+         the wordnet data available to dictd and by extension for lookup with
+         the dict command. '';
+
+    homepage = http://wordnet.princeton.edu/;
+
+    maintainers = [ stdenv.lib.maintainers.mornfall ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/servers/dict/wiktionary2dict.py b/pkgs/servers/dict/wiktionary2dict.py
new file mode 100644
index 00000000000..8a0210e7254
--- /dev/null
+++ b/pkgs/servers/dict/wiktionary2dict.py
@@ -0,0 +1,778 @@
+# Adapted to produce DICT-compatible files by Petr Rockai in 2012
+# Based on code from wiktiondict by Greg Hewgill
+import re
+import sys
+import codecs
+import os
+import textwrap
+import time
+import xml.sax
+
+class Text:
+    def __init__(self, s):
+        self.s = s
+    def process(self):
+        return s
+
+class TemplateCall:
+    def __init__(self):
+        pass
+    def process(self):
+        pass
+
+class Template:
+    def __init__(self):
+        self.parts = []
+    def append(self, part):
+        self.parts.append(part)
+    def process(self):
+        return ''.join(x.process() for x in self.parts)
+
+class Whitespace:
+    def __init__(self, s):
+        self.s = s
+
+class OpenDouble: pass
+class OpenTriple: pass
+class CloseDouble: pass
+class CloseTriple: pass
+
+class Equals:
+    def __str__(self):
+        return "="
+
+class Delimiter:
+    def __init__(self, c):
+        self.c = c
+    def __str__(self):
+        return self.c
+
+def Tokenise(s):
+    s = unicode(s)
+    stack = []
+    last = 0
+    i = 0
+    while i < len(s):
+        if s[i] == '{' and i+1 < len(s) and s[i+1] == '{':
+            if i > last:
+                yield s[last:i]
+            if i+2 < len(s) and s[i+2] == '{':
+                yield OpenTriple()
+                stack.append(3)
+                i += 3
+            else:
+                yield OpenDouble()
+                stack.append(2)
+                i += 2
+            last = i
+        elif s[i] == '}' and i+1 < len(s) and s[i+1] == '}':
+            if i > last:
+                yield s[last:i]
+            if len(stack) == 0:
+                yield "}}"
+                i += 2
+            elif stack[-1] == 2:
+                yield CloseDouble()
+                i += 2
+                stack.pop()
+            elif i+2 < len(s) and s[i+2] == '}':
+                yield CloseTriple()
+                i += 3
+                stack.pop()
+            else:
+                raise SyntaxError()
+            last = i
+        elif s[i] == ':' or s[i] == '|':
+            if i > last:
+                yield s[last:i]
+            yield Delimiter(s[i])
+            i += 1
+            last = i
+        elif s[i] == '=':
+            if i > last:
+                yield s[last:i]
+            yield Equals()
+            i += 1
+            last = i
+        #elif s[i] == ' ' or s[i] == '\t' or s[i] == '\n':
+        #    if i > last:
+        #        yield s[last:i]
+        #    last = i
+        #    m = re.match(r"\s+", s[i:])
+        #    assert m
+        #    yield Whitespace(m.group(0))
+        #    i += len(m.group(0))
+        #    last = i
+        else:
+            i += 1
+    if i > last:
+        yield s[last:i]
+
+def processSub(templates, tokens, args):
+    t = tokens.next()
+    if not isinstance(t, unicode):
+        raise SyntaxError
+    name = t
+    t = tokens.next()
+    default = None
+    if isinstance(t, Delimiter) and t.c == '|':
+        default = ""
+        while True:
+            t = tokens.next()
+            if isinstance(t, unicode):
+                default += t
+            elif isinstance(t, OpenDouble):
+                default += processTemplateCall(templates, tokens, args)
+            elif isinstance(t, OpenTriple):
+                default += processSub(templates, tokens, args)
+            elif isinstance(t, CloseTriple):
+                break
+            else:
+                print "Unexpected:", t
+                raise SyntaxError()
+    if name in args:
+        return args[name]
+    if default is not None:
+        return default
+    if name == "lang":
+        return "en"
+    return "{{{%s}}}" % name
+
+def processTemplateCall(templates, tokens, args):
+    template = tokens.next().strip().lower()
+    args = {}
+    a = 1
+    t = tokens.next()
+    while True:
+        if isinstance(t, Delimiter):
+            name = unicode(a)
+            arg = ""
+            while True:
+                t = tokens.next()
+                if isinstance(t, unicode):
+                    arg += t
+                elif isinstance(t, OpenDouble):
+                    arg += processTemplateCall(templates, tokens, args)
+                elif isinstance(t, OpenTriple):
+                    arg += processSub(templates, tokens, args)
+                elif isinstance(t, Delimiter) and t.c != '|':
+                    arg += str(t)
+                else:
+                    break
+            if isinstance(t, Equals):
+                name = arg.strip()
+                arg = ""
+                while True:
+                    t = tokens.next()
+                    if isinstance(t, (unicode, Equals)):
+                        arg += unicode(t)
+                    elif isinstance(t, OpenDouble):
+                        arg += processTemplateCall(templates, tokens, args)
+                    elif isinstance(t, OpenTriple):
+                        arg += processSub(templates, tokens, args)
+                    elif isinstance(t, Delimiter) and t.c != '|':
+                        arg += str(t)
+                    else:
+                        break
+                arg = arg.strip()
+            else:
+                a += 1
+            args[name] = arg
+        elif isinstance(t, CloseDouble):
+            break
+        else:
+            print "Unexpected:", t
+            raise SyntaxError
+    #print template, args
+    if template[0] == '#':
+        if template == "#if":
+            if args['1'].strip():
+                return args['2']
+            elif '3' in args:
+                return args['3']
+            else:
+                return ""
+        elif template == "#ifeq":
+            if args['1'].strip() == args['2'].strip():
+                return args['3']
+            elif '4' in args:
+                return args['4']
+            else:
+                return ""
+        elif template == "#ifexist":
+            return ""
+        elif template == "#switch":
+            sw = args['1'].strip()
+            if sw in args:
+                return args[sw]
+            else:
+                return ""
+        else:
+            print "Unknown ParserFunction:", template
+            sys.exit(1)
+    if template not in templates:
+        return "{{%s}}" % template
+    return process(templates, templates[template], args)
+
+def process(templates, s, args = {}):
+    s = re.compile(r"<!--.*?-->", re.DOTALL).sub("", s)
+    s = re.compile(r"<noinclude>.*?</noinclude>", re.DOTALL).sub("", s)
+    assert "<onlyinclude>" not in s
+    #s = re.sub(r"(.*?)<onlyinclude>(.*?)</onlyinclude>(.*)", r"\1", s)
+    s = re.compile(r"<includeonly>(.*?)</includeonly>", re.DOTALL).sub(r"\1", s)
+    r = ""
+    #print list(Tokenise(s))
+    tokens = Tokenise(s)
+    try:
+        while True:
+            t = tokens.next()
+            if isinstance(t, OpenDouble):
+                r += processTemplateCall(templates, tokens, args)
+            elif isinstance(t, OpenTriple):
+                r += processSub(templates, tokens, args)
+            else:
+                r += unicode(t)
+    except StopIteration:
+        pass
+    return r
+
+def test():
+    templates = {
+        'lb': "{{",
+        'name-example': "I am a template example, my first name is '''{{{firstName}}}''' and my last name is '''{{{lastName}}}'''. You can reference my page at [[{{{lastName}}}, {{{firstName}}}]].",
+        't': "start-{{{1|pqr}}}-end",
+        't0': "start-{{{1}}}-end",
+        't1': "start{{{1}}}end<noinclude>moo</noinclude>",
+        't2a1': "{{t2demo|a|{{{1}}}}}",
+        't2a2': "{{t2demo|a|2={{{1}}}}}",
+        't2demo': "start-{{{1}}}-middle-{{{2}}}-end",
+        't5': "{{t2demo|{{{a}}}=b}}",
+        't6': "t2demo|a",
+    }
+    def t(text, expected):
+        print "text:", text
+        s = process(templates, text)
+        if s != expected:
+            print "got:", s
+            print "expected:", expected
+            sys.exit(1)
+    t("{{Name-example}}", "I am a template example, my first name is '''{{{firstName}}}''' and my last name is '''{{{lastName}}}'''. You can reference my page at [[{{{lastName}}}, {{{firstName}}}]].")
+    t("{{Name-example | firstName=John | lastName=Smith }}", "I am a template example, my first name is '''John''' and my last name is '''Smith'''. You can reference my page at [[Smith, John]].")
+    t("{{t0|a}}", "start-a-end")
+    t("{{t0| }}", "start- -end")
+    t("{{t0|}}", "start--end")
+    t("{{t0}}", "start-{{{1}}}-end")
+    t("{{t0|     }}", "start-     -end")
+    t("{{t0|\n}}", "start-\n-end")
+    t("{{t0|1=     }}", "start--end")
+    t("{{t0|1=\n}}", "start--end")
+    t("{{T}}", "start-pqr-end")
+    t("{{T|}}", "start--end")
+    t("{{T|abc}}", "start-abc-end")
+    t("{{T|abc|def}}", "start-abc-end")
+    t("{{T|1=abc|1=def}}", "start-def-end")
+    t("{{T|abc|1=def}}", "start-def-end")
+    t("{{T|1=abc|def}}", "start-def-end")
+    t("{{T|{{T}}}}", "start-start-pqr-end-end")
+    t("{{T|{{T|{{T}}}}}}", "start-start-start-pqr-end-end-end")
+    t("{{T|{{T|{{T|{{T}}}}}}}}", "start-start-start-start-pqr-end-end-end-end")
+    t("{{T|a{{t|b}}}}", "start-astart-b-end-end")
+    t("{{T|{{T|a=b}}}}", "start-start-pqr-end-end")
+    t("{{T|a=b}}", "start-pqr-end")
+    t("{{T|1=a=b}}", "start-a=b-end")
+    #t("{{t1|{{lb}}tc}}}}", "start{{tcend}}")
+    #t("{{t2a1|1=x=y}}", "start-a-middle-{{{2}}}-end")
+    #t("{{t2a2|1=x=y}}", "start-a-middle-x=y-end")
+    #t("{{t5|a=2=d}}", "start-{{{1}}}-middle-d=b-end")
+    #t("{{ {{t6}} }}", "{{ t2demo|a }}")
+    t("{{t|[[a|b]]}}", "start-b-end")
+    t("{{t|[[a|b]] }}", "start-b -end")
+
+Parts = {
+    # Standard POS headers
+    'noun': "n.",
+    'Noun': "n.",
+    'Noun 1': "n.",
+    'Noun 2': "n.",
+    'Verb': "v.",
+    'Adjective': "adj.",
+    'Adverb': "adv.",
+    'Pronoun': "pron.",
+    'Conjunction': "conj.",
+    'Interjection': "interj.",
+    'Preposition': "prep.",
+    'Proper noun': "n.p.",
+    'Proper Noun': "n.p.",
+    'Article': "art.",
+
+    # Standard non-POS level 3 headers
+    '{{acronym}}': "acr.",
+    'Acronym': "acr.",
+    '{{abbreviation}}': "abbr.",
+    '[[Abbreviation]]': "abbr.",
+    'Abbreviation': "abbr.",
+    '[[initialism]]': "init.",
+    '{{initialism}}': "init.",
+    'Initialism': "init.",
+    'Contraction': "cont.",
+    'Prefix': "prefix",
+    'Suffix': "suffix",
+    'Symbol': "sym.",
+    'Letter': "letter",
+    'Idiom': "idiom",
+    'Idioms': "idiom",
+    'Phrase': "phrase",
+
+    # Debated POS level 3 headers
+    'Number': "num.",
+    'Numeral': "num.",
+    'Cardinal number': "num.",
+    'Ordinal number': "num.",
+    'Cardinal numeral': "num.",
+    'Ordinal numeral': "num.",
+
+    # Other headers in use
+    'Personal pronoun': "pers.pron.",
+    'Adjective/Adverb': "adj./adv.",
+    'Proper adjective': "prop.adj.",
+    'Determiner': "det.",
+    'Demonstrative determiner': "dem.det.",
+    'Clitic': "clitic",
+    'Infix': "infix",
+    'Counter': "counter",
+    'Kanji': None,
+    'Kanji reading': None,
+    'Hiragana letter': None,
+    'Katakana letter': None,
+    'Pinyin': None,
+    'Han character': None,
+    'Hanzi': None,
+    'Hanja': None,
+    'Proverb': "prov.",
+    'Expression': None,
+    'Adjectival noun': None,
+    'Quasi-adjective': None,
+    'Particle': "part.",
+    'Infinitive particle': "part.",
+    'Possessive adjective': "poss.adj.",
+    'Verbal prefix': "v.p.",
+    'Postposition': "post.",
+    'Prepositional article': "prep.art.",
+    'Phrasal verb': "phr.v.",
+    'Participle': "participle",
+    'Interrogative auxiliary verb': "int.aux.v.",
+    'Pronominal adverb': "pron.adv.",
+    'Adnominal': "adn.",
+    'Abstract pronoun': "abs.pron.",
+    'Conjunction particle': None,
+    'Root': "root",
+
+    # Non-standard, deprecated headers
+    'Noun form': "n.",
+    'Verb form': "v.",
+    'Adjective form': "adj.form.",
+    'Nominal phrase': "nom.phr.",
+    'Noun phrase': "n. phrase",
+    'Verb phrase': "v. phrase",
+    'Transitive verb': "v.t.",
+    'Intransitive verb': "v.i.",
+    'Reflexive verb': "v.r.",
+    'Cmavo': None,
+    'Romaji': "rom.",
+    'Hiragana': None,
+    'Furigana': None,
+    'Compounds': None,
+
+    # Other headers seen
+    'Alternative forms': None,
+    'Alternative spellings': None,
+    'Anagrams': None,
+    'Antonym': None,
+    'Antonyms': None,
+    'Conjugation': None,
+    'Declension': None,
+    'Declension and pronunciations': None,
+    'Definite Article': "def.art.",
+    'Definite article': "def.art.",
+    'Demonstrative pronoun': "dem.pron.",
+    'Derivation': None,
+    'Derived expression': None,
+    'Derived expressions': None,
+    'Derived forms': None,
+    'Derived phrases': None,
+    'Derived terms': None,
+    'Derived, Related terms': None,
+    'Descendants': None,
+    #'Etymology': None,
+    #'Etymology 1': None,
+    #'Etymology 2': None,
+    #'Etymology 3': None,
+    #'Etymology 4': None,
+    #'Etymology 5': None,
+    'Examples': None,
+    'External links': None,
+    '[[Gismu]]': None,
+    'Gismu': None,
+    'Homonyms': None,
+    'Homophones': None,
+    'Hyphenation': None,
+    'Indefinite article': "art.",
+    'Indefinite pronoun': "ind.pron.",
+    'Indefinite Pronoun': "ind.pron.",
+    'Indetermined pronoun': "ind.pron.",
+    'Interrogative conjunction': "int.conj.",
+    'Interrogative determiner': "int.det.",
+    'Interrogative particle': "int.part.",
+    'Interrogative pronoun': "int.pron.",
+    'Legal expression': "legal",
+    'Mass noun': "n.",
+    'Miscellaneous': None,
+    'Mutations': None,
+    'Noun and verb': "n/v.",
+    'Other language': None,
+    'Pinyin syllable': None,
+    'Possessive determiner': "poss.det.",
+    'Possessive pronoun': "poss.pron.",
+    'Prepositional phrase': "prep.phr.",
+    'Prepositional Pronoun': "prep.pron.",
+    'Pronunciation': None,
+    'Pronunciation 1': None,
+    'Pronunciation 2': None,
+    'Quotations': None,
+    'References': None,
+    'Reflexive pronoun': "refl.pron.",
+    'Related expressions': None,
+    'Related terms': None,
+    'Related words': None,
+    'Relative pronoun': "rel.pron.",
+    'Saying': "saying",
+    'See also': None,
+    'Shorthand': None,
+    '[http://en.wikipedia.org/wiki/Shorthand Shorthand]': None,
+    'Sister projects': None,
+    'Spelling note': None,
+    'Synonyms': None,
+    'Translation': None,
+    'Translations': None,
+    'Translations to be checked': None,
+    'Transliteration': None,
+    'Trivia': None,
+    'Usage': None,
+    'Usage in English': None,
+    'Usage notes': None,
+    'Verbal noun': "v.n.",
+}
+PartsUsed = {}
+for p in Parts.keys():
+    PartsUsed[p] = 0
+
+def encode(s):
+    r = e(s)
+    assert r[1] == len(s)
+    return r[0]
+
+def dowikilink(m):
+    a = m.group(1).split("|")
+    if len(a) > 1:
+        link = a[1]
+    else:
+        link = a[0]
+    if ':' in link:
+        link = ""
+    return link
+
+seentemplates = {}
+def dotemplate(m):
+    aa = m.group(1).split("|")
+    args = {}
+    n = 0
+    for a in aa:
+        am = re.match(r"(.*?)(=(.*))?", a)
+        if am:
+            args[am.group(1)] = am.group(3)
+        else:
+            n += 1
+            args[n] = am.group(1)
+
+    #if aa[0] in seentemplates:
+    #    seentemplates[aa[0]] += 1
+    #else:
+    #    seentemplates[aa[0]] = 1
+    #    print len(seentemplates), aa[0]
+    #print aa[0]
+
+    #if aa[0] not in Templates:
+    #    return "(unknown template %s)" % aa[0]
+    #body = Templates[aa[0]]
+    #body = re.sub(r"<noinclude>.*?</noinclude>", "", body)
+    #assert "<onlyinclude>" not in body
+    ##body = re.sub(r"(.*?)<onlyinclude>(.*?)</onlyinclude>(.*)", r"\1", body)
+    #body = re.sub(r"<includeonly>(.*?)</includeonly>", r"\1", body)
+    #def dotemplatearg(m):
+    #    ta = m.group(1).split("|")
+    #    if ta[0] in args:
+    #        return args[ta[0]]
+    #    elif len(ta) > 1:
+    #        return ta[1]
+    #    else:
+    #        return "{{{%s}}}" % ta[0]
+    #body = re.sub(r"{{{(.*?)}}}", dotemplatearg, body)
+    #return dewiki(body)
+
+def doparserfunction(m):
+    a = m.group(2).split("|")
+    if m.group(1) == "ifeq":
+        if a[0] == a[1]:
+            return a[2]
+        elif len(a) >= 4:
+            return a[3]
+    return ""
+
+def dewiki(body, indent = 0):
+    # process in this order:
+    #   {{{ }}}
+    #   <> <>
+    #   [[ ]]
+    #   {{ }}
+    #   ''' '''
+    #   '' ''
+    #body = wikimediatemplate.process(Templates, body)
+    body = re.sub(r"\[\[(.*?)\]\]", dowikilink, body)
+    #body = re.sub(r"{{(.*?)}}", dotemplate, body)
+    #body = re.sub(r"{{#(.*?):(.*?)}}", doparserfunction, body)
+    body = re.sub(r"'''(.*?)'''", r"\1", body)
+    body = re.sub(r"''(.*?)''", r"\1", body)
+    lines = body.split("\n")
+    n = 0
+    i = 0
+    while i < len(lines):
+        if len(lines[i]) > 0 and lines[i][0] == "#":
+            if len(lines[i]) > 1 and lines[i][1] == '*':
+                wlines = textwrap.wrap(lines[i][2:].strip(),
+                    initial_indent = "    * ",
+                    subsequent_indent = "      ")
+            elif len(lines[i]) > 1 and lines[i][1] == ':':
+                wlines = textwrap.wrap(lines[i][2:].strip(),
+                    initial_indent = "        ",
+                    subsequent_indent = "        ")
+            else:
+                n += 1
+                wlines = textwrap.wrap(str(n) + ". " + lines[i][1:].strip(),
+                    subsequent_indent = "   ")
+        elif len(lines[i]) > 0 and lines[i][0] == "*":
+            n = 0
+            wlines = textwrap.wrap(lines[i][1:].strip(),
+                initial_indent = "* ",
+                subsequent_indent = "  ")
+        else:
+            n = 0
+            wlines = textwrap.wrap(lines[i].strip())
+            if len(wlines) == 0:
+                wlines = ['']
+        lines[i:i+1] = wlines
+        i += len(wlines)
+    return ''.join("  "*(indent-1)+x+"\n" for x in lines)
+
+class WikiSection:
+    def __init__(self, heading, body):
+        self.heading = heading
+        self.body = body
+        #self.lines = re.split("\n+", body.strip())
+        #if len(self.lines) == 1 and len(self.lines[0]) == 0:
+        #    self.lines = []
+        self.children = []
+    def __str__(self):
+        return "<%s:%i:%s>" % (self.heading, len(self.body or ""), ','.join([str(x) for x in self.children]))
+    def add(self, section):
+        self.children.append(section)
+
+def parse(word, text):
+    headings = list(re.finditer("^(=+)\s*(.*?)\s*=+\n", text, re.MULTILINE))
+    #print [x.group(1) for x in headings]
+    doc = WikiSection(word, "")
+    stack = [doc]
+    for i, m in enumerate(headings):
+        depth = len(m.group(1))
+        if depth < len(stack):
+            stack = stack[:depth]
+        else:
+            while depth > len(stack):
+                s = WikiSection(None, "")
+                stack[-1].add(s)
+                stack.append(s)
+        if i+1 < len(headings):
+            s = WikiSection(m.group(2), text[m.end(0):headings[i+1].start(0)].strip())
+        else:
+            s = WikiSection(m.group(2), text[m.end(0):].strip())
+        assert len(stack) == depth
+        stack[-1].add(s)
+        stack.append(s)
+    #while doc.heading is None and len(doc.lines) == 0 and len(doc.children) == 1:
+    #    doc = doc.children[0]
+    return doc
+
+def formatFull(word, doc):
+    def f(depth, section):
+        if section.heading:
+            r = "  "*(depth-1) + section.heading + "\n\n"
+        else:
+            r = ""
+        if section.body:
+            r += dewiki(section.body, depth+1)+"\n"
+        #r += "".join("  "*depth + x + "\n" for x in dewiki(section.body))
+        #if len(section.lines) > 0:
+        #    r += "\n"
+        for c in section.children:
+            r += f(depth+1, c)
+        return r
+    s = f(0, doc)
+    s += "Ref: http://en.wiktionary.org/wiki/%s\n" % word
+    return s
+
+def formatNormal(word, doc):
+    def f(depth, posdepth, section):
+        r = ""
+        if depth == posdepth:
+            if not section.heading or section.heading.startswith("Etymology"):
+                posdepth += 1
+            elif section.heading in Parts:
+                #p = Parts[section.heading]
+                #if p:
+                #    r += "  "*(depth-1) + word + " (" + p + ")\n\n"
+                r += "  "*(depth-1) + section.heading + "\n\n"
+            else:
+                print >>errors, "Unknown part: (%s) %s" % (word, section.heading)
+                return ""
+        elif depth > posdepth:
+            return ""
+        elif section.heading:
+            r += "  "*(depth-1) + section.heading + "\n\n"
+        if section.body:
+            r += dewiki(section.body, depth+1)+"\n"
+        #r += "".join("  "*depth + x + "\n" for x in dewiki(section.lines))
+        #if len(section.lines) > 0:
+        #    r += "\n"
+        for c in section.children:
+            r += f(depth+1, posdepth, c)
+        return r
+    s = f(0, 3, doc)
+    s += "Ref: http://en.wiktionary.org/wiki/%s\n" % word
+    return s
+
+def formatBrief(word, doc):
+    def f(depth, posdepth, section):
+        if depth == posdepth:
+            h = section.heading
+            if not section.heading or section.heading.startswith("Etymology"):
+                posdepth += 1
+            elif section.heading in Parts:
+                #h = Parts[section.heading]
+                #if h:
+                #    h = "%s (%s)" % (word, h)
+                pass
+            stack.append([h, False])
+        elif depth > 0:
+            stack.append([section.heading, False])
+        else:
+            stack.append(["%h " + section.heading, False])
+        r = ""
+        #if section.heading:
+        #    r += "  "*(depth-1) + section.heading + "\n"
+        body = ''.join(x+"\n" for x in section.body.split("\n") if len(x) > 0 and x[0] == '#')
+        if len(body) > 0:
+            for i in range(len(stack)):
+                if not stack[i][1]:
+                    if stack[i][0]:
+                        r += "  "*(i-1) + stack[i][0] + "\n"
+                    stack[i][1] = True
+            r += dewiki(body, depth+1)
+        for c in section.children:
+            r += f(depth+1, posdepth, c)
+        stack.pop()
+        return r
+    stack = []
+    s = f(0, 3, doc)
+    s += "Ref: http://en.wiktionary.org/wiki/%s\n" % word
+    return s
+
+class WikiHandler(xml.sax.ContentHandler):
+    def __init__(self):
+        self.element = None
+        self.page = None
+        self.text = ""
+        self.long = {}
+    def startElement(self, name, attrs):
+        #print "start", name, attrs
+        self.element = name
+    def endElement(self, name):
+        #print "end", name
+        if self.element == "text":
+            if self.page:
+                if self.page in self.long:
+                    print self.page, len(self.text)
+                    print
+                self.doPage(self.page, self.text)
+                self.page = None
+            self.text = ""
+        self.element = None
+    def characters(self, content):
+        #print "characters", content
+        if self.element == "title":
+            if self.checkPage(content):
+                self.page = content
+        elif self.element == "text":
+            if self.page:
+                self.text += content
+                if len(self.text) > 100000 and self.page not in self.long:
+                    self.long[self.page] = 1
+    def checkPage(self, page):
+        return False
+    def doPage(self, page, text):
+        pass
+
+class TemplateHandler(WikiHandler):
+    def checkPage(self, page):
+        return page.startswith("Template:")
+    def doPage(self, page, text):
+        Templates[page[page.find(':')+1:].lower()] = text
+
+class WordHandler(WikiHandler):
+    def checkPage(self, page):
+        return ':' not in page
+    def doPage(self, page, text):
+        m = re.match(r"#redirect\s*\[\[(.*?)\]\]", text, re.IGNORECASE)
+        if m:
+            out.write("  See <%s>" % page)
+            return
+        doc = parse(page, text)
+        out.write(formatBrief(page, doc))
+        #print formatBrief(page, doc)
+
+fn = sys.argv[1]
+info = """   This file was converted from the original database on:
+             %s
+
+   The original data is available from:
+             http://en.wiktionary.org
+   The version from which this file was generated was:
+             %s
+
+  Wiktionary is available under the GNU Free Documentation License.
+""" % (time.ctime(), os.path.basename(fn))
+
+errors = codecs.open("mkdict.err", "w", "utf_8")
+e = codecs.getencoder("utf_8")
+
+Templates = {}
+f = os.popen("bunzip2 -c %s" % fn, "r")
+xml.sax.parse(f, TemplateHandler())
+f.close()
+
+f = os.popen("bunzip2 -c %s" % fn, "r")
+out = codecs.getwriter("utf_8")(
+        os.popen("dictfmt -p wiktionary-en --locale en_US.UTF-8 --columns 0 -u http://en.wiktionary.org", "w"))
+
+out.write(("%%h English Wiktionary\n%s" % info).encode('utf-8'))
+xml.sax.parse(f, WordHandler())
+f.close()
+out.close()
diff --git a/pkgs/servers/dict/wordnet_structures.py b/pkgs/servers/dict/wordnet_structures.py
new file mode 100644
index 00000000000..6a88427c5da
--- /dev/null
+++ b/pkgs/servers/dict/wordnet_structures.py
@@ -0,0 +1,319 @@
+#!/usr/bin/env python
+#Copyright 2007 Sebastian Hagen
+# This file is part of wordnet_tools.
+
+# wordnet_tools is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2
+# as published by the Free Software Foundation
+
+# wordnet_tools is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with wordnet_tools; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+# This program requires python >= 2.4.
+
+# This program converts wordnet index/data file pairs into dict index/data
+# files usable by dictd.
+# This is basically a reimplementation of the wnfilter program by Rik Faith,
+# which unfortunately doesn't work correctly for wordnet files in the newer
+# formats. This version of wordnet_structures whould parse wordnet 2.1 files
+# correctly, and create output very similar to what wnfilter would have
+# written.
+
+import datetime
+from textwrap import TextWrapper
+
+CAT_ADJECTIVE = 0
+CAT_ADVERB = 1
+CAT_NOUN = 2
+CAT_VERB = 3
+
+category_map = {
+   'n': CAT_NOUN,
+   'v': CAT_VERB,
+   'a': CAT_ADJECTIVE,
+   's': CAT_ADJECTIVE,
+   'r': CAT_ADVERB
+}
+
+
+class WordIndex:
+   def __init__(self, lemma, category, ptrs, synsets, tagsense_count):
+      self.lemma = lemma
+      self.category = category
+      self.ptrs = ptrs
+      self.synsets = synsets
+      self.tagsense_count = tagsense_count
+   
+   @classmethod
+   def build_from_line(cls, line_data, synset_map):
+      line_split = line_data.split()
+      lemma = line_split[0]
+      category = category_map[line_split[1]]
+      synset_count = int(line_split[2],10)
+      ptr_count = int(line_split[3],10)
+      ptrs = [line_split[i] for i in range(3, 3+ptr_count)]
+      tagsense_count = int(line_split[5 + ptr_count],10)
+      synsets = [synset_map[int(line_split[i],10)] for i in range(6 + ptr_count, 6 + ptr_count + synset_count)]
+      return cls(lemma, category, ptrs, synsets, tagsense_count)
+   
+   @classmethod
+   def build_from_file(cls, f, synset_map, rv_base=None):
+      if (rv_base is None):
+         rv = {}
+      else:
+         rv = rv_base
+         
+      for line in f:
+         if (line.startswith('  ')):
+            continue
+         wi = cls.build_from_line(line, synset_map)
+         word = wi.lemma.lower()
+         if not (word in rv):
+            rv[word] = []
+         rv[word].append(wi)
+      return rv
+
+   def __repr__(self):
+      return '%s%s' % (self.__class__.__name__, (self.lemma, self.category, self.ptrs, self.synsets, self.tagsense_count))
+   
+   
+class WordIndexDictFormatter(WordIndex):
+   category_map_rev = {
+      CAT_NOUN: 'n',
+      CAT_VERB: 'v',
+      CAT_ADJECTIVE: 'adj',
+      CAT_ADVERB: 'adv'
+   }
+   linesep = '\n'
+   LINE_WIDTH_MAX = 68
+   prefix_fmtf_line_first = '%5s 1: '
+   prefix_fmtn_line_first = '         '
+   prefix_fmtf_line_nonfirst = '%5d: '
+   prefix_fmtn_line_nonfirst = '       '
+   
+   def dict_str(self):
+      tw = TextWrapper(width=self.LINE_WIDTH_MAX,
+         initial_indent=(self.prefix_fmtf_line_first % self.category_map_rev[self.category]),
+         subsequent_indent=self.prefix_fmtn_line_first)
+         
+      lines = (tw.wrap(self.synsets[0].dict_str()))
+      i = 2
+      for synset in self.synsets[1:]:
+         tw = TextWrapper(width=self.LINE_WIDTH_MAX,
+            initial_indent=(self.prefix_fmtf_line_nonfirst % i),
+            subsequent_indent=self.prefix_fmtn_line_nonfirst)
+         lines.extend(tw.wrap(synset.dict_str()))
+         i += 1
+      return self.linesep.join(lines)
+
+
+class Synset:
+   def __init__(self, offset, ss_type, words, ptrs, gloss, frames=()):
+      self.offset = offset
+      self.type = ss_type
+      self.words = words
+      self.ptrs = ptrs
+      self.gloss = gloss
+      self.frames = frames
+      self.comments = []
+   
+   @classmethod
+   def build_from_line(cls, line_data):
+      line_split = line_data.split()
+      synset_offset = int(line_split[0],10)
+      ss_type = category_map[line_split[2]]
+      word_count = int(line_split[3],16)
+      words = [line_split[i] for i in range(4, 4 + word_count*2,2)]
+      ptr_count = int(line_split[4 + word_count*2],10)
+      ptrs = [(line_split[i], line_split[i+1], line_split[i+2], line_split[i+3]) for i in range(5 + word_count*2,4 + word_count*2 + ptr_count*4,4)]
+     
+      tok = line_split[5 + word_count*2 + ptr_count*4]
+      base = 6 + word_count*2 + ptr_count*4
+      if (tok != '|'):
+         frame_count = int(tok, 10)
+         frames = [(int(line_split[i+1],10), int(line_split[i+2],16)) for i in range(base, base + frame_count*3, 3)]
+         base += frame_count*3 + 1
+      else:
+         frames = []
+     
+      line_split2 = line_data.split(None, base)
+      if (len(line_split2) < base):
+         gloss = None
+      else:
+         gloss = line_split2[-1]
+     
+      return cls(synset_offset, ss_type, words, ptrs, gloss, frames)
+   
+   @classmethod
+   def build_from_file(cls, f):
+      rv = {}
+      comments = []
+     
+      for line in f:
+         if (line.startswith('  ')):
+            line_s = line.lstrip().rstrip('\n')
+            line_elements = line_s.split(None,1)
+            try:
+               int(line_elements[0])
+            except ValueError:
+               continue
+            if (len(line_elements) == 1):
+               line_elements.append('')
+            comments.append(line_elements[1])
+            continue
+         synset = cls.build_from_line(line.rstrip())
+         rv[synset.offset] = synset
+
+      return (rv, comments)
+
+   def dict_str(self):
+      rv = self.gloss
+      if (len(self.words) > 1):
+         rv += ' [syn: %s]' % (', '.join([('{%s}' % word) for word in self.words]))
+      return rv
+
+   def __repr__(self):
+      return '%s%s' % (self.__class__.__name__, (self.offset, self.type, self.words, self.ptrs, self.gloss, self.frames))
+
+
+class WordnetDict:
+   db_info_fmt = '''This file was converted from the original database on:
+          %(conversion_datetime)s
+
+The original data is available from:
+     %(wn_url)s
+
+The original data was distributed with the notice shown below. No
+additional restrictions are claimed.  Please redistribute this changed
+version under the same conditions and restriction that apply to the
+original version.\n\n
+%(wn_license)s'''
+
+   datetime_fmt = '%Y-%m-%dT%H:%M:%S'
+   base64_map = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+   
+   def __init__(self, wn_url, desc_short, desc_long):
+      self.word_data = {}
+      self.wn_url = wn_url
+      self.desc_short = desc_short
+      self.desc_long = desc_long
+      self.wn_license = None
+   
+   def wn_dict_add(self, file_index, file_data):
+      file_data.seek(0)
+      file_index.seek(0)
+      (synsets, license_lines) = Synset.build_from_file(file_data)
+      WordIndexDictFormatter.build_from_file(file_index, synsets, self.word_data)
+      if (license_lines):
+         self.wn_license = '\n'.join(license_lines) + '\n'
+   
+   @classmethod
+   def base64_encode(cls, i):
+      """Encode a non-negative integer into a dictd compatible base64 string"""
+      if (i < 0):
+         raise ValueError('Value %r for i is negative' % (i,))
+      r = 63
+      e = 1
+      while (r < i):
+         e += 1
+         r = 64**e - 1
+     
+      rv = ''
+      while (e > 0):
+         e -= 1
+         d = (i / 64**e)
+         rv += cls.base64_map[d]
+         i = i % (64**e)
+      return rv
+     
+   @classmethod
+   def dict_entry_write(cls, file_index, file_data, key, entry, linesep='\n'):
+      """Write a single dict entry for <key> to index and data files"""
+      entry_start = file_data.tell()
+      file_data.write(entry)
+      entry_len = len(entry)
+      file_index.write('%s\t%s\t%s%s' % (key, cls.base64_encode(entry_start),
+            cls.base64_encode(entry_len), linesep))
+     
+   def dict_generate(self, file_index, file_data):
+      file_index.seek(0)
+      file_data.seek(0)
+      # The dictd file format is fairly iffy on the subject of special
+      # headwords: either dictd is buggy, or the manpage doesn't tell the whole
+      # story about the format.
+      # The upshot is that order of these entries in the index *matters*.
+      # Putting them at the beginning and in alphabetic order is afaict ok.
+      # Some other orders completely and quietly break the ability to look
+      # those headwords up.
+      # -- problem encountered with 1.10.2, at 2007-08-05.
+      file_data.write('\n')
+      wn_url = self.wn_url
+      conversion_datetime = datetime.datetime.now().strftime(self.datetime_fmt)
+      wn_license = self.wn_license
+      self.dict_entry_write(file_index, file_data, '00-database-info', '00-database-info\n%s\n' % (self.db_info_fmt % vars()))
+      self.dict_entry_write(file_index, file_data, '00-database-long', '00-database-long\n%s\n' % self.desc_long)
+      self.dict_entry_write(file_index, file_data, '00-database-short', '00-database-short\n%s\n' % self.desc_short)
+      self.dict_entry_write(file_index, file_data, '00-database-url', '00-database-url\n%s\n' % self.wn_url)
+
+     
+      words = self.word_data.keys()
+      words.sort()
+      for word in words:
+         for wi in self.word_data[word]:
+            word_cs = word
+            # Use case-sensitivity information of first entry of first synset that
+            # matches this word case-insensitively
+            for synset in wi.synsets:
+               for ss_word in synset.words:
+                  if (ss_word.lower() == word_cs.lower()):
+                     word_cs = ss_word
+                     break
+               else:
+                  continue
+               break
+            else:
+               continue
+            break
+           
+         outstr = ''
+         for wi in self.word_data[word]:
+            outstr += wi.dict_str() + '\n'
+         
+         outstr = '%s%s%s' % (word_cs, wi.linesep, outstr)
+         self.dict_entry_write(file_index, file_data, word_cs, outstr, wi.linesep)
+     
+      file_index.truncate()
+      file_data.truncate()
+
+
+if (__name__ == '__main__'):
+   import optparse
+   op = optparse.OptionParser(usage='usage: %prog [options] (<wn_index_file> <wn_data_file>)+')
+   op.add_option('-i', '--outindex', dest='oi', default='wn.index', help='filename of index file to write to')
+   op.add_option('-d', '--outdata', dest='od', default='wn.dict', help='filename of data file to write to')
+   op.add_option('--wn_url', dest='wn_url', default='ftp://ftp.cogsci.princeton.edu/pub/wordnet/2.0', help='URL for wordnet sources')
+   op.add_option('--db_desc_short', dest='desc_short', default='     WordNet (r) 2.1 (2005)', help='short dict DB description')
+   op.add_option('--db_desc_long', dest='desc_long', default='    WordNet (r): A Lexical Database for English from the\n     Cognitive Science Laboratory at Princeton University', help='long dict DB description')
+   
+   (options, args) = op.parse_args()
+   
+   wnd = WordnetDict(wn_url=options.wn_url, desc_short=options.desc_short, desc_long=options.desc_long)
+   
+   for i in range(0,len(args),2):
+      print 'Opening index file %r...' % args[i]
+      file_index = file(args[i])
+      print 'Opening data file %r...' % args[i+1]
+      file_data = file(args[i+1])
+      print 'Parsing index file and data file...'
+      wnd.wn_dict_add(file_index, file_data)
+
+   print 'All input files parsed. Writing output to index file %r and data file %r.' % (options.oi, options.od)
+   
+   wnd.dict_generate(file(options.oi, 'w'),file(options.od, 'w'))
+   print 'All done.' 
diff --git a/pkgs/servers/dns/bind/default.nix b/pkgs/servers/dns/bind/default.nix
index cdd8704739b..1df30e25491 100644
--- a/pkgs/servers/dns/bind/default.nix
+++ b/pkgs/servers/dns/bind/default.nix
@@ -1,15 +1,14 @@
 { stdenv, fetchurl, openssl, libtool, perl, libxml2 }:
 
-let
-  version = "9.7.6-P1";
-in
+let version = "9.9.3-P1"; in
+
 stdenv.mkDerivation rec {
 
   name = "bind-${version}";
 
   src = fetchurl {
     url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
-    sha256 = "1xp7c3fpi3b6y1bz77mf7c98ic7rxp5lpwlmzqwsdrllip33qw1k";
+    sha256 = "0ddlvdxsyibm24v1wzbknywvalsrvl06gbvsrigpqc1vgkj25ahv";
   };
 
   patchPhase = ''
@@ -21,11 +20,13 @@ stdenv.mkDerivation rec {
   /* Why --with-libtool? */
   configureFlags = [ "--with-libtool" "--with-openssl=${openssl}"
     "--localstatedir=/var" ];
-      
+
   meta = {
-    homepage = http://www.isc.org/software/bind;
+    homepage = "http://www.isc.org/software/bind";
     description = "ISC BIND: a domain name server";
-    maintainers = with stdenv.lib.maintainers; [viric];
+    license = stdenv.lib.licenses.isc;
+
+    maintainers = with stdenv.lib.maintainers; [viric simons];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/servers/firebird/default.nix b/pkgs/servers/firebird/default.nix
index ebacc84e8c6..12dfc20e736 100644
--- a/pkgs/servers/firebird/default.nix
+++ b/pkgs/servers/firebird/default.nix
@@ -21,9 +21,9 @@
 
 */
 
-stdenv.mkDerivation {
-
-  name = "firebird-2.3.1";
+stdenv.mkDerivation rec {
+  version = "2.5.2";
+  name = "firebird-${version}";
 
   configureFlags =
     [ "--with-serivec-port=${builtins.toString port}"
@@ -34,8 +34,8 @@ stdenv.mkDerivation {
     ++ (stdenv.lib.optional superServer "--enable-superserver=true");
 
   src = fetchurl {
-    url = mirror://sourceforge/firebird/files/2.1.3-Release/Firebird-2.1.3.18185-0.tar.bz2;
-    sha256 = "0a7xy016r0j1f97cf2lww8fkz1vlvvghrgv9ffz2i6f7ppacniw0";
+    url = "mirror://sourceforge/firebird/Firebird-${version}.26539-0.tar.bz2";
+    sha256 = "1j5bcfl35hr6i4lcd08zls19bal2js3ar16gnwkzbhwxkxbyb43b";
   };
 
   buildInputs = [libedit icu];
diff --git a/pkgs/servers/ftp/vsftpd/default.nix b/pkgs/servers/ftp/vsftpd/default.nix
index 0fc1531056b..39b78958b03 100644
--- a/pkgs/servers/ftp/vsftpd/default.nix
+++ b/pkgs/servers/ftp/vsftpd/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, sslEnable ? false, libcap, pam }:
 
 stdenv.mkDerivation (rec {
-  name = "vsftpd-2.3.4";
+  name = "vsftpd-3.0.2";
   
   src = fetchurl {
-    url = "ftp://vsftpd.beasts.org/users/cevans/${name}.tar.gz";
-    sha256 = "0nhsqwnb8qkbxx5wjahara1ln85hp151v656psra5brpckwysrml";
+    url = "https://security.appspot.com/downloads/${name}.tar.gz";
+    sha256 = "0mjy345wszskz1vnk83360c1y37arwgap3gwz8hy13sjqpig0imy";
   };
 
   # The gcc-wrappers use -idirafter for glibc, and vsftpd also, and
@@ -14,9 +14,13 @@ stdenv.mkDerivation (rec {
     sed -i -e 's/-idirafter.*//' Makefile
   '';
   
-  preBuild =''
-    makeFlagsArray=( "LIBS=${if sslEnable then "-lcrypt -lssl -lcrypto " else ""}-lpam -lcap" )
-  '';
+  preBuild = let
+      sslLibs = if sslEnable then "-lcrypt -lssl -lcrypto " else "";
+    in ''
+      makeFlagsArray=( "LIBS=${sslLibs}-lpam -lcap -fstack-protector" )
+    '';
+
+  # It won't link without this flag, used in CFLAGS
 
   buildInputs = [ openssl libcap pam ];
 
diff --git a/pkgs/servers/gpm/1.99.6.nix b/pkgs/servers/gpm/1.99.6.nix
deleted file mode 100644
index 3874e4adfbd..00000000000
--- a/pkgs/servers/gpm/1.99.6.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-args : with args; 
-rec {
-  src = fetchurl {
-    url = http://linux.schottelius.org/gpm/archives/gpm-1.99.6.tar.lzma;
-    sha256 = "14zxx7nx40k8b0bmwhxfyv20xrdi8cg9fxmv8ylsx661lvizqsg3";
-  };
-
-  buildInputs = [lzma flex bison ncurses];
-  configureFlags = [];
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["preConfigure" "doConfigure" "doMakeInstall"];
-
-  preConfigure = fullDepEntry (''
-    sed -e 's/[$](MKDIR)/mkdir -p /' -i doc/Makefile.in
-    sed -e 's/gpm2//' -i Makefile.in
-  '') ["addInputs" "doUnpack" "minInit"];
-      
-  name = "gpm-" + version;
-  meta = {
-    description = "Mouse daemon";
-  };
-}
diff --git a/pkgs/servers/gpm/default.nix b/pkgs/servers/gpm/default.nix
index cb664eac253..7c16153e9b5 100644
--- a/pkgs/servers/gpm/default.nix
+++ b/pkgs/servers/gpm/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1990i19ddzn8gg5xwm53yn7d0mya885f48sd2hyvr7dvzyaw7ch8";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   buildInputs = [ ncurses ];
 
   preConfigure =
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 31c9deaf3af..25051167ca5 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1bjhyjg561kwp6zc2wg58njdvpnsj5yaa2slz8g3ga1176jl68w3";
   };
 
-  buildNativeInputs = [ makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl
+  nativeBuildInputs = [ makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl
     xmlto bc pythonPackages.wrapPython ];
 
   pythonPath = [ pythonPackages.curses ];
diff --git a/pkgs/servers/http/4store/default.nix b/pkgs/servers/http/4store/default.nix
index 08d671d960e..4854f9e18dd 100644
--- a/pkgs/servers/http/4store/default.nix
+++ b/pkgs/servers/http/4store/default.nix
@@ -3,8 +3,8 @@ x@{builderDefsPackage
   glib, libxml2, pcre, avahi,
   readline, ncurses, expat,
   zlib, pkgconfig, which,
-  perl,
-  db_dir ? "/var/lib/4store"
+  perl, libuuid, gmp, mpfr
+  , db_dir ? "/var/lib/4store"
   , ...}:
 builderDefsPackage
 (a :  
@@ -28,9 +28,9 @@ rec {
   doFixConfigure = a.fullDepEntry ''
     sed -e 's@#! */bin/bash@#! ${a.stdenv.shell}@' -i configure
     find . -name Makefile -exec sed -e "s@/usr/local@$out@g" -i '{}' ';'
-    sed -e '/\/var\/lib\/4store/d' -i src/utilities/Makefile
     
     sed -e 's@/var/lib/4store@${db_dir}@g' -i src/common/params.h src/utilities/*
+    sed -e '/FS_STORE_ROOT/d' -i src/utilities/Makefile*
   '' ["minInit" "doUnpack"];
 
   fixInterpreter = (a.doPatchShebangs "$out/bin");
@@ -46,4 +46,3 @@ rec {
       linux;
   };
 }) x
-
diff --git a/pkgs/servers/http/4store/src-for-default.nix b/pkgs/servers/http/4store/src-for-default.nix
index a8624ab40ab..7076b921911 100644
--- a/pkgs/servers/http/4store/src-for-default.nix
+++ b/pkgs/servers/http/4store/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="v1.0.3";
-   name="4store-v1.0.3";
-   hash="1d3n2xgqrq2kgigql3slxw1w2bml3b57xa7h6x9dbngxcz11xg22";
+   version="v1.1.5";
+   name="4store-v1.1.5";
+   hash="0nwckvf8xqwvc2h3v6s1rvmxvcx2xrjy6yapghc052180jw6zp9b";
    url="http://4store.org/download/4store-${version}.tar.gz";
-   advertisedUrl="http://4store.org/download/4store-v1.0.3.tar.gz";
+   advertisedUrl="http://4store.org/download/4store-v1.1.5.tar.gz";
   
   
 }
diff --git a/pkgs/servers/http/apache-httpd/2.2.nix b/pkgs/servers/http/apache-httpd/2.2.nix
index f2a21ee28be..ba0bde63358 100644
--- a/pkgs/servers/http/apache-httpd/2.2.nix
+++ b/pkgs/servers/http/apache-httpd/2.2.nix
@@ -12,12 +12,12 @@ assert ldapSupport -> aprutil.ldapSupport && openldap != null;
 assert mpm == "prefork" || mpm == "worker" || mpm == "event";
 
 stdenv.mkDerivation rec {
-  version = "2.2.22";
+  version = "2.2.24";
   name = "apache-httpd-${version}";
 
   src = fetchurl {
     url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
-    sha1 = "766cd0843050a8dfb781e48b976f3ba6ebcf8696";
+    sha1 = "f73bce14832ec40c1aae68f4f8c367cab2266241";
   };
 
   buildInputs = [perl apr aprutil pcre] ++
diff --git a/pkgs/servers/http/apache-httpd/2.4.nix b/pkgs/servers/http/apache-httpd/2.4.nix
index c9161bf5909..da353212657 100644
--- a/pkgs/servers/http/apache-httpd/2.4.nix
+++ b/pkgs/servers/http/apache-httpd/2.4.nix
@@ -14,17 +14,17 @@ assert sslSupport -> aprutil.sslSupport && openssl != null;
 assert ldapSupport -> aprutil.ldapSupport && openldap != null;
 
 stdenv.mkDerivation rec {
-  version = "2.4.2";
+  version = "2.4.4";
   name = "apache-httpd-${version}";
 
   src = fetchurl {
     url = "mirror://apache/httpd/httpd-${version}.tar.bz2";
-    sha1 = "8d391db515edfb6623c0c7c6ce5c1b2e1f7c64c2";
+    sha256 = "0p35jy6mkb1q48bia719qxs5bwxv0wadyhxi61rsr93nrbgbvalj";
   };
 
   buildInputs = [perl] ++
     optional ldapSupport openldap ++    # there is no --with-ldap flag
-    optional libxml2Support libxml2;    # there is --with-libxml2, but it doesn't work
+    optional libxml2Support libxml2;
 
   # Required for ‘pthread_cancel’.
   NIX_LDFLAGS = "-lgcc_s";
@@ -38,9 +38,13 @@ stdenv.mkDerivation rec {
     --disable-debugger-mode
     --enable-mods-shared=all
     --enable-mpms-shared=all
+    --enable-cern-meta
+    --enable-imagemap
+    --enable-cgi
     ${optionalString proxySupport "--enable-proxy"}
     ${optionalString sslSupport "--enable-ssl --with-ssl=${openssl}"}
     ${optionalString luaSupport "--enable-lua --with-lua=${lua5}"}
+    ${optionalString libxml2Support "--with-libxml2=${libxml2}/include/libxml2"}
   '';
 
   postInstall = ''
diff --git a/pkgs/servers/http/apache-modules/mod_evasive/default.nix b/pkgs/servers/http/apache-modules/mod_evasive/default.nix
index 22e0fabf832..d796d0a6dc5 100644
--- a/pkgs/servers/http/apache-modules/mod_evasive/default.nix
+++ b/pkgs/servers/http/apache-modules/mod_evasive/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, apacheHttpd }:
 
 stdenv.mkDerivation {
-  name = "mod_evasive_1.10.1";
+  name = "mod_evasive-1.10.1";
 
   src = fetchurl {
     url = http://www.zdziarski.com/blog/wp-content/uploads/2010/02/mod_evasive_1.10.1.tar.gz;
diff --git a/pkgs/servers/http/couchdb/src-for-default.nix b/pkgs/servers/http/couchdb/src-for-default.nix
index 0c174feed8d..6e07077d333 100644
--- a/pkgs/servers/http/couchdb/src-for-default.nix
+++ b/pkgs/servers/http/couchdb/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="1.1.1";
-   name="couchdb-1.1.1";
-   hash="9d6592aacd4bc139f8c1ccb0ed80f30021cee50eb7f8a1feddf46b6eb963891c";
-   url="mirror://apache/couchdb/${version}/apache-couchdb-${version}.tar.gz";
-   advertisedUrl="http://www.apache.org/dist/couchdb/${version}/apache-couchdb-${version}.tar.gz";
-
-
+   version="1.2.0";
+   name="couchdb-1.2.0";
+   hash="0dswinmg32zn217049dkbx3pab3qwihzmlbc7i6vq7a7lbg4s98g";
+   url="mirror://apache/couchdb/releases/1.2.0/apache-couchdb-${version}.tar.gz";
+   advertisedUrl="http://www.apache.org/dist/couchdb/releases/1.2.0/apache-couchdb-1.2.0.tar.gz";
+  
+  
 }
diff --git a/pkgs/servers/http/jboss/default.nix b/pkgs/servers/http/jboss/default.nix
index 2f0b9be96b0..d5768da4c82 100644
--- a/pkgs/servers/http/jboss/default.nix
+++ b/pkgs/servers/http/jboss/default.nix
@@ -1,21 +1,19 @@
 { stdenv, fetchurl, unzip, jdk, lib }:
 
 stdenv.mkDerivation {
-  name = "jboss-5.1.0.GA";
+  name = "jboss-as-7.1.1.Final";
   src = fetchurl {
-    url = mirror://sourceforge/jboss/jboss-5.1.0.GA-jdk6.zip;
-    sha256 = "0wy5666h554x1qq4w0rzg3krp4rqrijq0ql7dkx6qgl3vpj9xr5y";
+    url = http://download.jboss.org/jbossas/7.1/jboss-as-7.1.1.Final/jboss-as-7.1.1.Final.tar.gz;
+    sha256 = "1bdjw0ib9qr498vpfbg8klqw6rl11vbz7vwn6gp1r5gpqkd3zzc8";
   };
 
   buildInputs = [ unzip ];
-      
-  buildPhase = ''
-    sed -i -e "/GREP/aJAVA_HOME=${jdk}" bin/run.sh
-  '';
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
   
   installPhase = ''
-    mkdir -p $out
-    cp -av * $out
+    mv $PWD $out
+    find $out/bin -name \*.sh -print0 | xargs -0 sed -i -e '/#!\/bin\/sh/aJAVA_HOME=${jdk}'
   '';
   
   meta = {
diff --git a/pkgs/servers/http/joseki/default.nix b/pkgs/servers/http/joseki/default.nix
index f23a6ce73eb..6ca5caba944 100644
--- a/pkgs/servers/http/joseki/default.nix
+++ b/pkgs/servers/http/joseki/default.nix
@@ -81,8 +81,8 @@ rec {
 
     sed -e 's/\r//g' -i "$TARGET/bin"/*
 
-    echo -e '#! /bin/sh\nls "'"$TARGET"'"/bin' > "$out/bin/jena-list-commands"
-    echo '#! /bin/sh' >> "$out/bin/jena-command"
+    echo -e '#! ${a.stdenv.shell}\nls "'"$TARGET"'"/bin' > "$out/bin/jena-list-commands"
+    echo '#! ${a.stdenv.shell}' >> "$out/bin/jena-command"
     echo 'export JENAROOT="'"$TARGET"'"' >> "$out/bin/jena-command"
     echo 'export JOSEKIROOT="'"$TARGET"'"' >> "$out/bin/jena-command"
     echo 'export TDBROOT="'"$TARGET"'"' >> "$out/bin/jena-command"
diff --git a/pkgs/servers/http/lighttpd/default.nix b/pkgs/servers/http/lighttpd/default.nix
index 11df6e74bd6..f967a7aaa2a 100644
--- a/pkgs/servers/http/lighttpd/default.nix
+++ b/pkgs/servers/http/lighttpd/default.nix
@@ -1,18 +1,26 @@
-{ stdenv, fetchurl, pcre, libxml2, zlib, attr, bzip2 }:
+{ stdenv, fetchurl, pcre, libxml2, zlib, attr, bzip2, which, file, openssl }:
 
 stdenv.mkDerivation {
-  name = "lighttpd-1.4.30";
+  name = "lighttpd-1.4.32";
 
   src = fetchurl {
-    url = http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.30.tar.xz;
-    sha256 = "c237692366935b19ef8a6a600b2f3c9b259a9c3107271594c081a45902bd9c9b";
+    url = http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.32.tar.xz;
+    sha256 = "1hgd9bi4mrak732h57na89lqg58b1kkchnddij9gawffd40ghs0k";
   };
 
-  buildInputs = [ pcre libxml2 zlib attr bzip2 ];
+  buildInputs = [ pcre libxml2 zlib attr bzip2 which file openssl ];
 
-  meta = {
+  configureFlags = "--with-openssl --with-openssl-libs=${openssl}";
+
+  preConfigure = ''
+    sed -i "s:/usr/bin/file:${file}/bin/file:g" configure
+  '';
+
+  meta = with stdenv.lib; {
     description = "Lightweight high-performance web server";
     homepage = http://www.lighttpd.net/;
     license = "BSD";
+    platforms = platforms.linux;
+    maintainers = [maintainers.bjornfor];
   };
 }
diff --git a/pkgs/servers/http/mini-httpd/default.nix b/pkgs/servers/http/mini-httpd/default.nix
index a6ae56b6534..b8848f1e5d8 100644
--- a/pkgs/servers/http/mini-httpd/default.nix
+++ b/pkgs/servers/http/mini-httpd/default.nix
@@ -1,14 +1,16 @@
-{ stdenv, fetchurl, boost }:
+{ stdenv, fetchurl, boostHeaders }:
 
-stdenv.mkDerivation {
-  name = "mini-httpd-1.1";
+stdenv.mkDerivation rec {
+  name = "mini-httpd-1.4";
 
   src = fetchurl {
-    url = "mirror://savannah/mini-httpd/mini-httpd-1.1.tar.gz";
-    sha256 = "12hqvh67hgxmc9b3fhb8gb5ash7j6f7d0mxv47zkmjl7k3vw3ny7";
+    url = "mirror://savannah/mini-httpd/${name}.tar.gz";
+    sha256 = "1i46klkx2ca1cgmlilajkx8gf7b7d7c2sj58llxfllh184pb6cpd";
   };
 
-  buildInputs = [ boost ];
+  buildInputs = [ boostHeaders ];
+
+  enableParallelBuilding = true;
 
   meta = {
     homepage = "http://mini-httpd.nongnu.org/";
diff --git a/pkgs/servers/http/myserver/installable-binary.patch b/pkgs/servers/http/myserver/installable-binary.patch
deleted file mode 100644
index 346e76afd5e..00000000000
--- a/pkgs/servers/http/myserver/installable-binary.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-We actually want the `myserver' binary to be installable.  Failing to do that
-it gets an RPATH pointing to $top_builddir/src/.libs.
-
---- myserver-0.10/src/Makefile.in	2010-10-14 12:45:42.000000000 +0200
-+++ myserver-0.10/src/Makefile.in	2011-03-03 22:23:05.000000000 +0100
-@@ -1307,7 +1307,6 @@ libmyserver_la_LIBADD = \
- 		$(INTLLIBS) $(LDFLAGS)
- 
- myserver_CXXFLAGS = $(AM_CXXFLAGS) $(CXXFLAGS) -DHOST_STR=\"$(build)\" -DPREFIX=\"$(prefix)\"
--myserver_LDFLAGS = -static -no-install
- myserver_LDADD = libmyserver.la $(PTHREAD_LIB) $(IDN_LIB) \
- 	$(XNET_LIB) $(DL_LIB) $(ZLIB_LIB) \
- 	$(XML_LIBS) $(INTLLIBS) $(LDFLAGS)
-
diff --git a/pkgs/servers/http/nginx/default.nix b/pkgs/servers/http/nginx/default.nix
index 4a1c0be649f..52a17ea399c 100644
--- a/pkgs/servers/http/nginx/default.nix
+++ b/pkgs/servers/http/nginx/default.nix
@@ -1,11 +1,22 @@
-{ stdenv, fetchurl, openssl, zlib, pcre, libxml2, libxslt }:
+{ stdenv, fetchurl, fetchgit, openssl, zlib, pcre, libxml2, libxslt, expat, fullWebDAV ? false }:
+
+let
+  dav-ext = fetchgit {
+    url = git://github.com/arut/nginx-dav-ext-module.git;
+    rev = "54cebc1f21fc13391aae692c6cce672fa7986f9d";
+    sha256 = "1dvpq1fg5rslnl05z8jc39sgnvh3akam9qxfl033akpczq1bh8nq";
+  };
+in
+
 stdenv.mkDerivation rec {
-  name = "nginx-1.1.7";
+  name = "nginx-1.2.8";
+
   src = fetchurl {
     url = "http://nginx.org/download/${name}.tar.gz";
-    sha256 = "1y0bzmrgnyqw8ghc508nipy5k46byrxc2sycqp35fdx0jmjz3h51";
+    sha256 = "0dvi8n3ljh3zz80r5zkb5q7f94mg62kkakn0wsqi3lxyqnc7r56j";
   };
-  buildInputs = [ openssl zlib pcre libxml2 libxslt ];
+
+  buildInputs = [ openssl zlib pcre libxml2 libxslt ] ++ stdenv.lib.optional fullWebDAV expat;
 
   configureFlags = [
     "--with-http_ssl_module"
@@ -15,8 +26,8 @@ stdenv.mkDerivation rec {
     "--with-http_gzip_static_module"
     "--with-http_secure_link_module"
     # Install destination problems
-    # "--with-http_perl_module" 
-  ];
+    # "--with-http_perl_module"
+  ] ++ stdenv.lib.optional fullWebDAV "--add-module=${dav-ext}";
 
   preConfigure = ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2"
@@ -27,11 +38,8 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "nginx - 'engine x' - reverse proxy and lightweight webserver";
-    maintainers = [
-      stdenv.lib.maintainers.raskin
-    ];
-    platforms = with stdenv.lib.platforms; 
-      all;
+    description = "A reverse proxy and lightweight webserver";
+    maintainers = [ stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/servers/http/yaws/default.nix b/pkgs/servers/http/yaws/default.nix
new file mode 100644
index 00000000000..7828cf84398
--- /dev/null
+++ b/pkgs/servers/http/yaws/default.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, erlang, pam, perl }:
+
+stdenv.mkDerivation rec {
+  name = "yaws-${version}";
+  version = "1.95";
+
+  src = fetchurl {
+    url = "http://yaws.hyber.org/download/${name}.tar.gz";
+    sha256 = "01jlp6v8l95n9k5rbp4kvklnh95q7yv9lp2a6ahyixb1cn1sxvz4";
+  };
+
+  # The tarball includes a symlink yaws -> yaws-1.95, which seems to be
+  # necessary for importing erlang files
+  unpackPhase = ''
+    tar xzf $src
+    cd $name
+  '';
+
+  configureFlags = "--with-extrainclude=${pam}/include/security";
+
+  buildInputs = [ erlang pam perl ];
+
+  postInstall = ''
+    sed -i "s#which #type -P #" $out/bin/yaws
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A high performance HTTP 1.1 server in Erlang";
+    homepage = http://http://yaws.hyber.org;
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+
+}
diff --git a/pkgs/servers/icecast/default.nix b/pkgs/servers/icecast/default.nix
new file mode 100644
index 00000000000..24ae245a8a0
--- /dev/null
+++ b/pkgs/servers/icecast/default.nix
@@ -0,0 +1,32 @@
+{stdenv, fetchurl
+, libxml2, libxslt, curl
+, libvorbis, libtheora, speex, libkate }:
+
+stdenv.mkDerivation rec {
+  name = "icecast-2.3.3";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/icecast/${name}.tar.gz";
+    sha256 = "0vf38mk13z1czpbj0g8va4rzjf201slqmiwcs8y9i6iwz3shc78v";
+  };
+
+  buildInputs = [ libxml2 libxslt curl libvorbis libtheora speex libkate ];
+
+  meta = {
+    description = "icecast is free server software for streaming multimedia.";
+
+    longDescription = ''
+      Icecast is a streaming media server which currently supports Ogg Vorbis and MP3
+      audio streams. It can be used to create an Internet radio station or a
+      privately running jukebox and many things in between. It is very versatile in
+      that new formats can be added relatively easily and supports open standards for
+      commuincation and interaction.
+    '';
+  
+
+    homepage = http://www.icecast.org;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
+
diff --git a/pkgs/servers/mail/dovecot/1.1.1.nix b/pkgs/servers/mail/dovecot/1.1.1.nix
deleted file mode 100644
index 103f79652fd..00000000000
--- a/pkgs/servers/mail/dovecot/1.1.1.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{stdenv, fetchurl
-  , openssl
-  , pam
-}:
-
-let 
-  version = "1.1.1"; 
-in
-
-stdenv.mkDerivation {
-  name = "dovecot-${version}";
-
-  buildInputs = [openssl pam];
-
-  src = fetchurl {
-    url = "http://dovecot.org/releases/1.1/dovecot-${version}.tar.gz";
-    sha256 = "0plzrzz07k0cylk9323gs9fzlv176y6nd6am660b6dch4p884sck";
-  };
-  
-}
diff --git a/pkgs/servers/mail/dovecot/2.x.nix b/pkgs/servers/mail/dovecot/2.x.nix
deleted file mode 100644
index 1b4fbe7c7cc..00000000000
--- a/pkgs/servers/mail/dovecot/2.x.nix
+++ /dev/null
@@ -1,27 +0,0 @@
-{stdenv, fetchurl, openssl, pam, bzip2, zlib, inotifyTools, openldap}:
-
-stdenv.mkDerivation rec {
-  name = "dovecot-2.1.8";
-
-  buildInputs = [openssl pam bzip2 zlib inotifyTools openldap];
-
-  src = fetchurl {
-    url = "http://dovecot.org/releases/2.1/${name}.tar.gz";
-    sha256 = "03801f4agcwdpqyg6dfxlga3750pnhk4gaf8m7sjq1qmz2277028";
-  };
-
-  # It will hardcode this for /var/lib/dovecot.
-  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
-  configureFlags = [
-    "--localstatedir=/var"
-    "--with-ldap"
-  ];
-
-  meta = {
-    homepage = http://dovecot.org/;
-    description = "Open source IMAP and POP3 email server written with security primarily in mind";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-  
-}
diff --git a/pkgs/servers/mail/dovecot/default.nix b/pkgs/servers/mail/dovecot/default.nix
index 70e84fa51b0..cb29c9ebc89 100644
--- a/pkgs/servers/mail/dovecot/default.nix
+++ b/pkgs/servers/mail/dovecot/default.nix
@@ -1,16 +1,27 @@
-{stdenv, fetchurl
-  , openssl
-  , pam
-}:
+{stdenv, fetchurl, openssl, pam, bzip2, zlib, inotifyTools, openldap}:
 
-stdenv.mkDerivation {
-  name = "dovecot-1.0.3";
+stdenv.mkDerivation rec {
+  name = "dovecot-2.1.8";
 
-  buildInputs = [openssl pam];
+  buildInputs = [openssl pam bzip2 zlib inotifyTools openldap];
 
   src = fetchurl {
-    url = http://dovecot.org/releases/1.0/dovecot-1.0.3.tar.gz;
-    sha256 = "14b3sbvj9xpm5mjwfavwrcwmzfdgian51ncspl8j83cd8j01jdjz";
+    url = "http://dovecot.org/releases/2.1/${name}.tar.gz";
+    sha256 = "03801f4agcwdpqyg6dfxlga3750pnhk4gaf8m7sjq1qmz2277028";
   };
-  
+
+  # It will hardcode this for /var/lib/dovecot.
+  # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=626211
+  configureFlags = [
+    "--localstatedir=/var"
+    "--with-ldap"
+  ];
+
+  meta = {
+    homepage = "http://dovecot.org/";
+    description = "Open source IMAP and POP3 email server written with security primarily in mind";
+    maintainers = with stdenv.lib.maintainers; [viric simons];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+
 }
diff --git a/pkgs/servers/mail/freepops/default.nix b/pkgs/servers/mail/freepops/default.nix
index d5866029762..c80d0f04bda 100644
--- a/pkgs/servers/mail/freepops/default.nix
+++ b/pkgs/servers/mail/freepops/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "freepops-0.2.9";
   src = fetchurl {
-    url = mirror://sf/freepops/0.2.9/freepops-0.2.9.tar.gz;
+    url = mirror://sourceforge/freepops/0.2.9/freepops-0.2.9.tar.gz;
     sha256 = "3a065e30cafed03d9b6fdb28251ae5bf0d8aeb62181746154beecd25dc0c9cae";
   };
   buildInputs = [pkgconfig openssl lua5 curl readline bison expat];
diff --git a/pkgs/servers/mail/petidomo/default.nix b/pkgs/servers/mail/petidomo/default.nix
new file mode 100644
index 00000000000..6c6cde8a46a
--- /dev/null
+++ b/pkgs/servers/mail/petidomo/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, flex, bison, sendmailPath ? "/var/setuid-wrappers/sendmail" }:
+
+stdenv.mkDerivation rec {
+  name = "petidomo-4.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/petidomo/${name}.tar.gz";
+    sha256 = "0x4dbxc4fcfg1rw5ywpcypvylnzn3y4rh0m6fz4h4cdnzb8p1lvm";
+  };
+
+  buildInputs = [ flex bison ];
+
+  configureFlags = "--with-mta=${sendmailPath}";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://petidomo.sourceforge.net/";
+    description = "a simple and easy to administer mailing list server";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/servers/mail/popa3d/default.nix b/pkgs/servers/mail/popa3d/default.nix
new file mode 100644
index 00000000000..25ac0d5f9e3
--- /dev/null
+++ b/pkgs/servers/mail/popa3d/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl,  openssl }:
+
+stdenv.mkDerivation rec {
+
+  name = "popa3d-1.0.2";
+
+  src = fetchurl {
+    url = "http://www.openwall.com/popa3d/${name}.tar.gz";
+    sha256 = "0zvspgnlrx4jhhkb5b1p280nsf9d558jijgpvwfyvdp4q4v460z7";
+  };
+
+  buildInputs = [ openssl ];
+
+  patches = [
+    ./fix-mail-spool-path.patch
+    ./use-openssl.patch
+    ./use-glibc-crypt.patch
+    ./enable-standalone-mode.patch
+  ];
+
+  configurePhase = ''makeFlags="PREFIX=$out MANDIR=$out/share/man"'';
+
+  meta = {
+    homepage = "http://www.openwall.com/popa3d/";
+    description = "tiny POP3 daemon with security as the primary goal";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/servers/mail/popa3d/enable-standalone-mode.patch b/pkgs/servers/mail/popa3d/enable-standalone-mode.patch
new file mode 100644
index 00000000000..763ede102f2
--- /dev/null
+++ b/pkgs/servers/mail/popa3d/enable-standalone-mode.patch
@@ -0,0 +1,12 @@
+diff -ubr popa3d-1.0.2-orig/params.h popa3d-1.0.2/params.h
+--- popa3d-1.0.2-orig/params.h	2012-09-19 01:19:56.698098130 +0200
++++ popa3d-1.0.2/params.h	2012-09-19 01:37:06.749130665 +0200
+@@ -13,7 +13,7 @@
+ /*
+  * Are we going to be a standalone server or start via an inetd clone?
+  */
+-#define POP_STANDALONE			0
++#define POP_STANDALONE			1
+ 
+ #if POP_STANDALONE
+ 
diff --git a/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch b/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch
new file mode 100644
index 00000000000..4f440ae5966
--- /dev/null
+++ b/pkgs/servers/mail/popa3d/fix-mail-spool-path.patch
@@ -0,0 +1,12 @@
+diff -ubr popa3d-1.0.2-orig/params.h popa3d-1.0.2/params.h
+--- popa3d-1.0.2-orig/params.h	2012-09-19 01:19:56.698098130 +0200
++++ popa3d-1.0.2/params.h	2012-09-19 01:21:13.748065132 +0200
+@@ -191,7 +191,7 @@
+  *
+  * #undef this for qmail-style $HOME/Mailbox mailboxes.
+  */
+-#define MAIL_SPOOL_PATH			"/var/mail"
++#define MAIL_SPOOL_PATH			"/var/spool/mail"
+ 
+ #ifndef MAIL_SPOOL_PATH
+ /*
diff --git a/pkgs/servers/mail/popa3d/use-glibc-crypt.patch b/pkgs/servers/mail/popa3d/use-glibc-crypt.patch
new file mode 100644
index 00000000000..35843a38bb3
--- /dev/null
+++ b/pkgs/servers/mail/popa3d/use-glibc-crypt.patch
@@ -0,0 +1,12 @@
+diff -ubr popa3d-1.0.2-orig/Makefile popa3d-1.0.2/Makefile
+--- popa3d-1.0.2-orig/Makefile	2012-09-19 01:19:56.698098130 +0200
++++ popa3d-1.0.2/Makefile	2012-09-19 01:24:33.871750473 +0200
+@@ -9,7 +9,7 @@
+ LDFLAGS = -s
+ LIBS =
+ # Linux with glibc, FreeBSD, NetBSD
+-#LIBS += -lcrypt
++LIBS += -lcrypt
+ # HP-UX trusted system
+ #LIBS += -lsec
+ # Solaris (POP_STANDALONE, POP_VIRTUAL)
diff --git a/pkgs/servers/mail/popa3d/use-openssl.patch b/pkgs/servers/mail/popa3d/use-openssl.patch
new file mode 100644
index 00000000000..54301dd873b
--- /dev/null
+++ b/pkgs/servers/mail/popa3d/use-openssl.patch
@@ -0,0 +1,21 @@
+diff -ubr popa3d-1.0.2-orig/Makefile popa3d-1.0.2/Makefile
+--- popa3d-1.0.2-orig/Makefile	2012-09-19 01:19:56.698098130 +0200
++++ popa3d-1.0.2/Makefile	2012-09-19 01:23:00.309636423 +0200
+@@ -5,7 +5,7 @@
+ INSTALL = install -c
+ CFLAGS = -Wall -O2 -fomit-frame-pointer
+ # You may use OpenSSL's MD5 routines instead of the ones supplied here
+-#CFLAGS += -DHAVE_OPENSSL
++CFLAGS += -DHAVE_OPENSSL
+ LDFLAGS = -s
+ LIBS =
+ # Linux with glibc, FreeBSD, NetBSD
+@@ -21,7 +21,7 @@
+ # libwrap may also want this
+ #LIBS += -lnsl
+ # OpenSSL (-DHAVE_OPENSSL)
+-#LIBS += -lcrypto
++LIBS += -lcrypto
+ 
+ DESTDIR =
+ PREFIX = /usr/local
diff --git a/pkgs/servers/mail/postfix/default.nix b/pkgs/servers/mail/postfix/default.nix
index 16d9127e556..a435eea8663 100644
--- a/pkgs/servers/mail/postfix/default.nix
+++ b/pkgs/servers/mail/postfix/default.nix
@@ -4,31 +4,22 @@
 
 assert stdenv.isLinux;
 
-stdenv.mkDerivation {
-  name = "postfix-2.8.6";
-  
+stdenv.mkDerivation rec {
+  name = "postfix-2.8.12";
+
   src = fetchurl {
-    url = ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/postfix-2.8.6.tar.gz;
-    sha256 = "1rfsfhna5hy5lc6hkg1zc2862pdc5c1y9z6aiy8rinlmzrfplhlb";
+    url = "ftp://ftp.cs.uu.nl/mirror/postfix/postfix-release/official/${name}.tar.gz";
+    sha256 = "11z07mjy53l1fnl7k4101yk4ilibgqr1164628mqcbmmr8bh2szl";
   };
 
-  installTargets = ["non-interactive-package"];
-  
-  installFlags = [" install_root=$out "];
-  
-  preInstall = ''
-    sed -e '/^PATH=/d' -i postfix-install
-  '';
-  
-  postInstall = ''
-    mkdir -p $out
-    mv ut/$out/* $out/
+  buildInputs = [db4 openssl cyrus_sasl bison perl];
 
-    mkdir $out/share/postfix/conf
-    cp conf/* $out/share/postfix/conf
-    sed -e 's@PATH=.*@PATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin@' -i $out/share/postfix/conf/post-install $out/libexec/postfix/post-install
-    sed -e '2aPATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin' -i $out/share/postfix/conf/postfix-script $out/libexec/postfix/postfix-script
-    chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
+  patches = [ ./postfix-2.2.9-db.patch  ./postfix-2.2.9-lib.patch ./db-linux3.patch ];
+
+  postPatch = ''
+    sed -i -e s,/usr/bin,/var/run/current-system/sw/bin, \
+      -e s,/usr/sbin,/var/run/current-system/sw/sbin, \
+      -e s,:/sbin,, src/util/sys_defs.h
   '';
 
   preBuild = ''
@@ -46,15 +37,29 @@ stdenv.mkDerivation {
     make makefiles CCARGS='-DUSE_TLS -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I${cyrus_sasl}/include/sasl' AUXLIBS='-lssl -lcrypto -lsasl2 -ldb -lnsl'
   '';
 
-  buildInputs = [db4 openssl cyrus_sasl bison perl];
-  
-  patches = [ ./postfix-2.2.9-db.patch  ./postfix-2.2.9-lib.patch ./db-linux3.patch ];
+  installPhase = ''
+    sed -e '/^PATH=/d' -i postfix-install
+    $SHELL postfix-install install_root=out -non-interactive -package
 
-  postPatch = ''
-    sed -i -e s,/usr/bin,/var/run/current-system/sw/bin, \
-      -e s,/usr/sbin,/var/run/current-system/sw/sbin, \
-      -e s,:/sbin,, src/util/sys_defs.h
+    mkdir -p $out
+    mv -v "out$out/"* $out/
+
+    mkdir -p $out/share/postfix
+    mv conf $out/share/postfix/
+    mv LICENSE TLS_LICENSE $out/share/postfix/
+
+    sed -e 's@^PATH=.*@PATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin@' -i $out/share/postfix/conf/post-install $out/libexec/postfix/post-install
+    sed -e '2aPATH=${coreutils}/bin:${findutils}/bin:${gnused}/bin:${gnugrep}/bin:'$out'/sbin' -i $out/share/postfix/conf/postfix-script $out/libexec/postfix/postfix-script
+    chmod a+x $out/share/postfix/conf/{postfix-script,post-install}
   '';
-  
+
   inherit glibc;
+
+  meta = {
+    homepage = "http://www.postfix.org/";
+    description = "a fast, easy to administer, and secure mail server";
+    license = stdenv.lib.licenses.bsdOriginal;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
 }
diff --git a/pkgs/servers/mail/spamassassin/default.nix b/pkgs/servers/mail/spamassassin/default.nix
index 0f5cefb84c2..dc316267e6c 100644
--- a/pkgs/servers/mail/spamassassin/default.nix
+++ b/pkgs/servers/mail/spamassassin/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, buildPerlPackage, perl, HTMLParser, NetDNS, NetAddrIP, DBFile
-, HTTPDate, MailDKIM, makeWrapper
+, HTTPDate, MailDKIM, LWP, IOSocketSSL, makeWrapper, gnupg1
 }:
 
-# TODO:
+# TODO: Add the Perl modules ...
+#
+#   DBI
+#   Encode::Detect
+#   IP::Country::Fast
+#   Mail::SPF
+#   Net::Ident
+#   Razor2::Client::Agent
 #
-#  - Mail::SPF
-#  - IP::Country
-#  - Razor2
-#  - Net::Ident
-#  - DBI
-#  - LWP::UserAgent
-#  - Encode::Detect
 
 buildPerlPackage rec {
   name = "SpamAssassin-3.3.2";
@@ -20,18 +20,22 @@ buildPerlPackage rec {
     sha256 = "01d2jcpy423zfnhg123wlhzysih1hmb93nxfspiaajzh9r5rn8y7";
   };
 
-  buildInputs = [ makeWrapper HTMLParser NetDNS NetAddrIP DBFile HTTPDate
-    MailDKIM ];
+  buildInputs = [ makeWrapper HTMLParser NetDNS NetAddrIP DBFile HTTPDate MailDKIM
+    LWP IOSocketSSL ];
 
   # Enabling 'taint' mode is desirable, but that flag disables support
   # for the PERL5LIB environment variable. Needs further investigation.
   makeFlags = "PERL_BIN=${perl}/bin/perl PERL_TAINT=no";
 
+  makeMakerFlags = "CONFDIR=/etc/spamassassin LOCALSTATEDIR=/var/lib/spamassassin";
+
   doCheck = false;
 
   postInstall = ''
+    mv "rules/"* $out/share/spamassassin/
+
     for n in "$out/bin/"*; do
-      wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB"
+      wrapProgram "$n" --prefix PERL5LIB : "$PERL5LIB" --prefix PATH : "${gnupg1}/bin"
     done
   '';
 
diff --git a/pkgs/servers/mediatomb/default.nix b/pkgs/servers/mediatomb/default.nix
index d040a4c9a57..e531f6160ff 100644
--- a/pkgs/servers/mediatomb/default.nix
+++ b/pkgs/servers/mediatomb/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "1k8i5zvgik7cad7znd8358grzwh62frpqww1a5rwkldrlws3q5ii";
   };
 
+  patches = [ ./zmm_new.patch ];
+
   buildInputs = [ sqlite expat spidermonkey taglib libexif curl ffmpeg file ];
 
   configureFlags = [ "--enable-inotify" ];
@@ -21,4 +23,4 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.linux;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/servers/mediatomb/zmm_new.patch b/pkgs/servers/mediatomb/zmm_new.patch
new file mode 100644
index 00000000000..5238b42035b
--- /dev/null
+++ b/pkgs/servers/mediatomb/zmm_new.patch
@@ -0,0 +1,13 @@
+diff -rc mediatomb-0.12.1.old/src/zmm/object.h mediatomb-0.12.1/src/zmm/object.h
+*** mediatomb-0.12.1.old/src/zmm/object.h	2010-03-25 07:58:08.000000000 -0700
+--- mediatomb-0.12.1/src/zmm/object.h	2013-02-15 17:57:02.000000000 -0800
+***************
+*** 33,38 ****
+--- 33,39 ----
+  #define __ZMM_OBJECT_H__
+  
+  #include <new> // for size_t
++ #include <stddef.h>
+  #include "atomic.h"
+  
+  namespace zmm
diff --git a/pkgs/servers/memcached/default.nix b/pkgs/servers/memcached/default.nix
index 36ce54b53ef..17c674b4d06 100644
--- a/pkgs/servers/memcached/default.nix
+++ b/pkgs/servers/memcached/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, cyrus_sasl, libevent}:
 
 stdenv.mkDerivation {
-  name = "memcached-1.4.13";
+  name = "memcached-1.4.15";
 
   src = fetchurl {
-    url = http://memcached.googlecode.com/files/memcached-1.4.13.tar.gz;
-    sha256 = "0abyy9agjinac56bb1881j3qs6xny7r12slh4wihv2apma3qn2yb";
+    url = http://memcached.googlecode.com/files/memcached-1.4.15.tar.gz;
+    sha256 = "1d7205cp49s379fdy2qz1gz2a5v4nnv18swzmvbascbmgamj35qn";
   };
 
   buildInputs = [cyrus_sasl libevent];
diff --git a/pkgs/servers/monitoring/munin/default.nix b/pkgs/servers/monitoring/munin/default.nix
new file mode 100644
index 00000000000..8329a9a05c9
--- /dev/null
+++ b/pkgs/servers/monitoring/munin/default.nix
@@ -0,0 +1,98 @@
+{ stdenv, fetchurl, makeWrapper, which, coreutils, rrdtool, perl, perlPackages
+, python, ruby, openjdk }:
+
+# TODO: split into server/node derivations
+
+# FIXME: munin tries to write log files and web graphs to its installation path.
+
+stdenv.mkDerivation rec {
+  version = "2.0.14";
+  name = "munin-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/munin-monitoring/munin/archive/${version}.tar.gz";
+    sha256 = "1d71gvmkrck42z1h1dfk9napbhn7apfmlnp7r62fyylv0m7s2ylx";
+  };
+
+  buildInputs = [ 
+    makeWrapper
+    which
+    coreutils
+    rrdtool
+    perl
+    perlPackages.ModuleBuild
+    perlPackages.HTMLTemplate
+    perlPackages.NetSSLeay
+    perlPackages.NetServer
+    perlPackages.Log4Perl
+    perlPackages.IOSocketInet6
+    perlPackages.Socket6
+    perlPackages.URI
+    perlPackages.DBFile
+    perlPackages.DateManip
+    perlPackages.FileCopyRecursive
+    perlPackages.FCGI
+    perlPackages.NetSNMP
+    perlPackages.NetServer
+    perlPackages.ListMoreUtils
+    perlPackages.TimeHiRes
+    python
+    ruby
+    openjdk
+  ];
+
+  preBuild = ''
+    sed -i '/CHECKUSER/d' Makefile
+    sed -i '/CHOWN/d' Makefile
+    sed -i '/CHECKGROUP/d' Makefile
+    substituteInPlace "Makefile" \
+      --replace "/usr/pwd" "pwd"
+  '';
+
+  # DESTDIR shouldn't be needed (and shouldn't have worked), but munin
+  # developers have forgotten to use PREFIX everywhere, so we use DESTDIR to
+  # ensure that everything is installed in $out.
+  makeFlags = ''
+    PREFIX=$(out)
+    DESTDIR=$(out)
+    PERLLIB=$(out)/lib/perl5/site_perl
+    PERL=${perl}/bin/perl
+    PYTHON=${python}/bin/python
+    RUBY=${ruby}/bin/ruby
+    JAVARUN=${openjdk}/bin/java
+    HOSTNAME=default
+  '';
+
+  postFixup = ''
+    if test -e $out/nix-support/propagated-native-build-inputs; then
+        ln -s $out/nix-support/propagated-native-build-inputs $out/nix-support/propagated-user-env-packages
+    fi
+
+    # TODO: toPerlLibPath can be added to
+    # pkgs/development/interpreters/perl5.16/setup-hook.sh (and the other perl
+    # versions) just like for python. NOTE: it causes massive rebuilds.
+    # $(toPerlLibPath $out perlPackages.Log4Perl ...)
+
+    for file in "$out"/bin/munindoc "$out"/sbin/munin-* "$out"/lib/munin-* "$out"/www/cgi/*; do
+        # don't wrap .jar files
+        case "$file" in
+            *.jar) continue;;
+        esac
+        wrapProgram "$file" --set PERL5LIB $out/lib/perl5/site_perl:${perlPackages.Log4Perl}/lib/perl5/site_perl:${perlPackages.IOSocketInet6}/lib/perl5/site_perl:${perlPackages.Socket6}/lib/perl5/site_perl:${perlPackages.URI}/lib/perl5/site_perl:${perlPackages.DBFile}/lib/perl5/site_perl:${perlPackages.DateManip}/lib/perl5/site_perl:${perlPackages.HTMLTemplate}/lib/perl5/site_perl:${perlPackages.FileCopyRecursive}/lib/perl5/site_perl:${perlPackages.FCGI}/lib/perl5/site_perl:${perlPackages.NetSNMP}/lib/perl5/site_perl:${perlPackages.NetServer}/lib/perl5/site_perl:${perlPackages.ListMoreUtils}/lib/perl5/site_perl:${perlPackages.TimeHiRes}/lib/perl5/site_perl:${rrdtool}/lib/perl
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Networked resource monitoring tool";
+    longDescription = ''
+      Munin is a monitoring tool that surveys all your computers and remembers
+      what it saw. It presents all the information in graphs through a web
+      interface. Munin can help analyze resource trends and 'what just happened
+      to kill our performance?' problems.
+    '';
+    homepage = http://munin-monitoring.org/;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.iElectric maintainers.bjornfor ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/servers/monitoring/net-snmp/default.nix b/pkgs/servers/monitoring/net-snmp/default.nix
index 190c48ba56e..a9d1578495a 100644
--- a/pkgs/servers/monitoring/net-snmp/default.nix
+++ b/pkgs/servers/monitoring/net-snmp/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, file, openssl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "net-snmp-5.7.1";
+  name = "net-snmp-5.7.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/net-snmp/${name}.tar.gz";
-    sha256 = "07qqdgs3flraqccwry4a4x23jcg6vfi0rqj7clsibdv51ijwjwbw";
+    sha256 = "05mqrv22c65405d6v91cqf4hvczkkvvyy5lsxw8h8g0zrjs33v89";
   };
 
   preConfigure =
@@ -13,6 +13,9 @@ stdenv.mkDerivation rec {
       perlversion=$(perl -e 'use Config; print $Config{version};')
       perlarchname=$(perl -e 'use Config; print $Config{archname};')
       installFlags="INSTALLSITEARCH=$out/lib/perl5/site_perl/$perlversion/$perlarchname INSTALLSITEMAN3DIR=$out/share/man/man3"
+
+      # http://comments.gmane.org/gmane.network.net-snmp.user/32434
+      substituteInPlace "man/Makefile.in" --replace 'grep -vE' '@EGREP@ -v'
     '';
 
   configureFlags =
diff --git a/pkgs/servers/monitoring/zabbix/2.0.nix b/pkgs/servers/monitoring/zabbix/2.0.nix
new file mode 100644
index 00000000000..6b0a22962a3
--- /dev/null
+++ b/pkgs/servers/monitoring/zabbix/2.0.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, pkgconfig, postgresql, curl, openssl, zlib, gettext }:
+
+let
+
+  version = "2.0.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/zabbix/zabbix-${version}.tar.gz";
+    sha256 = "0l8038j6ldsv0ywrs2j69ybjl2zv4qw42791glqvcabjj8x24m3m";
+  };
+
+  preConfigure =
+    ''
+      substituteInPlace ./configure \
+        --replace " -static" "" \
+        ${stdenv.lib.optionalString (stdenv.gcc.libc != null) ''
+          --replace /usr/include/iconv.h ${stdenv.gcc.libc}/include/iconv.h
+        ''}
+    '';
+
+in
+
+{
+
+  server = stdenv.mkDerivation {
+    name = "zabbix-${version}";
+
+    inherit src preConfigure;
+
+    configureFlags = "--enable-agent --enable-server --with-postgresql --with-libcurl --with-gettext";
+
+    buildInputs = [ pkgconfig postgresql curl openssl zlib ];
+
+    postInstall =
+      ''
+        mkdir -p $out/share/zabbix
+        cp -prvd frontends/php $out/share/zabbix/php
+        mkdir -p $out/share/zabbix/db/data
+        cp -prvd database/postgresql/data.sql $out/share/zabbix/db/data/data.sql
+        cp -prvd database/postgresql/images.sql $out/share/zabbix/db/data/images_pgsql.sql
+        mkdir -p $out/share/zabbix/db/schema
+        cp -prvd database/postgresql/schema.sql $out/share/zabbix/db/schema/postgresql.sql
+      '';
+
+    meta = {
+      description = "An enterprise-class open source distributed monitoring solution";
+      homepage = http://www.zabbix.com/;
+      license = "GPL";
+      maintainers = [ stdenv.lib.maintainers.eelco ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+  agent = stdenv.mkDerivation {
+    name = "zabbix-agent-${version}";
+
+    inherit src preConfigure;
+
+    configureFlags = "--enable-agent";
+
+    meta = {
+      description = "An enterprise-class open source distributed monitoring solution (client-side agent)";
+      homepage = http://www.zabbix.com/;
+      license = "GPL";
+      maintainers = [ stdenv.lib.maintainers.eelco ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+}
diff --git a/pkgs/servers/monitoring/zabbix/default.nix b/pkgs/servers/monitoring/zabbix/default.nix
index 864f11bee3e..0189f3dd8fd 100644
--- a/pkgs/servers/monitoring/zabbix/default.nix
+++ b/pkgs/servers/monitoring/zabbix/default.nix
@@ -2,11 +2,11 @@
 
 let
 
-  version = "1.8.10";
-  
+  version = "1.8.15";
+
   src = fetchurl {
     url = "mirror://sourceforge/zabbix/zabbix-${version}.tar.gz";
-    sha256 = "0jx5i1ps1zr908g8gh1zisajiblg40x8cchmgbpdviz85hzx4rfr";
+    sha256 = "0358syx6vck6l8j9wwlsb78faivh4qxrgy3jlkmjqr99xi6h3r3f";
   };
 
   preConfigure =
@@ -49,7 +49,7 @@ in
       platforms = stdenv.lib.platforms.linux;
     };
   };
-  
+
   agent = stdenv.mkDerivation {
     name = "zabbix-agent-${version}";
 
@@ -65,5 +65,5 @@ in
       platforms = stdenv.lib.platforms.all;
     };
   };
-  
+
 }
diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix
index 0c3257d61c3..54c9d160565 100644
--- a/pkgs/servers/mpd/default.nix
+++ b/pkgs/servers/mpd/default.nix
@@ -1,34 +1,90 @@
-{ stdenv, fetchurl, pkgconfig, glib, alsaSupport ? true, alsaLib
-, flacSupport ? true, flac, vorbisSupport ? true, libvorbis
-, madSupport ? true, libmad, id3tagSupport ? true, libid3tag
-, mikmodSupport ? true, libmikmod, cueSupport ? true, libcue
+{ stdenv, fetchurl, pkgconfig, glib, systemd
+, alsaSupport ? true, alsaLib
+, flacSupport ? true, flac
+, vorbisSupport ? true, libvorbis
+, madSupport ? true, libmad
+, id3tagSupport ? true, libid3tag
+, mikmodSupport ? true, libmikmod
+, shoutSupport ? true, libshout
+, sqliteSupport ? true, sqlite
+, curlSupport ? true, curl
+, soupSupport ? true, libsoup
+, audiofileSupport ? true, audiofile
+, bzip2Support ? true, bzip2
+, ffadoSupport ? true, ffado
+, ffmpegSupport ? true, ffmpeg
+, fluidsynthSupport ? true, fluidsynth
+, zipSupport ? true, zziplib
+, samplerateSupport ? true, libsamplerate
+, mmsSupport ? true, libmms
+, mpg123Support ? true, mpg123
+, aacSupport ? true, faad2
 }:
+
 let
+
   opt = stdenv.lib.optional;
-in
-stdenv.mkDerivation rec {
-  name = "mpd-0.16.3";
+
+  mkFlag = c: f: if c then "--enable-${f}" else "--disable-${f}";
+
+in stdenv.mkDerivation rec {
+  name = "mpd-0.17.3";
   src = fetchurl {
     url = "mirror://sourceforge/musicpd/${name}.tar.bz2";
-    sha256 = "1liihxj58f944gapdqg15firl6phbxh3y3vjxq9m8dlvm37pkpsq";
+    sha256 = "1iilimlyhw22lpbqiab4qprznxg9c4d68fkrr9jww765b4c7x1ip";
   };
-  buildInputs = [ pkgconfig glib ]
+
+  buildInputs = [ pkgconfig glib systemd ]
     ++ opt alsaSupport alsaLib
     ++ opt flacSupport flac
     ++ opt vorbisSupport libvorbis
     ++ opt madSupport libmad
     ++ opt id3tagSupport libid3tag
     ++ opt mikmodSupport libmikmod
-    ++ opt cueSupport libcue;
-  configureFlags = ''
-    ${if alsaSupport then "--enable-alsa" else "--disable-alsa"}
-    ${if flacSupport then "--enable-flac" else "--disable-flac"}
-    ${if vorbisSupport then "--enable-vorbis" else "--disable-vorbis"}
-    ${if madSupport then "--enable-mad" else "--disable-mad"}
-    ${if mikmodSupport then "--enable-mikmod" else "--disable-mikmod"}
-    ${if id3tagSupport then "--enable-id3" else "--disable-id3"}
-    ${if cueSupport then "--enable-cue" else "--disable-cue"}
+    ++ opt shoutSupport libshout
+    ++ opt sqliteSupport sqlite
+    ++ opt curlSupport curl
+    ++ opt soupSupport libsoup
+    ++ opt bzip2Support bzip2
+    ++ opt audiofileSupport audiofile
+    ++ opt ffadoSupport ffado
+    ++ opt ffmpegSupport ffmpeg
+    ++ opt fluidsynthSupport fluidsynth
+    ++ opt samplerateSupport libsamplerate
+    ++ opt mmsSupport libmms
+    ++ opt mpg123Support mpg123
+    ++ opt aacSupport faad2
+    ++ opt zipSupport zziplib;
+
+  configureFlags = [
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    (mkFlag alsaSupport "alsa")
+    (mkFlag flacSupport "flac")
+    (mkFlag vorbisSupport "vorbis")
+    (mkFlag vorbisSupport "vorbis-encoder")
+    (mkFlag madSupport "mad")
+    (mkFlag mikmodSupport "mikmod")
+    (mkFlag id3tagSupport "id3")
+    (mkFlag shoutSupport "shout")
+    (mkFlag sqliteSupport "sqlite")
+    (mkFlag curlSupport "curl")
+    (mkFlag soupSupport "soup")
+    (mkFlag audiofileSupport "audiofile")
+    (mkFlag bzip2Support "bzip2")
+    (mkFlag ffadoSupport "ffado")
+    (mkFlag ffmpegSupport "ffmpeg")
+    (mkFlag fluidsynthSupport "fluidsynth")
+    (mkFlag zipSupport "zzip")
+    (mkFlag samplerateSupport "lsr")
+    (mkFlag mmsSupport "mms")
+    (mkFlag mpg123Support "mpg123")
+    (mkFlag aacSupport "aac")
+  ];
+
+  NIX_LDFLAGS = ''
+    ${if shoutSupport then "-lshout" else ""}
   '';
+
   meta = {
     description = "A flexible, powerful daemon for playing music";
     longDescription = ''
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
index 685aeb05ce7..612db162e5c 100644
--- a/pkgs/servers/nosql/mongodb/default.nix
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -1,39 +1,39 @@
-{ stdenv, fetchurl, scons, which, boost, gnutar, v8 ? null, useV8 ? false}:
-
-assert useV8 -> v8 != null;
+{ stdenv, fetchurl, scons, boost, v8, gperftools, pcre, snappy }:
 
 with stdenv.lib;
 
+let installerPatch = fetchurl {
+      url = "https://jira.mongodb.org/secure/attachment/18160/SConscript.client.patch";
+      sha256 = "0n60fh2r8i7m6g113k0iw4adc8jv2by4ahrd780kxg47kzfgw06a";
+    };
+
+in
 stdenv.mkDerivation rec {
-  name = "mongodb-2.0.6";
+  name = "mongodb-2.4.3";
 
   src = fetchurl {
-    url = "http://downloads.mongodb.org/src/mongodb-src-r2.0.6.tar.gz";
-    sha256 = "0kiiz8crx318sdn0wd9d88pzx9s1c6ak2dhd0zw7kl63gmd74wm9";
+    url = http://downloads.mongodb.org/src/mongodb-src-r2.4.3.tar.gz;
+    sha256 = "1k653xmwphdk88z2byz5fglr8xcsm8nw13prls1rx16qnc6h1pb1";
   };
 
-  buildInputs = [scons which boost] ++ stdenv.lib.optional useV8 v8;
+  nativeBuildInputs = [ scons boost v8 gperftools pcre snappy ];
 
-  enableParallelBuilding = true;
+  patches = [ installerPatch ];
 
-  patchPhase = ''
-    substituteInPlace SConstruct --replace "Environment( MSVS_ARCH=msarch , tools = [\"default\", \"gch\"], toolpath = '.' )" "Environment( MSVS_ARCH=msarch , tools = [\"default\", \"gch\"], toolpath = '.', ENV = os.environ )"
-    substituteInPlace SConstruct --replace "../v8" "${v8}"
-    substituteInPlace SConstruct --replace "LIBPATH=[\"${v8}/\"]" "LIBPATH=[\"${v8}/lib\"]"
+  postPatch = ''
+    substituteInPlace SConstruct \
+        --replace "Environment( BUILD_DIR" "Environment( ENV = os.environ, BUILD_DIR" \
+        --replace 'CCFLAGS=["-Werror", "-pipe"]' 'CCFLAGS=["-pipe"]'
   '';
 
   buildPhase = ''
-    export TERM=""
-    scons all --cc=`which gcc` --cxx=`which g++` --libpath=${boost}/lib --cpppath=${boost}/include \
-              ${optionalString useV8 "--usev8"}
+    export SCONSFLAGS="-j$NIX_BUILD_CORES"
+    scons all --use-system-all
   '';
 
   installPhase = ''
-    scons install --cc=`which gcc` --cxx=`which g++` --libpath=${boost}/lib --cpppath=${boost}/include \
-                  ${optionalString useV8 "--usev8"} --full --prefix=$out
-    if [ -d $out/lib64 ]; then
-      mv $out/lib64 $out/lib
-    fi
+    mkdir -p $out/lib
+    scons install --use-system-all --full --prefix=$out
   '';
 
   meta = {
@@ -42,7 +42,6 @@ stdenv.mkDerivation rec {
     license = "AGPLv3";
 
     maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
-
diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix
index e2e111a81fb..777fb31ac97 100644
--- a/pkgs/servers/nosql/redis/default.nix
+++ b/pkgs/servers/nosql/redis/default.nix
@@ -1,22 +1,21 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  pname = "redis";
-  version = "2.4.7";
-  name = "${pname}-${version}";
+  name = "redis-2.6.13";
 
   src = fetchurl {
-    url = "http://redis.googlecode.com/files/redis-2.4.7.tar.gz";
-    sha256 = "f91956377b7ff23cc23e0c8758e0b873032f36545c61d88436ebb741bf4dd5e1";
+    url = "http://redis.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0j79a5vmdy0c1df89ymqk37kz8q2iqlzg81qwnz0djjqdiikk51v";
   };
 
   makeFlags = "PREFIX=$(out)";
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://redis.io;
     description = "An open source, advanced key-value store";
     license = "BSD";
-
     platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/servers/openafs-client/default.nix b/pkgs/servers/openafs-client/default.nix
index efbcd151de5..247628c30a6 100644
--- a/pkgs/servers/openafs-client/default.nix
+++ b/pkgs/servers/openafs-client/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, which, autoconf, automake, flex, yacc,
-  kernel, glibc, ncurses, perl, krb5 }:
+  kernelDev, glibc, ncurses, perl, krb5 }:
 
 assert stdenv.isLinux;
 
 stdenv.mkDerivation {
-  name = "openafs-1.6.1-${kernel.version}";
+  name = "openafs-1.6.1-${kernelDev.version}";
 
   src = fetchurl {
     url = http://www.openafs.org/dl/openafs/1.6.1/openafs-1.6.1-src.tar.bz2;
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   buildInputs = [ autoconf automake flex yacc ncurses perl which ];
 
   preConfigure = ''
-    ln -s ${kernel}/lib/modules/*/build $TMP/linux
+    ln -s ${kernelDev}/lib/modules/*/build $TMP/linux
 
     patchShebangs .
     for i in `grep -l -R '/usr/\(include\|src\)' .`; do
diff --git a/pkgs/servers/portmap/default.nix b/pkgs/servers/portmap/default.nix
index d7a05261ff2..f2152b65df3 100644
--- a/pkgs/servers/portmap/default.nix
+++ b/pkgs/servers/portmap/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, lib, tcpWrapper
+{ fetchurl, stdenv, lib, tcp_wrappers
 , daemonUser ? false, daemonUID ? false, daemonGID ? false }:
 
 assert daemonUser -> (!daemonUID && !daemonGID);
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional (daemonUID != false) "DAEMON_UID=${toString daemonUID}"
     ++ lib.optional (daemonGID != false) "DAEMON_GID=${toString daemonGID}";
 
-  buildInputs = [ tcpWrapper ];
+  buildInputs = [ tcp_wrappers ];
 
   installPhase = ''
     mkdir -p "$out/sbin" "$out/man/man8"
diff --git a/pkgs/servers/prayer/default.nix b/pkgs/servers/prayer/default.nix
index c67d2c8a010..8a23e480e1f 100644
--- a/pkgs/servers/prayer/default.nix
+++ b/pkgs/servers/prayer/default.nix
@@ -5,15 +5,15 @@ let
     "-e 's/CCLIENT_SSL_ENABLE.*= false/CCLIENT_SSL_ENABLE=true/'";
 in
 stdenv.mkDerivation rec {
-  name = "prayer-1.3.4";
+  name = "prayer-1.3.5";
   
   src = fetchurl {
     url = "ftp://ftp.csx.cam.ac.uk/pub/software/email/prayer/${name}.tar.gz";
-    sha256 = "0a2nmrlwdq4n5019j3mw2xbbc61s7sssjih5ql6r5rvyrrr48szc";
+    sha256 = "135fjbxjn385b6cjys6qhbwfw61mdcl2akkll4jfpdzfvhbxlyda";
   };
 
   buildInputs = [ openssl db4 zlib uwimap htmlTidy pam ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   NIX_LDFLAGS = "-lpam";
 
diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix
index 21112250597..e315f788904 100644
--- a/pkgs/servers/pulseaudio/default.nix
+++ b/pkgs/servers/pulseaudio/default.nix
@@ -4,16 +4,17 @@
 , jackaudioSupport ? false, jackaudio ? null
 , x11Support ? false, xlibs
 , json_c
+, useSystemd ? false, systemd ? null
 }:
 
 assert jackaudioSupport -> jackaudio != null;
 
 stdenv.mkDerivation rec {
-  name = "pulseaudio-1.1";
+  name = "pulseaudio-2.1";
 
   src = fetchurl {
-    url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-1.1.tar.xz";
-    sha256 = "1vpm0681zj2jvhbabvnmrmfxr3172k4x58kjb39y5g3fdw9k3rbg";
+    url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-2.1.tar.xz";
+    sha256 = "0zyal2mix7lzhxmr3pxlmss5kjca061iapvrh20bkgvsyixk8szg";
   };
 
   # Since `libpulse*.la' contain `-lgdbm', it must be propagated.
@@ -26,13 +27,10 @@ stdenv.mkDerivation rec {
       #gtk gconf 
     ]
     ++ stdenv.lib.optional jackaudioSupport jackaudio
-    ++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ];
+    ++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ]
+    ++ stdenv.lib.optional useSystemd systemd;
 
   preConfigure = ''
-    # Change the `padsp' script so that it contains the full path to
-    # `libpulsedsp.so'.
-    sed -i "src/utils/padsp" \
-        -e "s|libpulsedsp\.so|$out/lib/libpulsedsp.so|g"
 
     # Move the udev rules under $(prefix).
     sed -i "src/Makefile.in" \
diff --git a/pkgs/servers/restund/default.nix b/pkgs/servers/restund/default.nix
new file mode 100644
index 00000000000..e817151e778
--- /dev/null
+++ b/pkgs/servers/restund/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl, zlib, openssl, libre, librem, mysql}:
+stdenv.mkDerivation rec {
+  version = "0.4.2";
+  name = "restund-${version}";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/restund-${version}.tar.gz";
+    sha256 = "db5260939d40cb2ce531075bef02b9d6431067bdd52f3168a6f25246bdf7b9f2";
+  };
+  buildInputs = [zlib openssl libre librem mysql];
+  makeFlags = [
+    "LIBRE_MK=${libre}/share/re/re.mk"
+    "LIBRE_INC=${libre}/include/re"
+    "LIBRE_SO=${libre}/lib"
+    "LIBREM_PATH=${librem}"
+    ''PREFIX=$(out)''
+    "USE_MYSQL=1"
+  ]
+  ++ stdenv.lib.optional (stdenv.gcc.gcc != null) "SYSROOT_ALT=${stdenv.gcc.gcc}"
+  ++ stdenv.lib.optional (stdenv.gcc.libc != null) "SYSROOT=${stdenv.gcc.libc}"
+  ;
+  NIX_LDFLAGS='' -L${mysql}/lib/mysql '';
+  meta = {
+    homepage = "http://www.creytiv.com/restund.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; bsd3;
+  };
+}
diff --git a/pkgs/servers/samba/default.nix b/pkgs/servers/samba/default.nix
index 7a73a041798..059b1c1a217 100644
--- a/pkgs/servers/samba/default.nix
+++ b/pkgs/servers/samba/default.nix
@@ -18,11 +18,11 @@
 assert useKerberos -> kerberos != null;
 
 stdenv.mkDerivation rec {
-  name = "samba-3.6.7";
+  name = "samba-3.6.8";
 
   src = fetchurl {
     url = "http://us3.samba.org/samba/ftp/stable/${name}.tar.gz";
-    sha256 = "1jnl9v6axz30ymh6in1fwan7zjy9n5n7x70vi1afazxs27qa0n5q";
+    sha256 = "1phl6mmrc72jyvbyrw6cv6b92cxq3v2pbn1fh97nnb4hild1fnjg";
   };
 
   patches =
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   postPatch =
     # XXX: Awful hack to allow cross-compilation.
     '' sed -i source3/configure \
-           -e 's/^as_fn_error \("cannot run test program while cross compiling\)/$as_echo \1/g'
+           -e 's/^as_fn_error .. \("cannot run test program while cross compiling\)/$as_echo \1/g'
     ''; # "
 
   preConfigure =
@@ -68,11 +68,17 @@ stdenv.mkDerivation rec {
     ''
       mkdir -p $out
       mv $TMPDIR/inst/$out/* $out/
-  
+
       mkdir -pv $out/lib/cups/backend
       ln -sv ../../../bin/smbspool $out/lib/cups/backend/smb
       mkdir -pv $out/etc/openldap/schema
       cp ../examples/LDAP/samba.schema $out/etc/openldap/schema
     '' # */
     + stdenv.lib.optionalString (configDir == "") "touch $out/lib/smb.conf";
+
+  meta = {
+    homepage = http://www.samba.org/;
+    description = "The standard Windows interoperability suite of programs for Linux and Unix";
+    platforms = stdenv.lib.platforms.linux;
+  };
 }
diff --git a/pkgs/servers/search/elasticsearch/default.nix b/pkgs/servers/search/elasticsearch/default.nix
new file mode 100644
index 00000000000..9afbc62ce8c
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  name = "elasticsearch-0.20.5";
+
+  src = fetchurl {
+    url = "https://download.elasticsearch.org/elasticsearch/elasticsearch/${name}.tar.gz";
+    sha256 = "0r0h9znyflajps1k8hl9naixhg1gqmhz7glc009pzzv94ncdzrq1";
+  };
+
+  patches = [ ./es-home.patch ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -R bin config lib $out
+  '';
+
+  meta = {
+    description = "Open Source, Distributed, RESTful Search Engine";
+    license = "ASL2.0";
+  };
+}
diff --git a/pkgs/servers/search/elasticsearch/es-home.patch b/pkgs/servers/search/elasticsearch/es-home.patch
new file mode 100644
index 00000000000..f9e460198a9
--- /dev/null
+++ b/pkgs/servers/search/elasticsearch/es-home.patch
@@ -0,0 +1,20 @@
+diff -rc elasticsearch-0.20.5/bin/elasticsearch elasticsearch-0.20.5-new/bin/elasticsearch
+*** elasticsearch-0.20.5/bin/elasticsearch	2013-03-07 12:16:31.152494626 +0100
+--- elasticsearch-0.20.5-new/bin/elasticsearch	2013-03-07 12:24:41.076081272 +0100
+***************
+*** 62,68 ****
+  done
+  
+  # determine elasticsearch home
+! ES_HOME=`dirname "$SCRIPT"`/..
+  
+  # make ELASTICSEARCH_HOME absolute
+  ES_HOME=`cd "$ES_HOME"; pwd`
+--- 62,68 ----
+  done
+  
+  # determine elasticsearch home
+! ES_HOME=${ES_HOME:=`dirname "$SCRIPT"`/..}
+  
+  # make ELASTICSEARCH_HOME absolute
+  ES_HOME=`cd "$ES_HOME"; pwd`
diff --git a/pkgs/servers/shishi/default.nix b/pkgs/servers/shishi/default.nix
index 6779ac9e0c3..db6f94d3826 100644
--- a/pkgs/servers/shishi/default.nix
+++ b/pkgs/servers/shishi/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "13c6w9rpaqb3am65nrn86byvmll5r78pld2vb0i68491vww4fzlx";
   };
 
+  patches = [ ./no-gets.patch ];
+
   buildInputs = [ libtasn1 libgcrypt gnutls ] ;
 
   doCheck = true;
@@ -17,14 +19,14 @@ stdenv.mkDerivation rec {
 
     longDescription =
       '' GNU Shishi is an implementation of the Kerberos 5 network
-	 authentication system, as specified in RFC 4120.  Shishi can be
-	 used to authenticate users in distributed systems.
-
-	 Shishi contains a library (`libshishi') that can be used by
-	 application developers to add support for Kerberos 5.  Shishi
-	 contains a command line utility (1shishi') that is used by
-	 users to acquire and manage tickets (and more).  The server
-	 side, a Key Distribution Center, is implemented by `shishid'.
+         authentication system, as specified in RFC 4120.  Shishi can be
+         used to authenticate users in distributed systems.
+
+         Shishi contains a library (`libshishi') that can be used by
+         application developers to add support for Kerberos 5.  Shishi
+         contains a command line utility (1shishi') that is used by
+         users to acquire and manage tickets (and more).  The server
+         side, a Key Distribution Center, is implemented by `shishid'.
       '';
 
     homepage = http://www.gnu.org/software/shishi/;
diff --git a/pkgs/servers/shishi/no-gets.patch b/pkgs/servers/shishi/no-gets.patch
new file mode 100644
index 00000000000..12137204f45
--- /dev/null
+++ b/pkgs/servers/shishi/no-gets.patch
@@ -0,0 +1,20 @@
+diff --git a/gl/stdio.in.h b/gl/stdio.in.h
+index 06d9780..fa04a10 100644
+--- a/gl/stdio.in.h
++++ b/gl/stdio.in.h
+@@ -713,10 +713,13 @@ _GL_CXXALIAS_SYS (gets, char *, (char *s));
+ # endif
+ _GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides C11
++   removed it.  */
++#ifdef gets
++#undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+ 
+ 
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/pkgs/servers/silc-server/default.nix b/pkgs/servers/silc-server/default.nix
new file mode 100644
index 00000000000..2afec801961
--- /dev/null
+++ b/pkgs/servers/silc-server/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "silc-server-1.1.18";
+
+  src = fetchurl {
+    url = "http://silcnet.org/download/server/sources/${name}.tar.bz2";
+    sha256 = "0nr0hrwr4kbi611qazmrify7a27nzxb5n7d97f5i9cw3avxlw38s";
+  };
+
+  meta = {
+    homepage = http://silcnet.org/;
+    description = "Secure Internet Live Conferencing server";
+    license = "GPLv2";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/servers/sip/freeswitch/default.nix b/pkgs/servers/sip/freeswitch/default.nix
index 5b341b7deb9..a1d9940c887 100644
--- a/pkgs/servers/sip/freeswitch/default.nix
+++ b/pkgs/servers/sip/freeswitch/default.nix
@@ -1,21 +1,16 @@
-{ fetchgit, stdenv, ncurses, curl, pkgconfig, gnutls, readline, openssl, perl, libjpeg
-, libzrtpcpp, autoconf, automake, libtool }:
+{ fetchurl, stdenv, ncurses, curl, pkgconfig, gnutls, readline, openssl, perl, libjpeg
+, libzrtpcpp }:
 
 stdenv.mkDerivation rec {
-  name = "freeswitch-git-0db52e6";
+  name = "freeswitch-1.2.3";
 
-  src = fetchgit {
-    url = "git://git.freeswitch.org/freeswitch.git";
-    rev = "0db52e6e556fce584f1850c3a3b87c8f46ff87c5";
-    sha256 = "5cc7161c1ba64c5faf3dda2669e9aafd529eaa66be2fd83f284304444bcab9ff";
+  src = fetchurl {
+    url = http://files.freeswitch.org/freeswitch-1.2.3.tar.bz2;
+    sha256 = "0kfvn5f75c6r6yp18almjz9p6llvpm66gpbxcjswrg3ddgbkzg0k";
   };
 
-  preConfigure = ''
-    ./bootstrap.sh
-  '';
-
   buildInputs = [ ncurses curl pkgconfig gnutls readline openssl perl libjpeg
-    autoconf automake libtool libzrtpcpp ];
+    libzrtpcpp ];
 
   meta = {
     description = "Cross-Platform Scalable FREE Multi-Protocol Soft Switch";
diff --git a/pkgs/servers/sip/sipwitch/default.nix b/pkgs/servers/sip/sipwitch/default.nix
index 7fa9a62e5e3..097dde325f1 100644
--- a/pkgs/servers/sip/sipwitch/default.nix
+++ b/pkgs/servers/sip/sipwitch/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, pkgconfig, ucommon, libosip, libexosip, gnutls, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "sipwitch-1.2.3";
+  name = "sipwitch-1.2.4";
 
   src = fetchurl {
     url = "mirror://gnu/sipwitch/${name}.tar.gz";
-    sha256 = "0vc7x061m2jdj8hwpw56yiz8ij07x058vm1rm1dz7w98slpkcj6d";
+    sha256 = "1c826832xi9p85l7c9va33xx8hx01m3jq49s0d1xl4c8kvri7bsj";
   };
 
   buildInputs = [ pkgconfig ucommon libosip libexosip gnutls zlib ];
diff --git a/pkgs/servers/sql/mysql/jdbc/default.nix b/pkgs/servers/sql/mysql/jdbc/default.nix
index 0f411b43f9f..424f6d02181 100644
--- a/pkgs/servers/sql/mysql/jdbc/default.nix
+++ b/pkgs/servers/sql/mysql/jdbc/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, ant, unzip}:
 
 stdenv.mkDerivation {
-  name = "mysql-connector-java-5.1.17";
+  name = "mysql-connector-java-5.1.25";
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = ftp://mirror.leaseweb.com/mysql/Downloads/Connector-J/mysql-connector-java-5.1.17.zip;
-    sha256 = "1c4hsx0qwb3rp66a1dllnah2zi9gqqnr4aqm9p59yrqj5jr22ldp";
+    url = http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.25.zip;
+    sha256 = "1qwnha8w8xafcig8wdvbry93pbli2vmzks8ds6kbb9im2k0rrmrw";
   };
 
   buildInputs = [ unzip ant ];
diff --git a/pkgs/servers/sql/mysql51/default.nix b/pkgs/servers/sql/mysql51/default.nix
index c6392589bb6..b0f125faef7 100644
--- a/pkgs/servers/sql/mysql51/default.nix
+++ b/pkgs/servers/sql/mysql51/default.nix
@@ -2,12 +2,12 @@
 
 # Note: zlib is not required; MySQL can use an internal zlib.
 
-stdenv.mkDerivation {
-  name = "mysql-5.1.54";
+stdenv.mkDerivation rec {
+  name = "mysql-5.1.69";
 
   src = fetchurl {
-    url = https://downloads.mysql.com/archives/mysql-5.1/mysql-5.1.54.tar.gz;
-    sha256 = "07xbnwk7h1xya8s6dw34nrv7ampzag8l0l1szd2pc9zyqkzhydw4";
+    url = "http://cdn.mysql.com/Downloads/MySQL-5.1/${name}.tar.gz";
+    md5 = "06bbb6a11a2cbe042f80dbd333ff9f12";
   };
 
   buildInputs = [ncurses zlib perl openssl] ++ stdenv.lib.optional stdenv.isLinux ps;
diff --git a/pkgs/servers/sql/mysql55/default.nix b/pkgs/servers/sql/mysql55/default.nix
index 3f26ea1f98b..898acc1ba49 100644
--- a/pkgs/servers/sql/mysql55/default.nix
+++ b/pkgs/servers/sql/mysql55/default.nix
@@ -2,20 +2,27 @@
 
 # Note: zlib is not required; MySQL can use an internal zlib.
 
-stdenv.mkDerivation {
-  name = "mysql-5.5.23";
+stdenv.mkDerivation rec {
+  name = "mysql-${version}";
+  version = "5.5.31";
 
   src = fetchurl {
-    url = ftp://ftp.inria.fr/pub/MySQL/Downloads/MySQL-5.5/mysql-5.5.23.tar.gz;
-    sha256 = "0sklcz6miff7nb6bi1pqncgjv819255y7if6jxcqgiqs50z319i0";
+    url = "http://cdn.mysql.com/Downloads/MySQL-5.5/${name}.tar.gz";
+    md5 = "bf402cbd52a9af33e5c25b2a4bbc56db";
   };
 
-  buildInputs = [ cmake bison ncurses openssl readline zlib ];
+  buildInputs = [ cmake bison ncurses openssl readline zlib ]
+     ++ stdenv.lib.optional stdenv.isDarwin perl;
+
+  enableParallelBuilding = true;
 
   cmakeFlags = "-DWITH_SSL=yes -DWITH_READLINE=yes -DWITH_EMBEDDED_SERVER=yes -DWITH_ZLIB=yes -DINSTALL_SCRIPTDIR=bin -DHAVE_IPV6=yes";
-  
+
   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
 
+  prePatch = ''
+    sed -i -e "s|/usr/bin/libtool|libtool|" cmake/libutils.cmake
+  '';
   postInstall = ''
     sed -i -e "s|basedir=\"\"|basedir=\"$out\"|" $out/bin/mysql_install_db
     rm -rf $out/mysql-test $out/sql-bench
diff --git a/pkgs/servers/sql/oracle-xe/default.nix b/pkgs/servers/sql/oracle-xe/default.nix
new file mode 100644
index 00000000000..57ff50175bb
--- /dev/null
+++ b/pkgs/servers/sql/oracle-xe/default.nix
@@ -0,0 +1,83 @@
+{ stdenv, makeWrapper, requireFile, patchelf, rpm, cpio, libaio }:
+
+assert stdenv.system == "x86_64-linux";
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "oracle-xe-${version}";
+  version = "11.2.0";
+
+  src = requireFile {
+    name = "${name}-1.0.x86_64.rpm";
+    sha256 = "0s2jj2xn56v5ys6hxb7l7045hw9c1mm1lhj4p2fvqbs02kqchab6";
+
+    url = "http://www.oracle.com/technetwork/"
+        + "products/express-edition/downloads/";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  unpackCmd = ''
+    (mkdir -p "${name}" && cd "${name}" &&
+      ${rpm}/bin/rpm2cpio "$curSrc" | ${cpio}/bin/cpio -id)
+  '';
+
+  buildPhase = let
+    libs = makeLibraryPath [ libaio ];
+  in ''
+    basedir="u01/app/oracle/product/${version}/xe"
+    cat > "$basedir/network/admin/listener.ora" <<SQL
+    # listener.ora Network Configuration File:
+
+    SID_LIST_LISTENER =
+      (SID_LIST =
+        (SID_DESC =
+          (SID_NAME = PLSExtProc)
+          (ORACLE_HOME = ''${out}/libexec/oracle)
+          (PROGRAM = extproc)
+        )
+      )
+
+    LISTENER =
+      (DESCRIPTION_LIST =
+        (DESCRIPTION =
+          (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
+          (ADDRESS = (PROTOCOL = TCP)(HOST = %hostname%)(PORT = %port%))
+        )
+      )
+
+    DEFAULT_SERVICE_LISTENER = (XE)
+    SQL
+
+    find u01 \
+      \( -name '*.sh' \
+      -o -path "$basedir/bin/*" \
+      \) -print -exec "${patchelf}/bin/patchelf" \
+           --interpreter "$(cat "$NIX_GCC/nix-support/dynamic-linker")" \
+           --set-rpath "${libs}:$out/libexec/oracle/lib" \
+           --force-rpath '{}' \;
+  '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  installPhase = ''
+    mkdir -p "$out/libexec"
+    cp -r "u01/app/oracle/product/${version}/xe" "$out/libexec/oracle"
+
+    for i in "$out/libexec/oracle/bin"/*; do
+      makeWrapper "$i" "$out/bin/''${i##*/}" \
+        --set ORACLE_HOME "$out/libexec/oracle" \
+        --set ORACLE_SID XE \
+        --set NLS_LANG '$("'"$out"'/libexec/oracle/bin/nls_lang.sh")' \
+        --prefix PATH : "$out/libexec/oracle/bin"
+    done
+  '';
+
+  meta = {
+    description = "Oracle Database Express Edition";
+    homepage = "http://www.oracle.com/technetwork/products/express-edition/";
+    license = licenses.unfree;
+  };
+}
diff --git a/pkgs/servers/sql/postgresql/8.3.x.nix b/pkgs/servers/sql/postgresql/8.3.x.nix
index d4ddb36d4fe..b7f2d7d2a50 100644
--- a/pkgs/servers/sql/postgresql/8.3.x.nix
+++ b/pkgs/servers/sql/postgresql/8.3.x.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, zlib, ncurses, readline }:
 
-let version = "8.3.20"; in
+let version = "8.3.23"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0qqic4wx59lgbyfmdfcgip9nrcpk10zdb91bw9b96wr1vijn2awj";
+    sha256 = "1n8qj1bvyx83jsn2x2l8xzk53c014gkz8hwvswvnzcdyvlbnd90p";
   };
 
   buildInputs = [ zlib ncurses readline ];
diff --git a/pkgs/servers/sql/postgresql/8.4.x.nix b/pkgs/servers/sql/postgresql/8.4.x.nix
index e1150543f36..c8597def61e 100644
--- a/pkgs/servers/sql/postgresql/8.4.x.nix
+++ b/pkgs/servers/sql/postgresql/8.4.x.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, zlib, ncurses, readline }:
 
-let version = "8.4.13"; in
+let version = "8.4.17"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "1fccqkni64vg1pi4zzcl67bm9g2brrlzjn1vh6qlyfpsld139p90";
+    sha256 = "0dh4rn4q2amqjwmjjiya99bz1ph3lx45j5brnpwdjd9mxhs4r26w";
   };
 
   buildInputs = [ zlib ncurses readline ];
diff --git a/pkgs/servers/sql/postgresql/9.0.x.nix b/pkgs/servers/sql/postgresql/9.0.x.nix
index a28e5c33779..ea25cf0d476 100644
--- a/pkgs/servers/sql/postgresql/9.0.x.nix
+++ b/pkgs/servers/sql/postgresql/9.0.x.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, zlib, readline }:
 
-let version = "9.0.9"; in
+let version = "9.0.13"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "12nslml1mg3lyvrhmdvv5g15n7vj5fk1blx1dfllylqg38c7shc7";
+    sha256 = "0xwrmwrx0pm21w3ifrqcmb8k2sa46w491ff3gqqfxynyk78a9bji";
   };
 
   buildInputs = [ zlib readline ];
diff --git a/pkgs/servers/sql/postgresql/9.1.x.nix b/pkgs/servers/sql/postgresql/9.1.x.nix
index 14488d4649e..b9436cb4b08 100644
--- a/pkgs/servers/sql/postgresql/9.1.x.nix
+++ b/pkgs/servers/sql/postgresql/9.1.x.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, zlib, readline }:
 
-let version = "9.1.5"; in
+let version = "9.1.9"; in
 
 stdenv.mkDerivation rec {
   name = "postgresql-${version}";
 
   src = fetchurl {
     url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
-    sha256 = "0i6fssldjp65xfxz9dcmkhz6bk4rpw9g26zbqbc6iz164h9rr20b";
+    sha256 = "1n1dc1kqc487dylc22iq1j8sn93jxbqm2g4b5rr0i4q0h7hk7998";
   };
 
   buildInputs = [ zlib readline ];
diff --git a/pkgs/servers/sql/postgresql/9.2.x.nix b/pkgs/servers/sql/postgresql/9.2.x.nix
new file mode 100644
index 00000000000..46a6aa0c032
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/9.2.x.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, zlib, readline }:
+
+let version = "9.2.4"; in
+
+stdenv.mkDerivation rec {
+  name = "postgresql-${version}";
+
+  src = fetchurl {
+    url = "mirror://postgresql/source/v${version}/${name}.tar.bz2";
+    sha256 = "14xfzw3hb2fn60c438v3j7wa65jjm2pnmx4qb4i4ji4am0cdjzfr";
+  };
+
+  buildInputs = [ zlib readline ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = [ "world" ];
+
+  installTargets = [ "install-world" ];
+
+  LC_ALL = "C";
+
+  passthru = {
+    inherit readline;
+    psqlSchema = "9.2";
+  };
+
+  meta = {
+    homepage = http://www.postgresql.org/;
+    description = "A powerful, open source object-relational database system";
+    license = "bsd";
+  };
+}
diff --git a/pkgs/servers/sql/postgresql/jdbc/default.nix b/pkgs/servers/sql/postgresql/jdbc/default.nix
index e173a270e88..e490a14bea6 100644
--- a/pkgs/servers/sql/postgresql/jdbc/default.nix
+++ b/pkgs/servers/sql/postgresql/jdbc/default.nix
@@ -1,13 +1,19 @@
-{stdenv, fetchurl, ant}:
+{ stdenv, fetchurl, ant }:
 
-stdenv.mkDerivation {
-  name = "postgresql-jdbc-8.2";
+stdenv.mkDerivation rec {
+  name = "postgresql-jdbc-9.1-902";
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = http://jdbc.postgresql.org/download/postgresql-jdbc-8.2-504.src.tar.gz;
-    sha256 = "1fkza5j4b9pzm69cw1zv35bqk062d92l4l0zhz3qn0g64r08ccm4";
+    url = "http://jdbc.postgresql.org/download/${name}.src.tar.gz";
+    sha256 = "0sgwbiw5vfxcl0g1yzsndgxdha74cr8ag6y65i0jhgg5g8qc56bz";
   };
 
   buildInputs = [ant];
+
+  meta = {
+    homepage = http://jdbc.postgresql.org/;
+    description = "JDBC driver for PostgreSQL allowing Java programs to connect to a PostgreSQL database";
+    license = "bsd";
+  };
 }
diff --git a/pkgs/servers/sql/postgresql/psqlodbc/default.nix b/pkgs/servers/sql/postgresql/psqlodbc/default.nix
new file mode 100644
index 00000000000..ce57c214183
--- /dev/null
+++ b/pkgs/servers/sql/postgresql/psqlodbc/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, libiodbc, postgresql, openssl }:
+
+stdenv.mkDerivation rec {
+  name = "psqlodbc-09.01.0200";
+
+  src = fetchurl {
+    url = "http://ftp.postgresql.org/pub/odbc/versions/src/${name}.tar.gz";
+    sha256 = "0b4w1ahfpp34jpscfk2kv9050lh3xl9pvcysqvaigkcd0vsk1hl9";
+  };
+
+  buildInputs = [ libiodbc postgresql openssl ];
+
+  configureFlags = "--with-iodbc=${libiodbc}";
+
+  meta = {
+    homepage = http://psqlodbc.projects.postgresql.org/;
+    description = "ODBC driver for PostgreSQL";
+    license = "LGPL";
+  };
+}
diff --git a/pkgs/servers/sql/virtuoso/default.nix b/pkgs/servers/sql/virtuoso/default.nix
index 6d732fde182..9453b8d2cdb 100644
--- a/pkgs/servers/sql/virtuoso/default.nix
+++ b/pkgs/servers/sql/virtuoso/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libxml2, openssl, readline, gawk }:
 
 stdenv.mkDerivation rec {
-  name = "virtuoso-opensource-6.1.5";
+  name = "virtuoso-opensource-6.1.6";
 
   src = fetchurl {
     url = "mirror://sourceforge/virtuoso/${name}.tar.gz";
-    sha256 = "02aax76f51ya5slp1slv4r1ihcb7zpb040n33b581g8n1ppgj2ps";
+    sha256 = "0dx0lp7cngdchi0772hp93zzn6sdap7z8s3vay3mzb9xgf0sdgy6";
   };
 
   buildInputs = [ libxml2 openssl readline gawk ];
diff --git a/pkgs/servers/squid/squids.nix b/pkgs/servers/squid/squids.nix
index 3e5e4ebbe6f..22aba3e156f 100644
--- a/pkgs/servers/squid/squids.nix
+++ b/pkgs/servers/squid/squids.nix
@@ -11,7 +11,7 @@ rec {
       sha256 = "3e54ae3ad09870203862f0856c7d0cca16a85f62d5012085009003ee3d5467b4";
     };
 
-    configureFlags = ["--enable-ipv6"];
+    configureFlags = ["--enable-ipv6" "--disable-strict-error-checking"];
 
     meta = {
       description = "http-proxy";
@@ -27,19 +27,17 @@ rec {
       url = http://www.squid-cache.org/Versions/v3/3.1/squid-3.1.15.tar.bz2;
       sha256 = "1300f44dd4783697bacc262a7a9b32dbc9f550367fe82b70262864fdff715a35";
     };
-    configureFlags = ["--enable-ipv6"];
   };
 
-  squid32Beta = squid30.merge rec {
-    name = "squid-3.2.0.16";
+  squid32 = squid30.merge rec {
+    name = "squid-3.2.2";
     src = args.fetchurl {
       url = "http://www.squid-cache.org/Versions/v3/3.2/${name}.tar.bz2";
-      sha256 = "2431f4f9372e4e1a9c5fca5a4fa0c4bb0761ce3e044642ea9362bb1580a36d25";
+      sha256 = "13jlx3d6rqq7ajxs8bgn8a0mh932jhq6aa8032q205nxnhqs0l4l";
     };
-    configureFlags = ["--enable-ipv6"];
     buildInputs = [openldap pam db4 cyrus_sasl libcap expat libxml2
       libtool openssl];
   };
 
-  latest = squid32Beta;
+  latest = squid32;
 }
diff --git a/pkgs/servers/unfs3/default.nix b/pkgs/servers/unfs3/default.nix
index e59023c905e..96073645cc1 100644
--- a/pkgs/servers/unfs3/default.nix
+++ b/pkgs/servers/unfs3/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "076zkyqkn56q0a8n3h65n1a68fknk4hrrp6mbhajq5s1wp5248j8";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
 
   configureFlags = [ "--disable-shared" ];
 
diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix
new file mode 100644
index 00000000000..528c03e3aa3
--- /dev/null
+++ b/pkgs/servers/varnish/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "3.0.3";
+  name = "varnish-${version}";
+
+  src = fetchurl {
+    url = "http://repo.varnish-cache.org/source/${name}.tar.gz";
+    sha256 = "1cla2igwfwcm07srvk0z9cqdxh74sga0c1rsmh4b4n1gjn6x2drd";
+  };
+
+  buildInputs = [ pcre libxslt groff ncurses pkgconfig ];
+
+  meta = {
+    description = "Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy.";
+    homepage = "https://www.varnish-cache.org";
+    license = stdenv.lib.licenses.bsd2;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/servers/x11/xorg/builder.sh b/pkgs/servers/x11/xorg/builder.sh
index 156f4e79e42..733d04e787a 100644
--- a/pkgs/servers/x11/xorg/builder.sh
+++ b/pkgs/servers/x11/xorg/builder.sh
@@ -26,7 +26,7 @@ postInstall() {
             for p in $nativePkgs; do
                 if test -e $p/lib/pkgconfig/$r.pc; then
                     echo "  found requisite $r in $p"
-                    propagatedBuildNativeInputs="$propagatedBuildNativeInputs $p"
+                    propagatedNativeBuildInputs="$propagatedNativeBuildInputs $p"
                 fi
             done
         fi
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index 3edc5832543..cb7ecf9ed16 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -8,11 +8,11 @@ let
   xorg = rec {
 
   applewmproto = (stdenv.mkDerivation ((if overrides ? applewmproto then overrides.applewmproto else x: x) {
-    name = "applewmproto-1.4.1";
+    name = "applewmproto-1.4.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/applewmproto-1.4.1.tar.bz2;
-      sha256 = "06fyixmx36qac2qqwmra3l9xr570rankm9kzmk0mgqyhgldrw1h8";
+      url = mirror://xorg/X11R7.7/src/everything/applewmproto-1.4.2.tar.bz2;
+      sha256 = "1zi4p07mp6jmk030p4gmglwxcwp0lzs5mi31y1b4rp8lsqxdxizw";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -21,18 +21,18 @@ let
     name = "bdftopcf-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/bdftopcf-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/bdftopcf-1.0.3.tar.bz2;
       sha256 = "02hx981f7jfwylxj21s91yvv4h597nqqzz3vd6ar81zyn84b944w";
     };
     buildInputs = [pkgconfig libXfont ];
   })) // {inherit libXfont ;};
     
   bigreqsproto = (stdenv.mkDerivation ((if overrides ? bigreqsproto then overrides.bigreqsproto else x: x) {
-    name = "bigreqsproto-1.1.1";
+    name = "bigreqsproto-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/bigreqsproto-1.1.1.tar.bz2;
-      sha256 = "16phzxa55lr749rghpaa699h1lcpndmw7izxzgl1bljq5f3qafqw";
+      url = mirror://xorg/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2;
+      sha256 = "07hvfm84scz8zjw14riiln2v4w03jlhp756ypwhq27g48jmic8a6";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -41,7 +41,7 @@ let
     name = "compositeproto-0.4.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/compositeproto-0.4.2.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2;
       sha256 = "1z0crmf669hirw4s7972mmp8xig80kfndja9h559haqbpvq5k4q4";
     };
     buildInputs = [pkgconfig ];
@@ -51,7 +51,7 @@ let
     name = "damageproto-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/damageproto-1.2.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2;
       sha256 = "0nzwr5pv9hg7c21n995pdiv0zqhs91yz3r8rn3aska4ykcp12z2w";
     };
     buildInputs = [pkgconfig ];
@@ -61,18 +61,18 @@ let
     name = "dmxproto-2.3.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/proto/dmxproto-2.3.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/dmxproto-2.3.1.tar.bz2;
       sha256 = "02b5x9dkgajizm8dqyx2w6hmqx3v25l67mgf35nj6sz0lgk52877";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   dri2proto = (stdenv.mkDerivation ((if overrides ? dri2proto then overrides.dri2proto else x: x) {
-    name = "dri2proto-2.6";
+    name = "dri2proto-2.8";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/proto/dri2proto-2.6.tar.bz2;
-      sha256 = "02drlfqvjm2q7dvkkwli3fs2crb6rdb3kyd13vwx7z0rijrc10md";
+      url = mirror://xorg/individual/proto/dri2proto-2.8.tar.bz2;
+      sha256 = "015az1vfdqmil1yay5nlsmpf6cf7vcbpslxjb72cfkzlvrv59dgr";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -81,18 +81,18 @@ let
     name = "encodings-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/encodings-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/encodings-1.0.4.tar.bz2;
       sha256 = "0ffmaw80vmfwdgvdkp6495xgsqszb6s0iira5j0j6pd4i0lk3mnf";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   fixesproto = (stdenv.mkDerivation ((if overrides ? fixesproto then overrides.fixesproto else x: x) {
-    name = "fixesproto-4.1.2";
+    name = "fixesproto-5.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/fixesproto-4.1.2.tar.bz2;
-      sha256 = "0mzq8kh1v1w2mrl4y82qzgv8jzlr3n4jmss56h3r1h9knp6byk6y";
+      url = mirror://xorg/X11R7.7/src/everything/fixesproto-5.0.tar.bz2;
+      sha256 = "1ki4wiq2iivx5g4w5ckzbjbap759kfqd72yg18m3zpbb4hqkybxs";
     };
     buildInputs = [pkgconfig xextproto ];
   })) // {inherit xextproto ;};
@@ -101,47 +101,47 @@ let
     name = "font-adobe-100dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-adobe-100dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-adobe-100dpi-1.0.3.tar.bz2;
       sha256 = "0m60f5bd0caambrk8ksknb5dks7wzsg7g7xaf0j21jxmx8rq9h5j";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontadobe75dpi = (stdenv.mkDerivation ((if overrides ? fontadobe75dpi then overrides.fontadobe75dpi else x: x) {
     name = "font-adobe-75dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-adobe-75dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-adobe-75dpi-1.0.3.tar.bz2;
       sha256 = "02advcv9lyxpvrjv8bjh1b797lzg6jvhipclz49z8r8y98g4l0n6";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontadobeutopia100dpi = (stdenv.mkDerivation ((if overrides ? fontadobeutopia100dpi then overrides.fontadobeutopia100dpi else x: x) {
     name = "font-adobe-utopia-100dpi-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2;
       sha256 = "19dd9znam1ah72jmdh7i6ny2ss2r6m21z9v0l43xvikw48zmwvyi";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontadobeutopia75dpi = (stdenv.mkDerivation ((if overrides ? fontadobeutopia75dpi then overrides.fontadobeutopia75dpi else x: x) {
     name = "font-adobe-utopia-75dpi-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2;
       sha256 = "152wigpph5wvl4k9m3l4mchxxisgsnzlx033mn5iqrpkc6f72cl7";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontadobeutopiatype1 = (stdenv.mkDerivation ((if overrides ? fontadobeutopiatype1 then overrides.fontadobeutopiatype1 else x: x) {
     name = "font-adobe-utopia-type1-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2;
       sha256 = "0xw0pdnzj5jljsbbhakc6q9ha2qnca1jr81zk7w70yl9bw83b54p";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -151,7 +151,7 @@ let
     name = "font-alias-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-alias-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-alias-1.0.3.tar.bz2;
       sha256 = "16ic8wfwwr3jicaml7b5a0sk6plcgc1kg84w02881yhwmqm3nicb";
     };
     buildInputs = [pkgconfig ];
@@ -161,7 +161,7 @@ let
     name = "font-arabic-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-arabic-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-arabic-misc-1.0.3.tar.bz2;
       sha256 = "1x246dfnxnmflzf0qzy62k8jdpkb6jkgspcjgbk8jcq9lw99npah";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -171,47 +171,47 @@ let
     name = "font-bh-100dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-100dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-100dpi-1.0.3.tar.bz2;
       sha256 = "10cl4gm38dw68jzln99ijix730y7cbx8np096gmpjjwff1i73h13";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontbh75dpi = (stdenv.mkDerivation ((if overrides ? fontbh75dpi then overrides.fontbh75dpi else x: x) {
     name = "font-bh-75dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-75dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-75dpi-1.0.3.tar.bz2;
       sha256 = "073jmhf0sr2j1l8da97pzsqj805f7mf9r2gy92j4diljmi8sm1il";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontbhlucidatypewriter100dpi = (stdenv.mkDerivation ((if overrides ? fontbhlucidatypewriter100dpi then overrides.fontbhlucidatypewriter100dpi else x: x) {
     name = "font-bh-lucidatypewriter-100dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2;
       sha256 = "1fqzckxdzjv4802iad2fdrkpaxl4w0hhs9lxlkyraq2kq9ik7a32";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontbhlucidatypewriter75dpi = (stdenv.mkDerivation ((if overrides ? fontbhlucidatypewriter75dpi then overrides.fontbhlucidatypewriter75dpi else x: x) {
     name = "font-bh-lucidatypewriter-75dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2;
       sha256 = "0cfbxdp5m12cm7jsh3my0lym9328cgm7fa9faz2hqj05wbxnmhaa";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontbhttf = (stdenv.mkDerivation ((if overrides ? fontbhttf then overrides.fontbhttf else x: x) {
     name = "font-bh-ttf-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-ttf-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-ttf-1.0.3.tar.bz2;
       sha256 = "0pyjmc0ha288d4i4j0si4dh3ncf3jiwwjljvddrb0k8v4xiyljqv";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -221,7 +221,7 @@ let
     name = "font-bh-type1-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bh-type1-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bh-type1-1.0.3.tar.bz2;
       sha256 = "1hb3iav089albp4sdgnlh50k47cdjif9p4axm0kkjvs8jyi5a53n";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -231,7 +231,7 @@ let
     name = "font-bitstream-100dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2;
       sha256 = "1kmn9jbck3vghz6rj3bhc3h0w6gh0qiaqm90cjkqsz1x9r2dgq7b";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -241,7 +241,7 @@ let
     name = "font-bitstream-75dpi-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2;
       sha256 = "13plbifkvfvdfym6gjbgy9wx2xbdxi9hfrl1k22xayy02135wgxs";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -251,7 +251,7 @@ let
     name = "font-bitstream-type1-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-bitstream-type1-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-bitstream-type1-1.0.3.tar.bz2;
       sha256 = "1256z0jhcf5gbh1d03593qdwnag708rxqa032izmfb5dmmlhbsn6";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -261,7 +261,7 @@ let
     name = "font-cronyx-cyrillic-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2;
       sha256 = "0ai1v4n61k8j9x2a1knvfbl2xjxk3xxmqaq3p9vpqrspc69k31kf";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -271,7 +271,7 @@ let
     name = "font-cursor-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-cursor-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-cursor-misc-1.0.3.tar.bz2;
       sha256 = "0dd6vfiagjc4zmvlskrbjz85jfqhf060cpys8j0y1qpcbsrkwdhp";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -281,7 +281,7 @@ let
     name = "font-daewoo-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-daewoo-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-daewoo-misc-1.0.3.tar.bz2;
       sha256 = "1s2bbhizzgbbbn5wqs3vw53n619cclxksljvm759h9p1prqdwrdw";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -291,7 +291,7 @@ let
     name = "font-dec-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-dec-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-dec-misc-1.0.3.tar.bz2;
       sha256 = "0yzza0l4zwyy7accr1s8ab7fjqkpwggqydbm2vc19scdby5xz7g1";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -301,7 +301,7 @@ let
     name = "font-ibm-type1-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-ibm-type1-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-ibm-type1-1.0.3.tar.bz2;
       sha256 = "1pyjll4adch3z5cg663s6vhi02k8m6488f0mrasg81ssvg9jinzx";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -311,7 +311,7 @@ let
     name = "font-isas-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-isas-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-isas-misc-1.0.3.tar.bz2;
       sha256 = "0rx8q02rkx673a7skkpnvfkg28i8gmqzgf25s9yi0lar915sn92q";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -321,7 +321,7 @@ let
     name = "font-jis-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-jis-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-jis-misc-1.0.3.tar.bz2;
       sha256 = "0rdc3xdz12pnv951538q6wilx8mrdndpkphpbblszsv7nc8cw61b";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -331,7 +331,7 @@ let
     name = "font-micro-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-micro-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-micro-misc-1.0.3.tar.bz2;
       sha256 = "1dldxlh54zq1yzfnrh83j5vm0k4ijprrs5yl18gm3n9j1z0q2cws";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -341,7 +341,7 @@ let
     name = "font-misc-cyrillic-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-misc-cyrillic-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-misc-cyrillic-1.0.3.tar.bz2;
       sha256 = "0q2ybxs8wvylvw95j6x9i800rismsmx4b587alwbfqiw6biy63z4";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -351,7 +351,7 @@ let
     name = "font-misc-ethiopic-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-misc-ethiopic-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-misc-ethiopic-1.0.3.tar.bz2;
       sha256 = "19cq7iq0pfad0nc2v28n681fdq3fcw1l1hzaq0wpkgpx7bc1zjsk";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -361,7 +361,7 @@ let
     name = "font-misc-meltho-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-misc-meltho-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-misc-meltho-1.0.3.tar.bz2;
       sha256 = "148793fqwzrc3bmh2vlw5fdiwjc2n7vs25cic35gfp452czk489p";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -371,17 +371,17 @@ let
     name = "font-misc-misc-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-misc-misc-1.1.2.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-misc-misc-1.1.2.tar.bz2;
       sha256 = "150pq6n8n984fah34n3k133kggn9v0c5k07igv29sxp1wi07krxq";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontmuttmisc = (stdenv.mkDerivation ((if overrides ? fontmuttmisc then overrides.fontmuttmisc else x: x) {
     name = "font-mutt-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-mutt-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-mutt-misc-1.0.3.tar.bz2;
       sha256 = "13qghgr1zzpv64m0p42195k1kc77pksiv059fdvijz1n6kdplpxx";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -391,17 +391,17 @@ let
     name = "font-schumacher-misc-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-schumacher-misc-1.1.2.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-schumacher-misc-1.1.2.tar.bz2;
       sha256 = "0nkym3n48b4v36y4s927bbkjnsmicajarnf6vlp7wxp0as304i74";
     };
-    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
-  })) // {inherit bdftopcf fontutil mkfontdir ;};
+    buildInputs = [pkgconfig bdftopcf fontutil mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
+  })) // {inherit bdftopcf fontutil mkfontdir mkfontscale ;};
     
   fontscreencyrillic = (stdenv.mkDerivation ((if overrides ? fontscreencyrillic then overrides.fontscreencyrillic else x: x) {
     name = "font-screen-cyrillic-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-screen-cyrillic-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-screen-cyrillic-1.0.4.tar.bz2;
       sha256 = "0yayf1qlv7irf58nngddz2f1q04qkpr5jwp4aja2j5gyvzl32hl2";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -411,18 +411,18 @@ let
     name = "font-sony-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-sony-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-sony-misc-1.0.3.tar.bz2;
       sha256 = "1xfgcx4gsgik5mkgkca31fj3w72jw9iw76qyrajrsz1lp8ka6hr0";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
   })) // {inherit bdftopcf mkfontdir ;};
     
   fontsproto = (stdenv.mkDerivation ((if overrides ? fontsproto then overrides.fontsproto else x: x) {
-    name = "fontsproto-2.1.1";
+    name = "fontsproto-2.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/fontsproto-2.1.1.tar.bz2;
-      sha256 = "1g1rsvj0lb7744x6fj18d989ymf7zgry3v3fzipnnzljwa0vr6lw";
+      url = mirror://xorg/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2;
+      sha256 = "1ab8mbqxdwvdz4k5x4xb9c4n5w7i1xw276cbpk4z7a1nlpjrg746";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -431,18 +431,18 @@ let
     name = "font-sun-misc-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-sun-misc-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-sun-misc-1.0.3.tar.bz2;
       sha256 = "1q6jcqrffg9q5f5raivzwx9ffvf7r11g6g0b125na1bhpz5ly7s8";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
   })) // {inherit bdftopcf mkfontdir ;};
     
   fontutil = (stdenv.mkDerivation ((if overrides ? fontutil then overrides.fontutil else x: x) {
-    name = "font-util-1.2.0";
+    name = "font-util-1.3.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-util-1.2.0.tar.bz2;
-      sha256 = "04lp7xlrcqfyrsnvdgyqbanlnzr13lhn28v0kr2nzpvcmqbwdfnv";
+      url = mirror://xorg/X11R7.7/src/everything/font-util-1.3.0.tar.bz2;
+      sha256 = "15cijajwhjzpy3ydc817zz8x5z4gbkyv3fps687jbq544mbfbafz";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -451,7 +451,7 @@ let
     name = "font-winitzki-cyrillic-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2;
       sha256 = "181n1bgq8vxfxqicmy1jpm1hnr6gwn1kdhl6hr4frjigs1ikpldb";
     };
     buildInputs = [pkgconfig bdftopcf mkfontdir ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -461,7 +461,7 @@ let
     name = "font-xfree86-type1-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/font-xfree86-type1-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/font-xfree86-type1-1.0.4.tar.bz2;
       sha256 = "0jp3zc0qfdaqfkgzrb44vi9vi0a8ygb35wp082yz7rvvxhmg9sya";
     };
     buildInputs = [pkgconfig mkfontdir mkfontscale ]; configureFlags = "--with-fontrootdir=$(out)/lib/X11/fonts"; 
@@ -478,91 +478,91 @@ let
   })) // {inherit ;};
     
   glproto = (stdenv.mkDerivation ((if overrides ? glproto then overrides.glproto else x: x) {
-    name = "glproto-1.4.12";
+    name = "glproto-1.4.16";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/glproto-1.4.12.tar.bz2;
-      sha256 = "1pjpnj78hski4krvsbf55pkhhsrahvlb825dwl804q0b36fpmgj8";
+      url = mirror://xorg/individual/proto/glproto-1.4.16.tar.bz2;
+      sha256 = "13arnb4bz5pn89bxbh3shr8gihkhyznpjnq3zzr05msygwx6dpal";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   iceauth = (stdenv.mkDerivation ((if overrides ? iceauth then overrides.iceauth else x: x) {
-    name = "iceauth-1.0.4";
+    name = "iceauth-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/iceauth-1.0.4.tar.bz2;
-      sha256 = "13ck97rz53l490aba3xpgv4psgk4rywh1vi6slg1n4zhai2zvrhf";
+      url = mirror://xorg/X11R7.7/src/everything/iceauth-1.0.5.tar.bz2;
+      sha256 = "1aq6v671s2x5rc6zn0rgxb4wddg4vq94mckw3cpwl7ccrjjvd5hl";
     };
     buildInputs = [pkgconfig libICE xproto ];
   })) // {inherit libICE xproto ;};
     
   imake = (stdenv.mkDerivation ((if overrides ? imake then overrides.imake else x: x) {
-    name = "imake-1.0.4";
+    name = "imake-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/util/imake-1.0.4.tar.bz2;
-      sha256 = "1zj6y59yip40hrdvvljjmnsfqddzxpxmbmd8842010rhkvq7zcmc";
+      url = mirror://xorg/individual/util/imake-1.0.5.tar.bz2;
+      sha256 = "1h8ww97aymm10l9qn21n1b9x5ypjrqr10qpf48jjcbc9fg77gklr";
     };
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   inputproto = (stdenv.mkDerivation ((if overrides ? inputproto then overrides.inputproto else x: x) {
-    name = "inputproto-2.0.1";
+    name = "inputproto-2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/inputproto-2.0.1.tar.bz2;
-      sha256 = "0i2a28bnvv68i6z8qx09iw95c1wchqc2migx1s7764pqipc3srk3";
+      url = mirror://xorg/X11R7.7/src/everything/inputproto-2.2.tar.bz2;
+      sha256 = "1c5wqamfsd8g5i8kya5pjfmcac8q5zq1l3vclh6p96f24nmicxfy";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   kbproto = (stdenv.mkDerivation ((if overrides ? kbproto then overrides.kbproto else x: x) {
-    name = "kbproto-1.0.5";
+    name = "kbproto-1.0.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/kbproto-1.0.5.tar.bz2;
-      sha256 = "17glym611bbkca371ihpcnx9ydp4asay4psqq267j00pbr94zfhf";
+      url = mirror://xorg/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2;
+      sha256 = "0yal11hhpiisy3w8wmacsdzzzcnc3xwnswxz8k7zri40xc5aqz03";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   libAppleWM = (stdenv.mkDerivation ((if overrides ? libAppleWM then overrides.libAppleWM else x: x) {
-    name = "libAppleWM-1.4.0";
+    name = "libAppleWM-1.4.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libAppleWM-1.4.0.tar.bz2;
-      sha256 = "10hw7rvwc2b0v3v6mc6vaq8xs6vim4bg43rnhspf4p26mlb2dsf8";
+      url = mirror://xorg/X11R7.7/src/everything/libAppleWM-1.4.1.tar.bz2;
+      sha256 = "0r8x28n45q89x91mz8mv0zkkcxi8wazkac886fyvflhiv2y8ap2y";
     };
     buildInputs = [pkgconfig applewmproto libX11 libXext xextproto ];
   })) // {inherit applewmproto libX11 libXext xextproto ;};
     
   libFS = (stdenv.mkDerivation ((if overrides ? libFS then overrides.libFS else x: x) {
-    name = "libFS-1.0.3";
+    name = "libFS-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libFS-1.0.3.tar.bz2;
-      sha256 = "0694iyc1rdz0fqnalgzpgzmxfaklrdk0jz769fsn1bv88mszjymb";
+      url = mirror://xorg/X11R7.7/src/everything/libFS-1.0.4.tar.bz2;
+      sha256 = "05c3bqgn5m7j4kx8wvy0p36faq6f9jv5yq12m6033m4lflg7cwvh";
     };
     buildInputs = [pkgconfig fontsproto xproto xtrans ];
   })) // {inherit fontsproto xproto xtrans ;};
     
   libICE = (stdenv.mkDerivation ((if overrides ? libICE then overrides.libICE else x: x) {
-    name = "libICE-1.0.7";
+    name = "libICE-1.0.8";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libICE-1.0.7.tar.bz2;
-      sha256 = "00drapw7n793nqy23m76vxj5yzlgx7prmprkhzp3qiqs2lpnkcd8";
+      url = mirror://xorg/X11R7.7/src/everything/libICE-1.0.8.tar.bz2;
+      sha256 = "07mp13pb3s73kj7y490gnx619znzwk91mlf8kdw0rzq29ll93a94";
     };
     buildInputs = [pkgconfig xproto xtrans ];
   })) // {inherit xproto xtrans ;};
     
   libSM = (stdenv.mkDerivation ((if overrides ? libSM then overrides.libSM else x: x) {
-    name = "libSM-1.2.0";
+    name = "libSM-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libSM-1.2.0.tar.bz2;
-      sha256 = "1jspgbd9g1d20kl18nnbzv37f1kpfybjff2xn08dmgv7f0dxzn0c";
+      url = mirror://xorg/X11R7.7/src/everything/libSM-1.2.1.tar.bz2;
+      sha256 = "07bzi6xwlhq36f60qfspjbz0qjj7zcgayi1vp4ihgx34kib1vhck";
     };
     buildInputs = [pkgconfig libICE libuuid xproto xtrans ];
   })) // {inherit libICE libuuid xproto xtrans ;};
@@ -571,50 +571,50 @@ let
     name = "libWindowsWM-1.0.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libWindowsWM-1.0.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/libWindowsWM-1.0.1.tar.bz2;
       sha256 = "1p0flwb67xawyv6yhri9w17m1i4lji5qnd0gq8v1vsfb8zw7rw15";
     };
     buildInputs = [pkgconfig windowswmproto libX11 libXext xextproto ];
   })) // {inherit windowswmproto libX11 libXext xextproto ;};
     
   libX11 = (stdenvMulti.mkDerivation ((if overrides ? libX11 then overrides.libX11 else x: x) {
-    name = "libX11-1.4.1";
+    name = "libX11-1.5.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/libX11-1.4.1.tar.bz2;
-      sha256 = "1qiwyqaf9vfn52nwp7nxlbixld3r9jyzsarnkwk0ynk4k3vy1x3h";
+      url = mirror://xorg/X11R7.7/src/everything/libX11-1.5.0.tar.bz2;
+      sha256 = "11jdpl15bxwpwv0knpkh990s8jvlybng3dx477pkrz1bx7byz0n3";
     };
     outputs = [ "dev" "out" "man" ];
     buildInputs = [pkgconfig inputproto kbproto libxcb xextproto xf86bigfontproto xproto xtrans ];
   })) // {inherit inputproto kbproto libxcb xextproto xf86bigfontproto xproto xtrans ;};
     
   libXScrnSaver = (stdenv.mkDerivation ((if overrides ? libXScrnSaver then overrides.libXScrnSaver else x: x) {
-    name = "libXScrnSaver-1.2.1";
+    name = "libXScrnSaver-1.2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXScrnSaver-1.2.1.tar.bz2;
-      sha256 = "16i59gac2sixgi692w4lvq5cp8hkl6rc375bh0ib51gsyvi6cfnf";
+      url = mirror://xorg/X11R7.7/src/everything/libXScrnSaver-1.2.2.tar.bz2;
+      sha256 = "07ff4r20nkkrj7h08f9fwamds9b3imj8jz5iz6y38zqw6jkyzwcg";
     };
     buildInputs = [pkgconfig scrnsaverproto libX11 libXext xextproto ];
   })) // {inherit scrnsaverproto libX11 libXext xextproto ;};
     
   libXau = (stdenvMulti.mkDerivation ((if overrides ? libXau then overrides.libXau else x: x) {
-    name = "libXau-1.0.6";
+    name = "libXau-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXau-1.0.6.tar.bz2;
-      sha256 = "1z3h07wj2kg2hnzj4gd9pc3rkj4n0mfw6f9skg9w1hfwzrgl317f";
+      url = mirror://xorg/X11R7.7/src/everything/libXau-1.0.7.tar.bz2;
+      sha256 = "12d4f7sdv2pjxhk0lcay0pahccddszkw579dc59daqi37r8bllvi";
     };
     outputs = [ "dev" "out" "man" ];
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   libXaw = (stdenv.mkDerivation ((if overrides ? libXaw then overrides.libXaw else x: x) {
-    name = "libXaw-1.0.9";
+    name = "libXaw-1.0.11";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/libXaw-1.0.9.tar.bz2;
-      sha256 = "0dxh5ldcmzl6afq0a9172ryah1341g0zysm8vk2lmqkqdda7ffd8";
+      url = mirror://xorg/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2;
+      sha256 = "14ll7ndf5njc30hz2w197qvwp7fqj7y14wq4p1cyxlbipfn79a47";
     };
     buildInputs = [pkgconfig libX11 libXext xextproto libXmu libXpm xproto libXt ];
   })) // {inherit libX11 libXext xextproto libXmu libXpm xproto libXt ;};
@@ -623,7 +623,7 @@ let
     name = "libXcomposite-0.4.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXcomposite-0.4.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/libXcomposite-0.4.3.tar.bz2;
       sha256 = "1b8sniijb85v4my6v30ma9yqnwl4hkclci9l1hqxnipfyhl4sa9j";
     };
     outputs = [ "dev" "out" "man" ];
@@ -631,11 +631,11 @@ let
   })) // {inherit compositeproto libX11 libXfixes xproto ;};
     
   libXcursor = (stdenv.mkDerivation ((if overrides ? libXcursor then overrides.libXcursor else x: x) {
-    name = "libXcursor-1.1.11";
+    name = "libXcursor-1.1.13";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXcursor-1.1.11.tar.bz2;
-      sha256 = "1zpn5dx66l5ql9qv0yz41qlbap4imkkvi0p6j2a6zh72g52zfvm0";
+      url = mirror://xorg/X11R7.7/src/everything/libXcursor-1.1.13.tar.bz2;
+      sha256 = "13xd1dyb06gwdwb0bxb22fkgdlmis6wrljm2xk6fhz0v9bg2g27p";
     };
     buildInputs = [pkgconfig fixesproto libX11 libXfixes xproto libXrender ];
   })) // {inherit fixesproto libX11 libXfixes xproto libXrender ;};
@@ -644,94 +644,94 @@ let
     name = "libXdamage-1.1.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXdamage-1.1.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/libXdamage-1.1.3.tar.bz2;
       sha256 = "1a678bwap74sqczbr2z4y4fvbr35km3inkm8bi1igjyk4v46jqdw";
     };
     buildInputs = [pkgconfig damageproto fixesproto libX11 xextproto libXfixes xproto ];
   })) // {inherit damageproto fixesproto libX11 xextproto libXfixes xproto ;};
     
   libXdmcp = (stdenvMulti.mkDerivation ((if overrides ? libXdmcp then overrides.libXdmcp else x: x) {
-    name = "libXdmcp-1.1.0";
+    name = "libXdmcp-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXdmcp-1.1.0.tar.bz2;
-      sha256 = "0wh0q4ih9p3nsxsjjj9a3d03nhiyjggpl7gbavdzsfia36iyk85q";
+      url = mirror://xorg/X11R7.7/src/everything/libXdmcp-1.1.1.tar.bz2;
+      sha256 = "13highx4xpgkiwykpcl7z2laslrjc4pzi4h617ny9p7r6116vkls";
     };
     outputs = [ "dev" "out" "doc" ];
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   libXext = (stdenvMulti.mkDerivation ((if overrides ? libXext then overrides.libXext else x: x) {
-    name = "libXext-1.2.0";
+    name = "libXext-1.3.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXext-1.2.0.tar.bz2;
-      sha256 = "1xvgvrbg9lc812zi44hsyr461hiiwy05alckq847ki213qhkxvaa";
+      url = mirror://xorg/X11R7.7/src/everything/libXext-1.3.1.tar.bz2;
+      sha256 = "0ng8clhn7srbkadxjc7ih3z3v27v9ny0aa0dqkgddgxpgrhrq8jn";
     };
     outputs = [ "dev" "out" "man" "doc" ];
     buildInputs = [pkgconfig libX11 xextproto xproto ];
   })) // {inherit libX11 xextproto xproto ;};
     
   libXfixes = (stdenvMulti.mkDerivation ((if overrides ? libXfixes then overrides.libXfixes else x: x) {
-    name = "libXfixes-4.0.5";
+    name = "libXfixes-5.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXfixes-4.0.5.tar.bz2;
-      sha256 = "0x4drdxrslxf4vgcfyba0f0fbxg98c8x5dfrl7azakhf8qhd0v1f";
+      url = mirror://xorg/X11R7.7/src/everything/libXfixes-5.0.tar.bz2;
+      sha256 = "1qx2rmwhmca2n7rgafy0arp15k5vwhdhhh6v6mx76hlj29328yjk";
     };
     outputs = [ "dev" "out" "man" ];
     buildInputs = [pkgconfig fixesproto libX11 xextproto xproto ];
   })) // {inherit fixesproto libX11 xextproto xproto ;};
     
   libXfont = (stdenv.mkDerivation ((if overrides ? libXfont then overrides.libXfont else x: x) {
-    name = "libXfont-1.4.3";
+    name = "libXfont-1.4.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXfont-1.4.3.tar.bz2;
-      sha256 = "1k79f8vcibd114ydndvna8axx39bsdaj351f16901lh155jlb4pp";
+      url = mirror://xorg/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2;
+      sha256 = "0w3irg00k6b6mziddnacln9q2rkf5848b04nvjqwv5bb1fw6zydv";
     };
     buildInputs = [pkgconfig libfontenc fontsproto freetype xproto xtrans zlib ];
   })) // {inherit libfontenc fontsproto freetype xproto xtrans zlib ;};
     
   libXft = (stdenvMulti.mkDerivation ((if overrides ? libXft then overrides.libXft else x: x) {
-    name = "libXft-2.2.0";
+    name = "libXft-2.3.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXft-2.2.0.tar.bz2;
-      sha256 = "1cprbz7xnxkb7axblw8sdaw9ibkngmz60d0ypk1drhd0dpjmls68";
+      url = mirror://xorg/X11R7.7/src/everything/libXft-2.3.1.tar.bz2;
+      sha256 = "1gdv6559cdz1lfw73x7wsvax1fkvphmayrymprljhyyb5nwk5kkz";
     };
     outputs = [ "dev" "out" "man" ];
-    buildInputs = [pkgconfig fontconfig freetype xproto libXrender ];
-  })) // {inherit fontconfig freetype xproto libXrender ;};
+    buildInputs = [pkgconfig fontconfig freetype libX11 xproto libXrender ];
+  })) // {inherit fontconfig freetype libX11 xproto libXrender ;};
     
   libXi = (stdenvMulti.mkDerivation ((if overrides ? libXi then overrides.libXi else x: x) {
-    name = "libXi-1.4.1";
+    name = "libXi-1.6.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/libXi-1.4.1.tar.bz2;
-      sha256 = "19i92if8anv5pg2mwyy93jcllk1mgxx5gchi8zkjlk7r604ir7sr";
+      url = mirror://xorg/X11R7.7/src/everything/libXi-1.6.1.tar.bz2;
+      sha256 = "029ihw4jq8mng8rx7a3jdvq64jm1zdkqidca93zmxv4jf9yn5qzj";
     };
     outputs = [ "dev" "out" "man" "doc" ];
     buildInputs = [pkgconfig inputproto libX11 libXext xextproto xproto ];
   })) // {inherit inputproto libX11 libXext xextproto xproto ;};
     
   libXinerama = (stdenvMulti.mkDerivation ((if overrides ? libXinerama then overrides.libXinerama else x: x) {
-    name = "libXinerama-1.1.1";
+    name = "libXinerama-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXinerama-1.1.1.tar.bz2;
-      sha256 = "17vpsscracg1hza0avrczm9fc7xx3229qhicy101mw6cx2hb9qmv";
+      url = mirror://xorg/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2;
+      sha256 = "1b3aq1762hxzchd9ndavdjlksq93991s0g2z6spf8wl3v0pprrx4";
     };
     outputs = [ "dev" "out" "man" ];
     buildInputs = [pkgconfig libX11 libXext xextproto xineramaproto ];
   })) // {inherit libX11 libXext xextproto xineramaproto ;};
     
   libXmu = (stdenv.mkDerivation ((if overrides ? libXmu then overrides.libXmu else x: x) {
-    name = "libXmu-1.1.0";
+    name = "libXmu-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXmu-1.1.0.tar.bz2;
-      sha256 = "1b9nkml1mk8yi76bv23cikbfrd7hlp48h710yqgcrpkh7cq1za8g";
+      url = mirror://xorg/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2;
+      sha256 = "1pbym8rrznxqd60zwf7w4xpf27sa72bky2knginqcfnca32q343h";
     };
     buildInputs = [pkgconfig libX11 libXext xextproto xproto libXt ];
   })) // {inherit libX11 libXext xextproto xproto libXt ;};
@@ -747,93 +747,93 @@ let
   })) // {inherit printproto libX11 libXau libXext xextproto ;};
     
   libXpm = (stdenv.mkDerivation ((if overrides ? libXpm then overrides.libXpm else x: x) {
-    name = "libXpm-3.5.9";
+    name = "libXpm-3.5.10";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXpm-3.5.9.tar.bz2;
-      sha256 = "07k2zpiadck1p986pgksfm5zfdm6h5vjy6p0hv59h1dbkh103pca";
+      url = mirror://xorg/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2;
+      sha256 = "0dd737ch4q9gr151wff1m3q2j7wf3pip4y81601xdrsh8wipxnx6";
     };
     buildInputs = [pkgconfig libX11 libXext xextproto xproto libXt ];
   })) // {inherit libX11 libXext xextproto xproto libXt ;};
     
   libXrandr = (stdenvMulti.mkDerivation ((if overrides ? libXrandr then overrides.libXrandr else x: x) {
-    name = "libXrandr-1.3.1";
+    name = "libXrandr-1.4.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXrandr-1.3.1.tar.bz2;
-      sha256 = "0qf6aywqk2mgd5hw0nr24xxp5k015aa11sax5yycn14wch4agfv2";
+      url = mirror://xorg/individual/lib/libXrandr-1.4.0.tar.bz2;
+      sha256 = "1hzm2ndra4nf8xxzm4lzd225zj05hzbzcq464q2znah15ynd0fh3";
     };
     outputs = [ "dev" "out" "man" ];
     buildInputs = [pkgconfig randrproto renderproto libX11 libXext xextproto xproto libXrender ];
   })) // {inherit randrproto renderproto libX11 libXext xextproto xproto libXrender ;};
     
   libXrender = (stdenvMulti.mkDerivation ((if overrides ? libXrender then overrides.libXrender else x: x) {
-    name = "libXrender-0.9.6";
+    name = "libXrender-0.9.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXrender-0.9.6.tar.bz2;
-      sha256 = "0s567qgys8m6782lbrpvpscm8fkk2jm2717g7s3hm7hhcgib2n3z";
+      url = mirror://xorg/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2;
+      sha256 = "1rmvja2gkf5v0k2n1bcghw8v98m2kfn3af0rbmsda5dwr69npd7r";
     };
     outputs = [ "dev" "out" "doc" ];
     buildInputs = [pkgconfig renderproto libX11 xproto ];
   })) // {inherit renderproto libX11 xproto ;};
     
   libXres = (stdenv.mkDerivation ((if overrides ? libXres then overrides.libXres else x: x) {
-    name = "libXres-1.0.5";
+    name = "libXres-1.0.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXres-1.0.5.tar.bz2;
-      sha256 = "0nd032jn3im6ar71xm1wgcmb4pa76c73nl8lavdkih609d30y2x0";
+      url = mirror://xorg/X11R7.7/src/everything/libXres-1.0.6.tar.bz2;
+      sha256 = "1478pm70gdi6l70r4jpkyyg2am9wv6xh53z9ibwq5cg84p4n31pz";
     };
     buildInputs = [pkgconfig resourceproto libX11 libXext xextproto xproto ];
   })) // {inherit resourceproto libX11 libXext xextproto xproto ;};
     
   libXt = (stdenv.mkDerivation ((if overrides ? libXt then overrides.libXt else x: x) {
-    name = "libXt-1.0.9";
+    name = "libXt-1.1.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXt-1.0.9.tar.bz2;
-      sha256 = "00bbms32fkzrxhdm9kybb2404ad6f3d6v4qgl83py7w09dcipfga";
+      url = mirror://xorg/X11R7.7/src/everything/libXt-1.1.3.tar.bz2;
+      sha256 = "1g85gwnhs7lg5f01gfi1cpb916xc3spm1fjlv2f4xz2zzk1r7dcd";
     };
     buildInputs = [pkgconfig libICE kbproto libSM libX11 xproto ];
   })) // {inherit libICE kbproto libSM libX11 xproto ;};
     
   libXtst = (stdenv.mkDerivation ((if overrides ? libXtst then overrides.libXtst else x: x) {
-    name = "libXtst-1.2.0";
+    name = "libXtst-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXtst-1.2.0.tar.bz2;
-      sha256 = "022lx3c57pkkw11j2k5s1f5idf53li5qg291766bvxi1nl90jbks";
+      url = mirror://xorg/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2;
+      sha256 = "1q750hjplq1rfyxkr4545z1y2a1wfnc828ynvbws7b4jwdk3xsky";
     };
     buildInputs = [pkgconfig inputproto recordproto libX11 libXext xextproto libXi ];
   })) // {inherit inputproto recordproto libX11 libXext xextproto libXi ;};
     
   libXv = (stdenv.mkDerivation ((if overrides ? libXv then overrides.libXv else x: x) {
-    name = "libXv-1.0.6";
+    name = "libXv-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXv-1.0.6.tar.bz2;
-      sha256 = "1vpmr9wnbz990ivarsp5rcmdg483fd2nk695plzlzx5h9dcqw3z2";
+      url = mirror://xorg/X11R7.7/src/everything/libXv-1.0.7.tar.bz2;
+      sha256 = "044hllz013afhzywwpxz007l4zjy99bv9im065rqd30zckmllrjx";
     };
     buildInputs = [pkgconfig videoproto libX11 libXext xextproto xproto ];
   })) // {inherit videoproto libX11 libXext xextproto xproto ;};
     
   libXvMC = (stdenv.mkDerivation ((if overrides ? libXvMC then overrides.libXvMC else x: x) {
-    name = "libXvMC-1.0.6";
+    name = "libXvMC-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXvMC-1.0.6.tar.bz2;
-      sha256 = "14ik1kgpnds213dsa16i8cf5qg3hc7vccy9jz4a4ml8zqzlq1nix";
+      url = mirror://xorg/X11R7.7/src/everything/libXvMC-1.0.7.tar.bz2;
+      sha256 = "18yf6ysc01pqkbk9704914ghalq1sl2hfdjmwggxm8qqhpy8bw18";
     };
     buildInputs = [pkgconfig videoproto libX11 libXext xextproto xproto libXv ];
   })) // {inherit videoproto libX11 libXext xextproto xproto libXv ;};
     
   libXxf86dga = (stdenv.mkDerivation ((if overrides ? libXxf86dga then overrides.libXxf86dga else x: x) {
-    name = "libXxf86dga-1.1.2";
+    name = "libXxf86dga-1.1.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXxf86dga-1.1.2.tar.bz2;
-      sha256 = "01jsc0jg7mjngfbh3j942595pwbyxf2m9kljy3zb6gyfcbsm59hv";
+      url = mirror://xorg/X11R7.7/src/everything/libXxf86dga-1.1.3.tar.bz2;
+      sha256 = "15291ddhyr54sribwbg8hxx2psgzm5gh0pgkw5yrf3zgvdsa67sm";
     };
     buildInputs = [pkgconfig libX11 libXext xextproto xf86dgaproto xproto ];
   })) // {inherit libX11 libXext xextproto xf86dgaproto xproto ;};
@@ -849,41 +849,41 @@ let
   })) // {inherit libX11 libXext xextproto xf86miscproto xproto ;};
     
   libXxf86vm = (stdenv.mkDerivation ((if overrides ? libXxf86vm then overrides.libXxf86vm else x: x) {
-    name = "libXxf86vm-1.1.1";
+    name = "libXxf86vm-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libXxf86vm-1.1.1.tar.bz2;
-      sha256 = "17i342h7a2nqfz4lpk8cay0vc0h4i7nxdc6xli9r7mggk8iykji1";
+      url = mirror://xorg/X11R7.7/src/everything/libXxf86vm-1.1.2.tar.bz2;
+      sha256 = "117w92xz39rcqcahspi48nc04cc9110x1dycpf3vbcb6p0pifr55";
     };
     buildInputs = [pkgconfig libX11 libXext xextproto xf86vidmodeproto xproto ];
   })) // {inherit libX11 libXext xextproto xf86vidmodeproto xproto ;};
     
   libdmx = (stdenv.mkDerivation ((if overrides ? libdmx then overrides.libdmx else x: x) {
-    name = "libdmx-1.1.1";
+    name = "libdmx-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libdmx-1.1.1.tar.bz2;
-      sha256 = "066yndshwq2nzkd0z0w96wq37rnhb23s6vq50bg4kiqb8y3nxpm6";
+      url = mirror://xorg/X11R7.7/src/everything/libdmx-1.1.2.tar.bz2;
+      sha256 = "1fiq73sfxcbyjval118ialwrzxhzb08xsxmg69adcs47i9j0p1x7";
     };
     buildInputs = [pkgconfig dmxproto libX11 libXext xextproto ];
   })) // {inherit dmxproto libX11 libXext xextproto ;};
     
   libfontenc = (stdenv.mkDerivation ((if overrides ? libfontenc then overrides.libfontenc else x: x) {
-    name = "libfontenc-1.1.0";
+    name = "libfontenc-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libfontenc-1.1.0.tar.bz2;
-      sha256 = "1gww1cbi17q15lh2ws6qzspp807issbyk5wlzjmgw6pn880ip2il";
+      url = mirror://xorg/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2;
+      sha256 = "0zq1483xy31sssq0h3xxf8y1v4q14cp8rv164ayn7fsn30pq2wny";
     };
     buildInputs = [pkgconfig xproto zlib ];
   })) // {inherit xproto zlib ;};
     
   libpciaccess = (stdenv.mkDerivation ((if overrides ? libpciaccess then overrides.libpciaccess else x: x) {
-    name = "libpciaccess-0.12.1";
+    name = "libpciaccess-0.13.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/libpciaccess-0.12.1.tar.bz2;
-      sha256 = "0i3kdmvl1mcjrkhklpli45sqsy4pvipm6swifbcyxx4cwkqdfiyc";
+      url = mirror://xorg/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2;
+      sha256 = "11509lkgd5j4g5wy0g13z4sf31h50hqx3jfwb2i4q6k98pv6iar7";
     };
     buildInputs = [pkgconfig zlib ];
   })) // {inherit zlib ;};
@@ -892,92 +892,92 @@ let
     name = "libpthread-stubs-0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libpthread-stubs-0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/libpthread-stubs-0.3.tar.bz2;
       sha256 = "16bjv3in19l84hbri41iayvvg4ls9gv1ma0x0qlbmwy67i7dbdim";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   libxcb = (stdenvMulti.mkDerivation ((if overrides ? libxcb then overrides.libxcb else x: x) {
-    name = "libxcb-1.7";
+    name = "libxcb-1.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libxcb-1.7.tar.bz2;
-      sha256 = "1pr40wa3i1f0iwx83c8alcycy9sfzd2y1qlc63kr8q56w8sxqxp7";
+      url = mirror://xorg/individual/xcb/libxcb-1.9.tar.bz2;
+      sha256 = "15icn78x610dvvgnji6b3pyn8nd88lz68hq0w73pcadf78mycmw8";
     };
     outputs = [ "dev" "out" "doc" ];
     buildInputs = [pkgconfig libxslt libpthreadstubs python libXau xcbproto libXdmcp ];
   })) // {inherit libxslt libpthreadstubs python libXau xcbproto libXdmcp ;};
     
   libxkbfile = (stdenv.mkDerivation ((if overrides ? libxkbfile then overrides.libxkbfile else x: x) {
-    name = "libxkbfile-1.0.7";
+    name = "libxkbfile-1.0.8";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/libxkbfile-1.0.7.tar.bz2;
-      sha256 = "1r9a1xnn57431hfp1am2r5h23pa1zh646482li3vd5ivfc53fzk6";
+      url = mirror://xorg/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2;
+      sha256 = "0flg5arw6n3njagmsi4i4l0zl5bfx866a1h9ydc3bi1pqlclxaca";
     };
     buildInputs = [pkgconfig kbproto libX11 ];
   })) // {inherit kbproto libX11 ;};
     
   lndir = (stdenv.mkDerivation ((if overrides ? lndir then overrides.lndir else x: x) {
-    name = "lndir-1.0.2";
+    name = "lndir-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/util/lndir-1.0.2.tar.bz2;
-      sha256 = "1d988z0ywy2k53s7i43ff0j5qac1cpy9j0gjwmiprq66w8rh24z5";
+      url = mirror://xorg/individual/util/lndir-1.0.3.tar.bz2;
+      sha256 = "0pdngiy8zdhsiqx2am75yfcl36l7kd7d7nl0rss8shcdvsqgmx29";
     };
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   luit = (stdenv.mkDerivation ((if overrides ? luit then overrides.luit else x: x) {
-    name = "luit-1.1.0";
+    name = "luit-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/luit-1.1.0.tar.bz2;
-      sha256 = "1l83b5yknh4svqzwsppvmm2q9l0mvsfwm16ik7q3yss8m5zgvypi";
+      url = mirror://xorg/X11R7.7/src/everything/luit-1.1.1.tar.bz2;
+      sha256 = "0dn694mk56x6hdk6y9ylx4f128h5jcin278gnw2gb807rf3ygc1h";
     };
-    buildInputs = [pkgconfig libfontenc zlib ];
-  })) // {inherit libfontenc zlib ;};
+    buildInputs = [pkgconfig libfontenc ];
+  })) // {inherit libfontenc ;};
     
   makedepend = (stdenv.mkDerivation ((if overrides ? makedepend then overrides.makedepend else x: x) {
-    name = "makedepend-1.0.3";
+    name = "makedepend-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/makedepend-1.0.3.tar.bz2;
-      sha256 = "0dxpz376bvphjg8q0nqrcf4y0dbni0c6jj5y16qymr37wlq1s99s";
+      url = mirror://xorg/X11R7.7/src/everything/makedepend-1.0.4.tar.bz2;
+      sha256 = "1zpp2b9dfvlnfj2i1mzdyn785rpl7vih5lap7kcpiv80xspbhmmb";
     };
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   mkfontdir = (stdenv.mkDerivation ((if overrides ? mkfontdir then overrides.mkfontdir else x: x) {
-    name = "mkfontdir-1.0.6";
+    name = "mkfontdir-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/mkfontdir-1.0.6.tar.bz2;
-      sha256 = "0nf8p0zsndd9qmrw70h2wdq7sz6j066q73lpp262dlpq21inrmam";
+      url = mirror://xorg/X11R7.7/src/everything/mkfontdir-1.0.7.tar.bz2;
+      sha256 = "0c3563kw9fg15dpgx4dwvl12qz6sdqdns1pxa574hc7i5m42mman";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   mkfontscale = (stdenv.mkDerivation ((if overrides ? mkfontscale then overrides.mkfontscale else x: x) {
-    name = "mkfontscale-1.0.8";
+    name = "mkfontscale-1.1.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/mkfontscale-1.0.8.tar.bz2;
-      sha256 = "1yah41gr5hlihbjm5l1kykdqj1p5rx6y4vrqraxbzvkrrn37gdbf";
+      url = mirror://xorg/X11R7.7/src/everything/mkfontscale-1.1.0.tar.bz2;
+      sha256 = "1539h3ws66vcql6sf2831bcs0r4d9b05lcgpswkw33lvcxighmff";
     };
     buildInputs = [pkgconfig libfontenc freetype xproto zlib ];
   })) // {inherit libfontenc freetype xproto zlib ;};
     
   pixman = (stdenv.mkDerivation ((if overrides ? pixman then overrides.pixman else x: x) {
-    name = "pixman-0.20.2";
+    name = "pixman-0.26.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/pixman-0.20.2.tar.bz2;
-      sha256 = "1agl6f63y2wiqr6n9slzhisnilcg8byafp2l8wmw713bk8k6yc9h";
+      url = mirror://xorg/individual/lib/pixman-0.26.2.tar.bz2;
+      sha256 = "0z34jb75wpbyj3gxn34icd8j81fk5d6s6qnwp2ncz7m8icf6afqr";
     };
-    buildInputs = [pkgconfig perl ];
-  })) // {inherit perl ;};
+    buildInputs = [pkgconfig libpng perl ];
+  })) // {inherit libpng perl ;};
     
   printproto = (stdenv.mkDerivation ((if overrides ? printproto then overrides.printproto else x: x) {
     name = "printproto-1.0.5";
@@ -990,21 +990,21 @@ let
   })) // {inherit libXau ;};
     
   randrproto = (stdenv.mkDerivation ((if overrides ? randrproto then overrides.randrproto else x: x) {
-    name = "randrproto-1.3.2";
+    name = "randrproto-1.4.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/randrproto-1.3.2.tar.bz2;
-      sha256 = "0wfwcq85wbm0g5r0snc7prgki1wi3kxrxhcxinyr54n45ihh03fr";
+      url = mirror://xorg/individual/proto/randrproto-1.4.0.tar.bz2;
+      sha256 = "1kq9h93qdnniiivry8jmhlgwn9fbx9xp5r9cmzfihlx5cs62xi45";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   recordproto = (stdenv.mkDerivation ((if overrides ? recordproto then overrides.recordproto else x: x) {
-    name = "recordproto-1.14.1";
+    name = "recordproto-1.14.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/recordproto-1.14.1.tar.bz2;
-      sha256 = "1389fc3r8h8xqix11y9ngw7a13i1mvw68jkhicgvq676sd1v0zmj";
+      url = mirror://xorg/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2;
+      sha256 = "0w3kgr1zabwf79bpc28dcnj0fpni6r53rpi82ngjbalj5s6m8xx7";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -1013,78 +1013,78 @@ let
     name = "renderproto-0.11.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/renderproto-0.11.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2;
       sha256 = "0dr5xw6s0qmqg0q5pdkb4jkdhaja0vbfqla79qh5j1xjj9dmlwq6";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   resourceproto = (stdenv.mkDerivation ((if overrides ? resourceproto then overrides.resourceproto else x: x) {
-    name = "resourceproto-1.1.1";
+    name = "resourceproto-1.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/resourceproto-1.1.1.tar.bz2;
-      sha256 = "1imqlkvn4mfjsflwvqx8dj0n7i7frdpzkdafq001r25ak6782yc5";
+      url = mirror://xorg/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2;
+      sha256 = "0638iyfiiyjw1hg3139pai0j6m65gkskrvd9684zgc6ydcx00riw";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   scrnsaverproto = (stdenv.mkDerivation ((if overrides ? scrnsaverproto then overrides.scrnsaverproto else x: x) {
-    name = "scrnsaverproto-1.2.1";
+    name = "scrnsaverproto-1.2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/scrnsaverproto-1.2.1.tar.bz2;
-      sha256 = "1w94c1an7cy9v68289xbqszaj6g5qx5a29qx67fwsvqkmhygglps";
+      url = mirror://xorg/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2;
+      sha256 = "0rfdbfwd35d761xkfifcscx56q0n56043ixlmv70r4v4l66hmdwb";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   sessreg = (stdenv.mkDerivation ((if overrides ? sessreg then overrides.sessreg else x: x) {
-    name = "sessreg-1.0.6";
+    name = "sessreg-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/sessreg-1.0.6.tar.bz2;
-      sha256 = "143ivrs2pbkid4wr1hri9221z4gi9dlkq7x60jarcz9bhiq1dwvk";
+      url = mirror://xorg/X11R7.7/src/everything/sessreg-1.0.7.tar.bz2;
+      sha256 = "0lifgjxdvc6lwyjk90slddnr12fsv88ldy6qhklr5av409cfwd47";
     };
     buildInputs = [pkgconfig xproto ];
   })) // {inherit xproto ;};
     
   setxkbmap = (stdenv.mkDerivation ((if overrides ? setxkbmap then overrides.setxkbmap else x: x) {
-    name = "setxkbmap-1.2.0";
+    name = "setxkbmap-1.3.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/setxkbmap-1.2.0.tar.bz2;
-      sha256 = "0fdfvc0fqdp11ly5iywrsi4w7rln4dq02b0b91yjmjm83fzr35cr";
+      url = mirror://xorg/X11R7.7/src/everything/setxkbmap-1.3.0.tar.bz2;
+      sha256 = "1inygpvlgc6vr5h9laxw9lnvafnccl3fy0g5n9ll28iq3yfmqc1x";
     };
     buildInputs = [pkgconfig libX11 libxkbfile ];
   })) // {inherit libX11 libxkbfile ;};
     
   smproxy = (stdenv.mkDerivation ((if overrides ? smproxy then overrides.smproxy else x: x) {
-    name = "smproxy-1.0.4";
+    name = "smproxy-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/smproxy-1.0.4.tar.bz2;
-      sha256 = "0wj4z4ars9j4k5pysl42jpx4zclrz3ifwgqxrcdlmb3l5xvyb4ip";
+      url = mirror://xorg/X11R7.7/src/everything/smproxy-1.0.5.tar.bz2;
+      sha256 = "02fn5wa1gs2jap6sr9j9yk6zsvz82j8l61pf74iyqwa99q4wnb67";
     };
-    buildInputs = [pkgconfig libSM libXmu libXt ];
-  })) // {inherit libSM libXmu libXt ;};
+    buildInputs = [pkgconfig libICE libSM libXmu libXt ];
+  })) // {inherit libICE libSM libXmu libXt ;};
     
   twm = (stdenv.mkDerivation ((if overrides ? twm then overrides.twm else x: x) {
-    name = "twm-1.0.6";
+    name = "twm-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/twm-1.0.6.tar.bz2;
-      sha256 = "1scly9kv3kx8zh8bfljsdd32dsb4j05xzn8c5x270xcshzbwmp77";
+      url = mirror://xorg/individual/app/twm-1.0.7.tar.bz2;
+      sha256 = "0i6dbf5vafi5hm4bcmnj6r412cncjlv9hkkbr6bzlh15qvg56p8g";
     };
-    buildInputs = [pkgconfig libICE libSM libX11 libXext libXmu libXt ];
-  })) // {inherit libICE libSM libX11 libXext libXmu libXt ;};
+    buildInputs = [pkgconfig libICE libSM libX11 libXext libXmu xproto libXt ];
+  })) // {inherit libICE libSM libX11 libXext libXmu xproto libXt ;};
     
   utilmacros = (stdenv.mkDerivation ((if overrides ? utilmacros then overrides.utilmacros else x: x) {
-    name = "util-macros-1.11.0";
+    name = "util-macros-1.17";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/util-macros-1.11.0.tar.bz2;
-      sha256 = "1kya7z5rad93zmc0ij7jhl3shh1k37szmjg1rv75lizqlib4slz8";
+      url = mirror://xorg/X11R7.7/src/everything/util-macros-1.17.tar.bz2;
+      sha256 = "1vbmrcn5n3wp4pyw0n4c3pyvzlc4yf7jzgngavfdq5zwfbgfsybx";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -1093,7 +1093,7 @@ let
     name = "videoproto-2.3.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/videoproto-2.3.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2;
       sha256 = "0nk3i6gwkqq1w8zwn7bxz344pi1dwcjrmf6hr330h7hxjcj6viry";
     };
     buildInputs = [pkgconfig ];
@@ -1103,88 +1103,88 @@ let
     name = "windowswmproto-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/windowswmproto-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/windowswmproto-1.0.4.tar.bz2;
       sha256 = "0syjxgy4m8l94qrm03nvn5k6bkxc8knnlld1gbllym97nvnv0ny0";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   x11perf = (stdenv.mkDerivation ((if overrides ? x11perf then overrides.x11perf else x: x) {
-    name = "x11perf-1.5.3";
+    name = "x11perf-1.5.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/x11perf-1.5.3.tar.bz2;
-      sha256 = "1g91ksfrvj59hvxvfj1xb730aqscg5wdnc3grrab1wz7mxap6k9r";
+      url = mirror://xorg/X11R7.7/src/everything/x11perf-1.5.4.tar.bz2;
+      sha256 = "111iwpxhnxjiq44w96zf0kszg5zpgv1g3ayx18v4nhdzl9bqivi4";
     };
     buildInputs = [pkgconfig libX11 libXext libXft libXmu libXrender ];
   })) // {inherit libX11 libXext libXft libXmu libXrender ;};
     
   xauth = (stdenv.mkDerivation ((if overrides ? xauth then overrides.xauth else x: x) {
-    name = "xauth-1.0.5";
+    name = "xauth-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xauth-1.0.5.tar.bz2;
-      sha256 = "0v3lmm3qil8shgm7731pl0wd32kpq7w73w5d4mjq1bqxzw09a4vd";
+      url = mirror://xorg/X11R7.7/src/everything/xauth-1.0.7.tar.bz2;
+      sha256 = "1382wdfiakgckbw1xxavzh1nm34q21b1zzy96qp7ws66xc48rxw4";
     };
     buildInputs = [pkgconfig libX11 libXau libXext libXmu ];
   })) // {inherit libX11 libXau libXext libXmu ;};
     
   xbacklight = (stdenv.mkDerivation ((if overrides ? xbacklight then overrides.xbacklight else x: x) {
-    name = "xbacklight-1.1.2";
+    name = "xbacklight-1.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xbacklight-1.1.2.tar.bz2;
-      sha256 = "02b5jfys2msla2yvg5s0knzyxg2104r25czkwd49i8g8kp804bxg";
+      url = mirror://xorg/individual/app/xbacklight-1.2.0.tar.bz2;
+      sha256 = "199n9qszjiz82nbjz6ychh0xl15igm535mv0830wk4m59w9xclji";
     };
-    buildInputs = [pkgconfig libX11 libXrandr ];
-  })) // {inherit libX11 libXrandr ;};
+    buildInputs = [pkgconfig libxcb xcbutil ];
+  })) // {inherit libxcb xcbutil ;};
     
   xbitmaps = (stdenv.mkDerivation ((if overrides ? xbitmaps then overrides.xbitmaps else x: x) {
     name = "xbitmaps-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xbitmaps-1.1.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xbitmaps-1.1.1.tar.bz2;
       sha256 = "178ym90kwidia6nas4qr5n5yqh698vv8r02js0r4vg3b6lsb0w9n";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xcbproto = (stdenv.mkDerivation ((if overrides ? xcbproto then overrides.xcbproto else x: x) {
-    name = "xcb-proto-1.6";
+    name = "xcb-proto-1.8";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xcb-proto-1.6.tar.bz2;
-      sha256 = "18jwkgd2ayvd0zzwawnbh86b4xqjq29mgsq44h06yj8jkcaw2azm";
+      url = mirror://xorg/individual/xcb/xcb-proto-1.8.tar.bz2;
+      sha256 = "1c11652h9sjynw3scm1pn5z3a6ci888pq7hij8q5n8qrl33icg93";
     };
     buildInputs = [pkgconfig python ];
   })) // {inherit python ;};
     
   xcbutil = (stdenv.mkDerivation ((if overrides ? xcbutil then overrides.xcbutil else x: x) {
-    name = "xcb-util-0.3.8";
+    name = "xcb-util-0.3.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xcb/xcb-util-0.3.8.tar.bz2;
-      sha256 = "1fa7njhg7dsqbrkwrzbkfszdp1dmggvlsrb05qshkg2h8wldkvn1";
+      url = mirror://xorg/individual/xcb/xcb-util-0.3.9.tar.bz2;
+      sha256 = "1i0qbhqkcdlbbsj7ifkyjsffl61whj24d3zlg5pxf3xj1af2a4f6";
     };
     buildInputs = [pkgconfig gperf m4 libxcb xproto ];
   })) // {inherit gperf m4 libxcb xproto ;};
     
   xcbutilimage = (stdenv.mkDerivation ((if overrides ? xcbutilimage then overrides.xcbutilimage else x: x) {
-    name = "xcb-util-image-0.3.8";
+    name = "xcb-util-image-0.3.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xcb/xcb-util-image-0.3.8.tar.bz2;
-      sha256 = "1nd67105lb8qfa7r2lli5sxnipi1p1wnbwa04l9k30kfq8l0afa0";
+      url = mirror://xorg/individual/xcb/xcb-util-image-0.3.9.tar.bz2;
+      sha256 = "1pr1l1nkg197gyl9d0fpwmn72jqpxjfgn9y13q4gawg1m873qnnk";
     };
     buildInputs = [pkgconfig gperf m4 libxcb xcbutil xproto ];
   })) // {inherit gperf m4 libxcb xcbutil xproto ;};
     
   xcbutilkeysyms = (stdenv.mkDerivation ((if overrides ? xcbutilkeysyms then overrides.xcbutilkeysyms else x: x) {
-    name = "xcb-util-keysyms-0.3.8";
+    name = "xcb-util-keysyms-0.3.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xcb/xcb-util-keysyms-0.3.8.tar.bz2;
-      sha256 = "08b1d19gaqv3agpkvh5mgcir11vjy89ywdknva0cb073mzvk4gci";
+      url = mirror://xorg/individual/xcb/xcb-util-keysyms-0.3.9.tar.bz2;
+      sha256 = "0vjwk7vrcfnlhiadv445c6skfxmdrg5v4qf81y8s2s5xagqarqbv";
     };
     buildInputs = [pkgconfig gperf m4 libxcb xproto ];
   })) // {inherit gperf m4 libxcb xproto ;};
@@ -1193,58 +1193,58 @@ let
     name = "xcb-util-renderutil-0.3.8";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xcb/xcb-util-renderutil-0.3.8.tar.bz2;
+      url = http://xcb.freedesktop.org/dist/xcb-util-renderutil-0.3.8.tar.bz2;
       sha256 = "0lkl9ij9b447c0br2qc5qsynjn09c4fdz7sd6yp7pyi8az2sb2cp";
     };
     buildInputs = [pkgconfig gperf m4 libxcb xproto ];
   })) // {inherit gperf m4 libxcb xproto ;};
     
   xcbutilwm = (stdenv.mkDerivation ((if overrides ? xcbutilwm then overrides.xcbutilwm else x: x) {
-    name = "xcb-util-wm-0.3.8";
+    name = "xcb-util-wm-0.3.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xcb/xcb-util-wm-0.3.8.tar.bz2;
-      sha256 = "01shwv13rfcxycrsla6c5xlrk1qska7kvvj10n7jcibx9jzanmy5";
+      url = mirror://xorg/individual/xcb/xcb-util-wm-0.3.9.tar.bz2;
+      sha256 = "0c30fj33gvwzwhyz1dhsfwni0ai16bxpvxb4l6c6s7vvj7drp3q3";
     };
     buildInputs = [pkgconfig gperf m4 libxcb xproto ];
   })) // {inherit gperf m4 libxcb xproto ;};
     
   xclock = (stdenv.mkDerivation ((if overrides ? xclock then overrides.xclock else x: x) {
-    name = "xclock-1.0.5";
+    name = "xclock-1.0.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xclock-1.0.5.tar.bz2;
-      sha256 = "16jcmsmhz503mqv7wz7daqqhm11phsws0g7fryzlz0gk4jg1daak";
+      url = mirror://xorg/individual/app/xclock-1.0.6.tar.bz2;
+      sha256 = "1l1zxr69p0734fnx9rdqw79ahr273hr050sm8xdc0n51n1bnzfr1";
     };
     buildInputs = [pkgconfig libX11 libXaw libXft libxkbfile libXmu libXrender libXt ];
   })) // {inherit libX11 libXaw libXft libxkbfile libXmu libXrender libXt ;};
     
   xcmiscproto = (stdenv.mkDerivation ((if overrides ? xcmiscproto then overrides.xcmiscproto else x: x) {
-    name = "xcmiscproto-1.2.1";
+    name = "xcmiscproto-1.2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xcmiscproto-1.2.1.tar.bz2;
-      sha256 = "05acy1axzkrq6z9xlbmz1kg66lbgfqzky8v4qfdl16gv5gi2f3kk";
+      url = mirror://xorg/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2;
+      sha256 = "1pyjv45wivnwap2wvsbrzdvjc5ql8bakkbkrvcv6q9bjjf33ccmi";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xcmsdb = (stdenv.mkDerivation ((if overrides ? xcmsdb then overrides.xcmsdb else x: x) {
-    name = "xcmsdb-1.0.3";
+    name = "xcmsdb-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xcmsdb-1.0.3.tar.bz2;
-      sha256 = "102s9lsghdp5n3bsg4chlkhrk0jh0kxvg2g0pyi1zmzfy5hd0dxj";
+      url = mirror://xorg/X11R7.7/src/everything/xcmsdb-1.0.4.tar.bz2;
+      sha256 = "03ms731l3kvaldq7ycbd30j6134b61i3gbll4b2gl022wyzbjq74";
     };
     buildInputs = [pkgconfig libX11 ];
   })) // {inherit libX11 ;};
     
   xcursorgen = (stdenv.mkDerivation ((if overrides ? xcursorgen then overrides.xcursorgen else x: x) {
-    name = "xcursorgen-1.0.4";
+    name = "xcursorgen-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xcursorgen-1.0.4.tar.bz2;
-      sha256 = "07azdw6w18hdgrd6z3nawrhn1m18nyp24cz54ih91vpz8hpxnany";
+      url = mirror://xorg/X11R7.7/src/everything/xcursorgen-1.0.5.tar.bz2;
+      sha256 = "10f5wk1326mm45gvgpf4m2p0j80fcd0i4c52zikahb91zah72wdw";
     };
     buildInputs = [pkgconfig libpng libX11 libXcursor ];
   })) // {inherit libpng libX11 libXcursor ;};
@@ -1253,58 +1253,58 @@ let
     name = "xcursor-themes-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xcursor-themes-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xcursor-themes-1.0.3.tar.bz2;
       sha256 = "1is4bak0qkkhv63mfa5l7492r475586y52yzfxyv3psppn662ilr";
     };
     buildInputs = [pkgconfig libXcursor ];
   })) // {inherit libXcursor ;};
     
   xdm = (stdenv.mkDerivation ((if overrides ? xdm then overrides.xdm else x: x) {
-    name = "xdm-1.1.10";
+    name = "xdm-1.1.11";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xdm-1.1.10.tar.bz2;
-      sha256 = "0zzrlkmppy6mma49db2x1il47rhjqkg9rs91ryl7xyv5iqbgg1ql";
+      url = mirror://xorg/individual/app/xdm-1.1.11.tar.bz2;
+      sha256 = "0iqw11977lpr9nk1is4fca84d531vck0mq7jldwl44m0vrnl5nnl";
     };
     buildInputs = [pkgconfig libX11 libXau libXaw libXdmcp libXext libXft libXinerama libXmu libXpm libXt ];
   })) // {inherit libX11 libXau libXaw libXdmcp libXext libXft libXinerama libXmu libXpm libXt ;};
     
   xdpyinfo = (stdenv.mkDerivation ((if overrides ? xdpyinfo then overrides.xdpyinfo else x: x) {
-    name = "xdpyinfo-1.2.0";
+    name = "xdpyinfo-1.3.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xdpyinfo-1.2.0.tar.bz2;
-      sha256 = "1kmmfawcjxgmp06jb3w7d0pxbrcxrrgfx3m1lbwj3gygir4ssnzy";
+      url = mirror://xorg/X11R7.7/src/everything/xdpyinfo-1.3.0.tar.bz2;
+      sha256 = "0gypsvpmay3lsh3b1dg29pjxv95pkrr21d4w6ys02mrbld24kvi3";
     };
-    buildInputs = [pkgconfig libdmx libX11 libXcomposite libXext libXi libXinerama libXrender libXtst libXxf86dga libXxf86misc libXxf86vm ];
-  })) // {inherit libdmx libX11 libXcomposite libXext libXi libXinerama libXrender libXtst libXxf86dga libXxf86misc libXxf86vm ;};
+    buildInputs = [pkgconfig libdmx libX11 libxcb libXcomposite libXext libXi libXinerama libXrender libXtst libXxf86dga libXxf86misc libXxf86vm ];
+  })) // {inherit libdmx libX11 libxcb libXcomposite libXext libXi libXinerama libXrender libXtst libXxf86dga libXxf86misc libXxf86vm ;};
     
   xdriinfo = (stdenv.mkDerivation ((if overrides ? xdriinfo then overrides.xdriinfo else x: x) {
     name = "xdriinfo-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xdriinfo-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xdriinfo-1.0.4.tar.bz2;
       sha256 = "076bjix941znyjmh3j5jjsnhp2gv2iq53d0ks29mvvv87cyy9iim";
     };
     buildInputs = [pkgconfig glproto libX11 ];
   })) // {inherit glproto libX11 ;};
     
   xev = (stdenv.mkDerivation ((if overrides ? xev then overrides.xev else x: x) {
-    name = "xev-1.1.0";
+    name = "xev-1.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xev-1.1.0.tar.bz2;
-      sha256 = "1ih1rxf2b6bpsggvbx4ibyx70bzgcyjl98l1894d0smjxmlc4n9q";
+      url = mirror://xorg/X11R7.7/src/everything/xev-1.2.0.tar.bz2;
+      sha256 = "13xk5z7vy87rnn4574z0jfzymdivyc7pl4axim81sx0pmdysg1ip";
     };
-    buildInputs = [pkgconfig libX11 ];
-  })) // {inherit libX11 ;};
+    buildInputs = [pkgconfig libX11 xproto libXrandr ];
+  })) // {inherit libX11 xproto libXrandr ;};
     
   xextproto = (stdenv.mkDerivation ((if overrides ? xextproto then overrides.xextproto else x: x) {
-    name = "xextproto-7.1.2";
+    name = "xextproto-7.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xextproto-7.1.2.tar.bz2;
-      sha256 = "16ci2mc9g85fsb7lgml349rbgf97v7l9688by71agv682bhjky7n";
+      url = mirror://xorg/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2;
+      sha256 = "06kdanbnprxvgl56l5h0lqj4b0f1fbb1ndha33mv5wvy802v2lvw";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -1323,7 +1323,7 @@ let
     name = "xf86bigfontproto-1.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86bigfontproto-1.2.0.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86bigfontproto-1.2.0.tar.bz2;
       sha256 = "0j0n7sj5xfjpmmgx6n5x556rw21hdd18fwmavp95wps7qki214ms";
     };
     buildInputs = [pkgconfig ];
@@ -1333,7 +1333,7 @@ let
     name = "xf86dgaproto-2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86dgaproto-2.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86dgaproto-2.1.tar.bz2;
       sha256 = "0l4hx48207mx0hp09026r6gy9nl3asbq0c75hri19wp1118zcpmc";
     };
     buildInputs = [pkgconfig ];
@@ -1343,98 +1343,78 @@ let
     name = "xf86driproto-2.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/proto/xf86driproto-2.1.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86driproto-2.1.1.tar.bz2;
       sha256 = "07v69m0g2dfzb653jni4x656jlr7l84c1k39j8qc8vfb45r8sjww";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
-  xf86inputacecad = (stdenv.mkDerivation ((if overrides ? xf86inputacecad then overrides.xf86inputacecad else x: x) {
-    name = "xf86-input-acecad-1.4.0";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-acecad-1.4.0.tar.bz2;
-      sha256 = "0mnmvffxwgcvsa208vffsqlai7lldjc46rdk6j0j4q00df5isd28";
-    };
-    buildInputs = [pkgconfig inputproto randrproto xorgserver xproto ];
-  })) // {inherit inputproto randrproto xorgserver xproto ;};
-    
-  xf86inputaiptek = (stdenv.mkDerivation ((if overrides ? xf86inputaiptek then overrides.xf86inputaiptek else x: x) {
-    name = "xf86-input-aiptek-1.3.1";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-aiptek-1.3.1.tar.bz2;
-      sha256 = "16pby473s65lfd2v60fwayzfhf1n6x696lrx720zwb2p22rlsna3";
-    };
-    buildInputs = [pkgconfig inputproto randrproto xorgserver xproto ];
-  })) // {inherit inputproto randrproto xorgserver xproto ;};
-    
   xf86inputevdev = (stdenv.mkDerivation ((if overrides ? xf86inputevdev then overrides.xf86inputevdev else x: x) {
-    name = "xf86-input-evdev-2.6.0";
+    name = "xf86-input-evdev-2.7.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-input-evdev-2.6.0.tar.bz2;
-      sha256 = "1b2kcxm7bc255ym56dpl1fw3km44f5ny3hwn65sa90w13acz7rxh";
+      url = mirror://xorg/individual/driver/xf86-input-evdev-2.7.3.tar.bz2;
+      sha256 = "01557w1kmsaqdsc42pxyypig10l5r5vh9axz9g22hg9cc09r8f7b";
     };
-    buildInputs = [pkgconfig inputproto xorgserver xproto ];
-  })) // {inherit inputproto xorgserver xproto ;};
+    buildInputs = [pkgconfig inputproto udev xorgserver xproto ];
+  })) // {inherit inputproto udev xorgserver xproto ;};
     
   xf86inputjoystick = (stdenv.mkDerivation ((if overrides ? xf86inputjoystick then overrides.xf86inputjoystick else x: x) {
-    name = "xf86-input-joystick-1.5.0";
+    name = "xf86-input-joystick-1.6.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-joystick-1.5.0.tar.bz2;
-      sha256 = "1ac2lap4npylyzg0pi0zy0n48wvicgz9kw0z9ih9ylk9sz2ii0bi";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-input-joystick-1.6.1.tar.bz2;
+      sha256 = "1xgpkdmfw4ahjlva97gs9sllzw8nlpa8mxj59g28fxhak67mvv8x";
     };
     buildInputs = [pkgconfig inputproto kbproto xorgserver xproto ];
   })) // {inherit inputproto kbproto xorgserver xproto ;};
     
   xf86inputkeyboard = (stdenv.mkDerivation ((if overrides ? xf86inputkeyboard then overrides.xf86inputkeyboard else x: x) {
-    name = "xf86-input-keyboard-1.5.0";
+    name = "xf86-input-keyboard-1.6.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-keyboard-1.5.0.tar.bz2;
-      sha256 = "1c4ww4yj23shqwhc52r512qsy5baf1sxsb7jj7pfnralj07520r3";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-input-keyboard-1.6.1.tar.bz2;
+      sha256 = "1hwc1bjw5mxv186xbrxiky0agfglwqg8fsxqdh4br1vzgxpck7ma";
     };
     buildInputs = [pkgconfig inputproto xorgserver xproto ];
   })) // {inherit inputproto xorgserver xproto ;};
     
   xf86inputmouse = (stdenv.mkDerivation ((if overrides ? xf86inputmouse then overrides.xf86inputmouse else x: x) {
-    name = "xf86-input-mouse-1.6.0";
+    name = "xf86-input-mouse-1.7.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-mouse-1.6.0.tar.bz2;
-      sha256 = "1nzvlbhvdyki3h1s4x2i3ps1immf3wfns6az2i3669v8a5g29bn7";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-input-mouse-1.7.2.tar.bz2;
+      sha256 = "0fs1lwnycyv3d0m6l2wrnlgvbs8qw66d93hwlnmrsswfq5bp6ark";
     };
     buildInputs = [pkgconfig inputproto xorgserver xproto ];
   })) // {inherit inputproto xorgserver xproto ;};
     
   xf86inputsynaptics = (stdenv.mkDerivation ((if overrides ? xf86inputsynaptics then overrides.xf86inputsynaptics else x: x) {
-    name = "xf86-input-synaptics-1.5.0";
+    name = "xf86-input-synaptics-1.6.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-input-synaptics-1.5.0.tar.bz2;
-      sha256 = "0khwda8lrrvrdb37i4i1kdhg8f44kgcjq9y209ds7ja9zjcm7k4m";
+      url = mirror://xorg/individual/driver/xf86-input-synaptics-1.6.2.tar.bz2;
+      sha256 = "082rlbyw63sashjbwd7dd0a0smp5n8yv9bihy19c706lhnhddxy3";
     };
     buildInputs = [pkgconfig inputproto randrproto recordproto libX11 libXi xorgserver xproto libXtst ];
   })) // {inherit inputproto randrproto recordproto libX11 libXi xorgserver xproto libXtst ;};
     
   xf86inputvmmouse = (stdenv.mkDerivation ((if overrides ? xf86inputvmmouse then overrides.xf86inputvmmouse else x: x) {
-    name = "xf86-input-vmmouse-12.6.10";
+    name = "xf86-input-vmmouse-12.9.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-vmmouse-12.6.10.tar.bz2;
-      sha256 = "0409lkwk1ws8vw4axxilwmcs8qxj8lq5dma2i2iz49q6hrd9sdm6";
+      url = mirror://xorg/individual/driver/xf86-input-vmmouse-12.9.0.tar.bz2;
+      sha256 = "1gwrna96f0p4gpjhin8yx01y5xvns2j15f7hw1jvqf7fpzv01kzv";
     };
     buildInputs = [pkgconfig inputproto randrproto xorgserver xproto ];
   })) // {inherit inputproto randrproto xorgserver xproto ;};
     
   xf86inputvoid = (stdenv.mkDerivation ((if overrides ? xf86inputvoid then overrides.xf86inputvoid else x: x) {
-    name = "xf86-input-void-1.3.1";
+    name = "xf86-input-void-1.4.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-input-void-1.3.1.tar.bz2;
-      sha256 = "0x662i756p0nqmfv76ppm28ir2sbvcm32r71ycd9bxc3mj29g9mb";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-input-void-1.4.0.tar.bz2;
+      sha256 = "01bmk324fq48wydvy1qrnxbw6qz0fjd0i80g0n4cqr1c4mjmif9a";
     };
     buildInputs = [pkgconfig xorgserver xproto ];
   })) // {inherit xorgserver xproto ;};
@@ -1449,145 +1429,115 @@ let
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
-  xf86videoapm = (stdenv.mkDerivation ((if overrides ? xf86videoapm then overrides.xf86videoapm else x: x) {
-    name = "xf86-video-apm-1.2.3";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-apm-1.2.3.tar.bz2;
-      sha256 = "1nih9ayiw13aa1s8j6gr99b207215if055c6yvsrssnpvccflij0";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
-    
   xf86videoark = (stdenv.mkDerivation ((if overrides ? xf86videoark then overrides.xf86videoark else x: x) {
-    name = "xf86-video-ark-0.7.3";
+    name = "xf86-video-ark-0.7.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-ark-0.7.3.tar.bz2;
-      sha256 = "164gyaaddjjma0xqys0knid2rsd0c7jlab02c8wh3bk4bib9l51r";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-ark-0.7.4.tar.bz2;
+      sha256 = "194zc35ivfh3vcxcilf9nbi88c2di8kbh84x535cljlpiajdnk5x";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ;};
     
   xf86videoast = (stdenv.mkDerivation ((if overrides ? xf86videoast then overrides.xf86videoast else x: x) {
-    name = "xf86-video-ast-0.91.10";
+    name = "xf86-video-ast-0.93.10";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-ast-0.91.10.tar.bz2;
-      sha256 = "05fcp0svdd4skkfgag1rrram6v3xzgasf582dihpyrwlz28186vy";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-ast-0.93.10.tar.bz2;
+      sha256 = "1q64z8qqa0ix3cymqiwk1s3sphd1fvvz30lvyxhgkgciygz6dm69";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videoati = (stdenv.mkDerivation ((if overrides ? xf86videoati then overrides.xf86videoati else x: x) {
-    name = "xf86-video-ati-6.14.3";
+    name = "xf86-video-ati-6.14.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-video-ati-6.14.3.tar.bz2;
-      sha256 = "1d1ph7xvgcr7rdf5sgibhas625aghvm3f61yzwmfk8znxx4jcjl4";
+      url = mirror://xorg/individual/driver/xf86-video-ati-6.14.4.tar.bz2;
+      sha256 = "11gg6xn65vym75769hzgzpkjsyhlkrw4zw3ncngriq7vz1g47zjg";
     };
     buildInputs = [pkgconfig fontsproto libdrm udev libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm udev libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
     
-  xf86videochips = (stdenv.mkDerivation ((if overrides ? xf86videochips then overrides.xf86videochips else x: x) {
-    name = "xf86-video-chips-1.2.3";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-chips-1.2.3.tar.bz2;
-      sha256 = "07fb03cxdlis2rjphz2pl59cjhldrhqric8p0gi4wkgq0s72fq85";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
-    
   xf86videocirrus = (stdenv.mkDerivation ((if overrides ? xf86videocirrus then overrides.xf86videocirrus else x: x) {
-    name = "xf86-video-cirrus-1.3.2";
+    name = "xf86-video-cirrus-1.5.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-cirrus-1.3.2.tar.bz2;
-      sha256 = "06na525xy5d6xf5g13bjsk9cyxly5arzgrk9j8dmxfll5jj9i6jj";
+      url = mirror://xorg/individual/driver/xf86-video-cirrus-1.5.1.tar.bz2;
+      sha256 = "0my54x52fsa82bsh196hz79750xjlv8ddbvin7230ck7pnf44md9";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videodummy = (stdenv.mkDerivation ((if overrides ? xf86videodummy then overrides.xf86videodummy else x: x) {
-    name = "xf86-video-dummy-0.3.4";
+    name = "xf86-video-dummy-0.3.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-dummy-0.3.4.tar.bz2;
-      sha256 = "1p0vhxvx25d8fp59i72664smhd0z5zw0i2kipk0879xk1vsxz13y";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-dummy-0.3.5.tar.bz2;
+      sha256 = "0pyr50kqh7g84r4p0x09ay5kxax20dip9sh8h3cbd4xv8cswdbfm";
     };
     buildInputs = [pkgconfig fontsproto randrproto renderproto videoproto xf86dgaproto xorgserver xproto ];
   })) // {inherit fontsproto randrproto renderproto videoproto xf86dgaproto xorgserver xproto ;};
     
   xf86videofbdev = (stdenv.mkDerivation ((if overrides ? xf86videofbdev then overrides.xf86videofbdev else x: x) {
-    name = "xf86-video-fbdev-0.4.2";
+    name = "xf86-video-fbdev-0.4.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-fbdev-0.4.2.tar.bz2;
-      sha256 = "1mc23w0bfmak5216411xh58nrs93jlxmi6l412hmqzhxnjs73clk";
+      url = mirror://xorg/individual/driver/xf86-video-fbdev-0.4.3.tar.bz2;
+      sha256 = "0ca8khgy3wv0fys7s4087apvnp8j86blxj5m5m70l10hs5x06yzz";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xorgserver xproto ;};
     
   xf86videogeode = (stdenv.mkDerivation ((if overrides ? xf86videogeode then overrides.xf86videogeode else x: x) {
-    name = "xf86-video-geode-2.11.10";
+    name = "xf86-video-geode-2.11.13";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-geode-2.11.10.tar.bz2;
-      sha256 = "1zdb3y5df1dcqlvijg8hxcd6520a5c69jk52yz7ww194ka2c8icf";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-geode-2.11.13.tar.bz2;
+      sha256 = "09p2cjd2fb7h32k9qs4wp7qvhfn2zv454spv5mfplv7w2jis4863";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videoglide = (stdenv.mkDerivation ((if overrides ? xf86videoglide then overrides.xf86videoglide else x: x) {
-    name = "xf86-video-glide-1.1.0";
+    name = "xf86-video-glide-1.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-glide-1.1.0.tar.bz2;
-      sha256 = "1wf35ai8z3qqk2a97rp72jzvm28ylw2wj2hllrsn29p7jpznh5aw";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-glide-1.2.0.tar.bz2;
+      sha256 = "0byapm9mnpqk3wijfnnan3d22ii5cw6dmg4xn1625iiz89j5vs1l";
     };
     buildInputs = [pkgconfig xextproto xorgserver xproto ];
   })) // {inherit xextproto xorgserver xproto ;};
     
   xf86videoglint = (stdenv.mkDerivation ((if overrides ? xf86videoglint then overrides.xf86videoglint else x: x) {
-    name = "xf86-video-glint-1.2.5";
+    name = "xf86-video-glint-1.2.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-glint-1.2.5.tar.bz2;
-      sha256 = "0jw1kkyja8hvvhrr3ldl1r5vpqfhn1xmqkpgd2jrkc5p59rz4xan";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-glint-1.2.7.tar.bz2;
+      sha256 = "0nf36jryabpncqq4m6sfsnmzk00f7gvfmjnl8l8sfy7w6sa6iacs";
     };
-    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xf86driproto xorgserver xproto ];
-  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xf86driproto xorgserver xproto ;};
+    buildInputs = [pkgconfig libpciaccess videoproto xextproto xf86dgaproto xorgserver xproto ];
+  })) // {inherit libpciaccess videoproto xextproto xf86dgaproto xorgserver xproto ;};
     
   xf86videoi128 = (stdenv.mkDerivation ((if overrides ? xf86videoi128 then overrides.xf86videoi128 else x: x) {
-    name = "xf86-video-i128-1.3.4";
+    name = "xf86-video-i128-1.3.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-i128-1.3.4.tar.bz2;
-      sha256 = "1kwb4ifxwm77s1ks19csmq2ymgs36bxqwvwv24ssvxb9znki76xn";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
-    
-  xf86videoi740 = (stdenv.mkDerivation ((if overrides ? xf86videoi740 then overrides.xf86videoi740 else x: x) {
-    name = "xf86-video-i740-1.3.2";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-i740-1.3.2.tar.bz2;
-      sha256 = "0hzr5fz6d5jk9jxh9plfgvgias3w7xzyg1n4gx0hs2lc7mm9qm28";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-i128-1.3.5.tar.bz2;
+      sha256 = "1sik8ck410hb2885vy7rlc590hw5br8lr2fzxgmv55jyawgfpv9y";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videointel = (stdenv.mkDerivation ((if overrides ? xf86videointel then overrides.xf86videointel else x: x) {
-    name = "xf86-video-intel-2.15.0";
+    name = "xf86-video-intel-2.20.19";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-video-intel-2.15.0.tar.bz2;
-      sha256 = "080pkhjp910wy36crpgi0dmcwpcx8w2r3k4s0dz6v14bmgly2xy3";
+      url = mirror://xorg/individual/driver/xf86-video-intel-2.20.19.tar.bz2;
+      sha256 = "0k67vcf0aqhv9zmy1arxyjdl7fsrg90cjm0ryyhamghq67z0xcmr";
     };
-    buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXvMC ];
-  })) // {inherit dri2proto fontsproto libdrm udev libpciaccess randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXvMC ;};
+    buildInputs = [pkgconfig dri2proto fontsproto libdrm udev libpciaccess pixman randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ];
+  })) // {inherit dri2proto fontsproto libdrm udev libpciaccess pixman randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;};
     
   xf86videointel_2_14_901 = (stdenv.mkDerivation ((if overrides ? xf86videointel_2_14_901 then overrides.xf86videointel_2_14_901 else x: x) {
     name = "xf86-video-intel-2.14.901";
@@ -1610,170 +1560,110 @@ let
   })) // {inherit dri2proto fontsproto libdrm udev libpciaccess pixman randrproto renderproto libX11 xcbutil libxcb libXext xextproto xf86driproto libXfixes xorgserver xproto libXrender libXvMC ;};
     
   xf86videomach64 = (stdenv.mkDerivation ((if overrides ? xf86videomach64 then overrides.xf86videomach64 else x: x) {
-    name = "xf86-video-mach64-6.8.2";
+    name = "xf86-video-mach64-6.9.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-mach64-6.8.2.tar.bz2;
-      sha256 = "07b7dkb6xc10pvf483dg52r2klpikmw339i5ln9ig913601r84dr";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-mach64-6.9.1.tar.bz2;
+      sha256 = "0kl3kvpc2ny48z89313i9fi4cxzwb2pllvxcr9j5ly680ygx8slz";
     };
-    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xineramaproto xorgserver xproto ];
-  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xineramaproto xorgserver xproto ;};
+    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
+  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
     
   xf86videomga = (stdenv.mkDerivation ((if overrides ? xf86videomga then overrides.xf86videomga else x: x) {
-    name = "xf86-video-mga-1.4.13";
+    name = "xf86-video-mga-1.5.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-mga-1.4.13.tar.bz2;
-      sha256 = "1xnzxmp9cfpi6q7fx2r74iwyb33wkdrqcf38dhwydbaaxigvsmxn";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-mga-1.5.0.tar.bz2;
+      sha256 = "03l3wz5kz0hmxmzqqbkgn7pf9d956jlag04rb701a0fr1mw3v66a";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
     
   xf86videoneomagic = (stdenv.mkDerivation ((if overrides ? xf86videoneomagic then overrides.xf86videoneomagic else x: x) {
-    name = "xf86-video-neomagic-1.2.5";
+    name = "xf86-video-neomagic-1.2.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-neomagic-1.2.5.tar.bz2;
-      sha256 = "0jshn5k1byq0msl1ymip3m2xycrd8jkk6nzm5dx2av5xlj1rxdn0";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-neomagic-1.2.6.tar.bz2;
+      sha256 = "124qci48xrk0w2jy91n7vqs7s6q397zyiqqszhmkx6ld7six57mi";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ;};
     
   xf86videonewport = (stdenv.mkDerivation ((if overrides ? xf86videonewport then overrides.xf86videonewport else x: x) {
-    name = "xf86-video-newport-0.2.3";
+    name = "xf86-video-newport-0.2.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-newport-0.2.3.tar.bz2;
-      sha256 = "0w02rz49gipnfl33vak3zgis8bh9i0v5ykyj8qh9vzddjm7ypjp6";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-newport-0.2.4.tar.bz2;
+      sha256 = "1yafmp23jrfdmc094i6a4dsizapsc9v0pl65cpc8w1kvn7343k4i";
     };
     buildInputs = [pkgconfig fontsproto randrproto renderproto videoproto xorgserver xproto ];
   })) // {inherit fontsproto randrproto renderproto videoproto xorgserver xproto ;};
     
   xf86videonv = (stdenv.mkDerivation ((if overrides ? xf86videonv then overrides.xf86videonv else x: x) {
-    name = "xf86-video-nv-2.1.18";
+    name = "xf86-video-nv-2.1.20";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-nv-2.1.18.tar.bz2;
-      sha256 = "05glbi9jc7j9nm4sf4qvl3z87s48ibm3i283lqz85kbphg62dxvc";
+      url = mirror://xorg/individual/driver/xf86-video-nv-2.1.20.tar.bz2;
+      sha256 = "1gqh1khc4zalip5hh2nksgs7i3piqq18nncgmsx9qvzi05azd5c3";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videoopenchrome = (stdenv.mkDerivation ((if overrides ? xf86videoopenchrome then overrides.xf86videoopenchrome else x: x) {
-    name = "xf86-video-openchrome-0.2.904";
+    name = "xf86-video-openchrome-0.2.906";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-openchrome-0.2.904.tar.bz2;
-      sha256 = "1sksddn0pc3izvab5ppxhprs1xzk5ijwqz5ylivx1cb5hg2gggf7";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-openchrome-0.2.906.tar.bz2;
+      sha256 = "0hgzn1r7ig94xbr9dvq0bp1nxqlfp2ki8823jca3f22a2kf8wmg7";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto libX11 libXext xextproto xf86driproto xorgserver xproto libXvMC ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto libX11 libXext xextproto xf86driproto xorgserver xproto libXvMC ;};
     
   xf86videor128 = (stdenv.mkDerivation ((if overrides ? xf86videor128 then overrides.xf86videor128 else x: x) {
-    name = "xf86-video-r128-6.8.1";
+    name = "xf86-video-r128-6.8.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-r128-6.8.1.tar.bz2;
-      sha256 = "1jlybabm3k09hhlzx1xilndqngk3xgdck66n94sr02w5hg622zji";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-r128-6.8.2.tar.bz2;
+      sha256 = "1c84x40k9qz9dnf5qs6nnjcgz7px6mpc3rbk8mj62zhp7mf16hbv";
     };
-    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xineramaproto xorgserver xproto ];
-  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xineramaproto xorgserver xproto ;};
-    
-  xf86videorendition = (stdenv.mkDerivation ((if overrides ? xf86videorendition then overrides.xf86videorendition else x: x) {
-    name = "xf86-video-rendition-4.2.4";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-rendition-4.2.4.tar.bz2;
-      sha256 = "1a9anxgqs7wc8d7jb5nw6dgmynw0sxiwp9p90h4w19y315kqx6rv";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ;};
-    
-  xf86videos3 = (stdenv.mkDerivation ((if overrides ? xf86videos3 then overrides.xf86videos3 else x: x) {
-    name = "xf86-video-s3-0.6.3";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-s3-0.6.3.tar.bz2;
-      sha256 = "0i2i1080cw3pxy1pm43bskb80n7wql0cxpyd2s61v0didsm6b7zd";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
-    
-  xf86videos3virge = (stdenv.mkDerivation ((if overrides ? xf86videos3virge then overrides.xf86videos3virge else x: x) {
-    name = "xf86-video-s3virge-1.10.4";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-s3virge-1.10.4.tar.bz2;
-      sha256 = "1f3zjs6a3j2a8lfdilijggpwbg9cs88qksrvzvd71ggxf5p0vl0w";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
+    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xorgserver xproto ];
+  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xf86miscproto xorgserver xproto ;};
     
   xf86videosavage = (stdenv.mkDerivation ((if overrides ? xf86videosavage then overrides.xf86videosavage else x: x) {
-    name = "xf86-video-savage-2.3.1";
+    name = "xf86-video-savage-2.3.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-savage-2.3.1.tar.bz2;
-      sha256 = "1ays1l4phyjcdikc9d1zwgswivcrb1grkh7klv5klvqahbfxqjib";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-savage-2.3.4.tar.bz2;
+      sha256 = "0jdy4wv3k3ylx3lajjcbsg37z2hf6366a1jvv16sv1ln6dk6lris";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
     
   xf86videosiliconmotion = (stdenv.mkDerivation ((if overrides ? xf86videosiliconmotion then overrides.xf86videosiliconmotion else x: x) {
-    name = "xf86-video-siliconmotion-1.7.4";
+    name = "xf86-video-siliconmotion-1.7.6";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-siliconmotion-1.7.4.tar.bz2;
-      sha256 = "1mq4dsg2f77wxl0n4fnm6a5p3lajyhra6rxx29z52p5b1x412xdl";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-siliconmotion-1.7.6.tar.bz2;
+      sha256 = "01sdl6ky1vmvmfgx2d44i35rqafi0z07xdy40cvindcr2k91p7x5";
     };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
+    buildInputs = [pkgconfig fontsproto libpciaccess videoproto xextproto xorgserver xproto ];
+  })) // {inherit fontsproto libpciaccess videoproto xextproto xorgserver xproto ;};
     
   xf86videosis = (stdenv.mkDerivation ((if overrides ? xf86videosis then overrides.xf86videosis else x: x) {
-    name = "xf86-video-sis-0.10.3";
+    name = "xf86-video-sis-0.10.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-sis-0.10.3.tar.bz2;
-      sha256 = "0dy7a7iil35nz1xlazrcq0sp474p6wy0f1pa5y0spbfj5zib6fcv";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-sis-0.10.4.tar.bz2;
+      sha256 = "03diq0l93lfsipmwkpdb2ysgbxxryl6yakpghzc3fksjxa01112f";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xf86driproto xineramaproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xf86driproto xineramaproto xorgserver xproto ;};
     
-  xf86videosisusb = (stdenv.mkDerivation ((if overrides ? xf86videosisusb then overrides.xf86videosisusb else x: x) {
-    name = "xf86-video-sisusb-0.9.4";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-sisusb-0.9.4.tar.bz2;
-      sha256 = "0b5afc1dqj8h34fldl35hzf7wphj1x76czkd461bfarnvyljgfrb";
-    };
-    buildInputs = [pkgconfig fontsproto randrproto renderproto videoproto xextproto xineramaproto xorgserver xproto ];
-  })) // {inherit fontsproto randrproto renderproto videoproto xextproto xineramaproto xorgserver xproto ;};
-    
-  xf86videosuncg14 = (stdenv.mkDerivation ((if overrides ? xf86videosuncg14 then overrides.xf86videosuncg14 else x: x) {
-    name = "xf86-video-suncg14-1.1.1";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-suncg14-1.1.1.tar.bz2;
-      sha256 = "1n108xbwg803v2sk51galx66ph8wdb0ym84fx45h0jrr41wh0hyb";
-    };
-    buildInputs = [pkgconfig fontsproto randrproto renderproto xorgserver xproto ];
-  })) // {inherit fontsproto randrproto renderproto xorgserver xproto ;};
-    
-  xf86videosuncg3 = (stdenv.mkDerivation ((if overrides ? xf86videosuncg3 then overrides.xf86videosuncg3 else x: x) {
-    name = "xf86-video-suncg3-1.1.1";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-suncg3-1.1.1.tar.bz2;
-      sha256 = "06c4hzmd5cfzbw79yrv3knss80hllciamz734ij1pbzj6j6fjvym";
-    };
-    buildInputs = [pkgconfig fontsproto randrproto renderproto xorgserver xproto ];
-  })) // {inherit fontsproto randrproto renderproto xorgserver xproto ;};
-    
   xf86videosuncg6 = (stdenv.mkDerivation ((if overrides ? xf86videosuncg6 then overrides.xf86videosuncg6 else x: x) {
     name = "xf86-video-suncg6-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-suncg6-1.1.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-suncg6-1.1.1.tar.bz2;
       sha256 = "07w0hm63fiy5l3cpcjsl0ig8z84z9r36xm0cmnpiv3g75dy6q8fi";
     };
     buildInputs = [pkgconfig fontsproto randrproto renderproto xorgserver xproto ];
@@ -1783,38 +1673,18 @@ let
     name = "xf86-video-sunffb-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-sunffb-1.2.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-sunffb-1.2.1.tar.bz2;
       sha256 = "04byax4sc1fn183vyyq0q11q730k16h2by4ggjky7s36wgv7ldzx";
     };
     buildInputs = [pkgconfig fontsproto randrproto renderproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto randrproto renderproto xextproto xorgserver xproto ;};
     
-  xf86videosunleo = (stdenv.mkDerivation ((if overrides ? xf86videosunleo then overrides.xf86videosunleo else x: x) {
-    name = "xf86-video-sunleo-1.2.0";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-sunleo-1.2.0.tar.bz2;
-      sha256 = "01kffjbshmwix2cdb95j0cx2qmrss6yfjj7y5qssw83h36bvw5dk";
-    };
-    buildInputs = [pkgconfig fontsproto randrproto renderproto xorgserver xproto ];
-  })) // {inherit fontsproto randrproto renderproto xorgserver xproto ;};
-    
-  xf86videosuntcx = (stdenv.mkDerivation ((if overrides ? xf86videosuntcx then overrides.xf86videosuntcx else x: x) {
-    name = "xf86-video-suntcx-1.1.1";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-suntcx-1.1.1.tar.bz2;
-      sha256 = "07lqah5sizhwjpzr4vcpwgvbl86fwz4k0c3skp63sq58ng21acal";
-    };
-    buildInputs = [pkgconfig fontsproto randrproto renderproto xorgserver xproto ];
-  })) // {inherit fontsproto randrproto renderproto xorgserver xproto ;};
-    
   xf86videotdfx = (stdenv.mkDerivation ((if overrides ? xf86videotdfx then overrides.xf86videotdfx else x: x) {
-    name = "xf86-video-tdfx-1.4.3";
+    name = "xf86-video-tdfx-1.4.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-tdfx-1.4.3.tar.bz2;
-      sha256 = "0cxz1rsc87cnf0ba1zfwhk0lhfas92ysc9b13q6x21m31b53bn9s";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-tdfx-1.4.4.tar.bz2;
+      sha256 = "124gsi30rj547jjd7gvv7xykfnwlyrxw0gcacamby7pvl3g33fg0";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
@@ -1823,58 +1693,48 @@ let
     name = "xf86-video-tga-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-tga-1.2.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-tga-1.2.1.tar.bz2;
       sha256 = "0mdqrn02zzkdnmhg4vh9djaawg6b2p82g5qbj66z8b30yr77b93h";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ;};
     
   xf86videotrident = (stdenv.mkDerivation ((if overrides ? xf86videotrident then overrides.xf86videotrident else x: x) {
-    name = "xf86-video-trident-1.3.4";
+    name = "xf86-video-trident-1.3.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-trident-1.3.4.tar.bz2;
-      sha256 = "1a4wybqwd617mg8lzn1xvi5m0iibimxpvyqsr31mhb7gw0qidrjq";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-trident-1.3.5.tar.bz2;
+      sha256 = "02y5pzdp0a1c12jr8gghbrzgbyfbgq67x7kd7n4f323pmf8x1csb";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xf86dgaproto xorgserver xproto ;};
     
-  xf86videotseng = (stdenv.mkDerivation ((if overrides ? xf86videotseng then overrides.xf86videotseng else x: x) {
-    name = "xf86-video-tseng-1.2.4";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-tseng-1.2.4.tar.bz2;
-      sha256 = "0gfiwx2p51k3k78qic8y9y0d3d6nhhbmzfvzmw5hx3ba9kxmvpfh";
-    };
-    buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ];
-  })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
-    
   xf86videov4l = (stdenv.mkDerivation ((if overrides ? xf86videov4l then overrides.xf86videov4l else x: x) {
     name = "xf86-video-v4l-0.2.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-v4l-0.2.0.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-v4l-0.2.0.tar.bz2;
       sha256 = "0pcjc75hgbih3qvhpsx8d4fljysfk025slxcqyyhr45dzch93zyb";
     };
     buildInputs = [pkgconfig randrproto videoproto xorgserver xproto ];
   })) // {inherit randrproto videoproto xorgserver xproto ;};
     
   xf86videovesa = (stdenv.mkDerivation ((if overrides ? xf86videovesa then overrides.xf86videovesa else x: x) {
-    name = "xf86-video-vesa-2.3.0";
+    name = "xf86-video-vesa-2.3.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-vesa-2.3.0.tar.bz2;
-      sha256 = "0yhdj39d8rfv2n4i52dg7cg1rsrclagn7rjs3pc3jdajjh75mn4f";
+      url = mirror://xorg/individual/driver/xf86-video-vesa-2.3.2.tar.bz2;
+      sha256 = "1qqf97baii1dcsm3y8gqw674j4r8llhkbqsavhyn11iwmvzifjhl";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ;};
     
   xf86videovmware = (stdenv.mkDerivation ((if overrides ? xf86videovmware then overrides.xf86videovmware else x: x) {
-    name = "xf86-video-vmware-11.0.3";
+    name = "xf86-video-vmware-12.0.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-vmware-11.0.3.tar.bz2;
-      sha256 = "18rqkzr1dvzgdr2khlhhpai69z28rnrfl8jiw9hnahbyv2r7qjmj";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-vmware-12.0.2.tar.bz2;
+      sha256 = "0isiwx516gww8hfk3vy7js83yziyjym9mq2zjadyq1a8v5gqf9y8";
     };
     buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto libX11 libXext xextproto xineramaproto xorgserver xproto ];
   })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto libX11 libXext xextproto xineramaproto xorgserver xproto ;};
@@ -1883,78 +1743,58 @@ let
     name = "xf86-video-voodoo-1.2.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-voodoo-1.2.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-voodoo-1.2.4.tar.bz2;
       sha256 = "0ha748yz92yzn6hp2rhin3il8f4j2rs4vkgdvqkagnv1ryxkh0ph";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xf86dgaproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xf86dgaproto xorgserver xproto ;};
     
   xf86videowsfb = (stdenv.mkDerivation ((if overrides ? xf86videowsfb then overrides.xf86videowsfb else x: x) {
-    name = "xf86-video-wsfb-0.3.0";
+    name = "xf86-video-wsfb-0.4.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-wsfb-0.3.0.tar.bz2;
-      sha256 = "17lqhir0adcccfkrzz2sr8cpv5vkakk0w7xfc22vv7c6jz9vdgbq";
+      url = mirror://xorg/X11R7.7/src/everything/xf86-video-wsfb-0.4.0.tar.bz2;
+      sha256 = "0hr8397wpd0by1hc47fqqrnaw3qdqd8aqgwgzv38w5k3l3jy6p4p";
     };
     buildInputs = [pkgconfig xorgserver xproto ];
   })) // {inherit xorgserver xproto ;};
     
-  xf86videoxgi = (stdenv.mkDerivation ((if overrides ? xf86videoxgi then overrides.xf86videoxgi else x: x) {
-    name = "xf86-video-xgi-1.6.0";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-xgi-1.6.0.tar.bz2;
-      sha256 = "05wl9a51pik5swkzpyhh4y2gf6m3hd458r4142p5w39bbkmhcd78";
-    };
-    buildInputs = [pkgconfig fontsproto glproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xineramaproto xorgserver xproto ];
-  })) // {inherit fontsproto glproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xineramaproto xorgserver xproto ;};
-    
-  xf86videoxgixp = (stdenv.mkDerivation ((if overrides ? xf86videoxgixp then overrides.xf86videoxgixp else x: x) {
-    name = "xf86-video-xgixp-1.8.0";
-    builder = ./builder.sh;
-    src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xf86-video-xgixp-1.8.0.tar.bz2;
-      sha256 = "06np5s3f3451vmjwpxbn8hb7d4dhsxff2af8qy8jlc24rinnv9is";
-    };
-    buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ];
-  })) // {inherit fontsproto libdrm libpciaccess randrproto renderproto videoproto xextproto xf86driproto xorgserver xproto ;};
-    
   xf86vidmodeproto = (stdenv.mkDerivation ((if overrides ? xf86vidmodeproto then overrides.xf86vidmodeproto else x: x) {
     name = "xf86vidmodeproto-2.3.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/proto/xf86vidmodeproto-2.3.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xf86vidmodeproto-2.3.1.tar.bz2;
       sha256 = "0w47d7gfa8zizh2bshdr2rffvbr4jqjv019mdgyh6cmplyd4kna5";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xfs = (stdenv.mkDerivation ((if overrides ? xfs then overrides.xfs else x: x) {
-    name = "xfs-1.1.1";
+    name = "xfs-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xfs-1.1.1.tar.bz2;
-      sha256 = "1yxm87az3xghngcsd50zz6mdgi9j6vm8pw90sjqzshwq7hx7d0qc";
+      url = mirror://xorg/individual/app/xfs-1.1.2.tar.bz2;
+      sha256 = "17g34yq789grnic83cqj5khq0knda1w2rgabhjflsyw9wg663shd";
     };
-    buildInputs = [pkgconfig libFS libXfont xtrans ];
-  })) // {inherit libFS libXfont xtrans ;};
+    buildInputs = [pkgconfig libXfont xproto xtrans ];
+  })) // {inherit libXfont xproto xtrans ;};
     
   xgamma = (stdenv.mkDerivation ((if overrides ? xgamma then overrides.xgamma else x: x) {
-    name = "xgamma-1.0.4";
+    name = "xgamma-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xgamma-1.0.4.tar.bz2;
-      sha256 = "05lfx9517why64b3n14drid7vn1d2g2ymg22034vqq50h9437j3x";
+      url = mirror://xorg/X11R7.7/src/everything/xgamma-1.0.5.tar.bz2;
+      sha256 = "0463sawps86jnxn121ramsz4sicy3az5wa5wsq4rqm8dm3za48p3";
     };
     buildInputs = [pkgconfig libX11 libXxf86vm ];
   })) // {inherit libX11 libXxf86vm ;};
     
   xhost = (stdenv.mkDerivation ((if overrides ? xhost then overrides.xhost else x: x) {
-    name = "xhost-1.0.4";
+    name = "xhost-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xhost-1.0.4.tar.bz2;
-      sha256 = "15558q9hgmw6vbwc2sgjkfpzw342lxci9w8vcbrmi8mpmrnc00jy";
+      url = mirror://xorg/X11R7.7/src/everything/xhost-1.0.5.tar.bz2;
+      sha256 = "0l483y6wfrjh37j16b41kpi2nc7ss5rvndafpbaylrs87ygx2w18";
     };
     buildInputs = [pkgconfig libX11 libXau libXmu ];
   })) // {inherit libX11 libXau libXmu ;};
@@ -1963,48 +1803,48 @@ let
     name = "xineramaproto-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/proto/xineramaproto-1.2.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2;
       sha256 = "0ns8abd27x7gbp4r44z3wc5k9zqxxj8zjnazqpcyr4n17nxp8xcp";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xinit = (stdenv.mkDerivation ((if overrides ? xinit then overrides.xinit else x: x) {
-    name = "xinit-1.3.0";
+    name = "xinit-1.3.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xinit-1.3.0.tar.bz2;
-      sha256 = "0k70bw6x2zgvmd0l7xyzbps18pbzfz26yzjva1vcz9s239pf6xms";
+      url = mirror://xorg/individual/app/xinit-1.3.2.tar.bz2;
+      sha256 = "0d821rlqwyn2js7bkzicyp894n9gqv1hahxs285pas1zm3d7z1m1";
     };
     buildInputs = [pkgconfig libX11 ];
   })) // {inherit libX11 ;};
     
   xinput = (stdenv.mkDerivation ((if overrides ? xinput then overrides.xinput else x: x) {
-    name = "xinput-1.5.3";
+    name = "xinput-1.6.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xinput-1.5.3.tar.bz2;
-      sha256 = "0xjwi1sjmvmmzgcvzvz4q8wn0gs7x3aivknx77yfxnndrqqy3bba";
+      url = mirror://xorg/X11R7.7/src/everything/xinput-1.6.0.tar.bz2;
+      sha256 = "0zl4cdgnzh9shz20yn7hz889v4nkbyqwx0nb7dh6arn7abchgc2a";
     };
-    buildInputs = [pkgconfig inputproto libX11 libXext libXi ];
-  })) // {inherit inputproto libX11 libXext libXi ;};
+    buildInputs = [pkgconfig inputproto libX11 libXext libXi libXinerama libXrandr ];
+  })) // {inherit inputproto libX11 libXext libXi libXinerama libXrandr ;};
     
   xkbcomp = (stdenv.mkDerivation ((if overrides ? xkbcomp then overrides.xkbcomp else x: x) {
-    name = "xkbcomp-1.2.1";
+    name = "xkbcomp-1.2.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xkbcomp-1.2.1.tar.bz2;
-      sha256 = "1sv51rliqs6wygrp2hc79a5pgn6ly0bbr4sa8a8x00j4j4kjaqdp";
+      url = mirror://xorg/X11R7.7/src/everything/xkbcomp-1.2.4.tar.bz2;
+      sha256 = "0bas1d2wjiy5zy9d0g92d2p9pwv4aapfbfidi7hxy8ax8jmwkl4i";
     };
-    buildInputs = [pkgconfig libX11 libxkbfile ];
-  })) // {inherit libX11 libxkbfile ;};
+    buildInputs = [pkgconfig libX11 libxkbfile xproto ];
+  })) // {inherit libX11 libxkbfile xproto ;};
     
   xkbevd = (stdenv.mkDerivation ((if overrides ? xkbevd then overrides.xkbevd else x: x) {
-    name = "xkbevd-1.1.2";
+    name = "xkbevd-1.1.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xkbevd-1.1.2.tar.bz2;
-      sha256 = "0qzbh1wb2fg0wsyfqr4j15443caa1xfcxwdf1gzb4gpbkxn98qnd";
+      url = mirror://xorg/X11R7.7/src/everything/xkbevd-1.1.3.tar.bz2;
+      sha256 = "05h1xcnbalndbrryyqs8wzy9h3wz655vc0ymhlk2q4aik17licjm";
     };
     buildInputs = [pkgconfig libX11 libxkbfile ];
   })) // {inherit libX11 libxkbfile ;};
@@ -2013,28 +1853,38 @@ let
     name = "xkbutils-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xkbutils-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xkbutils-1.0.3.tar.bz2;
       sha256 = "1ga913pw6chssf2016kjyjl6ar2lj83pa497w97ak2kq603sy2g4";
     };
     buildInputs = [pkgconfig inputproto libX11 libXaw xproto libXt ];
   })) // {inherit inputproto libX11 libXaw xproto libXt ;};
     
+  xkeyboardconfig = (stdenv.mkDerivation ((if overrides ? xkeyboardconfig then overrides.xkeyboardconfig else x: x) {
+    name = "xkeyboard-config-2.6";
+    builder = ./builder.sh;
+    src = fetchurl {
+      url = mirror://xorg/X11R7.7/src/everything/xkeyboard-config-2.6.tar.bz2;
+      sha256 = "1nmb7ma8rqryicc5xqrn2hm5pwp5lkf7nj28bwbf63mz2r0mk892";
+    };
+    buildInputs = [pkgconfig ];
+  })) // {inherit ;};
+    
   xkill = (stdenv.mkDerivation ((if overrides ? xkill then overrides.xkill else x: x) {
     name = "xkill-1.0.3";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xkill-1.0.3.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xkill-1.0.3.tar.bz2;
       sha256 = "1ac110qbb9a4x1dim3vaghvdk3jc708i2p3f4rmag33458khg0xx";
     };
     buildInputs = [pkgconfig libX11 libXmu ];
   })) // {inherit libX11 libXmu ;};
     
   xlsatoms = (stdenv.mkDerivation ((if overrides ? xlsatoms then overrides.xlsatoms else x: x) {
-    name = "xlsatoms-1.1.0";
+    name = "xlsatoms-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xlsatoms-1.1.0.tar.bz2;
-      sha256 = "03fbknvq7rixfgpv5945s7r82jz2xc06a0n09w1p22hl4pd7l0aa";
+      url = mirror://xorg/X11R7.7/src/everything/xlsatoms-1.1.1.tar.bz2;
+      sha256 = "1y9nfl8s7njxbnci8c20j986xixharasgg40vdw92y593j6dk2rv";
     };
     buildInputs = [pkgconfig libxcb ];
   })) // {inherit libxcb ;};
@@ -2043,7 +1893,7 @@ let
     name = "xlsclients-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xlsclients-1.1.2.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xlsclients-1.1.2.tar.bz2;
       sha256 = "1l97j15mg4wfzpm81wlpzagfjff7v4fwn7s2z2rpksk3gfcg7r8w";
     };
     buildInputs = [pkgconfig libxcb ];
@@ -2060,14 +1910,14 @@ let
   })) // {inherit libXaw libXt ;};
     
   xmodmap = (stdenv.mkDerivation ((if overrides ? xmodmap then overrides.xmodmap else x: x) {
-    name = "xmodmap-1.0.5";
+    name = "xmodmap-1.0.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xmodmap-1.0.5.tar.bz2;
-      sha256 = "00il5y6q2m90f62cqzgc0ni5qg3y946gf98jj325kx8cgfhyf7j2";
+      url = mirror://xorg/X11R7.7/src/everything/xmodmap-1.0.7.tar.bz2;
+      sha256 = "1dg47lay4vhrl9mfq3cfc6741a0m2n8wd4ljagd21ix3qklys8pg";
     };
-    buildInputs = [pkgconfig libX11 ];
-  })) // {inherit libX11 ;};
+    buildInputs = [pkgconfig libX11 xproto ];
+  })) // {inherit libX11 xproto ;};
     
   xorgcffiles = (stdenv.mkDerivation ((if overrides ? xorgcffiles then overrides.xorgcffiles else x: x) {
     name = "xorg-cf-files-1.0.4";
@@ -2080,81 +1930,91 @@ let
   })) // {inherit ;};
     
   xorgdocs = (stdenv.mkDerivation ((if overrides ? xorgdocs then overrides.xorgdocs else x: x) {
-    name = "xorg-docs-1.6";
+    name = "xorg-docs-1.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xorg-docs-1.6.tar.bz2;
-      sha256 = "0clxy41642jx77mmw5j2fnwa88ms1a7z1z8xpzrgs45bhv21pcpn";
+      url = mirror://xorg/X11R7.7/src/everything/xorg-docs-1.7.tar.bz2;
+      sha256 = "0prphdba6kgr1bxk7r07wxxx6x6pqjw6prr5qclypsb5sf5r3cdr";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xorgserver = (stdenv.mkDerivation ((if overrides ? xorgserver then overrides.xorgserver else x: x) {
-    name = "xorg-server-1.9.5";
+    name = "xorg-server-1.12.4";
+    builder = ./builder.sh;
+    src = fetchurl {
+      url = mirror://xorg/individual/xserver/xorg-server-1.12.4.tar.bz2;
+      sha256 = "1xscr6rf0q15hv3hmm51xhwk0c0rx7a2swkj14ygp8vb60sprh4a";
+    };
+    buildInputs = [pkgconfig renderproto libdrm openssl libX11 libXau libXaw libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt libXv ];
+  })) // {inherit renderproto libdrm openssl libX11 libXau libXaw libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt libXv ;};
+
+  xorgserver_1_13_0 = (stdenv.mkDerivation ((if overrides ? xorgserver_1_13_0 then overrides.xorgserver_1_13_0 else x: x) {
+    name = "xorg-server-1.13.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xserver/xorg-server-1.9.5.tar.bz2;
-      sha256 = "1p19w1s840jb1ah6na0c9k23gbh9wwz1il272irqy3jggh4pbirz";
+      url = mirror://xorg/individual/xserver/xorg-server-1.13.0.tar.bz2;
+      sha256 = "12pjis236ss3402cg1iy749cylajjp27m3j2jbwd8yh8075r32sl";
     };
-    buildInputs = [pkgconfig bigreqsproto damageproto fixesproto fontsproto inputproto kbproto libdrm openssl libpciaccess perl randrproto renderproto libX11 libXau libXaw xcmiscproto libXdmcp xextproto libXfixes libxkbfile libXmu libXpm xproto libXrender libXres libXt xtrans libXv ];
-  })) // {inherit bigreqsproto damageproto fixesproto fontsproto inputproto kbproto libdrm openssl libpciaccess perl randrproto renderproto libX11 libXau libXaw xcmiscproto libXdmcp xextproto libXfixes libxkbfile libXmu libXpm xproto libXrender libXres libXt xtrans libXv ;};
+    buildInputs = [pkgconfig renderproto libdrm openssl libX11 libXau libXaw libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt libXv pixman glproto ];
+  })) // {inherit renderproto libdrm openssl libX11 libXau libXaw libXdmcp libXfixes libxkbfile libXmu libXpm libXrender libXres libXt libXv pixman glproto ;};
     
   xorgsgmldoctools = (stdenv.mkDerivation ((if overrides ? xorgsgmldoctools then overrides.xorgsgmldoctools else x: x) {
-    name = "xorg-sgml-doctools-1.6";
+    name = "xorg-sgml-doctools-1.11";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xorg-sgml-doctools-1.6.tar.bz2;
-      sha256 = "0smfsman09dqqw6h638w44lgp2kng2jwk53sb74i7r53x1v09llq";
+      url = mirror://xorg/X11R7.7/src/everything/xorg-sgml-doctools-1.11.tar.bz2;
+      sha256 = "0k5pffyi5bx8dmfn033cyhgd3gf6viqj3x769fqixifwhbgy2777";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xpr = (stdenv.mkDerivation ((if overrides ? xpr then overrides.xpr else x: x) {
-    name = "xpr-1.0.3";
+    name = "xpr-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xpr-1.0.3.tar.bz2;
-      sha256 = "0zckkd45lzbikmdn29r12faby8g5prjkacc1z8aw87pq9sqdcy18";
+      url = mirror://xorg/X11R7.7/src/everything/xpr-1.0.4.tar.bz2;
+      sha256 = "1dbcv26w2yand2qy7b3h5rbvw1mdmdd57jw88v53sgdr3vrqvngy";
     };
-    buildInputs = [pkgconfig libX11 libXmu ];
-  })) // {inherit libX11 libXmu ;};
+    buildInputs = [pkgconfig libX11 libXmu xproto ];
+  })) // {inherit libX11 libXmu xproto ;};
     
   xprop = (stdenv.mkDerivation ((if overrides ? xprop then overrides.xprop else x: x) {
-    name = "xprop-1.2.0";
+    name = "xprop-1.2.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xprop-1.2.0.tar.bz2;
-      sha256 = "173bpq7x2amr77xy28f9m4nfdwr340wj3jw9hkbbznq35c48ql2k";
+      url = mirror://xorg/X11R7.7/src/everything/xprop-1.2.1.tar.bz2;
+      sha256 = "18zi2any13zlb7f34fzyw6lkiwkd6k2scp3b800a1f4rj0c7m407";
     };
-    buildInputs = [pkgconfig libX11 ];
-  })) // {inherit libX11 ;};
+    buildInputs = [pkgconfig libX11 xproto ];
+  })) // {inherit libX11 xproto ;};
     
   xproto = (stdenv.mkDerivation ((if overrides ? xproto then overrides.xproto else x: x) {
-    name = "xproto-7.0.20";
+    name = "xproto-7.0.23";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xproto-7.0.20.tar.bz2;
-      sha256 = "0alyxrd8wmdvdqm1v3q4x5brv4prj0gxf59pp9h5wycvgpj7zs1z";
+      url = mirror://xorg/X11R7.7/src/everything/xproto-7.0.23.tar.bz2;
+      sha256 = "17lkmi12f89qvg4jj5spqzwzc24fmsqq68dv6kpy7r7b944lmq5d";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
   xrandr = (stdenv.mkDerivation ((if overrides ? xrandr then overrides.xrandr else x: x) {
-    name = "xrandr-1.3.4";
+    name = "xrandr-1.3.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xrandr-1.3.4.tar.bz2;
-      sha256 = "1nsadgvn57b9way7v0s4yk2729rwqj1m5fbilmd38lfcws928jjy";
+      url = mirror://xorg/X11R7.7/src/everything/xrandr-1.3.5.tar.bz2;
+      sha256 = "03lq1c1q4w5cf2ijs4b34v008lshibha9zv5lw08xpyhk9xgyn8h";
     };
-    buildInputs = [pkgconfig libX11 libXrandr libXrender ];
-  })) // {inherit libX11 libXrandr libXrender ;};
+    buildInputs = [pkgconfig libX11 xproto libXrandr libXrender ];
+  })) // {inherit libX11 xproto libXrandr libXrender ;};
     
   xrdb = (stdenv.mkDerivation ((if overrides ? xrdb then overrides.xrdb else x: x) {
-    name = "xrdb-1.0.8";
+    name = "xrdb-1.0.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xrdb-1.0.8.tar.bz2;
-      sha256 = "1r2k50qnflj40iandhxhvnrvnhy4qliz5kymlh682455gjmlgn7z";
+      url = mirror://xorg/X11R7.7/src/everything/xrdb-1.0.9.tar.bz2;
+      sha256 = "1dza5a34nj68fzhlgwf18i5bk0n24ig28yihwpjy7vwn57hh2934";
     };
     buildInputs = [pkgconfig libX11 libXmu ];
   })) // {inherit libX11 libXmu ;};
@@ -2163,38 +2023,38 @@ let
     name = "xrefresh-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xrefresh-1.0.4.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xrefresh-1.0.4.tar.bz2;
       sha256 = "0ywxzwa4kmnnmf8idr8ssgcil9xvbhnk155zpsh2i8ay93mh5586";
     };
     buildInputs = [pkgconfig libX11 ];
   })) // {inherit libX11 ;};
     
   xset = (stdenv.mkDerivation ((if overrides ? xset then overrides.xset else x: x) {
-    name = "xset-1.2.1";
+    name = "xset-1.2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xset-1.2.1.tar.bz2;
-      sha256 = "18cja8b9xrilpshz0z8bkmpjm6pjb20w71xf41jgm70h4dymz6gc";
+      url = mirror://xorg/X11R7.7/src/everything/xset-1.2.2.tar.bz2;
+      sha256 = "1s61mvscd0h7y6anljarj7nkii6plhs8ndx1fm8b1f1h00a1qdv1";
     };
-    buildInputs = [pkgconfig libX11 libXext libXmu libXxf86misc ];
-  })) // {inherit libX11 libXext libXmu libXxf86misc ;};
+    buildInputs = [pkgconfig libX11 libXext libXmu xproto libXxf86misc ];
+  })) // {inherit libX11 libXext libXmu xproto libXxf86misc ;};
     
   xsetroot = (stdenv.mkDerivation ((if overrides ? xsetroot then overrides.xsetroot else x: x) {
     name = "xsetroot-1.1.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xsetroot-1.1.0.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xsetroot-1.1.0.tar.bz2;
       sha256 = "1bazzsf9sy0q2bj4lxvh1kvyrhmpggzb7jg575i15sksksa3xwc8";
     };
     buildInputs = [pkgconfig libX11 xbitmaps libXcursor libXmu ];
   })) // {inherit libX11 xbitmaps libXcursor libXmu ;};
     
   xtrans = (stdenv.mkDerivation ((if overrides ? xtrans then overrides.xtrans else x: x) {
-    name = "xtrans-1.2.6";
+    name = "xtrans-1.2.7";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xtrans-1.2.6.tar.bz2;
-      sha256 = "1im5kj6y8j8m9i5lf1c33dkag6sb7g1zmi0niydqrfyx0lvsgyf5";
+      url = mirror://xorg/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2;
+      sha256 = "19p1bw3qyn0ia1znx6q3gx92rr9rl88ylrfijjclm8vhpa8i30bz";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -2203,40 +2063,40 @@ let
     name = "xvinfo-1.1.1";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xvinfo-1.1.1.tar.bz2;
+      url = mirror://xorg/X11R7.7/src/everything/xvinfo-1.1.1.tar.bz2;
       sha256 = "119rd93d7661ll1rfcdssn78l0b97326smziyr2f5wdwj2hlmiv0";
     };
     buildInputs = [pkgconfig libX11 libXv ];
   })) // {inherit libX11 libXv ;};
     
   xwd = (stdenv.mkDerivation ((if overrides ? xwd then overrides.xwd else x: x) {
-    name = "xwd-1.0.4";
+    name = "xwd-1.0.5";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xwd-1.0.4.tar.bz2;
-      sha256 = "07mh72j794hwq5rnqkmdd4wj27mqmdc3da4jkwpva2hsj64wi9mp";
+      url = mirror://xorg/X11R7.7/src/everything/xwd-1.0.5.tar.bz2;
+      sha256 = "0fkg6msy2zg7rda2rpxb7j6vmrdmqmk72xsxnyhz97196ykjnx82";
     };
-    buildInputs = [pkgconfig libX11 ];
-  })) // {inherit libX11 ;};
+    buildInputs = [pkgconfig libX11 xproto ];
+  })) // {inherit libX11 xproto ;};
     
   xwininfo = (stdenv.mkDerivation ((if overrides ? xwininfo then overrides.xwininfo else x: x) {
-    name = "xwininfo-1.1.1";
+    name = "xwininfo-1.1.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xwininfo-1.1.1.tar.bz2;
-      sha256 = "0g9ll8hv0k5cjz4l5kdv64xzmalf9mpwjzcy8nx6myvh92z5fnk4";
+      url = mirror://xorg/X11R7.7/src/everything/xwininfo-1.1.2.tar.bz2;
+      sha256 = "0fmcr5yl03xw7m8p9h1rk67rrj7gp5x16a547xhmg8idw2f6r9lg";
     };
     buildInputs = [pkgconfig libX11 libxcb xproto ];
   })) // {inherit libX11 libxcb xproto ;};
     
   xwud = (stdenv.mkDerivation ((if overrides ? xwud then overrides.xwud else x: x) {
-    name = "xwud-1.0.3";
+    name = "xwud-1.0.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.6/src/everything/xwud-1.0.3.tar.bz2;
-      sha256 = "0hrc6gbipg7cximgkaxixlha9m2fph31dpzhzdfw7g63bkhfmzc8";
+      url = mirror://xorg/X11R7.7/src/everything/xwud-1.0.4.tar.bz2;
+      sha256 = "1ggql6maivah58kwsh3z9x1hvzxm1a8888xx4s78cl77ryfa1cyn";
     };
-    buildInputs = [pkgconfig libX11 ];
-  })) // {inherit libX11 ;};
+    buildInputs = [pkgconfig libX11 xproto ];
+  })) // {inherit libX11 xproto ;};
     
 }; in xorg
diff --git a/pkgs/servers/x11/xorg/extra.list b/pkgs/servers/x11/xorg/extra.list
index 744eb66d84c..f7f139b19c1 100644
--- a/pkgs/servers/x11/xorg/extra.list
+++ b/pkgs/servers/x11/xorg/extra.list
@@ -1,8 +1,7 @@
-mirror://xorg/individual/driver/xf86-video-intel-2.14.901.tar.bz2:xf86videointel_2_14_901
-mirror://xorg/individual/driver/xf86-video-intel-2.17.0.tar.bz2:xf86videointel_2_17_0
-mirror://xorg/individual/lib/pixman-0.20.2.tar.bz2
-mirror://xorg/individual/xcb/xcb-util-0.3.8.tar.bz2
-mirror://xorg/individual/xcb/xcb-util-image-0.3.8.tar.bz2
-mirror://xorg/individual/xcb/xcb-util-keysyms-0.3.8.tar.bz2
+mirror://xorg/individual/lib/pixman-0.26.2.tar.bz2
+mirror://xorg/individual/xcb/xcb-util-0.3.9.tar.bz2
+mirror://xorg/individual/xcb/xcb-util-image-0.3.9.tar.bz2
+mirror://xorg/individual/xcb/xcb-util-keysyms-0.3.9.tar.bz2
 mirror://xorg/individual/xcb/xcb-util-renderutil-0.3.8.tar.bz2
-mirror://xorg/individual/xcb/xcb-util-wm-0.3.8.tar.bz2
+mirror://xorg/individual/xcb/xcb-util-wm-0.3.9.tar.bz2
+mirror://xorg/individual/xserver/xorg-server-1.13.0.tar.bz2:xorgserver_1_13_0
diff --git a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
index 89edb571e0f..7b00e5e9043 100755
--- a/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
+++ b/pkgs/servers/x11/xorg/generate-expr-from-tarballs.pl
@@ -169,7 +169,7 @@ while (<>) {
     }
 
     if ($file =~ /XORG_FONT_UCS2ANY/) {
-        push @requires, "fontutil";
+        push @requires, "fontutil", "mkfontscale";
         $isFont = 1;
     }
 
diff --git a/pkgs/servers/x11/xorg/old.list b/pkgs/servers/x11/xorg/old.list
index 5eacf46d1c3..94fae784488 100644
--- a/pkgs/servers/x11/xorg/old.list
+++ b/pkgs/servers/x11/xorg/old.list
@@ -1,15 +1,15 @@
-mirror://xorg/individual/app/twm-1.0.6.tar.bz2
-mirror://xorg/individual/app/xclock-1.0.5.tar.bz2
-mirror://xorg/individual/app/xdm-1.1.10.tar.bz2
+mirror://xorg/individual/app/twm-1.0.7.tar.bz2
+mirror://xorg/individual/app/xclock-1.0.6.tar.bz2
+mirror://xorg/individual/app/xdm-1.1.11.tar.bz2
 mirror://xorg/individual/app/xeyes-1.1.1.tar.bz2
-mirror://xorg/individual/app/xfs-1.1.1.tar.bz2
-mirror://xorg/individual/app/xinit-1.3.0.tar.bz2
+mirror://xorg/individual/app/xfs-1.1.2.tar.bz2
+mirror://xorg/individual/app/xinit-1.3.2.tar.bz2
 mirror://xorg/individual/app/xmessage-1.0.3.tar.bz2
 mirror://xorg/individual/lib/libXp-1.0.1.tar.bz2
 mirror://xorg/individual/lib/libXxf86misc-1.0.3.tar.bz2
 mirror://xorg/individual/proto/printproto-1.0.5.tar.bz2
 mirror://xorg/individual/proto/xf86miscproto-0.9.3.tar.bz2
 mirror://xorg/individual/util/gccmakedep-1.0.2.tar.bz2
-mirror://xorg/individual/util/imake-1.0.4.tar.bz2
-mirror://xorg/individual/util/lndir-1.0.2.tar.bz2
+mirror://xorg/individual/util/imake-1.0.5.tar.bz2
+mirror://xorg/individual/util/lndir-1.0.3.tar.bz2
 mirror://xorg/individual/util/xorg-cf-files-1.0.4.tar.bz2
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 46903124568..e5b7a9a3402 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -8,6 +8,10 @@ let
 in
 {
 
+  fontcursormisc = attrs: attrs // {
+    buildInputs = attrs.buildInputs ++ [ xorg.mkfontscale ];
+  };
+
   fontmiscmisc = attrs: attrs // {
     postInstall =
       ''
@@ -24,7 +28,7 @@ in
   };
 
   mkfontdir = attrs: attrs // {
-    preBuild = "substituteInPlace mkfontdir.cpp --replace BINDIR ${xorg.mkfontscale}/bin";
+    preBuild = "substituteInPlace mkfontdir.in --replace @bindir@ ${xorg.mkfontscale}/bin";
   };
 
   libxcb = attrs : attrs // {
@@ -33,18 +37,18 @@ in
     # I should use: builtins.unsafeDiscardStringContext
     buildInputs = [args.pkgconfig args.libxslt xorg.libpthreadstubs /*xorg.python*/
         xorg.libXau xorg.xcbproto xorg.libXdmcp ] ++ [ xorg.xproto ];
-    buildNativeInputs = [ args.python ];
+    nativeBuildInputs = [ args.python ];
   };
 
   xcbproto = attrs : attrs // {
     # I only remove python from the original.
     buildInputs = [args.pkgconfig  /*xorg.python*/ ];
-    buildNativeInputs = [ args.python ];
+    nativeBuildInputs = [ args.python ];
   };
 
   pixman = attrs : attrs // {
     buildInputs = [ args.pkgconfig ];
-    buildNativeInputs = [ args.perl ];
+    nativeBuildInputs = [ args.perl ];
   };
 
   libpciaccess = attrs : attrs // {
@@ -83,21 +87,19 @@ in
   compositeproto = attrs: attrs // {
     propagatedBuildInputs = [ xorg.fixesproto ];
   };
-  
+
   libXcomposite = attrs: attrs // {
     propagatedBuildInputs = [ xorg.libXfixes ];
   };
-  
+
   libXaw = attrs: attrs // {
     propagatedBuildInputs = [ xorg.libXmu ];
   };
-  
+
   libXft = attrs: attrs // {
     buildInputs = attrs.buildInputs ++
       [ xorg.xproto xorg.libX11 xorg.renderproto ];
-    # probably, fontconfig and freetype could be added
-    # pkgconfig seems to be nice, too...
-    propagatedBuildInputs = [ xorg.libXrender ];
+    propagatedBuildInputs = [ xorg.libXrender args.freetype args.fontconfig ];
     preConfigure = setMalloc0ReturnsNullCrossCompiling;
   };
 
@@ -124,35 +126,85 @@ in
     buildInputs = attrs.buildInputs ++ [ args.freetype args.fontconfig ];
   };
 
+  xev = attrs: attrs // {
+    buildInputs = attrs.buildInputs ++ [ xorg.libXrender ];
+  };
+
   xf86inputevdev = attrs: attrs // {
     preBuild = "sed -e '/motion_history_proc/d; /history_size/d;' -i src/*.c";
-    buildInputs = attrs.buildInputs ++ [xorg.kbproto xorg.libxkbfile xorg.randrproto];
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.kbproto xorg.libxkbfile xorg.randrproto xorg.pixman];
     installFlags = "sdkdir=\${out}/include/xorg";
   };
 
+  xf86inputkeyboard = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86inputmouse = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
   xf86inputsynaptics = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [args.mtdev xorg.pixman];
     installFlags = "sdkdir=\${out}/include/xorg configdir=\${out}/include/xorg";
   };
 
+  xf86inputvoid = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
   xf86videointel = attrs: attrs // {
     buildInputs = attrs.buildInputs ++ [xorg.glproto args.mesa];
   };
 
   xf86videosis = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
     buildInputs = attrs.buildInputs ++ [xorg.glproto args.mesa];
   };
 
   xf86videoati = attrs: attrs // {
-    buildInputs = attrs.buildInputs ++ [xorg.glproto args.mesa];
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.glproto args.mesa xorg.pixman];
   };
 
-  xf86videoopenchrome = attrs: attrs // rec {
-    name = "xf86-video-openchrome-0.2.905";
-    src = args.fetchurl {
-      url = "http://openchrome.org/releases/${name}.tar.bz2";
-      sha256 = "1llbm020s0fck9chs0906xz7jr4h3whxan4s10ls9046g7xib3qc";
-    };
-    buildInputs = attrs.buildInputs ++ [xorg.glproto args.mesa xorg.libXext];
+  xf86videocirrus = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86videodummy = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86videofbdev = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86videoopenchrome = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman xorg.glproto args.mesa];
+  };
+
+  xf86videonv = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86videovesa = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman];
+  };
+
+  xf86videovmware = attrs: attrs // {
+    NIX_CFLAGS_COMPILE = "-I${xorg.pixman}/include/pixman-1";
+    buildInputs = attrs.buildInputs ++ [xorg.pixman xorg.glproto args.mesa];
   };
 
   xdriinfo = attrs: attrs // {
@@ -168,7 +220,8 @@ in
   };
 
   xorgserver = attrs: attrs // {
-    patches = [./xorgserver-dri-path.patch ./xorgserver-xkbcomp-path.patch];
+    configureFlags = "--enable-xcsecurity"; # enable SECURITY extension
+    patches = [./xorgserver-dri-path.patch ./xorgserver-xkbcomp-path.patch ./xorgserver12-CVE-1940.patch];
     buildInputs = attrs.buildInputs ++
       [ args.zlib args.udev args.mesa args.dbus.libs
         xorg.xf86bigfontproto xorg.glproto xorg.xf86driproto
@@ -176,6 +229,7 @@ in
         xorg.xineramaproto xorg.xf86dgaproto
         xorg.dmxproto xorg.libdmx xorg.xf86vidmodeproto
         xorg.recordproto xorg.libXext xorg.pixman xorg.libXfont
+        xorg.damageproto xorg.xcmiscproto xorg.xtrans xorg.bigreqsproto
       ];
     propagatedBuildInputs =
       [ xorg.libpciaccess xorg.inputproto xorg.xextproto xorg.randrproto
@@ -188,10 +242,32 @@ in
       '';
   };
 
-  libSM = attrs: attrs // args.stdenv.lib.optionalAttrs (args.stdenv.system == "i686-darwin") {
-    configureFlags = "LIBUUID_CFLAGS='' LIBUUID_LIBS=''";
+  xorgserver_1_13_0 = attrs: attrs // {
+    configureFlags = "--enable-xcsecurity"; # enable SECURITY extension
+    patches = [./xorgserver-dri-path.patch ./xorgserver-xkbcomp-path.patch];
+    buildInputs = attrs.buildInputs ++
+      [ args.zlib args.udev args.mesa args.dbus.libs
+        xorg.xf86bigfontproto xorg.glproto xorg.xf86driproto
+        xorg.compositeproto xorg.scrnsaverproto xorg.resourceproto
+        xorg.xineramaproto xorg.xf86dgaproto
+        xorg.dmxproto xorg.libdmx xorg.xf86vidmodeproto
+        xorg.recordproto xorg.libXext xorg.pixman xorg.libXfont
+        xorg.damageproto xorg.xcmiscproto xorg.xtrans xorg.bigreqsproto
+      ];
+    propagatedBuildInputs =
+      [ xorg.libpciaccess xorg.inputproto xorg.xextproto xorg.randrproto
+        xorg.dri2proto xorg.kbproto
+      ];
+    postInstall =
+      ''
+        rm -fr $out/share/X11/xkb/compiled
+        ln -s /var/tmp $out/share/X11/xkb/compiled
+      '';
   };
 
+  libSM = attrs: attrs
+    // { propagatedBuildInputs = [ xorg.libICE ]; };
+
   lndir = attrs: attrs // {
     preConfigure = ''
       substituteInPlace lndir.c \
@@ -200,11 +276,26 @@ in
   };
 
   twm = attrs: attrs // {
-    buildNativeInputs = [args.bison args.flex];
+    nativeBuildInputs = [args.bison args.flex];
   };
 
   xbacklight = attrs: attrs // {
     buildInputs = attrs.buildInputs ++ [xorg.libXrender];
   };
 
+  xinput = attrs: attrs // {
+    buildInputs = attrs.buildInputs ++ [xorg.libXrender];
+  };
+
+  xinit = attrs: attrs // {
+    configureFlags = "--with-xserver=${xorg.xorgserver}/bin/X";
+    propagatedBuildInputs = [ xorg.xauth ];
+    prePatch = ''
+      sed -i 's|^defaultserverargs="|&-logfile \"$HOME/.xorg.log\"|p' startx.cpp
+    '';
+  };
+
+  xwd = attrs: attrs // {
+    buildInputs = attrs.buildInputs ++ [xorg.libXt];
+  };
 }
diff --git a/pkgs/servers/x11/xorg/tarballs-7.6.list b/pkgs/servers/x11/xorg/tarballs-7.6.list
deleted file mode 100644
index 613c3107c86..00000000000
--- a/pkgs/servers/x11/xorg/tarballs-7.6.list
+++ /dev/null
@@ -1,199 +0,0 @@
-mirror://xorg/X11R7.6/src/everything/applewmproto-1.4.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/bdftopcf-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/bigreqsproto-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/compositeproto-0.4.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/damageproto-1.2.1.tar.bz2
-mirror://xorg/individual/proto/dri2proto-2.6.tar.bz2
-mirror://xorg/individual/proto/dmxproto-2.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/encodings-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/fixesproto-4.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-adobe-100dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-adobe-75dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-alias-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-arabic-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-100dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-75dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-ttf-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bh-type1-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-bitstream-type1-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-cursor-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-daewoo-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-dec-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-ibm-type1-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-isas-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-jis-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-micro-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-misc-cyrillic-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-misc-ethiopic-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-misc-meltho-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-misc-misc-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-mutt-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-schumacher-misc-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-screen-cyrillic-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-sony-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/fontsproto-2.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-sun-misc-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-util-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/font-xfree86-type1-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/glproto-1.4.12.tar.bz2
-mirror://xorg/X11R7.6/src/everything/iceauth-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/inputproto-2.0.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/kbproto-1.0.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libAppleWM-1.4.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libdmx-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libfontenc-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libFS-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libICE-1.0.7.tar.bz2
-mirror://xorg/individual/lib/libpciaccess-0.12.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libpthread-stubs-0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libSM-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libWindowsWM-1.0.1.tar.bz2
-mirror://xorg/individual/lib/libX11-1.4.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXau-1.0.6.tar.bz2
-mirror://xorg/individual/lib/libXaw-1.0.9.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libxcb-1.7.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXcomposite-0.4.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXcursor-1.1.11.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXdamage-1.1.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXdmcp-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXext-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXfixes-4.0.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXfont-1.4.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXft-2.2.0.tar.bz2
-mirror://xorg/individual/lib/libXi-1.4.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXinerama-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libxkbfile-1.0.7.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXmu-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXpm-3.5.9.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXrandr-1.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXrender-0.9.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXres-1.0.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXScrnSaver-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXt-1.0.9.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXtst-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXv-1.0.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXvMC-1.0.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXxf86dga-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/libXxf86vm-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/luit-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/makedepend-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/mkfontdir-1.0.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/mkfontscale-1.0.8.tar.bz2
-mirror://xorg/X11R7.6/src/everything/randrproto-1.3.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/recordproto-1.14.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/renderproto-0.11.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/resourceproto-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/scrnsaverproto-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/sessreg-1.0.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/setxkbmap-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/smproxy-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/util-macros-1.11.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/videoproto-2.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/windowswmproto-1.0.4.tar.bz2
-mirror://xorg/individual/app/x11perf-1.5.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xauth-1.0.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xbacklight-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xbitmaps-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xcb-proto-1.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xcmiscproto-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xcmsdb-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xcursorgen-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xcursor-themes-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xdpyinfo-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xdriinfo-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xev-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xextproto-7.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86bigfontproto-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86dgaproto-2.1.tar.bz2
-mirror://xorg/individual/proto/xf86driproto-2.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-acecad-1.4.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-aiptek-1.3.1.tar.bz2
-mirror://xorg/individual/driver/xf86-input-evdev-2.6.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-joystick-1.5.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-keyboard-1.5.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-mouse-1.6.0.tar.bz2
-mirror://xorg/individual/driver/xf86-input-synaptics-1.5.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-vmmouse-12.6.10.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-input-void-1.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-apm-1.2.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-ark-0.7.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-ast-0.91.10.tar.bz2
-mirror://xorg/individual/driver/xf86-video-ati-6.14.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-chips-1.2.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-cirrus-1.3.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-dummy-0.3.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-fbdev-0.4.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-geode-2.11.10.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-glide-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-glint-1.2.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-i128-1.3.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-i740-1.3.2.tar.bz2
-mirror://xorg/individual/driver/xf86-video-intel-2.15.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-mach64-6.8.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-mga-1.4.13.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-neomagic-1.2.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-newport-0.2.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-nv-2.1.18.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-openchrome-0.2.904.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-r128-6.8.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-rendition-4.2.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-s3-0.6.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-s3virge-1.10.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-savage-2.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-siliconmotion-1.7.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-sis-0.10.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-sisusb-0.9.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-suncg14-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-suncg3-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-suncg6-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-sunffb-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-sunleo-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-suntcx-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-tdfx-1.4.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-tga-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-trident-1.3.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-tseng-1.2.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-v4l-0.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-vesa-2.3.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-vmware-11.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-voodoo-1.2.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-wsfb-0.3.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-xgi-1.6.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xf86-video-xgixp-1.8.0.tar.bz2
-mirror://xorg/individual/proto/xf86vidmodeproto-2.3.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xgamma-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xhost-1.0.4.tar.bz2
-mirror://xorg/individual/proto/xineramaproto-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xinput-1.5.3.tar.bz2
-mirror://xorg/individual/app/xkbcomp-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xkbevd-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xkbutils-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xkill-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xlsatoms-1.1.0.tar.bz2
-mirror://xorg/individual/app/xlsclients-1.1.2.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xmodmap-1.0.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xorg-docs-1.6.tar.bz2
-mirror://xorg/individual/xserver/xorg-server-1.9.5.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xorg-sgml-doctools-1.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xpr-1.0.3.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xprop-1.2.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xproto-7.0.20.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xrandr-1.3.4.tar.bz2
-mirror://xorg/individual/app/xrdb-1.0.8.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xrefresh-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xset-1.2.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xsetroot-1.1.0.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xtrans-1.2.6.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xvinfo-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xwd-1.0.4.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xwininfo-1.1.1.tar.bz2
-mirror://xorg/X11R7.6/src/everything/xwud-1.0.3.tar.bz2
diff --git a/pkgs/servers/x11/xorg/tarballs-7.7.list b/pkgs/servers/x11/xorg/tarballs-7.7.list
new file mode 100644
index 00000000000..7b361636264
--- /dev/null
+++ b/pkgs/servers/x11/xorg/tarballs-7.7.list
@@ -0,0 +1,184 @@
+mirror://xorg/X11R7.7/src/everything/applewmproto-1.4.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/bdftopcf-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/bigreqsproto-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/compositeproto-0.4.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/damageproto-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/dmxproto-2.3.1.tar.bz2
+mirror://xorg/individual/proto/dri2proto-2.8.tar.bz2
+mirror://xorg/X11R7.7/src/everything/encodings-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/fixesproto-5.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-adobe-100dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-adobe-75dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-100dpi-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-75dpi-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-adobe-utopia-type1-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-alias-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-arabic-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-100dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-75dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-lucidatypewriter-100dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-lucidatypewriter-75dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-ttf-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bh-type1-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bitstream-100dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bitstream-75dpi-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-bitstream-type1-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-cronyx-cyrillic-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-cursor-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-daewoo-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-dec-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-ibm-type1-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-isas-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-jis-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-micro-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-misc-cyrillic-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-misc-ethiopic-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-misc-meltho-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-misc-misc-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-mutt-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-schumacher-misc-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-screen-cyrillic-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-sony-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/fontsproto-2.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-sun-misc-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-util-1.3.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-winitzki-cyrillic-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/font-xfree86-type1-1.0.4.tar.bz2
+mirror://xorg/individual/proto/glproto-1.4.16.tar.bz2
+mirror://xorg/X11R7.7/src/everything/iceauth-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/inputproto-2.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/kbproto-1.0.6.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libAppleWM-1.4.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libdmx-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libfontenc-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libFS-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libICE-1.0.8.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libpciaccess-0.13.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libpthread-stubs-0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libSM-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libWindowsWM-1.0.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libX11-1.5.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXau-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXaw-1.0.11.tar.bz2
+mirror://xorg/individual/xcb/libxcb-1.9.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXcomposite-0.4.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXcursor-1.1.13.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXdamage-1.1.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXdmcp-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXext-1.3.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXfixes-5.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXfont-1.4.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXft-2.3.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXi-1.6.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXinerama-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libxkbfile-1.0.8.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXmu-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXpm-3.5.10.tar.bz2
+mirror://xorg/individual/lib/libXrandr-1.4.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXrender-0.9.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXres-1.0.6.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXScrnSaver-1.2.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXt-1.1.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXtst-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXv-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXvMC-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXxf86dga-1.1.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/libXxf86vm-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/luit-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/makedepend-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/mkfontdir-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/mkfontscale-1.1.0.tar.bz2
+mirror://xorg/individual/proto/randrproto-1.4.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/recordproto-1.14.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/renderproto-0.11.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/resourceproto-1.2.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/scrnsaverproto-1.2.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/sessreg-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/setxkbmap-1.3.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/smproxy-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/util-macros-1.17.tar.bz2
+mirror://xorg/X11R7.7/src/everything/videoproto-2.3.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/windowswmproto-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/x11perf-1.5.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xauth-1.0.7.tar.bz2
+mirror://xorg/individual/app/xbacklight-1.2.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xbitmaps-1.1.1.tar.bz2
+mirror://xorg/individual/xcb/xcb-proto-1.8.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xcmiscproto-1.2.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xcmsdb-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xcursorgen-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xcursor-themes-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xdpyinfo-1.3.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xdriinfo-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xev-1.2.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xextproto-7.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86bigfontproto-1.2.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86dgaproto-2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86driproto-2.1.1.tar.bz2
+mirror://xorg/individual/driver/xf86-input-evdev-2.7.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-input-joystick-1.6.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-input-keyboard-1.6.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-input-mouse-1.7.2.tar.bz2
+mirror://xorg/individual/driver/xf86-input-synaptics-1.6.2.tar.bz2
+mirror://xorg/individual/driver/xf86-input-vmmouse-12.9.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-input-void-1.4.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-ark-0.7.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-ast-0.93.10.tar.bz2
+mirror://xorg/individual/driver/xf86-video-ati-6.14.4.tar.bz2
+mirror://xorg/individual/driver/xf86-video-cirrus-1.5.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-dummy-0.3.5.tar.bz2
+mirror://xorg/individual/driver/xf86-video-fbdev-0.4.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-geode-2.11.13.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-glide-1.2.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-glint-1.2.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-i128-1.3.5.tar.bz2
+mirror://xorg/individual/driver/xf86-video-intel-2.20.10.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-mach64-6.9.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-mga-1.5.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-neomagic-1.2.6.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-newport-0.2.4.tar.bz2
+mirror://xorg/individual/driver/xf86-video-nv-2.1.20.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-openchrome-0.2.906.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-r128-6.8.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-savage-2.3.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-siliconmotion-1.7.6.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-sis-0.10.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-suncg6-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-sunffb-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-tdfx-1.4.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-tga-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-trident-1.3.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-v4l-0.2.0.tar.bz2
+mirror://xorg/individual/driver/xf86-video-vesa-2.3.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-vmware-12.0.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-voodoo-1.2.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86-video-wsfb-0.4.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xf86vidmodeproto-2.3.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xgamma-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xhost-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xineramaproto-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xinput-1.6.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xkbcomp-1.2.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xkbevd-1.1.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xkbutils-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xkeyboard-config-2.6.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xkill-1.0.3.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xlsatoms-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xlsclients-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xmodmap-1.0.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xorg-docs-1.7.tar.bz2
+mirror://xorg/individual/xserver/xorg-server-1.12.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xorg-sgml-doctools-1.11.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xpr-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xprop-1.2.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xproto-7.0.23.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xrandr-1.3.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xrdb-1.0.9.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xrefresh-1.0.4.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xset-1.2.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xsetroot-1.1.0.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xtrans-1.2.7.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xvinfo-1.1.1.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xwd-1.0.5.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xwininfo-1.1.2.tar.bz2
+mirror://xorg/X11R7.7/src/everything/xwud-1.0.4.tar.bz2
diff --git a/pkgs/servers/x11/xorg/unichrome/default.nix b/pkgs/servers/x11/xorg/unichrome/default.nix
index 5cc26338c95..720ccd10158 100644
--- a/pkgs/servers/x11/xorg/unichrome/default.nix
+++ b/pkgs/servers/x11/xorg/unichrome/default.nix
@@ -1,24 +1,25 @@
 {stdenv, fetchgit, pkgconfig, fontsproto, libdrm, libpciaccess, randrproto, renderproto,
 videoproto, libX11,
 xextproto, xf86driproto, xorgserver, xproto, libXvMC, glproto, mesa, automake,
-autoconf, libtool, libXext, utilmacros}:
+autoconf, libtool, libXext, utilmacros, pixman}:
 
 stdenv.mkDerivation {
   name = "xf86-video-unichrome-git";
   src = fetchgit {
-    url = "git://anongit.freedesktop.org/~libv/xf86-video-unichrome";
+    url = "git://people.freedesktop.org/~libv/xf86-video-unichrome";
     md5 = "6e5e0f8ee204af2385a02e502d1ca8f1";
     rev = "6260e0fc9f0754d101dda014a8f4b5f76f58e978";
   };
   buildInputs = [pkgconfig fontsproto libdrm libpciaccess randrproto renderproto
     videoproto libX11 libXext xextproto xf86driproto xorgserver xproto libXvMC
-    glproto mesa automake autoconf libtool libXext utilmacros ];
+    glproto mesa automake autoconf libtool libXext utilmacros pixman ];
   preConfigure = "chmod +x autogen.sh";
   prePatch = ''
     sed s,/bin/bash,/bin/sh, -i git_version.sh
   '';
   patches = [ ./configure.patch ];
   configureScript = "./autogen.sh";
+  CFLAGS="-I${pixman}/include/pixman-1";
 
   meta = {
     homepage = "http://unichrome.sourceforge.net/";
diff --git a/pkgs/servers/x11/xorg/xorgserver-dri-path.patch b/pkgs/servers/x11/xorg/xorgserver-dri-path.patch
index 30e423ba3cb..3a5f061eb9a 100644
--- a/pkgs/servers/x11/xorg/xorgserver-dri-path.patch
+++ b/pkgs/servers/x11/xorg/xorgserver-dri-path.patch
@@ -1,52 +1,19 @@
-diff --git a/glx/glxdri.c b/glx/glxdri.c
-index 6122653..3f5fc2b 100644
---- a/glx/glxdri.c
-+++ b/glx/glxdri.c
-@@ -1042,8 +1042,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
- 	goto handle_error;
-     }
+diff -Naur xorg-server-1.12.2-orig/glx/glxdricommon.c xorg-server-1.12.2/glx/glxdricommon.c
+--- xorg-server-1.12.2-orig/glx/glxdricommon.c	2012-05-17 13:09:02.000000000 -0400
++++ xorg-server-1.12.2/glx/glxdricommon.c	2012-07-14 14:57:37.972791909 -0400
+@@ -219,10 +219,14 @@
+     int i;
+     void *driver;
+     char filename[PATH_MAX];
++    char *real_dri_driver_path;
+     const __DRIextension **extensions;
  
-+    char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
++    real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
 +    if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
 +
      snprintf(filename, sizeof filename, "%s/%s_dri.so",
 -             dri_driver_path, driverName);
 +             real_dri_driver_path, driverName);
  
-     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-     if (screen->driver == NULL) {
-diff --git a/glx/glxdri2.c b/glx/glxdri2.c
-index ed7fb4c..135b1c8 100644
---- a/glx/glxdri2.c
-+++ b/glx/glxdri2.c
-@@ -617,8 +617,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
- 
-     __glXInitExtensionEnableBits(screen->glx_enable_bits);
- 
--    snprintf(filename, sizeof filename,
--	     "%s/%s_dri.so", dri_driver_path, driverName);
-+     char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
-+     if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
-+ 
-+     snprintf(filename, sizeof filename, "%s/%s_dri.so",
-+              real_dri_driver_path, driverName);
- 
-     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-     if (screen->driver == NULL) {
-diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
-index 44f658f..8922414 100644
---- a/glx/glxdriswrast.c
-+++ b/glx/glxdriswrast.c
-@@ -458,8 +458,11 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
-     screen->base.swapInterval   = NULL;
-     screen->base.pScreen       = pScreen;
- 
-+    char *real_dri_driver_path = getenv("XORG_DRI_DRIVER_PATH");
-+    if (!real_dri_driver_path) real_dri_driver_path = dri_driver_path;
-+
-     snprintf(filename, sizeof filename,
--	     "%s/%s_dri.so", dri_driver_path, driverName);
-+	     "%s/%s_dri.so", real_dri_driver_path, driverName);
- 
-     screen->driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
-     if (screen->driver == NULL) {
+     driver = dlopen(filename, RTLD_LAZY | RTLD_LOCAL);
+     if (driver == NULL) {
diff --git a/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch b/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
index 825d09ba1e0..f5196c60c7c 100644
--- a/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
+++ b/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
@@ -9,7 +9,7 @@ diff -rc xorg-server-X11R7.2-1.2.0-orig/xkb/xkbInit.c xorg-server-X11R7.2-1.2.0/
       }
 +     char *xkbBinDir = getenv("XKB_BINDIR");
 +     if (xkbBinDir)
-+         XkbBinDirectory = _XkbDupString(xkbBinDir);
++         XkbBinDirectory = Xstrdup(xkbBinDir);
       return 0;
   }
   
diff --git a/pkgs/servers/x11/xorg/xorgserver.sh b/pkgs/servers/x11/xorg/xorgserver.sh
deleted file mode 100644
index 0beb09d61a7..00000000000
--- a/pkgs/servers/x11/xorg/xorgserver.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# There is a dependency somewhere on `-ldl', which Make treats
-# specially by mapping it to /usr/lib/libdl.so.  That won't work on
-# NixOS, so force Make to search in our own Glibc.
-export VPATH=$(cat ${NIX_GCC}/nix-support/orig-libc)/lib
-
-preConfigure() {
-    unpackFile $mesaSrc
-    configureFlags="$configureFlags --with-mesa-source=$(ls -d $(pwd)/Mesa-*)"
-}
\ No newline at end of file
diff --git a/pkgs/servers/x11/xorg/xorgserver12-CVE-1940.patch b/pkgs/servers/x11/xorg/xorgserver12-CVE-1940.patch
new file mode 100644
index 00000000000..d85494f9029
--- /dev/null
+++ b/pkgs/servers/x11/xorg/xorgserver12-CVE-1940.patch
@@ -0,0 +1,34 @@
+From 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f Mon Sep 17 00:00:00 2001
+From: Dave Airlie <airlied@gmail.com>
+Date: Wed, 10 Apr 2013 06:09:01 +0000
+Subject: xf86: fix flush input to work with Linux evdev devices.
+
+So when we VT switch back and attempt to flush the input devices,
+we don't succeed because evdev won't return part of an event,
+since we were only asking for 4 bytes, we'd only get -EINVAL back.
+
+This could later cause events to be flushed that we shouldn't have
+gotten.
+
+This is a fix for CVE-2013-1940.
+
+Signed-off-by: Dave Airlie <airlied@redhat.com>
+Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
+Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
+---
+diff --git a/hw/xfree86/os-support/shared/posix_tty.c b/hw/xfree86/os-support/shared/posix_tty.c
+index ab3757a..4d08c1e 100644
+--- a/hw/xfree86/os-support/shared/posix_tty.c
++++ b/hw/xfree86/os-support/shared/posix_tty.c
+@@ -421,7 +421,8 @@ xf86FlushInput(int fd)
+ {
+     fd_set fds;
+     struct timeval timeout;
+-    char c[4];
++    /* this needs to be big enough to flush an evdev event. */
++    char c[256];
+ 
+     DebugF("FlushingSerial\n");
+     if (tcflush(fd, TCIFLUSH) == 0)
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/pkgs/servers/xinetd/default.nix b/pkgs/servers/xinetd/default.nix
index 6f752a7194f..c841f8431de 100644
--- a/pkgs/servers/xinetd/default.nix
+++ b/pkgs/servers/xinetd/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "xinetd-2.3.14";
-  
+  name = "xinetd-2.3.15";
+
   src = fetchurl {
     url = "http://www.xinetd.org/${name}.tar.gz";
-    sha256 = "07xws1ydxrrx4xinvfqkc66diwfjh2apxz33xw4hb6k0gihhw3kn";
+    sha256 = "1qsv1al506x33gh92bqa8w21k7mxqrbsrwmxvkj0amn72420ckmz";
   };
 
   meta = {
diff --git a/pkgs/servers/xmpp/pyMAILt/default.nix b/pkgs/servers/xmpp/pyMAILt/default.nix
index e763d2dce5b..9e3877735d6 100644
--- a/pkgs/servers/xmpp/pyMAILt/default.nix
+++ b/pkgs/servers/xmpp/pyMAILt/default.nix
@@ -33,7 +33,7 @@ rec {
     chmod a+rx  $out/bin/pyMAILt $out/share/${name}/mail.py
   '') ["minInit" "addInputs" "doUnpack" "defEnsureDir"];
       
-  name = "pyMAILt";
+  name = "pyMAILt-20090101";
   meta = {
     description = "Email transport module for XMPP";
   };
diff --git a/pkgs/shells/bash-completion/default.nix b/pkgs/shells/bash-completion/default.nix
index d79c9774569..a189ed29d8c 100644
--- a/pkgs/shells/bash-completion/default.nix
+++ b/pkgs/shells/bash-completion/default.nix
@@ -1,21 +1,13 @@
 { stdenv, fetchurl }:
 
-let
-  version = "2.0";
-in
-stdenv.mkDerivation {
-  name = "bash-completion-${version}";
+stdenv.mkDerivation rec {
+  name = "bash-completion-2.1";
 
   src = fetchurl {
-    url = "http://bash-completion.alioth.debian.org/files/bash-completion-${version}.tar.bz2";
-    sha256 = "e5a490a4301dfb228361bdca2ffca597958e47dd6056005ef9393a5852af5804";
+    url = "http://bash-completion.alioth.debian.org/files/${name}.tar.bz2";
+    sha256 = "0kxf8s5bw7y50x0ksb77d3kv0dwadixhybl818w27y6mlw26hq1b";
   };
 
-  postInstall = ''
-    sed -i "$out/share/bash-completion/bash_completion" \
-        -e 's|: .{BASH_COMPLETION_COMPAT_DIR:=.*}|BASH_COMPLETION_COMPAT_DIR="$HOME/.nix-profile/etc/bash_completion.d"|'
-  '';
-
   doCheck = true;
 
   meta = {
@@ -23,6 +15,7 @@ stdenv.mkDerivation {
     description = "Programmable completion for the bash shell";
     license = "GPL";
 
+    platforms = stdenv.lib.platforms.unix;
     maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/shells/bash/bash-4.2-patches.nix b/pkgs/shells/bash/bash-4.2-patches.nix
index 8d2a74e95b0..52392f4b32c 100644
--- a/pkgs/shells/bash/bash-4.2-patches.nix
+++ b/pkgs/shells/bash/bash-4.2-patches.nix
@@ -25,4 +25,22 @@ patch: [
 (patch "022" "0sswp2c63pclvdwi2hbkwbqf9ysmiw6mmi0qinl2pkgqyyfzdkcx")
 (patch "023" "1gzhcmwj0741libjqwln4r4h9k7lskprc4q87hvqgj56y6a17hax")
 (patch "024" "1rlrdfk67g8as6pr076ldhjhnkd2c86mb4ci18fjivivsfyjdj4r")
+(patch "025" "05am4w789v630x0a6a9wrxhvrjvs73fjn68i55qdand5sxpn9c0d")
+(patch "026" "1li3sd3hpdxhh257hdwzzn2g18m4ksflx6crqswv9qxwmgx0rsg7")
+(patch "027" "0hpdywvny6vihls2qqlwwxkvps7q710vp6szq117zhgwarr6n7qc")
+(patch "028" "0ypdn590h5f8y7kvk2sk93vcjbh5vrcwsaasvprsm0ds77g2chi0")
+(patch "029" "10gm73rvfhr42v7i70qqc56wl8l459i2frs6ifrcsnmw2w48rc6h")
+(patch "030" "1bmg8iz95jijxp89czwaw9msppgj220233nbrn66s4qsb5k46n8j")
+(patch "031" "1yfrz093hghhlrj8na48dzc8v6ax34mj5i0h6l3bnpvp6i6qrwsm")
+(patch "032" "1vci8xh1r8f59j6d95iljw9i555jm1fm2lssm1ycprdivdivba73")
+(patch "033" "0js38r5gmlyz70zjfw0m2j08h26c3vma2vy8gbsb5pwzss82glgm")
+(patch "034" "1f213qpvqnv2bm79a01r44xjlwk65483cxvw6kgwx28k20rg7h81")
+(patch "035" "1pvqxpm7m1y7ab5srq3s7r095z34nbcr62gz6nb89d1qn1iy9kff")
+(patch "036" "1yma0m9wrk6a15x36libb8a0cz7gmzihv6lvmrrd5i1ar4dklagy")
+(patch "037" "0x0niqv7zwqvz4l8n9nivhk0g0036jh5h3vlkil3095vsgfqqmy7")
+(patch "038" "0mvdpsxxs4bn5zvsm04yfsplhcrv6y0avpwilj5yasr0vwdsijdq")
+(patch "039" "148pkj5s73ym0jhpr8d3z5vfily4chm0am4yms4506ijc0531ygl")
+(patch "040" "0v5a98ybibwsd4iyh18gy0kc51mx8qn9w2wfpjaiycn7yg5gjrdj")
+(patch "041" "1szmm8xv41hvbzgxfwrj6dg85wa7zy3781nnil428rlzpm8ikk05")
+(patch "042" "017kpdqy6v9sgi2a931wyzpix86n9mkalpm6n9cb45v58lgmraps")
 ]
diff --git a/pkgs/shells/bash/default.nix b/pkgs/shells/bash/default.nix
index 98fe43b0122..0bad70e9eef 100644
--- a/pkgs/shells/bash/default.nix
+++ b/pkgs/shells/bash/default.nix
@@ -44,10 +44,14 @@ stdenv.mkDerivation rec {
   configureFlags = baseConfigureFlags;
 
   # Note: Bison is needed because the patches above modify parse.y.
-  buildNativeInputs = [bison]
+  nativeBuildInputs = [bison]
     ++ stdenv.lib.optional (texinfo != null) texinfo
     ++ stdenv.lib.optional interactive readline;
 
+  # Bash randomly fails to build because of a recursive invocation to
+  # build `version.h'.
+  enableParallelBuilding = false;
+
   postInstall = ''
     # Add an `sh' -> `bash' symlink.
     ln -s bash "$out/bin/sh"
diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix
new file mode 100644
index 00000000000..091da2c68f0
--- /dev/null
+++ b/pkgs/shells/fish/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, autoconf, ncurses, which }:
+
+stdenv.mkDerivation rec {
+  name = "fish-2.0.0";
+
+  src = fetchurl {
+    url = http://fishshell.com/files/2.0.0/fish-2.0.0.tar.gz;
+    sha1 = "2d28553e2ff975f8e5fed6b266f7a940493b6636";
+  };
+
+  nativeBuildInputs = [ autoconf ];
+
+  buildInputs = [ ncurses which ];
+
+  preConfigure = ''
+    autoconf
+  '';
+
+  meta = {
+    homepage = http://fishshell.com;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/shells/ipython/default.nix b/pkgs/shells/ipython/default.nix
index a64c2052056..84ca7f04e7e 100644
--- a/pkgs/shells/ipython/default.nix
+++ b/pkgs/shells/ipython/default.nix
@@ -1,15 +1,44 @@
-{ stdenv, fetchurl, buildPythonPackage, pythonPackages }:
+{ stdenv, fetchurl, buildPythonPackage, pythonPackages, pyqt4 ? null, sip ? null
+, notebookSupport ? true   # ipython notebook
+, qtconsoleSupport ? true  # ipython qtconsole
+, pylabSupport ? true      # ipython --pylab    (backend: agg - no gui, just file)
+, pylabQtSupport ? true    # ipython --pylab=qt (backend: Qt4Agg - plot to window)
+}:
+
+# ipython qtconsole works with both pyside and pyqt4. But ipython --pylab=qt
+# only works with pyqt4 (at least this is true for ipython 0.13.1). So just use
+# pyqt4 for both.
+
+assert qtconsoleSupport == true -> pyqt4 != null;
+assert pylabQtSupport == true -> pyqt4 != null && sip != null;
 
 buildPythonPackage rec {
-  name = "ipython-0.13";
+  name = "ipython-0.13.1";
   namePrefix = "";
 
   src = fetchurl {
     url = "http://pypi.python.org/packages/source/i/ipython/${name}.tar.gz";
-    sha256 = "1m4m0zf3llnicfgrbnl2h08p3662px7v2pzbhq4fq24vnyz6x5w2";
+    sha256 = "1h7q2zlyfn7si2vf6gnq2d0krkm1f5jy5nbi105by7zxqjai1grv";
   };
 
-  propagatedBuildInputs = [ pythonPackages.readline pythonPackages.sqlite3 ];
+  propagatedBuildInputs = [
+    pythonPackages.readline
+    pythonPackages.sqlite3  # required for history support
+  ] ++ stdenv.lib.optionals notebookSupport [
+    pythonPackages.tornado
+    pythonPackages.pyzmq
+    pythonPackages.jinja2
+  ] ++ stdenv.lib.optionals qtconsoleSupport [
+    pythonPackages.pygments
+    pythonPackages.pyzmq
+    pyqt4
+  ] ++ stdenv.lib.optionals pylabSupport [
+    pythonPackages.matplotlib
+  ] ++ stdenv.lib.optionals pylabQtSupport [
+    pythonPackages.matplotlib
+    pyqt4
+    sip
+  ];
 
   doCheck = false;
 
@@ -17,12 +46,12 @@ buildPythonPackage rec {
     homepage = http://ipython.scipy.org/;
     description = "An interactive computing environment for Python";
     license = "BSD";
-
     longDescription = ''
       The goal of IPython is to create a comprehensive environment
       for interactive and exploratory computing. It consists of an
       enhanced interactive Python shell and an architecture for
       interactive parallel computing.
     '';
+    maintainers = [ stdenv.lib.maintainers.bjornfor ];
   };
 }
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index dc9314f6885..662f3307b46 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -3,8 +3,8 @@
    compiler. */
 
 {dietlibc, fetchurl, runCommand}:
-   
-   
+
+
 rec {
 
 
@@ -14,13 +14,13 @@ rec {
       inherit gcc;
     };
 
-    
+
   # Add some arbitrary packages to buildInputs for specific packages.
   # Used to override packages in stdenv like Make.  Should not be used
   # for other dependencies.
   overrideInStdenv = stdenv: pkgs: stdenv //
     { mkDerivation = args: stdenv.mkDerivation (args //
-        { buildInputs = (if args ? buildInputs then args.buildInputs else []) ++ pkgs; }
+        { buildInputs = args.buildInputs or [] ++ pkgs; }
       );
     };
 
@@ -48,11 +48,11 @@ rec {
         # These are added *after* the command-line flags, so we'll
         # always optimise for size.
         NIX_CFLAGS_COMPILE =
-          (if args ? NIX_CFLAGS_COMPILE then args.NIX_CFLAGS_COMPILE else "")
+          args.NIX_CFLAGS_COMPILE or ""
           + " -Os -s -D_BSD_SOURCE=1";
 
         configureFlags =
-          (if args ? configureFlags then args.configureFlags else "")
+          args.configureFlags or ""
           + " --disable-shared"; # brrr...
 
         NIX_GCC = import ../build-support/gcc-wrapper {
@@ -65,7 +65,7 @@ rec {
       isDietLibC = true;
     } // {inherit fetchurl;};
 
-    
+
   # Return a modified stdenv that uses klibc to create small
   # statically linked binaries.
   useKlibc = stdenv: klibc: stdenv //
@@ -75,12 +75,10 @@ rec {
         # These are added *after* the command-line flags, so we'll
         # always optimise for size.
         NIX_CFLAGS_COMPILE =
-          (if args ? NIX_CFLAGS_COMPILE then args.NIX_CFLAGS_COMPILE else "")
-          + " -Os -s";
+          args.NIX_CFLAGS_COMPILE or "" + " -Os -s";
 
         configureFlags =
-          (if args ? configureFlags then args.configureFlags else "")
-          + " --disable-shared"; # brrr...
+          args.configureFlags or "" + " --disable-shared"; # brrr...
 
         NIX_GCC = runCommand "klibc-wrapper" {} ''
           mkdir -p $out/bin
@@ -94,98 +92,95 @@ rec {
       isStatic = true;
     } // {inherit fetchurl;};
 
-    
+
   # Return a modified stdenv that tries to build statically linked
   # binaries.
   makeStaticBinaries = stdenv: stdenv //
     { mkDerivation = args: stdenv.mkDerivation (args // {
         NIX_CFLAGS_LINK = "-static";
-
         configureFlags =
-          (if args ? configureFlags then toString args.configureFlags else "")
+          toString args.configureFlags or ""
           + " --disable-shared"; # brrr...
       });
       isStatic = true;
     } // {inherit fetchurl;};
 
-    
+
   # Return a modified stdenv that builds static libraries instead of
   # shared libraries.
   makeStaticLibraries = stdenv: stdenv //
     { mkDerivation = args: stdenv.mkDerivation (args // {
         dontDisableStatic = true;
         configureFlags =
-          (if args ? configureFlags then toString args.configureFlags else "")
+          toString args.configureFlags or ""
           + " --enable-static --disable-shared";
       });
     } // {inherit fetchurl;};
 
-    
+
   # Return a modified stdenv that adds a cross compiler to the
   # builds.
   makeStdenvCross = stdenv: cross: binutilsCross: gccCross: stdenv //
-    { mkDerivation = {name ? "", buildInputs ? [], buildNativeInputs ? [],
-            propagatedBuildInputs ? [], propagatedBuildNativeInputs ? [],
-            selfBuildNativeInput ? false, ...}@args: let
+    { mkDerivation = {name ? "", buildInputs ? [], nativeBuildInputs ? [],
+            propagatedBuildInputs ? [], propagatedNativeBuildInputs ? [],
+            selfNativeBuildInput ? false, ...}@args: let
 
             # *BuildInputs exists temporarily as another name for
             # *HostInputs.
 
             # In nixpkgs, sometimes 'null' gets in as a buildInputs element,
             # and we handle that through isAttrs.
-            getBuildDrv = drv : if (builtins.isAttrs drv && drv ? buildDrv) then drv.buildDrv else drv;
-            getHostDrv = drv : if (builtins.isAttrs drv && drv ? hostDrv) then drv.hostDrv else drv;
-            buildNativeInputsDrvs = map (getBuildDrv) buildNativeInputs;
-            buildInputsDrvs = map (getHostDrv) buildInputs;
-            buildInputsDrvsAsBuildInputs = map (getBuildDrv) buildInputs;
-            propagatedBuildInputsDrvs = map (getHostDrv) (propagatedBuildInputs);
-            propagatedBuildNativeInputsDrvs = map (getBuildDrv)
-                (propagatedBuildNativeInputs);
-
-            # The base stdenv already knows that buildNativeInputs and
+            getNativeDrv = drv: drv.nativeDrv or drv;
+            getCrossDrv = drv: drv.crossDrv or drv;
+            nativeBuildInputsDrvs = map getNativeDrv nativeBuildInputs;
+            buildInputsDrvs = map getCrossDrv buildInputs;
+            buildInputsDrvsAsBuildInputs = map getNativeDrv buildInputs;
+            propagatedBuildInputsDrvs = map getCrossDrv propagatedBuildInputs;
+            propagatedNativeBuildInputsDrvs = map getNativeDrv propagatedNativeBuildInputs;
+
+            # The base stdenv already knows that nativeBuildInputs and
             # buildInputs should be built with the usual gcc-wrapper
             # And the same for propagatedBuildInputs.
-            buildDrv = stdenv.mkDerivation args;
+            nativeDrv = stdenv.mkDerivation args;
 
             # Temporary expression until the cross_renaming, to handle the
             # case of pkgconfig given as buildInput, but to be used as
-            # buildNativeInput.
-            hostAsBuildDrv = drv: builtins.unsafeDiscardStringContext
-                drv.buildDrv.drvPath == builtins.unsafeDiscardStringContext
-                drv.hostDrv.drvPath;
+            # nativeBuildInput.
+            hostAsNativeDrv = drv:
+                builtins.unsafeDiscardStringContext drv.nativeDrv.drvPath
+                == builtins.unsafeDiscardStringContext drv.crossDrv.drvPath;
             buildInputsNotNull = stdenv.lib.filter
-                (drv: builtins.isAttrs drv && drv ? buildDrv) buildInputs;
-            nativeInputsFromBuildInputs = stdenv.lib.filter (hostAsBuildDrv) buildInputsNotNull;
+                (drv: builtins.isAttrs drv && drv ? nativeDrv) buildInputs;
+            nativeInputsFromBuildInputs = stdenv.lib.filter hostAsNativeDrv buildInputsNotNull;
 
-            # We should overwrite the input attributes in hostDrv, to overwrite
+            # We should overwrite the input attributes in crossDrv, to overwrite
             # the defaults for only-native builds in the base stdenv
-            hostDrv = if (cross == null) then buildDrv else
+            crossDrv = if cross == null then nativeDrv else
                 stdenv.mkDerivation (args // {
                     name = name + "-" + cross.config;
-                    buildNativeInputs = buildNativeInputsDrvs
+                    nativeBuildInputs = nativeBuildInputsDrvs
                       ++ nativeInputsFromBuildInputs
                       ++ [ gccCross binutilsCross ] ++
-                      stdenv.lib.optional selfBuildNativeInput buildDrv;
+                      stdenv.lib.optional selfNativeBuildInput nativeDrv;
 
                     # Cross-linking dynamic libraries, every buildInput should
                     # be propagated because ld needs the -rpath-link to find
                     # any library needed to link the program dynamically at
                     # loader time. ld(1) explains it.
                     buildInputs = [];
-                    propagatedBuildInputs = propagatedBuildInputsDrvs ++
-                      buildInputsDrvs;
-                    propagatedBuildNativeInputs = propagatedBuildNativeInputsDrvs;
+                    propagatedBuildInputs = propagatedBuildInputsDrvs ++ buildInputsDrvs;
+                    propagatedNativeBuildInputs = propagatedNativeBuildInputsDrvs;
 
                     crossConfig = cross.config;
-                } // (if args ? crossAttrs then args.crossAttrs else {}));
-        in buildDrv // {
-            inherit hostDrv buildDrv;
+                } // args.crossAttrs or {});
+        in nativeDrv // {
+          inherit crossDrv nativeDrv;
         };
     } // {
       inherit cross gccCross binutilsCross;
     };
 
-    
+
   /* Modify a stdenv so that the specified attributes are added to
      every derivation returned by its mkDerivation function.
 
@@ -202,7 +197,7 @@ rec {
   /* Return a modified stdenv that performs the build under $out/.build
      instead of in $TMPDIR.  Thus, the sources are kept available.
      This is useful for things like debugging or generation of
-     dynamic analysis reports. */ 
+     dynamic analysis reports. */
   keepBuildTree = stdenv:
     addAttrsToDerivation
       { prePhases = "moveBuildDir";
@@ -230,12 +225,12 @@ rec {
               \( -name "*.c" -o -name "*.h" -o -name "*.gcno" \) \
               | xargs rm -f --
 
-            for i in $(find $out/.build/ -name ".tmp_*.gcno"); do 
+            for i in $(find $out/.build/ -name ".tmp_*.gcno"); do
                 mv "$i" "$(echo $i | sed s/.tmp_//)"
             done
           '';
-      } stdenv;          
-      
+      } stdenv;
+
 
   /* Return a modified stdenv that builds packages with GCC's coverage
      instrumentation.  The coverage note files (*.gcno) are stored in
@@ -258,7 +253,7 @@ rec {
             export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -O0 --coverage"
           '';
       }
-      
+
       # Object files instrumented with coverage analysis write
       # runtime coverage data to <path>/<object>.gcda, where <path>
       # is the location where gcc originally created the object
@@ -269,7 +264,7 @@ rec {
       # we need the source code.  So we have to use the
       # `keepBuildTree' adapter as well.
       (cleanupBuildTree (keepBuildTree stdenv));
-      
+
 
   /* Replace the meta.maintainers field of a derivation.  This is useful
      when you want to fork to update some packages without disturbing other
@@ -297,21 +292,16 @@ rec {
           pkg = stdenv.mkDerivation args;
           printDrvPath = val: let
             drvPath = builtins.unsafeDiscardStringContext pkg.drvPath;
-            license =
-              if pkg ? meta && pkg.meta ? license then
-                pkg.meta.license
-              else
-                null;
+            license = pkg.meta.license or null;
           in
-            builtins.trace "@:drv:${toString drvPath}:${builtins.toString license}:@"
-              val;
+            builtins.trace "@:drv:${toString drvPath}:${builtins.toString license}:@" val;
         in pkg // {
           outPath = printDrvPath pkg.outPath;
           drvPath = printDrvPath pkg.drvPath;
         };
     };
 
-    
+
   /* Abort if the license predicate is not verified for a derivation
      declared with mkDerivation.
 
@@ -333,15 +323,12 @@ rec {
           pkg = stdenv.mkDerivation args;
           drv = builtins.unsafeDiscardStringContext pkg.drvPath;
           license =
-            if pkg ? meta && pkg.meta ? license then
-              pkg.meta.license
-            else if pkg ? outputHash then
+            pkg.meta.license or
               # Fixed-output derivations such as source tarballs usually
               # don't have licensing information, but that's OK.
-              null
-            else
-              builtins.trace
-                "warning: ${drv} lacks licensing information" null;
+              (pkg.outputHash or
+                (builtins.trace
+                  "warning: ${drv} lacks licensing information" null));
 
           validate = arg:
             if licensePred license then arg
@@ -355,4 +342,16 @@ rec {
           drvPath = validate pkg.drvPath;
         };
     };
+
+
+  /* Modify a stdenv so that it produces debug builds; that is,
+     binaries have debug info, and compiler optimisations are
+     disabled. */
+  keepDebugInfo = stdenv: stdenv //
+    { mkDerivation = args: stdenv.mkDerivation (args // {
+        dontStrip = true;
+        NIX_CFLAGS_COMPILE = toString (args.NIX_CFLAGS_COMPILE or "") + " -g -O0";
+      });
+    };
+
 }
diff --git a/pkgs/stdenv/default.nix b/pkgs/stdenv/default.nix
index c454204f897..ca90b46192e 100644
--- a/pkgs/stdenv/default.nix
+++ b/pkgs/stdenv/default.nix
@@ -10,7 +10,7 @@
 # system, e.g., cygwin and mingw builds on i686-cygwin.  Most people
 # can ignore it.
 
-{system, stdenvType ? system, allPackages ? import ../.., platform}:
+{ system, stdenvType ? system, allPackages ? import ../.., platform, config }:
 
 assert system != "i686-cygwin" -> system == stdenvType;
 
@@ -24,7 +24,7 @@ rec {
   # be used with care, since many Nix packages will not build properly
   # with it (e.g., because they require GNU Make).
   stdenvNative = (import ./native {
-    inherit system allPackages;
+    inherit system allPackages config;
   }).stdenv;
 
   stdenvNativePkgs = allPackages {
@@ -35,31 +35,32 @@ rec {
 
   # The Nix build environment.
   stdenvNix = import ./nix {
+    inherit config;
     stdenv = stdenvNative;
     pkgs = stdenvNativePkgs;
   };
 
 
   # Linux standard environment.
-  stdenvLinux = (import ./linux {inherit system allPackages platform;}).stdenvLinux;
+  stdenvLinux = (import ./linux { inherit system allPackages platform config;}).stdenvLinux;
+
 
-    
   # MinGW/MSYS standard environment.
   stdenvMinGW = import ./mingw {
     inherit system;
   };
 
-  
+
   # Select the appropriate stdenv for the platform `system'.
   stdenv =
     if stdenvType == "i686-linux" then stdenvLinux else
     if stdenvType == "x86_64-linux" then stdenvLinux else
     if stdenvType == "armv5tel-linux" then stdenvLinux else
+    if stdenvType == "armv6l-linux" then stdenvLinux else
     if stdenvType == "armv7l-linux" then stdenvLinux else
     if stdenvType == "mips64el-linux" then stdenvLinux else
     if stdenvType == "powerpc-linux" then /* stdenvLinux */ stdenvNative else
     if stdenvType == "i686-mingw" then stdenvMinGW else
-    if stdenvType == "i686-darwin" then stdenvNix else
     if stdenvType == "x86_64-darwin" then stdenvNix else
     stdenvNative;
 }
diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix
index 9197ff8314b..9b8fd5615e7 100644
--- a/pkgs/stdenv/generic/default.nix
+++ b/pkgs/stdenv/generic/default.nix
@@ -1,16 +1,22 @@
 { system, name ? "stdenv", preHook ? "", initialPath, gcc, shell
-, extraAttrs ? {}, overrides ? (pkgs: {})
+, extraAttrs ? {}, overrides ? (pkgs: {}), config
 
 , # The `fetchurl' to use for downloading curl and its dependencies
   # (see all-packages.nix).
   fetchurlBoot
 }:
 
+if ! builtins ? langVersion then
+
+  abort "This version of Nixpkgs requires Nix >= 1.2, please upgrade!"
+
+else
+
 let
 
   lib = import ../../lib;
 
-  disallowUnfree = builtins.getEnv "HYDRA_DISALLOW_UNFREE" == "1";
+  allowUnfree = config.allowUnfree or true && builtins.getEnv "HYDRA_DISALLOW_UNFREE" != "1";
 
   stdenvGenerator = setupScript: rec {
 
@@ -30,6 +36,8 @@ let
 
         propagatedUserEnvPkgs = [gcc] ++
           lib.filter lib.isDerivation initialPath;
+
+        __ignoreNulls = true;
       }
 
       // rec {
@@ -41,54 +49,56 @@ let
         # Add a utility function to produce derivations that use this
         # stdenv and its shell.
         mkDerivation = attrs:
-          if disallowUnfree && attrs.meta.license or "" == "unfree" then
+          if !allowUnfree && (let l = attrs.meta.license or ""; in l == "unfree" || l == "unfree-redistributable") then
             throw "package ‘${attrs.name}’ has an unfree license, refusing to evaluate"
           else
-          (derivation (
-            (removeAttrs attrs ["meta" "passthru" "crossAttrs"])
-            // (let
-              buildInputs = attrs.buildInputs or [];
-              buildNativeInputs = attrs.buildNativeInputs or [];
-              propagatedBuildInputs = attrs.propagatedBuildInputs or [];
-              propagatedBuildNativeInputs = attrs.propagatedBuildNativeInputs or [];
-              crossConfig = attrs.crossConfig or null;
-            in
+            lib.addPassthru (derivation (
+              (removeAttrs attrs ["meta" "passthru" "crossAttrs"])
+              // (let
+                buildInputs = attrs.buildInputs or [];
+                nativeBuildInputs = attrs.nativeBuildInputs or [];
+                propagatedBuildInputs = attrs.propagatedBuildInputs or [];
+                propagatedNativeBuildInputs = attrs.propagatedNativeBuildInputs or [];
+                crossConfig = attrs.crossConfig or null;
+              in
+              {
+                builder = attrs.realBuilder or shell;
+                args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
+                stdenv = result;
+                system = result.system;
+                userHook = config.stdenv.userHook or null;
+
+                # Inputs built by the cross compiler.
+                buildInputs = lib.optionals (crossConfig != null) buildInputs;
+                propagatedBuildInputs = lib.optionals (crossConfig != null)
+                    propagatedBuildInputs;
+                # Inputs built by the usual native compiler.
+                nativeBuildInputs = nativeBuildInputs ++ lib.optionals
+                  (crossConfig == null) buildInputs;
+                propagatedNativeBuildInputs = propagatedNativeBuildInputs ++
+                  lib.optionals (crossConfig == null) propagatedBuildInputs;
+            }))) (
             {
-              builder = attrs.realBuilder or shell;
-              args = attrs.args or ["-e" (attrs.builder or ./default-builder.sh)];
-              stdenv = result;
-              system = result.system;
-
-              # Inputs built by the cross compiler.
-              buildInputs = lib.optionals (crossConfig != null) buildInputs;
-              propagatedBuildInputs = lib.optionals (crossConfig != null)
-                  propagatedBuildInputs;
-              # Inputs built by the usual native compiler.
-              buildNativeInputs = buildNativeInputs ++ lib.optionals
-                (crossConfig == null) buildInputs;
-              propagatedBuildNativeInputs = propagatedBuildNativeInputs ++
-                lib.optionals (crossConfig == null) propagatedBuildInputs;
-            }))
-          )
-          # The meta attribute is passed in the resulting attribute set,
-          # but it's not part of the actual derivation, i.e., it's not
-          # passed to the builder and is not a dependency.  But since we
-          # include it in the result, it *is* available to nix-env for
-          # queries.
-          // { meta = attrs.meta or {}; }
-          # Pass through extra attributes that are not inputs, but
-          # should be made available to Nix expressions using the
-          # derivation (e.g., in assertions).
-          // (attrs.passthru or {});
+              # The meta attribute is passed in the resulting attribute set,
+              # but it's not part of the actual derivation, i.e., it's not
+              # passed to the builder and is not a dependency.  But since we
+              # include it in the result, it *is* available to nix-env for
+              # queries.
+              meta = attrs.meta or {};
+              passthru = attrs.passthru or {};
+            } //
+            # Pass through extra attributes that are not inputs, but
+            # should be made available to Nix expressions using the
+            # derivation (e.g., in assertions).
+            (attrs.passthru or {}));
 
         # Utility flags to test the type of platform.
-        isDarwin = result.system == "i686-darwin"
-               || result.system == "powerpc-darwin"
-               || result.system == "x86_64-darwin";
+        isDarwin = result.system == "x86_64-darwin";
         isLinux = result.system == "i686-linux"
                || result.system == "x86_64-linux"
                || result.system == "powerpc-linux"
                || result.system == "armv5tel-linux"
+               || result.system == "armv6l-linux"
                || result.system == "armv7l-linux"
                || result.system == "mips64el-linux";
         isGNU = result.system == "i686-gnu";      # GNU/Hurd
@@ -108,7 +118,6 @@ let
                || result.system == "x86_64-openbsd";
         isi686 = result.system == "i686-linux"
                || result.system == "i686-gnu"
-               || result.system == "i686-darwin"
                || result.system == "i686-freebsd"
                || result.system == "i686-openbsd"
                || result.system == "i386-sunos";
@@ -117,10 +126,13 @@ let
                || result.system == "x86_64-freebsd"
                || result.system == "x86_64-openbsd";
         is64bit = result.system == "x86_64-linux"
-                || result.system == "x86_64-darwin";
+                || result.system == "x86_64-darwin"
+                || result.system == "x86_64-freebsd"
+                || result.system == "x86_64-openbsd";
         isMips = result.system == "mips-linux"
                 || result.system == "mips64el-linux";
         isArm = result.system == "armv5tel-linux"
+             || result.system == "armv6l-linux"
              || result.system == "armv7l-linux";
 
         # Utility function: allow stdenv to be easily regenerated with
diff --git a/pkgs/stdenv/generic/setup.sh b/pkgs/stdenv/generic/setup.sh
index 703ea53db8e..a474b6a8eaf 100644
--- a/pkgs/stdenv/generic/setup.sh
+++ b/pkgs/stdenv/generic/setup.sh
@@ -1,7 +1,7 @@
 # Run the named hook, either by calling the function with that name or
 # by evaluating the variable with that name.  This allows convenient
 # setting of hooks both from Nix expressions (as attributes /
-# environment variables) and from shell scripts (as functions). 
+# environment variables) and from shell scripts (as functions).
 runHook() {
     local hookName="$1"
     case "$(type -t $hookName)" in
@@ -29,10 +29,10 @@ exitHandler() {
         # - system time for all child processes
         echo "build time elapsed: " ${times[*]}
     fi
-    
+
     if [ $exitCode != 0 ]; then
         runHook failureHook
-    
+
         # If the builder had a non-zero exit code and
         # $succeedOnFailure is set, create the file
         # `$out/nix-support/failed' to signal failure, and exit
@@ -43,11 +43,11 @@ exitHandler() {
             echo -n $exitCode > "$out/nix-support/failed"
             exit 0
         fi
-        
+
     else
         runHook exitHook
     fi
-    
+
     exit $exitCode
 }
 
@@ -169,8 +169,8 @@ for i in $buildInputs $propagatedBuildInputs; do
 done
 
 nativePkgs=""
-for i in $buildNativeInputs $propagatedBuildNativeInputs; do
-    findInputs $i nativePkgs propagated-build-native-inputs
+for i in $nativeBuildInputs $propagatedNativeBuildInputs; do
+    findInputs $i nativePkgs propagated-native-build-inputs
 done
 
 
@@ -197,7 +197,7 @@ addToCrossEnv() {
     local pkg=$1
 
     # Some programs put important build scripts (freetype-config and similar)
-    # into their hostDrv bin path. Intentionally these should go after
+    # into their crossDrv bin path. Intentionally these should go after
     # the nativePkgs in PATH.
     if [ -d $1/bin ]; then
         addToSearchPath _PATH $1/bin
@@ -445,7 +445,7 @@ unpackFile() {
         *)
             if [ -d "$curSrc" ]; then
                 stripHash $curSrc
-                cp -prvd $curSrc $strippedName
+                cp -prd --no-preserve=timestamps $curSrc $strippedName
             else
                 if [ -z "$unpackCmd" ]; then
                     echo "source archive $curSrc has unknown type"
@@ -462,7 +462,7 @@ unpackFile() {
 
 unpackPhase() {
     runHook preUnpack
-    
+
     if [ -z "$srcs" ]; then
         if [ -z "$src" ]; then
             echo 'variable $src or $srcs should point to the source'
@@ -529,9 +529,7 @@ unpackPhase() {
 
 patchPhase() {
     runHook prePatch
-    
-    if [ -z "$patchPhase" -a -z "$patches" ]; then return; fi
-    
+
     for i in $patches; do
         header "applying patch $i" 3
         local uncompress=cat
@@ -627,7 +625,7 @@ checkPhase() {
     make ${makefile:+-f $makefile} \
         ${enableParallelBuilding:+-j${NIX_BUILD_CORES} -l${NIX_BUILD_CORES}} \
         $makeFlags "${makeFlagsArray[@]}" \
-        $checkFlags "${checkFlagsArray[@]}" ${checkTarget:-check}
+        ${checkFlags:-VERBOSE=y} "${checkFlagsArray[@]}" ${checkTarget:-check}
 
     runHook postCheck
 }
@@ -724,11 +722,11 @@ fixupPhase() {
 
     # TODO: strip _only_ ELF executables, and return || fail here...
     if [ -z "$dontStrip" ]; then
-        stripDebugList=${stripDebugList:-lib lib64 libexec bin sbin}
+        stripDebugList=${stripDebugList:-lib lib32 lib64 libexec bin sbin}
         if [ -n "$stripDebugList" ]; then
             stripDirs "$stripDebugList" "${stripDebugFlags:--S}"
         fi
-        
+
         stripAllList=${stripAllList:-}
         if [ -n "$stripAllList" ]; then
             stripDirs "$stripAllList" "${stripAllFlags:--s}"
@@ -748,9 +746,9 @@ fixupPhase() {
         echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
     fi
 
-    if [ -n "$propagatedBuildNativeInputs" ]; then
+    if [ -n "$propagatedNativeBuildInputs" ]; then
         mkdir -p "$out/nix-support"
-        echo "$propagatedBuildNativeInputs" > "$out/nix-support/propagated-build-native-inputs"
+        echo "$propagatedNativeBuildInputs" > "$out/nix-support/propagated-native-build-inputs"
     fi
 
     if [ -n "$propagatedUserEnvPkgs" ]; then
@@ -844,7 +842,7 @@ genericBuild() {
 
         showPhaseHeader "$curPhase"
         dumpVars
-        
+
         # Evaluate the variable named $curPhase if it exists, otherwise the
         # function named $curPhase.
         eval "${!curPhase:-$curPhase}"
@@ -852,7 +850,7 @@ genericBuild() {
         if [ "$curPhase" = unpackPhase ]; then
             cd "${sourceRoot:-.}"
         fi
-        
+
         if [ -n "$tracePhases" ]; then
             echo
             echo "@ phase-succeeded $out $curPhase"
@@ -869,4 +867,10 @@ genericBuild() {
 runHook postHook
 
 
+# Execute the global user hook (defined through the Nixpkgs
+# configuration option ‘stdenv.userHook’).  This can be used to set
+# global compiler optimisation flags, for instance.
+runHook userHook
+
+
 dumpVars
diff --git a/pkgs/stdenv/linux/bootstrap/armv6l/default.nix b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
new file mode 100644
index 00000000000..ecda6be8bd3
--- /dev/null
+++ b/pkgs/stdenv/linux/bootstrap/armv6l/default.nix
@@ -0,0 +1,15 @@
+{
+  sh = ../armv5tel/sh;
+  bzip2 = ../armv5tel/bzip2;
+  mkdir = ../armv5tel/mkdir;
+  cpio = ../armv5tel/cpio;
+  ln = ../armv5tel/ln;
+  curl = ../armv5tel/curl.bz2;
+
+  bootstrapTools = {
+    # Built from make-bootstrap-tools-crosspi.nix
+    # nixpkgs rev eb0422e4c1263a65a9b2b954fe10a1e03d67db3e
+    url = http://viric.name/tmp/nix/pi/bootstrap-tools.cpio.bz2;
+    sha256 = "1zb27x5h54k51yrvn3sy4wb1qprx8iv2kfbgklxwc0mcxp9b7ccd";
+  };
+}
diff --git a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
index a87f07e00ce..b0ad8d6545d 100644
--- a/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
+++ b/pkgs/stdenv/linux/bootstrap/loongson2f/default.nix
@@ -7,7 +7,7 @@
   curl = ./curl.bz2;
 
   bootstrapTools = {
-    url = "file:///root/cross-bootstrap-tools.cpio.bz2";
+    url = "http://nixos.org/tarballs/stdenv-linux/loongson2f/r22849/cross-bootstrap-tools.cpio.bz2";
     sha256 = "00aavbk76qjj2gdlmpaaj66r8nzl4d7pyl8cv1gigyzgpbr5vv3j";
   };
 }
diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix
index 3105e76f817..84af23a263c 100644
--- a/pkgs/stdenv/linux/default.nix
+++ b/pkgs/stdenv/linux/default.nix
@@ -7,7 +7,7 @@
 # The function defaults are for easy testing.
 { system ? builtins.currentSystem
 , allPackages ? import ../../top-level/all-packages.nix
-, platform ? null }:
+, platform ? null, config }:
 
 rec {
 
@@ -16,6 +16,7 @@ rec {
     else if system == "x86_64-linux" then import ./bootstrap/x86_64
     else if system == "powerpc-linux" then import ./bootstrap/powerpc
     else if system == "armv5tel-linux" then import ./bootstrap/armv5tel
+    else if system == "armv6l-linux" then import ./bootstrap/armv6l
     else if system == "armv7l-linux" then import ./bootstrap/armv5tel
     else if system == "mips64el-linux" then import ./bootstrap/loongson2f
     else abort "unsupported platform for the pure Linux stdenv";
@@ -32,11 +33,11 @@ rec {
 
   # The bootstrap process proceeds in several steps.
 
-  
+
   # 1) Create a standard environment by downloading pre-built binaries
   # of coreutils, GCC, etc.
 
-  
+
   # This function downloads a file.
   download = {url, sha256}: derivation {
     name = baseNameOf (toString url);
@@ -49,31 +50,31 @@ rec {
     impureEnvVars = [ "http_proxy" "https_proxy" "ftp_proxy" "all_proxy" "no_proxy" ];
   };
 
-  
+
   # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...).
   bootstrapTools = derivation {
     name = "bootstrap-tools";
-    
+
     builder = bootstrapFiles.sh;
-    
+
     args =
-      if system == "armv5tel-linux"
+      if (system == "armv5tel-linux" || system == "armv6l-linux")
       then [ ./scripts/unpack-bootstrap-tools-arm.sh ]
       else [ ./scripts/unpack-bootstrap-tools.sh ];
-    
+
     inherit (bootstrapFiles) bzip2 mkdir curl cpio;
-    
+
     tarball = download {
       inherit (bootstrapFiles.bootstrapTools) url sha256;
     };
-    
+
     inherit system;
-    
+
     # Needed by the GCC wrapper.
     langC = true;
     langCC = true;
   };
-  
+
 
   # This function builds the various standard environments used during
   # the bootstrap.
@@ -81,7 +82,7 @@ rec {
     {gcc, extraAttrs ? {}, overrides ? (pkgs: {}), extraPath ? [], fetchurl}:
 
     import ../generic {
-      inherit system;
+      inherit system config;
       name = "stdenv-linux-boot";
       preHook =
         ''
@@ -109,7 +110,7 @@ rec {
     fetchurl = null;
   };
 
-  
+
   fetchurl = import ../../build-support/fetchurl {
     stdenv = stdenvLinuxBoot0;
     curl = bootstrapTools;
@@ -133,7 +134,7 @@ rec {
   # A helper function to call gcc-wrapper.
   wrapGCC =
     {gcc ? bootstrapTools, libc, binutils, coreutils, shell ? "", name ? "bootstrap-gcc-wrapper"}:
-    
+
     import ../../build-support/gcc-wrapper {
       nativeTools = false;
       nativeLibc = false;
@@ -153,7 +154,7 @@ rec {
     };
     inherit fetchurl;
   };
-  
+
 
   # 2) These are the packages that we can build with the first
   #    stdenv.  We only need binutils, because recent Glibcs
@@ -164,7 +165,7 @@ rec {
     bootStdenv = stdenvLinuxBoot1;
   };
 
-  
+
   # 3) 2nd stdenv that we will use to build only the glibc.
   stdenvLinuxBoot2 = stdenvBootFun {
     gcc = wrapGCC {
@@ -186,12 +187,12 @@ rec {
     bootStdenv = stdenvLinuxBoot2;
   };
 
-  
+
   # 5) Build Glibc with the bootstrap tools.  The result is the full,
   #    dynamically linked, final Glibc.
   stdenvLinuxGlibc = stdenvLinuxBoot2Pkgs.glibc;
 
-  
+
   # 6) Construct a third stdenv identical to the 2nd, except that
   #    this one uses the Glibc built in step 3.  It still uses
   #    the recent binutils and rest of the bootstrap tools, including GCC.
@@ -217,14 +218,14 @@ rec {
     inherit fetchurl;
   };
 
-  
+
   # 7) The packages that can be built using the third stdenv.
   stdenvLinuxBoot3Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot3;
   };
 
-  
+
   # 8) Construct a fourth stdenv identical to the second, except that
   #    this one uses the dynamically linked GCC and Binutils from step
   #    5.  The other tools (e.g. coreutils) are still from the
@@ -240,19 +241,19 @@ rec {
     extraPath = [ stdenvLinuxBoot3Pkgs.xz ];
     overrides = pkgs: {
       inherit (stdenvLinuxBoot1Pkgs) perl;
-      inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 xz gmp;
+      inherit (stdenvLinuxBoot3Pkgs) gettext gnum4 gmp;
     };
     inherit fetchurl;
   };
 
-  
+
   # 9) The packages that can be built using the fourth stdenv.
   stdenvLinuxBoot4Pkgs = allPackages {
     inherit system platform;
     bootStdenv = stdenvLinuxBoot4;
   };
 
-  
+
   # 10) Construct the final stdenv.  It uses the Glibc, GCC and
   #     Binutils built above, and adds in dynamically linked versions
   #     of all other tools.
@@ -261,11 +262,11 @@ rec {
   #     dependency (`nix-store -qR') on bootstrapTools or the
   #     first binutils built.
   stdenvLinux = import ../generic rec {
-    inherit system;
-    
+    inherit system config;
+
     preHook = commonPreHook;
-    
-    initialPath = 
+
+    initialPath =
       ((import ../common-path.nix) {pkgs = stdenvLinuxBoot4Pkgs;})
       ++ [stdenvLinuxBoot4Pkgs.patchelf];
 
@@ -273,18 +274,19 @@ rec {
       inherit (stdenvLinuxBoot3Pkgs) binutils;
       inherit (stdenvLinuxBoot4Pkgs) coreutils;
       libc = stdenvLinuxGlibc;
-      gcc = stdenvLinuxBoot3Pkgs.gcc.gcc;
+      gcc = stdenvLinuxBoot4.gcc.gcc;
       shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
       name = "";
     };
 
     shell = stdenvLinuxBoot4Pkgs.bash + "/bin/bash";
-    
+
     fetchurlBoot = fetchurl;
-    
+
     extraAttrs = {
       inherit (stdenvLinuxBoot3Pkgs) glibc;
-      inherit platform;
+      inherit platform bootstrapTools;
+      shellPackage = stdenvLinuxBoot4Pkgs.bash; 
     };
 
     overrides = pkgs: {
diff --git a/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
new file mode 100644
index 00000000000..9b2949e3e36
--- /dev/null
+++ b/pkgs/stdenv/linux/make-bootstrap-tools-crosspi.nix
@@ -0,0 +1,269 @@
+{system ? builtins.currentSystem}:
+
+let
+  pkgsFun = import ../../top-level/all-packages.nix;
+  pkgsNoParams = pkgsFun {};
+  raspberrypiCrossSystem = {
+    crossSystem = {
+      config = "armv6l-unknown-linux-gnueabi";  
+      bigEndian = false;
+      arch = "arm";
+      float = "hard";
+      fpu = "vfp";
+      withTLS = true;
+      libc = "glibc";
+      platform = pkgsNoParams.platforms.raspberrypi;
+      openssl.system = "linux-generic32";
+      gcc = {
+        arch = "armv6";
+        fpu = "vfp";
+        float = "hard";
+      };
+    };
+  };
+
+  raspberrypiCrossSystemUclibc = {
+    crossSystem = {
+      config = "armv6l-unknown-linux-gnueabi";  
+      bigEndian = false;
+      arch = "arm";
+      float = "hard";
+      fpu = "vfp";
+      withTLS = true;
+      libc = "uclibc";
+      platform = pkgsNoParams.platforms.raspberrypi;
+      openssl.system = "linux-generic32";
+      gcc = {
+        arch = "armv6";
+        fpu = "vfp";
+        float = "hard";
+      };
+      uclibc.extraConfig = ''
+        ARCH_WANTS_BIG_ENDIAN n
+        ARCH_BIG_ENDIAN n
+        ARCH_WANTS_LITTLE_ENDIAN y
+        ARCH_LITTLE_ENDIAN y
+      '';
+    };
+  };
+
+  pkgsuclibc = pkgsFun ({inherit system;} // raspberrypiCrossSystemUclibc);
+  pkgs = pkgsFun ({inherit system;} // raspberrypiCrossSystem);
+
+  inherit (pkgs) stdenv nukeReferences cpio binutilsCross;
+
+  # We want coreutils without ACL support.
+  coreutils_base = pkgs.coreutils.override (args: {
+    aclSupport = false;
+  });
+
+  coreutils_ = coreutils_base.crossDrv;
+
+  glibc = pkgs.libcCross;
+  bash = pkgs.bash.crossDrv;
+  findutils = pkgs.findutils.crossDrv;
+  diffutils = pkgs.diffutils.crossDrv;
+  gnused = pkgs.gnused.crossDrv;
+  gnugrep = pkgs.gnugrep.crossDrv;
+  gawk = pkgs.gawk.crossDrv;
+  gnutar = pkgs.gnutar.crossDrv;
+  gzip = pkgs.gzip.crossDrv;
+  bzip2 = pkgs.bzip2.crossDrv;
+  gnumake = pkgs.gnumake.crossDrv;
+  patch = pkgs.patch.crossDrv;
+  patchelf = pkgs.patchelf.crossDrv;
+  replace = pkgs.replace.crossDrv;
+  gcc = pkgs.gcc47;
+  gmp = pkgs.gmp.crossDrv;
+  mpfr = pkgs.mpfr.crossDrv;
+  ppl = pkgs.ppl.crossDrv;
+  cloogppl = pkgs.cloogppl.crossDrv;
+  cloog = pkgs.cloog.crossDrv;
+  zlib = pkgs.zlib.crossDrv;
+  isl = pkgs.isl.crossDrv;
+  mpc = pkgs.mpc.crossDrv;
+  binutils = pkgs.binutils.crossDrv;
+  klibc = pkgs.klibc.crossDrv;
+
+in
+
+rec {
+
+  curlStatic = import <nixpkgs/pkgs/tools/networking/curl> {
+    stdenv = pkgsuclibc.stdenv;
+    inherit (pkgsuclibc) fetchurl;
+    zlibSupport = false;
+    sslSupport = false;
+    linkStatic = true;
+  };
+
+  bzip2Static = import <nixpkgs/pkgs/tools/compression/bzip2> {
+    stdenv = pkgsuclibc.stdenv;
+    inherit (pkgsuclibc) fetchurl;
+    linkStatic = true;
+  };
+
+  inherit pkgs;
+
+  build = 
+
+    stdenv.mkDerivation {
+      name = "build";
+
+      buildInputs = [nukeReferences cpio binutilsCross];
+
+      crossConfig = stdenv.cross.config;
+
+      buildCommand = ''
+	set -x
+        ensureDir $out/bin $out/lib $out/libexec
+
+        # Copy what we need of Glibc.
+        cp -d ${glibc}/lib/ld-*.so* $out/lib
+        cp -d ${glibc}/lib/libc*.so* $out/lib
+        cp -d ${glibc}/lib/libc_nonshared.a $out/lib
+        cp -d ${glibc}/lib/libm*.so* $out/lib
+        cp -d ${glibc}/lib/libdl*.so* $out/lib
+        cp -d ${glibc}/lib/librt*.so*  $out/lib
+        cp -d ${glibc}/lib/libpthread*.so* $out/lib
+        cp -d ${glibc}/lib/libnsl*.so* $out/lib
+        cp -d ${glibc}/lib/libutil*.so* $out/lib
+        cp -d ${glibc}/lib/crt?.o $out/lib
+        
+        cp -rL ${glibc}/include $out
+        chmod -R u+w $out/include
+        
+        # Hopefully we won't need these.
+        rm -rf $out/include/mtd $out/include/rdma $out/include/sound $out/include/video
+        find $out/include -name .install -exec rm {} \;
+        find $out/include -name ..install.cmd -exec rm {} \;
+        mv $out/include $out/include-glibc
+        
+        # Copy coreutils, bash, etc.
+        cp ${coreutils_}/bin/* $out/bin
+        (cd $out/bin && rm vdir dir sha*sum pinky factor pathchk runcon shuf who whoami shred users)
+        
+        cp ${bash}/bin/bash $out/bin
+        cp ${findutils}/bin/find $out/bin
+        cp ${findutils}/bin/xargs $out/bin
+        cp -d ${diffutils}/bin/* $out/bin
+        cp -d ${gnused}/bin/* $out/bin
+        cp -d ${gnugrep}/bin/* $out/bin
+        cp ${gawk}/bin/gawk $out/bin
+        cp -d ${gawk}/bin/awk $out/bin
+        cp ${gnutar}/bin/tar $out/bin
+        cp ${gzip}/bin/gzip $out/bin
+        cp ${bzip2}/bin/bzip2 $out/bin
+        cp -d ${gnumake}/bin/* $out/bin
+        cp -d ${patch}/bin/* $out/bin
+        cp ${patchelf}/bin/* $out/bin
+        cp ${replace}/bin/* $out/bin
+
+        cp -d ${gnugrep.pcre.crossDrv}/lib/libpcre*.so* $out/lib # needed by grep
+        
+        # Copy what we need of GCC.
+        cp -d ${gcc.gcc.crossDrv}/bin/gcc $out/bin
+        cp -d ${gcc.gcc.crossDrv}/bin/cpp $out/bin
+        cp -d ${gcc.gcc.crossDrv}/bin/g++ $out/bin
+        cp -d ${gcc.gcc.crossDrv}/lib*/libgcc_s.so* $out/lib
+        cp -d ${gcc.gcc.crossDrv}/lib*/libstdc++.so* $out/lib
+        cp -rd ${gcc.gcc.crossDrv}/lib/gcc $out/lib
+        chmod -R u+w $out/lib
+        rm -f $out/lib/gcc/*/*/include*/linux
+        rm -f $out/lib/gcc/*/*/include*/sound
+        rm -rf $out/lib/gcc/*/*/include*/root
+        rm -f $out/lib/gcc/*/*/include-fixed/asm
+        rm -rf $out/lib/gcc/*/*/plugin
+        #rm -f $out/lib/gcc/*/*/*.a
+        cp -rd ${gcc.gcc.crossDrv}/libexec/* $out/libexec
+        mkdir $out/include
+        cp -rd ${gcc.gcc.crossDrv}/include/c++ $out/include
+        chmod -R u+w $out/include
+        rm -rf $out/include/c++/*/ext/pb_ds
+        rm -rf $out/include/c++/*/ext/parallel
+
+        cp -d ${gmp}/lib/libgmp*.so* $out/lib
+        cp -d ${mpfr}/lib/libmpfr*.so* $out/lib
+        cp -d ${cloogppl}/lib/libcloog*.so* $out/lib
+        cp -d ${cloog}/lib/libcloog*.so* $out/lib
+        cp -d ${ppl}/lib/libppl*.so* $out/lib
+        cp -d ${isl}/lib/libisl*.so* $out/lib
+        cp -d ${mpc}/lib/libmpc*.so* $out/lib
+        cp -d ${zlib}/lib/libz.so* $out/lib
+        
+        # Copy binutils.
+        for i in as ld ar ranlib nm strip readelf objdump; do
+          cp ${binutils}/bin/$i $out/bin
+        done
+
+        chmod -R u+w $out
+        
+        # Strip executables even further.
+        for i in $out/bin/* $out/libexec/gcc/*/*/*; do
+            if test -x $i -a ! -L $i; then
+                chmod +w $i
+                $crossConfig-strip -s $i || true
+            fi
+        done
+
+        nuke-refs $out/bin/*
+        nuke-refs $out/lib/*
+        nuke-refs $out/libexec/gcc/*/*/*
+        nuke-refs $out/libexec/gcc/*/*/*/*
+
+        mkdir $out/.pack
+        mv $out/* $out/.pack
+        mv $out/.pack $out/pack
+
+        mkdir $out/on-server
+        (cd $out/pack && (find | cpio -o -H newc)) | bzip2 > $out/on-server/bootstrap-tools.cpio.bz2
+
+        mkdir $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/sh $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/cpio $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/mkdir $out/in-nixpkgs
+        cp ${klibc}/lib/klibc/bin.static/ln $out/in-nixpkgs
+        cp ${curlStatic.crossDrv}/bin/curl $out/in-nixpkgs
+        cp ${bzip2Static.crossDrv}/bin/bzip2 $out/in-nixpkgs
+        chmod u+w $out/in-nixpkgs/*
+        $crossConfig-strip $out/in-nixpkgs/*
+        nuke-refs $out/in-nixpkgs/*
+        bzip2 $out/in-nixpkgs/curl
+      ''; # */
+
+      # The result should not contain any references (store paths) so
+      # that we can safely copy them out of the store and to other
+      # locations in the store.
+      allowedReferences = [];
+    };
+
+  
+  unpack =
+    
+    stdenv.mkDerivation {
+      name = "unpack";
+
+      buildCommand = ''
+        ${build}/in-nixpkgs/mkdir $out
+        ${build}/in-nixpkgs/bzip2 -d < ${build}/on-server/bootstrap-tools.cpio.bz2 | (cd $out && ${build}/in-nixpkgs/cpio -V -i)
+
+        for i in $out/bin/* $out/libexec/gcc/*/*/*; do
+            echo patching $i
+            if ! test -L $i; then
+                LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.2 \
+                    $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.2 --set-rpath $out/lib --force-rpath $i
+            fi
+        done
+
+        # Fix the libc linker script.
+        for i in $out/lib/libc.so; do
+            cat $i | sed "s|/nix/store/e*-[^/]*/|$out/|g" > $i.tmp
+            mv $i.tmp $i
+        done
+      ''; # " */
+
+      allowedReferences = ["out"];
+    };
+
+    
+}
diff --git a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
index 3709ac05041..dcf819ad6f7 100644
--- a/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
+++ b/pkgs/stdenv/linux/scripts/unpack-bootstrap-tools-arm.sh
@@ -13,22 +13,24 @@ echo Patching the bootstrap tools...
 LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? $out/bin/cp $out/bin/patchelf .
 
 for i in $out/bin/* $out/libexec/gcc/*/*/* $out/lib/librt*; do
+    if test ${i%.la} != $i; then continue; fi
+    if test ${i%*.so*} != $i; then continue; fi
+    if ! test -f $i; then continue; fi
+    if test -L $i; then continue; fi
     echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
-    fi
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-interpreter $out/lib/ld-linux*.so.? --set-rpath $out/lib --force-rpath $i
 done
-for i in $out/lib/libppl* $out/lib/libgmp*; do
+for i in $out/lib/librt* $out/lib/libcloog* $out/lib/libppl* $out/lib/libgmp*; do
+    if ! test -f $i; then continue; fi
+    if test -L $i; then continue; fi
     echo patching $i
-    if ! test -L $i; then
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-         LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
-             $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
-    fi
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
+    LD_LIBRARY_PATH=$out/lib $out/lib/ld-linux*.so.? \
+        $out/bin/patchelf --set-rpath $out/lib --force-rpath $i
 done
 
 # Fix the libc linker script.
diff --git a/pkgs/stdenv/mingw/setup.sh b/pkgs/stdenv/mingw/setup.sh
index 4de3c0ddc9b..592580a829e 100755
--- a/pkgs/stdenv/mingw/setup.sh
+++ b/pkgs/stdenv/mingw/setup.sh
@@ -486,9 +486,7 @@ unpackPhase() {
 
 patchPhase() {
     runHook prePatch
-    
-    if test -z "$patchPhase" -a -z "$patches"; then return; fi
-    
+
     for i in $patches; do
         header "applying patch $i" 3
         local uncompress=cat
diff --git a/pkgs/stdenv/native/default.nix b/pkgs/stdenv/native/default.nix
index c0da8f2b0c1..524b2a53337 100644
--- a/pkgs/stdenv/native/default.nix
+++ b/pkgs/stdenv/native/default.nix
@@ -1,12 +1,12 @@
-{ system, allPackages ? import ../../.. }:
+{ system, allPackages ? import ../../.., config }:
 
 rec {
 
-  shell = 
+  shell =
     if system == "i686-freebsd" || system == "x86_64-freebsd" then "/usr/local/bin/bash"
     else "/bin/bash";
 
-  path = 
+  path =
     (if system == "i686-solaris" then [ "/usr/gnu" ] else []) ++
     (if system == "i686-netbsd" then [ "/usr/pkg" ] else []) ++
     ["/" "/usr" "/usr/local"];
@@ -22,13 +22,13 @@ rec {
     export NIX_DONT_SET_RPATH=1
     export NIX_NO_SELF_RPATH=1
     dontFixLibtool=1
-    stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 
+    stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
     xargsFlags=" "
   '';
 
   prehookFreeBSD = ''
     ${prehookBase}
-    
+
     alias make=gmake
     alias tar=gtar
     alias sed=gsed
@@ -41,14 +41,14 @@ rec {
 
   prehookOpenBSD = ''
     ${prehookBase}
-    
+
     alias make=gmake
     alias grep=ggrep
     alias mv=gmv
     alias ln=gln
     alias sed=gsed
     alias tar=gtar
-    
+
     export MAKE=gmake
     shopt -s expand_aliases
 
@@ -58,20 +58,20 @@ rec {
 
   prehookNetBSD = ''
     ${prehookBase}
-    
+
     alias make=gmake
     alias sed=gsed
     alias tar=gtar
     export MAKE=gmake
     shopt -s expand_aliases
-    
+
     # Filter out stupid GCC warnings (in gcc-wrapper).
     export NIX_GCC_NEEDS_GREP=1
   '';
 
   prehookCygwin = ''
     ${prehookBase}
-    
+
     if test -z "$cygwinConfigureEnableShared"; then
       export configureFlags="$configureFlags --disable-shared"
     fi
@@ -81,24 +81,24 @@ rec {
 
 
   # A function that builds a "native" stdenv (one that uses tools in
-  # /usr etc.).  
+  # /usr etc.).
   makeStdenv =
     { gcc, fetchurl, extraPath ? [], overrides ? (pkgs: { }) }:
 
     import ../generic {
       preHook =
-        if system == "i686-darwin" || system == "powerpc-darwin" || system == "x86_64-darwin" then prehookDarwin else
+        if system == "x86_64-darwin" then prehookDarwin else
         if system == "i686-freebsd" then prehookFreeBSD else
         if system == "x86_64-freebsd" then prehookFreeBSD else
         if system == "i686-openbsd" then prehookOpenBSD else
-	if system == "i686-netbsd" then prehookNetBSD else
+        if system == "i686-netbsd" then prehookNetBSD else
         prehookBase;
 
       initialPath = extraPath ++ path;
 
       fetchurlBoot = fetchurl;
 
-      inherit system shell gcc overrides;
+      inherit system shell gcc overrides config;
     };
 
 
@@ -106,7 +106,7 @@ rec {
     gcc = "/no-such-path";
     fetchurl = null;
   };
-  
+
 
   gcc = import ../../build-support/gcc-wrapper {
     name = "gcc-native";
@@ -116,14 +116,14 @@ rec {
     stdenv = stdenvBoot0;
   };
 
-    
+
   fetchurl = import ../../build-support/fetchurl {
     stdenv = stdenvBoot0;
     # Curl should be in /usr/bin or so.
     curl = null;
   };
-  
-    
+
+
   # First build a stdenv based only on tools outside the store.
   stdenvBoot1 = makeStdenv {
     inherit gcc fetchurl;
diff --git a/pkgs/stdenv/nix/default.nix b/pkgs/stdenv/nix/default.nix
index 5e242b6e3a1..d0f7d60f101 100644
--- a/pkgs/stdenv/nix/default.nix
+++ b/pkgs/stdenv/nix/default.nix
@@ -1,6 +1,8 @@
-{ stdenv, pkgs }:
+{ stdenv, pkgs, config }:
 
 import ../generic rec {
+  inherit config;
+
   preHook =
     ''
       export NIX_ENFORCE_PURITY=1
@@ -10,7 +12,7 @@ import ../generic rec {
         export NIX_DONT_SET_RPATH=1
         export NIX_NO_SELF_RPATH=1
         dontFixLibtool=1
-        stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" 
+        stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
         xargsFlags=" "
       fi
     '';
@@ -23,7 +25,7 @@ import ../generic rec {
     nativeTools = false;
     nativeLibc = true;
     inherit stdenv;
-    binutils = 
+    binutils =
       if stdenv.isDarwin then
         import ../../build-support/native-darwin-cctools-wrapper {inherit stdenv;}
       else
@@ -40,7 +42,7 @@ import ../generic rec {
   overrides = pkgs_: {
     inherit gcc;
     inherit (gcc) binutils;
-    inherit (pkgs) 
+    inherit (pkgs)
       gzip bzip2 xz bash coreutils diffutils findutils gawk
       gnumake gnused gnutar gnugrep gnupatch perl;
   };
diff --git a/pkgs/tools/X11/autocutsel/default.nix b/pkgs/tools/X11/autocutsel/default.nix
new file mode 100644
index 00000000000..871dc5e130a
--- /dev/null
+++ b/pkgs/tools/X11/autocutsel/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, libX11, libXaw}:
+
+let
+  name = "autocutsel-0.9.0";
+in
+stdenv.mkDerivation {
+  inherit name;
+ 
+  src = fetchurl {
+    url = "http://savannah.nongnu.org/download/autocutsel/${name}.tar.gz";
+    sha256 = "0hp335qq57l0kp58pfwb0bk930zx5497frq8y0lzr4icvk1fpw5y";
+  };
+ 
+  buildInputs = [ libX11 libXaw ];
+  installPhase = ''
+    mkdir -p $out/bin
+    cp autocutsel $out/bin/
+  '';
+
+  meta = {
+    homepage = "http://www.nongnu.org/autocutsel/";
+    description = "Autocutsel tracks changes in the server's cutbuffer and CLIPBOARD selection.";
+    license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/tools/X11/virtualgl/default.nix b/pkgs/tools/X11/virtualgl/default.nix
index 57df08c1e2b..3ae0920b9a7 100644
--- a/pkgs/tools/X11/virtualgl/default.nix
+++ b/pkgs/tools/X11/virtualgl/default.nix
@@ -2,19 +2,19 @@
 , libjpeg_turbo, cmake }:
 
 let
-  libDir = if stdenv.is64bit then "lib64" else "lib";
+  version = "2.3.2";
 in
 stdenv.mkDerivation {
-  name = "virtualgl-2.1.4";
+  name = "virtualgl-${version}";
   src = fetchurl {
-    url = mirror://sourceforge/virtualgl/VirtualGL-2.3.tar.gz;
-    sha256 = "2f00c4eb20b0ae88e957a23fb66882e4ade2faa208abd30aa8c4f61570ecd4b9";
+    url = "mirror://sourceforge/virtualgl/VirtualGL-${version}.tar.gz";
+    sha256 = "062lrhd8yr13ch4wpgzxdabqs92j4q7fcl3a0c3sdlav4arspqmy";
   };
 
   patches = [ ./xshm.patch ./fixturbopath.patch ];
 
   prePatch = ''
-    sed -i s,LD_PRELOAD=lib,LD_PRELOAD=$out/${libDir}/lib, rr/vglrun
+    sed -i s,LD_PRELOAD=lib,LD_PRELOAD=$out/lib/lib, server/vglrun
   '';
 
   cmakeFlags = [ "-DTJPEG_LIBRARY=${libjpeg_turbo}/lib/libturbojpeg.so" ];
diff --git a/pkgs/tools/X11/x11vnc/default.nix b/pkgs/tools/X11/x11vnc/default.nix
index 71c7046b0b7..23b0aaa55e8 100644
--- a/pkgs/tools/X11/x11vnc/default.nix
+++ b/pkgs/tools/X11/x11vnc/default.nix
@@ -23,8 +23,7 @@ stdenv.mkDerivation rec {
         --replace '"/bin/su"' '"/var/setuid-wrappers/su"' \
         --replace '"/bin/true"' '"${coreutils}/bin/true"'
         
-    substituteInPlace x11vnc/ssltools.h \
-        --replace xdpyinfo ${xorg.xdpyinfo}/bin/xdpyinfo
+    sed -i -e '/#!\/bin\/sh/a"PATH=${xorg.xdpyinfo}\/bin:$PATH\\n"' -e 's|/bin/su|/var/setuid-wrappers/su|g' x11vnc/ssltools.h
   '';
 
   meta = {
diff --git a/pkgs/tools/X11/xcalib/default.nix b/pkgs/tools/X11/xcalib/default.nix
new file mode 100644
index 00000000000..65868a3b6b0
--- /dev/null
+++ b/pkgs/tools/X11/xcalib/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, libX11, libXxf86vm, libXext }:
+
+stdenv.mkDerivation rec {
+  name = "xcalib-0.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xcalib/xcalib-source-0.8.tar.gz";
+    sha256 = "8a112ee710e5446f6c36e62345b2066f10639d500259db8c48bf1716caea06e6";
+  };
+
+  buildInputs = [ libX11 libXxf86vm libXext ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp xcalib $out/bin/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://xcalib.sourceforge.net/;
+    description = "A tiny monitor calibration loader for X and MS-Windows";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.rickynils ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/X11/xchainkeys/default.nix b/pkgs/tools/X11/xchainkeys/default.nix
new file mode 100644
index 00000000000..42e26825e33
--- /dev/null
+++ b/pkgs/tools/X11/xchainkeys/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "xchainkeys-0.11";
+
+  src = fetchurl {
+    url = "https://xchainkeys.googlecode.com/files/${name}.tar.gz";
+    sha256 = "1rpqs7h5krral08vqxwb0imy33z17v5llvrg5hy8hkl2ap7ya0mn";
+  };
+
+  buildInputs = [ libX11 ];
+
+  meta = {
+    homepage = "https://code.google.com/p/xchainkeys/";
+    description = "A standalone X11 program to create chained key bindings";
+    license = "GPLv3";
+  };
+}
diff --git a/pkgs/tools/X11/xdg-utils/default.nix b/pkgs/tools/X11/xdg-utils/default.nix
index cc166ba20d9..df5d59c7b57 100644
--- a/pkgs/tools/X11/xdg-utils/default.nix
+++ b/pkgs/tools/X11/xdg-utils/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, file }:
 
 stdenv.mkDerivation rec {
   name = "xdg-utils-1.0.2";
@@ -7,6 +7,10 @@ stdenv.mkDerivation rec {
     url = "http://portland.freedesktop.org/download/${name}.tgz";
     sha256 = "1b019d3r1379b60p33d6z44kx589xjgga62ijz9vha95dg8vgbi1";
   };
+
+  postInstall = ''
+    substituteInPlace $out/bin/xdg-mime --replace /usr/bin/file ${file}/bin/file
+  '';
   
   meta = {
     homepage = http://portland.freedesktop.org/wiki/;
diff --git a/pkgs/tools/X11/xkb-switch/default.nix b/pkgs/tools/X11/xkb-switch/default.nix
new file mode 100644
index 00000000000..0fc49038efe
--- /dev/null
+++ b/pkgs/tools/X11/xkb-switch/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchgit, cmake, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "xkb-switch-1.2";
+
+  src = fetchgit {
+    url = https://github.com/ierton/xkb-switch.git;
+    rev = "4c90511ecf2cacc040c97f034a13254c3fa9dfef";
+    sha256 = "1jxya67v1qnvbzd0cd5gj7xrwvxyfy1rpa70l8p30p9cmw3ahk41";
+  };
+
+  buildInputs = [ cmake libX11 ];
+
+  meta = {
+    description = "Switch X layouts from the command line";
+    homepage = https://github.com/ierton/xkb-switch.git;
+    maintainers = with stdenv.lib.maintainers; [smironov];
+    platforms = stdenv.lib.platforms.gnu;
+    license = "BSD";
+  };
+}
+
diff --git a/pkgs/tools/X11/xlaunch/default.nix b/pkgs/tools/X11/xlaunch/default.nix
index 0bc33bcb7fa..3cab25837e6 100644
--- a/pkgs/tools/X11/xlaunch/default.nix
+++ b/pkgs/tools/X11/xlaunch/default.nix
@@ -45,7 +45,7 @@ EOF
 			else
 			  RESET_OPTION=\"-noreset\"
 			fi;
-			XCMD=\"\$(egrep \"^env\" /etc/init/xserver.conf | sed -e \"s/env/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ \$RESET_OPTION )\" 
+			XCMD=\"\$(egrep \"^Environment=\" /etc/systemd/system/display-manager.service | sed -e \"s/Environment=/ export /\" | sed -e '\\''s/#.*//'\\'' ; echo export _XARGS_=\\\$\\( grep xserver_arguments \\\$SLIM_CFGFILE \\| sed -e s/xserver_arguments// \\| sed -e s/:0/:\${_display}/ \\| sed -e s/vt7/vt\$((7+_display))/ \\) ; echo ${xorgserver}/bin/X \\\$_XARGS_ \$RESET_OPTION )\" 
 			echo \"\$XCMD\" 
 			echo \"\$XCMD\" | bash &
 			while ! test -e /tmp/.X11-unix/X\$_display &>/dev/null ; do sleep 0.5; done
diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix
index 3fbb350e0ab..e0881e5aa9b 100644
--- a/pkgs/tools/X11/xpra/default.nix
+++ b/pkgs/tools/X11/xpra/default.nix
@@ -1,44 +1,40 @@
-{ stdenv, fetchurl, pkgconfig, python, cython
-, pygtk, pygobject, pycairo, notify, xlibs, gtk
-, ffmpeg, x264, libvpx, makeWrapper}:
+{ stdenv, fetchurl, buildPythonPackage
+, python, cython, pkgconfig
+, xorg, gtk, glib, pango, cairo, gdk_pixbuf, pygtk, atk, pygobject, pycairo
+, ffmpeg_1, x264, libvpx, pil, libwebp }:
 
-stdenv.mkDerivation rec {
-  name = "xpra-0.3.2";
+buildPythonPackage rec {
+  name = "xpra-0.8.8";
   
   src = fetchurl {
-    url = http://xpra.org/src/xpra-0.3.2.tar.bz2;
-    sha256 = "1s1z6r0r78qvf59ci3vxammjz7lj5m64jyk0bfn7yxd5jl3sy41y";
+    url = "http://xpra.org/src/${name}.tar.bz2";
+    sha256 = "248bac50c78eccfbc7f728667f9d0ef26b101b288193fa286881cda452e63683";
   };
 
-  buildNativeInputs = [ cython ];
+  buildInputs = [ 
+    python cython pkgconfig 
 
-  buildInputs = [
-    pkgconfig python pygtk gtk ffmpeg x264 libvpx makeWrapper
-    xlibs.inputproto xlibs.libXcomposite xlibs.libXdamage xlibs.libXtst
-  ];
+    xorg.libX11 xorg.renderproto xorg.libXrender xorg.libXi xorg.inputproto xorg.kbproto
+    xorg.randrproto xorg.damageproto xorg.compositeproto xorg.xextproto xorg.recordproto
+    xorg.xproto xorg.fixesproto xorg.libXtst xorg.libXfixes xorg.libXcomposite xorg.libXdamage
+    xorg.libXrandr
 
-  buildPhase = ''
-    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0)"
-    NIX_LDFLAGS="$NIX_LDFLAGS -lXcomposite -lXdamage"
-    ./do-build
-  '';
+    pango cairo gdk_pixbuf atk gtk glib
 
-  pythonPaths = [
-    "$out/lib/python"
-    "$(toPythonPath ${pygtk})/gtk-2.0"
-  ] ++ map (i: "$(toPythonPath ${i})") [
-    pygobject pycairo notify
+    ffmpeg_1 libvpx x264 libwebp
   ];
 
-  installPhase = ''
-    mkdir -p $out
-    cp -r install/* $out
+  propagatedBuildInputs = [ 
+    pil pygtk pygobject
+  ];
+
+  # Even after i tried monkey patching, their tests just fail, looks like
+  # they don't have automated testing out of the box? http://xpra.org/trac/ticket/177
+  doCheck = false;
 
-    for i in $(cd $out/bin && ls); do
-        wrapProgram $out/bin/$i \
-            --set PYTHONPATH "${stdenv.lib.concatStringsSep ":" pythonPaths}" \
-            --prefix PATH : "${xlibs.xauth}/bin:${xlibs.xorgserver}/bin:${xlibs.xmodmap}/bin"
-    done
+  buildPhase = ''
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0) $(pkg-config --cflags xtst)"
+    python ./setup.py build --enable-Xdummy
   '';
   
   meta = {
diff --git a/pkgs/tools/admin/tigervnc/default.nix b/pkgs/tools/admin/tigervnc/default.nix
index 36aae068438..be42fb4d2a5 100644
--- a/pkgs/tools/admin/tigervnc/default.nix
+++ b/pkgs/tools/admin/tigervnc/default.nix
@@ -3,29 +3,31 @@
 , fontDirectories, fontutil, libgcrypt, gnutls, pam, flex, bison
 , fixesproto, damageproto, xcmiscproto, bigreqsproto, randrproto, renderproto
 , fontsproto, videoproto, compositeproto, scrnsaverproto, resourceproto
-, libxkbfile, libXfont, libpciaccess
+, libxkbfile, libXfont, libpciaccess, cmake, libjpeg_turbo, libXft, fltk, libXinerama
+, xineramaproto, libXcursor, fetchsvn
 }:
 
-
-
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "tigervnc-1.1.0";
-  
-  src = fetchurl {
-    url = "mirror://sourceforge/tigervnc/${name}.tar.gz";
-    sha256 = "1x30s12fwv9rk0fnwwn631qq0d8rpjjx53bvzlx8c91cba170jsr";
+  # Release version = "1.2.0";
+  revision = 5005;
+  version = "r${toString revision}";
+  name = "tigervnc-${version}";
+
+  src = fetchsvn {
+    # Release url = "mirror://sourceforge/tigervnc/${version}/${name}.tar.gz";
+    url = "https://tigervnc.svn.sourceforge.net/svnroot/tigervnc/trunk";
+    rev = revision;
+    sha256 = "2401e0ede9a2d50a37caeb094e5e832d24878749239578f44ae2acd42de01b43";
   };
 
-  configureFlags = "--enable-nls";
-
   inherit fontDirectories;
 
   patchPhase = ''
-    sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.hostDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
-    sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.hostDrv else xkbcomp}/bin";' unix/vncserver 
-    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.hostDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver 
+    sed -i -e 's,$(includedir)/pixman-1,${if stdenv ? cross then pixman.crossDrv else pixman}/include/pixman-1,' unix/xserver/hw/vnc/Makefile.am
+    sed -i -e '/^$pidFile/a$ENV{XKB_BINDIR}="${if stdenv ? cross then xkbcomp.crossDrv else xkbcomp}/bin";' unix/vncserver
+    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -xkbdir ${if stdenv ? cross then xkeyboard_config.crossDrv else xkeyboard_config}/etc/X11/xkb";' unix/vncserver
 
     fontPath=
     for i in $fontDirectories; do
@@ -33,15 +35,19 @@ stdenv.mkDerivation rec {
         addToSearchPathWithCustomDelimiter "," fontPath $(dirname $j)
       done
     done
-    
-    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -fp '"$fontPath"'";' unix/vncserver 
+
+    sed -i -e '/^\$cmd \.= " -pn";/a$cmd .= " -fp '"$fontPath"'";' unix/vncserver
   '';
 
   # I don't know why I can't use in the script
   # this:  ${concatStringsSep " " (map (f: "${f}") xorgserver.patches)}
   xorgPatches = xorgserver.patches;
 
+  dontUseCmakeBuildDir = "yes";
+
   postBuild = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -fpermissive -Wno-error=int-to-pointer-cast"
+
     # Build Xvnc
     tar xf ${xorgserver.src}
     cp -R xorg*/* unix/xserver
@@ -50,42 +56,39 @@ stdenv.mkDerivation rec {
     do
       patch -p1 < $a
     done
-    patch -p1 < ../xserver18.patch
+    patch -p1 < ../xserver113.patch
     autoreconf -vfi
-    ./configure $configureFlags --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg --disable-dmx --disable-dri --disable-dri2 --disable-glx
+    ./configure $configureFlags --disable-xinerama --disable-xvfb --disable-xnest --disable-xorg --disable-dmx --disable-dri --disable-dri2 --disable-glx --prefix="$out"
     make TIGERVNC_SRCDIR=`pwd`/../..
     popd
   '';
 
-  # I don't know why I need this; it may have to do with this problem:
-  # http://bugs.gentoo.org/show_bug.cgi?id=142852
-  preInstall = ''
-    sed -i -e s,@MKINSTALLDIRS@,`pwd`/mkinstalldirs, po/Makefile
-  '';
-
   postInstall = ''
     pushd unix/xserver
     make TIGERVNC_SRCDIR=`pwd`/../.. install
   '';
 
   crossAttrs = {
-    buildInputs = (map (x : x.hostDrv) (buildInputs ++ [
+    buildInputs = (map (x : x.crossDrv) (buildInputs ++ [
       fixesproto damageproto xcmiscproto bigreqsproto randrproto renderproto
       fontsproto videoproto compositeproto scrnsaverproto resourceproto
-      libxkbfile libXfont libpciaccess
+      libxkbfile libXfont libpciaccess xineramaproto
     ]));
   };
 
   buildInputs =
-    [ libX11 libXext gettext libICE libXtst libXi libSM
-      nasm libgcrypt gnutls pam pixman
+    [ libX11 libXext gettext libICE libXtst libXi libSM libXft
+      nasm libgcrypt gnutls pam pixman libjpeg_turbo fltk xineramaproto
+      libXinerama libXcursor
     ];
-  
-  buildNativeInputs = 
-    [ autoconf automake cvs utilmacros fontutil libtool flex bison ] 
-      ++ xorgserver.buildNativeInputs;
 
-  propagatedBuildNativeInputs = xorgserver.propagatedBuildNativeInputs;
+  nativeBuildInputs =
+    [ autoconf automake cvs utilmacros fontutil libtool flex bison
+      cmake
+    ]
+      ++ xorgserver.nativeBuildInputs;
+
+  propagatedNativeBuildInputs = xorgserver.propagatedNativeBuildInputs;
 
   meta = {
     homepage = http://www.tigervnc.org/;
@@ -94,5 +97,4 @@ stdenv.mkDerivation rec {
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
   };
-
 }
diff --git a/pkgs/tools/archivers/cabextract/default.nix b/pkgs/tools/archivers/cabextract/default.nix
index 9e11a1bf761..79be818bfb3 100644
--- a/pkgs/tools/archivers/cabextract/default.nix
+++ b/pkgs/tools/archivers/cabextract/default.nix
@@ -1,10 +1,11 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "cabextract-1.3";
+  name = "cabextract-1.4";
+
   src = fetchurl {
-    url = meta.homepage + name + ".tar.gz";
-    sha256 = "00f0qcrz9f2gwvm98qglbrjpwrzwrfdgh0hck6im93dl6lx3hr6l";
+    url = "http://www.cabextract.org.uk/${name}.tar.gz";
+    sha256 = "07p49053a727nwnw7vnx1bpj4xqa43cvx8mads2146fpqai8pfpp";
   };
 
   meta = {
diff --git a/pkgs/tools/archivers/cpio/latest.nix b/pkgs/tools/archivers/cpio/latest.nix
deleted file mode 100644
index 8e14ff17866..00000000000
--- a/pkgs/tools/archivers/cpio/latest.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{stdenv, fetchurl}:
-
-stdenv.mkDerivation ({
-  name = "cpio-2.11";
-
-  src = fetchurl {
-    url = mirror://gnu/cpio/cpio-2.11.tar.bz2;
-    sha256 = "1gavgpzqwgkpagjxw72xgxz52y1ifgz0ckqh8g7cckz7jvyhp0mv";
-  };
-
-  # Tests fail on Darwin, see
-  # <http://lists.gnu.org/archive/html/bug-cpio/2010-07/msg00012.html> for
-  # details.
-  doCheck = !stdenv.isDarwin;
-
-  meta = {
-    homepage = http://www.gnu.org/software/cpio/;
-    description = "GNU cpio, a program to create or extract from cpio archives";
-
-    longDescription =
-      '' GNU cpio copies files into or out of a cpio or tar archive.  The
-         archive can be another file on the disk, a magnetic tape, or a pipe.
-
-         GNU cpio supports the following archive formats: binary, old ASCII,
-         new ASCII, crc, HPUX binary, HPUX old ASCII, old tar, and POSIX.1
-         tar.  The tar format is provided for compatability with the tar
-         program.  By default, cpio creates binary format archives, for
-         compatibility with older cpio programs.  When extracting from
-         archives, cpio automatically recognizes which kind of archive it is
-         reading and can read archives created on machines with a different
-         byte-order.
-      '';
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.all;
-  };
-}
-
-//
-
-(if stdenv.isLinux
- then {}
- else { patches = [ ./darwin-fix.patch ]; }))
diff --git a/pkgs/tools/archivers/gnutar/default.nix b/pkgs/tools/archivers/gnutar/default.nix
index 4ef973bd56a..51d5d35fe80 100644
--- a/pkgs/tools/archivers/gnutar/default.nix
+++ b/pkgs/tools/archivers/gnutar/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl }:
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   name = "gnutar-1.26";
 
   src = fetchurl {
@@ -8,6 +8,12 @@ stdenv.mkDerivation (rec {
     sha256 = "0hbdkzmchq9ycr2x1pxqdcgdbaxksh8c6ac0jf75jajhcks6jlss";
   };
 
+  patches = [ ./gets-undeclared.patch ];
+
+  # May have some issues with root compilation because the bootstrap tool
+  # cannot be used as a login shell for now.
+  FORCE_UNSAFE_CONFIGURE = stdenv.lib.optionalString (stdenv.system == "armv7l-linux") "1";
+
   meta = {
     homepage = http://www.gnu.org/software/tar/;
     description = "GNU implementation of the `tar' archiver";
@@ -33,18 +39,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-  # May have some issues with root compilation because the bootstrap tool
-  # cannot be used as a login shell for now.
-// stdenv.lib.optionalAttrs (stdenv.system == "armv7l-linux") {
-  FORCE_UNSAFE_CONFIGURE = 1;
-}
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ./gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix
index bb9743e8e5d..767e85d6773 100644
--- a/pkgs/tools/archivers/p7zip/default.nix
+++ b/pkgs/tools/archivers/p7zip/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "p7zip-9.13";
+  name = "p7zip-9.20.1";
   
   src = fetchurl {
-    url = mirror://sourceforge/p7zip/p7zip_9.13_src_all.tar.bz2;
-    sha256 = "08yr0cfbjx60r1ia7vhphzvc3gax62xhgsn3vdm7sdmxxai0z77w";
+    url = mirror://sourceforge/p7zip/p7zip_9.20.1_src_all.tar.bz2;
+    sha256 = "10j7rc1nzdp7vvcpc3340yi3qw7abby4szv8zkwh10d0zizpwma9";
   };
 
   preConfigure =
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
       buildFlags=all3
     '';
 
+  enableParallelBuilding = true;
+
   meta = {
     homepage = http://p7zip.sourceforge.net/;
     description = "A port of the 7-zip archiver";
diff --git a/pkgs/tools/archivers/sharutils/default.nix b/pkgs/tools/archivers/sharutils/default.nix
index 15b8ead7d38..7346b8e4e05 100644
--- a/pkgs/tools/archivers/sharutils/default.nix
+++ b/pkgs/tools/archivers/sharutils/default.nix
@@ -8,11 +8,22 @@ stdenv.mkDerivation rec {
     sha256 = "1mallg1gprimlggdisfzdmh1xi676jsfdlfyvanlcw72ny8fsj3g";
   };
 
+  preConfigure =
+    ''
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in sharutils is updated.
+       sed -i '/gets is a security hole/d' lib/stdio.in.h
+    '';
+
   # GNU Gettext is needed on non-GNU platforms.
   buildInputs = [ gettext ];
 
   doCheck = true;
 
+  crossAttrs = {
+    patches = [ ./sharutils-4.11.1-cross-binary-mode-popen.patch ];
+  };
+
   meta = {
     description = "GNU Sharutils, tools for remote synchronization and `shell archives'";
 
diff --git a/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch b/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch
new file mode 100644
index 00000000000..f05eab251d4
--- /dev/null
+++ b/pkgs/tools/archivers/sharutils/sharutils-4.11.1-cross-binary-mode-popen.patch
@@ -0,0 +1,63 @@
+diff -Naur sharutils-4.11.1.orig/configure sharutils-4.11.1/configure
+--- sharutils-4.11.1.orig/configure	2011-06-20 11:07:40.000000000 -0400
++++ sharutils-4.11.1/configure	2011-06-20 11:09:30.000000000 -0400
+@@ -26962,33 +26962,33 @@
+   CATALOGS="$new_CATALOGS"
+ fi
+ 
+-if test "$cross_compiling" = yes; then :
+-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+-as_fn_error $? "cannot run test program while cross compiling
+-See \`config.log' for more details" "$LINENO" 5; }
+-else
+-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+-/* end confdefs.h.  */
+-
+-int
+-main ()
+-{
+-    FILE * fp = popen ("date", "rb");
+-    exit (fp == NULL);
+-  ;
+-  return 0;
+-}
+-_ACEOF
+-if ac_fn_c_try_run "$LINENO"; then :
+-
++#if test "$cross_compiling" = yes; then :
++#  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
++#$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
++#as_fn_error $? "cannot run test program while cross compiling
++#See \`config.log' for more details" "$LINENO" 5; }
++#else
++#  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++#/* end confdefs.h.  */
++#
++#int
++#main ()
++#{
++#    FILE * fp = popen ("date", "rb");
++#    exit (fp == NULL);
++#  ;
++#  return 0;
++#}
++#_ACEOF
++#if ac_fn_c_try_run "$LINENO"; then :
++#
+ $as_echo "#define BINARY_MODE_POPEN 1" >>confdefs.h
+-
+-
+-fi
+-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+-fi
++#
++#
++#fi
++#rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
++#  conftest.$ac_objext conftest.beam conftest.$ac_ext
++#fi
+ 
+ 
+ 
diff --git a/pkgs/tools/archivers/xarchive/default.nix b/pkgs/tools/archivers/xarchive/default.nix
new file mode 100644
index 00000000000..2b60bef197a
--- /dev/null
+++ b/pkgs/tools/archivers/xarchive/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, gtk2, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.8-6";
+  name = "xarchive-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xarchive/${name}.tar.gz";
+    sha256 = "0chfim7z27s00naf43a61zsngwhvim14mg1p3csbv5i3f6m50xx4";
+  };
+
+  buildInputs = [ gtk2 pkgconfig ];
+
+  meta = {
+    description = "A GTK+ front-end for command line archiving tools";
+    mainatainers = [ stdenv.lib.maintainers.iElectric ];
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/tools/archivers/zip/default.nix b/pkgs/tools/archivers/zip/default.nix
index c7bddfd6de2..2e3f111aba4 100644
--- a/pkgs/tools/archivers/zip/default.nix
+++ b/pkgs/tools/archivers/zip/default.nix
@@ -6,7 +6,10 @@ stdenv.mkDerivation {
   name = "zip-3.0";
 
   src = fetchurl {
-    url = ftp://ftp.info-zip.org/pub/infozip/src/zip30.tgz;
+    urls = [
+      ftp://ftp.info-zip.org/pub/infozip/src/zip30.tgz
+      http://pkgs.fedoraproject.org/repo/pkgs/zip/zip30.tar.gz/7b74551e63f8ee6aab6fbc86676c0d37/zip30.tar.gz
+    ];
     sha256 = "0sb3h3067pzf3a7mlxn1hikpcjrsvycjcnj9hl9b1c3ykcgvps7h";
   };
 
diff --git a/pkgs/tools/archivers/zpaq/default.nix b/pkgs/tools/archivers/zpaq/default.nix
new file mode 100644
index 00000000000..6b04fe17268
--- /dev/null
+++ b/pkgs/tools/archivers/zpaq/default.nix
@@ -0,0 +1,51 @@
+{stdenv, fetchurl, unzip}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="zpaq";
+    version="625";
+    name="${baseName}-${version}";
+    hash="0d3ly8l6mzbqxkg68yz7mid3dr056fgr5n49rlkjwcfg533c5gwx";
+    url="http://mattmahoney.net/dc/zpaq625.zip";
+    sha256="0d3ly8l6mzbqxkg68yz7mid3dr056fgr5n49rlkjwcfg533c5gwx";
+  };
+  buildInputs = [
+    unzip
+  ];
+  isUnix = stdenv.isLinux || stdenv.isGNU || stdenv.isDarwin || stdenv.isBSD;
+  isx86 = stdenv.isi686 || stdenv.isx86_64;
+  compileFlags = ""
+    + (stdenv.lib.optionalString isUnix " -Dunix -pthread ")
+    + (stdenv.lib.optionalString (!isx86) " -DNOJIT ")
+    + " -DNDEBUG "
+    + " -fPIC "
+    ;
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  sourceRoot = ".";
+  buildPhase = ''
+    g++ -shared -O3 libzpaq.cpp divsufsort.c ${compileFlags} -o libzpaq.so
+    g++ -O3 -L. -L"$out/lib" -lzpaq zpaq.cpp -o zpaq
+    g++ -O3 -L. -L"$out/lib" -lzpaq zpaqd.cpp -o zpaqd
+  '';
+  installPhase = ''
+    mkdir -p "$out"/{bin,include,lib,share/doc/zpaq}
+    cp libzpaq.so "$out/lib"
+    cp zpaq zpaqd "$out/bin"
+    cp libzpaq.h divsufsort.h "$out/include"
+    cp readme.txt "$out/share/doc/zpaq"
+  '';
+  meta = {
+    inherit (s) version;
+    description = ''An archiver with backward compatibility of versions for decompression'';
+    license = stdenv.lib.licenses.gpl3Plus ;
+    maintainers = [stdenv.lib.maintainers.raskin];
+    platforms = stdenv.lib.platforms.linux;
+    homepage = "http://mattmahoney.net/dc/zpaq.html";
+  };
+}
diff --git a/pkgs/tools/archivers/zpaq/default.upstream b/pkgs/tools/archivers/zpaq/default.upstream
new file mode 100644
index 00000000000..2d62f834647
--- /dev/null
+++ b/pkgs/tools/archivers/zpaq/default.upstream
@@ -0,0 +1,3 @@
+url http://mattmahoney.net/dc/zpaq.html
+version_link "/zpaq[0-9]+[.]zip"
+version "[^0-9]*([0-9]+)[^0-9]*" '\1'
diff --git a/pkgs/tools/audio/pa-applet/default.nix b/pkgs/tools/audio/pa-applet/default.nix
new file mode 100644
index 00000000000..c5b45743c34
--- /dev/null
+++ b/pkgs/tools/audio/pa-applet/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchgit, pulseaudio, pkgconfig, gtk3, glibc, autoconf, automake, libnotify, libX11, xf86inputevdev }:
+
+stdenv.mkDerivation rec {
+  name = "pa-applet";
+
+  src = fetchgit {
+    url = "git://github.com/fernandotcl/pa-applet.git";
+    rev = "005f192df9ba6d2e6491f9aac650be42906b135a";
+    sha256 = "1rqnp6nzgb3z7c6pvd5qzsxprwrzif8cfx6i7xp3f0x5s7n2dqkb";
+  };
+
+  buildInputs = [
+    gtk3 pulseaudio glibc pkgconfig automake autoconf libnotify libX11 xf86inputevdev
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  postInstall = ''
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://projects.gnome.org/NetworkManager/;
+    description = "";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ iElectric ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/backup/bacula/default.nix b/pkgs/tools/backup/bacula/default.nix
index c6ad0876823..d3acdf74753 100644
--- a/pkgs/tools/backup/bacula/default.nix
+++ b/pkgs/tools/backup/bacula/default.nix
@@ -1,20 +1,30 @@
-{stdenv, fetchurl, sqlite, zlib, acl, ncurses, openssl, readline}:
+{stdenv, fetchurl, sqlite, postgresql, zlib, acl, ncurses, openssl, readline}:
 
-stdenv.mkDerivation {
-  name = "bacula-5.0.3";
+stdenv.mkDerivation rec {
+  name = "bacula-5.2.13";
 
   src = fetchurl {
-    url = mirror://sourceforge/bacula/bacula-5.0.3.tar.gz;
-    sha256 = "1d7x6jw5x9ljbdxvcc8k635lsxcbxw9kzjyxf6l4zsdv3275j1cr";
+    url = "mirror://sourceforge/bacula/${name}.tar.gz";
+    sha256 = "1n3sc0kd7r0afpyi708y3md0a24rbldnfcdz0syqj600pxcd9gm4";
   };
 
-  buildInputs = [ sqlite zlib acl ncurses openssl readline ];
+  buildInputs = [ postgresql sqlite zlib acl ncurses openssl readline ];
 
-  configureFlags = [ "--with-sqlite3=${sqlite}" ];
+  configureFlags = [ 
+    "--with-sqlite3=${sqlite}" 
+    "--with-postgresql=${postgresql}"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/bin
+    ln -s $out/sbin/* $out/bin
+  '';
 
   meta = {
     description = "Enterprise ready, Network Backup Tool";
     homepage = http://bacula.org/;
     license = "GPLv2";
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.iElectric ];
   };
 }
diff --git a/pkgs/tools/backup/bup/default.nix b/pkgs/tools/backup/bup/default.nix
index 586fc514ba6..e683df5a7fe 100644
--- a/pkgs/tools/backup/bup/default.nix
+++ b/pkgs/tools/backup/bup/default.nix
@@ -1,35 +1,35 @@
-{ stdenv, fetchgit, python, pyxattr, pylibacl, setuptools, fuse, git, perl, pandoc, makeWrapper }:
+{ stdenv, fetchgit, python, pyxattr, pylibacl, setuptools, fuse, git, perl, pandoc, makeWrapper
+, par2cmdline, par2Support ? false }:
+
+assert par2Support -> par2cmdline != null;
 
 with stdenv.lib;
 
 stdenv.mkDerivation {
-  name = "bup-0.25git20120722";
+  name = "bup-0.25-rc1-107-g96c6fa2";
 
   src = fetchgit {
-    url = "https://github.com/apenwarr/bup.git";
-    sha256 = "3ad232d7f23071ed34f920bd4c3137583f1adffbe23c022896289bc0a03fe7aa";
-    rev = "02bd2b566ea5eec2fd656e0ae572b4c7b6b9550a";
+    url = "https://github.com/bup/bup.git";
+    rev = "96c6fa2a70425fff1e73d2e0945f8e242411ab58";
+    sha256 = "0d9hgyh1g5qcpdvnqv3a5zy67x79yx9qx557rxrnxyzqckp9v75n";
   };
 
-  buildNativeInputs = [ pandoc perl makeWrapper ];
-
   buildInputs = [ python git ];
-
-  postInstall = optionalString (elem stdenv.system platforms.linux) ''
-    wrapProgram $out/bin/bup --prefix PYTHONPATH : \
-      ${stdenv.lib.concatStringsSep ":"
-          (map (path: "$(toPythonPath ${path})") [ pyxattr pylibacl setuptools fuse ])}
-  '';
+  nativeBuildInputs = [ pandoc perl makeWrapper ];
 
   patchPhase = ''
-    for f in cmd/* lib/tornado/* lib/tornado/test/* t/* wvtest.py main.py; do
+    substituteInPlace Makefile --replace "-Werror" ""
+    for f in "cmd/"* "lib/tornado/"* "lib/tornado/test/"* "t/"* wvtest.py main.py; do
+      test -f $f || continue
       substituteInPlace $f --replace "/usr/bin/env python" "${python}/bin/python"
     done
     substituteInPlace Makefile --replace "./format-subst.pl" "perl ./format-subst.pl"
-    substituteInPlace lib/bup/csetup.py \
-      --replace "'bupsplit.c'])" "'bupsplit.c'], library_dirs=['${python}/lib'])"
+  '' + optionalString par2Support ''
+    substituteInPlace cmd/fsck-cmd.py --replace "['par2'" "['${par2cmdline}/bin/par2'"
   '';
 
+  dontAddPrefix = true;
+
   makeFlags = [
     "MANDIR=$(out)/share/man"
     "DOCDIR=$(out)/share/doc/bup"
@@ -37,11 +37,23 @@ stdenv.mkDerivation {
     "LIBDIR=$(out)/lib/bup"
   ];
 
+  postInstall = optionalString (elem stdenv.system platforms.linux) ''
+    wrapProgram $out/bin/bup --prefix PYTHONPATH : \
+      ${stdenv.lib.concatStringsSep ":"
+          (map (path: "$(toPythonPath ${path})") [ pyxattr pylibacl setuptools fuse ])}
+  '';
+
   meta = {
-    description = ''
+    homepage = "https://github.com/bup/bup";
+    description = "efficient file backup system based on the git packfile format";
+    license = stdenv.lib.licenses.gpl2Plus;
+
+    longDescription = ''
       Highly efficient file backup system based on the git packfile format.
       Capable of doing *fast* incremental backups of virtual machine images.
     '';
-    homepage = "https://github.com/apenwarr/bup";
+
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/tools/backup/duplicity/default.nix b/pkgs/tools/backup/duplicity/default.nix
index bb5ae55b904..0b0c1dbb943 100644
--- a/pkgs/tools/backup/duplicity/default.nix
+++ b/pkgs/tools/backup/duplicity/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, python, librsync, gnupg, boto, makeWrapper }:
 
 stdenv.mkDerivation {
-  name = "duplicity-0.6.17";
+  name = "duplicity-0.6.20";
 
   src = fetchurl {
-    url = "http://code.launchpad.net/duplicity/0.6-series/0.6.17/+download/duplicity-0.6.17.tar.gz";
-    sha256 = "0n54fw55v4h0cjspgh9nhss5w18bfrib9fckgkk2fldi3835c7l9";
+    url = "http://code.launchpad.net/duplicity/0.6-series/0.6.20/+download/duplicity-0.6.20.tar.gz";
+    sha256 = "0r0nf7arc3n5ipvvbh7h6ksqzbl236iv5pjpmd5s7lff3xswdl2i";
   };
 
   installPhase = ''
diff --git a/pkgs/tools/backup/obnam/default.nix b/pkgs/tools/backup/obnam/default.nix
index 119633e0638..69927e01582 100644
--- a/pkgs/tools/backup/obnam/default.nix
+++ b/pkgs/tools/backup/obnam/default.nix
@@ -1,12 +1,14 @@
 { stdenv, fetchurl, python, pythonPackages, pycrypto, attr }:
 
-pythonPackages.buildPythonPackage {
-  name = "obnam-1.1";
+pythonPackages.buildPythonPackage rec {
+  name = "obnam-${version}";
+  version = "1.4";
+
   namePrefix = "";
 
   src = fetchurl rec {
-    url = "http://code.liw.fi/debian/pool/main/o/obnam/obnam_1.1.orig.tar.gz";
-    sha256 = "763693e5ea4e8d6a63b1a16c2aacd5fe0dc97abc687c8f0dde5840f77d549349";
+    url = "http://code.liw.fi/debian/pool/main/o/obnam/obnam_${version}.orig.tar.gz";
+    sha256 = "0gipbhh20p9n1x1cdpcil8vg3i20f1saa0xyz2wydb9xl4l2mjff";
   };
 
   buildInputs = [ pythonPackages.sphinx attr ];
diff --git a/pkgs/tools/backup/partclone/default.nix b/pkgs/tools/backup/partclone/default.nix
new file mode 100644
index 00000000000..b446b06f987
--- /dev/null
+++ b/pkgs/tools/backup/partclone/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl
+, pkgconfig, libuuid
+, e2fsprogs
+}:
+stdenv.mkDerivation {
+  name = "partclone-stable";
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = https://codeload.github.com/Thomas-Tsai/partclone/legacy.tar.gz/stable;
+    sha256 = "0vvk6c26gf2wv5y0mxnz90bivgp84pi82qk5q5xkcz6nz3swals7";
+    name = "Thomas-Tsai-partclone-stable-0-gab3bd53.tar.gz";
+  };
+
+  buildInputs = [e2fsprogs pkgconfig libuuid];
+
+  installPhase = ''make INSTPREFIX=$out install'';
+
+  meta = {
+    description = "Partclone provides utilities to save and restore used blocks on a partition and is designed for higher compatibility of the file system by using existing libraries, e.g. e2fslibs is used to read and write the ext2 partition";
+    homepage = http://partclone.org;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/backup/partimage/default.nix b/pkgs/tools/backup/partimage/default.nix
new file mode 100644
index 00000000000..d06ef2c8366
--- /dev/null
+++ b/pkgs/tools/backup/partimage/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, bzip2, zlib, newt, openssl, pkgconfig, slang
+, automake, autoconf, libtool, gettext
+}:
+stdenv.mkDerivation {
+  name = "partimage-0.6.9";
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = http://sourceforge.net/projects/partimage/files/stable/0.6.9/partimage-0.6.9.tar.bz2;
+    sha256 = "0db6xiphk6xnlpbxraiy31c5xzj0ql6k4rfkmqzh665yyj0nqfkm";
+  };
+  configureFlags = "--with-ssl-headers=${openssl}/include/openssl";
+
+  buildInputs = [bzip2 zlib newt newt openssl pkgconfig slang
+    # automake autoconf libtool gettext
+  ];
+
+  patches = [
+    ./gentoos-zlib.patch
+  ];
+
+  meta = {
+    description = "opensource disk backup software";
+    homepage = http://www.partimage.org;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/backup/partimage/gentoos-zlib.patch b/pkgs/tools/backup/partimage/gentoos-zlib.patch
new file mode 100644
index 00000000000..05150e131e3
--- /dev/null
+++ b/pkgs/tools/backup/partimage/gentoos-zlib.patch
@@ -0,0 +1,33 @@
+http://bugs.gentoo.org/405323
+
+--- a/src/client/imagefile.cpp
++++ b/src/client/imagefile.cpp
+@@ -783,7 +783,7 @@
+   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+     {
+       showDebug(1, "open gzip\n");
+-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "wb"); //"wb1h");
++      m_gzImageFile = gzdopen(m_nFdImage, "wb"); //"wb1h");
+       if (m_gzImageFile == NULL)
+ 	{
+ 	  showDebug(1, "error:%d %s\n", errno, strerror(errno));
+@@ -1098,7 +1098,7 @@
+     }
+   else if (m_options.dwCompression == COMPRESS_GZIP) // Gzip compression
+     {
+-      m_gzImageFile = (gzFile *) gzdopen(m_nFdImage, "rb");
++      m_gzImageFile = gzdopen(m_nFdImage, "rb");
+       if (m_gzImageFile == NULL)
+         THROW(ERR_ERRNO, errno);
+       else
+--- a/src/client/imagefile.h
++++ b/src/client/imagefile.h
+@@ -41,7 +41,7 @@
+   COptions m_options;
+ 
+   FILE *m_fImageFile;
+-  gzFile *m_gzImageFile;
++  gzFile m_gzImageFile;
+   BZFILE *m_bzImageFile;
+ 
+   int m_nFdImage;
diff --git a/pkgs/tools/backup/rsnapshot/default.nix b/pkgs/tools/backup/rsnapshot/default.nix
index a9cba3f7dee..3da2fad21f2 100644
--- a/pkgs/tools/backup/rsnapshot/default.nix
+++ b/pkgs/tools/backup/rsnapshot/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   name = "rsnapshot-1.3.0";
   src = fetchurl {
-    url = "mirrors://sourceforge/rsnapshot/${name}.tar.gz";
+    url = "mirror://sourceforge/rsnapshot/${name}.tar.gz";
     sha256 = "19p35ycm73a8vd4ccjpah18h5jagvcr11rqca6ya87sg8k0a5h9z";
   };
 
diff --git a/pkgs/tools/backup/tarsnap/default.nix b/pkgs/tools/backup/tarsnap/default.nix
new file mode 100644
index 00000000000..bcf03356c68
--- /dev/null
+++ b/pkgs/tools/backup/tarsnap/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, openssl, zlib, e2fsprogs }:
+
+stdenv.mkDerivation {
+  name = "tarsnap-1.0.33";
+
+  src = fetchurl {
+    url = "https://www.tarsnap.com/download/tarsnap-autoconf-1.0.33.tgz";
+    sha256 = "0z8bmra3xms9vcgvkiy9fy1j97192z6w7n658j6zr5cniid8438c";
+  };
+
+  buildInputs = [ openssl zlib e2fsprogs ];
+
+  meta = {
+    description = "Online backups for the truly paranoid";
+    homepage = "http://www.tarsnap.com/";
+    maintainers = with stdenv.lib.maintainers; [roconnor];
+  };
+}
diff --git a/pkgs/tools/bluetooth/bluedevil/default.nix b/pkgs/tools/bluetooth/bluedevil/default.nix
index 287036f3e0a..b8b7510b882 100644
--- a/pkgs/tools/bluetooth/bluedevil/default.nix
+++ b/pkgs/tools/bluetooth/bluedevil/default.nix
@@ -1,14 +1,22 @@
-{ stdenv, fetchgit, cmake, automoc4, kdelibs, libbluedevil, shared_mime_info }:
+{ stdenv, fetchurl, cmake, automoc4, kdelibs, libbluedevil, shared_mime_info, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "bluedevil-20110303";
+  name = "${pname}-${version}";
+  pname = "bluedevil";
+  version = "1.3.1";
 
-  src = fetchgit {
-    url = git://anongit.kde.org/bluedevil.git;
-    sha256 = "1chx3cx43wic1sgzc651vxxiy9khbp9hcm7n40nmhnj9czfcg46q";
-    rev = "7e513008aa6430d3b8d0052b14201d1d813c80b9";
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
+    sha256 = "0di3hwgqzhx51x172wnbccf9f84cg69mab83qkcif0v3gv3pzy4f";
   };
 
-  buildInputs = [ cmake kdelibs libbluedevil shared_mime_info automoc4 ];
+  buildInputs = [ cmake kdelibs libbluedevil shared_mime_info automoc4 gettext ];
+
+  meta = with stdenv.lib; {
+    description = "Bluetooth manager for KDE";
+    license = "GPLv2";
+    inherit (kdelibs.meta) platforms;
+    maintainers = [ maintainers.phreedom ];
+  };
 
 }
diff --git a/pkgs/tools/bluetooth/kbluetooth/default.nix b/pkgs/tools/bluetooth/kbluetooth/default.nix
deleted file mode 100644
index 047b4f822ae..00000000000
--- a/pkgs/tools/bluetooth/kbluetooth/default.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{ stdenv, fetchurl, kdelibs, cmake, qt4, automoc4, phonon, kdebase_workspace, soprano, gettext
-, semanticDesktop ? true }:
-with stdenv;
-mkDerivation rec {
-  name = "kbluetooth-${version}";
-  version = "0.4.2";
-
-  src = fetchurl {
-    url = "http://kde-apps.org/CONTENT/content-files/112110-${name}.tar.bz2";
-    sha256 = "0z5clp677g1vgh3dd09ilq1r481y342q2cx5pzjj51y1d9lb5zp5";
-  };
-
-  enableParallelBuilding = true;
-
-  buildInputs = [ cmake qt4 kdelibs automoc4 phonon kdebase_workspace soprano gettext]
-    ++ lib.optional semanticDesktop soprano;
-
-  patchPhase = ''
-      substituteInPlace src/CMakeLists.txt --replace "DESTINATION \''${KDE4_BIN_INSTALL_DIR}" "DESTINATION bin"
-      substituteInPlace src/inputwizard/CMakeLists.txt --replace "DESTINATION \''${KDE4_BIN_INSTALL_DIR}" "DESTINATION bin"
-      substituteInPlace src/device-manager/CMakeLists.txt  --replace "DESTINATION \''${KDE4_BIN_INSTALL_DIR}" "DESTINATION bin"
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Bluetooth manager for KDE";
-    license = "GPLv2";
-    inherit (kdelibs.meta) platforms;
-    maintainers = [ maintainers.phreedom ];
-  };
-}
\ No newline at end of file
diff --git a/pkgs/tools/bluetooth/obexd/default.nix b/pkgs/tools/bluetooth/obexd/default.nix
index 215ecb167ba..47db0877dd2 100644
--- a/pkgs/tools/bluetooth/obexd/default.nix
+++ b/pkgs/tools/bluetooth/obexd/default.nix
@@ -1,16 +1,16 @@
 { stdenv, fetchurl, pkgconfig, glib, dbus, openobex, bluez, libical }:
    
 stdenv.mkDerivation rec {
-  name = "obexd-0.40";
+  name = "obexd-0.47";
    
   src = fetchurl {
     url = "mirror://kernel/linux/bluetooth/${name}.tar.gz";
-    sha256 = "0jz0ldg2wvdzzl639xzf76hqwj23svlg3zv1r8nc3hik3pgs6h2l";
+    sha256 = "15zw008098qr5az9y1c010yv8gkw1f6hi3mnfcvpmwxwh23kfh4i";
   };
 
   buildInputs = [ glib dbus.libs openobex bluez libical ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://www.bluez.org/;
diff --git a/pkgs/tools/cd-dvd/cuetools/default.nix b/pkgs/tools/cd-dvd/cuetools/default.nix
new file mode 100644
index 00000000000..7de503adc07
--- /dev/null
+++ b/pkgs/tools/cd-dvd/cuetools/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, automake, autoconf, flex, bison }:
+
+stdenv.mkDerivation {
+  name = "cuetools-1.3.1";
+
+  src = fetchurl {
+    url = https://github.com/svend/cuetools/archive/cuetools-1.3.1.tar.gz;
+    sha256 = "1cap3wl0mlcqrjywpz46003w8jws05rr3r87pzqkz1g89v9459dg";
+  };
+
+  preConfigure = "autoreconf -fiv";
+
+  buildInputs = [ automake autoconf flex bison ]; 
+
+  meta = {
+    description = "cd/dvd cue and toc file parsers and utilities";
+    homepage = https://github.com/svend/cuetools;
+    platforms = stdenv.lib.platforms.all;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/tools/compression/bzip2/builder.sh b/pkgs/tools/compression/bzip2/builder.sh
index 4610bdd4085..a598dfcf808 100644
--- a/pkgs/tools/compression/bzip2/builder.sh
+++ b/pkgs/tools/compression/bzip2/builder.sh
@@ -10,7 +10,7 @@ if test -n "$sharedLibrary"; then
     preInstall() {
         mkdir -p $out/lib
         mv libbz2.so* $out/lib
-        ln -s libbz2.so.1.0 $out/lib/libbz2.so
+        (cd $out/lib && ln -s libbz2.so.1.0.? libbz2.so && ln -s libbz2.so.1.0.? libbz2.so.1);
     }
     
 fi
diff --git a/pkgs/tools/compression/gzip/default.nix b/pkgs/tools/compression/gzip/default.nix
index e1d6d75da51..d15b26f48b6 100644
--- a/pkgs/tools/compression/gzip/default.nix
+++ b/pkgs/tools/compression/gzip/default.nix
@@ -1,15 +1,13 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation (rec {
-  name = "gzip-1.4";
+stdenv.mkDerivation rec {
+  name = "gzip-1.5";
 
   src = fetchurl {
-    url = "mirror://gnu/gzip/${name}.tar.gz";
-    sha256 = "1vhiyzls60fws48scw48wvwn8mpv1f4yhcsnafys239qvb9wyrni";
+    url = "mirror://gnu/gzip/${name}.tar.xz";
+    sha256 = "0wx1nqk709kx75cwp2axachnbxryp4gyl06qxn5nl95184w0mhls";
   };
 
-  doCheck = true;
-
   meta = {
     homepage = http://www.gnu.org/software/gzip/;
     description = "Gzip, the GNU zip compression program";
@@ -31,13 +29,3 @@ stdenv.mkDerivation (rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ./gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/compression/gzip/gets-undeclared.patch b/pkgs/tools/compression/gzip/gets-undeclared.patch
deleted file mode 100644
index a09f59b122a..00000000000
--- a/pkgs/tools/compression/gzip/gets-undeclared.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-This patch is needed to allow builds with newer versions of
-the GNU libc (2.16+).
-
-This is a backport of this patch:
-
-commit 66712c23388e93e5c518ebc8515140fa0c807348
-Author: Eric Blake <eblake@redhat.com>
-Date:   Thu Mar 29 13:30:41 2012 -0600
-
-    stdio: don't assume gets any more
-    
---- gzip/lib/stdio.in.h	2012-07-02 14:28:45.000000000 +0200
-+++ gzip/lib/stdio.in.h	2012-07-02 14:28:50.000000000 +0200
-@@ -160,12 +160,6 @@ _GL_WARN_ON_USE (fflush, "fflush is not
-                  "use gnulib module fflush for portable POSIX compliance");
- #endif
- 
--/* It is very rare that the developer ever has full control of stdin,
--   so any use of gets warrants an unconditional warning.  Assume it is
--   always declared, since it is required by C89.  */
--#undef gets
--_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
--
- #if @GNULIB_FOPEN@
- # if @REPLACE_FOPEN@
- #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
diff --git a/pkgs/tools/compression/lrzip/default.nix b/pkgs/tools/compression/lrzip/default.nix
index 35df411fd0f..23b516e32e4 100644
--- a/pkgs/tools/compression/lrzip/default.nix
+++ b/pkgs/tools/compression/lrzip/default.nix
@@ -1,26 +1,20 @@
 {stdenv, fetchurl, zlib, lzo, bzip2, nasm, perl}:
 
-let
-  md5fix = fetchurl {
-    url = "https://github.com/ckolivas/lrzip/commit/9430b6ff4a58adb69ef4cf74f1245fd5b3b313dd.patch";
-    sha256 = "084x4wi3mamcxphzwf43iw287v1ylrk0xjghg6b5k6vgm9gkqlx8";
-  };
-in
 stdenv.mkDerivation rec {
-  name = "lrzip-0.612";
+  version = "0.614";
+  name = "lrzip-${version}";
 
   src = fetchurl {
     url = "http://ck.kolivas.org/apps/lrzip/${name}.tar.bz2";
-    sha256 = "15rfqpc4xj7wbv117mr2g9npxnrlmqqj97mhxqfpy8360ys9yc1c";
+    sha256 = "16i6mz2z6gx8xiva7zb0j78yvkwq1bjbdkl7w3i10195ll097ad8";
   };
 
   buildInputs = [ zlib lzo bzip2 nasm perl ];
 
-  patches = [ md5fix ];
-
   meta = {
     homepage = http://ck.kolivas.org/apps/lrzip/;
     description = "The CK LRZIP compression program (LZMA + RZIP)";
     license = "GPLv2+";
+    inherit version;
   };
 }
diff --git a/pkgs/tools/compression/lrzip/default.upstream b/pkgs/tools/compression/lrzip/default.upstream
new file mode 100644
index 00000000000..1b834598637
--- /dev/null
+++ b/pkgs/tools/compression/lrzip/default.upstream
@@ -0,0 +1,8 @@
+url http://ck.kolivas.org/apps/lrzip/
+version_link '[.]tar[.]bz2$'
+
+do_overwrite () {
+  ensure_hash
+  set_var_value version "$CURRENT_VERSION"
+  set_var_value sha256 "$CURRENT_HASH"
+}
diff --git a/pkgs/tools/compression/lzip/default.nix b/pkgs/tools/compression/lzip/default.nix
new file mode 100644
index 00000000000..de29c34f150
--- /dev/null
+++ b/pkgs/tools/compression/lzip/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, texinfo }:
+
+stdenv.mkDerivation rec {
+  name = "lzip-1.14";
+
+  buildInputs = [ texinfo ];
+
+  src = fetchurl {
+    url = "http://download.savannah.gnu.org/releases/lzip/${name}.tar.gz";
+    sha256 = "1rybhk2pxpfh2789ck9mrkdv3bpx7b7miwndlshb5vb02m9crxbz";
+  };
+
+  configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3";
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://www.nongnu.org/lzip/lzip.html";
+    description = "a lossless data compressor based on the LZMA algorithm";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix
index 78a8ed95a4e..6b74ba41eca 100644
--- a/pkgs/tools/compression/xz/default.nix
+++ b/pkgs/tools/compression/xz/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "xz-5.0.3";
+  name = "xz-5.0.4";
 
   src = fetchurl {
     url = "http://tukaani.org/xz/${name}.tar.bz2";
-    sha256 = "1sgaq4gdh8llz3gnlgvd65x610fwc8h4m32skhqn5npwgghvj4as";
+    sha256 = "14nf55b47335aakswqk0kqv1qsh4269rnb757dmkkbd1sdhb1naw";
   };
 
   doCheck = true;
diff --git a/pkgs/tools/compression/zsync/default.nix b/pkgs/tools/compression/zsync/default.nix
index a657234e577..3732e5b1756 100644
--- a/pkgs/tools/compression/zsync/default.nix
+++ b/pkgs/tools/compression/zsync/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
-  name = "zsync-0.6.1";
+  name = "zsync-0.6.2";
 
   src = fetchurl {
     url = "http://zsync.moria.org.uk/download/${name}.tar.bz2";
-    sha256 = "13rbq2m2d4c4qqzadr1cfzrryqxvjgafr8cmask9w2acc0zpv7v1";
+    sha1 = "5e69f084c8adaad6a677b68f7388ae0f9507617a";
   };
 
   meta = {
diff --git a/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c b/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c
new file mode 100644
index 00000000000..483ec5f8415
--- /dev/null
+++ b/pkgs/tools/filesystems/btrfsprogs/btrfs-set-received-uuid.c
@@ -0,0 +1,109 @@
+/*
+btrfs receive currently mandates that incremental receives can only be performed on a parent subvolume
+that was also received. This means you cannot apply it to (snapshotted) subvolumes you still have on disk, 
+as they were not received themselves.
+
+This small utility allows you to set the received_uuid of a subvolume, tricking btrfs receive into using it.
+
+found on btrfs mailing list
+read the discussion here: http://comments.gmane.org/gmane.comp.file-systems.btrfs/21922
+*/
+
+#define _GNU_SOURCE
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <uuid/uuid.h>
+#include <sys/ioctl.h>
+
+#include "ctree.h"
+#include "ioctl.h"
+#include "send-utils.h"
+
+#define CLEAR(var) memset(&var, 0, sizeof(var))
+
+
+int main(int argc, char **argv) {
+	int ret, fd;
+	struct subvol_uuid_search sus;
+	struct btrfs_ioctl_received_subvol_args rs_args;
+	struct subvol_info *si;
+	char uuidbuf[37], parent_uuidbuf[37], received_uuidbuf[37];
+
+
+	if (argc != 3 && argc != 4) {
+		printf("usage: btrfs-set-received-uuid btrfs-mountpoint src-subvolume-path-relative-to-mountpoint [dest-absolute-subvolume-path]\n");
+		exit(1);
+	}
+
+	printf("opening srcmnt %s\n", argv[1]);
+	fd = open(argv[1], O_RDONLY | O_NOATIME);
+	if (fd < 0) {
+		printf("failed to open srcmnt %s! %s\n", argv[1], strerror(errno));
+		exit(2);
+	}
+
+	puts("initializing sub search");
+	CLEAR(sus);
+	ret = subvol_uuid_search_init(fd, &sus);
+	if (ret < 0) {
+		printf("failed to initialize sub search! %s\n", strerror(-ret));
+		exit(3);
+	}
+	
+	printf("searching srcsub %s\n", argv[2]);
+	si = subvol_uuid_search(&sus, 0, NULL, 0, argv[2], subvol_search_by_path);
+	if (!si) {
+		puts("srcsub not found!");
+		exit(4);
+	}
+
+	uuid_unparse(si->uuid,                   uuidbuf);
+	uuid_unparse(si->parent_uuid,     parent_uuidbuf);
+	uuid_unparse(si->received_uuid, received_uuidbuf);
+
+	printf("\nsrcsub found:\n"
+	       "         uuid=%s\n"
+	       "  parent_uuid=%s\n"
+	       "received_uuid=%s\n"
+	       "ctransid=%Lu otransid=%Lu stransid=%Lu rtransid=%Lu\n\n",
+	       uuidbuf, parent_uuidbuf, received_uuidbuf,
+	       (unsigned long long)(si->ctransid),
+	       (unsigned long long)(si->otransid),
+	       (unsigned long long)(si->stransid),
+	       (unsigned long long)(si->rtransid));
+
+	if (argc == 3)
+		goto done;
+
+	printf("opening dst subvol %s\n", argv[3]);
+	fd = open(argv[3], O_RDONLY | O_NOATIME);
+	if (fd < 0) {
+		printf("failed to open dst subvol %s. %s\n", argv[3], strerror(errno));
+		exit(5);
+	}
+
+	printf("\nhere we go with BTRFS_IOC_SET_RECEIVED_SUBVOL:\n"
+	       "dstsub.received_uuid = srcsub.uuid == %s\n"
+	       "dstsub.stransid = srcsub.ctransid == %Lu\n\n",
+	       uuidbuf, (unsigned long long)(si->ctransid));
+
+	CLEAR(rs_args);
+	memcpy(rs_args.uuid, si->uuid, BTRFS_UUID_SIZE);
+	rs_args.stransid = si->ctransid;
+
+	ret = ioctl(fd, BTRFS_IOC_SET_RECEIVED_SUBVOL, &rs_args);
+	if (ret < 0) {
+		printf("BTRFS_IOC_SET_RECEIVED_SUBVOL failed: %s", strerror(-ret));
+		exit(6);
+	}
+
+done:
+	printf("done.\n");
+	exit(0);
+}
diff --git a/pkgs/tools/filesystems/btrfsprogs/default.nix b/pkgs/tools/filesystems/btrfsprogs/default.nix
index 861bacd46c2..a091142db24 100644
--- a/pkgs/tools/filesystems/btrfsprogs/default.nix
+++ b/pkgs/tools/filesystems/btrfsprogs/default.nix
@@ -1,17 +1,31 @@
-{ stdenv, fetchgit, zlib, libuuid, acl, attr, e2fsprogs }:
+{ stdenv, fetchgit, zlib, libuuid, acl, attr, e2fsprogs, lzo }:
 
-let version = "0.19-20120328"; in
+let version = "0.20pre20130509"; in
 
 stdenv.mkDerivation {
   name = "btrfs-progs-${version}";
 
   src = fetchgit {
     url = "git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-progs.git";
-    rev = "1957076ab4fefa47b6efed3da541bc974c83eed7";
-    sha256 = "566d863c5500652e999d0d6b823365fb06f2f8f9523e65e69eaa3e993e9b26e1";
+    rev = "650e656a8b9c1fbe4ec5cd8c48ae285b8abd3b69";
+    sha256 = "e50e8ce9d24505711ed855f69a73d639dc5e401692a7d1c300753de3472abb21";
   };
 
-  buildInputs = [ zlib libuuid acl attr e2fsprogs ];
+  buildInputs = [ zlib libuuid acl attr e2fsprogs lzo ];
+
+  postPatch = ''
+    cp ${./btrfs-set-received-uuid.c} btrfs-set-received-uuid.c
+  '';
+
+  postBuild = ''
+    gcc -Wall -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DBTRFS_FLAT_INCLUDES \
+        -fPIC -g -O1 -luuid -o btrfs-set-received-uuid rbtree.o send-utils.o btrfs-list.o \
+        btrfs-set-received-uuid.c
+  '';
+
+  postInstall = ''
+    cp btrfs-set-received-uuid $out/bin
+  '';
 
   makeFlags = "prefix=$(out)";
 
diff --git a/pkgs/tools/filesystems/davfs2/default.nix b/pkgs/tools/filesystems/davfs2/default.nix
index 8cc212deee4..d16af28010c 100644
--- a/pkgs/tools/filesystems/davfs2/default.nix
+++ b/pkgs/tools/filesystems/davfs2/default.nix
@@ -1,21 +1,33 @@
 { stdenv, fetchurl, neon, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "davfs2-1.4.5";
+  name = "davfs2-1.4.7";
 
   src = fetchurl {
     url = "mirror://savannah/davfs2/${name}.tar.gz";
-    sha256 = "1pkl2braggp2qg4c68dwfv399l9jz7cvi7gkm4xbj6mgvl0cxw18";
+    sha256 = "0i7hrwlfzisb4l2mza1kjj9q9xxixggjplsjm339zl7828mfxh2h";
   };
 
   buildInputs = [ neon zlib ];
-  
-  patches = [ ./davfs2-install.patch ./isdir.patch ]; 
+
+  patches = [ ./davfs2-install.patch ./isdir.patch ./fix-sysconfdir.patch ];
+
+  configureFlags = "--sysconfdir=/etc";
 
   meta = {
-    longDescription = "Web Distributed Authoring and Versioning (WebDAV), an extension to the HTTP-protocol, allows authoring of resources on a remote web server. davfs2 provides the ability to access such resources like a typical filesystem, allowing for use by standard applications with no built-in support for WebDAV.";
+    homepage = "http://savannah.nongnu.org/projects/davfs2";
+    description = "mount WebDAV shares like a typical filesystem";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      Web Distributed Authoring and Versioning (WebDAV), an extension to
+      the HTTP-protocol, allows authoring of resources on a remote web
+      server. davfs2 provides the ability to access such resources like
+      a typical filesystem, allowing for use by standard applications
+      with no built-in support for WebDAV.
+    '';
 
-    license = "GPLv3+";
-    homepage = http://savannah.nongnu.org/projects/davfs2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch b/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch
new file mode 100644
index 00000000000..f71248a28f4
--- /dev/null
+++ b/pkgs/tools/filesystems/davfs2/fix-sysconfdir.patch
@@ -0,0 +1,60 @@
+diff -ubr davfs2-1.4.7-orig/etc/Makefile.am davfs2-1.4.7/etc/Makefile.am
+--- davfs2-1.4.7-orig/etc/Makefile.am	2013-02-21 11:45:00.185763558 +0100
++++ davfs2-1.4.7/etc/Makefile.am	2013-02-21 11:53:05.423197775 +0100
+@@ -24,17 +24,17 @@
+ 
+ install-data-local: $(dist_pkgdata_DATA)
+ 	@$(NORMAL_INSTALL)
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+-	$(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf
+-	$(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private
+-	chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)
++	$(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf
++	$(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private
++	chmod 700 $(out)$(pkgsysconfdir)/certs/private
+ 
+ uninstall-local:
+ 	@$(NORMAL_UNINSTALL)
+ 	@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ 	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+-	  echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \
+-	  rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \
++	  echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \
++	  rm -f $(out)$(pkgsysconfdir)/$$f; \
+ 	done
+diff -ubr davfs2-1.4.7-orig/etc/Makefile.in davfs2-1.4.7/etc/Makefile.in
+--- davfs2-1.4.7-orig/etc/Makefile.in	2013-02-21 11:45:00.185763558 +0100
++++ davfs2-1.4.7/etc/Makefile.in	2013-02-21 11:53:27.241207128 +0100
+@@ -408,19 +408,19 @@
+ 
+ install-data-local: $(dist_pkgdata_DATA)
+ 	@$(NORMAL_INSTALL)
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)
+-	$(INSTALL_DATA) -b davfs2.conf $(DESTDIR)$(pkgsysconfdir)/davfs2.conf
+-	$(INSTALL_DATA) -b -m 600 secrets $(DESTDIR)$(pkgsysconfdir)/secrets
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs
+-	$(mkinstalldirs) $(DESTDIR)$(pkgsysconfdir)/certs/private
+-	chmod 700 $(DESTDIR)$(pkgsysconfdir)/certs/private
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)
++	$(INSTALL_DATA) -b davfs2.conf $(out)$(pkgsysconfdir)/davfs2.conf
++	$(INSTALL_DATA) -b -m 600 secrets $(out)$(pkgsysconfdir)/secrets
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs
++	$(mkinstalldirs) $(out)$(pkgsysconfdir)/certs/private
++	chmod 700 $(out)$(pkgsysconfdir)/certs/private
+ 
+ uninstall-local:
+ 	@$(NORMAL_UNINSTALL)
+ 	@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
+ 	  f="`echo $$p | sed -e 's|^.*/||'`"; \
+-	  echo " rm -f $(DESTDIR)$(pkgsysconfdir)/$$f"; \
+-	  rm -f $(DESTDIR)$(pkgsysconfdir)/$$f; \
++	  echo " rm -f $(out)$(pkgsysconfdir)/$$f"; \
++	  rm -f $(out)$(pkgsysconfdir)/$$f; \
+ 	done
+ 
+ # Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/pkgs/tools/filesystems/dosfstools/default.nix b/pkgs/tools/filesystems/dosfstools/default.nix
index 21e2ceea9dd..b0ee47e23b5 100644
--- a/pkgs/tools/filesystems/dosfstools/default.nix
+++ b/pkgs/tools/filesystems/dosfstools/default.nix
@@ -4,7 +4,10 @@ stdenv.mkDerivation rec {
   name = "dosfstools-3.0.11";
 
   src = fetchurl {
-    url = "http://www.daniel-baumann.ch/software/dosfstools/${name}.tar.bz2";
+    urls = [
+      "http://www.daniel-baumann.ch/software/dosfstools/${name}.tar.bz2"
+      "http://pkgs.fedoraproject.org/repo/pkgs/dosfstools/${name}.tar.bz2/8d2211d5bd813164e20740e7c852aa06/${name}.tar.bz2"
+    ];
     sha256 = "1a6rzjy82f6579ywaln33g1wc7k8gbgjdss9q2q8daplac7pmcll";
   };
 
diff --git a/pkgs/tools/filesystems/e2fsprogs/default.nix b/pkgs/tools/filesystems/e2fsprogs/default.nix
index bd697d761e0..712cd32d9c3 100644
--- a/pkgs/tools/filesystems/e2fsprogs/default.nix
+++ b/pkgs/tools/filesystems/e2fsprogs/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libuuid }:
 
 stdenv.mkDerivation rec {
-  name = "e2fsprogs-1.42.4";
+  name = "e2fsprogs-1.42.7";
 
   src = fetchurl {
     url = "mirror://sourceforge/e2fsprogs/${name}.tar.gz";
-    sha256 = "0plhvcjynyy5ifih5jr8p2fjymqyl8fj6vj74cmqjyrahi3z6iir";
+    sha256 = "0ibkkvp6kan0hn0d1anq4n2md70j5gcm7mwna515w82xwyr02rfw";
   };
 
   buildInputs = [ pkgconfig libuuid ];
@@ -19,12 +19,18 @@ stdenv.mkDerivation rec {
   # libuuid, libblkid, uuidd and fsck are in util-linux-ng (the "libuuid" dependency).
   configureFlags = "--enable-elf-shlibs --disable-libuuid --disable-libblkid --disable-uuidd --disable-fsck";
 
+  enableParallelBuilding = true;
+
   preInstall = "installFlagsArray=('LN=ln -s')";
-  
+
   postInstall = "make install-libs";
-  
+
+  dontGzipMan = true; # See issue #523
+
   meta = {
     homepage = http://e2fsprogs.sourceforge.net/;
     description = "Tools for creating and checking ext2/ext3/ext4 filesystems";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/tools/filesystems/fuse-zip/default.nix b/pkgs/tools/filesystems/fuse-zip/default.nix
index 346b11015f4..a5ac74fe47a 100644
--- a/pkgs/tools/filesystems/fuse-zip/default.nix
+++ b/pkgs/tools/filesystems/fuse-zip/default.nix
@@ -2,16 +2,18 @@
 
 stdenv.mkDerivation rec {
   name = "fuse-zip-0.2.13";
-  
+
   src = fetchurl {
     url = "http://fuse-zip.googlecode.com/files/${name}.tar.gz";
     sha1 = "9cfa00e38a59d4e06fd47bfaca75ad5e299ecc6b";
   };
 
+  patches = [ ./libzip.patch ]; # problems with new libzip; from Gentoo
+
   buildInputs = [ pkgconfig fuse libzip zlib ];
 
   makeFlags = "INSTALLPREFIX=$(out)";
-  
+
   meta = {
     homepage = http://code.google.com/p/fuse-zip/;
     description = "A FUSE-based filesystem that allows read and write access to ZIP files";
diff --git a/pkgs/tools/filesystems/fuse-zip/libzip.patch b/pkgs/tools/filesystems/fuse-zip/libzip.patch
new file mode 100644
index 00000000000..f2348e5f1ba
--- /dev/null
+++ b/pkgs/tools/filesystems/fuse-zip/libzip.patch
@@ -0,0 +1,24 @@
+diff -ru fuse-zip-0.2.13/lib/bigBuffer.cpp fuse-zip-0.2.13.new//lib/bigBuffer.cpp
+--- fuse-zip-0.2.13/lib/bigBuffer.cpp	2010-12-06 12:34:32.000000000 -0500
++++ fuse-zip-0.2.13.new//lib/bigBuffer.cpp	2011-09-28 21:40:01.294946957 -0400
+@@ -236,7 +236,7 @@
+     len = offset;
+ }
+ 
+-ssize_t BigBuffer::zipUserFunctionCallback(void *state, void *data, size_t len, enum zip_source_cmd cmd) {
++zip_int64_t BigBuffer::zipUserFunctionCallback(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd) {
+     CallBackStruct *b = (CallBackStruct*)state;
+     switch (cmd) {
+         case ZIP_SOURCE_OPEN: {
+diff -ru fuse-zip-0.2.13/lib/bigBuffer.h fuse-zip-0.2.13.new//lib/bigBuffer.h
+--- fuse-zip-0.2.13/lib/bigBuffer.h	2010-12-06 12:34:32.000000000 -0500
++++ fuse-zip-0.2.13.new//lib/bigBuffer.h	2011-09-28 21:40:23.203719133 -0400
+@@ -52,7 +52,7 @@
+      * never called because read() always successfull.
+      * See zip_source_function(3) for details.
+      */
+-    static ssize_t zipUserFunctionCallback(void *state, void *data, size_t len, enum zip_source_cmd cmd);
++    static zip_int64_t zipUserFunctionCallback(void *state, void *data, zip_uint64_t len, enum zip_source_cmd cmd);
+ 
+     /**
+      * Return number of chunks needed to keep 'offset' bytes.
diff --git a/pkgs/tools/filesystems/glusterfs/default.nix b/pkgs/tools/filesystems/glusterfs/default.nix
index 3995faa588b..7cae84a19c7 100644
--- a/pkgs/tools/filesystems/glusterfs/default.nix
+++ b/pkgs/tools/filesystems/glusterfs/default.nix
@@ -1,28 +1,36 @@
-a :  
+{stdenv, fetchurl, fuse, bison, flex, openssl, python, ncurses, readline}:
 let 
-  s = import ./src-for-default.nix;
-  buildInputs = with a; [
-    fuse bison flex
+  s = # Generated upstream information 
+  rec {
+    baseName="glusterfs";
+    version="3.3.1";
+    name="glusterfs-3.3.1";
+    hash="06bmnyl3vh8s21kk98idm2fl7kq38na94k5l67l9l1grl3iyzahr";
+    url="http://download.gluster.org/pub/gluster/glusterfs/3.3/3.3.1/glusterfs-3.3.1.tar.gz";
+    sha256="06bmnyl3vh8s21kk98idm2fl7kq38na94k5l67l9l1grl3iyzahr";
+  };
+  buildInputs = [
+    fuse bison flex openssl python ncurses readline
   ];
 in
+stdenv.mkDerivation
 rec {
-  src = a.fetchUrlFromSrcInfo s;
-
-  inherit (s) name;
+  inherit (s) name version;
   inherit buildInputs;
   configureFlags = [
     ''--with-mountutildir="$out/sbin"''
     ];
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doConfigure" "doMakeInstall"];
-      
   meta = {
+    inherit (s) version;
     description = "Distributed storage system";
     maintainers = [
-      a.lib.maintainers.raskin
+      stdenv.lib.maintainers.raskin
     ];
-    platforms = with a.lib.platforms; 
+    platforms = with stdenv.lib.platforms; 
       linux ++ freebsd;
   };
 }
diff --git a/pkgs/tools/filesystems/glusterfs/default.upstream b/pkgs/tools/filesystems/glusterfs/default.upstream
new file mode 100644
index 00000000000..7c86455b440
--- /dev/null
+++ b/pkgs/tools/filesystems/glusterfs/default.upstream
@@ -0,0 +1,4 @@
+url http://download.gluster.org/pub/gluster/glusterfs/
+version_link '[0-9.]+/$'
+version_link '[0-9.]+/$'
+version_link '[.]tar[.]'
diff --git a/pkgs/tools/filesystems/glusterfs/src-for-default.nix b/pkgs/tools/filesystems/glusterfs/src-for-default.nix
deleted file mode 100644
index eeda32796f5..00000000000
--- a/pkgs/tools/filesystems/glusterfs/src-for-default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-rec {
-  advertisedUrl="http://ftp.gluster.com/pub/gluster/glusterfs/2.0/2.0.6/glusterfs-2.0.6.tar.gz";
-  version = "2.0.6";
-  url="http://ftp.gluster.com/pub/gluster/glusterfs/2.0/2.0.6/glusterfs-2.0.6.tar.gz";
-  hash = "0qr8smwncrr63vzbaf2v4fwpdck3jpgywn2rq8sdhifff67ydc9h";
-  name = "glusterfs-2.0.6";
-  
-}
diff --git a/pkgs/tools/filesystems/glusterfs/src-info-for-default.nix b/pkgs/tools/filesystems/glusterfs/src-info-for-default.nix
deleted file mode 100644
index 273ee4512e1..00000000000
--- a/pkgs/tools/filesystems/glusterfs/src-info-for-default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  downloadPage = "http://ftp.gluster.com/pub/gluster/glusterfs/2.0/";
-  sourceRegexp = "^2[.]0[.]";
-  choiceCommand = ''tail -1 | sed -re 's@(.*)/@&glusterfs-\1.tar.gz@' '';
-  baseName = "glusterfs";
-}
diff --git a/pkgs/tools/filesystems/grive/default.nix b/pkgs/tools/filesystems/grive/default.nix
index 67c6d2f8581..dce7757d23a 100644
--- a/pkgs/tools/filesystems/grive/default.nix
+++ b/pkgs/tools/filesystems/grive/default.nix
@@ -1,7 +1,8 @@
 { stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, binutils }:
 
 stdenv.mkDerivation rec {
-  name = "grive-0.3.0";
+  version = "0.3.0";
+  name = "grive-${version}";
 
   src = fetchgit {
     url = "https://github.com/Grive/grive.git";
@@ -11,6 +12,13 @@ stdenv.mkDerivation rec {
 
   buildInputs = [cmake libgcrypt json_c curl expat stdenv binutils boost];
 
+  # work around new binutils headers, see
+  # http://stackoverflow.com/questions/11748035/binutils-bfd-h-wants-config-h-now
+  prePatch = ''
+    sed -i '1i#define PACKAGE "grive"\n#define PACKAGE_VERSION "${version}"' \
+      libgrive/src/bfd/SymbolInfo.cc
+  '';
+
   meta = {
     description = "an open source (experimental) Linux client for Google Drive";
     homepage = https://github.com/Grive/grive;
diff --git a/pkgs/tools/filesystems/jfsutils/default.nix b/pkgs/tools/filesystems/jfsutils/default.nix
index 79a9fad0e79..9712721021e 100644
--- a/pkgs/tools/filesystems/jfsutils/default.nix
+++ b/pkgs/tools/filesystems/jfsutils/default.nix
@@ -1,13 +1,15 @@
 { stdenv, fetchurl, libuuid }:
 
 stdenv.mkDerivation rec {
-  name = "jfsutils-1.1.12";
+  name = "jfsutils-1.1.15";
 
   src = fetchurl {
     url = "http://jfs.sourceforge.net/project/pub/${name}.tar.gz";
-    sha256 = "04vqdlg90j0mk5jkxpfg9fp6ss4gs1g5pappgns6183q3i6j02hd";
+    sha1 = "291e8bd9d615cf3d27e4000117c81a3602484a50";
   };
 
+  patches = [ ./types.patch ];
+
   buildInputs = [ libuuid ];
 
   meta = {
diff --git a/pkgs/tools/filesystems/jfsutils/types.patch b/pkgs/tools/filesystems/jfsutils/types.patch
new file mode 100644
index 00000000000..a682f2695f9
--- /dev/null
+++ b/pkgs/tools/filesystems/jfsutils/types.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' jfsutils-1.1.15-orig/libfs/devices.h jfsutils-1.1.15/libfs/devices.h
+--- jfsutils-1.1.15-orig/libfs/devices.h	2005-11-22 21:43:55.000000000 +0100
++++ jfsutils-1.1.15/libfs/devices.h	2013-01-28 13:58:56.888630278 +0100
+@@ -18,6 +18,8 @@
+ #ifndef H_DEVICES
+ #define H_DEVICES
+ 
++#include <inttypes.h>
++
+ #define GET	0
+ #define PUT	1
+ #define VRFY	2
diff --git a/pkgs/tools/filesystems/mtdutils/default.nix b/pkgs/tools/filesystems/mtdutils/default.nix
index 9e7e3a16e01..4cb09d53adc 100644
--- a/pkgs/tools/filesystems/mtdutils/default.nix
+++ b/pkgs/tools/filesystems/mtdutils/default.nix
@@ -1,22 +1,19 @@
 {stdenv, fetchgit, libuuid, lzo, zlib, acl}:
 
 let
-  version = "1.3.1";
+  version = "1.5.0";
 in
 stdenv.mkDerivation {
   name = "mtd-utils-${version}";
 
   src = fetchgit {
     url = git://git.infradead.org/mtd-utils.git;
-    rev = "v" + version;
-    sha256 = "0pjjs9x03bgvphqwlw99c2cpkpjsx0vkqi79vjl7fcb9pyrghgd1";
+    rev = "refs/tags/v" + version;
+    sha256 = "cc645c0ec28083431b11f3b38f9f7759378d89e11047a883529f703e1b6c1cce";
   };
 
   patchPhase = ''
     sed -i -e s,/usr/local,, -e s,/usr,$out, common.mk
-
-    # gcc 4.5.1 issues a warning where 4.4.3 did not
-    sed -i -e s/-Werror// ubi-utils/old-utils/Makefile
   '';
 
   buildInputs = [ libuuid lzo zlib acl ];
diff --git a/pkgs/tools/filesystems/ntfs-3g/default.nix b/pkgs/tools/filesystems/ntfs-3g/default.nix
index cedb8df39d1..a306a424ee1 100644
--- a/pkgs/tools/filesystems/ntfs-3g/default.nix
+++ b/pkgs/tools/filesystems/ntfs-3g/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   buildInputs = [libuuid] ++ stdenv.lib.optionals crypto [gnutls libgcrypt];
-  buildNativeInputs = stdenv.lib.optional crypto pkgconfig;
+  nativeBuildInputs = stdenv.lib.optional crypto pkgconfig;
 
   src = fetchurl {
     url = "http://tuxera.com/opensource/${name}.tgz";
diff --git a/pkgs/tools/filesystems/reiserfsprogs/default.nix b/pkgs/tools/filesystems/reiserfsprogs/default.nix
index 2283a0c1746..2c14bc624ae 100644
--- a/pkgs/tools/filesystems/reiserfsprogs/default.nix
+++ b/pkgs/tools/filesystems/reiserfsprogs/default.nix
@@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
   name = "reiserfsprogs-3.6.21";
 
   src = fetchurl {
-    url = "mirror://kernel/linux/utils/fs/reiserfs/${name}.tar.bz2";
+    url = "http://ftp.be.debian.org/pub/linux/utils/fs/reiserfs/${name}.tar.bz2";
     sha256 = "19mqzhh6jsf2gh8zr5scqi9pyk1fwivrxncd11rqnp2148c58jam";
   };
 
diff --git a/pkgs/tools/filesystems/squashfs/default.nix b/pkgs/tools/filesystems/squashfs/default.nix
index f66c54cc9e1..bec5592ccae 100644
--- a/pkgs/tools/filesystems/squashfs/default.nix
+++ b/pkgs/tools/filesystems/squashfs/default.nix
@@ -7,17 +7,17 @@ stdenv.mkDerivation rec {
     url = mirror://sourceforge/squashfs/squashfs4.2.tar.gz;
     sha256 = "15if08j0pl5hmnz9pwshwrp4fjp0jsm9larjxmjvdnr2m5d1kq6r";
   };
-  
+
   buildInputs = [ zlib xz ];
 
   preBuild = "cd squashfs-tools";
-  
+
   NIX_LDFLAGS = "-lgcc_s"; # for pthread_cancel
 
   installFlags = "INSTALL_DIR=\${out}/bin";
-  
+
   makeFlags = "XZ_SUPPORT=1";
-  
+
   meta = {
     homepage = http://squashfs.sourceforge.net/;
     description = "Tool for creating and unpacking squashfs filesystems";
diff --git a/pkgs/tools/filesystems/unionfs-fuse/default.nix b/pkgs/tools/filesystems/unionfs-fuse/default.nix
new file mode 100644
index 00000000000..5b681ab170c
--- /dev/null
+++ b/pkgs/tools/filesystems/unionfs-fuse/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, cmake, fuse }:
+
+stdenv.mkDerivation rec {
+  name = "unionfs-fuse-0.26";
+
+  src = fetchurl {
+    url = "http://podgorny.cz/unionfs-fuse/releases/${name}.tar.xz";
+    sha256 = "0qpnr4czgc62vsfnmv933w62nq3xwcbnvqch72qakfgca75rsp4d";
+  };
+
+  buildInputs = [ cmake fuse ];
+
+  # Put the unionfs mount helper in place as mount.unionfs-fuse. This makes it
+  # possible to do:
+  #   mount -t unionfs-fuse none /dest -o dirs=/source1=RW,/source2=RO
+  #
+  # This must be done in preConfigure because the build process removes
+  # helper from the source directory during the build.
+  preConfigure = ''
+    ensureDir $out/sbin
+    cp -a mount.unionfs $out/sbin/mount.unionfs-fuse
+    substituteInPlace $out/sbin/mount.unionfs-fuse --replace mount.fuse ${fuse}/sbin/mount.fuse
+    substituteInPlace $out/sbin/mount.unionfs-fuse --replace unionfs $out/bin/unionfs
+  '';
+
+  meta = {
+    description = "FUSE UnionFS implementation";
+    homepage = http://podgorny.cz/moin/UnionFsFuse;
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/tools/filesystems/xtreemfs/default.nix b/pkgs/tools/filesystems/xtreemfs/default.nix
index 98657891f2d..6d1f863fdea 100644
--- a/pkgs/tools/filesystems/xtreemfs/default.nix
+++ b/pkgs/tools/filesystems/xtreemfs/default.nix
@@ -11,10 +11,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="XtreemFS";
-    version="1.3.0";
+    version="1.4";
     name="${baseName}-${version}";
     url="http://xtreemfs.googlecode.com/files/${name}.tar.gz";
-    hash="15rg3dh22kb2g94fmbb6r32a9qfl3yr4ql17rwj50l4y8wrcx0hf";
+    hash="1hzd6anplxdcl4cg6xwriqk9b34541r7ah1ab2xavv149a2ll25s";
   };
 in
 rec {
diff --git a/pkgs/tools/graphics/argyllcms/default.nix b/pkgs/tools/graphics/argyllcms/default.nix
new file mode 100644
index 00000000000..934a27ef25b
--- /dev/null
+++ b/pkgs/tools/graphics/argyllcms/default.nix
@@ -0,0 +1,85 @@
+{ stdenv, fetchurl, jam, unzip, libX11, libXxf86vm, libXrandr, libXinerama
+, libXrender, libXext, libtiff, libjpeg, libXScrnSaver, writeText
+, libXdmcp, libXau, lib }:
+
+stdenv.mkDerivation rec {
+  name = "argyllcms-1.4.0";
+
+  src = fetchurl {
+    url = "http://www.argyllcms.com/Argyll_V1.4.0_src.zip";
+    sha256 = "1a5i0972cjp6asmawmyzih2y4bv3i0qvf7p6z5lxnr199mq38cfk";
+  };
+
+  # The contents of this file comes from the Jamtop file from the
+  # root of the ArgyllCMS distribution, rewritten to pick up Nixpkgs
+  # library paths. When ArgyllCMS is updated, make sure that changes
+  # in that file is reflected here.
+  jamTop = writeText "argyllcms_jamtop" ''
+    DESTDIR = "/" ;
+    REFSUBDIR = "ref" ;
+    
+    # Keep this DESTDIR anchored to Jamtop. PREFIX is used literally
+    ANCHORED_PATH_VARS = DESTDIR ;
+    
+    # Tell standalone libraries that they are part of Argyll:
+    DEFINES += ARGYLLCMS ;
+    
+    # Use libusb1 rather than libusb0 & libusb0-win32
+    USE_LIBUSB1 = true ;
+    
+    # Make the USB V1 library static
+    LIBUSB_IS_DLL = false ;
+    
+    # Set the libubs1 library name.
+    LIBUSB1NAME = libusb-1A ;
+
+    JPEGLIB = ;
+    JPEGINC = ;
+    HAVE_JPEG = true ;
+
+    TIFFLIB = ;
+    TIFFINC = ;
+    HAVE_TIFF = true ;
+
+    LINKFLAGS +=
+      ${lib.concatStringsSep " " (map (x: "-L${x}/lib") buildInputs)}
+      -ldl -lrt -lX11 -lXext -lXxf86vm -lXinerama -lXrandr -lXau -lXdmcp -lXss
+      -ljpeg -ltiff ;
+  '';
+
+  nativeBuildInputs = [ jam unzip ];
+
+  preConfigure = ''
+    cp ${jamTop} Jamtop
+    substituteInPlace Makefile --replace "-j 3" "-j $NIX_BUILD_CORES"
+    # Remove tiff and jpg to be sure the nixpkgs-provided ones are used
+    rm -rf tiff jpg
+  '';
+
+  buildInputs = [ 
+    libtiff libjpeg libX11 libXxf86vm libXrandr libXinerama libXext
+    libXrender libXScrnSaver libXdmcp libXau
+  ];
+
+  buildFlags = "PREFIX=$(out) all";
+
+  installFlags = "PREFIX=$(out)";
+
+  # Install udev rules, but remove lines that set up the udev-acl and plugdev
+  # stuff, since that is handled by udev's own rules (70-udev-acl.rules)
+  postInstall = ''
+    rm -v $out/bin/License.txt
+    mkdir -p $out/etc/udev/rules.d
+    sed -i '/udev-acl/d' libusb1/55-Argyll.rules
+    sed -i '/plugdev/d' libusb1/55-Argyll.rules
+    cp -v libusb1/55-Argyll.rules $out/etc/udev/rules.d/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://www.argyllcms.com;
+    description = "An ICC compatible color management system";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.rickynils ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/tools/graphics/asymptote/default.nix b/pkgs/tools/graphics/asymptote/default.nix
index bdde709c2c2..e32a3901a92 100644
--- a/pkgs/tools/graphics/asymptote/default.nix
+++ b/pkgs/tools/graphics/asymptote/default.nix
@@ -3,12 +3,20 @@ a @ {
   boehmgc,mesa,ncurses,readline,gsl,libsigsegv,
   python,zlib, perl, texLive, texinfo, lzma,
 
-  noDepEntry, fullDepEntry, fetchUrlFromSrcInfo, 
+  noDepEntry, fullDepEntry, fetchUrlFromSrcInfo,
   lib,
 
   ...}:
-let 
-  s = import ./src-for-default.nix;
+let
+  s = # Generated upstream information
+  rec {
+    baseName="asymptote";
+    version="2.21";
+    name="asymptote-2.21";
+    hash="07lkj0xnxpanfscmbm30lw6j9484rlmmqpnl0mhs7nx9h2lczrjz";
+    url="mirror://sourceforge/project/asymptote/2.21/asymptote-2.21.src.tgz";
+    sha256="07lkj0xnxpanfscmbm30lw6j9484rlmmqpnl0mhs7nx9h2lczrjz";
+  };
   buildInputs = with a; [
     freeglut ghostscriptX imagemagick fftw boehmgc
     mesa ncurses readline gsl libsigsegv python zlib
@@ -51,11 +59,13 @@ rec {
   '' ["minInit" "addInputs" "doUnpack"];
 
   meta = {
+    inherit (s) version;
     description = "A tool for programming graphics intended to replace Metapost";
     maintainers = [
       a.lib.maintainers.raskin
+      a.lib.maintainers.simons
     ];
-    platforms = with a.lib.platforms; 
+    platforms = with a.lib.platforms;
       linux;
   };
 }
diff --git a/pkgs/tools/graphics/asymptote/default.upstream b/pkgs/tools/graphics/asymptote/default.upstream
new file mode 100644
index 00000000000..3739390fd1d
--- /dev/null
+++ b/pkgs/tools/graphics/asymptote/default.upstream
@@ -0,0 +1,4 @@
+url http://sourceforge.net/projects/asymptote/files/
+SF_version_dir
+version_link 'src[.]tgz/download$'
+SF_redirect
diff --git a/pkgs/tools/graphics/asymptote/src-for-default.nix b/pkgs/tools/graphics/asymptote/src-for-default.nix
deleted file mode 100644
index e9d822904af..00000000000
--- a/pkgs/tools/graphics/asymptote/src-for-default.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-rec {
-   version="2.16";
-   name="asymptote-2.16";
-   hash="1yj8dx320s1ypqbpb2116y4kkc8lwg5q4d49n992ds3g59w98djj";
-   url="http://downloads.sourceforge.net/project/asymptote/${version}/asymptote-${version}.src.tgz";
-   advertisedUrl="http://downloads.sourceforge.net/project/asymptote/2.16/asymptote-2.16.src.tgz";
-}
diff --git a/pkgs/tools/graphics/asymptote/src-info-for-default.nix b/pkgs/tools/graphics/asymptote/src-info-for-default.nix
deleted file mode 100644
index dbfd064f51a..00000000000
--- a/pkgs/tools/graphics/asymptote/src-info-for-default.nix
+++ /dev/null
@@ -1,8 +0,0 @@
-{
-  downloadPage = "http://sourceforge.net/projects/asymptote/files/";
-  baseName = "asymptote";
-  sourceRegexp = ".*[.]src[.]tgz";
-  versionExtractorSedScript = ''$extractReleaseSF'';
-  versionReferenceCreator = ''$(replaceAllVersionOccurences)'';
-  choiceCommand = ''head -1 | sed -re "$skipRedirectSF"'';
-}
diff --git a/pkgs/tools/graphics/cfdg/default.nix b/pkgs/tools/graphics/cfdg/default.nix
index 26df8818b2b..9376ad6a709 100644
--- a/pkgs/tools/graphics/cfdg/default.nix
+++ b/pkgs/tools/graphics/cfdg/default.nix
@@ -1,8 +1,8 @@
-a @ {libpng, bison, flex, fullDepEntry, ...} :  
+a @ {libpng, bison, flex, ffmpeg, fullDepEntry, ...} :  
 let 
   s = import ./src-for-default.nix;
   buildInputs = with a; [
-    libpng bison flex
+    libpng bison flex ffmpeg
   ];
 in
 rec {
@@ -13,8 +13,12 @@ rec {
   configureFlags = [];
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["doMake" "copyFiles"];
-
+  phaseNames = ["doFixInc" "doMake" "copyFiles"];
+ 
+  doFixInc = a.fullDepEntry ''
+    sed -e "/YY_NO_UNISTD/a#include <stdio.h>" -i src-common/cfdg.l
+  '' ["doUnpack" "minInit"];
+ 
   copyFiles = a.fullDepEntry ''
     mkdir -p $out/bin
     cp cfdg $out/bin/
diff --git a/pkgs/tools/graphics/cfdg/src-for-default.nix b/pkgs/tools/graphics/cfdg/src-for-default.nix
index 6ad1394650e..179f0432dd1 100644
--- a/pkgs/tools/graphics/cfdg/src-for-default.nix
+++ b/pkgs/tools/graphics/cfdg/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="2.2.1";
-   name="cfdg-2.2.1";
-   hash="1zf3cls5h4fnhdxhdkdwsm4pav6df1ljr9jwp26dbqa4z2q3r8p4";
-   url="http://www.contextfreeart.org/download/ContextFreeSource2.2.1.tgz";
-   advertisedUrl="http://www.contextfreeart.org/download/ContextFreeSource2.2.1.tgz";
+   version="3.0.2";
+   name="cfdg-3.0.2";
+   hash="1pd1hjippbhad8l4s4lsglykh22i24qfrgmnxrsx71bvcqbr356p";
+   url="http://www.contextfreeart.org/download/ContextFreeSource3.0.2.tgz";
+   advertisedUrl="http://www.contextfreeart.org/download/ContextFreeSource3.0.2.tgz";
   
   
 }
diff --git a/pkgs/tools/graphics/cuneiform/default.nix b/pkgs/tools/graphics/cuneiform/default.nix
index 13f7d4b7f6f..3c75af4bcf3 100644
--- a/pkgs/tools/graphics/cuneiform/default.nix
+++ b/pkgs/tools/graphics/cuneiform/default.nix
@@ -2,15 +2,15 @@ a :
 let 
   fetchurl = a.fetchurl;
 
-  version = a.lib.attrByPath ["version"] "1.0" a; 
+  version = "1.1.0";
   buildInputs = with a; [
     cmake imagemagick patchelf
   ];
 in
 rec {
   src = fetchurl {
-    url = "http://launchpad.net/cuneiform-linux/${version}/${version}/+download/cuneiform-linux-${version}.0.tar.bz2";
-    sha256 = "bfa7acc6aade966ab62bc0f19e0ac1a843b659a70202229570c087ca8b15f39e";
+    url = "https://launchpad.net/cuneiform-linux/1.1/1.1/+download/cuneiform-linux-1.1.0.tar.bz2";
+    sha256 = "1bdvppyfx2184zmzcylskd87cxv56d8f32jf7g1qc8779l2hszjp";
   };
 
   inherit buildInputs;
diff --git a/pkgs/tools/graphics/cuneiform/default.upstream b/pkgs/tools/graphics/cuneiform/default.upstream
new file mode 100644
index 00000000000..4fb85a2a1e8
--- /dev/null
+++ b/pkgs/tools/graphics/cuneiform/default.upstream
@@ -0,0 +1,8 @@
+url https://launchpad.net/cuneiform-linux/+download
+
+do_overwrite () {
+  ensure_hash
+  set_var_value version "$CURRENT_VERSION"
+  set_var_value sha256 "$CURRENT_HASH"
+  set_var_value ' url' "$CURRENT_URL"
+}
diff --git a/pkgs/tools/graphics/enblend-enfuse/default.nix b/pkgs/tools/graphics/enblend-enfuse/default.nix
index f1759d7a782..b77d63d510d 100644
--- a/pkgs/tools/graphics/enblend-enfuse/default.nix
+++ b/pkgs/tools/graphics/enblend-enfuse/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libtiff libpng lcms libxmi boost mesa freeglut glew ];
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   patches =
     let
diff --git a/pkgs/tools/graphics/glxinfo/default.nix b/pkgs/tools/graphics/glxinfo/default.nix
index ed29b743d54..d0235c5bade 100644
--- a/pkgs/tools/graphics/glxinfo/default.nix
+++ b/pkgs/tools/graphics/glxinfo/default.nix
@@ -1,13 +1,13 @@
 {stdenv, fetchurl, x11, mesa}:
 
-let version = "8.0.1"; in
+let version = "8.1.0"; in
 
 stdenv.mkDerivation {
   name = "glxinfo-${version}";
 
   src = fetchurl {
     url = "ftp://ftp.freedesktop.org/pub/mesa/demos/${version}/mesa-demos-${version}.tar.bz2";
-    sha256 = "1lbp1llpx0hl5k79xb653yvjvk9mlikj73r8xjzyxqqp1nrg5isb";
+    sha256 = "0a58hw5850731p4smz4zqsbvyxvgjf7n5xdbs9l1wamk8q3gl0wp";
   };
 
   buildInputs = [x11 mesa];
diff --git a/pkgs/tools/graphics/gnuplot/default.nix b/pkgs/tools/graphics/gnuplot/default.nix
index ce564e8de4f..3e6902a183d 100644
--- a/pkgs/tools/graphics/gnuplot/default.nix
+++ b/pkgs/tools/graphics/gnuplot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, gd, texinfo
+{ stdenv, fetchurl, zlib, gd, texinfo, makeWrapper
 , texLive ? null
 , lua ? null
 , emacs ? null
@@ -11,25 +11,36 @@
 , cairo ? null
 , pkgconfig ? null
 , readline
+, fontconfig ? null, gnused ? null, coreutils ? null
 }:
 
+assert libX11 != null -> (fontconfig != null && gnused != null && coreutils != null);
+
 stdenv.mkDerivation rec {
-  name = "gnuplot-4.4.4";
-  
+  name = "gnuplot-4.6.0";
+
   src = fetchurl {
     url = "mirror://sourceforge/gnuplot/${name}.tar.gz";
-    sha256 = "1zfv3npsxfn743wl65ibh11djxrc8fxzi2mgg75ppy6m12fmja6j";
+    sha256 = "1ghp1jbcf95yy09lqhjcfmvb6y2101qfdbf20zs42dcs0fsssq3f";
   };
 
-  configureFlags = if libX11 != null then ["--with-x"] else ["--without-x"];
-
   buildInputs =
     [ zlib gd texinfo readline emacs lua texLive libX11 libXt libXpm libXaw
-      wxGTK pango cairo pkgconfig
+      wxGTK pango cairo pkgconfig makeWrapper
     ];
 
+  configureFlags = if libX11 != null then ["--with-x"] else ["--without-x"];
+
+  postInstall = stdenv.lib.optionalString (libX11 != null) ''
+    wrapProgram $out/bin/gnuplot \
+       --prefix PATH : '${gnused}/bin' \
+       --prefix PATH : '${coreutils}/bin' \
+       --prefix PATH : '${fontconfig}/bin' \
+       --run '. ${./set-gdfontpath-from-fontconfig.sh}'
+  '';
+
   meta = {
-    homepage = http://www.gnuplot.info;
+    homepage = "http://www.gnuplot.info";
     description = "A portable command-line driven graphing utility for many platforms";
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/tools/graphics/gnuplot/set-gdfontpath-from-fontconfig.sh b/pkgs/tools/graphics/gnuplot/set-gdfontpath-from-fontconfig.sh
new file mode 100644
index 00000000000..4886b4f2b7c
--- /dev/null
+++ b/pkgs/tools/graphics/gnuplot/set-gdfontpath-from-fontconfig.sh
@@ -0,0 +1,4 @@
+p=( $(for n in $(fc-list | sed -r -e 's|^([^:]+):.*$|\1|'); do echo $(dirname "$n"); done | sort | uniq) )
+IFS=:
+export GDFONTPATH="${GDFONTPATH}${GDFONTPATH:+:}${p[*]}"
+unset IFS p
diff --git a/pkgs/tools/graphics/graphviz/default.nix b/pkgs/tools/graphics/graphviz/default.nix
index 4edec43e243..370ce4fc1a1 100644
--- a/pkgs/tools/graphics/graphviz/default.nix
+++ b/pkgs/tools/graphics/graphviz/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, libpng, libjpeg, expat, libXaw
-, yacc, libtool, fontconfig, pango, gd, xlibs, gts
+, yacc, libtool, fontconfig, pango, gd, xlibs, gts, gettext
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,10 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ pkgconfig libpng libjpeg expat libXaw yacc libtool fontconfig
       pango gd gts
-    ] ++ stdenv.lib.optionals (xlibs != null) [ xlibs.xlibs xlibs.libXrender ];
+    ] ++ stdenv.lib.optionals (xlibs != null) [ xlibs.xlibs xlibs.libXrender ]
+    ++ stdenv.lib.optional (stdenv.system == "x86_64-darwin") gettext;
+
+  patches = [ ./fix-broken-memcp-signature.patch ];
 
   configureFlags =
     [ "--with-pngincludedir=${libpng}/include"
@@ -29,8 +32,10 @@ stdenv.mkDerivation rec {
     sed -e 's@am__append_5 *=.*@am_append_5 =@' -i lib/gvc/Makefile
   '';
 
+  # "command -v" is POSIX, "which" is not
   postInstall = ''
     sed -i 's|`which lefty`|"'$out'/bin/lefty"|' $out/bin/dotty
+    sed -i 's|which|command -v|' $out/bin/vimdot
   '';
 
   meta = {
@@ -47,6 +52,6 @@ stdenv.mkDerivation rec {
     '';
 
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = with stdenv.lib.maintainers; [ simons bjornfor ];
   };
 }
diff --git a/pkgs/tools/graphics/graphviz/fix-broken-memcp-signature.patch b/pkgs/tools/graphics/graphviz/fix-broken-memcp-signature.patch
new file mode 100644
index 00000000000..e93728d4850
--- /dev/null
+++ b/pkgs/tools/graphics/graphviz/fix-broken-memcp-signature.patch
@@ -0,0 +1,15 @@
+diff -ubr graphviz-2.28.0-orig/lib/cdt/cdt.h graphviz-2.28.0-new/lib/cdt/cdt.h
+--- graphviz-2.28.0-orig/lib/cdt/cdt.h	2012-11-11 20:05:55.674397100 +0100
++++ graphviz-2.28.0-new/lib/cdt/cdt.h	2012-11-11 20:06:28.069511092 +0100
+@@ -238,11 +238,6 @@
+ extern int		dtstat _ARG_((Dt_t*, Dtstat_t*, int));
+ extern unsigned int	dtstrhash _ARG_((unsigned int, Void_t*, int));
+ 
+-#if !_PACKAGE_ast
+-extern int		memcmp _ARG_((const Void_t*, const Void_t*, size_t));
+-extern int		strcmp _ARG_((const char*, const char*));
+-#endif
+-
+ #undef extern
+ _END_EXTERNS_
+ 
diff --git a/pkgs/tools/graphics/jbig2enc/default.nix b/pkgs/tools/graphics/jbig2enc/default.nix
new file mode 100644
index 00000000000..60704d6300c
--- /dev/null
+++ b/pkgs/tools/graphics/jbig2enc/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, leptonica, zlib, libwebp, giflib, libjpeg, libpng, libtiff }: stdenv.mkDerivation {
+  name = "jbig2enc-0.28";
+
+  src = fetchurl {
+    url = http://github.com/agl/jbig2enc/archive/0.28-dist.tar.gz;
+    sha256 = "1wc0lmqz4jag3rhhk1xczlqpfv2qqp3fz7wzic2lba3vsbi1rrw3";
+  };
+
+  propagatedBuildInputs = [ leptonica zlib libwebp giflib libjpeg libpng libtiff ];
+
+  # This is necessary, because the resulting library has
+  # /tmp/nix-build-jbig2enc/src/.libs before /nix/store/jbig2enc/lib
+  # in its rpath, which means that patchelf --shrink-rpath removes
+  # the /nix/store one.  By cleaning up before fixup, we ensure that
+  # the /tmp/nix-build-jbig2enc/src/.libs directory is gone.
+  preFixup = ''
+    make clean
+  '';
+}
diff --git a/pkgs/tools/graphics/lprof/default.nix b/pkgs/tools/graphics/lprof/default.nix
new file mode 100644
index 00000000000..31eaebc0fa1
--- /dev/null
+++ b/pkgs/tools/graphics/lprof/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, scons, qt3, lcms1, libtiff, vigra }:
+
+/*  how to calibrate your monitor:
+    Eg see https://wiki.archlinux.org/index.php/ICC_Profiles#Loading_ICC_Profiles
+*/
+stdenv.mkDerivation {
+  name = "lprof-1.11.4.1";
+  buildInputs = [ scons qt3 lcms1 libtiff vigra ];
+
+  preConfigure = ''
+    export QTDIR=${qt3}
+    export qt_directory=${qt3}
+  '';
+
+  src = fetchurl {
+    url = mirror://sourceforge/lprof/lprof/lprof-1.11.4/lprof-1.11.4.1.tar.gz;
+    sha256 = "0q8x24fm5yyvm151xrl3l03p7hvvciqnkbviprfnvlr0lyg9wsrn";
+  };
+
+  # The sed commands disable header checks and add LDFLAGS NIX_CFLAGS_COMPILE
+  # to the gcc environment
+  buildPhase = ''
+    mkdir -p $out
+    export CXX=g++
+    sed -i  SConstruct \
+     -e 's/def CheckForQt(context):/def CheckForQt(context):\n  return 1/' \
+     -e "s/not config.CheckHeader('lcms.h')/False/" \
+     -e "s/not config.CheckHeader('tiff.h')/False/" \
+     -e "s/not config.CheckCXXHeader('vigra\/impex.hxx')/False/" \
+     \
+     -e "s/^\(      'LDFLAGS'.*\)/\1\n,'NIX_CFLAGS_COMPILE' : os.environ['NIX_CFLAGS_COMPILE']/" \
+     -e "s/^\(      'LDFLAGS'.*\)/\1\n,'NIX_LDFLAGS' : os.environ['NIX_LDFLAGS']/"
+
+    scons PREFIX=$out SYSLIBS=1 install
+  '';
+
+  installPhase = ":";
+
+  patches = [ ./lcms-1.17.patch ];
+
+  meta = {
+    description = "Little CMS ICC profile construction set";
+    homepage = "http://sourceforge.net/projects/lprof";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/tools/graphics/lprof/lcms-1.17.patch b/pkgs/tools/graphics/lprof/lcms-1.17.patch
new file mode 100644
index 00000000000..a88471e143f
--- /dev/null
+++ b/pkgs/tools/graphics/lprof/lcms-1.17.patch
@@ -0,0 +1,13 @@
+--- a/src/liblprof/lcmsprf.h	2007-08-31 15:36:20.000000000 -0700
++++ b/src/liblprof/lcmsprf.h	2007-08-31 15:37:39.000000000 -0700
+@@ -67,6 +67,9 @@
+ #define mmax(a,b) ((a) > (b)?(a):(b))
+ #endif
+ 
++#if LCMS_VERSION > 116
++typedef int BOOL;
++#endif
+ 
+ /* Misc operations ------------------------------------------------------------------------ */
+ 
+
diff --git a/pkgs/tools/graphics/mscgen/default.nix b/pkgs/tools/graphics/mscgen/default.nix
index 63e6afaa803..ed69327b752 100644
--- a/pkgs/tools/graphics/mscgen/default.nix
+++ b/pkgs/tools/graphics/mscgen/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
   name = "mscgen-${version}";
 
   src = fetchurl {
-    url = "www.mcternan.me.uk/mscgen/software/mscgen-src-${version}.tar.gz";
+    url = "http://www.mcternan.me.uk/mscgen/software/mscgen-src-${version}.tar.gz";
     sha256 = "3c3481ae0599e1c2d30b7ed54ab45249127533ab2f20e768a0ae58d8551ddc23";
   };
 
@@ -19,8 +19,8 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    homepage = "http://www.mcternan.me.uk/mscgen/";
-    description = "convert Message Sequence Chart descriptions into PNG, SVG, or EPS images";
+    homepage = http://www.mcternan.me.uk/mscgen/;
+    description = "Convert Message Sequence Chart descriptions into PNG, SVG, or EPS images";
     license = "GPLv2";
 
     longDescription = ''
diff --git a/pkgs/tools/graphics/netpbm/default.nix b/pkgs/tools/graphics/netpbm/default.nix
index 06a89a1e2da..2af863e37bc 100644
--- a/pkgs/tools/graphics/netpbm/default.nix
+++ b/pkgs/tools/graphics/netpbm/default.nix
@@ -1,17 +1,18 @@
-{stdenv, fetchsvn, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper }:
+{stdenv, fetchsvn, pkgconfig, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper, libX11 }:
 
+let rev = 1742; in
 stdenv.mkDerivation {
-  name = "netpbm-advanced-1177";
+  name = "netpbm-advanced-${toString rev}";
 
   src = fetchsvn {
     url = https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced;
-    rev = 1656;
-    sha256 = "0mbrvd8nc52yrg8wgxcvxsajxc9qrnjqhlcks6dpdzq7qmwjy6g9";
+    inherit rev;
+    sha256 = "0csx6g0ci66nx1a6z0a9dkpfp66mdvcpp5r7g6zrx4jp18r9hzb2";
   };
 
-  NIX_CFLAGS_COMPILE = if stdenv.system == "x86_64-linux" then "-fPIC" else "";
+  NIX_CFLAGS_COMPILE = "-fPIC"; # Gentoo adds this on every platform
 
-  buildInputs = [ flex zlib perl libpng libjpeg libxml2 makeWrapper ];
+  buildInputs = [ pkgconfig flex zlib perl libpng libjpeg libxml2 makeWrapper libX11 ];
 
   configurePhase = "cp config.mk.in config.mk";
 
diff --git a/pkgs/tools/graphics/pfstools/default.nix b/pkgs/tools/graphics/pfstools/default.nix
index 0c829eab130..9b0a83725ea 100644
--- a/pkgs/tools/graphics/pfstools/default.nix
+++ b/pkgs/tools/graphics/pfstools/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libtiff openexr imagemagick libjpeg qt4 mesa freeglut
     bzip2 libX11 libpng expat ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://pfstools.sourceforge.net/;
diff --git a/pkgs/tools/graphics/plotutils/debian-patches.nix b/pkgs/tools/graphics/plotutils/debian-patches.nix
index d72974445e6..0615d1f52e1 100644
--- a/pkgs/tools/graphics/plotutils/debian-patches.nix
+++ b/pkgs/tools/graphics/plotutils/debian-patches.nix
@@ -1,6 +1,6 @@
 # Generated by debian-patches.sh from debian-patches.txt
 let
-  prefix = "http://patch-tracker.debian.org/patch/series/dl/plotutils/2.6-2";
+  prefix = "http://patch-tracker.debian.org/patch/series/dl/plotutils/2.6-3";
 in
 [
   {
diff --git a/pkgs/tools/graphics/pngcrush/default.nix b/pkgs/tools/graphics/pngcrush/default.nix
index 7293c0db66d..60301b9b164 100644
--- a/pkgs/tools/graphics/pngcrush/default.nix
+++ b/pkgs/tools/graphics/pngcrush/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libpng }:
 
 stdenv.mkDerivation rec {
-  name = "pngcrush-1.7.22";
+  name = "pngcrush-1.7.50";
 
   src = fetchurl {
     url = "mirror://sourceforge/pmt/${name}-nolib.tar.xz";
-    sha256 = "1sngz34cssni4j7hvqhq5ms6h4ydb3b0s5y7fidv3kjms9g1xcsp";
+    sha256 = "1xabqjgvwsyazs0hw7bzzm256zbd7v33alwzp0lbawm521m3m651";
   };
 
   configurePhase = ''
diff --git a/pkgs/tools/graphics/qrencode/default.nix b/pkgs/tools/graphics/qrencode/default.nix
index 866b121f76b..3b83a18fd36 100644
--- a/pkgs/tools/graphics/qrencode/default.nix
+++ b/pkgs/tools/graphics/qrencode/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libpng ];
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     homepage = http://fukuchi.org/works/qrencode/;
diff --git a/pkgs/tools/graphics/zbar/default.nix b/pkgs/tools/graphics/zbar/default.nix
index 4bced99820b..d5cea08f3df 100644
--- a/pkgs/tools/graphics/zbar/default.nix
+++ b/pkgs/tools/graphics/zbar/default.nix
@@ -30,6 +30,8 @@ rec {
 
   /* doConfigure should be removed if not needed */
   phaseNames = ["doConfigure" "doMakeInstall"];
+
+  configureFlags = ["--disable-video"];
       
   meta = {
     description = "Bar code toolset";
diff --git a/pkgs/tools/inputmethods/fcitx/default.nix b/pkgs/tools/inputmethods/fcitx/default.nix
new file mode 100644
index 00000000000..ac60cd6134f
--- /dev/null
+++ b/pkgs/tools/inputmethods/fcitx/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, pkgconfig, cmake, intltool, gettext
+, libxml2, enchant, isocodes, icu, libpthreadstubs
+, pango, cairo, libxkbfile, xorg
+}:
+
+stdenv.mkDerivation rec {
+  name = "fcitx-4.2.7";
+  src = fetchurl {
+    url = "https://fcitx.googlecode.com/files/${name}_dict.tar.xz";
+    sha256 = "1dfvr77j9vnlg76155clrjxnm59r5fzv0d3n6c6yn10zb0bjd40c";
+  };
+
+  buildInputs = [
+    cmake enchant pango gettext libxml2 isocodes pkgconfig libxkbfile
+    intltool cairo icu libpthreadstubs xorg.libXau xorg.libXdmcp
+  ];
+
+  cmakeFlags = ''
+    -DENABLE_DBUS=OFF
+    -DENABLE_QT=OFF
+    -DENABLE_QT_IM_MODULE=OFF
+    -DENABLE_OPENCC=OFF
+    -DENABLE_PRESAGE=OFF
+    -DENABLE_XDGAUTOSTART=OFF
+  '';
+
+  meta = {
+    homepage = "https://code.google.com/p/fcitx/";
+    description = "A Flexible Input Method Framework";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/tools/misc/autojump/default.nix b/pkgs/tools/misc/autojump/default.nix
index 397e80a745e..459c9c86ce4 100644
--- a/pkgs/tools/misc/autojump/default.nix
+++ b/pkgs/tools/misc/autojump/default.nix
@@ -1,41 +1,33 @@
-{ fetchurl, stdenv, python }:
+{ fetchurl, stdenv, python, bash }:
 
-let version = "4"; in
+let 
+  version = "21.5.8";
+in
   stdenv.mkDerivation rec {
     name = "autojump-${version}";
 
     src = fetchurl {
-      url = "http://github.com/joelthelion/autojump/tarball/release-v4";
+      url = "http://github.com/joelthelion/autojump/archive/release-v${version}.tar.gz";
       name = "autojump-${version}.tar.gz";
-      sha256 = "06hjkdmfhawi6xksangymf9z85ql8d7q0vlcmgsw45vxq7iq1fnp";
+      sha256 = "07jf5pa9xwmbswsc0h6law9f5qwczsj25w7h034s379imid5h62f";
     };
 
-    # FIXME: Appears to be broken with Bash 4.0:
-    # http://wiki.github.com/joelthelion/autojump/doesnt-seem-to-be-working-with-bash-40 .
-
-    patchPhase = ''
-      sed -i "install.sh" \
-          -e "s,/usr/,$out/,g ; s,/etc/,/nowhere/,g ; s,sudo,,g"
-    '';
-
-    buildInputs = [ python ];
+    buildInputs = [ python bash ];
+    dontBuild = true;
 
     installPhase = ''
-      mkdir -p "$out/bin" "$out/share/man/man1"
-      yes no | sh ./install.sh
+      bash ./install.sh -d $out
 
       mkdir -p "$out/etc/bash_completion.d"
-      cp -v autojump.bash "$out/etc/bash_completion.d"
-
-      echo "Bash users: Make sure to source \`$out/etc/bash_completion.d/autojump.bash'"
-      echo "to get the \`j' and \`jumpstat' commands."
+      cp -v $out/etc/profile.d/autojump.bash "$out/etc/bash_completion.d"
+      mkdir -p $out/bin
+      ln -s $out/usr/local/bin/autojump $out/bin/j
 
       # FIXME: What's the right place for `autojump.zsh'?
     '';
 
     meta = {
       description = "Autojump, a `cd' command that learns";
-
       longDescription = ''
         One of the most used shell commands is “cdâ€.  A quick survey
         among my friends revealed that between 10 and 20% of all
@@ -56,9 +48,9 @@ let version = "4"; in
 
         Autojump supports tab-completion.
       '';
-
       homepage = http://wiki.github.com/joelthelion/autojump;
-
-      license = "GPLv3+";
+      license = stdenv.lib.licenses.gpl3;
+      platforms = stdenv.lib.platforms.all;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
     };
   }
diff --git a/pkgs/tools/misc/byobu/default.nix b/pkgs/tools/misc/byobu/default.nix
new file mode 100644
index 00000000000..6766e0bb474
--- /dev/null
+++ b/pkgs/tools/misc/byobu/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "byobu-5.37";
+
+  src = fetchurl {
+    url = "https://launchpad.net/byobu/trunk/5.37/+download/byobu_5.37.orig.tar.gz";
+    sha256 = "e9fec9c03ebdfbeb42d08e8e7a7e45d873e1a5d5f7984a39793e37fe7cc30688";
+  };
+
+  doCheck = true;
+
+  meta = {
+    homepage = https://launchpad.net/byobu/;
+    description = "Byobu is a GPLv3 open source text-based window manager and terminal multiplexer.";
+
+    longDescription =
+      ''Byobu is a GPLv3 open source text-based window manager and terminal multiplexer. 
+        It was originally designed to provide elegant enhancements to the otherwise functional, 
+        plain, practical GNU Screen, for the Ubuntu server distribution. 
+        Byobu now includes an enhanced profiles, convenient keybindings, 
+        configuration utilities, and toggle-able system status notifications for both 
+        the GNU Screen window manager and the more modern Tmux terminal multiplexer, 
+        and works on most Linux, BSD, and Mac distributions.
+      '';
+
+    license = stdenv.lib.licenses.gpl3;
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.qknight ];
+  };
+}
diff --git a/pkgs/tools/misc/cloc/default.nix b/pkgs/tools/misc/cloc/default.nix
new file mode 100644
index 00000000000..dfe5476f813
--- /dev/null
+++ b/pkgs/tools/misc/cloc/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, perl, AlgorithmDiff, RegexpCommon }:
+
+stdenv.mkDerivation rec {
+  
+  name = "cloc-${version}";
+
+  version = "1.58";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cloc/cloc-${version}.tar.gz";
+    sha256 = "1k92jldy4m717lh1xd6yachx3l2hhpx76qhj1ipnx12hsxw1zc8w";
+  };
+
+  buildInputs = [ perl AlgorithmDiff RegexpCommon ];
+
+  unpackPhase = ''
+    mkdir ${name}
+    tar xf $src -C ${name}
+    cd ${name}
+  '';
+
+  makeFlags = [ "prefix=" "DESTDIR=$(out)" "INSTALL=install" ];
+
+  meta = {
+    description = "A program that counts lines of source code";
+    homepage = http://cloc.sourceforge.net;
+    license = stdenv.lib.licenses.gpl2;
+  };
+
+}
diff --git a/pkgs/tools/misc/coreutils-5/default.nix b/pkgs/tools/misc/coreutils-5/default.nix
deleted file mode 100644
index de1ff1c4a90..00000000000
--- a/pkgs/tools/misc/coreutils-5/default.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{stdenv, fetchurl, perl ? null}:
-
-stdenv.mkDerivation {
-  name = "coreutils-5.97";
-  src = fetchurl {
-    url = http://nixos.org/tarballs/coreutils-5.97.tar.gz;
-    md5 = "bdec4b75c76ac9bf51b6dd1747d3b06e";
-  };
-  patches = [./dietlibc.patch];
-}
diff --git a/pkgs/tools/misc/coreutils-5/dietlibc.patch b/pkgs/tools/misc/coreutils-5/dietlibc.patch
deleted file mode 100644
index 232737c2f35..00000000000
--- a/pkgs/tools/misc/coreutils-5/dietlibc.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-diff -rc coreutils-5.97-orig/lib/strftime.c coreutils-5.97/lib/strftime.c
-*** coreutils-5.97-orig/lib/strftime.c	2006-10-18 17:10:16.000000000 +0200
---- coreutils-5.97/lib/strftime.c	2006-10-18 17:19:10.000000000 +0200
-***************
-*** 180,185 ****
---- 180,191 ----
-  # define memset_zero(P, Len) (memset (P, '0', Len), (P) += (Len))
-  #endif
-  
-+ #if FPRINTFTIME
-+ #define advance(p, _n) ;
-+ #else
-+ #define advance(p, _n) p += _n;
-+ #endif 
-+ 
-  #define add(n, f)							      \
-    do									      \
-      {									      \
-***************
-*** 198,204 ****
-  		memset_space (p, _delta);				      \
-  	    }								      \
-  	  f;								      \
-! 	  p += FPRINTFTIME ? 0 : _n;					      \
-  	}								      \
-        i += _incr;							      \
-      } while (0)
---- 204,210 ----
-  		memset_space (p, _delta);				      \
-  	    }								      \
-  	  f;								      \
-! 	  advance(p, _n);						      \
-  	}								      \
-        i += _incr;							      \
-      } while (0)
diff --git a/pkgs/tools/misc/coreutils/8.19.nix b/pkgs/tools/misc/coreutils/8.19.nix
new file mode 100644
index 00000000000..f3bee551960
--- /dev/null
+++ b/pkgs/tools/misc/coreutils/8.19.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, perl, gmp ? null
+, aclSupport ? false, acl ? null
+, selinuxSupport? false, libselinux ? null, libsepol ? null
+}:
+
+assert aclSupport -> acl != null;
+assert selinuxSupport -> libselinux != null && libsepol != null;
+
+stdenv.mkDerivation rec {
+  name = "coreutils-8.19";
+
+  src = fetchurl {
+    url = "mirror://gnu/coreutils/${name}.tar.xz";
+    sha256 = "1rx9x3fp848w4nny7irdkcpkan9fcx24d99v5dkwgkyq7wc76f5d";
+  };
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ gmp ]
+    ++ stdenv.lib.optional aclSupport acl
+    ++ stdenv.lib.optional selinuxSupport libselinux
+    ++ stdenv.lib.optional selinuxSupport libsepol;
+
+  crossAttrs = ({
+    buildInputs = [ gmp ]
+      ++ stdenv.lib.optional aclSupport acl.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libselinux.crossDrv
+      ++ stdenv.lib.optional selinuxSupport libsepol.crossDrv
+      ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
+        stdenv.gccCross.libc.libiconv.crossDrv;
+
+    # Needed for fstatfs()
+    # I don't know why it is not properly detected cross building with glibc.
+    configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
+    doCheck = false;
+  }
+
+  //
+
+  # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
+  (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
+    patches = [ ./gets-undeclared.patch ];
+  }));
+
+  # The tests are known broken on Cygwin
+  # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
+  # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
+  # and {Open,Free}BSD.
+  doCheck = stdenv ? glibc;
+
+  enableParallelBuilding = true;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol";
+
+  meta = {
+    homepage = http://www.gnu.org/software/coreutils/;
+    description = "The basic file, shell and text manipulation utilities of the GNU operating system";
+
+    longDescription = ''
+      The GNU Core Utilities are the basic file, shell and text
+      manipulation utilities of the GNU operating system.  These are
+      the core utilities which are expected to exist on every
+      operating system.
+    '';
+
+    license = "GPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
+
diff --git a/pkgs/tools/misc/coreutils/default.nix b/pkgs/tools/misc/coreutils/default.nix
index 9d9ea52f3f5..f55fbc31925 100644
--- a/pkgs/tools/misc/coreutils/default.nix
+++ b/pkgs/tools/misc/coreutils/default.nix
@@ -4,67 +4,76 @@
 }:
 
 assert aclSupport -> acl != null;
-assert selinuxSupport -> ( (libselinux != null) && (libsepol != null) );
+assert selinuxSupport -> libselinux != null && libsepol != null;
 
-stdenv.mkDerivation rec {
-  name = "coreutils-8.15";
+let
+  self = stdenv.mkDerivation rec {
+    name = "coreutils-8.21";
 
-  src = fetchurl {
-    url = "mirror://gnu/coreutils/${name}.tar.xz";
-    sha256 = "176lgw810xw84c6fz5xwhydxggkndmzggl0pxqzldbjf85vv6zl3";
-  };
-
-  buildNativeInputs = [ perl ];
-  buildInputs = [ gmp ]
-    ++ stdenv.lib.optional aclSupport acl
-    ++ stdenv.lib.optional selinuxSupport libselinux
-    ++ stdenv.lib.optional selinuxSupport libsepol;
+    src = fetchurl {
+      url = "mirror://gnu/coreutils/${name}.tar.xz";
+      sha256 = "064f512185iysqqcvhnhaf3bfmzrvcgs7n405qsyp99zmfyl9amd";
+    };
 
-  crossAttrs = ({
+    nativeBuildInputs = [ perl ];
     buildInputs = [ gmp ]
-      ++ stdenv.lib.optional aclSupport acl.hostDrv
-      ++ stdenv.lib.optional selinuxSupport libselinux.hostDrv
-      ++ stdenv.lib.optional selinuxSupport libsepol.hostDrv
-      ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
-        stdenv.gccCross.libc.libiconv.hostDrv;
-
-    # Needed for fstatfs()
-    # I don't know why it is not properly detected cross building with glibc.
-    configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
-    doCheck = false;
-  }
-
-  //
-
-  # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-  (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-    patches = [ ./gets-undeclared.patch ];
-  }));
-
-  # The tests are known broken on Cygwin
-  # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
-  # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
-  # and {Open,Free}BSD.
-  doCheck = (stdenv ? glibc);
-
-  enableParallelBuilding = true;
-
-  NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol";
-
-  meta = {
-    homepage = http://www.gnu.org/software/coreutils/;
-    description = "The basic file, shell and text manipulation utilities of the GNU operating system";
-
-    longDescription = ''
-      The GNU Core Utilities are the basic file, shell and text
-      manipulation utilities of the GNU operating system.  These are
-      the core utilities which are expected to exist on every
-      operating system.
-    '';
-
-    license = "GPLv3+";
-
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+      ++ stdenv.lib.optional aclSupport acl
+      ++ stdenv.lib.optional selinuxSupport libselinux
+      ++ stdenv.lib.optional selinuxSupport libsepol;
+
+    crossAttrs = {
+      buildInputs = [ gmp ]
+        ++ stdenv.lib.optional aclSupport acl.crossDrv
+        ++ stdenv.lib.optional selinuxSupport libselinux.crossDrv
+        ++ stdenv.lib.optional selinuxSupport libsepol.crossDrv
+        ++ stdenv.lib.optional (stdenv.gccCross.libc ? libiconv)
+          stdenv.gccCross.libc.libiconv.crossDrv;
+
+      buildPhase = ''
+        make || (
+          pushd man
+          for a in *.x; do
+            touch `basename $a .x`.1
+          done
+          popd; make ) 
+      '';
+
+      postInstall = ''
+        rm $out/share/man/man1/*
+        cp ${self}/share/man/man1/* $out/share/man/man1
+      '';
+
+      # Needed for fstatfs()
+      # I don't know why it is not properly detected cross building with glibc.
+      configureFlags = [ "fu_cv_sys_stat_statfs2_bsize=yes" ];
+      doCheck = false;
+    };
+
+    # The tests are known broken on Cygwin
+    # (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19025),
+    # Darwin (http://thread.gmane.org/gmane.comp.gnu.core-utils.bugs/19351),
+    # and {Open,Free}BSD.
+    doCheck = stdenv ? glibc;
+
+    enableParallelBuilding = true;
+
+    NIX_LDFLAGS = stdenv.lib.optionalString selinuxSupport "-lsepol";
+
+    meta = {
+      homepage = http://www.gnu.org/software/coreutils/;
+      description = "The basic file, shell and text manipulation utilities of the GNU operating system";
+
+      longDescription = ''
+        The GNU Core Utilities are the basic file, shell and text
+        manipulation utilities of the GNU operating system.  These are
+        the core utilities which are expected to exist on every
+        operating system.
+      '';
+
+      license = "GPLv3+";
+
+      maintainers = [ stdenv.lib.maintainers.ludo ];
+    };
   };
-}
-
+in
+  self
diff --git a/pkgs/tools/misc/cowsay/default.nix b/pkgs/tools/misc/cowsay/default.nix
index 59978e2865c..a9bdf1b2b92 100644
--- a/pkgs/tools/misc/cowsay/default.nix
+++ b/pkgs/tools/misc/cowsay/default.nix
@@ -2,17 +2,22 @@
 
 stdenv.mkDerivation {
   name = "cowsay-3.03";
+
   src = fetchurl {
     url = http://www.nog.net/~tony/warez/cowsay-3.03.tar.gz;
-    sha256 = "1bxj802na2si2bk5zh7n0b7c33mg8a5n2wnvh0vihl9bmjkp51hb";
+    sha256 = "1s3c0g5vmsadicc4lrlkmkm8znm4y6wnxd8kyv9xgm676hban1il";
   };
-  buildInputs = [perl];
+
+  buildInputs = [ perl ];
+
   installPhase = ''
     bash ./install.sh $out
   '';
 
   meta = {
-    description = "cowsay is a program which generates ASCII pictures of a cow with a message.";
+    description = "A program which generates ASCII pictures of a cow with a message";
     homepage = http://www.nog.net/~tony/warez/cowsay.shtml;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.rob ];
   };
 }
diff --git a/pkgs/tools/misc/debian-devscripts/default.nix b/pkgs/tools/misc/debian-devscripts/default.nix
new file mode 100644
index 00000000000..ddf30f342d1
--- /dev/null
+++ b/pkgs/tools/misc/debian-devscripts/default.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchurl, perl, CryptSSLeay, LWP, unzip, xz, dpkg, TimeDate, DBFile
+  , FileDesktopEntry, libxslt, docbook_xsl, python, setuptools, makeWrapper
+}:
+stdenv.mkDerivation rec {
+  version = "2.12.4";
+  name = "debian-devscripts-${version}";
+  src = fetchurl {
+    url = "mirror://debian/pool/main/d/devscripts/devscripts_${version}.tar.gz";
+    sha256 = "34bcbec78bd4fe34d9f1326b9d1477ff2410e20e2dca6b7bfbf2bf92dbb83904";
+  };
+  buildInputs = [ perl CryptSSLeay LWP unzip xz dpkg TimeDate DBFile 
+    FileDesktopEntry libxslt python setuptools makeWrapper ];
+  preConfigure = ''
+    export PERL5LIB="$PERL5LIB''${PERL5LIB:+:}${dpkg}";
+    sed -e "s@/usr/share/sgml/[^ ]*/manpages/docbook.xsl@${docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl@" -i scripts/Makefile
+    sed -e 's/ translated_manpages//; s/--install-layout=deb//; s@--root="[^ ]*"@--prefix="'"$out"'"@' -i Makefile */Makefile
+    tgtpy="$out/lib/${python.libPrefix}/site-packages"
+    mkdir -p "$tgtpy"
+    export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$tgtpy"
+    sed -re "s@/usr( |$|/)@$out\\1@" -i Makefile* */Makefile*
+    sed -re "s@/etc( |$|/)@$out/etc\\1@" -i Makefile* */Makefile*
+  '';
+  postInstall = ''
+    sed -re 's@(^|[ !`"])/bin/bash@\1${stdenv.shell}@g' -i "$out/bin"/*
+    for i in "$out/bin"/*; do
+      wrapProgram "$i" \
+        --prefix PERL5LIB : "$PERL5LIB" \
+        --prefix PERL5LIB : "$out/share/devscripts"
+    done
+  '';
+  meta = {
+    description = ''Debian package maintenance scripts'';
+    license = "GPL (various)"; # Mix of public domain, Artistic+GPL, GPL1+, GPL2+, GPL3+, and GPL2-only...
+    maintainers = with stdenv.lib.maintainers; [raskin];
+  };
+}
diff --git a/pkgs/tools/misc/debootstrap/default.nix b/pkgs/tools/misc/debootstrap/default.nix
index 33a1fc839ce..388cfa14e41 100644
--- a/pkgs/tools/misc/debootstrap/default.nix
+++ b/pkgs/tools/misc/debootstrap/default.nix
@@ -1,55 +1,65 @@
-{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget }:
+{ stdenv, fetchurl, dpkg, gettext, gawk, perl, wget, coreutils, fakeroot }:
 
 let
 
-  devices = fetchurl {
-    url = mirror://gentoo/distfiles/devices.tar.gz;
-    sha256 = "0j4yhajmlgvbksr2ij0dm7jy3q52j3wzhx2fs5lh05i1icygk4qd";
+# USAGE like this: debootstrap sid /tmp/target-chroot-directory
+
+# There is also cdebootstrap now. Is that easier to maintain?
+
+  makedev = stdenv.mkDerivation {
+    name = "makedev-for-debootstrap";
+    src = fetchurl {
+            url = mirror://debian/pool/main/m/makedev/makedev_2.3.1.orig.tar.gz;
+            sha256 = "1yhxlj2mhn1nqkx1f0sn0bl898nf28arxxa4lgp7hdrb5cpp36c5";
+    };
+    patches = [
+      (fetchurl {
+       url = "http://ftp.de.debian.org/debian/pool/main/m/makedev/makedev_2.3.1-89.diff.gz";
+       sha256 = "1zbifw2jkq6471fb67y893nq4lq009xbfbi57jbjwxnhqmrppcy9";
+       })
+    ];
+    # TODO install man
+    installPhase = ''
+      ensureDir $out/sbin
+      ls -l
+      t=$out/sbin/MAKEDEV
+      cp MAKEDEV $t
+      chmod +x $t
+    '';
   };
   
 in
 
 stdenv.mkDerivation {
-  name = "debootstrap-1.0.10lenny";
+
+  name = "debootstrap-1.0.42";
 
   src = fetchurl {
-    # I'd like to use the source. However it's lacking the lanny script ?
-    url = mirror://debian/pool/main/d/debootstrap/debootstrap_1.0.10lenny1_all.deb;
-    sha256 = "a70af8e3369408ce9d6314fb5219de73f9523b347b75a3b07ee17ea92c445051";
+    # git clone git://git.debian.org/d-i/debootstrap.git
+    # I'd like to use the source. However it's lacking the lanny script ? (still true?)
+    url = http://ftp.de.debian.org/debian/pool/main/d/debootstrap/debootstrap_1.0.42.tar.gz;
+    sha256 = "0a5azl22wz1q92b2c91zlpz6krd7wqyi63yk87vyczp363ml0nz0";
   };
-  
+
   buildInputs = [ dpkg gettext gawk perl ];
 
-  unpackPhase = ''
-    dpkg-deb --extract "$src" .
-  '';
-  
   buildPhase = ":";
 
-  patches = [
-    # replace /usr/* and /sbin/* executables by @executable@ so that they can be replaced by substitute
-    # Be careful not to replace code being run in the debian chroot !
-    ./subst.patch
-  ];
-
-  # from deb 
+  # If you have to update the patch for functions a vim regex like this
+  # can help you identify which lines are used to write scripts on TARGET and
+  # which should /bin/ paths should be replaced:
+  # \<echo\>\|\/bin\/\|^\s*\<cat\>\|EOF\|END
   installPhase = ''
-    cp -r . $out; cd $out
-    t=bin/debootstrap
-    mkdir -p bin man/man8
-    cat >> $t << EOF
-    #!/bin/sh
-    export DEBOOTSTRAP_DIR=$out/usr/share/debootstrap
-    # mount and other tools must be found in chroot. So add default debain paths!
-    # TODO only add paths which are required by the scripts!
-    export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
-    $out/usr/sbin/debootstrap "\$@"
-    EOF
-    chmod +x $t
-    mv usr/share/man/man8/debootstrap.8.gz man/man8
 
-    set -x
-    for file in usr/share/debootstrap/functions usr/sbin/debootstrap; do
+    sed -i \
+      -e 's@/usr/bin/id@id@' \
+      -e 's@/usr/bin/dpkg@${dpkg}/bin/dpkg@' \
+      -e 's@/usr/bin/sha@${coreutils}/bin/sha@' \
+      -e 's@/bin/sha@${coreutils}/bin/sha@' \
+      debootstrap
+
+
+    for file in functions debootstrap; do
       substituteInPlace "$file" \
         --subst-var-by gunzip "$(type -p gunzip)" \
         --subst-var-by bunzip "$(type -p bunzip)" \
@@ -61,28 +71,36 @@ stdenv.mkDerivation {
         --subst-var-by uname "$(type -p uname)" \
         --subst-var-by wget "${wget}/bin/wget"
     done
-  '';
 
-  /* build from source:
-  installPhase = ''
-    cp ${devices} devices.tar.gz
-    mkdir -p $out/{bin,man/man8};
-    cp debootstrap.8 $out/man/man8
+
     sed -i  \
-      -e 's@-o root@@'   \
-      -e 's@-g root@@'   \
-      -e 's@chown@true@' \
-      Makefile
-    make pkgdetails debootstrap-arch
-    make DESTDIR="''\${out}" install-arch
-    t=$out/bin/debootstrap
-    cat >> $t << EOF
+      -e 's@\<wget\>@${wget}/bin/wget@' \
+      functions
+
+    d=$out/share/debootstrap
+    ensureDir $out/{share/debootstrap,bin}
+
+    ${fakeroot}/bin/fakeroot -- make devices.tar.gz MAKEDEV=${makedev}/sbin/MAKEDEV
+
+    cp -r . $d
+
+    cat >> $out/bin/debootstrap << EOF
     #!/bin/sh
-    DEBOOTSTRAP_DIR=$out/usr/share/debootstrap $out/usr/sbin/debootstrap "\$@"
+    export DEBOOTSTRAP_DIR="''${DEBOOTSTRAP_DIR:-$d}"
+    # mount and other tools must be found in chroot. So add default debain paths!
+    # TODO only add paths which are required by the scripts!
+    export PATH=$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+    exec $d/debootstrap "\$@"
     EOF
-    chmod +x $t
+    chmod +x $out/bin/debootstrap
+
+    ensureDir $out/man/man8
+    mv debootstrap.8 $out/man/man8
   '';
-  */
+
+  passthru = {
+    inherit makedev;
+  };
 
   meta = { 
     description = "Tool to create a Debian system in a chroot";
diff --git a/pkgs/tools/misc/file/511.nix b/pkgs/tools/misc/file/511.nix
deleted file mode 100644
index 4e62462b8b3..00000000000
--- a/pkgs/tools/misc/file/511.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl, zlib}:
- 
-stdenv.mkDerivation rec {
-  name = "file-5.11";
-
-  buildInputs = [ zlib ];
-
-  src = fetchurl {
-    url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
-    sha256 = "c70ae29a28c0585f541d5916fc3248c3e91baa481f63d7ccec53d1534cbcc9b7";
-  };
-
-  meta = {
-    description = "A program that shows the type of files";
-    homepage = "http://darwinsys.com/file";
-  };
-}
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index 01a674fe227..8b141fea826 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -1,15 +1,17 @@
-{stdenv, fetchurl}:
- 
-stdenv.mkDerivation {
-  name = "file-5.04";
+{ stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  name = "file-5.12";
+
+  buildInputs = [ zlib ];
 
   src = fetchurl {
-    url = ftp://ftp.astron.com/pub/file/file-5.04.tar.gz;
-    sha256 = "0316lj3jxmp2g8azv0iykmmwjsnjanq93bklccwb6k77jiwnx7jc";
+    url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
+    sha256 = "08ix4xrvan0k80n0l5lqfmc4azjv5lyhvhwdxny4r09j5smhv78r";
   };
 
   meta = {
+    homepage = "http://darwinsys.com/file";
     description = "A program that shows the type of files";
-    homepage = ftp://ftp.astron.com/pub/file;
   };
 }
diff --git a/pkgs/tools/misc/findutils/4.2.27.nix b/pkgs/tools/misc/findutils/4.2.27.nix
deleted file mode 100644
index 591134d692d..00000000000
--- a/pkgs/tools/misc/findutils/4.2.27.nix
+++ /dev/null
@@ -1,14 +0,0 @@
-{stdenv, fetchurl, coreutils}:
-
-stdenv.mkDerivation {
-  name = "findutils-4.2.27";
-  src = fetchurl {
-    url = http://nixos.org/tarballs/findutils-4.2.27.tar.gz;
-    md5 = "f1e0ddf09f28f8102ff3b90f3b5bc920";
-  };
-  buildInputs = [coreutils];
-  patches = [./findutils-path.patch]
-    # Note: the dietlibc is just to get findutils to compile.  The
-    # locate command probably won't work though.
-    ++ (if stdenv ? isDietLibC then [./dietlibc-hack.patch] else []);
-}
diff --git a/pkgs/tools/misc/findutils/default.nix b/pkgs/tools/misc/findutils/default.nix
index 11ed1cf07b5..88cb2c313c0 100644
--- a/pkgs/tools/misc/findutils/default.nix
+++ b/pkgs/tools/misc/findutils/default.nix
@@ -8,12 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "0amn0bbwqvsvvsh6drfwz20ydc2czk374lzw5kksbh6bf78k4ks3";
   };
 
-  buildNativeInputs = [coreutils];
+  nativeBuildInputs = [coreutils];
 
-  patches = [ ./findutils-path.patch ./change_echo_path.patch ]
-    # Note: the dietlibc patch is just to get findutils to compile.
-    # The locate command probably won't work though.
-    ++ stdenv.lib.optional (stdenv ? isDietLibC) ./dietlibc-hack.patch;
+  patches = [ ./findutils-path.patch ./change_echo_path.patch ];
 
   doCheck = true;
 
diff --git a/pkgs/tools/misc/findutils/dietlibc-hack.patch b/pkgs/tools/misc/findutils/dietlibc-hack.patch
deleted file mode 100644
index 957c32d3d4e..00000000000
--- a/pkgs/tools/misc/findutils/dietlibc-hack.patch
+++ /dev/null
@@ -1,58 +0,0 @@
-diff -rc findutils-4.2.27-orig/locate/code.c findutils-4.2.27/locate/code.c
-*** findutils-4.2.27-orig/locate/code.c	2005-06-07 22:24:56.000000000 +0000
---- findutils-4.2.27/locate/code.c	2006-10-20 15:53:53.000000000 +0000
-***************
-*** 210,216 ****
---- 210,218 ----
-        if (diffcount < -LOCATEDB_OLD_OFFSET || diffcount > LOCATEDB_OLD_OFFSET)
-  	{
-  	  putc (LOCATEDB_OLD_ESCAPE, stdout);
-+ #if 0          
-  	  putw (diffcount + LOCATEDB_OLD_OFFSET, stdout);
-+ #endif          
-  	}
-        else
-  	putc (diffcount + LOCATEDB_OLD_OFFSET, stdout);
-diff -rc findutils-4.2.27-orig/locate/locate.c findutils-4.2.27/locate/locate.c
-*** findutils-4.2.27-orig/locate/locate.c	2005-09-01 20:42:43.000000000 +0000
---- findutils-4.2.27/locate/locate.c	2006-10-20 15:53:11.000000000 +0000
-***************
-*** 468,473 ****
---- 468,474 ----
-    return VISIT_CONTINUE;
-  }
-  
-+ #if 0
-  static int
-  visit_old_format(struct process_data *procdata, void *context)
-  {
-***************
-*** 498,503 ****
---- 499,505 ----
-    
-    return VISIT_CONTINUE;
-  }
-+ #endif
-  
-  
-  static int
-***************
-*** 911,920 ****
-    lastinspector = NULL;
-    past_pat_inspector = NULL;
-  
-!   if (old_format)
-!     add_visitor(visit_old_format, NULL);
-!   else
-!     add_visitor(visit_locate02_format, NULL);
-  
-    if (basename_only)
-      add_visitor(visit_basename, NULL);
---- 913,919 ----
-    lastinspector = NULL;
-    past_pat_inspector = NULL;
-  
-!   add_visitor(visit_locate02_format, NULL);
-  
-    if (basename_only)
-      add_visitor(visit_basename, NULL);
diff --git a/pkgs/tools/misc/g500-control/default.nix b/pkgs/tools/misc/g500-control/default.nix
new file mode 100644
index 00000000000..adccde71c46
--- /dev/null
+++ b/pkgs/tools/misc/g500-control/default.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, coreutils}:
+
+stdenv.mkDerivation rec {
+  name = "g500-control-0.0.1";
+
+  src = fetchurl {
+    url = "http://g500-control.googlecode.com/files/g500_control_0.0.1.tar.gz";
+    sha256 = "1xlg9lpxnk3228k81y1i6jjh4df1p4jh64g54w969g6a6v6dazvb";
+  };
+
+  buildInputs = [ coreutils ];
+  
+  unpackPhase = ''
+    mkdir -pv g500-control
+    tar -C g500-control/ -xf $src
+  '';
+
+  buildPhase = ''
+    cd g500-control
+    gcc -o g500-control *.c
+  '';
+
+  installPhase = ''
+    mkdir -pv $out/bin/
+    cp g500-control $out/bin/
+  '';
+  
+  meta = {
+    homepage = http://code.google.com/p/g500-control/;
+    description = "Configure Logitech G500's internal profile under Linux";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/tools/misc/gnokii/src-for-default.nix b/pkgs/tools/misc/gnokii/src-for-default.nix
index 360f98de758..af2768ddfa3 100644
--- a/pkgs/tools/misc/gnokii/src-for-default.nix
+++ b/pkgs/tools/misc/gnokii/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="0.6.30";
-   name="gnokii-0.6.30";
-   hash="0k14dymifk7dx3z58cqrc4mgxrm17s4jk12chwdfjhjarz390x8p";
+   version="0.6.31";
+   name="gnokii-0.6.31";
+   hash="0sjjhm40662bj6j0jh3sd25b8nww54nirpwamz618rg6pb5hjwm8";
    url="http://www.gnokii.org/download/gnokii/gnokii-${version}.tar.gz";
-   advertisedUrl="http://www.gnokii.org/download/gnokii/gnokii-0.6.30.tar.gz";
+   advertisedUrl="http://www.gnokii.org/download/gnokii/gnokii-0.6.31.tar.gz";
   
   
 }
diff --git a/pkgs/tools/misc/gparted/default.nix b/pkgs/tools/misc/gparted/default.nix
index 249456580d4..9e8b1f9e322 100644
--- a/pkgs/tools/misc/gparted/default.nix
+++ b/pkgs/tools/misc/gparted/default.nix
@@ -1,22 +1,21 @@
 { stdenv, fetchurl, parted, gtk, glib, intltool, gettext, libuuid
-, pkgconfig, gtkmm, gnomedocutils, libxml2 }:
+, pkgconfig, gtkmm, libxml2 }:
 
-stdenv.mkDerivation {
-  name = "gparted-0.8.1";
+stdenv.mkDerivation rec {
+  name = "gparted-0.15.0";
 
   src = fetchurl {
-    url = mirror://sourceforge/gparted/gparted-0.5.1/gparted-0.8.1.tar.bz2;
-    sha256 = "128pnrcqp3d4a4jnjxm0mqglbyrs2q841pmg5g8ilyc827b6j163";
+    url = "mirror://sourceforge/gparted/${name}.tar.bz2";
+    sha256 = "03s9dp2q281lkkfjgk9ahc8i6dk4d2a03z4bh2d19a7r3b2mmdww";
   };
 
   configureFlags = "--disable-doc";
 
-  buildInputs =
-    [ parted gtk glib intltool gettext libuuid pkgconfig gtkmm
-      gnomedocutils libxml2
-    ];
+  buildInputs = [
+    parted gtk glib intltool gettext libuuid pkgconfig gtkmm libxml2
+  ];
 
-  meta = { 
+  meta = {
     description = "Graphical disk partitioning tool";
     homepage = http://gparted.sourceforge.net;
     license = "GPLv2";
diff --git a/pkgs/tools/misc/grub/2.0x.nix b/pkgs/tools/misc/grub/2.0x.nix
index 4186a440535..d824d76a864 100644
--- a/pkgs/tools/misc/grub/2.0x.nix
+++ b/pkgs/tools/misc/grub/2.0x.nix
@@ -4,14 +4,14 @@
 let
 
   prefix = "grub${if EFIsupport then "-efi" else ""}";
-  
+
   version = "2.00";
-  
+
   unifont_bdf = fetchurl {
     url = "http://unifoundry.com/unifont-5.1.20080820.bdf.gz";
     sha256 = "0s0qfff6n6282q28nwwblp5x295zd6n71kl43xj40vgvdqxv0fxx";
   };
-  
+
 in
 
 stdenv.mkDerivation rec {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     sha256 = "0n64hpmsccvicagvr0c6v0kgp2yw0kgnd3jvsyd26cnwgs7c6kkq";
   };
 
-  buildNativeInputs = [ flex bison ];
+  nativeBuildInputs = [ flex bison ];
   buildInputs = [ ncurses libusb freetype gettext devicemapper ]
     ++ stdenv.lib.optional doCheck qemu;
 
@@ -43,6 +43,10 @@ stdenv.mkDerivation rec {
        # See <http://www.mail-archive.com/qemu-devel@nongnu.org/msg22775.html>.
        sed -i "tests/util/grub-shell.in" \
            -e's/qemu-system-i386/qemu-system-x86_64 -nodefaults/g'
+
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in grub is updated.
+       sed -i '/gets is a security hole/d' grub-core/gnulib/stdio.in.h
     '';
 
   prePatch =
@@ -51,6 +55,8 @@ stdenv.mkDerivation rec {
            -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g"
     '';
 
+  patches = [ ./fix-bash-completion.patch ];
+
   configureFlags =
     let arch = if stdenv.system == "i686-linux" then "i386"
                else if stdenv.system == "x86_64-linux" then "x86_64"
diff --git a/pkgs/tools/misc/grub/default.nix b/pkgs/tools/misc/grub/default.nix
index a187dd9d6b2..4f4931e004f 100644
--- a/pkgs/tools/misc/grub/default.nix
+++ b/pkgs/tools/misc/grub/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation {
   name = "grub-0.97-patch-1.12";
-  
+
   src = fetchurl {
     url = ftp://alpha.gnu.org/gnu/grub/grub-0.97.tar.gz;
     md5 = "cd3f3eb54446be6003156158d51f4884";
@@ -27,10 +27,10 @@ stdenv.mkDerivation {
     # shell.  KDE uses this to allow rebooting into a non-default
     # entry.
     (fetchurl {
-      url = http://cvs.mandriva.com/cgi-bin/viewvc.cgi/SPECS/grub/grub-0.97-once.patch?revision=1.3;
+      url = "https://raw.github.com/andatche/centos-grub/master/SOURCES/grub-0.97-once.patch";
       sha256 = "1g5qfn8lvl32h4pggdf7dmjqjpi42jblknzakb5h909fi5i1qyw8";
     })
-    
+
   ] ++ (stdenv.lib.optional buggyBiosCDSupport ./buggybios.patch);
 
   # Autoconf/automake required for the splashimage patch.
diff --git a/pkgs/tools/misc/grub/device-mapper-symlinks.patch b/pkgs/tools/misc/grub/device-mapper-symlinks.patch
deleted file mode 100644
index 0a21a51de79..00000000000
--- a/pkgs/tools/misc/grub/device-mapper-symlinks.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-Only in grub-1.97.1-orig/: grub-1.97.1
-diff -rc -x '*~' grub-1.97.1-orig/util/getroot.c grub-1.97.1/util/getroot.c
-*** grub-1.97.1-orig/util/getroot.c	2009-11-09 16:48:16.000000000 +0100
---- grub-1.97.1/util/getroot.c	2010-01-08 00:26:12.000000000 +0100
-***************
-*** 217,224 ****
-  	continue;
-  
-        if (S_ISLNK (st.st_mode))
-! 	/* Don't follow symbolic links.  */
-! 	continue;
-  
-        if (S_ISDIR (st.st_mode))
-  	{
---- 217,229 ----
-  	continue;
-  
-        if (S_ISLNK (st.st_mode))
-!         {
-!           if (strcmp(dir, "mapper") != 0)
-!             /* Don't follow symbolic links.  */
-!             continue;
-!           if (stat (ent->d_name, &st) < 0)
-!             continue;
-!         }
-  
-        if (S_ISDIR (st.st_mode))
-  	{
diff --git a/pkgs/tools/misc/grub/fix-bash-completion.patch b/pkgs/tools/misc/grub/fix-bash-completion.patch
new file mode 100644
index 00000000000..97cecdce373
--- /dev/null
+++ b/pkgs/tools/misc/grub/fix-bash-completion.patch
@@ -0,0 +1,24 @@
+diff -ubr grub-2.00-orig/util/bash-completion.d/grub-completion.bash.in grub-2.00/util/bash-completion.d/grub-completion.bash.in
+--- grub-2.00-orig/util/bash-completion.d/grub-completion.bash.in	2012-10-16 19:02:36.342733957 +0200
++++ grub-2.00/util/bash-completion.d/grub-completion.bash.in	2012-10-16 19:04:48.262733941 +0200
+@@ -17,6 +17,12 @@
+ # along with GRUB.  If not, see <http://www.gnu.org/licenses/>.
+ # bash completion for grub
+ 
++have()
++{
++    unset -v have
++    _have $1 && have=yes
++}
++
+ __grub_dir() {
+     local i c=1 boot_dir
+ 
+@@ -479,6 +485,7 @@
+ have ${__grub_script_check_program} && \
+  complete -F _grub_script_check -o filenames ${__grub_script_check_program}
+ 
++unset -f have
+ 
+ # Local variables:
+ # mode: shell-script
diff --git a/pkgs/tools/misc/gsmartcontrol/default.nix b/pkgs/tools/misc/gsmartcontrol/default.nix
new file mode 100644
index 00000000000..abbd8f20fd0
--- /dev/null
+++ b/pkgs/tools/misc/gsmartcontrol/default.nix
@@ -0,0 +1,23 @@
+{ fetchurl, stdenv, smartmontools, gtk, gtkmm, libglademm, pkgconfig, pcre }:
+
+stdenv.mkDerivation rec {
+  version="0.8.7";
+  name = "gsmartcontrol-${version}";
+
+  src = fetchurl {
+    url = "http://artificialtime.com/gsmartcontrol/gsmartcontrol-${version}.tar.bz2";
+    sha256 = "1ipykzqpfvlr84j38hr7q2cag4imrn1gql10slp8bfrs4h1si3vh";
+  };
+
+  buildInputs = [ smartmontools gtk gtkmm libglademm pkgconfig pcre ];
+
+  #installTargets = "install datainstall";
+
+  meta = {
+    description = "GSmartControl is a graphical user interface for smartctl (from smartmontools package), which is a tool for querying and controlling SMART (Self-Monitoring, Analysis, and Reporting Technology) data on modern hard disk drives.";
+    homepage = http://gsmartcontrol.berlios.de;
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [qknight];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/misc/gummiboot/default.nix b/pkgs/tools/misc/gummiboot/default.nix
new file mode 100644
index 00000000000..cf2fe713461
--- /dev/null
+++ b/pkgs/tools/misc/gummiboot/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, gnu_efi, unzip, pkgconfig, utillinux, libxslt, docbook_xsl, docbook_xml_dtd_42 }:
+
+stdenv.mkDerivation rec {
+  name = "gummiboot-23";
+
+  buildInputs = [ unzip pkgconfig utillinux libxslt docbook_xsl docbook_xml_dtd_42 ];
+
+  patches = [ ./no-usr.patch ];
+
+  buildFlags = [ "GNU_EFI=${gnu_efi}" ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  src = fetchurl {
+    url = "http://cgit.freedesktop.org/gummiboot/snapshot/${name}.zip";
+    sha256 = "1lmfk4k52ha00ppna5g7h51vhd27i9fipf5k7mc2d9jkm2480z4j";
+  };
+
+  meta = {
+    description = "A simple UEFI boot manager which executes configured EFI images";
+
+    homepage = http://freedesktop.org/wiki/Software/gummiboot;
+
+    license = stdenv.lib.licenses.lgpl21Plus;
+
+    platforms = [ "x86_64-linux" "i686-linux" ];
+
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/tools/misc/gummiboot/no-usr.patch b/pkgs/tools/misc/gummiboot/no-usr.patch
new file mode 100644
index 00000000000..db906894740
--- /dev/null
+++ b/pkgs/tools/misc/gummiboot/no-usr.patch
@@ -0,0 +1,79 @@
+diff -Naur gummiboot-23-orig/Makefile gummiboot-23/Makefile
+--- gummiboot-23-orig/Makefile	2013-02-20 00:55:44.000000000 -0500
++++ gummiboot-23/Makefile	2013-02-21 12:00:35.783637645 -0500
+@@ -10,7 +10,8 @@
+ export E Q
+ 
+ ARCH=$(shell $(CC) -dumpmachine | sed "s/\(-\).*$$//")
+-LIBDIR=$(shell echo $$(cd /usr/lib/$$(gcc -print-multi-os-directory); pwd))
++PREFIX=/usr
++LIBDIR=$(GNU_EFI)/lib
+ LIBEFIDIR=$(or $(wildcard $(LIBDIR)/gnuefi), $(LIBDIR))
+ 
+ ifeq ($(ARCH),i686)
+@@ -25,13 +26,13 @@
+ 		-mno-red-zone
+ endif
+ 
+-all: gummiboot$(MACHINE_TYPE_NAME).efi gummiboot
++all: gummiboot$(MACHINE_TYPE_NAME).efi gummiboot man
+ 
+ # ------------------------------------------------------------------------------
+ CPPFLAGS = \
+ 	-I. \
+-	-I/usr/include/efi \
+-	-I/usr/include/efi/$(ARCH)
++	-I$(GNU_EFI)/include/efi \
++	-I$(GNU_EFI)/include/efi/$(ARCH)
+ 
+ CFLAGS = \
+ 	-DVERSION=$(VERSION) \
+@@ -82,6 +83,7 @@
+ 	  `pkg-config --cflags --libs blkid` \
+ 	  src/setup/setup.c \
+ 	  src/setup/efivars.c \
++	  -DPREFIX=\"$(PREFIX)\" \
+ 	  -o $@
+ 
+ # ------------------------------------------------------------------------------
+@@ -101,11 +103,11 @@
+ 	rm -f src/efi/gummiboot.o src/efi/gummiboot.so gummiboot gummiboot$(MACHINE_TYPE_NAME).efi
+ 
+ install: all
+-	mkdir -p $(DESTDIR)/usr/bin/
+-	cp gummiboot $(DESTDIR)/usr/bin
+-	mkdir -p $(DESTDIR)/usr/lib/gummiboot/
+-	cp gummiboot$(MACHINE_TYPE_NAME).efi $(DESTDIR)/usr/lib/gummiboot/
+-	[ -e gummiboot.1 ] && mkdir -p $(DESTDIR)/usr/share/man/man1/ && cp gummiboot.1 $(DESTDIR)/usr/share/man/man1/ || :
++	mkdir -p $(DESTDIR)$(PREFIX)/bin/
++	cp gummiboot $(DESTDIR)$(PREFIX)/bin
++	mkdir -p $(DESTDIR)$(PREFIX)/lib/gummiboot/
++	cp gummiboot$(MACHINE_TYPE_NAME).efi $(DESTDIR)$(PREFIX)/lib/gummiboot/
++	[ -e gummiboot.1 ] && mkdir -p $(DESTDIR)$(PREFIX)/share/man/man1/ && cp gummiboot.1 $(DESTDIR)$(PREFIX)/share/man/man1/ || :
+ 
+ tar:
+ 	git archive --format=tar --prefix=gummiboot-$(VERSION)/ $(VERSION) | xz > gummiboot-$(VERSION).tar.xz
+diff -Naur gummiboot-23-orig/src/setup/setup.c gummiboot-23/src/setup/setup.c
+--- gummiboot-23-orig/src/setup/setup.c	2013-02-20 00:55:44.000000000 -0500
++++ gummiboot-23/src/setup/setup.c	2013-02-21 11:57:43.295324700 -0500
+@@ -736,7 +736,7 @@
+         char *p = NULL, *q = NULL, *v = NULL;
+         int r;
+ 
+-        if (asprintf(&p, "/usr/lib/gummiboot/%s", name) < 0) {
++        if (asprintf(&p, PREFIX "/lib/gummiboot/%s", name) < 0) {
+                 fprintf(stderr, "Out of memory.\n");
+                 r = -ENOMEM;
+                 goto finish;
+@@ -791,9 +791,9 @@
+                         return r;
+         }
+ 
+-        d = opendir("/usr/lib/gummiboot");
++        d = opendir(PREFIX "/lib/gummiboot");
+         if (!d) {
+-                fprintf(stderr, "Failed to open /usr/lib/gummiboot: %m\n");
++                fprintf(stderr, "Failed to open " PREFIX "/lib/gummiboot: %m\n");
+                 return -errno;
+         }
+ 
diff --git a/pkgs/tools/misc/hddtemp/byteswap.patch b/pkgs/tools/misc/hddtemp/byteswap.patch
new file mode 100644
index 00000000000..7b0dddc2ae4
--- /dev/null
+++ b/pkgs/tools/misc/hddtemp/byteswap.patch
@@ -0,0 +1,28 @@
+diff -Nuar --exclude '*~' hddtemp-0.3-beta15.orig/src/sata.c hddtemp-0.3-beta15/src/sata.c
+--- hddtemp-0.3-beta15.orig/src/sata.c	2006-05-14 02:09:55.579437498 -0700
++++ hddtemp-0.3-beta15/src/sata.c	2006-05-14 02:06:08.495948437 -0700
+@@ -88,7 +88,9 @@
+     return strdup(_("unknown"));
+   else
+   {
++		//fprintf(stderr,"sata_model1=%s\n",identify + 54);
+     sata_fixstring(identify + 54, 24);
++		//fprintf(stderr,"sata_model2=%s\n",identify + 54);
+     return strdup(identify + 54);
+   }
+ }
+diff -Nuar --exclude '*~' hddtemp-0.3-beta15.orig/src/satacmds.c hddtemp-0.3-beta15/src/satacmds.c
+--- hddtemp-0.3-beta15.orig/src/satacmds.c	2006-05-14 02:09:40.983470339 -0700
++++ hddtemp-0.3-beta15/src/satacmds.c	2006-05-14 02:09:02.319557333 -0700
+@@ -98,7 +98,10 @@
+   /* convert from big-endian to host byte order */
+   for (p = end ; p != s;) {
+     unsigned short *pp = (unsigned short *) (p -= 2);
+-    *pp = ntohs(*pp);
++		char tmp = p[0];
++		p[0] = p[1];
++		p[1] = tmp;
++    //*pp = ntohs(*pp);
+   }
+ 
+   /* strip leading blanks */
diff --git a/pkgs/tools/misc/hddtemp/default.nix b/pkgs/tools/misc/hddtemp/default.nix
index 7db9324c281..df75e7b3389 100644
--- a/pkgs/tools/misc/hddtemp/default.nix
+++ b/pkgs/tools/misc/hddtemp/default.nix
@@ -7,20 +7,23 @@ stdenv.mkDerivation {
     url = http://download.savannah.nongnu.org/releases/hddtemp/hddtemp.db;
     sha256 = "1fr6qgns6qv7cr40lic5yqwkkc7yjmmgx8j0z6d93csg3smzhhya";
   };
-  
+
   src = fetchurl {
     url = http://download.savannah.nongnu.org/releases/hddtemp/hddtemp-0.3-beta15.tar.bz2;
     sha256 = "0nzgg4nl8zm9023wp4dg007z6x3ir60rwbcapr9ks2al81c431b1";
   };
 
+  # from Gentoo
+  patches = [ ./byteswap.patch ./dontwake.patch ./execinfo.patch ./satacmds.patch ];
+
   configurePhase =
     ''
       mkdir -p $out/nix-support
       cp $db $out/nix-support/hddtemp.db
       ./configure --prefix=$out --with-db-path=$out/nix-support/hddtemp.db
-    ''; 
+    '';
 
-  meta = { 
+  meta = {
     description = "Tool for displaying hard disk temperature";
     homepage = https://savannah.nongnu.org/projects/hddtemp/;
     license = "GPL2";
diff --git a/pkgs/tools/misc/hddtemp/dontwake.patch b/pkgs/tools/misc/hddtemp/dontwake.patch
new file mode 100644
index 00000000000..969da7a70e4
--- /dev/null
+++ b/pkgs/tools/misc/hddtemp/dontwake.patch
@@ -0,0 +1,20 @@
+--- hddtemp-0.3-beta15/src/sata.c	2012-07-01 16:35:01.681708074 +0200
++++ hddtemp-0.3-beta15/src/sata.c	2012-07-01 16:33:58.172109699 +0200
+@@ -125,6 +125,17 @@
+     dsk->fd = -1;
+     return GETTEMP_NOSENSOR;
+   }
++
++  switch(ata_get_powermode(dsk->fd)) {
++  case PWM_STANDBY:
++  case PWM_SLEEPING:
++    if (!wakeup)
++      return GETTEMP_DRIVE_SLEEP;
++  case PWM_UNKNOWN:
++  case PWM_ACTIVE: /* active or idle */
++  default:
++    break;
++  }
+   
+   /* get SMART values */
+   if(sata_enable_smart(dsk->fd) != 0) {
diff --git a/pkgs/tools/misc/hddtemp/execinfo.patch b/pkgs/tools/misc/hddtemp/execinfo.patch
new file mode 100644
index 00000000000..1e7239535d4
--- /dev/null
+++ b/pkgs/tools/misc/hddtemp/execinfo.patch
@@ -0,0 +1,21 @@
+--- hddtemp-0.3-beta15/configure.in~	2005-10-17 19:14:19 +0000
++++ hddtemp-0.3-beta15/configure.in	2006-12-11 18:23:22 +0000
+@@ -18,6 +18,7 @@
+ AC_HEADER_STDC
+ AC_CHECK_HEADERS(fcntl.h)
+ AC_CHECK_HEADERS(netinet/in.h)
++AC_CHECK_HEADERS(execinfo.h)
+ AC_CHECK_TYPE(in_addr_t, ,[AC_DEFINE_UNQUOTED([in_addr_t], [uint32_t], [Define to 'uint32_t' if <netinet/in.h> does not define.])], [#include <netinet/in.h>])
+ 
+ # Checks for typedefs, structures, and compiler characteristics.
+--- hddtemp-0.3-beta15/src/backtrace.c-orig	2006-12-11 18:20:41 +0000
++++ hddtemp-0.3-beta15/src/backtrace.c	2006-12-11 18:23:28 +0000
+@@ -18,7 +18,7 @@
+ 
+ #include <features.h>
+ 
+-#if defined(__i386__) && defined(__GLIBC__)
++#ifdef HAS_EXECINFO_H
+ 
+ #include <execinfo.h>
+ 
diff --git a/pkgs/tools/misc/hddtemp/satacmds.patch b/pkgs/tools/misc/hddtemp/satacmds.patch
new file mode 100644
index 00000000000..d67e0681f33
--- /dev/null
+++ b/pkgs/tools/misc/hddtemp/satacmds.patch
@@ -0,0 +1,26 @@
+diff -Naurp hddtemp-0.3-beta15-orig/src/satacmds.c hddtemp-0.3-beta15/src/satacmds.c
+--- hddtemp-0.3-beta15-orig/src/satacmds.c	2007-02-10 14:25:15.000000000 +0100
++++ hddtemp-0.3-beta15/src/satacmds.c	2007-02-10 14:26:53.000000000 +0100
+@@ -54,7 +54,6 @@ int sata_pass_thru(int device, unsigned 
+   unsigned char cdb[16];
+   unsigned char sense[32];
+   int dxfer_direction;
+-  int ret;
+   
+   memset(cdb, 0, sizeof(cdb));
+   cdb[0] = ATA_16;
+@@ -78,13 +77,7 @@ int sata_pass_thru(int device, unsigned 
+     cdb[6] = cmd[1];
+   cdb[14] = cmd[0];
+ 
+-  ret = scsi_SG_IO(device, cdb, sizeof(cdb), buffer, cmd[3] * 512, sense, sizeof(sense), dxfer_direction);
+- 
+-  /* Verify SATA magics */
+-  if (sense[0] != 0x72 || sense[7] != 0x0e || sense[9] != 0x0e || sense[10] != 0x00)
+-    return 1;		  
+-  else 
+-    return ret;
++  return scsi_SG_IO(device, cdb, sizeof(cdb), buffer, cmd[3] * 512, sense, sizeof(sense), dxfer_direction);
+ }
+ 
+ void sata_fixstring(unsigned char *s, int bytecount)
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index 0df4e0d7d4d..c8ba478af33 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -3,10 +3,10 @@
 , fetchurl
 }:
 stdenv.mkDerivation {
-  name = "hdf5";
+  name = "hdf5-1.8.10";
   src = fetchurl {
-    url = http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.5-patch1.tar.gz ;
-    sha256 = "919bb52a08fc5560c49fdc5ebd693b10b1e03eebbf44ad2e142c2e6cfd81f2b0";  			
+    url = http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.10-patch1.tar.gz;
+    sha256 = "08ad32fhnci6rdfn6mn3w9v1wcaxdcd326n3ljwkcq4dzhkh28qz";  			
   };
   buildInputs = [] ;
   
diff --git a/pkgs/tools/misc/idutils/default.nix b/pkgs/tools/misc/idutils/default.nix
index 4b81d48b027..b76b9a18715 100644
--- a/pkgs/tools/misc/idutils/default.nix
+++ b/pkgs/tools/misc/idutils/default.nix
@@ -8,6 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "1hmai3422iaqnp34kkzxdnywl7n7pvlxp11vrw66ybxn9wxg90c1";
   };
 
+  preConfigure =
+    ''
+       # Fix for building on Glibc 2.16.  Won't be needed once the
+       # gnulib in idutils is updated.
+       sed -i '/gets is a security hole/d' lib/stdio.in.h
+    '';
+
   buildInputs = stdenv.lib.optional stdenv.isLinux emacs;
 
   doCheck = true;
diff --git a/pkgs/tools/misc/ised/default.nix b/pkgs/tools/misc/ised/default.nix
index f5f9112639c..0a04886f64c 100644
--- a/pkgs/tools/misc/ised/default.nix
+++ b/pkgs/tools/misc/ised/default.nix
@@ -12,7 +12,7 @@ let
     baseName="ised";
     version="2.2.2";
     name="${baseName}-${version}";
-    url="mirror://sf/project/ised/${name}.tar.bz2";
+    url="mirror://sourceforge/project/ised/${name}.tar.bz2";
     hash="1nb1cnsbs2k3j9cy2kc2kg01rd7wf3jwxm62rwn1rjlc46nwdlmn";
   };
 in
diff --git a/pkgs/tools/misc/jdiskreport/builder.sh b/pkgs/tools/misc/jdiskreport/builder.sh
index 1e73b674c15..cdc5f94bde0 100644
--- a/pkgs/tools/misc/jdiskreport/builder.sh
+++ b/pkgs/tools/misc/jdiskreport/builder.sh
@@ -2,13 +2,14 @@ source $stdenv/setup
 
 unzip $src
 
-mkdir -p $out/jars
-mv */*.jar $out/jars
-jar=$(ls $out/jars/jdiskreport-*.jar)
+jar=$(ls */*.jar)
+
+mkdir -p $out/lib/java
+mv $jar $out/lib/java
 
 mkdir -p $out/bin
 cat > $out/bin/jdiskreport <<EOF
 #! $SHELL -e
-exec $jdk/bin/java -jar $jar
+exec $jre/bin/java -jar $out/lib/java/$(basename $jar)
 EOF
 chmod +x $out/bin/jdiskreport
diff --git a/pkgs/tools/misc/jdiskreport/default.nix b/pkgs/tools/misc/jdiskreport/default.nix
index 7a4de418a8c..2457668d5b0 100644
--- a/pkgs/tools/misc/jdiskreport/default.nix
+++ b/pkgs/tools/misc/jdiskreport/default.nix
@@ -1,22 +1,22 @@
-{ stdenv, fetchurl, unzip, jdk }:
+{ stdenv, fetchurl, unzip, jre }:
 
 stdenv.mkDerivation rec {
   name = "jdiskreport-1.4.0";
-  
+
   builder = ./builder.sh;
-  
+
   src = fetchurl {
     url = http://www.jgoodies.com/download/jdiskreport/jdiskreport-1_4_0.zip;
     sha256 = "0kx43480p89wlyza94lzqygqfafsdf964syc2c24q28y42psz4kd";
   };
-  
+
   buildInputs = [ unzip ];
-  
-  inherit jdk;
+
+  inherit jre;
 
   meta = {
     homepage = http://www.jgoodies.com/freeware/jdiskreport/;
     description = "A graphical utility to visualize disk usage";
     license = "unfree-redistributable";
-  };  
+  };
 }
diff --git a/pkgs/tools/misc/lockfile-progs/default.nix b/pkgs/tools/misc/lockfile-progs/default.nix
new file mode 100644
index 00000000000..41fca212158
--- /dev/null
+++ b/pkgs/tools/misc/lockfile-progs/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, liblockfile }:
+
+stdenv.mkDerivation rec {
+  _name   = "lockfile-progs";
+  version = "0.1.16";
+  name    = "${_name}-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/l/${_name}/${_name}_${version}.tar.gz";
+    sha256 = "0sca19mg0lk68ms6idy4vfp8dyjpcbq9f143v9qzjyk86bb34lgr";
+  };
+
+  buildInputs = [ liblockfile ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/man/man1
+    install -s bin/* $out/bin
+    install man/*.1 $out/man/man1
+  '';
+
+  meta = {
+    description = "Programs for locking and unlocking files and mailboxes";
+    homepage = http://packages.debian.org/sid/lockfile-progs;
+    license = "GPLv2";
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch b/pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch
deleted file mode 100644
index d6d55a02707..00000000000
--- a/pkgs/tools/misc/mc/mc-4.6.1-bash32-1.patch
+++ /dev/null
@@ -1,41 +0,0 @@
-Submitted By: Alexander E. Patrakov
-Date: 2007-01-19
-Initial Package Version: 4.6.1
-Origin: http://bugs.gentoo.org/show_bug.cgi?id=153925
-Upstream Status: aware of the problem
-Description: with bash-3.2, unpatched mc-4.6.1 refuses to go into directories
-containing underscores or other strange characters.
-
---- mc-4.6.1/src/subshell.c.000	2006-05-08 23:11:48.000000000 +0200
-+++ mc-4.6.1/src/subshell.c	2006-10-28 15:40:46.000000000 +0200
-@@ -745,29 +745,13 @@ subshell_name_quote (const char *s)
-     memcpy (d, cmd_start, len);
-     d += len;
- 
--    /*
--     * Print every character in octal format with the leading backslash.
--     * tcsh and zsh may require 4-digit octals, bash < 2.05b doesn't like them.
--     */
--    if (subshell_type == BASH) {
- 	for (; *s; s++) {
--	    /* Must quote numbers, so that they are not glued to octals */
- 	    if (isalpha ((unsigned char) *s)) {
- 		*d++ = (unsigned char) *s;
- 	    } else {
--		sprintf (d, "\\%03o", (unsigned char) *s);
--		d += 4;
--	    }
--	}
--    } else {
--	for (; *s; s++) {
--	    if (isalnum ((unsigned char) *s)) {
--		*d++ = (unsigned char) *s;
--	    } else {
- 		sprintf (d, "\\0%03o", (unsigned char) *s);
- 		d += 5;
- 	    }
--	}
-     }
- 
-     memcpy (d, common_end, sizeof (common_end));
-
diff --git a/pkgs/tools/misc/mc/mc-4.6.1-debian_fixes-1.patch b/pkgs/tools/misc/mc/mc-4.6.1-debian_fixes-1.patch
deleted file mode 100644
index 931b10b7b65..00000000000
--- a/pkgs/tools/misc/mc/mc-4.6.1-debian_fixes-1.patch
+++ /dev/null
@@ -1,12671 +0,0 @@
-Submitted By: Alexander E. Patrakov
-Date: 2007-01-19
-Initial Package Version: 4.6.1
-Origin: Debian
-Upstream Status: partially applied
-Description: This patch adds UTF-8 support to MC, enables recoding
-of FTP filenames, fixes 64-bit issues, mcedit segfaults, moves
-configuration files to /etc/mc, and contains other changes from the
-Debian mc package.
-
-diff -urN mc-4.6.1.orig/doc/mc.1.in mc-4.6.1/doc/mc.1.in
---- mc-4.6.1.orig/doc/mc.1.in	2005-06-08 18:27:06.000000000 +0600
-+++ mc-4.6.1/doc/mc.1.in	2007-01-19 18:33:58.000000000 +0500
-@@ -1377,7 +1377,7 @@
- but only if it is owned by user or root and is not world-writable.
- If no such file found, ~/.mc/menu is tried in the same way,
- and otherwise mc uses the default system-wide menu
--@prefix@/share/mc/mc.menu.
-+/etc/mc/mc.menu.
- .PP
- The format of the menu file is very simple. Lines that start with
- anything but space or tab are considered entries for the menu (in
-@@ -1903,7 +1903,7 @@
- At startup the Midnight Commander will try to load initialization
- information from the ~/.mc/ini file. If this file doesn't exist, it will
- load the information from the system-wide configuration file, located in
--@prefix@/share/mc/mc.ini. If the system-wide configuration file doesn't
-+/etc/mc/mc.ini. If the system-wide configuration file doesn't
- exist, MC uses the default settings.
- .PP
- The
-@@ -3235,7 +3235,7 @@
- .IP
- The help file for the program.
- .PP
--.I @prefix@/share/mc/mc.ext
-+.I /etc/mc/mc.ext
- .IP
- The default system-wide extensions file.
- .PP
-@@ -3244,12 +3244,12 @@
- User's own extension, view configuration and edit configuration
- file.  They override the contents of the system wide files if present.
- .PP
--.I @prefix@/share/mc/mc.ini
-+.I /etc/mc/mc.ini
- .IP
- The default system-wide setup for the Midnight Commander, used only if
- the user doesn't have his own ~/.mc/ini file.
- .PP
--.I @prefix@/share/mc/mc.lib
-+.I /etc/mc/mc.lib
- .IP
- Global settings for the Midnight Commander.  Settings in this file
- affect all users, whether they have ~/.mc/ini or not.  Currently, only
-@@ -3267,7 +3267,7 @@
- .IP
- This file contains the hints displayed by the program.
- .PP
--.I @prefix@/share/mc/mc.menu
-+.I /etc/mc/mc.menu
- .IP
- This file contains the default system-wide applications menu.
- .PP
-diff -urN mc-4.6.1.orig/doc/mcedit.1.in mc-4.6.1/doc/mcedit.1.in
---- mc-4.6.1.orig/doc/mcedit.1.in	2005-06-08 18:27:07.000000000 +0600
-+++ mc-4.6.1/doc/mcedit.1.in	2007-01-19 18:33:58.000000000 +0500
-@@ -464,12 +464,12 @@
- .IP
- The help file for the program.
- .PP
--.I @prefix@/share/mc/mc.ini
-+.I /etc/mc/mc.ini
- .IP
- The default system-wide setup for GNU Midnight Commander, used only if
- the user's own ~/.mc/ini file is missing.
- .PP
--.I @prefix@/share/mc/mc.lib
-+.I /etc/mc/mc.lib
- .IP
- Global settings for the Midnight Commander.  Settings in this file
- affect all users, whether they have ~/.mc/ini or not.
-diff -urN mc-4.6.1.orig/doc/mcview.1.in mc-4.6.1/doc/mcview.1.in
---- mc-4.6.1.orig/doc/mcview.1.in	2005-06-08 18:27:07.000000000 +0600
-+++ mc-4.6.1/doc/mcview.1.in	2007-01-19 18:33:58.000000000 +0500
-@@ -65,12 +65,12 @@
- .IP
- The help file for the program.
- .PP
--.I @prefix@/share/mc/mc.ini
-+.I /etc/mc/mc.ini
- .IP
- The default system-wide setup for GNU Midnight Commander, used only if
- the user's own ~/.mc/ini file is missing.
- .PP
--.I @prefix@/share/mc/mc.lib
-+.I /etc/mc/mc.lib
- .IP
- Global settings for the Midnight Commander.  Settings in this file
- affect all users, whether they have ~/.mc/ini or not.
-diff -urN mc-4.6.1.orig/edit/edit.c mc-4.6.1/edit/edit.c
---- mc-4.6.1.orig/edit/edit.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/edit.c	2007-01-19 18:33:58.000000000 +0500
-@@ -93,7 +93,7 @@
- 
- #ifndef NO_INLINE_GETBYTE
- 
--int edit_get_byte (WEdit * edit, long byte_index)
-+mc_wchar_t edit_get_byte (WEdit * edit, long byte_index)
- {
-     unsigned long p;
-     if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0)
-@@ -125,7 +125,7 @@
- 
-     edit->curs1 = 0;
-     edit->curs2 = 0;
--    edit->buffers2[0] = g_malloc (EDIT_BUF_SIZE);
-+    edit->buffers2[0] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- }
- 
- /*
-@@ -152,7 +152,7 @@
-     }
- 
-     if (!edit->buffers2[buf2])
--	edit->buffers2[buf2] = g_malloc (EDIT_BUF_SIZE);
-+	edit->buffers2[buf2] = g_malloc (EDIT_BUF_SIZE  * sizeof(mc_wchar_t));
- 
-     mc_read (file,
- 	     (char *) edit->buffers2[buf2] + EDIT_BUF_SIZE -
-@@ -162,7 +162,7 @@
-     for (buf = buf2 - 1; buf >= 0; buf--) {
- 	/* edit->buffers2[0] is already allocated */
- 	if (!edit->buffers2[buf])
--	    edit->buffers2[buf] = g_malloc (EDIT_BUF_SIZE);
-+	    edit->buffers2[buf] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- 	mc_read (file, (char *) edit->buffers2[buf], EDIT_BUF_SIZE);
-     }
- 
-@@ -242,9 +242,44 @@
- {
-     int c;
-     long i = 0;
--    while ((c = fgetc (f)) >= 0) {
-+#ifndef UTF8
-+    while ((c = fgetc (f)) != EOF) {
- 	edit_insert (edit, c);
- 	i++;
-+#else /* UTF8 */
-+    unsigned char buf[MB_LEN_MAX];
-+    int charpos = 0;
-+    mbstate_t mbs;
-+
-+    while ((c = fgetc (f)) != EOF) {
-+	mc_wchar_t wc;
-+	int size;
-+	int j;
-+
-+	buf[charpos++] = c;
-+
-+        memset (&mbs, 0, sizeof (mbs));
-+	size = mbrtowc(&wc, (char *)buf, charpos, &mbs);
-+
-+	if (size == -2) 
-+	    continue; /* incomplete */
-+
-+	else if (size >= 0) {
-+	    edit_insert (edit, wc);
-+	    i++;
-+	    charpos = 0;
-+	    continue;
-+	}
-+	else {
-+
-+		/* invalid  */
-+#ifdef __STDC_ISO_10646__
-+		for (j=0; j<charpos; j++)
-+		    edit_insert (edit, BINARY_CHAR_OFFSET + (mc_wchar_t)buf[j]);
-+#endif
-+		charpos = 0;
-+	}
-+#endif /* UTF8 */
-     }
-     return i;
- }
-@@ -252,9 +287,32 @@
- long edit_write_stream (WEdit * edit, FILE * f)
- {
-     long i;
-+#ifndef UTF8
-     for (i = 0; i < edit->last_byte; i++)
- 	if (fputc (edit_get_byte (edit, i), f) < 0)
- 	    break;
-+#else /* UTF8 */
-+    for (i = 0; i < edit->last_byte; i++) {
-+	mc_wchar_t wc = edit_get_byte (edit, i);
-+	int res;
-+	char tmpbuf[MB_LEN_MAX];
-+        mbstate_t mbs;
-+
-+        memset (&mbs, 0, sizeof (mbs));
-+
-+#ifdef __STDC_ISO_10646__ 
-+	if (wc >= BINARY_CHAR_OFFSET && wc < (BINARY_CHAR_OFFSET + 256)) {
-+	    res = 1;
-+	    tmpbuf[0] = (char) (wc - BINARY_CHAR_OFFSET);
-+	} else
-+#endif
-+	res = wcrtomb(tmpbuf, wc, &mbs);
-+	if (res > 0) {
-+	    if (fwrite(tmpbuf, res, 1, f) != 1)
-+		break;
-+	}
-+    }
-+#endif /* UTF8 */
-     return i;
- }
- 
-@@ -294,12 +352,46 @@
- 	int i, file, blocklen;
- 	long current = edit->curs1;
- 	unsigned char *buf;
-+#ifdef UTF8
-+	mbstate_t mbs;
-+	int bufstart = 0;
-+
-+	memset (&mbs, 0, sizeof (mbs));
-+#endif /* UTF8 */
- 	if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1)
- 	    return 0;
- 	buf = g_malloc (TEMP_BUF_LEN);
-+#ifndef UTF8
- 	while ((blocklen = mc_read (file, (char *) buf, TEMP_BUF_LEN)) > 0) {
- 	    for (i = 0; i < blocklen; i++)
- 		edit_insert (edit, buf[i]);
-+#else /* UTF8 */
-+	while ((blocklen = mc_read (file, (char *) buf + bufstart, TEMP_BUF_LEN - bufstart)) > 0) {
-+	    blocklen += bufstart;
-+	    bufstart = 0;
-+	    for (i = 0; i < blocklen; ) {
-+		mc_wchar_t wc;
-+		int j;
-+	        int size = mbrtowc(&wc, (char *)buf + i, blocklen - i, &mbs);
-+		if (size == -2) { /*incomplete char*/
-+		    bufstart = blocklen - i;
-+		    memcpy(buf, buf+i, bufstart);
-+		    i = blocklen;
-+		    memset (&mbs, 0, sizeof (mbs));
-+		}
-+		else if (size <= 0) {
-+#ifdef __STDC_ISO_10646__
-+		    edit_insert (edit, BINARY_CHAR_OFFSET + (mc_wchar_t)buf[i]);
-+#endif
-+		    memset (&mbs, 0, sizeof (mbs));
-+		    i++; /* skip broken char */
-+		}
-+		else {
-+		    edit_insert (edit, wc);
-+		    i+=size;
-+		}
-+	    }
-+#endif /* UTF8 */
- 	}
- 	edit_cursor_move (edit, current - edit->curs1);
- 	g_free (buf);
-@@ -393,7 +485,11 @@
- static int
- edit_load_file (WEdit *edit)
- {
-+#ifndef UTF8
-     int fast_load = 1;
-+#else /* UTF8 */
-+    int fast_load = 0; /* can't be used with multibyte characters */
-+#endif /* UTF8 */
- 
-     /* Cannot do fast load if a filter is used */
-     if (edit_find_filter (edit->filename) >= 0)
-@@ -540,7 +636,7 @@
-     edit_set_filename (edit, filename);
-     edit->stack_size = START_STACK_SIZE;
-     edit->stack_size_mask = START_STACK_SIZE - 1;
--    edit->undo_stack = g_malloc ((edit->stack_size + 10) * sizeof (long));
-+    edit->undo_stack = g_malloc ((edit->stack_size + 10) * sizeof (struct action));
-     if (edit_load_file (edit)) {
- 	/* edit_load_file already gives an error message */
- 	if (to_free)
-@@ -565,7 +661,9 @@
- 	edit_move_display (edit, line - 1);
- 	edit_move_to_line (edit, line - 1);
-     }
--
-+#ifdef UTF8
-+    edit->charpoint = 0;
-+#endif
-     return edit;
- }
- 
-@@ -693,13 +791,23 @@
- {
-     unsigned long sp = edit->stack_pointer;
-     unsigned long spm1;
--    long *t;
-+  
-+    struct action *t; 
-+    mc_wchar_t ch = 0; 
-+
-+    if (c == CHAR_INSERT || c == CHAR_INSERT_AHEAD) { 
-+      va_list ap; 
-+      va_start (ap, c); 
-+      ch = va_arg (ap, mc_wint_t); 
-+      va_end (ap); 
-+    } 
-+
- /* first enlarge the stack if necessary */
-     if (sp > edit->stack_size - 10) {	/* say */
- 	if (option_max_undo < 256)
- 	    option_max_undo = 256;
- 	if (edit->stack_size < (unsigned long) option_max_undo) {
--	    t = g_realloc (edit->undo_stack, (edit->stack_size * 2 + 10) * sizeof (long));
-+	    t = g_realloc (edit->undo_stack, (edit->stack_size * 2 + 10) * sizeof (struct action));
- 	    if (t) {
- 		edit->undo_stack = t;
- 		edit->stack_size <<= 1;
-@@ -714,7 +822,7 @@
- #ifdef FAST_MOVE_CURSOR
-     if (c == CURS_LEFT_LOTS || c == CURS_RIGHT_LOTS) {
- 	va_list ap;
--	edit->undo_stack[sp] = c == CURS_LEFT_LOTS ? CURS_LEFT : CURS_RIGHT;
-+	edit->undo_stack[sp].flags = c == CURS_LEFT_LOTS ? CURS_LEFT : CURS_RIGHT;
- 	edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask;
- 	va_start (ap, c);
- 	c = -(va_arg (ap, int));
-@@ -725,12 +833,14 @@
- 	&& spm1 != edit->stack_bottom
- 	&& ((sp - 2) & edit->stack_size_mask) != edit->stack_bottom) {
- 	int d;
--	if (edit->undo_stack[spm1] < 0) {
--	    d = edit->undo_stack[(sp - 2) & edit->stack_size_mask];
--	    if (d == c) {
--		if (edit->undo_stack[spm1] > -1000000000) {
-+	mc_wchar_t d_ch;
-+	if (edit->undo_stack[spm1].flags < 0) {
-+	    d    = edit->undo_stack[(sp - 2) & edit->stack_size_mask].flags;
-+	    d_ch = edit->undo_stack[(sp - 2) & edit->stack_size_mask].ch;
-+	    if (d == c && d_ch == ch) {
-+		if (edit->undo_stack[spm1].flags > -1000000000) {
- 		    if (c < KEY_PRESS)	/* --> no need to push multiple do-nothings */
--			edit->undo_stack[spm1]--;
-+			edit->undo_stack[spm1].flags--;
- 		    return;
- 		}
- 	    }
-@@ -738,19 +848,20 @@
- #ifndef NO_STACK_CURSMOVE_ANIHILATION
- 	    else if ((c == CURS_LEFT && d == CURS_RIGHT)
- 		     || (c == CURS_RIGHT && d == CURS_LEFT)) {	/* a left then a right anihilate each other */
--		if (edit->undo_stack[spm1] == -2)
-+		if (edit->undo_stack[spm1].flags == -2)
- 		    edit->stack_pointer = spm1;
- 		else
--		    edit->undo_stack[spm1]++;
-+		    edit->undo_stack[spm1].flags++;
- 		return;
- 	    }
- #endif
- 	} else {
--	    d = edit->undo_stack[spm1];
--	    if (d == c) {
-+	    d    = edit->undo_stack[spm1].flags;
-+	    d_ch = edit->undo_stack[spm1].ch;
-+	    if (d == c && d_ch == ch) {
- 		if (c >= KEY_PRESS)
- 		    return;	/* --> no need to push multiple do-nothings */
--		edit->undo_stack[sp] = -2;
-+		edit->undo_stack[sp].flags = -2;
- 		goto check_bottom;
- 	    }
- #ifndef NO_STACK_CURSMOVE_ANIHILATION
-@@ -762,7 +873,9 @@
- #endif
- 	}
-     }
--    edit->undo_stack[sp] = c;
-+    edit->undo_stack[sp].flags = c;
-+    edit->undo_stack[sp].ch = ch;
-+
-   check_bottom:
- 
-     edit->stack_pointer = (edit->stack_pointer + 1) & edit->stack_size_mask;
-@@ -775,10 +888,10 @@
-        (((unsigned long) c + 1) & edit->stack_size_mask) == edit->stack_bottom)
- 	do {
- 	    edit->stack_bottom = (edit->stack_bottom + 1) & edit->stack_size_mask;
--	} while (edit->undo_stack[edit->stack_bottom] < KEY_PRESS && edit->stack_bottom != edit->stack_pointer);
-+	} while (edit->undo_stack[edit->stack_bottom].flags < KEY_PRESS && edit->stack_bottom != edit->stack_pointer);
- 
- /*If a single key produced enough pushes to wrap all the way round then we would notice that the [stack_bottom] does not contain KEY_PRESS. The stack is then initialised: */
--    if (edit->stack_pointer != edit->stack_bottom && edit->undo_stack[edit->stack_bottom] < KEY_PRESS)
-+    if (edit->stack_pointer != edit->stack_bottom && edit->undo_stack[edit->stack_bottom].flags < KEY_PRESS)
- 	edit->stack_bottom = edit->stack_pointer = 0;
- }
- 
-@@ -787,30 +900,30 @@
-    then the file should be as it was when he loaded up. Then set edit->modified to 0.
-  */
- static long
--pop_action (WEdit * edit)
-+pop_action (WEdit * edit, struct action *c)
- {
--    long c;
-     unsigned long sp = edit->stack_pointer;
-     if (sp == edit->stack_bottom) {
--	return STACK_BOTTOM;
-+	c->flags = STACK_BOTTOM;
-+	return c->flags;
-     }
-     sp = (sp - 1) & edit->stack_size_mask;
--    if ((c = edit->undo_stack[sp]) >= 0) {
--/*	edit->undo_stack[sp] = '@'; */
-+    *c = edit->undo_stack[sp];
-+    if (edit->undo_stack[sp].flags >= 0) {
- 	edit->stack_pointer = (edit->stack_pointer - 1) & edit->stack_size_mask;
--	return c;
-+	return c->flags;
-     }
-     if (sp == edit->stack_bottom) {
- 	return STACK_BOTTOM;
-     }
--    c = edit->undo_stack[(sp - 1) & edit->stack_size_mask];
--    if (edit->undo_stack[sp] == -2) {
--/*      edit->undo_stack[sp] = '@'; */
-+    *c = edit->undo_stack[(sp - 1) & edit->stack_size_mask];
-+
-+    if (edit->undo_stack[sp].flags == -2) {
- 	edit->stack_pointer = sp;
-     } else
--	edit->undo_stack[sp]++;
-+	edit->undo_stack[sp].flags++;
- 
--    return c;
-+    return c->flags;
- }
- 
- /* is called whenever a modification is made by one of the four routines below */
-@@ -831,7 +944,7 @@
-  */
- 
- void
--edit_insert (WEdit *edit, int c)
-+edit_insert (WEdit *edit, mc_wchar_t c)
- {
-     /* check if file has grown to large */
-     if (edit->last_byte >= SIZE_LIMIT)
-@@ -869,12 +982,11 @@
-     /* add a new buffer if we've reached the end of the last one */
-     if (!(edit->curs1 & M_EDIT_BUF_SIZE))
- 	edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] =
--	    g_malloc (EDIT_BUF_SIZE);
-+	    g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- 
-     /* perform the insertion */
--    edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit->
--						   curs1 & M_EDIT_BUF_SIZE]
--	= (unsigned char) c;
-+    edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE]
-+		    [edit->curs1 & M_EDIT_BUF_SIZE] = c;
- 
-     /* update file length */
-     edit->last_byte++;
-@@ -885,7 +997,7 @@
- 
- 
- /* same as edit_insert and move left */
--void edit_insert_ahead (WEdit * edit, int c)
-+void edit_insert_ahead (WEdit * edit, mc_wchar_t c)
- {
-     if (edit->last_byte >= SIZE_LIMIT)
- 	return;
-@@ -908,7 +1020,7 @@
-     edit->last_get_rule += (edit->last_get_rule >= edit->curs1);
- 
-     if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE))
--	edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE);
-+	edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
-     edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c;
- 
-     edit->last_byte++;
-@@ -918,7 +1030,7 @@
- 
- int edit_delete (WEdit * edit)
- {
--    int p;
-+    mc_wint_t p;
-     if (!edit->curs2)
- 	return 0;
- 
-@@ -942,7 +1054,7 @@
- 	edit->total_lines--;
- 	edit->force |= REDRAW_AFTER_CURSOR;
-     }
--    edit_push_action (edit, p + 256);
-+    edit_push_action (edit, CHAR_INSERT_AHEAD, p);
-     if (edit->curs1 < edit->start_display) {
- 	edit->start_display--;
- 	if (p == '\n')
-@@ -956,7 +1068,7 @@
- static int
- edit_backspace (WEdit * edit)
- {
--    int p;
-+    mc_wint_t p;
-     if (!edit->curs1)
- 	return 0;
- 
-@@ -980,7 +1092,7 @@
- 	edit->total_lines--;
- 	edit->force |= REDRAW_AFTER_CURSOR;
-     }
--    edit_push_action (edit, p);
-+    edit_push_action (edit, CHAR_INSERT, p);
- 
-     if (edit->curs1 < edit->start_display) {
- 	edit->start_display--;
-@@ -993,10 +1105,18 @@
- 
- #ifdef FAST_MOVE_CURSOR
- 
--static void memqcpy (WEdit * edit, unsigned char *dest, unsigned char *src, int n)
-+static void memqcpy (WEdit * edit, mc_wchar_t *dest, mc_wchar_t *src, int n)
- {
-     unsigned long next;
-+#ifndef UTF8
-     while ((next = (unsigned long) memccpy (dest, src, '\n', n))) {
-+#else /* UTF8 */
-+    while (n) {
-+	next = 0;
-+	while (next < n && src[next]!='\n') next++;
-+	if (next < n) next++;
-+        wmemcpy (dest, src, next)
-+#endif /* UTF8 */
- 	edit->curs_line--;
- 	next -= (unsigned long) dest;
- 	n -= next;
-@@ -1009,7 +1129,7 @@
- edit_move_backward_lots (WEdit *edit, long increment)
- {
-     int r, s, t;
--    unsigned char *p;
-+    mc_wchar_t *p;
- 
-     if (increment > edit->curs1)
- 	increment = edit->curs1;
-@@ -1049,7 +1169,7 @@
- 	    edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p;
- 	else
- 	    edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] =
--		g_malloc (EDIT_BUF_SIZE);
-+		g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
-     } else {
- 	g_free (p);
-     }
-@@ -1087,7 +1207,7 @@
- 		edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] = p;
- 	    else
- 		edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE] =
--		    g_malloc (EDIT_BUF_SIZE);
-+		    g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- 	} else {
- 	    g_free (p);
- 	}
-@@ -1119,7 +1239,7 @@
- 
- 	    c = edit_get_byte (edit, edit->curs1 - 1);
- 	    if (!((edit->curs2 + 1) & M_EDIT_BUF_SIZE))
--		edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE);
-+		edit->buffers2[(edit->curs2 + 1) >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- 	    edit->buffers2[edit->curs2 >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (edit->curs2 & M_EDIT_BUF_SIZE) - 1] = c;
- 	    edit->curs2++;
- 	    c = edit->buffers1[(edit->curs1 - 1) >> S_EDIT_BUF_SIZE][(edit->curs1 - 1) & M_EDIT_BUF_SIZE];
-@@ -1144,7 +1264,7 @@
- 
- 	    c = edit_get_byte (edit, edit->curs1);
- 	    if (!(edit->curs1 & M_EDIT_BUF_SIZE))
--		edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE);
-+		edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE] = g_malloc (EDIT_BUF_SIZE * sizeof(mc_wchar_t));
- 	    edit->buffers1[edit->curs1 >> S_EDIT_BUF_SIZE][edit->curs1 & M_EDIT_BUF_SIZE] = c;
- 	    edit->curs1++;
- 	    c = edit->buffers2[(edit->curs2 - 1) >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - ((edit->curs2 - 1) & M_EDIT_BUF_SIZE) - 1];
-@@ -1251,7 +1371,7 @@
- 	q = edit->last_byte + 2;
- 
-     for (col = 0, p = current; p < q; p++) {
--	int c;
-+	mc_wchar_t c;
- 	if (cols != -10) {
- 	    if (col == cols)
- 		return p;
-@@ -1269,7 +1389,7 @@
- 	} else if (c < 32 || c == 127)
- 	    col += 2; /* Caret notation for control characters */
- 	else
--	    col++;
-+	    col += wcwidth(c);
-     }
-     return col;
- }
-@@ -1402,7 +1522,7 @@
- is_blank (WEdit *edit, long offset)
- {
-     long s, f;
--    int c;
-+    mc_wchar_t c;
-     s = edit_bol (edit, offset);
-     f = edit_eol (edit, offset) - 1;
-     while (s <= f) {
-@@ -1774,13 +1894,13 @@
- static void
- edit_do_undo (WEdit * edit)
- {
--    long ac;
-+    struct action ac;
-     long count = 0;
- 
-     edit->stack_disable = 1;	/* don't record undo's onto undo stack! */
- 
--    while ((ac = pop_action (edit)) < KEY_PRESS) {
--	switch ((int) ac) {
-+    while (pop_action (edit, &ac) < KEY_PRESS) {
-+	switch ((int) ac.flags) {
- 	case STACK_BOTTOM:
- 	    goto done_undo;
- 	case CURS_RIGHT:
-@@ -1801,31 +1921,33 @@
- 	case COLUMN_OFF:
- 	    column_highlighting = 0;
- 	    break;
-+	case CHAR_INSERT:
-+	    edit_insert (edit, ac.ch);
-+	    break;
-+	case CHAR_INSERT_AHEAD:
-+	    edit_insert_ahead (edit, ac.ch);
-+	    break;
- 	}
--	if (ac >= 256 && ac < 512)
--	    edit_insert_ahead (edit, ac - 256);
--	if (ac >= 0 && ac < 256)
--	    edit_insert (edit, ac);
- 
--	if (ac >= MARK_1 - 2 && ac < MARK_2 - 2) {
--	    edit->mark1 = ac - MARK_1;
-+	if (ac.flags >= MARK_1 - 2 && ac.flags < MARK_2 - 2) {
-+	    edit->mark1 = ac.flags - MARK_1;
- 	    edit->column1 = edit_move_forward3 (edit, edit_bol (edit, edit->mark1), 0, edit->mark1);
--	} else if (ac >= MARK_2 - 2 && ac < KEY_PRESS) {
--	    edit->mark2 = ac - MARK_2;
-+	} else if (ac.flags >= MARK_2 - 2 && ac.flags < KEY_PRESS) {
-+	    edit->mark2 = ac.flags - MARK_2;
- 	    edit->column2 = edit_move_forward3 (edit, edit_bol (edit, edit->mark2), 0, edit->mark2);
- 	}
- 	if (count++)
- 	    edit->force |= REDRAW_PAGE;		/* more than one pop usually means something big */
-     }
- 
--    if (edit->start_display > ac - KEY_PRESS) {
--	edit->start_line -= edit_count_lines (edit, ac - KEY_PRESS, edit->start_display);
-+    if (edit->start_display > ac.flags - KEY_PRESS) {
-+	edit->start_line -= edit_count_lines (edit, ac.flags - KEY_PRESS, edit->start_display);
- 	edit->force |= REDRAW_PAGE;
--    } else if (edit->start_display < ac - KEY_PRESS) {
--	edit->start_line += edit_count_lines (edit, edit->start_display, ac - KEY_PRESS);
-+    } else if (edit->start_display < ac.flags - KEY_PRESS) {
-+	edit->start_line += edit_count_lines (edit, edit->start_display, ac.flags - KEY_PRESS);
- 	edit->force |= REDRAW_PAGE;
-     }
--    edit->start_display = ac - KEY_PRESS;	/* see push and pop above */
-+    edit->start_display = ac.flags - KEY_PRESS;	/* see push and pop above */
-     edit_update_curs_row (edit);
- 
-   done_undo:;
-@@ -2102,7 +2224,7 @@
-  * passed as -1.  Commands are executed, and char_for_insertion is
-  * inserted at the cursor.
-  */
--void edit_execute_key_command (WEdit *edit, int command, int char_for_insertion)
-+void edit_execute_key_command (WEdit *edit, int command, mc_wint_t char_for_insertion)
- {
-     if (command == CK_Begin_Record_Macro) {
- 	edit->macro_i = 0;
-@@ -2137,7 +2259,7 @@
-    all of them. It also does not check for the Undo command.
-  */
- void
--edit_execute_cmd (WEdit *edit, int command, int char_for_insertion)
-+edit_execute_cmd (WEdit *edit, int command, mc_wint_t char_for_insertion)
- {
-     edit->force |= REDRAW_LINE;
- 
-@@ -2170,7 +2292,7 @@
-     }
- 
-     /* An ordinary key press */
--    if (char_for_insertion >= 0) {
-+    if (char_for_insertion != (mc_wint_t) -1) {
- 	if (edit->overwrite) {
- 	    if (edit_get_byte (edit, edit->curs1) != '\n')
- 		edit_delete (edit);
-diff -urN mc-4.6.1.orig/edit/editcmd.c mc-4.6.1/edit/editcmd.c
---- mc-4.6.1.orig/edit/editcmd.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/editcmd.c	2007-01-19 18:33:58.000000000 +0500
-@@ -24,7 +24,6 @@
- /* #define PIPE_BLOCKS_SO_READ_BYTE_BY_BYTE */
- 
- #include <config.h>
--#include <ctype.h>
- 
- #include "edit.h"
- #include "editlock.h"
-@@ -46,7 +45,7 @@
- #define edit_get_save_file(f,h) input_expand_dialog (h, _(" Enter file name: "), f)
- 
- struct selection {
--   unsigned char * text;
-+   mc_wchar_t *text;
-    int len;
- };
- 
-@@ -69,12 +68,16 @@
- #define MAX_REPL_LEN 1024
- 
- static int edit_save_cmd (WEdit *edit);
--static unsigned char *edit_get_block (WEdit *edit, long start,
-+static mc_wchar_t *edit_get_block (WEdit *edit, long start,
- 				      long finish, int *l);
- 
--static inline int my_lower_case (int c)
-+static inline mc_wchar_t my_lower_case (mc_wchar_t c)
- {
-+#ifndef UTF8
-     return tolower(c & 0xFF);
-+#else
-+    return towlower(c);
-+#endif    
- }
- 
- static const char *strcasechr (const unsigned char *s, int c)
-@@ -108,11 +111,11 @@
- #endif /* !HAVE_MEMMOVE */
- 
- /* #define itoa MY_itoa  <---- this line is now in edit.h */
--static char *
-+static mc_wchar_t *
- MY_itoa (int i)
- {
--    static char t[14];
--    char *s = t + 13;
-+    static mc_wchar_t t[14];
-+    mc_wchar_t *s = t + 13;
-     int j = i;
-     *s-- = 0;
-     do {
-@@ -196,6 +199,48 @@
-     doupdate();
- }
- 
-+#ifdef UTF8
-+
-+static size_t
-+wchar_write(int fd, mc_wchar_t *buf, size_t len)
-+{
-+    char *tmpbuf = g_malloc(len + MB_LEN_MAX);
-+    mbstate_t mbs;
-+    size_t i;
-+    size_t outlen = 0;
-+    size_t res;
-+
-+    for (i = 0; i < len; i++) {
-+	if (outlen >= len) {
-+	    if ((res = mc_write(fd, tmpbuf, outlen)) != outlen) {
-+		g_free(tmpbuf);
-+		return -1;
-+	    }
-+	    outlen = 0;
-+	}
-+	memset (&mbs, 0, sizeof (mbs));
-+#ifdef __STDC_ISO_10646__ 
-+	if (buf[i] >= BINARY_CHAR_OFFSET && buf[i] < (BINARY_CHAR_OFFSET + 256)) {
-+	    res = 1;
-+	    tmpbuf[outlen] = (char) (buf[i] - BINARY_CHAR_OFFSET);
-+
-+	} else
-+#endif
-+	res = wcrtomb(tmpbuf + outlen, buf[i], &mbs);
-+	if (res > 0) {
-+	    outlen += res;
-+	}
-+    }
-+    if ((res = mc_write(fd, tmpbuf, outlen)) != outlen) {
-+	g_free(tmpbuf);
-+	return -1;
-+    }
-+    g_free(tmpbuf);
-+    return len;
-+}
-+
-+#endif /* UTF8 */
-+
- /*  If 0 (quick save) then  a) create/truncate <filename> file,
- 			    b) save to <filename>;
-     if 1 (safe save) then   a) save to <tempnam>,
-@@ -225,7 +270,7 @@
-     }
- 
-     if (!vfs_file_is_local (filename) ||
--	(fd = mc_open (filename, O_WRONLY | O_BINARY)) == -1) {
-+	(fd = mc_open (filename, O_RDONLY | O_BINARY)) == -1) {
- 	/*
- 	 * The file does not exists yet, so no safe save or
- 	 * backup are necessary.
-@@ -303,32 +348,48 @@
- 	buf = 0;
- 	filelen = edit->last_byte;
- 	while (buf <= (edit->curs1 >> S_EDIT_BUF_SIZE) - 1) {
-+#ifndef UTF8
- 	    if (mc_write (fd, (char *) edit->buffers1[buf], EDIT_BUF_SIZE)
-+#else /* UTF8 */
-+	    if (wchar_write (fd, edit->buffers1[buf], EDIT_BUF_SIZE)
-+#endif /* UTF8 */
- 		!= EDIT_BUF_SIZE) {
- 		mc_close (fd);
- 		goto error_save;
- 	    }
- 	    buf++;
- 	}
-+#ifndef UTF8
- 	if (mc_write
- 	    (fd, (char *) edit->buffers1[buf],
-+#else /* UTF8 */
-+	if (wchar_write
-+	    (fd, edit->buffers1[buf],
-+#endif /* UTF8 */
- 	     edit->curs1 & M_EDIT_BUF_SIZE) !=
- 	    (edit->curs1 & M_EDIT_BUF_SIZE)) {
- 	    filelen = -1;
- 	} else if (edit->curs2) {
- 	    edit->curs2--;
- 	    buf = (edit->curs2 >> S_EDIT_BUF_SIZE);
--	    if (mc_write
--		(fd,
--		 (char *) edit->buffers2[buf] + EDIT_BUF_SIZE -
-+#ifndef UTF8
-+	    if (mc_write(fd, (char *) edit->buffers2[buf] + EDIT_BUF_SIZE -
-+#else /* UTF8 */
-+	    if (wchar_write(fd, edit->buffers2[buf] + EDIT_BUF_SIZE -
-+#endif /* UTF8 */
- 		 (edit->curs2 & M_EDIT_BUF_SIZE) - 1,
- 		 1 + (edit->curs2 & M_EDIT_BUF_SIZE)) !=
- 		1 + (edit->curs2 & M_EDIT_BUF_SIZE)) {
- 		filelen = -1;
- 	    } else {
- 		while (--buf >= 0) {
-+#ifndef UTF8
- 		    if (mc_write
- 			(fd, (char *) edit->buffers2[buf],
-+#else /* UTF8 */
-+		    if (wchar_write
-+			(fd, edit->buffers2[buf],
-+#endif /* UTF8 */
- 			 EDIT_BUF_SIZE) != EDIT_BUF_SIZE) {
- 			filelen = -1;
- 			break;
-@@ -643,13 +704,21 @@
- 	if (!n || n == EOF)
- 	    break;
- 	n = 0;
-+#ifndef UTF8
- 	while (fscanf (f, "%hd %hd, ", &macro[n].command, &macro[n].ch))
-+#else /* UTF8 */
-+	while (fscanf (f, "%hd %lu, ", &macro[n].command, &macro[n].ch))
-+#endif /* UTF8 */
- 	    n++;
- 	fscanf (f, ";\n");
- 	if (s != k) {
- 	    fprintf (g, ("key '%d 0': "), s);
- 	    for (i = 0; i < n; i++)
-+#ifndef UTF8
- 		fprintf (g, "%hd %hd, ", macro[i].command, macro[i].ch);
-+#else /* UTF8 */
-+		fprintf (g, "%hd %lu, ", macro[i].command, macro[i].ch);
-+#endif /* UTF8 */
- 	    fprintf (g, ";\n");
- 	}
-     }
-@@ -685,7 +754,11 @@
- 	if (f) {
- 	    fprintf (f, ("key '%d 0': "), s);
- 	    for (i = 0; i < n; i++)
-+#ifndef UTF8
- 		fprintf (f, "%hd %hd, ", macro[i].command, macro[i].ch);
-+#else /* UTF8 */
-+		fprintf (f, "%hd %lu, ", macro[i].command, macro[i].ch);
-+#endif /* UTF8 */
- 	    fprintf (f, ";\n");
- 	    fclose (f);
- 	    if (saved_macros_loaded) {
-@@ -734,10 +807,18 @@
- 		saved_macro[i++] = s;
- 	    if (!found) {
- 		*n = 0;
-+#ifndef UTF8
- 		while (*n < MAX_MACRO_LENGTH && 2 == fscanf (f, "%hd %hd, ", &macro[*n].command, &macro[*n].ch))
-+#else /* UTF8 */
-+		while (*n < MAX_MACRO_LENGTH && 2 == fscanf (f, "%hd %lu, ", &macro[*n].command, &macro[*n].ch))
-+#endif /* UTF8 */
- 		    (*n)++;
- 	    } else {
-+#ifndef UTF8
- 		while (2 == fscanf (f, "%hd %hd, ", &dummy.command, &dummy.ch));
-+#else /* UTF8 */
-+		while (2 == fscanf (f, "%hd %lu, ", &dummy.command, &dummy.ch));
-+#endif /* UTF8 */
- 	    }
- 	    fscanf (f, ";\n");
- 	    if (s == k)
-@@ -886,7 +967,7 @@
- #define space_width 1
- 
- static void
--edit_insert_column_of_text (WEdit * edit, unsigned char *data, int size, int width)
-+edit_insert_column_of_text (WEdit * edit, mc_wchar_t *data, int size, int width)
- {
-     long cursor;
-     int i, col;
-@@ -934,7 +1015,7 @@
- {
-     long start_mark, end_mark, current = edit->curs1;
-     int size, x;
--    unsigned char *copy_buf;
-+    mc_wchar_t *copy_buf;
- 
-     edit_update_curs_col (edit);
-     x = edit->curs_col;
-@@ -979,7 +1060,7 @@
- {
-     long count;
-     long current;
--    unsigned char *copy_buf;
-+    mc_wchar_t *copy_buf;
-     long start_mark, end_mark;
-     int deleted = 0;
-     int x = 0;
-@@ -1040,7 +1121,7 @@
- 	edit_push_action (edit, COLUMN_ON);
- 	column_highlighting = 0;
-     } else {
--	copy_buf = g_malloc (end_mark - start_mark);
-+	copy_buf = g_malloc ((end_mark - start_mark) * sizeof(mc_wchar_t));
- 	edit_cursor_move (edit, start_mark - edit->curs1);
- 	edit_scroll_screen_over_cursor (edit);
- 	count = start_mark;
-@@ -1371,7 +1452,11 @@
- /* This function is a modification of mc-3.2.10/src/view.c:regexp_view_search() */
- /* returns -3 on error in pattern, -1 on not found, found_len = 0 if either */
- static int
-+#ifndef UTF8
- string_regexp_search (char *pattern, char *string, int len, int match_type,
-+#else /* UTF8 */
-+string_regexp_search (char *pattern, mc_wchar_t *wstring, int match_type,
-+#endif /* UTF8 */
- 		      int match_bol, int icase, int *found_len, void *d)
- {
-     static regex_t r;
-@@ -1380,6 +1465,11 @@
-     regmatch_t *pmatch;
-     static regmatch_t s[1];
- 
-+#ifdef UTF8
-+    char *string;
-+    int i;
-+#endif /* UTF8 */
-+
-     pmatch = (regmatch_t *) d;
-     if (!pmatch)
- 	pmatch = s;
-@@ -1399,13 +1489,51 @@
- 	old_type = match_type;
- 	old_icase = icase;
-     }
-+
-+#ifdef UTF8
-+    string = wchar_to_mbstr(wstring);
-+    if (string == NULL)
-+	return -1;
-+#endif /* UTF8 */
-+
-     if (regexec
- 	(&r, string, d ? NUM_REPL_ARGS : 1, pmatch,
- 	 ((match_bol
- 	   || match_type != match_normal) ? 0 : REG_NOTBOL)) != 0) {
- 	*found_len = 0;
-+
-+#ifdef UTF8
-+	g_free(string);
-+#endif /* UTF8 */
-+
- 	return -1;
-     }
-+
-+#ifdef UTF8
-+    for (i = 0; i < (d ? NUM_REPL_ARGS : 1); i++) {
-+	char tmp;
-+	int new_o;
-+
-+	if (pmatch[i].rm_so < 0)
-+	    continue;
-+	tmp = string[pmatch[i].rm_so];
-+	string[pmatch[i].rm_so] = 0;
-+	new_o = mbstrlen(string);
-+	string[pmatch[i].rm_so] = tmp;
-+	pmatch[i].rm_so = new_o; 
-+
-+	if (pmatch[i].rm_eo < 0)
-+	    continue;
-+	tmp = string[pmatch[i].rm_eo];
-+	string[pmatch[i].rm_eo] = 0;
-+	new_o = mbstrlen(string);
-+	string[pmatch[i].rm_eo] = tmp;
-+	pmatch[i].rm_eo = new_o; 
-+    }
-+
-+    g_free(string);
-+#endif /* UTF8 */
-+
-     *found_len = pmatch[0].rm_eo - pmatch[0].rm_so;
-     return (pmatch[0].rm_so);
- }
-@@ -1413,13 +1541,29 @@
- /* thanks to  Liviu Daia <daia@stoilow.imar.ro>  for getting this
-    (and the above) routines to work properly - paul */
- 
-+#ifndef UTF8
- typedef int (*edit_getbyte_fn) (WEdit *, long);
-+#else /* UTF8 */
-+typedef mc_wchar_t (*edit_getbyte_fn) (WEdit *, long);
-+#endif /* UTF8 */
- 
- static long
-+#ifndef UTF8
- edit_find_string (long start, unsigned char *exp, int *len, long last_byte, edit_getbyte_fn get_byte, void *data, int once_only, void *d)
-+#else /* UTF8 */
-+edit_find_string (long start, unsigned char *exp_mb, int *len, long last_byte, edit_getbyte_fn get_byte, void *data, int once_only, void *d)
-+#endif /* UTF8 */
- {
-     long p, q = 0;
--    long l = strlen ((char *) exp), f = 0;
-+    long f = 0;
-+
-+#ifndef UTF8
-+    long l = strlen ((char *) exp);
-+#else /* UTF8 */
-+    mc_wchar_t *exp = mbstr_to_wchar((char *)exp_mb);
-+    mc_wchar_t *exp_backup = exp;
-+    long l = wcslen(exp);
-+#endif /* UTF8 */
-     int n = 0;
- 
-     for (p = 0; p < l; p++)	/* count conversions... */
-@@ -1428,19 +1572,22 @@
- 		n++;
- 
-     if (replace_scanf || replace_regexp) {
--	int c;
--	unsigned char *buf;
--	unsigned char mbuf[MAX_REPL_LEN * 2 + 3];
-+	mc_wint_t c;
-+	mc_wchar_t *buf;
-+	mc_wchar_t mbuf[MAX_REPL_LEN * 2 + 3];
- 
- 	replace_scanf = (!replace_regexp);	/* can't have both */
- 
- 	buf = mbuf;
- 
- 	if (replace_scanf) {
--	    unsigned char e[MAX_REPL_LEN];
--	    if (n >= NUM_REPL_ARGS)
--		return -3;
--
-+	    mc_wchar_t e[MAX_REPL_LEN];
-+	    if (n >= NUM_REPL_ARGS) {
-+#ifdef UTF8
-+                g_free(exp_backup);
-+#endif /* UTF8 */
-+                return -3;
-+	    }
- 	    if (replace_case) {
- 		for (p = start; p < last_byte && p < start + MAX_REPL_LEN; p++)
- 		    buf[p - start] = (*get_byte) (data, p);
-@@ -1454,20 +1601,36 @@
- 	    }
- 
- 	    buf[(q = p - start)] = 0;
-+#ifndef UTF8
- 	    strcpy ((char *) e, (char *) exp);
- 	    strcat ((char *) e, "%n");
-+#else /* UTF8 */
-+	    wcscpy (e, exp);
-+	    wcscat (e, L"%n");
-+#endif /* UTF8 */
- 	    exp = e;
- 
- 	    while (q) {
- 		*((int *) sargs[n]) = 0;	/* --> here was the problem - now fixed: good */
-+#ifndef UTF8
- 		if (n == sscanf ((char *) buf, (char *) exp, SCANF_ARGS)) {
-+#else /* UTF8 */
-+		if (n == swscanf (buf, exp, SCANF_ARGS)) {
-+#endif /* UTF8 */
- 		    if (*((int *) sargs[n])) {
- 			*len = *((int *) sargs[n]);
-+#ifdef UTF8
-+			g_free(exp_backup);
-+#endif /* UTF8 */
- 			return start;
- 		    }
- 		}
--		if (once_only)
-+		if (once_only) {
-+#ifdef UTF8
-+		    g_free(exp_backup);
-+#endif /* UTF8 */
- 		    return -2;
-+		}
- 		if (q + start < last_byte) {
- 		    if (replace_case) {
- 			buf[q] = (*get_byte) (data, q + start);
-@@ -1481,7 +1644,11 @@
- 		start++;
- 		buf++;		/* move the window along */
- 		if (buf == mbuf + MAX_REPL_LEN) {	/* the window is about to go past the end of array, so... */
-+#ifndef UTF8
- 		    memmove (mbuf, buf, strlen ((char *) buf) + 1);	/* reset it */
-+#else /* UTF8 */
-+		    wmemmove (mbuf, buf, (wcslen (buf) + 1));	/* reset it */
-+#endif /* UTF8 */
- 		    buf = mbuf;
- 		}
- 		q--;
-@@ -1507,10 +1674,17 @@
- 
- 		buf = mbuf;
- 		while (q) {
-+#ifndef UTF8
- 		    found_start = string_regexp_search ((char *) exp, (char *) buf, q, match_normal, match_bol, !replace_case, len, d);
-+#else /* UTF8 */
-+                    found_start = string_regexp_search ((char *) exp_mb, buf, match_normal, match_bol, !replace_case, len, d);
-+#endif /* UTF8 */
- 
- 		    if (found_start <= -2) {	/* regcomp/regexec error */
- 			*len = 0;
-+#ifdef UTF8
-+                        g_free (exp_backup);
-+#endif /* UTF8 */
- 			return -3;
- 		    }
- 		    else if (found_start == -1)	/* not found: try next line */
-@@ -1521,15 +1695,27 @@
- 			match_bol = 0;
- 			continue;
- 		    }
--		    else	/* found */
-+		    else {	/* found */
-+#ifdef UTF8
-+			g_free(exp_backup);
-+#endif /* UTF8 */
- 			return (start + offset - q + found_start);
-+		    }
- 		}
--		if (once_only)
-+		if (once_only) {
-+#ifdef UTF8
-+		    g_free(exp_backup);
-+#endif /* UTF8 */
- 		    return -2;
-+		}
- 
- 		if (buf[q - 1] != '\n') { /* incomplete line: try to recover */
- 		    buf = mbuf + MAX_REPL_LEN / 2;
-+#ifndef UTF8
- 		    q = strlen ((const char *) buf);
-+#else /* UTF8 */
-+		    q = wcslen (buf);
-+#endif /* UTF8 */
- 		    memmove (mbuf, buf, q);
- 		    p = start + q;
- 		    move_win = 1;
-@@ -1539,36 +1725,59 @@
- 	    }
- 	}
-     } else {
-+#ifndef UTF8
-  	*len = strlen ((const char *) exp);
-+#else /* UTF8 */
-+        *len = wcslen (exp);
-+#endif /* UTF8 */
- 	if (replace_case) {
- 	    for (p = start; p <= last_byte - l; p++) {
-- 		if ((*get_byte) (data, p) == (unsigned char)exp[0]) {	/* check if first char matches */
-+                if ((*get_byte) (data, p) == exp[0]) {  /* check if first char matches */
- 		    for (f = 0, q = 0; q < l && f < 1; q++)
-- 			if ((*get_byte) (data, q + p) != (unsigned char)exp[q])
-+                        if ((*get_byte) (data, q + p) != exp[q])
- 			    f = 1;
--		    if (f == 0)
-+                    if (f == 0) {
-+#ifdef UTF8
-+                        g_free (exp_backup);
-+#endif /* UTF8 */
- 			return p;
-+		    }
- 		}
--		if (once_only)
-+                if (once_only) {
-+#ifdef UTF8
-+                    g_free(exp_backup);
-+#endif /* UTF8 */
- 		    return -2;
-+		}
- 	    }
- 	} else {
- 	    for (p = 0; exp[p] != 0; p++)
- 		exp[p] = my_lower_case (exp[p]);
- 
- 	    for (p = start; p <= last_byte - l; p++) {
--		if (my_lower_case ((*get_byte) (data, p)) == (unsigned char)exp[0]) {
-+                if (my_lower_case ((*get_byte) (data, p)) == exp[0]) {
- 		    for (f = 0, q = 0; q < l && f < 1; q++)
--			if (my_lower_case ((*get_byte) (data, q + p)) != (unsigned char)exp[q])
-+                        if (my_lower_case ((*get_byte) (data, q + p)) != exp[q])
- 			    f = 1;
--		    if (f == 0)
-+		    if (f == 0) {
-+#ifdef UTF8
-+                        g_free (exp_backup);
-+#endif /* UTF8 */
- 			return p;
-+		    }
- 		}
--		if (once_only)
-+		if (once_only) {
-+#ifdef UTF8
-+                    g_free (exp_backup);
-+#endif /* UTF8 */
- 		    return -2;
-+		}
- 	    }
- 	}
-     }
-+#ifdef UTF8
-+    g_free (exp_backup);
-+#endif /* UTF8 */
-     return -2;
- }
- 
-@@ -1582,9 +1791,14 @@
- 
-     while ((p = edit_find_string (p, exp, len, last_byte, get_byte, data, once_only, d)) >= 0) {
- 	if (replace_whole) {
-+#ifndef UTF8
- /*If the bordering chars are not in option_whole_chars_search then word is whole */
- 	    if (!strcasechr (option_whole_chars_search, (*get_byte) (data, p - 1))
- 		&& !strcasechr (option_whole_chars_search, (*get_byte) (data, p + *len)))
-+#else /* UTF8 */
-+	    if (!iswalnum((*get_byte) (data, p - 1))
-+		&& !iswalnum((*get_byte) (data, p + *len)))
-+#endif /* UTF8 */
- 		return p;
- 	    if (once_only)
- 		return -2;
-@@ -1616,6 +1830,7 @@
- 
- #define is_digit(x) ((x) >= '0' && (x) <= '9')
- 
-+#ifndef UTF8
- #define snprint(v) { \
- 		*p1++ = *p++; \
- 		*p1 = '\0'; \
-@@ -1623,33 +1838,48 @@
- 		if (n >= (size_t) (e - s)) goto nospc; \
- 		s += n; \
- 	    }
-+#else /* UTF8 */
-+#define snprint(v) { \
-+		*p1++ = *p++; \
-+		*p1 = '\0'; \
-+		n = swprintf(s, e-s, q1,v); \
-+		if (n >= (size_t) (e - s)) goto nospc; \
-+		s += n; \
-+	    }
-+#endif /* UTF8 */
- 
- /* this function uses the sprintf command to do a vprintf */
- /* it takes pointers to arguments instead of the arguments themselves */
- /* The return value is the number of bytes written excluding '\0'
-    if successfull, -1 if the resulting string would be too long and
-    -2 if the format string is errorneous.  */
--static int snprintf_p (char *str, size_t size, const char *fmt,...)
--    __attribute__ ((format (printf, 3, 4)));
--
--static int snprintf_p (char *str, size_t size, const char *fmt,...)
-+static int snprintf_p (mc_wchar_t *str, size_t size, const mc_wchar_t *fmt,...)
- {
-     va_list ap;
-     size_t n;
--    const char *q, *p;
--    char *s = str, *e = str + size;
--    char q1[40];
--    char *p1;
-+    const mc_wchar_t *q, *p;
-+    mc_wchar_t *s = str, *e = str + size;
-+    mc_wchar_t q1[40];
-+
-+    mc_wchar_t *p1;
-     int nargs = 0;
- 
-     va_start (ap, fmt);
-     p = q = fmt;
- 
-+#ifndef UTF8
-     while ((p = strchr (p, '%'))) {
-+#else /* UTF8 */
-+    while ((p = wcschr (p, L'%'))) {
-+#endif /* UTF8 */
- 	n = p - q;
- 	if (n >= (size_t) (e - s))
- 	  goto nospc;
-+#ifndef UTF8
- 	memcpy (s, q, n);	/* copy stuff between format specifiers */
-+#else /* UTF8 */
-+	wmemcpy (s, q, n);	/* copy stuff between format specifiers */
-+#endif /* UTF8 */
- 	s += n;
- 	q = p;
- 	p1 = q1;
-@@ -1677,45 +1907,78 @@
- 	    *p1++ = *p++;
- 	if (*p == '*') {
- 	    p++;
-+#ifndef UTF8
- 	    strcpy (p1, MY_itoa (*va_arg (ap, int *)));	/* replace field width with a number */
- 	    p1 += strlen (p1);
-+#else /* UTF8 */
-+	    wcscpy (p1, MY_itoa (*va_arg (ap, int *)));	/* replace field width with a number */
-+	    p1 += wcslen (p1);
-+#endif /* UTF8 */
- 	} else {
--	    while (is_digit (*p) && p1 < q1 + 20)
-+#ifndef UTF8
-+	    while (is_digit (*p)
-+#else /* UTF8 */
-+	    while (iswdigit (*p)
-+#endif /* UTF8 */
-+		    && p1 < q1 + 20)
- 		*p1++ = *p++;
--	    if (is_digit (*p))
-+#ifndef UTF8
-+	    if (is_digit (*p)) 
-+#else /* UTF8 */
-+	    if (iswdigit (*p))
-+#endif /* UTF8 */
- 		goto err;
- 	}
- 	if (*p == '.')
- 	    *p1++ = *p++;
- 	if (*p == '*') {
- 	    p++;
-+#ifndef UTF8
- 	    strcpy (p1, MY_itoa (*va_arg (ap, int *)));	/* replace precision with a number */
- 	    p1 += strlen (p1);
-+#else /* UTF8 */
-+	    wcscpy (p1, MY_itoa (*va_arg (ap, int *)));	/* replace precision with a number */
-+	    p1 += wcslen (p1);
-+#endif /* UTF8 */
- 	} else {
--	    while (is_digit (*p) && p1 < q1 + 32)
-+#ifndef UTF8
-+	    while (is_digit (*p)
-+#else /* UTF8 */
-+	    while (iswdigit (*p)
-+#endif /* UTF8 */
-+		&& p1 < q1 + 32)
- 		*p1++ = *p++;
--	    if (is_digit (*p))
-+#ifndef UTF8
-+	    if (is_digit (*p)) 
-+#else /* UTF8 */
-+	    if (iswdigit (*p))
-+#endif /* UTF8 */
- 		goto err;
- 	}
- /* flags done, now get argument */
- 	if (*p == 's') {
-+#ifndef UTF8
- 	    snprint (va_arg (ap, char *));
-+#else /* UTF8 */
-+	    *p1++ = 'l';
-+	    snprint (va_arg (ap, mc_wchar_t *));
-+#endif /* UTF8 */
- 	} else if (*p == 'h') {
--	    if (strchr ("diouxX", *p))
-+	    if (*p < 128 && strchr ("diouxX", *p))
- 		snprint (*va_arg (ap, short *));
- 	} else if (*p == 'l') {
- 	    *p1++ = *p++;
--	    if (strchr ("diouxX", *p))
-+	    if (*p < 128 && strchr ("diouxX", *p))
- 		snprint (*va_arg (ap, long *));
--	} else if (strchr ("cdiouxX", *p)) {
-+	} else if (*p < 128 && strchr ("cdiouxX", *p)) {
- 	    snprint (*va_arg (ap, int *));
- 	} else if (*p == 'L') {
- 	    *p1++ = *p++;
--	    if (strchr ("EefgG", *p))
-+	    if (*p < 128 && strchr ("EefgG", *p))
- 		snprint (*va_arg (ap, double *));	/* should be long double */
--	} else if (strchr ("EefgG", *p)) {
-+	} else if (*p < 128 && strchr ("EefgG", *p)) {
- 	    snprint (*va_arg (ap, double *));
--	} else if (strchr ("DOU", *p)) {
-+	} else if (*p < 128 && strchr ("DOU", *p)) {
- 	    snprint (*va_arg (ap, long *));
- 	} else if (*p == 'p') {
- 	    snprint (*va_arg (ap, void **));
-@@ -1724,10 +1987,17 @@
- 	q = p;
-     }
-     va_end (ap);
-+#ifndef UTF8
-     n = strlen (q);
-     if (n >= (size_t) (e - s))
- 	return -1;
-     memcpy (s, q, n + 1);
-+#else /* UTF8 */
-+    n = wcslen (q);
-+    if (n >= (size_t) (e - s))
-+	return -1;
-+    wmemcpy (s, q, n + 1);
-+#endif /* UTF8 */
-     return s + n - str;
- nospc:
-     va_end (ap);
-@@ -1902,8 +2172,11 @@
- 		}
- 	    }
- 	    if (replace_yes) {	/* delete then insert new */
-+#ifdef UTF8
-+		mc_wchar_t *winput2 = mbstr_to_wchar(exp2);
-+#endif /* UTF8 */
- 		if (replace_scanf || replace_regexp) {
--		    char repl_str[MAX_REPL_LEN + 2];
-+		    mc_wchar_t repl_str[MAX_REPL_LEN + 2];
- 		    int ret = 0;
- 
- 		    /* we need to fill in sargs just like with scanf */
-@@ -1912,17 +2185,25 @@
- 			for (k = 1;
- 			     k < NUM_REPL_ARGS && pmatch[k].rm_eo >= 0;
- 			     k++) {
-+#ifndef UTF8
- 			    unsigned char *t;
-+#else /* UTF8 */
-+			    mc_wchar_t *t;
-+#endif
- 
- 			    if (pmatch[k].rm_eo - pmatch[k].rm_so > 255) {
- 				ret = -1;
- 				break;
- 			    }
-+#ifndef UTF8
- 			    t = (unsigned char *) &sargs[k - 1][0];
-+#else /* UTF8 */
-+			    t = (mc_wchar_t *) &sargs[k - 1][0];
-+#endif /* UTF8 */
- 			    for (j = 0;
- 				 j < pmatch[k].rm_eo - pmatch[k].rm_so
- 				 && j < 255; j++, t++)
--				*t = (unsigned char) edit_get_byte (edit,
-+				*t = edit_get_byte (edit,
- 								    edit->
- 								    search_start
- 								    -
-@@ -1939,13 +2220,22 @@
- 			    sargs[k - 1][0] = 0;
- 		    }
- 		    if (!ret)
-+#ifndef UTF8
- 			ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, exp2, PRINTF_ARGS);
-+#else /* UTF8 */
-+                        ret = snprintf_p (repl_str, MAX_REPL_LEN + 2, winput2, PRINTF_ARGS);
-+#endif /* UTF8 */
- 		    if (ret >= 0) {
- 			times_replaced++;
- 			while (i--)
- 			    edit_delete (edit);
-+#ifndef UTF8
- 			while (repl_str[++i])
- 			    edit_insert (edit, repl_str[i]);
-+#else /* UTF8 */
-+                        while (winput2[++i])
-+                            edit_insert (edit, winput2[i]);
-+#endif /* UTF8 */
- 		    } else {
- 			edit_error_dialog (_(" Replace "),
- 					   ret == -2
-@@ -1957,10 +2247,18 @@
- 		    times_replaced++;
- 		    while (i--)
- 			edit_delete (edit);
-+#ifndef UTF8
- 		    while (exp2[++i])
- 			edit_insert (edit, exp2[i]);
-+#else /* UTF8 */
-+                    while (winput2[++i])
-+                        edit_insert (edit, winput2[i]);
-+#endif
- 		}
- 		edit->found_len = i;
-+#ifdef UTF8
-+                g_free (winput2);
-+#endif /* UTF8 */
- 	    }
- 	    /* so that we don't find the same string again */
- 	    if (replace_backwards) {
-@@ -2132,16 +2430,17 @@
- #define TEMP_BUF_LEN 1024
- 
- /* Return a null terminated length of text. Result must be g_free'd */
--static unsigned char *
-+static mc_wchar_t *
- edit_get_block (WEdit *edit, long start, long finish, int *l)
- {
--    unsigned char *s, *r;
--    r = s = g_malloc (finish - start + 1);
-+    mc_wchar_t *s, *r;
-+    r = s = g_malloc ((finish - start + 1) * sizeof(mc_wchar_t));
-     if (column_highlighting) {
- 	*l = 0;
- 	/* copy from buffer, excluding chars that are out of the column 'margins' */
- 	while (start < finish) {
--	    int c, x;
-+	    mc_wchar_t c;
-+	    int x;
- 	    x = edit_move_forward3 (edit, edit_bol (edit, start), 0,
- 				    start);
- 	    c = edit_get_byte (edit, start);
-@@ -2174,11 +2473,15 @@
- 	return 0;
- 
-     if (column_highlighting) {
--	unsigned char *block, *p;
-+	mc_wchar_t *block, *p;
- 	int r;
- 	p = block = edit_get_block (edit, start, finish, &len);
- 	while (len) {
-+#ifndef UTF8
- 	    r = mc_write (file, p, len);
-+#else /* UTF8 */
-+	    r = wchar_write (file, p, len);
-+#endif /* UTF8 */
- 	    if (r < 0)
- 		break;
- 	    p += r;
-@@ -2186,15 +2489,19 @@
- 	}
- 	g_free (block);
-     } else {
--	unsigned char *buf;
-+	mc_wchar_t *buf;
- 	int i = start, end;
- 	len = finish - start;
--	buf = g_malloc (TEMP_BUF_LEN);
-+	buf = g_malloc (TEMP_BUF_LEN * sizeof(mc_wchar_t));
- 	while (start != finish) {
- 	    end = min (finish, start + TEMP_BUF_LEN);
- 	    for (; i < end; i++)
- 		buf[i - start] = edit_get_byte (edit, i);
-+#ifndef UTF8
- 	    len -= mc_write (file, (char *) buf, end - start);
-+#else /* UTF8 */
-+	    len -= wchar_write (file, buf, end - start);
-+#endif /* UTF8 */
- 	    start = end;
- 	}
- 	g_free (buf);
-@@ -2531,17 +2838,20 @@
- 
- /* prints at the cursor */
- /* returns the number of chars printed */
-+#ifndef UTF8
- int edit_print_string (WEdit * e, const char *s)
-+#else /* UTF8 */
-+int edit_print_wstring (WEdit * e, mc_wchar_t *s)
-+#endif /* UTF8 */
- {
-     int i = 0;
-     while (s[i])
--	edit_execute_cmd (e, -1, (unsigned char) s[i++]);
-+	edit_execute_cmd (e, -1, s[i++]);
-     e->force |= REDRAW_COMPLETELY;
-     edit_update_screen (e);
-     return i;
- }
- 
--
- static void pipe_mail (WEdit *edit, char *to, char *subject, char *cc)
- {
-     FILE *p = 0;
-@@ -2635,15 +2945,20 @@
- /* find first character of current word */
- static int edit_find_word_start (WEdit *edit, long *word_start, int *word_len)
- {
--    int i, c, last;
-+    int i;
-+    mc_wint_t c, last;
-     
- /* return if at begin of file */
-     if (edit->curs1 <= 0)
- 	return 0;
- 
--    c = (unsigned char) edit_get_byte (edit, edit->curs1 - 1);
-+    c = edit_get_byte (edit, edit->curs1 - 1);
- /* return if not at end or in word */
-+#ifndef UTF8
-     if (isspace (c) || !(isalnum (c) || c == '_'))
-+#else /* UTF8 */
-+    if (iswspace (c) || !(iswalnum (c) || c == '_'))
-+#endif /* UTF8 */
- 	return 0; 
- 
- /* search start of word to be completed */
-@@ -2653,11 +2968,19 @@
- 	    return 0;
- 	    
- 	last = c;
--	c = (unsigned char) edit_get_byte (edit, edit->curs1 - i);
-+	c = edit_get_byte (edit, edit->curs1 - i);
- 
-+#ifndef UTF8
- 	if (!(isalnum (c) || c == '_')) {
-+#else /* UTF8 */
-+	if (!(iswalnum (c) || c == '_')) {
-+#endif /* UTF8 */
- /* return if word starts with digit */
-+#ifndef UTF8
- 	    if (isdigit (last))
-+#else /* UTF8 */
-+	    if (iswdigit (last))
-+#endif /* UTF8 */
- 		return 0;
- 
- 	    *word_start = edit->curs1 - (i - 1); /* start found */
-@@ -2690,7 +3013,7 @@
- 			  int *num)
- {
-     int len, max_len = 0, i, skip;
--    char *bufpos;
-+    mc_wchar_t *bufpos;
- 
-     /* collect max MAX_WORD_COMPLETIONS completions */
-     while (*num < MAX_WORD_COMPLETIONS) {
-@@ -2711,9 +3034,16 @@
- 	    buffers1[start >> S_EDIT_BUF_SIZE][start & M_EDIT_BUF_SIZE];
- 	skip = 0;
- 	for (i = 0; i < *num; i++) {
-+#ifndef UTF8
- 	    if (strncmp
- 		(&compl[i].text[word_len], &bufpos[word_len],
--		 max (len, compl[i].len) - word_len) == 0) {
-+		 max (len,
-+#else /* UTF8 */
-+            if (wcsncmp
-+                ((wchar_t *) &compl[i].text[word_len],
-+                 (wchar_t *) &bufpos[word_len], max (len,
-+#endif /* UTF8 */
-+                 compl[i].len) - word_len) == 0) {
- 		skip = 1;
- 		break;		/* skip it, already added */
- 	    }
-@@ -2721,7 +3051,7 @@
- 	if (skip)
- 	    continue;
- 
--	compl[*num].text = g_malloc (len + 1);
-+	compl[*num].text = g_malloc ((len + 1) * sizeof(mc_wchar_t));
- 	compl[*num].len = len;
- 	for (i = 0; i < len; i++)
- 	    compl[*num].text[i] = *(bufpos + i);
-@@ -2735,6 +3065,18 @@
-     return max_len;
- }
- 
-+#ifdef UTF8
-+int edit_print_string (WEdit * e, const char *s)
-+{
-+    int i;
-+    mc_wchar_t *ws = mbstr_to_wchar(s);
-+    i = edit_print_wstring (e, ws);
-+    g_free(ws);
-+    return i;
-+}
-+
-+#endif /* UTF8 */
-+
- 
- /* let the user select its preferred completion */
- static void
-@@ -2747,6 +3089,10 @@
-     WListbox *compl_list;
-     int compl_dlg_h;	/* completion dialog height */
-     int compl_dlg_w;	/* completion dialog width */
-+#ifdef UTF8
-+    char *mbtext;
-+#endif /* UTF8 */
-+
- 
-     /* calculate the dialog metrics */
-     compl_dlg_h = num_compl + 2;
-@@ -2782,8 +3128,16 @@
-     add_widget (compl_dlg, compl_list);
- 
-     /* fill the listbox with the completions */
-+#ifndef UTF8
-     for (i = 0; i < num_compl; i++)
- 	listbox_add_item (compl_list, 0, 0, compl[i].text, NULL);
-+#else /* UTF8 */
-+    for (i = 0; i < num_compl; i++) {
-+        mbtext = wchar_to_mbstr(compl[i].text);
-+        listbox_add_item (compl_list, 0, 0, mbtext, NULL);
-+        g_free(mbtext);
-+    }
-+#endif /* UTF8 */
- 
-     /* pop up the dialog */
-     run_dlg (compl_dlg);
-@@ -2791,9 +3145,17 @@
-     /* apply the choosen completion */
-     if (compl_dlg->ret_value == B_ENTER) {
- 	listbox_get_current (compl_list, &curr, NULL);
--	if (curr)
-+	if (curr){
-+#ifndef UTF8
- 	    for (curr += word_len; *curr; curr++)
- 		edit_insert (edit, *curr);
-+#else /* UTF8 */
-+	    mc_wchar_t *wc, *wccurr = mbstr_to_wchar(curr);
-+	    for (wc = wccurr + word_len; *wc; wc++)
-+		edit_insert (edit, *wc);
-+	    g_free(wccurr);
-+#endif /* UTF8 */
-+	}
-     }
- 
-     /* destroy dialog before return */
-@@ -2810,8 +3172,9 @@
- {
-     int word_len = 0, i, num_compl = 0, max_len;
-     long word_start = 0;
--    char *bufpos;
--    char *match_expr;
-+    mc_wchar_t *bufpos;
-+    mc_wchar_t *match_expr;
-+    char *mbmatch_expr;
-     struct selection compl[MAX_WORD_COMPLETIONS];	/* completions */
- 
-     /* don't want to disturb another search */
-@@ -2828,16 +3191,32 @@
-     /* prepare match expression */
-     bufpos = &edit->buffers1[word_start >> S_EDIT_BUF_SIZE]
- 	[word_start & M_EDIT_BUF_SIZE];
-+
-+    match_expr = g_malloc((word_len + 14) * sizeof(mc_wchar_t));
-+#ifndef UTF8
-     match_expr = g_strdup_printf ("%.*s[a-zA-Z_0-9]+", word_len, bufpos);
-+#else /* UTF8 */
-+    wcsncpy (match_expr, bufpos, word_len);
-+    match_expr[word_len] = '\0';
-+    wcscat (match_expr, L"[a-zA-Z_0-9]+");
-+#endif /* UTF8 */
- 
-     /* init search: backward, regexp, whole word, case sensitive */
-     edit_set_search_parameters (0, 1, 1, 1, 1);
- 
-     /* collect the possible completions              */
-     /* start search from curs1 down to begin of file */
-+#ifndef UTF8
-     max_len =
- 	edit_collect_completions (edit, word_start, word_len, match_expr,
- 				  (struct selection *) &compl, &num_compl);
-+#else /* UTF8 */
-+    mbmatch_expr = wchar_to_mbstr(match_expr);
-+    max_len =
-+	edit_collect_completions (edit, word_start, word_len, mbmatch_expr,
-+				  (struct selection *) &compl, &num_compl);
-+    g_free(mbmatch_expr);
-+#endif /* UTF8 */
- 
-     if (num_compl > 0) {
- 	/* insert completed word if there is only one match */
-diff -urN mc-4.6.1.orig/edit/editdraw.c mc-4.6.1/edit/editdraw.c
---- mc-4.6.1.orig/edit/editdraw.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/editdraw.c	2007-01-19 18:33:59.000000000 +0500
-@@ -48,7 +48,7 @@
- 
- static void status_string (WEdit * edit, char *s, int w)
- {
--    char byte_str[16];
-+    char byte_str[32];
- 
-     /*
-      * If we are at the end of file, print <EOF>,
-@@ -56,11 +56,16 @@
-      * as decimal and as hex.
-      */
-     if (edit->curs1 < edit->last_byte) {
--	unsigned char cur_byte = edit_get_byte (edit, edit->curs1);
-+        mc_wchar_t cur_byte = edit_get_byte (edit, edit->curs1);
-+#ifndef UTF8
- 	g_snprintf (byte_str, sizeof (byte_str), "%c %3d 0x%02X",
- 		    is_printable (cur_byte) ? cur_byte : '.',
--		    (int) cur_byte,
--		    (unsigned) cur_byte);
-+#else /* UTF8 */
-+        g_snprintf (byte_str, sizeof(byte_str), "%lc %3d 0x%02X",
-+                    iswprint(cur_byte) ? cur_byte : '.',
-+#endif /* UTF8 */
-+                    (int) cur_byte,
-+                    (unsigned) cur_byte);
-     } else {
- 	strcpy (byte_str, "<EOF>");
-     }
-@@ -183,11 +188,16 @@
- #define lowlevel_set_color(x) attrset(MY_COLOR_PAIR(color))
- #endif
- 
-+struct line_s {
-+    mc_wchar_t ch;
-+    unsigned int style;
-+};
-+
- static void
- print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
--		 long end_col, unsigned int line[])
-+		 long end_col, struct line_s line[])
- {
--    unsigned int *p;
-+    struct line_s *p;
- 
-     int x = start_col_real + EDIT_TEXT_HORIZONTAL_OFFSET;
-     int x1 = start_col + EDIT_TEXT_HORIZONTAL_OFFSET;
-@@ -201,9 +211,9 @@
-     edit_move (x1 + FONT_OFFSET_X, y + FONT_OFFSET_Y);
-     p = line;
- 
--    while (*p) {
-+    while (p->ch) {
- 	int style;
--	int textchar;
-+	mc_wchar_t textchar;
- 	int color;
- 
- 	if (cols_to_skip) {
-@@ -212,9 +222,9 @@
- 	    continue;
- 	}
- 
--	style = *p & 0xFF00;
--	textchar = *p & 0xFF;
--	color = *p >> 16;
-+	style = p->style & 0xFF00;
-+	textchar = p->ch;
-+	color = p->style >> 16;
- 
- 	if (style & MOD_ABNORMAL) {
- 	    /* Non-printable - use black background */
-@@ -228,8 +238,11 @@
- 	} else {
- 	    lowlevel_set_color (color);
- 	}
--
-+#ifdef UTF8
-+	SLsmg_write_nwchars(&textchar, 1);
-+#else
- 	addch (textchar);
-+#endif
- 	p++;
-     }
- }
-@@ -239,11 +252,11 @@
- edit_draw_this_line (WEdit *edit, long b, long row, long start_col,
- 		     long end_col)
- {
--    static unsigned int line[MAX_LINE_LEN];
--    unsigned int *p = line;
-+    struct line_s line[MAX_LINE_LEN];
-+    struct line_s *p = line;
-     long m1 = 0, m2 = 0, q, c1, c2;
-     int col, start_col_real;
--    unsigned int c;
-+    mc_wint_t c;
-     int color;
-     int i, book_mark = -1;
- 
-@@ -265,66 +278,96 @@
- 
- 	if (row <= edit->total_lines - edit->start_line) {
- 	    while (col <= end_col - edit->start_col) {
--		*p = 0;
-+		p->ch = 0;
-+		p->style = 0;
- 		if (q == edit->curs1)
--		    *p |= MOD_CURSOR;
-+		    p->style |= MOD_CURSOR;
- 		if (q >= m1 && q < m2) {
- 		    if (column_highlighting) {
- 			int x;
- 			x = edit_move_forward3 (edit, b, 0, q);
- 			if (x >= c1 && x < c2)
--			    *p |= MOD_MARKED;
-+			    p->style |= MOD_MARKED;
- 		    } else
--			*p |= MOD_MARKED;
-+			p->style |= MOD_MARKED;
- 		}
- 		if (q == edit->bracket)
--		    *p |= MOD_BOLD;
-+		    p->style |= MOD_BOLD;
- 		if (q >= edit->found_start
- 		    && q < edit->found_start + edit->found_len)
--		    *p |= MOD_BOLD;
-+		    p->style |= MOD_BOLD;
- 		c = edit_get_byte (edit, q);
- /* we don't use bg for mc - fg contains both */
- 		if (book_mark == -1) {
- 		    edit_get_syntax_color (edit, q, &color);
--		    *p |= color << 16;
-+		    p->style |= color << 16;
- 		} else {
--		    *p |= book_mark << 16;
-+		    p->style |= book_mark << 16;
- 		}
- 		q++;
- 		switch (c) {
- 		case '\n':
- 		    col = end_col - edit->start_col + 1;	/* quit */
--		    *(p++) |= ' ';
-+		    p->ch = ' ';
-+		    p++;
- 		    break;
- 		case '\t':
- 		    i = TAB_SIZE - ((int) col % TAB_SIZE);
--		    *p |= ' ';
--		    c = *(p++) & ~MOD_CURSOR;
-+		    p->ch = ' ';
-+		    c = p->style & ~MOD_CURSOR;
-+		    p++;
- 		    col += i;
--		    while (--i)
--			*(p++) = c;
-+		    while (--i) {
-+			p->ch = ' '; p->style = c;
-+			p++;
-+		    }
- 		    break;
- 		default:
- 		    c = convert_to_display_c (c);
- 
- 		    /* Caret notation for control characters */
- 		    if (c < 32) {
--			*(p++) = '^' | MOD_ABNORMAL;
--			*(p++) = (c + 0x40) | MOD_ABNORMAL;
-+		        p->ch = '^';
-+			p->style = MOD_ABNORMAL;
-+			p++;
-+		        p->ch = c + 0x40;
-+			p->style = MOD_ABNORMAL;
- 			col += 2;
- 			break;
- 		    }
- 		    if (c == 127) {
--			*(p++) = '^' | MOD_ABNORMAL;
--			*(p++) = '?' | MOD_ABNORMAL;
-+		        p->ch = '^';
-+			p->style = MOD_ABNORMAL;
-+			p++;
-+		        p->ch = '?';
-+			p->style = MOD_ABNORMAL;
-+			p++;
- 			col += 2;
- 			break;
- 		    }
- 
--		    if (is_printable (c)) {
--			*(p++) |= c;
-+#ifndef UTF8
-+		    if (is_printable (c)
-+#else /* UTF8 */
-+		    if (iswprint (c)
-+#ifdef __STDC_ISO_10646__ 
-+			&& (c < BINARY_CHAR_OFFSET || c >= (BINARY_CHAR_OFFSET + 256))
-+#endif
-+#endif /* UTF8 */
-+			) {
-+			p->ch = c;
-+			p++;
-+			
-+#ifdef UTF8
-+			i = wcwidth(c);
-+			if (i > 1) {
-+			    col += i - 1;
-+			}
-+#endif /* UTF8 */
- 		    } else {
--			*(p++) = '.' | MOD_ABNORMAL;
-+		        p->ch = '.';
-+			p->style = MOD_ABNORMAL;
-+			p++;
- 		    }
- 		    col++;
- 		    break;
-@@ -334,7 +377,7 @@
-     } else {
- 	start_col_real = start_col = 0;
-     }
--    *p = 0;
-+    p->ch = 0;
- 
-     print_to_widget (edit, row, start_col, start_col_real, end_col, line);
- }
-diff -urN mc-4.6.1.orig/edit/edit.h mc-4.6.1/edit/edit.h
---- mc-4.6.1.orig/edit/edit.h	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/edit.h	2007-01-19 18:33:58.000000000 +0500
-@@ -39,6 +39,27 @@
- 
- #include "../src/global.h"
- 
-+#include "src/tty.h"
-+
-+#ifdef UTF8
-+#include <wchar.h>
-+#include <wctype.h>
-+
-+#define mc_wchar_t wchar_t
-+#define mc_wint_t wint_t
-+
-+#else
-+
-+#define mc_wchar_t unsigned char
-+#define mc_wint_t int
-+
-+#endif
-+
-+
-+/* unicode private use area */
-+#define BINARY_CHAR_OFFSET 0xFFE00
-+
-+
- #define N_menus 5
- 
- #define SEARCH_DIALOG_OPTION_NO_SCANF	1
-@@ -99,6 +120,8 @@
- #define START_STACK_SIZE 32
- 
- /* Some codes that may be pushed onto or returned from the undo stack */
-+#define CHAR_INSERT 65
-+#define CHAR_INSERT_AHEAD 66
- #define CURS_LEFT 601
- #define CURS_RIGHT 602
- #define DELCHAR 603
-@@ -118,7 +141,7 @@
- 
- struct macro {
-     short command;
--    short ch;
-+    mc_wchar_t ch;
- };
- 
- struct WEdit;
-@@ -132,26 +155,8 @@
- void menu_save_mode_cmd (void);
- int edit_raw_key_query (const char *heading, const char *query, int cancel);
- int edit_file (const char *_file, int line);
--int edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch);
--
--#ifndef NO_INLINE_GETBYTE
--int edit_get_byte (WEdit * edit, long byte_index);
--#else
--static inline int edit_get_byte (WEdit * edit, long byte_index)
--{
--    unsigned long p;
--    if (byte_index >= (edit->curs1 + edit->curs2) || byte_index < 0)
--	return '\n';
--
--    if (byte_index >= edit->curs1) {
--	p = edit->curs1 + edit->curs2 - byte_index - 1;
--	return edit->buffers2[p >> S_EDIT_BUF_SIZE][EDIT_BUF_SIZE - (p & M_EDIT_BUF_SIZE) - 1];
--    } else {
--	return edit->buffers1[byte_index >> S_EDIT_BUF_SIZE][byte_index & M_EDIT_BUF_SIZE];
--    }
--}
--#endif
--
-+int edit_translate_key (WEdit *edit, long x_key, int *cmd, mc_wint_t *ch);
-+mc_wchar_t edit_get_byte (WEdit * edit, long byte_index);
- int edit_count_lines (WEdit * edit, long current, int upto);
- long edit_move_forward (WEdit * edit, long current, int lines, long upto);
- long edit_move_forward3 (WEdit * edit, long current, int cols, long upto);
-@@ -176,11 +181,11 @@
- void edit_delete_line (WEdit * edit);
- 
- int edit_delete (WEdit * edit);
--void edit_insert (WEdit * edit, int c);
-+void edit_insert (WEdit * edit, mc_wchar_t c);
- int edit_cursor_move (WEdit * edit, long increment);
- void edit_push_action (WEdit * edit, long c, ...);
- void edit_push_key_press (WEdit * edit);
--void edit_insert_ahead (WEdit * edit, int c);
-+void edit_insert_ahead (WEdit * edit, mc_wchar_t c);
- long edit_write_stream (WEdit * edit, FILE * f);
- char *edit_get_write_filter (const char *writename, const char *filename);
- int edit_save_confirm_cmd (WEdit * edit);
-@@ -212,7 +217,7 @@
- int eval_marks (WEdit * edit, long *start_mark, long *end_mark);
- void edit_status (WEdit * edit);
- void edit_execute_key_command (WEdit *edit, int command,
--			       int char_for_insertion);
-+			       mc_wint_t char_for_insertion);
- void edit_update_screen (WEdit * edit);
- int edit_print_string (WEdit * e, const char *s);
- void edit_move_to_line (WEdit * e, long line);
-@@ -256,7 +261,7 @@
- void format_paragraph (WEdit *edit, int force);
- 
- /* either command or char_for_insertion must be passed as -1 */
--void edit_execute_cmd (WEdit *edit, int command, int char_for_insertion);
-+void edit_execute_cmd (WEdit *edit, int command, mc_wint_t char_for_insertion);
- 
- #define get_sys_error(s) (s)
- 
-diff -urN mc-4.6.1.orig/edit/editkeys.c mc-4.6.1/edit/editkeys.c
---- mc-4.6.1.orig/edit/editkeys.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/editkeys.c	2007-01-19 18:33:59.000000000 +0500
-@@ -162,10 +162,10 @@
-  * 'command' is one of the editor commands from editcmddef.h.
-  */
- int
--edit_translate_key (WEdit *edit, long x_key, int *cmd, int *ch)
-+edit_translate_key (WEdit *edit, long x_key, int *cmd, mc_wint_t *ch)
- {
-     int command = CK_Insert_Char;
--    int char_for_insertion = -1;
-+    mc_wint_t char_for_insertion = -1;
-     int i = 0;
-     static const long *key_map;
- 
-@@ -205,7 +205,7 @@
- 
- #ifdef HAVE_CHARSET
-     if (x_key == XCTRL ('t')) {
--	do_select_codepage ();
-+	do_select_codepage (_(" Choose codepage "));
- 
- 	edit->force = REDRAW_COMPLETELY;
- 	command = CK_Refresh;
-@@ -242,9 +242,30 @@
-     /* an ordinary insertable character */
-     if (x_key < 256) {
- 	int c = convert_from_input_c (x_key);
--
-+#ifdef UTF8
-+	mbstate_t mbs;
-+	int res;
-+	mc_wchar_t wc;
-+    
-+	memset (&mbs, 0, sizeof (mbs));
-+
-+	if (edit->charpoint >= MB_CUR_MAX) edit->charpoint = 0;
-+
-+	edit->charbuf[edit->charpoint++] = c;
-+
-+	res = mbrtowc(&wc, (char *)edit->charbuf, edit->charpoint, &mbs);
-+	if (res < 0) {
-+	    if (res != -2) edit->charpoint = 0; /* broken multibyte char, skip */
-+    	    return 0;
-+        }
-+	edit->charpoint = 0;
-+
-+	if (iswprint (wc)) {
-+	    char_for_insertion = wc;
-+#else 
- 	if (is_printable (c)) {
- 	    char_for_insertion = c;
-+#endif /* UTF8 */
- 	    goto fin;
- 	}
-     }
-@@ -285,7 +306,7 @@
-     *cmd = command;
-     *ch = char_for_insertion;
- 
--    if (command == CK_Insert_Char && char_for_insertion == -1) {
-+    if (command == CK_Insert_Char && char_for_insertion == (mc_wint_t)-1) {
- 	/* unchanged, key has no function here */
- 	return 0;
-     }
-diff -urN mc-4.6.1.orig/edit/editwidget.c mc-4.6.1/edit/editwidget.c
---- mc-4.6.1.orig/edit/editwidget.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/editwidget.c	2007-01-19 18:33:58.000000000 +0500
-@@ -337,7 +337,8 @@
- 
-     case WIDGET_KEY:
- 	{
--	    int cmd, ch;
-+	    int cmd;
-+	    mc_wint_t ch;
- 
- 	    /* first check alt-f, alt-e, alt-s, etc for drop menus */
- 	    if (edit_drop_hotkey_menu (e, parm))
-diff -urN mc-4.6.1.orig/edit/edit-widget.h mc-4.6.1/edit/edit-widget.h
---- mc-4.6.1.orig/edit/edit-widget.h	2003-10-29 13:54:47.000000000 +0500
-+++ mc-4.6.1/edit/edit-widget.h	2007-01-19 18:33:58.000000000 +0500
-@@ -24,6 +24,11 @@
-     unsigned char border;
- };
- 
-+struct action {
-+    mc_wchar_t ch;
-+    long flags;
-+};
-+
- struct WEdit {
-     Widget widget;
- 
-@@ -36,8 +41,17 @@
-     /* dynamic buffers and cursor position for editor: */
-     long curs1;			/* position of the cursor from the beginning of the file. */
-     long curs2;			/* position from the end of the file */
-+#ifndef UTF8
-     unsigned char *buffers1[MAXBUFF + 1];	/* all data up to curs1 */
-     unsigned char *buffers2[MAXBUFF + 1];	/* all data from end of file down to curs2 */
-+#else /* UTF8 */
-+    mc_wchar_t *buffers1[MAXBUFF + 1];        /* all data up to curs1 */
-+    mc_wchar_t *buffers2[MAXBUFF + 1];        /* all data from end of file down to curs2 */
-+
-+    unsigned char charbuf[MB_LEN_MAX];
-+    int charpoint;
-+#endif /* UTF8 */
-+
- 
-     /* search variables */
-     long search_start;		/* First character to start searching from */
-@@ -81,7 +95,7 @@
- 
-     /* undo stack and pointers */
-     unsigned long stack_pointer;
--    long *undo_stack;
-+    struct action *undo_stack;
-     unsigned long stack_size;
-     unsigned long stack_size_mask;
-     unsigned long stack_bottom;
-@@ -92,6 +106,7 @@
-     /* syntax higlighting */
-     struct _syntax_marker *syntax_marker;
-     struct context_rule **rules;
-+    size_t rules_count;		/* number of rules that are defined */
-     long last_get_rule;
-     struct syntax_rule rule;
-     char *syntax_type;		/* description of syntax highlighting type being used */
-diff -urN mc-4.6.1.orig/edit/syntax.c mc-4.6.1/edit/syntax.c
---- mc-4.6.1.orig/edit/syntax.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/syntax.c	2007-01-19 18:33:58.000000000 +0500
-@@ -662,6 +662,7 @@
-     strcpy (whole_right, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_01234567890");
- 
-     r = edit->rules = g_malloc (alloc_contexts * sizeof (struct context_rule *));
-+    edit->rules_count = 0;
- 
-     if (!edit->defines)
- 	edit->defines = g_tree_new ((GCompareFunc) strcmp);
-@@ -892,6 +893,7 @@
-     if (num_contexts == -1) {
- 	return line;
-     }
-+    edit->rules_count = num_contexts;
- 
-     {
- 	char *first_chars, *p;
-@@ -916,17 +918,18 @@
- 
- void edit_free_syntax_rules (WEdit * edit)
- {
--    int i, j;
-+    size_t i, j;
-     if (!edit)
- 	return;
-     if (edit->defines)
- 	destroy_defines (&edit->defines);
-     if (!edit->rules)
- 	return;
--    edit_get_rule (edit, -1);
-+    if (edit->rules_count > 0)
-+	edit_get_rule (edit, -1);
-     syntax_g_free (edit->syntax_type);
-     edit->syntax_type = 0;
--    for (i = 0; edit->rules[i]; i++) {
-+    for (i = 0; i < edit->rules_count; i++) {
- 	if (edit->rules[i]->keyword) {
- 	    for (j = 0; edit->rules[i]->keyword[j]; j++) {
- 		syntax_g_free (edit->rules[i]->keyword[j]->keyword);
-diff -urN mc-4.6.1.orig/edit/wordproc.c mc-4.6.1/edit/wordproc.c
---- mc-4.6.1.orig/edit/wordproc.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/edit/wordproc.c	2007-01-19 18:33:58.000000000 +0500
-@@ -24,7 +24,12 @@
- 
- #define tab_width option_tab_spacing
- 
-+#ifndef UTF8
- #define NO_FORMAT_CHARS_START "-+*\\,.;:&>"
-+#else /* UTF8 */
-+#define NO_FORMAT_CHARS_START L"-+*\\,.;:&>"
-+#endif /* UTF8 */
-+
- #define FONT_MEAN_WIDTH 1
- 
- static long
-@@ -41,14 +46,21 @@
- 	p = edit_move_forward (edit, p, line - l, 0);
- 
-     p = edit_bol (edit, p);
-+
-+#ifndef UTF8
-     while (strchr ("\t ", edit_get_byte (edit, p)))
-+#else /* UTF8 */
-+    while (wcschr (L"\t ", edit_get_byte (edit, p)))
-+#endif /* UTF8 */
-+
- 	p++;
-     return p;
- }
- 
- static int bad_line_start (WEdit * edit, long p)
- {
--    int c;
-+    mc_wint_t c;
-+
-     c = edit_get_byte (edit, p);
-     if (c == '.') {		/* `...' is acceptable */
- 	if (edit_get_byte (edit, p + 1) == '.')
-@@ -62,7 +74,13 @@
- 		return 0;	/* `---' is acceptable */
- 	return 1;
-     }
-+    
-+#ifndef UTF8
-     if (strchr (NO_FORMAT_CHARS_START, c))
-+#else /* UTF8 */
-+    if (wcschr (NO_FORMAT_CHARS_START, c))
-+#endif /* UTF8 */
-+
- 	return 1;
-     return 0;
- }
-@@ -115,33 +133,37 @@
- 					i - edit->curs_line, 0));
- }
- 
--static unsigned char *
-+static mc_wchar_t *
- get_paragraph (WEdit *edit, long p, long q, int indent, int *size)
- {
--    unsigned char *s, *t;
-+    mc_wchar_t *s, *t;
- #if 0
--    t = g_malloc ((q - p) + 2 * (q - p) / option_word_wrap_line_length +
--		  10);
-+    t = g_malloc (((q - p) + 2 * (q - p) / option_word_wrap_line_length +
-+		  10) * sizeof(mc_wchar_t));
- #else
--    t = g_malloc (2 * (q - p) + 100);
-+    t = g_malloc ((2 * (q - p) + 100) * sizeof(mc_wchar_t));
- #endif
-     if (!t)
- 	return 0;
-     for (s = t; p < q; p++, s++) {
- 	if (indent)
- 	    if (edit_get_byte (edit, p - 1) == '\n')
-+#ifndef UTF8
- 		while (strchr ("\t ", edit_get_byte (edit, p)))
-+#else /* UTF8 */
-+		while (wcschr (L"\t ", edit_get_byte (edit, p)))
-+#endif /* UTF8 */
- 		    p++;
- 	*s = edit_get_byte (edit, p);
-     }
--    *size = (unsigned long) s - (unsigned long) t;
-+    *size = s - t;
-     t[*size] = '\n';
-     return t;
- }
- 
--static void strip_newlines (unsigned char *t, int size)
-+static void strip_newlines (mc_wchar_t *t, int size)
- {
--    unsigned char *p = t;
-+    mc_wchar_t *p = t;
-     while (size--) {
- 	*p = *p == '\n' ? ' ' : *p;
- 	p++;
-@@ -158,7 +180,7 @@
- {
-     return x += tab_width - x % tab_width;
- }
--static int line_pixel_length (unsigned char *t, long b, int l)
-+static int line_pixel_length (mc_wchar_t *t, long b, int l)
- {
-     int x = 0, c, xn = 0;
-     for (;;) {
-@@ -182,7 +204,7 @@
- }
- 
- /* find the start of a word */
--static int next_word_start (unsigned char *t, int q, int size)
-+static int next_word_start (mc_wchar_t *t, int q, int size)
- {
-     int i;
-     for (i = q;; i++) {
-@@ -203,7 +225,7 @@
- }
- 
- /* find the start of a word */
--static int word_start (unsigned char *t, int q, int size)
-+static int word_start (mc_wchar_t *t, int q, int size)
- {
-     int i = q;
-     if (t[q] == ' ' || t[q] == '\t')
-@@ -222,7 +244,7 @@
- }
- 
- /* replaces ' ' with '\n' to properly format a paragraph */
--static void format_this (unsigned char *t, int size, int indent)
-+static void format_this (mc_wchar_t *t, int size, int indent)
- {
-     int q = 0, ww;
-     strip_newlines (t, size);
-@@ -250,7 +272,7 @@
-     }
- }
- 
--static void replace_at (WEdit * edit, long q, int c)
-+static void replace_at (WEdit * edit, long q, mc_wint_t c)
- {
-     edit_cursor_move (edit, q - edit->curs1);
-     edit_delete (edit);
-@@ -258,18 +280,27 @@
- }
- 
- /* replaces a block of text */
--static void put_paragraph (WEdit * edit, unsigned char *t, long p, long q, int indent, int size)
-+static void put_paragraph (WEdit * edit, mc_wchar_t *t, long p, long q, int indent, int size)
- {
-     long cursor;
--    int i, c = 0;
-+    int i;
-+    mc_wchar_t c = 0;
-     cursor = edit->curs1;
-     if (indent)
-+#ifndef UTF8
- 	while (strchr ("\t ", edit_get_byte (edit, p)))
-+#else /* UTF8 */
-+        while (wcschr (L"\t ", edit_get_byte (edit, p)))
-+#endif /* UTF8 */
- 	    p++;
-     for (i = 0; i < size; i++, p++) {
- 	if (i && indent) {
- 	    if (t[i - 1] == '\n' && c == '\n') {
-+#ifndef UTF8
- 		while (strchr ("\t ", edit_get_byte (edit, p)))
-+#else /* UTF8 */
-+                while (wcschr (L"\t ", edit_get_byte (edit, p)))
-+#endif /* UTF8 */
- 		    p++;
- 	    } else if (t[i - 1] == '\n') {
- 		long curs;
-@@ -281,7 +312,11 @@
- 		p = edit->curs1;
- 	    } else if (c == '\n') {
- 		edit_cursor_move (edit, p - edit->curs1);
-+#ifndef UTF8
- 		while (strchr ("\t ", edit_get_byte (edit, p))) {
-+#else /* UTF8 */
-+		while (wcschr (L"\t ", edit_get_byte (edit, p))) {
-+#endif /* UTF8 */
- 		    edit_delete (edit);
- 		    if (cursor > edit->curs1)
- 			cursor--;
-@@ -314,7 +349,7 @@
- {
-     long p, q;
-     int size;
--    unsigned char *t;
-+    mc_wchar_t *t;
-     int indent = 0;
-     if (option_word_wrap_line_length < 2)
- 	return;
-@@ -324,17 +359,25 @@
-     q = end_paragraph (edit, force);
-     indent = test_indent (edit, p, q);
-     t = get_paragraph (edit, p, q, indent, &size);
--    if (!t)
-+    if (!t) 
- 	return;
-     if (!force) {
- 	int i;
-+#ifndef UTF8
- 	if (strchr (NO_FORMAT_CHARS_START, *t)) {
-+#else /* UTF8 */
-+	if (wcschr (NO_FORMAT_CHARS_START, *t)) {
-+#endif /* UTF8 */
- 	    g_free (t);
- 	    return;
- 	}
- 	for (i = 0; i < size - 1; i++) {
- 	    if (t[i] == '\n') {
-+#ifndef UTF8
- 		if (strchr (NO_FORMAT_CHARS_START "\t ", t[i + 1])) {
-+#else /* UTF8 */
-+		if (wcschr (NO_FORMAT_CHARS_START "\t", t[i + 1])) {
-+#endif /* UTF8 */
- 		    g_free (t);
- 		    return;
- 		}
-diff -urN mc-4.6.1.orig/lib/mc.menu mc-4.6.1/lib/mc.menu
---- mc-4.6.1.orig/lib/mc.menu	2004-08-17 14:31:16.000000000 +0600
-+++ mc-4.6.1/lib/mc.menu	2007-01-19 18:33:58.000000000 +0500
-@@ -15,7 +15,7 @@
- 
- 0       Edit a bug report and send it to root
- 	I=`mktemp ${MC_TMPDIR:-/tmp}/mail.XXXXXX` || exit 1
--	${EDITOR-vi} $I
-+	${EDITOR-editor} $I
- 	test -r $I && mail root < $I
- 	rm -f $I
- 
-@@ -330,3 +330,7 @@
- o       Open next a free console
-         open -s -- sh
- 
-+=+ f \.dsc$ & t r
-+x       Extract the contents of a Debian source package
-+        dpkg-source -x %f
-+
-diff -urN mc-4.6.1.orig/po/de.po mc-4.6.1/po/de.po
---- mc-4.6.1.orig/po/de.po	2005-07-23 22:53:27.000000000 +0600
-+++ mc-4.6.1/po/de.po	2007-01-19 18:33:58.000000000 +0500
-@@ -1412,7 +1412,7 @@
- #: src/cmd.c:988
- #, c-format
- msgid " edit symlink: %s "
--msgstr " symbolschen Link barbeiten: %s"
-+msgstr " symbolschen Link bearbeiten: %s"
- 
- #: src/cmd.c:999
- #, c-format
-@@ -1562,7 +1562,7 @@
- " Cannot create temporary command file \n"
- " %s "
- msgstr ""
--" Kann temporäre Befehlsdaei nicht anlegen \n"
-+" Kann temporäre Befehlsdatei nicht anlegen \n"
- " %s "
- 
- #: src/ext.c:117 src/user.c:606
-@@ -1670,7 +1670,7 @@
- " Cannot stat source file \"%s\" \n"
- " %s "
- msgstr ""
--" Kann Quelldaei \"%s\" nicht untersuchen \n"
-+" Kann Quelldatei \"%s\" nicht untersuchen \n"
- " %s "
- 
- #: src/file.c:517 src/file.c:1058
-@@ -2576,7 +2576,7 @@
- #: src/learn.c:115
- #, c-format
- msgid " You have entered \"%s\""
--msgstr " Sie haben \"%s\" einggeben"
-+msgstr " Sie haben \"%s\" eingegeben"
- 
- #. TRANSLATORS: This label appears near learned keys.  Keep it short.
- #: src/learn.c:164
-@@ -2668,7 +2668,7 @@
- 
- #: src/main.c:811 src/main.c:835
- msgid "S&hell link..."
--msgstr "Shell-Verbindung..."
-+msgstr "S&hell-Verbindung..."
- 
- #: src/main.c:813 src/main.c:837
- msgid "SM&B link..."
-@@ -4200,7 +4200,7 @@
- #: vfs/ftpfs.c:684
- #, c-format
- msgid "ftpfs: connection to server failed: %s"
--msgstr "ftpfs: Verbindung zum Server fehlgeschlgen: %s"
-+msgstr "ftpfs: Verbindung zum Server fehlgeschlagen: %s"
- 
- #: vfs/ftpfs.c:725
- #, c-format
-diff -urN mc-4.6.1.orig/po/it.po mc-4.6.1/po/it.po
---- mc-4.6.1.orig/po/it.po	2005-07-23 22:53:28.000000000 +0600
-+++ mc-4.6.1/po/it.po	2007-01-19 18:33:58.000000000 +0500
-@@ -2098,7 +2098,7 @@
- 
- #: src/filegui.c:524
- msgid "A&ppend"
--msgstr "Atta&cca"
-+msgstr "atta&Cca"
- 
- #: src/filegui.c:527
- msgid "Overwrite this target?"
-diff -urN mc-4.6.1.orig/po/ru.po mc-4.6.1/po/ru.po
---- mc-4.6.1.orig/po/ru.po	2005-07-23 22:53:30.000000000 +0600
-+++ mc-4.6.1/po/ru.po	2007-01-19 18:33:59.000000000 +0500
-@@ -4503,3 +4503,32 @@
- #: vfs/vfs.c:894
- msgid "Changes to file lost"
- msgstr "éÚÍÅÎÅÎÉÑ ÄÌÑ ÆÁÊÌÁ ÐÏÔÅÒÑÎÙ"
-+
-+#: messages for recode patch
-+msgid "Panel &codepage"
-+msgstr "ëÏÄÉÒÏ×ËÁ ÐÁÎÅÌÉ"
-+
-+msgid " Choose codepage "
-+msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ"
-+
-+msgid " Choose panel codepage "
-+msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ ÐÁÎÅÌÉ "
-+
-+msgid " Choose default FTP codepage "
-+msgstr " ÷ÙÂÅÒÉÔÅ ËÏÄÉÒÏ×ËÕ FTP ÐÏ ÕÍÏÌÞÁÎÉÀ "
-+
-+msgid "FTP default codepage:"
-+msgstr "ëÏÄÉÒÏ×ËÁ FTP ÐÏ ÕÍÏÌÞÁÎÉÀ:"
-+
-+msgid "Recode file names:"
-+msgstr "ðÅÒÅËÏÄÉÒÏ×ÁÔØ ÉÍÅÎÁ:"
-+
-+msgid "Recoding works only with COPY/MOVE operation"
-+msgstr "ðÅÒÅËÏÄÉÒÏ×ËÁ ÒÁÂÏÔÁÅÔ ÔÏÌØËÏ ÄÌÑ ÏÐÅÒÁÃÉÊ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ"
-+
-+msgid " Choose \"FROM\" codepage for COPY/MOVE operaion "
-+msgstr" ÷ÙÂÅÒÉÔÅ ÎÁÞÁÌØÎÕÀ ËÏÄÉÒÏ×ËÕ ÄÌÑ ÏÐÅÒÁÃÉÉ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ "
-+
-+msgid " Choose \"TO\" codepage for COPY/MOVE operaion "
-+msgstr" ÷ÙÂÅÒÉÔÅ ËÏÎÅÞÎÕÀ ËÏÄÉÒÏ×ËÕ ÄÌÑ ÏÐÅÒÁÃÉÉ ËÏÐÉÒÏ×ÁÎÉÑ/ÐÅÒÅÍÅÝÅÎÉÑ "
-+
-diff -urN mc-4.6.1.orig/po/vi.po mc-4.6.1/po/vi.po
---- mc-4.6.1.orig/po/vi.po	1970-01-01 05:00:00.000000000 +0500
-+++ mc-4.6.1/po/vi.po	2007-01-19 18:33:58.000000000 +0500
-@@ -0,0 +1,4456 @@
-+# Vietnamese translation of Midnight Commander
-+# Copyright (C) 1998-2003, 2005 Free Software Foundation, Inc.
-+# First translator(s): Phan Vinh Thinh <teppi@vnlinux.org>, 2005.
-+#
-+#
-+msgid ""
-+msgstr ""
-+"Project-Id-Version: mc 4.6.1\n"
-+"Report-Msgid-Bugs-To: \n"
-+"POT-Creation-Date: 2003-12-24 12:16-0500\n"
-+"PO-Revision-Date: 2005-03-29 01:20+0300\n"
-+"Last-Translator: Phan Vinh Thinh <teppi@vnlinux.org>\n"
-+"Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net>\n"
-+"MIME-Version: 1.0\n"
-+"Content-Type: text/plain; charset=UTF-8\n"
-+"Content-Transfer-Encoding: 8bit\n"
-+"X-Generator: KBabel 1.9.1\n"
-+
-+#: edit/edit.c:146 edit/edit.c:277 edit/edit.c:285 edit/edit.c:333
-+#: edit/edit.c:348 edit/edit.c:359 edit/edit.c:375 edit/edit.c:2665
-+#: edit/editcmd.c:282 edit/editcmd.c:290 edit/editcmd.c:1719 src/wtools.c:120
-+#: src/wtools.c:275
-+msgid "Error"
-+msgstr "Lá»—i"
-+
-+#: edit/edit.c:149 edit/edit.c:336
-+msgid " Cannot open file for reading: "
-+msgstr " Không thể mở tập tin để Ä‘á»c: "
-+
-+#: edit/edit.c:279
-+msgid " Error reading from pipe: "
-+msgstr " Lá»—i Ä‘á»c từ Ä‘Æ°á»ng ống (pipe): "
-+
-+#: edit/edit.c:288
-+msgid " Cannot open pipe for reading: "
-+msgstr " Không thể mở Ä‘Æ°á»ng ống để Ä‘á»c: "
-+
-+#: edit/edit.c:351
-+msgid " Cannot get size/permissions info for file: "
-+msgstr " Không lấy được thông tin kích thÆ°á»›c/quyá»n hạn của tập tin: "
-+
-+#: edit/edit.c:360
-+msgid " Not an ordinary file: "
-+msgstr " Tập tin không thông thÆ°á»ng: "
-+
-+#: edit/edit.c:376
-+msgid " File is too large: "
-+msgstr " Tập tin quá lớn: "
-+
-+#: edit/edit.c:2665
-+msgid "Macro recursion is too deep"
-+msgstr "Äệ qui của macro quá sâu"
-+
-+#: edit/edit.h:262
-+msgid "&Dismiss"
-+msgstr "Äó&ng"
-+
-+#: edit/edit.h:264 edit/editcmd.c:382 edit/editcmd.c:1228 edit/editcmd.c:1310
-+#: edit/editcmd.c:2569 edit/editmenu.c:37 edit/editoptions.c:71
-+#: src/boxes.c:139 src/boxes.c:276 src/boxes.c:372 src/boxes.c:464
-+#: src/boxes.c:590 src/boxes.c:713 src/boxes.c:835 src/boxes.c:945
-+#: src/boxes.c:1013 src/filegui.c:763 src/find.c:184 src/layout.c:348
-+#: src/option.c:113 src/subshell.c:323 src/view.c:2107 src/wtools.c:441
-+msgid "&OK"
-+msgstr "Äồng ý &="
-+
-+#: edit/editcmd.c:45 edit/editcmd.c:46
-+msgid " Enter file name: "
-+msgstr " Hãy nhập tên tập tin: "
-+
-+#: edit/editcmd.c:283
-+msgid " Error writing to pipe: "
-+msgstr " Lá»—i ghi vào Ä‘Æ°á»ng ống: "
-+
-+#: edit/editcmd.c:293
-+msgid " Cannot open pipe for writing: "
-+msgstr " Không thể mở Ä‘Æ°á»ng ống để ghi: "
-+
-+#: edit/editcmd.c:375
-+msgid "Quick save "
-+msgstr "&LÆ°u nhanh"
-+
-+#: edit/editcmd.c:376
-+msgid "Safe save "
-+msgstr "Lưu &an toàn"
-+
-+#: edit/editcmd.c:377
-+msgid "Do backups -->"
-+msgstr "&Sao lÆ°u -->"
-+
-+#: edit/editcmd.c:380 edit/editcmd.c:1169 edit/editcmd.c:1226
-+#: edit/editcmd.c:1308 edit/editcmd.c:2567 edit/editoptions.c:68
-+#: src/achown.c:68 src/boxes.c:140 src/boxes.c:277 src/boxes.c:370
-+#: src/boxes.c:462 src/boxes.c:588 src/boxes.c:711 src/boxes.c:833
-+#: src/boxes.c:1013 src/chmod.c:96 src/chown.c:72 src/cmd.c:856
-+#: src/filegui.c:745 src/find.c:184 src/hotlist.c:121 src/hotlist.c:523
-+#: src/hotlist.c:830 src/hotlist.c:926 src/layout.c:349 src/learn.c:58
-+#: src/option.c:114 src/panelize.c:66 src/view.c:441 src/view.c:2104
-+#: src/wtools.c:46 src/wtools.c:439
-+msgid "&Cancel"
-+msgstr "Äóng há»™p thoại &-"
-+
-+#: edit/editcmd.c:386
-+msgid "Extension:"
-+msgstr "&Mở rộng:"
-+
-+#: edit/editcmd.c:392
-+msgid " Edit Save Mode "
-+msgstr " Chế độ ghi nhớ "
-+
-+#: edit/editcmd.c:465 edit/editcmd.c:524
-+msgid " Save As "
-+msgstr " Ghi nhÆ° "
-+
-+#: edit/editcmd.c:482 edit/editcmd.c:804 edit/editcmd.c:841
-+#: edit/editcmd.c:1000 edit/editcmd.c:1113 src/file.c:599 src/help.c:318
-+#: src/main.c:424 src/screen.c:1415 src/selcodepage.c:105 src/subshell.c:319
-+#: src/subshell.c:653 src/utilunix.c:401 src/utilunix.c:405 src/utilunix.c:427
-+#: vfs/mcfs.c:138
-+msgid "Warning"
-+msgstr "Cảnh báo"
-+
-+#: edit/editcmd.c:483
-+msgid " A file already exists with this name. "
-+msgstr " Tập tin có tên như vậy đã tồn tại. "
-+
-+#: edit/editcmd.c:484
-+msgid "Overwrite"
-+msgstr "Ghi chèn"
-+
-+#: edit/editcmd.c:484 edit/editcmd.c:569 edit/editcmd.c:768 edit/editcmd.c:804
-+#: edit/editcmd.c:844 edit/editcmd.c:1003 edit/editcmd.c:1116
-+msgid "Cancel"
-+msgstr "Hủy bá»"
-+
-+#: edit/editcmd.c:526 edit/editcmd.c:2293 src/view.c:440
-+msgid " Cannot save file. "
-+msgstr " Không thể ghi nhớ tập tin. "
-+
-+#: edit/editcmd.c:626 edit/editcmd.c:634 edit/editcmd.c:659 edit/editcmd.c:706
-+msgid " Delete macro "
-+msgstr " Xóa macro "
-+
-+#: edit/editcmd.c:628
-+msgid " Cannot open temp file "
-+msgstr " Không thể mở tập tin tạm thá»i "
-+
-+#: edit/editcmd.c:636 edit/editcmd.c:697 edit/editcmd.c:754
-+msgid " Cannot open macro file "
-+msgstr " Không thể mở tập tin chứa các macro "
-+
-+#: edit/editcmd.c:660
-+msgid " Cannot overwrite macro file "
-+msgstr " Không thể ghi chèn lên tập tin chứa các macro "
-+
-+#: edit/editcmd.c:676 edit/editcmd.c:697
-+msgid " Save macro "
-+msgstr " Ghi nhá»› macro "
-+
-+#: edit/editcmd.c:678
-+msgid " Press the macro's new hotkey: "
-+msgstr " Hãy nhấn phím tắt mới của macro: "
-+
-+#: edit/editcmd.c:707 edit/editkeys.c:195 edit/editkeys.c:225
-+msgid " Press macro hotkey: "
-+msgstr " Hãy nhấn phím tắt của macro: "
-+
-+#: edit/editcmd.c:753
-+msgid " Load macro "
-+msgstr " Nạp macro "
-+
-+#: edit/editcmd.c:766
-+msgid " Confirm save file? : "
-+msgstr " Phê chuẩn việc ghi nhớ tập tin?: "
-+
-+#: edit/editcmd.c:768 src/view.c:439
-+msgid " Save file "
-+msgstr " Ghi nhớ tập tin "
-+
-+#: edit/editcmd.c:768 edit/editwidget.c:288 src/view.c:2220
-+msgid "Save"
-+msgstr "Ghinhá»›"
-+
-+#: edit/editcmd.c:804 edit/editcmd.c:842
-+msgid ""
-+" Current text was modified without a file save. \n"
-+" Continue discards these changes. "
-+msgstr ""
-+" Văn bản hiện thá»i đã thay đổi và chÆ°a được ghi nhá»›. \n"
-+" Tiếp tục thao tác sẽ làm mất những thay đổi này. "
-+
-+#: edit/editcmd.c:804 edit/editcmd.c:843 edit/editcmd.c:1003
-+#: edit/editcmd.c:1116
-+msgid "Continue"
-+msgstr "Tiếp tục"
-+
-+#: edit/editcmd.c:850
-+msgid " Load "
-+msgstr " Nạp "
-+
-+#: edit/editcmd.c:1002 edit/editcmd.c:1115
-+msgid " Block is large, you may not be able to undo this action. "
-+msgstr " Khối quá lớn, có thể bạn sẽ không hủy bỠđược bước này. "
-+
-+#: edit/editcmd.c:1171
-+msgid "O&ne"
-+msgstr "&Má»™t"
-+
-+#: edit/editcmd.c:1173 src/file.c:2210 src/filegui.c:521
-+msgid "A&ll"
-+msgstr "&Tất cả"
-+
-+#: edit/editcmd.c:1175 src/file.c:2147 src/filegui.c:210
-+msgid "&Skip"
-+msgstr "&Bá» qua"
-+
-+#: edit/editcmd.c:1177
-+msgid "&Replace"
-+msgstr "&Thay thế"
-+
-+#: edit/editcmd.c:1184 edit/editcmd.c:1191
-+msgid " Replace with: "
-+msgstr " Thay thế bằng: "
-+
-+#: edit/editcmd.c:1196
-+msgid " Confirm replace "
-+msgstr " Phê chuẩn thay thế "
-+
-+#: edit/editcmd.c:1230 edit/editcmd.c:1312
-+msgid "scanf &Expression"
-+msgstr "biểu thức &Scanf"
-+
-+#: edit/editcmd.c:1232
-+msgid "replace &All"
-+msgstr "&Thay thế tất cả"
-+
-+#: edit/editcmd.c:1234
-+msgid "pr&Ompt on replace"
-+msgstr "&Há»i trÆ°á»›c khi thay"
-+
-+#: edit/editcmd.c:1236 edit/editcmd.c:1314 src/view.c:2110
-+msgid "&Backwards"
-+msgstr "&Tìm ngược lại"
-+
-+#: edit/editcmd.c:1238 edit/editcmd.c:1316
-+msgid "&Regular expression"
-+msgstr "&Biểu thức chính quy"
-+
-+#: edit/editcmd.c:1240 edit/editcmd.c:1318
-+msgid "&Whole words only"
-+msgstr "&Chỉ những từ đầy đủ"
-+
-+#: edit/editcmd.c:1242 edit/editcmd.c:1320 src/find.c:176
-+msgid "case &Sensitive"
-+msgstr "có tính &Kiểu chữ"
-+
-+#: edit/editcmd.c:1246
-+msgid " Enter replacement argument order eg. 3,2,1,4 "
-+msgstr " Hãy nhập thứ tự của tham số thay thế, ví dụ 3,2,1,4 "
-+
-+#: edit/editcmd.c:1250
-+msgid " Enter replacement string:"
-+msgstr " Nhập chuỗi thay thế:"
-+
-+#: edit/editcmd.c:1254 edit/editcmd.c:1324 src/view.c:2115
-+msgid " Enter search string:"
-+msgstr " Nhập chuỗi tìm kiếm:"
-+
-+#: edit/editcmd.c:1273 edit/editcmd.c:1925 edit/editcmd.c:1949
-+msgid " Replace "
-+msgstr " Thay thế "
-+
-+#: edit/editcmd.c:1338 edit/editcmd.c:2036 edit/editcmd.c:2038
-+#: edit/editcmd.c:2066 edit/editwidget.c:293 src/view.c:1594 src/view.c:1673
-+#: src/view.c:1826 src/view.c:1838 src/view.c:2060 src/view.c:2113
-+#: src/view.c:2120 src/view.c:2236
-+msgid "Search"
-+msgstr "Tìm"
-+
-+#: edit/editcmd.c:1719
-+msgid " Invalid regular expression, or scanf expression with to many conversions "
-+msgstr " Biểu thức chính quy không đúng, hoặc biểu thức scanf có quá nhiá»u biến đổi "
-+
-+#: edit/editcmd.c:1927
-+msgid " Error in replacement format string. "
-+msgstr " Lỗi trong định dạng chuỗi thay thế. "
-+
-+#: edit/editcmd.c:1957
-+#, c-format
-+msgid " %ld replacements made. "
-+msgstr " %ld thay thế được thực hiện. "
-+
-+#: edit/editcmd.c:1960 edit/editcmd.c:2038 edit/editcmd.c:2066 src/view.c:1673
-+#: src/view.c:1838
-+msgid " Search string not found "
-+msgstr " Không tìm thấy chuỗi tìm kiếm "
-+
-+#: edit/editcmd.c:2036
-+#, c-format
-+msgid " %d finds made, %d bookmarks added "
-+msgstr " tìm thấy %d , thêm %d thẻ đánh dấu (bookmark) "
-+
-+#: edit/editcmd.c:2088 edit/editwidget.c:296 src/help.c:826 src/main.c:1208
-+#: src/view.c:456 src/view.c:2215 src/view.c:2246
-+msgid "Quit"
-+msgstr "Thoát"
-+
-+#: edit/editcmd.c:2088 src/view.c:457
-+msgid " File was modified, Save with exit? "
-+msgstr "Tập tin đã thay đổi, ghi nhớ khi thoát? "
-+
-+#: edit/editcmd.c:2089 src/view.c:458
-+msgid "Cancel quit"
-+msgstr "Không thoát"
-+
-+#: edit/editcmd.c:2089 src/cmd.c:195 src/file.c:1837 src/file.c:2209
-+#: src/filegui.c:526 src/hotlist.c:1049 src/main.c:471 src/screen.c:1952
-+#: src/subshell.c:654 src/tree.c:708 src/view.c:458 vfs/mcfs.c:143
-+msgid "&Yes"
-+msgstr "&Có"
-+
-+#: edit/editcmd.c:2089 src/cmd.c:195 src/file.c:1837 src/file.c:2209
-+#: src/filegui.c:525 src/hotlist.c:1049 src/main.c:471 src/screen.c:1953
-+#: src/subshell.c:654 src/tree.c:708 src/view.c:458 vfs/mcfs.c:143
-+msgid "&No"
-+msgstr "&Không"
-+
-+#: edit/editcmd.c:2202
-+msgid " Copy to clipboard "
-+msgstr "Sao chép vào bộ đệm "
-+
-+#: edit/editcmd.c:2202 edit/editcmd.c:2215
-+msgid " Unable to save to file. "
-+msgstr "Không ghi nhớ được tập tin. "
-+
-+#: edit/editcmd.c:2215
-+msgid " Cut to clipboard "
-+msgstr "Cắt vào bộ đệm "
-+
-+#: edit/editcmd.c:2243 src/view.c:2005
-+msgid " Goto line "
-+msgstr "Chuyển tới dòng "
-+
-+#: edit/editcmd.c:2243
-+msgid " Enter line: "
-+msgstr "Hãy nhập số thứ tự dòng: "
-+
-+#: edit/editcmd.c:2278 edit/editcmd.c:2291
-+msgid " Save Block "
-+msgstr "Ghi nhớ khối "
-+
-+#: edit/editcmd.c:2307 edit/editcmd.c:2320
-+msgid " Insert File "
-+msgstr "Chèn tập tin "
-+
-+#: edit/editcmd.c:2322
-+msgid " Cannot insert file. "
-+msgstr "Không chèn được tập tin. "
-+
-+#: edit/editcmd.c:2339
-+msgid " Sort block "
-+msgstr "Sắp xếp khối "
-+
-+#: edit/editcmd.c:2339 edit/editcmd.c:2465
-+msgid " You must first highlight a block of text. "
-+msgstr "Äầu tiên bạn phải chá»n má»™t khối văn bản. "
-+
-+#: edit/editcmd.c:2346
-+msgid " Run Sort "
-+msgstr "Thực hiện sắp xếp "
-+
-+#: edit/editcmd.c:2347
-+msgid " Enter sort options (see manpage) separated by whitespace: "
-+msgstr "Nhập tùy chá»n sắp xếp (xem trang man), phân cách nhau bởi khoảng trắng: "
-+
-+#: edit/editcmd.c:2358 edit/editcmd.c:2363
-+msgid " Sort "
-+msgstr "Sắp xếp "
-+
-+#: edit/editcmd.c:2359
-+msgid " Cannot execute sort command "
-+msgstr "Không thể thực hiện câu lệnh sort "
-+
-+#: edit/editcmd.c:2364
-+msgid " Sort returned non-zero: "
-+msgstr "Sắp xếp trả lại giá trị khác không: "
-+
-+#: edit/editcmd.c:2388
-+msgid "Paste output of external command"
-+msgstr "Dán kết quả của lệnh ngoại trú"
-+
-+#: edit/editcmd.c:2389
-+msgid "Enter shell command(s):"
-+msgstr "Nhập (các) câu lệnh shell:"
-+
-+#: edit/editcmd.c:2398
-+msgid "External command"
-+msgstr "Lệnh ngoại trú"
-+
-+#: edit/editcmd.c:2399
-+msgid "Cannot execute command"
-+msgstr "Không thực hiện được câu lệnh"
-+
-+#: edit/editcmd.c:2433
-+msgid "Error creating script:"
-+msgstr "Lỗi tạo script:"
-+
-+#: edit/editcmd.c:2441
-+msgid "Error reading script:"
-+msgstr "Lá»—i Ä‘á»c script:"
-+
-+#: edit/editcmd.c:2450
-+msgid "Error closing script:"
-+msgstr "Lỗi đóng script:"
-+
-+#: edit/editcmd.c:2456
-+msgid "Script created:"
-+msgstr "Äã tạo script:"
-+
-+#: edit/editcmd.c:2463
-+msgid "Process block"
-+msgstr "Xử lý khối"
-+
-+#: edit/editcmd.c:2562
-+msgid " Mail "
-+msgstr " ThÆ° "
-+
-+#: edit/editcmd.c:2573
-+msgid " Copies to"
-+msgstr " Sao chép tới"
-+
-+#: edit/editcmd.c:2577
-+msgid " Subject"
-+msgstr " Tên thư"
-+
-+#: edit/editcmd.c:2581
-+msgid " To"
-+msgstr " NgÆ°á»i nhận"
-+
-+#: edit/editcmd.c:2583
-+msgid " mail -s <subject> -c <cc> <to>"
-+msgstr " mail -s <Tên thÆ°> -c <cc> <NgÆ°á»i nhận>"
-+
-+#: edit/editkeys.c:180
-+msgid " Emacs key: "
-+msgstr "Phím Emacs: "
-+
-+#: edit/editkeys.c:194 edit/editkeys.c:225
-+msgid " Execute Macro "
-+msgstr "Thực hiện Macro "
-+
-+#: edit/editkeys.c:217
-+msgid " Insert Literal "
-+msgstr " Chèn văn bản thuần túy "
-+
-+#: edit/editkeys.c:218
-+msgid " Press any key: "
-+msgstr " Nhấn phím bất kỳ: "
-+
-+#: edit/editlock.c:148
-+#, c-format
-+msgid ""
-+"File \"%s\" is already being edited\n"
-+"User: %s\n"
-+"Process ID: %d"
-+msgstr ""
-+"Tập tin \"%s\" đang được soạn thảo\n"
-+"Ngưòi dùng: %s\n"
-+"ID tiến trình: %d"
-+
-+#: edit/editlock.c:153
-+msgid "File locked"
-+msgstr "Tập tin bị khóa"
-+
-+#: edit/editlock.c:153
-+msgid "&Grab lock"
-+msgstr "&Chiếm đoạt khóa"
-+
-+#: edit/editlock.c:154
-+msgid "&Ignore lock"
-+msgstr "&Lá»i Ä‘i khóa"
-+
-+#: edit/editmenu.c:55
-+msgid " About "
-+msgstr " VỠchương trình "
-+
-+#: edit/editmenu.c:56
-+msgid ""
-+"\n"
-+"                Cooledit  v3.11.5\n"
-+"\n"
-+" Copyright (C) 1996 the Free Software Foundation\n"
-+"\n"
-+"       A user friendly text editor written\n"
-+"           for the Midnight Commander.\n"
-+msgstr ""
-+"\n"
-+"                     Cooledit  v3.11.5\n"
-+"\n"
-+"       Copyright (C) 1996 the Free Software Foundation\n"
-+"\n"
-+" Trình soạn thảo vá»›i giao diện ngÆ°á»i dùng thân thiện.\n"
-+"               Äược viết cho Midnight Commander.\n"
-+
-+#: edit/editmenu.c:283 edit/editmenu.c:301
-+msgid "&Open file..."
-+msgstr "&Mở tập tin..."
-+
-+#: edit/editmenu.c:284
-+msgid "&New              C-n"
-+msgstr "&Tập tin mới             C-n"
-+
-+#: edit/editmenu.c:286 edit/editmenu.c:304
-+msgid "&Save              F2"
-+msgstr "&Ghi nhá»›                  F2"
-+
-+#: edit/editmenu.c:287 edit/editmenu.c:305
-+msgid "Save &as...       F12"
-+msgstr "Ghi &nhÆ°...              F12"
-+
-+#: edit/editmenu.c:289 edit/editmenu.c:307
-+msgid "&Insert file...   F15"
-+msgstr "&Chèn tập tin...         F15"
-+
-+#: edit/editmenu.c:290
-+msgid "Copy to &file...  C-f"
-+msgstr "Ché&p vào tập tin...    C-f"
-+
-+#: edit/editmenu.c:292 edit/editmenu.c:310
-+msgid "&User menu...     F11"
-+msgstr "Trình Ä‘Æ¡n ngÆ°á»i &dùng... F11"
-+
-+#: edit/editmenu.c:294 edit/editmenu.c:312
-+msgid "A&bout...            "
-+msgstr "&VỠchương trình...         "
-+
-+#: edit/editmenu.c:296 edit/editmenu.c:314
-+msgid "&Quit             F10"
-+msgstr "T&hoát                   F10"
-+
-+#: edit/editmenu.c:302
-+msgid "&New            C-x k"
-+msgstr "&Tập tin mới           C-x k"
-+
-+#: edit/editmenu.c:308
-+msgid "Copy to &file...     "
-+msgstr "S&ao chép vào tập tin...    "
-+
-+#: edit/editmenu.c:319
-+msgid "&Toggle Mark       F3"
-+msgstr "&Bật/tắt bôi đen           F3"
-+
-+#: edit/editmenu.c:320
-+msgid "&Mark Columns    S-F3"
-+msgstr "Bôi đen &cột             S-F3"
-+
-+#: edit/editmenu.c:322
-+msgid "Toggle &ins/overw Ins"
-+msgstr "Chế độ chèn/&thay thế     Ins"
-+
-+#: edit/editmenu.c:324
-+msgid "&Copy              F5"
-+msgstr "&Sao chép                  F5"
-+
-+#: edit/editmenu.c:325
-+msgid "&Move              F6"
-+msgstr "&Di chuyển                 F6"
-+
-+#: edit/editmenu.c:326
-+msgid "&Delete            F8"
-+msgstr "&Xóa                       F8"
-+
-+#: edit/editmenu.c:328
-+msgid "&Undo             C-u"
-+msgstr "&Hủy bước                 C-u"
-+
-+#: edit/editmenu.c:330
-+msgid "&Beginning     C-PgUp"
-+msgstr "Äầ&u tập tin           C-PgUp"
-+
-+#: edit/editmenu.c:331
-+msgid "&End           C-PgDn"
-+msgstr "Cuố&i tập tin          C-PgDn"
-+
-+#: edit/editmenu.c:338
-+msgid "&Search...         F7"
-+msgstr "Tìm &kiếm...               F7"
-+
-+#: edit/editmenu.c:339
-+msgid "Search &again     F17"
-+msgstr "&Tìm kiếm lại lần nữa     F17"
-+
-+#: edit/editmenu.c:340
-+msgid "&Replace...        F4"
-+msgstr "Th&ay thế...               F4"
-+
-+#: edit/editmenu.c:347 edit/editmenu.c:371
-+msgid "&Go to line...            M-l"
-+msgstr "&Chuyển tới dòng...             M-l"
-+
-+#: edit/editmenu.c:348 edit/editmenu.c:372
-+msgid "Go to matching &bracket   M-b"
-+msgstr "Chuyển &tới dấu ngoặc tạo cặp    M-b"
-+
-+#: edit/editmenu.c:350 edit/editmenu.c:374
-+msgid "Insert &literal...       C-q"
-+msgstr "Chèn &văn bản thuần túy...       C-q"
-+
-+#: edit/editmenu.c:352 edit/editmenu.c:376
-+msgid "&Refresh screen          C-l"
-+msgstr "&Làm mới màn hình                C-l"
-+
-+#: edit/editmenu.c:354 edit/editmenu.c:378
-+msgid "&Start record macro      C-r"
-+msgstr "&Bắt đầu ghi macro               C-r"
-+
-+#: edit/editmenu.c:355 edit/editmenu.c:379
-+msgid "&Finish record macro...  C-r"
-+msgstr "&Kết thúc ghi macro...           C-r"
-+
-+#: edit/editmenu.c:356
-+msgid "&Execute macro...   C-a, KEY"
-+msgstr "Chạy &macro...              C-a, KEY"
-+
-+#: edit/editmenu.c:357 edit/editmenu.c:381
-+msgid "Delete macr&o...            "
-+msgstr "&Xóa macro...                       "
-+
-+#: edit/editmenu.c:359 edit/editmenu.c:383
-+msgid "Insert &date/time           "
-+msgstr "Chèn &ngày/giỠ                     "
-+
-+#: edit/editmenu.c:361 edit/editmenu.c:385
-+msgid "Format p&aragraph        M-p"
-+msgstr "Äịnh &dạng Ä‘oạn văn              M-p"
-+
-+#: edit/editmenu.c:362
-+msgid "'ispell' s&pell check    C-p"
-+msgstr "Kiểm tra chính tả '&ispell'      C-p"
-+
-+#: edit/editmenu.c:363 edit/editmenu.c:387
-+msgid "Sor&t...                 M-t"
-+msgstr "&Sắp xếp...                      M-t"
-+
-+#: edit/editmenu.c:364 edit/editmenu.c:388
-+msgid "Paste o&utput of...      M-u"
-+msgstr "Dán &kết quả của lệnh...         M-u"
-+
-+#: edit/editmenu.c:365 edit/editmenu.c:389
-+msgid "E&xternal Formatter      F19"
-+msgstr "T&rình định dạng ngoài           F19"
-+
-+#: edit/editmenu.c:366 edit/editmenu.c:390
-+msgid "&Mail...                    "
-+msgstr "T&hư điện tử...                     "
-+
-+#: edit/editmenu.c:380
-+msgid "&Execute macro... C-x e, KEY"
-+msgstr "Thực hiện &macro...       C-x e, KEY"
-+
-+#: edit/editmenu.c:386
-+msgid "'ispell' s&pell check    M-$"
-+msgstr "Kiểm tra chính tả '&ispell'      M-$"
-+
-+#: edit/editmenu.c:395
-+msgid "&General...  "
-+msgstr "Ch&ung...         "
-+
-+#: edit/editmenu.c:396
-+msgid "&Save mode..."
-+msgstr "&Chế độ ghi nhớ..."
-+
-+#: edit/editmenu.c:397 src/main.c:909
-+msgid "learn &Keys..."
-+msgstr "&Tạo phím tắt...  "
-+
-+#: edit/editmenu.c:408 edit/editmenu.c:422 src/chmod.c:146 src/chown.c:119
-+msgid " File "
-+msgstr " Tập tin "
-+
-+#: edit/editmenu.c:410 edit/editmenu.c:424
-+msgid " Edit "
-+msgstr " Soạn thảo "
-+
-+#: edit/editmenu.c:412 edit/editmenu.c:426
-+msgid " Sear/Repl "
-+msgstr " Tìm kiếm/Thay thế "
-+
-+#: edit/editmenu.c:414 edit/editmenu.c:428
-+msgid " Command "
-+msgstr " Câu lệnh "
-+
-+#: edit/editmenu.c:416 edit/editmenu.c:430
-+msgid " Options "
-+msgstr " Tùy chá»n "
-+
-+#: edit/editoptions.c:36
-+msgid "Intuitive"
-+msgstr "T&rực giác"
-+
-+#: edit/editoptions.c:36
-+msgid "Emacs"
-+msgstr "&Emacs"
-+
-+#: edit/editoptions.c:39
-+msgid "None"
-+msgstr "&Không"
-+
-+#: edit/editoptions.c:39
-+msgid "Dynamic paragraphing"
-+msgstr "Äịnh &dạng Ä‘oạn văn Ä‘á»™ng"
-+
-+#: edit/editoptions.c:39
-+msgid "Type writer wrap"
-+msgstr "Tự độ&ng chuyển dòng"
-+
-+#: edit/editoptions.c:75
-+msgid "Word wrap line length: "
-+msgstr "Vị trí chuyển dòng: "
-+
-+#: edit/editoptions.c:81
-+msgid "Tab spacing: "
-+msgstr "Äá»™ rá»™ng tab: "
-+
-+#: edit/editoptions.c:88
-+msgid "Synta&x highlighting"
-+msgstr "&Chiếu sáng cú pháp"
-+
-+#: edit/editoptions.c:91
-+msgid "Save file &position"
-+msgstr "&Ghi nhớ vị trí trong tập tin"
-+
-+#: edit/editoptions.c:94
-+msgid "Confir&m before saving"
-+msgstr "&Há»i lại trÆ°á»›c khi ghi nhá»›"
-+
-+#: edit/editoptions.c:97
-+msgid "Fill tabs with &spaces"
-+msgstr "&Làm đầy tab bằng khoảng trắng"
-+
-+#: edit/editoptions.c:100
-+msgid "&Return does autoindent"
-+msgstr "&Enter tự động thụt dòng"
-+
-+#: edit/editoptions.c:103
-+msgid "&Backspace through tabs"
-+msgstr "&Backpace xóa hết tab"
-+
-+#: edit/editoptions.c:106
-+msgid "&Fake half tabs"
-+msgstr "&Tạo một nửa tab"
-+
-+#: edit/editoptions.c:112
-+msgid "Wrap mode"
-+msgstr "Chế độ chuyển dòng"
-+
-+#: edit/editoptions.c:119
-+msgid "Key emulation"
-+msgstr "Giả tạo phím"
-+
-+#: edit/editoptions.c:124
-+msgid " Editor options "
-+msgstr " Cấu hình trình soạn thảo "
-+
-+#: edit/editwidget.c:287 src/help.c:793 src/help.c:814 src/main.c:1205
-+#: src/screen.c:2184 src/tree.c:970 src/view.c:2213
-+msgid "Help"
-+msgstr "Giúpđỡ"
-+
-+#: edit/editwidget.c:289
-+msgid "Mark"
-+msgstr "Bôiđen"
-+
-+#: edit/editwidget.c:290
-+msgid "Replac"
-+msgstr "Thayth"
-+
-+#: edit/editwidget.c:291 src/file.c:803 src/screen.c:2188 src/tree.c:975
-+msgid "Copy"
-+msgstr "Cópi  "
-+
-+#: edit/editwidget.c:292
-+msgid "Move"
-+msgstr "Chuyển"
-+
-+#: edit/editwidget.c:294 src/screen.c:2191
-+msgid "Delete"
-+msgstr "Xóa   "
-+
-+#: edit/editwidget.c:295 src/main.c:1207
-+msgid "PullDn"
-+msgstr "Gá»iTÄ "
-+
-+#: edit/syntax.c:1100 edit/syntax.c:1107
-+msgid " Load syntax file "
-+msgstr " Nạp tập tin cú pháp "
-+
-+#: edit/syntax.c:1101 src/help.c:764 src/user.c:711
-+#, c-format
-+msgid ""
-+" Cannot open file %s \n"
-+" %s "
-+msgstr ""
-+" Không mở được tập tin %s \n"
-+" %s "
-+
-+#: edit/syntax.c:1108
-+#, c-format
-+msgid " Error in file %s on line %d "
-+msgstr " Lỗi trong tập tin %s trên dòng %d "
-+
-+#: src/achown.c:69 src/chmod.c:97 src/chown.c:73
-+msgid "&Set"
-+msgstr "Äồ&ng ý"
-+
-+#: src/achown.c:70
-+msgid "S&kip"
-+msgstr "&Bá» qua"
-+
-+#: src/achown.c:71 src/chmod.c:101 src/chown.c:76
-+msgid "Set &all"
-+msgstr "Äặt &tất cả"
-+
-+#: src/achown.c:250 src/achown.c:338 src/achown.c:345
-+msgid "owner"
-+msgstr "sở hữu"
-+
-+#: src/achown.c:250 src/achown.c:340 src/achown.c:347
-+msgid "group"
-+msgstr "nhóm"
-+
-+#: src/achown.c:342
-+msgid "other"
-+msgstr "khác"
-+
-+#: src/achown.c:350
-+msgid "On"
-+msgstr "Trên"
-+
-+#: src/achown.c:352
-+msgid "Flag"
-+msgstr "Cá»"
-+
-+#: src/achown.c:354
-+msgid "Mode"
-+msgstr "Chếđộ"
-+
-+#: src/achown.c:358
-+#, c-format
-+msgid "%6d of %d"
-+msgstr "%6d của %d"
-+
-+#: src/achown.c:549
-+msgid " Chown advanced command "
-+msgstr " Câu lệnh chown mở rộng"
-+
-+#: src/achown.c:607 src/achown.c:623 src/achown.c:669 src/chmod.c:241
-+#: src/chmod.c:311
-+#, c-format
-+msgid ""
-+" Cannot chmod \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không chmod được \"%s\" \n"
-+" %s "
-+
-+#: src/achown.c:612 src/achown.c:627 src/achown.c:673 src/chown.c:214
-+#: src/chown.c:322
-+#, c-format
-+msgid ""
-+" Cannot chown \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thay thế được chủ sở hữu \"%s\" \n"
-+" %s "
-+
-+#: src/background.c:205 src/file.c:2145
-+msgid " Background process error "
-+msgstr " Lá»—i của tiến trình ná»n sau "
-+
-+#: src/background.c:211
-+msgid " Unknown error in child "
-+msgstr " Lỗi không rõ trong tiến trình con "
-+
-+#: src/background.c:219
-+msgid " Child died unexpectedly "
-+msgstr " Tiến trình con bất đắc kỳ tử "
-+
-+#: src/background.c:226
-+msgid " Background protocol error "
-+msgstr " Lá»—i giao thức ná»n sau "
-+
-+#: src/background.c:227
-+msgid ""
-+" Background process sent us a request for more arguments \n"
-+" than we can handle. \n"
-+msgstr ""
-+" Tiến trình ná»n sau yêu cầu nhiá»u tham số hÆ¡n, \n"
-+" số chúng ta có thể Ä‘iá»u khiển. \n"
-+
-+#: src/boxes.c:75
-+msgid "&Full file list"
-+msgstr "&Danh sách đầy đủ"
-+
-+#: src/boxes.c:76
-+msgid "&Brief file list"
-+msgstr "&Thu gá»n"
-+
-+#: src/boxes.c:77
-+msgid "&Long file list"
-+msgstr "&Mở rộng"
-+
-+#: src/boxes.c:78
-+msgid "&User defined:"
-+msgstr "&NgÆ°á»i dùng tá»± xác định:"
-+
-+#: src/boxes.c:136
-+msgid "Listing mode"
-+msgstr "Dạng danh sách"
-+
-+#: src/boxes.c:138
-+msgid "user &Mini status"
-+msgstr "t&Rạng thái mini"
-+
-+#: src/boxes.c:278
-+msgid "&Reverse"
-+msgstr "&Ngược lại"
-+
-+#: src/boxes.c:279
-+msgid "case sensi&tive"
-+msgstr "tính đến kiể&U chữ"
-+
-+#: src/boxes.c:280
-+msgid "Sort order"
-+msgstr "Thứ tự sắp xếp"
-+
-+#: src/boxes.c:375
-+msgid " confirm &Exit "
-+msgstr " trước khi th&Oát "
-+
-+#: src/boxes.c:377
-+msgid " confirm e&Xecute "
-+msgstr " trước &Khi thực hiện "
-+
-+#: src/boxes.c:379
-+msgid " confirm o&Verwrite "
-+msgstr " &Trước khi ghi chèn "
-+
-+#: src/boxes.c:381
-+msgid " confirm &Delete "
-+msgstr " há»i lại trÆ°á»›c khi &Xóa "
-+
-+#: src/boxes.c:387 src/cmd.c:194
-+msgid " Confirmation "
-+msgstr " Há»i xác nhận "
-+
-+#: src/boxes.c:459
-+msgid "Full 8 bits output"
-+msgstr "Äầu ra 8 bit đầy đủ"
-+
-+#: src/boxes.c:459
-+msgid "ISO 8859-1"
-+msgstr "ISO.8859-1"
-+
-+#: src/boxes.c:459
-+msgid "7 bits"
-+msgstr "7 bit"
-+
-+#: src/boxes.c:466 src/boxes.c:594
-+msgid "F&ull 8 bits input"
-+msgstr "Äầ&u vào 8 bit đầy đủ"
-+
-+#: src/boxes.c:474 src/boxes.c:575
-+msgid " Display bits "
-+msgstr " Ký tự hiển thị "
-+
-+#: src/boxes.c:556 src/boxes.c:581 src/selcodepage.c:70
-+msgid "Other 8 bit"
-+msgstr "8 bit khác"
-+
-+#: src/boxes.c:578
-+msgid "Input / display codepage:"
-+msgstr "Bảng mã đầu vào / hiển thị:"
-+
-+#: src/boxes.c:597
-+msgid "&Select"
-+msgstr "&Lá»±a chá»n"
-+
-+#: src/boxes.c:716
-+msgid "Use &passive mode"
-+msgstr "Sử &dụng chế độ thụ động"
-+
-+#: src/boxes.c:718
-+msgid "&Use ~/.netrc"
-+msgstr "&Sử dụng ~/.netrc"
-+
-+#: src/boxes.c:722
-+msgid "&Always use ftp proxy"
-+msgstr "&Luôn luôn sử dụng ftp proxy"
-+
-+#: src/boxes.c:724
-+msgid "sec"
-+msgstr "giây"
-+
-+#: src/boxes.c:728
-+msgid "ftpfs directory cache timeout:"
-+msgstr "Thá»i gian chá» của cache thÆ° mục ftp:"
-+
-+#: src/boxes.c:732
-+msgid "ftp anonymous password:"
-+msgstr "Mật khẩu ftp nặc danh:"
-+
-+#: src/boxes.c:739
-+msgid "Timeout for freeing VFSs:"
-+msgstr "Thá»i gian chá» giải phóng VFS:"
-+
-+#: src/boxes.c:745
-+msgid " Virtual File System Setting "
-+msgstr " Thiết lập hệ thống tập tin ảo "
-+
-+#: src/boxes.c:799
-+msgid "Quick cd"
-+msgstr "cd nhanh"
-+
-+#: src/boxes.c:802
-+msgid "cd"
-+msgstr "cd"
-+
-+#: src/boxes.c:837
-+msgid "Symbolic link filename:"
-+msgstr "Tên của liên kết má»m:"
-+
-+#: src/boxes.c:841
-+msgid "Existing filename (filename symlink will point to):"
-+msgstr "Tên tập tin đã có (liên kết má»m sẽ chỉ đến):"
-+
-+#: src/boxes.c:848
-+msgid "Symbolic link"
-+msgstr "Liên kết má»m"
-+
-+#: src/boxes.c:881
-+msgid "Running "
-+msgstr "Äang chạy "
-+
-+#: src/boxes.c:882 src/find.c:721
-+msgid "Stopped"
-+msgstr "Äã dừng"
-+
-+#: src/boxes.c:942
-+msgid "&Stop"
-+msgstr "&Dừng"
-+
-+#: src/boxes.c:943
-+msgid "&Resume"
-+msgstr "&Phục hồi"
-+
-+#: src/boxes.c:944
-+msgid "&Kill"
-+msgstr "&Diệt"
-+
-+#: src/boxes.c:981
-+msgid "Background Jobs"
-+msgstr " Công việc ná»n sau"
-+
-+#: src/boxes.c:1012
-+msgid "Domain:"
-+msgstr "Miá»n (domain):"
-+
-+#: src/boxes.c:1012
-+msgid "Username:"
-+msgstr "Tên ngÆ°á»i dùng:"
-+
-+#: src/boxes.c:1012
-+msgid "Password:"
-+msgstr "Mật khẩu:"
-+
-+#: src/boxes.c:1063
-+#, c-format
-+msgid "Password for \\\\%s\\%s"
-+msgstr "Mật khẩu cho \\\\%s\\%s"
-+
-+#: src/charsets.c:51 vfs/extfs.c:1260 vfs/sfs.c:318
-+#, c-format
-+msgid "Warning: file %s not found\n"
-+msgstr "Cảnh báo: không tìm thấy tập tin %s\n"
-+
-+#: src/charsets.c:198 src/charsets.c:212
-+#, c-format
-+msgid "Cannot translate from %s to %s"
-+msgstr "Không chuyển được bảng mã từ %s thành %s"
-+
-+#: src/chmod.c:77
-+msgid "execute/search by others"
-+msgstr "ngÆ°á»i khác có quyá»n chạy/tìm"
-+
-+#: src/chmod.c:78
-+msgid "write by others"
-+msgstr "ngÆ°á»i khác có quyá»n ghi nhá»›"
-+
-+#: src/chmod.c:79
-+msgid "read by others"
-+msgstr "ngÆ°á»i khác có quyá»n Ä‘á»c"
-+
-+#: src/chmod.c:80
-+msgid "execute/search by group"
-+msgstr "nhóm có quyá»n chạy/tìm kiếm"
-+
-+#: src/chmod.c:81
-+msgid "write by group"
-+msgstr "nhóm có quyá»n ghi nhá»›"
-+
-+#: src/chmod.c:82
-+msgid "read by group"
-+msgstr "nhóm có quyá»n Ä‘á»c"
-+
-+#: src/chmod.c:83
-+msgid "execute/search by owner"
-+msgstr "chủ sở hữu có quyá»n chạy/tìm"
-+
-+#: src/chmod.c:84
-+msgid "write by owner"
-+msgstr "chủ sở hữu có quyá»n ghi nhá»›"
-+
-+#: src/chmod.c:85
-+msgid "read by owner"
-+msgstr "chủ sở hữu có quyá»n Ä‘á»c"
-+
-+#: src/chmod.c:86
-+msgid "sticky bit"
-+msgstr "bit dính (sticky)"
-+
-+#: src/chmod.c:87
-+msgid "set group ID on execution"
-+msgstr "đặt ID nhóm khi chạy"
-+
-+#: src/chmod.c:88
-+msgid "set user ID on execution"
-+msgstr "đặt ID ngÆ°á»i dùng khi chạy"
-+
-+#: src/chmod.c:98
-+msgid "C&lear marked"
-+msgstr "&Xóa đánh dấu"
-+
-+#: src/chmod.c:99
-+msgid "S&et marked"
-+msgstr "Äá&nh dấu"
-+
-+#: src/chmod.c:100
-+msgid "&Marked all"
-+msgstr "Äánh &dấu tất cả"
-+
-+#: src/chmod.c:124 src/screen.c:405
-+msgid "Name"
-+msgstr "Tên"
-+
-+#: src/chmod.c:126
-+msgid "Permissions (Octal)"
-+msgstr "Quyá»n hạn (Hệ tám)"
-+
-+#: src/chmod.c:128
-+msgid "Owner name"
-+msgstr "Tên chủ sở hữu"
-+
-+#: src/chmod.c:130
-+msgid "Group name"
-+msgstr "Tên nhóm"
-+
-+#: src/chmod.c:133
-+msgid "Use SPACE to change"
-+msgstr "Dùng PHÃM TRẮNG để thay đổi"
-+
-+#: src/chmod.c:135
-+msgid "an option, ARROW KEYS"
-+msgstr "tùy chá»n, PHÃM MŨI TÊN"
-+
-+#: src/chmod.c:137
-+msgid "to move between options"
-+msgstr "để di chuyển giữa các tùy chá»n"
-+
-+#: src/chmod.c:139
-+msgid "and T or INS to mark"
-+msgstr "và T hoặc INS để đánh dấu"
-+
-+#: src/chmod.c:144 src/chown.c:111
-+msgid " Permission "
-+msgstr " Quyá»n truy cập "
-+
-+#: src/chmod.c:196
-+msgid "Chmod command"
-+msgstr " Câu lệnh chmod "
-+
-+#: src/chown.c:74
-+msgid "Set &users"
-+msgstr "Äặt &ngÆ°á»i dùng"
-+
-+#: src/chown.c:75
-+msgid "Set &groups"
-+msgstr "Äặt &nhóm"
-+
-+#: src/chown.c:103
-+msgid " Name "
-+msgstr " Tên "
-+
-+#: src/chown.c:105
-+msgid " Owner name "
-+msgstr " Tên chủ sở hữu "
-+
-+#: src/chown.c:107 src/chown.c:117
-+msgid " Group name "
-+msgstr " Tên nhóm "
-+
-+#: src/chown.c:109
-+msgid " Size "
-+msgstr " Kích thước "
-+
-+#: src/chown.c:115
-+msgid " User name "
-+msgstr " Tên ngÆ°á»i dùng "
-+
-+#: src/chown.c:158
-+msgid " Chown command "
-+msgstr " Câu lệnh chown "
-+
-+#: src/chown.c:178
-+msgid "<Unknown user>"
-+msgstr "<không rõ ngÆ°á»i dùng>"
-+
-+#: src/chown.c:179
-+msgid "<Unknown group>"
-+msgstr "<không rõ nhóm>"
-+
-+#: src/cmd.c:194
-+msgid "Files tagged, want to cd?"
-+msgstr "Äã đánh dấu các tập tin, chuyển thÆ° mục?"
-+
-+#: src/cmd.c:200 src/cmd.c:670 src/cmd.c:727 src/main.c:681 src/screen.c:1933
-+msgid "Cannot change directory"
-+msgstr "Không thay đổi được thư mục"
-+
-+#: src/cmd.c:233
-+msgid " View file "
-+msgstr " Xem tập tin "
-+
-+#: src/cmd.c:233
-+msgid " Filename:"
-+msgstr " Tên tập tin:"
-+
-+#: src/cmd.c:255
-+msgid " Filtered view "
-+msgstr " Lá»c rồi xem "
-+
-+#: src/cmd.c:256
-+msgid " Filter command and arguments:"
-+msgstr " Lệnh lá»c và tham số:"
-+
-+#: src/cmd.c:355
-+msgid "Create a new Directory"
-+msgstr "Tạo thư mục mới"
-+
-+#: src/cmd.c:356
-+msgid " Enter directory name:"
-+msgstr " Hãy nhập tên thư mục:"
-+
-+#: src/cmd.c:428
-+msgid " Filter "
-+msgstr " Äầu lá»c "
-+
-+#: src/cmd.c:429
-+msgid " Set expression for filtering filenames"
-+msgstr " Äặt biểu thức để lá»c tên tập tin (nhấn F1 để xem trợ giúp)"
-+
-+#: src/cmd.c:482
-+msgid " Select "
-+msgstr " Chá»n "
-+
-+#: src/cmd.c:510 src/cmd.c:555 src/find.c:147
-+msgid "  Malformed regular expression  "
-+msgstr "  Biểu thức chính quy không đúng  "
-+
-+#: src/cmd.c:528
-+msgid " Unselect "
-+msgstr " Bá» chá»n "
-+
-+#: src/cmd.c:596
-+msgid "Extension file edit"
-+msgstr "Soạn thảo phần mở rộng tập tin"
-+
-+#: src/cmd.c:597
-+msgid " Which extension file you want to edit? "
-+msgstr " Soạn thảo phần mở rộng tập tin nào? "
-+
-+#: src/cmd.c:598 src/cmd.c:701
-+msgid "&User"
-+msgstr "&NgÆ°á»i dùng"
-+
-+#: src/cmd.c:598 src/cmd.c:627 src/cmd.c:701
-+msgid "&System Wide"
-+msgstr "&Hệ thống"
-+
-+#: src/cmd.c:624
-+msgid " Menu edit "
-+msgstr " Soạn thảo tập tin trình đơn "
-+
-+#: src/cmd.c:625
-+msgid " Which menu file do you want to edit? "
-+msgstr " Soạn thảo tập tin trình đơn nào? "
-+
-+#: src/cmd.c:627
-+msgid "&Local"
-+msgstr "&Nội bộ máy"
-+
-+#: src/cmd.c:627
-+msgid "&Home"
-+msgstr "&Cá nhân"
-+
-+#: src/cmd.c:699
-+msgid "Syntax file edit"
-+msgstr "Soạn thảo tập tin cú pháp"
-+
-+#: src/cmd.c:700
-+msgid " Which syntax file you want to edit? "
-+msgstr " Soạn thảo tập tin cú pháp nào? "
-+
-+#: src/cmd.c:854
-+msgid " Compare directories "
-+msgstr " So sánh thư mục "
-+
-+#: src/cmd.c:855
-+msgid " Select compare method: "
-+msgstr " Chá»n phÆ°Æ¡ng pháp so sánh: "
-+
-+#: src/cmd.c:855
-+msgid "&Quick"
-+msgstr "&Nhanh"
-+
-+#: src/cmd.c:856
-+msgid "&Size only"
-+msgstr "&Chỉ theo kích thước"
-+
-+#: src/cmd.c:856
-+msgid "&Thorough"
-+msgstr "&Theo từng byte"
-+
-+#: src/cmd.c:869
-+msgid " Both panels should be in the listing mode to use this command "
-+msgstr "Äể thá»±c hiện câu lệnh này cả hai bảng phải ở trong chế Ä‘á»™ danh sách "
-+
-+#: src/cmd.c:885
-+msgid " The command history is empty "
-+msgstr " Lịch sử dòng lệnh rỗng "
-+
-+#: src/cmd.c:889
-+msgid " Command history "
-+msgstr " Lịch sử dòng lệnh "
-+
-+#: src/cmd.c:925
-+msgid ""
-+" Not an xterm or Linux console; \n"
-+" the panels cannot be toggled. "
-+msgstr ""
-+" Äây không phải là xterm hay kênh giao tác Linux; \n"
-+" bảng sẽ không thể bị tắt. "
-+
-+#: src/cmd.c:939
-+#, c-format
-+msgid "Link %s to:"
-+msgstr "Tạo liên kết tới %s:"
-+
-+#: src/cmd.c:940
-+msgid " Link "
-+msgstr " Liên kết "
-+
-+#: src/cmd.c:950
-+#, c-format
-+msgid " link: %s "
-+msgstr " liên kết: %s "
-+
-+#: src/cmd.c:978
-+#, c-format
-+msgid " symlink: %s "
-+msgstr " liên kết má»m: %s "
-+
-+#: src/cmd.c:1012
-+#, c-format
-+msgid " Symlink `%s' points to: "
-+msgstr " Liên kết má»m %s chỉ tá»›i: "
-+
-+#: src/cmd.c:1017
-+msgid " Edit symlink "
-+msgstr " Sá»­a liên kết má»m "
-+
-+#: src/cmd.c:1022
-+#, c-format
-+msgid " edit symlink, unable to remove %s: %s "
-+msgstr " sá»­a liên kết má»m, không thể xóa %s: %s "
-+
-+#: src/cmd.c:1026
-+#, c-format
-+msgid " edit symlink: %s "
-+msgstr " sá»­a liên kết má»m: %s "
-+
-+#: src/cmd.c:1037
-+#, c-format
-+msgid "`%s' is not a symbolic link"
-+msgstr "`%s' không phải là má»™t liên kết má»m"
-+
-+#: src/cmd.c:1155
-+#, c-format
-+msgid " Cannot chdir to %s "
-+msgstr " Không thể chdir vào %s "
-+
-+#: src/cmd.c:1164
-+msgid " Enter machine name (F1 for details): "
-+msgstr " Hãy nhập tên máy (nhấn F1 để biết chi tiết): "
-+
-+#: src/cmd.c:1169 src/widget.c:1051
-+msgid " Link to a remote machine "
-+msgstr " Kiết nối tới máy ở xa "
-+
-+#: src/cmd.c:1176 src/widget.c:1052
-+msgid " FTP to machine "
-+msgstr " FTP tới máy ở xa "
-+
-+#: src/cmd.c:1182
-+msgid " Shell link to machine "
-+msgstr " Kết nối shell tới máy ở xa"
-+
-+#: src/cmd.c:1189 src/widget.c:1053
-+msgid " SMB link to machine "
-+msgstr " Kết nối SMB tới máy ở xa"
-+
-+#: src/cmd.c:1198
-+msgid " Undelete files on an ext2 file system "
-+msgstr " Phục hồi tập tin trên hệ thống tập tin ext2 sau khi xóa "
-+
-+#: src/cmd.c:1199
-+msgid ""
-+" Enter device (without /dev/) to undelete\n"
-+"   files on: (F1 for details)"
-+msgstr ""
-+" Nhập tên thiết bị (không có /dev/), để\n"
-+" phục hồi tập tin của nó: (nhấn F1 để biết chi tiết)"
-+
-+#: src/cmd.c:1249
-+msgid " Setup saved to ~/"
-+msgstr " Tham số ghi nhớ trong ~/"
-+
-+#: src/cmd.c:1251
-+msgid " Setup "
-+msgstr " Cấu hình "
-+
-+#: src/command.c:177 src/screen.c:2174 src/tree.c:823
-+#, c-format
-+msgid ""
-+" Cannot chdir to \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không chdir được tới \"%s\" \n"
-+" %s "
-+
-+#: src/command.c:210 src/user.c:694
-+msgid " Cannot execute commands on non-local filesystems"
-+msgstr " Chỉ có thể thực hiện câu lệnh trên hệ thống tập tin nội bộ"
-+
-+#: src/command.c:219 src/execute.c:183
-+msgid " The shell is already running a command "
-+msgstr " shell đang chạy một câu lệnh"
-+
-+#: src/dir.c:49
-+msgid "&Unsorted"
-+msgstr "không &Sắp xếp"
-+
-+#: src/dir.c:50
-+msgid "&Name"
-+msgstr "th&Eo tên"
-+
-+#: src/dir.c:51
-+msgid "&Extension"
-+msgstr "&Phần mở rộng"
-+
-+#: src/dir.c:52
-+msgid "&Modify time"
-+msgstr "&Thá»i gian sá»­a đổi"
-+
-+#: src/dir.c:53
-+msgid "&Access time"
-+msgstr "thá»i &Gian truy cập"
-+
-+#: src/dir.c:54
-+msgid "&Change time"
-+msgstr "thá»i gi&An thay đổi"
-+
-+#: src/dir.c:55
-+msgid "&Size"
-+msgstr "&Kích thước"
-+
-+#: src/dir.c:56
-+msgid "&Inode"
-+msgstr "&Chỉ mục inode"
-+
-+#: src/dir.c:59
-+msgid "&Type"
-+msgstr "&Loại"
-+
-+#: src/dir.c:60
-+msgid "&Links"
-+msgstr "&Liên kết"
-+
-+#: src/dir.c:61
-+msgid "N&GID"
-+msgstr "N&GID"
-+
-+#: src/dir.c:62
-+msgid "N&UID"
-+msgstr "N&UID"
-+
-+#: src/dir.c:63
-+msgid "&Owner"
-+msgstr "&Chủ sở hữu"
-+
-+#: src/dir.c:64
-+msgid "&Group"
-+msgstr "&Nhóm"
-+
-+#: src/dir.c:475 src/dir.c:577
-+msgid "Cannot read directory contents"
-+msgstr "Không Ä‘á»c được ná»™i dung thÆ° mục"
-+
-+#: src/execute.c:133 src/utilunix.c:380
-+msgid "Press any key to continue..."
-+msgstr "Äể tiếp tục nhấn phím bất kỳ..."
-+
-+#: src/execute.c:235
-+msgid "Type `exit' to return to the Midnight Commander"
-+msgstr "Hãy gõ \"exit\" để quay trở lại Midnight Commander"
-+
-+#: src/execute.c:343
-+#, c-format
-+msgid " Cannot fetch a local copy of %s "
-+msgstr " Không thể lấy được bản sao nội bộ của %s "
-+
-+#: src/ext.c:106 src/user.c:566
-+#, c-format
-+msgid ""
-+" Cannot create temporary command file \n"
-+" %s "
-+msgstr ""
-+" Không tạo được tập tin câu lệnh tạm thá»i\n"
-+" %s "
-+
-+#: src/ext.c:119 src/user.c:589
-+msgid " Parameter "
-+msgstr " Tham số "
-+
-+#: src/ext.c:462 src/ext.c:481
-+msgid " file error "
-+msgstr " lỗi tập tin "
-+
-+#: src/ext.c:464 src/ext.c:483
-+msgid "Format of the "
-+msgstr "Äịnh dạng của "
-+
-+#: src/ext.c:465
-+msgid ""
-+"mc.ext file has changed\n"
-+"with version 3.0. It seems that installation\n"
-+"failed. Please fetch a fresh new copy from the\n"
-+"Midnight Commander package."
-+msgstr ""
-+"Tập tin mc.ext đã thay đổi\n"
-+"từ phiên bản 3.0. Rất có thể có sự cố khi cài đặt.\n"
-+"Xin hãy lấy bản sao mới nhất từ gói  \n"
-+"Midnight Commander."
-+
-+#: src/ext.c:484
-+msgid ""
-+" file has changed\n"
-+"with version 3.0. You may want either to\n"
-+"copy it from "
-+msgstr ""
-+" tập tin đã thay đổi\n"
-+"trong phiên bản 3.0. Có thể nên sao\n"
-+"chép nó từ "
-+
-+#: src/ext.c:487
-+msgid ""
-+"mc.ext or use that\n"
-+"file as an example of how to write it.\n"
-+msgstr ""
-+"mc.ext, hoặc sử dụng tập tin này làm\n"
-+"ví dụ để biết cách viết.\n"
-+
-+#: src/ext.c:490
-+msgid "mc.ext will be used for this moment."
-+msgstr "mc.ext sẽ được sá»­ dụng trong thá»i Ä‘iểm này."
-+
-+#: src/file.c:122 src/tree.c:593
-+msgid " Copy "
-+msgstr " Sao chép "
-+
-+#: src/file.c:123 src/tree.c:634
-+msgid " Move "
-+msgstr " Di chuyển "
-+
-+#: src/file.c:124 src/tree.c:708
-+msgid " Delete "
-+msgstr " Xóa "
-+
-+#: src/file.c:217
-+msgid " Invalid target mask "
-+msgstr " Dấu hiệu đích đến không đúng "
-+
-+#: src/file.c:316
-+msgid " Cannot make the hardlink "
-+msgstr " Không thể tạo liên kết cứng "
-+
-+#: src/file.c:359
-+#, c-format
-+msgid ""
-+" Cannot read source link \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể Ä‘á»c liên kết nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:370
-+msgid ""
-+" Cannot make stable symlinks across non-local filesystems: \n"
-+"\n"
-+" Option Stable Symlinks will be disabled "
-+msgstr ""
-+" Không tạo được liên kết má»m bá»n vững giữa các hệ thống tập tin không phải ná»™i bá»™:\n"
-+"\n"
-+" Tùy chá»n \"Liên kết má»m Bá»n vững\" sẽ bị tắt "
-+
-+#: src/file.c:419
-+#, c-format
-+msgid ""
-+" Cannot create target symlink \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Khônt tạo được liên kết má»m đích \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:493
-+#, c-format
-+msgid ""
-+" Cannot overwrite directory \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể ghi chèn lên thư mục \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:504
-+#, c-format
-+msgid ""
-+" Cannot stat source file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không lấy được tính chất (stat) của tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:514 src/file.c:1115
-+#, c-format
-+msgid " `%s' and `%s' are the same file "
-+msgstr " `%s' và `%s' là một tập tin "
-+
-+#: src/file.c:552
-+#, c-format
-+msgid ""
-+" Cannot create special file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không tạo được tập tin đặc biệt \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:564 src/file.c:813
-+#, c-format
-+msgid ""
-+" Cannot chown target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thay đổi được chủ sở hữu của tập tin đích đến \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:575 src/file.c:830
-+#, c-format
-+msgid ""
-+" Cannot chmod target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thay đổi được quyá»n hạn (chmod) của tập tin đích đến \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:589
-+#, c-format
-+msgid ""
-+" Cannot open source file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không mở được tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:600
-+msgid " Reget failed, about to overwrite file "
-+msgstr " Lấy phần còn lại của tập tin không thành công, tập tin sẽ bị ghi đè "
-+
-+#: src/file.c:607
-+#, c-format
-+msgid ""
-+" Cannot fstat source file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không lấy được tính chất (fstat) tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:631
-+#, c-format
-+msgid ""
-+" Cannot create target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không tạo được tập tin đích \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:646
-+#, c-format
-+msgid ""
-+" Cannot fstat target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không lấy được tính chất (fstat) tập tin đích \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:680
-+#, c-format
-+msgid ""
-+" Cannot read source file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không Ä‘á»c được tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:715
-+#, c-format
-+msgid ""
-+" Cannot write target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không ghi nhớ được tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:733
-+msgid "(stalled)"
-+msgstr "(bị nhốt)"
-+
-+#: src/file.c:780
-+#, c-format
-+msgid ""
-+" Cannot close source file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không đóng được tập tin nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:791
-+#, c-format
-+msgid ""
-+" Cannot close target file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không đóng được tập tin đính \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:804
-+msgid "Incomplete file was retrieved. Keep it?"
-+msgstr "Nhận được tập tin không đầy đủ. Giữ tập tin?"
-+
-+#: src/file.c:805
-+msgid "&Delete"
-+msgstr "&Xóa"
-+
-+#: src/file.c:805
-+msgid "&Keep"
-+msgstr "&Giữ"
-+
-+#: src/file.c:873
-+#, c-format
-+msgid ""
-+" Cannot stat source directory \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không lấy được thông tin (stat) thư mục nguồn \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:900
-+#, c-format
-+msgid ""
-+" Source directory \"%s\" is not a directory \n"
-+" %s "
-+msgstr ""
-+" Thư mục nguồn \"%s\" không phải là một thư mục \n"
-+" %s "
-+
-+#: src/file.c:910
-+#, c-format
-+msgid ""
-+" Cannot copy cyclic symbolic link \n"
-+" `%s' "
-+msgstr ""
-+" Không sao chép được liên kết má»m vòng lặp \n"
-+" `%s' "
-+
-+#: src/file.c:945 src/file.c:1985 src/tree.c:648
-+#, c-format
-+msgid ""
-+" Destination \"%s\" must be a directory \n"
-+" %s "
-+msgstr ""
-+" Nơi đến \"%s\" phải là một thư mục \n"
-+" %s "
-+
-+#: src/file.c:975
-+#, c-format
-+msgid ""
-+" Cannot create target directory \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không tạo được thư mục đích đến \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:994
-+#, c-format
-+msgid ""
-+" Cannot chown target directory \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thay đổi được chủ sở hữu (chown) của thư mục đích đến \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1096
-+#, c-format
-+msgid ""
-+" Cannot stat file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không nhận được tính chất (stat) của tập tin \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1122
-+#, c-format
-+msgid " Cannot overwrite directory `%s' "
-+msgstr " Không thể ghi đè lên thư mục `%s' "
-+
-+#: src/file.c:1157
-+#, c-format
-+msgid ""
-+" Cannot move file \"%s\" to \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể di chuyển tập tin \"%s\" vào \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1181
-+#, c-format
-+msgid ""
-+" Cannot remove file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể xóa tập tin \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1233
-+#, c-format
-+msgid " `%s' and `%s' are the same directory "
-+msgstr " %s và %s - là một thư mục "
-+
-+#: src/file.c:1252
-+#, c-format
-+msgid " Cannot overwrite directory \"%s\" %s "
-+msgstr " Không thể ghi đè lên thư mục \"%s\" %s "
-+
-+#: src/file.c:1256
-+#, c-format
-+msgid " Cannot overwrite file \"%s\" %s "
-+msgstr " Không thể ghi đè tập tin \"%s\" %s "
-+
-+#: src/file.c:1282
-+#, c-format
-+msgid ""
-+" Cannot move directory \"%s\" to \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể di chuyển thư mục \"%s\" vào \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1352
-+#, c-format
-+msgid ""
-+" Cannot delete file \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể xóa tập tin \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1412 src/file.c:1481 src/file.c:1509
-+#, c-format
-+msgid ""
-+" Cannot remove directory \"%s\" \n"
-+" %s "
-+msgstr ""
-+" Không thể xóa thư mục \"%s\" \n"
-+" %s "
-+
-+#: src/file.c:1657
-+msgid "1Copy"
-+msgstr "1Sao chép"
-+
-+#: src/file.c:1657
-+msgid "1Move"
-+msgstr "1Di chuyển"
-+
-+#: src/file.c:1657
-+msgid "1Delete"
-+msgstr "1Xóa"
-+
-+#: src/file.c:1672
-+#, no-c-format
-+msgid "%o %f \"%s\"%m"
-+msgstr "%o %f \"%s\"%m"
-+
-+# msgfmt warnings/errors must be ignored. mc parse this pattern itself.
-+#: src/file.c:1674
-+#, no-c-format
-+msgid "%o %d %f%m"
-+msgstr "%o (%d cái) %f%m"
-+
-+#: src/file.c:1676 vfs/fish.c:561
-+msgid "file"
-+msgstr "tập tin"
-+
-+#: src/file.c:1676
-+msgid "files"
-+msgstr "các tập tin"
-+
-+#: src/file.c:1676
-+msgid "directory"
-+msgstr "thư mục"
-+
-+#: src/file.c:1676
-+msgid "directories"
-+msgstr "Các thư mục"
-+
-+#: src/file.c:1677
-+msgid "files/directories"
-+msgstr "tập tin/thư mục"
-+
-+#: src/file.c:1677
-+msgid " with source mask:"
-+msgstr " với nhãn ban đầu:"
-+
-+#: src/file.c:1677
-+msgid " to:"
-+msgstr " vào:"
-+
-+#: src/file.c:1821
-+msgid " Cannot operate on \"..\"! "
-+msgstr " Không thể thao tác trên \"..\"! "
-+
-+#: src/file.c:1877
-+msgid " Sorry, I could not put the job in background "
-+msgstr " Xin lá»—i, không thể đặt công việc nào vào chế Ä‘á»™ ná»n sau "
-+
-+#: src/file.c:2147 src/view.c:441
-+msgid "&Retry"
-+msgstr "&Thử lại"
-+
-+#: src/file.c:2148 src/file.c:2211 src/filegui.c:207 src/filegui.c:517
-+msgid "&Abort"
-+msgstr "&Dừng"
-+
-+#: src/file.c:2200
-+msgid ""
-+"\n"
-+"   Directory not empty.   \n"
-+"   Delete it recursively? "
-+msgstr ""
-+"\n"
-+"   Thư mục không rỗng.    \n"
-+"   Xóa toàn bộ (đệ quy)? "
-+
-+#: src/file.c:2202
-+msgid ""
-+"\n"
-+"   Background process: Directory not empty \n"
-+"   Delete it recursively? "
-+msgstr ""
-+"\n"
-+"   Tiến trình ná»n sau: ThÆ° mục không rá»—ng \n"
-+"   Xóa toàn bộ (đệ quy)? "
-+
-+#: src/file.c:2204
-+msgid " Delete: "
-+msgstr " Xóa: "
-+
-+#: src/file.c:2210 src/filegui.c:519
-+msgid "Non&e"
-+msgstr "&Không"
-+
-+#: src/filegui.c:324
-+#, c-format
-+msgid "ETA %d:%02d.%02d"
-+msgstr "Còn lại %d:%02d.%02d"
-+
-+#: src/filegui.c:347
-+#, c-format
-+msgid "%.2f MB/s"
-+msgstr "%.2f МB/giây"
-+
-+#: src/filegui.c:350
-+#, c-format
-+msgid "%.2f KB/s"
-+msgstr "%.2f KB/giây"
-+
-+#: src/filegui.c:353
-+#, c-format
-+msgid "%ld B/s"
-+msgstr "%ld B/giây"
-+
-+#: src/filegui.c:376
-+msgid "File"
-+msgstr "Tập tin"
-+
-+#: src/filegui.c:399
-+msgid "Count"
-+msgstr "Äếm"
-+
-+#: src/filegui.c:420
-+msgid "Bytes"
-+msgstr "Byte"
-+
-+#: src/filegui.c:453
-+msgid "Source"
-+msgstr "Nguồn"
-+
-+#: src/filegui.c:476
-+msgid "Target"
-+msgstr "Äích"
-+
-+#: src/filegui.c:498
-+msgid "Deleting"
-+msgstr "Äang xóa"
-+
-+#: src/filegui.c:516
-+#, c-format
-+msgid "Target file \"%s\" already exists!"
-+msgstr "Tập tin đích \"%s\" đã tồn tại!"
-+
-+#: src/filegui.c:518
-+msgid "If &size differs"
-+msgstr "&Nếu kích thước khác nhau"
-+
-+#: src/filegui.c:520
-+msgid "&Update"
-+msgstr "&Cập nhật"
-+
-+#: src/filegui.c:522
-+msgid "Overwrite all targets?"
-+msgstr "Khi đè lên má»i tập tin đích?"
-+
-+#: src/filegui.c:523
-+msgid "&Reget"
-+msgstr "&Lấy lại"
-+
-+#: src/filegui.c:524
-+msgid "A&ppend"
-+msgstr "&Thêm vào cuối"
-+
-+#: src/filegui.c:527
-+msgid "Overwrite this target?"
-+msgstr "Khi đè lên tập tin này?"
-+
-+#: src/filegui.c:528
-+#, c-format
-+msgid "Target date: %s, size %d"
-+msgstr "Thá»i gian sá»­a đổi của tập tin đích: %s, kích thÆ°á»›c %d"
-+
-+#: src/filegui.c:529
-+#, c-format
-+msgid "Source date: %s, size %d"
-+msgstr "Thá»i gian sá»­a đổi của tập tin nguồn: %s, kích thÆ°á»›c %d"
-+
-+#: src/filegui.c:604
-+msgid " File exists "
-+msgstr " Tập tin tồn tại "
-+
-+#: src/filegui.c:606
-+msgid " Background process: File exists "
-+msgstr " Tiến trình ná»n sau: tập tin tồn tại "
-+
-+#: src/filegui.c:728
-+msgid "preserve &Attributes"
-+msgstr "&Ghi nhớ thuộc tính"
-+
-+#: src/filegui.c:730
-+msgid "follow &Links"
-+msgstr "đi theo &Liên kết"
-+
-+#: src/filegui.c:732
-+msgid "to:"
-+msgstr "vào:"
-+
-+#: src/filegui.c:733
-+msgid "&Using shell patterns"
-+msgstr "&Sử dụng mẫu (pattern) của shell"
-+
-+#: src/filegui.c:754
-+msgid "&Background"
-+msgstr "&Trong ná»n sau"
-+
-+#: src/filegui.c:764
-+msgid "&Stable Symlinks"
-+msgstr "liên kết &Bá»n vững"
-+
-+#: src/filegui.c:766
-+msgid "&Dive into subdir if exists"
-+msgstr "&Vào thư mục con, nếu có"
-+
-+#: src/filegui.c:938
-+#, c-format
-+msgid ""
-+"Invalid source pattern `%s' \n"
-+" %s "
-+msgstr ""
-+"Mẫu không đúng `%s' \n"
-+" %s "
-+
-+#: src/find.c:99
-+msgid "&Suspend"
-+msgstr "&Hoãn"
-+
-+#: src/find.c:100
-+msgid "Con&tinue"
-+msgstr "&Tiếp tục"
-+
-+#: src/find.c:101
-+msgid "&Chdir"
-+msgstr "&Chuyển thư mục"
-+
-+#: src/find.c:102
-+msgid "&Again"
-+msgstr "&Lặp lại"
-+
-+#: src/find.c:103 src/subshell.c:323
-+msgid "&Quit"
-+msgstr "&Thoát"
-+
-+#: src/find.c:104 src/panelize.c:69
-+msgid "Pane&lize"
-+msgstr "&Bảng"
-+
-+#: src/find.c:105
-+msgid "&View - F3"
-+msgstr "X&em - F3"
-+
-+#: src/find.c:106
-+msgid "&Edit - F4"
-+msgstr "&Soạn thảo - F4"
-+
-+#: src/find.c:183
-+msgid "Start at:"
-+msgstr "Bắt đầu từ:"
-+
-+#: src/find.c:183
-+msgid "Filename:"
-+msgstr "Tên tập tin:"
-+
-+#: src/find.c:183
-+msgid "Content: "
-+msgstr "Ná»™i dung: "
-+
-+#: src/find.c:184 src/main.c:795 src/main.c:819
-+msgid "&Tree"
-+msgstr "&Cây thư mục"
-+
-+#: src/find.c:232 src/find.c:792
-+msgid "Find File"
-+msgstr "Tìm tập tin"
-+
-+#: src/find.c:464
-+#, c-format
-+msgid "Grepping in %s"
-+msgstr "Tìm trong %s"
-+
-+#: src/find.c:538
-+msgid "Finished"
-+msgstr "Kết thúc"
-+
-+#: src/find.c:565 src/view.c:1594
-+#, c-format
-+msgid "Searching %s"
-+msgstr "Tìm %s"
-+
-+#: src/find.c:721 src/find.c:818
-+msgid "Searching"
-+msgstr "Tìm"
-+
-+#: src/help.c:279
-+msgid " Help file format error\n"
-+msgstr " Lỗi định dạng tập tin trợ giúp\n"
-+
-+#: src/help.c:318
-+msgid " Internal bug: Double start of link area "
-+msgstr " Lỗi (bug) nội bộ: vùng liên kết có hai đầu "
-+
-+#: src/help.c:554 src/help.c:778
-+#, c-format
-+msgid " Cannot find node %s in help file "
-+msgstr " Không tìm thấy nút %s trong tập tin trợ giúp "
-+
-+#: src/help.c:816
-+msgid "Index"
-+msgstr "Chỉ mục"
-+
-+#: src/help.c:818
-+msgid "Prev"
-+msgstr "Quay lại"
-+
-+#: src/hotlist.c:115
-+msgid "&Move"
-+msgstr "&Di chuyển"
-+
-+#: src/hotlist.c:116 src/panelize.c:68
-+msgid "&Remove"
-+msgstr "&Xóa"
-+
-+#: src/hotlist.c:117 src/hotlist.c:834 src/hotlist.c:930
-+msgid "&Append"
-+msgstr "&Thêm vào"
-+
-+#: src/hotlist.c:118 src/hotlist.c:832 src/hotlist.c:928
-+msgid "&Insert"
-+msgstr "c&Hèn"
-+
-+#: src/hotlist.c:119
-+msgid "New &Entry"
-+msgstr "tạo &Mục mới"
-+
-+#: src/hotlist.c:120
-+msgid "New &Group"
-+msgstr "&Nhóm mới"
-+
-+#: src/hotlist.c:122
-+msgid "&Up"
-+msgstr "&Lên"
-+
-+#: src/hotlist.c:123
-+msgid "&Add current"
-+msgstr "&Thêm hiện thá»i"
-+
-+#: src/hotlist.c:125
-+msgid "&Refresh"
-+msgstr "&Làm mới"
-+
-+#: src/hotlist.c:126
-+msgid "Fr&ee VFSs now"
-+msgstr "&Giải phóng"
-+
-+#: src/hotlist.c:128
-+msgid "Change &To"
-+msgstr "&Chuyển tới"
-+
-+#: src/hotlist.c:177
-+msgid "Subgroup - press ENTER to see list"
-+msgstr "Nhóm con - nhấn ENTER để xem danh sách"
-+
-+#: src/hotlist.c:609
-+msgid "Active VFS directories"
-+msgstr "Thư mục VFS hoạt động"
-+
-+#: src/hotlist.c:612
-+msgid "Directory hotlist"
-+msgstr "Danh sách thÆ° mục thÆ°á»ng dùng"
-+
-+#: src/hotlist.c:640
-+msgid " Directory path "
-+msgstr " ÄÆ°á»ng dẫn tá»›i thÆ° mục "
-+
-+#: src/hotlist.c:643 src/hotlist.c:692
-+msgid " Directory label "
-+msgstr " Nhãn thư mục"
-+
-+#: src/hotlist.c:668
-+#, c-format
-+msgid "Moving %s"
-+msgstr "Di chuyển %s"
-+
-+#: src/hotlist.c:907
-+msgid "New hotlist entry"
-+msgstr " Thêm bản ghi vào tra cứu"
-+
-+#: src/hotlist.c:907
-+msgid "Directory label"
-+msgstr " Tên nhãn thư mục"
-+
-+#: src/hotlist.c:907
-+msgid "Directory path"
-+msgstr " ÄÆ°á»ng dẫn tá»›i thÆ° mục"
-+
-+#: src/hotlist.c:987
-+msgid " New hotlist group "
-+msgstr " Thêm nhóm vào tra cứu "
-+
-+#: src/hotlist.c:987
-+msgid "Name of new group"
-+msgstr " Tên nhóm mới"
-+
-+#: src/hotlist.c:1002
-+#, c-format
-+msgid "Label for \"%s\":"
-+msgstr " Tên nhãn cho \"%s\":"
-+
-+#: src/hotlist.c:1006
-+msgid " Add to hotlist "
-+msgstr " Thêm vào tra cứu "
-+
-+#: src/hotlist.c:1043
-+msgid " Remove: "
-+msgstr " Xóa: "
-+
-+#: src/hotlist.c:1047
-+msgid ""
-+"\n"
-+" Group not empty.\n"
-+" Remove it?"
-+msgstr ""
-+"\n"
-+" Nhóm không rỗng.\n"
-+" Xóa nó?"
-+
-+#: src/hotlist.c:1391
-+msgid " Top level group "
-+msgstr "Nhóm cấp độ cao nhất "
-+
-+#: src/hotlist.c:1414
-+msgid "MC was unable to write ~/"
-+msgstr "MC không thể ghi nhớ ~/"
-+
-+#: src/hotlist.c:1415
-+msgid " file, your old hotlist entries were not deleted"
-+msgstr " tập tin, tra cứu thư mục cũ chưa bị xóa"
-+
-+#: src/hotlist.c:1417
-+msgid " Hotlist Load "
-+msgstr " Nạp tra cứu "
-+
-+#: src/info.c:74
-+#, c-format
-+msgid "Midnight Commander %s"
-+msgstr "Midnight Commander %s"
-+
-+#: src/info.c:91
-+#, c-format
-+msgid "File:       %s"
-+msgstr "Tập tin:       %s"
-+
-+#: src/info.c:103
-+#, c-format
-+msgid "Free nodes: %d (%d%%) of %d"
-+msgstr "Nút tự do: %d (%d%%) trong tổng số %d"
-+
-+#: src/info.c:109
-+msgid "No node information"
-+msgstr "Không có thông tin vỠnút (node)"
-+
-+#: src/info.c:117
-+#, c-format
-+msgid "Free space: %s (%d%%) of %s"
-+msgstr "Chỗ trống:    %s (%d%%) của %s"
-+
-+#: src/info.c:121
-+msgid "No space information"
-+msgstr "Không có thông tin vỠkhoảng trống"
-+
-+#: src/info.c:125
-+#, c-format
-+msgid "Type:      %s "
-+msgstr "Loại:         %s "
-+
-+#: src/info.c:125
-+msgid "non-local vfs"
-+msgstr "không phải vfs cục bộ"
-+
-+#: src/info.c:131
-+#, c-format
-+msgid "Device:    %s"
-+msgstr "Thiết bị:     %s"
-+
-+#: src/info.c:135
-+#, c-format
-+msgid "Filesystem: %s"
-+msgstr "Hệ thống tập tin: %s"
-+
-+#: src/info.c:140
-+#, c-format
-+msgid "Accessed:  %s"
-+msgstr "Truy cập:     %s"
-+
-+#: src/info.c:144
-+#, c-format
-+msgid "Modified:  %s"
-+msgstr "Sửa đổi:      %s"
-+
-+#: src/info.c:148
-+#, c-format
-+msgid "Created:   %s"
-+msgstr "Tạo ra:       %s"
-+
-+#: src/info.c:163
-+#, c-format
-+msgid "Size:      %s"
-+msgstr "Kích thước:   %s"
-+
-+#: src/info.c:166
-+#, c-format
-+msgid " (%d block)"
-+msgstr " (%d khối)"
-+
-+#: src/info.c:166
-+#, c-format
-+msgid " (%d blocks)"
-+msgstr " (%d khối)"
-+
-+#: src/info.c:172
-+#, c-format
-+msgid "Owner:     %s/%s"
-+msgstr "Chủ sở hữu:   %s/%s"
-+
-+#: src/info.c:177
-+#, c-format
-+msgid "Links:     %d"
-+msgstr "Liên kết:     %d"
-+
-+#: src/info.c:181
-+#, c-format
-+msgid "Mode:      %s (%04o)"
-+msgstr "Quyá»n hạn:    %s (%04o)"
-+
-+#: src/info.c:186
-+#, c-format
-+msgid "Location:  %Xh:%Xh"
-+msgstr "Vị trí:       %Xh:%Xh"
-+
-+#: src/info.c:196
-+msgid "File:       None"
-+msgstr "Tập tin:      Không có"
-+
-+#: src/layout.c:151
-+msgid "&Vertical"
-+msgstr "&Thẳng đứng"
-+
-+#: src/layout.c:152
-+msgid "&Horizontal"
-+msgstr "&Nằm ngang"
-+
-+#: src/layout.c:162
-+msgid "&Xterm window title"
-+msgstr "tiê&U đỠcửa sổ xterm"
-+
-+#: src/layout.c:163
-+msgid "h&Intbar visible"
-+msgstr "dòng &Gợi ý"
-+
-+#: src/layout.c:164
-+msgid "&Keybar visible"
-+msgstr "&Hiển thị thanh phím tắt"
-+
-+#: src/layout.c:165
-+msgid "command &Prompt"
-+msgstr "&Dòng lệnh"
-+
-+#: src/layout.c:166
-+msgid "show &Mini status"
-+msgstr "hiện trạng thái m&Ini"
-+
-+#: src/layout.c:167
-+msgid "menu&Bar visible"
-+msgstr "thAnh trình đơn"
-+
-+#: src/layout.c:168
-+msgid "&Equal split"
-+msgstr "&Kích thước bằng nhau"
-+
-+#: src/layout.c:169
-+msgid "pe&Rmissions"
-+msgstr "&Quyá»n truy cập"
-+
-+#: src/layout.c:170
-+msgid "&File types"
-+msgstr "&Loại tập tin"
-+
-+#: src/layout.c:350 src/learn.c:59 src/learn.c:174 src/option.c:115
-+msgid "&Save"
-+msgstr "Ghi nhá»› &+"
-+
-+#: src/layout.c:358
-+msgid " Panel split "
-+msgstr " Chia bảng "
-+
-+#: src/layout.c:359
-+msgid " Highlight... "
-+msgstr " Chiếu sáng... "
-+
-+#: src/layout.c:360 src/option.c:125
-+msgid " Other options "
-+msgstr " Cấu hình khác "
-+
-+#: src/layout.c:361
-+msgid "output lines"
-+msgstr "dòng kết quả"
-+
-+#: src/layout.c:423
-+msgid "Layout"
-+msgstr "Vẻ ngoài"
-+
-+#: src/learn.c:73
-+msgid "Learn keys"
-+msgstr "Tạo phím tắt"
-+
-+#: src/learn.c:79
-+msgid " Teach me a key "
-+msgstr " Dạy tôi một phím "
-+
-+#: src/learn.c:80
-+#, c-format
-+msgid ""
-+"Please press the %s\n"
-+"and then wait until this message disappears.\n"
-+"\n"
-+"Then, press it again to see if OK appears\n"
-+"next to its button.\n"
-+"\n"
-+"If you want to escape, press a single Escape key\n"
-+"and wait as well."
-+msgstr ""
-+"Xin hãy nhấn lên %s\n"
-+"và đợi cho thông báo này biến mất.\n"
-+"\n"
-+"Sau đó hãy nhấn một lần nữa để chắc chắn là ở bên phải\n"
-+"của tên xuất hiện \"OK\".\n"
-+"\n"
-+"Nếu bạn muốn dừng việc dạy phím, thì hãy nhấn\n"
-+"phím Esc và cũng cần đợi một chút."
-+
-+#: src/learn.c:114
-+msgid " Cannot accept this key "
-+msgstr " Không thể chấp nhận phím này "
-+
-+#: src/learn.c:115
-+#, c-format
-+msgid " You have entered \"%s\""
-+msgstr " Äã nhập vào \"%s\""
-+
-+#. TRANSLATORS: This label appears near learned keys.  Keep it short.
-+#: src/learn.c:164
-+msgid "OK"
-+msgstr "OK"
-+
-+#: src/learn.c:172
-+msgid ""
-+"It seems that all your keys already\n"
-+"work fine. That's great."
-+msgstr ""
-+"Có vẻ như tất cả các phím của bạn\n"
-+"làm việc tốt. Thật là tuyệt."
-+
-+#: src/learn.c:174
-+msgid "&Discard"
-+msgstr "&Vứt bá»"
-+
-+#: src/learn.c:179
-+msgid ""
-+"Great! You have a complete terminal database!\n"
-+"All your keys work well."
-+msgstr ""
-+"Tuyệt! Chúng ta có một cơ sở dữ liệu mô tả terminal đầy đủ!\n"
-+"Tất cả các phím Ä‘á»u làm việc tốt."
-+
-+#: src/learn.c:287
-+msgid "Press all the keys mentioned here. After you have done it, check"
-+msgstr "Hãy nhấn tất cả những phím liệt kê ở trên. Sau khi nhấn xong, hãy kiểm tra"
-+
-+#: src/learn.c:291
-+msgid "which keys are not marked with OK.  Press space on the missing"
-+msgstr "xem những phím nào không có dấu hiệu \"OK\".  Nhấn phím space trên những"
-+
-+#: src/learn.c:295
-+msgid "key, or click with the mouse to define it. Move around with Tab."
-+msgstr "phím bị thiếu, hoặc nhấn chuột để xác định. Di chuyển bằng Tab."
-+
-+#: src/main.c:425
-+msgid ""
-+" The Commander can't change to the directory that \n"
-+" the subshell claims you are in.  Perhaps you have \n"
-+" deleted your working directory, or given yourself \n"
-+" extra access permissions with the \"su\" command? "
-+msgstr ""
-+" MC không thể chuyển vào thư mục, mà tiến trình shell \n"
-+" con thông báo. Rất có thể, bạn đã xóa thư mục làm việc \n"
-+" hoặc thêm cho mình quyá»n truy cập mở rá»™ng bằng câu \n"
-+" lệnh \"su\"? "
-+
-+#: src/main.c:469 src/screen.c:1951
-+msgid " The Midnight Commander "
-+msgstr " Midnight Commander "
-+
-+#: src/main.c:470
-+msgid " Do you really want to quit the Midnight Commander? "
-+msgstr " Thực sự muốn thoát Midnight Commander? "
-+
-+#: src/main.c:792 src/main.c:816
-+msgid "&Listing mode..."
-+msgstr "&Dạng danh sách..."
-+
-+#: src/main.c:793 src/main.c:817
-+msgid "&Quick view     C-x q"
-+msgstr "&Xem nhanh     C-x q"
-+
-+#: src/main.c:794 src/main.c:818
-+msgid "&Info           C-x i"
-+msgstr "&Thông tin     C-x i"
-+
-+#: src/main.c:797 src/main.c:821
-+msgid "&Sort order..."
-+msgstr "t&Hứ tự sắp xếp..."
-+
-+#: src/main.c:799 src/main.c:823
-+msgid "&Filter..."
-+msgstr "&Lá»c tập tin..."
-+
-+#: src/main.c:803 src/main.c:827
-+msgid "&Network link..."
-+msgstr "&Kết nối mạng..."
-+
-+#: src/main.c:805 src/main.c:829
-+msgid "FT&P link..."
-+msgstr "kết nối &FTP..."
-+
-+#: src/main.c:806 src/main.c:830
-+msgid "S&hell link..."
-+msgstr "kết nối &Shell..."
-+
-+#: src/main.c:808 src/main.c:832
-+msgid "SM&B link..."
-+msgstr "kết nối SM&B..."
-+
-+#: src/main.c:812 src/main.c:836
-+msgid "&Rescan         C-r"
-+msgstr "&Quét lại        C-r"
-+
-+#: src/main.c:840
-+msgid "&User menu          F2"
-+msgstr "&Trình Ä‘Æ¡n ngÆ°á»i dùng   F2"
-+
-+#: src/main.c:841
-+msgid "&View               F3"
-+msgstr "&Xem                    F3"
-+
-+#: src/main.c:842
-+msgid "Vie&w file...         "
-+msgstr "x&Em tập tin...       "
-+
-+#: src/main.c:843
-+msgid "&Filtered view     M-!"
-+msgstr "xe&M đã lá»c            M-!"
-+
-+#: src/main.c:844
-+msgid "&Edit               F4"
-+msgstr "&Soạn thảo              F4"
-+
-+#: src/main.c:845
-+msgid "&Copy               F5"
-+msgstr "sao &Chép               F5"
-+
-+#: src/main.c:846
-+msgid "c&Hmod           C-x c"
-+msgstr "c&Hmod               C-x c"
-+
-+#: src/main.c:847
-+msgid "&Link            C-x l"
-+msgstr "&Liên kết cứng       C-x l"
-+
-+#: src/main.c:848
-+msgid "&SymLink         C-x s"
-+msgstr "liên &Kết má»m        C-x s"
-+
-+#: src/main.c:849
-+msgid "edit s&Ymlink  C-x C-s"
-+msgstr "sá»­&A liên kết má»m  C-x C-s"
-+
-+#: src/main.c:850
-+msgid "ch&Own           C-x o"
-+msgstr "cho&Wn               C-x o"
-+
-+#: src/main.c:851
-+msgid "&Advanced chown       "
-+msgstr "chown &Nâng cao      "
-+
-+#: src/main.c:852
-+msgid "&Rename/Move        F6"
-+msgstr "Äổi tên/&Di chuyển      F6"
-+
-+#: src/main.c:853
-+msgid "&Mkdir              F7"
-+msgstr "mkdi&R                  F7"
-+
-+#: src/main.c:854
-+msgid "&Delete             F8"
-+msgstr "xó&A                    F8"
-+
-+#: src/main.c:855
-+msgid "&Quick cd          M-c"
-+msgstr "cd nhanh &>           M-c"
-+
-+#: src/main.c:857
-+msgid "select &Group      M-+"
-+msgstr "Chá»n Nhóm &+           M-+"
-+
-+#: src/main.c:858
-+msgid "u&Nselect group    M-\\"
-+msgstr "&Bá» chá»n nhóm          M-\\"
-+
-+#: src/main.c:859
-+msgid "reverse selec&Tion M-*"
-+msgstr "Chá»n ngược lạ&I        M-*"
-+
-+#: src/main.c:861
-+msgid "e&Xit              F10"
-+msgstr "Th&Oát                 F10"
-+
-+#: src/main.c:869
-+msgid "&Directory tree"
-+msgstr "cây thư &Mục"
-+
-+#: src/main.c:870
-+msgid "&Find file            M-?"
-+msgstr "&Tìm tập tin                   M-?"
-+
-+#: src/main.c:871
-+msgid "s&Wap panels          C-u"
-+msgstr "đổi chỗ h&Ai bảng              C-u"
-+
-+#: src/main.c:872
-+msgid "switch &Panels on/off C-o"
-+msgstr "&Bật/tắt bảng                  C-o"
-+
-+#: src/main.c:873
-+msgid "&Compare directories  C-x d"
-+msgstr "&So sánh thư mục             C-x d"
-+
-+#: src/main.c:874
-+msgid "e&Xternal panelize    C-x !"
-+msgstr "bản&G ngoài                  C-x !"
-+
-+#: src/main.c:875
-+msgid "show directory s&Izes"
-+msgstr "&Hiển thị kích thước thư mục"
-+
-+#: src/main.c:877
-+msgid "command &History"
-+msgstr "&Lịch sử câu lệnh"
-+
-+#: src/main.c:878
-+msgid "di&Rectory hotlist    C-\\"
-+msgstr "ThÆ° mục thÆ°á»ng dùng &*         C-\\"
-+
-+#: src/main.c:880
-+msgid "&Active VFS list      C-x a"
-+msgstr "&Danh sách VFS hoạt động     C-x a"
-+
-+#: src/main.c:883
-+msgid "&Background jobs      C-x j"
-+msgstr "&Công việc ná»n sau           C-x j"
-+
-+#: src/main.c:887
-+msgid "&Undelete files (ext2fs only)"
-+msgstr "&Phục hồi tập tin đã xóa (chỉ ext2fs)"
-+
-+#: src/main.c:890
-+msgid "&Listing format edit"
-+msgstr "&Soạn thảo định dạng danh sách"
-+
-+#: src/main.c:895
-+msgid "Edit &extension file"
-+msgstr "soạn thảo tập tin phần mở &Rộng"
-+
-+#: src/main.c:896
-+msgid "Edit &menu file"
-+msgstr "soạ&N thảo tập tin trình đơn"
-+
-+#: src/main.c:898
-+msgid "Edit edi&tor menu file"
-+msgstr "sửa trình đơn của trình s&Oạn thảo"
-+
-+#: src/main.c:899
-+msgid "Edit &syntax file"
-+msgstr "sửa tập tin cú &Pháp"
-+
-+#: src/main.c:905
-+msgid "&Configuration..."
-+msgstr "&Cấu hình..."
-+
-+#: src/main.c:906
-+msgid "&Layout..."
-+msgstr "&Vẻ ngoài..."
-+
-+#: src/main.c:907
-+msgid "c&Onfirmation..."
-+msgstr "&Xác nhận..."
-+
-+#: src/main.c:908
-+msgid "&Display bits..."
-+msgstr "bit &Hiển thị..."
-+
-+#: src/main.c:911
-+msgid "&Virtual FS..."
-+msgstr "&FS ảo..."
-+
-+#: src/main.c:914
-+msgid "&Save setup"
-+msgstr "&Ghi nhớ cấu hình"
-+
-+#: src/main.c:925
-+msgid " &Above "
-+msgstr " Ở &trên "
-+
-+#: src/main.c:925
-+msgid " &Left "
-+msgstr " &Bảng trái "
-+
-+#: src/main.c:929
-+msgid " &File "
-+msgstr " &Tập tin "
-+
-+#: src/main.c:932
-+msgid " &Command "
-+msgstr " &Câu lệnh "
-+
-+#: src/main.c:935
-+msgid " &Options "
-+msgstr " &Cấu hình "
-+
-+#: src/main.c:938
-+msgid " &Below "
-+msgstr " Ở &dưới "
-+
-+#: src/main.c:938
-+msgid " &Right "
-+msgstr " Bảng &phải "
-+
-+#: src/main.c:981
-+msgid " Information "
-+msgstr " Thông tin "
-+
-+#: src/main.c:983
-+msgid ""
-+" Using the fast reload option may not reflect the exact \n"
-+" directory contents. In this case you'll need to do a   \n"
-+" manual reload of the directory. See the man page for   \n"
-+" the details.                                           "
-+msgstr ""
-+" Sá»­ dụng tùy chá»n nạp lại nhanh có thể không phản ánh   \n"
-+" đúng ná»™i dung hiện thá»i của thÆ° mục. Trong trÆ°á»ng hợp  \n"
-+" này cần nạp lại thư mục một cách thủ công. Hãy xem     \n"
-+" trang hướng dẫn sử dụng man để biết them chi tiết.     "
-+
-+#: src/main.c:1206 src/screen.c:2185
-+msgid "Menu"
-+msgstr "Trđơn "
-+
-+#: src/main.c:1340
-+msgid "The TERM environment variable is unset!\n"
-+msgstr "Biến môi trÆ°á»n TERM chÆ°a được xác định!\n"
-+
-+#: src/main.c:1642 src/textconf.c:116
-+#, c-format
-+msgid "GNU Midnight Commander %s\n"
-+msgstr "GNU Midnight Commander %s\n"
-+
-+#: src/main.c:1848
-+msgid "[flags] [this_dir] [other_panel_dir]\n"
-+msgstr "[cá»] [thÆ°_mục_này] [thÆ°_mục_bảng_còn_lại]\n"
-+
-+#: src/main.c:1852
-+msgid "+number"
-+msgstr "+số"
-+
-+#: src/main.c:1853
-+msgid "Set initial line number for the internal editor"
-+msgstr "Äặt số dòng ban đầu cho trình soạn thảo ná»™i bá»™"
-+
-+#: src/main.c:1855
-+msgid ""
-+"\n"
-+"Please send any bug reports (including the output of `mc -V')\n"
-+"to mc-devel@gnome.org\n"
-+msgstr ""
-+"\n"
-+"Xin hãy gửi bất kỳ báo cáo lỗi (bug) nào (gồm cả kết quả của lệnh `mc -V')\n"
-+"tá»›i mc-devel@gnome.org\n"
-+
-+#: src/main.c:1870
-+msgid ""
-+"--colors KEYWORD={FORE},{BACK}\n"
-+"\n"
-+"{FORE} and {BACK} can be omitted, and the default will be used\n"
-+"\n"
-+"Keywords:\n"
-+"   Global:       errors, reverse, gauge, input\n"
-+"   File display: normal, selected, marked, markselect\n"
-+"   Dialog boxes: dnormal, dfocus, dhotnormal, dhotfocus\n"
-+"   Menus:        menu, menuhot, menusel, menuhotsel\n"
-+"   Help:         helpnormal, helpitalic, helplink, helpslink\n"
-+"   File types:   directory, executable, link, stalelink, device, special, "
-+"core\n"
-+"\n"
-+"Colors:\n"
-+"   black, gray, red, brightred, green, brightgreen, brown,\n"
-+"   yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
-+"   brightcyan, lightgray and white\n"
-+"\n"
-+msgstr ""
-+"--colors TỪ_KHÓA={VĂN BẢN},{NỀN}\n"
-+"\n"
-+"có thể bỠqua {VĂN BẢN} và {NỀN}, và sử dụng giá trị theo mặc định\n"
-+"\n"
-+"Từ khóa:\n"
-+"   Toàn cầu:         errors, reverse, gauge, input\n"
-+"   Hiển thị tập tin: normal, selected, marked, markselect\n"
-+"   Hộp thoại:        dnormal, dfocus, dhotnormal, dhotfocus\n"
-+"   Trình đơn:        menu, menuhot, menusel, menuhotsel\n"
-+"   Trợ giúp:         helpnormal, helpitalic, helplink, helpslink\n"
-+"   Dạng tập tin:     directory, executable, link, stalelink, device, special, core\n"
-+"\n"
-+"Màu sắc:\n"
-+"   black, gray, red, brightred, green, brightgreen, brown,\n"
-+"   yellow, blue, brightblue, magenta, brightmagenta, cyan,\n"
-+"   brightcyan, lightgray, white\n"
-+"\n"
-+
-+#: src/main.c:1945
-+msgid "Displays this help message"
-+msgstr "Hiển thị thông báo trợ giúp này"
-+
-+#: src/main.c:1947
-+msgid "Displays the current version"
-+msgstr "Hiển thị số phiên bản hiện thá»i"
-+
-+#: src/main.c:1951
-+msgid "Forces xterm features"
-+msgstr "Bắt buộc dùng tính năng của xterm"
-+
-+#: src/main.c:1953
-+msgid "Disable mouse support in text version"
-+msgstr "BỠhỗ trợ chuột trong phiên bản văn bản (text)"
-+
-+#: src/main.c:1956
-+msgid "Tries to use termcap instead of terminfo"
-+msgstr "Thử sử dụng termcap thay cho terminfo"
-+
-+#: src/main.c:1959
-+msgid "Resets soft keys on HP terminals"
-+msgstr "Äặt lại phím phần má»m trên các terminal HP"
-+
-+#: src/main.c:1961
-+msgid "To run on slow terminals"
-+msgstr "Äể chạy trên các terminal chậm"
-+
-+#: src/main.c:1963
-+msgid "Use stickchars to draw"
-+msgstr "Sử dụng ký tự thẳng đứng để vẽ"
-+
-+#: src/main.c:1967
-+msgid "Requests to run in black and white"
-+msgstr "Yêu cầu chạy trong chế độ đen trắng"
-+
-+#: src/main.c:1969
-+msgid "Request to run in color mode"
-+msgstr "Yêu cầu chạy trong chế độ màu"
-+
-+#: src/main.c:1971
-+msgid "Specifies a color configuration"
-+msgstr "Xác định cấu hình màu sắc"
-+
-+#: src/main.c:1973
-+msgid "Displays a help screen on how to change the color scheme"
-+msgstr "Hiển thị cửa sổ trợ giúp cách thay đổi bộ phối hợp màu"
-+
-+#: src/main.c:1978
-+msgid "Log ftp dialog to specified file"
-+msgstr "Ghi hội thoại FTP vào một tập tin"
-+
-+#: src/main.c:1981
-+msgid "Set debug level"
-+msgstr "Äặt mức Ä‘á»™ tìm sá»­a lá»—i (debug)"
-+
-+#: src/main.c:1987
-+msgid "Print data directory"
-+msgstr "In ra tên thư mục dữ liệu"
-+
-+#: src/main.c:1989
-+msgid "Print last working directory to specified file"
-+msgstr "Ghi thư mục làm việc cuối cùng vào tập tin chỉ ra"
-+
-+#: src/main.c:1994
-+msgid "Enables subshell support (default)"
-+msgstr "Bật hỗ trợ shell con (mặc định)"
-+
-+#: src/main.c:1996
-+msgid "Disables subshell support"
-+msgstr "Tắt hỗ trợ shell con"
-+
-+#: src/main.c:2001
-+msgid "Launches the file viewer on a file"
-+msgstr "Xem tập tin"
-+
-+#: src/main.c:2004
-+msgid "Edits one file"
-+msgstr "Soạn thảo tập tin"
-+
-+#: src/main.c:2218
-+msgid " Notice "
-+msgstr " Cảnh báo "
-+
-+#: src/main.c:2219
-+msgid ""
-+" The Midnight Commander configuration files \n"
-+" are now stored in the ~/.mc directory, the \n"
-+" files have been moved now\n"
-+msgstr ""
-+" Các tập tin cấu hình Midnight Commander \n"
-+" bây giỠđặt trong thư mục ~/.mc, các \n"
-+" tập tin cũ bây giỠđược chuyển tới đó\n"
-+
-+#: src/option.c:56
-+msgid "safe de&Lete"
-+msgstr "Xóa một cách &An toàn"
-+
-+#: src/option.c:57
-+msgid "cd follows lin&Ks"
-+msgstr "cd th&Eo liên kết"
-+
-+#: src/option.c:58
-+msgid "L&ynx-like motion"
-+msgstr "di chuyển giống trong l&Ynx"
-+
-+#: src/option.c:59
-+msgid "rotatin&G dash"
-+msgstr "cái chỉ &Quay"
-+
-+#: src/option.c:60
-+msgid "co&Mplete: show all"
-+msgstr "tự động hoàn thành: hiện tất cả"
-+
-+#: src/option.c:61
-+msgid "&Use internal view"
-+msgstr "trình xem nội &Bộ"
-+
-+#: src/option.c:62
-+msgid "use internal ed&It"
-+msgstr "sử dụng s&Oạn thảo nội bộ"
-+
-+#: src/option.c:63
-+msgid "auto m&Enus"
-+msgstr "t&Rình đơn tự động"
-+
-+#: src/option.c:64
-+msgid "&Auto save setup"
-+msgstr "tự động gh&I nhớ cấu hình"
-+
-+#: src/option.c:65
-+msgid "shell &Patterns"
-+msgstr "&Mẫu dạng shell"
-+
-+#: src/option.c:66
-+msgid "Compute &Totals"
-+msgstr "tính tổn&G kích thước"
-+
-+#: src/option.c:67
-+msgid "&Verbose operation"
-+msgstr "thao tác với thông báo &Dài dòng"
-+
-+#: src/option.c:69
-+msgid "&Fast dir reload"
-+msgstr "nạ&P nhanh thư mục"
-+
-+#: src/option.c:70
-+msgid "mi&X all files"
-+msgstr "trộn lẫn tất &Cả tập tin"
-+
-+#: src/option.c:71
-+msgid "&Drop down menus"
-+msgstr "đẩy &Xuống trình đơn"
-+
-+#: src/option.c:72
-+msgid "ma&Rk moves down"
-+msgstr "&Nhãn di chuyển xuống"
-+
-+#: src/option.c:73
-+msgid "show &Hidden files"
-+msgstr "&Hiển thị tập tin ẩn"
-+
-+#: src/option.c:74
-+msgid "show &Backup files"
-+msgstr "hiển thị tập tin sao &Lưu"
-+
-+#: src/option.c:85
-+msgid "&Never"
-+msgstr "&Không bao giá»"
-+
-+#: src/option.c:86
-+msgid "on dumb &Terminals"
-+msgstr "&Trên terminal ngu"
-+
-+#: src/option.c:87
-+msgid "Alwa&ys"
-+msgstr "&Luôn luôn"
-+
-+#: src/option.c:123
-+msgid " Panel options "
-+msgstr " Cấu hình bảng "
-+
-+#: src/option.c:124
-+msgid " Pause after run... "
-+msgstr " Tạm ngừng sau khi chạy... "
-+
-+#: src/option.c:170
-+msgid "Configure options"
-+msgstr "Tùy chá»n cấu hình"
-+
-+#: src/panelize.c:67
-+msgid "&Add new"
-+msgstr "&Thêm mới"
-+
-+#: src/panelize.c:154 src/panelize.c:420
-+msgid "External panelize"
-+msgstr "Bảng ngoài"
-+
-+#: src/panelize.c:169
-+msgid "Command"
-+msgstr "Câu lệnh"
-+
-+#: src/panelize.c:185 src/panelize.c:242 src/panelize.c:313 src/panelize.c:334
-+msgid "Other command"
-+msgstr "Lệnh khác"
-+
-+#: src/panelize.c:226
-+msgid " Add to external panelize "
-+msgstr " Thêm vào bảng ngoài "
-+
-+#: src/panelize.c:227
-+msgid " Enter command label: "
-+msgstr " Nhập tên câu lệnh: "
-+
-+#: src/panelize.c:267
-+msgid " Cannot run external panelize in a non-local directory "
-+msgstr " Không thể chạy câu lệnh này trên một thư mục không phải nội bộ "
-+
-+#: src/panelize.c:316
-+msgid "Find rejects after patching"
-+msgstr "Tìm những loại bỠsau khi vá lỗi (patch)"
-+
-+#: src/panelize.c:317
-+msgid "Find *.orig after patching"
-+msgstr "Tìm *.orig) sau khi vá lỗi (patch)"
-+
-+#: src/panelize.c:318
-+msgid "Find SUID and SGID programs"
-+msgstr "Tìm chương trình có các bit SUID/SGID"
-+
-+#: src/panelize.c:369
-+msgid "Cannot invoke command."
-+msgstr "Không thực hiện được câu lệnh."
-+
-+#: src/panelize.c:420
-+msgid "Pipe close failed"
-+msgstr "Äóng Ä‘Æ°á»ng ống không thành công"
-+
-+#: src/popt.c:547
-+msgid "missing argument"
-+msgstr "thiếu tham số"
-+
-+#: src/popt.c:549
-+msgid "unknown option"
-+msgstr "tùy chá»n không rõ"
-+
-+#: src/popt.c:555
-+msgid "invalid numeric value"
-+msgstr "giá trị số không thích hợp"
-+
-+#: src/popthelp.c:31
-+msgid "Show this help message"
-+msgstr "Hiển thị thông báo trợ giúp này"
-+
-+#: src/popthelp.c:32
-+msgid "Display brief usage message"
-+msgstr "Hiển thị chỉ dẫn ngắn gá»n"
-+
-+#: src/popthelp.c:60
-+msgid "ARG"
-+msgstr "ARG"
-+
-+#: src/popthelp.c:179
-+msgid "Usage:"
-+msgstr "Sử dụng:"
-+
-+#: src/screen.c:201
-+msgid "UP--DIR"
-+msgstr "LÊNTRÊN"
-+
-+#: src/screen.c:222
-+msgid "SYMLINK"
-+msgstr "LIÊNKẾTMỀM"
-+
-+#: src/screen.c:226
-+msgid "SUB-DIR"
-+msgstr "THƯMỤCCON"
-+
-+#: src/screen.c:406 src/screen.c:407
-+msgid "Size"
-+msgstr "Kích cỡ"
-+
-+#: src/screen.c:409
-+msgid "MTime"
-+msgstr "Thá»i gian sá»­a"
-+
-+#: src/screen.c:410
-+msgid "ATime"
-+msgstr "Truy cập cuối cùng"
-+
-+#: src/screen.c:411
-+msgid "CTime"
-+msgstr "Thá»i gian thay đổi"
-+
-+#: src/screen.c:412
-+msgid "Permission"
-+msgstr "Quyá»n hạn"
-+
-+#: src/screen.c:413
-+msgid "Perm"
-+msgstr "Quyá»n"
-+
-+#: src/screen.c:414
-+msgid "Nl"
-+msgstr "Nl"
-+
-+#: src/screen.c:415
-+msgid "Inode"
-+msgstr "Nút"
-+
-+#: src/screen.c:416
-+msgid "UID"
-+msgstr "UID"
-+
-+#: src/screen.c:417
-+msgid "GID"
-+msgstr "GID"
-+
-+#: src/screen.c:418
-+msgid "Owner"
-+msgstr "Chủ sở hữu"
-+
-+#: src/screen.c:419
-+msgid "Group"
-+msgstr "Nhóm"
-+
-+#: src/screen.c:655
-+#, c-format
-+msgid "%s bytes in %d file"
-+msgstr "%s byte trong %d tập tin"
-+
-+#: src/screen.c:655
-+#, c-format
-+msgid "%s bytes in %d files"
-+msgstr "%s byte trong %d tập tin"
-+
-+#: src/screen.c:681
-+msgid "<readlink failed>"
-+msgstr "<Ä‘á»c liên kết không thành công>"
-+
-+#: src/screen.c:1289
-+msgid "Unknown tag on display format: "
-+msgstr "Thẻ ghi không rõ trong định dạng hiển thị: "
-+
-+#: src/screen.c:1415
-+msgid "User supplied format looks invalid, reverting to default."
-+msgstr "Äịnh dạng ngÆ°á»i dùng Ä‘Æ°a ra có vẻ không thích hợp, chuyển lại thành mặc định."
-+
-+#: src/screen.c:1952
-+msgid " Do you really want to execute? "
-+msgstr " Thực sự muốn thực hiện? "
-+
-+#: src/screen.c:2186
-+msgid "View"
-+msgstr "Xem   "
-+
-+#: src/screen.c:2187 src/view.c:2231
-+msgid "Edit"
-+msgstr "Soạn  "
-+
-+#: src/screen.c:2189 src/tree.c:977
-+msgid "RenMov"
-+msgstr "Chuyển"
-+
-+#: src/screen.c:2190 src/tree.c:981
-+msgid "Mkdir"
-+msgstr "Tạotm "
-+
-+#: src/selcodepage.c:54
-+msgid " Choose input codepage "
-+msgstr " Chá»n bảng mã dữ liệu vào "
-+
-+#: src/selcodepage.c:58
-+msgid "-  < No translation >"
-+msgstr "-  < Không có dịch >"
-+
-+#: src/selcodepage.c:106
-+msgid ""
-+"To use this feature select your codepage in\n"
-+"Setup / Display Bits dialog!\n"
-+"Do not forget to save options."
-+msgstr ""
-+"Äể sá»­ dụng tính năng này, hãy chá»n bảng mã trong\n"
-+"trình đơn Cấu hình / hộp thoại Bit hiển thị!\n"
-+"Äừng quên ghi nhá»› lại cấu hình."
-+
-+#: src/slint.c:188
-+#, c-format
-+msgid ""
-+"Screen size %dx%d is not supported.\n"
-+"Check the TERM environment variable.\n"
-+msgstr ""
-+"Kích thước màn hình %dx%d không được hỗ trợ.\n"
-+"Hãy kiểm tra biến môi trÆ°á»ng TERM.\n"
-+
-+#: src/subshell.c:320
-+msgid ""
-+"GNU Midnight Commander is already\n"
-+"running on this terminal.\n"
-+"Subshell support will be disabled."
-+msgstr ""
-+"Một GNU Midnight Commander đã làm việc\n"
-+"trên terminal này. Sẽ không có hỗ trợ\n"
-+"shell con."
-+
-+#: src/subshell.c:425
-+#, c-format
-+msgid "Cannot open named pipe %s\n"
-+msgstr "Không mở được Ä‘Æ°á»ng ống tên (named pipe) %s\n"
-+
-+#: src/subshell.c:653
-+msgid " The shell is still active. Quit anyway? "
-+msgstr " Shell vẫn còn hoạt động. Vẫn thoát? "
-+
-+#: src/subshell.c:790
-+#, c-format
-+msgid "Warning: Cannot change to %s.\n"
-+msgstr "Cảnh báo: Không chuyển được vào %s.\n"
-+
-+#: src/textconf.c:50
-+msgid "With builtin Editor\n"
-+msgstr "Với Trình soạn thảo nội trú\n"
-+
-+#: src/textconf.c:56
-+msgid "Using system-installed S-Lang library"
-+msgstr "Sử dụng thư việc của S-Lang hệ thống"
-+
-+#: src/textconf.c:58
-+msgid "Using included S-Lang library"
-+msgstr "Sử dụng thư việc S-Lang bao gồm"
-+
-+#: src/textconf.c:64
-+msgid "with termcap database"
-+msgstr "với cơ sở dữ liệu termcap"
-+
-+#: src/textconf.c:66
-+msgid "with terminfo database"
-+msgstr "với cơ sở dữ liệu terminfo"
-+
-+#: src/textconf.c:70
-+msgid "Using the ncurses library"
-+msgstr "Dùng thư viện ncurses"
-+
-+#: src/textconf.c:79
-+msgid "With optional subshell support"
-+msgstr "Với hỗ trợ shell con không bắt buộc"
-+
-+#: src/textconf.c:81
-+msgid "With subshell support as default"
-+msgstr "Với hỗ trợ shell con mặc định"
-+
-+#: src/textconf.c:87
-+msgid "With support for background operations\n"
-+msgstr "Vá»›i há»— trợ thao tác ná»n sau\n"
-+
-+#: src/textconf.c:91
-+msgid "With mouse support on xterm and Linux console\n"
-+msgstr "Với hỗ trợ chuột trong xterm và kênh giao tác Linux\n"
-+
-+#: src/textconf.c:93
-+msgid "With mouse support on xterm\n"
-+msgstr "Với hỗ trợ chuột trong xterm\n"
-+
-+#: src/textconf.c:97
-+msgid "With support for X11 events\n"
-+msgstr "Với hỗ trợ sự kiện X11\n"
-+
-+#: src/textconf.c:101
-+msgid "With internationalization support\n"
-+msgstr "Với hỗ trợ các ngôn ngữ khác\n"
-+
-+#: src/textconf.c:105
-+msgid "With multiple codepages support\n"
-+msgstr "Vá»›i há»— trợ nhiá»u bảng mã\n"
-+
-+#: src/textconf.c:121
-+msgid "Virtual File System:"
-+msgstr "Hệ thống tập tin ảo:"
-+
-+#: src/tree.c:147
-+#, c-format
-+msgid ""
-+"Cannot open the %s file for writing:\n"
-+"%s\n"
-+msgstr ""
-+"Không mở được tập tin %s để ghi nhớ:\n"
-+"%s\n"
-+
-+#: src/tree.c:591
-+#, c-format
-+msgid "Copy \"%s\" directory to:"
-+msgstr " Sao chép thư mục \"%s\" vào:"
-+
-+#: src/tree.c:632
-+#, c-format
-+msgid "Move \"%s\" directory to:"
-+msgstr " Di chuyển thư mục \"%s\" vào:"
-+
-+#: src/tree.c:642
-+#, c-format
-+msgid ""
-+" Cannot stat the destination \n"
-+" %s "
-+msgstr ""
-+" Không lấy (stat) được thuộc tính của đích đến \n"
-+" %s "
-+
-+#: src/tree.c:705
-+#, c-format
-+msgid "  Delete %s?  "
-+msgstr "  Xóa %s?  "
-+
-+#: src/tree.c:735
-+msgid "Static"
-+msgstr "TÄ©nh"
-+
-+#: src/tree.c:735
-+msgid "Dynamc"
-+msgstr "Äá»™ng"
-+
-+#: src/tree.c:971
-+msgid "Rescan"
-+msgstr "Quét lại"
-+
-+#: src/tree.c:973
-+msgid "Forget"
-+msgstr "Quên"
-+
-+#: src/tree.c:986
-+msgid "Rmdir"
-+msgstr "Xóa thư mục"
-+
-+#: src/treestore.c:343
-+#, c-format
-+msgid ""
-+"Cannot write to the %s file:\n"
-+"%s\n"
-+msgstr ""
-+"Không ghi nhớ được vào tập tin %s:\n"
-+"%s\n"
-+
-+#: src/user.c:133
-+msgid " Format error on file Extensions File "
-+msgstr " Lỗi định dạng tập tin \"Phần mở rộng của tập tin\" "
-+
-+#: src/user.c:134
-+#, c-format
-+msgid " The %%var macro has no default "
-+msgstr " Macro %%var không có giá trị mặc định "
-+
-+#: src/user.c:135
-+#, c-format
-+msgid " The %%var macro has no variable "
-+msgstr " Macro %%var không có giá trị biến "
-+
-+#: src/user.c:447
-+msgid " Debug "
-+msgstr " Sá»­a lá»—i "
-+
-+#: src/user.c:456
-+msgid " ERROR: "
-+msgstr " Lá»–I: "
-+
-+#: src/user.c:460
-+msgid " True:  "
-+msgstr " Äúng: "
-+
-+#: src/user.c:462
-+msgid " False: "
-+msgstr " Sai: "
-+
-+#: src/user.c:669
-+msgid " Warning -- ignoring file "
-+msgstr " Cảnh báo - tập tin bị lỠđi "
-+
-+#: src/user.c:670
-+#, c-format
-+msgid ""
-+"File %s is not owned by root or you or is world writable.\n"
-+"Using it may compromise your security"
-+msgstr ""
-+"Tập tin %s không thuá»™c quyá»n sở hữu của root, hay của bạn,\n"
-+"hoặc ai cũng có thể ghi. Sử dụng tập tin này có thể không an toàn"
-+
-+#: src/user.c:792
-+#, c-format
-+msgid " No suitable entries found in %s "
-+msgstr " Không tìm thấy mục thích hợp trong %s"
-+
-+#: src/user.c:798
-+msgid " User menu "
-+msgstr " Trình Ä‘Æ¡n ngÆ°á»i dùng "
-+
-+#: src/util.c:671 src/util.c:697
-+msgid "%b %e %H:%M"
-+msgstr "%b %e %H:%M"
-+
-+#: src/util.c:672 src/util.c:695
-+msgid "%b %e  %Y"
-+msgstr "%b %e  %Y"
-+
-+#: src/utilunix.c:333
-+#, c-format
-+msgid "%s is not a directory\n"
-+msgstr "%s không phải là một thư mục\n"
-+
-+#: src/utilunix.c:335
-+#, c-format
-+msgid "Directory %s is not owned by you\n"
-+msgstr "Bạn không sở hữu thư mục %s\n"
-+
-+#: src/utilunix.c:338
-+#, c-format
-+msgid "Cannot set correct permissions for directory %s\n"
-+msgstr "Không đặt được quyá»n hạn đúng cho thÆ° mục %s\n"
-+
-+#: src/utilunix.c:343
-+#, c-format
-+msgid "Cannot create temporary directory %s: %s\n"
-+msgstr "Không tạo được thÆ° mục tạm thá»i %s: %s\n"
-+
-+#: src/utilunix.c:373
-+#, c-format
-+msgid "Temporary files will be created in %s\n"
-+msgstr "Tập tin tạm thá»i sẽ được tạo trong thÆ° mục %s\n"
-+
-+#: src/utilunix.c:376
-+msgid "Temporary files will not be created\n"
-+msgstr "Tập tin tạm thá»i sẽ không được tạo ra\n"
-+
-+#: src/utilunix.c:401
-+msgid " Pipe failed "
-+msgstr " Lá»—i Ä‘Æ°á»ng ống "
-+
-+#: src/utilunix.c:405
-+msgid " Dup failed "
-+msgstr " Lỗi lặp lại "
-+
-+#: src/view.c:502
-+msgid " Cannot spawn child program "
-+msgstr " Không sinh ra được tiến trình con "
-+
-+#: src/view.c:513
-+msgid "Empty output from child filter"
-+msgstr "Bá»™ lá»c con trả lại kết quả rá»—ng"
-+
-+#: src/view.c:519
-+msgid " Cannot open file "
-+msgstr " Không mở được tập tin "
-+
-+#: src/view.c:618
-+#, c-format
-+msgid ""
-+" Cannot open \"%s\"\n"
-+" %s "
-+msgstr ""
-+" Không mở được \"%s\"\n"
-+" %s "
-+
-+#: src/view.c:627
-+#, c-format
-+msgid ""
-+" Cannot stat \"%s\"\n"
-+" %s "
-+msgstr ""
-+" Không lấy (stat) được thuộc tính \"%s\"\n"
-+" %s "
-+
-+#: src/view.c:636
-+msgid " Cannot view: not a regular file "
-+msgstr " Không xem được vì lý do: không\n"
-+" phải tập tin thông thÆ°á»ng "
-+
-+#: src/view.c:775
-+#, c-format
-+msgid "File: %s"
-+msgstr "Tập tin: %s"
-+
-+#: src/view.c:790
-+#, c-format
-+msgid "Offset 0x%08lx"
-+msgstr "Bá»™ offset 0x%08lx"
-+
-+#: src/view.c:792
-+#, c-format
-+msgid "Col %d"
-+msgstr "Cá»™t %d"
-+
-+#: src/view.c:796
-+#, c-format
-+msgid "%s bytes"
-+msgstr "%s byte"
-+
-+#: src/view.c:801
-+msgid "  [grow]"
-+msgstr "  [lớn lên]"
-+
-+#: src/view.c:1826
-+msgid "Invalid hex search expression"
-+msgstr "Biểu thức tìm kiếm hex không đúng"
-+
-+#: src/view.c:1880
-+msgid " Invalid regular expression "
-+msgstr " Biểu thức chính quy không đúng"
-+
-+#: src/view.c:2003
-+#, c-format
-+msgid ""
-+" The current line number is %d.\n"
-+" Enter the new line number:"
-+msgstr ""
-+" Số thứ tá»± dòng hiện thá»i %d.\n"
-+" Hãy nhập số thứ tự dòng muốn chuyển đến:"
-+
-+#: src/view.c:2026
-+#, c-format
-+msgid ""
-+" The current address is 0x%lx.\n"
-+" Enter the new address:"
-+msgstr ""
-+" Äịa chỉ hiện thá»i - 0x%lx.\n"
-+" Hãy nhập địa chỉ mới:"
-+
-+#: src/view.c:2028
-+msgid " Goto Address "
-+msgstr " Äi tá»›i địa chỉ "
-+
-+#: src/view.c:2060
-+msgid " Enter regexp:"
-+msgstr " Nhập biểu thức chính quy:"
-+
-+#: src/view.c:2216
-+msgid "Ascii"
-+msgstr "Ascii"
-+
-+#: src/view.c:2216
-+msgid "Hex"
-+msgstr "Hex"
-+
-+#: src/view.c:2218
-+msgid "Goto"
-+msgstr "ÄiTá»›i"
-+
-+#: src/view.c:2218
-+msgid "Line"
-+msgstr "Dòng"
-+
-+#: src/view.c:2220
-+msgid "RxSrch"
-+msgstr "TìmRx"
-+
-+#: src/view.c:2225
-+msgid "EdHex"
-+msgstr "SoạnHex"
-+
-+#: src/view.c:2225
-+msgid "EdText"
-+msgstr "SoạnVb"
-+
-+#: src/view.c:2233
-+msgid "UnWrap"
-+msgstr "Bá»Wrap"
-+
-+#: src/view.c:2233
-+msgid "Wrap"
-+msgstr "CóWrap"
-+
-+#: src/view.c:2236
-+msgid "HxSrch"
-+msgstr "TìmHx"
-+
-+#: src/view.c:2239
-+msgid "Raw"
-+msgstr "Thô"
-+
-+#: src/view.c:2239
-+msgid "Parse"
-+msgstr "Phtích"
-+
-+#: src/view.c:2244
-+msgid "Unform"
-+msgstr "K0dạng"
-+
-+#: src/view.c:2244
-+msgid "Format"
-+msgstr "CóDạng"
-+
-+#: src/widget.c:911
-+msgid " History "
-+msgstr " Lịch sử"
-+
-+#: src/win.c:159
-+msgid "Function key 1"
-+msgstr "Phím chức năng 1"
-+
-+#: src/win.c:160
-+msgid "Function key 2"
-+msgstr "Phím chức năng 2"
-+
-+#: src/win.c:161
-+msgid "Function key 3"
-+msgstr "Phím chức năng 3"
-+
-+#: src/win.c:162
-+msgid "Function key 4"
-+msgstr "Phím chức năng 4"
-+
-+#: src/win.c:163
-+msgid "Function key 5"
-+msgstr "Phím chức năng 5"
-+
-+#: src/win.c:164
-+msgid "Function key 6"
-+msgstr "Phím chức năng 6"
-+
-+#: src/win.c:165
-+msgid "Function key 7"
-+msgstr "Phím chức năng 7"
-+
-+#: src/win.c:166
-+msgid "Function key 8"
-+msgstr "Phím chức năng 8"
-+
-+#: src/win.c:167
-+msgid "Function key 9"
-+msgstr "Phím chức năng 9"
-+
-+#: src/win.c:168
-+msgid "Function key 10"
-+msgstr "Phím chức năng 10"
-+
-+#: src/win.c:169
-+msgid "Function key 11"
-+msgstr "Phím chức năng 11"
-+
-+#: src/win.c:170
-+msgid "Function key 12"
-+msgstr "Phím chức năng 12"
-+
-+#: src/win.c:171
-+msgid "Function key 13"
-+msgstr "Phím chức năng 13"
-+
-+#: src/win.c:172
-+msgid "Function key 14"
-+msgstr "Phím chức năng 14"
-+
-+#: src/win.c:173
-+msgid "Function key 15"
-+msgstr "Phím chức năng 15"
-+
-+#: src/win.c:174
-+msgid "Function key 16"
-+msgstr "Phím chức năng 16"
-+
-+#: src/win.c:175
-+msgid "Function key 17"
-+msgstr "Phím chức năng 17"
-+
-+#: src/win.c:176
-+msgid "Function key 18"
-+msgstr "Phím chức năng 18"
-+
-+#: src/win.c:177
-+msgid "Function key 19"
-+msgstr "Phím chức năng 19"
-+
-+#: src/win.c:178
-+msgid "Function key 20"
-+msgstr "Phím chức năng 20"
-+
-+#: src/win.c:179
-+msgid "Backspace key"
-+msgstr "Phím Backspace"
-+
-+#: src/win.c:180
-+msgid "End key"
-+msgstr "Phím End"
-+
-+#: src/win.c:181
-+msgid "Up arrow key"
-+msgstr "Phím mũi tên lên"
-+
-+#: src/win.c:182
-+msgid "Down arrow key"
-+msgstr "Phím mũi tên xuống"
-+
-+#: src/win.c:183
-+msgid "Left arrow key"
-+msgstr "Phím mũi tên sang trái"
-+
-+#: src/win.c:184
-+msgid "Right arrow key"
-+msgstr "Phím mũi tên sang phải"
-+
-+#: src/win.c:185
-+msgid "Home key"
-+msgstr "Phím Home"
-+
-+#: src/win.c:186
-+msgid "Page Down key"
-+msgstr "Phím Page Down"
-+
-+#: src/win.c:187
-+msgid "Page Up key"
-+msgstr "Phím Page Up"
-+
-+#: src/win.c:188
-+msgid "Insert key"
-+msgstr "Phím Insert"
-+
-+#: src/win.c:189
-+msgid "Delete key"
-+msgstr "Phím Delete"
-+
-+#: src/win.c:190
-+msgid "Completion/M-tab"
-+msgstr "Hoàn thành/M-Tab"
-+
-+#: src/win.c:191
-+msgid "+ on keypad"
-+msgstr "+ trên phần keypad"
-+
-+#: src/win.c:192
-+msgid "- on keypad"
-+msgstr "- trên phần keypad"
-+
-+#: src/win.c:193
-+msgid "* on keypad"
-+msgstr "* trên phần keypad"
-+
-+#: src/win.c:195
-+msgid "Left arrow keypad"
-+msgstr "Mũi tên sang trái trên phần keypad"
-+
-+#: src/win.c:196
-+msgid "Right arrow keypad"
-+msgstr "Mũi tên sang phải trên phần keypad"
-+
-+#: src/win.c:197
-+msgid "Up arrow keypad"
-+msgstr "Mũi tên lên trên của phần keypad"
-+
-+#: src/win.c:198
-+msgid "Down arrow keypad"
-+msgstr "Mũi tên xuống dưới của phần keypad"
-+
-+#: src/win.c:199
-+msgid "Home on keypad"
-+msgstr "Home trên keypad"
-+
-+#: src/win.c:200
-+msgid "End on keypad"
-+msgstr "End trên keypad"
-+
-+#: src/win.c:201
-+msgid "Page Down keypad"
-+msgstr "Page Down trên keypad"
-+
-+#: src/win.c:202
-+msgid "Page Up keypad"
-+msgstr "Page Up trên keypad"
-+
-+#: src/win.c:203
-+msgid "Insert on keypad"
-+msgstr "Insert trên keypad"
-+
-+#: src/win.c:204
-+msgid "Delete on keypad"
-+msgstr "Delete trên keypad"
-+
-+#: src/win.c:205
-+msgid "Enter on keypad"
-+msgstr "Enter trên keypad"
-+
-+#: src/win.c:206
-+msgid "Slash on keypad"
-+msgstr "Slash trên keypad"
-+
-+#: src/win.c:207
-+msgid "NumLock on keypad"
-+msgstr "NumLock trên keypad"
-+
-+#: src/wtools.c:256
-+msgid "Background process:"
-+msgstr "Tiến trình ná»n sau:"
-+
-+#: vfs/cpio.c:142 vfs/cpio.c:158
-+#, c-format
-+msgid ""
-+"Cannot open cpio archive\n"
-+"%s"
-+msgstr ""
-+"Không mở được tập tin nén cpio\n"
-+"%s"
-+
-+#: vfs/cpio.c:223
-+#, c-format
-+msgid ""
-+"Premature end of cpio archive\n"
-+"%s"
-+msgstr ""
-+"Phần cuối của tập tin nén cpio bị há»ng\n"
-+"%s"
-+
-+#: vfs/cpio.c:309 vfs/cpio.c:359
-+#, c-format
-+msgid ""
-+"Corrupted cpio header encountered in\n"
-+"%s"
-+msgstr ""
-+"Lỗi phần đầu cpio phát hiện trong\n"
-+"%s"
-+
-+#: vfs/cpio.c:432
-+#, c-format
-+msgid ""
-+"Inconsistent hardlinks of\n"
-+"%s\n"
-+"in cpio archive\n"
-+"%s"
-+msgstr ""
-+"Liên kết cứng không thích hợp \n"
-+"%s\n"
-+"trong tập tin nén cpio\n"
-+"%s"
-+
-+#: vfs/cpio.c:457
-+#, c-format
-+msgid "%s contains duplicate entries! Skipping!"
-+msgstr "%s chứa mục lặp lại! Nhảy qua!"
-+
-+#: vfs/cpio.c:526
-+#, c-format
-+msgid ""
-+"Unexpected end of file\n"
-+"%s"
-+msgstr ""
-+"Kết thúc tập tin không mong đợi\n"
-+"%s"
-+
-+#: vfs/direntry.c:326
-+#, c-format
-+msgid "Directory cache expired for %s"
-+msgstr "Cache thư mục hết hạn cho %s"
-+
-+#: vfs/direntry.c:749
-+msgid "Starting linear transfer..."
-+msgstr "Chạy truyá»n tải theo Ä‘Æ°á»ng thẳng..."
-+
-+#: vfs/direntry.c:886
-+#, c-format
-+msgid "%s: %s: %s %3d%% (%lu bytes transferred)"
-+msgstr "%s: %s: %s %3d%% (đã truyá»n tải %lu byte)"
-+
-+#: vfs/direntry.c:887
-+#, c-format
-+msgid "%s: %s: %s %lu bytes transferred"
-+msgstr "%s: %s: %s đã truyá»n tải %lu byte"
-+
-+#: vfs/direntry.c:933
-+msgid "Getting file"
-+msgstr "Nhận tập tin"
-+
-+#: vfs/extfs.c:303
-+#, c-format
-+msgid ""
-+"Cannot open %s archive\n"
-+"%s"
-+msgstr ""
-+"Không mở được tập tin nén %s\n"
-+"%s"
-+
-+#: vfs/extfs.c:343 vfs/extfs.c:365 vfs/extfs.c:415
-+msgid "Inconsistent extfs archive"
-+msgstr "Tập tin nén extfs không thích hợp"
-+
-+#: vfs/fish.c:157
-+#, c-format
-+msgid "fish: Disconnecting from %s"
-+msgstr "fish: Ngừng kết nối từ %s"
-+
-+#: vfs/fish.c:232
-+msgid "fish: Waiting for initial line..."
-+msgstr "fish: Äang chá»i dòng đầu tiên..."
-+
-+#: vfs/fish.c:244
-+msgid "Sorry, we cannot do password authenticated connections for now."
-+msgstr "Xin lỗi, bây giỠkhông thể tạo kết nối xác thực theo mật khẩu."
-+
-+#: vfs/fish.c:249
-+msgid " fish: Password required for "
-+msgstr "fish: yêu cầu mật khẩu cho "
-+
-+#: vfs/fish.c:258
-+msgid "fish: Sending password..."
-+msgstr "fish: Äang gá»­i mật khẩu..."
-+
-+#: vfs/fish.c:264
-+msgid "fish: Sending initial line..."
-+msgstr "fish: Äang gá»­i dòng đầu tiên..."
-+
-+#: vfs/fish.c:275
-+msgid "fish: Handshaking version..."
-+msgstr "fish: Äang xác nhận phiên bản..."
-+
-+#: vfs/fish.c:289
-+msgid "fish: Setting up current directory..."
-+msgstr "fish: Äang đặt thÆ° mục hiện thá»i..."
-+
-+#: vfs/fish.c:291
-+#, c-format
-+msgid "fish: Connected, home %s."
-+msgstr "fish: Kết nối thành công, thư mục cá nhân %s."
-+
-+#: vfs/fish.c:375
-+#, c-format
-+msgid "fish: Reading directory %s..."
-+msgstr "fish: Äá»c thÆ° mục %s..."
-+
-+#: vfs/fish.c:477 vfs/ftpfs.c:1277 vfs/undelfs.c:343
-+#, c-format
-+msgid "%s: done."
-+msgstr "%s: xong."
-+
-+#: vfs/fish.c:482 vfs/ftpfs.c:1247 vfs/undelfs.c:346
-+#, c-format
-+msgid "%s: failure"
-+msgstr "%s: lá»—i"
-+
-+#: vfs/fish.c:507
-+#, c-format
-+msgid "fish: store %s: sending command..."
-+msgstr "fish: bản ghi %s: đang gửi câu lệnh..."
-+
-+#: vfs/fish.c:548
-+msgid "fish: Local read failed, sending zeros"
-+msgstr "fish: Lá»—i Ä‘á»c ná»™i bá»™, Ä‘ang gá»­i các số không"
-+
-+#: vfs/fish.c:560
-+#, c-format
-+msgid "fish: storing %s %d (%lu)"
-+msgstr "fish: ghi %s %d (%lu)"
-+
-+#: vfs/fish.c:561
-+msgid "zeros"
-+msgstr "các số không"
-+
-+#: vfs/fish.c:613
-+msgid "Aborting transfer..."
-+msgstr "Dừng truyá»n tải..."
-+
-+#: vfs/fish.c:622
-+msgid "Error reported after abort."
-+msgstr "Có lỗi báo cáo sau khi dừng."
-+
-+#: vfs/fish.c:624
-+msgid "Aborted transfer would be successful."
-+msgstr "Dừng truyá»n tải thành công."
-+
-+#: vfs/ftpfs.c:378
-+#, c-format
-+msgid "ftpfs: Disconnecting from %s"
-+msgstr "ftpfs: Ngắt kết nối từ %s"
-+
-+#: vfs/ftpfs.c:433
-+msgid " FTP: Password required for "
-+msgstr " FTP: Cần mật khẩu cho "
-+
-+#: vfs/ftpfs.c:469
-+msgid "ftpfs: sending login name"
-+msgstr "ftpfs: đang gửi tên đăng nhập"
-+
-+#: vfs/ftpfs.c:473
-+msgid "ftpfs: sending user password"
-+msgstr "ftpfs: Ä‘ang gá»­i mật khẩu ngÆ°á»i dùng"
-+
-+#: vfs/ftpfs.c:479
-+#, c-format
-+msgid "FTP: Account required for user %s"
-+msgstr "FTP: Yêu cầu tài khoản cho ngÆ°á»i dùng %s"
-+
-+#: vfs/ftpfs.c:481
-+msgid "Account:"
-+msgstr "Tài khoản:"
-+
-+#: vfs/ftpfs.c:485
-+msgid "ftpfs: sending user account"
-+msgstr "ftpfs: Ä‘ang gá»­i tài khoản ngÆ°á»i dùng"
-+
-+#: vfs/ftpfs.c:495
-+msgid "ftpfs: logged in"
-+msgstr "ftpfs: đã đăng nhập"
-+
-+#: vfs/ftpfs.c:509
-+#, c-format
-+msgid "ftpfs: Login incorrect for user %s "
-+msgstr "ftpfs: lá»—i đăng nhập cho ngÆ°á»i dùng %s "
-+
-+#: vfs/ftpfs.c:633
-+msgid "ftpfs: Invalid host name."
-+msgstr "ftpfs: Tên máy không đúng."
-+
-+#: vfs/ftpfs.c:651
-+msgid "ftpfs: Invalid host address."
-+msgstr "ftpfs: Äịa chỉ không đúng."
-+
-+#: vfs/ftpfs.c:673
-+#, c-format
-+msgid "ftpfs: making connection to %s"
-+msgstr "ftpfs: Thực hiện kết nối với %s"
-+
-+#: vfs/ftpfs.c:683
-+msgid "ftpfs: connection interrupted by user"
-+msgstr "ftpfs: ngÆ°á»i dùng dừng kết nối giữa chừng"
-+
-+#: vfs/ftpfs.c:685
-+#, c-format
-+msgid "ftpfs: connection to server failed: %s"
-+msgstr "ftpfs: kết nối tới máy chủ không thành công: %s"
-+
-+#: vfs/ftpfs.c:726
-+#, c-format
-+msgid "Waiting to retry... %d (Control-C to cancel)"
-+msgstr "Chá» thá»­ lại... %d (Control-C để hủy bá»)"
-+
-+#: vfs/ftpfs.c:906
-+msgid "ftpfs: could not setup passive mode"
-+msgstr "ftpfs: không đặt được chế độ bị động (passive)"
-+
-+#: vfs/ftpfs.c:985
-+msgid "ftpfs: aborting transfer."
-+msgstr "ftpfs: dừng truyá»n tải."
-+
-+#: vfs/ftpfs.c:987
-+#, c-format
-+msgid "ftpfs: abort error: %s"
-+msgstr "ftpfs: lỗi thoát: %s"
-+
-+#: vfs/ftpfs.c:995
-+msgid "ftpfs: abort failed"
-+msgstr "ftpfs: sự cố thoát"
-+
-+#: vfs/ftpfs.c:1099 vfs/ftpfs.c:1203
-+msgid "ftpfs: CWD failed."
-+msgstr "ftpfs: CWD (thay đổi thư mục) không thành công."
-+
-+#: vfs/ftpfs.c:1109 vfs/ftpfs.c:1116
-+msgid "ftpfs: couldn't resolve symlink"
-+msgstr "ftpfs: không tìm được liên kết má»m"
-+
-+#: vfs/ftpfs.c:1167
-+msgid "Resolving symlink..."
-+msgstr "Äang tìm liên kết má»m..."
-+
-+#: vfs/ftpfs.c:1189
-+#, c-format
-+msgid "ftpfs: Reading FTP directory %s... %s%s"
-+msgstr "ftpfs: Äá»c thÆ° mục FTP %s... %s%s"
-+
-+#: vfs/ftpfs.c:1192
-+msgid "(strict rfc959)"
-+msgstr "(hạn chế rfc959)"
-+
-+#: vfs/ftpfs.c:1193
-+msgid "(chdir first)"
-+msgstr "(đầu tiên chdir)"
-+
-+#: vfs/ftpfs.c:1290
-+msgid "ftpfs: failed; nowhere to fallback to"
-+msgstr "ftpfs: lá»—i; không có nÆ¡i nào để quay lại vá»"
-+
-+#: vfs/ftpfs.c:1355
-+#, c-format
-+msgid "ftpfs: storing file %lu (%lu)"
-+msgstr "ftpfs: ghi tập tin %lu (%lu)"
-+
-+#: vfs/ftpfs.c:1740
-+msgid ""
-+"~/.netrc file has incorrect mode.\n"
-+"Remove password or correct mode."
-+msgstr ""
-+"Tập tin ~/.netrc có chế độ truy cập/sở hữu không đúng.\n"
-+"Hãy xóa mật khẩu hoặc sửa lại chế độ cho đúng."
-+
-+#: vfs/mcfs.c:122 vfs/mcfs.c:167
-+msgid " MCFS "
-+msgstr " MCFS "
-+
-+#: vfs/mcfs.c:123
-+msgid " The server does not support this version "
-+msgstr " Máy chủ không hỗ trợ phiên bản này "
-+
-+#: vfs/mcfs.c:140
-+msgid ""
-+" The remote server is not running on a system port \n"
-+" you need a password to log in, but the information may \n"
-+" not be safe on the remote side.  Continue? \n"
-+msgstr ""
-+" Máy chủ ở xa không chạy trên một cổng hệ thống. Cần \n"
-+" mật khẩu để đăng nhập vào, nhÆ°ng Ä‘iá»u này có thể \n"
-+" không an toàn cho thông tin phía ở xa. Tiếp tục?\n"
-+
-+#: vfs/mcfs.c:153
-+msgid " MCFS Password required "
-+msgstr " Yêu cầu mật khẩu MCFS "
-+
-+#: vfs/mcfs.c:167
-+msgid " Invalid password "
-+msgstr " Mật khẩu không đúng "
-+
-+#: vfs/mcfs.c:227
-+#, c-format
-+msgid " Cannot locate hostname: %s "
-+msgstr " Không xác định được tên máy ở xa: %s"
-+
-+#: vfs/mcfs.c:246
-+#, c-format
-+msgid " Cannot create socket: %s "
-+msgstr " Không tạo được socket: %s "
-+
-+#: vfs/mcfs.c:252
-+#, c-format
-+msgid " Cannot connect to server: %s "
-+msgstr " Không kết nối được tới máy chủ: %s "
-+
-+#: vfs/mcfs.c:322
-+msgid " Too many open connections "
-+msgstr " Quá nhiá»u kết nối mở "
-+
-+#: vfs/sfs.c:346
-+#, c-format
-+msgid ""
-+"Warning: Invalid line in %s:\n"
-+"%s\n"
-+msgstr ""
-+"Cảnh báo: dòng không đúng trong %s:\n"
-+"%s\n"
-+
-+#: vfs/sfs.c:358
-+#, c-format
-+msgid ""
-+"Warning: Invalid flag %c in %s:\n"
-+"%s\n"
-+msgstr ""
-+"Cảnh báo: CỠkhông đúng %c trong %s:\n"
-+"%s\n"
-+
-+#: vfs/smbfs.c:576
-+#, c-format
-+msgid ""
-+" smbfs_reconnect to %s failed\n"
-+" "
-+msgstr ""
-+" smbfs_reconnect (kết nối lại) tới %s không thành công\n"
-+" "
-+
-+#: vfs/smbfs.c:1120
-+msgid " Authentication failed "
-+msgstr " Xác thực không thành công "
-+
-+#: vfs/smbfs.c:1632
-+#, c-format
-+msgid " Error %s creating directory %s "
-+msgstr " Lỗi %s khi tạo thư mục %s "
-+
-+#: vfs/smbfs.c:1655
-+#, c-format
-+msgid " Error %s removing directory %s "
-+msgstr " Lỗi %s khi xóa thư mục %s "
-+
-+#: vfs/smbfs.c:1744
-+#, c-format
-+msgid " %s opening remote file %s "
-+msgstr " %s khi mở tập tin ở xa %s "
-+
-+#: vfs/smbfs.c:1817
-+#, c-format
-+msgid " %s removing remote file %s "
-+msgstr " %s khi xoá tập tin ở xa %s "
-+
-+#: vfs/smbfs.c:1855
-+#, c-format
-+msgid " %s renaming files\n"
-+msgstr " %s khi đổi tên các tập tin\n"
-+
-+#: vfs/tar.c:212 vfs/tar.c:229
-+#, c-format
-+msgid ""
-+"Cannot open tar archive\n"
-+"%s"
-+msgstr ""
-+"Không mở được tập tin nén tar\n"
-+"%s"
-+
-+#: vfs/tar.c:424
-+msgid "Unexpected EOF on archive file"
-+msgstr "Kết thúc tập tin EOF nén không mong đợi"
-+
-+#: vfs/tar.c:476 vfs/tar.c:483
-+msgid "Inconsistent tar archive"
-+msgstr "Tập tin tar không thích hợp"
-+
-+#: vfs/tar.c:561
-+#, c-format
-+msgid ""
-+"Hmm,...\n"
-+"%s\n"
-+"doesn't look like a tar archive."
-+msgstr ""
-+"Hừm,...\n"
-+"%s\n"
-+"không giống tập tin tar."
-+
-+#: vfs/undelfs.c:82
-+msgid " undelfs: error "
-+msgstr " undelfs: lá»—i "
-+
-+#: vfs/undelfs.c:189
-+msgid " not enough memory "
-+msgstr " không đủ bộ nhớ "
-+
-+#: vfs/undelfs.c:194
-+msgid " while allocating block buffer "
-+msgstr " khi phân phối bộ đệm khối "
-+
-+#: vfs/undelfs.c:198
-+#, c-format
-+msgid " open_inode_scan: %d "
-+msgstr " open_inode_scan: %d "
-+
-+#: vfs/undelfs.c:202
-+#, c-format
-+msgid " while starting inode scan %d "
-+msgstr " khi bắt đầu quét chỉ mục nút inode %d "
-+
-+#: vfs/undelfs.c:211
-+#, c-format
-+msgid "undelfs: loading deleted files information %d inodes"
-+msgstr "undelfs: nạp thông tin vỠnhững tập tin bị xóa %d inode"
-+
-+#: vfs/undelfs.c:229
-+#, c-format
-+msgid " while calling ext2_block_iterate %d "
-+msgstr " khi gá»i ext2_block_iterate %d "
-+
-+#: vfs/undelfs.c:241
-+msgid " no more memory while reallocating array "
-+msgstr " không đủ bộ nhớ khi phân phối lại chuỗi "
-+
-+#: vfs/undelfs.c:262
-+#, c-format
-+msgid " while doing inode scan %d "
-+msgstr " khi quét chỉ mục nút inode %d "
-+
-+#: vfs/undelfs.c:297
-+msgid " Ext2lib error "
-+msgstr " Lá»—i Ext2lib "
-+
-+#: vfs/undelfs.c:325 vfs/undelfs.c:644
-+#, c-format
-+msgid " Cannot open file %s "
-+msgstr " Không mở được tập tin %s "
-+
-+#: vfs/undelfs.c:328
-+msgid "undelfs: reading inode bitmap..."
-+msgstr "undelfs: Ä‘á»c sÆ¡ đồ bit của nút inode..."
-+
-+#: vfs/undelfs.c:331
-+#, c-format
-+msgid ""
-+" Cannot load inode bitmap from: \n"
-+" %s \n"
-+msgstr ""
-+" Không nạp được sơ đồ bit của nút inode từ:\n"
-+" %s \n"
-+
-+#: vfs/undelfs.c:334
-+msgid "undelfs: reading block bitmap..."
-+msgstr "undelfs: Ä‘á»c sÆ¡ đồ bit của khối..."
-+
-+#: vfs/undelfs.c:337
-+#, c-format
-+msgid ""
-+" Cannot load block bitmap from: \n"
-+" %s \n"
-+msgstr ""
-+"  Không nạp được sơ đồ bit của khối từ:\n"
-+" %s \n"
-+
-+#: vfs/undelfs.c:360
-+msgid " vfs_info is not fs! "
-+msgstr " vfs_info không phải là hệ thống tập tin! "
-+
-+#: vfs/undelfs.c:416 vfs/undelfs.c:600
-+msgid " You have to chdir to extract files first "
-+msgstr " Äầu tiên bạn phải chdir để chuyển tá»›i thÆ° mục chứa tập tin cần giản nén "
-+
-+#: vfs/undelfs.c:539
-+msgid " while iterating over blocks "
-+msgstr " khi lặp lại khối "
-+
-+#: vfs/vfs.c:880
-+msgid "Changes to file lost"
-+msgstr "Thay đổi tới tập tin bị mất"
-+
-diff -urN mc-4.6.1.orig/src/achown.c mc-4.6.1/src/achown.c
---- mc-4.6.1.orig/src/achown.c	2005-07-23 22:52:02.000000000 +0600
-+++ mc-4.6.1/src/achown.c	2007-01-19 18:33:58.000000000 +0500
-@@ -583,6 +583,12 @@
-     b_att[2] = button_new (XTRACT (6));
-     b_user = button_new (XTRACT (5));
-     b_group = button_new (XTRACT (4));
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode) {
-+	b_user->text = g_realloc (b_user->text, MB_CUR_MAX * 15 + 1);
-+	b_group->text = g_realloc (b_group->text, MB_CUR_MAX * 15 + 1);
-+    }
-+#endif
- 
-     add_widget (ch_dlg, b_group);
-     add_widget (ch_dlg, b_user);
-diff -urN mc-4.6.1.orig/src/boxes.c mc-4.6.1/src/boxes.c
---- mc-4.6.1.orig/src/boxes.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/boxes.c	2007-01-19 18:33:59.000000000 +0500
-@@ -49,6 +49,7 @@
- #ifdef HAVE_CHARSET
- #include "charsets.h"
- #include "selcodepage.h"
-+#include "recode.h"
- #endif
- 
- #ifdef USE_NETCODE
-@@ -150,23 +151,23 @@
- 	display_title = _(display_title);
- 	for (i = 0; i < LIST_TYPES; i++) {
- 	    displays[i] = _(displays[i]);
--	    if ((l = strlen (displays[i])) > maxlen)
-+	    if ((l = mbstrlen (displays[i])) > maxlen)
- 		maxlen = l;
- 	}
- 
--	i = strlen (ok_button) + 5;
--	l = strlen (cancel_button) + 3;
-+	i = mbstrlen (ok_button) + 5;
-+	l = mbstrlen (cancel_button) + 3;
- 	l = max (i, l);
- 
- 	i = maxlen + l + 16;
- 	if (i > DISPLAY_X)
- 	    DISPLAY_X = i;
- 
--	i = strlen (user_mini_status) + 13;
-+	i = mbstrlen (user_mini_status) + 13;
- 	if (i > DISPLAY_X)
- 	    DISPLAY_X = i;
- 
--	i = strlen (display_title) + 10;
-+	i = mbstrlen (display_title) + 10;
- 	if (i > DISPLAY_X)
- 	    DISPLAY_X = i;
- 
-@@ -285,20 +286,20 @@
- 	int maxlen = 0;
- 	for (i = SORT_TYPES - 1; i >= 0; i--) {
- 	    sort_orders_names[i] = _(sort_orders[i].sort_name);
--	    r = strlen (sort_orders_names[i]);
-+	    r = mbstrlen (sort_orders_names[i]);
- 	    if (r > maxlen)
- 		maxlen = r;
- 	}
- 
- 	check_pos = maxlen + 9;
- 
--	r = strlen (reverse_label) + 4;
--	i = strlen (case_label) + 4;
-+	r = mbstrlen (reverse_label) + 4;
-+	i = mbstrlen (case_label) + 4;
- 	if (i > r)
- 	    r = i;
- 
--	l = strlen (ok_button) + 6;
--	i = strlen (cancel_button) + 4;
-+	l = mbstrlen (ok_button) + 6;
-+	i = mbstrlen (cancel_button) + 4;
- 	if (i > l)
- 	    l = i;
- 
-@@ -307,7 +308,7 @@
- 	if (i > SORT_X)
- 	    SORT_X = i;
- 
--	i = strlen (sort_title) + 6;
-+	i = mbstrlen (sort_title) + 6;
- 	if (i > SORT_X)
- 	    SORT_X = i;
- 
-@@ -402,7 +403,7 @@
- 		while (i--)
- 		{
- 			conf_widgets [i].text = _(conf_widgets [i].text);
--			l1 = strlen (conf_widgets [i].text) + 3;
-+			l1 = mbstrlen (conf_widgets [i].text) + 3;
- 			if (l1 > maxlen)
- 				maxlen = l1;
- 		}
-@@ -417,8 +418,8 @@
- 		 * And this for the case when buttons with some space to the right
- 		 * do not fit within 2/6
- 		 */
--		l1 = strlen (conf_widgets [0].text) + 3;
--		i = strlen (conf_widgets [1].text) + 5;
-+		l1 = mbstrlen (conf_widgets [0].text) + 3;
-+		i = mbstrlen (conf_widgets [1].text) + 5;
- 		if (i > l1)
- 			l1 = i;
- 
-@@ -446,8 +447,8 @@
-     }
- }
- 
--#define DISPY 11
--#define DISPX 46
-+#define DISPY 13
-+#define DISPX 35
- 
- 
- #ifndef HAVE_CHARSET
-@@ -489,11 +490,11 @@
- 		{
- 			display_widgets [i].text = _(display_widgets[i].text);
- 			display_bits_str [i] = _(display_bits_str [i]);
--			l1 = strlen (display_bits_str [i]);
-+			l1 = mbstrlen (display_bits_str [i]);
- 			if (l1 > maxlen)
- 				maxlen = l1;
- 		}
--		l1 = strlen (display_widgets [2].text);
-+		l1 = mbstrlen (display_widgets [2].text);
- 		if (l1 > maxlen)
- 			maxlen = l1;
- 		
-@@ -501,8 +502,8 @@
- 		display_bits.xlen = (maxlen + 5) * 6 / 4;
- 
- 		/* See above confirm_box */
--		l1 = strlen (display_widgets [0].text) + 3;
--		i = strlen (display_widgets [1].text) + 5;
-+		l1 = mbstrlen (display_widgets [0].text) + 3;
-+		i = mbstrlen (display_widgets [1].text) + 5;
- 		if (i > l1)
- 			l1 = i;
- 
-@@ -543,26 +544,61 @@
- 
- 
- static int new_display_codepage;
-+static int new_ftp_codepage;
- 
--static WLabel *cplabel;
- static WCheck *inpcheck;
- 
-+static WButton *cpbutton;
-+static WButton *cpbutton_ftp;
-+
- static int
- sel_charset_button (int action)
- {
-     const char *cpname;
-     char buf[64];
--    new_display_codepage = select_charset (new_display_codepage, 1);
-+    new_display_codepage = select_charset (new_display_codepage, 1, _(" Choose input codepage "));
-     cpname = (new_display_codepage < 0)
- 	? _("Other 8 bit")
- 	: codepages[new_display_codepage].name;
- 
-     /* avoid strange bug with label repainting */
--    g_snprintf (buf, sizeof (buf), "%-27s", cpname);
--    label_set_text (cplabel, buf);
-+    sprintf( buf, "%s", cpname );
-+    button_set_text (cpbutton, buf);
-+
-+    if(new_display_codepage<0)  new_ftp_codepage=-1;
-+    cpname = (new_ftp_codepage < 0)
-+             ? _("Other 8 bit")
-+             : codepages[ new_ftp_codepage ].name;
-+    sprintf( buf, "%s", cpname );
-+    button_set_text (cpbutton_ftp, buf);
-+
-     return 0;
- }
- 
-+static int sel_charset_button_ftp(int action) {
-+  char *cpname, buf[64];
-+  if(new_display_codepage>0) {
-+    new_ftp_codepage = select_charset(new_ftp_codepage, 0, _(" Choose default FTP codepage "));
-+    cpname = (new_display_codepage < 0)
-+             ? _("Other 8 bit")
-+             : codepages[ new_display_codepage ].name;
-+    sprintf( buf, "%s", cpname );
-+    button_set_text( cpbutton, buf );
-+    cpname = (new_ftp_codepage < 0)
-+             ? _("Other 8 bit")
-+             : codepages[ new_ftp_codepage ].name;
-+    sprintf( buf, "%s", cpname );
-+    button_set_text( cpbutton_ftp, buf );
-+  }
-+  else {
-+    message( 1, _(" Warning "),
-+                _("To use this feature select your codepage in\n"
-+                  "Setup / Display Bits dialog!\n"
-+                 "Do not forget to save options." ));
-+  }
-+  return 0;
-+}
-+
- static Dlg_head *
- init_disp_bits_box (void)
- {
-@@ -581,9 +617,6 @@
-     cpname = (new_display_codepage < 0)
- 	? _("Other 8 bit")
- 	: codepages[new_display_codepage].name;
--    cplabel = label_new (4, 4, cpname);
--    add_widget (dbits_dlg, cplabel);
--
-     add_widget (dbits_dlg,
- 		button_new (DISPY - 3, DISPX / 2 + 3, B_CANCEL,
- 			    NORMAL_BUTTON, _("&Cancel"), 0));
-@@ -592,13 +625,30 @@
- 			    0));
- 
-     inpcheck =
--	check_new (6, 4, !use_8th_bit_as_meta, _("F&ull 8 bits input"));
-+	check_new (8, 4, !use_8th_bit_as_meta, _("F&ull 8 bits input"));
-     add_widget (dbits_dlg, inpcheck);
- 
--    cpname = _("&Select");
--    add_widget (dbits_dlg,
--		button_new (4, DISPX - 8 - strlen (cpname), B_USER,
--			    NORMAL_BUTTON, cpname, sel_charset_button));
-+
-+    add_widget( dbits_dlg, label_new( 5, 4, _("FTP default codepage:")));
-+    if(n_codepages>0) {
-+      cpname = (new_display_codepage < 0)
-+               ? _("Other 8 bit")
-+               : codepages[ new_display_codepage ].name;
-+    }
-+    else cpname= _("Other 8 bit");
-+    cpbutton=button_new(4, 5, B_USER,
-+                       NORMAL_BUTTON, cpname, sel_charset_button);
-+
-+    if(n_codepages>0) {
-+      cpname = (new_ftp_codepage < 0)
-+               ? _("Other 8 bit")
-+               : codepages[ new_ftp_codepage ].name;
-+    }
-+    else cpname= _("Other 8 bit");
-+    cpbutton_ftp=button_new(6, 5, B_USER,
-+                            NORMAL_BUTTON, cpname, sel_charset_button_ftp);
-+    add_widget( dbits_dlg, cpbutton_ftp);
-+    add_widget (dbits_dlg, cpbutton);
- 
-     return dbits_dlg;
- }
-@@ -608,6 +658,7 @@
- {
-     Dlg_head *dbits_dlg;
-     new_display_codepage = display_codepage;
-+    new_ftp_codepage = ftp_codepage;
- 
-     application_keypad_mode ();
-     dbits_dlg = init_disp_bits_box ();
-@@ -628,6 +679,17 @@
- 				   && display_codepage != 1) ? 128 : 160;
- #endif
- 	use_8th_bit_as_meta = !(inpcheck->state & C_BOOL);
-+
-+        ftp_codepage=new_ftp_codepage;
-+        if(display_codepage<=0) {
-+          panel_reset_codepage(left_panel);
-+          paint_dir(left_panel);
-+          display_mini_info(left_panel);
-+          panel_reset_codepage(right_panel);
-+          paint_dir(right_panel);
-+          display_mini_info(right_panel);
-+        }
-+
-     }
-     destroy_dlg (dbits_dlg);
-     repaint_screen ();
-@@ -803,7 +865,7 @@
-     quick_widgets [1].y_divisions =
- 	quick_widgets [0].y_divisions = Quick_input.ylen = 5;
- 
--    len = strlen (quick_widgets [1].text);
-+    len = mbstrlen (quick_widgets [1].text);
- 
-     quick_widgets [0].relative_x =
- 	quick_widgets [1].relative_x + len + 1;
-@@ -962,7 +1024,7 @@
- 		{
- 			job_buttons [i].name = _(job_buttons [i].name);
- 
--			len = strlen (job_buttons [i].name) + 4;
-+			len = mbstrlen (job_buttons [i].name) + 4;
- 			JOBS_X = max (JOBS_X, startx + len + 3);
- 
- 			job_buttons [i].xpos = startx;
-@@ -971,7 +1033,7 @@
- 
- 		/* Last button - Ok a.k.a. Cancel :) */
- 		job_buttons [n_buttons - 1].xpos =
--			JOBS_X - strlen (job_buttons [n_buttons - 1].name) - 7;
-+			JOBS_X - mbstrlen (job_buttons [n_buttons - 1].name) - 7;
- 
- 		i18n_flag = 1;
- 	}
-@@ -1029,7 +1091,7 @@
-         
-         while (i--)
-         {
--            l1 = strlen (labs [i] = _(labs [i]));
-+            l1 = mbstrlen (labs [i] = _(labs [i]));
-             if (l1 > maxlen)
-                 maxlen = l1;
-         }
-@@ -1039,7 +1101,7 @@
-         
-         for (i = sizeof(buts)/sizeof(buts[0]), l1 = 0; i--; )
-         {
--            l1 += strlen (buts [i] = _(buts [i]));
-+            l1 += mbstrlen (buts [i] = _(buts [i]));
-         }
-         l1 += 15;
-         if (l1 > dialog_x)
-@@ -1048,7 +1110,7 @@
-         ilen = dialog_x - 7 - maxlen; /* for the case of very long buttons :) */
-         istart = dialog_x - 3 - ilen;
-         
--        b2 = dialog_x - (strlen(buts[1]) + 6);
-+        b2 = dialog_x - (mbstrlen(buts[1]) + 6);
-         
-         i18n_flag = 1;
-     }
-diff -urN mc-4.6.1.orig/src/charsets.c mc-4.6.1/src/charsets.c
---- mc-4.6.1.orig/src/charsets.c	2005-07-23 22:52:02.000000000 +0600
-+++ mc-4.6.1/src/charsets.c	2007-01-19 18:33:59.000000000 +0500
-@@ -119,8 +119,6 @@
-     }
- }
- 
--#define OTHER_8BIT "Other_8_bit"
--
- const char *
- get_codepage_id (int n)
- {
-@@ -139,7 +137,7 @@
-     return -1;
- }
- 
--static char
-+char
- translate_character (iconv_t cd, char c)
- {
-     char outbuf[4], *obuf;
-diff -urN mc-4.6.1.orig/src/charsets.h mc-4.6.1/src/charsets.h
---- mc-4.6.1.orig/src/charsets.h	2004-08-30 16:38:00.000000000 +0600
-+++ mc-4.6.1/src/charsets.h	2007-01-19 18:33:59.000000000 +0500
-@@ -6,6 +6,7 @@
- #define UNKNCHAR '\001'
- 
- #define CHARSETS_INDEX "mc.charsets"
-+#define OTHER_8BIT "Other_8_bit"
- 
- extern int n_codepages;
- 
-@@ -19,6 +20,10 @@
- 
- extern struct codepage_desc *codepages;
- 
-+#include <iconv.h>
-+extern char translate_character(iconv_t cd, char c);
-+extern char errbuf[255];
-+
- const char *get_codepage_id (int n);
- int get_codepage_index (const char *id);
- int load_codepages_list (void);
-diff -urN mc-4.6.1.orig/src/cmd.c mc-4.6.1/src/cmd.c
---- mc-4.6.1.orig/src/cmd.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/cmd.c	2007-01-19 18:33:59.000000000 +0500
-@@ -74,6 +74,10 @@
- #   include "../edit/edit.h"
- #endif
- 
-+#ifdef HAVE_CHARSET
-+#include "recode.h"
-+#endif
-+
- /* If set and you don't have subshell support,then C-o will give you a shell */
- int output_starts_shell = 0;
- 
-@@ -350,6 +354,9 @@
- {
-     char *tempdir;
-     char *dir;
-+#ifdef HAVE_CHARSET
-+    char *recoded_dir;
-+#endif
- 
-     dir =
- 	input_expand_dialog (_("Create a new Directory"),
-@@ -360,8 +367,17 @@
- 
-     if (dir[0] == '/' || dir[0] == '~')
- 	tempdir = g_strdup (dir);
--    else
--	tempdir = concat_dir_and_file (current_panel->cwd, dir);
-+    else {
-+#ifdef HAVE_CHARSET
-+        recoded_dir=g_strdup(dir);
-+        my_translate_string(dir,strlen(dir), recoded_dir,current_panel->tr_table_input);
-+        tempdir = concat_dir_and_file (current_panel->cwd, recoded_dir);
-+        g_free(recoded_dir);
-+#else
-+        tempdir = concat_dir_and_file (current_panel->cwd, dir);
-+#endif
-+    }
-+
-     g_free (dir);
- 
-     save_cwds_stat ();
-diff -urN mc-4.6.1.orig/src/dialog.c mc-4.6.1/src/dialog.c
---- mc-4.6.1.orig/src/dialog.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/dialog.c	2007-01-19 18:33:58.000000000 +0500
-@@ -162,7 +162,7 @@
- 
-     if (h->title) {
- 	attrset (HOT_NORMALC);
--	dlg_move (h, space, (h->cols - strlen (h->title)) / 2);
-+	dlg_move (h, space, (h->cols - mbstrlen (h->title)) / 2);
- 	addstr (h->title);
-     }
- }
-diff -urN mc-4.6.1.orig/src/file.c mc-4.6.1/src/file.c
---- mc-4.6.1.orig/src/file.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/file.c	2007-01-19 18:33:59.000000000 +0500
-@@ -77,6 +77,9 @@
- #include "../vfs/vfs-impl.h"
- 
- /* }}} */
-+#ifdef HAVE_CHARSET
-+#include "recode.h"
-+#endif
- 
- int verbose = 1;
- 
-@@ -165,15 +168,20 @@
- do_transform_source (FileOpContext *ctx, const unsigned char *source)
- {
-     size_t j, k, l, len;
--    unsigned const char *fnsource = x_basename (source);
-+    unsigned const char *fnsource = g_strdup (x_basename (source));
-     int next_reg;
-     enum CaseConvs case_conv = NO_CONV;
-     static unsigned char fntarget[MC_MAXPATHLEN];
- 
-+#ifdef UTF8
-+    fix_utf8(fnsource);
-+#endif
-+
-     len = strlen (fnsource);
-     j = re_match (&ctx->rx, fnsource, len, 0, &ctx->regs);
-     if (j != len) {
- 	transform_error = FILE_SKIP;
-+	g_free(fnsource);
- 	return NULL;
-     }
-     for (next_reg = 1, j = 0, k = 0; j < strlen (ctx->dest_mask); j++) {
-@@ -217,6 +225,7 @@
- 		|| ctx->regs.start[next_reg] < 0) {
- 		message (1, MSG_ERROR, _(" Invalid target mask "));
- 		transform_error = FILE_ABORT;
-+		g_free(fnsource);
- 		return NULL;
- 	    }
- 	    for (l = (size_t) ctx->regs.start[next_reg];
-@@ -231,6 +240,7 @@
- 	}
-     }
-     fntarget[k] = 0;
-+    g_free(fnsource);
-     return fntarget;
- }
- 
-@@ -380,9 +390,9 @@
- 	char *p, *q, *s;
- 
- 	const char *r = strrchr (src_path, PATH_SEP);
--
-+	
- 	if (r) {
--	    p = g_strndup (src_path, r - src_path);
-+	    p = g_strndup (src_path, r - src_path + 1);
- 	    if (*dst_path == PATH_SEP)
- 		q = g_strdup (dst_path);
- 	    else
-@@ -914,7 +924,11 @@
- 	}
- 	/* Dive into subdir if exists */
- 	if (toplevel && ctx->dive_into_subdirs) {
--	    dest_dir = concat_dir_and_file (d, x_basename (s));
-+#ifdef HAVE_CHARSET
-+            dest_dir = concat_dir_and_recoded_fname(d, x_basename (s), ctx);
-+#else
-+            dest_dir = concat_dir_and_file (d, x_basename (s));
-+#endif
- 	} else {
- 	    dest_dir = g_strdup (d);
- 	    goto dont_mkdir;
-@@ -964,7 +978,11 @@
- 
- 	(*ctx->stat_func) (path, &buf);
- 	if (S_ISDIR (buf.st_mode)) {
--	    mdpath = concat_dir_and_file (dest_dir, next->d_name);
-+#ifdef HAVE_CHARSET
-+            mdpath = concat_dir_and_recoded_fname(dest_dir, next->d_name, ctx);
-+#else
-+            mdpath = concat_dir_and_file (dest_dir, next->d_name);
-+#endif
- 	    /*
- 	     * From here, we just intend to recursively copy subdirs, not
- 	     * the double functionality of copying different when the target
-@@ -975,7 +993,11 @@
- 				parent_dirs, progress_count, progress_bytes);
- 	    g_free (mdpath);
- 	} else {
--	    dest_file = concat_dir_and_file (dest_dir, x_basename (path));
-+#ifdef HAVE_CHARSET
-+            dest_file=concat_dir_and_recoded_fname(dest_dir, x_basename(path),ctx);
-+#else
-+            dest_file = concat_dir_and_file (dest_dir, x_basename (path));
-+#endif
- 	    return_status = copy_file_file (ctx, path, dest_file, 1,
- 					    progress_count, progress_bytes, 0);
- 	    g_free (dest_file);
-@@ -1159,7 +1181,12 @@
- 	destdir = g_strdup (d);
- 	move_over = 1;
-     } else
--	destdir = concat_dir_and_file (d, x_basename (s));
-+#ifdef HAVE_CHARSET
-+        destdir = concat_dir_and_recoded_fname(d, x_basename (s), ctx);
-+#else
-+        destdir = concat_dir_and_file (d, x_basename (s));
-+#endif
-+
- 
-     if (sbuf.st_dev == dbuf.st_dev && sbuf.st_ino == dbuf.st_ino) {
- 	int msize = COLS - 36;
-@@ -1875,7 +1902,12 @@
- 	    if (temp == NULL) {
- 		value = transform_error;
- 	    } else {
--		char *temp2 = concat_dir_and_file (dest, temp);
-+#ifdef HAVE_CHARSET
-+                char *temp2 = concat_dir_and_recoded_fname (dest, temp, ctx);
-+#else
-+                char *temp2 = concat_dir_and_file (dest, temp);
-+#endif
-+
- 		g_free (dest);
- 		dest = temp2;
- 		temp = NULL;
-@@ -1969,7 +2001,12 @@
- 		if (temp == NULL)
- 		    value = transform_error;
- 		else {
--		    char *temp2 = concat_dir_and_file (dest, temp);
-+#ifdef HAVE_CHARSET
-+                    char *temp2 = concat_dir_and_recoded_fname(dest, temp, ctx);
-+#else
-+                    char *temp2 = concat_dir_and_file (dest, temp);
-+#endif
-+
- 
- 		    switch (operation) {
- 		    case OP_COPY:
-diff -urN mc-4.6.1.orig/src/filegui.c mc-4.6.1/src/filegui.c
---- mc-4.6.1.orig/src/filegui.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/filegui.c	2007-01-19 18:33:59.000000000 +0500
-@@ -69,6 +69,11 @@
- #include "filegui.h"
- #include "key.h"		/* get_event */
- #include "util.h"               /* strip_password() */
-+#include "tty.h"
-+
-+#ifdef HAVE_CHARSET
-+#include "recode.h"
-+#endif
- 
- /* }}} */
- 
-@@ -564,8 +569,8 @@
- 	 * longest of "Overwrite..." labels 
- 	 * (assume "Target date..." are short enough)
- 	 */
--	l1 = max (strlen (rd_widgets[6].text),
--		  strlen (rd_widgets[11].text));
-+	l1 = max (mbstrlen (rd_widgets[6].text),
-+		  mbstrlen (rd_widgets[11].text));
- 
- 	/* longest of button rows */
- 	i = sizeof (rd_widgets) / sizeof (rd_widgets[0]);
-@@ -576,7 +581,7 @@
- 		    l2 = max (l2, l);
- 		    l = 0;
- 		}
--		l += strlen (rd_widgets[i].text) + 4;
-+		l += mbstrlen (rd_widgets[i].text) + 4;
- 	    }
- 	}
- 	l2 = max (l2, l);	/* last row */
-@@ -594,12 +599,12 @@
- 		    l = l1;
- 		}
- 		rd_widgets[i].xpos = l;
--		l += strlen (rd_widgets[i].text) + 4;
-+		l += mbstrlen (rd_widgets[i].text) + 4;
- 	    }
- 	}
- 	/* Abort button is centered */
- 	rd_widgets[1].xpos =
--	    (rd_xlen - strlen (rd_widgets[1].text) - 3) / 2;
-+	    (rd_xlen - mbstrlen (rd_widgets[1].text) - 3) / 2;
-     }
- #endif				/* ENABLE_NLS */
- 
-@@ -618,7 +623,7 @@
- 
-     ADD_RD_LABEL (ui, 0,
- 		  name_trunc (ui->replace_filename,
--			      rd_trunc - strlen (rd_widgets[0].text)), 0);
-+			      rd_trunc - mbstrlen (rd_widgets[0].text)), 0);
-     ADD_RD_BUTTON (1);
- 
-     ADD_RD_BUTTON (2);
-@@ -721,57 +726,79 @@
-     }
- }
- 
-+#ifdef HAVE_CHARSET
-+#define FMDY 15
-+#else
- #define FMDY 13
-+#endif
-+
- #define	FMD_XLEN 64
- extern int fmd_xlen;
- static QuickWidget fmd_widgets[] = {
- 
--#define	FMCB0  FMDC
--#define	FMCB12 0
--#define	FMCB11 1
--    /* follow symlinks and preserve Attributes must be the first */
--    {quick_checkbox, 3, 64, 8, FMDY, N_("preserve &Attributes"), 9, 0,
--     0 /* &op_preserve */ , 0, "preserve"},
--    {quick_checkbox, 3, 64, 7, FMDY, N_("follow &Links"), 7, 0,
--     0 /* &file_mask_op_follow_links */ , 0, "follow"},
--    {quick_label, 3, 64, 5, FMDY, N_("to:"), 0, 0, 0, 0, "to"},
--    {quick_checkbox, 37, 64, 4, FMDY, N_("&Using shell patterns"), 0, 0,
--     0 /* &source_easy_patterns */ , 0, "using-shell"},
--    {quick_input, 3, 64, 3, FMDY, "", 58,
--     0, 0, 0, "input-def"},
--#define FMDI1 4
--#define FMDI2 5
--#define FMDC 3
--    {quick_input, 3, 64, 6, FMDY, "", 58, 0,
--     0, 0, "input2"},
--#define FMDI0 6
--    {quick_label, 3, 64, 2, FMDY, "", 0, 0, 0, 0, "ql"},
--#define	FMBRGT 7
--    {quick_button, 42, 64, 9, FMDY, N_("&Cancel"), 0, B_CANCEL, 0, 0,
--     "cancel"},
--#undef SKIP
-+#ifdef HAVE_CHARSET
-+ #define Y_OK 12
-+#else 
-+ #define Y_OK 9
-+#endif
-+
-+#ifdef WITH_BACKGROUND
-+ #define ADD 0
-+#else
-+ #define ADD -1
-+#endif
-+
-+  #define FM_STAB_SYM         0
-+  #define FM_DIVE_INTO_SUBDIR 1
-+  #define FM_PRES_ATTR        2
-+  #define FM_FOLLOW_LINKS     3
-+  #define FM_DST_INPUT        4
-+  #define FM_DST_TITLE        5
-+  #define FM_USING_SHELL_PATT 6
-+  #define FM_SRC_INPUT        7
-+  #define FM_SRC_TITLE        8
-+  #define FM_CANCEL           9
-+#ifdef WITH_BACKGROUND
-+  #define FM_BKGND            10
-+#endif
-+  #define FM_OK               11+ADD
-+#ifdef HAVE_CHARSET
-+  #define FM_TO_CODEPAGE      12+ADD
-+  #define FM_FROM_CODEPAGE    13+ADD
-+  #define FM_RECODE_TITLE     14+ADD
-+  #define FM_RECODE_ARROW     15+ADD
-+#endif // HAVE_CHARSET
-+
-+
-+#ifdef HAVE_CHARSET
-+ #define SKIP             10
-+ #define B_FROM B_USER+1
-+ #define B_TO   B_USER+2
-+#else
-+ #define SKIP             10
-+#endif
-+
-+    {quick_checkbox, 42,64, 8, FMDY, N_("&Stable Symlinks"),0,0,0,0,"stab-sym"},
-+    {quick_checkbox, 31,64, 7, FMDY, N_("&Dive into subdir if exists"),0,0,0,0,"dive"},
-+    {quick_checkbox, 3, 64, 8, FMDY, N_("preserve &Attributes"),9,0,0,0,"preserve"},
-+    {quick_checkbox, 3, 64, 7, FMDY, N_("follow &Links"),7,0,0,0,"follow"},
-+    {quick_input,    3, 64, 6, FMDY, "", 58, 0, 0, 0, "input2"},
-+    {quick_label,    3, 64, 5, FMDY, N_("to:"), 0, 0, 0, 0, "to"},
-+    {quick_checkbox, 37,64, 4, FMDY, N_("&Using shell patterns"),0,0, 0,0,"us-sh"},
-+    {quick_input,    3, 64, 3, FMDY, "", 58, 0, 0, 0, "input-def"},
-+    {quick_label,    3, 64, 2, FMDY, "", 0, 0, 0, 0, "ql"},
-+    {quick_button,   42,64, Y_OK, FMDY, N_("&Cancel"), 0, B_CANCEL, 0,0, "cancel"},
- #ifdef WITH_BACKGROUND
--# define SKIP 5
--# define FMCB21 11
--# define FMCB22 10
--# define FMBLFT 9
--# define FMBMID 8
--    {quick_button, 25, 64, 9, FMDY, N_("&Background"), 0, B_USER, 0, 0,
--     "back"},
--#else				/* WITH_BACKGROUND */
--# define SKIP 4
--# define FMCB21 10
--# define FMCB22 9
--# define FMBLFT 8
--# undef  FMBMID
--#endif
--    {quick_button, 14, 64, 9, FMDY, N_("&OK"), 0, B_ENTER, 0, 0, "ok"},
--    {quick_checkbox, 42, 64, 8, FMDY, N_("&Stable Symlinks"), 0, 0,
--     0 /* &file_mask_stable_symlinks */ , 0, "stab-sym"},
--    {quick_checkbox, 31, 64, 7, FMDY, N_("&Dive into subdir if exists"), 0,
--     0,
--     0 /* &dive_into_subdirs */ , 0, "dive"},
--    NULL_QuickWidget
-+    {quick_button,   25,64, Y_OK, FMDY, N_("&Background"), 0, B_USER, 0,0, "back"},
-+#endif
-+    {quick_button,   14,64, Y_OK, FMDY, N_("&OK"), 0, B_ENTER, 0, 0, "ok"},
-+#ifdef HAVE_CHARSET
-+    {quick_button,   46,64, 10, FMDY,"to codepage", 0, B_TO, 0, 0, "ql"},
-+    {quick_button,   25,64, 10, FMDY, "from codepage", 0, B_FROM, 0, 0, "ql"},
-+    {quick_label,    3, 64, 10, FMDY, N_("Recode file names:"), 0, 0, 0, 0, "ql"},
-+    {quick_label,    42,64, 10, FMDY, "->", 0, 0, 0, 0, "ql"},
-+#endif
-+    {0}
- };
- 
- static int
-@@ -805,48 +832,48 @@
- 	if (fmd_widgets[i].text[0] != '\0')
- 	    fmd_widgets[i].text = _(fmd_widgets[i].text);
- 
--    len = strlen (fmd_widgets[FMCB11].text)
--	+ strlen (fmd_widgets[FMCB21].text) + 15;
-+    len = mbstrlen (fmd_widgets[FM_FOLLOW_LINKS].text)
-+	+ mbstrlen (fmd_widgets[FM_DIVE_INTO_SUBDIR].text) + 15;
-     fmd_xlen = max (fmd_xlen, len);
- 
--    len = strlen (fmd_widgets[FMCB12].text)
--	+ strlen (fmd_widgets[FMCB22].text) + 15;
-+    len = mbstrlen (fmd_widgets[FM_PRES_ATTR].text)
-+	+ mbstrlen (fmd_widgets[FM_STAB_SYM].text) + 15;
-     fmd_xlen = max (fmd_xlen, len);
- 
--    len = strlen (fmd_widgets[FMBRGT].text)
--	+ strlen (fmd_widgets[FMBLFT].text) + 11;
-+    len = mbstrlen (fmd_widgets[FM_CANCEL].text)
-+	+ mbstrlen (fmd_widgets[FM_OK].text) + 11;
- 
--#ifdef FMBMID
--    len += strlen (fmd_widgets[FMBMID].text) + 6;
-+#ifdef FM_BKGND
-+    len += mbstrlen (fmd_widgets[FM_BKGND].text) + 6;
- #endif
- 
-     fmd_xlen = max (fmd_xlen, len + 4);
- 
-     len = (fmd_xlen - (len + 6)) / 2;
--    i = fmd_widgets[FMBLFT].relative_x = len + 3;
--    i += strlen (fmd_widgets[FMBLFT].text) + 8;
-+    i = fmd_widgets[FM_OK].relative_x = len + 3;
-+    i += mbstrlen (fmd_widgets[FM_OK].text) + 8;
- 
--#ifdef FMBMID
--    fmd_widgets[FMBMID].relative_x = i;
--    i += strlen (fmd_widgets[FMBMID].text) + 6;
-+#ifdef FM_BKGND
-+    fmd_widgets[FM_BKGND].relative_x = i;
-+     i += mbstrlen (fmd_widgets[FM_BKGND].text) + 6;
- #endif
- 
--    fmd_widgets[FMBRGT].relative_x = i;
-+    fmd_widgets[FM_CANCEL].relative_x = i;
- 
- #define	chkbox_xpos(i) \
--	fmd_widgets [i].relative_x = fmd_xlen - strlen (fmd_widgets [i].text) - 6
-+	fmd_widgets [i].relative_x = fmd_xlen - mbstrlen (fmd_widgets [i].text) - 6
- 
--    chkbox_xpos (FMCB0);
--    chkbox_xpos (FMCB21);
--    chkbox_xpos (FMCB22);
-+    chkbox_xpos (FM_USING_SHELL_PATT);
-+    chkbox_xpos (FM_DIVE_INTO_SUBDIR);
-+    chkbox_xpos (FM_STAB_SYM);
- 
-     if (fmd_xlen != FMD_XLEN) {
- 	i = sizeof (fmd_widgets) / sizeof (fmd_widgets[0]) - 1;
- 	while (i--)
- 	    fmd_widgets[i].x_divisions = fmd_xlen;
- 
--	fmd_widgets[FMDI1].hotkey_pos =
--	    fmd_widgets[FMDI2].hotkey_pos = fmd_xlen - 6;
-+	fmd_widgets[FM_SRC_INPUT].hotkey_pos =
-+	    fmd_widgets[FM_DST_INPUT].hotkey_pos = fmd_xlen - 6;
-     }
- #undef chkbox_xpos
- 
-@@ -856,7 +883,7 @@
- 
- char *
- file_mask_dialog (FileOpContext *ctx, FileOperation operation, const char *text,
--		  const char *def_text, int only_one, int *do_background)
-+		  const char *def_text_orig, int only_one, int *do_background)
- {
-     int source_easy_patterns = easy_patterns;
-     char *source_mask, *orig_mask, *dest_dir, *tmpdest;
-@@ -865,20 +892,32 @@
-     struct stat buf;
-     int val;
-     QuickDialog Quick_input;
--
-+    char *def_text;
-+#ifdef HAVE_CHARSET
-+    char *errmsg;
-+#endif
-     g_return_val_if_fail (ctx != NULL, NULL);
-+
-+    def_text = g_strdup(def_text_orig);
-+
- #if 0
-     message (1, __FUNCTION__, "text = `%s' \n def_text = `%s'", text,
- 		def_text);
- #endif
-+
-+#ifdef UTF8
-+	fix_utf8(def_text);
-+#endif
-+
-     fmd_init_i18n (FALSE);
- 
-     /* Set up the result pointers */
- 
--    fmd_widgets[FMCB12].result = &ctx->op_preserve;
--    fmd_widgets[FMCB11].result = &ctx->follow_links;
--    fmd_widgets[FMCB22].result = &ctx->stable_symlinks;
--    fmd_widgets[FMCB21].result = &ctx->dive_into_subdirs;
-+    fmd_widgets[FM_PRES_ATTR].result = &ctx->op_preserve;
-+    fmd_widgets[FM_FOLLOW_LINKS].result = &ctx->follow_links;
-+    fmd_widgets[FM_STAB_SYM].result = &ctx->stable_symlinks;
-+    fmd_widgets[FM_DIVE_INTO_SUBDIR].result = &ctx->dive_into_subdirs;
-+
- 
-     /* filter out a possible password from def_text */
-     def_text_secure = strip_password (g_strdup (def_text), 1);
-@@ -886,8 +925,9 @@
-     /* Create the dialog */
- 
-     ctx->stable_symlinks = 0;
--    fmd_widgets[FMDC].result = &source_easy_patterns;
--    fmd_widgets[FMDI1].text = easy_patterns ? "*" : "^\\(.*\\)$";
-+    fmd_widgets[FM_USING_SHELL_PATT].result = &source_easy_patterns;
-+    fmd_widgets[FM_SRC_INPUT].text = easy_patterns ? "*" : "^\\(.*\\)$";
-+ 
-     Quick_input.xlen = fmd_xlen;
-     Quick_input.xpos = -1;
-     Quick_input.title = op_names[operation];
-@@ -895,19 +935,34 @@
-     Quick_input.ylen = FMDY;
-     Quick_input.i18n = 1;
-     Quick_input.widgets = fmd_widgets;
--    fmd_widgets[FMDI0].text = text;
--    fmd_widgets[FMDI2].text = def_text_secure;
--    fmd_widgets[FMDI2].str_result = &dest_dir;
--    fmd_widgets[FMDI1].str_result = &source_mask;
-+    fmd_widgets[FM_SRC_TITLE].text = text;
-+    fmd_widgets[FM_DST_INPUT].text = def_text_secure;
-+    fmd_widgets[FM_DST_INPUT].str_result = &dest_dir;
-+    fmd_widgets[FM_SRC_INPUT].str_result = &source_mask;
- 
-     *do_background = 0;
-+
-+#ifdef HAVE_CHARSET
-+    ctx->from_codepage=current_panel->src_codepage;
-+    ctx->to_codepage=left_panel->src_codepage;
-+    if(current_panel==left_panel) ctx->to_codepage=right_panel->src_codepage;
-+#endif
-+
-   ask_file_mask:
- 
-+#ifdef HAVE_CHARSET
-+    if(operation!=OP_COPY && operation!=OP_MOVE) {
-+      ctx->from_codepage=-1;
-+      ctx->to_codepage=-1;
-+    }
-+    fmd_widgets[FM_FROM_CODEPAGE].text=get_codepage_id(ctx->from_codepage);
-+    fmd_widgets[FM_TO_CODEPAGE].text=get_codepage_id(ctx->to_codepage);
-+#endif
-+
-     if ((val = quick_dialog_skip (&Quick_input, SKIP)) == B_CANCEL) {
- 	g_free (def_text_secure);
- 	return 0;
-     }
--    g_free (def_text_secure);
- 
-     if (ctx->follow_links)
- 	ctx->stat_func = (mc_stat_fn) mc_stat;
-@@ -929,6 +984,8 @@
-     orig_mask = source_mask;
-     if (!dest_dir || !*dest_dir) {
- 	g_free (source_mask);
-+    g_free (def_text_secure);
-+        g_free(def_text);
- 	return dest_dir;
-     }
-     if (source_easy_patterns) {
-@@ -982,5 +1039,48 @@
-     }
-     if (val == B_USER)
- 	*do_background = 1;
-+#ifdef HAVE_CHARSET
-+    if(val == B_FROM) {
-+      if(operation==OP_COPY || operation==OP_MOVE) {
-+        if(display_codepage<=0) {
-+          message( 1, _(" Warning "),
-+                      _("To use this feature select your codepage in\n"
-+                        "Setup / Display Bits dialog!\n"
-+                        "Do not forget to save options." ));
-+          goto ask_file_mask;
-+        }
-+        ctx->from_codepage=select_charset(ctx->from_codepage,0,
-+                            _(" Choose \"FROM\" codepage for COPY/MOVE operaion "));
-+      }
-+      else
-+        message(1,"Warning",_("Recoding works only with COPY or MOVE operation"));
-+      goto ask_file_mask;
-+    }
-+    if(val == B_TO) {
-+      if(operation==OP_COPY || operation==OP_MOVE) {
-+        if(display_codepage<=0) {
-+          message( 1, _(" Warning "),
-+                      _("To use this feature select your codepage in\n"
-+                        "Setup / Display Bits dialog!\n"
-+                        "Do not forget to save options." ));
-+          goto ask_file_mask;
-+        }
-+        ctx->to_codepage=select_charset(ctx->to_codepage,0,
-+                            _(" Choose \"TO\" codepage for COPY/MOVE operaion "));
-+      }
-+      else
-+        message(1,"Warning",_("Recoding works only with COPY or MOVE operation"));
-+      goto ask_file_mask;
-+    }
-+
-+    errmsg=my_init_tt(ctx->to_codepage,ctx->from_codepage,ctx->tr_table);
-+    if(errmsg) {
-+      my_reset_tt(ctx->tr_table,256);
-+      message( 1, MSG_ERROR, "%s", errmsg);
-+    }
-+#endif
-+
-+    g_free(def_text_secure);
-+    g_free(def_text);
-     return dest_dir;
- }
-diff -urN mc-4.6.1.orig/src/fileopctx.c mc-4.6.1/src/fileopctx.c
---- mc-4.6.1.orig/src/fileopctx.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/fileopctx.c	2007-01-19 18:33:59.000000000 +0500
-@@ -24,8 +24,12 @@
- #include <unistd.h>
- 
- #include "global.h"
--#include "fileopctx.h"
- 
-+#ifdef HAVE_CHARSET
-+#include "recode.h"
-+#endif
-+
-+#include "fileopctx.h"
- 
- /**
-  * file_op_context_new:
-@@ -52,6 +56,12 @@
-     ctx->umask_kill = 0777777;
-     ctx->erase_at_end = TRUE;
- 
-+#ifdef HAVE_CHARSET
-+    ctx->from_codepage=-1;
-+    ctx->to_codepage=-1;
-+    my_reset_tt(ctx->tr_table,256);
-+#endif
-+
-     return ctx;
- }
- 
-diff -urN mc-4.6.1.orig/src/fileopctx.h mc-4.6.1/src/fileopctx.h
---- mc-4.6.1.orig/src/fileopctx.h	2004-10-07 00:06:26.000000000 +0600
-+++ mc-4.6.1/src/fileopctx.h	2007-01-19 18:33:59.000000000 +0500
-@@ -108,6 +108,14 @@
- 	/* User interface data goes here */
- 
- 	void *ui;
-+
-+#ifdef HAVE_CHARSET
-+       /* Recode data */
-+       int from_codepage, to_codepage;
-+       unsigned char tr_table[256];
-+       unsigned char recode_buf[MC_MAXPATHLEN];
-+#endif
-+
- } FileOpContext;
- 
- 
-diff -urN mc-4.6.1.orig/src/find.c mc-4.6.1/src/find.c
---- mc-4.6.1.orig/src/find.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/find.c	2007-01-19 18:33:58.000000000 +0500
-@@ -205,7 +205,7 @@
- 	int l1, maxlen = 0;
- 
- 	while (i--) {
--	    l1 = strlen (labs[i] = _(labs[i]));
-+	    l1 = mbstrlen (labs[i] = _(labs[i]));
- 	    if (l1 > maxlen)
- 		maxlen = l1;
- 	}
-@@ -214,7 +214,7 @@
- 	    FIND_X = i;
- 
- 	for (i = sizeof (buts) / sizeof (buts[0]), l1 = 0; i--;) {
--	    l1 += strlen (buts[i] = _(buts[i]));
-+	    l1 += mbstrlen (buts[i] = _(buts[i]));
- 	}
- 	l1 += 21;
- 	if (l1 > FIND_X)
-@@ -223,8 +223,8 @@
- 	ilen = FIND_X - 7 - maxlen;	/* for the case of very long buttons :) */
- 	istart = FIND_X - 3 - ilen;
- 
--	b1 = b0 + strlen (buts[0]) + 7;
--	b2 = FIND_X - (strlen (buts[2]) + 6);
-+	b1 = b0 + mbstrlen (buts[0]) + 7;
-+	b2 = FIND_X - (mbstrlen (buts[2]) + 6);
- 
- 	i18n_flag = 1;
- 	case_label = _(case_label);
-@@ -813,7 +813,7 @@
-     if (!i18n_flag) {
- 	register int i = sizeof (fbuts) / sizeof (fbuts[0]);
- 	while (i--)
--	    fbuts[i].len = strlen (fbuts[i].text = _(fbuts[i].text)) + 3;
-+	    fbuts[i].len = mbstrlen (fbuts[i].text = _(fbuts[i].text)) + 3;
- 	fbuts[2].len += 2;	/* DEFPUSH_BUTTON */
- 	i18n_flag = 1;
-     }
-diff -urN mc-4.6.1.orig/src/global.h mc-4.6.1/src/global.h
---- mc-4.6.1.orig/src/global.h	2004-09-25 19:46:23.000000000 +0600
-+++ mc-4.6.1/src/global.h	2007-01-19 18:33:58.000000000 +0500
-@@ -146,6 +146,13 @@
- #   define N_(String) (String)
- #endif /* !ENABLE_NLS */
- 
-+#include <slang.h>
-+#if SLANG_VERSION >= 20000
-+#define UTF8 1
-+#define SLsmg_Is_Unicode SLsmg_is_utf8_mode()
-+void SLsmg_write_nwchars(wchar_t *s, size_t n);
-+#endif
-+
- #include "fs.h"
- #include "util.h"
- 
-diff -urN mc-4.6.1.orig/src/help.c mc-4.6.1/src/help.c
---- mc-4.6.1.orig/src/help.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/help.c	2007-01-19 18:33:59.000000000 +0500
-@@ -445,10 +445,28 @@
- #ifndef HAVE_SLANG
- 			addch (acs_map [c]);
- #else
-+#if defined(UTF8) && SLANG_VERSION < 20000
-+			SLsmg_draw_object (h->y + line + 2, h->x + col + 2, acs_map [c]);
-+#else
- 			SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
-+#endif /* UTF8 */
- #endif
-+		} else {
-+#ifdef UTF8
-+		if (SLsmg_Is_Unicode) {
-+		    int len;
-+		    mbstate_t mbs;
-+                   wchar_t wc;
-+		    memset (&mbs, 0, sizeof (mbs));
-+		    len = mbrtowc(&wc, p, MB_CUR_MAX, &mbs);
-+		    if (len <= 0) len = 1; /* skip broken multibyte chars */
-+
-+		    SLsmg_write_nwchars(&wc, 1);
-+		    p += len - 1;
- 		} else
-+#endif
- 		    addch (c);
-+		}
- 		col++;
- 		break;
- 	    }
-@@ -771,6 +789,12 @@
- 	message (1, MSG_ERROR, _(" Cannot open file %s \n %s "), filename ? filename : hlpfile,
- 		 unix_error_string (errno));
-     }
-+    else
-+    {
-+	char *conv = utf8_to_local(data);
-+	g_free(data);
-+	data = conv;
-+    }
- 
-     if (!filename)
- 	g_free (hlpfile);
-diff -urN mc-4.6.1.orig/src/hotlist.c mc-4.6.1/src/hotlist.c
---- mc-4.6.1.orig/src/hotlist.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/hotlist.c	2007-01-19 18:33:58.000000000 +0500
-@@ -555,7 +555,7 @@
- 
- 			row = hotlist_but [i].y;
- 			++count [row];
--			len [row] += strlen (hotlist_but [i].text) + 5;
-+			len [row] += mbstrlen (hotlist_but [i].text) + 5;
- 			if (hotlist_but [i].flags == DEFPUSH_BUTTON)
- 				len [row] += 2;
- 		}
-@@ -580,12 +580,12 @@
- 				/* not first int the row */
- 				if (!strcmp (hotlist_but [i].text, cancel_but))
- 					hotlist_but [i].x = 
--						cols - strlen (hotlist_but [i].text) - 13;
-+						cols - mbstrlen (hotlist_but [i].text) - 13;
- 				else
- 					hotlist_but [i].x = cur_x [row];
- 			}
- 
--			cur_x [row] += strlen (hotlist_but [i].text) + 2
-+			cur_x [row] += mbstrlen (hotlist_but [i].text) + 2
- 				+ (hotlist_but [i].flags == DEFPUSH_BUTTON ? 5 : 3);
- 		}
- 	}
-@@ -814,7 +814,7 @@
- 	for (i = 0; i < 3; i++)
- 	{
- 		qw [i].text = _(qw [i].text);
--		l[i] = strlen (qw [i].text) + 3;
-+		l[i] = mbstrlen (qw [i].text) + 3;
- 	}
- 	space = (len - 4 - l[0] - l[1] - l[2]) / 4;
- 
-@@ -860,7 +860,7 @@
- 	static int i18n_flag = 0;
- #endif /* ENABLE_NLS */
- 
--    len = max (strlen (header), (size_t) msglen (text1, &lines1));
-+    len = max ((int) mbstrlen (header), (size_t) msglen (text1, &lines1));
-     len = max (len, (size_t) msglen (text2, &lines2)) + 4;
-     len = max (len, 64);
- 
-@@ -955,7 +955,7 @@
- 	static int i18n_flag = 0;
- #endif /* ENABLE_NLS */
-     
--    len = max (strlen (header), (size_t) msglen (label, &lines)) + 4;
-+    len = max ((int) mbstrlen (header), (size_t) msglen (label, &lines)) + 4;
-     len = max (len, 64);
- 
- #ifdef ENABLE_NLS
-@@ -1011,7 +1011,7 @@
- {
-     char *prompt, *label;
-     const char *cp = _("Label for \"%s\":");
--    int l = strlen (cp);
-+    int l = mbstrlen (cp);
-     char *label_string = g_strdup (current_panel->cwd);
- 
-     strip_password (label_string, 1);
-diff -urN mc-4.6.1.orig/src/layout.c mc-4.6.1/src/layout.c
---- mc-4.6.1.orig/src/layout.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/layout.c	2007-01-19 18:33:58.000000000 +0500
-@@ -362,36 +362,36 @@
- 
- 	while (i--) {
- 	    s_split_direction[i] = _(s_split_direction[i]);
--	    l1 = strlen (s_split_direction[i]) + 7;
-+	    l1 = mbstrlen (s_split_direction[i]) + 7;
- 	    if (l1 > first_width)
- 		first_width = l1;
- 	}
- 
- 	for (i = 0; i <= 8; i++) {
- 	    check_options[i].text = _(check_options[i].text);
--	    l1 = strlen (check_options[i].text) + 7;
-+	    l1 = mbstrlen (check_options[i].text) + 7;
- 	    if (l1 > first_width)
- 		first_width = l1;
- 	}
- 
--	l1 = strlen (title1) + 1;
-+	l1 = mbstrlen (title1) + 1;
- 	if (l1 > first_width)
- 	    first_width = l1;
- 
--	l1 = strlen (title2) + 1;
-+	l1 = mbstrlen (title2) + 1;
- 	if (l1 > first_width)
- 	    first_width = l1;
- 
- 
--	second_width = strlen (title3) + 1;
-+	second_width = mbstrlen (title3) + 1;
- 	for (i = 0; i < 6; i++) {
- 	    check_options[i].text = _(check_options[i].text);
--	    l1 = strlen (check_options[i].text) + 7;
-+	    l1 = mbstrlen (check_options[i].text) + 7;
- 	    if (l1 > second_width)
- 		second_width = l1;
- 	}
- 	if (console_flag) {
--	    l1 = strlen (output_lines_label) + 13;
-+	    l1 = mbstrlen (output_lines_label) + 13;
- 	    if (l1 > second_width)
- 		second_width = l1;
- 	}
-@@ -405,14 +405,14 @@
- 	 *
- 	 * Now the last thing to do - properly space buttons...
- 	 */
--	l1 = 11 + strlen (ok_button)	/* 14 - all brackets and inner space */
--	    +strlen (save_button)	/* notice: it is 3 char less because */
--	    +strlen (cancel_button);	/* of '&' char in button text */
-+	l1 = 11 + mbstrlen (ok_button)	/* 14 - all brackets and inner space */
-+	    +mbstrlen (save_button)	/* notice: it is 3 char less because */
-+	    +mbstrlen (cancel_button);	/* of '&' char in button text */
- 
- 	i = (first_width + second_width - l1) / 4;
- 	b1 = 5 + i;
--	b2 = b1 + strlen (ok_button) + i + 6;
--	b3 = b2 + strlen (save_button) + i + 4;
-+	b2 = b1 + mbstrlen (ok_button) + i + 6;
-+	b3 = b2 + mbstrlen (save_button) + i + 4;
- 
- 	i18n_layt_flag = 1;
-     }
-@@ -684,7 +684,7 @@
-     panel_do_cols (0);
-     panel_do_cols (1);
- 
--    promptl = strlen (prompt);
-+    promptl = mbstrlen (prompt);
- 
-     widget_set_size (&the_menubar->widget, 0, 0, 1, COLS);
- 
-diff -urN mc-4.6.1.orig/src/learn.c mc-4.6.1/src/learn.c
---- mc-4.6.1.orig/src/learn.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/learn.c	2007-01-19 18:33:59.000000000 +0500
-@@ -236,7 +236,7 @@
- 	learn_but[0].x = 78 / 2 + 4;
- 
- 	learn_but[1].text = _(learn_but[1].text);
--	learn_but[1].x = 78 / 2 - (strlen (learn_but[1].text) + 9);
-+	learn_but[1].x = 78 / 2 - (mbstrlen (learn_but[1].text) + 9);
- 
- 	learn_title = _(learn_title);
- 	i18n_flag = 1;
-diff -urN mc-4.6.1.orig/src/main.c mc-4.6.1/src/main.c
---- mc-4.6.1.orig/src/main.c	2005-07-23 22:52:02.000000000 +0600
-+++ mc-4.6.1/src/main.c	2007-01-19 18:33:59.000000000 +0500
-@@ -86,6 +86,7 @@
- 
- #ifdef	HAVE_CHARSET
- #include "charsets.h"
-+#include "recode.h"
- #endif				/* HAVE_CHARSET */
- 
- #ifdef USE_VFS
-@@ -102,6 +103,7 @@
- /* The structures for the panels */
- WPanel *left_panel = NULL;
- WPanel *right_panel = NULL;
-+WPanel* ret_panel=NULL;
- 
- /* The pointer to the tree */
- WTree *the_tree = NULL;
-@@ -274,6 +276,9 @@
- /* The user's shell */
- const char *shell = NULL;
- 
-+/* Is the LANG UTF-8 ? */                                                     
-+gboolean is_utf8 = FALSE;
-+
- /* mc_home: The home of MC */
- char *mc_home = NULL;
- 
-@@ -585,6 +590,7 @@
-     }
-     directory = *new_dir ? new_dir : home_dir;
- 
-+    ret_panel=panel;
-     if (mc_chdir (directory) == -1) {
- 	strcpy (panel->cwd, olddir);
- 	g_free (olddir);
-@@ -798,6 +804,10 @@
-     {' ', N_("&Quick view     C-x q"), 'Q', quick_view_cmd},
-     {' ', N_("&Info           C-x i"), 'I', info_cmd},
-     {' ', N_("&Tree"), 'T', tree_cmd},
-+#ifdef HAVE_CHARSET
-+    {' ', "", ' ', 0},
-+    {' ', N_("Panel &codepage"), 'C', fnc_l_cmd},
-+#endif
-     {' ', "", ' ', 0},
-     {' ', N_("&Sort order..."), 'S', sort_cmd},
-     {' ', "", ' ', 0},
-@@ -822,6 +832,10 @@
-     {' ', N_("&Quick view     C-x q"), 'Q', quick_view_cmd},
-     {' ', N_("&Info           C-x i"), 'I', info_cmd},
-     {' ', N_("&Tree"), 'T', tree_cmd},
-+#ifdef HAVE_CHARSET
-+    {' ', "", ' ', 0},
-+    {' ', N_("Panel &codepage"), 'C', fnc_r_cmd},
-+#endif
-     {' ', "", ' ', 0},
-     {' ', N_("&Sort order..."), 'S', sort_cmd},
-     {' ', "", ' ', 0},
-@@ -1600,21 +1614,49 @@
- 
- #define xtoolkit_panel_setup()
- 
--/* Show current directory in the xterm title */
-+/* Show hostname and current directory in the xterm title */
- void
- update_xterm_title_path (void)
- {
-     unsigned char *p, *s;
-+    char *pvp;
-+    size_t pvlen;
-+    int pvresult;
- 
-     if (xterm_flag && xterm_title) {
-+	// currrent path
- 	p = s = g_strdup (strip_home_and_password (current_panel->cwd));
-+	// hostname
-+	pvlen = strlen(p);
-+ 	pvp = g_malloc (pvlen + 64); 	//approach - max hostname length
-+        pvresult = gethostname(pvp, 63);
-+	if (pvresult) {		// print just current path
-+	    g_free (pvp);
-+	    pvp = p;
-+	} else {
-+	    s = pvp;
-+	    do {		// merge hostname with path
-+		if (!is_printable (*s))
-+		    *s = '?';
-+	    } while (*++s!=0x00);
-+	    *s++=':';
-+	    strcpy (s, p);
-+	    g_free (p);
-+	}
-+
- 	do {
-+#ifndef UTF8
- 	    if (!is_printable (*s))
-+#else /* UTF8 */
-+            if (*s < ' ')
-+#endif /* UTF8 */
- 		*s = '?';
- 	} while (*++s);
--	fprintf (stdout, "\33]0;mc - %s\7", p);
-+// 	fprintf (stdout, "\33]0;mc - %s\7", p);
-+	fprintf (stdout, "\33]0;mc - %s\7", pvp);
- 	fflush (stdout);
--	g_free (p);
-+// 	g_free (p);
-+	g_free (pvp);
-     }
- }
- 
-@@ -2136,6 +2178,16 @@
-     /* if on, it displays the information that files have been moved to ~/.mc */
-     int show_change_notice = 0;
- 
-+    /* Check whether we have UTF-8 locale */
-+    char *lang = getenv("LANG");
-+    size_t len = 0;
-+    
-+    if ( lang )
-+    	len = strlen(lang);
-+    
-+    if ( len >= 5 && !strcasecmp(&lang[len-5],"UTF-8") )
-+	is_utf8 = TRUE;
-+
-     /* We had LC_CTYPE before, LC_ALL includs LC_TYPE as well */
-     setlocale (LC_ALL, "");
-     bindtextdomain ("mc", LOCALEDIR);
-diff -urN mc-4.6.1.orig/src/main.h mc-4.6.1/src/main.h
---- mc-4.6.1.orig/src/main.h	2005-07-01 21:47:06.000000000 +0600
-+++ mc-4.6.1/src/main.h	2007-01-19 18:33:59.000000000 +0500
-@@ -64,6 +64,7 @@
- extern int only_leading_plus_minus;
- extern int output_starts_shell;
- extern int midnight_shutdown;
-+extern gboolean is_utf8;
- extern char cmd_buf [512];
- extern const char *shell;
- 
-diff -urN mc-4.6.1.orig/src/Makefile.am mc-4.6.1/src/Makefile.am
---- mc-4.6.1.orig/src/Makefile.am	2005-06-08 18:27:19.000000000 +0600
-+++ mc-4.6.1/src/Makefile.am	2007-01-19 18:33:59.000000000 +0500
-@@ -40,7 +40,8 @@
- mc_LDADD = $(EDITLIB) $(SLANGLIB) $(VFSLIB) \
- 	$(INTLLIBS) $(GLIB_LIBS) $(MCLIBS) $(LIBICONV)
- 
--CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h
-+CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h	\
-+	 recode.c recode.h
- 
- SRCS =	achown.c achown.h background.c background.h boxes.c boxes.h	\
- 	chmod.c chmod.h chown.c chown.h cmd.c cmd.h color.c color.h	\
-@@ -55,8 +56,8 @@
- 	menu.c menu.h mountlist.c mountlist.h mouse.c mouse.h myslang.h	\
- 	option.c option.h panel.h panelize.c panelize.h poptalloca.h	\
- 	popt.c poptconfig.c popt.h popthelp.c poptint.h poptparse.c	\
--	profile.c profile.h regex.c rxvt.c screen.c setup.c setup.h	\
--	slint.c	subshell.c subshell.h textconf.c textconf.h		\
-+	profile.c profile.h regex.c rxvt.c screen.c screen.h setup.c	\
-+	setup.h	slint.c	subshell.c subshell.h textconf.c textconf.h	\
- 	tree.c tree.h treestore.c treestore.h tty.h user.c user.h	\
- 	util.c util.h utilunix.c view.c view.h vfsdummy.h widget.c	\
- 	widget.h win.c win.h wtools.c wtools.h				\
-diff -urN mc-4.6.1.orig/src/Makefile.in mc-4.6.1/src/Makefile.in
---- mc-4.6.1.orig/src/Makefile.in	2005-07-23 22:53:15.000000000 +0600
-+++ mc-4.6.1/src/Makefile.in	2007-01-19 18:33:59.000000000 +0500
-@@ -84,12 +84,12 @@
- 	mouse.c mouse.h myslang.h option.c option.h panel.h panelize.c \
- 	panelize.h poptalloca.h popt.c poptconfig.c popt.h popthelp.c \
- 	poptint.h poptparse.c profile.c profile.h regex.c rxvt.c \
--	screen.c setup.c setup.h slint.c subshell.c subshell.h \
-+	screen.c screen.h setup.c setup.h slint.c subshell.c subshell.h \
- 	textconf.c textconf.h tree.c tree.h treestore.c treestore.h \
- 	tty.h user.c user.h util.c util.h utilunix.c view.c view.h \
- 	vfsdummy.h widget.c widget.h win.c win.h wtools.c wtools.h \
- 	x11conn.h x11conn.c charsets.c charsets.h selcodepage.c \
--	selcodepage.h
-+	selcodepage.h recode.c recode.h
- am__objects_1 = achown.$(OBJEXT) background.$(OBJEXT) boxes.$(OBJEXT) \
- 	chmod.$(OBJEXT) chown.$(OBJEXT) cmd.$(OBJEXT) color.$(OBJEXT) \
- 	command.$(OBJEXT) complete.$(OBJEXT) cons.handler.$(OBJEXT) \
-@@ -109,7 +109,8 @@
- 	util.$(OBJEXT) utilunix.$(OBJEXT) view.$(OBJEXT) \
- 	widget.$(OBJEXT) win.$(OBJEXT) wtools.$(OBJEXT) \
- 	x11conn.$(OBJEXT)
--am__objects_2 = charsets.$(OBJEXT) selcodepage.$(OBJEXT)
-+am__objects_2 = charsets.$(OBJEXT) selcodepage.$(OBJEXT) recode.$(OBJEXT)
-+
- @CHARSET_FALSE@am_mc_OBJECTS = $(am__objects_1)
- @CHARSET_TRUE@am_mc_OBJECTS = $(am__objects_1) $(am__objects_2)
- mc_OBJECTS = $(am_mc_OBJECTS)
-@@ -342,7 +343,8 @@
- mc_LDADD = $(EDITLIB) $(SLANGLIB) $(VFSLIB) \
- 	$(INTLLIBS) $(GLIB_LIBS) $(MCLIBS) $(LIBICONV)
- 
--CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h
-+CHARSET_SRC = charsets.c charsets.h selcodepage.c selcodepage.h		\
-+	recode.c recode.h
- SRCS = achown.c achown.h background.c background.h boxes.c boxes.h	\
- 	chmod.c chmod.h chown.c chown.h cmd.c cmd.h color.c color.h	\
- 	command.c command.h complete.c complete.h cons.handler.c	\
-@@ -356,8 +358,8 @@
- 	menu.c menu.h mountlist.c mountlist.h mouse.c mouse.h myslang.h	\
- 	option.c option.h panel.h panelize.c panelize.h poptalloca.h	\
- 	popt.c poptconfig.c popt.h popthelp.c poptint.h poptparse.c	\
--	profile.c profile.h regex.c rxvt.c screen.c setup.c setup.h	\
--	slint.c	subshell.c subshell.h textconf.c textconf.h		\
-+	profile.c profile.h regex.c rxvt.c screen.c screen.h setup.c	\
-+	setup.h	slint.c	subshell.c subshell.h textconf.c textconf.h	\
- 	tree.c tree.h treestore.c treestore.h tty.h user.c user.h	\
- 	util.c util.h utilunix.c view.c view.h vfsdummy.h widget.c	\
- 	widget.h win.c win.h wtools.c wtools.h				\
-diff -urN mc-4.6.1.orig/src/menu.c mc-4.6.1/src/menu.c
---- mc-4.6.1.orig/src/menu.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/menu.c	2007-01-19 18:33:59.000000000 +0500
-@@ -20,6 +20,8 @@
- #include <stdarg.h>
- #include <sys/types.h>
- #include <ctype.h>
-+#include <wchar.h>
-+
- #include "global.h"
- #include "tty.h"
- #include "menu.h"
-@@ -50,33 +52,96 @@
- {
-     Menu *menu;
-     const char *cp;
-+    int wlen = 0;
-+    mbstate_t s;
- 
-     menu = (Menu *) g_malloc (sizeof (*menu));
-     menu->count = count;
-     menu->max_entry_len = 20;
-     menu->entries = entries;
-+    menu->name = g_strdup (name);
-+    menu_scan_hotkey (menu);
-+#ifdef UTF8
-+    menu->wentries = NULL;
-+    menu->wname = NULL;
-+    if (SLsmg_Is_Unicode) {
-+      const char *str = menu->name;
-+      memset (&s, 0, sizeof (s));
-+      wlen = mbsrtowcs (NULL, &str, -1, &s);
-+      if (wlen > 0)
-+        ++wlen;
-+      else {
-+        wlen = 0;
-+        memset (&s, 0, sizeof (s));
-+      }
-+    }
-+#endif
- 
-     if (entries != (menu_entry*) NULL) {
- 	register menu_entry* mp;
- 	for (mp = entries; count--; mp++) {
- 	    if (mp->text[0] != '\0') {
-+		int len;
- #ifdef ENABLE_NLS
- 	        mp->text = _(mp->text);
- #endif /* ENABLE_NLS */
- 	        cp = strchr (mp->text,'&');
- 
-+#ifdef UTF8
-+		if (SLsmg_Is_Unicode) {
-+                    len = mbstrlen(mp->text) + 1;
-+                    wlen += len;
-+                    menu->max_entry_len = max (len - 1, menu->max_entry_len);
-+                } else
-+#endif
-+                    len = strlen (mp->text);
-+
- 		if (cp != NULL && *(cp+1) != '\0') {
- 		    mp->hot_key = tolower (*(cp+1));
--		    menu->max_entry_len = max ((int) (strlen (mp->text) - 1),
--			menu->max_entry_len);
-+		    menu->max_entry_len = max (len - 1, menu->max_entry_len);
- 		} else {
--		    menu->max_entry_len = max ((int) strlen (mp->text),
--			menu->max_entry_len);
-+		    menu->max_entry_len = max (len, menu->max_entry_len);
- 		}
- 	    }
- 	}
-     }
- 
-+#ifdef UTF8
-+    if (wlen) {
-+      wchar_t *wp;
-+      const char *str;
-+      int len;
-+
-+      menu->wentries = (wchar_t **)
-+                       g_malloc (sizeof (wchar_t *) * menu->count
-+                                 + wlen * sizeof (wchar_t));
-+      wp = (wchar_t *) (menu->wentries + menu->count);
-+      str = menu->name;
-+      len = mbsrtowcs (wp, &str, wlen, &s);
-+      if (len > 0) {
-+          menu->wname = wp;
-+          wlen -= len + 1;
-+          wp += len + 1;
-+      } else
-+          memset (&s, 0, sizeof (s));
-+      if (menu->entries != NULL)
-+          for (count = 0; count < menu->count; ++count)
-+              if (menu->entries[count].text[0] != '\0') {
-+                  str = menu->entries[count].text;
-+                  menu->wentries[count] = wp;
-+                  len = mbsrtowcs (wp, &str, wlen, &s);
-+                  if (len > 0) {
-+                      wlen -= len + 1;
-+                      wp += len + 1;
-+                  } else {
-+                      memset (&s, 0, sizeof (s));
-+                      *wp++ = L'\0';
-+                      --wlen;
-+                  }
-+              }
-+    }
-+#endif
-+
-     menu->name = g_strdup (name);
-     menu_scan_hotkey(menu);
-     menu->start_x = 0;
-@@ -109,8 +174,26 @@
- 	const unsigned char *text;
- 
- 	addch((unsigned char)menu->entries [idx].first_letter);
--	for (text = menu->entries [idx].text; *text; text++)
--	{
-+#ifdef UTF8
-+	if (menu->wentries) {
-+	    wchar_t *wtext, *wp;
-+
-+	    for (wtext = wp = menu->wentries [idx]; *wtext; wtext++) {
-+		if (*wtext == L'&') {
-+		    if (wtext > wp)
-+			SLsmg_write_nwchars (wp, wtext - wp);
-+		    attrset (color == MENU_SELECTED_COLOR ?
-+			MENU_HOTSEL_COLOR : MENU_HOT_COLOR);
-+		    SLsmg_write_nwchars (++wtext, 1);
-+		    attrset (color);
-+		    wp = wtext + 1;
-+		}
-+	    }
-+	    if (wtext > wp)
-+		SLsmg_write_nwchars (wp, wtext - wp);
-+	} else
-+#endif
-+	    for (text = menu->entries [idx].text; *text; text++) {
- 		if (*text != '&')
- 		    addch(*text);
- 		else {
-@@ -119,7 +202,7 @@
- 		    addch(*(++text));
- 		    attrset(color);
- 		}
--	}
-+	    }
-     }
-     widget_move (&menubar->widget, y, x + 1);
- }
-@@ -167,7 +250,13 @@
- 	if (menubar->active)
- 	    attrset(i == menubar->selected?MENU_SELECTED_COLOR:SELECTED_COLOR);
- 	widget_move (&menubar->widget, 0, menubar->menu [i]->start_x);
--	printw ("%s", menubar->menu [i]->name);
-+#ifdef UTF8
-+	if (menubar->menu [i]->wname)
-+	    SLsmg_write_nwchars (menubar->menu [i]->wname,
-+				 wcslen (menubar->menu [i]->wname));
-+	else
-+#endif
-+	    printw ("%s", menubar->menu [i]->name);
-     }
- 
-     if (menubar->dropped)
-@@ -489,7 +578,13 @@
- 
- 	for (i = 0; i < items; i++)
- 	{
--		int len = strlen(menubar->menu[i]->name);
-+		int len;
-+#ifdef UTF8
-+		if (menubar->menu[i]->wname)
-+		    len = wcslen (menubar->menu[i]->wname);
-+		else
-+#endif		
-+		    len = strlen(menubar->menu[i]->name);
- 		menubar->menu[i]->start_x = start_x;
- 		start_x += len + gap;
- 	}
-@@ -502,7 +597,13 @@
- 	for (i = 0; i < items; i++)
- 	{
- 		/* preserve length here, to be used below */
--		gap -= (menubar->menu[i]->start_x = strlen(menubar->menu[i]->name));
-+#ifdef UTF8
-+		if (menubar->menu[i]->wname)
-+		    menubar->menu[i]->start_x = wcslen (menubar->menu[i]->wname);
-+		else
-+#endif
-+		    menubar->menu[i]->start_x = strlen (menubar->menu[i]->name);
-+		gap -= menubar->menu[i]->start_x;
- 	}
- 
- 	gap /= (items - 1);
-@@ -526,6 +627,9 @@
- void
- destroy_menu (Menu *menu)
- {
-+#ifdef UTF8
-+    g_free (menu->wentries);
-+#endif
-     g_free (menu->name);
-     g_free (menu->help_node);
-     g_free (menu);
-diff -urN mc-4.6.1.orig/src/menu.h mc-4.6.1/src/menu.h
---- mc-4.6.1.orig/src/menu.h	2004-09-18 20:30:59.000000000 +0600
-+++ mc-4.6.1/src/menu.h	2007-01-19 18:33:59.000000000 +0500
-@@ -21,6 +21,8 @@
-     menu_entry *entries;
-     int    start_x;		/* position relative to menubar start */
-     char   *help_node;
-+    wchar_t **wentries;
-+    wchar_t *wname;
- } Menu;
- 
- extern int menubar_visible;
-diff -urN mc-4.6.1.orig/src/mountlist.c mc-4.6.1/src/mountlist.c
---- mc-4.6.1.orig/src/mountlist.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/mountlist.c	2007-01-19 18:33:59.000000000 +0500
-@@ -132,11 +132,19 @@
- 
- struct fs_usage
- {
-+#ifndef HAVE_SYS_STATVFS_H
-   long fsu_blocks;		/* Total blocks. */
-   long fsu_bfree;		/* Free blocks available to superuser. */
-   long fsu_bavail;		/* Free blocks available to non-superuser. */
-   long fsu_files;		/* Total file nodes. */
-   long fsu_ffree;		/* Free file nodes. */
-+#else	/* We have sys/statvfs.h, use proper data types when _FILE_OFFSET_BITS=64 */
-+  fsblkcnt_t fsu_blocks;
-+  fsblkcnt_t fsu_bfree;
-+  fsblkcnt_t fsu_bavail;
-+  fsblkcnt_t fsu_files;
-+  fsblkcnt_t fsu_ffree;
-+#endif /* HAVE_SYS_STATVFS_H */
- };
- 
- static int get_fs_usage (char *path, struct fs_usage *fsp);
-@@ -663,6 +671,7 @@
-    BLOCKS FROMSIZE-byte blocks, rounding away from zero.
-    TOSIZE must be positive.  Return -1 if FROMSIZE is not positive.  */
- 
-+#if !defined(HAVE_SYS_STATFS_H) || !defined(STAT_STATVFS)
- static long
- fs_adjust_blocks (long blocks, int fromsize, int tosize)
- {
-@@ -670,13 +679,21 @@
- 	abort ();
-     if (fromsize <= 0)
- 	return -1;
--
-+#else
-+static fsblkcnt_t
-+fs_adjust_blocks (fsblkcnt_t blocks, unsigned long fromsize, unsigned long tosize)
-+{
-+    if (!tosize)
-+        abort ();
-+    if (!fromsize)
-+        return -1;
-+#endif
-     if (fromsize == tosize)	/* E.g., from 512 to 512.  */
- 	return blocks;
-     else if (fromsize > tosize)	/* E.g., from 2048 to 512.  */
- 	return blocks * (fromsize / tosize);
-     else			/* E.g., from 256 to 512.  */
--	return (blocks + (blocks < 0 ? -1 : 1)) / (tosize / fromsize);
-+	return (blocks + 1) / (tosize / fromsize);
- }
- 
- #if defined(_AIX) && defined(_I386)
-diff -urN mc-4.6.1.orig/src/myslang.h mc-4.6.1/src/myslang.h
---- mc-4.6.1.orig/src/myslang.h	2004-10-12 10:32:04.000000000 +0600
-+++ mc-4.6.1/src/myslang.h	2007-01-19 18:33:59.000000000 +0500
-@@ -11,6 +11,10 @@
- #endif	/* HAVE_SLANG_SLANG_H */
- #endif
- 
-+#ifdef UTF8
-+#    include <wchar.h>
-+#endif
-+
- enum {
-     KEY_BACKSPACE = 400,
-     KEY_END, KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT,
-diff -urN mc-4.6.1.orig/src/option.c mc-4.6.1/src/option.c
---- mc-4.6.1.orig/src/option.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/option.c	2007-01-19 18:33:59.000000000 +0500
-@@ -124,12 +124,12 @@
- 	title2 = _(" Pause after run... ");
- 	title3 = _(" Other options ");
- 
--	first_width = strlen (title1) + 1;
--	second_width = strlen (title3) + 1;
-+	first_width = mbstrlen (title1) + 1;
-+	second_width = mbstrlen (title3) + 1;
- 
- 	for (i = 0; check_options[i].text; i++) {
- 	    check_options[i].text = _(check_options[i].text);
--	    l1 = strlen (check_options[i].text) + 7;
-+	    l1 = mbstrlen (check_options[i].text) + 7;
- 	    if (i >= OTHER_OPTIONS) {
- 		if (l1 > first_width)
- 		    first_width = l1;
-@@ -142,23 +142,23 @@
- 	i = PAUSE_OPTIONS;
- 	while (i--) {
- 	    pause_options[i] = _(pause_options[i]);
--	    l1 = strlen (pause_options[i]) + 7;
-+	    l1 = mbstrlen (pause_options[i]) + 7;
- 	    if (l1 > first_width)
- 		first_width = l1;
- 	}
- 
--	l1 = strlen (title2) + 1;
-+	l1 = mbstrlen (title2) + 1;
- 	if (l1 > first_width)
- 	    first_width = l1;
- 
--	l1 = 11 + strlen (ok_button)
--	    + strlen (save_button)
--	    + strlen (cancel_button);
-+	l1 = 11 + mbstrlen (ok_button)
-+	    + mbstrlen (save_button)
-+	    + mbstrlen (cancel_button);
- 
- 	i = (first_width + second_width - l1) / 4;
- 	b1 = 5 + i;
--	b2 = b1 + strlen (ok_button) + i + 6;
--	b3 = b2 + strlen (save_button) + i + 4;
-+	b2 = b1 + mbstrlen (ok_button) + i + 6;
-+	b3 = b2 + mbstrlen (save_button) + i + 4;
- 
- 	i18n_config_flag = 1;
-     }
-diff -urN mc-4.6.1.orig/src/panel.h mc-4.6.1/src/panel.h
---- mc-4.6.1.orig/src/panel.h	2004-08-29 22:55:51.000000000 +0600
-+++ mc-4.6.1/src/panel.h	2007-01-19 18:33:59.000000000 +0500
-@@ -71,6 +71,19 @@
- 
-     int      searching;
-     char     search_buffer [256];
-+
-+#ifdef HAVE_CHARSET
-+    int src_codepage;
-+    unsigned char tr_table[256], tr_table_input[256];
-+#endif
-+
-+#ifdef USE_VFS
-+ #ifdef HAVE_CHARSET
-+    int ret_codepage;
-+ #endif
-+    int  is_return;
-+    char retdir[MC_MAXPATHLEN];
-+#endif
- } WPanel;
- 
- WPanel *panel_new (const char *panel_name);
-@@ -96,6 +109,7 @@
- extern WPanel *left_panel;
- extern WPanel *right_panel;
- extern WPanel *current_panel;
-+extern WPanel* ret_panel;
- 
- void try_to_select (WPanel *panel, const char *name);
- 
-diff -urN mc-4.6.1.orig/src/panelize.c mc-4.6.1/src/panelize.c
---- mc-4.6.1.orig/src/panelize.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/panelize.c	2007-01-19 18:33:59.000000000 +0500
-@@ -127,7 +127,7 @@
- 	i = sizeof (panelize_but) / sizeof (panelize_but[0]);
- 	while (i--) {
- 	    panelize_but[i].text = _(panelize_but[i].text);
--	    maxlen += strlen (panelize_but[i].text) + 5;
-+	    maxlen += mbstrlen (panelize_but[i].text) + 5;
- 	}
- 	maxlen += 10;
- 
-@@ -136,11 +136,11 @@
-     panelize_cols = max (panelize_cols, maxlen);
- 
-     panelize_but[2].x =
--	panelize_but[3].x + strlen (panelize_but[3].text) + 7;
-+	panelize_but[3].x + mbstrlen (panelize_but[3].text) + 7;
-     panelize_but[1].x =
--	panelize_but[2].x + strlen (panelize_but[2].text) + 5;
-+	panelize_but[2].x + mbstrlen (panelize_but[2].text) + 5;
-     panelize_but[0].x =
--	panelize_cols - strlen (panelize_but[0].text) - 8 - BX;
-+	panelize_cols - mbstrlen (panelize_but[0].text) - 8 - BX;
- 
- #endif				/* ENABLE_NLS */
- 
-diff -urN mc-4.6.1.orig/src/recode.c mc-4.6.1/src/recode.c
---- mc-4.6.1.orig/src/recode.c	1970-01-01 05:00:00.000000000 +0500
-+++ mc-4.6.1/src/recode.c	2007-01-19 18:33:59.000000000 +0500
-@@ -0,0 +1,153 @@
-+#include "recode.h"
-+#ifdef HAVE_CHARSET
-+
-+char *lang;
-+char lang_codepage_name[256];
-+int lang_codepage;
-+
-+int ftp_codepage=-1;
-+
-+// recode buffer for displaying file names
-+unsigned char recode_buf[MC_MAXPATHLEN];
-+
-+WPanel* recode_panel;
-+
-+//--- get codepage from $LANG
-+void get_locale_codepage() {
-+  char* a;
-+  char* b;
-+  int len;
-+
-+  lang=getenv("LANG");
-+  if(!lang) {
-+    strncpy(lang_codepage_name,OTHER_8BIT, sizeof(OTHER_8BIT)); 
-+    lang_codepage=-1;
-+    return;
-+  }
-+
-+  a=strchr(lang,'.');
-+  if(!a) {
-+    strncpy(lang_codepage_name,OTHER_8BIT, sizeof(OTHER_8BIT)); 
-+    lang_codepage=-1;
-+    return;
-+  }
-+  ++a;
-+
-+  b=strchr(lang,'@');
-+  if(!b) b=lang+strlen(lang);
-+
-+  len=b-a;
-+  if(len>=sizeof(lang_codepage_name)) len=sizeof(lang_codepage_name)-1;
-+
-+  memcpy(lang_codepage_name,a, len);
-+  lang_codepage_name[len]='\0';
-+  lang_codepage=get_codepage_index(lang_codepage_name);
-+  if(lang_codepage<0) strncpy(lang_codepage_name,OTHER_8BIT, sizeof(OTHER_8BIT));
-+}
-+
-+//--- reset translation table
-+void  my_reset_tt(unsigned char *table,int n) {
-+  int i;
-+  for(i=0;i<n;i++) table[i]=i;
-+}
-+
-+//--- reset panel codepage
-+void panel_reset_codepage(WPanel *p) {
-+  p->src_codepage=-1;
-+  my_reset_tt(p->tr_table,256);
-+  my_reset_tt(p->tr_table_input,256);
-+}
-+
-+//--- Initialize translation table 
-+//    i need this function because init_translation_table from
-+//    charsets.c fills only fixed translation tables conv_displ and conv_input
-+//---   
-+char* my_init_tt( int from, int to, unsigned char *table) {
-+ int i;
-+ iconv_t cd;
-+ char *cpfrom, *cpto;
-+
-+ if(from < 0 || to < 0 || from == to) {
-+   my_reset_tt(table,256);
-+   return NULL;
-+ }
-+ my_reset_tt(table,128);
-+ cpfrom=codepages[from ].id;
-+ cpto=codepages[to].id;
-+ cd=iconv_open(cpfrom, cpto);
-+ if(cd==(iconv_t)-1) {
-+   snprintf(errbuf, 255, _("Cannot translate from %s to %s"), cpfrom, cpto);
-+   return errbuf;
-+ }
-+ for(i=128; i<=255; ++i) table[i] = translate_character(cd, i);
-+ iconv_close(cd);
-+ return NULL;
-+}
-+
-+//--- Translate string from one codepage to another
-+void my_translate_string(unsigned char *s1,int l1, unsigned char *s2, unsigned char *table) {
-+  int i=0;
-+  if(!s1) return;
-+  while(i<l1) {
-+    s2[i]=table[s1[i]];
-+    i++;
-+   }
-+  s2[i]=0;
-+}
-+
-+//--- Recode filename and concat in to dir
-+char* concat_dir_and_recoded_fname(const char *dir, const char *fname, FileOpContext *ctx) {
-+    int i = strlen (dir);
-+    
-+    my_translate_string((unsigned char*)fname,strlen(fname),ctx->recode_buf,ctx->tr_table);
-+    if (dir [i-1] == PATH_SEP)
-+        return  g_strconcat (dir, ctx->recode_buf, NULL);
-+    else
-+        return  g_strconcat (dir, PATH_SEP_STR, ctx->recode_buf, NULL);
-+  return 0;
-+}
-+
-+
-+//--- Internal handler for "Panel codepage"
-+static void fnc_cmd(WPanel *p) {
-+  char *errmsg;
-+  if(display_codepage > 0) {
-+    p->src_codepage=select_charset(p->src_codepage, 0, _(" Choose panel codepage "));
-+    errmsg=my_init_tt(display_codepage,p->src_codepage,p->tr_table);
-+    if(errmsg) {
-+      panel_reset_codepage(p);
-+      message( 1, MSG_ERROR, "%s", errmsg);
-+    }
-+    errmsg=my_init_tt(p->src_codepage,display_codepage,p->tr_table_input);
-+    if (errmsg) {
-+      panel_reset_codepage(p);
-+      message( 1, MSG_ERROR, "%s", errmsg );
-+     }
-+    paint_dir(p);
-+    show_dir(p);
-+    display_mini_info(p);
-+  }
-+  else {
-+    message( 1, _(" Warning "),
-+                _("To use this feature select your codepage in\n"
-+                  "Setup / Display Bits dialog!\n"
-+                  "Do not forget to save options." ));
-+  }
-+}
-+
-+//--- Menu handlers for "Panel codepage" for left and right panel menu
-+
-+void fnc_l_cmd() {
-+  fnc_cmd(left_panel);
-+}
-+
-+void fnc_r_cmd() {
-+  fnc_cmd(right_panel);
-+}
-+
-+//--- screen handler for "Panel codepage"
-+void fnc_c_cmd(WPanel *panel) {
-+  fnc_cmd(current_panel);
-+}
-+
-+#endif //HAVE_CHARSET
-diff -urN mc-4.6.1.orig/src/recode.h mc-4.6.1/src/recode.h
---- mc-4.6.1.orig/src/recode.h	1970-01-01 05:00:00.000000000 +0500
-+++ mc-4.6.1/src/recode.h	2007-01-19 18:33:59.000000000 +0500
-@@ -0,0 +1,48 @@
-+#ifndef __RECODE_H__
-+#define __RECODE_H__
-+#include <config.h>
-+#ifdef HAVE_CHARSET
-+
-+#include <stdio.h>
-+#include <locale.h>
-+#include <iconv.h>
-+
-+#include "global.h"
-+#include "wtools.h"
-+#include "panel.h"
-+#include "charsets.h"
-+#include "selcodepage.h"
-+#include "screen.h"
-+#include "main.h"
-+#include "fileopctx.h"
-+    
-+extern char *lang;
-+extern char lang_codepage_name[256];
-+extern int lang_codepage;
-+
-+extern int ftp_codepage;
-+
-+// recode buffer for displaying file names
-+extern unsigned char recode_buf[MC_MAXPATHLEN];
-+extern WPanel* recode_panel;
-+
-+//--- get codepage from $LANG
-+extern void get_locale_codepage();
-+
-+//--- reset translation table
-+extern void  my_reset_tt(unsigned char *table,int n);
-+//--- reset panel codepage
-+extern void panel_reset_codepage(WPanel *p);
-+//--- Initialize translation table
-+extern char* my_init_tt( int from, int to, unsigned char *table);
-+//--- Translate string from one codepage to another
-+extern void my_translate_string(unsigned char *s1,int l1, unsigned char *s2, unsigned char *table);
-+//--- Recode filename and concat in to dir
-+extern char* concat_dir_and_recoded_fname(const char *dir, const char *fname, FileOpContext *ctx);
-+//--- handlers for "Panel codepage"
-+extern void fnc_l_cmd();
-+extern void fnc_r_cmd();
-+extern void fnc_c_cmd(WPanel *panel);
-+
-+#endif // HAVE_CHARSET
-+#endif //__RECODE_H__
-diff -urN mc-4.6.1.orig/src/screen.c mc-4.6.1/src/screen.c
---- mc-4.6.1.orig/src/screen.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/screen.c	2007-01-19 18:33:59.000000000 +0500
-@@ -48,6 +48,10 @@
- #define WANT_WIDGETS
- #include "main.h"		/* the_menubar */
- 
-+#ifdef HAVE_CHARSET
-+#include "recode.h"
-+#endif
-+
- #define ELEMENTS(arr) ( sizeof(arr) / sizeof((arr)[0]) )
- 
- #define J_LEFT 		1
-@@ -169,22 +173,67 @@
- static const char *
- string_file_name (file_entry *fe, int len)
- {
--    static char buffer [BUF_SMALL];
-     size_t i;
-+    char* filename;    
-+#ifdef UTF8
-+    static char buffer [BUF_SMALL * 4];
-+    mbstate_t s;
-+    int mbmax = MB_CUR_MAX;
-+    const char *str = fe->fname;
- 
--    for (i = 0; i < sizeof(buffer) - 1; i++) {
--	char c;
-+    memset (&s, 0, sizeof (s));
-+#else
-+    static char buffer [BUF_SMALL];
-+#endif
- 
--	c = fe->fname[i];
-+#ifdef HAVE_CHARSET
-+    my_translate_string(fe->fname,fe->fnamelen, recode_buf, recode_panel->tr_table);
-+    filename= recode_buf;
-+#else
-+    filename=fe->fname;
-+#endif
- 
--	if (!c)
--	    break;
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode)
-+	for (i = 0; i < sizeof (buffer) - 1; i++) {
-+	    wchar_t wc;
-+	    int len;
- 
--	if (!is_printable(c))
--	    c = '?';
-+	    len = mbrtowc (&wc, str, mbmax, &s);
-+	    if (!len)
-+		break;
-+	    if (len < 0) {
-+		memset (&s, 0, sizeof (s));
-+		buffer[i] = '?';
-+		str++;
-+		continue;
-+	    }
-+	    if (!is_printable (wc)) {
-+		buffer[i] = '?';
-+		str++;
-+		continue;
-+	    }
-+	    if (i >= sizeof (buffer) - len)
-+		break;
-+	    memcpy (buffer + i, str, len);
-+	    i += len - 1;
-+	    str += len;
-+	}
-+    else
-+#endif
-+      for (i = 0; i < sizeof(buffer) - 1; i++) {
-+	  char c;
- 
--	buffer[i] = c;
--    }
-+      c= filename[i];
-+
-+	  if (!c)
-+	      break;
-+
-+	  if (!is_printable(c))
-+	      c = '?';
-+
-+	  buffer[i] = c;
-+      }
- 
-     buffer[i] = 0;
-     return buffer;
-@@ -425,42 +474,6 @@
- { "dot",   1,  0, J_RIGHT,	" ",		0, string_dot,		   NULL },
- };
- 
--static char *
--to_buffer (char *dest, int just_mode, int len, const char *txt)
--{
--    int txtlen = strlen (txt);
--    int still, over;
--
--    /* Fill buffer with spaces */
--    memset (dest, ' ', len);
--
--    still = (over=(txtlen > len)) ? (txtlen - len) : (len - txtlen);
--
--    switch (HIDE_FIT(just_mode)){
--        case J_LEFT:
--	    still = 0;
--	    break;
--	case J_CENTER:
--	    still /= 2;
--	    break;
--	case J_RIGHT:
--	default:
--	    break;
--    }
--
--    if (over){
--	if (IS_FIT(just_mode))
--	    strcpy (dest, name_trunc(txt, len));
--	else
--	    strncpy (dest, txt+still, len);
--    } else
--	strncpy (dest+still, txt, txtlen);
--
--    dest[len] = '\0';
--
--    return (dest + len);
--}
--
- static int
- file_compute_color (int attr, file_entry *fe)
- {
-@@ -514,14 +527,18 @@
- 
- /* Formats the file number file_index of panel in the buffer dest */
- static void
--format_file (char *dest, int limit, WPanel *panel, int file_index, int width, int attr, int isstatus)
-+format_file (WPanel *panel, int file_index, int width, int attr, int isstatus)
- {
-     int      color, length, empty_line;
-     const char *txt;
--    char     *old_pos;
--    char     *cdest = dest;
-     format_e *format, *home;
-     file_entry *fe;
-+#ifdef UTF8
-+    char     buffer[BUF_MEDIUM * sizeof (wchar_t)];
-+#else
-+    char     buffer[BUF_MEDIUM];
-+#endif
-+    int txtwidth;
- 
-     length     = 0;
-     empty_line = (file_index >= panel->count);
-@@ -539,34 +556,137 @@
- 	    break;
- 
- 	if (format->string_fn){
--	    int len;
-+	    int len, still, over, perm, txtlen, wide;
- 
- 	    if (empty_line)
- 		txt = " ";
- 	    else
- 		txt = (*format->string_fn)(fe, format->field_len);
- 
--	    old_pos = cdest;
--
- 	    len = format->field_len;
- 	    if (len + length > width)
- 		len = width - length;
--	    if (len + (cdest - dest) > limit)
--		len = limit - (cdest - dest);
-+	    if (len >= BUF_MEDIUM)
-+		len = BUF_MEDIUM - 1;
- 	    if (len <= 0)
- 		break;
--	    cdest = to_buffer (cdest, format->just_mode, len, txt);
--	    length += len;
- 
--            attrset (color);
-+	    perm = 0;
-+            if (permission_mode) {
-+		if (!strcmp(format->id, "perm"))
-+		    perm = 1;
-+		else if (!strcmp(format->id, "mode"))
-+		    perm = 2;
-+	    }
- 
--            if (permission_mode && !strcmp(format->id, "perm"))
--                add_permission_string (old_pos, format->field_len, fe, attr, color, 0);
--            else if (permission_mode && !strcmp(format->id, "mode"))
--                add_permission_string (old_pos, format->field_len, fe, attr, color, 1);
--            else
--		addstr (old_pos);
-+	    wide = 0;
-+#ifdef UTF8
-+	    if (SLsmg_Is_Unicode && !empty_line && !perm) {
-+		mbstate_t s;
-+		const char *str = txt;
-+
-+		memset (&s, 0, sizeof (s));
-+		txtlen = mbsrtowcs ((wchar_t *) buffer, &str,
-+				    sizeof (buffer) / sizeof (wchar_t), &s);
-+		if (txtlen < 0) {
-+		    txt = " ";
-+		    txtlen = 1;
-+		} else {
-+		    wide = 1;
-+		    txtwidth = wcswidth((wchar_t*)buffer, txtlen);
-+		}
-+	    } else
-+#endif
-+	    {
-+		txtlen = strlen (txt);
-+		txtwidth = txtlen;
-+	    }
-+
-+	    over = txtwidth > len;
-+	    still = over ? txtlen - len : len - txtlen;
-+
-+	    switch (HIDE_FIT(format->just_mode)) {
-+	    case J_LEFT:
-+		still = 0;
-+		break;
-+	    case J_CENTER:
-+		still /= 2;
-+		break;
-+	    case J_RIGHT:
-+	    default:
-+		break;
-+	    }
-+
-+	    attrset (color);
- 
-+	    if (wide) {
-+#ifdef UTF8
-+		if (over) {
-+		    if (IS_FIT (format->just_mode)) {
-+			int n1 = 0;
-+			int width1 = 0;
-+			int n2 = 0;
-+			int width2 = 0;
-+			int len1 = len / 2;
-+			int len2;
-+			
-+			while (1) {
-+			    int w = wcwidth(((wchar_t *) buffer)[n1]);
-+			    if (width1 + w <= len1) {
-+				width1 += w;
-+				n1++;
-+			    }
-+			    else
-+				break;
-+			}
-+			len2 = len - width1 - 1;
-+
-+			while (1) {
-+			    int w = wcwidth(((wchar_t *) buffer)[txtlen - n2 - 1]);
-+			    if (width2 + w <= len2) {
-+				width2 += w;
-+				n2++;
-+			    }
-+			    else
-+				break;
-+			}
-+			
-+
-+			SLsmg_write_nwchars ((wchar_t *) buffer, n1);
-+			SLsmg_write_nwchars (L"~", 1);
-+			printw ("%*s", len - width1 - width2 - 1, "");
-+			SLsmg_write_nwchars (((wchar_t *) buffer)
-+					     + txtlen - n2, n2);
-+		    } else
-+			SLsmg_write_nwchars ((wchar_t *) buffer, len);
-+		} else {
-+		    printw ("%*s", still, "");
-+		    SLsmg_write_nwchars ((wchar_t *) buffer, txtlen);
-+		    printw ("%*s", len - txtwidth - still, "");
-+		}
-+#endif
-+	    } else {
-+		if (over) {
-+		    if (IS_FIT (format->just_mode))
-+			strcpy (buffer, name_trunc(txt, len));
-+		    else
-+			memcpy (buffer, txt + still, len);
-+		} else {
-+		    memset (buffer, ' ', still);
-+		    memcpy (buffer + still, txt, txtlen);
-+		    memset (buffer + still + txtlen, ' ',
-+			    len - txtlen - still);
-+		}
-+		buffer[len] = '\0';
-+
-+		if (perm)
-+		    add_permission_string (buffer, format->field_len, fe,
-+					   attr, color, perm - 1);
-+		else
-+		    addstr (buffer);
-+	    }
-+
-+	    length += len;
- 	} else {
-             if (attr == SELECTED || attr == MARKED_SELECTED)
-                 attrset (SELECTED_COLOR);
-@@ -589,7 +709,10 @@
- {
-     int    second_column = 0;
-     int	   width, offset;
--    char   buffer [BUF_MEDIUM];
-+
-+#ifdef HAVE_CHARSET
-+    recode_panel=panel;
-+#endif
- 
-     offset = 0;
-     if (!isstatus && panel->split){
-@@ -618,7 +741,7 @@
- 	    widget_move (&panel->widget, file_index - panel->top_file + 2, 1);
-     }
- 
--    format_file (buffer, sizeof(buffer), panel, file_index, width, attr, isstatus);
-+    format_file (panel, file_index, width, attr, isstatus);
- 
-     if (!isstatus && panel->split){
- 	if (second_column)
-@@ -630,7 +753,7 @@
-     }
- }
- 
--static void
-+void
- display_mini_info (WPanel *panel)
- {
-     if (!show_mini_info)
-@@ -658,7 +781,7 @@
- 	g_snprintf (buffer, sizeof (buffer), (panel->marked == 1) ?
- 		 _("%s bytes in %d file") : _("%s bytes in %d files"),
- 		 size_trunc_sep (panel->total), panel->marked);
--	if ((int) strlen (buffer) > cols-2){
-+	if ((int) mbstrlen (buffer) > cols-2){
- 	    buffer [cols] = 0;
- 	    p += 2;
- 	} else
-@@ -691,7 +814,7 @@
-     return;
- }
- 
--static void
-+void
- paint_dir (WPanel *panel)
- {
-     int i;
-@@ -729,7 +852,7 @@
- #endif				/* !HAVE_SLANG */
- }
- 
--static void
-+void
- show_dir (WPanel *panel)
- {
-     char *tmp;
-@@ -749,6 +872,9 @@
-     }
- #endif				/* HAVE_SLANG */
- 
-+    vscrollbar (panel->widget, panel->widget.lines, panel->widget.cols-1, 2, 2,
-+		panel->selected, panel->count, TRUE);
-+
-     if (panel->active)
- 	attrset (REVERSE_COLOR);
- 
-@@ -757,8 +883,15 @@
-     tmp = g_malloc (panel->widget.cols + 1);
-     tmp[panel->widget.cols] = '\0';
- 
-+#ifdef HAVE_CHARSET
-+    my_translate_string(panel->cwd,strlen(panel->cwd),recode_buf, panel->tr_table);
-+    trim (strip_home_and_password (recode_buf), tmp,
-+	 min (max (panel->widget.cols - 7, 0), panel->widget.cols) );
-+#else
-     trim (strip_home_and_password (panel->cwd), tmp,
- 	 min (max (panel->widget.cols - 7, 0), panel->widget.cols) );
-+#endif
-+
-     addstr (tmp);
-     g_free (tmp);
-     widget_move (&panel->widget, 0, 1);
-@@ -970,6 +1103,17 @@
-     mc_get_current_wd (panel->cwd, sizeof (panel->cwd) - 2);
-     strcpy (panel->lwd, ".");
- 
-+#ifdef HAVE_CHARSET
-+    panel_reset_codepage(panel);
-+#endif
-+
-+#ifdef USE_VFS
-+    panel->is_return=0;
-+ #ifdef HAVE_CHARSET
-+    panel->ret_codepage=-1;
-+ #endif
-+#endif
-+
-     panel->hist_name = g_strconcat ("Dir Hist ", panel_name, (char *) NULL);
-     panel->dir_history = history_get (panel->hist_name);
-     directory_history_add (panel, panel->cwd);
-@@ -1068,6 +1212,12 @@
-     int  side, width;
- 
-     const char *txt;
-+#ifdef UTF8
-+    char buffer[30 * sizeof (wchar_t)];
-+    mbstate_t s;
-+
-+    memset (&s, 0, sizeof (s));
-+#endif
-     if (!panel->split)
- 	adjust_top_file (panel);
- 
-@@ -1092,16 +1242,37 @@
-             if (format->string_fn){
-                 txt = format->title;
- 
-+		attrset (MARKED_COLOR);
-+		width -= format->field_len;
-+#ifdef UTF8
-+		if (SLsmg_Is_Unicode) {
-+		    const char *str = txt;
-+		    header_len = mbsrtowcs ((wchar_t *) buffer, &str,
-+					    sizeof (buffer) / sizeof (wchar_t),
-+					    &s);
-+		    if (header_len < 0) {
-+			memset (&s, 0, sizeof (s));
-+			printw ("%*s", format->field_len, "");
-+			continue;
-+		    }
-+		    if (header_len > format->field_len)
-+			header_len = format->field_len;
-+		    spaces = (format->field_len - header_len) / 2;
-+		    extra  = (format->field_len - header_len) % 2;
-+		    printw ("%*s", spaces, "");
-+		    SLsmg_write_nwchars ((wchar_t *) buffer, header_len);
-+		    printw ("%*s", spaces + extra, "");
-+		    continue;
-+		}
-+#endif
- 		header_len = strlen (txt);
- 		if (header_len > format->field_len)
- 		    header_len = format->field_len;
- 
--                attrset (MARKED_COLOR);
-                 spaces = (format->field_len - header_len) / 2;
-                 extra  = (format->field_len - header_len) % 2;
- 		printw ("%*s%.*s%*s", spaces, "",
- 			 header_len, txt, spaces+extra, "");
--		width -= 2 * spaces + extra + header_len;
- 	    } else {
- 		attrset (NORMAL_COLOR);
- 		one_vline ();
-@@ -1320,7 +1491,7 @@
-     panel->dirty = 1;
- 
-     /* Status needn't to be split */
--    usable_columns = ((panel->widget.cols-2)/((isstatus)
-+    usable_columns = ((panel->widget.cols-3)/((isstatus)
- 					      ? 1
- 					      : (panel->split+1))) - (!isstatus && panel->split);
- 
-@@ -2100,7 +2271,12 @@
-     { XCTRL('n'), move_down },		/* C-n like emacs */
-     { XCTRL('s'), start_search },	/* C-s like emacs */
-     { ALT('s'),   start_search },	/* M-s not like emacs */
-+#ifndef HAVE_CHARSET
-     { XCTRL('t'), mark_file },
-+#endif
-+#ifdef HAVE_CHARSET
-+    { XCTRL('t'), mark_file },		/* was 'fnc_c_cmd' */
-+#endif
-     { ALT('o'),   chdir_other_panel },
-     { ALT('l'),   chdir_to_readlink },
-     { ALT('H'),   directory_history_list },
-diff -urN mc-4.6.1.orig/src/screen.h mc-4.6.1/src/screen.h
---- mc-4.6.1.orig/src/screen.h	1970-01-01 05:00:00.000000000 +0500
-+++ mc-4.6.1/src/screen.h	2007-01-19 18:33:59.000000000 +0500
-@@ -0,0 +1,11 @@
-+#ifndef __SCREEN_H__
-+#define __SCREEN_H__
-+#include <config.h>
-+
-+#include "global.h"
-+
-+extern void paint_dir (WPanel *panel);
-+extern void display_mini_info (WPanel *panel);
-+extern void show_dir(WPanel *panel);
-+#endif //__SCREEN_H__
-+
-diff -urN mc-4.6.1.orig/src/selcodepage.c mc-4.6.1/src/selcodepage.c
---- mc-4.6.1.orig/src/selcodepage.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/selcodepage.c	2007-01-19 18:33:59.000000000 +0500
-@@ -44,14 +44,16 @@
- }
- 
- int
--select_charset (int current_charset, int seldisplay)
-+select_charset (int current_charset, int seldisplay, const char *title)
- {
-+    int new_charset;
-+
-     int i, menu_lines = n_codepages + 1;
-     char buffer[255];
- 
-     /* Create listbox */
-     Listbox *listbox = create_listbox_window (ENTRY_LEN + 2, menu_lines,
--					      _(" Choose input codepage "),
-+                                              title,
- 					      "[Codepages Translation]");
- 
-     if (!seldisplay)
-@@ -81,20 +83,26 @@
- 
-     i = run_listbox (listbox);
- 
--    return (seldisplay) ? ((i >= n_codepages) ? -1 : i)
--	: (i - 1);
-+    if(i==-1)
-+      i = (seldisplay)
-+          ? ((current_charset < 0) ? n_codepages : current_charset)
-+          : (current_charset + 1);
-+
-+    new_charset =(seldisplay) ? ( (i >= n_codepages) ? -1 : i ) : ( i-1 );
-+    new_charset = (new_charset==-2) ? current_charset:new_charset;
-+    return new_charset;
- }
- 
- /* Helper functions for codepages support */
- 
- 
- int
--do_select_codepage (void)
-+do_select_codepage (const char *title)
- {
-     const char *errmsg;
- 
-     if (display_codepage > 0) {
--	source_codepage = select_charset (source_codepage, 0);
-+	source_codepage = select_charset (source_codepage, 0, title);
- 	errmsg =
- 	    init_translation_table (source_codepage, display_codepage);
- 	if (errmsg) {
-diff -urN mc-4.6.1.orig/src/selcodepage.h mc-4.6.1/src/selcodepage.h
---- mc-4.6.1.orig/src/selcodepage.h	2002-10-31 04:16:16.000000000 +0500
-+++ mc-4.6.1/src/selcodepage.h	2007-01-19 18:33:59.000000000 +0500
-@@ -2,8 +2,8 @@
- #ifndef __SELCODEPAGE_H__
- #define __SELCODEPAGE_H__
- 
--int select_charset (int current_charset, int seldisplay);
--int do_select_codepage (void);
-+int select_charset (int current_charset, int seldisplay, const char *title);
-+int do_select_codepage (const char *title);
- 
- #endif				/* __SELCODEPAGE_H__ */
- #endif				/* HAVE_CHARSET */
-diff -urN mc-4.6.1.orig/src/setup.c mc-4.6.1/src/setup.c
---- mc-4.6.1.orig/src/setup.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/setup.c	2007-01-19 18:33:59.000000000 +0500
-@@ -47,6 +47,8 @@
- 
- #ifdef HAVE_CHARSET
- #include "charsets.h"
-+#include"recode.h"
-+#include "wtools.h"
- #endif
- 
- #ifdef USE_NETCODE
-@@ -255,6 +257,11 @@
-     g_snprintf (buffer, sizeof (buffer), "%d", panel->user_mini_status);
-     save_string (section, "user_mini_status", buffer,
- 			       profile_name);
-+
-+#ifdef HAVE_CHARSET
-+    // save panel codepage
-+    save_string(section, "panel_display_codepage", get_codepage_id(panel->src_codepage), profile_name);
-+#endif
- }
- 
- void
-@@ -352,6 +359,7 @@
- #ifdef HAVE_CHARSET
-     save_string( "Misc", "display_codepage",
-     		 get_codepage_id( display_codepage ), profile_name );
-+    save_string( "Misc", "ftp_codepage", get_codepage_id(ftp_codepage), profile_name);
- #endif /* HAVE_CHARSET */
- 
-     g_free (profile);
-@@ -401,6 +409,31 @@
-     panel->user_mini_status =
- 	load_int (section, "user_mini_status", 0);
- 
-+#ifdef HAVE_CHARSET
-+//--- Loading panel codepage
-+    panel_reset_codepage(panel);
-+    if(load_codepages_list()>0) {
-+      char cpname[128];
-+      char *errmsg;
-+
-+
-+      if(display_codepage>=0) {
-+        load_string(section, "panel_display_codepage", "", cpname, sizeof(cpname));
-+        if(cpname[0]!='\0') panel->src_codepage = get_codepage_index(cpname);
-+      }
-+
-+      errmsg=my_init_tt(display_codepage,panel->src_codepage,panel->tr_table);
-+      if(errmsg) {
-+        panel_reset_codepage(panel);
-+        message( 1, MSG_ERROR, "%s", errmsg );
-+       }
-+      errmsg=my_init_tt(panel->src_codepage,display_codepage,panel->tr_table_input);
-+      if(errmsg) {
-+        panel_reset_codepage(panel);
-+        message( 1, MSG_ERROR, "%s", errmsg );
-+      }
-+    }
-+#endif
- }
- 
- static void
-@@ -543,12 +576,18 @@
- #endif /* USE_VFS && USE_NETCODE */
- 
- #ifdef HAVE_CHARSET
--    if ( load_codepages_list() > 0 ) {
--	char cpname[128];
--	load_string( "Misc", "display_codepage", "",
--		     cpname, sizeof(cpname) );
--	if ( cpname[0] != '\0' )
--	    display_codepage = get_codepage_index( cpname );
-+    if(load_codepages_list() > 0) {
-+      char cpname[128];
-+      get_locale_codepage();
-+      load_string("Misc", "display_codepage", "", cpname, sizeof(cpname));
-+      if(cpname[0] != '\0')  display_codepage=get_codepage_index(cpname);
-+      else display_codepage=lang_codepage;
-+
-+      ftp_codepage=-1;
-+      if(display_codepage >= 0) {
-+        load_string( "Misc", "ftp_codepage", "", cpname, sizeof(cpname));
-+        if(cpname[0] != '\0')  ftp_codepage=get_codepage_index(cpname);
-+      }
-     }
- 
-     init_translation_table( source_codepage, display_codepage );
-diff -urN mc-4.6.1.orig/src/slint.c mc-4.6.1/src/slint.c
---- mc-4.6.1.orig/src/slint.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/slint.c	2007-01-19 18:33:59.000000000 +0500
-@@ -180,6 +180,9 @@
-     struct sigaction act, oact;
-     
-     SLtt_get_terminfo ();
-+#if SLANG_VERSION >= 20000
-+    SLutf8_enable (-1);
-+#endif
- 
-    /*
-     * If the terminal in not in terminfo but begins with a well-known
-diff -urN mc-4.6.1.orig/src/util.c mc-4.6.1/src/util.c
---- mc-4.6.1.orig/src/util.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/util.c	2007-01-19 18:33:59.000000000 +0500
-@@ -32,7 +32,11 @@
- #include <stdarg.h>
- #include <string.h>
- #include <ctype.h>
-+#include <iconv.h>
-+#include <langinfo.h>
-+#include <errno.h>
- 
-+#include "tty.h"
- #include "global.h"
- #include "profile.h"
- #include "main.h"		/* mc_home */
-@@ -44,9 +48,40 @@
- #include "charsets.h"
- #endif
- 
-+#ifdef UTF8
-+#include <wctype.h>
-+#include <wchar.h>
-+#endif
-+
- static const char app_text [] = "Midnight-Commander";
- int easy_patterns = 1;
- 
-+#if SLANG_VERSION >= 20000
-+void SLsmg_write_nwchars(wchar_t *s, size_t n)
-+{
-+    if (SLsmg_is_utf8_mode()) { /* slang can handle it directly */
-+	while(n-- && *s)
-+	    SLsmg_write_char(*s++);
-+    }
-+    else { /* convert wchars back to 8bit encoding */
-+	mbstate_t mbs;
-+	memset (&mbs, 0, sizeof (mbs));
-+	while (n-- && *s) {
-+	    char buf[MB_LEN_MAX + 1]; /* should use 1 char, but to be sure */
-+	    if (*s < 0x80) {
-+		SLsmg_write_char(*s++); /* ASCII */
-+	    }
-+	    else {
-+		if (wcrtomb(buf, *s++, &mbs) == 1)
-+		    SLsmg_write_char((wchar_t)(buf[0]));
-+		else
-+		    SLsmg_write_char('?'); /* should not happen */
-+	    }
-+	}
-+    }
-+}
-+#endif
-+
- extern void str_replace(char *s, char from, char to)
- {
-     for (; *s != '\0'; s++) {
-@@ -77,9 +112,106 @@
-     return (c > 31 && c != 127 && c != 155);
- }
- 
-+size_t
-+mbstrlen (const char *str)
-+{
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode) {
-+        size_t width = 0;
-+
-+        for (; *str; str++) {
-+            wchar_t c;
-+            size_t len;
-+
-+            len = mbrtowc (&c, str, MB_CUR_MAX, NULL);
-+	    
-+            if (len == (size_t)(-1) || len == (size_t)(-2)) break;
-+	    
-+            if (len > 0) {
-+                int wcsize = wcwidth(c);
-+                width += wcsize > 0 ? wcsize : 0;
-+                str += len-1;
-+            }
-+        }
-+
-+        return width;
-+    } else
-+#endif
-+	return strlen (str);
-+}
-+
-+#ifdef UTF8
-+
-+void 
-+fix_utf8(char *str)
-+{
-+    mbstate_t mbs;
-+
-+    char *p = str;
-+
-+    while (*p) {
-+	int len;
-+        memset (&mbs, 0, sizeof (mbs));
-+	len = mbrlen(p, MB_CUR_MAX, &mbs);
-+	if (len == -1) {
-+	    *p = '?';
-+	    p++;
-+	} else if (len > 0) {
-+	    p += len;
-+	} else {
-+	    p++;
-+	}
-+    }
-+}
-+#endif
-+
-+
-+
-+#ifdef UTF8
-+wchar_t *
-+mbstr_to_wchar (const char *str)
-+{
-+    int len = mbstrlen(str);
-+    wchar_t *buf = g_malloc((len+1) * sizeof(wchar_t));
-+    mbstate_t mbs;
-+    memset (&mbs, 0, sizeof (mbs));
-+    mbsrtowcs (buf, &str, len, &mbs);
-+    buf[len] = 0;
-+    return buf;
-+}
-+
-+char *
-+wchar_to_mbstr (const wchar_t *wstr)
-+{
-+    mbstate_t mbs;
-+    const wchar_t *wstr2;
-+    char * string;
-+    int len;
-+
-+    memset (&mbs, 0, sizeof (mbs));
-+    wstr2 = wstr;
-+    len = wcsrtombs(NULL, &wstr2, 0, &mbs);
-+    if (len <= 0) 
-+	return NULL;
-+
-+    string = g_malloc(len + 1);
-+
-+    wstr2 = wstr;
-+    wcsrtombs(string, &wstr2, len, &mbs);
-+    string[len] = 0;
-+    return string;
-+}
-+#endif
-+
-+
-+
- int
- is_printable (int c)
- {
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode)
-+	return iswprint (c);
-+#endif
-     c &= 0xff;
- 
- #ifdef HAVE_CHARSET
-@@ -97,7 +229,7 @@
- #endif				/* !HAVE_CHARSET */
- }
- 
--/* Returns the message dimensions (lines and columns) */
-+/* Returns the message dimensions columns */
- int msglen (const char *text, int *lines)
- {
-     int max = 0;
-@@ -108,8 +240,18 @@
- 	    line_len = 0;
- 	    (*lines)++;
- 	} else {
--	    line_len++;
--	    if (line_len > max)
-+#ifdef UTF8
-+            size_t len;
-+            wchar_t c;
-+
-+            len = mbrtowc (&c, text, MB_CUR_MAX, NULL);
-+            if (len > 0 && len != (size_t)(-1) && len != (size_t)(-2)) {
-+                int wcsize = wcwidth(c);
-+                line_len += wcsize > 0 ? wcsize-1 : -1;
-+                text += len-1;
-+            }
-+#endif
-+            if (++line_len > max)
- 		max = line_len;
- 	}
-     }
-@@ -201,7 +343,24 @@
- 		*d++ = '\\';
- 	    break;
- 	}
-+#ifndef UTF8
- 	*d = *s;
-+#else /* UTF8 */
-+	{
-+	    mbstate_t mbs;
-+           int len;
-+           memset (&mbs, 0, sizeof (mbs));
-+           len = mbrlen(s, MB_CUR_MAX, &mbs);
-+	    if (len > 0) {
-+        	while (len-- > 1)
-+            	    *d++ = *s++;
-+		*d = *s;
-+	    } else {
-+                *d = '?';
-+	    }
-+
-+	}
-+#endif /* UTF8 */
-     }
-     *d = '\0';
-     return ret;
-@@ -222,25 +381,90 @@
- name_trunc (const char *txt, int trunc_len)
- {
-     static char x[MC_MAXPATHLEN + MC_MAXPATHLEN];
--    int txt_len;
-+    int txt_len, first, skip;
-     char *p;
-+    const char *str;
- 
-     if ((size_t) trunc_len > sizeof (x) - 1) {
- 	trunc_len = sizeof (x) - 1;
-     }
--    txt_len = strlen (txt);
--    if (txt_len <= trunc_len) {
--	strcpy (x, txt);
--    } else {
--	int y = (trunc_len / 2) + (trunc_len % 2);
--	strncpy (x, txt, y);
--	strncpy (x + y, txt + txt_len - (trunc_len / 2), trunc_len / 2);
--	x[y] = '~';
--    }
--    x[trunc_len] = 0;
--    for (p = x; *p; p++)
--	if (!is_printable (*p))
--	    *p = '?';
-+    txt_len = mbstrlen (txt);
-+    first = 0;
-+    skip = 0;
-+    if (txt_len > trunc_len) {
-+      first = trunc_len / 2;
-+      skip = txt_len - trunc_len + 1;
-+    }
-+
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode) {
-+      mbstate_t s;
-+      int mbmax;
-+
-+      str = txt;
-+      memset (&s, 0, sizeof (s));
-+      mbmax = MB_CUR_MAX;
-+      p = x;
-+      while (p < x + sizeof (x) - 1 && trunc_len) {
-+	  wchar_t wc;
-+	  int len;
-+
-+	  len = mbrtowc (&wc, str, mbmax, &s);
-+	  if (!len)
-+	      break;
-+	  if (len < 0) {
-+	      memset (&s, 0, sizeof (s));
-+	      *p = '?';
-+	      len = 1;
-+	      str++;
-+	  } else if (!is_printable (wc)) {
-+	      *p = '?';
-+	      str += len;
-+	      len = 1;
-+	  } else if (p >= x + sizeof (x) - len)
-+	      break;
-+	  else {
-+	      memcpy (p, str, len);
-+	      str += len;
-+	  }
-+	  if (first) {
-+	      --trunc_len;
-+	      --first;
-+	      p += len;
-+	      if (!first && p < x + sizeof (x) - 1 && trunc_len) {
-+		  *p++ = '~';
-+		  --trunc_len;
-+	      }
-+	  } else if (skip)
-+	      --skip;
-+	  else {
-+	      --trunc_len;
-+	      p += len;
-+	  }
-+      }
-+    } else
-+#endif
-+    {
-+      str = txt;
-+      p = x;
-+      while (p < x + sizeof (x) - 1) {
-+	  if (*str == '\0')
-+	      break;
-+	  else if (!is_printable (*str))
-+	      *p++ = '?';
-+	  else
-+	      *p++ = *str;
-+	  ++str;
-+	  if (first) {
-+	      --first;
-+	      if (!first) {
-+		  *p++ = '~';
-+		  str += skip;
-+	      }
-+	  }
-+      }
-+    }
-+    *p = '\0';
-     return x;
- }
- 
-@@ -650,11 +874,66 @@
- }
- 
- char *
-+utf8_to_local(char *str)
-+{
-+   iconv_t cd;
-+   size_t buflen;
-+   char *output;
-+   int retry = 1;
-+
-+   if (str == NULL)
-+	   return NULL;
-+   else
-+	   buflen = strlen(str);
-+        
-+   cd = iconv_open (nl_langinfo(CODESET), "UTF-8");
-+   if (cd == (iconv_t) -1) {
-+	return g_strdup(str);
-+   }
-+
-+   output = g_malloc(buflen + 1);
-+     
-+   while (retry)
-+   {
-+	char *wrptr = output;
-+	char *inptr = str;
-+	size_t insize = buflen;
-+	size_t avail = buflen;
-+        size_t nconv;
-+     
-+        nconv = iconv (cd, &inptr, &insize, &wrptr, &avail);
-+        if (nconv == (size_t) -1)
-+        {
-+    	    if (errno == E2BIG)
-+	    {
-+		buflen *= 2;
-+		g_free(output);
-+		output = g_malloc(buflen + 1);
-+	    }
-+	    else
-+	    {
-+		g_free(output);
-+		return g_strdup(str);
-+	    }
-+	}
-+	else {
-+	    retry = 0;
-+	    *wrptr = 0;
-+	}
-+    }
-+     
-+    iconv_close (cd);
-+    
-+    return output;
-+}
-+
-+char *
- load_mc_home_file (const char *filename, char **allocated_filename)
- {
-     char *hintfile_base, *hintfile;
-     char *lang;
-     char *data;
-+    char *conv_data;
- 
-     hintfile_base = concat_dir_and_file (mc_home, filename);
-     lang = guess_message_value ();
-@@ -687,7 +966,10 @@
-     else
- 	g_free (hintfile);
- 
--    return data;
-+    conv_data = utf8_to_local(data);
-+    g_free(data);
-+    
-+    return conv_data;
- }
- 
- /* Check strftime() results. Some systems (i.e. Solaris) have different
-@@ -695,12 +977,14 @@
- size_t i18n_checktimelength (void)
- {
-     size_t length, a, b;
--    char buf [MAX_I18NTIMELENGTH + 1];
-+    char buf [4 * MAX_I18NTIMELENGTH + 1];
-     time_t testtime = time (NULL);
-     
--    a = strftime (buf, sizeof(buf)-1, _("%b %e %H:%M"), localtime(&testtime));
--    b = strftime (buf, sizeof(buf)-1, _("%b %e  %Y"), localtime(&testtime));
--    
-+    strftime (buf, sizeof(buf)-1, _("%b %e %H:%M"), localtime(&testtime));
-+    a = mbstrlen (buf);
-+    strftime (buf, sizeof(buf)-1, _("%b %e  %Y"), localtime(&testtime));
-+    b = mbstrlen (buf);
-+
-     length = max (a, b);
-     
-     /* Don't handle big differences. Use standard value (email bug, please) */
-@@ -712,15 +996,12 @@
- 
- const char *file_date (time_t when)
- {
--    static char timebuf [MAX_I18NTIMELENGTH + 1];
-+    static char timebuf [4 * MAX_I18NTIMELENGTH + 1];
-     time_t current_time = time ((time_t) 0);
--    static size_t i18n_timelength = 0;
-     static const char *fmtyear, *fmttime;
-     const char *fmt;
- 
--    if (i18n_timelength == 0){
--	i18n_timelength = i18n_checktimelength() + 1;
--	
-+    if (fmtyear == NULL) {
- 	/* strftime() format string for old dates */
- 	fmtyear = _("%b %e  %Y");
- 	/* strftime() format string for recent dates */
-@@ -740,7 +1021,7 @@
-     else
- 	fmt = fmttime;
-     
--    strftime (timebuf, i18n_timelength, fmt, localtime(&when));
-+    strftime (timebuf, sizeof (timebuf) - 1, fmt, localtime(&when));
-     return timebuf;
- }
- 
-@@ -863,10 +1144,27 @@
- 		r++;
- 	    continue;
- 	}
--
-+#ifndef UTF8
- 	if (is_printable(*r))
- 	    *w++ = *r;
- 	++r;
-+#else /* UTF8 */
-+	{
-+	    mbstate_t mbs;
-+           int len;
-+	    memset (&mbs, 0, sizeof (mbs));
-+	    len = mbrlen(r, MB_CUR_MAX, &mbs);
-+		
-+	    if (len > 0 && (unsigned char)*r >= ' ') 
-+		while (len--)
-+		    *w++ = *r++;
-+	    else {
-+		if (len == -1)
-+		    *w++ = '?';
-+		r++;
-+	    }
-+	}
-+#endif /* UTF8 */
-     }
-     *w = 0;
-     return s;
-@@ -1140,21 +1438,23 @@
-  * as needed up in first and then goes down using second */
- char *diff_two_paths (const char *first, const char *second) 
- {
--    char *p, *q, *r, *s, *buf = 0;
-+    char *p, *q, *r, *s, *buf = NULL;
-     int i, j, prevlen = -1, currlen;
-     char *my_first = NULL, *my_second = NULL;
-     
-     my_first = resolve_symlinks (first);
-     if (my_first == NULL)
-         return NULL;
-+    my_second= resolve_symlinks (second);
-+    if (my_second == NULL) {
-+	g_free (my_first);
-+	return NULL;
-+    }
-     for (j = 0; j < 2; j++) {
- 	p = my_first;
- 	if (j) {
--	    my_second = resolve_symlinks (second);
--	    if (my_second == NULL) {
--		g_free (my_first);
-+	    if (my_second == NULL)
- 	        return buf;
--	    }
- 	}
- 	q = my_second;
- 	for (;;) {
-diff -urN mc-4.6.1.orig/src/util.h mc-4.6.1/src/util.h
---- mc-4.6.1.orig/src/util.h	2005-01-14 00:20:47.000000000 +0500
-+++ mc-4.6.1/src/util.h	2007-01-19 18:33:59.000000000 +0500
-@@ -93,6 +93,13 @@
- char *get_group (int);
- char *get_owner (int);
- 
-+void fix_utf8(char *str);
-+size_t mbstrlen (const char *);
-+wchar_t *mbstr_to_wchar (const char *);
-+char *wchar_to_mbstr (const wchar_t *);
-+char *utf8_to_local(char *str);
-+
-+
- #define MAX_I18NTIMELENGTH 14
- #define MIN_I18NTIMELENGTH 10
- #define STD_I18NTIMELENGTH 12
-@@ -210,7 +217,7 @@
- #define PATH_ENV_SEP ':'
- #define TMPDIR_DEFAULT "/tmp"
- #define SCRIPT_SUFFIX ""
--#define get_default_editor() "vi"
-+#define get_default_editor() "editor"
- #define OS_SORT_CASE_SENSITIVE_DEFAULT 1
- #define STRCOMP strcmp
- #define STRNCOMP strncmp
-diff -urN mc-4.6.1.orig/src/view.c mc-4.6.1/src/view.c
---- mc-4.6.1.orig/src/view.c	2005-05-27 20:19:18.000000000 +0600
-+++ mc-4.6.1/src/view.c	2007-01-19 18:33:59.000000000 +0500
-@@ -36,6 +36,10 @@
- #include <errno.h>
- #include <limits.h>
- 
-+#ifdef UTF8
-+#include <wctype.h>
-+#endif /* UTF8 */
-+
- #include "global.h"
- #include "tty.h"
- #include "cmd.h"		/* For view_other_cmd */
-@@ -793,7 +797,7 @@
- 
-     if (!i18n_adjust) {
- 	file_label = _("File: %s");
--	i18n_adjust = strlen (file_label) - 2;
-+	i18n_adjust = mbstrlen (file_label) - 2;
-     }
- 
-     if (w < i18n_adjust + 6)
-@@ -849,7 +853,11 @@
- 	widget_erase ((Widget *) view);
- }
- 
-+#ifndef UTF8
- #define view_add_character(view,c) addch (c)
-+#else /* UTF8 */
-+#define view_add_character(view,c) {wchar_t tmp=c; SLsmg_write_nwchars(&tmp, 1);}
-+#endif /* UTF8 */
- #define view_add_one_vline()       one_vline()
- #define view_add_string(view,s)    addstr (s)
- #define view_gotoyx(v,r,c)    widget_move (v,r,c)
-@@ -1071,6 +1079,12 @@
- 	if (view->growing_buffer && from == view->last_byte)
- 	    get_byte (view, from);
- 	for (; row < height && from < view->last_byte; from++) {
-+#ifdef UTF8
-+            mbstate_t mbs;
-+            char mbbuf[MB_LEN_MAX];
-+            int mblen;
-+            wchar_t wc;
-+#endif /* UTF8 */
- 	    c = get_byte (view, from);
- 	    if ((c == '\n') || (col >= width && view->wrap_mode)) {
- 		col = frame_shift;
-@@ -1084,7 +1098,37 @@
- 		col = ((col - frame_shift) / 8) * 8 + 8 + frame_shift;
- 		continue;
- 	    }
-+#ifndef UTF8
- 	    if (view->viewer_nroff_flag && c == '\b') {
-+#else /* UTF8 */
-+                mblen = 1;
-+                mbbuf[0] = convert_to_display_c (c);
-+
-+                while (mblen < MB_LEN_MAX) {
-+                    int res;
-+                    memset (&mbs, 0, sizeof (mbs));
-+                    res = mbrtowc (&wc, mbbuf, mblen, &mbs);
-+                    if (res <= 0 && res != -2) {
-+                        wc = '.';
-+                        mblen = 1;
-+                        break;
-+                    }
-+                    if (res == mblen)
-+                        break;
-+
-+                    mbbuf[mblen] = convert_to_display_c (get_byte (view, from + mblen));
-+                    mblen++;
-+                }
-+
-+                if (mblen == MB_LEN_MAX) {
-+                    wc = '.';
-+                    mblen = 1;
-+                }
-+
-+                from += mblen - 1;
-+
-+            if (view->viewer_nroff_flag && wc == '\b') {
-+#endif /* UTF8 */
- 		int c_prev;
- 		int c_next;
- 
-@@ -1122,12 +1166,23 @@
- 		&& col < width - view->start_col) {
- 		view_gotoyx (view, row, col + view->start_col);
- 
-+#ifndef UTF8
- 		c = convert_to_display_c (c);
--
- 		if (!is_printable (c))
- 		    c = '.';
--
- 		view_add_character (view, c);
-+#else /* UTF8 */
-+		if (!iswprint (wc))
-+		    wc = '.';
-+		view_add_character (view, wc);
-+
-+		{
-+		    int cw = wcwidth(wc);
-+		    if (cw > 1)
-+			col+= cw - 1;
-+		}
-+#endif /* UTF8 */
-+
- 	    }
- 	    col++;
- 	    if (boldflag != MARK_NORMAL) {
-@@ -1239,7 +1294,12 @@
- 	    if (lines != -1 && line >= lines)
- 		return p;
- 
--	    c = get_byte (view, p);
-+		if ((c = get_byte (view, p)) == -1) {
-+		if (upto)
-+			return line;
-+	    else
-+        	return p;
-+	    }
- 
- 	    if (view->wrap_mode) {
- 		if (c == '\r')
-@@ -2534,7 +2594,7 @@
- 
- #ifdef HAVE_CHARSET
-     case XCTRL ('t'):
--	do_select_codepage ();
-+	do_select_codepage (_(" Choose codepage "));
- 	view->dirty++;
- 	view_update (view, TRUE);
- 	return MSG_HANDLED;
-diff -urN mc-4.6.1.orig/src/widget.c mc-4.6.1/src/widget.c
---- mc-4.6.1.orig/src/widget.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/src/widget.c	2007-01-19 18:33:59.000000000 +0500
-@@ -33,6 +33,9 @@
- #include <ctype.h>
- #include "global.h"
- #include "tty.h"
-+#ifdef UTF8
-+#include <wctype.h>
-+#endif /* UTF8 */
- #include "color.h"
- #include "mouse.h"
- #include "dialog.h"
-@@ -148,6 +151,11 @@
- 	if (b->hotpos >= 0) {
- 	    attrset ((b->selected) ? HOT_FOCUSC : HOT_NORMALC);
- 	    widget_move (&b->widget, 0, b->hotpos + off);
-+#ifdef UTF8
-+	    if (SLsmg_Is_Unicode) 
-+		SLsmg_write_nwchars (&b->hotwc, 1);
-+	    else
-+#endif
- 	    addch ((unsigned char) b->text[b->hotpos]);
- 	}
- 	return MSG_HANDLED;
-@@ -179,7 +187,7 @@
- static int
- button_len (const char *text, unsigned int flags)
- {
--    int ret = strlen (text);
-+    int ret = mbstrlen (text);
-     switch (flags){
- 	case DEFPUSH_BUTTON:
- 	    ret += 6;
-@@ -202,14 +210,36 @@
-  * the button text is g_malloc()ed, we can safely change and shorten it.
-  */
- static void
--button_scan_hotkey (WButton *b)
-+scan_hotkey (char *text, int *hotposp, int *hotkeyp, wchar_t *hotwcp)
- {
--    char *cp = strchr (b->text, '&');
-+    char *cp = strchr (text, '&');
- 
-     if (cp != NULL && cp[1] != '\0') {
--	g_strlcpy (cp, cp + 1, strlen (cp));
--	b->hotkey = tolower (*cp);
--	b->hotpos = cp - b->text;
-+#ifdef UTF8
-+    if (SLsmg_Is_Unicode) {
-+        mbstate_t s;
-+        int len;
-+
-+        *cp = '\0';
-+        memset (&s, 0, sizeof (s));
-+        len = mbrtowc (hotwcp, cp + 1, MB_CUR_MAX, &s);
-+        if (len > 0) {
-+            *hotposp = mbstrlen (text);
-+            if (*hotposp < 0) {
-+                *hotposp = -1;
-+            } else {
-+                /* FIXME */
-+                *hotkeyp = tolower (*hotwcp);
-+            }
-+        }
-+      } else
-+#endif
-+      {
-+        *hotkeyp = tolower (cp[1]);
-+        *hotposp = cp - text;
-+      }
-+
-+      memmove (cp, cp + 1, strlen (cp + 1) + 1);
-     }
- }
- 
-@@ -231,22 +261,23 @@
-     widget_want_hotkey (b->widget, 1);
-     b->hotkey = 0;
-     b->hotpos = -1;
-+    b->hotwc = L'\0';
- 
--    button_scan_hotkey(b);
-+    scan_hotkey(b->text, &b->hotpos, &b->hotkey, &b->hotwc);
-     return b;
- }
- 
- void
- button_set_text (WButton *b, const char *text)
- {
--   g_free (b->text);
-+    g_free (b->text);
-     b->text = g_strdup (text);
-     b->widget.cols = button_len (text, b->flags);
--    button_scan_hotkey(b);
-+    scan_hotkey(b->text, &b->hotpos, &b->hotkey, &b->hotwc);
-     dlg_redraw (b->widget.parent);
- }
- 
--
-+
- /* Radio button widget */
- static int radio_event (Gpm_Event *event, WRadio *r);
- 
-@@ -320,16 +351,37 @@
- 	    widget_move (&r->widget, i, 0);
- 
- 	    printw ("(%c) ", (r->sel == i) ? '*' : ' ');
--	    for (cp = r->texts[i]; *cp; cp++) {
--		if (*cp == '&') {
--		    attrset ((i == r->pos && msg == WIDGET_FOCUS)
--			     ? HOT_FOCUSC : HOT_NORMALC);
--		    addch (*++cp);
--		    attrset ((i == r->pos
--			      && msg == WIDGET_FOCUS) ? FOCUSC : NORMALC);
-+	    cp = strchr (r->texts[i], '&');
-+	    if (cp != NULL) {
-+#ifdef UTF8
-+		mbstate_t s;
-+		wchar_t wc;
-+		int len;
-+#endif
-+		printw ("%.*s", (int) ((char *) cp - r->texts[i]),
-+			r->texts[i]);
-+		attrset ((i == r->pos && msg == WIDGET_FOCUS)
-+			 ? HOT_FOCUSC : HOT_NORMALC);
-+#ifdef UTF8
-+		if (SLsmg_Is_Unicode) {
-+		    memset (&s, 0, sizeof (s));
-+		    len = mbrtowc (&wc, cp + 1, MB_CUR_MAX, &s);
-+		    ++cp;
-+		    if (len > 0) {
-+			printw ("%.*s", len, cp);
-+			cp += len;
-+		    }
- 		} else
--		    addch (*cp);
--	    }
-+#endif
-+		{
-+		    addch (*++cp);
-+		    ++cp;
-+		}
-+		attrset ((i == r->pos && msg == WIDGET_FOCUS)
-+			 ? FOCUSC : NORMALC);
-+	    } else
-+		cp = r->texts[i];
-+	    addstr ((char *) cp);
- 	}
- 	return MSG_HANDLED;
- 
-@@ -365,7 +417,7 @@
-     /* Compute the longest string */
-     max = 0;
-     for (i = 0; i < count; i++){
--	m = strlen (texts [i]);
-+	m = mbstrlen (texts [i]);
- 	if (m > max)
- 	    max = m;
-     }
-@@ -426,6 +478,11 @@
- 	if (c->hotpos >= 0) {
- 	    attrset ((msg == WIDGET_FOCUS) ? HOT_FOCUSC : HOT_NORMALC);
- 	    widget_move (&c->widget, 0, +c->hotpos + 4);
-+#ifdef UTF8
-+	    if (SLsmg_Is_Unicode)
-+		SLsmg_write_nwchars (&c->hotwc, 1);
-+	    else
-+#endif
- 	    addch ((unsigned char) c->text[c->hotpos]);
- 	}
- 	return MSG_HANDLED;
-@@ -460,32 +517,18 @@
- check_new (int y, int x, int state, const char *text)
- {
-     WCheck *c =  g_new (WCheck, 1);
--    const char *s;
--    char *t;
-     
--    init_widget (&c->widget, y, x, 1, strlen (text),
-+    init_widget (&c->widget, y, x, 1, mbstrlen (text),
- 		 (callback_fn)check_callback,
- 		 (mouse_h) check_event);
-     c->state = state ? C_BOOL : 0;
-     c->text = g_strdup (text);
-     c->hotkey = 0;
-     c->hotpos = -1;
-+    c->hotwc = L'\0';
-     widget_want_hotkey (c->widget, 1);
- 
--    /* Scan for the hotkey */
--    for (s = text, t = c->text; *s; s++, t++){
--	if (*s != '&'){
--	    *t = *s;
--	    continue;
--	}
--	s++;
--	if (*s){
--	    c->hotkey = tolower (*s);
--	    c->hotpos = t - c->text;
--	}
--	*t = *s;
--    }
--    *t = 0;
-+    scan_hotkey (c->text, &c->hotpos, &c->hotkey, &c->hotwc);
-     return c;
- }
- 
-@@ -527,7 +570,7 @@
- 		}
- 		widget_move (&l->widget, y, 0);
- 		printw ("%s", p);
--		xlen = l->widget.cols - strlen (p);
-+		xlen = l->widget.cols - mbstrlen (p);
- 		if (xlen > 0)
- 		    printw ("%*s", xlen, " ");
- 		if (!q)
-@@ -561,7 +604,7 @@
-     if (text){
- 	label->text = g_strdup (text);
- 	if (label->auto_adjust_cols) {
--	    newcols = strlen (text);
-+	    newcols = mbstrlen (text);
- 	    if (newcols > label->widget.cols)
- 	    label->widget.cols = newcols;
- 	}
-@@ -585,7 +628,7 @@
-     if (!text || strchr(text, '\n'))
- 	width = 1;
-     else
--	width = strlen (text);
-+	width = mbstrlen (text);
- 
-     l = g_new (WLabel, 1);
-     init_widget (&l->widget, y, x, 1, width,
-@@ -734,13 +777,69 @@
- /* Pointer to killed data */
- static char *kill_buffer = 0;
- 
-+#ifdef UTF8
-+static int
-+charpos(WInput *in, int idx)
-+{
-+    int i, pos, l, len;
-+    mbstate_t mbs;
-+    memset (&mbs, 0, sizeof (mbs));
-+    i = 0;
-+    pos = 0;
-+    len = strlen(in->buffer);
-+
-+    while (in->buffer[pos]) {
-+	if (i == idx)
-+	    return pos;
-+	l = mbrlen(in->buffer + pos, len - pos, &mbs);
-+	if (l <= 0)
-+	    return pos;
-+	pos+=l;
-+	i++;
-+    };
-+    return pos;
-+}
-+
-+static int
-+charcolumn(WInput *in, int idx)
-+{
-+    int i, pos, l, width, len;
-+    mbstate_t mbs;
-+    memset (&mbs, 0, sizeof (mbs));
-+    i = 0;
-+    pos = 0; width = 0;
-+    len = strlen(in->buffer);
-+
-+    while (in->buffer[pos]) {
-+	wchar_t wc;
-+	if (i == idx)
-+	    return width;
-+	l = mbrtowc(&wc, in->buffer + pos, len - pos, &mbs);
-+	if (l <= 0)
-+	    return width;
-+	pos += l; width += wcwidth(wc);
-+	i++;
-+    };
-+    return width;
-+}
-+#else
-+#define charpos(in, idx) (idx)
-+#define charcolumn(in, idx) (idx)
-+#endif /* UTF8 */
-+
- void
- update_input (WInput *in, int clear_first)
- {
-     int has_history = 0;
-     int    i, j;
--    unsigned char   c;
--    int    buf_len = strlen (in->buffer);
-+    int    buf_len = mbstrlen (in->buffer);
-+#ifndef UTF8
-+    unsigned char c;
-+#else /* UTF8 */
-+    wchar_t c;
-+    mbstate_t mbs;
-+    memset (&mbs, 0, sizeof (mbs));
-+#endif /* UTF8 */
- 
-     if (should_show_history_button (in))
- 	has_history = HISTORY_BUTTON_WIDTH;
-@@ -750,7 +849,7 @@
- 
-     /* Make the point visible */
-     if ((in->point < in->first_shown) ||
--	(in->point >= in->first_shown+in->field_len - has_history)){
-+	(charcolumn(in, in->point) >= charcolumn(in, in->first_shown) + in->field_len - has_history)){
- 	in->first_shown = in->point - (in->field_len / 3);
- 	if (in->first_shown < 0)
- 	    in->first_shown = 0;
-@@ -770,14 +869,29 @@
- 	addch (' ');
-     widget_move (&in->widget, 0, 0);
-     
-+#ifndef UTF8
-     for (i = 0, j = in->first_shown; i < in->field_len - has_history && in->buffer [j]; i++){
- 	c = in->buffer [j++];
- 	c = is_printable (c) ? c : '.';
--	if (in->is_password)
-+#else /* UTF8 */
-+    for (i = 0, j = in->first_shown; (i < in->field_len - has_history) && (j < buf_len); i++,j++){
-+	char * chp = in->buffer + charpos(in,j);
-+	size_t res = mbrtowc(&c, chp, strlen(chp), &mbs);
-+	c = (res && iswprint (c)) ? 0 : '.';
-+#endif /* UTF8 */
-+	if (in->is_password) 
- 	    c = '*';
-+#ifndef UTF8
- 	addch (c);
-+#else /* UTF8 */
-+	if (c) {
-+	    addch (c); 
-+	}
-+	else
-+	    SLsmg_write_nchars (chp, res);
-+#endif /* UTF8 */
-     }
--    widget_move (&in->widget, 0, in->point - in->first_shown);
-+    widget_move (&in->widget, 0, charcolumn(in, in->point) - charcolumn(in, in->first_shown));
- 
-     if (clear_first)
- 	    in->first = 0;
-@@ -919,7 +1033,7 @@
- show_hist (GList *history, int widget_x, int widget_y)
- {
-     GList *hi, *z;
--    size_t maxlen = strlen (i18n_htitle ()), i, count = 0;
-+    size_t maxlen = mbstrlen (i18n_htitle ()), i, count = 0;
-     int x, y, w, h;
-     char *q, *r = 0;
-     Dlg_head *query_dlg;
-@@ -932,7 +1046,7 @@
-     z = g_list_first (history);
-     hi = z;
-     while (hi) {
--	if ((i = strlen ((char *) hi->data)) > maxlen)
-+	if ((i = mbstrlen ((char *) hi->data)) > maxlen)
- 	    maxlen = i;
- 	count++;
- 	hi = g_list_next (hi);
-@@ -1104,35 +1218,83 @@
-     in->need_push = 1;
-     in->buffer [0] = 0;
-     in->point = 0;
-+    in->charpoint = 0;
-     in->mark = 0;
-     free_completions (in);
-     update_input (in, 0);
- }
- 
-+static void
-+move_buffer_backward (WInput *in, int point)
-+{
-+    int i, pos, len;
-+    int str_len = mbstrlen (in->buffer);
-+    if (point >= str_len) return;
-+
-+    pos = charpos(in,point);
-+    len = charpos(in,point + 1) - pos;
-+
-+    for (i = pos; in->buffer [i + len - 1]; i++)
-+	in->buffer [i] = in->buffer [i + len];
-+}
-+
- static cb_ret_t
- insert_char (WInput *in, int c_code)
- {
-     size_t i;
-+#ifdef UTF8
-+    mbstate_t mbs;
-+    int res;
-+
-+    memset (&mbs, 0, sizeof (mbs));
-+#else
-+    in->charpoint = 0;
-+#endif /* UTF8 */
- 
-     if (c_code == -1)
- 	return MSG_NOT_HANDLED;
-     
-+#ifdef UTF8
-+    if (in->charpoint >= MB_CUR_MAX) return 1;
-+
-+    in->charbuf[in->charpoint++] = c_code;
-+
-+    res = mbrlen((char *)in->charbuf, in->charpoint, &mbs);
-+    if (res < 0) {
-+	if (res != -2) in->charpoint = 0; /* broken multibyte char, skip */
-+        return 1;
-+    }
-+
-+#endif /* UTF8 */
-     in->need_push = 1;
--    if (strlen (in->buffer)+1 == (size_t) in->current_max_len){
-+    if (strlen (in->buffer) + 1 + in->charpoint >= (size_t) in->current_max_len){
- 	/* Expand the buffer */
--	char *narea = g_realloc (in->buffer, in->current_max_len + in->field_len);
-+	char *narea = g_realloc (in->buffer, in->current_max_len + in->field_len + in->charpoint);
- 	if (narea){
- 	    in->buffer = narea;
--	    in->current_max_len += in->field_len;
-+	    in->current_max_len += in->field_len + in->charpoint;
- 	}
-     }
-+#ifndef UTF8
-     if (strlen (in->buffer)+1 < (size_t) in->current_max_len){
- 	size_t l = strlen (&in->buffer [in->point]);
- 	for (i = l+1; i > 0; i--)
- 	    in->buffer [in->point+i] = in->buffer [in->point+i-1];
- 	in->buffer [in->point] = c_code;
-+#else /* UTF8 */
-+    if (strlen (in->buffer) + in->charpoint < in->current_max_len){
-+        size_t ins_point = charpos(in,in->point); /* bytes from begin */
-+	/* move chars */
-+	size_t rest_bytes = strlen (in->buffer + ins_point);
-+
-+	for (i = rest_bytes + 1; i > 0; i--) 
-+	    in->buffer [ins_point + i + in->charpoint - 1] = in->buffer [ins_point + i - 1];
-+
-+	memcpy(in->buffer + ins_point, in->charbuf, in->charpoint); 
-+#endif /* UTF8 */
- 	in->point++;
-     }
-+    in->charpoint = 0;
-     return MSG_HANDLED;
- }
- 
-@@ -1140,12 +1302,14 @@
- beginning_of_line (WInput *in)
- {
-     in->point = 0;
-+    in->charpoint = 0;
- }
- 
- static void
- end_of_line (WInput *in)
- {
--    in->point = strlen (in->buffer);
-+    in->point = mbstrlen (in->buffer);
-+    in->charpoint = 0;
- }
- 
- static void
-@@ -1153,18 +1317,21 @@
- {
-     if (in->point)
- 	in->point--;
-+    in->charpoint = 0;
- }
- 
- static void
- forward_char (WInput *in)
- {
--    if (in->buffer [in->point])
-+    if (in->buffer [charpos(in,in->point)])
- 	in->point++;
-+    in->charpoint = 0;
- }
- 
- static void
- forward_word (WInput *in)
- {
-+#ifndef UTF8
-     unsigned char *p = in->buffer+in->point;
- 
-     while (*p && (isspace (*p) || ispunct (*p)))
-@@ -1172,11 +1339,39 @@
-     while (*p && isalnum (*p))
- 	p++;
-     in->point = p - in->buffer;
-+#else /* UTF8 */
-+    mbstate_t mbs;
-+    int len = mbstrlen (in->buffer);
-+    memset (&mbs, 0, sizeof (mbs));
-+
-+    while (in->point < len) {
-+        wchar_t c;
-+        char *p = in->buffer + charpos(in,in->point);
-+        size_t res = mbrtowc(&c, p, strlen(p), &mbs);
-+        if (res <= 0 || !(iswspace (c) || iswpunct (c)))
-+            break;
-+        in->point++;
-+    }
-+
-+    memset (&mbs, 0, sizeof (mbs));
-+
-+    while (in->point < len) {
-+        wchar_t c;
-+        char *p = in->buffer + charpos(in,in->point);
-+        size_t res = mbrtowc(&c, p, strlen(p), &mbs);
-+        if (res <= 0 || !iswalnum (c))
-+            break;
-+        in->point++;
-+    }
-+
-+    in->charpoint = 0;
-+#endif /* UTF8 */
- }
- 
- static void
- backward_word (WInput *in)
- {
-+#ifndef UTF8
-     unsigned char *p = in->buffer+in->point;
- 
-     while (p-1 > in->buffer-1 && (isspace (*(p-1)) || ispunct (*(p-1))))
-@@ -1184,6 +1379,32 @@
-     while (p-1 > in->buffer-1 && isalnum (*(p-1)))
- 	p--;
-     in->point = p - in->buffer;
-+#else /* UTF8 */
-+    mbstate_t mbs;
-+
-+    memset (&mbs, 0, sizeof (mbs));
-+    while (in->point > 0) {
-+      wchar_t c;
-+      char *p = in->buffer + charpos(in,in->point);
-+      size_t res = mbrtowc(&c, p, strlen(p), &mbs);
-+      if (*p && (res <= 0 || !(iswspace (c) || iswpunct (c))))
-+          break;
-+      in->point--;
-+    }
-+
-+    memset (&mbs, 0, sizeof (mbs));
-+
-+    while (in->point > 0) {
-+      wchar_t c;
-+      char *p = in->buffer + charpos(in,in->point);
-+      size_t res = mbrtowc(&c, p, strlen(p), &mbs);
-+      if (*p && (res <= 0 || !iswalnum (c)))
-+          break;
-+      in->point--;
-+    }
-+
-+    in->charpoint = 0;
-+#endif /* UTF8 */
- }
- 
- static void
-@@ -1216,8 +1437,9 @@
-     
-     if (!in->point)
- 	return;
--    for (i = in->point; in->buffer [i-1]; i++)
--	in->buffer [i-1] = in->buffer [i];
-+
-+    move_buffer_backward(in, in->point - 1);    
-+    in->charpoint = 0;
-     in->need_push = 1;
-     in->point--;
- }
-@@ -1225,10 +1447,8 @@
- static void
- delete_char (WInput *in)
- {
--    int i;
--
--    for (i = in->point; in->buffer [i]; i++)
--	in->buffer [i] = in->buffer [i+1];
-+    move_buffer_backward(in, in->point);    
-+    in->charpoint = 0;
-     in->need_push = 1;
- }
- 
-@@ -1243,6 +1463,9 @@
-     
-     g_free (kill_buffer);
- 
-+    first=charpos(in,first);
-+    last=charpos(in,last);
-+    
-     kill_buffer = g_strndup(in->buffer+first,last-first);
- }
- 
-@@ -1251,11 +1474,13 @@
- {
-    int first = min (x_first, x_last);
-    int last  = max (x_first, x_last);
--   size_t len = strlen (&in->buffer [last]) + 1;
-+   size_t len;
- 
-    in->point = first;
-    in->mark  = first;
--   memmove (&in->buffer [first], &in->buffer [last], len);
-+   len = strlen (&in->buffer [charpos(in,last)]) + 1;
-+   memmove (&in->buffer [charpos(in,first)], &in->buffer [charpos(in,last)], len);
-+   in->charpoint = 0;
-    in->need_push = 1;
- }
- 
-@@ -1272,6 +1497,8 @@
-     copy_region (in, old_point, new_point);
-     delete_region (in, old_point, new_point);
-     in->need_push = 1;
-+    in->charpoint = 0;
-+    in->charpoint = 0;
- }
- 
- static void
-@@ -1315,16 +1542,20 @@
-     
-     if (!kill_buffer)
-         return;
-+    in->charpoint = 0;
-     for (p = kill_buffer; *p; p++)
- 	insert_char (in, *p);
-+    in->charpoint = 0;
- }
- 
- static void
- kill_line (WInput *in)
- {
-+    int chp = charpos(in,in->point);
-     g_free (kill_buffer);
--    kill_buffer = g_strdup (&in->buffer [in->point]);
--    in->buffer [in->point] = 0;
-+    kill_buffer = g_strdup (&in->buffer [chp]);
-+    in->buffer [chp] = 0;
-+    in->charpoint = 0;
- }
- 
- void
-@@ -1334,9 +1565,10 @@
-     g_free (in->buffer);
-     in->buffer = g_strdup (text);	/* was in->buffer->text */
-     in->current_max_len = strlen (in->buffer) + 1;
--    in->point = strlen (in->buffer);
-+    in->point = mbstrlen (in->buffer);
-     in->mark = 0;
-     in->need_push = 1;
-+    in->charpoint = 0;
- }
- 
- static void
-@@ -1461,6 +1693,7 @@
-     *in->buffer = 0;
-     in->point = 0;
-     in->first = 0;
-+    in->charpoint = 0;
- }
- 
- cb_ret_t
-@@ -1489,7 +1722,11 @@
- 	}
-     }
-     if (!input_map [i].fn){
-+#ifndef UTF8
- 	if (c_code > 255 || !is_printable (c_code))
-+#else /* UTF8 */
-+	if (c_code > 255)
-+#endif /* UTF8 */
- 	    return MSG_NOT_HANDLED;
- 	if (in->first){
- 	    port_region_marked_for_delete (in);
-@@ -1523,6 +1760,9 @@
-     if (pos != in->point)
-     	free_completions (in);
-     in->point = pos;
-+#ifdef UTF8
-+    in->charpoint = 0;
-+#endif /* UTF8 */
-     update_input (in, 1);
- }
- 
-@@ -1562,7 +1802,7 @@
- 	return MSG_HANDLED;
- 
-     case WIDGET_CURSOR:
--	widget_move (&in->widget, 0, in->point - in->first_shown);
-+        widget_move (&in->widget, 0, charcolumn(in, in->point) - charcolumn(in, in->first_shown));
- 	return MSG_HANDLED;
- 
-     case WIDGET_DESTROY:
-@@ -1584,7 +1824,7 @@
- 	    && should_show_history_button (in)) {
- 	    do_show_hist (in);
- 	} else {
--	    in->point = strlen (in->buffer);
-+	    in->point = mbstrlen (in->buffer);
- 	    if (event->x - in->first_shown - 1 < in->point)
- 		in->point = event->x - in->first_shown - 1;
- 	    if (in->point < 0)
-@@ -1642,56 +1882,91 @@
-     in->is_password = 0;
- 
-     strcpy (in->buffer, def_text);
--    in->point = strlen (in->buffer);
-+    in->point = mbstrlen (in->buffer);
-+    in->charpoint = 0;
-     return in;
- }
- 
--
--/* Listbox widget */
-+/* Vertical scrollbar widget */
- 
--/* Should draw the scrollbar, but currently draws only
-- * indications that there is more information
-- */
--static int listbox_cdiff (WLEntry *s, WLEntry *e);
--
--static void
--listbox_drawscroll (WListbox *l)
-+void
-+vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
-+            int selected, int count, gboolean color)
- {
-     int line;
--    int i, top;
--    int max_line = l->height-1;
--    
-+    int i;
-+
-     /* Are we at the top? */
--    widget_move (&l->widget, 0, l->width);
--    if (l->list == l->top)
--	one_vline ();
-+    widget_move (&widget, tpad, width);
-+#ifndef UTF8
-+    if (!selected)
-+        one_vline ();
-+    else
-+        addch ('^');
-+#else
-+    if (color) attrset (MARKED_COLOR);
-+    if (is_utf8)
-+	SLsmg_write_string("â–²");
-     else
--	addch ('^');
-+        addch ('^');
-+    if (color) attrset (NORMAL_COLOR);
-+#endif
- 
-     /* Are we at the bottom? */
--    widget_move (&l->widget, max_line, l->width);
--    top = listbox_cdiff (l->list, l->top);
--    if ((top + l->height == l->count) || l->height >= l->count)
--	one_vline ();
-+    widget_move (&widget, height-1-bpad, width);
-+#ifndef UTF8
-+    if (selected == count-1)
-+        one_vline ();
-+    else
-+        addch ('v');
-+#else
-+    if (color) attrset (MARKED_COLOR);
-+    if (is_utf8)
-+	SLsmg_write_string("â–¼");
-     else
--	addch ('v');
-+	addch('v');
-+    if (color) attrset (NORMAL_COLOR);
-+#endif
- 
-     /* Now draw the nice relative pointer */
--    if (l->count)
--	line = 1+ ((l->pos * (l->height-2)) / l->count);
-+    if (count > 1)
-+        line = tpad + 1 + ((selected * (height-3-tpad-bpad)) / (count-1));
-     else
--	line = 0;
--    
--    for (i = 1; i < max_line; i++){
--	widget_move (&l->widget, i, l->width);
--	if (i != line)
--	    one_vline ();
--	else
--	    addch ('*');
-+        line = 0;
-+
-+    for (i = tpad + 1; i < height-1-bpad; i++){
-+        widget_move (&widget, i, width);
-+        if (i != line)
-+#ifndef UTF8
-+            one_vline ();
-+        else
-+            addch ('*');
-+#else
-+            if (is_utf8)
-+		SLsmg_write_string("â–’");
-+	    else
-+		one_vline();
-+        else {
-+            if (color) attrset (MARKED_COLOR);
-+            if (is_utf8)
-+		SLsmg_write_string("â—");
-+	    else
-+		addch('*');
-+            if (color) attrset (NORMAL_COLOR);
-+        }
-+#endif
-     }
- }
--    
--static void
-+
-+
-+/* Listbox widget */
-+
-+/* Should draw the scrollbar, but currently draws only
-+ * indications that there is more information
-+ */
-+static int listbox_cdiff (WLEntry *s, WLEntry *e);
-+
-+void
- listbox_draw (WListbox *l, int focused)
- {
-     WLEntry *e;
-@@ -1732,7 +2007,7 @@
-     if (!l->scrollbar)
- 	return;
-     attrset (normalc);
--    listbox_drawscroll (l);
-+    vscrollbar (l->widget, l->height, l->width, 0, 0, l->pos, l->count, FALSE);
- }
- 
- /* Returns the number of items between s and e,
-diff -urN mc-4.6.1.orig/src/widget.h mc-4.6.1/src/widget.h
---- mc-4.6.1.orig/src/widget.h	2004-08-30 00:46:16.000000000 +0600
-+++ mc-4.6.1/src/widget.h	2007-01-19 18:33:59.000000000 +0500
-@@ -25,6 +25,7 @@
-     char *text;			/* text of button */
-     int hotkey;			/* hot KEY */
-     int hotpos;			/* offset hot KEY char in text */
-+    wchar_t hotwc;
-     bcback callback;		/* Callback function */
- } WButton;
- 
-@@ -43,6 +44,7 @@
-     char *text;			/* text of check button */
-     int hotkey;                 /* hot KEY */                    
-     int hotpos;			/* offset hot KEY char in text */
-+    wchar_t hotwc;
- } WCheck;
- 
- typedef struct WGauge {
-@@ -58,16 +60,20 @@
- 
- typedef struct {
-     Widget widget;
--    int  point;			/* cursor position in the input line */
--    int  mark;			/* The mark position */
--    int  first_shown;		/* Index of the first shown character */
--    int  current_max_len;	/* Maximum length of input line */
--    int  field_len;		/* Length of the editing field */
-+    int  point;			/* cursor position in the input line (mb chars) */
-+    int  mark;			/* The mark position (mb chars) */
-+    int  first_shown;		/* Index of the first shown character (mb chars) */
-+    int  current_max_len;	/* Maximum length of input line (bytes) */
-+    int  field_len;		/* Length of the editing field (mb chars) */
-     int  color;			/* color used */
-     int  first;			/* Is first keystroke? */
-     int  disable_update;	/* Do we want to skip updates? */
-     int  is_password;		/* Is this a password input line? */
-     unsigned char *buffer;	/* pointer to editing buffer */
-+#ifdef UTF8
-+    unsigned char charbuf[MB_LEN_MAX];
-+#endif /* UTF8 */
-+    int charpoint;
-     GList *history;		/* The history */
-     int  need_push;		/* need to push the current Input on hist? */
-     char **completions;		/* Possible completions array */
-@@ -176,6 +182,10 @@
- /* Listbox manager */
- WLEntry *listbox_get_data (WListbox *l, int pos);
- 
-+/* Vertical scrollbar */
-+void vscrollbar (Widget widget, int height, int width, int tpad, int bpad,
-+        	int selected, int count, gboolean color);
-+
- /* search text int listbox entries */
- WLEntry *listbox_search_text (WListbox *l, const char *text);
- void listbox_select_entry (WListbox *l, WLEntry *dest);
-diff -urN mc-4.6.1.orig/src/wtools.c mc-4.6.1/src/wtools.c
---- mc-4.6.1.orig/src/wtools.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/src/wtools.c	2007-01-19 18:33:59.000000000 +0500
-@@ -48,11 +48,11 @@
-     /* Adjust sizes */
-     lines = (lines > LINES - 6) ? LINES - 6 : lines;
- 
--    if (title && (cols < (len = strlen (title) + 2)))
-+    if (title && (cols < (len = mbstrlen (title) + 2)))
- 	cols = len;
- 
-     /* no &, but 4 spaces around button for brackets and such */
--    if (cols < (len = strlen (cancel_string) + 3))
-+    if (cols < (len = mbstrlen (cancel_string) + 3))
- 	cols = len;
- 
-     cols = cols > COLS - 6 ? COLS - 6 : cols;
-@@ -123,7 +123,7 @@
- 	va_start (ap, count);
- 	for (i = 0; i < count; i++) {
- 	    char *cp = va_arg (ap, char *);
--	    win_len += strlen (cp) + 6;
-+	    win_len += mbstrlen (cp) + 6;
- 	    if (strchr (cp, '&') != NULL)
- 		win_len--;
- 	}
-@@ -131,7 +131,7 @@
-     }
- 
-     /* count coordinates */
--    cols = 6 + max (win_len, max ((int) strlen (header), msglen (text, &lines)));
-+    cols = 6 + max (win_len, max ((int) mbstrlen (header), msglen (text, &lines)));
-     lines += 4 + (count > 0 ? 2 : 0);
-     xpos = COLS / 2 - cols / 2;
-     ypos = LINES / 3 - (lines - 3) / 2;
-@@ -146,7 +146,7 @@
- 	va_start (ap, count);
- 	for (i = 0; i < count; i++) {
- 	    cur_name = va_arg (ap, char *);
--	    xpos = strlen (cur_name) + 6;
-+	    xpos = mbstrlen (cur_name) + 6;
- 	    if (strchr (cur_name, '&') != NULL)
- 		xpos--;
- 
-@@ -457,7 +457,7 @@
-     g_strlcpy (histname + 3, header, 61);
-     quick_widgets[2].histname = histname;
- 
--    len = max ((int) strlen (header), msglen (text, &lines)) + 4;
-+    len = max ((int) mbstrlen (header), msglen (text, &lines)) + 4;
-     len = max (len, 64);
- 
-     /* The special value of def_text is used to identify password boxes
-@@ -477,7 +477,7 @@
-      */
-     quick_widgets[0].relative_x = len / 2 + 4;
-     quick_widgets[1].relative_x =
--	len / 2 - (strlen (_(quick_widgets[1].text)) + 9);
-+	len / 2 - (mbstrlen (_(quick_widgets[1].text)) + 9);
-     quick_widgets[0].x_divisions = quick_widgets[1].x_divisions = len;
- #endif				/* ENABLE_NLS */
- 
-diff -urN mc-4.6.1.orig/syntax/c.syntax mc-4.6.1/syntax/c.syntax
---- mc-4.6.1.orig/syntax/c.syntax	2005-05-31 12:03:45.000000000 +0600
-+++ mc-4.6.1/syntax/c.syntax	2007-01-19 18:33:58.000000000 +0500
-@@ -32,34 +32,7 @@
-     keyword whole volatile yellow
-     keyword whole while yellow
-     keyword whole asm yellow
--    keyword whole catch yellow
--    keyword whole class yellow
--    keyword whole friend yellow
--    keyword whole delete yellow
-     keyword whole inline yellow
--    keyword whole new yellow
--    keyword whole operator yellow
--    keyword whole private yellow
--    keyword whole protected yellow
--    keyword whole public yellow
--    keyword whole this yellow
--    keyword whole throw yellow
--    keyword whole template yellow
--    keyword whole try yellow
--    keyword whole virtual yellow
--    keyword whole bool yellow
--    keyword whole const_cast yellow
--    keyword whole dynamic_cast yellow
--    keyword whole explicit yellow
--    keyword whole false yellow
--    keyword whole mutable yellow
--    keyword whole namespace yellow
--    keyword whole reinterpret_cast yellow
--    keyword whole static_cast yellow
--    keyword whole true yellow
--    keyword whole typeid yellow
--    keyword whole typename yellow
--    keyword whole using yellow
-     keyword whole wchar_t yellow
-     keyword whole ... yellow
-     keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
-diff -urN mc-4.6.1.orig/syntax/cxx.syntax mc-4.6.1/syntax/cxx.syntax
---- mc-4.6.1.orig/syntax/cxx.syntax	1970-01-01 05:00:00.000000000 +0500
-+++ mc-4.6.1/syntax/cxx.syntax	2007-01-19 18:33:58.000000000 +0500
-@@ -0,0 +1,128 @@
-+context default
-+    keyword whole auto yellow
-+    keyword whole break yellow
-+    keyword whole case yellow
-+    keyword whole char yellow
-+    keyword whole const yellow
-+    keyword whole continue yellow
-+    keyword whole default yellow
-+    keyword whole do yellow
-+    keyword whole double yellow
-+    keyword whole else yellow
-+    keyword whole enum yellow
-+    keyword whole extern yellow
-+    keyword whole float yellow
-+    keyword whole for yellow
-+    keyword whole goto yellow
-+    keyword whole if yellow
-+    keyword whole int yellow
-+    keyword whole long yellow
-+    keyword whole register yellow
-+    keyword whole return yellow
-+    keyword whole short yellow
-+    keyword whole signed yellow
-+    keyword whole sizeof yellow
-+    keyword whole static yellow
-+    keyword whole struct yellow
-+    keyword whole switch yellow
-+    keyword whole typedef yellow
-+    keyword whole union yellow
-+    keyword whole unsigned yellow
-+    keyword whole void yellow
-+    keyword whole volatile yellow
-+    keyword whole while yellow
-+    keyword whole asm yellow
-+    keyword whole catch yellow
-+    keyword whole class yellow
-+    keyword whole friend yellow
-+    keyword whole delete yellow
-+    keyword whole inline yellow
-+    keyword whole new yellow
-+    keyword whole operator yellow
-+    keyword whole private yellow
-+    keyword whole protected yellow
-+    keyword whole public yellow
-+    keyword whole this yellow
-+    keyword whole throw yellow
-+    keyword whole template yellow
-+    keyword whole try yellow
-+    keyword whole virtual yellow
-+    keyword whole bool yellow
-+    keyword whole const_cast yellow
-+    keyword whole dynamic_cast yellow
-+    keyword whole explicit yellow
-+    keyword whole false yellow
-+    keyword whole mutable yellow
-+    keyword whole namespace yellow
-+    keyword whole reinterpret_cast yellow
-+    keyword whole static_cast yellow
-+    keyword whole true yellow
-+    keyword whole typeid yellow
-+    keyword whole typename yellow
-+    keyword whole using yellow
-+    keyword whole wchar_t yellow
-+    keyword whole ... yellow
-+    keyword whole linestart \{\s\t\}\[\s\t\]#*\n brightmagenta
-+
-+    keyword /\* brown
-+    keyword \*/ brown
-+    keyword // brown
-+
-+    keyword '\\\{"abtnvfr\}' brightgreen
-+    keyword '\\\{0123\}\{01234567\}\{01234567\}' brightgreen
-+    keyword '\\'' brightgreen
-+    keyword '\\\\' brightgreen
-+    keyword '\\0' brightgreen
-+    keyword '\{\s!"#$%&()\*\+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ\}' brightgreen
-+
-+    keyword > yellow
-+    keyword < yellow
-+    keyword \+ yellow
-+    keyword - yellow
-+    keyword \* yellow
-+    keyword / yellow
-+    keyword % yellow
-+    keyword = yellow
-+    keyword != yellow
-+    keyword == yellow
-+    keyword { brightcyan
-+    keyword } brightcyan
-+    keyword ( brightcyan
-+    keyword ) brightcyan
-+    keyword [ brightcyan
-+    keyword ] brightcyan
-+    keyword , brightcyan
-+    keyword : brightcyan
-+    keyword ? brightcyan
-+    keyword ; brightmagenta
-+
-+context exclusive /\* \*/ brown
-+    spellcheck
-+
-+context exclusive // \n brown
-+    spellcheck
-+
-+context linestart # \n brightred
-+    keyword \\\n yellow
-+    keyword /\**\*/ brown
-+    keyword //*\n brown
-+    keyword "+" red
-+    keyword <+> red
-+
-+context " " green
-+    spellcheck
-+    keyword \\" brightgreen
-+    keyword %% brightgreen
-+    keyword %\[#0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[L\]\{eEfgGoxX\} brightgreen
-+    keyword %\[0\s-\+,\]\[0123456789\*\]\[.\]\[0123456789\*\]\[hl\]\{diuxX\} brightgreen
-+    keyword %\[hl\]n brightgreen
-+    keyword %\[-\]\[0123456789\*\]\[.\]\[0123456789\*\]s brightgreen
-+    keyword %[*] brightgreen
-+    keyword %c brightgreen
-+    keyword %p brightgreen
-+    keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
-+    keyword \\\\ brightgreen
-+    keyword \\' brightgreen
-+    keyword \\\{abtnvfr\} brightgreen
-+
-+
-diff -urN mc-4.6.1.orig/syntax/Makefile.am mc-4.6.1/syntax/Makefile.am
---- mc-4.6.1.orig/syntax/Makefile.am	2005-03-19 22:39:06.000000000 +0500
-+++ mc-4.6.1/syntax/Makefile.am	2007-01-19 18:33:58.000000000 +0500
-@@ -4,6 +4,7 @@
- 	aspx.syntax		\
- 	assembler.syntax	\
- 	c.syntax		\
-+	cxx.syntax		\
- 	cs.syntax		\
- 	changelog.syntax	\
- 	diff.syntax		\
-diff -urN mc-4.6.1.orig/syntax/Makefile.in mc-4.6.1/syntax/Makefile.in
---- mc-4.6.1.orig/syntax/Makefile.in	2005-07-23 22:53:15.000000000 +0600
-+++ mc-4.6.1/syntax/Makefile.in	2007-01-19 18:33:58.000000000 +0500
-@@ -218,6 +218,7 @@
- 	aspx.syntax		\
- 	assembler.syntax	\
- 	c.syntax		\
-+	cxx.syntax		\
- 	cs.syntax		\
- 	changelog.syntax	\
- 	diff.syntax		\
-diff -urN mc-4.6.1.orig/syntax/sh.syntax mc-4.6.1/syntax/sh.syntax
---- mc-4.6.1.orig/syntax/sh.syntax	2004-12-02 15:47:14.000000000 +0500
-+++ mc-4.6.1/syntax/sh.syntax	2007-01-19 18:33:58.000000000 +0500
-@@ -41,7 +41,9 @@
-     keyword whole bg yellow
-     keyword whole break yellow
-     keyword whole case yellow
-+    keyword whole clear yellow
-     keyword whole continue yellow
-+    keyword whole declare yellow
-     keyword whole done yellow
-     keyword whole do yellow
-     keyword whole elif yellow
-@@ -56,11 +58,13 @@
-     keyword whole for yellow
-     keyword whole if yellow
-     keyword whole in yellow
-+    keyword whole let yellow
-     keyword whole read yellow
-     keyword whole return yellow
-     keyword whole select yellow
-     keyword whole set yellow
-     keyword whole shift yellow
-+    keyword whole source yellow
-     keyword whole then yellow
-     keyword whole trap yellow
-     keyword whole umask yellow
-@@ -69,6 +73,8 @@
-     keyword whole wait yellow
-     keyword whole while yellow
- 
-+    keyword whole apt-get cyan
-+    keyword whole ar cyan
-     keyword whole arch cyan
-     keyword whole ash cyan
-     keyword whole awk cyan
-@@ -77,90 +83,204 @@
-     keyword whole bg_backup cyan
-     keyword whole bg_restore cyan
-     keyword whole bsh cyan
-+    keyword whole bzip cyan
-+    keyword whole bzip2 cyan
-+    keyword whole cam cyan
-     keyword whole cat cyan
-     keyword whole cd cyan
-+    keyword whole cdda2wav cyan
-     keyword whole chgrp cyan
-     keyword whole chmod cyan
-     keyword whole chown cyan
-+    keyword whole cmp cyan
-+    keyword whole col cyan
-+    keyword whole compress cyan
-     keyword whole cp cyan
-     keyword whole cpio cyan
-+    keyword whole cpp cyan
-     keyword whole csh cyan
-+    keyword whole curl cyan
-+    keyword whole cut cyan
-     keyword whole date cyan
-     keyword whole dd cyan
-     keyword whole df cyan
-+    keyword whole dialog cyan
-+    keyword whole diff cyan
-+    keyword whole dirname cyan
-     keyword whole dmesg cyan
-     keyword whole dnsdomainname cyan
-     keyword whole doexec cyan
-     keyword whole domainname cyan
-+    keyword whole dpkg cyan
-+    keyword whole dpkg-buildpackage cyan
-+    keyword whole dpkg-scanpackages cyan
-+    keyword whole dpkg-scansources cyan
-     keyword whole echo cyan
-     keyword whole ed cyan
-+    keyword whole editor cyan
-     keyword whole egrep cyan
-     keyword whole ex cyan
-+    keyword whole fakeroot cyan
-     keyword whole false cyan
-+    keyword whole fdformat cyan
-+    keyword whole fetchmail cyan
-     keyword whole fgrep cyan
-     keyword whole find cyan
-+    keyword whole formail cyan
-+    keyword whole free cyan
-+    keyword whole freeze cyan
-     keyword whole fsconf cyan
-     keyword whole gawk cyan
-+    keyword whole gdb cyan
-+    keyword whole gcc cyan
-     keyword whole grep cyan
-     keyword whole gunzip cyan
-     keyword whole gzip cyan
-+    keyword whole ha cyan
-     keyword whole hostname cyan
-     keyword whole igawk cyan
-+    keyword whole insmod cyan
-     keyword whole ipcalc cyan
-+    keyword whole iptables cyan
-     keyword whole kill cyan
-     keyword whole ksh cyan
-+    keyword whole lame cyan
-+    keyword whole less cyan
-+    keyword whole lharc cyan
-+    keyword whole lilo cyan
-+    keyword whole linux_logo cyan
-     keyword whole linuxconf cyan
-     keyword whole ln cyan
-+    keyword whole locale cyan
-+    keyword whole logger cyan
-     keyword whole login cyan
-     keyword whole lpdconf cyan
-     keyword whole ls cyan
-+    keyword whole lynx cyan
-     keyword whole mail cyan
-+    keyword whole man cyan
-+    keyword whole mc cyan
-+    keyword whole mcedit cyan
-+    keyword whole mcview cyan
-+    keyword whole mimedecode cyan
-     keyword whole mkdir cyan
-+    keyword whole mkdirhier cyan
-+    keyword whole mkfs.ext2 cyan
-+    keyword whole mkfs.ext3 cyan
-+    keyword whole mkfs.minix cyan
-+    keyword whole mkfs.msdos cyan
-+    keyword whole mke2fs cyan
-+    keyword whole mkdosfs cyan
-+    keyword whole mkinitrd cyan
-     keyword whole mknod cyan
-     keyword whole mktemp cyan
-+    keyword whole modprobe cyan
-     keyword whole more cyan
-     keyword whole mount cyan
-+    keyword whole mozilla cyan
-+    keyword whole mp3info cyan
-+    keyword whole munpack cyan
-+    keyword whole msgfmt cyan
-     keyword whole mt cyan
-+    keyword whole mutt cyan
-     keyword whole mv cyan
-     keyword whole netconf cyan
-     keyword whole netstat cyan
-     keyword whole nice cyan
-     keyword whole nisdomainname cyan
-+    keyword whole nm cyan
-+    keyword whole patch cyan
-+    keyword whole pinfo cyan
-     keyword whole ping cyan
-+    keyword whole procmail cyan
-     keyword whole ps cyan
-     keyword whole pwd cyan
-+    keyword whole rar cyan
-     keyword whole red cyan
-     keyword whole remadmin cyan
-+    keyword whole rename cyan
-     keyword whole rm cyan
-     keyword whole rmdir cyan
-+    keyword whole rmmod cyan
-+    keyword whole rplay cyan
-     keyword whole rpm cyan
-+    keyword whole rpm2cpio cyan
-     keyword whole sed cyan
-     keyword whole set cyan
-     keyword whole setserial cyan
-     keyword whole sh cyan
-     keyword whole sleep cyan
-     keyword whole sort cyan
-+    keyword whole sa-learn cyan
-+    keyword whole spamassassin cyan
-+    keyword whole spamc cyan
-+    keyword whole spamd cyan
-+    keyword whole ssmtp cyan
-+    keyword whole strace cyan
-     keyword whole stty cyan
-     keyword whole su cyan
-     keyword whole sync cyan
-     keyword whole taper cyan
-     keyword whole tar cyan
-+    keyword whole tcpdump cyan
-     keyword whole tcsh cyan
-     keyword whole test cyan
-+    keyword whole tempfile cyan
-     keyword whole time cyan
-+    keyword whole tnef cyan
-     keyword whole touch cyan
-+    keyword whole tr cyan
-     keyword whole true cyan
-+    keyword whole tune2fs cyan
-     keyword whole umount cyan
-     keyword whole uname cyan
-+    keyword whole unarj cyan
-+    keyword whole uniq cyan
-+    keyword whole unzip cyan
-+    keyword whole uptime cyan
-     keyword whole userconf cyan
-     keyword whole usleep cyan
-     keyword whole vi cyan
-     keyword whole view cyan
-     keyword whole vim cyan
-+    keyword whole wc cyan
-+    keyword whole wget cyan
-+    keyword whole whiptail cyan
-+    keyword whole wvWare cyan
-     keyword whole xconf cyan
-+    keyword whole xgettext cyan
-+    keyword whole xmessage cyan
-+    keyword whole xmodmap cyan
-+    keyword whole xterm cyan
-     keyword whole ypdomainname cyan
-     keyword whole zcat cyan
-+    keyword whole zgv cyan
-+    keyword whole zip cyan
-+    keyword whole zoo cyan
-     keyword whole zsh cyan
-+    keyword whole Xdialog cyan
-+
-+    keyword whole gpg     red
-+    keyword whole md5sum  red
-+    keyword whole openssl red
-+    keyword whole ssh     red
-+
-+    keyword whole TEXTDOMAINDIR magenta
-+    keyword whole TEXTDOMAIN    magenta
-+    keyword whole VERSION       magenta
-+
-+    keyword whole jpegtopnm cyan
-+    keyword whole pnmscale  cyan
-+    keyword whole ppmtoxpm  cyan
-+
-+    keyword whole /dev/audio  brightblue
-+    keyword whole /dev/dsp    brightblue
-+    keyword whole /dev/null   brightblue
-+    keyword whole /dev/mixed  brightblue
-+    keyword whole /dev/stdin  brightblue
-+    keyword whole /dev/stdout brightblue
-+    keyword whole /dev/stderr brightblue
-+    keyword whole /dev/zero   brightblue
- 
- wholechars abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_
- 
-@@ -224,7 +344,9 @@
- 
-     keyword whole break yellow
-     keyword whole case yellow
-+    keyword whole clear yellow
-     keyword whole continue yellow
-+    keyword whole declare yellow
-     keyword whole done yellow
-     keyword whole do yellow
-     keyword whole elif yellow
-@@ -238,11 +360,15 @@
-     keyword whole return yellow
-     keyword whole select yellow
-     keyword whole shift yellow
-+    keyword whole source yellow
-     keyword whole then yellow
-     keyword whole trap yellow
-     keyword whole until yellow
-+    keyword whole wait yellow
-     keyword whole while yellow
- 
-+    keyword whole apt-get cyan
-+    keyword whole ar cyan
-     keyword whole arch cyan
-     keyword whole ash cyan
-     keyword whole awk cyan
-@@ -251,89 +377,194 @@
-     keyword whole bg_backup cyan
-     keyword whole bg_restore cyan
-     keyword whole bsh cyan
-+    keyword whole bzip cyan
-+    keyword whole bzip2 cyan
-+    keyword whole cam cyan
-     keyword whole cat cyan
-     keyword whole cd cyan
-+    keyword whole cdda2wav cyan
-     keyword whole chgrp cyan
-     keyword whole chmod cyan
-     keyword whole chown cyan
-+    keyword whole cmp cyan
-+    keyword whole col cyan
-+    keyword whole compress cyan
-     keyword whole cp cyan
-     keyword whole cpio cyan
-+    keyword whole cpp cyan
-     keyword whole csh cyan
-+    keyword whole curl cyan
-+    keyword whole cut cyan
-     keyword whole date cyan
-     keyword whole dd cyan
-     keyword whole df cyan
-+    keyword whole dialog cyan
-+    keyword whole diff cyan
-+    keyword whole dirname cyan
-     keyword whole dmesg cyan
-     keyword whole dnsdomainname cyan
-     keyword whole doexec cyan
-     keyword whole domainname cyan
-+    keyword whole dpkg cyan
-+    keyword whole dpkg-buildpackage cyan
-+    keyword whole dpkg-scanpackages cyan
-+    keyword whole dpkg-scansources cyan
-     keyword whole echo cyan
-     keyword whole ed cyan
-+    keyword whole editor cyan
-     keyword whole egrep cyan
-     keyword whole ex cyan
-+    keyword whole fakeroot cyan
-     keyword whole false cyan
-+    keyword whole fdformat cyan
-+    keyword whole fetchmail cyan
-     keyword whole fgrep cyan
-     keyword whole find cyan
-+    keyword whole free cyan
-+    keyword whole freeze cyan
-     keyword whole fsconf cyan
-     keyword whole gawk cyan
-+    keyword whole gdb cyan
-+    keyword whole gcc cyan
-     keyword whole grep cyan
-     keyword whole gunzip cyan
-     keyword whole gzip cyan
-+    keyword whole ha cyan
-     keyword whole hostname cyan
-     keyword whole igawk cyan
-+    keyword whole insmod cyan
-+    keyword whole iptables cyan
-     keyword whole ipcalc cyan
-     keyword whole kill cyan
-     keyword whole ksh cyan
-+    keyword whole lame cyan
-+    keyword whole less cyan
-+    keyword whole lharc cyan
-+    keyword whole lilo cyan
-+    keyword whole linux_logo cyan
-     keyword whole linuxconf cyan
-     keyword whole ln cyan
-+    keyword whole locale cyan
-+    keyword whole logger cyan
-     keyword whole login cyan
-     keyword whole lpdconf cyan
-     keyword whole ls cyan
-+    keyword whole lynx cyan
-     keyword whole mail cyan
-+    keyword whole man cyan
-+    keyword whole mc cyan
-+    keyword whole mcedit cyan
-+    keyword whole mcview cyan
-+    keyword whole mimedecode cyan
-     keyword whole mkdir cyan
-+    keyword whole mkdirhier cyan
-+    keyword whole mkfs.ext2 cyan
-+    keyword whole mkfs.ext3 cyan
-+    keyword whole mkfs.minix cyan
-+    keyword whole mkfs.msdos cyan
-+    keyword whole mke2fs cyan
-+    keyword whole mkdosfs cyan
-+    keyword whole mkinitrd cyan
-     keyword whole mknod cyan
-     keyword whole mktemp cyan
-+    keyword whole modprobe cyan
-     keyword whole more cyan
-     keyword whole mount cyan
-+    keyword whole mozilla cyan
-+    keyword whole mp3info cyan
-+    keyword whole msgfmt cyan
-     keyword whole mt cyan
-+    keyword whole mutt cyan
-     keyword whole mv cyan
-     keyword whole netconf cyan
-     keyword whole netstat cyan
-     keyword whole nice cyan
-     keyword whole nisdomainname cyan
-+    keyword whole nm cyan
-+    keyword whole patch cyan
-+    keyword whole pinfo cyan
-     keyword whole ping cyan
-     keyword whole ps cyan
-     keyword whole pwd cyan
-+    keyword whole rar cyan
-     keyword whole red cyan
-     keyword whole remadmin cyan
-+    keyword whole rename cyan
-     keyword whole rm cyan
-     keyword whole rmdir cyan
-+    keyword whole rmmod cyan
-+    keyword whole rplay cyan
-     keyword whole rpm cyan
-+    keyword whole rpm2cpio cyan
-     keyword whole sed cyan
-     keyword whole set cyan
-     keyword whole setserial cyan
-     keyword whole sh cyan
-     keyword whole sleep cyan
-     keyword whole sort cyan
-+    keyword whole sa-learn cyan
-+    keyword whole spamassassin cyan
-+    keyword whole spamc cyan
-+    keyword whole spamd cyan
-+    keyword whole ssmtp cyan
-+    keyword whole strace cyan
-     keyword whole stty cyan
-     keyword whole su cyan
-     keyword whole sync cyan
-     keyword whole taper cyan
-     keyword whole tar cyan
-+    keyword whole tcpdump cyan
-     keyword whole tcsh cyan
-+    keyword whole tempfile cyan
-     keyword whole test cyan
-     keyword whole time cyan
-+    keyword whole tnef cyan
-     keyword whole touch cyan
-+    keyword whole tr cyan
-     keyword whole true cyan
-+    keyword whole tune2fs cyan
-     keyword whole umount cyan
-     keyword whole uname cyan
-+    keyword whole unarj cyan
-+    keyword whole uniq cyan
-+    keyword whole unzip cyan
-+    keyword whole uptime cyan
-     keyword whole userconf cyan
-     keyword whole usleep cyan
-     keyword whole vi cyan
-     keyword whole view cyan
-     keyword whole vim cyan
-+    keyword whole wc cyan
-+    keyword whole wget cyan
-+    keyword whole whiptail cyan
-+    keyword whole wvWare cyan
-     keyword whole xconf cyan
-+    keyword whole xgettext cyan
-+    keyword whole xmessage cyan
-+    keyword whole xmodmap cyan
-+    keyword whole xterm cyan
-     keyword whole ypdomainname cyan
-     keyword whole zcat cyan
-+    keyword whole zgv cyan
-+    keyword whole zoo cyan
-+    keyword whole zip cyan
-     keyword whole zsh cyan
-+    keyword whole Xdialog cyan
- 
--
-+    keyword whole gpg     red
-+    keyword whole md5sum  red
-+    keyword whole openssl red
-+    keyword whole ssh     red
-+
-+    keyword whole TEXTDOMAINDIR magenta
-+    keyword whole TEXTDOMAIN    magenta
-+    keyword whole VERSION       magenta
-+
-+    keyword whole /dev/audio  brightblue
-+    keyword whole /dev/dsp    brightblue
-+    keyword whole /dev/null   brightblue
-+    keyword whole /dev/mixed  brightblue
-+    keyword whole /dev/stdin  brightblue
-+    keyword whole /dev/stdout brightblue
-+    keyword whole /dev/stderr brightblue
-+    keyword whole /dev/zero   brightblue
-diff -urN mc-4.6.1.orig/syntax/Syntax mc-4.6.1/syntax/Syntax
---- mc-4.6.1.orig/syntax/Syntax	2005-05-26 13:21:34.000000000 +0600
-+++ mc-4.6.1/syntax/Syntax	2007-01-19 18:33:58.000000000 +0500
-@@ -45,9 +45,10 @@
- file ..\*\\.(rb|RB)$ Ruby\sProgram ^#!.\*([\s/]ruby|@RUBY@)
- include ruby.syntax
- 
--file ..\*\\.(man|[0-9n]|[0-9]x)$ NROFF\sSource
-+file ..\*\\.(man|[0-9n]|[0-9](x|ncurses|ssl|p|pm|menu|form|vga|t|td))$ NROFF\sSource
- include nroff.syntax
- 
-+
- file ..\*\\.(htm|html|HTM|HTML)$ HTML\sFile
- include html.syntax
- 
-@@ -72,9 +73,12 @@
- file ..\*\.(texi|texinfo|TEXI|TEXINFO)$ Texinfo\sDocument
- include texinfo.syntax
- 
--file ..\*\\.([chC]|CC|cxx|cc|cpp|CPP|CXX|hxx|h\.in)$ C/C\+\+\sProgram
-+file ..\*\\.c$ C\sProgram
- include c.syntax
- 
-+file ..\*\\.([hC]|CC|cxx|cc|cpp|CPP|CXX|hxx|h\.in)$ C/C\+\+\sProgram
-+include cxx.syntax
-+
- file ..\*\\.[fF]$ Fortran\sProgram
- include fortran.syntax
- 
-diff -urN mc-4.6.1.orig/vfs/cpio.c mc-4.6.1/vfs/cpio.c
---- mc-4.6.1.orig/vfs/cpio.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/cpio.c	2007-01-19 18:33:58.000000000 +0500
-@@ -83,7 +83,7 @@
-     struct vfs_s_inode *inode;
- };
- 
--static int cpio_position;
-+static off_t cpio_position;
- 
- static int cpio_find_head(struct vfs_class *me, struct vfs_s_super *super);
- static int cpio_read_bin_head(struct vfs_class *me, struct vfs_s_super *super);
-@@ -107,7 +107,7 @@
-     return l;
- }
- 
--static int cpio_skip_padding(struct vfs_s_super *super)
-+static off_t cpio_skip_padding(struct vfs_s_super *super)
- {
-     switch(super->u.arch.type) {
-     case CPIO_BIN:
-diff -urN mc-4.6.1.orig/vfs/direntry.c mc-4.6.1/vfs/direntry.c
---- mc-4.6.1.orig/vfs/direntry.c	2004-11-29 23:44:49.000000000 +0500
-+++ mc-4.6.1/vfs/direntry.c	2007-01-19 18:33:58.000000000 +0500
-@@ -243,7 +243,13 @@
-     char * const pathref = g_strdup (a_path);
-     char *path = pathref;
- 
--    canonicalize_pathname (path);
-+    if (strncmp(me->name, "ftpfs", 5) != 0)
-+	canonicalize_pathname (path);
-+    else {
-+	char *p = path + strlen (path) - 1;
-+	while (p > path && *p == PATH_SEP)
-+	    *p-- = 0;
-+    }
- 
-     while (root) {
- 	while (*path == PATH_SEP)	/* Strip leading '/' */
-@@ -313,7 +319,13 @@
-     if (root->super->root != root)
- 	vfs_die ("We have to use _real_ root. Always. Sorry.");
- 
--    canonicalize_pathname (path);
-+    if (strncmp (me->name, "ftpfs", 5) != 0)
-+	canonicalize_pathname (path);
-+    else {
-+	char *p = path + strlen (path) - 1;
-+	while (p > path && *p == PATH_SEP)
-+	    *p-- = 0;
-+    }
- 
-     if (!(flags & FL_DIR)) {
- 	char *dirname, *name, *save;
-@@ -836,13 +848,13 @@
-     return 0;
- }
- 
--static int
-+static off_t
- vfs_s_lseek (void *fh, off_t offset, int whence)
- {
-     off_t size = FH->ino->st.st_size;
- 
-     if (FH->handle != -1){	/* If we have local file opened, we want to work with it */
--	int retval = lseek (FH->handle, offset, whence);
-+	off_t retval = lseek (FH->handle, offset, whence);
- 	if (retval == -1)
- 	    FH->ino->super->me->verrno = errno;
- 	return retval;
-diff -urN mc-4.6.1.orig/vfs/extfs/uzip.in mc-4.6.1/vfs/extfs/uzip.in
---- mc-4.6.1.orig/vfs/extfs/uzip.in	2004-09-02 06:16:33.000000000 +0600
-+++ mc-4.6.1/vfs/extfs/uzip.in	2007-01-19 18:33:58.000000000 +0500
-@@ -34,6 +34,14 @@
- # Command used to extract a file to standard out
- my $cmd_extract = "$app_unzip -p";
- 
-+# -rw-r--r--  2.2 unx     2891 tx     1435 defN 20000330.211927 ./edit.html
-+# (perm) (?) (?) (size) (?) (zippedsize) (method) (yyyy)(mm)(dd)(HH)(MM) (fname)
-+my $regex_zipinfo_line = qr"^(\S{7,10})\s+(\d+\.\d+)\s+(\S+)\s+(\d+)\s+(\S\S)\s+(\d+)\s+(\S{4})\s+(\d{4})(\d\d)(\d\d)\.(\d\d)(\d\d)(\d\d)\s(.*)$";
-+
-+#     2891  Defl:N     1435  50%  03-30-00 21:19  50cbaaf8  ./edit.html
-+# (size) (method) (zippedsize) (zipratio) (mm)(dd)(yy)(HH)(MM) (cksum) (fname)
-+my $regex_nonzipinfo_line = qr"^\s*(\d+)\s+(\S+)\s+(\d+)\s+(-?\d+\%)\s+(\d?\d)-(\d?\d)-(\d\d)\s+(\d?\d):(\d\d)\s+([0-9a-f]+)\s\s(.*)$";
-+
- #
- # Main code
- #
-@@ -50,6 +58,50 @@
- my $cmd_list = ($op_has_zipinfo ? $cmd_list_zi : $cmd_list_nzi);
- my ($qarchive, $aqarchive) = map (quotemeta, $archive, $aarchive);
- 
-+# Strip all "." and ".." path components from a pathname.
-+sub zipfs_canonicalize_pathname($) {
-+  my ($fname) = @_;
-+  $fname =~ s,/+,/,g;
-+  $fname =~ s,(^|/)(?:\.?\./)+,$1,;
-+  return $fname;
-+}
-+
-+# The Midnight Commander never calls this script with archive pathnames
-+# starting with either "./" or "../". Some ZIP files contain such names,
-+# so we need to build a translation table for them.
-+my $zipfs_realpathname_table = undef;
-+sub zipfs_realpathname($) {
-+    my ($fname) = @_;
-+
-+    if (!defined($zipfs_realpathname_table)) {
-+        $zipfs_realpathname_table = {};
-+	if (!open(ZIP, "$cmd_list $qarchive |")) {
-+	    return $fname;
-+	}
-+	foreach my $line (<ZIP>) {
-+	    $line =~ s/\r*\n*$//;
-+	    if ($op_has_zipinfo) {
-+		if ($line =~ $regex_zipinfo_line) {
-+		    my ($fname) = ($14);
-+		    $zipfs_realpathname_table->{zipfs_canonicalize_pathname($fname)} = $fname;
-+		}
-+	    } else {
-+		if ($line =~ $regex_nonzipinfo_line) {
-+		    my ($fname) = ($11);
-+		    $zipfs_realpathname_table->{zipfs_canonicalize_pathname($fname)} = $fname;
-+		}
-+	    }
-+	}
-+	if (!close(ZIP)) {
-+	    return $fname;
-+	}
-+    }
-+    if (exists($zipfs_realpathname_table->{$fname})) {
-+	return $zipfs_realpathname_table->{$fname};
-+    }
-+    return $fname;
-+}
-+
- if ($cmd eq 'list')    { &mczipfs_list(@ARGV); }
- if ($cmd eq 'rm')      { &mczipfs_rm(@ARGV); }
- if ($cmd eq 'rmdir')   { &mczipfs_rmdir(@ARGV); }
-@@ -63,7 +115,12 @@
- 
- # Remove a file from the archive.
- sub mczipfs_rm {
--	my ($qfile) = map { &zipquotemeta($_) } @_;
-+	my ($qfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_;
-+
-+	# "./" at the beginning of pathnames is stripped by Info-ZIP,
-+	# so convert it to "[.]/" to prevent stripping.
-+	$qfile =~ s/^\\\./[.]/;
-+
- 	&checkargs(1, 'archive file', @_);
- 	&safesystem("$cmd_delete $qarchive $qfile >/dev/null");
- 	exit;
-@@ -74,7 +131,7 @@
- # additional slash to the directory name to remove. I am not
- # sure this is absolutely necessary, but it doesn't hurt.
- sub mczipfs_rmdir {
--	my ($qfile) = map { &zipquotemeta($_) } @_;
-+	my ($qfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_;
- 	&checkargs(1, 'archive directory', @_);
- 	&safesystem("$cmd_delete $qarchive $qfile/ >/dev/null", 12);
-   exit;
-@@ -84,7 +141,7 @@
- # Note that we don't need to check if the file is a link,
- # because mc apparently doesn't call copyout for symbolic links.
- sub mczipfs_copyout {
--	my ($qafile, $qfsfile) = map { &zipquotemeta($_) } @_;
-+	my ($qafile, $qfsfile) = map { &zipquotemeta(zipfs_realpathname($_)) } @_;
- 	&checkargs(1, 'archive file', @_);
- 	&checkargs(2, 'local file', @_);
- 	&safesystem("$cmd_extract $qarchive $qafile > $qfsfile", 11);
-@@ -195,14 +252,14 @@
- 			next if /^Archive:/;
- 			next if /^\d+ file/;
- 			next if /^Empty zipfile\.$/;
--			my @match = /^(.{10}) +([\d.]+) +([a-z\d]+) +(\d+) +([^ ]{2}) +(\d+) +([^ ]{4}) +(\d{4})(\d\d)(\d\d)\.(\d\d)(\d\d)(\d\d) +(.*)$/;
-+			my @match = /$regex_zipinfo_line/;
- 			next if ($#match != 13);
- 			&checked_print_file(@match);
- 		}
- 	} else {
- 		while (<PIPE>) {
- 			chomp;
--			my @match = /^ *(\d+) +([^ ]+) +(\d+) +(-?\d+\%) +(\d?\d)-(\d?\d)-(\d\d) (\d?\d):(\d\d) +([0-9a-f]+) +(.*)$/;
-+			my @match = /$regex_nonzipinfo_line/;
- 			next if ($#match != 10);
- 			my @rmatch = ('', '', 'unknown', $match[0], '', $match[2], $match[1],
- 					$match[6] + ($match[6] < 70 ? 2000 : 1900), $match[4], $match[5],
-@@ -230,7 +287,7 @@
- sub mczipfs_run {
- 	my ($afile) = @_;
- 	&checkargs(1, 'archive file', @_);
--	my $qafile = &zipquotemeta($afile);
-+	my $qafile = &zipquotemeta(zipfs_realpathname($afile));
- 	my $tmpdir = &mktmpdir();
- 	my $tmpfile = File::Basename::basename($afile);
- 
-diff -urN mc-4.6.1.orig/vfs/extfs.c mc-4.6.1/vfs/extfs.c
---- mc-4.6.1.orig/vfs/extfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/extfs.c	2007-01-19 18:33:58.000000000 +0500
-@@ -1125,7 +1125,7 @@
-     return 0;
- }
- 
--static int extfs_lseek (void *data, off_t offset, int whence)
-+static off_t extfs_lseek (void *data, off_t offset, int whence)
- {
-     struct pseudofile *file = (struct pseudofile *) data;
- 
-diff -urN mc-4.6.1.orig/vfs/ftpfs.c mc-4.6.1/vfs/ftpfs.c
---- mc-4.6.1.orig/vfs/ftpfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/ftpfs.c	2007-01-19 18:33:58.000000000 +0500
-@@ -114,7 +114,7 @@
- int ftpfs_use_unix_list_options = 1;
- 
- /* First "CWD <path>", then "LIST -la ." */
--int ftpfs_first_cd_then_ls;
-+int ftpfs_first_cd_then_ls = 1;
- 
- /* Use the ~/.netrc */
- int use_netrc = 1;
-diff -urN mc-4.6.1.orig/vfs/local.c mc-4.6.1/vfs/local.c
---- mc-4.6.1.orig/vfs/local.c	2004-09-25 05:00:18.000000000 +0600
-+++ mc-4.6.1/vfs/local.c	2007-01-19 18:33:58.000000000 +0500
-@@ -197,7 +197,7 @@
-     return chdir (path);
- }
- 
--int
-+off_t
- local_lseek (void *data, off_t offset, int whence)
- {
-     int fd = * (int *) data;
-diff -urN mc-4.6.1.orig/vfs/local.h mc-4.6.1/vfs/local.h
---- mc-4.6.1.orig/vfs/local.h	2004-08-17 15:17:43.000000000 +0600
-+++ mc-4.6.1/vfs/local.h	2007-01-19 18:33:58.000000000 +0500
-@@ -11,7 +11,7 @@
- extern int local_read (void *data, char *buffer, int count);
- extern int local_fstat (void *data, struct stat *buf);
- extern int local_errno (struct vfs_class *me);
--extern int local_lseek (void *data, off_t offset, int whence);
-+extern off_t local_lseek (void *data, off_t offset, int whence);
- #ifdef HAVE_MMAP
- extern caddr_t local_mmap (struct vfs_class *me, caddr_t addr, size_t len,
-                            int prot, int flags, void *data, off_t offset);
-diff -urN mc-4.6.1.orig/vfs/mcfs.c mc-4.6.1/vfs/mcfs.c
---- mc-4.6.1.orig/vfs/mcfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/mcfs.c	2007-01-19 18:33:58.000000000 +0500
-@@ -1037,7 +1037,7 @@
-     return 0;
- }
- 
--static int
-+static off_t
- mcfs_lseek (void *data, off_t offset, int whence)
- {
-     mcfs_handle *info = (mcfs_handle *) data;
-diff -urN mc-4.6.1.orig/vfs/smbfs.c mc-4.6.1/vfs/smbfs.c
---- mc-4.6.1.orig/vfs/smbfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/smbfs.c	2007-01-19 18:33:58.000000000 +0500
-@@ -283,7 +283,7 @@
- static int
- smbfs_init (struct vfs_class * me)
- {
--    const char *servicesf = CONFIGDIR PATH_SEP_STR "smb.conf";
-+    const char *servicesf = CONFIGDIR PATH_SEP_STR "samba/smb.conf";
- 
-     /*  DEBUGLEVEL = 4; */
- 
-@@ -1585,7 +1585,7 @@
- 
- #define smbfs_lstat smbfs_stat	/* no symlinks on smb filesystem? */
- 
--static int
-+static off_t
- smbfs_lseek (void *data, off_t offset, int whence)
- {
-     smbfs_handle *info = (smbfs_handle *) data;
-diff -urN mc-4.6.1.orig/vfs/tar.c mc-4.6.1/vfs/tar.c
---- mc-4.6.1.orig/vfs/tar.c	2005-07-23 22:52:04.000000000 +0600
-+++ mc-4.6.1/vfs/tar.c	2007-01-19 18:33:58.000000000 +0500
-@@ -194,7 +194,7 @@
- }
- 
- /* As we open one archive at a time, it is safe to have this static */
--static int current_tar_position = 0;
-+static off_t current_tar_position = 0;
- 
- /* Returns fd of the open tar file */
- static int
-@@ -461,7 +461,7 @@
- 	struct stat st;
- 	struct vfs_s_entry *entry;
- 	struct vfs_s_inode *inode, *parent;
--	long data_position;
-+	off_t data_position;
- 	char *q;
- 	int len;
- 	char *current_file_name, *current_link_name;
-@@ -646,8 +646,9 @@
-     int fd = FH_SUPER->u.arch.fd;
-     struct vfs_class *me = FH_SUPER->me;
- 
--    if (mc_lseek (fd, begin + FH->pos, SEEK_SET) != 
--        begin + FH->pos) ERRNOR (EIO, -1);
-+
-+    off_t o = mc_lseek(fd, begin + FH->pos, SEEK_SET);
-+    if ( o != begin + FH->pos) ERRNOR (EIO, -1);
- 
-     count = MIN(count, FH->ino->st.st_size - FH->pos);
- 
-diff -urN mc-4.6.1.orig/vfs/undelfs.c mc-4.6.1/vfs/undelfs.c
---- mc-4.6.1.orig/vfs/undelfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/undelfs.c	2007-01-19 18:33:58.000000000 +0500
-@@ -645,7 +645,7 @@
- }
- 
- /* this has to stay here for now: vfs layer does not know how to emulate it */
--static int
-+static off_t
- undelfs_lseek(void *vfs_info, off_t offset, int whence)
- {
-     return -1;
-diff -urN mc-4.6.1.orig/vfs/vfs.c mc-4.6.1/vfs/vfs.c
---- mc-4.6.1.orig/vfs/vfs.c	2005-05-27 20:19:19.000000000 +0600
-+++ mc-4.6.1/vfs/vfs.c	2007-01-19 18:33:59.000000000 +0500
-@@ -49,6 +49,11 @@
- #include "smbfs.h"
- #include "local.h"
- 
-+#include "../src/panel.h"
-+#ifdef HAVE_CHARSET
-+#include "../src/recode.h"
-+#endif
-+
- /* They keep track of the current directory */
- static struct vfs_class *current_vfs;
- static char *current_dir;
-@@ -623,14 +628,14 @@
- off_t mc_lseek (int fd, off_t offset, int whence)
- {
-     struct vfs_class *vfs;
--    int result;
-+    off_t result;
- 
-     if (fd == -1)
- 	return -1;
- 
-     vfs = vfs_op (fd);
-     result = vfs->lseek ? (*vfs->lseek)(vfs_info (fd), offset, whence) : -1;
--    if (result == -1)
-+    if (result == (off_t)-1)
-         errno = vfs->lseek ? ferrno (vfs) : E_NOTSUPP;
-     return result;
- }
-@@ -681,8 +686,66 @@
-     vfsid old_vfsid;
-     int result;
- 
-+#ifdef HAVE_CHARSET
-+    char* errmsg;
-+#endif
-+    WPanel* p=ret_panel;
-+
-     new_dir = vfs_canon (path);
-     new_vfs = vfs_get_class (new_dir);
-+    old_vfsid = vfs_getid (current_vfs, current_dir);
-+    old_vfs = current_vfs;
-+
-+    if(p) {
-+
-+      // Change from localfs to ftpfs
-+      ret_panel=NULL;
-+      if(    (strcmp(old_vfs->name,"localfs")==0) &&
-+            (strcmp(new_vfs->name,"ftpfs")==0)){
-+        p->is_return=1;
-+        strncpy(p->retdir,current_dir, MC_MAXPATHLEN);
-+#ifdef HAVE_CHARSET
-+       p->ret_codepage=p->src_codepage;
-+        p->src_codepage=ftp_codepage;
-+        errmsg=my_init_tt(display_codepage,p->src_codepage,p->tr_table);
-+        if(errmsg) {
-+          panel_reset_codepage(p);
-+          message( 1, MSG_ERROR, "%s", errmsg );
-+        }
-+        errmsg=my_init_tt(p->src_codepage,display_codepage,p->tr_table_input);
-+       if(errmsg) {
-+          panel_reset_codepage(p);
-+          message( 1, MSG_ERROR, "%s", errmsg );
-+        }
-+#endif
-+      }
-+
-+      // Change from ftpfs to localfs
-+      if(    (strcmp(old_vfs->name,"ftpfs")==0) &&
-+            (strcmp(new_vfs->name,"localfs")==0) &&
-+             p->is_return){
-+        p->is_return=0;
-+       g_free(new_dir);
-+       new_dir = vfs_canon (p->retdir);
-+        new_vfs = vfs_get_class (new_dir);
-+#ifdef HAVE_CHARSET
-+        p->src_codepage=p->ret_codepage;
-+        errmsg=my_init_tt(display_codepage,p->src_codepage,p->tr_table);
-+        if(errmsg) {
-+          panel_reset_codepage(p);
-+          message( 1, MSG_ERROR, "%s", errmsg );
-+        }
-+        errmsg=my_init_tt(p->src_codepage,display_codepage,p->tr_table_input);
-+        if(errmsg) {
-+          panel_reset_codepage(p);
-+          message( 1, MSG_ERROR, "%s", errmsg );
-+        }
-+#endif
-+      }
-+    }
-+
-+
-+
-     if (!new_vfs->chdir) {
-     	g_free (new_dir);
- 	return -1;
-@@ -696,9 +759,6 @@
- 	return -1;
-     }
- 
--    old_vfsid = vfs_getid (current_vfs, current_dir);
--    old_vfs = current_vfs;
--
-     /* Actually change directory */
-     g_free (current_dir);
-     current_dir = new_dir;
-diff -urN mc-4.6.1.orig/vfs/vfs-impl.h mc-4.6.1/vfs/vfs-impl.h
---- mc-4.6.1.orig/vfs/vfs-impl.h	2004-09-02 19:57:59.000000000 +0600
-+++ mc-4.6.1/vfs/vfs-impl.h	2007-01-19 18:33:58.000000000 +0500
-@@ -53,7 +53,7 @@
-     int (*rename) (struct vfs_class *me, const char *p1, const char *p2);
-     int (*chdir) (struct vfs_class *me, const char *path);
-     int (*ferrno) (struct vfs_class *me);
--    int (*lseek) (void *vfs_info, off_t offset, int whence);
-+    off_t (*lseek) (void *vfs_info, off_t offset, int whence);
-     int (*mknod) (struct vfs_class *me, const char *path, int mode, int dev);
- 
-     vfsid (*getid) (struct vfs_class *me, const char *path);
-diff -urN mc-4.6.1.orig/vfs/xdirentry.h mc-4.6.1/vfs/xdirentry.h
---- mc-4.6.1.orig/vfs/xdirentry.h	2004-10-07 00:04:15.000000000 +0600
-+++ mc-4.6.1/vfs/xdirentry.h	2007-01-19 18:33:58.000000000 +0500
-@@ -90,7 +90,7 @@
-     char *linkname;		/* Symlink's contents */
-     char *localname;		/* Filename of local file, if we have one */
-     struct timeval timestamp;	/* Subclass specific */
--    long data_offset;		/* Subclass specific */
-+    off_t data_offset;		/* Subclass specific */
- };
- 
- /* Data associated with an open file */
diff --git a/pkgs/tools/misc/mktorrent/default.nix b/pkgs/tools/misc/mktorrent/default.nix
new file mode 100644
index 00000000000..713d6dc70b8
--- /dev/null
+++ b/pkgs/tools/misc/mktorrent/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, openssl}:
+
+stdenv.mkDerivation {
+  name = "mktorrent-1.0.0";
+
+  src = fetchurl {
+    url = mirror://sourceforge/mktorrent/mktorrent-1.0.tar.gz;
+    sha256 = "17qi3nfky240pq6qcmf5qg324mxm83vk9r3nvsdhsvinyqm5d3kg";
+  };
+
+  makeFlags = "CFLAGS=-lgcc_s USE_PTHREADS=1 USE_OPENSSL=1 USE_LONG_OPTIONS=1" +
+    stdenv.lib.optionalString stdenv.isi686 " USE_LARGE_FILES=1";
+
+  preInstall = ''
+    installFlags=PREFIX=$out
+  '';
+
+  buildInputs = [ openssl ];
+
+  meta = {
+    homepage = http://mktorrent.sourceforge.net/;
+    license = "GPLv2+";
+    description = "Command line utility to create BitTorrent metainfo files";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/tools/misc/mmv/default.nix b/pkgs/tools/misc/mmv/default.nix
new file mode 100644
index 00000000000..e6e7eb505bf
--- /dev/null
+++ b/pkgs/tools/misc/mmv/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "mmv-${version}";
+  version = "1.01b";
+
+  src = fetchurl {
+    url = "http://ftp.debian.org/debian/pool/main/m/mmv/mmv_${version}.orig.tar.gz";
+    sha256 = "0399c027ea1e51fd607266c1e33573866d4db89f64a74be8b4a1d2d1ff1fdeef";
+  };
+
+  patches = [
+    # Use Debian patched version, as upstream is no longer maintained and it
+    # contains a _lot_ of fixes.
+    (fetchurl {
+      url = "http://ftp.debian.org/debian/pool/main/m/mmv/mmv_${version}-15.diff.gz";
+      sha256 = "9ad3e3d47510f816b4a18bae04ea75913588eec92248182f85dd09bc5ad2df13";
+    })
+  ];
+
+  postPatch = ''
+    sed -i \
+      -e 's/^\s*LDFLAGS\s*=\s*-s\s*-N/LDFLAGS = -s/' \
+      -e "s|/usr/bin|$out/bin|" \
+      -e "s|/usr/man|$out/share/man|" \
+      Makefile
+  '';
+
+  preInstall = ''
+    mkdir -p "$out/bin" "$out/share/man/man1"
+  '';
+
+  postInstall = ''
+    for variant in mcp mad mln
+    do
+      ln -s mmv "$out/bin/$variant"
+      ln -s mmv.1 "$out/share/man/man1/$variant.1"
+    done
+  '';
+
+  meta = {
+    homepage = "http://linux.maruhn.com/sec/mmv.html";
+    description = "Utility for wildcard renaming, copying, etc";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/tools/misc/multitail/default.nix b/pkgs/tools/misc/multitail/default.nix
new file mode 100644
index 00000000000..19bebcf2823
--- /dev/null
+++ b/pkgs/tools/misc/multitail/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation {
+  name = "multitail-5.2.12";
+
+  src = fetchurl {
+    url = http://www.vanheusden.com/multitail/multitail-5.2.12.tgz;
+    sha256 = "681d87cd49e11aab1d82ad7818ee639c88a3d305db8accf0859977beda6c493c";
+  };
+
+  buildInputs = [ ncurses ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp multitail $out/bin
+  '';
+
+  meta = {
+    homepage = http://www.vanheusden.com/multitail/;
+    description = "tail on Steroids";
+  };
+}
diff --git a/pkgs/tools/misc/ncdu/default.nix b/pkgs/tools/misc/ncdu/default.nix
index 944b6ea77e1..2d3a67db8c5 100644
--- a/pkgs/tools/misc/ncdu/default.nix
+++ b/pkgs/tools/misc/ncdu/default.nix
@@ -15,5 +15,6 @@ stdenv.mkDerivation rec {
     description = "An ncurses disk usage analyzer.";
     homepage = http://dev.yorhel.nl/ncdu;
     license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/tools/misc/parallel/default.nix b/pkgs/tools/misc/parallel/default.nix
index 235cb70cd86..ead17461750 100644
--- a/pkgs/tools/misc/parallel/default.nix
+++ b/pkgs/tools/misc/parallel/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, perl }:
 
 stdenv.mkDerivation rec {
-  name = "parallel-20120322";
+  name = "parallel-20130422";
 
   src = fetchurl {
     url = "mirror://gnu/parallel/${name}.tar.bz2";
-    sha256 = "1nm3ljgaxh2rg2dfwpw9r31zs7k09ab9i14yvbm4wrqasa2bcrxj";
+    sha256 = "0aygc6d2sf2xrnyldv62a17masfs5am4zfm68k4fhvymwcfbp41h";
   };
 
   patchPhase =
diff --git a/pkgs/tools/misc/parcellite/default.nix b/pkgs/tools/misc/parcellite/default.nix
new file mode 100644
index 00000000000..04ff98b5e7b
--- /dev/null
+++ b/pkgs/tools/misc/parcellite/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+
+stdenv.mkDerivation rec {
+  name = "parcellite-1.1.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/parcellite/${name}.tar.gz";
+    sha256 = "10lr2gx81i7nlxvafa9j9hnlj402k1szyi08xsl841hs1m9zdwan";
+  };
+
+  buildInputs = [ pkgconfig intltool gtk2 ];
+
+  meta = {
+    description = "Lightweight GTK+ clipboard manager";
+    homepage = "http://parcellite.sourceforge.net";
+    license = "GPLv3+";
+  };
+}
diff --git a/pkgs/tools/misc/parted/2.3.nix b/pkgs/tools/misc/parted/2.3.nix
deleted file mode 100644
index 649def69115..00000000000
--- a/pkgs/tools/misc/parted/2.3.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline
-, utillinux, enableStatic ? false, hurd ? null }:
-
-stdenv.mkDerivation rec {
-  name = "parted-2.3";
-
-  src = fetchurl {
-    url = "mirror://gnu/parted/${name}.tar.xz";
-    sha256 = "0sabj81nawcjm8ww34lxg65ka8crv3w2ab4crh8ypw5agg681836";
-  };
-
-  buildInputs = [ libuuid ]
-    ++ stdenv.lib.optional (readline != null) readline
-    ++ stdenv.lib.optional (gettext != null) gettext
-    ++ stdenv.lib.optional (devicemapper != null) devicemapper
-    ++ stdenv.lib.optional (hurd != null) hurd;
-
-  configureFlags =
-       (if (readline != null)
-        then [ "--with-readline" ]
-        else [ "--without-readline" ])
-    ++ stdenv.lib.optional (devicemapper == null) "--disable-device-mapper"
-    ++ stdenv.lib.optional enableStatic "--enable-static";
-
-  doCheck = true;
-
-  preCheck =
-    stdenv.lib.optionalString doCheck
-      # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
-      "export PATH=\"${utillinux}/sbin:$PATH\"";
-
-  meta = {
-    description = "GNU Parted, a tool to create, destroy, resize, check, and copy partitions";
-
-    longDescription = ''
-      GNU Parted is an industrial-strength package for creating, destroying,
-      resizing, checking and copying partitions, and the file systems on
-      them.  This is useful for creating space for new operating systems,
-      reorganising disk usage, copying data on hard disks and disk imaging.
-
-      It contains a library, libparted, and a command-line frontend, parted,
-      which also serves as a sample implementation and script backend.
-    '';
-
-    homepage = http://www.gnu.org/software/parted/;
-    license = "GPLv3+";
-
-    maintainers = [
-      # Add your name here!
-      stdenv.lib.maintainers.ludo
-    ];
-
-    # GNU Parted requires libuuid, which is part of util-linux-ng.
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/tools/misc/partition-manager/default.nix b/pkgs/tools/misc/partition-manager/default.nix
index 46be78965fb..19a0df26169 100644
--- a/pkgs/tools/misc/partition-manager/default.nix
+++ b/pkgs/tools/misc/partition-manager/default.nix
@@ -1,16 +1,21 @@
-{ stdenv, fetchurl, cmake, gettext, parted, libuuid, qt4, kdelibs, kde_baseapps,
-  automoc4, phonon, perl }:
+{ stdenv, fetchurl, pkgconfig, cmake, gettext, automoc4, perl
+, parted, libuuid, qt4, kdelibs, kde_baseapps, phonon, libatasmart
+}:
 
-stdenv.mkDerivation {
-  name = "partitionmanager-1.0.0";
+stdenv.mkDerivation rec {
+  name = "partitionmanager-1.0.3_p20120804";
 
   src = fetchurl {
-    url = http://www.kde-apps.org/CONTENT/content-files/89595-partitionmanager-1.0.0.tar.bz2;
-    sha256 = "03ibn4vns7pa0ygkp2jh6zcdy106as5cc7p6rv1f5c15wxx0zsk1";
+    #url = "mirror://sourceforge/partitionman/${name}.tar.bz2";
+    # the upstream version is old and doesn't build
+    url = "http://dev.gentoo.org/~kensington/distfiles/${name}.tar.bz2";
+    sha256 = "1j6zpgj8xs98alzxvcibwch9yj8jsx0s7y864gbdx280jmj8c1np";
   };
 
-  buildInputs =
-    [ cmake gettext parted libuuid qt4 kdelibs kde_baseapps automoc4 perl phonon ];
+  buildInputs = [
+    pkgconfig cmake gettext automoc4 perl
+    parted libuuid qt4 kdelibs kde_baseapps phonon libatasmart
+  ];
 
   preConfigure = ''
     export VERBOSE=1
@@ -19,13 +24,13 @@ stdenv.mkDerivation {
 
   postInstall = ''
     set -x
-    rpath=`patchelf --print-rpath $out/bin/partitionmanager-bin`:${qt4}/lib 
+    rpath=`patchelf --print-rpath $out/bin/partitionmanager-bin`:${qt4}/lib
     for p in $out/bin/partitionmanager-bin; do
       patchelf --set-rpath $rpath $p
     done
   '';
 
-  meta = { 
+  meta = {
     description = "Utility program to help you manage the disk devices";
     homepage = http://www.kde-apps.org/content/show.php/KDE+Partition+Manager?content=89595; # ?
     license = "GPL";
diff --git a/pkgs/tools/misc/picocom/default.nix b/pkgs/tools/misc/picocom/default.nix
new file mode 100644
index 00000000000..bb08091ad57
--- /dev/null
+++ b/pkgs/tools/misc/picocom/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "picocom-1.7";
+
+  src = fetchurl {
+    url = "http://picocom.googlecode.com/files/${name}.tar.gz";
+    sha256 = "17hjq713naq02xar711aw24qqd52p591mj1h5n97cni1ga7irwyh";
+  };
+
+  installPhase = ''
+    ensureDir $out/bin $out/share/man/man8
+    cp picocom $out/bin
+    cp picocom.8 $out/share/man/man8
+  '';
+
+  meta = {
+    description = "Minimal dumb-terminal emulation program";
+    homepage = http://code.google.com/p/picocom/;
+    license = "GPLv2+";
+    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+  };
+}
diff --git a/pkgs/tools/misc/plowshare/default.nix b/pkgs/tools/misc/plowshare/default.nix
new file mode 100644
index 00000000000..199e709f16a
--- /dev/null
+++ b/pkgs/tools/misc/plowshare/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, makeWrapper, curl }:
+
+stdenv.mkDerivation rec {
+
+  name = "plowshare4-${version}";
+
+  version = "20121126.47e4480";
+
+  src = fetchurl {
+    url = "http://plowshare.googlecode.com/files/plowshare4-snapshot-git${version}.tar.gz";
+    sha256 = "1p7bqqfbgcy41hiickgr8cilspyvrrql12rdmfasz0dmgf7nx1x6";
+  };
+
+  buildInputs = [ makeWrapper ];
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
+
+  installPhase = ''
+    make PREFIX="$out" install
+
+    for fn in plow{del,down,list,up}; do
+      wrapProgram "$out/bin/$fn" --prefix PATH : "${curl}/bin"
+    done
+  '';
+
+  meta = {
+    description = ''
+      A command-line download/upload tool for popular file sharing websites
+    '';
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = [ stdenv.lib.maintainers.aforemny ];
+  };
+}
diff --git a/pkgs/tools/misc/recutils/default.nix b/pkgs/tools/misc/recutils/default.nix
index 8e159f48b63..739fe8b801c 100644
--- a/pkgs/tools/misc/recutils/default.nix
+++ b/pkgs/tools/misc/recutils/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1v2xzwwwhc5j5kmvg4sv6baxjpsfqh8ln7ilv4mgb1408rs7xmky";
   };
 
+  patches = [ ./glibc.patch ];
+
   doCheck = true;
 
   buildInputs = [ curl emacs ] ++ (stdenv.lib.optionals doCheck [ check bc ]);
diff --git a/pkgs/tools/misc/recutils/glibc.patch b/pkgs/tools/misc/recutils/glibc.patch
new file mode 100644
index 00000000000..8b4997f099d
--- /dev/null
+++ b/pkgs/tools/misc/recutils/glibc.patch
@@ -0,0 +1,29 @@
+--- recutils-1.5/lib/stdio.in.h
++++ recutils-1.5/lib/stdio.in.h
+@@ -699,22 +699,11 @@
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
diff --git a/pkgs/tools/misc/refind/default.nix b/pkgs/tools/misc/refind/default.nix
index bd0a7040adf..1fbb177afa0 100644
--- a/pkgs/tools/misc/refind/default.nix
+++ b/pkgs/tools/misc/refind/default.nix
@@ -1,22 +1,22 @@
 { stdenv, fetchurl, gnu_efi, unzip }:
 
-let version = "0.2.3"; in
+let version = "0.4.5"; in
 
 stdenv.mkDerivation {
   name = "refind-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/refind/refind-src-${version}.zip";
-    sha256 = "0q3p4mczr6wchk4vbgsb0cq7829vk3b3kg9qaizrb02pdak3s2nf";
+    sha256 = "05nbalsl5csgph0v2amzgay9k2vzm47z8n1n6blbh9hvb7j5vn2c";
   };
 
   buildInputs = [ unzip ];
 
-  buildFlags = [ "prefix=" "EFIINC=${gnu_efi}/include/efi" "GNUEFILIB=${gnu_efi}/lib" "EFILIB=${gnu_efi}/lib" "EFICRT0=${gnu_efi}/lib" ];
+  buildFlags = [ "prefix=" "EFIINC=${gnu_efi}/include/efi" "GNUEFILIB=${gnu_efi}/lib" "EFILIB=${gnu_efi}/lib" "EFICRT0=${gnu_efi}/lib" "LOCAL_CFLAGS=-I${gnu_efi}/include" ];
 
   installPhase = ''
     mkdir -pv $out
-    install -v -m644 refind/refind.efi refind.conf-sample $out
+    install -v -m644 refind/refind*.efi refind.conf-sample $out
     mv -v icons $out
   '';
 
diff --git a/pkgs/tools/misc/renameutils/default.nix b/pkgs/tools/misc/renameutils/default.nix
new file mode 100644
index 00000000000..6d4793a4aab
--- /dev/null
+++ b/pkgs/tools/misc/renameutils/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, readline}:
+
+stdenv.mkDerivation {
+  name = "renameutils-0.12";
+
+  src = fetchurl {
+    url = mirror://savannah/renameutils/renameutils-0.12.0.tar.gz;
+    sha256 = "18xlkr56jdyajjihcmfqlyyanzyiqqlzbhrm6695mkvw081g1lnb";
+  };
+
+  patches = [ ./install-exec.patch ];
+
+  nativeBuildInputs = [ readline ];
+
+  meta = {
+    homepage = http://www.nongnu.org/renameutils/;
+    description = "A set of programs to make renaming of files faster";
+  };
+}
diff --git a/pkgs/tools/misc/renameutils/install-exec.patch b/pkgs/tools/misc/renameutils/install-exec.patch
new file mode 100644
index 00000000000..32b8de5adb8
--- /dev/null
+++ b/pkgs/tools/misc/renameutils/install-exec.patch
@@ -0,0 +1,24 @@
+diff -Naur renameutils-0.12.0-orig/src/Makefile.am renameutils-0.12.0/src/Makefile.am
+--- renameutils-0.12.0-orig/src/Makefile.am	2012-04-23 12:10:43.000000000 +0100
++++ renameutils-0.12.0/src/Makefile.am	2013-03-25 11:13:21.605447377 +0000
+@@ -49,7 +49,7 @@
+ 	@[ -f icp ] || (echo $(LN_S) icmd icp ; $(LN_S) icmd icp)
+ 
+ install-exec-local:
+-	$(mkdir_p) $(DESTDIR)($bindir)
++	$(mkdir_p) $(DESTDIR)$(bindir)
+ 	@[ -f $(DESTDIR)$(bindir)/qmv ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv)
+ 	@[ -f $(DESTDIR)$(bindir)/qcp ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp)
+ 	@[ -f $(DESTDIR)$(bindir)/imv ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/imv ; $(LN_S) icmd $(DESTDIR)$(bindir)/imv)
+diff -Naur renameutils-0.12.0-orig/src/Makefile.in renameutils-0.12.0/src/Makefile.in
+--- renameutils-0.12.0-orig/src/Makefile.in	2012-04-23 12:24:10.000000000 +0100
++++ renameutils-0.12.0/src/Makefile.in	2013-03-25 11:13:40.549847891 +0000
+@@ -1577,7 +1577,7 @@
+ 	@[ -f icp ] || (echo $(LN_S) icmd icp ; $(LN_S) icmd icp)
+ 
+ install-exec-local:
+-	$(mkdir_p) $(DESTDIR)($bindir)
++	$(mkdir_p) $(DESTDIR)$(bindir)
+ 	@[ -f $(DESTDIR)$(bindir)/qmv ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qmv)
+ 	@[ -f $(DESTDIR)$(bindir)/qcp ] || (echo $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp ; $(LN_S) qcmd $(DESTDIR)$(bindir)/qcp)
+ 	@[ -f $(DESTDIR)$(bindir)/imv ] || (echo $(LN_S) icmd $(DESTDIR)$(bindir)/imv ; $(LN_S) icmd $(DESTDIR)$(bindir)/imv)
diff --git a/pkgs/tools/misc/screen/default.nix b/pkgs/tools/misc/screen/default.nix
index 329754ab5f5..2a3f53d6741 100644
--- a/pkgs/tools/misc/screen/default.nix
+++ b/pkgs/tools/misc/screen/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ncurses}:
+{ stdenv, fetchurl, ncurses, pam }:
 
 stdenv.mkDerivation rec {
   name = "screen-4.0.3";
@@ -8,12 +8,15 @@ stdenv.mkDerivation rec {
     sha256 = "0xvckv1ia5pjxk7fs4za6gz2njwmfd54sc464n8ab13096qxbw3q";
   };
 
+  patches = [ ./screen-4.0.3-caption-colors.patch
+              ./screen-4.0.3-long-term.patch ];
+
   preConfigure = ''
-    configureFlags="--enable-telnet --infodir=$out/share/info --mandir=$out/share/man"
+    configureFlags="--enable-telnet --enable-pam --infodir=$out/share/info --mandir=$out/share/man --with-sys-screenrc=/etc/screenrc"
     sed -i -e "s|/usr/local|/non-existent|g" -e "s|/usr|/non-existent|g" configure Makefile.in */Makefile.in
   '';
 
-  buildInputs = [ ncurses ];
+  buildInputs = [ ncurses pam ];
 
   doCheck = true;
 
diff --git a/pkgs/tools/misc/screen/screen-4.0.3-caption-colors.patch b/pkgs/tools/misc/screen/screen-4.0.3-caption-colors.patch
new file mode 100644
index 00000000000..14365dc81c1
--- /dev/null
+++ b/pkgs/tools/misc/screen/screen-4.0.3-caption-colors.patch
@@ -0,0 +1,25 @@
+# Source:
+# https://projects.archlinux.org/svntogit/packages.git/plain/screen/trunk/screen-4.0.3-caption-colors.patch
+# modified by hand for nixpkgs
+
+From e6a28cf8bfdac15faa6c267bf476ddcaddf48d67 Mon Sep 17 00:00:00 2001
+From: Sadrul Habib Chowdhury <sadrul@users.sourceforge.net>
+Date: Tue, 26 Jan 2010 20:17:26 +0000
+Subject: Accommodate more color changes in the caption.
+
+---
+diff --git a/src/screen.c b/src/screen.c
+index b1c3dfb..2cceae0 100644
+--- a/screen.c
++++ b/screen.c
+@@ -2204,7 +2204,7 @@ static const char months[] = "JanFebMarAprMayJunJulAugSepOctNovDec";
+ #endif
+ 
+ static char winmsg_buf[MAXSTR];
+-#define MAX_WINMSG_REND 16	/* rendition changes */
++#define MAX_WINMSG_REND 256	/* rendition changes */
+ static int winmsg_rend[MAX_WINMSG_REND];
+ static int winmsg_rendpos[MAX_WINMSG_REND];
+ static int winmsg_numrend;
+--
+cgit v0.8.3.4
diff --git a/pkgs/tools/misc/screen/screen-4.0.3-long-term.patch b/pkgs/tools/misc/screen/screen-4.0.3-long-term.patch
new file mode 100644
index 00000000000..f94f9da8ac4
--- /dev/null
+++ b/pkgs/tools/misc/screen/screen-4.0.3-long-term.patch
@@ -0,0 +1,29 @@
+# Source:
+# https://projects.archlinux.org/svntogit/packages.git/plain/screen/trunk/screen-4.0.3-long-term.patch
+
+# This fixes long terminal names handling, e.g. TERM=rxvt-unicode-256colors works
+# as expected.
+diff -Naur screen-4.0.3-orig//display.h screen-4.0.3/display.h
+--- screen-4.0.3-orig//display.h	2003-07-02 00:01:42.000000000 +1000
++++ screen-4.0.3/display.h	2010-12-03 20:19:23.826671689 +1000
+@@ -85,7 +85,7 @@
+   struct win *d_other;		/* pointer to other window */
+   int   d_nonblock;		/* -1 don't block if obufmax reached */
+ 				/* >0: block after nonblock secs */
+-  char  d_termname[20 + 1];	/* $TERM */
++  char  d_termname[40 + 1];	/* $TERM */
+   char	*d_tentry;		/* buffer for tgetstr */
+   char	d_tcinited;		/* termcap inited flag */
+   int	d_width, d_height;	/* width/height of the screen */
+diff -Naur screen-4.0.3-orig//screen.h screen-4.0.3/screen.h
+--- screen-4.0.3-orig//screen.h	2003-08-22 22:28:43.000000000 +1000
++++ screen-4.0.3/screen.h	2010-12-03 20:19:43.163338333 +1000
+@@ -202,7 +202,7 @@
+ 	  char preselect[20];
+ 	  int esc;		/* his new escape character unless -1 */
+ 	  int meta_esc;		/* his new meta esc character unless -1 */
+-	  char envterm[20 + 1];	/* terminal type */
++	  char envterm[40 + 1];	/* terminal type */
+ 	  int encoding;		/* encoding of display */
+ 	}
+       attach;
diff --git a/pkgs/tools/misc/sl/default.nix b/pkgs/tools/misc/sl/default.nix
new file mode 100644
index 00000000000..14cc6c4260f
--- /dev/null
+++ b/pkgs/tools/misc/sl/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation {
+  name = "sl-3.03";
+
+  src = fetchurl {
+    url = "http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/sl/sl.tar";
+    sha256 = "1x3517aza0wm9hhb02npl8s7xy947cdidxmans27q0gjmj3bvg5j";
+  };
+
+  patchPhase = ''
+    sed -i "s/-lcurses -ltermcap/-lncurses/" Makefile
+  '';
+
+  buildInputs = [ ncurses ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp sl $out/bin
+  '';
+
+  meta = {
+    homepage = http://www.tkl.iis.u-tokyo.ac.jp/~toyoda/index_e.html;
+    license = "unfree"; # I couldn't find its license, only a copyright.
+    description = "Steam Locomotive runs across your terminal when you type 'sl'";
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/misc/system-config-printer/default.nix b/pkgs/tools/misc/system-config-printer/default.nix
index 8923637bbdb..b0da497c322 100644
--- a/pkgs/tools/misc/system-config-printer/default.nix
+++ b/pkgs/tools/misc/system-config-printer/default.nix
@@ -1,29 +1,34 @@
 { stdenv, fetchurl, udev, intltool, pkgconfig, glib, xmlto
 , makeWrapper, pygobject, pygtk, docbook_xml_dtd_412, docbook_xsl
-, pythonDBus, libxml2, desktop_file_utils, libusb, cups, pycups
+, pythonDBus, libxml2, desktop_file_utils, libusb1, cups, pycups
 , pythonPackages
 , withGUI ? true
 }:
 
 stdenv.mkDerivation rec {
-  name = "${meta.name}-${meta.version}";
+  name = "system-config-printer-1.3.12";
 
   src = fetchurl {
-    url = "http://cyberelk.net/tim/data/${meta.name}/1.3/${name}.tar.xz";
-    sha256 = "1d50rqgpyrzyrxwq3qhafzq9075qm2wxdrh1f1q7whlr0chxi3mw";
+    url = "http://cyberelk.net/tim/data/system-config-printer/1.3/${name}.tar.xz";
+    sha256 = "1cg9n75rg5l9vr1925n2g771kga33imikyl0mf70lww2sfgvs18r";
   };
 
+  propagatedBuildInputs = [ pythonPackages.pycurl ];
+
   buildInputs =
-    [ intltool pkgconfig glib udev libusb cups xmlto
+    [ intltool pkgconfig glib udev libusb1 cups xmlto
       libxml2 docbook_xml_dtd_412 docbook_xsl desktop_file_utils
       pythonPackages.python pythonPackages.wrapPython
     ];
 
   pythonPath =
-    [ pythonDBus pycups pygobject ]
+    [ pythonDBus pycups pygobject pythonPackages.pycurl ]
     ++ stdenv.lib.optionals withGUI [ pygtk pythonPackages.notify ];
-    
-  configureFlags = "--with-udev-rules";
+
+  configureFlags =
+    [ "--with-udev-rules"
+      "--with-systemdsystemunitdir=$(out)/etc/systemd/systemd"
+    ];
 
   postInstall =
     ''
@@ -34,7 +39,6 @@ stdenv.mkDerivation rec {
     '';
 
   meta = {
-    name = "system-config-printer";
-    version = "1.3.4";
+    homepage = http://cyberelk.net/tim/software/system-config-printer/;
   };
 }
diff --git a/pkgs/tools/misc/testdisk/default.nix b/pkgs/tools/misc/testdisk/default.nix
index fd9f4578294..6ccfea50482 100644
--- a/pkgs/tools/misc/testdisk/default.nix
+++ b/pkgs/tools/misc/testdisk/default.nix
@@ -1,18 +1,18 @@
-{stdenv, fetchurl, ncurses, libjpeg, e2fsprogs, zlib, openssl}:
+{stdenv, fetchurl, ncurses, libjpeg, e2fsprogs, zlib, openssl, libuuid}:
 
 stdenv.mkDerivation {
-  name = "testdisk-6.8";
+  name = "testdisk-6.13";
   
   src = fetchurl {
-    url = http://www.cgsecurity.org/testdisk-6.8.tar.bz2;
-    sha256 = "0cyqikcyi6zj671kkr8vydqskh2r7f3n1v3xks1vh1biaffqq2ir";
+    url = http://www.cgsecurity.org/testdisk-6.13.tar.bz2;
+    sha256 = "087jrn41z3ymf1b6njl2bg99pr79v8l1f63f7rn5ni69vz6mq9s8";
   };
 
-  buildInputs = [ncurses libjpeg e2fsprogs zlib openssl];
+  buildInputs = [ncurses libjpeg e2fsprogs zlib openssl libuuid];
 
   meta = {
     homepage = http://www.cgsecurity.org/wiki/TestDisk;
-    license = "GPL";
+    license = "GPLv2+";
     longDescription = ''
       TestDisk is a program for data recovery, primarily designed to
       help recover lost partitions and/or make non-booting disks
diff --git a/pkgs/tools/misc/timidity/default.nix b/pkgs/tools/misc/timidity/default.nix
index 4fae21250ca..89ff6f4677f 100644
--- a/pkgs/tools/misc/timidity/default.nix
+++ b/pkgs/tools/misc/timidity/default.nix
@@ -7,7 +7,7 @@ composableDerivation.composableDerivation {} {
   name = "timidity-2.13.0";
 
   src = fetchurl {
-    url = http://ovh.dl.sourceforge.net/sourceforge/timidity/TiMidity++-2.13.0.tar.bz2;
+    url = mirror://sourceforge/timidity/TiMidity++-2.13.0.tar.bz2;
     sha256 = "1jbmk0m375fh5nj2awqzns7pdjbi7dxpjdwcix04zipfcilppbmf";
   };
 
diff --git a/pkgs/tools/misc/tmux/default.nix b/pkgs/tools/misc/tmux/default.nix
index 2e26fb7ddba..272656349f6 100644
--- a/pkgs/tools/misc/tmux/default.nix
+++ b/pkgs/tools/misc/tmux/default.nix
@@ -1,22 +1,16 @@
-{stdenv, fetchurl, ncurses, libevent}:
+{stdenv, fetchurl, ncurses, libevent, pkgconfig}:
 
 stdenv.mkDerivation rec {
   pname = "tmux";
-  version = "1.5";
+  version = "1.8";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-    sha256 = "eb8215b57c05b765d2446d9acb2bc5edcdb3eb4ea31af89ee127a27e90056306";
+    sha256 = "f265401ca890f8223e09149fcea5abcd6dfe75d597ab106e172b01e9d0c9cd44";
   };
 
-  makeFlags = "PREFIX=\${out}";
-
-  crossAttrs = {
-    preBuild = ''
-      makeFlags=" $makeFlags CC=${stdenv.cross.config}-gcc "
-    '';
-  };
+  nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ ncurses libevent ];
 
@@ -41,6 +35,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.bsd3;
 
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.thammers ];
+    maintainers = with stdenv.lib.maintainers; [ shlevy thammers ];
   };
 }
diff --git a/pkgs/tools/misc/ttf2pt1/default.nix b/pkgs/tools/misc/ttf2pt1/default.nix
index 379db7d533f..659b04a6238 100644
--- a/pkgs/tools/misc/ttf2pt1/default.nix
+++ b/pkgs/tools/misc/ttf2pt1/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   '';
 
   buildInputs = [ freetype ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
   
   patches = ./gentoo-makefile.patch; # also contains the freetype patch
 
diff --git a/pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix b/pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix
deleted file mode 100644
index 97a052db20d..00000000000
--- a/pkgs/tools/misc/ttf2pt1/ttf2pt1-cl-pdf.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{ttf2pt1, lib, fetchurl, unzip}:
-
-lib.overrideDerivation ttf2pt1 
-(x:
-{
-  name = "ttf2pt1-cl-pdf";
-  src = fetchurl {
-    url = "http://www.fractalconcept.com/fcweb/download/ttf2pt1-src.zip";
-    sha256 = "1w6kxgnrj3x67lf346bswmcqny9lmyhbnkp6kv99l6wfaq4gs82b";
-  };
-  buildInputs = x.buildInputs ++ [unzip];
-  sourceRoot = "ttf2pt1-cl-pdf";
-  preBuild = ''
-    chmod a+x scripts/*
-  '';
-  meta = x.meta // {
-    maintainers = [lib.maintainers.raskin];
-    platforms = lib.platforms.linux;
-  };
-})
diff --git a/pkgs/tools/misc/txt2man/default.nix b/pkgs/tools/misc/txt2man/default.nix
new file mode 100644
index 00000000000..3b7730347ac
--- /dev/null
+++ b/pkgs/tools/misc/txt2man/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "txt2man-1.5.6";
+
+  src = fetchurl {
+    url = "http://mvertes.free.fr/download/${name}.tar.gz";
+    sha256 = "0ammlb4pwc4ya1kc9791vjl830074zrpfcmzc18lkcqczp2jaj4q";
+  };
+
+  preConfigure = ''
+    makeFlags=prefix="$out"
+  '';
+
+  meta = { 
+    description = "Convert flat ASCII text to man page format";
+    homepage = http://mvertes.free.fr/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ bjornfor ];
+  };
+}
diff --git a/pkgs/tools/misc/usbmuxd/default.nix b/pkgs/tools/misc/usbmuxd/default.nix
index c4b41249355..b95dfde9850 100644
--- a/pkgs/tools/misc/usbmuxd/default.nix
+++ b/pkgs/tools/misc/usbmuxd/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "09swwr6x46qxmwylrylnyqh4pznr0swla9gijggwxxw8dw82r840";
   };
 
-  buildNativeInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkgconfig ];
   propagatedBuildInputs = [ libusb1 libplist ];
 
   patchPhase =
diff --git a/pkgs/tools/misc/wv2/default.nix b/pkgs/tools/misc/wv2/default.nix
index 7a30d011be2..a3938c1af4c 100644
--- a/pkgs/tools/misc/wv2/default.nix
+++ b/pkgs/tools/misc/wv2/default.nix
@@ -1,10 +1,19 @@
-{stdenv, fetchurl, pkgconfig, libgsf, glib, libxml2}:
+{ stdenv, fetchurl, pkgconfig, cmake, libgsf, glib, libxml2 }:
 
-stdenv.mkDerivation {
-  name = "wv2-0.3.1";
+stdenv.mkDerivation rec {
+  name = "wv2-0.4.2";
   src = fetchurl {
-    url = mirror://sourceforge/wvware/wv2-0.3.1.tar.bz2;
-    sha256 = "896ff8ec59e280e8cb1ef9a953b364845dd65de1cdf8e4ed8a7e045a3f81c546";
+    url = "mirror://sourceforge/wvware/${name}.tar.bz2";
+    sha256 = "1p1qxr8z5bsiq8pvlina3c8c1vjcb5d96bs3zz4jj3nb20wnsawz";
+  };
+
+  patches = [ ./fix-include.patch ];
+
+  buildInputs = [ pkgconfig cmake libgsf glib libxml2 ];
+
+  meta = {
+    description = "Excellent MS Word filter lib, used in most Office suites";
+    license = "LGPLv2";
+    homepage = http://wvware.sourceforge.net;
   };
-  buildInputs = [ pkgconfig libgsf glib libxml2 ];
 }
diff --git a/pkgs/tools/misc/wv2/fix-include.patch b/pkgs/tools/misc/wv2/fix-include.patch
new file mode 100644
index 00000000000..df34d24af94
--- /dev/null
+++ b/pkgs/tools/misc/wv2/fix-include.patch
@@ -0,0 +1,12 @@
+From: http://sourceforge.net/tracker/?func=detail&aid=3544851&group_id=10501&atid=110501
+--- a/src/olestream.h
++++ b/src/olestream.h
+@@ -23,7 +23,7 @@
+ #include "global.h"  // U8,... typedefs
+ #include <stack>
+ 
+-#include <glib/giochannel.h> // GSeekType
++#include <glib.h> // GSeekType
+ 
+ namespace wvWare {
+ 
diff --git a/pkgs/tools/misc/xburst-tools/default.nix b/pkgs/tools/misc/xburst-tools/default.nix
index 563406e430b..cc9f98a94f6 100644
--- a/pkgs/tools/misc/xburst-tools/default.nix
+++ b/pkgs/tools/misc/xburst-tools/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   # Not to strip cross build binaries (this is for the gcc-cross-wrapper)
   dontCrossStrip = true;
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb libusb1 autoconf automake confuse ] ++
     stdenv.lib.optional (gccCross != null) gccCross;
 
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index 0422383ed3b..54b3e6a4856 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -1,31 +1,34 @@
-{stdenv, fetchgit, python}:
+{ stdenv, fetchurl, python, pandoc, zip }:
 
-let pkgname = "youtube-dl";
-    pkgver  = "2011.12.08";
-    
+let
+  version = "2012.12.11";
 in
 stdenv.mkDerivation {
-  name = "${pkgname}-${pkgver}";
+  name = "youtube-dl-${version}";
 
-  src = fetchgit {
-    url = "git://github.com/rg3/${pkgname}";
-    rev = "661a807c65a154eccdddb875b45e4782ca86132c";
-    sha256 = "32fd193b867b122400e9d5d32f6dfaf15704f837a9dc2ff809e1ce06712857ba";
+  src = fetchurl {
+    url = "https://github.com/downloads/rg3/youtube-dl/youtube-dl.${version}.tar.gz";
+    sha256 = "03zv3z8p0fi122nqj7ff8hkgqscir4s7psm03rq7dfpg1z35klmn";
   };
 
-  buildInputs = [python];
-  buildPhase = "sed -i 's|#!/usr/bin/env python|#!#{python}/bin/python|' youtube-dl";
+  buildInputs = [ python ];
+  nativeBuildInputs = [ zip ] ++
+      stdenv.lib.optional (stdenv.isi686 || stdenv.isx86_64) pandoc;
 
-  installPhase = ''
-    ensureDir $out/bin
-    cp youtube-dl $out/bin
+  patchPhase = ''
+    rm youtube-dl
+    substituteInPlace Makefile --replace "#!/usr/bin/env python" "#!${python}/bin/python"
+  '';
+
+  configurePhase = ''
+    makeFlagsArray=( PREFIX=$out SYSCONFDIR=$out/etc )
   '';
 
   meta = {
-    description = "A small command-line program to download videos from YouTube.com and a few more sites";
-    homepage = http://rg3.github.com/youtube-dl/;
-    maintainers = [
-      stdenv.lib.maintainers.bluescreen303
-    ];
+    homepage = "http://rg3.github.com/youtube-dl/";
+    description = "Command-line tool to download videos from YouTube.com and other sites";
+
+    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    maintainers = with stdenv.lib.maintainers; [ bluescreen303 simons ];
   };
 }
diff --git a/pkgs/tools/networking/ahcpd/default.nix b/pkgs/tools/networking/ahcpd/default.nix
new file mode 100644
index 00000000000..635d94a3e86
--- /dev/null
+++ b/pkgs/tools/networking/ahcpd/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "ahcpd-0.53";
+
+  src = fetchurl {
+    url = "http://www.pps.univ-paris-diderot.fr/~jch/software/files/${name}.tar.gz";
+    sha256 = "0lhdmky3zdyk51hclv2lrhw3hzymbdc8bw2khs3rnaibgn0jwqm4";
+  };
+
+  preBuild = ''
+    makeFlags="PREFIX=$out ETCDIR=$out/etc"
+    sed -i -e s,etc,$out/etc, Makefile
+  '';
+
+  meta = {
+    homepage = "http://www.pps.univ-paris-diderot.fr/~jch/software/ahcp/";
+    description = "Autoconfiguration protocol for IPv6 and dual-stack IPv6/IPv4 networks";
+    license = "MIT";
+  };
+}
diff --git a/pkgs/tools/networking/aircrack-ng/default.nix b/pkgs/tools/networking/aircrack-ng/default.nix
index 9ecaf183f1f..1cc91f25660 100644
--- a/pkgs/tools/networking/aircrack-ng/default.nix
+++ b/pkgs/tools/networking/aircrack-ng/default.nix
@@ -1,15 +1,11 @@
-{stdenv, fetchsvn, libpcap, openssl, zlib, wirelesstools}:
+{stdenv, fetchurl, libpcap, openssl, zlib, wirelesstools}:
 
-let
-  rev = "2178";
-in
 stdenv.mkDerivation rec {
-  name = "aircrack-ng-1.1-${rev}";
+  name = "aircrack-ng-1.2-beta1";
 
-  src = fetchsvn {
-    url = "http://trac.aircrack-ng.org/svn/trunk";
-    inherit rev;
-    sha256 = "0rwj2nk4nyy0l9dg6rpg2h5gpvcygs5irj4i6fdcsr8xf0blq7yw";
+  src = fetchurl {
+    url = "http://download.aircrack-ng.org/${name}.tar.gz";
+    sha256 = "19cfib7sqp2rdm3lc84jrzsa6r8443gkm1ifbmhygsqn6fnkj8zi";
   };
 
   buildInputs = [libpcap openssl zlib];
@@ -19,9 +15,11 @@ stdenv.mkDerivation rec {
     sed -e 's@/usr/local/bin@'${wirelesstools}@ -i src/osdep/linux.c
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Wireless encryption crackign tools";
     homepage = http://www.aircrack-ng.org/;
     license = "GPL2+";
+    maintainers = [ maintainers.iElectric maintainers.viric maintainers.garbas maintainers.chaoflow ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/tools/networking/babeld/default.nix b/pkgs/tools/networking/babeld/default.nix
new file mode 100644
index 00000000000..6f773cd1f7d
--- /dev/null
+++ b/pkgs/tools/networking/babeld/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "babeld-1.4.1";
+
+  src = fetchurl {
+    url = "http://www.pps.univ-paris-diderot.fr/~jch/software/files/${name}.tar.gz";
+    sha256 = "0ykyvg9kkbv5pnkivcv9ncdcsb8bp3gfxv8swpq9jc7bh9aa2ckp";
+  };
+
+  preBuild = ''
+    makeFlags="PREFIX=$out ETCDIR=$out/etc"
+  '';
+
+  meta = {
+    homepage = "http://www.pps.univ-paris-diderot.fr/~jch/software/babel/";
+    description = "Loop-avoiding distance-vector routing protocol";
+    license = "MIT";
+  };
+}
diff --git a/pkgs/tools/networking/chrony/default.nix b/pkgs/tools/networking/chrony/default.nix
new file mode 100644
index 00000000000..d7fe0757057
--- /dev/null
+++ b/pkgs/tools/networking/chrony/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, libcap, readline }:
+
+assert stdenv.isLinux -> libcap != null;
+
+stdenv.mkDerivation rec {
+  name = "chrony-1.27";
+  
+  src = fetchurl {
+    url = "http://download.tuxfamily.org/chrony/${name}.tar.gz";
+    sha256 = "17dfhcm5mrkg8ids0ajwscryr7fm7664kz10ygsa1ac047p3aj6l";
+  };
+  
+  buildInputs = [ readline ] ++ stdenv.lib.optional stdenv.isLinux libcap;
+
+  meta = with stdenv.lib; {
+    description = "A pair of programs which are used to maintain the accuracy of the system clock on a computer.";
+    homepage = "http://chrony.tuxfamily.org/";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+
+    longDescription = ''
+      Chronyd is a daemon which runs in background on the system. It obtains measurements via the network of the system clock’s offset relative to time servers on other systems and adjusts the system time accordingly. For isolated systems, the user can periodically enter the correct time by hand (using Chronyc). In either case, Chronyd determines the rate at which the computer gains or loses time, and compensates for this. Chronyd implements the NTP protocol and can act as either a client or a server.
+
+      Chronyc provides a user interface to Chronyd for monitoring its performance and configuring various settings. It can do so while running on the same computer as the Chronyd instance it is controlling or a different computer.
+    '';
+  };
+}
diff --git a/pkgs/tools/networking/connect/default.nix b/pkgs/tools/networking/connect/default.nix
new file mode 100644
index 00000000000..67f2b63c292
--- /dev/null
+++ b/pkgs/tools/networking/connect/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "connect-1.95";
+  
+  src = fetchurl {
+    url = http://savannah.gnu.org/maintenance/connect.c;
+    sha256 = "11dx07pcanwaq71g4xh8d4blr5j7iy0ilmb0fkgpj8p22blb74mf";
+  };
+
+  phases = "unpackPhase buildPhase fixupPhase";
+
+  unpackPhase = ''
+    cp $src connect.c
+  '';
+
+  buildPhase = ''
+    ensureDir $out/bin
+    gcc -o $out/bin/connect connect.c
+  '';
+
+  meta = {
+    description = "make network connection via SOCKS and https proxy.";
+    longDescription = ''
+      This proxy traversal tool is intended to assist OpenSSH (via ProxyCommand
+      in ~/.ssh/config) and GIT (via $GIT_PROXY_COMMAND) utilize SOCKS and https proxies. 
+      '';
+    homepage = http://bent.latency.net/bent/git/goto-san-connect-1.85/src/connect.html; # source URL is busted there
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.gnu;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix
index 4dcab442119..f9439f1b42a 100644
--- a/pkgs/tools/networking/curl/default.nix
+++ b/pkgs/tools/networking/curl/default.nix
@@ -2,6 +2,7 @@
 , zlibSupport ? false, zlib ? null
 , sslSupport ? false, openssl ? null
 , scpSupport ? false, libssh2 ? null
+, gssSupport ? false, gss ? null
 , linkStatic ? false
 }:
 
@@ -10,27 +11,33 @@ assert sslSupport -> openssl != null;
 assert scpSupport -> libssh2 != null;
 
 stdenv.mkDerivation rec {
-  name = "curl-7.26.0";
+  name = "curl-7.30.0";
 
   src = fetchurl {
     url = "http://curl.haxx.se/download/${name}.tar.bz2";
-    sha256 = "0snj41knvy4xbfirr88l9gq5zjzz0mwlmq0mxbfgqszb2qpjdvgw";
+    sha256 = "04dgm9aqvplsx43n8xin5rkr8mwmc6mdd1gcp80jda5yhw1l273b";
   };
 
   # Zlib and OpenSSL must be propagated because `libcurl.la' contains
   # "-lz -lssl", which aren't necessary direct build inputs of
   # applications that use Curl.
-  propagatedBuildInputs =
-    stdenv.lib.optional zlibSupport zlib ++
-    stdenv.lib.optional sslSupport openssl;
+  propagatedBuildInputs = with stdenv.lib;
+    optional zlibSupport zlib ++
+    optional gssSupport gss ++
+    optional sslSupport openssl;
 
-  configureFlags = ''
-    ${if sslSupport then "--with-ssl=${openssl}" else "--without-ssl"}
-    ${if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2"}
-    ${if linkStatic then "--enable-static --disable-shared" else ""}
+  preConfigure = ''
+    sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
   '';
+  configureFlags = [
+      ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" )
+      ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" )
+    ]
+    ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}"
+    ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]
+  ;
 
-  dontDisableStatic = if linkStatic then true else false;
+  dontDisableStatic = linkStatic;
 
   CFLAGS = if stdenv ? isDietLibC then "-DHAVE_INET_NTOA_R_2_ARGS=1" else "";
   LDFLAGS = if linkStatic then "-static" else "";
@@ -44,23 +51,20 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     # We should refer to the cross built openssl
     # For the 'urandom', maybe it should be a cross-system option
-    configureFlags = ''
-      ${if sslSupport then "--with-ssl=${openssl.hostDrv}" else "--without-ssl"}
-      ${if linkStatic then "--enable-static --disable-shared" else ""}
-      --with-random /dev/urandom
-    '';
+    configureFlags = [
+        ( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" )
+        "--with-random /dev/urandom"
+      ]
+      ++ stdenv.lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]
+    ;
   };
 
   passthru = {
     inherit sslSupport openssl;
   };
 
-  preConfigure = ''
-    sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
-  '';
-
   meta = {
+    homepage = "http://curl.haxx.se/";
     description = "A command line tool for transferring files with URL syntax";
-    homepage = http://curl.haxx.se/;
   };
 }
diff --git a/pkgs/tools/networking/dd-agent/default.nix b/pkgs/tools/networking/dd-agent/default.nix
new file mode 100644
index 00000000000..e83ad7933f1
--- /dev/null
+++ b/pkgs/tools/networking/dd-agent/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchgit, python, sysstat }:
+
+stdenv.mkDerivation rec {
+    name = "dd-agent-ab14fde6f9";
+
+    src = fetchgit {
+      url = git://github.com/DataDog/dd-agent.git;
+      rev = "ab14fde6f9b9f6cb3544f643cece97ef18a0d770";
+      sha256 = "2615a2f122ac97363eba8973dfc6c2ce81cb61a26eb61c2988faad2abd05efc5";
+    };
+
+    buildInputs = [ python ];
+
+    postUnpack = "export sourceRoot=$sourceRoot/packaging";
+
+    makeFlags = [ "BUILD=$(out)" ];
+
+    installTargets = [ "install_base" "install_full" ];
+
+    postInstall = ''
+      mv $out/usr/* $out
+      rmdir $out/usr
+    '';
+
+    meta = {
+      description = "Event collector for the DataDog analysis service";
+
+      homepage = http://www.datadoghq.com;
+
+      maintainers = [ stdenv.lib.maintainers.shlevy ];
+
+      license = stdenv.lib.licenses.bsd3;
+
+      platforms = stdenv.lib.platforms.all;
+    };
+}
diff --git a/pkgs/tools/networking/ddclient/ddclient-foreground.patch b/pkgs/tools/networking/ddclient/ddclient-foreground.patch
index 954b3e1132f..1ae3621f507 100644
--- a/pkgs/tools/networking/ddclient/ddclient-foreground.patch
+++ b/pkgs/tools/networking/ddclient/ddclient-foreground.patch
@@ -1,80 +1,12 @@
-diff -rc ddclient-3.8.0/ddclient ddclient-3.8.0-new/ddclient
-*** ddclient-3.8.0/ddclient	2009-01-27 20:14:02.000000000 +0100
---- ddclient-3.8.0-new/ddclient	2009-09-16 12:56:43.720654327 +0200
-***************
-*** 307,313 ****
-  my %variables = (
-      'global-defaults'    => {
-  	'daemon'              => setv(T_DELAY, 0, 0, 1, 0,                    interval('60s')),
-! 	'file'                => setv(T_FILE,  0, 0, 1, "$etc$program.conf",  undef),
-  	'cache'               => setv(T_FILE,  0, 0, 1, "$cachedir$program.cache", undef),
-  	'pid'                 => setv(T_FILE,  0, 0, 1, "",                   undef),
-  	'proxy'               => setv(T_FQDNP, 0, 0, 1, '',                   undef),
---- 307,314 ----
-  my %variables = (
-      'global-defaults'    => {
-  	'daemon'              => setv(T_DELAY, 0, 0, 1, 0,                    interval('60s')),
-!         'foreground'          => setv(T_BOOL,  0, 0, 1, 0,                    undef),	
-!         'file'                => setv(T_FILE,  0, 0, 1, "$etc$program.conf",  undef),
-  	'cache'               => setv(T_FILE,  0, 0, 1, "$cachedir$program.cache", undef),
-  	'pid'                 => setv(T_FILE,  0, 0, 1, "",                   undef),
-  	'proxy'               => setv(T_FQDNP, 0, 0, 1, '',                   undef),
-***************
-*** 535,540 ****
---- 536,542 ----
-      "usage: ${program} [options]",
-      "options are:",
-      [ "daemon",      "=s", "-daemon delay         : run as a daemon, specify delay as an interval." ],
-+     [ "foreground",  "!",  "-foreground           : do not fork" ],
-      [ "proxy",       "=s", "-proxy host           : use 'host' as the HTTP proxy" ],
-      [ "server",      "=s", "-server host          : update DNS information on 'host'" ],
-      [ "protocol",    "=s", "-protocol type        : update protocol used" ],
-***************
-*** 623,629 ****
-  $SIG{'HUP'}    = sub { $caught_hup  = 1; };
-  $SIG{'TERM'}   = sub { $caught_term = 1; };
-  $SIG{'KILL'}   = sub { $caught_kill = 1; };
-! if (opt('daemon') && !opt('force')) {
-      $SIG{'CHLD'}   = 'IGNORE';
-      my $pid = fork;
-      if ($pid < 0) {
---- 625,634 ----
-  $SIG{'HUP'}    = sub { $caught_hup  = 1; };
-  $SIG{'TERM'}   = sub { $caught_term = 1; };
-  $SIG{'KILL'}   = sub { $caught_kill = 1; };
-! # don't fork() if foreground or force is on
-! if (opt('foreground') || opt('force')) {
-!     ;
-! } elsif (opt('daemon')) {
-      $SIG{'CHLD'}   = 'IGNORE';
-      my $pid = fork;
-      if ($pid < 0) {
-***************
-*** 633,644 ****
-  	exit 0;
-      }
-      $SIG{'CHLD'}   = 'DEFAULT';
--     $opt{'syslog'} = 1;
-      open(STDOUT, ">/dev/null");
-      open(STDERR, ">/dev/null");
-      open(STDIN,  "</dev/null");
-! 
-!     write_pid();
-  }
-  
-  umask 077;
---- 638,650 ----
-  	exit 0;
-      }
-      $SIG{'CHLD'}   = 'DEFAULT';
-      open(STDOUT, ">/dev/null");
-      open(STDERR, ">/dev/null");
-      open(STDIN,  "</dev/null");
-! }
-! if(opt('daemon')) {
-!      write_pid();
-!     $opt{'syslog'} = 1;
-  }
-  
-  umask 077;
-Only in ddclient-3.8.0-new: ddclient~
+diff -u ddclient-3.8.1/ddclient ddclient-3.8.1.patched/ddclient
+--- ddclient-3.8.1/ddclient	2011-07-11 23:04:21.000000000 +0200
++++ ddclient-3.8.1.patched/ddclient	2012-11-08 11:52:31.930647236 +0100
+@@ -574,7 +574,7 @@
+     "usage: ${program} [options]",
+     "options are:",
+     [ "daemon",      "=s", "-daemon delay         : run as a daemon, specify delay as an interval." ],
+-+     [ "foreground",  "!",  "-foreground           : do not fork" ],
++    [ "foreground",  "!",  "-foreground           : do not fork" ],
+     [ "proxy",       "=s", "-proxy host           : use 'host' as the HTTP proxy" ],
+     [ "server",      "=s", "-server host          : update DNS information on 'host'" ],
+     [ "protocol",    "=s", "-protocol type        : update protocol used" ],
diff --git a/pkgs/tools/networking/ddclient/default.nix b/pkgs/tools/networking/ddclient/default.nix
index e57ba489450..22539657b1f 100644
--- a/pkgs/tools/networking/ddclient/default.nix
+++ b/pkgs/tools/networking/ddclient/default.nix
@@ -1,17 +1,23 @@
-{buildPerlPackage, fetchurl, perl}:
+{buildPerlPackage, fetchurl, perlPackages, iproute}:
 
 buildPerlPackage {
-  name = "ddclient-3.8.0";
+  name = "ddclient-3.8.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/ddclient/ddclient-3.8.0.tar.gz ;
-    sha256 = "1cqz6fwx8bcl7zdrvm6irh3bzs8858gkyficww9simyjmz7z3w48";
+    url = mirror://sourceforge/ddclient/ddclient-3.8.1.tar.gz ;
+    sha256 = "f22ac7b0ec78e310d7b88a1cf636e5c00360b2ed9c087f231b3522ef3e6295f2";
   };
 
+  buildInputs = [ perlPackages.IOSocketSSL ];
+
   patches = [ ./ddclient-foreground.patch ];
 
+  # Use iproute2 instead of ifconfig
   preConfigure = '' 
     touch Makefile.PL
+    substituteInPlace ddclient --replace 'in the output of ifconfig' 'in the output of ip addr show'
+    substituteInPlace ddclient --replace 'ifconfig -a' '${iproute}/sbin/ip addr show'
+    substituteInPlace ddclient --replace 'ifconfig $arg' '${iproute}/sbin/ip addr show $arg'
   ''; 
 
   installPhase = ''
@@ -20,5 +26,4 @@ buildPerlPackage {
   '';
 
   doCheck = false;
-
 }
diff --git a/pkgs/tools/networking/dhcpcd/default.nix b/pkgs/tools/networking/dhcpcd/default.nix
index dc2a8498223..9b3b6238420 100644
--- a/pkgs/tools/networking/dhcpcd/default.nix
+++ b/pkgs/tools/networking/dhcpcd/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "dhcpcd-5.5.6";
+  name = "dhcpcd-5.6.8";
 
   src = fetchurl {
     url = "http://roy.marples.name/downloads/dhcpcd/${name}.tar.bz2";
-    sha256 = "1rz8n6crw6yh9hzqwdqjpl37v60i1szr7dbhf6gvm374gpf10zv5";
+    sha256 = "1i7fv1l0n7q1mnia7g0789ch63x5zhwk5gsrwvs78dv2f2kmvcd3";
   };
 
   configureFlags = "--sysconfdir=/etc";
diff --git a/pkgs/tools/networking/dnsmasq/default.nix b/pkgs/tools/networking/dnsmasq/default.nix
index 89c15b91a1a..20964213d53 100644
--- a/pkgs/tools/networking/dnsmasq/default.nix
+++ b/pkgs/tools/networking/dnsmasq/default.nix
@@ -1,18 +1,20 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "dnsmasq-2.59";
+  name = "dnsmasq-2.63";
 
   src = fetchurl {
     url = "http://www.thekelleys.org.uk/dnsmasq/${name}.tar.gz";
-    sha256 = "02s1y5320aiqhcrgzc7c2zs292vidijc156k5w7apzzsk5hfdhdx";
+    sha256 = "043p8qjd1zx8bklcli9qnk3vzfz7j2kvl82abvipcg56qsyf71px";
   };
 
   makeFlags = "DESTDIR= BINDIR=$(out)/bin MANDIR=$(out)/man LOCALEDIR=$(out)/share/locale";
 
-  meta = { 
+  meta = {
     description = "An integrated DNS, DHCP and TFTP server for small networks";
     homepage = http://www.thekelleys.org.uk/dnsmasq/doc.html;
     license = "GPL";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/tools/networking/filegive/default.nix b/pkgs/tools/networking/filegive/default.nix
new file mode 100644
index 00000000000..3072ba3bd4f
--- /dev/null
+++ b/pkgs/tools/networking/filegive/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchurl, fetchgit, go }:
+
+assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);
+
+let
+
+  # Code with BSD license
+  srcNatPMP = fetchgit {
+    url = "https://code.google.com/p/go-nat-pmp/";
+    rev = "e04deda90d56";
+    sha256 = "1swwfyzaj3l40yh9np3x4fcracgs79nwryc85sxbdakx8wwxs2xb";
+  };
+
+  version = "0.6.1";
+
+in
+stdenv.mkDerivation rec {
+  name = "filegive-${version}";
+
+  src = fetchurl {
+    url = "http://viric.name/cgi-bin/filegive/tarball/${name}.tar.gz?uuid=v${version}";
+    name = "${name}.tar.gz";
+    sha256 = "172cvm41bqaixz50f86ppqbbridb0qnrcdldfswrs03dc569szm1";
+  };
+
+  buildInputs = [ go ];
+
+  buildPhase = ''
+    ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
+
+    mkdir $TMPDIR/go
+    export GOPATH=$TMPDIR/go
+
+    GONATPMP=$GOPATH/src/code.google.com/p/go-nat-pmp
+    mkdir -p $GONATPMP
+    cp -R ${srcNatPMP}/* $GONATPMP/
+    go build -o filegive
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp filegive $out/bin
+  '';
+
+  meta = {
+    homepage = http://viric.name/cgi-bin/filegive;
+    description = "Easy p2p file sending program";
+    license = "AGPLv3+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/networking/fping/default.nix b/pkgs/tools/networking/fping/default.nix
new file mode 100644
index 00000000000..c51c8f59ff7
--- /dev/null
+++ b/pkgs/tools/networking/fping/default.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "fping-3.4";
+
+  src = fetchurl {
+    url = "http://www.fping.org/dist/${name}.tar.gz";
+    sha256 = "1zkawlk6lcqw6nakqnl3v0x1cwnxrx2lmg9q6j76mw9i96pjh9fl";
+  };
+
+  meta = {
+    homepage = "http://fping.org/";
+    description = "A program to send ICMP echo probes to network hosts.";
+  };
+}
diff --git a/pkgs/tools/networking/gmvault/default.nix b/pkgs/tools/networking/gmvault/default.nix
new file mode 100644
index 00000000000..1ea2b761fc8
--- /dev/null
+++ b/pkgs/tools/networking/gmvault/default.nix
@@ -0,0 +1,34 @@
+{ pkgs, fetchurl, buildPythonPackage, pythonPackages }:
+
+buildPythonPackage rec {
+  version = "1.8.1-beta";
+  name = "gmvault-${version}";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/gaubert/gmvault-official-download/downloads/gmvault-v${version}-src.tar.gz";
+    name = "${name}.tar.bz";
+    sha256 = "0b575cnrd6jzcpa05mbn2swzcy0r9ck09pkhs4ydj6d3ir52j80c";
+  };
+
+  doCheck = false;
+
+  propagatedBuildInputs = [
+    pythonPackages.gdata
+    pythonPackages.IMAPClient
+    pythonPackages.Logbook
+    pythonPackages.argparse
+  ];
+
+  startScript = ./gmvault.py;
+
+  patchPhase = ''
+    cat ${startScript} > etc/scripts/gmvault
+    chmod +x etc/scripts/gmvault
+  '';
+
+  meta = {
+    description = "Gmvault Gmail Backup - Backup and restore your gmail account at will.";
+    homepage = "http://gmvault.org";
+    license = pkgs.lib.licenses.agpl3Plus;
+  };
+}
diff --git a/pkgs/tools/networking/gmvault/gmvault.py b/pkgs/tools/networking/gmvault/gmvault.py
new file mode 100644
index 00000000000..127036577f3
--- /dev/null
+++ b/pkgs/tools/networking/gmvault/gmvault.py
@@ -0,0 +1,4 @@
+#!/usr/bin/env python
+
+import gmv.gmv_cmd as runner
+runner.bootstrap_run()
diff --git a/pkgs/tools/networking/gvpe/src-for-default.nix b/pkgs/tools/networking/gvpe/src-for-default.nix
index 10094c7b129..097f275feff 100644
--- a/pkgs/tools/networking/gvpe/src-for-default.nix
+++ b/pkgs/tools/networking/gvpe/src-for-default.nix
@@ -1,8 +1,9 @@
 rec {
-  advertisedUrl="http://ftp.gnu.org/gnu/gvpe/gvpe-2.22.tar.gz";
-  version = "2.22";
-  url="http://ftp.gnu.org/gnu/gvpe/gvpe-2.22.tar.gz";
-  hash = "01p1akcib8wxpsma9i3zlnqwd78swpjhwx4drp9h57f0hp14cr7w";
-  name = "gvpe-2.22";
+   version="2.24";
+   name="gvpe-2.24";
+   hash="1szwia7n24fx9n40yvmdidna55b97459ccq6d2c4863q4pfkqpjy";
+   url="http://ftp.gnu.org/gnu/gvpe/gvpe-${version}.tar.gz";
+   advertisedUrl="http://ftp.gnu.org/gnu/gvpe/gvpe-2.24.tar.gz";
+  
   
 }
diff --git a/pkgs/tools/networking/hping/default.nix b/pkgs/tools/networking/hping/default.nix
new file mode 100644
index 00000000000..aa2574fbc1d
--- /dev/null
+++ b/pkgs/tools/networking/hping/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, libpcap, tcl }:
+
+stdenv.mkDerivation rec {
+  name = "hping-${version}";
+  version = "20051105";
+
+  src = fetchurl {
+    url = "http://www.hping.org/hping3-${version}.tar.gz";
+    sha256 = "1s5f9xd1msx05ibhwaw37jmc7l9fahcxxslqz8a83p0i5ak739pm";
+  };
+
+  buildInputs = [ libpcap tcl ];
+
+  configurePhase = ''
+    MANPATH="$out/share/man" ./configure
+    sed -i -r -e 's|/usr(/s?bin)|'"$out"'\1|g' Makefile
+  '';
+
+  TCLSH = "${tcl}/bin/tclsh";
+
+  prePatch = ''
+    sed -i -e '/#if.*defined(__i386__)/a \
+      || defined(__x86_64__) \\
+    ' bytesex.h
+
+    sed -i -e 's|#include.*net/bpf.h|#include <pcap/bpf.h>|' \
+      libpcap_stuff.c script.c
+
+    sed -i -r -e 's|"(/usr/(local/)?)?bin/"|"${tcl}/bin"|g' \
+              -e 's!/usr/(local/)?(lib|include)!${tcl}/\2!g' \
+              configure
+  '';
+
+  preInstall = ''
+    mkdir -vp "$out/sbin" "$out/share/man/man8"
+  '';
+
+  postInstall = ''
+    ln -vs hping3.8.gz "$out/share/man/man8/hping.8.gz"
+    ln -vs hping3.8.gz "$out/share/man/man8/hping2.8.gz"
+  '';
+
+  meta = {
+    description = "A command-line oriented TCP/IP packet assembler/analyzer";
+    homepage = "http://www.hping.org/";
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/tools/networking/httpie/default.nix
new file mode 100644
index 00000000000..cdbb52fe739
--- /dev/null
+++ b/pkgs/tools/networking/httpie/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pythonPackages }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "httpie-0.4.1";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/h/httpie/${name}.tar.gz";
+    sha256 = "1qd03vd4657vdvkfhbd2wnlz4xh6hyw75m7wmfhgac5m2028y3cv";
+  };
+
+  propagatedBuildInputs = with pythonPackages; [ pygments requests ];
+
+  doCheck = false;
+
+  meta = {
+    description = "A command line HTTP client whose goal is to make CLI human-friendly";
+    homepage = http://httpie.org/;
+    license = "BSD";
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  };
+}
diff --git a/pkgs/tools/networking/iftop/default.nix b/pkgs/tools/networking/iftop/default.nix
index 730b60c7aec..3a9c0e10a78 100644
--- a/pkgs/tools/networking/iftop/default.nix
+++ b/pkgs/tools/networking/iftop/default.nix
@@ -8,6 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1b0fis53280qx85gldhmqfcpgyiwplzg43gxyngia1w3f1y58cnh";
   };
 
+  # Explicitly link against libgcc_s, to work around the infamous
+  # "libgcc_s.so.1 must be installed for pthread_cancel to work".
+  LDFLAGS = "-lgcc_s";
+
   preConfigure = ''
     cp ${automake}/share/automake*/config.{sub,guess} config
   '';
diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix
index 6734465dbba..24d73ff4d6f 100644
--- a/pkgs/tools/networking/inetutils/default.nix
+++ b/pkgs/tools/networking/inetutils/default.nix
@@ -1,18 +1,26 @@
 { stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
-  name = "inetutils-1.8";
+  name = "inetutils-1.9.1";
 
   src = fetchurl {
     url = "mirror://gnu/inetutils/${name}.tar.gz";
-    sha256 = "1iqihfv54nzjmclivys2dpcyfhavgynj8pp6r44a97jbw2p0nl68";
+    sha256 = "0azzg6njgq79byl6960kb0wihfhhzf49snslhxgvi30ribgfpa82";
   };
 
   buildInputs = [ ncurses /* for `talk' */ ];
 
   configureFlags = "--with-ncurses-include-dir=${ncurses}/include";
 
-  doCheck = true;
+  preConfigure = ''
+     # Fix for building on Glibc 2.16.  Won't be needed once the
+     # gnulib in inetutils is updated.
+     sed -i '/gets is a security hole/d' lib/stdio.in.h
+  '';
+
+  # Test fails with "UNIX socket name too long", probably because our
+  # $TMPDIR is too long.
+  #doCheck = true;
 
   postInstall = ''
     # XXX: These programs are normally installed setuid but since it
diff --git a/pkgs/tools/networking/isync/default.nix b/pkgs/tools/networking/isync/default.nix
index aca9b47195d..9587dfee613 100644
--- a/pkgs/tools/networking/isync/default.nix
+++ b/pkgs/tools/networking/isync/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, openssl, pkgconfig, db4 }:
 
 stdenv.mkDerivation rec {
-  name = "isync-1.0.4";
+  name = "isync-1.0.6";
 
   src = fetchurl {
-    url = "mirror://sourceforge/isync/isync-1.0.4.tar.gz";
-    sha256 = "1xmgzypl5a3i0fz1ca55vfbs5mv2l9icwf2gk8rvlbwrkn2wid68";
+    url = "mirror://sourceforge/isync/${name}.tar.gz";
+    sha256 = "0bv3hw6mc9xi55q6lpyz1w3dyrk6rlxa8ny2x1b44mrnbrx7chz5";
   };
 
   patches = [ ./isync-recursice-imap.patch ]; # usefull patch to enable subfolders listing
diff --git a/pkgs/tools/networking/lftp/default.nix b/pkgs/tools/networking/lftp/default.nix
index 64e7ac50bc0..2bc575bbd02 100644
--- a/pkgs/tools/networking/lftp/default.nix
+++ b/pkgs/tools/networking/lftp/default.nix
@@ -1,12 +1,20 @@
-{stdenv, fetchurl, gnutls, libtasn1, pkgconfig, readline, zlib, xz}:
+{ stdenv, fetchurl, gnutls, pkgconfig, readline, zlib, xz }:
 
 stdenv.mkDerivation rec {
-  name = "lftp-4.3.1";
+  name = "lftp-4.4.5";
 
   src = fetchurl {
-    url = "ftp://ftp.cs.tu-berlin.de/pub/net/ftp/lftp/${name}.tar.xz";
-    sha256 = "0v3591fknmimarzk5icm0qxdcfzfckwi2drh165vsiggmj590iyx";
+    url = "ftp://ftp.tuwien.ac.at/infosys/browsers/ftp/lftp/${name}.tar.xz";
+    sha256 = "1p3nxsd2an9pdwc3vgwxy8p5nnjrc7mhilikjaddy62cyvxdbpxq";
   };
 
-  buildInputs = [gnutls libtasn1 pkgconfig readline zlib];
+  patches = [ ./no-gets.patch ];
+
+  buildInputs = [ gnutls pkgconfig readline zlib ];
+
+  meta = {
+    homepage = http://lftp.yar.ru/;
+    description = "A file transfer program supporting a number of network protocols";
+    license = "GPL";
+  };
 }
diff --git a/pkgs/tools/networking/lftp/no-gets.patch b/pkgs/tools/networking/lftp/no-gets.patch
new file mode 100644
index 00000000000..0c2cb7c8ae6
--- /dev/null
+++ b/pkgs/tools/networking/lftp/no-gets.patch
@@ -0,0 +1,15 @@
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -702,10 +702,12 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning; besides, C11
+    removed it.  */
++#ifdef gets
+ #undef gets
+ #if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
++#endif
+ 
+ 
+ #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
diff --git a/pkgs/tools/networking/maildrop/default.nix b/pkgs/tools/networking/maildrop/default.nix
new file mode 100644
index 00000000000..b91282c9a2b
--- /dev/null
+++ b/pkgs/tools/networking/maildrop/default.nix
@@ -0,0 +1,20 @@
+{ fetchurl, stdenv, pkgconfig, pcre, perl }:
+
+stdenv.mkDerivation rec {
+  name = "maildrop-2.6.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/courier/maildrop/2.6.0/maildrop-2.6.0.tar.bz2";
+    sha256 = "1a94p2b41iy334cwfwmzi19557dn5j61abh0cp2rfc9dkc8ibhdg";
+  };
+
+  buildInputs = [ pkgconfig pcre perl ];
+
+  patches = [ ./maildrop.configure.hack.patch ]; # for building in chroot
+
+  meta = {
+    homepage = http://www.courier-mta.org/maildrop/;
+    description = "Mail filter/mail delivery agent that is used by the Courier Mail Server";
+    licenses = [ "GPLv3" ];
+  };
+}
diff --git a/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch b/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch
new file mode 100644
index 00000000000..08988f6cde5
--- /dev/null
+++ b/pkgs/tools/networking/maildrop/maildrop.configure.hack.patch
@@ -0,0 +1,13 @@
+--- a/maildrop/configure	2012-09-06 01:52:13.000000000 +0100
++++ b/maildrop/configure	2013-01-04 03:00:57.095628327 +0000
+@@ -17562,8 +17562,8 @@
+ check_spooldir() {
+   if test "$CHECKED_SPOOLDIR" != 1
+   then
+-     get_spooldir
+-     MBOX_DIR="$SPOOLDIR"
++     MBOX_DIR="/var/spool/mail"
++     MBOX_RESET_GID=0
+      CHECKED_SPOOLDIR=1
+   fi
+ }
diff --git a/pkgs/tools/networking/mailutils/default.nix b/pkgs/tools/networking/mailutils/default.nix
index 43293b79578..3a84516cd37 100644
--- a/pkgs/tools/networking/mailutils/default.nix
+++ b/pkgs/tools/networking/mailutils/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0szbqa12zqzldqyw97lxqax3ja2adis83i7brdfsxmrfw68iaf65";
   };
 
-  patches = [ ./path-to-cat.patch ];
+  patches = [ ./path-to-cat.patch ./no-gets.patch ];
 
   buildInputs =
    [ gettext gdbm libtool pam readline ncurses
diff --git a/pkgs/tools/networking/mailutils/no-gets.patch b/pkgs/tools/networking/mailutils/no-gets.patch
new file mode 100644
index 00000000000..d72fa3f056c
--- /dev/null
+++ b/pkgs/tools/networking/mailutils/no-gets.patch
@@ -0,0 +1,14 @@
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -138,8 +138,10 @@
+ /* It is very rare that the developer ever has full control of stdin,
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+-#undef gets
++#ifdef gets
++# undef gets
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
++#endif
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/tools/networking/megatools/default.nix b/pkgs/tools/networking/megatools/default.nix
new file mode 100644
index 00000000000..25dbd634c8c
--- /dev/null
+++ b/pkgs/tools/networking/megatools/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, glib, curl, pkgconfig, fuse, glib_networking, makeWrapper
+, gsettings_desktop_schemas }:
+
+stdenv.mkDerivation rec {
+  name = "megatools-1.9.91";
+
+  src = fetchurl {
+    url = "http://megatools.megous.com/builds/${name}.tar.gz";
+    sha256 = "0hb83wqsn6mggcmk871hl8cski5x0hxz9dhaka42115s4mdfbl1i";
+  };
+
+  buildInputs = [ glib curl pkgconfig fuse makeWrapper ];
+
+  postInstall = ''
+    for a in $out/bin/*; do
+      wrapProgram "$a" \
+            --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+            --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share"
+
+    done
+  '';
+
+  meta = {
+    description = "Command line client for Mega.co.nz";
+    homepage = http://megatools.megous.com/;
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/networking/minidlna/default.nix b/pkgs/tools/networking/minidlna/default.nix
index 736ca980cfb..02013d8ede6 100644
--- a/pkgs/tools/networking/minidlna/default.nix
+++ b/pkgs/tools/networking/minidlna/default.nix
@@ -1,28 +1,32 @@
-{stdenv, fetchurl, libav, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }:
+{ stdenv, fetchurl, ffmpeg, flac, libvorbis, libogg, libid3tag, libexif, libjpeg, sqlite }:
+
+let version = "1.0.25"; in
+
 stdenv.mkDerivation rec {
-  name = "minidlna-1.0.24";
+  name = "minidlna-${version}";
+
   src = fetchurl {
-    url = mirror://sourceforge/project/minidlna/minidlna/1.0.24/minidlna_1.0.24_src.tar.gz;
-    sha256 = "0hmrrrq7d8940rckwj93bcdpdxxy3qfkjl17j5k31mi37hqc42l4";
+    url = "mirror://sourceforge/project/minidlna/minidlna/${version}/minidlna_${version}_src.tar.gz";
+    sha256 = "0l987x3bx2apnlihnjbhywgk5b2g9ysiapwclz5vphj2w3xn018p";
   };
 
+  patches = [ ./config.patch ];
+
   preConfigure = ''
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libav}/include/libavutil -I${libav}/include/libavcodec -I${libav}/include/libavformat"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ffmpeg}/include/libavutil -I${ffmpeg}/include/libavcodec -I${ffmpeg}/include/libavformat"
     export makeFlags="INSTALLPREFIX=$out"
   '';
 
-  buildInputs = [ libav flac libvorbis libogg libid3tag libexif libjpeg sqlite ];
-  patches = [ ./config.patch ];
+  buildInputs = [ ffmpeg flac libvorbis libogg libid3tag libexif libjpeg sqlite ];
 
   meta = {
     description = "MiniDLNA Media Server";
     longDescription = ''
-      MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully 
-      compliant with DLNA/UPnP-AV clients. 
+      MiniDLNA (aka ReadyDLNA) is server software with the aim of being fully
+      compliant with DLNA/UPnP-AV clients.
     '';
     homepage = http://sourceforge.net/projects/minidlna/;
     license = stdenv.lib.licenses.gpl2;
-
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/tools/networking/miniupnpc/default.nix b/pkgs/tools/networking/miniupnpc/default.nix
index 34ec8eed90e..3cd35073be6 100644
--- a/pkgs/tools/networking/miniupnpc/default.nix
+++ b/pkgs/tools/networking/miniupnpc/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "miniupnpc-1.6";
+  name = "miniupnpc-1.7";
 
   src = fetchurl {
     url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz";
-    sha256 = "151rh46axl44y7bbflb43pnj52gvlfnkxfgrn2jvai5gwrbbgmmv";
+    sha256 = "0dv3mz4yikngmlnrnmh747mlgbbpijryw03wcs8g4jwvprb29p8n";
   };
 
   installFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)";
diff --git a/pkgs/tools/networking/miniupnpd/default.nix b/pkgs/tools/networking/miniupnpd/default.nix
index 6db47f8e079..b5002d22990 100644
--- a/pkgs/tools/networking/miniupnpd/default.nix
+++ b/pkgs/tools/networking/miniupnpd/default.nix
@@ -1,33 +1,34 @@
-{ stdenv, fetchurl, iptables }:
+{ stdenv, fetchurl, iptables, libnfnetlink, libnetfilter_conntrack }:
 
 assert stdenv.isLinux;
 
 stdenv.mkDerivation rec {
-  name = "miniupnpd-1.4";
+  name = "miniupnpd-1.7.20121005";
 
   src = fetchurl {
     url = "http://miniupnp.free.fr/files/download.php?file=${name}.tar.gz";
-    sha256 = "06q5agkzv2snjxcsszpm27h8bqv41jijahs8jqnarxdrik97rfl5";
+    sha256 = "03kaxj808hgj1zf2528pzilgywgh70mh0qivjb5nm3spziiq32sv";
   };
 
-  buildInputs = [ iptables ];
+  buildInputs = [ iptables libnfnetlink libnetfilter_conntrack ];
+
+  patchPhase = ''
+    sed -i -e 's/upnputils\.o -lnfnetlink/upnputils.o/' Makefile.linux
+  '';
 
   NIX_CFLAGS_COMPILE = "-DIPTABLES_143";
 
-  NIX_CFLAGS_LINK = "-liptc";
-  
+  NIX_CFLAGS_LINK = "-liptc -lnfnetlink";
+
   makefile = "Makefile.linux";
 
   makeFlags = "LIBS=";
 
-  postBuild = "cat config.h";
-
   installFlags = "PREFIX=$(out) INSTALLPREFIX=$(out)";
 
-  postInstall =
+  preInstall =
     ''
-      mkdir -p $out/share/man/man1
-      cp miniupnpd.1 $out/share/man/man1/
+      mkdir -p $out/share/man/man8
     '';
 
   meta = {
diff --git a/pkgs/tools/networking/modemmanager/default.nix b/pkgs/tools/networking/modemmanager/default.nix
index c9c975d557c..bfa673eff09 100644
--- a/pkgs/tools/networking/modemmanager/default.nix
+++ b/pkgs/tools/networking/modemmanager/default.nix
@@ -5,11 +5,11 @@ stdenv.mkDerivation rec {
 
   src = fetchurl_gnome {
     project = "ModemManager";
-    major = "0"; minor = "5"; extension = "xz";
-    sha256 = "0zvwrni4l21d856nq28khigrhwgrq5cc7nh45zidwjj8q7bsxiz7";
+    major = "0"; minor = "5"; patchlevel = "4.0"; extension = "xz";
+    sha256 = "1fdf5d5cc494825afe9f551248e00a2d91e220e88435b47f109ca2a707a40f1f";
   };
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   buildInputs = [ udev polkit dbus_glib ppp ];
 
diff --git a/pkgs/tools/networking/mosh/default.nix b/pkgs/tools/networking/mosh/default.nix
index 60a9e5cab87..f9562f7eff6 100644
--- a/pkgs/tools/networking/mosh/default.nix
+++ b/pkgs/tools/networking/mosh/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, zlib, boost, protobuf, ncurses, pkgconfig, IOTty
-, makeWrapper, perl }:
+, makeWrapper, perl, openssl }:
 
 stdenv.mkDerivation rec {
-  name = "mosh-1.1.3";
+  name = "mosh-1.2.4";
 
   src = fetchurl {
-    url = "https://github.com/downloads/keithw/mosh/${name}.tar.gz";
-    sha256 = "1vkf7h8mcmfn9dgcwrww05mdijrl7321xv9wlhf7j99nwmklc8sk";
+    url = "http://mosh.mit.edu/${name}.tar.gz";
+    sha256 = "0inzfmqrab3n97m7rrmhd4xh3hjz0xva2sfl5m06w11668r0skg7";
   };
 
-  buildInputs = [ boost protobuf ncurses zlib pkgconfig IOTty makeWrapper perl ];
+  buildInputs = [ boost protobuf ncurses zlib pkgconfig IOTty makeWrapper perl openssl ];
 
   postInstall = ''
       wrapProgram $out/bin/mosh --prefix PERL5LIB : $PERL5LIB
diff --git a/pkgs/tools/networking/mtr/default.nix b/pkgs/tools/networking/mtr/default.nix
index d4cfaa4ce9b..45dcb087bd7 100644
--- a/pkgs/tools/networking/mtr/default.nix
+++ b/pkgs/tools/networking/mtr/default.nix
@@ -1,4 +1,4 @@
-x@{builderDefsPackage
+x@{builderDefsPackage, ncurses
   , ...}:
 builderDefsPackage
 (a :  
@@ -10,10 +10,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="mtr";
-    version="0.80";
+    version="0.82";
     name="${baseName}-${version}";
     url="ftp://ftp.bitwizard.nl/${baseName}/${name}.tar.gz";
-    hash="1h0fzxy5cwml3p2nq749sq8mk2dsvm4qb1ah7a9hbf7kzabxvfvn";
+    hash="185nx4y6xn7vv6l3pbyc0ljmwfl4si4zszwad1jkbq1scb4mgd7k";
   };
 in
 rec {
diff --git a/pkgs/tools/networking/mu/default.nix b/pkgs/tools/networking/mu/default.nix
new file mode 100644
index 00000000000..7495c3bcd7f
--- /dev/null
+++ b/pkgs/tools/networking/mu/default.nix
@@ -0,0 +1,25 @@
+{ fetchurl, stdenv, sqlite, pkgconfig, xapian, glib, gmime, texinfo, emacs, guile }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.9";
+  name = "mu-${version}";
+
+  src = fetchurl {
+    url = "https://mu0.googlecode.com/files/mu-${version}.tar.gz";
+    sha256 = "04r0y05awsyb5hqwaxn1hq9jxijw20hwsgdbacqrma519f0y5y43";
+  };
+
+  buildInputs = [ sqlite pkgconfig xapian glib gmime texinfo emacs guile ];
+
+  meta = {
+    description = "mu is a collection of utilties for indexing and searching Maildirs";
+
+    licenses = [ "GPLv3+" ];
+
+    homepage = "http://www.djcbsoftware.nl/code/mu/";
+
+    platforms = stdenv.lib.platforms.all;
+
+    maintainers = [ stdenv.lib.maintainers.antono ];
+  };
+}
diff --git a/pkgs/tools/networking/mu0/default.nix b/pkgs/tools/networking/mu0/default.nix
deleted file mode 100644
index a772f237500..00000000000
--- a/pkgs/tools/networking/mu0/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ fetchurl, stdenv, sqlite, pkgconfig, xapian, glib, gmime }:
-
-stdenv.mkDerivation rec {
-  name = "mu0-0.9.7";
-
-  src = fetchurl {
-    url = http://mu0.googlecode.com/files/mu-0.9.7.tar.gz;
-    sha256 = "14nyn791ficyllj9idhiq3mncwnrg71lfxk126804dxba1l90r72";
-  };
-
-  buildInputs = [ sqlite pkgconfig xapian glib gmime ];
-
-  /* The tests don't pass */
-  doCheck = false;
-
-  meta = {
-    description = "mu is a collection of utilties for indexing and searching Maildirs";
-
-    licenses = [ "GPLv3+" ];
-
-    homepage = http://code.google.com/p/mu0/;
-
-    platforms = stdenv.lib.platforms.all;
-  };
-}
diff --git a/pkgs/tools/networking/nbd/default.nix b/pkgs/tools/networking/nbd/default.nix
index 9e2d14c64ff..c5636c6e6ee 100644
--- a/pkgs/tools/networking/nbd/default.nix
+++ b/pkgs/tools/networking/nbd/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, glib }:
 
 let
-  name = "nbd-3.2";
+  name = "nbd-3.3";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://sourceforge/nbd/${name}.tar.bz2";
-    sha256 = "e297c1883133f04a55d8e9527a2e4344e577a54046cf81694ffabe13f73793db";
+    sha256 = "068cm0lkw67g7vj95kqxwb9z15c0jbsfbmjjl5zfx7mbvhc5f443";
   };
 
   buildInputs = [ pkgconfig glib ] ++ stdenv.lib.optional (stdenv ? glibc) stdenv.glibc.kernelHeaders;
diff --git a/pkgs/tools/networking/netboot/default.nix b/pkgs/tools/networking/netboot/default.nix
index 684507a1d2e..ec49770d269 100644
--- a/pkgs/tools/networking/netboot/default.nix
+++ b/pkgs/tools/networking/netboot/default.nix
@@ -1,46 +1,33 @@
 x@{builderDefsPackage
-  , fetchgit, ...}:
+  , fetchurl, yacc, bison, ...}:
 builderDefsPackage
-(a :  
-let 
-  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    ["fetchgit"];
+(a :
+let
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++
+    [];
 
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    version="git-head-${rev}";
+    version="0.10.2";
     baseName="netboot";
-    rev="19a955cd87b399a5b56";
-    name="${baseName}-git-head";
-    url="git://github.com/ITikhonov/netboot.git";
-    hash="7610c734dc46183439c161d327e7ef6a3d5bc07b5173850b92f71ec047b109d6";
+    name="${baseName}-${version}";
+    url="mirror://sourceforge/netboot/${name}.tar.gz";
+    hash="09w09bvwgb0xzn8hjz5rhi3aibysdadbg693ahn8rylnqfq4hwg0";
   };
 in
 rec {
-  srcDrv = a.fetchgit {
+  src = a.fetchurl {
     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 = ["doBuild" "doDeploy"];
-
-  doBuild = a.fullDepEntry ''
-    gcc netboot.c -o netboot
-  '' ["doUnpack" "addInputs"];
+  phaseNames = ["doUnpack" "doConfigure" "doMakeInstall"];
 
-  doDeploy = a.fullDepEntry ''
-    mkdir -p "$out/bin"
-    cp netboot "$out/bin"
-  '' ["defEnsureDir" "minInit"];
-      
   meta = {
     description = "Mini PXE server";
     maintainers = with a.lib.maintainers;
diff --git a/pkgs/tools/networking/network-manager-applet/default.nix b/pkgs/tools/networking/network-manager-applet/default.nix
index 1a9b9485749..1f874c70ddc 100644
--- a/pkgs/tools/networking/network-manager-applet/default.nix
+++ b/pkgs/tools/networking/network-manager-applet/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl, intltool, pkgconfig, gtk, libglade, networkmanager, GConf
 , libnotify, libgnome_keyring, dbus_glib, polkit, isocodes
-, mobile_broadband_provider_info }:
+, mobile_broadband_provider_info, glib_networking, gsettings_desktop_schemas
+, makeWrapper, networkmanager_openvpn }:
 
 let
   pn = "network-manager-applet";
   major = "0.9";
-  version = "${major}.4.1";
+  version = "${major}.6.4";
 in
 
 stdenv.mkDerivation rec {
@@ -13,20 +14,30 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pn}/${major}/${name}.tar.xz";
-    sha256 = "b6b6de75e28d1fbcdfdbb51c0e40fcd6bc0ec0385bfecd16c457260491cd2ff7";
+    sha256 = "0ha16wvp2jcl96849qahaagidhiyalbjzi3nxi235y7hcnqnfmmf";
   };
 
   buildInputs = [
     gtk libglade networkmanager GConf libnotify libgnome_keyring dbus_glib
-    polkit isocodes 
+    polkit isocodes makeWrapper
   ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   makeFlags = [
     ''CFLAGS=-DMOBILE_BROADBAND_PROVIDER_INFO=\"${mobile_broadband_provider_info}/share/mobile-broadband-provider-info/serviceproviders.xml\"''
   ];
 
+  postInstall = ''
+    ln -s ${networkmanager_openvpn}/etc/NetworkManager $out/etc/NetworkManager
+    ln -s ${networkmanager_openvpn}/lib/* $out/lib
+    wrapProgram "$out/bin/nm-applet" \
+      --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share:$out/share" \
+      --set GCONF_CONFIG_SOURCE "xml::~/.gconf" \
+      --prefix PATH ":" "${GConf}/bin"
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://projects.gnome.org/NetworkManager/;
     description = "NetworkManager control applet for GNOME";
diff --git a/pkgs/tools/networking/network-manager/default.nix b/pkgs/tools/networking/network-manager/default.nix
index f7aab9fb4f2..d9e73a706db 100644
--- a/pkgs/tools/networking/network-manager/default.nix
+++ b/pkgs/tools/networking/network-manager/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, intltool, wirelesstools, pkgconfig, dbus_glib, xz
-, udev, libnl1, libuuid, polkit, gnutls, ppp, dhcp, dhcpcd, iptables
+, udev, libnl, libuuid, polkit, gnutls, ppp, dhcp, dhcpcd, iptables
 , libgcrypt, dnsmasq, avahi, bind, perl, substituteAll }:
 
 stdenv.mkDerivation rec {
   name = "network-manager-${version}";
-  version = "0.9.4.0";
+  version = "0.9.6.4";
 
   src = fetchurl {
     url = "mirror://gnome/sources/NetworkManager/0.9/NetworkManager-${version}.tar.xz";
-    sha256 = "eb4f124008b3d855a37205d03ef035b7218639cd7332bdae5567095977e93e0f";
+    sha256 = "1sx7h29j9h13qszcppja1p27zq2m7vdrylbcyb47n62x0lg426si";
   };
 
   preConfigure = ''
@@ -29,13 +29,16 @@ stdenv.mkDerivation rec {
     "--without-resolvconf"
     "--sysconfdir=/etc" "--localstatedir=/var"
     "--with-dbus-sys-dir=\${out}/etc/dbus-1/system.d"
-    "--with-crypto=gnutls" "--disable-more-warnings" ];
+    "--with-crypto=gnutls" "--disable-more-warnings"
+    "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
+    "--with-kernel-firmware-dir=/run/current-system/firmware"
+    "--with-session-tracking=systemd" ];
 
-  buildInputs = [ wirelesstools udev libnl1 libuuid polkit ppp xz ];
+  buildInputs = [ wirelesstools udev libnl libuuid polkit ppp xz ];
 
   propagatedBuildInputs = [ dbus_glib gnutls libgcrypt ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   patches =
     [ ( substituteAll {
@@ -53,11 +56,14 @@ stdenv.mkDerivation rec {
   postInstall =
     ''
       mkdir -p $out/lib/NetworkManager
+      
+      # FIXME: Workaround until NixOS' dbus+systemd supports at_console policy
+      substituteInPlace $out/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf --replace 'at_console="true"' 'group="networkmanager"'
     '';
 
   meta = with stdenv.lib; {
     homepage = http://projects.gnome.org/NetworkManager/;
-    description = "Network configuration and management in an easy way. Desktop environment independent.";
+    description = "Network configuration and management tool";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ phreedom urkud rickynils ];
     platforms = platforms.linux;
diff --git a/pkgs/tools/networking/network-manager/openvpn.nix b/pkgs/tools/networking/network-manager/openvpn.nix
new file mode 100644
index 00000000000..15da0236172
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/openvpn.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, openvpn, intltool, pkgconfig, networkmanager
+, withGnome ? true, gtk2, libgnome_keyring, procps, module_init_tools }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
+  pname = "NetworkManager-openvpn";
+  version = "0.9.6.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/0.9/${pname}-${version}.tar.xz";
+    sha256 = "18w7mlgnm7y5kg3s2jfm8biymh33ggw97bz27m5mg69kg42qgf4g";
+  };
+
+  buildInputs = [ openvpn networkmanager ]
+    ++ stdenv.lib.optionals withGnome [ gtk2 libgnome_keyring ];
+
+  nativeBuildInputs = [ intltool pkgconfig ];
+
+  configureFlags = [
+    "${if withGnome then "--with-gnome --with-gtkver=2" else "--without-gnome"}"
+    "--disable-static"
+  ];
+
+  preConfigure = ''
+     substituteInPlace "configure" \
+       --replace "/sbin/sysctl" "${procps}/sbin/sysctl"
+     substituteInPlace "src/nm-openvpn-service.c" \
+       --replace "/sbin/openvpn" "${openvpn}/sbin/openvpn" \
+       --replace "/sbin/modprobe" "${module_init_tools}/sbin/modprobe"
+     substituteInPlace "properties/auth-helpers.c" \
+       --replace "/sbin/openvpn" "${openvpn}/sbin/openvpn"
+  '';
+
+  postConfigure = ''
+     substituteInPlace "./auth-dialog/Makefile" \
+       --replace "-Wstrict-prototypes" "" \
+       --replace "-Werror" ""
+     substituteInPlace "properties/Makefile" \
+       --replace "-Wstrict-prototypes" "" \
+       --replace "-Werror" ""
+  '';
+
+  meta = {
+    description = "TODO";
+    inherit (networkmanager.meta) maintainers platforms;
+  };
+}
diff --git a/pkgs/tools/networking/network-manager/pptp-purity.patch b/pkgs/tools/networking/network-manager/pptp-purity.patch
new file mode 100644
index 00000000000..55ade68dd41
--- /dev/null
+++ b/pkgs/tools/networking/network-manager/pptp-purity.patch
@@ -0,0 +1,26 @@
+diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
+index 68a5759..568bbfe 100644
+--- a/src/nm-pptp-service.c
++++ b/src/nm-pptp-service.c
+@@ -729,9 +729,7 @@ nm_find_pppd (void)
+ {
+ 	static const char *pppd_binary_paths[] =
+ 		{
+-			"/sbin/pppd",
+-			"/usr/sbin/pppd",
+-			"/usr/local/sbin/pppd",
++			"@ppp@/sbin/pppd",
+ 			NULL
+ 		};
+ 
+@@ -751,9 +749,7 @@ nm_find_pptp (void)
+ {
+ 	static const char *pptp_binary_paths[] =
+ 		{
+-			"/sbin/pptp",
+-			"/usr/sbin/pptp",
+-			"/usr/local/sbin/pptp",
++			"@pptp@/sbin/pptp",
+ 			NULL
+ 		};
+ 
diff --git a/pkgs/tools/networking/network-manager/pptp.nix b/pkgs/tools/networking/network-manager/pptp.nix
index dc3c1643ebc..b71e41c8b56 100644
--- a/pkgs/tools/networking/network-manager/pptp.nix
+++ b/pkgs/tools/networking/network-manager/pptp.nix
@@ -1,24 +1,31 @@
-{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig
+{ stdenv, fetchurl, networkmanager, pptp, ppp, intltool, pkgconfig, substituteAll
 , withGnome ? false, gtk, libgnome_keyring }:
 
 stdenv.mkDerivation rec {
   name = "${pname}${if withGnome then "-gnome" else ""}-${version}";
   pname = "NetworkManager-pptp";
-  version = "0.9.2.0";
+  version = "0.9.4.0";
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/0.9/${pname}-${version}.tar.xz";
-    sha256 = "1fj2v8pjc17m9calckgc2jm8wbimwga8if4r21walf9xysvhsd1b";
+    sha256 = "0p93in5dn8m6dp9qs2ppfmazwqlklp5hwp9pjqr7jwvjbac75dvg";
   };
 
   buildInputs = [ networkmanager pptp ppp ]
     ++ stdenv.lib.optionals withGnome [ gtk libgnome_keyring ];
 
-  buildNativeInputs = [ intltool pkgconfig ];
+  nativeBuildInputs = [ intltool pkgconfig ];
 
   configureFlags =
     if withGnome then "--with-gnome --with-gtkver=2" else "--without-gnome";
 
+  patches =
+    [ ( substituteAll {
+        src = ./pptp-purity.patch;
+        inherit ppp pptp;
+      })
+    ];
+
   meta = {
     description = "PPtP plugin for NetworkManager";
     inherit (networkmanager.meta) maintainers platforms;
diff --git a/pkgs/tools/networking/networkmanagement/default.nix b/pkgs/tools/networking/networkmanagement/default.nix
index 682b78f2bae..474a4638758 100644
--- a/pkgs/tools/networking/networkmanagement/default.nix
+++ b/pkgs/tools/networking/networkmanagement/default.nix
@@ -2,7 +2,7 @@
 
 let
   pname = "networkmanagement";
-  version = "0.9.0";
+  version = "0.9.0.4";
   name = "${pname}-${version}";
 in
 stdenv.mkDerivation {
@@ -10,11 +10,11 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://kde/unstable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "0bxb5hzygf4szv01903zirzxjb3r2nzza9ya3rag4lkxxpwaynpd";
+    sha256 = "0mp2jai6f2qpywjwgvxcl1nh27idgy740vwiahfamq8w2y90a3aj";
   };
 
   buildInputs = [ kdelibs kde_workspace networkmanager ];
-  buildNativeInputs = [ gettext pkgconfig ];
+  nativeBuildInputs = [ gettext pkgconfig ];
 
   NIX_CFLAGS_COMPILE="-I${kde_workspace}/include/solid/control";
 
diff --git a/pkgs/tools/networking/nss-pam-ldapd/default.nix b/pkgs/tools/networking/nss-pam-ldapd/default.nix
new file mode 100644
index 00000000000..92cb053bb44
--- /dev/null
+++ b/pkgs/tools/networking/nss-pam-ldapd/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, pkgconfig, openldap, python, pam, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "nss-pam-ldapd-${version}";
+  version = "0.8.11";
+  
+  src = fetchurl {
+    url = "http://arthurdejong.org/nss-pam-ldapd/${name}.tar.gz";
+    sha256 = "9a841f6a46bf9f87213dc806c0f6507ac5016a2ee550d42c3ed9fb280c1e38e6";
+  };
+  
+  buildInputs = [ makeWrapper pkgconfig python openldap pam ];
+
+  preConfigure = ''
+    substituteInPlace Makefile.in --replace "install-data-local: " "# install-data-local: "
+  '';
+
+  configureFlags = [
+    "--with-bindpw-file=/run/nslcd/bindpw"
+    "--with-nslcd-socket=/run/nslcd/socket"
+    "--with-nslcd-pidfile=/run/nslcd/nslcd.pid"
+    "--with-pam-seclib-dir=$(out)/lib/security"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/sbin/nslcd --prefix LD_LIBRARY_PATH ":" $out/lib
+  '';
+
+  meta = {
+    description = "LDAP identity and authentication for NSS/PAM";
+    homepage = http://arthurdejong.org/nss-pam-ldapd/;
+    license = [ "GPLv21" ];
+  };
+}
diff --git a/pkgs/tools/networking/ntop/default.nix b/pkgs/tools/networking/ntop/default.nix
index 945effabcfb..48f2c9f0893 100644
--- a/pkgs/tools/networking/ntop/default.nix
+++ b/pkgs/tools/networking/ntop/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     cp ${libtool}/share/aclocal/libtool.m4 libtool.m4.in
   '';
 
-  buildNativeInputs = [ autoconf automake libtool wget libpcap gdbm zlib openssl rrdtool
+  nativeBuildInputs = [ autoconf automake libtool wget libpcap gdbm zlib openssl rrdtool
     python geoip ];
 
   meta = {
diff --git a/pkgs/tools/networking/nzbget/default.nix b/pkgs/tools/networking/nzbget/default.nix
index 7ff1ab4a5d3..c5386553f4f 100644
--- a/pkgs/tools/networking/nzbget/default.nix
+++ b/pkgs/tools/networking/nzbget/default.nix
@@ -2,20 +2,18 @@
 , gnutls, libgcrypt }:
 
 stdenv.mkDerivation rec {
-  name = "nzbget-0.8.0";
+  name = "nzbget-9.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/nzbget/${name}.tar.gz";
-    sha256 = "15bxsxdbkml9cqpy6zxgv78ff69l8qrv8r201gmzvylpc1ckjsb4";
+    sha256 = "1r4ys5nmcz1ilkdjdh3r8lawaf96i8spk6hl02h823q9rppvmya0";
   };
 
   buildInputs = [ pkgconfig libxml2 ncurses libsigcxx libpar2 gnutls libgcrypt ];
 
-  postInstall =
-    ''
-      mkdir -p $out/etc
-      cp nzbget.conf.example $out/etc/
-    '';
+  enableParallelBuilding = true;
+
+  NIX_LDFLAGS = "-lz";
 
   meta = {
     homepage = http://nzbget.sourceforge.net/;
diff --git a/pkgs/tools/networking/offlineimap/default.nix b/pkgs/tools/networking/offlineimap/default.nix
index 5a8f6b8caae..1b1aa768a25 100644
--- a/pkgs/tools/networking/offlineimap/default.nix
+++ b/pkgs/tools/networking/offlineimap/default.nix
@@ -1,20 +1,25 @@
-{ fetchurl, buildPythonPackage }:
+{ pkgs, fetchurl, buildPythonPackage, sqlite3 }:
 
 buildPythonPackage rec {
-  version = "6.5.3";
+  version = "6.5.5-rc2";
   name = "offlineimap-${version}";
 
   src = fetchurl {
-    url = "https://github.com/spaetz/offlineimap/tarball/v${version}";
+    url = "https://github.com/OfflineIMAP/offlineimap/tarball/v${version}";
     name = "${name}.tar.bz";
-    sha256 = "8717a56e6244b47b908b23b598efb3470d74450ecd881b6d3573d8aec4a5db38";
+    sha256 = "03w3irh8pxwvivi139xm5iaj2f8vmriak1ispq9d9f84z1098pd3";
   };
 
   doCheck = false;
 
+  propagatedBuildInputs = [
+    sqlite3
+  ];
+
   meta = {
     description = "OfflineImap synchronizes emails between two repositories, so that you can read the same mailbox from multiple computers.";
     homepage = "http://offlineimap.org";
-    license = "GPLv2+";
+    license = pkgs.lib.licenses.gpl2Plus;
+    maintainers = [ pkgs.lib.maintainers.garbas ];
   };
 }
diff --git a/pkgs/tools/networking/openconnect.nix b/pkgs/tools/networking/openconnect.nix
new file mode 100644
index 00000000000..d15b4cb59df
--- /dev/null
+++ b/pkgs/tools/networking/openconnect.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, vpnc, openssl, libxml2 } :
+
+stdenv.mkDerivation rec {
+  name = "openconnect-5.00";
+
+  src = fetchurl {
+    urls = [
+      "ftp://ftp.infradead.org/pub/openconnect/${name}.tar.gz"
+    ];
+    sha256 = "8bacd8d00b2c0ecf35594a8417e695b5ed3a7757467f22f980134de81ee7713a";
+  };
+
+  preConfigure = ''
+      export PKG_CONFIG=${pkgconfig}/bin/pkg-config
+      export LIBXML2_CFLAGS="-I ${libxml2}/include/libxml2"
+      export LIBXML2_LIBS="-L${libxml2}/lib -lxml2"
+      export CFLAGS="-D NO_BROKEN_DTLS_CHECK $CFLAGS"
+    '';
+
+  configureFlags = [
+    "--with-vpnc-script=${vpnc}/etc/vpnc/vpnc-script"
+    "--disable-nls"
+
+  ];
+
+  propagatedBuildInputs = [ vpnc openssl libxml2 ];
+}
diff --git a/pkgs/tools/networking/openresolv/default.nix b/pkgs/tools/networking/openresolv/default.nix
index 3aa818db728..2879c5cc1a1 100644
--- a/pkgs/tools/networking/openresolv/default.nix
+++ b/pkgs/tools/networking/openresolv/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "openresolv-3.4.6";
+  name = "openresolv-3.5.4";
 
   src = fetchurl {
     url = "http://roy.marples.name/downloads/openresolv/${name}.tar.bz2";
-    sha256 = "026z4973b0vqp5acr6mn5fyxyc84y4ahg1f8fddh8dph86jcnhba";
+    sha256 = "0in40iha4ghk12lr2p65v0by3h0jp7qsdajmj4vm7iis0plzr4db";
   };
 
   configurePhase =
diff --git a/pkgs/tools/networking/openssh/default.nix b/pkgs/tools/networking/openssh/default.nix
index f708ede2f69..9de3156f2a7 100644
--- a/pkgs/tools/networking/openssh/default.nix
+++ b/pkgs/tools/networking/openssh/default.nix
@@ -6,18 +6,18 @@
 let
 
   hpnSrc = fetchurl {
-    url = http://www.psc.edu/networking/projects/hpn-ssh/openssh-5.9p1-hpn13v12.diff.gz;
-    sha256 = "0h1h45vic4zks5bc5mvkc50rlgy2c219vn3rmpmalgm5hws9qjbl";
+    url = http://nixos.org/tarballs/openssh-6.1p1-hpn13v14.diff.gz;
+    sha256 = "14das6lim6fxxnx887ssw76ywsbvx3s4q3n43afgh5rgvs4xmnnq";
   };
 
 in
 
 stdenv.mkDerivation rec {
-  name = "openssh-6.0p1";
+  name = "openssh-6.2p1";
 
   src = fetchurl {
     url = "ftp://ftp.nl.uu.net/pub/OpenBSD/OpenSSH/portable/${name}.tar.gz";
-    sha1 = "f691e53ef83417031a2854b8b1b661c9c08e4422";
+    sha1 = "8824708c617cc781b2bb29fa20bd905fd3d2a43d";
   };
 
   prePatch = stdenv.lib.optionalString hpnSupport
@@ -25,10 +25,13 @@ stdenv.mkDerivation rec {
       gunzip -c ${hpnSrc} | patch -p1
       export NIX_LDFLAGS="$NIX_LDFLAGS -lgcc_s"
     '';
-    
-  patches = [ ./locale_archive.patch ];
 
-  buildNativeInptus = [ perl ];
+  patches =
+    [ ./locale_archive.patch
+      # Upstream fix for gratuitous "no such identity" warnings.
+      ./fix-identity-warnings.patch
+    ];
+
   buildInputs = [ zlib openssl libedit pkgconfig pam ];
 
   # I set --disable-strip because later we strip anyway. And it fails to strip
@@ -65,5 +68,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.openssh.org/;
     description = "An implementation of the SSH protocol";
     license = "bsd";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = stdenv.lib.maintainers.eelco;
   };
 }
diff --git a/pkgs/tools/networking/openssh/fix-identity-warnings.patch b/pkgs/tools/networking/openssh/fix-identity-warnings.patch
new file mode 100644
index 00000000000..c341889b3a4
--- /dev/null
+++ b/pkgs/tools/networking/openssh/fix-identity-warnings.patch
@@ -0,0 +1,251 @@
+https://bugzilla.mindrot.org/show_bug.cgi?id=2084
+
+@@ -, +, @@ 
+   - dtucker@cvs.openbsd.org 2013/02/17 23:16:57
+     [readconf.c ssh.c readconf.h sshconnect2.c]
+     Keep track of which IndentityFile options were manually supplied and which
+     were default options, and don't warn if the latter are missing.
+     ok markus@
+   - dtucker@cvs.openbsd.org 2013/02/22 04:45:09
+     [ssh.c readconf.c readconf.h]
+     Don't complain if IdentityFiles specified in system-wide configs are
+     missing.  ok djm, deraadt.
+Index: readconf.c
+===================================================================
+RCS file: /home/dtucker/openssh/cvs/openssh/readconf.c,v
+--- a/readconf.c	2 Oct 2011 07:59:03 -0000	1.174
++++ b/readconf.c	5 Apr 2013 02:36:11 -0000
+@@ -1,4 +1,4 @@ 
+-/* $OpenBSD: readconf.c,v 1.194 2011/09/23 07:45:05 markus Exp $ */
++/* $OpenBSD: readconf.c,v 1.196 2013/02/22 04:45:08 dtucker Exp $ */
+ /*
+  * Author: Tatu Ylonen <ylo@cs.hut.fi>
+  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
+@@ -326,6 +326,26 @@ clear_forwardings(Options *options)
+ 	options->tun_open = SSH_TUNMODE_NO;
+ }
+ 
++void
++add_identity_file(Options *options, const char *dir, const char *filename,
++    int userprovided)
++{
++	char *path;
++
++	if (options->num_identity_files >= SSH_MAX_IDENTITY_FILES)
++		fatal("Too many identity files specified (max %d)",
++		    SSH_MAX_IDENTITY_FILES);
++
++	if (dir == NULL) /* no dir, filename is absolute */
++		path = xstrdup(filename);
++	else
++		(void)xasprintf(&path, "%.100s%.100s", dir, filename);
++
++	options->identity_file_userprovided[options->num_identity_files] =
++	    userprovided;
++	options->identity_files[options->num_identity_files++] = path;
++}
++
+ /*
+  * Returns the number of the token pointed to by cp or oBadOption.
+  */
+@@ -353,7 +373,7 @@ parse_token(const char *cp, const char *
+ int
+ process_config_line(Options *options, const char *host,
+ 		    char *line, const char *filename, int linenum,
+-		    int *activep)
++		    int *activep, int userconfig)
+ {
+ 	char *s, **charptr, *endofnumber, *keyword, *arg, *arg2;
+ 	char **cpptr, fwdarg[256];
+@@ -586,9 +606,7 @@ parse_yesnoask:
+ 			if (*intptr >= SSH_MAX_IDENTITY_FILES)
+ 				fatal("%.200s line %d: Too many identity files specified (max %d).",
+ 				    filename, linenum, SSH_MAX_IDENTITY_FILES);
+-			charptr = &options->identity_files[*intptr];
+-			*charptr = xstrdup(arg);
+-			*intptr = *intptr + 1;
++			add_identity_file(options, NULL, arg, userconfig);
+ 		}
+ 		break;
+ 
+@@ -1075,7 +1093,7 @@ parse_int:
+ 
+ int
+ read_config_file(const char *filename, const char *host, Options *options,
+-    int checkperm)
++    int flags)
+ {
+ 	FILE *f;
+ 	char line[1024];
+@@ -1085,7 +1103,7 @@ read_config_file(const char *filename, c
+ 	if ((f = fopen(filename, "r")) == NULL)
+ 		return 0;
+ 
+-	if (checkperm) {
++	if (flags & SSHCONF_CHECKPERM) {
+ 		struct stat sb;
+ 
+ 		if (fstat(fileno(f), &sb) == -1)
+@@ -1106,7 +1124,8 @@ read_config_file(const char *filename, c
+ 	while (fgets(line, sizeof(line), f)) {
+ 		/* Update line number counter. */
+ 		linenum++;
+-		if (process_config_line(options, host, line, filename, linenum, &active) != 0)
++		if (process_config_line(options, host, line, filename, linenum,
++		    &active, flags & SSHCONF_USERCONF) != 0)
+ 			bad_options++;
+ 	}
+ 	fclose(f);
+@@ -1280,30 +1299,17 @@ fill_default_options(Options * options)
+ 		options->protocol = SSH_PROTO_2;
+ 	if (options->num_identity_files == 0) {
+ 		if (options->protocol & SSH_PROTO_1) {
+-			len = 2 + strlen(_PATH_SSH_CLIENT_IDENTITY) + 1;
+-			options->identity_files[options->num_identity_files] =
+-			    xmalloc(len);
+-			snprintf(options->identity_files[options->num_identity_files++],
+-			    len, "~/%.100s", _PATH_SSH_CLIENT_IDENTITY);
++			add_identity_file(options, "~/",
++			    _PATH_SSH_CLIENT_IDENTITY, 0);
+ 		}
+ 		if (options->protocol & SSH_PROTO_2) {
+-			len = 2 + strlen(_PATH_SSH_CLIENT_ID_RSA) + 1;
+-			options->identity_files[options->num_identity_files] =
+-			    xmalloc(len);
+-			snprintf(options->identity_files[options->num_identity_files++],
+-			    len, "~/%.100s", _PATH_SSH_CLIENT_ID_RSA);
+-
+-			len = 2 + strlen(_PATH_SSH_CLIENT_ID_DSA) + 1;
+-			options->identity_files[options->num_identity_files] =
+-			    xmalloc(len);
+-			snprintf(options->identity_files[options->num_identity_files++],
+-			    len, "~/%.100s", _PATH_SSH_CLIENT_ID_DSA);
++			add_identity_file(options, "~/",
++			    _PATH_SSH_CLIENT_ID_RSA, 0);
++			add_identity_file(options, "~/",
++			    _PATH_SSH_CLIENT_ID_DSA, 0);
+ #ifdef OPENSSL_HAS_ECC
+-			len = 2 + strlen(_PATH_SSH_CLIENT_ID_ECDSA) + 1;
+-			options->identity_files[options->num_identity_files] =
+-			    xmalloc(len);
+-			snprintf(options->identity_files[options->num_identity_files++],
+-			    len, "~/%.100s", _PATH_SSH_CLIENT_ID_ECDSA);
++			add_identity_file(options, "~/",
++			    _PATH_SSH_CLIENT_ID_ECDSA, 0);
+ #endif
+ 		}
+ 	}
+Index: readconf.h
+===================================================================
+RCS file: /home/dtucker/openssh/cvs/openssh/readconf.h,v
+--- a/readconf.h	2 Oct 2011 07:59:03 -0000	1.83
++++ b/readconf.h	5 Apr 2013 02:36:11 -0000
+@@ -1,4 +1,4 @@ 
+-/* $OpenBSD: readconf.h,v 1.91 2011/09/23 07:45:05 markus Exp $ */
++/* $OpenBSD: readconf.h,v 1.93 2013/02/22 04:45:09 dtucker Exp $ */
+ 
+ /*
+  * Author: Tatu Ylonen <ylo@cs.hut.fi>
+@@ -96,6 +96,7 @@ typedef struct {
+ 
+ 	int     num_identity_files;	/* Number of files for RSA/DSA identities. */
+ 	char   *identity_files[SSH_MAX_IDENTITY_FILES];
++	int    identity_file_userprovided[SSH_MAX_IDENTITY_FILES];
+ 	Key    *identity_keys[SSH_MAX_IDENTITY_FILES];
+ 
+ 	/* Local TCP/IP forward requests. */
+@@ -148,15 +149,20 @@ typedef struct {
+ #define REQUEST_TTY_YES		2
+ #define REQUEST_TTY_FORCE	3
+ 
++#define SSHCONF_CHECKPERM	1  /* check permissions on config file */
++#define SSHCONF_USERCONF	2  /* user provided config file not system */
++
+ void     initialize_options(Options *);
+ void     fill_default_options(Options *);
+ int	 read_config_file(const char *, const char *, Options *, int);
+ int	 parse_forward(Forward *, const char *, int, int);
+ 
+ int
+-process_config_line(Options *, const char *, char *, const char *, int, int *);
++process_config_line(Options *, const char *, char *, const char *, int, int *,
++    int);
+ 
+ void	 add_local_forward(Options *, const Forward *);
+ void	 add_remote_forward(Options *, const Forward *);
++void	 add_identity_file(Options *, const char *, const char *, int);
+ 
+ #endif				/* READCONF_H */
+Index: ssh.c
+===================================================================
+RCS file: /home/dtucker/openssh/cvs/openssh/ssh.c,v
+--- a/ssh.c	6 Jul 2012 03:45:01 -0000	1.366
++++ b/ssh.c	5 Apr 2013 02:36:11 -0000
+@@ -1,4 +1,4 @@ 
+-/* $OpenBSD: ssh.c,v 1.370 2012/07/06 01:47:38 djm Exp $ */
++/* $OpenBSD: ssh.c,v 1.372 2013/02/22 04:45:09 dtucker Exp $ */
+ /*
+  * Author: Tatu Ylonen <ylo@cs.hut.fi>
+  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
+@@ -405,12 +405,7 @@ main(int ac, char **av)
+ 				    strerror(errno));
+ 				break;
+ 			}
+-			if (options.num_identity_files >=
+-			    SSH_MAX_IDENTITY_FILES)
+-				fatal("Too many identity files specified "
+-				    "(max %d)", SSH_MAX_IDENTITY_FILES);
+-			options.identity_files[options.num_identity_files++] =
+-			    xstrdup(optarg);
++			add_identity_file(&options, NULL, optarg, 1);
+ 			break;
+ 		case 'I':
+ #ifdef ENABLE_PKCS11
+@@ -584,7 +579,8 @@ main(int ac, char **av)
+ 			dummy = 1;
+ 			line = xstrdup(optarg);
+ 			if (process_config_line(&options, host ? host : "",
+-			    line, "command-line", 0, &dummy) != 0)
++			    line, "command-line", 0, &dummy, SSHCONF_USERCONF)
++			    != 0)
+ 				exit(255);
+ 			xfree(line);
+ 			break;
+@@ -678,14 +674,15 @@ main(int ac, char **av)
+ 	 * file if the user specifies a config file on the command line.
+ 	 */
+ 	if (config != NULL) {
+-		if (!read_config_file(config, host, &options, 0))
++		if (!read_config_file(config, host, &options, SSHCONF_USERCONF))
+ 			fatal("Can't open user config file %.100s: "
+ 			    "%.100s", config, strerror(errno));
+ 	} else {
+ 		r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir,
+ 		    _PATH_SSH_USER_CONFFILE);
+ 		if (r > 0 && (size_t)r < sizeof(buf))
+-			(void)read_config_file(buf, host, &options, 1);
++			(void)read_config_file(buf, host, &options,
++			     SSHCONF_CHECKPERM|SSHCONF_USERCONF);
+ 
+ 		/* Read systemwide configuration file after user config. */
+ 		(void)read_config_file(_PATH_HOST_CONFIG_FILE, host,
+Index: sshconnect2.c
+===================================================================
+RCS file: /home/dtucker/openssh/cvs/openssh/sshconnect2.c,v
+--- a/sshconnect2.c	20 Mar 2013 01:55:15 -0000	1.184
++++ b/sshconnect2.c	5 Apr 2013 02:36:07 -0000
+@@ -1,4 +1,4 @@ 
+-/* $OpenBSD: sshconnect2.c,v 1.191 2013/02/15 00:21:01 dtucker Exp $ */
++/* $OpenBSD: sshconnect2.c,v 1.192 2013/02/17 23:16:57 dtucker Exp $ */
+ /*
+  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
+  * Copyright (c) 2008 Damien Miller.  All rights reserved.
+@@ -1384,7 +1384,7 @@ pubkey_prepare(Authctxt *authctxt)
+ 		id = xcalloc(1, sizeof(*id));
+ 		id->key = key;
+ 		id->filename = xstrdup(options.identity_files[i]);
+-		id->userprovided = 1;
++		id->userprovided = options.identity_file_userprovided[i];
+ 		TAILQ_INSERT_TAIL(&files, id, next);
+ 	}
+ 	/* Prefer PKCS11 keys that are explicitly listed */
diff --git a/pkgs/tools/networking/openvpn/default.nix b/pkgs/tools/networking/openvpn/default.nix
index 1310fb7d047..0db7c4b688f 100644
--- a/pkgs/tools/networking/openvpn/default.nix
+++ b/pkgs/tools/networking/openvpn/default.nix
@@ -1,35 +1,41 @@
-{stdenv, fetchurl, iproute, lzo, openssl}:
+{ stdenv, fetchurl, iproute, lzo, openssl, pam }:
 
 stdenv.mkDerivation rec {
-  name = "openvpn-2.2.2";
+  name = "openvpn-2.3.1";
 
   src = fetchurl {
     url = "http://swupdate.openvpn.net/community/releases/${name}.tar.gz";
-    sha256 = "005cpvdvh8pvsn3bc96lrznlkcccbz5jqa62hipb58rf1qk8pjjl";
+    sha256 = "0g7vf3f6z0h4kdqlqr8jd0gapi0ains6xcvlvfy8cicxnf2psbdx";
   };
 
-  buildInputs = [ iproute lzo openssl ];
+  buildInputs = [ iproute lzo openssl pam ];
 
   configureFlags = ''
     --enable-password-save
     --enable-iproute2
-    --with-iproute-path=${iproute}/sbin/ip
+    --enable-systemd
+    IPROUTE=${iproute}/sbin/ip
+  '';
+
+  preConfigure = ''
+    substituteInPlace ./src/openvpn/console.c \
+      --replace /bin/systemd-ask-password /run/current-system/sw/bin/systemd-ask-password
   '';
 
   postInstall = ''
     mkdir -p $out/share/doc/openvpn/examples
-    cp -r sample-config-files/ $out/share/doc/openvpn/examples
-    cp -r sample-keys/ $out/share/doc/openvpn/examples
-    cp -r easy-rsa/ $out/share/doc/openvpn/examples
-    rm -r $out/share/doc/openvpn/examples/easy-rsa/Windows
-    cp -r sample-scripts/ $out/share/doc/openvpn/examples
+    cp -r sample/sample-config-files/ $out/share/doc/openvpn/examples
+    cp -r sample/sample-keys/ $out/share/doc/openvpn/examples
+    cp -r sample/sample-scripts/ $out/share/doc/openvpn/examples
   '';
 
-  meta = { 
-      description="OpenVPN is a robust and highly flexible tunneling application compatible with many OSes.";
-      homepage="http://openvpn.net/";
-      license = "GPLv2";
-      maintainers = with stdenv.lib.maintainers; [viric];
-      platforms = with stdenv.lib.platforms; linux;
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A robust and highly flexible tunneling application";
+    homepage = http://openvpn.net/;
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/tools/networking/oslrd/default.nix b/pkgs/tools/networking/oslrd/default.nix
new file mode 100644
index 00000000000..18fdae2a44f
--- /dev/null
+++ b/pkgs/tools/networking/oslrd/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, bison, flex }:
+
+stdenv.mkDerivation rec {
+  name = "olsrd-0.6.5.4";
+
+  src = fetchurl {
+    url = "http://www.olsr.org/releases/0.6/${name}.tar.bz2";
+    sha256 = "757327b9a22b066bd0cab2a8e1cdd1c462f474bb99864a175388aa5f0c70504c";
+  };
+
+  buildInputs = [ bison flex ];
+
+  preConfigure = ''
+    makeFlags="prefix=$out ETCDIR=$out/etc"
+  '';
+
+  meta = {
+    description = "An adhoc wireless mesh routing daemon";
+    license = "BSD";
+    homepage = "http://olsr.org/";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
index 5ef4a640d2a..277e95eac96 100644
--- a/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
+++ b/pkgs/tools/networking/p2p/tahoe-lafs/default.nix
@@ -8,15 +8,15 @@
 # some loss of functionality because of it.
 
 let
-  name = "tahoe-lafs-1.8.3";
+  name = "tahoe-lafs-1.9.2";
 in
 buildPythonPackage {
   inherit name;
   namePrefix = "";
 
   src = fetchurl {
-    url = "http://tahoe-lafs.org/source/tahoe-lafs/snapshots/allmydata-tahoe-1.8.3.tar.bz2";
-    sha256 = "00pm7fvwci5ncg2jhsqsl9r79kn495yni8nmr7p5i98f3siwvjd8";
+    url = "http://tahoe-lafs.org/source/tahoe-lafs/snapshots/allmydata-tahoe-1.9.2.tar.bz2";
+    sha256 = "0111gmavyrnglx10kj8z7wm7y97fyg9isv71c0gx9kq4c03knxq4";
   };
 
   # The patch doesn't apply cleanly to the current version.
@@ -37,7 +37,7 @@ buildPythonPackage {
         -es"|cmd = find_exe.find_exe('twistd')|cmd = ['${twisted}/bin/twistd']|g"
 
     sed -i "src/allmydata/util/iputil.py" \
-        -es"|_linux_path = '/sbin/ifconfig'|_linux_path = '${nettools}/sbin/ifconfig'|g"
+        -es"|_linux_path = '/sbin/ifconfig'|_linux_path = '${nettools}/bin/ifconfig'|g"
 
     # Chroots don't have /etc/hosts and /etc/resolv.conf, so work around
     # that.
@@ -71,10 +71,9 @@ buildPythonPackage {
     find "$out/share/doc/${name}" -name Makefile -exec rm -v {} \;
 
     # Run the tests once everything is installed.
-    # FIXME: Some of the tests want to run $out/bin/tahoe, which isn't usable
-    # yet because it gets wrapped later on, in `postFixup'.
     export PYTHON_EGG_CACHE="$TMPDIR"
-    : python setup.py trial
+    python setup.py build
+    python setup.py trial
   '';
 
   meta = {
diff --git a/pkgs/tools/networking/p2p/tahoe-lafs/test-timeout.patch b/pkgs/tools/networking/p2p/tahoe-lafs/test-timeout.patch
deleted file mode 100644
index f9867e64bf8..00000000000
--- a/pkgs/tools/networking/p2p/tahoe-lafs/test-timeout.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-See http://thread.gmane.org/gmane.comp.file-systems.tahoe.devel/3194 .
-
---- allmydata-tahoe-1.6.1/src/allmydata/test/test_immutable.py	2010-02-28 00:36:14.000000000 +0100
-+++ allmydata-tahoe-1.6.1/src/allmydata/test/test_immutable.py	2010-03-02 11:40:38.000000000 +0100
-@@ -6,6 +6,7 @@ from twisted.trial import unittest
- import random
- 
- class Test(common.ShareManglingMixin, unittest.TestCase):
-+    timeout = 240
-     def test_test_code(self):
-         # The following process of stashing the shares, running
-         # replace_shares, and asserting that the new set of shares equals the
diff --git a/pkgs/tools/networking/pptp/default.nix b/pkgs/tools/networking/pptp/default.nix
index adb22a8d9c6..5bfb6f58bea 100644
--- a/pkgs/tools/networking/pptp/default.nix
+++ b/pkgs/tools/networking/pptp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, ppp }:
+{ stdenv, fetchurl, perl, ppp, iproute }:
 
 stdenv.mkDerivation rec {
   name = "pptp-1.7.2";
@@ -11,6 +11,7 @@ stdenv.mkDerivation rec {
   patchPhase =
     ''
       sed -e 's/install -o root/install/' -i Makefile
+      sed -e 's,/bin/ip,${iproute}/sbin/ip,' -i routing.c
     '';
   preConfigure =
     ''
@@ -18,7 +19,7 @@ stdenv.mkDerivation rec {
           MANDIR=$out/share/man/man8 PPPDIR=$out/etc/ppp )
     '';
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     description = "PPTP client for Linux";
diff --git a/pkgs/tools/networking/pwnat/default.nix b/pkgs/tools/networking/pwnat/default.nix
new file mode 100644
index 00000000000..63919edd505
--- /dev/null
+++ b/pkgs/tools/networking/pwnat/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "pwnat-0.3-beta";
+
+  src = fetchurl {
+    url = "http://samy.pl/pwnat/${name}.tgz";
+    sha256 = "18ihs6wk7zni2w0pqip7i61hyi6n60v5rgj6z7j543fgy4afmmnm";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/pwnat
+    cp pwnat $out/bin
+    cp README* COPYING* $out/share/pwnat
+  '';
+
+  meta = {
+    homepage = http://samy.pl/pwnat/;
+    description = "ICMP NAT to NAT client-server communication";
+    license = "GPLv3+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/networking/reaver-wps/default.nix b/pkgs/tools/networking/reaver-wps/default.nix
new file mode 100644
index 00000000000..a057985b48c
--- /dev/null
+++ b/pkgs/tools/networking/reaver-wps/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, libpcap, sqlite }:
+
+stdenv.mkDerivation rec {
+  name = "reaver-wps-1.4";
+
+  src = fetchurl {
+    url = http://reaver-wps.googlecode.com/files/reaver-1.4.tar.gz;
+    sha256 = "0bdjai4p8xbsw8zdkkk43rgsif79x0nyx4djpyv0mzh59850blxd";
+  };
+
+  buildInputs = [ libpcap sqlite ];
+
+  prePatch = ''
+    cd src
+  '';
+
+  preInstall = ''
+    ensureDir $out/bin
+  '';
+
+  meta = {
+    description = "Brute force attack against Wifi Protected Setup";
+    homepage = http://code.google.com/p/reaver-wps;
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/tools/networking/samplicator/default.nix b/pkgs/tools/networking/samplicator/default.nix
new file mode 100644
index 00000000000..a8733a7305a
--- /dev/null
+++ b/pkgs/tools/networking/samplicator/default.nix
@@ -0,0 +1,17 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "samplicator-${version}";
+  version = "1.3.7-beta6";
+
+  src = fetchurl {
+    url = "http://samplicator.googlecode.com/files/${name}.tar.gz";
+    sha1 = "2091af1898d6508ad9fd338a07e352e2387522d4";
+  };
+
+  meta = {
+    description = "Send copies of (UDP) datagrams to multiple receivers";
+    homepage = "http://code.google.com/p/samplicator/";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/tools/networking/sitecopy/default.nix b/pkgs/tools/networking/sitecopy/default.nix
index 6beaff56aea..5667744ef22 100644
--- a/pkgs/tools/networking/sitecopy/default.nix
+++ b/pkgs/tools/networking/sitecopy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, neon, zlib, openssl, autoconf, automake, libtool }:
+{ stdenv, fetchurl, neon, zlib, openssl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "sitecopy-0.16.6";
@@ -10,9 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./neon-29.patch ];
 
-  preConfigure = "autoreconf";
-
-  buildInputs = [ openssl neon zlib autoconf automake libtool ]; 
+  buildInputs = [ openssl neon zlib autoreconfHook ]; 
 
   configureFlags= "--with-ssl=openssl"; 
 }
diff --git a/pkgs/tools/networking/snx/default.nix b/pkgs/tools/networking/snx/default.nix
new file mode 100644
index 00000000000..7a73314d0e3
--- /dev/null
+++ b/pkgs/tools/networking/snx/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, makeWrapper, libX11, pam, gcc33 }:
+
+let
+  # The proper value for this offset can be found at the top of the snx_install script.
+  archiveOffset = "78";
+  libraryPath = stdenv.lib.makeSearchPath "lib" [libX11 pam gcc33.gcc];
+in
+stdenv.mkDerivation rec {
+  name = "snx-800007027";
+
+  src = fetchurl {
+    url = "https://remote.us.publicisgroupe.net/CSHELL/snx_install.sh";
+    sha256 = "1yq0r8gb6jw5pyfrw3wxvplrxxfhbhgm9ph4gyd754fyn52iwgxv";
+  };
+
+  buildInputs = [makeWrapper];
+
+  unpackPhase = ''
+    tail -n +${archiveOffset} ${src} | bunzip2 -c - | tar xfvp -
+  '';
+
+  buildPhase = ''
+    patchelf --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" snx
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/sbin" "$out/libexec"
+    mv snx "$out/libexec/"
+    makeWrapper "$out/libexec/snx" "$out/sbin/snx" --prefix LD_LIBRARY_PATH ":" "${libraryPath}"
+  '';
+
+  meta = {
+    homepage = "https://www.checkpoint.com/";
+    description = "Check Point SSL Network Extender";
+    license = "unknown";
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/tools/networking/socat/default.nix b/pkgs/tools/networking/socat/default.nix
index 7028c3bf605..727bbe08605 100644
--- a/pkgs/tools/networking/socat/default.nix
+++ b/pkgs/tools/networking/socat/default.nix
@@ -1,17 +1,20 @@
 { stdenv, fetchurl, openssl }:
 
 stdenv.mkDerivation rec {
-  name = "socat-1.7.2.0";
-  
+  name = "socat-1.7.2.1";
+
   src = fetchurl {
     url = "http://www.dest-unreach.org/socat/download/${name}.tar.bz2";
-    sha256 = "00hq0ia1fs4sy0qpavzlpf4qmnhh2ybq5is2kqzvqky14zlvvcsr";
+    sha256 = "0xw2qmmixv7jwsrgx2vy54bq695d6my3pm3z4dcpmf9vqvb2xsps";
   };
 
   buildInputs = [ openssl ];
-      
+
   meta = {
-    description = "Socat - a different replacement for netcat";
-    homepage = "http://www.dest-unreach.org/socat/";
+    description = "A utility for bidirectional data transfer between two independent data channels";
+    homepage = http://www.dest-unreach.org/socat/;
+    platforms = stdenv.lib.platforms.linux;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = stdenv.lib.maintainers.eelco;
   };
 }
diff --git a/pkgs/tools/networking/stunnel/default.nix b/pkgs/tools/networking/stunnel/default.nix
index d16d9bfb089..cb93e8a504b 100644
--- a/pkgs/tools/networking/stunnel/default.nix
+++ b/pkgs/tools/networking/stunnel/default.nix
@@ -1,14 +1,18 @@
 { stdenv, fetchurl, openssl }:
 
 stdenv.mkDerivation {
-  name = "stunnel-4.53";
+  name = "stunnel-4.56";
   
   src = fetchurl {
-    url = http://www.stunnel.org/downloads/stunnel-4.53.tar.gz;
-    sha256 = "3e640aa4c96861d10addba758b66e99e7c5aec8697764f2a59ca2268901b8e57";
+    url = http://www.stunnel.org/downloads/stunnel-4.56.tar.gz;
+    sha256 = "14qjhwfa0y17ipnd5mc970vfmralvgaxfl6fk0rl91vdwbxjrblw";
   };
 
   buildInputs = [openssl];
+
+  configureFlags = [
+    "--with-ssl=${openssl}"
+  ];
   
   meta = {
     description = "Stunnel - Universal SSL wrapper";
diff --git a/pkgs/tools/networking/surfraw/default.nix b/pkgs/tools/networking/surfraw/default.nix
new file mode 100644
index 00000000000..bd3a1135a84
--- /dev/null
+++ b/pkgs/tools/networking/surfraw/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, perl}:
+
+stdenv.mkDerivation rec {
+  name = "surfraw-2.2.8";
+
+  src = fetchurl {
+    url = "http://surfraw.alioth.debian.org/dist/surfraw-2.2.8.tar.gz";
+    sha256 = "925075e05637e39458b00e859193aacde306aafd9a962f44f5114f81713539ec";
+  };
+
+  configureFlags = [
+    "--disable-opensearch"
+  ];
+
+  nativeBuildInputs = [ perl ];
+
+  meta = {
+    description = "Provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power";
+    homepage = "http://surfraw.alioth.debian.org";
+    maintainers = [];
+  };
+}
diff --git a/pkgs/tools/networking/tcng/default.nix b/pkgs/tools/networking/tcng/default.nix
deleted file mode 100644
index 062977b455c..00000000000
--- a/pkgs/tools/networking/tcng/default.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ stdenv, fetchurl, bison, flex, db4, perl, kernel, iproute }:
-
-# tcc can even compile kernel modules for speed reason.
-# that would be a nice use case to test!
-
-# something is still wrong. The output can't be pasred sometimes
-# Eg it contains continue/pass,drop/pass, drop/drop. I've replaced
-# them by ok, drop, drop using sed. I'm not sure wether this is the correct way
-# Man pages are missing as well. So use the link at the bottom
-
-let version = "10b"; in
-
-stdenv.mkDerivation {
-
-  name = "tcng-${version}";
-
-  src = fetchurl {
-    url = mirror://debian/pool/main/t/tcng/tcng_10b.orig.tar.gz;
-    sha256 = "1xjs0yn90rfa8ibxybg3gab1xzcjg60njymq2bd1b0a9i0arx7ji";
-  };
-
-  iproute2Src = iproute.src;
-
-  patches =
-    [ (fetchurl {
-        url = mirror://debian/pool/main/t/tcng/tcng_10b-2.diff.gz;
-        sha256 = "17i4s2ffif0k4b78gfhkp08lvvharbfvyhwbd0vkwgpria0b9zrd";
-      })
-    ];
-  
-  # one mailinglist post says you should just add your kernel version to the list.. (?)
-  patchPhase = ''
-    unset patchPhase
-    patchPhase
-    unpackFile $iproute2Src
-    IPROUTESRC=$(echo iproute*)
-    for script in $(find . -type f); do sed -e 's@#![ ]*/bin/bash@#! /bin/sh@' -i $script; done
-    find . -type f | xargs sed -i 's@/usr/bin/perl@${perl}/bin/perl@g'
-    find . -type f | xargs sed -i 's@/lib/cpp@cpp@g'
-  '';
-
-  # gentoo ebulid says tcsim doesn't compile with 2.6 headers..
-  # DATADIR can still be overridden by env TOPDIR=...
-  # Don't know whats it for except including the default .tc files
-  configurePhase=''
-    cat >> config << EOF
-    YACC="yacc"
-    DATA_DIR="$out/lib/tcng"
-    EOF
-    ./configure \
-    --kernel ${kernel}/lib/modules/2.6.28.6-default/build \
-    --iproute2 $IPROUTESRC \
-    --install-directory $out \
-    --no-manual \
-    --with-tcsim
-  '';
-
-  # hacky, how to enable building tcc the correct way?
-  # adding shared and tcc to SUBDIRS and run make again isn't nice but works
-  buildPhase = ''
-    sed -i 's@^\(SUBDIRS.*\)@\1 shared tcc@' Makefile 
-    make
-  '';
-
-  # manually copy tcc and include files.. see comment above
-  installPhase = ''
-    mkdir -p $out{,/sbin,/lib/tcng/include}
-    make DESTDIR=$out install
-    cp tcc/tcc $out/sbin
-    cp tcc/*.tc $out/lib/tcng/include
-  '';
-
-  buildInputs = [ bison flex db4 perl ];
-
-  meta = { 
-    description = "tcng - Traffic Control Next Generation";
-    homepage = "http://tcng.sourceforge.net/";
-    license = "GPLv2";
-  };
-}
diff --git a/pkgs/tools/networking/tcpdump/default.nix b/pkgs/tools/networking/tcpdump/default.nix
index b4b96a549e1..f987d6fa6ba 100644
--- a/pkgs/tools/networking/tcpdump/default.nix
+++ b/pkgs/tools/networking/tcpdump/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, libpcap, enableStatic ? false }:
 
 stdenv.mkDerivation rec {
-  name = "tcpdump-4.2.1";
+  name = "tcpdump-4.4.0";
 
   src = fetchurl {
     url = "http://www.tcpdump.org/release/${name}.tar.gz";
-    sha256 = "1zwv9zp169dwqwwwi6lfd3fhiayiq81ijqmwi0pfdvw63skfjmsl";
+    sha256 = "1g9h2p31xwpdg88v7wv9hc8calq8sjs25800vzd9i45q5knln9qj";
   };
 
   buildInputs = [ libpcap ];
diff --git a/pkgs/tools/networking/tinc/default.nix b/pkgs/tools/networking/tinc/default.nix
new file mode 100644
index 00000000000..dd6bfb82aab
--- /dev/null
+++ b/pkgs/tools/networking/tinc/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, lzo, openssl, zlib}:
+
+stdenv.mkDerivation rec {
+  version = "1.0.21";
+  name = "tinc-${version}";
+
+  src = fetchurl {
+    url = "http://www.tinc-vpn.org/packages/tinc-${version}.tar.gz";
+    sha256 = "12v1x9p4f8y9967ypwxhkr10q6pk4cdallr0k4lic0kcfsmmxhba";
+  };
+
+  buildInputs = [ lzo openssl zlib ];
+
+  configureFlags = ''
+    --localstatedir=/var
+    --sysconfdir=/etc
+  '';
+
+  meta = { 
+    description = "VPN daemon with full mesh routing";
+    longDescription = ''
+      tinc is a Virtual Private Network (VPN) daemon that uses tunnelling and
+      encryption to create a secure private network between hosts on the
+      Internet.  It features full mesh routing, as well as encryption,
+      authentication, compression and ethernet bridging.
+    '';
+    homepage="http://www.tinc-vpn.org/";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/tools/networking/udptunnel/default.nix b/pkgs/tools/networking/udptunnel/default.nix
new file mode 100644
index 00000000000..88ee926e406
--- /dev/null
+++ b/pkgs/tools/networking/udptunnel/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "udptunnel-19";
+
+  src = fetchurl {
+    url = http://udptunnel.googlecode.com/files/udptunnel-r19.tar.gz;
+    sha1 = "51edec3b63b659229bcf92f6157568d3b074ede0";
+  };
+
+  installPhase = ''
+    ensureDir $out/bin $out/share/udptunnel
+    cp udptunnel $out/bin
+    cp README COPYING* $out/share/udptunnel
+  '';
+
+  meta = {
+    homepage = http://code.google.com/p/udptunnel/;
+    description = "Tunnels TCP over UDP packets";
+    license = "GPLv3+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/networking/wbox/default.nix b/pkgs/tools/networking/wbox/default.nix
new file mode 100644
index 00000000000..aa29b8be34f
--- /dev/null
+++ b/pkgs/tools/networking/wbox/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "wbox-${version}";
+  version = "5";
+
+  installPhase = ''
+    install -vD wbox "$out/bin/wbox"
+  '';
+
+  src = fetchurl {
+    url = "http://www.hping.org/wbox/${name}.tar.gz";
+    sha256 = "06daxwbysppvbh1mwprw8fgsp6mbd3kqj7a978w7ivn8hdgdi28m";
+  };
+
+  meta = {
+    description = "A simple HTTP benchmarking tool";
+    homepage = "http://www.hping.org/wbox/";
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/tools/networking/weighttp/default.nix b/pkgs/tools/networking/weighttp/default.nix
new file mode 100644
index 00000000000..3bf23275a18
--- /dev/null
+++ b/pkgs/tools/networking/weighttp/default.nix
@@ -0,0 +1,15 @@
+{ stdenv, fetchurl, python, libev}:
+stdenv.mkDerivation {
+  name = "weighttp-0.3";
+  src = fetchurl {
+    url = http://cgit.lighttpd.net/weighttp.git/snapshot/weighttp-0.3.tar.gz;
+    sha256 = "0gl83vnip3nj7fdgbwqkmrx7kxp51sri9jfiwd04q9iz8f9bsmz5";
+  };
+
+  buildInputs = [ python libev ];
+  installPhase = ''
+    python waf configure --prefix=$out
+    python waf build
+    python waf install
+  '';
+}
diff --git a/pkgs/tools/networking/wget/default.nix b/pkgs/tools/networking/wget/default.nix
index 799c5e9dd85..3b6c28d2ac1 100644
--- a/pkgs/tools/networking/wget/default.nix
+++ b/pkgs/tools/networking/wget/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, gettext, perl, LWP, gnutls ? null }:
 
 stdenv.mkDerivation rec {
-  name = "wget-1.13.4";
+  name = "wget-1.14";
 
   src = fetchurl {
-    url = "mirror://gnu/wget/${name}.tar.gz";
-    sha256 = "1kadjg63x1mm741dxdidwsn1rz0f7dkzbq59v0iww87jr45p3ir4";
+    url = "mirror://gnu/wget/${name}.tar.xz";
+    sha256 = "0yqllj3nv9p3vqbdm6j4nvpjcwf1y19rq8sd966nrbd2qvvxfq8p";
   };
 
   preConfigure = stdenv.lib.optionalString doCheck
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
        done
     '';
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
   buildInputs =
     stdenv.lib.optionals doCheck [ perl LWP ]
     ++ stdenv.lib.optional (gnutls != null) gnutls;
diff --git a/pkgs/tools/networking/wicd/default.nix b/pkgs/tools/networking/wicd/default.nix
index 6332ff8ad5d..47e417ffd8a 100644
--- a/pkgs/tools/networking/wicd/default.nix
+++ b/pkgs/tools/networking/wicd/default.nix
@@ -1,21 +1,29 @@
 {stdenv, fetchurl, python, pygobject, pycairo, pyGtkGlade, pythonDBus, 
- wpa_supplicant, dhcp, dhcpcd, wirelesstools, nettools, iproute,
- locale ? "C" }:
+ wpa_supplicant, dhcp, dhcpcd, wirelesstools, nettools, openresolv, iproute, iputils,
+ pythonPackages, locale ? "C" }:
 
 # Wicd has a ncurses interface that we do not build because it depends
 # on urwid which has not been packaged at this time (2009-12-27).
 
 stdenv.mkDerivation rec {
-  name = "wicd-1.7.1-beta2";
+  name = "wicd-${version}";
+  version = "1.7.2.4";
   
   src = fetchurl {
-    url = "mirror://sourceforge/wicd/wicd-1.7.1b2.tar.bz2";
-    sha256 = "13ga6a2ip8dy8h49wvv02jxxfvpk5q5sm2wz76dy62y1xsrm23c1";
+    url = "https://launchpad.net/wicd/1.7/${version}/+download/${name}.tar.gz";
+    sha256 = "15ywgh60xzmp5z8l1kzics7yi95isrjg1paz42dvp7dlpdfzpzfw";
   };
 
-  buildInputs = [ python ];
+  buildInputs = [ python pythonPackages.Babel ];
 
-  patches = [ ./no-var-install.patch ./mkdir-networks.patch ./pygtk.patch ./no-optimization.patch ];
+  patches = [
+    ./no-var-install.patch
+    ./pygtk.patch
+    ./no-optimization.patch
+    ./dhclient.patch 
+    ./fix-app-icon.patch
+    ./fix-gtk-issues.patch
+    ];
 
   # Should I be using pygtk's propogated build inputs?
   # !!! Should use makeWrapper.
@@ -24,16 +32,16 @@ stdenv.mkDerivation rec {
     substituteInPlace wicd/wicd-daemon.py --replace 'misc.find_path("python2")' "'${python}/bin/python'"
     
     substituteInPlace in/scripts=wicd.in --subst-var-by TEMPLATE-DEFAULT $out/share/other/dhclient.conf.template.default
-    
-    sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin:${wpa_supplicant}/sbin:${dhcpcd}/sbin:${dhcp}/sbin:${wirelesstools}/sbin:${nettools}/sbin:${iproute}/sbin" in/scripts=wicd.in
-    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pythonDBus})" in/scripts=wicd.in
-    sed -i "4iexport LC_ALL=\\\"${locale}\\\"" in/scripts=wicd.in
+
+    sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin:${wpa_supplicant}/sbin:${dhcpcd}/sbin:${dhcp}/sbin:${wirelesstools}/sbin:${nettools}/sbin:${nettools}/bin:${iputils}/bin:${openresolv}/sbin:${iproute}/sbin" in/scripts=wicd.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pygobject}):$(toPythonPath ${pythonDBus})" in/scripts=wicd.in
     sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-client.in
-    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-client.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject}):$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-client.in
     sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-gtk.in
-    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-gtk.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject}):$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-gtk.in
     sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-cli.in
-    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-cli.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject}):$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-cli.in
+    rm po/ast.po
   '';
 
   configurePhase = ''
@@ -57,11 +65,14 @@ stdenv.mkDerivation rec {
     --suspend=$out/etc/acpi/suspend.d/ \
     --pmutils=$out/lib/pm-utils/sleep.d/ \
     --dbus=$out/etc/dbus-1/system.d/ \
+    --dbus-service=$out/etc/dbus-1/system-services/ \
+    --systemd=$out/lib/systemd/ \
+    --logrotate=$out/etc/logrotate.d/ \
     --desktop=$out/share/applications/ \
-    --icons=$out/share/icons/hicolour/ \
+    --icons=$out/share/icons/hicolor/ \
     --translations=$out/share/locale/ \
     --autostart=$out/etc/xdg/autostart/ \
-    --varlib=/var/lib/wicd/ \
+    --varlib=$out/var/lib/ \
     --docdir=$out/share/doc/ \
     --mandir=$out/share/man/ \
     --kdedir=$out/share/autostart/ \
@@ -76,7 +87,7 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
-    python setup.py install --prefix=$out
+    python setup.py install --prefix=$out --install-lib=$out/lib/${python.libPrefix}/site-packages
     mkdir -p $out/share/other
     cp other/dhclient.conf.template.default $out/share/other/dhclient.conf.template.default
 
@@ -85,19 +96,6 @@ stdenv.mkDerivation rec {
     # <http://wicd.net/punbb/viewtopic.php?id=87>.
     cp -v "${./wpa2-ttls}" "$out/etc/encryption/templates/wpa2-ttls"
     echo "wpa2-ttls" >> "$out/etc/encryption/templates/active"
-
-    # have wicd generate upstart events
-    echo '#!/bin/sh
-initctl emit -n wicd-preconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/preconnect/upstart-emit
-    echo '#!/bin/sh
-initctl emit -n wicd-postconnect ITYPE="$1" ESSID="$2" BSSID="$3"
-initctl emit -n ip-up' > $out/etc/scripts/postconnect/upstart-emit
-    echo '#!/bin/sh
-initctl emit -n wicd-predisconnect ITYPE="$1" ESSID="$2" BSSID="$3"' > $out/etc/scripts/predisconnect/upstart-emit
-    echo '#!/bin/sh
-initctl emit -n wicd-postdisconnect ITYPE="$1" ESSID="$2" BSSID="$3"
-initctl emit -n ip-down' > $out/etc/scripts/postdisconnect/upstart-emit
-    chmod a+x $out/etc/scripts/*/upstart-emit
   '';
 
   meta = {
diff --git a/pkgs/tools/networking/wicd/dhclient.patch b/pkgs/tools/networking/wicd/dhclient.patch
new file mode 100644
index 00000000000..52d91846518
--- /dev/null
+++ b/pkgs/tools/networking/wicd/dhclient.patch
@@ -0,0 +1,101 @@
+diff -ruN wicd-1.7.2.4.orig/wicd/wnettools.py wicd-1.7.2.4/wicd/wnettools.py
+--- wicd-1.7.2.4.orig/wicd/wnettools.py	2013-03-30 21:47:19.804907552 +0000
++++ wicd-1.7.2.4/wicd/wnettools.py	2013-03-31 08:44:37.572792110 +0000
+@@ -37,6 +37,7 @@
+ import time
+ from string import maketrans, translate
+ 
++import tempfile
+ import wpath
+ import misc
+ from misc import find_path 
+@@ -216,6 +217,7 @@
+         self.flush_tool = None
+         self.link_detect = None       
+         self.dhcp_object = None
++        self.dhclient_conf_path = None;
+     
+     def SetDebugMode(self, value):
+         """ If True, verbose output is enabled. """
+@@ -277,12 +279,6 @@
+                 cmd = ""
+             return (client, cmd)
+ 
+-                # probably /var/lib/wicd/dhclient.conf with defaults
+-        dhclient_conf_path = os.path.join(
+-                    wpath.varlib,
+-                    'dhclient.conf'
+-                )
+-        
+         client_dict = {
+             "dhclient" : 
+                 {'connect' : r"%(cmd)s -cf %(dhclientconf)s %(iface)s",
+@@ -307,41 +303,44 @@
+         }
+         (client_name, cmd) = get_client_name(self.DHCP_CLIENT)
+ 
+-        # cause dhclient doesn't have a handy dandy argument
+-        # for specifing the hostname to be sent
+-        if client_name == "dhclient" and flavor:
+-            if hostname == None:
+-                # <hostname> will use the system hostname
+-                # we'll use that if there is hostname passed
+-                # that shouldn't happen, though
+-                hostname = '<hostname>'
+-            print 'attempting to set hostname with dhclient'
+-            print 'using dhcpcd or another supported client may work better'
+-            dhclient_template = \
+-                open(os.path.join(wpath.etc, 'dhclient.conf.template'), 'r')
+-
+-            output_conf = open(dhclient_conf_path, 'w')
+-
+-            for line in dhclient_template.readlines():
+-                line = line.replace('$_HOSTNAME', hostname)
+-                output_conf.write(line)
+-
+-            output_conf.close()
+-            dhclient_template.close()
+-            os.chmod(dhclient_conf_path, 0644)
+-
+         if not client_name or not cmd:
+             print "WARNING: Failed to find a valid dhcp client!"
+             return ""
+             
+         if flavor == "connect":
++            # cause dhclient doesn't have a handy dandy argument
++            # for specifing the hostname to be sent
++            if client_name == "dhclient" and flavor:
++                if hostname == None:
++                    # <hostname> will use the system hostname
++                    # we'll use that if there is hostname passed
++                    # that shouldn't happen, though
++                    hostname = '<hostname>'
++                print 'attempting to set hostname with dhclient'
++                print 'using dhcpcd or another supported client may work better'
++                if not self.dhclient_conf_path:
++                    _,self.dhclient_conf_path = tempfile.mkstemp()
++                    print 'New dhclient conf path: %s ' % self.dhclient_conf_path
++                dhclient_template = \
++                    open(os.path.join(wpath.etc, 'dhclient.conf.template'), 'r')
++
++                output_conf = open(self.dhclient_conf_path, 'w')
++
++                for line in dhclient_template.readlines():
++                    line = line.replace('$_HOSTNAME', hostname)
++                    output_conf.write(line)
++
++                output_conf.close()
++                dhclient_template.close()
++                os.chmod(self.dhclient_conf_path, 0644)
++
+             if not hostname:
+                 hostname = os.uname()[1]
+             return client_dict[client_name]['connect'] % \
+                     { "cmd" : cmd,
+                       "iface" : self.iface,
+                       "hostname" : hostname,
+-                      'dhclientconf' : dhclient_conf_path }
++                      'dhclientconf' : self.dhclient_conf_path }
+         elif flavor == "release":
+             return client_dict[client_name]['release'] % {"cmd":cmd, "iface":self.iface}
+         else:
diff --git a/pkgs/tools/networking/wicd/fix-app-icon.patch b/pkgs/tools/networking/wicd/fix-app-icon.patch
new file mode 100644
index 00000000000..31b47bb4588
--- /dev/null
+++ b/pkgs/tools/networking/wicd/fix-app-icon.patch
@@ -0,0 +1,19 @@
+Someone forgot to pack wicd.png icon. We will replace it with existing one.
+
+diff -ruN wicd-1.7.2.4.orig/gtk/gui.py wicd-1.7.2.4/gtk/gui.py
+--- wicd-1.7.2.4.orig/gtk/gui.py	2013-03-30 21:47:19.802907553 +0000
++++ wicd-1.7.2.4/gtk/gui.py	2013-03-31 08:13:32.876871673 +0000
+@@ -205,8 +205,10 @@
+ 
+         self.status_area.hide_all()
+ 
+-        if os.path.exists(os.path.join(wpath.images, "wicd.png")):
+-            self.window.set_icon_from_file(os.path.join(wpath.images, "wicd.png"))
++        if os.path.exists(os.path.join(wpath.images, "../../icons/hicolour/128x128/apps/wicd-gtk.png")):
++            self.window.set_icon_from_file(os.path.join(wpath.images, "../../icons/hicolor/128x128/apps/wicd-gtk.png"))
++        else:
++            print 'icon doesn\'t exist %s' % os.path.join(wpath.images, "../../icons/hicolor/128x128/apps/wicd-gtk.png")
+         self.statusID = None
+         self.first_dialog_load = True
+         self.is_visible = True
+
diff --git a/pkgs/tools/networking/wicd/fix-gtk-issues.patch b/pkgs/tools/networking/wicd/fix-gtk-issues.patch
new file mode 100644
index 00000000000..31e553b46b5
--- /dev/null
+++ b/pkgs/tools/networking/wicd/fix-gtk-issues.patch
@@ -0,0 +1,47 @@
+diff -ruN wicd-1.7.2.4.orig/gtk/gui.py wicd-1.7.2.4/gtk/gui.py
+--- wicd-1.7.2.4.orig/gtk/gui.py	2013-03-31 17:01:29.367001288 +0000
++++ wicd-1.7.2.4/gtk/gui.py	2013-03-31 17:55:20.826028396 +0000
+@@ -35,7 +35,7 @@
+ from wicd import misc
+ from wicd import wpath
+ from wicd import dbusmanager
+-from wicd.misc import noneToString
++from wicd.misc import noneToString, _status_dict
+ from wicd.translations import _, language
+ import prefs
+ from prefs import PreferencesDialog
+@@ -250,7 +250,7 @@
+         
+     def handle_connection_results(self, results):
+         if results not in ['success', 'aborted'] and self.is_visible:
+-            error(self.window, language[results], block=False)
++            error(self.window, misc._status_dict[results], block=False)
+ 
+     def create_adhoc_network(self, widget=None):
+         """ Shows a dialog that creates a new adhoc network. """
+diff -ruN wicd-1.7.2.4.orig/po/ru.po wicd-1.7.2.4/po/ru.po
+--- wicd-1.7.2.4.orig/po/ru.po	2013-03-31 17:01:29.362001288 +0000
++++ wicd-1.7.2.4/po/ru.po	2013-03-31 17:43:37.909022515 +0000
+@@ -173,7 +173,7 @@
+ 
+ #: wicd/misc.py:79
+ msgid "Connection Failed: Bad password"
+-msgstr "Ошибка ÑоединениÑ: Ðеверный пароль:"
++msgstr "Ошибка ÑоединениÑ: Ðеверный пароль"
+ 
+ #: wicd/misc.py:89
+ msgid "Connection Failed: No DHCP offers received."
+diff -ruN wicd-1.7.2.4.orig/wicd/misc.py wicd-1.7.2.4/wicd/misc.py
+--- wicd-1.7.2.4.orig/wicd/misc.py	2013-03-31 17:01:29.369001288 +0000
++++ wicd-1.7.2.4/wicd/misc.py	2013-03-31 17:23:56.822012593 +0000
+@@ -430,7 +430,9 @@
+     """ Sanitize property names to be used in config-files. """
+     allowed = string.ascii_letters + '_' + string.digits
+     table = string.maketrans(allowed, ' ' * len(allowed))
+-    return s.translate(None, table)
++    #return s.translate(None, table)
++    #return s.translate(table)
++    return s
+ 
+ def sanitize_escaped(s):
+     """ Sanitize double-escaped unicode strings. """
diff --git a/pkgs/tools/networking/wicd/mkdir-networks.patch b/pkgs/tools/networking/wicd/mkdir-networks.patch
deleted file mode 100644
index 01563fd55da..00000000000
--- a/pkgs/tools/networking/wicd/mkdir-networks.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-wicd normally makes the NETWORKS directory and install the dhclient.conf.template.default at install time, 
-but we cannot do that, so we make it at runtime instead.
-
---- wicd-1.7.0/in/scripts=wicd.in       2010-01-14 23:49:11.000000000 -0500
-+++ wicd-1.7.0/in/scripts=wicd.in       2010-11-16 22:35:50.272555487 -0500
-@@ -1,3 +1,6 @@
- #!/bin/bash
- 
-+mkdir -p %NETWORKS%
-+ln -sf @TEMPLATE-DEFAULT@ %ETC%dhclient.conf.template.default
-+
- exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@
diff --git a/pkgs/tools/networking/wicd/no-optimization.patch b/pkgs/tools/networking/wicd/no-optimization.patch
index fb04846d85b..785cae7b6ed 100644
--- a/pkgs/tools/networking/wicd/no-optimization.patch
+++ b/pkgs/tools/networking/wicd/no-optimization.patch
@@ -8,14 +8,14 @@ With optimizations on, python will overwrite the nix store.
 -exec %PYTHON% -O %SHARE%daemon/wicd-daemon.py $@
 +exec %PYTHON% -B %SHARE%daemon/wicd-daemon.py $@
 
---- wicd-1.7.1b2/wicd/wicd-daemon.py.old     2011-04-07 08:28:38.668311226 -0400
-+++ wicd-1.7.1b2/wicd/wicd-daemon.py 2011-04-07 08:28:59.111311223 -0400
-@@ -1806,7 +1806,7 @@
-     wicd_bus = dbus.service.BusName('org.wicd.daemon', bus=bus)
+--- wicd-1.7.2.4/wicd/wicd-daemon.py  2012-04-30 21:19:45.000000000 +0200
++++ wicd-1.7.2.4/wicd/wicd-daemon.pynew       2013-03-14 21:35:23.250306592 +0100
+@@ -1812,7 +1812,7 @@
      daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
+     child_pid = None
      if not no_poll:
--        child_pid = Popen([misc.find_path("python2"), "-O", 
-+        child_pid = Popen([misc.find_path("python2"), "-B",
+-        child_pid = Popen([wpath.python, "-O", 
++        child_pid = Popen([wpath.python, "-B", 
                            os.path.join(wpath.daemon, "monitor.py")],
                            shell=False, close_fds=True).pid
      atexit.register(on_exit, child_pid)
diff --git a/pkgs/tools/networking/wicd/no-var-install.patch b/pkgs/tools/networking/wicd/no-var-install.patch
index 95a5499f283..b01f0e5a438 100644
--- a/pkgs/tools/networking/wicd/no-var-install.patch
+++ b/pkgs/tools/networking/wicd/no-var-install.patch
@@ -1,25 +1,17 @@
 The install tries to create files in /var.  This patch removes those steps.
 
---- wicd-1.7.0/setup.py 2010-01-14 23:49:11.000000000 -0500
-+++ wicd-1.7.0/setup.py 2010-11-16 22:15:33.855977242 -0500
-@@ -493,11 +493,8 @@
-     print "Using init file",(wpath.init, wpath.initfile)
-     data = [
-     (wpath.dbus, ['other/wicd.conf']),
--    (wpath.log, [empty_file]), 
--    (wpath.etc, ['other/dhclient.conf.template.default']),
-     (wpath.encryption, [('encryption/templates/' + b) for b in 
-                         os.listdir('encryption/templates') if not b.startswith('.')]),
--    (wpath.networks, [empty_file]),
-     (wpath.sbin,  ['scripts/wicd']),  
-     (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py',
-                  'wicd/suspend.py', 'wicd/autoconnect.py']), 
-@@ -558,7 +555,7 @@
-     if not wpath.no_install_docs:
-         data.append((wpath.docdir, ['INSTALL', 'LICENSE', 'AUTHORS',
-                                      'README', 'CHANGES', ]))
--        data.append((wpath.varlib, ['other/WHEREAREMYFILES']))
-+        data.append((wpath.share, ['other/WHEREAREMYFILES']))
-     if not wpath.no_install_kde:
-         if not wpath.no_install_gtk:
-             data.append((wpath.kdedir, ['other/wicd-tray.desktop']))
+--- wicd-1.7.2.4/setup.py     2013-03-14 21:28:21.360580941 +0100
++++ wicd-1.7.2.4/setup.py  2013-03-14 21:22:50.125721943 +0100
+@@ -505,11 +505,8 @@
+         (wpath.dbus_service, ['other/org.wicd.daemon.service']),
+         (wpath.systemd, ['other/wicd.service']),
+         (wpath.logrotate, ['other/wicd.logrotate']),
+-        (wpath.log, [empty_file]), 
+-        (wpath.etc, ['other/dhclient.conf.template.default']),
+         (wpath.encryption, [('encryption/templates/' + b) for b in 
+                             os.listdir('encryption/templates') if not b.startswith('.')]),
+-        (wpath.networks, [empty_file]),
+         (wpath.sbin,  ['scripts/wicd']),  
+         (wpath.daemon, ['wicd/monitor.py', 'wicd/wicd-daemon.py',
+                     'wicd/suspend.py', 'wicd/autoconnect.py']), 
+
diff --git a/pkgs/tools/package-management/cabal-install/0.10.2.nix b/pkgs/tools/package-management/cabal-install/0.10.2.nix
index e97c9be9702..16853cab7fc 100644
--- a/pkgs/tools/package-management/cabal-install/0.10.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.10.2.nix
@@ -12,6 +12,9 @@ cabal.mkDerivation (self: {
     description = "The command-line interface for Cabal and Hackage";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.14.0.nix b/pkgs/tools/package-management/cabal-install/0.14.0.nix
index ecbd46de52c..15fe5f1e22c 100644
--- a/pkgs/tools/package-management/cabal-install/0.14.0.nix
+++ b/pkgs/tools/package-management/cabal-install/0.14.0.nix
@@ -9,6 +9,10 @@ cabal.mkDerivation (self: {
   buildDepends = [
     Cabal filepath HTTP mtl network random time zlib
   ];
+  postInstall = ''
+    mkdir $out/etc
+    mv bash-completion $out/etc/bash_completion.d
+  '';
   meta = {
     homepage = "http://www.haskell.org/cabal/";
     description = "The command-line interface for Cabal and Hackage";
diff --git a/pkgs/tools/package-management/cabal-install/0.6.2.nix b/pkgs/tools/package-management/cabal-install/0.6.2.nix
index f98aa8c306d..140c3628405 100644
--- a/pkgs/tools/package-management/cabal-install/0.6.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.6.2.nix
@@ -12,6 +12,9 @@ cabal.mkDerivation (self: {
     description = "The command-line interface for Cabal and Hackage";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.8.0.nix b/pkgs/tools/package-management/cabal-install/0.8.0.nix
index c0ea0752d13..ed84d069d10 100644
--- a/pkgs/tools/package-management/cabal-install/0.8.0.nix
+++ b/pkgs/tools/package-management/cabal-install/0.8.0.nix
@@ -12,6 +12,9 @@ cabal.mkDerivation (self: {
     description = "The command-line interface for Cabal and Hackage";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/0.8.2.nix b/pkgs/tools/package-management/cabal-install/0.8.2.nix
index 4b00985297f..a53460b6319 100644
--- a/pkgs/tools/package-management/cabal-install/0.8.2.nix
+++ b/pkgs/tools/package-management/cabal-install/0.8.2.nix
@@ -12,6 +12,9 @@ cabal.mkDerivation (self: {
     description = "The command-line interface for Cabal and Hackage";
     license = self.stdenv.lib.licenses.bsd3;
     platforms = self.ghc.meta.platforms;
-    maintainers = [ self.stdenv.lib.maintainers.andres ];
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/tools/package-management/cabal-install/1.16.0.2.nix b/pkgs/tools/package-management/cabal-install/1.16.0.2.nix
new file mode 100644
index 00000000000..8f28f57c18f
--- /dev/null
+++ b/pkgs/tools/package-management/cabal-install/1.16.0.2.nix
@@ -0,0 +1,23 @@
+{ cabal, Cabal, filepath, HTTP, mtl, network, random, time, zlib }:
+
+cabal.mkDerivation (self: {
+  pname = "cabal-install";
+  version = "1.16.0.2";
+  sha256 = "162nbkkffpbalg368m5s49jrvg9nibdwlwj0j1b8wriyyg4srpv6";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [
+    Cabal filepath HTTP mtl network random time zlib
+  ];
+  postInstall = ''
+    mkdir $out/etc
+    mv bash-completion $out/etc/bash_completion.d
+  '';
+  meta = {
+    homepage = "http://www.haskell.org/cabal/";
+    description = "The command-line interface for Cabal and Hackage";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [ self.stdenv.lib.maintainers.andres ];
+  };
+})
diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix
index aa935076eb9..2fbf5282ee1 100644
--- a/pkgs/tools/package-management/checkinstall/default.nix
+++ b/pkgs/tools/package-management/checkinstall/default.nix
@@ -29,7 +29,12 @@ stdenv.mkDerivation {
 
     # Fix a `conflicting types for 'scandir'' error on Glibc 2.11.
     ./scandir.patch
-  ];
+  ]
+
+  ++ stdenv.lib.optional (stdenv.system == "x86_64-linux") 
+    # Force use of old memcpy so that installwatch works on Glibc <
+    # 2.14.
+    ./use-old-memcpy.patch;
 
   buildInputs = [gettext];
 
@@ -55,6 +60,6 @@ stdenv.mkDerivation {
     homepage = http://checkinstall.izto.org/;
     description = "A tool for automatically generating Slackware, RPM or Debian packages when doing `make install'";
     maintainers = [ stdenv.lib.maintainers.eelco ];
-    platform = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/tools/package-management/checkinstall/glibc-check.patch b/pkgs/tools/package-management/checkinstall/glibc-check.patch
index 9376da41d9e..7f8cbccae8e 100644
--- a/pkgs/tools/package-management/checkinstall/glibc-check.patch
+++ b/pkgs/tools/package-management/checkinstall/glibc-check.patch
@@ -52,7 +52,7 @@ diff -x '*~' -rc checkinstall-1.6.2pre20081116-orig/installwatch/create-localdec
   		6)
   			echo '#define GLIBC_MINOR 6' >> $OUTFILE
   			SUBVERSION='glibc-2.6' ;;
-! 		7|8|9|10|11|12|13|14|15)
+! 		7|8|9|10|11|12|13|14|15|16|17|18)
   			echo '#define GLIBC_MINOR 7' >> $OUTFILE
   			SUBVERSION='glibc-2.7' ;;
   		*)
diff --git a/pkgs/tools/package-management/checkinstall/use-old-memcpy.patch b/pkgs/tools/package-management/checkinstall/use-old-memcpy.patch
new file mode 100644
index 00000000000..c8be7f0b5e2
--- /dev/null
+++ b/pkgs/tools/package-management/checkinstall/use-old-memcpy.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' checkinstall-1.6.2-orig/installwatch/installwatch.c checkinstall-1.6.2/installwatch/installwatch.c
+--- checkinstall-1.6.2-orig/installwatch/installwatch.c	2008-11-16 17:20:53.000000000 +0100
++++ checkinstall-1.6.2/installwatch/installwatch.c	2013-03-15 13:50:12.717646381 +0100
+@@ -28,6 +28,8 @@
+  *                                  <mail@fredemmott.co.uk>
+  */
+ 
++asm (".symver memcpy, memcpy@GLIBC_2.2.5");
++
+ #include <sys/param.h>
+ #include <sys/types.h>
+ #include <sys/stat.h>
diff --git a/pkgs/tools/package-management/dpkg/cache-arch.patch b/pkgs/tools/package-management/dpkg/cache-arch.patch
new file mode 100644
index 00000000000..9677c8fdee3
--- /dev/null
+++ b/pkgs/tools/package-management/dpkg/cache-arch.patch
@@ -0,0 +1,15 @@
+Don't invoke "dpkg --print-architecture" for every call to
+Dpkg::Arch::get_raw_build_arch().
+
+diff -ru -x '*~' dpkg-1.16.9/scripts/Dpkg/Arch.pm dpkg-1.16.9-new/scripts/Dpkg/Arch.pm
+--- dpkg-1.16.9/scripts/Dpkg/Arch.pm	2012-10-20 06:34:17.000000000 +0200
++++ dpkg-1.16.9-new/scripts/Dpkg/Arch.pm	2012-12-04 19:42:20.451002537 +0100
+@@ -59,7 +59,7 @@
+ 	# dpkg-architecture itself, by avoiding computing the DEB_BUILD_
+ 	# variables when they are not requested.
+ 
+-	my $build_arch = `dpkg --print-architecture`;
++	$build_arch = `dpkg --print-architecture`;
+ 	syserr("dpkg --print-architecture failed") if $? >> 8;
+ 
+ 	chomp $build_arch;
diff --git a/pkgs/tools/package-management/dpkg/default.nix b/pkgs/tools/package-management/dpkg/default.nix
index 2ffacb08479..e801bcfb2c2 100644
--- a/pkgs/tools/package-management/dpkg/default.nix
+++ b/pkgs/tools/package-management/dpkg/default.nix
@@ -1,21 +1,20 @@
-{stdenv, fetchurl, perl, zlib, bzip2}:
+{ stdenv, fetchurl, perl, zlib, bzip2, xz, makeWrapper }:
 
-let version = "1.14.29"; in
+let version = "1.16.9"; in
 
 stdenv.mkDerivation {
   name = "dpkg-${version}";
 
   src = fetchurl {
-    url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.gz";
-    sha256 = "0cynms4vziy957r4zskybbid87sz99vrfy8d999vlhxgc74c2zpa";
+    url = "mirror://debian/pool/main/d/dpkg/dpkg_${version}.tar.xz";
+    sha256 = "0ykby9x4x2zb7rfj30lfjcsrq2q32z2lnsrl8pbdvb2l9sx7zkbk";
   };
 
-  configureFlags = "--without-dselect --with-admindir=/var/lib/dpkg";
+  patches = [ ./cache-arch.patch ];
 
-  preConfigure = ''
-    # Can't use substitute pending resolution of NIXPKGS-89.
-    sed -s 's^/usr/bin/perl^${perl}/bin/perl^' -i scripts/dpkg-architecture.pl
+  configureFlags = "--disable-dselect --with-admindir=/var/lib/dpkg PERL_LIBDIR=$(out)/${perl.libPrefix}";
 
+  preConfigure = ''
     # Nice: dpkg has a circular dependency on itself.  Its configure
     # script calls scripts/dpkg-architecture, which calls "dpkg" in
     # $PATH.  It doesn't actually use its result, but fails if it
@@ -24,14 +23,25 @@ stdenv.mkDerivation {
     chmod +x $TMPDIR/dpkg
     PATH=$TMPDIR:$PATH
 
-    substituteInPlace src/Makefile.in --replace "install-data-local:" "disabled:"
-    substituteInPlace dpkg-split/Makefile.in --replace "install-data-local:" "disabled:"
+    for i in $(find . -name Makefile.in); do
+      substituteInPlace $i --replace "install-data-local:" "disabled:" ;
+    done
   '';
 
-  buildInputs = [ perl zlib bzip2 ];
+  buildInputs = [ perl zlib bzip2 xz makeWrapper ];
+
+  postInstall =
+    ''
+      for i in $out/bin/*; do
+        if head -n 1 $i | grep -q perl; then
+          wrapProgram $i --prefix PERL5LIB : $out/${perl.libPrefix}
+        fi
+      done # */
+    '';
 
   meta = {
     description = "The Debian package manager";
     homepage = http://wiki.debian.org/Teams/Dpkg;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/tools/package-management/nix/custom.nix b/pkgs/tools/package-management/nix/custom.nix
deleted file mode 100644
index b760e4b7f4d..00000000000
--- a/pkgs/tools/package-management/nix/custom.nix
+++ /dev/null
@@ -1,68 +0,0 @@
-{ stdenv, fetchurl, aterm, db4, perl, curl, bzip2, openssl ? null
-, storeDir ? "/nix/store"
-, stateDir ? "/nix/var"
-, src
-, preConfigure ? ""
-, autoconf ? null, automake ? null, libtool ? null
-, bison ? null
-, flex ? null
-, w3m ? null
-, libxml2 ? null
-, docbook5_xsl ? null, libxslt ? null
-, docbook5 ? null, docbook_xml_dtd_43 ? null 
-, perlPackages
-, boehmgc ? null
-, pkgconfig ? null
-, sqlite ? null
-, configureFlags ? []
-, lib
-, enableScripts ? []
-}:
-
-stdenv.mkDerivation {
-  name = "nix-custom";
-  
-  inherit src;
-
-  buildInputs = [perl curl openssl bzip2 ] 
-  	++ (if automake != null then [automake] else [])
-  	++ (if autoconf != null then [autoconf] else [])
-  	++ (if libtool != null then [libtool] else [])
-  	++ (if bison != null then [bison] else [])
-  	++ (if flex != null then [flex] else [])
-  	++ (if docbook5_xsl != null then [docbook5_xsl] else [])
-  	++ (if libxslt != null then [libxslt] else [])
-  	++ (if docbook5 != null then [docbook5] else [])
-  	++ (if docbook_xml_dtd_43 != null then [docbook_xml_dtd_43] else [])
-  	++ (if w3m != null then [w3m] else [])
-  	++ (if libxml2 != null then [libxml2] else [])
-  	++ (if boehmgc != null then [boehmgc] else [])
-  	++ (if sqlite != null then [sqlite] else [])
-  	++ (if pkgconfig != null then [pkgconfig] else [])
-  ;
-
-  preConfigure = 
-    (lib.concatMapStrings (script:
-      ''
-        sed -e '/bin_SCRIPTS = /a${script} \\' -i scripts/Makefile.am
-      ''
-    ) enableScripts)
-    + preConfigure
-    + "\n./bootstrap.sh";
-
-  configureFlags = ''
-    --with-store-dir=${storeDir} --localstatedir=${stateDir}
-    --with-aterm=${aterm} --with-bdb=${db4} --with-bzip2=${bzip2}
-    --with-sqlite=${sqlite}
-    --disable-init-state
-    --with-dbi=${perlPackages.DBI}/lib/perl5/site_perl
-    --with-dbd-sqlite=${perlPackages.DBDSQLite}/lib/perl5/site_perl
-    ${toString configureFlags}
-  '';
-
-  meta = {
-    description = "The Nix Deployment System";
-    homepage = http://nixos.org/;
-    license = "LGPL";
-  };
-}
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index e433aa60579..55f783d792f 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -5,14 +5,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.1";
+  name = "nix-1.5.2";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/2860022/download/4/${name}.tar.bz2";
-    sha256 = "edb2fc444eda49be144ca2901f1fc9472cd24896775ba02556ded5705863d324";
+    url = "http://nixos.org/releases/nix/${name}/${name}.tar.xz";
+    sha256 = "84880fcb94c06b11f66b28837f9c145aa3d65eb0e173fd6da195794a7b0331d1";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ curl openssl boehmgc sqlite ];
 
@@ -26,34 +26,40 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     ''
-      --with-store-dir=${storeDir} --localstatedir=${stateDir}
-      --with-dbi=${perlPackages.DBI}/lib/perl5/site_perl
-      --with-dbd-sqlite=${perlPackages.DBDSQLite}/lib/perl5/site_perl
+      --with-store-dir=${storeDir} --localstatedir=${stateDir} --sysconfdir=/etc
+      --with-dbi=${perlPackages.DBI}/${perl.libPrefix}
+      --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
+      --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
       --disable-init-state
       --enable-gc
       CFLAGS=-O3 CXXFLAGS=-O3
     '';
 
+  makeFlags = "profiledir=$(out)/etc/profile.d";
+
+  installFlags = "sysconfdir=$(out)/etc";
+
   doInstallCheck = true;
 
   crossAttrs = {
     postUnpack =
-      '' export CPATH="${bzip2.hostDrv}/include"
-         export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
+      '' export CPATH="${bzip2.crossDrv}/include"
+         export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
       '';
 
     configureFlags =
       ''
         --with-store-dir=${storeDir} --localstatedir=${stateDir}
-        --with-dbi=${perlPackages.DBI}/lib/perl5/site_perl
-        --with-dbd-sqlite=${perlPackages.DBDSQLite}/lib/perl5/site_perl
+        --with-dbi=${perlPackages.DBI}/${perl.libPrefix}
+        --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
+        --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
         --disable-init-state
         --enable-gc
         CFLAGS=-O3 CXXFLAGS=-O3
       '' + stdenv.lib.optionalString (
           stdenv.cross ? nix && stdenv.cross.nix ? system
       ) ''--with-system=${stdenv.cross.nix.system}'';
-      
+
     doInstallCheck = false;
   };
 
diff --git a/pkgs/tools/package-management/nix/unstable.nix b/pkgs/tools/package-management/nix/unstable.nix
index 103d92a0ee9..d66a156c33e 100644
--- a/pkgs/tools/package-management/nix/unstable.nix
+++ b/pkgs/tools/package-management/nix/unstable.nix
@@ -5,14 +5,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "nix-1.2pre2793_d950cfe";
+  name = "nix-1.5.2pre3091_772b709";
 
   src = fetchurl {
-    url = "http://hydra.nixos.org/build/2955697/download/4/${name}.tar.bz2";
-    sha256 = "f91367d8e7ed795b2bc9a47fb3ecff00d005633f248ecaafa25e8e101a5dc682";
+    url = "http://hydra.nixos.org/build/4796316/download/5/${name}.tar.xz";
+    sha256 = "f1acf131842d9604d886d5f98aaa4739bea63536023d7287ce48613c38d49fbd";
   };
 
-  buildNativeInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkgconfig ];
 
   buildInputs = [ curl openssl boehmgc sqlite ];
 
@@ -26,34 +26,40 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     ''
-      --with-store-dir=${storeDir} --localstatedir=${stateDir}
-      --with-dbi=${perlPackages.DBI}/lib/perl5/site_perl
-      --with-dbd-sqlite=${perlPackages.DBDSQLite}/lib/perl5/site_perl
+      --with-store-dir=${storeDir} --localstatedir=${stateDir} --sysconfdir=/etc
+      --with-dbi=${perlPackages.DBI}/${perl.libPrefix}
+      --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
+      --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
       --disable-init-state
       --enable-gc
       CFLAGS=-O3 CXXFLAGS=-O3
     '';
 
+  makeFlags = "profiledir=$(out)/etc/profile.d";
+
+  installFlags = "sysconfdir=$(out)/etc";
+
   doInstallCheck = true;
 
   crossAttrs = {
     postUnpack =
-      '' export CPATH="${bzip2.hostDrv}/include"
-         export NIX_CROSS_LDFLAGS="-L${bzip2.hostDrv}/lib -rpath-link ${bzip2.hostDrv}/lib $NIX_CROSS_LDFLAGS"
+      '' export CPATH="${bzip2.crossDrv}/include"
+         export NIX_CROSS_LDFLAGS="-L${bzip2.crossDrv}/lib -rpath-link ${bzip2.crossDrv}/lib $NIX_CROSS_LDFLAGS"
       '';
 
     configureFlags =
       ''
         --with-store-dir=${storeDir} --localstatedir=${stateDir}
-        --with-dbi=${perlPackages.DBI}/lib/perl5/site_perl
-        --with-dbd-sqlite=${perlPackages.DBDSQLite}/lib/perl5/site_perl
+        --with-dbi=${perlPackages.DBI}/${perl.libPrefix}
+        --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix}
+        --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}
         --disable-init-state
         --enable-gc
         CFLAGS=-O3 CXXFLAGS=-O3
       '' + stdenv.lib.optionalString (
           stdenv.cross ? nix && stdenv.cross.nix ? system
       ) ''--with-system=${stdenv.cross.nix.system}'';
-      
+
     doInstallCheck = false;
   };
 
diff --git a/pkgs/tools/security/aespipe/default.nix b/pkgs/tools/security/aespipe/default.nix
new file mode 100644
index 00000000000..9e4b8d12712
--- /dev/null
+++ b/pkgs/tools/security/aespipe/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "aespipe-${version}";
+  version = "v2.4c";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/loop-aes/aespipe/${name}.tar.bz2";
+    sha256 = "0pl49jnjczjvfxwm9lw576qsjm1lxh8gc4g776l904cixaz90096";
+  };
+
+  meta = {
+    description = "AES encrypting or decrypting pipe";
+    homepage = http://loop-aes.sourceforge.net/aespipe.README;
+    license = "GPL";
+    maintainers = stdenv.lib.maintainers.goibhniu;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/security/apg/default.nix b/pkgs/tools/security/apg/default.nix
new file mode 100644
index 00000000000..7eeb491374a
--- /dev/null
+++ b/pkgs/tools/security/apg/default.nix
@@ -0,0 +1,66 @@
+{ stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  name = "apg-2.2.3";
+  src = fetchurl {
+    url = "http://www.adel.nursat.kz/apg/download/${name}.tar.gz";
+    sha256 = "1fkxpaifv925i385krsyslrig42ksws5y19hfq5asn1rwv6zmjb9";
+  };
+  configurePhase = ''
+    substituteInPlace Makefile --replace /usr/local "$out"
+  '';
+  preInstall = ''
+    export CHOWNPROG=true
+    export CHGRPPROG=true
+  '';
+
+  meta = {
+    description = "A tool set for random password generation.";
+    longDescription = ''
+      APG (Automated Password Generator) is the tool set for random
+      password generation.
+
+      Standalone version
+
+        Generates some random words of required type and prints them
+        to standard output.
+
+      Network version
+
+        APG server: When client's request is arrived generates some
+        random words of predefined type and send them to client over
+        the network (according to RFC0972).
+
+        APG client: Sends the password generation request to the APG
+        server, wait for generated Passwords arrival and then prints
+        them to the standard output.
+
+     Advantages
+
+       * Built-in ANSI X9.17 RNG (Random Number Generator) (CAST/SHA1)
+       * Built-in password quality checking system (it has support for
+         Bloom filter for faster access)
+       * Two Password Generation Algorithms:
+           1. Pronounceable Password Generation Algorithm (according to
+              NIST FIPS 181)
+           2. Random Character Password Generation Algorithm with 35
+              configurable modes of operation
+       * Configurable password length parameters
+       * Configurable amount of generated passwords
+       * Ability to initialize RNG with user string
+       * Support for /dev/random
+       * Ability to crypt() generated passwords and print them as
+         additional output
+       * Special parameters to use APG in script
+       * Ability to log password generation requests for network version
+       * Ability to control APG service access using tcpd
+       * Ability to use password generation service from any type of box
+         (Mac, WinXX, etc.) that connected to network
+       * Ability to enforce remote users to use only allowed type of
+         password generation
+    '';
+    homepage = http://www.adel.nursat.kz/apg/;
+    license = stdenv.lib.licenses.bsd3;
+    maintainers = with stdenv.lib.maintainers; [ astsmtl ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix
index 896e034ee76..0e607092412 100644
--- a/pkgs/tools/security/ccid/default.nix
+++ b/pkgs/tools/security/ccid/default.nix
@@ -1,20 +1,21 @@
-{stdenv, fetchurl, pcsclite, pkgconfig, libusb, perl}:
-stdenv.mkDerivation {
-  name = "ccid-1.3.11";
+{ stdenv, fetchurl, pcsclite, pkgconfig, libusb1, perl }:
+stdenv.mkDerivation rec {
+  name = "ccid-1.4.9";
 
   src = fetchurl {
-    url = https://alioth.debian.org/frs/download.php/3080/ccid-1.3.11.tar.bz2;
-    sha256 = "01l9956wids087d38bprr8jqcl05j48cdp25k9q7vzran215mgzp";
+    url = "https://alioth.debian.org/frs/download.php/3866/${name}.tar.bz2";
+    sha256 = "1dj0cw4js4ab678l94rf9p8a8gppkf1hm66qhmq5ajra6r5nv3m9";
   };
 
   patchPhase = ''
     sed -i 's,/usr/bin/env perl,${perl}/bin/perl,' src/*.pl
+    substituteInPlace src/Makefile.in --replace /bin/echo echo
   '';
   preConfigure = ''
     configureFlags="$configureFlags --enable-usbdropdir=$out/pcsc/drivers"
   '';
 
-  buildInputs = [ pcsclite pkgconfig libusb ];
+  buildInputs = [ pcsclite pkgconfig libusb1 ];
 
   meta = {
     description = "ccid drivers for pcsclite";
diff --git a/pkgs/tools/security/ccrypt/default.nix b/pkgs/tools/security/ccrypt/default.nix
index a134f45c988..5653af424d1 100644
--- a/pkgs/tools/security/ccrypt/default.nix
+++ b/pkgs/tools/security/ccrypt/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "1bzbfq19jnnlp221kilzxpy0l6w3hk9b1iqjz4haypzlyxswnf35";
   };
 
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   meta = {
     homepage = http://ccrypt.sourceforge.net/;
diff --git a/pkgs/tools/security/fprot/default.nix b/pkgs/tools/security/fprot/default.nix
index 95f7140b918..2a8531a1795 100644
--- a/pkgs/tools/security/fprot/default.nix
+++ b/pkgs/tools/security/fprot/default.nix
@@ -1,4 +1,5 @@
 { stdenv, fetchurl }:
+
 stdenv.mkDerivation rec {
 
   name = "f-prot-${version}";
@@ -33,8 +34,8 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://www.f-prot.com;
-    description = "a popular proprietary antivirus, Linux workstation edition.";
-    license = licenses.proprietary;
+    description = "A popular proprietary antivirus program";
+    license = licenses.unfree;
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.linux;
   };
diff --git a/pkgs/tools/security/gnupg/default.nix b/pkgs/tools/security/gnupg/default.nix
index 0667a7f9885..b94e2e50a40 100644
--- a/pkgs/tools/security/gnupg/default.nix
+++ b/pkgs/tools/security/gnupg/default.nix
@@ -13,14 +13,14 @@ assert useUsb -> (libusb != null);
 assert useCurl -> (curl != null);
 
 stdenv.mkDerivation rec {
-  name = "gnupg-2.0.19";
+  name = "gnupg-2.0.20";
 
   src = fetchurl {
     url = "mirror://gnupg/gnupg/${name}.tar.bz2";
-    sha256 = "08n636sfffs5qvg9ppiprvsh00q0dmdw425psg3m3nssja53m8pg";
+    sha256 = "16mp0j5inrcqcb3fxbn0b3aamascy3n923wiy0y8marc0rzrp53f";
   };
 
-  buildInputs = [ readline zlib libgpgerror pth libgcrypt libassuan libksba ]
+  buildInputs = [ readline zlib libgpgerror libgcrypt libassuan libksba pth ]
     ++ stdenv.lib.optional useLdap openldap
     ++ stdenv.lib.optional useBzip2 bzip2
     ++ stdenv.lib.optional useUsb libusb
@@ -35,7 +35,9 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
+    homepage = "http://gnupg.org/";
     description = "GNU Privacy Guard (GnuPG), GNU Project's implementation of the OpenPGP standard";
+    license = stdenv.lib.licenses.gpl3Plus;
 
     longDescription = ''
       GnuPG is the GNU project's complete and free implementation of
@@ -49,12 +51,7 @@ stdenv.mkDerivation rec {
       S/MIME.
     '';
 
-    homepage = http://gnupg.org/;
-
-    license = "GPLv3+";
-
     maintainers = with stdenv.lib.maintainers; [ ludo urkud ];
-
     platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/tools/security/gnupg1/default.nix b/pkgs/tools/security/gnupg1/default.nix
index 0674fc4e480..c779b979d9d 100644
--- a/pkgs/tools/security/gnupg1/default.nix
+++ b/pkgs/tools/security/gnupg1/default.nix
@@ -15,11 +15,11 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "gnupg-1.4.11";
+  name = "gnupg-1.4.13";
 
   src = fetchurl {
     url = "mirror://gnupg/gnupg/${name}.tar.bz2";
-    sha256 = "1xkfxr4z2fy9d5d6hj4lzv854lk227kgv6qb2w0sam752snfx36i";
+    sha1 = "17a75c54d292bd0923f0a1817a1b02ded37d1de1";
   };
 
   buildInputs = [ readline bzip2 ];
diff --git a/pkgs/tools/security/meo/default.nix b/pkgs/tools/security/meo/default.nix
new file mode 100644
index 00000000000..e18b68c7593
--- /dev/null
+++ b/pkgs/tools/security/meo/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchhg, openssl, pcre, qt4, boost, pkcs11helper }:
+
+stdenv.mkDerivation {
+  name = "meo-20121113";
+  
+  src = fetchhg {
+    url = http://oss.stamfest.net/hg/meo;
+    tag = "b48e5f16cff8";
+    sha256 = "0ifg7y28s89i9gwda6fyj1jbrykbcvq8bf1m6rxmdcv5afi3arbq";
+  };
+
+  buildFlags = "QMAKE=qmake";
+
+  buildInputs = [ openssl pcre qt4 boost pkcs11helper ];
+
+  preConfigure = ''
+    sed -i s,-mt$,, meo-gui/meo-gui.pro
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp tools/{meo,p11} $out/bin
+    cp meo-gui/meo-gui $out/bin
+    cp meo-gui/meo-gui $out/bin
+  '';
+
+  meta = {
+    homepage = http://oss.stamfest.net/wordpress/meo-multiple-eyepairs-only;
+    description = "Tools to use cryptography for things like four-eyes principles";
+    license = "AGPLv3+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/security/mkpasswd/default.nix b/pkgs/tools/security/mkpasswd/default.nix
new file mode 100644
index 00000000000..a1982cc4e66
--- /dev/null
+++ b/pkgs/tools/security/mkpasswd/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl
+}:
+  
+stdenv.mkDerivation rec {
+  name = "mkpasswd-${version}";
+
+  version = "5.0.20";
+
+  src = fetchurl {
+    url = "http://ftp.debian.org/debian/pool/main/w/whois/whois_${version}.tar.xz";
+    sha256 = "1kwf5pwc7w8dw40nrd4m4637mz7pbhc4c1v78j56nqj38sak50w1";
+  };
+
+  preConfigure = ''
+    substituteInPlace Makefile --replace "prefix = /usr" "prefix = $out"
+  '';
+
+  buildPhase = "make mkpasswd";
+
+  installPhase = "make install-mkpasswd";
+
+  meta = {
+    homepage = http://ftp.debian.org/debian/pool/main/w/whois/;
+    description = ''
+      Overfeatured front end to crypt, from the Debian whois package.
+    '';
+  };
+}
diff --git a/pkgs/tools/security/munge/default.nix b/pkgs/tools/security/munge/default.nix
new file mode 100644
index 00000000000..2b6cd224371
--- /dev/null
+++ b/pkgs/tools/security/munge/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, gnused, perl, libgcrypt, zlib, bzip2 }:
+
+stdenv.mkDerivation rec {
+  name = "munge-0.5.10";
+
+  src = fetchurl {
+    url = "http://munge.googlecode.com/files/${name}.tar.bz2";
+    sha256 = "1imbmpd70vkcpca8d9yd9ajkhf6ik057nr3jb1app1wm51f15q00";
+  };
+
+  buildInputs = [ gnused perl libgcrypt zlib bzip2 ];
+
+  preConfigure = ''
+    # Remove the install-data stuff, since it tries to write to /var
+    sed -i '434,465d' src/etc/Makefile.in
+  '';
+
+  configureFlags = [
+    "--localstatedir=/var"
+  ];
+
+  meta = {
+    homepage = http://code.google.com/p/munge/;
+    description = ''
+      An authentication service for creating and validating credentials
+    '';
+    maintainers = [ stdenv.lib.maintainers.rickynils ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/security/nmap/default.nix b/pkgs/tools/security/nmap/default.nix
index 143c75285c4..2280ff3cfbe 100644
--- a/pkgs/tools/security/nmap/default.nix
+++ b/pkgs/tools/security/nmap/default.nix
@@ -2,7 +2,7 @@
 , openssl, python, pygtk, makeWrapper, pygobject
 , pycairo, pysqlite
 }:
-  
+
 stdenv.mkDerivation rec {
   name = "nmap-5.50";
 
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "aa044113caa47e172c154daed73afc70ffa18d359eb47c22a9ea85ffcb14ffb8";
   };
 
+  patches = [ ./zenmap.patch ];
+
   postInstall =
     ''
       wrapProgram $out/bin/zenmap --prefix PYTHONPATH : "$(toPythonPath $out)" --prefix PYTHONPATH : "$PYTHONPATH" --prefix PYTHONPATH : $(toPythonPath ${pygtk})/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath ${pygobject})/gtk-2.0 --prefix PYTHONPATH : $(toPythonPath ${pycairo})/gtk-2.0
diff --git a/pkgs/tools/security/nmap/zenmap.patch b/pkgs/tools/security/nmap/zenmap.patch
new file mode 100644
index 00000000000..3cd39750c88
--- /dev/null
+++ b/pkgs/tools/security/nmap/zenmap.patch
@@ -0,0 +1,15 @@
+diff -ruN nmap-5.50.orig/zenmap/zenmapCore/Paths.py nmap-5.50/zenmap/zenmapCore/Paths.py
+--- nmap-5.50.orig/zenmap/zenmapCore/Paths.py	2013-06-06 05:52:10.723087428 +0000
++++ nmap-5.50/zenmap/zenmapCore/Paths.py	2013-06-06 07:07:25.481261761 +0000
+@@ -115,7 +115,10 @@
+     else:
+         # Normal script execution. Look in the current directory to allow
+         # running from the distribution.
+-        return os.path.abspath(os.path.dirname(fs_dec(sys.argv[0])))
++        #
++        # Grrwlf: No,no,dear. That's not a script, thats Nixos wrapper. Go add
++        # those '..' to substract /bin part.
++        return os.path.abspath(os.path.join(os.path.dirname(fs_dec(sys.argv[0])), ".."))
+
+ prefix = get_prefix()
+
diff --git a/pkgs/tools/security/oath-toolkit/default.nix b/pkgs/tools/security/oath-toolkit/default.nix
new file mode 100644
index 00000000000..58786f1bd61
--- /dev/null
+++ b/pkgs/tools/security/oath-toolkit/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, fetchurl, pam }:
+
+stdenv.mkDerivation rec {
+  name = "oath-toolkit-2.0.2";
+
+  src = fetchurl {
+    url = "http://download.savannah.gnu.org/releases/oath-toolkit/${name}.tar.gz";
+    sha256 = "0i2rf5j83kb8h3sd9lsm0a46zq805kzagvccc4rk7879lg1fnl99";
+  };
+
+  buildInputs = [ pam ];
+
+  meta = {
+    homepage = http://www.nongnu.org/oath-toolkit/;
+    description = "Components for building one-time password authentication systems";
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix
index 28a673d03ef..de0fef9b73f 100644
--- a/pkgs/tools/security/pcsclite/default.nix
+++ b/pkgs/tools/security/pcsclite/default.nix
@@ -1,23 +1,26 @@
-{ stdenv, fetchurl, udev, pkgconfig, dbus_libs }:
+{ stdenv, fetchurl, pkgconfig, udev, dbus_libs, perl }:
 
 stdenv.mkDerivation rec {
-  name = "pcsclite-1.7.4";
+  name = "pcsclite-1.8.8";
 
   src = fetchurl {
-    url = "http://alioth.debian.org/frs/download.php/3598/${name}.tar.bz2";
-    sha256 = "1lc3amxisv2ya51v0gysygldj25kv7zj81famv69s205mvmagr6q";
+    url = "http://alioth.debian.org/frs/download.php/3862/${name}.tar.bz2";
+    sha256 = "1rw5530vr2jf02ziyf32jbd98n5q8zjcfwp5nkw3x3bkgr53arpy";
   };
 
   # The OS should care on preparing the drivers into this location
-  configureFlags = [ "--enable-usbdropdir=/var/lib/pcsc/drivers" ];
+  configureFlags = [
+    "--enable-usbdropdir=/var/lib/pcsc/drivers"
+    "--with-systemdsystemunitdir=$out/lib/systemd/system" # probably
+  ];
 
   preConfigure = ''
     configureFlags="$configureFlags --enable-confdir=$out/etc"
   '';
 
-  buildInputs = [ udev dbus_libs ];
+  buildInputs = [ udev dbus_libs perl ];
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
     description = "Middleware to access a smart card using SCard API (PC/SC)";
diff --git a/pkgs/tools/security/pinentry/default.nix b/pkgs/tools/security/pinentry/default.nix
index 524a582fcb0..543c5d81ba1 100644
--- a/pkgs/tools/security/pinentry/default.nix
+++ b/pkgs/tools/security/pinentry/default.nix
@@ -6,11 +6,11 @@
 assert useGtk || useNcurses || useQt4;
 
 stdenv.mkDerivation rec {
-  name = "pinentry-0.8.0";
+  name = "pinentry-0.8.2";
 
   src = fetchurl {
-    url = "mirror://gnupg/pinentry/${name}.tar.gz";
-    sha256 = "06phs3gbs6gf0z9g28z3jgsw312dhhpdgzrx4hhps53xrbwpyv22";
+    url = "mirror://gnupg/pinentry/${name}.tar.bz2";
+    sha256 = "1c9r99ck8072y7nkirddg3p372xadl95y65hyc1m6wn5mavbg12h";
   };
 
   buildInputs = let opt = stdenv.lib.optional; in []
@@ -24,17 +24,16 @@ stdenv.mkDerivation rec {
     ++ (if useGtk then ["--enable-pinentry-gtk2"] else ["--disable-pinentry-gtk"])
     ++ (if useQt4 then ["--enable-pinentry-qt4"] else ["--disable-pinentry-qt4"]);
 
-  buildNativeInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig ];
 
   meta = {
+    homepage = "http://gnupg.org/aegypten2/";
     description = "GnuPG's interface to passphrase input";
+    license = "GPLv2+";
 
     longDescription = ''
       Pinentry provides a console and a GTK+ GUI that allows users to
       enter a passphrase when `gpg' or `gpg2' is run and needs it.
     '';
-
-    homepage = http://gnupg.org/aegypten2/;
-    license = "GPLv2+";
   };
 }
diff --git a/pkgs/tools/security/pinentry/duplicate-glib-defs.patch b/pkgs/tools/security/pinentry/duplicate-glib-defs.patch
deleted file mode 100644
index 78796ee2f53..00000000000
--- a/pkgs/tools/security/pinentry/duplicate-glib-defs.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-Comment out definitions of functions that are part of Glib.
-
---- pinentry-0.7.5/gtk+-2/gtksecentry.c	2007-11-19 12:20:50.000000000 +0100
-+++ pinentry-0.7.5/gtk+-2/gtksecentry.c	2008-12-08 22:08:22.000000000 +0100
-@@ -269,6 +269,7 @@ gboolean g_use_secure_mem = FALSE;
- 				} while(0)
- 
- 
-+#if 0
- gpointer
- g_malloc(gulong size)
- {
-@@ -347,6 +348,7 @@ g_free(gpointer mem)
- 	    free(mem);
-     }
- }
-+#endif
- 
- GType
- gtk_secure_entry_get_type(void)
diff --git a/pkgs/tools/security/polkit-gnome/default.nix b/pkgs/tools/security/polkit-gnome/default.nix
index b70aa427031..c06aac204a1 100644
--- a/pkgs/tools/security/polkit-gnome/default.nix
+++ b/pkgs/tools/security/polkit-gnome/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ polkit gtk3 ];
-  buildNativeInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkgconfig intltool ];
 
   configureFlags = "--disable-introspection";
 
diff --git a/pkgs/tools/security/polkit-kde-agent/default.nix b/pkgs/tools/security/polkit-kde-agent/default.nix
index 10836366b18..7696ee93bce 100644
--- a/pkgs/tools/security/polkit-kde-agent/default.nix
+++ b/pkgs/tools/security/polkit-kde-agent/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs polkit_qt_1 ];
 
-  buildNativeInputs = [ gettext ];
+  nativeBuildInputs = [ gettext ];
 
   patchPhase = "sed -e s/KDE4_AUTOSTART/AUTOSTART/ -i CMakeLists.txt";
 
diff --git a/pkgs/tools/security/pwgen/default.nix b/pkgs/tools/security/pwgen/default.nix
index 72ca4c987c5..ecbc95362e6 100644
--- a/pkgs/tools/security/pwgen/default.nix
+++ b/pkgs/tools/security/pwgen/default.nix
@@ -8,5 +8,6 @@ stdenv.mkDerivation {
   };
   meta = {
 	description = "Small, GPL'ed password generator which creates passwords which can be easily memorized by a human.";
+        platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/tools/security/rng-tools/default.nix b/pkgs/tools/security/rng-tools/default.nix
new file mode 100644
index 00000000000..446e25772f1
--- /dev/null
+++ b/pkgs/tools/security/rng-tools/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "rng-tools-4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gkernel/${name}.tar.gz";
+
+    sha256 = "15f17j3lxn1v2mhdxvy3pahz41hn1vlnnm81c0qyh19c4bady6xp";
+  };
+
+  meta = {
+    description = "A random number generator daemon";
+
+    homepage = http://sourceforge.net/projects/gkernel;
+
+    license = stdenv.lib.licenses.gpl2;
+
+    platforms = stdenv.lib.platforms.linux;
+
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+  };
+}
diff --git a/pkgs/tools/security/sudo/default.nix b/pkgs/tools/security/sudo/default.nix
index e84fb50b359..e361746c57b 100644
--- a/pkgs/tools/security/sudo/default.nix
+++ b/pkgs/tools/security/sudo/default.nix
@@ -1,37 +1,45 @@
-{stdenv, fetchurl, coreutils, pam, groff}:
+{ stdenv, fetchurl, coreutils, pam, groff }:
 
 stdenv.mkDerivation rec {
-  name = "sudo-1.7.2";
+  name = "sudo-1.8.6p7";
 
   src = fetchurl {
-    urls = 
+    urls =
       [ "ftp://ftp.sudo.ws/pub/sudo/${name}.tar.gz"
         "ftp://ftp.sudo.ws/pub/sudo/OLD/${name}.tar.gz"
       ];
-    sha256 = "02hhvwxj7gnsvmq3cjh592g2xdjpkfcp1jjvwb64nxsz2kbccwy1";
+    sha256 = "0djh2b14d1b1knah46v971x940rz63hvnskz16fzami3nbnqj41h";
   };
 
-  # `--with-stow' allows /etc/sudoers to be a symlink.  Only it
-  # doesn't really help because the target still has to have mode 0440,
-  # while files in the Nix store all have mode 0444.
-  #configureFlags = "--with-stow";
+  postConfigure = ''
+    cat >> pathnames.h <<EOF
+    #undef  _PATH_SUDO_LOGFILE
+    #define _PATH_SUDO_LOGFILE "/var/log/sudo.log"
+    #undef  _PATH_SUDO_TIMEDIR
+    #define _PATH_SUDO_TIMEDIR "/run/sudo"
+    #undef  _PATH_VI
+    #define _PATH_VI "/run/current-system/sw/bin/nano"
+    #undef  _PATH_MV
+    #define _PATH_MV "${coreutils}/bin/mv"
+    EOF
 
-  postConfigure = "
-    sed -e '/_PATH_MV/d; /_PATH_VI/d' -i config.h
-    echo '#define _PATH_SUDO_LOGFILE \"/var/log/sudo.log\"' >> config.h
-    echo '#define _PATH_SUDO_TIMEDIR \"/var/run/sudo\"' >> config.h
-    echo '#define _PATH_MV \"/var/run/current-system/sw/bin/mv\"' >> config.h
-    echo '#define _PATH_VI \"/var/run/current-system/sw/bin/nano\"' >> config.h
-    echo '#define EDITOR _PATH_VI' >>config.h
+    makeFlags="install_uid=$(id -u) install_gid=$(id -g)"
+    installFlags="sudoers_uid=$(id -u) sudoers_gid=$(id -g) sysconfdir=$out/etc timedir=$TMPDIR/dummy"
+  '';
 
-    makeFlags=\"install_uid=$(id -u) install_gid=$(id -g)\"
-    installFlags=\"sudoers_uid=$(id -u) sudoers_gid=$(id -g) sysconfdir=$out/etc\"
-  ";
+  buildInputs = [ coreutils pam groff ];
 
-  buildInputs = [coreutils pam groff];
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    # ‘visudo’ does not make sense on NixOS.
+    rm $out/sbin/visudo $out/share/man/man8/visudo.8
+
+    rm $out/share/doc/sudo/ChangeLog
+  '';
 
   meta = {
-    description = "sudo, a command to run commands as root";
+    description = "A command to run commands as root";
 
     longDescription = ''
       Sudo (su "do") allows a system administrator to delegate
@@ -43,5 +51,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.sudo.ws/;
 
     license = http://www.sudo.ws/sudo/license.html;
+
+    maintainers = [ stdenv.lib.maintainers.eelco ];
   };
 }
diff --git a/pkgs/tools/security/tor/default.nix b/pkgs/tools/security/tor/default.nix
index 3d2360196a6..e8c27c5f2b1 100644
--- a/pkgs/tools/security/tor/default.nix
+++ b/pkgs/tools/security/tor/default.nix
@@ -1,20 +1,17 @@
 { stdenv, fetchurl, libevent, openssl, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "tor-0.2.2.35";
+  name = "tor-0.2.3.25";
 
   src = fetchurl {
     url = "http://www.torproject.org/dist/${name}.tar.gz";
-    sha256 = "f141a41fffd31494a0f96ebbb6b999eab33ce62d5c31f81222a0acd034adbf3a";
+    sha256 = "bb2d6f1136f33e11d37e6e34184143bf191e59501613daf33ae3d6f78f3176a0";
   };
 
-#  patchPhase =
-    # DNS lookups fail in chroots.
-#    '' sed -i "src/or/test.c" -es/localhost/127.0.0.1/g
-#    '';
-
   buildInputs = [ libevent openssl zlib ];
 
+  CFLAGS = "-lgcc_s";
+
   doCheck = true;
 
   meta = {
@@ -35,7 +32,7 @@ stdenv.mkDerivation rec {
 
     maintainers =
       [ # Russell O’Connor <roconnor@theorem.ca> ?
-	stdenv.lib.maintainers.ludo
+        stdenv.lib.maintainers.ludo
       ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
diff --git a/pkgs/tools/security/tor/torsocks.nix b/pkgs/tools/security/tor/torsocks.nix
index 83cfee07e66..ac60ccb16a1 100644
--- a/pkgs/tools/security/tor/torsocks.nix
+++ b/pkgs/tools/security/tor/torsocks.nix
@@ -2,11 +2,11 @@
 stdenv.mkDerivation rec {
   pname = "torsocks";
   name = "${pname}-${version}";
-  version = "1.0-epsilon";
+  version = "1.2";
   
   src = fetchurl {
     url = "http://${pname}.googlecode.com/files/${name}.tar.gz";
-    sha256 = "0508i4q9gm0rrav018z1jn4as5if3qrfdng6dmmzgs324hvdgap5";
+    sha256 = "1m0is5q24sf7jjlkl0icfkdc0m53nbkg0q72s57p48yp4hv7v9dy";
   };
 
   preConfigure = ''
diff --git a/pkgs/tools/security/vidalia/default.nix b/pkgs/tools/security/vidalia/default.nix
index 243604c2c79..6f34d61908e 100644
--- a/pkgs/tools/security/vidalia/default.nix
+++ b/pkgs/tools/security/vidalia/default.nix
@@ -2,11 +2,11 @@
 stdenv.mkDerivation rec {
 
   name = "vidalia-${version}";
-  version = "0.2.17";
+  version = "0.2.21";
 
   src = fetchurl {
     url = "https://www.torproject.org/dist/vidalia/${name}.tar.gz";
-    sha256 = "0x0vb37h2d5njxmqkss03ybv7b7jw25682xb793mix1m8l0hs44r";
+    sha256 = "1rqvvhdqgk6jqrd15invvc4r7p4nckd3b93hhr5dzpc1fxz8w064";
   };
 
   buildInputs = [ cmake qt4 ];
@@ -18,4 +18,4 @@ stdenv.mkDerivation rec {
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.all;
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/tools/system/acct/default.nix b/pkgs/tools/system/acct/default.nix
index 003dbb45a2a..a2ea6176c74 100644
--- a/pkgs/tools/system/acct/default.nix
+++ b/pkgs/tools/system/acct/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
     sha256 = "1mbg18acrva5m7kxc9pzhaknsqm4r90nrp7ax9jkm9wjkrxwhqs1";
   };
 
+  patches = [ ./no-gets.patch ];
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/tools/system/acct/no-gets.patch b/pkgs/tools/system/acct/no-gets.patch
new file mode 100644
index 00000000000..3478b66de9d
--- /dev/null
+++ b/pkgs/tools/system/acct/no-gets.patch
@@ -0,0 +1,22 @@
+hack until acct pulls a newer gnulib version
+
+From 66712c23388e93e5c518ebc8515140fa0c807348 Mon Sep 17 00:00:00 2001
+From: Eric Blake <eblake@redhat.com>
+Date: Thu, 29 Mar 2012 13:30:41 -0600
+Subject: [PATCH] stdio: don't assume gets any more
+
+Gnulib intentionally does not have a gets module, and now that C11
+and glibc have dropped it, we should be more proactive about warning
+any user on a platform that still has a declaration of this dangerous
+interface.
+
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -125,7 +125,6 @@
+    so any use of gets warrants an unconditional warning.  Assume it is
+    always declared, since it is required by C89.  */
+ #undef gets
+-_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ 
+ #if @GNULIB_FOPEN@
+ # if @REPLACE_FOPEN@
diff --git a/pkgs/tools/system/ddrescue/default.nix b/pkgs/tools/system/ddrescue/default.nix
index 0ca5d6af2d7..8fa40e5710f 100644
--- a/pkgs/tools/system/ddrescue/default.nix
+++ b/pkgs/tools/system/ddrescue/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "ddrescue-1.15";
+  name = "ddrescue-1.16";
 
   src = fetchurl {
     url = "mirror://gnu/ddrescue/${name}.tar.gz";
-    sha256 = "0y1dxkbl82nli6xjlg2kaq5kxd19480rvpay4ydbb9av01i17q3m";
+    sha256 = "1rixya7p8c4jrn4p0flf6h5dqwybrilf3hrj4r7x41h3zgjz5cvn";
   };
 
   doCheck = true;
diff --git a/pkgs/tools/system/fakeroot/default.nix b/pkgs/tools/system/fakeroot/default.nix
index d80b35e1a11..1bf18ed867c 100644
--- a/pkgs/tools/system/fakeroot/default.nix
+++ b/pkgs/tools/system/fakeroot/default.nix
@@ -1,13 +1,21 @@
-{stdenv, fetchurl}:
+{stdenv, fetchurl, utillinux}:
 
-stdenv.mkDerivation {
-  name = "fakeroot-1.18.1";
+stdenv.mkDerivation rec {
+  name = "fakeroot-1.18.4";
 
   src = fetchurl {
-    url = http://ftp.de.debian.org/debian/pool/main/f/fakeroot/fakeroot_1.18.1.orig.tar.bz2;
-    sha256 = "0h5jsw715a9hv32cb1m1bajy26l7xxrbgrk6qk1b6m91lxh6rnw9";
+    url = https://launchpad.net/ubuntu/+archive/primary/+files/fakeroot_1.18.4.orig.tar.bz2;
+    sha256 = "18mydrz49n7ic7147pikkpdb96x00s9wisdk6hrc75ll7vx9wd8a";
   };
 
+  buildInputs = [ utillinux /* provides getopt */ ];
+
+  postUnpack = ''
+    for prog in getopt; do
+      sed -i "s@getopt@$(type -p getopt)@g" ${name}/scripts/fakeroot.in
+    done
+  '';
+
   meta = {
     homepage = http://fakeroot.alioth.debian.org/;
     description = "Give a fake root environment through LD_PRELOAD";
diff --git a/pkgs/tools/system/fdisk/default.nix b/pkgs/tools/system/fdisk/default.nix
index 5a34813d8d9..988989b82f7 100644
--- a/pkgs/tools/system/fdisk/default.nix
+++ b/pkgs/tools/system/fdisk/default.nix
@@ -1,19 +1,19 @@
-{ fetchurl, stdenv, parted, libuuid, gettext }:
+{ fetchurl, stdenv, parted, libuuid, gettext, guile }:
 
 stdenv.mkDerivation rec {
-  name = "fdisk-1.3.0a";
+  name = "gnufdisk-2.0.0a"; # .0a1 seems broken, see http://lists.gnu.org/archive/html/bug-fdisk/2012-09/msg00000.html
 
   src = fetchurl {
-    url = "mirror://gnu/fdisk/${name}.tar.bz2";
-    sha256 = "1g2zvl560f7p1hd4q50d1msy6qp7949mdkagfy8ki8cayp8fp267";
+    url = "mirror://gnu/fdisk/${name}.tar.gz";
+    sha256 = "04nd7civ561x2lwcmxhsqbprml3178jfc58fy1v7hzqg5k4nbhy3";
   };
 
-  buildInputs = [ parted libuuid gettext ];
+  buildInputs = [ parted libuuid gettext guile ];
 
   doCheck = true;
 
   meta = {
-    description = "GNU fdisk, a command-line disk partitioning tool";
+    description = "A command-line disk partitioning tool";
 
     longDescription = ''
       GNU fdisk provides alternatives to util-linux fdisk and util-linux
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.gnu.org/software/fdisk/;
 
     maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms = stdenv.lib.platforms.linux;
+    #platforms = stdenv.lib.platforms.linux; # was failing for long without anyone complaining
   };
 }
diff --git a/pkgs/tools/system/hardlink/default.nix b/pkgs/tools/system/hardlink/default.nix
index 1655fdba6f4..982aac3c990 100644
--- a/pkgs/tools/system/hardlink/default.nix
+++ b/pkgs/tools/system/hardlink/default.nix
@@ -1,33 +1,27 @@
-{ fetchurl, stdenv }:
+{ fetchurl, stdenv, unzip }:
 
 let
-  rev = "269cc6";
-
-  src = fetchurl {
-    url = "http://pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=blob_plain;f=hardlink.c;hb=${rev}";
-    sha256 = "721c54e653772e11bf0d30fb02aa21b96b147a1b68c0acb4f05cb87e7718bc12";
-    name = "hardlink.c";
-  };
-
-  man =  fetchurl {
-    url = "pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=blob_plain;f=hardlink.1;hb=${rev}";
-    sha256 = "2f7e18a0259a2ceae316592e8b18bee525eb7e83fe3bb6b881e5dafa24747f2d";
-    name = "hardlink.1";
-  };
+  rev = "3ec908d539";
 in
 stdenv.mkDerivation {
-  name = "hardlink-2010.1.${rev}";
+  name = "hardlink-2012.9.${rev}";
 
-  phases = ["buildPhase"];
+  src = fetchurl {
+    url = "http://pkgs.fedoraproject.org/cgit/hardlink.git/snapshot/hardlink-${rev}.zip";
+    sha256 = "fea1803170b538d5fecf6a8d312ded1d25d516e9386a3797441a247487551647";
+    name = "hardlink-${rev}.zip";
+  };
 
-  buildPhase = ''
+  installPhase = ''
     mkdir -p $out/bin $out/share/man/man1
-    gcc -O2 ${src} -o $out/bin/hardlink
-    install -m 444 ${man} $out/share/man/man1/hardlink.1
+    gcc -O2 hardlink.c -o $out/bin/hardlink
+    mv hardlink.1 $out/share/man/man1/hardlink.1
   '';
 
+  buildInputs = [ unzip ];
+
   meta = {
-    homepage = "http://pkgs.fedoraproject.org/gitweb/?p=hardlink.git;a=summary";
+    homepage = "http://pkgs.fedoraproject.org/cgit/hardlink.git/";
     description = "consolidate duplicate files via hardlinks";
     license = stdenv.lib.licenses.gpl2Plus;
 
diff --git a/pkgs/tools/system/idle3tools/default.nix b/pkgs/tools/system/idle3tools/default.nix
new file mode 100644
index 00000000000..1325b52b380
--- /dev/null
+++ b/pkgs/tools/system/idle3tools/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "idle3-tools-0.9.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/idle3-tools/idle3-tools-0.9.1.tgz";
+    sha256 = "00ia7xq9yldxyl9gz0mr4xa568nav14p0fnv82f2rbbkg060cy4p";
+  };
+
+  preInstall = ''
+    installFlags=DESTDIR=$out
+  '';
+
+  meta = {
+    homepage = http://idle3-tools.sourceforge.net/;
+    description = "Tool to get/set the infamous idle3 timer in WD HDDs";
+    license = "GPLv3";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/system/logcheck/default.nix b/pkgs/tools/system/logcheck/default.nix
new file mode 100644
index 00000000000..1c57711940b
--- /dev/null
+++ b/pkgs/tools/system/logcheck/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, lockfileProgs, perl, mimeConstruct }:
+
+stdenv.mkDerivation rec {
+  _name   = "logcheck";
+  version = "1.3.15";
+  name    = "${_name}-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/l/${_name}/${_name}_${version}.tar.gz";
+    sha256 = "1rdrs12hkm5i5yyz89a6cwhf4fzjkbcd4q4zy6sk148aji9lg6xj";
+  };
+
+  preConfigure = ''
+    substituteInPlace src/logtail --replace "/usr/bin/perl" "${perl}/bin/perl"
+    substituteInPlace src/logtail2 --replace "/usr/bin/perl" "${perl}/bin/perl"
+
+    sed -i -e 's|! -f /usr/bin/lockfile|! -f ${lockfileProgs}/bin/lockfile|' \
+           -e 's|^\([ \t]*\)lockfile-|\1${lockfileProgs}/bin/lockfile-|' \
+           -e "s|/usr/sbin/logtail2|$out/sbin/logtail2|" \
+           -e 's|mime-construct|${mimeConstruct}/bin/mime-construct|' \
+           -e 's|\$(run-parts --list "\$dir")|"$dir"/*|' src/logcheck
+  '';
+
+  makeFlags = [
+    "DESTDIR=$(out)"
+    "SBINDIR=sbin"
+    "BINDIR=bin"
+    "SHAREDIR=share/logtail/detectrotate"
+ ];
+
+  meta = {
+    description = "Mails anomalies in the system logfiles to the administrator.";
+    longDescription = ''
+      Mails anomalies in the system logfiles to the administrator.
+
+      Logcheck helps spot problems and security violations in your logfiles automatically and will send the results to you by e-mail.
+      Logcheck was part of the Abacus Project of security tools, but this version has been rewritten.
+    '';
+    homepage = http://logcheck.org;
+    license = "GPLv2";
+
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/tools/system/logrotate/default.nix b/pkgs/tools/system/logrotate/default.nix
index a9994f14b57..784c8e75e76 100644
--- a/pkgs/tools/system/logrotate/default.nix
+++ b/pkgs/tools/system/logrotate/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl, gzip, popt}:
+{ stdenv, fetchurl, gzip, popt }:
 
 stdenv.mkDerivation rec {
-  name = "logrotate-3.7.8";
+  name = "logrotate-3.8.3";
 
   src = fetchurl {
-    url = https://fedorahosted.org/releases/l/o/logrotate/logrotate-3.7.8.tar.gz;
-    sha256 = "1p9nqmznqvzn03saw3jxa8xwsdqym8jr778rwig8kk786343vai1";
+    url = "https://fedorahosted.org/releases/l/o/logrotate/${name}.tar.gz";
+    sha256 = "0xqrz8xzs2c1vx8l5h9lp2ciwwifj7y52xsppb1vrvbi254vyxh7";
   };
 
   # Logrotate wants to access the 'mail' program; to be done.
@@ -21,11 +21,11 @@ stdenv.mkDerivation rec {
   buildInputs = [ popt ];
 
   meta = {
-    homepage = "https://fedorahosted.org/releases/l/o/logrotate/";
+    homepage = https://fedorahosted.org/releases/l/o/logrotate/;
     description = "Rotates and compresses system logs";
     license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; all;
+    maintainers = [ stdenv.lib.maintainers.viric ];
+    platforms = stdenv.lib.platforms.all;
   };
 
 }
diff --git a/pkgs/tools/system/monit/src-for-default.nix b/pkgs/tools/system/monit/src-for-default.nix
index f024801515f..b74958ae19a 100644
--- a/pkgs/tools/system/monit/src-for-default.nix
+++ b/pkgs/tools/system/monit/src-for-default.nix
@@ -1,8 +1,9 @@
 rec {
-  advertisedUrl="http://mmonit.com/monit/download/../dist/monit-5.0.3.tar.gz";
-  version = "5.0.3";
-  url="http://mmonit.com/monit/download/../dist/monit-5.0.3.tar.gz";
-  hash = "1lw7qp5906cb9jg8ifhfy9cvv4gbd28mkapgfpx0klb17jdm7ljx";
-  name = "monit-5.0.3";
+   version="5.5";
+   name="monit-5.5";
+   hash="0lvw9llsnaj72dp6di74sc4sxpa4q3g23m28jwy4brphndhb0xl2";
+   url="http://mmonit.com/monit/download/../dist/monit-${version}.tar.gz";
+   advertisedUrl="http://mmonit.com/monit/download/../dist/monit-5.5.tar.gz";
+  
   
 }
diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix
index 563521429a8..3cab8b0ef10 100644
--- a/pkgs/tools/system/pciutils/default.nix
+++ b/pkgs/tools/system/pciutils/default.nix
@@ -1,19 +1,19 @@
 { stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "pciutils-3.1.7";
-  
+  name = "pciutils-3.1.10";
+
   src = fetchurl {
     url = "mirror://kernel/software/utils/pciutils/${name}.tar.bz2";
-    sha256 = "0i7mqf1fkmdqsawdk2badv6k3xrkryq0i2xknclvy6kcjsv27znq";
+    sha256 = "0xdahcxd00c921wnxi0f0w3lzjqdfphwa5vglfcpf0lv3l2w40pl";
   };
-  
+
   buildInputs = [ zlib ];
 
   pciids = fetchurl {
     # Obtained from http://pciids.sourceforge.net/v2.2/pci.ids.bz2.
-    url = http://nixos.org/tarballs/pci.ids.20100714.bz2;
-    sha256 = "0vll4svr60l6217yna7bfhcjm3prxr2b62ynq4jaagdp1rilfbap";
+    url = http://nixos.org/tarballs/pci.ids.20120929.bz2;
+    sha256 = "1q3i479ay88wam1zz1vbgkbqb2axg8av9qjxaigrqbnw2pv0srmb";
   };
 
   # Override broken auto-detect logic.
@@ -27,6 +27,9 @@ stdenv.mkDerivation rec {
 
   installTargets = "install install-lib";
 
+  # Get rid of update-pciids as it won't work.
+  postInstall = "rm $out/sbin/update-pciids $out/man/man8/update-pciids.8";
+
   meta = {
     homepage = http://mj.ucw.cz/pciutils.shtml;
     description = "A collection of programs for inspecting and manipulating configuration of PCI devices";
diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix
new file mode 100644
index 00000000000..0189d04902a
--- /dev/null
+++ b/pkgs/tools/system/rsyslog/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, eventlog, pkgconfig, libestr, libee, json_c, libuuid, zlib, gnutls}:
+
+stdenv.mkDerivation {
+  name = "rsyslog-7.2.6";
+
+  src = fetchurl {
+    url = http://www.rsyslog.com/files/download/rsyslog/rsyslog-7.2.6.tar.gz;
+    sha256 = "19a5c60816ebce6c86468eb8c5fe1c4cc1febf23c9167ce59d2327fe5e047ed9";
+  };
+
+  buildInputs = [pkgconfig libestr libee json_c libuuid zlib gnutls];
+
+  configureFlags = "--enable-gnutls";
+
+  meta = {
+    homepage = "http://www.rsyslog.com/";
+    description = "Rsyslog is an enhanced syslogd. It can be used as a drop-in replacement for stock sysklogd.";
+    license = "GPLv3";
+
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/system/safecopy/default.nix b/pkgs/tools/system/safecopy/default.nix
new file mode 100644
index 00000000000..a6a5fced879
--- /dev/null
+++ b/pkgs/tools/system/safecopy/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "safecopy-1.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/safecopy/safecopy/${name}/${name}.tar.gz";
+    sha256 = "1zf4kk9r8za9pn4hzy1y3j02vrhl1rxfk5adyfq0w0k48xfyvys2";
+  };
+
+  meta = {
+    description = "data recovery tool for damaged hardware";
+
+    longDescription =
+      '' Safecopy is a data recovery tool which tries to extract as much data as possible from a
+         problematic (i.e. damaged sectors) source - like floppy drives, hard disk partitions, CDs,
+         tape devices, etc, where other tools like dd would fail due to I/O errors.
+
+         Safecopy includes a low level IO layer to read CDROM disks in raw mode, and issue device
+         resets and other helpful low level operations on a number of other device classes.
+       '';
+
+    homepage = http://safecopy.sourceforge.net;
+
+    license = "GPLv2+";
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+  };
+}
diff --git a/pkgs/tools/system/smartmontools/default.nix b/pkgs/tools/system/smartmontools/default.nix
index eee0b0de571..909b0d832f7 100644
--- a/pkgs/tools/system/smartmontools/default.nix
+++ b/pkgs/tools/system/smartmontools/default.nix
@@ -1,13 +1,25 @@
 { stdenv, fetchurl }:
 
+let
+  driverdb = fetchurl {
+    url = "http://smartmontools.svn.sourceforge.net/viewvc/smartmontools/trunk/smartmontools/drivedb.h?revision=3797";
+    sha256 = "01ycm3vffxpfvfga9vp1d38jy3lqpkpxnxf78pidc8q1nn8bpdyz";
+    name = "smartmontools-drivedb.h";
+  };
+in
 stdenv.mkDerivation rec {
-  name = "smartmontools-5.43";
+  name = "smartmontools-6.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/smartmontools/${name}.tar.gz";
-    sha256 = "d845187d1500b87ef8d2c43772bd0218a59114fe58474a903c56777c9175351e";
+    sha256 = "01yfv6hqsqandg6x8mnwa4g42hhqvc7dfxnfb3v849n8rj5kn059";
   };
 
+  patchPhase = ''
+    cp ${driverdb} drivedb.h
+    sed -i -e 's@which which >/dev/null || exit 1@alias which="type -p"@' update-smart-drivedb.in
+  '';
+
   meta = {
     description = "Tools for monitoring the health of hard drivers";
     homepage = "http://smartmontools.sourceforge.net/";
diff --git a/pkgs/tools/system/storebrowse/default.nix b/pkgs/tools/system/storebrowse/default.nix
new file mode 100644
index 00000000000..c46372bcd4b
--- /dev/null
+++ b/pkgs/tools/system/storebrowse/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, fetchhg, go, sqlite}:
+
+assert stdenv.isLinux && (stdenv.isi686 || stdenv.isx86_64 || stdenv.isArm);
+
+stdenv.mkDerivation rec {
+  name = "storebrowse-20130318212204";
+
+  src = fetchurl {
+    url = "http://viric.name/cgi-bin/storebrowse/tarball/storebrowse-775928f68e53.tar.gz?uuid=775928f68e53";
+    name = "${name}.tar.gz";
+    sha256 = "1yb8qbw95d9561s10k12a6lwv3my8h52arsbfcpizx74dwfsv7in";
+  };
+
+  # This source has license BSD
+  srcGoSqlite = fetchhg {
+    url = "https://code.google.com/p/gosqlite/";
+    tag = "5baefb109e18";
+    sha256 = "0mqfnx06jj15cs8pq9msny2z18x99hgk6mchnaxpg343nzdiz4zk";
+  };
+
+  buildPhase = ''
+    PATH=${go}/bin:$PATH
+    mkdir $TMPDIR/go
+    export GOPATH=$TMPDIR/go
+
+    ${stdenv.lib.optionalString (stdenv.system == "armv5tel-linux") "export GOARM=5"}
+
+    GOSQLITE=$GOPATH/src/code.google.com/p/gosqlite
+    mkdir -p $GOSQLITE
+    cp -R $srcGoSqlite/* $GOSQLITE/
+    export CGO_CFLAGS=-I${sqlite}/include
+    export CGO_LDFLAGS=-L${sqlite}/lib
+    go build -ldflags "-r ${sqlite}/lib" -o storebrowse
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp storebrowse $out/bin
+  '';
+
+  meta = {
+    homepage = http://viric.name/cgi-bin/storebrowse;
+    license = "AGPLv3+";
+  };
+}
diff --git a/pkgs/tools/system/thinkfan/default.nix b/pkgs/tools/system/thinkfan/default.nix
new file mode 100644
index 00000000000..a13f500c34f
--- /dev/null
+++ b/pkgs/tools/system/thinkfan/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl }:
+
+let
+
+  version = "0.8.1";
+  
+in
+
+stdenv.mkDerivation {
+  name = "thinkfan-${version}";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/thinkfan/thinkfan-${version}.tar.gz";
+    sha256 = "04akla66r8k10x0jvmcpfi92hj2sppygcl7hhwn8n8zsvvf0yqxs";
+  };
+  
+  installPhase = ''
+    mkdir -p $out/bin
+    mv thinkfan $out/bin/
+  '';
+
+  meta = {
+    description = "";
+    license = stdenv.lib.licenses.gpl3;
+    homePage = "http://thinkfan.sourceforge.net/";
+    maintainers = with stdenv.lib.maintainers; [ iElectric ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/tools/system/vboot_reference/default.nix b/pkgs/tools/system/vboot_reference/default.nix
new file mode 100644
index 00000000000..4c3c58b35cd
--- /dev/null
+++ b/pkgs/tools/system/vboot_reference/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchgit, pkgconfig, libuuid, openssl }:
+
+let
+  arch = if stdenv.system == "x86_64-linux" then "x86_64"
+    else if stdenv.system == "i686-linux" then "x86"
+    else throw "vboot_reference for: ${stdenv.system} not supported!";
+
+  version = "20130507";
+  checkout = "25/50225/2";
+in stdenv.mkDerivation {
+  name = "vboot_reference-${version}";
+
+  src = fetchgit {
+    url = "http://git.chromium.org/git/chromiumos/platform/vboot_reference.git";
+    rev = "refs/changes/${checkout}";
+    sha256 = "00qhwhh5ygrcfm9is8hrk1spqdvfs6aa744h10jbr03zics5bvac";
+  };
+
+  buildInputs = [ pkgconfig openssl ] ++
+                (if libuuid == null
+                 then []
+                 else [ (stdenv.lib.overrideDerivation libuuid
+                          (args: { configureFlags = args.configureFlags + " --enable-static"; })) ]);
+
+  buildPhase = ''
+    make ARCH=${arch} `pwd`/build/cgpt/cgpt
+    make ARCH=${arch} `pwd`/build/utility/vbutil_kernel
+    make ARCH=${arch} `pwd`/build/utility/vbutil_key
+    make ARCH=${arch} `pwd`/build/utility/vbutil_keyblock
+    make ARCH=${arch} `pwd`/build/utility/vbutil_firmware
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp build/cgpt/cgpt $out/bin
+    cp build/utility/vbutil_kernel $out/bin
+    cp build/utility/vbutil_key $out/bin
+    cp build/utility/vbutil_keyblock $out/bin
+    cp build/utility/vbutil_firmware $out/bin
+  '';
+}
diff --git a/pkgs/tools/text/ascii/default.nix b/pkgs/tools/text/ascii/default.nix
new file mode 100644
index 00000000000..769cf389426
--- /dev/null
+++ b/pkgs/tools/text/ascii/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "ascii-${version}";
+  version = "3.12";
+
+  src = fetchurl {
+    url = "http://www.catb.org/~esr/ascii/${name}.tar.gz";
+    sha256 = "17jhmmdbhzzaai0lr5aslg0nmqchq1ygdxwd8pgl7qn2jnxhc6ci";
+  };
+
+  prePatch = ''
+    sed -i -e 's|$(DESTDIR)/usr|$(out)|g' Makefile
+  '';
+
+  preInstall = ''
+    mkdir -vp "$out/bin" "$out/share/man/man1"
+  '';
+
+  meta = {
+    description = "Interactive ASCII name and synonym chart";
+    homepage = "http://www.catb.org/~esr/ascii/";
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index 086a44675a9..fc4293ad7cf 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -1,28 +1,20 @@
-{stdenv, fetchurl, coreutils ? null}:
+{ stdenv, fetchurl, coreutils ? null }:
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name = "diffutils-3.2";
-  
+
   src = fetchurl {
     url = mirror://gnu/diffutils/diffutils-3.2.tar.gz;
     sha256 = "1lsf0ln0h3mnm2y0mwgrfk0lyfi7bnm4r886acvdrrsvc7pypaia";
   };
-  
+
+  patches = [ ./gets-undeclared.patch ];
+
   /* If no explicit coreutils is given, use the one from stdenv. */
-  buildNativeInputs = [coreutils];
+  nativeBuildInputs = [ coreutils ];
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;
     description = "Commands for showing the differences between files (diff, cmp, etc.)";
   };
 }
-
-//
-
-{
-  crossAttrs =
-    # XXX: Temporary workaround to allow GNU/Hurd builds with newer libcs.
-    (stdenv.lib.optionalAttrs (stdenv.cross.config == "i586-pc-gnu") {
-      patches = [ ../../misc/coreutils/gets-undeclared.patch ];
-    });
-})
diff --git a/pkgs/tools/text/diffutils/gets-undeclared.patch b/pkgs/tools/text/diffutils/gets-undeclared.patch
new file mode 100644
index 00000000000..b6cdc77caa8
--- /dev/null
+++ b/pkgs/tools/text/diffutils/gets-undeclared.patch
@@ -0,0 +1,71 @@
+This patch is needed to allow builds with newer versions of
+the GNU libc (2.16+).
+
+
+commit 66712c23388e93e5c518ebc8515140fa0c807348
+Author: Eric Blake <eblake@redhat.com>
+Date:   Thu Mar 29 13:30:41 2012 -0600
+
+    stdio: don't assume gets any more
+    
+    Gnulib intentionally does not have a gets module, and now that C11
+    and glibc have dropped it, we should be more proactive about warning
+    any user on a platform that still has a declaration of this dangerous
+    interface.
+    
+    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
+    support.
+    * modules/stdio (Makefile.am): Likewise.
+    * lib/stdio-read.c (gets): Likewise.
+    * tests/test-stdio-c++.cc: Likewise.
+    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
+    * lib/stdio.in.h (gets): Make warning occur in more places.
+    * doc/posix-functions/gets.texi (gets): Update documentation.
+    Reported by Christer Solskogen.
+    
+    Signed-off-by: Eric Blake <eblake@redhat.com>
+
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index aa7b599..c377b6e 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
+@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ # endif
+ #endif
+ 
+-/* Some people would argue that sprintf should be handled like gets
+-   (for example, OpenBSD issues a link warning for both functions),
+-   since both can cause security holes due to buffer overruns.
++/* Some people would argue that all sprintf uses should be warned about
++   (for example, OpenBSD issues a link warning for it),
++   since it can cause security holes due to buffer overruns.
+    However, we believe that sprintf can be used safely, and is more
+    efficient than snprintf in those safe cases; and as proof of our
+    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/pkgs/tools/text/enca/default.nix b/pkgs/tools/text/enca/default.nix
new file mode 100644
index 00000000000..ce1c7401a4e
--- /dev/null
+++ b/pkgs/tools/text/enca/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, libiconv ? null }:
+
+stdenv.mkDerivation rec {
+  name = "enca-1.13";
+
+  src = fetchurl {
+    url = "http://dl.cihar.com/enca/${name}.tar.bz2";
+    sha256 = "6c091455d524b3ddae3533fe9bb375092f60ad6fe252e0777c873bd7869c7432";
+  };
+
+  buildInputs = (stdenv.lib.optional (libiconv != null) libiconv);
+
+  meta = {
+    homepage = http://freecode.com/projects/enca;
+    description = "Detects the encoding of text files and reencodes them";
+
+    longDescription = ''
+        Enca detects the encoding of text files, on the basis of knowledge
+        of their language. It can also convert them to other encodings,
+        allowing you to recode files without knowing their current encoding.
+        It supports most of Central and East European languages, and a few
+        Unicode variants, independently on language.
+    '';
+
+    license = "GPLv2";
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/tools/text/gawk/cygwin-identifiers.patch b/pkgs/tools/text/gawk/cygwin-identifiers.patch
deleted file mode 100644
index baff9b55481..00000000000
--- a/pkgs/tools/text/gawk/cygwin-identifiers.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-This patch fixes compilation on Windows, where some of the identifiers
-would clash.
-
-commit 5a0b7f9953f24dc034eca4052214da49fbad8bd0
-Author: Arnold D. Robbins <arnold@skeeve.com>
-Date:   Fri Jul 29 13:25:57 2011 +0300
-
-    Fix DJGPP problem with libsigsegv.
-
-diff --git a/builtin.c b/builtin.c
-index 4d87592..941f5ad 100644
---- a/builtin.c
-+++ b/builtin.c
-@@ -605,7 +605,7 @@ format_tree(
- 	NODE *arg;
- 	long fw, prec, argnum;
- 	int used_dollar;
--	int lj, alt, big, bigbig, small, have_prec, need_format;
-+	int lj, alt, big_flag, bigbig_flag, small_flag, have_prec, need_format;
- 	long *cur = NULL;
- 	uintmax_t uval;
- 	int sgn;
-@@ -725,7 +725,7 @@ format_tree(
- 		signchar = FALSE;
- 		zero_flag = FALSE;
- 		quote_flag = FALSE;
--		lj = alt = big = bigbig = small = FALSE;
-+		lj = alt = big_flag = bigbig_flag = small_flag = FALSE;
- 		fill = sp;
- 		cp = cend;
- 		chbuf = lchbuf;
-@@ -907,7 +907,7 @@ check_pos:
- 			goto retry;  
- #endif
- 		case 'l':
--			if (big)
-+			if (big_flag)
- 				break;
- 			else {
- 				static short warned = FALSE;
-@@ -921,10 +921,10 @@ check_pos:
- 					goto out;
- 				}
- 			}
--			big = TRUE;
-+			big_flag = TRUE;
- 			goto retry;
- 		case 'L':
--			if (bigbig)
-+			if (bigbig_flag)
- 				break;
- 			else {
- 				static short warned = FALSE;
-@@ -938,10 +938,10 @@ check_pos:
- 					goto out;
- 				}
- 			}
--			bigbig = TRUE;
-+			bigbig_flag = TRUE;
- 			goto retry;
- 		case 'h':
--			if (small)
-+			if (small_flag)
- 				break;
- 			else {
- 				static short warned = FALSE;
-@@ -955,7 +955,7 @@ check_pos:
- 					goto out;
- 				}
- 			}
--			small = TRUE;
-+			small_flag = TRUE;
- 			goto retry;
- 		case 'c':
- 			need_format = FALSE;
diff --git a/pkgs/tools/text/gawk/default.nix b/pkgs/tools/text/gawk/default.nix
index bb6e4e20d24..eba1dc2ac7f 100644
--- a/pkgs/tools/text/gawk/default.nix
+++ b/pkgs/tools/text/gawk/default.nix
@@ -1,14 +1,16 @@
 { stdenv, fetchurl, libsigsegv }:
 
-stdenv.mkDerivation (rec {
-  name = "gawk-4.0.0";
+stdenv.mkDerivation rec {
+  name = "gawk-4.0.2";
 
   src = fetchurl {
-    url = "mirror://gnu/gawk/${name}.tar.bz2";
-    sha256 = "0sss7rhpvizi2a88h6giv0i7w5h07s2fxkw3s6n1hqvcnhrfgbb0";
+    url = "mirror://gnu/gawk/${name}.tar.xz";
+    sha256 = "04vd0axif762mf781pj3days6ilv2333b9zi9c50y5mma66g5q91";
   };
 
-  doCheck = !stdenv.isCygwin;      # XXX: `test-dup2' segfaults on Cygwin 6.1
+  patches = [];
+
+  doCheck = !stdenv.isCygwin; # XXX: `test-dup2' segfaults on Cygwin 6.1
 
   buildInputs = [ libsigsegv ];
 
@@ -37,9 +39,3 @@ stdenv.mkDerivation (rec {
     maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
-
-//
-
-stdenv.lib.optionalAttrs stdenv.isCygwin {
-  patches = [ ./cygwin-identifiers.patch ];
-})
diff --git a/pkgs/tools/text/gnugrep/default.nix b/pkgs/tools/text/gnugrep/default.nix
index 8368edef656..98a737339d2 100644
--- a/pkgs/tools/text/gnugrep/default.nix
+++ b/pkgs/tools/text/gnugrep/default.nix
@@ -1,19 +1,21 @@
 { stdenv, fetchurl, pcre, libiconv ? null }:
 
-let version = "2.10"; in
+let version = "2.14"; in
 
-stdenv.mkDerivation ({
+stdenv.mkDerivation {
   name = "gnugrep-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/grep/grep-${version}.tar.xz";
-    sha256 = "1cvsqyfzk1p38fcaav22dn76fkd02g7bjnqna6vrpk9vy9rnfybc";
+    sha256 = "1qbjb1l7f9blckc5pqy8jlf6482hpx4awn2acmhyf5mv9wfq03p7";
   };
 
   buildInputs = [ pcre ]
-    ++ (stdenv.lib.optional (libiconv != null) libiconv);
+    ++ stdenv.lib.optional (libiconv != null) libiconv;
 
-  doCheck = if stdenv.isDarwin then false else true;
+  NIX_LDFLAGS = stdenv.lib.optionalString (libiconv != null) "-L${libiconv}/lib -liconv";
+
+  doCheck = !stdenv.isDarwin;
 
   # On Mac OS X, force use of mkdir -p, since Grep's fallback
   # (./install-sh) is broken.
@@ -38,4 +40,4 @@ stdenv.mkDerivation ({
   };
 
   passthru = {inherit pcre;};
-} // (if libiconv != null then { NIX_LDFLAGS="-L${libiconv}/lib -liconv"; } else {}) )
+}
diff --git a/pkgs/tools/text/gnupatch/darwin-fix.patch b/pkgs/tools/text/gnupatch/darwin-fix.patch
deleted file mode 100644
index 50d08534814..00000000000
--- a/pkgs/tools/text/gnupatch/darwin-fix.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-Fix builds on Darwin:
-http://lists.gnu.org/archive/html/bug-patch/2010-01/msg00004.html .
-
-
-commit 2c4e3ecddec8a686bd50d238f4cefebb950298b7
-Author: Andreas Gruenbacher <agruen@suse.de>
-Date:   Fri Jan 1 15:58:15 2010 +0100
-
-    * Makefile.in (LIBSRCS, LIBM4FILES): Add the missing files strnlen.c,
-    strnlen.m4, and safe-read.m4.
-
-diff --git a/Makefile.in b/Makefile.in
-index 3b3d78a..26dc281 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -91,6 +91,7 @@ LIBSRCS = \
- 	gl/lib/stripslash.c \
- 	gl/lib/strncasecmp.c \
- 	gl/lib/strndup.c \
-+	gl/lib/strnlen.c \
- 	gl/lib/xmalloc.c \
- 	gl/lib/xstrndup.c
-
-
-Add the missing bits from Gnulib.
-
---- /dev/null	2012-04-23 08:54:35.747205543 +0200
-+++ b/gl/lib/strnlen.c	2012-01-16 22:35:02.000000000 +0100
-@@ -0,0 +1,31 @@
-+/* Find the length of STRING, but scan at most MAXLEN characters.
-+   Copyright (C) 2005-2007, 2009-2012 Free Software Foundation, Inc.
-+   Written by Simon Josefsson.
-+
-+   This program is free software; you can redistribute it and/or modify
-+   it under the terms of the GNU General Public License as published by
-+   the Free Software Foundation; either version 2, or (at your option)
-+   any later version.
-+
-+   This program is distributed in the hope that it will be useful,
-+   but WITHOUT ANY WARRANTY; without even the implied warranty of
-+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+   GNU General Public License for more details.
-+
-+   You should have received a copy of the GNU General Public License
-+   along with this program; if not, write to the Free Software Foundation,
-+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
-+
-+#include <config.h>
-+
-+#include <string.h>
-+
-+/* Find the length of STRING, but scan at most MAXLEN characters.
-+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
-+
-+size_t
-+strnlen (const char *string, size_t maxlen)
-+{
-+  const char *end = memchr (string, '\0', maxlen);
-+  return end ? (size_t) (end - string) : maxlen;
-+}
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index a7a166c95c3..c8c336ad202 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -1,20 +1,21 @@
 { stdenv, fetchurl, ed }:
 
-stdenv.mkDerivation (rec {
-  name = "patch-2.6.1";
+stdenv.mkDerivation rec {
+  name = "patch-2.7.1";
 
   src = fetchurl {
     url = "mirror://gnu/patch/${name}.tar.gz";
-    sha256 = "1fc1jyq80nswkf492fiqdbl2bhvlw2wb44ghqlfd3zngx4qkfmni";
+    sha256 = "1m9r83b5c154xnxbvgjg4lfff58xjapanj6dmmivqx1liik2hpy0";
   };
 
-  buildInputs = (stdenv.lib.optional doCheck ed);
+  buildInputs = stdenv.lib.optional doCheck ed;
 
   crossAttrs = {
     configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
   };
 
-  doCheck = true;
+  # Tests fail on FreeBSD due to a Bashism in the tests.
+  doCheck = !stdenv.isFreeBSD;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";
@@ -33,9 +34,3 @@ stdenv.mkDerivation (rec {
     platforms = stdenv.lib.platforms.all;
   };
 }
-
-//
-
-(stdenv.lib.optionalAttrs stdenv.isDarwin {
-  patches = [ ./darwin-fix.patch ];
-}))
diff --git a/pkgs/tools/text/groff/default.nix b/pkgs/tools/text/groff/default.nix
index 243fe8dcab8..90c5ef0ba81 100644
--- a/pkgs/tools/text/groff/default.nix
+++ b/pkgs/tools/text/groff/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, ghostscript, perl, groff }:
 
 stdenv.mkDerivation rec {
-  name = "groff-1.20.1";
+  name = "groff-1.22.2";
 
   src = fetchurl {
     url = "mirror://gnu/groff/${name}.tar.gz";
-    sha256 = "01fq5i68p4s4fc6m8i90y5d28wk1x6zh2mkw85n0qqnb6n0qfidn";
+    sha256 = "0xi07nhj5vdgax37rj25mwxzdmsz1ifx50hjgc6hqbkpqkd6821q";
   };
 
   buildInputs = [ ghostscript ];
-  buildNativeInputs = [ perl ];
+  nativeBuildInputs = [ perl ];
 
   doCheck = true;
 
@@ -22,7 +22,9 @@ stdenv.mkDerivation rec {
   };
 
   meta = {
+    homepage = "http://www.gnu.org/software/groff/";
     description = "GNU Troff, a typesetting package that reads plain text and produces formatted output";
+    license = "GPLv3+";
 
     longDescription = ''
       groff is the GNU implementation of troff, a document formatting
@@ -35,9 +37,5 @@ stdenv.mkDerivation rec {
       version gxditview of the X11 xditview previewer, and an
       implementation of the -mm macros.
     '';
-
-    homepage = http://www.gnu.org/software/groff/;
-
-    license = "GPLv3+";
   };
 }
diff --git a/pkgs/tools/text/kdiff3/default.nix b/pkgs/tools/text/kdiff3/default.nix
index d8807bda08b..fc8813e7cec 100644
--- a/pkgs/tools/text/kdiff3/default.nix
+++ b/pkgs/tools/text/kdiff3/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ kdelibs ];
-  buildNativeInputs = [ cmake gettext ];
+  nativeBuildInputs = [ cmake gettext ];
 
   meta = {
     homepage = http://kdiff3.sourceforge.net/;
diff --git a/pkgs/tools/text/numdiff/default.nix b/pkgs/tools/text/numdiff/default.nix
new file mode 100644
index 00000000000..eb5ebf612b2
--- /dev/null
+++ b/pkgs/tools/text/numdiff/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+let
+  version = "5.6.1";
+in
+stdenv.mkDerivation {
+  name = "numdiff-${version}";
+  src = fetchurl {
+    url = "http://ftp.igh.cnrs.fr/pub/nongnu/numdiff/numdiff-${version}.tar.gz";
+    sha256 = "062byxp9vajj4flg1rqh0r2nwg9yx608mbsj5y25wkrzmkgcq3fx";
+  };
+  meta = {
+    description = ''
+      A little program that can be used to compare putatively similar files
+      line by line and field by field, ignoring small numeric differences
+      or/and different numeric formats.
+    '';
+    homepage = "http://www.nongnu.org/numdiff/";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = stdenv.lib.maintainers.bbenoist;
+    platforms = stdenv.lib.platforms.gnu;
+  };
+}
diff --git a/pkgs/tools/text/podiff/default.nix b/pkgs/tools/text/podiff/default.nix
new file mode 100644
index 00000000000..fc9e3785cf3
--- /dev/null
+++ b/pkgs/tools/text/podiff/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "podiff-${version}";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "ftp://download.gnu.org.ua/pub/release/podiff/podiff-1.1.tar.gz";
+    sha256 = "1zz6bcmka5zvk2rq775qv122lqh54aijkxlghvx7z0r6kh880x59";
+  };
+
+  patchPhase = ''
+    sed "s#PREFIX=/usr#PREFIX=$out#g" -i Makefile
+    mkdir -p $out/bin
+    mkdir -p $out/share/man/man1
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Finds differences in translations between two PO files, or revisions";
+    homepage = http://puszcza.gnu.org.ua/software/podiff;
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/tools/text/recode/default.nix b/pkgs/tools/text/recode/default.nix
index e7c5997021d..db9ed5d30f3 100644
--- a/pkgs/tools/text/recode/default.nix
+++ b/pkgs/tools/text/recode/default.nix
@@ -1,46 +1,39 @@
-{stdenv, fetchurl, autoconf, automake, libtool, gettext, perl}:
+# XXX: this may need -liconv on non-glibc systems.. 
 
-let
-  asIfPatch = ./recode-3.6-as-if.patch;
+{ stdenv, fetchgit, python, perl, autoconf, automake, libtool, intltool, flex }:
 
-  gettextPatch = ./recode-3.6-gettextfix.diff;
+stdenv.mkDerivation rec {
+  name = "recode-3.7-pff85fdbd";
 
-  debianPatch = fetchurl {
-    url = "http://ftp.de.debian.org/debian/pool/main/r/recode/recode_3.6-15.diff.gz";
-    sha256 = "114qxm29wk95w5760bswgd46d5p00g5kbfai5wchjvcbi722p5qf";
+  src = fetchgit {
+    url = https://github.com/pinard/Recode.git;
+    rev = "2fd8385658e5a08700e3b916053f6680ff85fdbd";
+    sha256 = "1xhlfmqld6af16l444jli9crj9brym2jihg1n6lkxh2gar68f5l7";
   };
-in
-stdenv.mkDerivation {
-  name = "recode-3.6";
 
-  src = fetchurl {
-    url = "ftp://ftp.halifax.rwth-aachen.de/gnu/recode/recode-3.6.tar.gz";
-    sha256 = "1krgjqfhsxcls4qvxhagc45sm1sd0w69jm81nwm0bip5z3rs9rp3";
-  };
+  buildInputs = [ python perl autoconf automake libtool intltool flex ];
 
-  buildInputs = [ autoconf automake libtool gettext perl ];
+  preConfigure = ''
+    # fix build with new automake, https://bugs.gentoo.org/show_bug.cgi?id=419455
+    #rm acinclude.m4
+    substituteInPlace Makefile.am --replace "ACLOCAL = ./aclocal.sh @ACLOCAL@" ""
+    sed -i '/^AM_C_PROTOTYPES/d' configure.ac
+    substituteInPlace src/Makefile.am --replace "ansi2knr" ""
 
-  patchPhase = ''
-    patch -Np1 -i ${asIfPatch}
-    patch -Np1 -i ${gettextPatch}
-    gunzip <${debianPatch} | patch -Np1 -i -
-    sed -i '1i#include <stdlib.h>' src/argmatch.c
-    rm -f acinclude.m4
     autoreconf -fi
-    libtoolize
   '';
 
-  configureFlags = "--without-included-gettext";
+  #doCheck = true; # doesn't work yet
 
-  doCheck = true;
+  preCheck = ''
+    checkFlagsArray=(CPPFLAGS="-I../lib" LDFLAGS="-L../src/.libs -Wl,-rpath=../src/.libs")
+  '';
 
   meta = {
     homepage = "http://www.gnu.org/software/recode/";
     description = "Converts files between various character sets and usages";
-
-    license = "GPLv2+";
-
     platforms = stdenv.lib.platforms.unix;
-    maintainers = [];
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/tools/text/recode/recode-3.6-as-if.patch b/pkgs/tools/text/recode/recode-3.6-as-if.patch
deleted file mode 100644
index c7bcc27c875..00000000000
--- a/pkgs/tools/text/recode/recode-3.6-as-if.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-http://bugs.gentoo.org/283029
-
---- a/m4/flex.m4
-+++ b/m4/flex.m4
-@@ -8,11 +8,11 @@ dnl ad_AC_PROG_FLEX
- dnl Look for flex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
- AC_DEFUN(ad_AC_PROG_FLEX,
- [AC_CHECK_PROGS(LEX, flex, missing)
--if test "$LEX" = missing; then
-+AS_IF([test "$LEX" = missing], [dnl
-   LEX="\$(top_srcdir)/$ac_aux_dir/missing flex"
-   LEX_OUTPUT_ROOT=lex.yy
-   AC_SUBST(LEX_OUTPUT_ROOT)dnl
--else
-+], [:
-   AC_PROG_LEX
-   AC_DECL_YYTEXT
--fi])
-+])])
diff --git a/pkgs/tools/text/recode/recode-3.6-gettextfix.diff b/pkgs/tools/text/recode/recode-3.6-gettextfix.diff
deleted file mode 100644
index 3b7eb8ba20e..00000000000
--- a/pkgs/tools/text/recode/recode-3.6-gettextfix.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-http://bugs.gentoo.org/239372
-
-patch by Dmitry Karasik
-
---- recode-3.6/m4/gettext.m4
-+++ recode-3.6/m4/gettext.m4
-@@ -109,12 +109,12 @@
-     else
-       ac_items="$LINGUAS"
-       for ac_item in $ac_items; do
--	case "$ALL_LINGUAS" in
--	  *$ac_item*)
-+        for supported_item in $ALL_LINGUAS; do
-+          if test "$ac_item" = "$supported_item"; then
- 	    ac_print="$ac_print $ac_item"
- 	    MOFILES="$MOFILES $ac_item.mo"
--	    ;;
--	esac
-+          fi
-+        done
-       done
-     fi
-     AC_SUBST(MOFILES)
diff --git a/pkgs/tools/text/sgml/openjade/default.nix b/pkgs/tools/text/sgml/openjade/default.nix
index 77532fd216c..fc7ee9f6f06 100644
--- a/pkgs/tools/text/sgml/openjade/default.nix
+++ b/pkgs/tools/text/sgml/openjade/default.nix
@@ -1,22 +1,19 @@
-{stdenv, fetchurl, opensp, perl}:
+{ stdenv, fetchurl, opensp, perl }:
 
-stdenv.mkDerivation {
-  # OpenJade-1.3.2 requires gcc 3.3 to build.  
-  # The next release is likely to be compatible with newer gccs.
-  # If so the overrideGCC in top-level/all-packages should be removed.
-  name = "OpenJade-1.3.2";
+stdenv.mkDerivation rec {
+  name = "openjade-1.3.2";
 
   src = fetchurl {
-    url = "mirror://sourceforge/openjade/openjade-1.3.2.tar.gz";
+    url = "mirror://sourceforge/openjade/${name}.tar.gz";
     sha256 = "1l92sfvx1f0wmkbvzv1385y1gb3hh010xksi1iyviyclrjb7jb8x";
   };
 
-  buildInputs = [opensp perl];
+  buildInputs = [ opensp perl ];
 
   configureFlags = [
     "--enable-spincludedir=${opensp}/include/OpenSP"
     "--enable-splibdir=${opensp}/lib"
-  ]; 
+  ];
 
   meta = {
     description = "An implementation of DSSSL, an ISO standard for formatting SGML (and XML) documents";
diff --git a/pkgs/tools/text/sgml/opensp/compat.nix b/pkgs/tools/text/sgml/opensp/compat.nix
index 8e521da2084..3e9d9152d36 100644
--- a/pkgs/tools/text/sgml/opensp/compat.nix
+++ b/pkgs/tools/text/sgml/opensp/compat.nix
@@ -3,13 +3,17 @@
 stdenv.mkDerivation {
   name = "sp-compat-${builtins.substring 7 100 opensp.name}";
 
-  buildCommand = ''
+  phases = [ "fixupPhase" "installPhase" ];
+
+  installPhase = ''
     mkdir -pv $out/bin
     for i in ${opensp}/bin/o*; do
       ln -sv $i $out/bin/''${i#${opensp}/bin/o}
     done
     '';
 
+  setupHook = opensp.setupHook;
+
   meta.description =
     "Compatibility wrapper for old programs looking for original sp programs";
 }
diff --git a/pkgs/tools/text/sgml/opensp/default.nix b/pkgs/tools/text/sgml/opensp/default.nix
index 76efbd0b1af..e30567000dd 100644
--- a/pkgs/tools/text/sgml/opensp/default.nix
+++ b/pkgs/tools/text/sgml/opensp/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation {
       docsrc/*.xml
   '';
 
+  setupHook = ./setup-hook.sh;
+
   buildInputs = [ xmlto docbook_xml_dtd_412 libxslt docbook_xsl ];
 
   meta = {
diff --git a/pkgs/tools/text/sgml/opensp/setup-hook.sh b/pkgs/tools/text/sgml/opensp/setup-hook.sh
new file mode 100644
index 00000000000..2c9142da101
--- /dev/null
+++ b/pkgs/tools/text/sgml/opensp/setup-hook.sh
@@ -0,0 +1,22 @@
+addSGMLCatalogs () {
+      if test -d $1/sgml/dtd; then
+          for i in $(find $1/sgml/dtd -name docbook.cat); do
+              export SGML_CATALOG_FILES="${SGML_CATALOG_FILES:+:}$i"
+          done
+      fi
+}
+
+if test -z "$sgmlHookDone"; then
+    sgmlHookDone=1
+
+    # Set http_proxy and ftp_proxy to a invalid host to prevent
+    # xmllint and xsltproc from trying to download DTDs from the
+    # network even when --nonet is not given.  That would be impure.
+    # (Note that .invalid is a reserved domain guaranteed not to
+    # work.)
+    export http_proxy=http://nodtd.invalid/
+    export ftp_proxy=http://nodtd.invalid/
+
+    export SGML_CATALOG_FILES
+    envHooks=(${envHooks[@]} addSGMLCatalogs)
+fi
diff --git a/pkgs/tools/text/wdiff/default.nix b/pkgs/tools/text/wdiff/default.nix
index 0d0576ee4a7..b64d05e19e1 100644
--- a/pkgs/tools/text/wdiff/default.nix
+++ b/pkgs/tools/text/wdiff/default.nix
@@ -1,14 +1,11 @@
 { stdenv, fetchurl, which, screen }:
 
-let
-  name = "wdiff-1.1.0";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "wdiff-1.1.2";
 
   src = fetchurl {
     url = "mirror://gnu/wdiff/${name}.tar.gz";
-    sha256 = "1lg5lz78xij4jjifv8fj68ixr9mha1c5vp8xzyg6rdx6ynkvnm5i";
+    sha256 = "0q78y5awvjjmsvizqilbpwany62shlmlq2ayxkjbygmdafpk1k8j";
   };
 
   # Required for the compile-time for the test suite.
diff --git a/pkgs/tools/text/wgetpaste/default.nix b/pkgs/tools/text/wgetpaste/default.nix
index 63313872ede..04102093aae 100644
--- a/pkgs/tools/text/wgetpaste/default.nix
+++ b/pkgs/tools/text/wgetpaste/default.nix
@@ -23,5 +23,6 @@
       homepage = http://wgetpaste.zlin.dk/;
       license = "publicDomain";
       maintainers = with stdenv.lib.maintainers; [qknight];
+      platforms = stdenv.lib.platforms.all;
     };
   }
diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix
index a4b9d375bce..f392ad065cc 100644
--- a/pkgs/tools/typesetting/asciidoc/default.nix
+++ b/pkgs/tools/typesetting/asciidoc/default.nix
@@ -1,10 +1,10 @@
 { fetchurl, stdenv, python }:
 
 stdenv.mkDerivation rec {
-  name = "asciidoc-8.6.6";
+  name = "asciidoc-8.6.8";
   src = fetchurl {
     url = "mirror://sourceforge/asciidoc/${name}.tar.gz";
-    sha256 = "9d54c11716e4309ff4d942cf6a6d9745d6a28754ff1de01efed0dc659457ac71";
+    sha256 = "ffb67f59dccaf6f15db72fcd04fdf21a2f9b703d31f94fcd0c49a424a9fcfbc4";
   };
 
   patchPhase = ''
@@ -20,11 +20,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ python ];
 
   meta = {
+    homepage = "http://www.methods.co.nz/asciidoc/";
+    description = "ASCII text-based document generation system";
+    license = "GPLv2+";
+
     longDescription = ''
       AsciiDoc is a text-based document generation system.  AsciiDoc
       input files can be translated to HTML and DocBook markups.
     '';
-    homepage = http://www.methods.co.nz/asciidoc/;
-    license = "GPLv2+";
   };
 }
diff --git a/pkgs/tools/typesetting/docbook2x/default.nix b/pkgs/tools/typesetting/docbook2x/default.nix
index 00dbe22aed3..d7d3f6f92a2 100644
--- a/pkgs/tools/typesetting/docbook2x/default.nix
+++ b/pkgs/tools/typesetting/docbook2x/default.nix
@@ -1,6 +1,6 @@
 { fetchurl, stdenv, texinfo, perl
 , XMLSAX, XMLParser, XMLNamespaceSupport
-, groff, libxml2, libxslt, gnused, libiconv, opensp
+, groff, libxml2, libxslt, gnused, libiconvOrEmpty, opensp
 , docbook_xml_dtd_43
 , makeWrapper }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ perl texinfo groff libxml2 libxslt makeWrapper
                   XMLSAX XMLParser XMLNamespaceSupport opensp
-  	        ] ++ (if libiconv != null then [libiconv] else []);
+                ] ++ libiconvOrEmpty;
 
   postConfigure = ''
     # Broken substitution is used for `perl/config.pl', which leaves literal
diff --git a/pkgs/tools/typesetting/hevea/builder.sh b/pkgs/tools/typesetting/hevea/builder.sh
index 7598da5d0a5..05c93fe7da7 100644
--- a/pkgs/tools/typesetting/hevea/builder.sh
+++ b/pkgs/tools/typesetting/hevea/builder.sh
@@ -10,10 +10,5 @@ cd hevea-*
 sed s+/usr/local+$out+ Makefile > Makefile.new
 mv Makefile.new Makefile
 
-if test "x$system" = "xpowerpc-darwin"; then
-  sed s/CPP=cpp\ -E\ -P/CPP=m4\ -E\ -E\ -P/ Makefile > Makefile.new
-  mv Makefile.new Makefile
-fi
-
 make
 make install
diff --git a/pkgs/tools/typesetting/lhs2tex/default.nix b/pkgs/tools/typesetting/lhs2tex/default.nix
index 5ac339e92ec..2b96ae526c4 100644
--- a/pkgs/tools/typesetting/lhs2tex/default.nix
+++ b/pkgs/tools/typesetting/lhs2tex/default.nix
@@ -2,9 +2,9 @@
 
 cabal.mkDerivation (self: {
   pname = "lhs2tex";
-  version = "1.17";
+  version = "1.18.1";
   name = self.fname;
-  sha256 = "1x49316m5xm4f6hw5q7kia9rpfpygxhk5gnifd54ai0zjmdlkxrc";
+  sha256 = "0j4n7vkabsggn94gbwixy1vmckdck2nggdiqvk6n9nx164if5jnw";
   extraBuildInputs = [regexCompat texLive];
 
   postInstall = ''
diff --git a/pkgs/tools/typesetting/tex/dblatex/default.nix b/pkgs/tools/typesetting/tex/dblatex/default.nix
index 05f4bd7a9fa..fa4746a562e 100644
--- a/pkgs/tools/typesetting/tex/dblatex/default.nix
+++ b/pkgs/tools/typesetting/tex/dblatex/default.nix
@@ -1,16 +1,19 @@
 { stdenv, fetchurl, python, libxslt, tetex }:
 
 stdenv.mkDerivation rec {
-  name = "dblatex-0.3.2";
+  name = "dblatex-0.3.4";
 
   src = fetchurl {
     url = "mirror://sourceforge/dblatex/${name}.tar.bz2";
-    sha256 = "0jg2acv2lyrbw06l8rr0id75lj1pws7xbsmryq58r3n13xzb1p7b";
+    sha256 = "120w3wm07qx0k1grgdhjwm2vpwil71icshjvqznskp1f6ggch290";
   };
 
   buildPhase = "true";
   
-  installPhase = "python ./setup.py install --prefix=$out";
+  installPhase = ''
+    sed -i 's|self.install_layout == "deb"|False|' setup.py
+    python ./setup.py install --prefix=$out
+  '';
 
   buildInputs = [ python libxslt tetex ];
 
diff --git a/pkgs/tools/typesetting/tex/latex2html/default.nix b/pkgs/tools/typesetting/tex/latex2html/default.nix
index 354cb6d22b0..1d1746e9a4b 100644
--- a/pkgs/tools/typesetting/tex/latex2html/default.nix
+++ b/pkgs/tools/typesetting/tex/latex2html/default.nix
@@ -1,23 +1,25 @@
-{stdenv, fetchurl, tex, perl, netpbm, ghostscript}:
+{ stdenv, fetchurl, tex, perl, netpbm, ghostscript }:
+
+stdenv.mkDerivation rec {
+  name = "latex2html-2008";
+
+  src = fetchurl {
+    url = "http://www.latex2html.org/~latex2ht/current/${name}.tar.gz";
+    sha256 = "1b9pld6wz01p1pf5qwxjipdkhq34hmmw9mfkjp150hlqlcanhiar";
+  };
 
-stdenv.mkDerivation {
-  name = "latex2html-2002-1";
-  
   buildInputs = [ tex perl ghostscript netpbm ];
 
   preConfigure = ''
-      configureFlags="--with-texpath=$out/share/texmf-nix";
+    patchShebangs .
+    sed -i -e "s|#! /bin/cat|#! $(type -p cat)|" configure
+    configureFlags="--with-texpath=$out/share/texmf-nix";
   '';
 
-  src = fetchurl {
-    url = mirror://ubuntu/pool/multiverse/l/latex2html/latex2html_2002-2-1-20050114.orig.tar.gz;
-    sha256 = "22049a77cf88a647776e61e06800ace4f9a06afc6ffe2590574487f023d0881f";
-  };
-
   meta = {
-    homepage = http://www.latex2html.org/;
-    license = "unfree-redistributable";
+    homepage = "http://www.latex2html.org/";
     description = "Convertor written in Perl that converts LaTeX documents to HTML";
+    license = stdenv.lib.licenses.gpl2Plus;
   };
 
 }
diff --git a/pkgs/tools/typesetting/tex/nix/default.nix b/pkgs/tools/typesetting/tex/nix/default.nix
index 9ae567e635b..223f72c6785 100644
--- a/pkgs/tools/typesetting/tex/nix/default.nix
+++ b/pkgs/tools/typesetting/tex/nix/default.nix
@@ -66,7 +66,7 @@ rec {
                 else if dep.type == "tex" then [".tex" ""]
                 else [""];
               fn = pkgs.lib.findFirst (fn: builtins.pathExists fn) null
-                (map (ext: "${dirOf key}/${dep.name}${ext}") exts);
+                (map (ext: dirOf key + ("/" + dep.name + ext)) exts);
             in if fn != null then [{key = fn;}] ++ xs
                else xs;
 
@@ -90,8 +90,8 @@ rec {
             { src = key; }
             "${pkgs.stdenv.bash}/bin/bash ${./find-lhs2tex-includes.sh}");
 
-        in pkgs.lib.concatMap (x : if builtins.pathExists x then [{key = x;}] else [])
-                              (map (x : "${dirOf key}/${x}") deps);
+        in pkgs.lib.concatMap (x: if builtins.pathExists x then [{key = x;}] else [])
+                              (map (x: dirOf key + ("/" + x)) deps);
     };
 
   dot2pdf =
diff --git a/pkgs/tools/typesetting/tex/tex4ht/default.nix b/pkgs/tools/typesetting/tex/tex4ht/default.nix
index 5d5d85d3c1d..24612de549e 100644
--- a/pkgs/tools/typesetting/tex/tex4ht/default.nix
+++ b/pkgs/tools/typesetting/tex/tex4ht/default.nix
@@ -4,9 +4,8 @@ stdenv.mkDerivation rec {
   name = "tex4ht-1.0.2009_06_11_1038";
 
   src = fetchurl {
-    url = "http://www.tug.org/applications/tex4ht/tex4ht.zip";
-    # http://www.cse.ohio-state.edu/~gurari/TeX4ht/fix/${name}.tar.gz";
-    sha1 = "2970cec5f4afc9039b82d6a4210f21d70ded2f5a";
+    url = "http://tug.org/applications/tex4ht/tex4ht.zip";
+    sha256 = "15gj18ihds6530af42clpa4zskak5kah9wzs2hd19a9ymwjsccd6";
   };
 
   buildInputs = [ tetex unzip ];
@@ -22,17 +21,15 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     mkdir -p $out/bin
-    for f in src/tex4ht src/t4ht src/htcmd bin/unix/*; do # */
-      mv $f $out/bin/.
+    for f in src/tex4ht src/t4ht src/htcmd "bin/unix/"*; do
+      mv $f $out/bin/
     done
-
-    mkdir -p $out/share
-    cp -r texmf $out/share/.
+    mv texmf $out/
   '';
 
   meta = {
-    homepage = http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html;
-    # LaTeX Project Public License
-    license = "LPPL";
+    homepage = "http://tug.org/tex4ht/";
+    description = "a system to convert (La)TeX documents to HTML and various other formats";
+    license = "LPPL";		# LaTeX Project Public License
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/tools/typesetting/tex/texlive/beamer.nix b/pkgs/tools/typesetting/tex/texlive/beamer.nix
index 851ad0707a1..bf9079ab104 100644
--- a/pkgs/tools/typesetting/tex/texlive/beamer.nix
+++ b/pkgs/tools/typesetting/tex/texlive/beamer.nix
@@ -1,9 +1,9 @@
 args: with args;
 rec {
-  name = "texlive-beamer-2007";
+  name = "texlive-beamer-2012";
   src = fetchurl {
-    url = mirror://debian/pool/main/l/latex-beamer/latex-beamer_3.07.orig.tar.gz;
-    sha256 = "07ldhg5f0hcnhjgzg5g8ailqacn8zhqc8nl2jkxc43c2qxbvswbv";
+    url = mirror://debian/pool/main/l/latex-beamer/latex-beamer_3.10.orig.tar.gz;
+    sha256 = "1vk7nr1lxinyj941nz5xzcpzircd60s8sgmq7jd2gqmf5ynd27nx";
   };
 
   buildInputs = [texLive];
diff --git a/pkgs/tools/typesetting/tex/texlive/moderncv.nix b/pkgs/tools/typesetting/tex/texlive/moderncv.nix
index 2d422385bd5..e490d55bc5f 100644
--- a/pkgs/tools/typesetting/tex/texlive/moderncv.nix
+++ b/pkgs/tools/typesetting/tex/texlive/moderncv.nix
@@ -1,10 +1,10 @@
 args: with args;
 rec {
-  version = "1.1.1";
+  version = "1.3.0";
   name = "moderncv-${version}";
   src = fetchurl {
     url = "https://launchpad.net/moderncv/trunk/${version}/+download/moderncv-${version}.zip";
-    sha256 = "929c118eff339a5c59ed58cc961ddee787e9a5933d12ec8801613fd2e2500e9f";
+    sha256 = "0wdj90shi04v97b2d6chhvm9qrp0bcvsm46441730ils1y74wisq";
   };
 
   buildInputs = [texLive unzip];
diff --git a/pkgs/tools/video/swfmill/default.nix b/pkgs/tools/video/swfmill/default.nix
new file mode 100644
index 00000000000..b48cc7cddcc
--- /dev/null
+++ b/pkgs/tools/video/swfmill/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl
+, pkgconfig, libxslt, freetype, libpng, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  name = "swfmill-0.3.2";
+
+  src = fetchurl {
+    url = "http://swfmill.org/releases/${name}.tar.gz";
+    sha256 = "077agf62q0xz95dxj4cq9avcqwin94vldrpb80iqwjskvkwpz9gy";
+  };
+
+  buildInputs = [ pkgconfig libxslt freetype libpng libxml2 ];
+
+  meta = {
+    description = "An xml2swf and swf2xml processor with import functionalities";
+    homepage = "http://swfmill.org";
+    license = "GPLv2";
+  };
+}
+
diff --git a/pkgs/tools/video/vncrec/default.nix b/pkgs/tools/video/vncrec/default.nix
index 29227318ae0..5732d4c9baf 100644
--- a/pkgs/tools/video/vncrec/default.nix
+++ b/pkgs/tools/video/vncrec/default.nix
@@ -30,9 +30,10 @@ rec {
     xmkmf
   '') ["doUnpack" "minInit" "addInputs"];
       
-  name = "vncrec";
+  name = "vncrec-0.2"; # version taken from Arch AUR
   meta = {
     description = "VNC recorder";
+    homepage = http://ronja.twibright.com/utils/vncrec/;
     maintainers = [
     ];
   };
diff --git a/pkgs/tools/virtualization/ec2-ami-tools/default.nix b/pkgs/tools/virtualization/ec2-ami-tools/default.nix
index 1420ab5eeeb..1905166c38e 100644
--- a/pkgs/tools/virtualization/ec2-ami-tools/default.nix
+++ b/pkgs/tools/virtualization/ec2-ami-tools/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, unzip, ruby, openssl, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "ec2-ami-tools-1.4.0.7";
-  
+  name = "ec2-ami-tools-1.4.0.9";
+
   buildInputs = [ unzip makeWrapper ];
-  
+
   src = fetchurl {
     url = "http://nixos.org/tarballs/${name}.zip";
-    sha256 = "0l8c623i1w30bh9k622cdjj5f57rlfc1zs0i01ya016ijyr08qip";
+    sha256 = "0icpjr2ipch3f6cf4rg9x5z2y9k6a4rd85npsmw3a1ambs3dwxlq";
   };
 
   # Amazon EC2 requires that disk images are writable.  If they're
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
             --set EC2_HOME $out \
             --prefix PATH : ${ruby}/bin:${openssl}/bin
       done
-      
+
       sed -i 's|/bin/bash|${stdenv.shell}|' $out/lib/ec2/platform/base/pipeline.rb
     '';  # */
 
diff --git a/pkgs/tools/virtualization/ec2-api-tools/default.nix b/pkgs/tools/virtualization/ec2-api-tools/default.nix
index 22669c67b12..ac2902aab94 100644
--- a/pkgs/tools/virtualization/ec2-api-tools/default.nix
+++ b/pkgs/tools/virtualization/ec2-api-tools/default.nix
@@ -1,28 +1,31 @@
 { stdenv, fetchurl, unzip, makeWrapper, jre }:
 
 stdenv.mkDerivation rec {
-  name = "ec2-api-tools-1.6.0.0";
-  
+  name = "ec2-api-tools-1.6.5.1";
+
   src = fetchurl {
     url = "http://nixos.org/tarballs/${name}.zip";
-    sha256 = "1j9isvi6g68zhk7zxs29yad2d0rpnbqx8fz25yn5paqx9c8pzqcl";
+    sha256 = "1j2pc20vggi4hv950999mhh7dl6475yma76nyj6k0hzkd1lf5hda";
   };
 
   buildInputs = [ unzip makeWrapper ];
 
   installPhase =
     ''
-      mkdir -p $out
-      mv * $out
-      rm $out/bin/*.cmd # Windows stuff
+      d=$out/libexec/ec2-api-tools
+      mkdir -p $d
+      mv * $d
+      rm $d/bin/*.cmd # Windows stuff
 
-      for i in $out/bin/*; do
-          wrapProgram $i \
-            --set EC2_HOME $out \
+      for i in $d/bin/*; do
+          b=$(basename $i)
+          if [ $b = "ec2-cmd" ]; then continue; fi
+          makeWrapper $i $out/bin/$(basename $i) \
+            --set EC2_HOME $d \
             --set JAVA_HOME ${jre}
       done
     ''; # */
-  
+
   meta = {
     homepage = http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351;
     description = "Command-line tools to create and manage Amazon EC2 virtual machines";
diff --git a/pkgs/tools/virtualization/euca2ools/default.nix b/pkgs/tools/virtualization/euca2ools/default.nix
index ce84706c356..ae488b0f359 100644
--- a/pkgs/tools/virtualization/euca2ools/default.nix
+++ b/pkgs/tools/virtualization/euca2ools/default.nix
@@ -1,17 +1,19 @@
 { stdenv, fetchgit, which, pythonPackages }:
 
 pythonPackages.buildPythonPackage rec {
-  name = "euca2ools-2.0.0-pre-20111230";
+  name = "euca2ools-2.1.3";
   namePrefix = "";
 
   src = fetchgit {
     url = https://github.com/eucalyptus/euca2ools.git;
-    rev = "0032f7c85603f34b728a6f8bc6f25d7e4892432e";
-    sha256 = "ae3c3918d60411ebf15faefb6dc94e3a98ab73cf751d8180c52f51b19ed64c09";
+    rev = "8ae2ecc";
+    sha256 = "caef5a3e2c9b515fd815034b5b7304acc878a0b9777ae4208dc033b0bf39da2b";
   };
 
   pythonPath = [ pythonPackages.boto pythonPackages.m2crypto pythonPackages.ssl ];
 
+  doCheck = false;
+
   meta = {
     homepage = http://open.eucalyptus.com/downloads;
     description = "Tools for interacting with Amazon EC2/S3-compatible cloud computing services";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 34bdb2ba542..85a95e3ba88 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -21,10 +21,12 @@
   # null, the default standard environment is used.
   bootStdenv ? null
 
-, # Darwin is an "impure" platform, with its libc outside of the store.
-  # Thus, GCC, GFortran, & co. must always look for files in standard system
-  # directories (/usr/include, etc.)
-  noSysDirs ? (system != "x86_64-darwin" && system != "i686-darwin")
+, # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
+  # outside of the store.  Thus, GCC, GFortran, & co. must always look for
+  # files in standard system directories (/usr/include, etc.)
+  noSysDirs ? (system != "x86_64-darwin"
+               && system != "x86_64-freebsd" && system != "i686-freebsd"
+               && system != "x86_64-kfreebsd-gnu")
 
   # More flags for the bootstrapping of stdenv.
 , gccWithCC ? true
@@ -75,13 +77,17 @@ let
         else configExpr;
 
   # Allow setting the platform in the config file. Otherwise, let's use a reasonable default (pc)
-  platform = if platform_ != null then platform_
-    else getConfig [ "platform" ] (import ./platforms.nix).pc;
 
-  # Return an attribute from the Nixpkgs configuration file, or
-  # a default value if the attribute doesn't exist.
-  getConfig = attrPath: default: lib.attrByPath attrPath default config;
+  platformAuto = let
+      platforms = (import ./platforms.nix);
+    in
+      if system == "armv6l-linux" then platforms.raspberrypi
+      else if system == "armv5tel-linux" then platforms.sheevaplug
+      else if system == "mips64el-linux" then platforms.fuloong2f_n32
+      else platforms.pc;
 
+  platform = if platform_ != null then platform_
+    else config.platform or platformAuto;
 
   # Helper functions that are exported through `pkgs'.
   helperFunctions =
@@ -99,7 +105,7 @@ let
   # (un-overriden) set of packages, allowing packageOverrides
   # attributes to refer to the original attributes (e.g. "foo =
   # ... pkgs.foo ...").
-  pkgs = applyGlobalOverrides (getConfig ["packageOverrides"] (pkgs: {}));
+  pkgs = applyGlobalOverrides (config.packageOverrides or (pkgs: {}));
 
 
   # Return the complete set of packages, after applying the overrides
@@ -133,6 +139,9 @@ let
   # eventually.
   inherit __overrides pkgs;
 
+  # Make some arguments passed to all-packages.nix available
+  inherit system stdenvType platform;
+
 
   # We use `callPackage' to be able to omit function arguments that
   # can be obtained from `pkgs' or `pkgs.xorg' (i.e. `defaultScope').
@@ -163,11 +172,10 @@ let
 
   ### Symbolic names.
 
-
-  x11 = xlibsWrapper;
+  x11 = if stdenv.isDarwin then darwinX11AndOpenGL else xlibsWrapper;
 
   # `xlibs' is the set of X library components.  This used to be the
-  # old modular X libraries project (called `xlibs') but now it's just
+  # old modular X llibraries project (called `xlibs') but now it's just
   # the set of packages in the modular X.org tree (which also includes
   # non-library components like the server, drivers, fonts, etc.).
   xlibs = xorg // {xlibs = xlibsWrapper;};
@@ -176,9 +184,10 @@ let
   ### Helper functions.
 
 
-  inherit lib config getConfig stdenvAdapters;
+  inherit lib config stdenvAdapters;
 
   inherit (lib) lowPrio hiPrio appendToName makeOverridable;
+  inherit (misc) versionedDerivation;
 
   # Applying this to an attribute set will cause nix-env to look
   # inside the set for derivations.
@@ -198,14 +207,13 @@ let
 
 
   allStdenvs = import ../stdenv {
-    inherit system stdenvType platform;
+    inherit system stdenvType platform config;
     allPackages = args: import ./all-packages.nix ({ inherit config system; } // args);
   };
 
   defaultStdenv = allStdenvs.stdenv // { inherit platform; };
 
-  stdenvCross = makeStdenvCross defaultStdenv crossSystem binutilsCross
-    gccCrossStageFinal;
+  stdenvCross = lowPrio (makeStdenvCross defaultStdenv crossSystem binutilsCross gccCrossStageFinal);
 
   stdenv =
     if bootStdenv != null then (bootStdenv // {inherit platform;}) else
@@ -213,7 +221,7 @@ let
         stdenvCross
       else
         let
-            changer = getConfig ["replaceStdenv"] null;
+            changer = config.replaceStdenv or null;
         in if changer != null then
           changer {
             # We import again all-packages to avoid recursivities.
@@ -225,26 +233,30 @@ let
       else
         defaultStdenv;
 
-  forceBuildDrv = drv : if (crossSystem == null) then drv else
-    (drv // { hostDrv = drv.buildDrv; });
+  forceNativeDrv = drv : if crossSystem == null then drv else
+    (drv // { crossDrv = drv.nativeDrv; });
 
   # A stdenv capable of building 32-bit binaries.  On x86_64-linux,
   # it uses GCC compiled with multilib support; on i686-linux, it's
   # just the plain stdenv.
-  stdenv_32bit =
+  stdenv_32bit = lowPrio (
     if system == "x86_64-linux" then
-      overrideGCC stdenv gcc43_multi
+      overrideGCC stdenv gcc46_multi
     else
-      stdenv;
+      stdenv);
 
 
   ### BUILD SUPPORT
 
-  attrSetToDir = arg : import ../build-support/upstream-updater/attrset-to-dir.nix {
+  attrSetToDir = arg: import ../build-support/upstream-updater/attrset-to-dir.nix {
     inherit writeTextFile stdenv lib;
     theAttrSet = arg;
   };
 
+  autoreconfHook = makeSetupHook
+    { substitutions = { inherit autoconf automake libtool; }; }
+    ../build-support/setup-hooks/autoreconf.sh;
+
   buildEnv = import ../build-support/buildenv {
     inherit (pkgs) runCommand perl;
   };
@@ -276,7 +288,7 @@ let
 
   fetchgitrevision = import ../build-support/fetchgitrevision runCommand git;
 
-  fetchmtn = callPackage ../build-support/fetchmtn (getConfig ["fetchmtn"] {});
+  fetchmtn = callPackage ../build-support/fetchmtn (config.fetchmtn or {});
 
   fetchsvn = import ../build-support/fetchsvn {
     inherit stdenv subversion openssh;
@@ -323,15 +335,16 @@ let
     inherit lib;
   };
 
-  makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix {
-    inherit stdenv perl cpio contents ubootChooser;
-  };
+  makeInitrd = {contents, compressor ? "gzip -9"}:
+    import ../build-support/kernel/make-initrd.nix {
+      inherit stdenv perl cpio contents ubootChooser compressor;
+    };
 
   stdenvMulti = stdenv // {
     mkDerivation = import ../build-support/multiple-outputs.nix { inherit (pkgs) stdenv; };
   };
 
-  makeWrapper = makeSetupHook {} ../build-support/make-wrapper/make-wrapper.sh;
+  makeWrapper = makeSetupHook { } ../build-support/setup-hooks/make-wrapper.sh;
 
   makeModulesClosure = {kernel, rootModules, allowMissing ? false}:
     import ../build-support/kernel/modules-closure.nix {
@@ -347,6 +360,10 @@ let
     inherit stdenv;
   };
 
+  replaceDependency = import ../build-support/replace-dependency.nix {
+    inherit runCommand nix lib;
+  };
+
   nukeReferences = callPackage ../build-support/nuke-references/default.nix { };
 
   vmTools = import ../build-support/vm/default.nix {
@@ -370,12 +387,25 @@ let
 
   aefs = callPackage ../tools/filesystems/aefs { };
 
+  aespipe = callPackage ../tools/security/aespipe { };
+
+  ahcpd = callPackage ../tools/networking/ahcpd { };
+
   aircrackng = callPackage ../tools/networking/aircrack-ng { };
 
   analog = callPackage ../tools/admin/analog {};
 
   archivemount = callPackage ../tools/filesystems/archivemount { };
 
+  arduino_core = callPackage ../development/arduino/arduino-core {
+    jdk = jdk;
+    jre = jdk;
+  };
+
+  argyllcms = callPackage ../tools/graphics/argyllcms {};
+
+  ascii = callPackage ../tools/text/ascii { };
+
   asymptote = builderDefsPackage ../tools/graphics/asymptote {
     inherit freeglut ghostscriptX imagemagick fftw boehmgc
       mesa ncurses readline gsl libsigsegv python zlib perl
@@ -405,6 +435,30 @@ let
     client = true;
   });
 
+  androidenv = import ../development/mobile/androidenv {
+    inherit pkgs;
+    pkgs_i686 = pkgsi686Linux;
+  };
+
+  apg = callPackage ../tools/security/apg { };
+
+  xcodeenv = callPackage ../development/mobile/xcodeenv { };
+
+  titaniumenv_2_1 = import ../development/mobile/titaniumenv {
+    inherit pkgs;
+    pkgs_i686 = pkgsi686Linux;
+    version = "2.1";
+  };
+
+  titaniumenv_3_1 = import ../development/mobile/titaniumenv {
+    inherit pkgs;
+    pkgs_i686 = pkgsi686Linux;
+  };
+
+  titaniumenv = titaniumenv_3_1;
+
+  inherit (androidenv) androidsdk_4_1;
+
   aria = builderDefsPackage (import ../tools/networking/aria) { };
 
   aria2 = callPackage ../tools/networking/aria2 { };
@@ -413,14 +467,12 @@ let
 
   atftp = callPackage ../tools/networking/atftp {};
 
-  autogen = callPackage ../development/tools/misc/autogen {
-    guile = guile_1_8;
-  };
+  autogen = callPackage ../development/tools/misc/autogen { };
 
   autojump = callPackage ../tools/misc/autojump { };
 
   avahi = callPackage ../development/libraries/avahi {
-    qt4Support = getConfig [ "avahi" "qt4Support" ] false;
+    qt4Support = config.avahi.qt4Support or false;
   };
 
   aws = callPackage ../tools/virtualization/aws { };
@@ -431,6 +483,8 @@ let
 
   azureus = callPackage ../tools/networking/p2p/azureus { };
 
+  babeld = callPackage ../tools/networking/babeld { };
+
   banner = callPackage ../games/banner {};
 
   barcode = callPackage ../tools/graphics/barcode {};
@@ -445,19 +499,28 @@ let
 
   bootchart = callPackage ../tools/system/bootchart { };
 
+  bro = callPackage ../applications/networking/ids/bro { };
+
   bsod = callPackage ../misc/emulators/bsod { };
 
   btrfsProgs = callPackage ../tools/filesystems/btrfsprogs { };
 
+  byobu = callPackage ../tools/misc/byobu { };
+
   catdoc = callPackage ../tools/text/catdoc { };
 
+  dlx = callPackage ../misc/emulators/dlx { };
+
   eggdrop = callPackage ../tools/networking/eggdrop { };
 
+  enca = callPackage ../tools/text/enca { };
+
   mcrl = callPackage ../tools/misc/mcrl { };
 
   mcrl2 = callPackage ../tools/misc/mcrl2 { };
 
   syslogng = callPackage ../tools/system/syslog-ng { };
+  rsyslog = callPackage ../tools/system/rsyslog { };
 
   mcelog = callPackage ../os-specific/linux/mcelog { };
 
@@ -496,6 +559,7 @@ let
   bup = callPackage ../tools/backup/bup {
     inherit (pythonPackages) pyxattr pylibacl setuptools fuse;
     inherit (haskellPackages) pandoc;
+    par2Support = (config.bup.par2Support or false);
   };
 
   atool = callPackage ../tools/archivers/atool { };
@@ -516,6 +580,7 @@ let
 
   cfdg = builderDefsPackage ../tools/graphics/cfdg {
     inherit libpng bison flex;
+    ffmpeg = ffmpeg_1;
   };
 
   checkinstall = callPackage ../tools/package-management/checkinstall { };
@@ -526,31 +591,45 @@ let
 
   chkrootkit = callPackage ../tools/security/chkrootkit { };
 
+  chrony = callPackage ../tools/networking/chrony { };
+
   cksfv = callPackage ../tools/networking/cksfv { };
 
   ciopfs = callPackage ../tools/filesystems/ciopfs { };
 
   colordiff = callPackage ../tools/text/colordiff { };
 
+  connect = callPackage ../tools/networking/connect { };
+
   convertlit = callPackage ../tools/text/convertlit { };
 
   cowsay = callPackage ../tools/misc/cowsay { };
 
+  cuetools = callPackage ../tools/cd-dvd/cuetools { };
+
   unifdef = callPackage ../development/tools/misc/unifdef { };
 
+  "unionfs-fuse" = callPackage ../tools/filesystems/unionfs-fuse { };
+
   usb_modeswitch = callPackage ../development/tools/misc/usb-modeswitch { };
 
   clamav = callPackage ../tools/security/clamav { };
 
+  cloc = callPackage ../tools/misc/cloc {
+    inherit (perlPackages) perl AlgorithmDiff RegexpCommon;
+  };
+
   cloog = callPackage ../development/libraries/cloog { };
 
   cloogppl = callPackage ../development/libraries/cloog-ppl { };
 
   convmv = callPackage ../tools/misc/convmv { };
 
-  coreutils = callPackage (if stdenv ? isDietLibC
-      then ../tools/misc/coreutils-5
-      else ../tools/misc/coreutils)
+  coreutils = (if stdenv.isDarwin then
+      # 8.20 doesn't build on Darwin
+      callPackage ../tools/misc/coreutils/8.19.nix
+    else
+      callPackage ../tools/misc/coreutils)
     {
       # TODO: Add ACL support for cross-Linux.
       aclSupport = crossSystem == null && stdenv.isLinux;
@@ -560,17 +639,15 @@ let
 
   cromfs = callPackage ../tools/archivers/cromfs { };
 
-  cron = callPackage ../tools/system/cron {  # see also fcron
-  };
+  cron = callPackage ../tools/system/cron { };
 
   cudatoolkit = callPackage ../development/compilers/cudatoolkit {
     python = python26;
   };
 
-  curl = makeOverridable (import ../tools/networking/curl) rec {
+  curl = callPackage ../tools/networking/curl rec {
     fetchurl = fetchurlBoot;
-    inherit stdenv zlib openssl libssh2;
-    zlibSupport = ! ((stdenv ? isDietLibC) || (stdenv ? isStatic));
+    zlibSupport = true;
     sslSupport = zlibSupport;
     scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
   };
@@ -579,19 +656,22 @@ let
 
   curlftpfs = callPackage ../tools/filesystems/curlftpfs { };
 
-  dadadodo = builderDefsPackage (import ../tools/text/dadadodo) {
-  };
+  dadadodo = builderDefsPackage (import ../tools/text/dadadodo) { };
+
+  daq = callPackage ../applications/networking/ids/daq { };
 
   dar = callPackage ../tools/archivers/dar { };
 
-  davfs2 = callPackage ../tools/filesystems/davfs2 {
-    neon = neon029;
-  };
+  davfs2 = callPackage ../tools/filesystems/davfs2 { };
 
   dbench = callPackage ../development/tools/misc/dbench { };
 
   dcraw = callPackage ../tools/graphics/dcraw { };
 
+  debian_devscripts = callPackage ../tools/misc/debian-devscripts {
+    inherit (perlPackages) CryptSSLeay LWP TimeDate DBFile FileDesktopEntry;
+  };
+
   debootstrap = callPackage ../tools/misc/debootstrap { };
 
   detox = callPackage ../tools/misc/detox { };
@@ -602,8 +682,12 @@ let
 
   ddrescue = callPackage ../tools/system/ddrescue { };
 
+  deluge = pythonPackages.deluge;
+
   desktop_file_utils = callPackage ../tools/misc/desktop-file-utils { };
 
+  despotify = callPackage ../development/libraries/despotify { };
+
   dev86 = callPackage ../development/compilers/dev86 {
     /* Using GNU Make 3.82 leads to this:
          make[4]: *** No rule to make target `__ldivmod.o)'
@@ -633,7 +717,6 @@ let
 
   docbook2x = callPackage ../tools/typesetting/docbook2x {
     inherit (perlPackages) XMLSAX XMLParser XMLNamespaceSupport;
-    libiconv = if stdenv.isDarwin then libiconv else null;
   };
 
   dosfstools = callPackage ../tools/filesystems/dosfstools { };
@@ -664,11 +747,12 @@ let
 
   ecryptfs = callPackage ../tools/security/ecryptfs { };
 
-  edk2 = callPackage ../development/compilers/edk2 {
-  };
+  edk2 = callPackage ../development/compilers/edk2 { };
 
   efibootmgr = callPackage ../tools/system/efibootmgr { };
 
+  elasticsearch = callPackage ../servers/search/elasticsearch { };
+
   enblendenfuse = callPackage ../tools/graphics/enblend-enfuse {
     boost = boost149;
   };
@@ -681,6 +765,8 @@ let
 
   euca2ools = callPackage ../tools/virtualization/euca2ools { pythonPackages = python26Packages; };
 
+  evtest = callPackage ../applications/misc/evtest { };
+
   exif = callPackage ../tools/graphics/exif { };
 
   exiftags = callPackage ../tools/graphics/exiftags { };
@@ -691,25 +777,21 @@ let
 
   fakeroot = callPackage ../tools/system/fakeroot { };
 
-  fcron = callPackage ../tools/system/fcron { };
+  fcitx = callPackage ../tools/inputmethods/fcitx { };
 
-  fdisk = callPackage ../tools/system/fdisk { };
+  fcron = callPackage ../tools/system/fcron { };
 
   fdm = callPackage ../tools/networking/fdm {};
 
   figlet = callPackage ../tools/misc/figlet { };
 
   file = callPackage ../tools/misc/file { };
-  file511 = callPackage ../tools/misc/file/511.nix { };
 
-  fileschanged = callPackage ../tools/misc/fileschanged { };
+  filegive = callPackage ../tools/networking/filegive { };
 
-  findutils =
-    if stdenv.isDarwin
-    then findutils4227
-    else callPackage ../tools/misc/findutils { };
+  fileschanged = callPackage ../tools/misc/fileschanged { };
 
-  findutils4227 = callPackage ../tools/misc/findutils/4.2.27.nix { };
+  findutils = callPackage ../tools/misc/findutils { };
 
   finger_bsd = callPackage ../tools/networking/bsd-finger { };
 
@@ -719,9 +801,11 @@ let
 
   libbsd = callPackage ../development/libraries/libbsd { };
 
+  lprof = callPackage ../tools/graphics/lprof { };
+
   flvtool2 = callPackage ../tools/video/flvtool2 { };
 
-  fontforge = callPackage ../tools/misc/fontforge { };
+  fontforge = lowPrio (callPackage ../tools/misc/fontforge { });
 
   fontforgeX = callPackage ../tools/misc/fontforge {
     withX11 = true;
@@ -729,6 +813,14 @@ let
 
   fortune = callPackage ../tools/misc/fortune { };
 
+  fox = callPackage ../development/libraries/fox/default.nix {
+    libpng = libpng12;
+  };
+
+  fox_1_6 = callPackage ../development/libraries/fox/fox-1.6.nix { };
+
+  fping = callPackage ../tools/networking/fping {};
+
   fprot = callPackage ../tools/security/fprot { };
 
   freeipmi = callPackage ../tools/system/freeipmi {};
@@ -755,6 +847,8 @@ let
 
   uni2ascii = callPackage ../tools/text/uni2ascii { };
 
+  g500-control = callPackage ../tools/misc/g500-control { };
+
   gawk = callPackage ../tools/text/gawk { };
 
   gdmap = callPackage ../tools/system/gdmap { };
@@ -771,25 +865,27 @@ let
 
   gifsicle = callPackage ../tools/graphics/gifsicle { };
 
-  glusterfs = builderDefsPackage ../tools/filesystems/glusterfs {
-    inherit fuse flex bison;
-  };
+  glusterfs = callPackage ../tools/filesystems/glusterfs { };
 
   glxinfo = callPackage ../tools/graphics/glxinfo { };
 
+  gmvault = callPackage ../tools/networking/gmvault { };
+
   gnokii = builderDefsPackage (import ../tools/misc/gnokii) {
     inherit intltool perl gettext libusb pkgconfig bluez readline pcsclite
       libical gtk glib;
     inherit (xorg) libXpm;
   };
 
-  gnugrep =
-    # Use libiconv only on non-GNU platforms (we can't test with
-    # `stdenv ? glibc' at this point.)
-    let gnu = stdenv.isLinux; in
-      callPackage ../tools/text/gnugrep {
-        libiconv = if gnu then null else libiconv;
-      };
+  gnufdisk = callPackage ../tools/system/fdisk {
+    guile = guile_1_8;
+  };
+
+  gnugrep = callPackage ../tools/text/gnugrep {
+    libiconv = libiconvOrNull;
+  };
+
+  gnulib = callPackage ../development/tools/gnulib { };
 
   gnupatch = callPackage ../tools/text/gnupatch { };
 
@@ -819,6 +915,8 @@ let
 
   gnuvd = callPackage ../tools/misc/gnuvd { };
 
+  googleAuthenticator = callPackage ../os-specific/linux/google-authenticator { };
+
   gource = callPackage ../applications/version-management/gource {};
 
   gptfdisk = callPackage ../tools/system/gptfdisk { };
@@ -838,7 +936,7 @@ let
   };
 
   grub = callPackage_i686 ../tools/misc/grub {
-    buggyBiosCDSupport = getConfig ["grub" "buggyBiosCDSupport"] true;
+    buggyBiosCDSupport = config.grub.buggyBiosCDSupport or true;
   };
 
   grub2 = callPackage ../tools/misc/grub/2.0x.nix { };
@@ -859,6 +957,8 @@ let
 
   gtmess = callPackage ../applications/networking/instant-messengers/gtmess { };
 
+  gummiboot = callPackage ../tools/misc/gummiboot { };
+
   gupnp = callPackage ../development/libraries/gupnp {
     inherit (gnome) libsoup;
   };
@@ -875,6 +975,10 @@ let
 
   gzip = callPackage ../tools/compression/gzip { };
 
+  partclone = callPackage ../tools/backup/partclone { };
+
+  partimage = callPackage ../tools/backup/partimage { };
+
   pigz = callPackage ../tools/compression/pigz { };
 
   haproxy = callPackage ../tools/networking/haproxy { };
@@ -897,6 +1001,10 @@ let
 
   host = callPackage ../tools/networking/host { };
 
+  hping = callPackage ../tools/networking/hping { };
+
+  httpie = callPackage ../tools/networking/httpie { };
+
   httpfs2 = callPackage ../tools/filesystems/httpfs { };
 
   # FIXME: This Hydra snapshot is outdated and depends on the `nixPerl',
@@ -908,10 +1016,14 @@ let
 
   iasl = callPackage ../development/compilers/iasl { };
 
+  icecast = callPackage ../servers/icecast { };
+
   icoutils = callPackage ../tools/graphics/icoutils { };
 
   idutils = callPackage ../tools/misc/idutils { };
 
+  idle3tools = callPackage ../tools/system/idle3tools { };
+
   iftop = callPackage ../tools/networking/iftop { };
 
   imapproxy = callPackage ../tools/networking/imapproxy { };
@@ -958,6 +1070,8 @@ let
 
   jnettop = callPackage ../tools/networking/jnettop { };
 
+  jq = callPackage ../development/tools/jq {};
+
   jscoverage = callPackage ../development/tools/misc/jscoverage { };
 
   jwhois = callPackage ../tools/networking/jwhois { };
@@ -970,14 +1084,20 @@ let
 
   less = callPackage ../tools/misc/less { };
 
+  lockfileProgs = callPackage ../tools/misc/lockfile-progs { };
+
   logstash = callPackage ../tools/misc/logstash { };
 
   klavaro = callPackage ../games/klavaro {};
 
   minidlna = callPackage ../tools/networking/minidlna { };
 
+  mmv = callPackage ../tools/misc/mmv { };
+
   most = callPackage ../tools/misc/most { };
 
+  multitail = callPackage ../tools/misc/multitail { };
+
   netperf = callPackage ../applications/networking/netperf { };
 
   ninka = callPackage ../development/tools/misc/ninka { };
@@ -986,22 +1106,30 @@ let
 
   nodePackages = recurseIntoAttrs (import ./node-packages.nix {
     inherit pkgs stdenv nodejs fetchurl;
+    neededNatives = [python] ++ lib.optional (lib.elem system lib.platforms.linux) utillinux;
+    self = pkgs.nodePackages;
   });
 
-  npm2nix = callPackage ../development/tools/node/npm2nix {
-    coffeescript = nodePackages."coffee-script";
-  };
-
   ldns = callPackage ../development/libraries/ldns { };
 
   lftp = callPackage ../tools/networking/lftp { };
 
   libconfig = callPackage ../development/libraries/libconfig { };
 
+  libee = callPackage ../development/libraries/libee { };
+
+  libestr = callPackage ../development/libraries/libestr { };
+
   libtirpc = callPackage ../development/libraries/ti-rpc { };
 
+  libshout = callPackage ../development/libraries/libshout { };
+
   libtorrent = callPackage ../tools/networking/p2p/libtorrent { };
 
+  logcheck = callPackage ../tools/system/logcheck {
+    inherit (perlPackages) mimeConstruct;
+  };
+
   logrotate = callPackage ../tools/system/logrotate { };
 
   logstalgica = callPackage ../tools/graphics/logstalgica {};
@@ -1016,7 +1144,9 @@ let
 
   lshw = callPackage ../tools/system/lshw { };
 
-  lxc = callPackage ../applications/virtualization/lxc { };
+  lxc = callPackage ../os-specific/linux/lxc { };
+
+  lzip = callPackage ../tools/compression/lzip { };
 
   lzma = xz;
 
@@ -1024,7 +1154,7 @@ let
 
   lzop = callPackage ../tools/compression/lzop { };
 
-  mu0 = callPackage ../tools/networking/mu0 { };
+  maildrop = callPackage ../tools/networking/maildrop { };
 
   mailutils = callPackage ../tools/networking/mailutils {
     guile = guile_1_8;
@@ -1032,6 +1162,8 @@ let
 
   mairix = callPackage ../tools/text/mairix { };
 
+  makemkv = callPackage ../applications/video/makemkv { };
+
   man = callPackage ../tools/misc/man { };
 
   man_db = callPackage ../tools/misc/man-db { };
@@ -1040,6 +1172,8 @@ let
 
   memtest86plus = callPackage ../tools/misc/memtest86/plus.nix { };
 
+  meo = callPackage ../tools/security/meo { };
+
   mc = callPackage ../tools/misc/mc { };
 
   mcabber = callPackage ../applications/networking/instant-messengers/mcabber { };
@@ -1052,8 +1186,12 @@ let
 
   mdbtools_git = callPackage ../tools/misc/mdbtools/git.nix { };
 
+  megatools = callPackage ../tools/networking/megatools { };
+
   minecraft = callPackage ../games/minecraft { };
 
+  minetest = callPackage ../games/minetest { };
+
   miniupnpc = callPackage ../tools/networking/miniupnpc { };
 
   miniupnpd = callPackage ../tools/networking/miniupnpd { };
@@ -1064,9 +1202,11 @@ let
 
   mkcue = callPackage ../tools/cd-dvd/mkcue { };
 
+  mkpasswd = callPackage ../tools/security/mkpasswd { };
+
   mktemp = callPackage ../tools/security/mktemp { };
 
-  mldonkey = callPackage ../applications/networking/p2p/mldonkey { };
+  mktorrent = callPackage ../tools/misc/mktorrent { };
 
   modemmanager = callPackage ../tools/networking/modemmanager {};
 
@@ -1111,6 +1251,8 @@ let
     mtutils = callPackage ../tools/text/multitran/mtutils { };
   });
 
+  munge = callPackage ../tools/security/munge { };
+
   muscleframework = callPackage ../tools/security/muscleframework { };
 
   muscletool = callPackage ../tools/security/muscletool { };
@@ -1147,12 +1289,16 @@ let
 
   networkmanager = callPackage ../tools/networking/network-manager { };
 
+  networkmanager_openvpn = callPackage ../tools/networking/network-manager/openvpn.nix { };
+
   networkmanager_pptp = callPackage ../tools/networking/network-manager/pptp.nix { };
 
   networkmanager_pptp_gnome = networkmanager_pptp.override { withGnome = true; };
 
   networkmanagerapplet = newScope gnome ../tools/networking/network-manager-applet { };
 
+  pa_applet = callPackage ../tools/audio/pa-applet { };
+
   nilfs_utils = callPackage ../tools/filesystems/nilfs-utils {};
 
   nlopt = callPackage ../development/libraries/nlopt {};
@@ -1163,6 +1309,8 @@ let
     inherit (pythonPackages) pysqlite;
   };
 
+  nss_pam_ldapd = callPackage ../tools/networking/nss-pam-ldapd {};
+
   ntfs3g = callPackage ../tools/filesystems/ntfs-3g { };
 
   # ntfsprogs are merged into ntfs-3g
@@ -1172,12 +1320,16 @@ let
 
   ntp = callPackage ../tools/networking/ntp { };
 
+  numdiff = callPackage ../tools/text/numdiff { };
+
   nssmdns = callPackage ../tools/networking/nss-mdns { };
 
   nylon = callPackage ../tools/networking/nylon { };
 
   nzbget = callPackage ../tools/networking/nzbget { };
 
+  oathToolkit = callPackage ../tools/security/oath-toolkit { };
+
   obex_data_server = callPackage ../tools/bluetooth/obex-data-server { };
 
   obexd = callPackage ../tools/bluetooth/obexd { };
@@ -1190,15 +1342,16 @@ let
 
   odt2txt = callPackage ../tools/text/odt2txt { };
 
-  offlineimap = callPackage ../tools/networking/offlineimap { };
+  offlineimap = callPackage ../tools/networking/offlineimap {
+    inherit (pythonPackages) sqlite3;
+  };
 
   opendbx = callPackage ../development/libraries/opendbx { };
 
   opendkim = callPackage ../development/libraries/opendkim { };
 
   openjade = callPackage ../tools/text/sgml/openjade {
-    stdenv = overrideGCC stdenv gcc33;
-    opensp = opensp.override { stdenv = overrideGCC stdenv gcc33; };
+    perl = perl510;
   };
 
   openobex = callPackage ../tools/bluetooth/openobex { };
@@ -1225,8 +1378,12 @@ let
 
   optipng = callPackage ../tools/graphics/optipng { };
 
+  oslrd = callPackage ../tools/networking/oslrd { };
+
   ossec = callPackage ../tools/security/ossec {};
 
+  otpw = callPackage ../os-specific/linux/otpw { };
+
   p7zip = callPackage ../tools/archivers/p7zip { };
 
   pal = callPackage ../tools/misc/pal { };
@@ -1237,10 +1394,11 @@ let
 
   parallel = callPackage ../tools/misc/parallel { };
 
+  parcellite = callPackage ../tools/misc/parcellite { };
+
   patchutils = callPackage ../tools/text/patchutils { };
 
   parted = callPackage ../tools/misc/parted { hurd = null; };
-  parted_2_3 = callPackage ../tools/misc/parted/2.3.nix { hurd = null; };
 
   hurdPartedCross =
     if crossSystem != null && crossSystem.config == "i586-pc-gnu"
@@ -1256,10 +1414,12 @@ let
                 gettext = null;
                 readline = null;
                 devicemapper = null;
-              }).hostDrv)
+              }).crossDrv)
            { hurd = gnu.hurdCrossIntermediate; })
     else null;
 
+  ipsecTools = callPackage ../os-specific/linux/ipsec-tools { };
+
   patch = gnupatch;
 
   pbzip2 = callPackage ../tools/compression/pbzip2 { };
@@ -1272,6 +1432,8 @@ let
 
   pdfjam = callPackage ../tools/typesetting/pdfjam { };
 
+  jbig2enc = callPackage ../tools/graphics/jbig2enc { };
+
   pdfread = callPackage ../tools/graphics/pdfread { };
 
   briss = callPackage ../tools/graphics/briss { };
@@ -1303,6 +1465,8 @@ let
 
   plotutils = callPackage ../tools/graphics/plotutils { };
 
+  plowshare = callPackage ../tools/misc/plowshare { };
+
   pngcrush = callPackage ../tools/graphics/pngcrush { };
 
   pngnq = callPackage ../tools/graphics/pngnq { };
@@ -1311,6 +1475,8 @@ let
     libpng = libpng12;
   };
 
+  podiff = callPackage ../tools/text/podiff { };
+
   polipo = callPackage ../servers/polipo { };
 
   polkit_gnome = callPackage ../tools/security/polkit-gnome { };
@@ -1337,6 +1503,8 @@ let
 
   pwgen = callPackage ../tools/security/pwgen { };
 
+  pwnat = callPackage ../tools/networking/pwnat { };
+
   pydb = callPackage ../development/tools/pydb { };
 
   pystringtemplate = callPackage ../development/python-modules/stringtemplate { };
@@ -1365,8 +1533,12 @@ let
 
   rtmpdump = callPackage ../tools/video/rtmpdump { };
 
+  reaverwps = callPackage ../tools/networking/reaver-wps {};
+
   recutils = callPackage ../tools/misc/recutils { };
 
+  recoll = callPackage ../applications/search/recoll { };
+
   refind = callPackage ../tools/misc/refind { };
 
   reiser4progs = callPackage ../tools/filesystems/reiser4progs { };
@@ -1381,12 +1553,18 @@ let
 
   remmina = callPackage ../applications/networking/remote/remmina {};
 
+  renameutils = callPackage ../tools/misc/renameutils { };
+
   replace = callPackage ../tools/text/replace { };
 
+  reptyr = callPackage ../os-specific/linux/reptyr {};
+
   rdiff_backup = callPackage ../tools/backup/rdiff-backup { };
 
   ripmime = callPackage ../tools/networking/ripmime {};
 
+  rng_tools = callPackage ../tools/security/rng-tools { };
+
   rsnapshot = callPackage ../tools/backup/rsnapshot {
     # For the `logger' command, we can use either `utillinux' or
     # GNU Inetutils.  The latter is more portable.
@@ -1425,6 +1603,12 @@ let
 
   sablotron = callPackage ../tools/text/xml/sablotron { };
 
+  safecopy = callPackage ../tools/system/safecopy { };
+
+  salut_a_toi = callPackage ../applications/networking/instant-messengers/salut-a-toi {};
+
+  samplicator = callPackage ../tools/networking/samplicator { };
+
   screen = callPackage ../tools/misc/screen { };
 
   scrot = callPackage ../tools/graphics/scrot { };
@@ -1443,6 +1627,10 @@ let
 
   siege = callPackage ../tools/networking/siege {};
 
+  silc_client = callPackage ../applications/networking/instant-messengers/silc-client { };
+
+  silc_server = callPackage ../servers/silc-server { };
+
   sleuthkit = callPackage ../tools/system/sleuthkit {};
 
   slimrat = callPackage ../tools/networking/slimrat {
@@ -1459,19 +1647,30 @@ let
 
   smbnetfs = callPackage ../tools/filesystems/smbnetfs {};
 
+  snort = callPackage ../applications/networking/ids/snort { };
+
+  snx = callPackage_i686 ../tools/networking/snx {
+    inherit (pkgsi686Linux) pam gcc33;
+    inherit (pkgsi686Linux.xlibs) libX11;
+  };
+
   stardict = callPackage ../applications/misc/stardict/stardict.nix {
     inherit (gnome) libgnomeui scrollkeeper;
   };
 
+  storebrowse = callPackage ../tools/system/storebrowse { };
+
   fusesmb = callPackage ../tools/filesystems/fusesmb { };
 
+  sl = callPackage ../tools/misc/sl { };
+
   socat = callPackage ../tools/networking/socat { };
 
   sourceHighlight = callPackage ../tools/text/source-highlight { };
 
-  socat2pre = builderDefsPackage ../tools/networking/socat/2.0.0-b3.nix {
+  socat2pre = lowPrio (builderDefsPackage ../tools/networking/socat/2.0.0-b3.nix {
     inherit fetchurl stdenv openssl;
-  };
+  });
 
   squashfsTools = callPackage ../tools/filesystems/squashfs { };
 
@@ -1495,12 +1694,16 @@ let
 
   su = shadow;
 
+  surfraw = callPackage ../tools/networking/surfraw { };
+
   swec = callPackage ../tools/networking/swec {
     inherit (perlPackages) LWP URI HTMLParser HTTPServerSimple Parent;
   };
 
   svnfs = callPackage ../tools/filesystems/svnfs { };
 
+  sysbench = callPackage ../development/tools/misc/sysbench {};
+
   system_config_printer = callPackage ../tools/misc/system-config-printer {
     libxml2 = libxml2Python;
    };
@@ -1511,13 +1714,14 @@ let
     autoconf = autoconf213;
   };
 
+  tarsnap = callPackage ../tools/backup/tarsnap { };
+
   tcpdump = callPackage ../tools/networking/tcpdump { };
 
-  /*
-  tcng = callPackage ../tools/networking/tcng {
-    kernel = linux_2_6_27;
-  };
-  */
+  teamviewer = callPackage_i686 ../applications/networking/remote/teamviewer { };
+
+  # Work In Progress: it doesn't start unless running a daemon as root
+  teamviewer8 = lowPrio (callPackage_i686 ../applications/networking/remote/teamviewer/8.nix { });
 
   telnet = callPackage ../tools/networking/telnet { };
 
@@ -1527,6 +1731,8 @@ let
     guile = guile_1_8;
   };
 
+  tinc = callPackage ../tools/networking/tinc { };
+
   tmux = callPackage ../tools/misc/tmux { };
 
   tor = callPackage ../tools/security/tor { };
@@ -1536,12 +1742,15 @@ let
   trickle = callPackage ../tools/networking/trickle {};
 
   ttf2pt1 = callPackage ../tools/misc/ttf2pt1 { };
-  ttf2pt1_cl_pdf = callPackage ../tools/misc/ttf2pt1 { };
+
+  txt2man = callPackage ../tools/misc/txt2man { };
 
   ucl = callPackage ../development/libraries/ucl { };
 
   udftools = callPackage ../tools/filesystems/udftools {};
 
+  udptunnel = callPackage ../tools/networking/udptunnel { };
+
   ufraw = callPackage ../applications/graphics/ufraw { };
 
   unetbootin = callPackage ../tools/cd-dvd/unetbootin { };
@@ -1562,6 +1771,8 @@ let
 
   vde2 = callPackage ../tools/networking/vde2 { };
 
+  vboot_reference = callPackage ../tools/system/vboot_reference { };
+
   verilog = callPackage ../applications/science/electronics/verilog {};
 
   vfdecrypt = callPackage ../tools/misc/vfdecrypt { };
@@ -1584,8 +1795,12 @@ let
 
   vpnc = callPackage ../tools/networking/vpnc { };
 
+  openconnect = callPackage ../tools/networking/openconnect.nix { };
+
   vtun = callPackage ../tools/networking/vtun { };
 
+  wbox = callPackage ../tools/networking/wbox {};
+
   welkin = callPackage ../tools/graphics/welkin {};
 
   testdisk = callPackage ../tools/misc/testdisk { };
@@ -1597,6 +1812,8 @@ let
   tigervnc = callPackage ../tools/admin/tigervnc {
     fontDirectories = [ xorg.fontadobe75dpi xorg.fontmiscmisc xorg.fontcursormisc
       xorg.fontbhlucidatypewriter75dpi ];
+    xorgserver = xorg.xorgserver_1_13_0;
+    fltk = fltk13;
   };
 
   tightvnc = callPackage ../tools/admin/tightvnc {
@@ -1610,6 +1827,17 @@ let
 
   tkabber_plugins = callPackage ../applications/networking/instant-messengers/tkabber-plugins { };
 
+  qfsm = callPackage ../applications/science/electronics/qfsm { };
+
+  tkgate = callPackage ../applications/science/electronics/tkgate/1.x.nix {
+    inherit (xlibs) libX11 imake xproto gccmakedep;
+  };
+
+  # The newer package is low-priority because it segfaults at startup.
+  tkgate2 = lowPrio (callPackage ../applications/science/electronics/tkgate/2.x.nix {
+    inherit (xlibs) libX11;
+  });
+
   tm = callPackage ../tools/system/tm { };
 
   trang = callPackage ../tools/text/xml/trang { };
@@ -1623,7 +1851,7 @@ let
   };
 
   truecrypt = callPackage ../applications/misc/truecrypt {
-    wxGUI = getConfig [ "truecrypt" "wxGUI" ] true;
+    wxGUI = config.truecrypt.wxGUI or true;
   };
 
   ttmkfdir = callPackage ../tools/misc/ttmkfdir { };
@@ -1636,16 +1864,20 @@ let
 
   unrar = callPackage ../tools/archivers/unrar { };
 
+  xarchive = callPackage ../tools/archivers/xarchive { };
+
   unarj = callPackage ../tools/archivers/unarj { };
 
   unshield = callPackage ../tools/archivers/unshield { };
 
   unzip = callPackage ../tools/archivers/unzip { };
 
-  unzipNLS = unzip.override { enableNLS = true; };
+  unzipNLS = lowPrio (unzip.override { enableNLS = true; });
 
   uptimed = callPackage ../tools/system/uptimed { };
 
+  varnish = callPackage ../servers/varnish { };
+
   vlan = callPackage ../tools/networking/vlan { };
 
   wakelan = callPackage ../tools/networking/wakelan { };
@@ -1667,6 +1899,8 @@ let
       libxml2 geoip;
   };
 
+  weighttp = callPackage ../tools/networking/weighttp { };
+
   wget = callPackage ../tools/networking/wget {
     inherit (perlPackages) LWP;
   };
@@ -1681,6 +1915,8 @@ let
 
   wv2 = callPackage ../tools/misc/wv2 { };
 
+  x86info = callPackage ../os-specific/linux/x86info { };
+
   x11_ssh_askpass = callPackage ../tools/networking/x11-ssh-askpass { };
 
   xbursttools = assert stdenv ? glibc; import ../tools/misc/xburst-tools {
@@ -1748,7 +1984,7 @@ let
 
   xvfb_run = callPackage ../tools/misc/xvfb-run { inherit (texFunctions) fontsConf; };
 
-  youtubeDL = callPackage ../tools/misc/youtube-dl { };
+  youtubeDL = callPackage ../tools/misc/youtube-dl { inherit (haskellPackages) pandoc; };
 
   zbar = callPackage ../tools/graphics/zbar {};
 
@@ -1758,6 +1994,8 @@ let
 
   zip = callPackage ../tools/archivers/zip { };
 
+  zpaq = callPackage ../tools/archivers/zpaq { };
+
   zsync = callPackage ../tools/compression/zsync { };
 
 
@@ -1776,7 +2014,7 @@ let
 
   dash = callPackage ../shells/dash { };
 
-  ipython = callPackage ../shells/ipython { };
+  fish = callPackage ../shells/fish { };
 
   tcsh = callPackage ../shells/tcsh { };
 
@@ -1801,14 +2039,20 @@ let
 
   bigloo = callPackage ../development/compilers/bigloo { };
 
+  chicken = callPackage ../development/compilers/chicken { };
+
   ccl = builderDefsPackage ../development/compilers/ccl {};
 
-  clangUnwrapped = callPackage ../development/compilers/llvm/clang.nix { };
+  clangUnwrapped = callPackage ../development/compilers/llvm/clang.nix {
+    stdenv = if stdenv.isDarwin
+      then stdenvAdapters.overrideGCC stdenv gccApple
+      else stdenv;
+  };
 
   clang = wrapClang clangUnwrapped;
 
   #Use this instead of stdenv to build with clang
-  clangStdenv = stdenvAdapters.overrideGCC stdenv clang;
+  clangStdenv = lowPrio (stdenvAdapters.overrideGCC stdenv clang);
 
   clean = callPackage ../development/compilers/clean { };
 
@@ -1833,10 +2077,6 @@ let
 
   gcc = gcc46;
 
-  gcc295 = wrapGCC (import ../development/compilers/gcc/2.95 {
-    inherit fetchurl stdenv noSysDirs;
-  });
-
   gcc33 = wrapGCC (import ../development/compilers/gcc/3.3 {
     inherit fetchurl stdenv noSysDirs;
   });
@@ -1850,19 +2090,6 @@ let
   # expects a single digit after the dot.  As a workaround, we feed
   # GCC with Texinfo 4.9.  Stupid bug, hackish workaround.
 
-  gcc40 = wrapGCC (makeOverridable (import ../development/compilers/gcc/4.0) {
-    inherit fetchurl stdenv noSysDirs;
-    texinfo = texinfo49;
-    profiledCompiler = true;
-  });
-
-  gcc41 = wrapGCC (makeOverridable (import ../development/compilers/gcc/4.1) {
-    inherit fetchurl noSysDirs gmp mpfr;
-    stdenv = overrideGCC stdenv gcc42;
-    texinfo = texinfo49;
-    profiledCompiler = false;
-  });
-
   gcc42 = wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2) {
     inherit fetchurl stdenv noSysDirs;
     profiledCompiler = false;
@@ -1925,7 +2152,19 @@ let
       cross = assert crossSystem != null; crossSystem;
     });
 
-  gcc_realCross = gcc46_realCross;
+  gcc47_realCross = lib.addMetaAttrs { platforms = []; }
+    (makeOverridable (import ../development/compilers/gcc/4.7) {
+      inherit fetchurl stdenv texinfo gmp mpfr mpc libelf zlib
+        cloog ppl gettext which noSysDirs;
+      binutilsCross = binutilsCross;
+      libcCross = libcCross;
+      profiledCompiler = false;
+      enableMultilib = false;
+      crossStageStatic = false;
+      cross = assert crossSystem != null; crossSystem;
+    });
+
+  gcc_realCross = gcc47_realCross;
 
   gccCrossStageStatic = let
       isMingw = (stdenv.cross.libc == "msvcrt");
@@ -1934,7 +2173,7 @@ let
                    if isMingw then windows.mingw_headers1 else null;
     in
       wrapGCCCross {
-      gcc = forceBuildDrv (lib.addMetaAttrs { platforms = []; } (
+      gcc = forceNativeDrv (lib.addMetaAttrs { platforms = []; } (
         gcc_realCross.override {
           crossStageStatic = true;
           langCC = false;
@@ -1955,12 +2194,17 @@ let
   };
 
   gccCrossStageFinal = wrapGCCCross {
-    gcc = forceBuildDrv (gcc_realCross.override {
+    gcc = forceNativeDrv (gcc_realCross.override {
       libpthreadCross =
         # FIXME: Don't explicitly refer to `i586-pc-gnu'.
         if crossSystem != null && crossSystem.config == "i586-pc-gnu"
         then gnu.libpthreadCross
         else null;
+
+      # XXX: We have troubles cross-compiling libstdc++ on MinGW (see
+      # <http://hydra.nixos.org/build/4268232>), so don't even try.
+      langCC = (crossSystem == null
+                || crossSystem.config != "i686-pc-mingw32");
      });
     libc = libcCross;
     binutils = binutilsCross;
@@ -1985,9 +2229,9 @@ let
       gettext which noSysDirs;
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.isArm then false else true;
+    profiledCompiler = !stdenv.isArm;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2006,7 +2250,7 @@ let
 
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.system == "armv5tel-linux" then false else true;
+    profiledCompiler = !stdenv.system == "armv5tel-linux";
   }));
 
   gcc46_real = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.6 {
@@ -2014,9 +2258,9 @@ let
 
     # bootstrapping a profiled compiler does not work in the sheevaplug:
     # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43944
-    profiledCompiler = if stdenv.isArm then false else true;
+    profiledCompiler = !stdenv.isArm;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2037,13 +2281,20 @@ let
     binutilsCross = null;
   }));
 
+  gcc46_multi = if system == "x86_64-linux" then lowPrio (
+      wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi (gcc46.gcc.override {
+      stdenv = overrideGCC stdenv (wrapGCCWith (import ../build-support/gcc-wrapper) glibc_multi gcc.gcc);
+      profiledCompiler = false;
+      enableMultilib = true;
+    })) else throw "Multilib gcc not supported on ‘${system}’";
+
   gcc47_real = lowPrio (wrapGCC (callPackage ../development/compilers/gcc/4.7 {
     inherit noSysDirs;
     # I'm not sure if profiling with enableParallelBuilding helps a lot.
     # We can enable it back some day. This makes the *gcc* builds faster now.
     profiledCompiler = false;
 
-    # When building `gcc.hostDrv' (a "Canadian cross", with host == target
+    # When building `gcc.crossDrv' (a "Canadian cross", with host == target
     # and host != build), `cross' must be null but the cross-libc must still
     # be passed.
     cross = null;
@@ -2064,39 +2315,17 @@ let
   }));
 
   gccApple =
-    wrapGCC (makeOverridable
-      (if stdenv.system == "i686-darwin"
-       then import ../development/compilers/gcc/4.2-apple32
-       else import ../development/compilers/gcc/4.2-apple64) {
-         inherit fetchurl noSysDirs;
-         profiledCompiler = true;
-
-         # Since it fails to build with GCC 4.6, build it with the "native"
-         # Apple-GCC.
-         stdenv = allStdenvs.stdenvNative;
-       });
-
-  gccupc40 = wrapGCCUPC (import ../development/compilers/gcc-upc-4.0 {
-    inherit fetchurl stdenv bison autoconf gnum4 noSysDirs;
-    texinfo = texinfo49;
-  });
+    assert stdenv.isDarwin;
+    wrapGCC (makeOverridable (import ../development/compilers/gcc/4.2-apple64) {
+      inherit fetchurl noSysDirs;
+      profiledCompiler = true;
+      # Since it fails to build with GCC 4.6, build it with the "native"
+      # Apple-GCC.
+      stdenv = allStdenvs.stdenvNative;
+    });
 
   gfortran = gfortran46;
 
-  gfortran40 = wrapGCC (gcc40.gcc.override {
-    langFortran = true;
-    langCC = false;
-    inherit gmp mpfr;
-  });
-
-  gfortran41 = wrapGCC (gcc41.gcc.override {
-    name = "gfortran";
-    langFortran = true;
-    langCC = false;
-    langC = false;
-    inherit gmp mpfr;
-  });
-
   gfortran42 = wrapGCC (gcc42.gcc.override {
     name = "gfortran";
     langFortran = true;
@@ -2272,6 +2501,11 @@ let
     };
   };
 
+  jhc = callPackage ../development/compilers/jhc {
+    inherit (haskellPackages_ghc6123) ghc binary zlib utf8String readline fgl
+    regexCompat HsSyck random;
+  };
+
   # Haskell and GHC
 
   # Import Haskell infrastructure.
@@ -2288,40 +2522,41 @@ let
   # particularly in connection with Hydra builds for all these packages.
   # So we enable it for selected versions only.
 
-  # Current default version: 7.4.1.
-  haskellPackages = haskellPackages_ghc741;
-  # Current Haskell platform.
+  # Current default version: 7.6.3.
+  haskellPackages = haskellPackages_ghc763;
+  # Current Haskell Platform: 2013.2.0.0
   haskellPlatform = haskellPackages.haskellPlatform;
 
-  haskellPackages_ghc6104             = recurseIntoAttrs (haskell.packages_ghc6104);
+  haskellPackages_ghc6104             =                   haskell.packages_ghc6104;
   haskellPackages_ghc6121             =                   haskell.packages_ghc6121;
   haskellPackages_ghc6122             =                   haskell.packages_ghc6122;
-  haskellPackages_ghc6123             = recurseIntoAttrs (haskell.packages_ghc6123);
+  haskellPackages_ghc6123             =                   haskell.packages_ghc6123;
   haskellPackages_ghc701              =                   haskell.packages_ghc701;
   haskellPackages_ghc702              =                   haskell.packages_ghc702;
   haskellPackages_ghc703              =                   haskell.packages_ghc703;
-  haskellPackages_ghc704              = recurseIntoAttrs (haskell.packages_ghc704);
+  haskellPackages_ghc704              =                   haskell.packages_ghc704;
   haskellPackages_ghc721              =                   haskell.packages_ghc721;
   haskellPackages_ghc722              =                   haskell.packages_ghc722;
+  haskellPackages_ghc741              =                   haskell.packages_ghc741;
+  haskellPackages_ghc742              =                   haskell.packages_ghc742;
+  haskellPackages_ghc761              =                   haskell.packages_ghc761;
+  haskellPackages_ghc762              =                   haskell.packages_ghc762;
   # For the default version, we build profiling versions of the libraries, too.
   # The following three lines achieve that: the first two make Hydra build explicit
   # profiling and non-profiling versions; the final respects the user-configured
   # default setting.
-  haskellPackages_ghc741_no_profiling = recurseIntoAttrs (haskell.packages_ghc741.noProfiling);
-  haskellPackages_ghc741_profiling    = recurseIntoAttrs (haskell.packages_ghc741.profiling);
-  haskellPackages_ghc741              = recurseIntoAttrs (haskell.packages_ghc741.highPrio);
-  # Stable branch snapshot.
-  haskellPackages_ghc742              = recurseIntoAttrs (haskell.packages_ghc742);
-  # Release candidate.
-  haskellPackages_ghc761              =                   haskell.packages_ghc761;
+  haskellPackages_ghc763_no_profiling = recurseIntoAttrs (haskell.packages_ghc763.noProfiling);
+  haskellPackages_ghc763_profiling    = recurseIntoAttrs (haskell.packages_ghc763.profiling);
+  haskellPackages_ghc763              = recurseIntoAttrs (haskell.packages_ghc763.highPrio);
   # Reasonably current HEAD snapshot.
   haskellPackages_ghcHEAD             =                   haskell.packages_ghcHEAD;
 
-  haxeDist = import ../development/compilers/haxe {
-    inherit fetchurl sourceFromHead stdenv lib ocaml zlib makeWrapper neko;
+  haxe = callPackage ../development/compilers/haxe { };
+
+  hiphopvm = callPackage ../development/interpreters/hiphopvm {
+    libevent = libevent14;
+    boost = boost149;
   };
-  haxe = haxeDist.haxe;
-  haxelib = haxeDist.haxelib;
 
   falcon = builderDefsPackage (import ../development/interpreters/falcon) {
     inherit cmake;
@@ -2329,19 +2564,18 @@ let
 
   fsharp = callPackage ../development/compilers/fsharp {};
 
-  go = callPackage ../development/compilers/go { };
+  go_1_0 = callPackage ../development/compilers/go { };
+
+  go_1_1 = callPackage ../development/compilers/go/1.1.nix { };
+
+  go = go_1_1;
 
   gprolog = callPackage ../development/compilers/gprolog { };
 
-  gwt = callPackage ../development/compilers/gwt {
-    libstdcpp5 = gcc33.gcc;
-  };
   gwt240 = callPackage ../development/compilers/gwt/2.4.0.nix { };
 
   ikarus = callPackage ../development/compilers/ikarus { };
 
-  #TODO add packages http://cvs.haskell.org/Hugs/downloads/2006-09/packages/ and test
-  # commented out because it's using the new configuration style proposal which is unstable
   hugs = callPackage ../development/compilers/hugs { };
 
   path64 = callPackage ../development/compilers/path64 { };
@@ -2350,33 +2584,46 @@ let
     if stdenv.isDarwin then
       callPackage ../development/compilers/openjdk-darwin { }
     else
-      callPackage ../development/compilers/openjdk { };
+      let
+        openjdkBootstrap = callPackage ../development/compilers/openjdk/bootstrap.nix {};
+        openjdkStage1 = callPackage ../development/compilers/openjdk {
+          jdk = openjdkBootstrap;
+          ant = pkgs.ant.override { jdk = openjdkBootstrap; };
+        };
+      in callPackage ../development/compilers/openjdk {
+        jdk = openjdkStage1;
+        ant = pkgs.ant.override { jdk = openjdkStage1; };
+      };
 
-  openjre = callPackage ../development/compilers/openjdk {
+  openjre = pkgs.openjdk.override {
     jreOnly = true;
   };
 
-  jdk = if stdenv.isDarwin then openjdk else jdkdistro true false;
-  jre = jdkdistro false false;
+  jdk = if stdenv.isDarwin || stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
+    then pkgs.openjdk
+    else pkgs.oraclejdk;
+  jre = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
+    then pkgs.openjre
+    else pkgs.oraclejre;
+
+  oraclejdk = pkgs.jdkdistro true false;
 
-  jrePlugin = lowPrio (jdkdistro false true);
+  oraclejre = lowPrio (pkgs.jdkdistro false false);
+
+  jrePlugin = lowPrio (pkgs.jdkdistro false true);
 
   supportsJDK =
     system == "i686-linux" ||
-    system == "x86_64-linux" ||
-    system == "i686-cygwin";
+    system == "x86_64-linux";
 
   jdkdistro = installjdk: pluginSupport:
-       (assert supportsJDK;
-    (if pluginSupport then appendToName "plugin" else x: x) (import ../development/compilers/jdk {
-      inherit fetchurl stdenv unzip installjdk xlibs pluginSupport makeWrapper cabextract;
-    }));
+    assert supportsJDK;
+    (if pluginSupport then appendToName "plugin" else x: x)
+      (callPackage ../development/compilers/jdk/jdk6-linux.nix { });
 
   jikes = callPackage ../development/compilers/jikes { };
 
   julia = callPackage ../development/compilers/julia {
-    llvm = llvm_3_1;
-    pcre = pcre_8_30;
     liblapack = liblapack.override {shared = true;};
     fftw = fftw.override {pthreads = true;};
     fftwSinglePrec = fftwSinglePrec.override {pthreads = true;};
@@ -2388,8 +2635,15 @@ let
     fpc = fpc;
   };
 
-  llvm = callPackage ../development/compilers/llvm { };
-  llvm_3_1 = callPackage ../development/compilers/llvm/3.1.nix { };
+  llvm = callPackage ../development/compilers/llvm {
+    stdenv = if stdenv.isDarwin
+      then stdenvAdapters.overrideGCC stdenv gccApple
+      else stdenv;
+  };
+
+  mentorToolchains = recurseIntoAttrs (
+    callPackage_i686 ../development/compilers/mentor {}
+  );
 
   mitscheme = callPackage ../development/compilers/mit-scheme { };
 
@@ -2417,7 +2671,7 @@ let
 
   ocaml_3_12_1 = callPackage ../development/compilers/ocaml/3.12.1.nix { };
 
-  ocaml_4_00_0 = callPackage ../development/compilers/ocaml/4.00.0.nix { };
+  ocaml_4_00_1 = callPackage ../development/compilers/ocaml/4.00.1.nix { };
 
   metaocaml_3_09 = callPackage ../development/compilers/ocaml/metaocaml-3.09.nix { };
 
@@ -2465,6 +2719,8 @@ let
 
     menhir = callPackage ../development/ocaml-modules/menhir { };
 
+    mldonkey = callPackage ../applications/networking/p2p/mldonkey { };
+
     ocaml_batteries = callPackage ../development/ocaml-modules/batteries {
       camomile = camomile_0_8_2;
     };
@@ -2508,13 +2764,15 @@ let
     ocaml_extlib = callPackage ../development/ocaml-modules/extlib { };
 
     pycaml = callPackage ../development/ocaml-modules/pycaml { };
+
+    opam = callPackage ../development/tools/ocaml/opam { };
   };
 
   ocamlPackages = recurseIntoAttrs ocamlPackages_3_12_1;
   ocamlPackages_3_10_0 = mkOcamlPackages ocaml_3_10_0 pkgs.ocamlPackages_3_10_0;
   ocamlPackages_3_11_2 = mkOcamlPackages ocaml_3_11_2 pkgs.ocamlPackages_3_11_2;
   ocamlPackages_3_12_1 = mkOcamlPackages ocaml_3_12_1 pkgs.ocamlPackages_3_12_1;
-  ocamlPackages_4_00_0 = mkOcamlPackages ocaml_4_00_0 pkgs.ocamlPackages_4_00_0;
+  ocamlPackages_4_00_1 = mkOcamlPackages ocaml_4_00_1 pkgs.ocamlPackages_4_00_1;
 
   ocaml_make = callPackage ../development/ocaml-modules/ocamlmake { };
 
@@ -2542,9 +2800,13 @@ let
 
   scala = callPackage ../development/compilers/scala { };
 
+  sdcc = callPackage ../development/compilers/sdcc {
+    boost = boost149; # sdcc 3.2.0 fails to build with boost 1.53
+  };
+
   stalin = callPackage ../development/compilers/stalin { };
 
-  strategoPackages = strategoPackages018;
+  strategoPackages = recurseIntoAttrs strategoPackages018;
 
   strategoPackages016 = callPackage ../development/compilers/strategoxt/0.16.nix {
     stdenv = overrideInStdenv stdenv [gnumake380];
@@ -2612,23 +2874,13 @@ let
   wrapGCCCross =
     {gcc, libc, binutils, cross, shell ? "", name ? "gcc-cross-wrapper"}:
 
-    forceBuildDrv (import ../build-support/gcc-cross-wrapper {
+    forceNativeDrv (import ../build-support/gcc-cross-wrapper {
       nativeTools = false;
       nativeLibc = false;
       noLibc = (libc == null);
       inherit stdenv gcc binutils libc shell name cross;
     });
 
-  # FIXME: This is a specific hack for GCC-UPC.  Eventually, we may
-  # want to merge `gcc-upc-wrapper' and `gcc-wrapper'.
-  wrapGCCUPC = baseGCC: import ../build-support/gcc-upc-wrapper {
-    nativeTools = stdenv ? gcc && stdenv.gcc.nativeTools;
-    nativeLibc = stdenv ? gcc && stdenv.gcc.nativeLibc;
-    gcc = baseGCC;
-    libc = glibc;
-    inherit stdenv binutils;
-  };
-
   # prolog
   yap = callPackage ../development/compilers/yap { };
 
@@ -2652,6 +2904,8 @@ let
 
   clojure = callPackage ../development/interpreters/clojure { };
 
+  clojureUnstable = callPackage ../development/interpreters/clojure { version = "1.5.0-RC1"; };
+
   clojure_binary = callPackage ../development/interpreters/clojure/binary.nix { };
 
   clojure_wrapper = callPackage ../development/interpreters/clojure/wrapper.nix {
@@ -2664,9 +2918,9 @@ let
     clooj = clooj_standalone_binary;
   };
 
-  erlang = callPackage ../development/interpreters/erlang { };
-
   erlangR14B04 = callPackage ../development/interpreters/erlang/R14B04.nix { };
+  erlangR15B03 = callPackage ../development/interpreters/erlang/R15B03.nix { };
+  erlang = erlangR15B03;
 
   groovy = callPackage ../development/interpreters/groovy { };
 
@@ -2689,10 +2943,13 @@ let
   love = callPackage ../development/interpreters/love {};
 
   lua4 = callPackage ../development/interpreters/lua-4 { };
-
   lua5 = callPackage ../development/interpreters/lua-5 { };
-
   lua5_0 = callPackage ../development/interpreters/lua-5/5.0.3.nix { };
+  lua5_1 = callPackage ../development/interpreters/lua-5/5.1.nix { };
+
+  luarocks = callPackage ../development/tools/misc/luarocks {
+     lua = lua5;
+  };
 
   maude = callPackage ../development/interpreters/maude { };
 
@@ -2709,27 +2966,19 @@ let
 
   perl510 = callPackage ../development/interpreters/perl/5.10 { };
 
-  perl514 = callPackage ../development/interpreters/perl/5.14 {
+  perl514 = callPackage ../development/interpreters/perl/5.14 { };
+
+  perl516 = callPackage ../development/interpreters/perl/5.16 {
     fetchurl = fetchurlBoot;
   };
 
-  perl = if system != "i686-cygwin" then perl514 else sysPerl;
+  perl = if system != "i686-cygwin" then perl516 else sysPerl;
 
-  php = php5_3;
+  php = php54;
 
-  php5_2 = makeOverridable (import ../development/interpreters/php/5.2.nix) {
-    inherit
-      stdenv fetchurl lib composableDerivation autoconf automake
-      flex bison apacheHttpd mysql libxml2 readline
-      zlib curl gd postgresql openssl pkgconfig sqlite getConfig libiconv libjpeg libpng;
-  };
+  php53 = callPackage ../development/interpreters/php/5.3.nix { };
 
-  php5_3 = makeOverridable (import ../development/interpreters/php/5.3.nix) {
-    inherit
-      stdenv fetchurl lib composableDerivation autoconf automake
-      flex bison apacheHttpd mysql libxml2 readline
-      zlib curl gd postgresql openssl pkgconfig sqlite getConfig libiconv libjpeg libpng;
-  };
+  php54 = callPackage ../development/interpreters/php/5.4.nix { };
 
   php_apc = callPackage ../development/libraries/php-apc { };
 
@@ -2739,40 +2988,35 @@ let
 
   picolisp = callPackage ../development/interpreters/picolisp {};
 
-  pltScheme = builderDefsPackage (import ../development/interpreters/plt-scheme) {
-    inherit cairo fontconfig freetype libjpeg libpng openssl
-      perl mesa zlib which;
-    inherit (xorg) libX11 libXaw libXft libXrender libICE xproto
-      renderproto pixman libSM libxcb libXext xextproto libXmu
-      libXt;
-  };
+  pltScheme = racket; # just to be sure
 
   polyml = callPackage ../development/compilers/polyml { };
 
   pure = callPackage ../development/interpreters/pure {};
 
-  python = python27;
-  python3 = python32;
+  python3 = hiPrio (callPackage ../development/interpreters/python/3.3 { });
 
+  python = python27;
   python26 = callPackage ../development/interpreters/python/2.6 { };
-
   python27 = callPackage ../development/interpreters/python/2.7 { };
 
-  python32 = callPackage ../development/interpreters/python/3.2 { };
-
   pythonFull = python27Full;
-
   python26Full = callPackage ../development/interpreters/python/wrapper.nix {
     extraLibs = lib.attrValues python26.modules;
     python = python26;
+    inherit (python26Packages) recursivePthLoader;
   };
-
   python27Full = callPackage ../development/interpreters/python/wrapper.nix {
     extraLibs = lib.attrValues python27.modules;
     python = python27;
+    inherit (python27Packages) recursivePthLoader;
   };
 
-  pythonhomeWrapper = callPackage ../development/interpreters/python/pythonhome-wrapper.nix { };
+  pythonDocs = recurseIntoAttrs (import ../development/interpreters/python/docs {
+    inherit stdenv fetchurl lib;
+  });
+
+  pythonLinkmeWrapper = callPackage ../development/interpreters/python/python-linkme-wrapper.nix { };
 
   pyrex = pyrex095;
 
@@ -2788,6 +3032,7 @@ let
 
   ruby18 = callPackage ../development/interpreters/ruby/ruby-18.nix { };
   ruby19 = callPackage ../development/interpreters/ruby/ruby-19.nix { };
+  ruby2 = lowPrio (callPackage ../development/interpreters/ruby/ruby-2.0.nix { });
 
   ruby = ruby19;
 
@@ -2798,7 +3043,7 @@ let
   rubySqlite3 = callPackage ../development/ruby-modules/sqlite3 { };
 
   rLang = callPackage ../development/interpreters/r-lang {
-    withBioconductor = getConfig ["rLang" "withBioconductor"] false;
+    withBioconductor = config.rLang.withBioconductor or false;
   };
 
   rubygemsFun = ruby: builderDefsPackage (import ../development/interpreters/ruby/rubygems.nix) {
@@ -2825,18 +3070,15 @@ let
 
   xulrunner = pkgs.firefoxPkgs.xulrunner;
 
+
   ### DEVELOPMENT / MISC
 
   avrgcclibc = callPackage ../development/misc/avr-gcc-with-avr-libc {};
 
   avr8burnomat = callPackage ../development/misc/avr8-burn-omat { };
 
-  /*
-  toolbus = callPackage ../development/interpreters/toolbus { };
-  */
-
   sourceFromHead = import ../build-support/source-from-head-fun.nix {
-    inherit getConfig;
+    inherit config;
   };
 
   ecj = callPackage ../development/eclipse/ecj { };
@@ -2874,6 +3116,7 @@ let
   apacheAnt = callPackage ../development/tools/build-managers/apache-ant { };
 
   apacheAntOpenJDK = apacheAnt.override { jdk = openjdk; };
+  apacheAntOracleJDK = ant.override { jdk = pkgs.oraclejdk; };
 
   apacheAntGcj = callPackage ../development/tools/build-managers/apache-ant/from-source.nix {
     # must be either pre-built or built with GCJ *alone*
@@ -2888,24 +3131,17 @@ let
 
   autoconf213 = callPackage ../development/tools/misc/autoconf/2.13.nix { };
 
+  autocutsel = callPackage ../tools/X11/autocutsel{ };
+
   automake = automake112x;
 
   automake110x = callPackage ../development/tools/misc/automake/automake-1.10.x.nix { };
 
-  automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix {
-    doCheck = !stdenv.isArm && !stdenv.isCygwin && !stdenv.isMips
-      # Some of the parallel tests seem to hang on `i386-pc-solaris2.11'.
-      && stdenv.system != "i686-solaris"
+  automake111x = callPackage ../development/tools/misc/automake/automake-1.11.x.nix { };
 
-      # One test fails to terminate on FreeBSD: <http://bugs.gnu.org/8788>.
-      && !stdenv.isFreeBSD;
-  };
+  automake112x = callPackage ../development/tools/misc/automake/automake-1.12.x.nix { };
 
-  automake112x = callPackage ../development/tools/misc/automake/automake-1.12.x.nix {
-    doCheck = !stdenv.isArm && !stdenv.isCygwin && !stdenv.isMips
-      # Some of the parallel tests seem to hang on `i386-pc-solaris2.11'.
-      && stdenv.system != "i686-solaris";
-  };
+  automake113x = callPackage ../development/tools/misc/automake/automake-1.13.x.nix { };
 
   automoc4 = callPackage ../development/tools/misc/automoc4 { };
 
@@ -2917,35 +3153,32 @@ let
     inherit noSysDirs;
   };
 
-  binutils_gold = callPackage ../development/tools/misc/binutils {
+  binutils_gold = lowPrio (callPackage ../development/tools/misc/binutils {
     inherit noSysDirs;
     gold = true;
-  };
+  });
 
-  binutilsCross = forceBuildDrv (import ../development/tools/misc/binutils {
+  binutilsCross = lowPrio (forceNativeDrv (import ../development/tools/misc/binutils {
     inherit stdenv fetchurl zlib;
     noSysDirs = true;
     cross = assert crossSystem != null; crossSystem;
-  });
-
-  bison = bison25;
-
-  bison1875 = callPackage ../development/tools/parsing/bison/bison-1.875.nix { };
-
-  bison23 = callPackage ../development/tools/parsing/bison/bison-2.3.nix { };
-
-  bison24 = callPackage ../development/tools/parsing/bison/bison-2.4.nix { };
-
-  bison25 = callPackage ../development/tools/parsing/bison/bison-2.5.nix { };
+  }));
 
-  bison26 = callPackage ../development/tools/parsing/bison/bison-2.6.nix { };
+  bison = callPackage ../development/tools/parsing/bison { };
 
   buildbot = callPackage ../development/tools/build-managers/buildbot {
+    inherit (pythonPackages) twisted jinja2 sqlalchemy sqlalchemy_migrate;
+    dateutil = pythonPackages.dateutil_1_5;
+  };
+
+  buildbotSlave = callPackage ../development/tools/build-managers/buildbot-slave {
     inherit (pythonPackages) twisted;
   };
 
   byacc = callPackage ../development/tools/parsing/byacc { };
 
+  casperjs = callPackage ../development/tools/casperjs { };
+
   cbrowser = callPackage ../development/tools/misc/cbrowser { };
 
   ccache = callPackage ../development/tools/misc/ccache { };
@@ -2966,10 +3199,12 @@ let
   #
   ccacheWrapper = makeOverridable ({ extraConfig ? "" }:
      wrapGCC (ccache.links extraConfig)) {};
-  ccacheStdenv = overrideGCC stdenv ccacheWrapper;
+  ccacheStdenv = lowPrio (overrideGCC stdenv ccacheWrapper);
 
   cgdb = callPackage ../development/tools/misc/cgdb { };
 
+  chromedriver = callPackage ../development/tools/selenium/chromedriver { };
+
   complexity = callPackage ../development/tools/misc/complexity { };
 
   ctags = callPackage ../development/tools/misc/ctags { };
@@ -3002,12 +3237,36 @@ let
 
   csslint = callPackage ../development/web/csslint { };
 
+  libcxx = callPackage ../development/libraries/libc++ { stdenv = pkgs.clangStdenv; };
+
   dejagnu = callPackage ../development/tools/misc/dejagnu { };
 
   ddd = callPackage ../development/tools/misc/ddd { };
 
   distcc = callPackage ../development/tools/misc/distcc { };
 
+  # distccWrapper: wrapper that works as gcc or g++
+  # It can be used by setting in nixpkgs config like this, for example:
+  #    replaceStdenv = { pkgs }: pkgs.distccStdenv;
+  # But if you build in chroot, a default 'nix' will create
+  # a new net namespace, and won't have network access.
+  # You can use an override in packageOverrides to set extraConfig:
+  #    packageOverrides = pkgs: {
+  #     distccWrapper = pkgs.distccWrapper.override {
+  #       extraConfig = ''
+  #         DISTCC_HOSTS="myhost1 myhost2"
+  #       '';
+  #     };
+  #
+  distccWrapper = makeOverridable ({ extraConfig ? "" }:
+     wrapGCC (distcc.links extraConfig)) {};
+  distccStdenv = lowPrio (overrideGCC stdenv distccWrapper);
+
+  distccMasquerade = callPackage ../development/tools/misc/distcc/masq.nix {
+    gccRaw = gcc.gcc;
+    binutils = binutils;
+  };
+
   docutils = builderDefsPackage (import ../development/tools/documentation/docutils) {
     inherit python pil makeWrapper;
   };
@@ -3091,6 +3350,8 @@ let
 
   indent = callPackage ../development/tools/misc/indent { };
 
+  ino = callPackage ../development/arduino/ino { };
+
   inotifyTools = callPackage ../development/tools/misc/inotify-tools { };
 
   intelgen4asm = callPackage ../development/misc/intelgen4asm { };
@@ -3121,6 +3382,12 @@ let
 
   mk = callPackage ../development/tools/build-managers/mk { };
 
+  neoload = callPackage ../development/tools/neoload {
+    licenseAccepted = (config.neoload.accept_license or false);
+  };
+
+  ninja = callPackage ../development/tools/build-managers/ninja { };
+
   noweb = callPackage ../development/tools/literate-programming/noweb { };
 
   omake = callPackage ../development/tools/ocaml/omake { };
@@ -3135,45 +3402,62 @@ let
 
   peg = callPackage ../development/tools/parsing/peg { };
 
+  phantomjs = callPackage ../development/tools/phantomjs { };
+
   pmccabe = callPackage ../development/tools/misc/pmccabe { };
 
-  /* Make pkgconfig always return a buildDrv, never a proper hostDrv,
+  /* Make pkgconfig always return a nativeDrv, never a proper crossDrv,
      because most usage of pkgconfig as buildInput (inheritance of
-     pre-cross nixpkgs) means using it using as buildNativeInput
+     pre-cross nixpkgs) means using it using as nativeBuildInput
      cross_renaming: we should make all programs use pkgconfig as
-     buildNativeInput after the renaming.
+     nativeBuildInput after the renaming.
      */
-  pkgconfig = forceBuildDrv (callPackage ../development/tools/misc/pkgconfig { });
-  pkgconfigUpstream = pkgconfig.override { vanilla = true; };
+  pkgconfig = forceNativeDrv (callPackage ../development/tools/misc/pkgconfig { });
+  pkgconfigUpstream = lowPrio (pkgconfig.override { vanilla = true; });
 
-  premake = callPackage ../development/tools/misc/premake { };
+  premake3 = callPackage ../development/tools/misc/premake/3.nix { };
+
+  premake4 = callPackage ../development/tools/misc/premake { };
+
+  premake = premake4;
 
   pstack = callPackage ../development/tools/misc/gdb/pstack.nix { };
 
   radare = callPackage ../development/tools/analysis/radare {
     inherit (gnome) vte;
     lua = lua5;
-    useX11 = getConfig ["radare" "useX11"] false;
-    pythonBindings = getConfig ["radare" "pythonBindings"] false;
-    rubyBindings = getConfig ["radare" "rubyBindings"] false;
-    luaBindings = getConfig ["radare" "luaBindings"] false;
+    useX11 = config.radare.useX11 or false;
+    pythonBindings = config.radare.pythonBindings or false;
+    rubyBindings = config.radare.rubyBindings or false;
+    luaBindings = config.radare.luaBindings or false;
   };
 
   ragel = callPackage ../development/tools/parsing/ragel { };
 
+  re2c = callPackage ../development/tools/parsing/re2c { };
+
   remake = callPackage ../development/tools/build-managers/remake { };
 
+  saleaeLogic = callPackage ../development/tools/misc/saleae-logic { };
+
   # couldn't find the source yet
   seleniumRCBin = callPackage ../development/tools/selenium/remote-control {
     jre = jdk;
   };
 
+  sbt = callPackage ../development/tools/build-managers/sbt { };
+
   scons = callPackage ../development/tools/build-managers/scons { };
 
   simpleBuildTool = callPackage ../development/tools/build-managers/simple-build-tool { };
 
   sloccount = callPackage ../development/tools/misc/sloccount { };
 
+  smatch = callPackage ../development/tools/analysis/smatch {
+    buildllvmsparse = false;
+    buildc2xml = false;
+  };
+
   sparse = callPackage ../development/tools/analysis/sparse { };
 
   spin = callPackage ../development/tools/analysis/spin { };
@@ -3188,11 +3472,16 @@ let
 
   swigWithJava = swig;
 
+  swfmill = callPackage ../tools/video/swfmill { };
+
   swftools = callPackage ../tools/video/swftools { };
 
-  texinfo49 = callPackage ../development/tools/misc/texinfo/4.9.nix { };
+  tcptrack = callPackage ../development/tools/misc/tcptrack { };
 
-  texinfo = callPackage ../development/tools/misc/texinfo { };
+  texinfo413 = callPackage ../development/tools/misc/texinfo/4.13a.nix { };
+  texinfo49 = callPackage ../development/tools/misc/texinfo/4.9.nix { };
+  texinfo5 = callPackage ../development/tools/misc/texinfo/5.1.nix { };
+  texinfo = texinfo413;
 
   texi2html = callPackage ../development/tools/misc/texi2html { };
 
@@ -3203,9 +3492,9 @@ let
     inherit (gnu) mig;
   };
 
-  gdbCross = callPackage ../development/tools/misc/gdb {
+  gdbCross = lowPrio (callPackage ../development/tools/misc/gdb {
     target = crossSystem;
-  };
+  });
 
   valgrind = callPackage ../development/tools/analysis/valgrind {
     stdenv =
@@ -3238,6 +3527,8 @@ let
     stdenv = stdenvMulti;
   };
 
+  activemq = callPackage ../development/libraries/apache-activemq { };
+
   adns = callPackage ../development/libraries/adns { };
 
   afflib = callPackage ../development/libraries/afflib {};
@@ -3296,15 +3587,12 @@ let
   boolstuff = callPackage ../development/libraries/boolstuff { };
 
   boost144 = callPackage ../development/libraries/boost/1.44.nix { };
-  boost146 = callPackage ../development/libraries/boost/1.46.nix { };
-  boost147 = callPackage ../development/libraries/boost/1.47.nix { };
   boost149 = callPackage ../development/libraries/boost/1.49.nix { };
-  boost150 = callPackage ../development/libraries/boost/1.50.nix { };
-  boost = boost150;
+  boost153 = callPackage ../development/libraries/boost/1.53.nix { };
+  boost = boost153;
 
-  boostHeaders149 = callPackage ../development/libraries/boost/1.49-headers.nix { };
-  boostHeaders150 = callPackage ../development/libraries/boost/1.50-headers.nix { };
-  boostHeaders = boostHeaders150;
+  boostHeaders153 = callPackage ../development/libraries/boost/1.53-headers.nix { };
+  boostHeaders = boostHeaders153;
 
   botan = callPackage ../development/libraries/botan { };
 
@@ -3315,9 +3603,9 @@ let
 
   bwidget = callPackage ../development/libraries/bwidget { };
 
-  caelum = callPackage ../development/libraries/caelum { };
+  c-ares = callPackage ../development/libraries/c-ares { };
 
-  cairomm = callPackage ../development/libraries/cairomm { };
+  caelum = callPackage ../development/libraries/caelum { };
 
   scmccid = callPackage ../development/libraries/scmccid { };
 
@@ -3326,6 +3614,7 @@ let
 
   celt = callPackage ../development/libraries/celt {};
   celt_0_7 = callPackage ../development/libraries/celt/0.7.nix {};
+  celt_0_5_1 = callPackage ../development/libraries/celt/0.5.1.nix {};
 
   cgal = callPackage ../development/libraries/CGAL {};
 
@@ -3362,6 +3651,8 @@ let
 
   clppcre = builderDefsPackage (import ../development/libraries/cl-ppcre) { };
 
+  clucene_core_2 = callPackage ../development/libraries/clucene-core/2.x.nix { };
+
   clucene_core = callPackage ../development/libraries/clucene-core { };
 
   cluceneCore = clucene_core; # !!! remove this
@@ -3381,8 +3672,6 @@ let
 
   confuse = callPackage ../development/libraries/confuse { };
 
-  consolekit = callPackage ../development/libraries/consolekit { };
-
   coredumper = callPackage ../development/libraries/coredumper { };
 
   ctl = callPackage ../development/libraries/ctl { };
@@ -3437,8 +3726,12 @@ let
 
   dragonegg = callPackage ../development/compilers/llvm/dragonegg.nix { };
 
+  dxflib = callPackage ../development/libraries/dxflib {};
+
   eigen = callPackage ../development/libraries/eigen {};
 
+  eigen2 = callPackage ../development/libraries/eigen/2.0.nix {};
+
   enchant = callPackage ../development/libraries/enchant { };
 
   enet = callPackage ../development/libraries/enet { };
@@ -3474,13 +3767,19 @@ let
   fcgi = callPackage ../development/libraries/fcgi { };
 
   ffmpeg = callPackage ../development/libraries/ffmpeg {
-    vpxSupport = if !stdenv.isMips then true else false;
+    vpxSupport = !stdenv.isMips;
   };
 
   ffmpeg_0_6_90 = callPackage ../development/libraries/ffmpeg/0.6.90.nix {
-    vpxSupport = if !stdenv.isMips then true else false;
+    vpxSupport = !stdenv.isMips;
   };
 
+  ffmpeg_1 = callPackage ../development/libraries/ffmpeg/1.x.nix {
+    vpxSupport = !stdenv.isMips;
+  };
+
+  ffms = callPackage ../development/libraries/ffms { };
+
   fftw = callPackage ../development/libraries/fftw {
     singlePrecision = false;
   };
@@ -3514,7 +3813,8 @@ let
 
   freealut = callPackage ../development/libraries/freealut { };
 
-  freeglut = callPackage ../development/libraries/freeglut { };
+  freeglut = if stdenv.isDarwin then darwinX11AndOpenGL else
+    callPackage ../development/libraries/freeglut { };
 
   freetype = callPackage ../development/libraries/freetype {
     stdenv = stdenvMulti;
@@ -3545,6 +3845,7 @@ let
   gegl_0_0_22 = callPackage ../development/libraries/gegl/0_0_22.nix {
     #  avocodec avformat librsvg
   };
+
   geoclue = callPackage ../development/libraries/geoclue {};
 
   geoip = builderDefsPackage ../development/libraries/geoip {
@@ -3568,118 +3869,99 @@ let
 
   giblib = callPackage ../development/libraries/giblib { };
 
+  libgit2 = callPackage ../development/libraries/git2 { };
+
   glew = callPackage ../development/libraries/glew { };
 
   glfw = callPackage ../development/libraries/glfw { };
 
-  glibc = glibc213;
-
-  glibcCross = glibc213Cross;
-
-  glibc25 = callPackage ../development/libraries/glibc/2.5 {
-    kernelHeaders = linuxHeaders_2_6_28;
-    installLocales = false;
-  };
-
-  glibc27 = callPackage ../development/libraries/glibc/2.7 {
-    kernelHeaders = linuxHeaders;
-    #installLocales = false;
-  };
+  glibc = glibc217;
 
-  glibc29 = callPackage ../development/libraries/glibc/2.9 {
-    kernelHeaders = linuxHeaders;
-    installLocales = getConfig [ "glibc" "locales" ] false;
-  };
-
-  glibc29Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.9) {
-    inherit stdenv fetchurl;
-    gccCross = gccCrossStageStatic;
-    kernelHeaders = linuxHeadersCross;
-    installLocales = getConfig [ "glibc" "locales" ] false;
-  });
+  glibcCross = glibc217Cross;
 
   glibc213 = (callPackage ../development/libraries/glibc/2.13 {
     kernelHeaders = linuxHeaders;
-    installLocales = getConfig [ "glibc" "locales" ] false;
+    installLocales = config.glibc.locales or false;
     machHeaders = null;
     hurdHeaders = null;
     gccCross = null;
-  }) // (if crossSystem != null then { hostDrv = glibc213Cross; } else {});
+  }) // (if crossSystem != null then { crossDrv = glibc213Cross; } else {});
 
-  glibc213Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.13)
+  glibc213Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.13)
     (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
      in {
        inherit stdenv fetchurl;
        gccCross = gccCrossStageStatic;
        kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross;
-       installLocales = getConfig [ "glibc" "locales" ] false;
+       installLocales = config.glibc.locales or false;
      }
      // lib.optionalAttrs crossGNU {
         inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig;
         inherit fetchgit;
       }));
 
-  glibc214 = (callPackage ../development/libraries/glibc/2.14 {
+  glibc217 = callPackage ../development/libraries/glibc/2.17 {
     kernelHeaders = linuxHeaders;
-    installLocales = getConfig [ "glibc" "locales" ] false;
+    installLocales = config.glibc.locales or false;
     machHeaders = null;
     hurdHeaders = null;
     gccCross = null;
-  }) // (lib.optionalAttrs (crossSystem != null) { hostDrv = glibc214Cross; });
+  };
 
-  glibc214Cross = forceBuildDrv (makeOverridable (import ../development/libraries/glibc/2.14)
-    (let crossGNU = (crossSystem != null && crossSystem.config == "i586-pc-gnu");
+  glibc217Cross = forceNativeDrv (makeOverridable (import ../development/libraries/glibc/2.17)
+    (let crossGNU = crossSystem != null && crossSystem.config == "i586-pc-gnu";
      in {
        inherit stdenv fetchurl;
        gccCross = gccCrossStageStatic;
        kernelHeaders = if crossGNU then gnu.hurdHeaders else linuxHeadersCross;
-       installLocales = getConfig [ "glibc" "locales" ] false;
+       installLocales = config.glibc.locales or false;
      }
      // lib.optionalAttrs crossGNU {
         inherit (gnu) machHeaders hurdHeaders libpthreadHeaders mig;
         inherit fetchgit;
       }));
 
+
   # We can choose:
-  libcCrossChooser = name : if (name == "glibc") then glibcCross
-    else if (name == "uclibc") then uclibcCross
-    else if (name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32") then
+  libcCrossChooser = name : if name == "glibc" then glibcCross
+    else if name == "uclibc" then uclibcCross
+    else if name == "msvcrt" && stdenv.cross.config == "x86_64-w64-mingw32" then
       windows.mingw_w64
-    else if (name == "msvcrt") then windows.mingw_headers3
+    else if name == "msvcrt" then windows.mingw_headers3
     else throw "Unknown libc";
 
   libcCross = assert crossSystem != null; libcCrossChooser crossSystem.libc;
 
   eglibc = callPackage ../development/libraries/eglibc {
     kernelHeaders = linuxHeaders;
-    installLocales = getConfig [ "glibc" "locales" ] false;
+    installLocales = config.glibc.locales or false;
   };
 
-  glibcLocales = callPackage ../development/libraries/glibc/2.13/locales.nix { };
+  glibcLocales = callPackage ../development/libraries/glibc/2.17/locales.nix { };
 
-  glibcInfo = callPackage ../development/libraries/glibc/2.13/info.nix { };
+  glibcInfo = callPackage ../development/libraries/glibc/2.17/info.nix { };
 
   glibc_multi =
-      runCommand "${glibc.name}-multi"
-        { glibc64 = glibc;
-          glibc32 = (import ./all-packages.nix {system = "i686-linux";}).glibc;
-        }
-        ''
-          mkdir -p $out
-          ln -s $glibc64/* $out/
-
-          rm $out/lib $out/lib64
-          mkdir -p $out/lib
-          ln -s $glibc64/lib/* $out/lib
-          ln -s $glibc32/lib $out/lib/32
-          ln -s lib $out/lib64
-
-          rm $out/include
-          cp -rs $glibc32/include $out
-          chmod -R u+w $out/include
-          cp -rsf $glibc64/include $out
-        '' # */
-        ;
+    runCommand "${glibc.name}-multi"
+      { glibc64 = glibc;
+        glibc32 = (import ./all-packages.nix {system = "i686-linux";}).glibc;
+      }
+      ''
+        mkdir -p $out
+        ln -s $glibc64/* $out/
+
+        rm $out/lib $out/lib64
+        mkdir -p $out/lib
+        ln -s $glibc64/lib/* $out/lib
+        ln -s $glibc32/lib $out/lib/32
+        ln -s lib $out/lib64
+
+        rm $out/include
+        cp -rs $glibc32/include $out
+        chmod -R u+w $out/include
+        cp -rsf $glibc64/include $out
+      '' # */
+      ;
 
   glpk = callPackage ../development/libraries/glpk { };
 
@@ -3689,22 +3971,16 @@ let
 
   gmm = callPackage ../development/libraries/gmm { };
 
-  gmp =
-    if stdenv.system == "i686-darwin" then
-      # GMP 4.3.2 is broken on Darwin, so use 4.3.1.
-      callPackage ../development/libraries/gmp/4.3.1.nix { }
-    else
-      callPackage ../development/libraries/gmp/5.0.5.nix { };
+  gmp = gmp5;
 
   gmpxx = appendToName "with-cxx" (gmp.override { cxx = true; });
 
   # The GHC bootstrap binaries link against libgmp.so.3, which is in GMP 4.x.
-  gmp4 =
-    if stdenv.system == "i686-darwin" then
-      # GMP 4.3.2 is broken on Darwin, so use 4.3.1.
-      callPackage ../development/libraries/gmp/4.3.1.nix { }
-    else
-      callPackage ../development/libraries/gmp/4.3.2.nix { };
+  gmp4 = callPackage ../development/libraries/gmp/4.3.2.nix { };
+
+  gmp5 = callPackage ../development/libraries/gmp/5.0.5.nix { };
+
+  gmp51 = callPackage ../development/libraries/gmp/5.1.1.nix { };
 
   gobjectIntrospection = callPackage ../development/libraries/gobject-introspection { };
 
@@ -3714,7 +3990,7 @@ let
     libart = gnome.libart_lgpl;
   };
 
-  goffice_0_9 = callPackage ../development/libraries/goffice/0.9.nix {
+  goffice_0_10 = callPackage ../development/libraries/goffice/0.10.nix {
     inherit (gnome) libglade libgnomeui;
     gconf = gnome.GConf;
     libart = gnome.libart_lgpl;
@@ -3723,7 +3999,7 @@ let
 
   goocanvas = callPackage ../development/libraries/goocanvas { };
 
-  google_perftools = callPackage ../development/libraries/google-perftools { };
+  gperftools = callPackage ../development/libraries/gperftools { };
 
   #GMP ex-satellite, so better keep it near gmp
   mpfr = callPackage ../development/libraries/mpfr { };
@@ -3762,17 +4038,21 @@ let
   };
 
   gnutls = callPackage ../development/libraries/gnutls {
-    guileBindings = getConfig ["gnutls" "guile"] true;
+    guileBindings = config.gnutls.guile or true;
   };
 
   gnutls2 = callPackage ../development/libraries/gnutls/2.12.nix {
-    guileBindings = getConfig ["gnutls" "guile"] true;
+    guileBindings = config.gnutls.guile or true;
   };
 
   gnutls_without_guile = gnutls.override { guileBindings = false; };
   gnutls2_without_guile = gnutls2.override { guileBindings = false; };
 
-  gpgme = callPackage ../development/libraries/gpgme { };
+  gpac = callPackage ../applications/video/gpac { };
+
+  gpgme = callPackage ../development/libraries/gpgme {
+    gnupg1 = gnupg1orig;
+  };
 
   grantlee = callPackage ../development/libraries/grantlee { };
 
@@ -3795,31 +4075,35 @@ let
       gtkmm;
   };
 
-  glib = callPackage ../development/libraries/glib/2.30.x.nix {
+  glib = callPackage ../development/libraries/glib/2.34.x.nix {
     stdenv = stdenvMulti;
   };
 
-  glibmm = callPackage ../development/libraries/glibmm/2.30.x.nix { };
+  glibmm = callPackage ../development/libraries/glibmm { };
 
   glib_networking = callPackage ../development/libraries/glib-networking {};
 
-  atk = callPackage ../development/libraries/atk/2.2.x.nix {
+  atk = callPackage ../development/libraries/atk/2.6.x.nix {
     stdenv = stdenvMulti;
   };
 
-  atkmm = callPackage ../development/libraries/atkmm/2.22.x.nix { };
+  atkmm = callPackage ../development/libraries/atkmm { };
 
   cairo = callPackage ../development/libraries/cairo {
     stdenv = stdenvMulti;
   };
 
-  pango = callPackage ../development/libraries/pango/1.29.x.nix {
+  cairomm = callPackage ../development/libraries/cairomm { };
+
+  cairo_1_12_2 = callPackage ../development/libraries/cairo/1.12.2.nix { };
+
+  pango = callPackage ../development/libraries/pango/1.30.x.nix {
     stdenv = stdenvMulti;
   };
 
   pangomm = callPackage ../development/libraries/pangomm/2.28.x.nix { };
 
-  gdk_pixbuf = callPackage ../development/libraries/gdk-pixbuf/2.24.x.nix {
+  gdk_pixbuf = callPackage ../development/libraries/gdk-pixbuf/2.26.x.nix {
     stdenv = stdenvMulti;
   };
 
@@ -3827,12 +4111,12 @@ let
     stdenv = stdenvMulti;
   };
 
-  gtk = pkgs.gtk2;
+  gtk3 = lowPrio (callPackage ../development/libraries/gtk+/3.2.x.nix { });
 
-  gtkmm = callPackage ../development/libraries/gtkmm/2.24.x.nix { };
-  gtkmm3 = callPackage ../development/libraries/gtkmm/3.2.x.nix { };
+  gtk = pkgs.gtk2;
 
-  gtk3 = lowPrio (callPackage ../development/libraries/gtk+/3.2.x.nix { });
+  gtkmm = callPackage ../development/libraries/gtkmm/2.x.nix { };
+  gtkmm3 = callPackage ../development/libraries/gtkmm/3.x.nix { };
 
   gtkmozembedsharp = callPackage ../development/libraries/gtkmozembed-sharp {
     gtksharp = gtksharp2;
@@ -3859,15 +4143,19 @@ let
 
   gts = callPackage ../development/libraries/gts { };
 
+  gvfs = callPackage ../development/libraries/gvfs { };
+
   gwenhywfar = callPackage ../development/libraries/gwenhywfar { };
 
   # TODO : Add MIT Kerberos and let admin choose.
   kerberos = heimdal;
 
-  hawknl = callPackage ../development/libraries/hawknl { };
-
   heimdal = callPackage ../development/libraries/kerberos/heimdal.nix { };
 
+  harfbuzz = callPackage ../development/libraries/harfbuzz { };
+
+  hawknl = callPackage ../development/libraries/hawknl { };
+
   herqq = callPackage ../development/libraries/herqq { };
 
   hspell = callPackage ../development/libraries/hspell { };
@@ -3876,6 +4164,8 @@ let
 
   hsqldb = callPackage ../development/libraries/java/hsqldb { };
 
+  http_parser = callPackage ../development/libraries/http_parser { inherit (pythonPackages) gyp; };
+
   hunspell = callPackage ../development/libraries/hunspell { };
 
   hwloc = callPackage ../development/libraries/hwloc {
@@ -3912,7 +4202,10 @@ let
 
   iniparser = callPackage ../development/libraries/iniparser { };
 
+  inteltbb = callPackage ../development/libraries/intel-tbb { };
+
   intltool = gnome.intltool;
+  intltool_standalone = callPackage ../development/tools/misc/intltool {};
 
   irrlicht3843 = callPackage ../development/libraries/irrlicht { };
 
@@ -3928,6 +4221,8 @@ let
 
   jama = callPackage ../development/libraries/jama { };
 
+  jansson = callPackage ../development/libraries/jansson { };
+
   jbig2dec = callPackage ../development/libraries/jbig2dec { };
 
   jetty_gwt = callPackage ../development/libraries/java/jetty-gwt { };
@@ -3956,6 +4251,8 @@ let
 
   lesstif93 = callPackage ../development/libraries/lesstif-0.93 { };
 
+  leveldb = callPackage ../development/libraries/leveldb { };
+
   levmar = callPackage ../development/libraries/levmar { };
 
   leptonica = callPackage ../development/libraries/leptonica { };
@@ -3967,7 +4264,7 @@ let
   libaal = callPackage ../development/libraries/libaal { };
 
   libao = callPackage ../development/libraries/libao {
-    usePulseAudio = getConfig [ "pulseaudio" ] true;
+    usePulseAudio = config.pulseaudio or true;
   };
 
   libarchive = callPackage ../development/libraries/libarchive { };
@@ -3988,16 +4285,22 @@ let
 
   libbluray = callPackage ../development/libraries/libbluray { };
 
+  libbs2b = callPackage ../development/libraries/audio/libbs2b { };
+
   libcaca = callPackage ../development/libraries/libcaca { };
 
   libcanberra = callPackage ../development/libraries/libcanberra { };
 
+  libcello = callPackage ../development/libraries/libcello {};
+
   libcdaudio = callPackage ../development/libraries/libcdaudio { };
 
   libcddb = callPackage ../development/libraries/libcddb { };
 
   libcdio = callPackage ../development/libraries/libcdio { };
 
+  libcdr = callPackage ../development/libraries/libcdr { };
+
   libchamplain = callPackage ../development/libraries/libchamplain {
     inherit (gnome) libsoup;
   };
@@ -4060,6 +4363,10 @@ let
 
   libdvdread = callPackage ../development/libraries/libdvdread { };
 
+  libdwarf = callPackage ../development/libraries/libdwarf { };
+
+  libeatmydata = callPackage ../development/libraries/libeatmydata { };
+
   libebml = callPackage ../development/libraries/libebml { };
 
   libedit = callPackage ../development/libraries/libedit { };
@@ -4082,13 +4389,13 @@ let
 
   liblo = callPackage ../development/libraries/liblo { };
 
-  liblrdf = callPackage ../development/libraries/liblrdf {};
+  liblrdf = librdf;
 
   liblscp = callPackage ../development/libraries/liblscp { };
 
-  libev = builderDefsPackage ../development/libraries/libev {
-  };
+  libev = builderDefsPackage ../development/libraries/libev { };
 
+  libevent14 = callPackage ../development/libraries/libevent/1.4.nix { };
   libevent = callPackage ../development/libraries/libevent { };
 
   libewf = callPackage ../development/libraries/libewf { };
@@ -4101,6 +4408,8 @@ let
     libmpeg2 = mpeg2dec;
   };
 
+  libexttextcat = callPackage ../development/libraries/libexttextcat {};
+
   libf2c = callPackage ../development/libraries/libf2c {};
 
   libfixposix = callPackage ../development/libraries/libfixposix {};
@@ -4115,12 +4424,16 @@ let
 
   libgcrypt = callPackage ../development/libraries/libgcrypt { };
 
+  libgcrypt_git = lowPrio (callPackage ../development/libraries/libgcrypt/git.nix { });
+
   libgdiplus = callPackage ../development/libraries/libgdiplus { };
 
   libgpgerror = callPackage ../development/libraries/libgpg-error { };
 
   libgphoto2 = callPackage ../development/libraries/libgphoto2 { };
 
+  libgphoto2_4 = callPackage ../development/libraries/libgphoto2/2.4.nix { };
+
   libgpod = callPackage ../development/libraries/libgpod {
     inherit (pkgs.pythonPackages) mutagen;
   };
@@ -4134,7 +4447,7 @@ let
   libimobiledevice = callPackage ../development/libraries/libimobiledevice { };
 
   libiodbc = callPackage ../development/libraries/libiodbc {
-    useGTK = getConfig [ "libiodbc" "gtk" ] false;
+    useGTK = config.libiodbc.gtk or false;
   };
 
   liblastfmSF = callPackage ../development/libraries/liblastfmSF { };
@@ -4143,6 +4456,10 @@ let
 
   liblqr1 = callPackage ../development/libraries/liblqr-1 { };
 
+  liblockfile = callPackage ../development/libraries/liblockfile { };
+
+  libmcrypt = callPackage ../development/libraries/libmcrypt {};
+
   libmhash = callPackage ../development/libraries/libmhash {};
 
   libmtp = callPackage ../development/libraries/libmtp { };
@@ -4157,6 +4474,9 @@ let
 
   libQGLViewer = callPackage ../development/libraries/libqglviewer { };
 
+  libre = callPackage ../development/libraries/libre {};
+  librem = callPackage ../development/libraries/librem {};
+
   libsamplerate = callPackage ../development/libraries/libsamplerate {
     stdenv = stdenvMulti;
   };
@@ -4169,14 +4489,17 @@ let
 
   libiconv = callPackage ../development/libraries/libiconv { };
 
-  libiconvOrEmpty = if (libiconvOrNull == null) then [] else [libiconv];
+  libiconvOrEmpty = if libiconvOrNull == null then [] else [libiconv];
 
   libiconvOrNull =
-    if ((gcc ? libc && (gcc.libc != null)) || stdenv.isGlibc)
+    if gcc.libc or null != null || stdenv.isGlibc
     then null
     else libiconv;
 
-  libiconvOrLibc = if (libiconvOrNull == null) then gcc.libc else libiconv;
+  libiconvOrLibc = if libiconvOrNull == null then gcc.libc else libiconv;
+
+  # On non-GNU systems we need GNU Gettext for libintl.
+  libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux) gettext;
 
   libid3tag = callPackage ../development/libraries/libid3tag { };
 
@@ -4212,6 +4535,8 @@ let
 
   libmcs = callPackage ../development/libraries/libmcs { };
 
+  libmemcached = callPackage ../development/libraries/libmemcached { };
+
   libmicrohttpd = callPackage ../development/libraries/libmicrohttpd { };
 
   libmikmod = callPackage ../development/libraries/libmikmod { };
@@ -4224,6 +4549,8 @@ let
 
   libmng = callPackage ../development/libraries/libmng { };
 
+  libmnl = callPackage ../development/libraries/libmnl { };
+
   libmodplug = callPackage ../development/libraries/libmodplug {};
 
   libmpcdec = callPackage ../development/libraries/libmpcdec { };
@@ -4242,6 +4569,10 @@ let
 
   libmusicbrainz = libmusicbrainz3;
 
+  libnetfilter_conntrack = callPackage ../development/libraries/libnetfilter_conntrack { };
+
+  libnfnetlink = callPackage ../development/libraries/libnfnetlink { };
+
   libnih = callPackage ../development/libraries/libnih { };
 
   libnova = callPackage ../development/libraries/libnova { };
@@ -4262,10 +4593,14 @@ let
 
   liboop = callPackage ../development/libraries/liboop { };
 
+  libopus = callPackage ../development/libraries/libopus { };
+
   libosip = callPackage ../development/libraries/osip {};
 
   libotr = callPackage ../development/libraries/libotr { };
 
+  libotr_3_2 = callPackage ../development/libraries/libotr/3.2.nix { };
+
   libp11 = callPackage ../development/libraries/libp11 { };
 
   libpar2 = callPackage ../development/libraries/libpar2 { };
@@ -4333,15 +4668,17 @@ let
 
   libungif = callPackage ../development/libraries/giflib/libungif.nix { };
 
+  libunique = callPackage ../development/libraries/libunique/default.nix { };
+
   libusb = callPackage ../development/libraries/libusb { };
 
   libusb1 = callPackage ../development/libraries/libusb1 { };
 
   libunwind = callPackage ../development/libraries/libunwind { };
 
-  libv4l = v4l_utils.override {
+  libv4l = lowPrio (v4l_utils.override {
     withQt4 = false;
-  };
+  });
 
   libva = callPackage ../development/libraries/libva { };
 
@@ -4349,6 +4686,8 @@ let
 
   libvirt = callPackage ../development/libraries/libvirt { };
 
+  libvisio = callPackage ../development/libraries/libvisio { };
+
   libvncserver = builderDefsPackage (import ../development/libraries/libvncserver) {
     inherit libtool libjpeg openssl zlib;
     inherit (xlibs) xproto libX11 damageproto libXdamage
@@ -4381,8 +4720,6 @@ let
 
   libx86 = builderDefsPackage ../development/libraries/libx86 {};
 
-  libxcrypt = callPackage ../development/libraries/libxcrypt { };
-
   libxdg_basedir = callPackage ../development/libraries/libxdg-basedir { };
 
   libxklavier = callPackage ../development/libraries/libxklavier { };
@@ -4393,14 +4730,16 @@ let
     pythonSupport = false;
   };
 
-  libxml2Python = libxml2.override {
+  libxml2Python = lowPrio (libxml2.override {
     pythonSupport = true;
-  };
+  });
 
   libxmlxx = callPackage ../development/libraries/libxmlxx { };
 
   libxslt = callPackage ../development/libraries/libxslt { };
 
+  libxtc_dxtn = callPackage ../development/libraries/libxtc_dxtn { };
+
   libixp_for_wmii = lowPrio (import ../development/libraries/libixp_for_wmii {
     inherit fetchurl stdenv;
   });
@@ -4429,6 +4768,8 @@ let
    guile = guile_1_8;
   };
 
+  log4cpp = callPackage ../development/libraries/log4cpp { };
+
   log4cxx = callPackage ../development/libraries/log4cxx { };
 
   log4cplus = callPackage ../development/libraries/log4cplus { };
@@ -4437,16 +4778,17 @@ let
 
   lzo = callPackage ../development/libraries/lzo { };
 
+  mdds = callPackage ../development/libraries/mdds { };
+
   # failed to build
   mediastreamer = callPackage ../development/libraries/mediastreamer { };
 
-  mesaSupported =
-    system == "i686-linux" ||
-    system == "x86_64-linux" ||
-    system == "x86_64-darwin" ||
-    system == "i686-darwin";
+  mesaSupported = lib.elem system lib.platforms.mesaPlatforms;
+
+  darwinX11AndOpenGL = callPackage ../os-specific/darwin/native-x11-and-opengl { };
 
-  mesa = callPackage ../development/libraries/mesa { };
+  mesa = if stdenv.isDarwin then darwinX11AndOpenGL else
+    callPackage ../development/libraries/mesa { };
 
   metaEnvironment = recurseIntoAttrs (let callPackage = newScope pkgs.metaEnvironment; in rec {
     sdfLibrary    = callPackage ../development/libraries/sdf-library { aterm = aterm28; };
@@ -4469,7 +4811,9 @@ let
 
   mkvtoolnix = callPackage ../applications/video/mkvtoolnix { };
 
-  mlt = callPackage ../development/libraries/mlt { };
+  mlt = callPackage ../development/libraries/mlt {
+    ffmpeg = ffmpeg_1;
+  };
 
   libmpeg2 = callPackage ../development/libraries/libmpeg2 { };
 
@@ -4485,6 +4829,8 @@ let
 
   mtdev = callPackage ../development/libraries/mtdev { };
 
+  mu = callPackage ../tools/networking/mu { };
+
   muparser = callPackage ../development/libraries/muparser { };
 
   mygui = callPackage ../development/libraries/mygui {};
@@ -4493,6 +4839,8 @@ let
 
   mysocketw = callPackage ../development/libraries/mysocketw { };
 
+  mythes = callPackage ../development/libraries/mythes { };
+
   ncurses = makeOverridable (import ../development/libraries/ncurses) {
     inherit fetchurl;
     unicode = system != "i686-cygwin";
@@ -4505,19 +4853,7 @@ let
       else stdenv;
   };
 
-  neon = neon029;
-
-  neon026 = callPackage ../development/libraries/neon/0.26.nix {
-    compressionSupport = true;
-    sslSupport = true;
-  };
-
-  neon028 = callPackage ../development/libraries/neon/0.28.nix {
-    compressionSupport = true;
-    sslSupport = true;
-  };
-
-  neon029 = callPackage ../development/libraries/neon/0.29.nix {
+  neon = callPackage ../development/libraries/neon {
     compressionSupport = true;
     sslSupport = true;
   };
@@ -4532,7 +4868,7 @@ let
 
   nspr = callPackage ../development/libraries/nspr { };
 
-  nss = callPackage ../development/libraries/nss { };
+  nss = lowPrio (callPackage ../development/libraries/nss { });
 
   nssTools = callPackage ../development/libraries/nss {
     includeTools = true;
@@ -4540,13 +4876,14 @@ let
 
   ntrack = callPackage ../development/libraries/ntrack { };
 
-  ode = builderDefsPackage (import ../development/libraries/ode) {
-  };
+  ode = builderDefsPackage (import ../development/libraries/ode) { };
 
   ogre = callPackage ../development/libraries/ogre {};
 
   ogrepaged = callPackage ../development/libraries/ogrepaged { };
 
+  oniguruma = callPackage ../development/libraries/oniguruma { };
+
   openal = callPackage ../development/libraries/openal { };
 
   # added because I hope that it has been easier to compile on x86 (for blender)
@@ -4554,11 +4891,15 @@ let
 
   openbabel = callPackage ../development/libraries/openbabel { };
 
-  opencascade = callPackage ../development/libraries/opencascade {
+  opencascade = callPackage ../development/libraries/opencascade { };
+
+  opencascade_6_5 = callPackage ../development/libraries/opencascade/6.5.nix {
     automake = automake111x;
     ftgl = ftgl212;
   };
 
+  opencascade_oce = callPackage ../development/libraries/opencascade/oce.nix { };
+
   opencsg = callPackage ../development/libraries/opencsg { };
 
   openct = callPackage ../development/libraries/openct { };
@@ -4579,16 +4920,14 @@ let
 
   openldap = callPackage ../development/libraries/openldap { };
 
-  openlierox = builderDefsPackage ../games/openlierox {
-    inherit (xlibs) libX11 xproto;
-    inherit gd SDL SDL_image SDL_mixer zlib libxml2
-      pkgconfig;
-  };
+  openlierox = callPackage ../games/openlierox { };
 
   libopensc_dnie = callPackage ../development/libraries/libopensc-dnie {
     opensc = opensc_0_11_7;
   };
 
+  opencolorio = callPackage ../development/libraries/opencolorio { };
+
   ois = callPackage ../development/libraries/ois {};
 
   opal = callPackage ../development/libraries/opal {};
@@ -4599,6 +4938,10 @@ let
 
   openssl = callPackage ../development/libraries/openssl {
     fetchurl = fetchurlBoot;
+    cryptodevHeaders = linuxPackages.cryptodev.override {
+      fetchurl = fetchurlBoot;
+      onlyHeaders = true;
+    };
   };
 
   ortp = callPackage ../development/libraries/ortp { };
@@ -4607,18 +4950,18 @@ let
 
   pangoxsl = callPackage ../development/libraries/pangoxsl { };
 
-  pcre = callPackage ../development/libraries/pcre {
-    unicodeSupport = getConfig ["pcre" "unicode"] true;
-    cplusplusSupport = !stdenv ? isDietLibC;
+  pcl = callPackage ../development/libraries/pcl {
+    vtk = vtkWithQt4;
   };
 
-  pcre_8_30 = callPackage ../development/libraries/pcre/8.30.nix {
-    unicodeSupport = getConfig ["pcre" "unicode"] true;
-    cplusplusSupport = !stdenv ? isDietLibC;
+  pcre = callPackage ../development/libraries/pcre {
+    unicodeSupport = config.pcre.unicode or true;
   };
 
   pdf2xml = callPackage ../development/libraries/pdf2xml {} ;
 
+  pdf2htmlex = callPackage ../development/libraries/pdf2htmlex {} ;
+
   phonon = callPackage ../development/libraries/phonon { };
 
   phonon_backend_gstreamer = callPackage ../development/libraries/phonon-backend-gstreamer { };
@@ -4627,6 +4970,8 @@ let
 
   physfs = callPackage ../development/libraries/physfs { };
 
+  pkcs11helper = callPackage ../development/libraries/pkcs11helper { };
+
   plib = callPackage ../development/libraries/plib { };
 
   pocketsphinx = callPackage ../development/libraries/pocketsphinx { };
@@ -4662,6 +5007,8 @@ let
 
   protobuf = callPackage ../development/libraries/protobuf { };
 
+  protobufc = callPackage ../development/libraries/protobufc { };
+
   pth = callPackage ../development/libraries/pth { };
 
   ptlib = callPackage ../development/libraries/ptlib {};
@@ -4674,28 +5021,25 @@ let
 
   qjson = callPackage ../development/libraries/qjson { };
 
+  qoauth = callPackage ../development/libraries/qoauth { };
+
   qt3 = callPackage ../development/libraries/qt-3 {
     openglSupport = mesaSupported;
   };
 
   qt4 = pkgs.kde4.qt4;
 
-  qt47 = callPackage ../development/libraries/qt-4.x/4.7 { };
-
   qt48 = callPackage ../development/libraries/qt-4.x/4.8 {
     # GNOME dependencies are not used unless gtkStyle == true
     inherit (pkgs.gnome) libgnomeui GConf gnome_vfs;
   };
 
-  qt4_for_skype = qt48.override {
-    mysql = null;
-    postgresql = null;
-    libtiff = null;
-    libmng = null;
-    cups = null;
-    flashplayerFix = false;
-    gstreamer = null;
-    gst_plugins_base = null;
+  qt48Full = callPackage ../development/libraries/qt-4.x/4.8 {
+    # GNOME dependencies are not used unless gtkStyle == true
+    inherit (pkgs.gnome) libgnomeui GConf gnome_vfs;
+    docs = true;
+    demos = true;
+    examples = true;
   };
 
   qtscriptgenerator = callPackage ../development/libraries/qtscriptgenerator { };
@@ -4777,7 +5121,7 @@ let
 
   silgraphite = callPackage ../development/libraries/silgraphite {};
 
-  simgear = callPackage ../development/libraries/simgear {};
+  simgear = callPackage ../development/libraries/simgear { };
 
   sfml_git = callPackage ../development/libraries/sfml { };
 
@@ -4793,6 +5137,10 @@ let
         # optional
   };
 
+  snappy = callPackage ../development/libraries/snappy { };
+
+  sodium = callPackage ../development/libraries/sodium {};
+
   sofia_sip = callPackage ../development/libraries/sofia-sip { };
 
   soprano = callPackage ../development/libraries/soprano { };
@@ -4801,6 +5149,8 @@ let
 
   sord = callPackage ../development/libraries/sord {};
 
+  spandsp = callPackage ../development/libraries/spandsp {};
+
   speechd = callPackage ../development/libraries/speechd { };
 
   speech_tools = callPackage ../development/libraries/speech-tools {};
@@ -4811,28 +5161,40 @@ let
 
   sphinxbase = callPackage ../development/libraries/sphinxbase { };
 
+  spice = callPackage ../development/libraries/spice {
+    celt = celt_0_5_1;
+    inherit (xlibs) libXrandr libXfixes libXext libXrender libXinerama;
+    inherit (pythonPackages) pyparsing;
+  };
+
+  spice_protocol = callPackage ../development/libraries/spice-protocol { };
+
   sratom = callPackage ../development/libraries/audio/sratom { };
 
   srtp = callPackage ../development/libraries/srtp {};
 
-  sqlite = lowPrio (callPackage ../development/libraries/sqlite {
+  sqlite_3_7_16 = lowPrio (callPackage ../development/libraries/sqlite/3.7.16.nix {
     readline = null;
     ncurses = null;
   });
 
-  sqlite36 = callPackage ../development/libraries/sqlite/3.6.x.nix {
+  sqlite_3_7_14 = lowPrio (callPackage ../development/libraries/sqlite/3.7.14.nix {
     readline = null;
     ncurses = null;
-  };
+  });
+
+  sqlite = sqlite_3_7_16;
 
   sqliteInteractive = appendToName "interactive" (sqlite.override {
     inherit readline ncurses;
   });
 
-  sqliteFull = lowPrio (callPackage ../development/libraries/sqlite/full.nix {
+  sqliteFull = lowPrio (callPackage ../development/libraries/sqlite/3.7.9-full.nix {
     inherit readline ncurses;
   });
 
+  stlink = callPackage ../development/tools/misc/stlink { };
+
   stlport = callPackage ../development/libraries/stlport { };
 
   strigi = callPackage ../development/libraries/strigi {};
@@ -4855,12 +5217,12 @@ let
 
   tclap = callPackage ../development/libraries/tclap {};
 
+  tclgpg = callPackage ../development/libraries/tclgpg { };
+
   tcllib = callPackage ../development/libraries/tcllib { };
 
   tcltls = callPackage ../development/libraries/tcltls { };
 
-  tcp_wrappers = callPackage ../development/libraries/tcp-wrappers {};
-
   tdb = callPackage ../development/libraries/tdb { };
 
   tecla = callPackage ../development/libraries/tecla { };
@@ -4871,6 +5233,10 @@ let
 
   telepathy_qt = callPackage ../development/libraries/telepathy/qt { };
 
+  tinyxml = tinyxml2;
+
+  tinyxml2 = callPackage ../development/libraries/tinyxml/2.6.2.nix { };
+
   tk = callPackage ../development/libraries/tk { };
 
   tnt = callPackage ../development/libraries/tnt { };
@@ -4882,6 +5248,8 @@ let
 
   unicap = callPackage ../development/libraries/unicap {};
 
+  tsocks = callPackage ../development/libraries/tsocks { };
+
   unixODBC = callPackage ../development/libraries/unixODBC { };
 
   unixODBCDrivers = recurseIntoAttrs (import ../development/libraries/unixODBCDrivers {
@@ -4895,6 +5263,10 @@ let
 
   ucommon = callPackage ../development/libraries/ucommon { };
 
+  vaapiIntel = callPackage ../development/libraries/vaapi-intel { };
+
+  vaapiVdpau = callPackage ../development/libraries/vaapi-vdpau { };
+
   vamp = callPackage ../development/libraries/audio/vamp { };
 
   vcdimager = callPackage ../development/libraries/vcdimager { };
@@ -4911,41 +5283,35 @@ let
 
   vtk = callPackage ../development/libraries/vtk { };
 
+  vtkWithQt4 = vtk.override { useQt4 = true; };
+
   vxl = callPackage ../development/libraries/vxl {
     libpng = libpng12;
   };
 
+  wayland = callPackage ../development/libraries/wayland { };
+
   webkit =
     builderDefsPackage ../development/libraries/webkit {
+      inherit gtk2; # for plugins etc. even with gtk3, see Gentoo ebuild
+      inherit gtk3 glib atk cairo pango fontconfig freetype;
       inherit (gnome) gtkdoc libsoup;
-      inherit atk pango glib;
-      gtk = gtk3;
-      inherit freetype fontconfig gettext gperf curl
-        libjpeg libtiff libxml2 libxslt sqlite
-        icu cairo intltool automake libtool
-        pkgconfig autoconf bison libproxy enchant
-        python ruby which flex geoclue;
-      inherit gstreamer gst_plugins_base gst_ffmpeg
-        gst_plugins_good;
-      inherit (xlibs) libXt renderproto libXrender kbproto;
-      libpng = libpng12;
-      perl = perl510;
+      inherit pkgconfig libtool intltool autoconf automake gperf bison flex
+        libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+        which libproxy geoclue enchant python ruby perl
+        mesa xlibs;
+      inherit gstreamer gst_plugins_base gst_ffmpeg gst_plugins_good;
     };
 
   webkit_gtk2 =
     builderDefsPackage ../development/libraries/webkit/gtk2.nix {
+      inherit gtk2 glib atk cairo pango fontconfig freetype;
       inherit (gnome) gtkdoc libsoup;
-      inherit gtk atk pango glib;
-      inherit freetype fontconfig gettext gperf curl
-        libjpeg libtiff libxml2 libxslt sqlite
-        icu cairo intltool automake libtool
-        pkgconfig autoconf bison libproxy enchant
-        python ruby which flex geoclue;
-      inherit gstreamer gst_plugins_base gst_ffmpeg
-        gst_plugins_good;
-      inherit (xlibs) libXt renderproto libXrender;
-      libpng = libpng12;
-      perl = perl510;
+      inherit pkgconfig libtool intltool autoconf automake gperf bison flex
+        libjpeg libpng libtiff libxml2 libxslt sqlite icu curl
+        which libproxy geoclue enchant python ruby perl
+        mesa xlibs;
+      inherit gstreamer gst_plugins_base gst_ffmpeg gst_plugins_good;
     };
 
   webkitSVN =
@@ -4960,9 +5326,11 @@ let
       inherit gstreamer gst_plugins_base gst_ffmpeg
         gst_plugins_good;
       inherit (xlibs) libXt renderproto libXrender;
-      libpng = libpng12;
+      inherit libpng;
     };
 
+  wildmidi = callPackage ../development/libraries/wildmidi { };
+
   wvstreams = callPackage ../development/libraries/wvstreams { };
 
   wxGTK = wxGTK28;
@@ -5029,19 +5397,18 @@ let
     fetchurl = fetchurlBoot;
   };
 
-  zlibStatic = lowPrio (appendToName "static" (import ../development/libraries/zlib {
-    inherit fetchurl stdenv;
+  zlibStatic = lowPrio (appendToName "static" (callPackage ../development/libraries/zlib {
     static = true;
   }));
 
-  zeromq = callPackage ../development/libraries/zeromq {};
+  zeromq2 = callPackage ../development/libraries/zeromq/2.x.nix {};
+  zeromq3 = callPackage ../development/libraries/zeromq/3.x.nix {};
 
-  ### DEVELOPMENT / LIBRARIES / JAVA
 
+  ### DEVELOPMENT / LIBRARIES / JAVA
 
   atermjava = callPackage ../development/libraries/java/aterm {
     stdenv = overrideInStdenv stdenv [gnumake380];
-
   };
 
   commonsFileUpload = callPackage ../development/libraries/java/jakarta-commons/file-upload { };
@@ -5103,6 +5470,8 @@ let
     jvm    = gcj;
     xerces = xercesJava;  };
 
+  xmlsec = callPackage ../development/libraries/xmlsec { };
+
   zziplib = callPackage ../development/libraries/zziplib { };
 
 
@@ -5110,12 +5479,14 @@ let
 
   jquery_ui = callPackage ../development/libraries/javascript/jquery-ui { };
 
+
   ### DEVELOPMENT / PERL MODULES
 
   buildPerlPackage = import ../development/perl-modules/generic perl;
 
   perlPackages = recurseIntoAttrs (import ./perl-packages.nix {
     inherit pkgs;
+    __overrides = (config.perlPackageOverrides or (p: {})) pkgs;
   });
 
   perl510Packages = import ./perl-packages.nix {
@@ -5123,6 +5494,7 @@ let
       perl = perl510;
       buildPerlPackage = import ../development/perl-modules/generic perl510;
     };
+    __overrides = (config.perl510PackageOverrides or (p: {})) pkgs;
   };
 
   perlXMLParser = perlPackages.XMLParser;
@@ -5138,29 +5510,50 @@ let
 
   pythonPackages = python27Packages;
 
+  # `nix-env -i python-nose` installs for 2.7, the default python.
+  # Therefore we do not recurse into attributes here, in contrast to
+  # python27Packages. `nix-env -iA python26Packages.nose` works
+  # regardless.
   python26Packages = import ./python-packages.nix {
     inherit pkgs;
+    inherit (lib) lowPrio;
     python = python26;
   };
 
   python27Packages = recurseIntoAttrs (import ./python-packages.nix {
     inherit pkgs;
+    inherit (lib) lowPrio;
     python = python27;
   });
 
+  plone41Packages = recurseIntoAttrs (import ../development/web/plone/4.1.6.nix {
+    inherit pkgs;
+    pythonPackages = python27Packages;
+  });
+
+  plone42Packages = recurseIntoAttrs (import ../development/web/plone/4.2.5.nix {
+    inherit pkgs;
+    pythonPackages = python27Packages;
+  });
+
+  plone43Packages = recurseIntoAttrs (import ../development/web/plone/4.3.0.nix {
+    inherit pkgs;
+    pythonPackages = python27Packages;
+  });
+
   foursuite = callPackage ../development/python-modules/4suite { };
 
   bsddb3 = callPackage ../development/python-modules/bsddb3 { };
 
   numeric = callPackage ../development/python-modules/numeric { };
 
-  pil = callPackage ../development/python-modules/pil { };
+  pil = pythonPackages.pil;
 
   psyco = callPackage ../development/python-modules/psyco { };
 
-  pycairo = callPackage ../development/python-modules/pycairo { };
+  pycairo = pythonPackages.pycairo;
 
-  pycrypto = callPackage ../development/python-modules/pycrypto { };
+  pycrypto = pythonPackages.pycrypto;
 
   pycups = callPackage ../development/python-modules/pycups { };
 
@@ -5168,13 +5561,13 @@ let
 
   pygame = callPackage ../development/python-modules/pygame { };
 
-  pygobject = callPackage ../development/python-modules/pygobject { };
+  pygobject = pythonPackages.pygobject;
 
-  pygtk = callPackage ../development/python-modules/pygtk { };
+  pygobject3 = pythonPackages.pygobject3;
 
-  pyGtkGlade = callPackage ../development/python-modules/pygtk {
-    inherit (gnome) libglade;
-  };
+  pygtk = pythonPackages.pygtk;
+
+  pyGtkGlade = pythonPackages.pyGtkGlade;
 
   pyopenssl = builderDefsPackage (import ../development/python-modules/pyopenssl) {
     inherit python openssl;
@@ -5207,13 +5600,7 @@ let
 
   twisted = pythonPackages.twisted;
 
-  ZopeInterface = pythonPackages.zopeInterface;
-
-  /*
-  zope = callPackage ../development/python-modules/zope {
-    python = python24;
-  };
-  */
+  ZopeInterface = pythonPackages.zope_interface;
 
 
   ### SERVERS
@@ -5252,10 +5639,11 @@ let
     inherit stdenv lib dict;
   };
 
+  dictdWiktionary = callPackage ../servers/dict/dictd-wiktionary.nix {};
+
+  dictdWordnet = callPackage ../servers/dict/dictd-wordnet.nix {};
+
   dovecot = callPackage ../servers/mail/dovecot { };
-  dovecot_1_1_1 = callPackage ../servers/mail/dovecot/1.1.1.nix { };
-  dovecot_2 = callPackage ../servers/mail/dovecot/2.x.nix { };
-  dovecot_2_0 = pkgs.dovecot_2; # Actually, 2.1
 
   ejabberd = callPackage ../servers/xmpp/ejabberd { };
 
@@ -5314,6 +5702,10 @@ let
 
   nginx = callPackage ../servers/http/nginx { };
 
+  petidomo = callPackage ../servers/mail/petidomo { };
+
+  popa3d = callPackage ../servers/mail/popa3d { };
+
   postfix = callPackage ../servers/mail/postfix { };
 
   pulseaudio = callPackage ../servers/pulseaudio {
@@ -5335,10 +5727,7 @@ let
 
   #monetdb = callPackage ../servers/sql/monetdb { };
 
-  mongodb = callPackage ../servers/nosql/mongodb {
-    boost = boost149;
-    useV8 = (getConfig ["mongodb" "useV8"] false);
-  };
+  mongodb = callPackage ../servers/nosql/mongodb { };
 
   mysql4 = import ../servers/sql/mysql {
     inherit fetchurl stdenv ncurses zlib perl;
@@ -5365,6 +5754,8 @@ let
     gdSupport = true;
   };
 
+  munin = callPackage ../servers/monitoring/munin { };
+
   nagiosPluginsOfficial = callPackage ../servers/monitoring/nagios/plugins/official { };
 
   net_snmp = callPackage ../servers/monitoring/net-snmp { };
@@ -5373,9 +5764,11 @@ let
 
   openfire = callPackage ../servers/xmpp/openfire { };
 
+  oracleXE = callPackage ../servers/sql/oracle-xe { };
+
   OVMF = callPackage ../applications/virtualization/OVMF { };
 
-  postgresql = postgresql83;
+  postgresql = postgresql92;
 
   postgresql83 = callPackage ../servers/sql/postgresql/8.3.x.nix { };
 
@@ -5385,8 +5778,12 @@ let
 
   postgresql91 = callPackage ../servers/sql/postgresql/9.1.x.nix { };
 
+  postgresql92 = callPackage ../servers/sql/postgresql/9.2.x.nix { };
+
   postgresql_jdbc = callPackage ../servers/sql/postgresql/jdbc { };
 
+  psqlodbc = callPackage ../servers/sql/postgresql/psqlodbc { };
+
   pyIRCt = builderDefsPackage (import ../servers/xmpp/pyIRCt) {
     inherit xmpppy pythonIRClib python makeWrapper;
   };
@@ -5399,28 +5796,34 @@ let
 
   radius = callPackage ../servers/radius { };
 
-  redis = callPackage ../servers/nosql/redis { };
+  redis = callPackage ../servers/nosql/redis {
+    stdenv =
+      if stdenv.isDarwin
+      then overrideGCC stdenv gccApple
+      else stdenv;
+  };
 
   redstore = callPackage ../servers/http/redstore { };
 
+  restund = callPackage ../servers/restund {};
+
   spamassassin = callPackage ../servers/mail/spamassassin {
     inherit (perlPackages) HTMLParser NetDNS NetAddrIP DBFile
-      HTTPDate MailDKIM;
+      HTTPDate MailDKIM LWP IOSocketSSL;
   };
 
   samba = callPackage ../servers/samba { };
 
   # A lightweight Samba, useful for non-Linux-based OSes.
-  samba_light = callPackage ../servers/samba {
+  samba_light = lowPrio (callPackage ../servers/samba {
     pam = null;
     fam = null;
     cups = null;
     acl = null;
     openldap = null;
-
     # libunwind 1.0.1 is not ported to GNU/Hurd.
     libunwind = null;
-  };
+  });
 
   shishi = callPackage ../servers/shishi { };
 
@@ -5451,7 +5854,7 @@ let
     inherit fetchurl fetchsvn stdenv stdenvMulti pkgconfig freetype fontconfig
       libxslt expat libdrm libpng zlib perl mesa
       xkeyboard_config dbus libuuid openssl gperf m4
-      autoconf libtool xmlto asciidoc udev flex bison python;
+      autoconf libtool xmlto asciidoc udev flex bison python mtdev;
     automake = automake110x;
   });
 
@@ -5459,10 +5862,16 @@ let
 
   xorgVideoUnichrome = callPackage ../servers/x11/xorg/unichrome/default.nix { };
 
+  yaws = callPackage ../servers/http/yaws { };
+
   zabbix = recurseIntoAttrs (import ../servers/monitoring/zabbix {
     inherit fetchurl stdenv pkgconfig postgresql curl openssl zlib;
   });
 
+  zabbix20 = recurseIntoAttrs (import ../servers/monitoring/zabbix/2.0.nix {
+    inherit fetchurl stdenv pkgconfig postgresql curl openssl zlib gettext;
+  });
+
 
   ### OS-SPECIFIC
 
@@ -5491,6 +5900,7 @@ let
   alsaPluginWrapper = callPackage ../os-specific/linux/alsa-plugins/wrapper.nix { };
 
   alsaUtils = callPackage ../os-specific/linux/alsa-utils { };
+  alsaOss = callPackage ../os-specific/linux/alsa-oss { };
 
   microcode2ucode = callPackage ../os-specific/linux/microcode/converter.nix { };
 
@@ -5500,13 +5910,23 @@ let
     inherit (perlPackages) LocaleGettext TermReadKey RpcXML;
   };
 
+  atop = callPackage ../os-specific/linux/atop { };
+
   b43Firmware_5_1_138 = callPackage ../os-specific/linux/firmware/b43-firmware/5.1.138.nix { };
 
   b43FirmwareCutter = callPackage ../os-specific/linux/firmware/b43-firmware-cutter { };
 
+  batctl = callPackage ../os-specific/linux/batman-adv/batctl.nix { };
+
   bcm43xx = callPackage ../os-specific/linux/firmware/bcm43xx { };
 
-  bluez = callPackage ../os-specific/linux/bluez { };
+  bluez4 = callPackage ../os-specific/linux/bluez {
+    pygobject = pygobject3;
+  };
+
+  bluez5 = lowPrio (callPackage ../os-specific/linux/bluez/bluez5.nix { });
+
+  bluez = bluez4;
 
   beret = callPackage ../games/beret { };
 
@@ -5534,10 +5954,7 @@ let
 
   dmtcp = callPackage ../os-specific/linux/dmtcp { };
 
-  dietlibc = callPackage ../os-specific/linux/dietlibc {
-    # Dietlibc 0.30 doesn't compile on PPC with GCC 4.1, bus GCC 3.4 works.
-    stdenv = if stdenv.system == "powerpc-linux" then overrideGCC stdenv gcc34 else stdenv;
-  };
+  dietlibc = callPackage ../os-specific/linux/dietlibc { };
 
   directvnc = builderDefsPackage ../os-specific/linux/directvnc {
     inherit libjpeg pkgconfig zlib directfb;
@@ -5553,7 +5970,7 @@ let
   libuuid =
     if crossSystem != null && crossSystem.config == "i586-pc-gnu"
     then (utillinux // {
-      hostDrv = lib.overrideDerivation utillinux.hostDrv (args: {
+      crossDrv = lib.overrideDerivation utillinux.crossDrv (args: {
         # `libblkid' fails to build on GNU/Hurd.
         configureFlags = args.configureFlags
           + " --disable-libblkid --disable-mount --disable-libmount"
@@ -5573,15 +5990,11 @@ let
 
   ebtables = callPackage ../os-specific/linux/ebtables { };
 
-  eject = callPackage ../os-specific/linux/eject { };
+  eject = utillinux;
 
   ffado = callPackage ../os-specific/linux/ffado { };
 
-  fbterm = builderDefsPackage (import ../os-specific/linux/fbterm) {
-    inherit fontconfig gpm freetype pkgconfig ncurses;
-  };
-
-  fbtermStdenv = callPackage ../os-specific/linux/fbterm/stdenv.nix { };
+  fbterm = callPackage ../os-specific/linux/fbterm { };
 
   fuse = callPackage ../os-specific/linux/fuse { };
 
@@ -5589,14 +6002,6 @@ let
 
   gpm = callPackage ../servers/gpm { };
 
-  hal = callPackage ../os-specific/linux/hal { };
-
-  halevt = callPackage ../os-specific/linux/hal/hal-evt.nix { };
-
-  hal_info = callPackage ../os-specific/linux/hal/info.nix { };
-
-  hal_info_synaptics = callPackage ../os-specific/linux/hal/synaptics.nix { };
-
   hdparm = callPackage ../os-specific/linux/hdparm { };
 
   hibernate = callPackage ../os-specific/linux/hibernate { };
@@ -5620,7 +6025,10 @@ let
 
   iproute = callPackage ../os-specific/linux/iproute { };
 
-  iputils = callPackage ../os-specific/linux/iputils { };
+  iputils = callPackage ../os-specific/linux/iputils {
+    sp = spCompat;
+    inherit (perlPackages) SGMLSpm;
+  };
 
   iptables = callPackage ../os-specific/linux/iptables { };
 
@@ -5632,6 +6040,8 @@ let
 
   iwlwifi1000ucode = callPackage ../os-specific/linux/firmware/iwlwifi-1000-ucode { };
 
+  iwlwifi2030ucode = callPackage ../os-specific/linux/firmware/iwlwifi-2030-ucode { };
+
   iwlwifi3945ucode = callPackage ../os-specific/linux/firmware/iwlwifi-3945-ucode { };
 
   iwlwifi4965ucodeV1 = callPackage ../os-specific/linux/firmware/iwlwifi-4965-ucode { };
@@ -5648,9 +6058,7 @@ let
 
   iwlwifi6000g2bucode = callPackage ../os-specific/linux/firmware/iwlwifi-6000g2b-ucode { };
 
-  jujuutils = callPackage ../os-specific/linux/jujuutils {
-    linuxHeaders = linuxHeaders33;
-  };
+  jujuutils = callPackage ../os-specific/linux/jujuutils { };
 
   kbd = callPackage ../os-specific/linux/kbd { };
 
@@ -5664,27 +6072,25 @@ let
 
   libnl = callPackage ../os-specific/linux/libnl { };
 
-  libnl2 = callPackage ../os-specific/linux/libnl/v2.nix { };
-
-  libnl1 = callPackage ../os-specific/linux/libnl/v1.nix { };
+  linuxHeaders = linuxHeaders37;
 
-  linuxHeaders = callPackage ../os-specific/linux/kernel-headers { };
+  linuxConsoleTools = callPackage ../os-specific/linux/consoletools { };
 
-  linuxHeaders33 = callPackage ../os-specific/linux/kernel-headers/3.3.5.nix { };
+  linuxHeaders37 = callPackage ../os-specific/linux/kernel-headers/3.7.nix { };
 
-  linuxHeaders26Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix {
+  linuxHeaders26Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.6.32.nix {
     inherit stdenv fetchurl perl;
     cross = assert crossSystem != null; crossSystem;
   });
 
-  linuxHeaders24Cross = forceBuildDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
+  linuxHeaders24Cross = forceNativeDrv (import ../os-specific/linux/kernel-headers/2.4.nix {
     inherit stdenv fetchurl perl;
     cross = assert crossSystem != null; crossSystem;
   });
 
   # We can choose:
-  linuxHeadersCrossChooser = ver : if (ver == "2.4") then linuxHeaders24Cross
-    else if (ver == "2.6") then linuxHeaders26Cross
+  linuxHeadersCrossChooser = ver : if ver == "2.4" then linuxHeaders24Cross
+    else if ver == "2.6" then linuxHeaders26Cross
     else throw "Unknown linux kernel version";
 
   linuxHeadersCross = assert crossSystem != null;
@@ -5694,126 +6100,86 @@ let
 
   kernelPatches = callPackage ../os-specific/linux/kernel/patches.nix { };
 
-  linux_2_6_15 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.15.nix) {
-    inherit fetchurl perl mktemp module_init_tools;
-    stdenv = overrideInStdenv stdenv [ gcc34 gnumake381 ];
-    kernelPatches =
-      [ kernelPatches.cifs_timeout_2_6_15
-      ];
-  };
-
-  linux_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) {
+  linux_3_0 = makeOverridable (import ../os-specific/linux/kernel/linux-3.0.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
     kernelPatches =
-      [ kernelPatches.fbcondecor_2_6_31
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_32
-        kernelPatches.cifs_timeout_2_6_29
-        kernelPatches.no_xsave
-        kernelPatches.dell_rfkill
+      [ kernelPatches.sec_perm_2_6_24
+        # kernelPatches.aufs3_0
       ];
   };
 
-  linux_2_6_32_xen = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32-xen.nix) {
+  linux_3_2 = makeOverridable (import ../os-specific/linux/kernel/linux-3.2.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
     kernelPatches =
-      [ kernelPatches.fbcondecor_2_6_31
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_32
-        kernelPatches.cifs_timeout_2_6_29
-        kernelPatches.no_xsave
-        kernelPatches.dell_rfkill
+      [ kernelPatches.sec_perm_2_6_24
+        # kernelPatches.aufs3_2
+        kernelPatches.cifs_timeout_2_6_38
       ];
   };
 
-  linux_2_6_35 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.35.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
-    kernelPatches =
-      [ kernelPatches.fbcondecor_2_6_35
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs2_2_6_35
-        kernelPatches.cifs_timeout_2_6_35
-      ] ++ lib.optional (platform.kernelArch == "arm")
-        kernelPatches.sheevaplug_modules_2_6_35;
-  };
-
-  linux_2_6_35_oldI686 = linux_2_6_35.override {
+  linux_3_2_apparmor = linux_3_2.override {
+    kernelPatches = [ kernelPatches.apparmor_3_2 ];
     extraConfig = ''
-      HIGHMEM64G? n
-      XEN? n
+      SECURITY_APPARMOR y
+      DEFAULT_SECURITY_APPARMOR y
     '';
-    extraMeta = {
-      platforms = ["i686-linux"];
-      maintainers = [lib.maintainers.raskin];
-    };
   };
 
-  linux_3_0 = makeOverridable (import ../os-specific/linux/kernel/linux-3.0.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
-    kernelPatches =
-      [ #kernelPatches.fbcondecor_2_6_38
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_0
-        #kernelPatches.aufs2_1_3_0
-      ];
+  linux_3_2_xen = linux_3_2.override {
+    extraConfig = ''
+      XEN_DOM0 y
+    '';
   };
 
-  linux_3_1 = makeOverridable (import ../os-specific/linux/kernel/linux-3.1.nix) {
+  linux_3_4 = makeOverridable (import ../os-specific/linux/kernel/linux-3.4.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
     kernelPatches =
-      [ #kernelPatches.fbcondecor_2_6_38
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_1
+      [ kernelPatches.sec_perm_2_6_24
+        # kernelPatches.aufs3_4
+      ] ++ lib.optionals (platform.kernelArch == "mips")
+      [ kernelPatches.mips_fpureg_emu
+        kernelPatches.mips_fpu_sigill
       ];
   };
 
-  linux_3_2 = makeOverridable (import ../os-specific/linux/kernel/linux-3.2.nix) {
+  linux_3_7 = makeOverridable (import ../os-specific/linux/kernel/linux-3.7.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
     kernelPatches =
-      [ #kernelPatches.fbcondecor_2_6_38
+      [
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_2
-        kernelPatches.cifs_timeout_2_6_38
+        # kernelPatches.aufs3_7
+      ] ++ lib.optionals (platform.kernelArch == "mips")
+      [ kernelPatches.mips_fpureg_emu
+        kernelPatches.mips_fpu_sigill
+        kernelPatches.mips_ext3_n32
       ];
   };
 
-  linux_3_2_xen = linux_3_2.override {
-    extraConfig = ''
-      XEN_DOM0 y
-    '';
-  };
-
-  linux_3_3 = makeOverridable (import ../os-specific/linux/kernel/linux-3.3.nix) {
+  linux_3_6_rpi = makeOverridable (import ../os-specific/linux/kernel/linux-rpi-3.6.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
-    kernelPatches =
-      [ #kernelPatches.fbcondecor_2_6_38
-        kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_3
-      ];
   };
 
-  linux_3_4 = makeOverridable (import ../os-specific/linux/kernel/linux-3.4.nix) {
+  linux_3_8 = makeOverridable (import ../os-specific/linux/kernel/linux-3.8.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
     kernelPatches =
-      [ #kernelPatches.fbcondecor_2_6_38
+      [
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_4
       ] ++ lib.optionals (platform.kernelArch == "mips")
       [ kernelPatches.mips_fpureg_emu
         kernelPatches.mips_fpu_sigill
+        kernelPatches.mips_ext3_n32
       ];
   };
 
-  linux_3_5 = makeOverridable (import ../os-specific/linux/kernel/linux-3.5.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools ubootChooser;
+  linux_3_9 = makeOverridable (import ../os-specific/linux/kernel/linux-3.9.nix) {
+    inherit fetchurl stdenv perl mktemp bc module_init_tools ubootChooser;
     kernelPatches =
       [
         kernelPatches.sec_perm_2_6_24
-        kernelPatches.aufs3_5
-        kernelPatches.perf3_5
       ] ++ lib.optionals (platform.kernelArch == "mips")
       [ kernelPatches.mips_fpureg_emu
         kernelPatches.mips_fpu_sigill
+        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -5823,36 +6189,37 @@ let
      for a specific kernel.  This function can then be called for
      whatever kernel you're using. */
 
-  linuxPackagesFor = kernel: self: let callPackage = newScope self; in rec {
-
+  linuxPackagesFor = kernel: self: let callPackage = newScope self; in {
     inherit kernel;
 
+    kernelDev = kernel.dev or kernel;
+
     acpi_call = callPackage ../os-specific/linux/acpi-call {};
 
+    batman_adv = callPackage ../os-specific/linux/batman-adv {};
+
     bbswitch = callPackage ../os-specific/linux/bbswitch {};
 
     ati_drivers_x11 = callPackage ../os-specific/linux/ati-drivers { };
 
     aufs =
-      if kernel.features ? aufs2 then
+      if self.kernel.features ? aufs2 then
         callPackage ../os-specific/linux/aufs/2.nix { }
-      else if kernel.features ? aufs2_1 then
-        callPackage ../os-specific/linux/aufs/2.1.nix { }
-      else if kernel.features ? aufs3 then
+      else if self.kernel.features ? aufs3 then
         callPackage ../os-specific/linux/aufs/3.nix { }
       else null;
 
     aufs_util =
-      if kernel.features ? aufs2 then
+      if self.kernel.features ? aufs2 then
         callPackage ../os-specific/linux/aufs-util/2.nix { }
-      else if kernel.features ? aufs2_1 then
-        callPackage ../os-specific/linux/aufs-util/2.1.nix { }
-      else if kernel.features ? aufs3 then
+      else if self.kernel.features ? aufs3 then
         callPackage ../os-specific/linux/aufs-util/3.nix { }
       else null;
 
     blcr = callPackage ../os-specific/linux/blcr { };
 
+    cryptodev = callPackage ../os-specific/linux/cryptodev { };
+
     e1000e = callPackage ../os-specific/linux/e1000e {};
 
     exmap = callPackage ../os-specific/linux/exmap { };
@@ -5864,21 +6231,20 @@ let
     iwlwifi = callPackage ../os-specific/linux/iwlwifi { };
 
     iwlwifi4965ucode =
-      (if (builtins.compareVersions kernel.version "2.6.27" == 0)
-          || (builtins.compareVersions kernel.version "2.6.27" == 1)
-       then iwlwifi4965ucodeV2
-       else iwlwifi4965ucodeV1);
+      if builtins.compareVersions self.kernel.version "2.6.27" == 0
+         || builtins.compareVersions self.kernel.version "2.6.27" == 1
+      then iwlwifi4965ucodeV2
+      else iwlwifi4965ucodeV1;
 
     atheros = callPackage ../os-specific/linux/atheros/0.9.4.nix { };
 
     broadcom_sta = callPackage ../os-specific/linux/broadcom-sta/default.nix { };
 
-    kernelHeaders = callPackage ../os-specific/linux/kernel-headers { };
-
     nvidia_x11 = callPackage ../os-specific/linux/nvidia-x11 { };
 
     nvidia_x11_legacy96 = callPackage ../os-specific/linux/nvidia-x11/legacy96.nix { };
     nvidia_x11_legacy173 = callPackage ../os-specific/linux/nvidia-x11/legacy173.nix { };
+    nvidia_x11_legacy304 = callPackage ../os-specific/linux/nvidia-x11/legacy304.nix { };
 
     openafsClient = callPackage ../servers/openafs-client { };
 
@@ -5892,28 +6258,28 @@ let
       linuxHeaders = glibc.kernelHeaders;
     };
 
-    splashutils = let hasFbConDecor = if kernel ? features
-      then kernel.features ? fbConDecor
-      else kernel.config.isEnabled "FB_CON_DECOR";
+    splashutils = let hasFbConDecor = if self.kernel ? features
+      then self.kernel.features ? fbConDecor
+      else self.kernel.config.isEnabled "FB_CON_DECOR";
     in if hasFbConDecor then pkgs.splashutils else null;
 
     /* compiles but has to be integrated into the kernel somehow
-      Let's have it uncommented and finish it..
+       Let's have it uncommented and finish it..
     */
     ndiswrapper = callPackage ../os-specific/linux/ndiswrapper { };
 
-    ov511 = callPackage ../os-specific/linux/ov511 {
-      stdenv = overrideGCC stdenv gcc34;
-    };
+    netatop = callPackage ../os-specific/linux/netatop { };
 
     perf = callPackage ../os-specific/linux/kernel/perf.nix { };
 
+    spl = callPackage ../os-specific/linux/spl/default.nix { };
+
     sysprof = callPackage ../development/tools/profiling/sysprof {
       inherit (gnome) libglade;
     };
 
     systemtap = callPackage ../development/tools/profiling/systemtap {
-      linux = kernel;
+      linux = self.kernelDev;
       inherit (gnome) libglademm;
     };
 
@@ -5924,22 +6290,26 @@ let
     virtualbox = callPackage ../applications/virtualization/virtualbox {
       stdenv = stdenv_32bit;
       inherit (gnome) libIDL;
+      enableExtensionPack = config.virtualbox.enableExtensionPack or false;
     };
 
     virtualboxGuestAdditions = callPackage ../applications/virtualization/virtualbox/guest-additions { };
+
+    zfs = callPackage ../os-specific/linux/zfs/default.nix { };
   };
 
   # Build the kernel modules for the some of the kernels.
-  linuxPackages_2_6_32 = recurseIntoAttrs (linuxPackagesFor linux_2_6_32 pkgs.linuxPackages_2_6_32);
-  linuxPackages_2_6_32_xen = linuxPackagesFor linux_2_6_32_xen pkgs.linuxPackages_2_6_32_xen;
-  linuxPackages_2_6_35 = recurseIntoAttrs (linuxPackagesFor linux_2_6_35 pkgs.linuxPackages_2_6_35);
-  linuxPackages_3_0 = recurseIntoAttrs (linuxPackagesFor linux_3_0 pkgs.linuxPackages_3_0);
-  linuxPackages_3_1 = recurseIntoAttrs (linuxPackagesFor linux_3_1 pkgs.linuxPackages_3_1);
-  linuxPackages_3_2 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2 pkgs.linuxPackages_3_2);
-  linuxPackages_3_2_xen = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2_xen pkgs.linuxPackages_3_2_xen);
-  linuxPackages_3_3 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_3 pkgs.linuxPackages_3_3);
-  linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4 pkgs.linuxPackages_3_4);
-  linuxPackages_3_5 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_5 pkgs.linuxPackages_3_5);
+  linuxPackages_3_0 = recurseIntoAttrs (linuxPackagesFor linux_3_0 linuxPackages_3_0);
+  linuxPackages_3_2 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2 linuxPackages_3_2);
+  linuxPackages_3_2_apparmor = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2_apparmor linuxPackages_3_2_apparmor);
+  linuxPackages_3_2_xen = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_2_xen linuxPackages_3_2_xen);
+  linuxPackages_3_4 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_4 linuxPackages_3_4);
+  linuxPackages_3_6_rpi = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_6_rpi linuxPackages_3_6_rpi);
+  linuxPackages_3_7 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_7 linuxPackages_3_7);
+  linuxPackages_3_8 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_8 linuxPackages_3_8);
+  linuxPackages_3_9 = recurseIntoAttrs (linuxPackagesFor pkgs.linux_3_9 linuxPackages_3_9);
+  # Update this when adding a new version!
+  linuxPackages_latest = pkgs.linuxPackages_3_9;
 
   # The current default kernel / kernel modules.
   linux = linuxPackages.kernel;
@@ -5947,7 +6317,7 @@ let
 
   # A function to build a manually-configured kernel
   linuxManualConfig = import ../os-specific/linux/kernel/manual-config.nix {
-    inherit (pkgs) stdenv runCommand nettools perl kmod writeTextFile;
+    inherit (pkgs) stdenv runCommand nettools bc perl kmod writeTextFile;
   };
 
   keyutils = callPackage ../os-specific/linux/keyutils { };
@@ -5986,6 +6356,8 @@ let
 
   libcap_manpages = callPackage ../os-specific/linux/libcap/man.nix { };
 
+  libcap_ng = callPackage ../os-specific/linux/libcap-ng { };
+
   libnscd = callPackage ../os-specific/linux/libnscd { };
 
   libnotify = callPackage ../development/libraries/libnotify { };
@@ -6002,19 +6374,13 @@ let
 
   module_init_tools = callPackage ../os-specific/linux/module-init-tools { };
 
-  mountall = callPackage ../os-specific/linux/mountall {
-    automake = automake111x;
-  };
+  mountall = callPackage ../os-specific/linux/mountall { };
 
   aggregateModules = modules:
     import ../os-specific/linux/module-init-tools/aggregator.nix {
       inherit stdenv module_init_tools modules buildEnv;
     };
 
-  modutils = callPackage ../os-specific/linux/modutils {
-    stdenv = overrideGCC stdenv gcc34;
-  };
-
   multipath_tools = callPackage ../os-specific/linux/multipath-tools { };
 
   nettools = callPackage ../os-specific/linux/net-tools { };
@@ -6049,23 +6415,21 @@ let
 
   pam_ssh_agent_auth = callPackage ../os-specific/linux/pam_ssh_agent_auth { };
 
-  pam_unix2 = callPackage ../os-specific/linux/pam_unix2 { };
-
   pam_usb = callPackage ../os-specific/linux/pam_usb { };
 
   pcmciaUtils = callPackage ../os-specific/linux/pcmciautils {
-    firmware = getConfig ["pcmciaUtils" "firmware"] [];
-    config = getConfig ["pcmciaUtils" "config"] null;
+    firmware = config.pcmciaUtils.firmware or [];
+    config = config.pcmciaUtils.config or null;
   };
 
-  phat = callPackage ../development/libraries/phat {
-    inherit (gnome) libgnomecanvas;
-  };
+  plymouth = callPackage ../os-specific/linux/plymouth { };
 
   pmount = callPackage ../os-specific/linux/pmount { };
 
   pmutils = callPackage ../os-specific/linux/pm-utils { };
 
+  pmtools = callPackage ../os-specific/linux/pmtools { };
+
   policycoreutils = callPackage ../os-specific/linux/policycoreutils { };
 
   powertop = callPackage ../os-specific/linux/powertop { };
@@ -6074,7 +6438,7 @@ let
 
   procps = callPackage ../os-specific/linux/procps { };
 
-  pwdutils = callPackage ../os-specific/linux/pwdutils { };
+  "procps-ng" = callPackage ../os-specific/linux/procps-ng { };
 
   qemu_kvm = callPackage ../os-specific/linux/qemu-kvm { };
 
@@ -6086,6 +6450,8 @@ let
   radeonR600 = callPackage ../os-specific/linux/firmware/radeon-r600 { };
   radeonJuniper = callPackage ../os-specific/linux/firmware/radeon-juniper { };
 
+  raspberrypifw = callPackage ../os-specific/linux/firmware/raspberrypi {};
+
   regionset = callPackage ../os-specific/linux/regionset { };
 
   rfkill = callPackage ../os-specific/linux/rfkill { };
@@ -6106,6 +6472,8 @@ let
 
   sdparm = callPackage ../os-specific/linux/sdparm { };
 
+  sepolgen = callPackage ../os-specific/linux/sepolgen { };
+
   shadow = callPackage ../os-specific/linux/shadow { };
 
   splashutils = callPackage ../os-specific/linux/splashutils/default.nix { };
@@ -6133,7 +6501,7 @@ let
   };
 
   # FIXME: `tcp-wrapper' is actually not OS-specific.
-  tcpWrapper = callPackage ../os-specific/linux/tcp-wrapper { };
+  tcp_wrappers = callPackage ../os-specific/linux/tcp-wrappers { };
 
   trackballs = callPackage ../games/trackballs {
     debug = false;
@@ -6142,10 +6510,10 @@ let
 
   tunctl = callPackage ../os-specific/linux/tunctl { };
 
-  ubootChooser = name : if (name == "upstream") then ubootUpstream
-    else if (name == "sheevaplug") then ubootSheevaplug
-    else if (name == "guruplug") then ubootGuruplug
-    else if (name == "nanonote") then ubootNanonote
+  ubootChooser = name : if name == "upstream" then ubootUpstream
+    else if name == "sheevaplug" then ubootSheevaplug
+    else if name == "guruplug" then ubootGuruplug
+    else if name == "nanonote" then ubootNanonote
     else throw "Unknown uboot";
 
   ubootUpstream = callPackage ../misc/uboot { };
@@ -6158,26 +6526,19 @@ let
 
   uclibc = callPackage ../os-specific/linux/uclibc { };
 
-  uclibcCross = callPackage ../os-specific/linux/uclibc {
+  uclibcCross = lowPrio (callPackage ../os-specific/linux/uclibc {
     inherit fetchurl stdenv libiconv;
     linuxHeaders = linuxHeadersCross;
     gccCross = gccCrossStageStatic;
     cross = assert crossSystem != null; crossSystem;
-  };
+  });
 
   udev145 = callPackage ../os-specific/linux/udev/145.nix { };
-  udev173 = callPackage ../os-specific/linux/udev/173.nix { };
-  udev = pkgs.udev173;
-
-  udisks = callPackage ../os-specific/linux/udisks { };
-
-  uml = linux.override {
-    userModeLinux = true;
-  };
+  udev = pkgs.systemd;
 
-  umlutilities = callPackage ../os-specific/linux/uml-utilities {
-    tunctl = true; mconsole = true;
-  };
+  udisks1 = callPackage ../os-specific/linux/udisks/1-default.nix { };
+  udisks2 = callPackage ../os-specific/linux/udisks/2-default.nix { };
+  udisks = udisks1;
 
   untie = callPackage ../os-specific/linux/untie { };
 
@@ -6248,7 +6609,7 @@ let
     };
 
     pthreads = callPackage ../os-specific/windows/pthread-w32 {
-      mingw_headers = mingw_headers2;
+      mingw_headers = mingw_headers3;
     };
 
     wxMSW = callPackage ../os-specific/windows/wxMSW-2.8 { };
@@ -6256,7 +6617,6 @@ let
 
   wesnoth = callPackage ../games/wesnoth {
     lua = lua5;
-    boost = boost147;
   };
 
   wirelesstools = callPackage ../os-specific/linux/wireless-tools { };
@@ -6299,8 +6659,7 @@ let
 
   anonymousPro = callPackage ../data/fonts/anonymous-pro {};
 
-  arkpandora_ttf = builderDefsPackage (import ../data/fonts/arkpandora) {
-  };
+  arkpandora_ttf = builderDefsPackage (import ../data/fonts/arkpandora) { };
 
   bakoma_ttf = callPackage ../data/fonts/bakoma-ttf { };
 
@@ -6325,6 +6684,8 @@ let
 
   docbook5 = callPackage ../data/sgml+xml/schemas/docbook-5.0 { };
 
+  docbook_sgml_dtd_31 = callPackage ../data/sgml+xml/schemas/sgml-dtd/docbook/3.1.nix { };
+
   docbook_sgml_dtd_41 = callPackage ../data/sgml+xml/schemas/sgml-dtd/docbook/4.1.nix { };
 
   docbook_xml_dtd_412 = callPackage ../data/sgml+xml/schemas/xml-dtd/docbook/4.1.2.nix { };
@@ -6349,6 +6710,8 @@ let
 
   freefont_ttf = callPackage ../data/fonts/freefont-ttf { };
 
+  freepats = callPackage ../data/misc/freepats { };
+
   gentium = callPackage ../data/fonts/gentium {};
 
   gnome_user_docs = callPackage ../data/documentation/gnome-user-docs { };
@@ -6364,7 +6727,7 @@ let
   liberation_ttf = callPackage ../data/fonts/redhat-liberation-fonts { };
 
   libertine = builderDefsPackage (import ../data/fonts/libertine) {
-    inherit fontforge;
+    inherit fetchurl fontforge lib;
   };
 
   lmmath = callPackage ../data/fonts/lmodern/lmmath.nix {};
@@ -6415,6 +6778,8 @@ let
 
   ttf_bitstream_vera = callPackage ../data/fonts/ttf-bitstream-vera { };
 
+  tzdata = callPackage ../data/misc/tzdata { };
+
   ubuntu_font_family = callPackage ../data/fonts/ubuntu-font-family { };
 
   ucsFonts = callPackage ../data/fonts/ucs-fonts { };
@@ -6448,7 +6813,11 @@ let
 
   aangifte2011 = callPackage_i686 ../applications/taxes/aangifte-2011 { };
 
-  abcde = callPackage ../applications/audio/abcde { };
+  aangifte2012 = callPackage_i686 ../applications/taxes/aangifte-2012 { };
+
+  abcde = callPackage ../applications/audio/abcde {
+    inherit (perlPackages) DigestSHA MusicBrainz MusicBrainzDiscID;
+  };
 
   abiword = callPackage ../applications/office/abiword {
     inherit (gnome) libglade libgnomecanvas;
@@ -6456,12 +6825,16 @@ let
 
   adobeReader = callPackage_i686 ../applications/misc/adobe-reader { };
 
+  aewan = callPackage ../applications/editors/aewan { };
+
+  alchemy = callPackage ../applications/graphics/alchemy { };
+
   amsn = callPackage ../applications/networking/instant-messengers/amsn { };
 
   antiword = callPackage ../applications/office/antiword {};
 
   ardour = callPackage ../applications/audio/ardour {
-    inherit (gnome) libgnomecanvas;
+    inherit (gnome) libgnomecanvas libgnomecanvasmm;
   };
 
   ardour3 =  lowPrio (callPackage ../applications/audio/ardour/ardour3.nix {
@@ -6481,16 +6854,21 @@ let
 
   autopanosiftc = callPackage ../applications/graphics/autopanosiftc { };
 
-  avidemux = callPackage ../applications/video/avidemux {
+  avidemux = callPackage ../applications/video/avidemux { };
+
+  avogadro = callPackage ../applications/science/chemistry/avogadro {
+    eigen = eigen2;
   };
 
-  avogadro = callPackage ../applications/science/chemistry/avogadro { };
+  avxsynth = callPackage ../applications/video/avxsynth { };
 
   awesome = callPackage ../applications/window-managers/awesome {
     lua = lua5;
     cairo = cairo.override { xcbSupport = true; };
   };
 
+  baresip = callPackage ../applications/networking/instant-messengers/baresip {};
+
   batik = callPackage ../applications/graphics/batik { };
 
   bazaar = callPackage ../applications/version-management/bazaar { };
@@ -6514,12 +6892,15 @@ let
     # For some reason, TLS support is broken when using GnuTLS 3.0 (can't
     # connect to jabber.org, for instance.)
     gnutls = gnutls2;
+    libotr = libotr_3_2;
   };
 
   blender = callPackage  ../applications/misc/blender {
-    python = python32;
+    python = python3;
   };
 
+  bristol = callPackage ../applications/audio/bristol { };
+
   bvi = callPackage ../applications/editors/bvi { };
 
   calf = callPackage ../applications/audio/calf {
@@ -6550,40 +6931,41 @@ let
 
   centerim = callPackage ../applications/networking/instant-messengers/centerim { };
 
+  cgit = callPackage ../applications/version-management/git-and-tools/cgit { };
+
   chatzilla = callPackage ../applications/networking/irc/chatzilla {
     xulrunner = firefox36Pkgs.xulrunner;
   };
 
   chromium = lowPrio (callPackage ../applications/networking/browsers/chromium {
+    channel = "stable";
     gconf = gnome.GConf;
+    pulseSupport = config.pulseaudio or false;
   });
 
-  chromeWrapper = wrapFirefox
-    { browser = chromium; browserName = chromium.packageName; desktopName = "Chromium";
-      icon = "${chromium}/share/icons/hicolor/48x48/apps/${chromium.packageName}.png";
-    };
+  chromiumBeta = chromium.override { channel = "beta"; };
+  chromiumBetaWrapper = wrapChromium chromiumBeta;
 
-  cinelerra = callPackage ../applications/video/cinelerra { };
+  chromiumDev = chromium.override { channel = "dev"; };
+  chromiumDevWrapper = wrapChromium chromiumDev;
 
-  cmus = callPackage ../applications/audio/cmus { };
+  chromiumWrapper = wrapChromium chromium;
 
-  compiz = callPackage ../applications/window-managers/compiz/core.nix { };
+  cinelerra = callPackage ../applications/video/cinelerra { };
 
-  compiz_ccsm = callPackage ../applications/window-managers/compiz/ccsm.nix { };
+  cmus = callPackage ../applications/audio/cmus { };
 
-  compizconfig_python = callPackage ../applications/window-managers/compiz/config-python.nix { };
+  compiz = callPackage ../applications/window-managers/compiz {
+    inherit (gnome) GConf ORBit2 metacity;
+    boost = boost149; # https://bugs.launchpad.net/compiz/+bug/1131864
+    intltool = intltool_standalone;
+  };
 
   coriander = callPackage ../applications/video/coriander {
     inherit (gnome) libgnomeui GConf;
   };
 
-  libcompizconfig = callPackage ../applications/window-managers/compiz/libcompizconfig.nix { };
-
-  compiz_bcop = callPackage ../applications/window-managers/compiz/bcop.nix { };
-
-  compiz_plugins_main = callPackage ../applications/window-managers/compiz/plugins-main.nix { };
-
-  compiz_plugins_extra = callPackage ../applications/window-managers/compiz/plugins-extra.nix { };
+  csound = callPackage ../applications/audio/csound { };
 
   cinepaint = callPackage ../applications/graphics/cinepaint {
     fltk = fltk13;
@@ -6601,7 +6983,7 @@ let
 
   cuneiform = builderDefsPackage (import ../tools/graphics/cuneiform) {
     inherit cmake patchelf;
-    imagemagick=imagemagick;
+    imagemagick = imagemagick;
   };
 
   cvs = callPackage ../applications/version-management/cvs { };
@@ -6612,22 +6994,35 @@ let
 
   d4x = callPackage ../applications/misc/d4x { };
 
-  darcs = haskellPackages.darcs;
+  darcs = haskellPackages.darcs.override {
+    # A variant of the Darcs derivation that containts only the executable and
+    # thus has no dependencies on other Haskell packages.
+    cabal = { mkDerivation = x: rec { final = haskellPackages.cabal.mkDerivation (self: (x final) // {
+              isLibrary = false;
+              configureFlags = "-f-library"; }); }.final;
+            };
+  };
 
   darktable = callPackage ../applications/graphics/darktable {
     inherit (gnome) GConf libglade;
   };
 
+  "dd-agent" = callPackage ../tools/networking/dd-agent { };
+
   dia = callPackage ../applications/graphics/dia {
     inherit (pkgs.gnome) libart_lgpl libgnomeui;
   };
 
+  distrho = callPackage ../applications/audio/distrho {};
+
   djvulibre = callPackage ../applications/misc/djvulibre { };
 
   djview = callPackage ../applications/graphics/djview { };
   djview4 = pkgs.djview;
 
-  dmenu = callPackage ../applications/misc/dmenu { };
+  dmenu = callPackage ../applications/misc/dmenu {
+    enableXft = config.dmenu.enableXft or false;
+  };
 
   dmtx = builderDefsPackage (import ../tools/graphics/dmtx) {
     inherit libpng libtiff libjpeg imagemagick librsvg
@@ -6636,6 +7031,10 @@ let
     inherit (xlibs) libX11;
   };
 
+  doodle = callPackage ../applications/search/doodle { };
+
+  dunst = callPackage ../applications/misc/dunst { };
+
   dvb_apps  = callPackage ../applications/video/dvb-apps { };
 
   dvdauthor = callPackage ../applications/video/dvdauthor { };
@@ -6643,12 +7042,16 @@ let
   dvswitch = callPackage ../applications/video/dvswitch { };
 
   dwm = callPackage ../applications/window-managers/dwm {
-    patches = getConfig [ "dwm" "patches" ] [];
+    patches = config.dwm.patches or [];
   };
 
   eaglemode = callPackage ../applications/misc/eaglemode { };
 
-  eclipses = recurseIntoAttrs (callPackage ../applications/editors/eclipse { });
+  eclipses = recurseIntoAttrs (
+    (callPackage ../applications/editors/eclipse { }).deepOverride {
+      cairo = cairo_1_12_2;
+    }
+  );
 
   ed = callPackage ../applications/editors/ed { };
 
@@ -6658,28 +7061,6 @@ let
 
   emacs = emacs24;
 
-  emacs22 = callPackage ../applications/editors/emacs-22 {
-    stdenv =
-      if stdenv.isDarwin
-
-      /* On Darwin, use Apple-GCC, otherwise:
-           configure: error: C preprocessor "cc -E -no-cpp-precomp" fails sanity check */
-      then overrideGCC stdenv gccApple
-
-      /* Using cpp 4.5, we get:
-
-           make[1]: Entering directory `/tmp/nix-build-dhbj8qqmqxwp3iw6sjcgafsrwlwrix1f-emacs-22.3.drv-0/emacs-22.3/lib-src'
-           Makefile:148: *** recipe commences before first target.  Stop.
-
-         Apparently, this is because `lib-src/Makefile' is generated by
-         processing `lib-src/Makefile.in' with cpp, and the escaping rules for
-         literal backslashes have changed.  */
-      else overrideGCC stdenv gcc44;
-
-    xaw3dSupport = getConfig [ "emacs" "xaw3dSupport" ] false;
-    gtkGUI = getConfig [ "emacs" "gtkSupport" ] true;
-  };
-
   emacs23 = callPackage ../applications/editors/emacs-23 {
     stdenv =
       if stdenv.isDarwin
@@ -6729,6 +7110,8 @@ let
 
     jabber = callPackage ../applications/editors/emacs-modes/jabber { };
 
+    emacsClangCompleteAsync = callPackage ../applications/editors/emacs-modes/emacs-clang-complete-async { };
+
     emacsSessionManagement = callPackage ../applications/editors/emacs-modes/session-management-for-emacs { };
 
     emacsw3m = callPackage ../applications/editors/emacs-modes/emacs-w3m { };
@@ -6739,6 +7122,8 @@ let
 
     gh = callPackage ../applications/editors/emacs-modes/gh { };
 
+    graphvizDot = callPackage ../applications/editors/emacs-modes/graphviz-dot { };
+
     gist = callPackage ../applications/editors/emacs-modes/gist { };
 
     jade = callPackage ../applications/editors/emacs-modes/jade { };
@@ -6769,12 +7154,12 @@ let
 
     notmuch = callPackage ../applications/networking/mailreaders/notmuch { };
 
-    nxml = callPackage ../applications/editors/emacs-modes/nxml { };
-
     # This is usually a newer version of Org-Mode than that found in GNU Emacs, so
     # we want it to have higher precedence.
     org = hiPrio (callPackage ../applications/editors/emacs-modes/org { });
 
+    org2blog = callPackage ../applications/editors/emacs-modes/org2blog { };
+
     pcache = callPackage ../applications/editors/emacs-modes/pcache { };
 
     phpMode = callPackage ../applications/editors/emacs-modes/php { };
@@ -6783,8 +7168,8 @@ let
 
     proofgeneral = callPackage ../applications/editors/emacs-modes/proofgeneral {
       texLive = pkgs.texLiveAggregationFun {
-                  paths = [ pkgs.texLive pkgs.texLiveCMSuper ];
-                };
+        paths = [ pkgs.texLive pkgs.texLiveCMSuper ];
+      };
     };
 
     quack = callPackage ../applications/editors/emacs-modes/quack { };
@@ -6798,9 +7183,10 @@ let
     scalaMode = callPackage ../applications/editors/emacs-modes/scala-mode { };
 
     sunriseCommander = callPackage ../applications/editors/emacs-modes/sunrise-commander { };
+
+    xmlRpc = callPackage ../applications/editors/emacs-modes/xml-rpc { };
   };
 
-  emacs22Packages = emacsPackages emacs22 pkgs.emacs22Packages;
   emacs23Packages = emacsPackages emacs23 pkgs.emacs23Packages;
   emacs24Packages = recurseIntoAttrs (emacsPackages emacs24 pkgs.emacs24Packages);
 
@@ -6808,6 +7194,8 @@ let
 
   espeak = callPackage ../applications/audio/espeak { };
 
+  espeakedit = callPackage ../applications/audio/espeak/edit.nix { };
+
   esniper = callPackage ../applications/networking/esniper { };
 
   etherape = callPackage ../applications/networking/sniffers/etherape {
@@ -6842,12 +7230,16 @@ let
 
   fossil = callPackage ../applications/version-management/fossil { };
 
+  fvwm = callPackage ../applications/window-managers/fvwm { };
+
+  geany = callPackage ../applications/editors/geany { };
+
   goldendict = callPackage ../applications/misc/goldendict { };
 
   grass = import ../applications/misc/grass {
     inherit (xlibs) libXmu libXext libXp libX11 libXt libSM libICE libXpm
       libXaw libXrender;
-    inherit getConfig composableDerivation stdenv fetchurl
+    inherit config composableDerivation stdenv fetchurl
       lib flex bison cairo fontconfig
       gdal zlib ncurses gdbm proj pkgconfig swig
       blas liblapack libjpeg libpng mysql unixODBC mesa postgresql python
@@ -6862,6 +7254,10 @@ let
     inherit (gnome) libgnome libgnomeui vte;
   };
 
+  guitarix = callPackage ../applications/audio/guitarix {
+    fftw = fftwSinglePrec;
+  };
+
   wavesurfer = callPackage ../applications/misc/audio/wavesurfer { };
 
   wireshark = callPackage ../applications/networking/sniffers/wireshark { };
@@ -6874,11 +7270,13 @@ let
 
   feh = callPackage ../applications/graphics/feh { };
 
+  filezilla = callPackage ../applications/networking/ftp/filezilla { };
+
   firefox = pkgs.firefoxPkgs.firefox;
 
   firefoxWrapper = wrapFirefox { browser = pkgs.firefox; };
 
-  firefoxPkgs = pkgs.firefox12Pkgs;
+  firefoxPkgs = pkgs.firefox20Pkgs;
 
   firefox36Pkgs = callPackage ../applications/networking/browsers/firefox/3.6.nix {
     inherit (gnome) libIDL;
@@ -6886,37 +7284,37 @@ let
 
   firefox36Wrapper = wrapFirefox { browser = firefox36Pkgs.firefox; };
 
-  firefox12Pkgs = callPackage ../applications/networking/browsers/firefox/12.0.nix {
+  firefox13Pkgs = callPackage ../applications/networking/browsers/firefox/13.0.nix {
     inherit (gnome) libIDL;
   };
 
-  firefox12Wrapper = wrapFirefox { browser = firefox12Pkgs.firefox; };
+  firefox13Wrapper = lowPrio (wrapFirefox { browser = firefox13Pkgs.firefox; });
 
-  firefox13Pkgs = callPackage ../applications/networking/browsers/firefox/13.0.nix {
+  firefox20Pkgs = callPackage ../applications/networking/browsers/firefox/20.0.nix {
     inherit (gnome) libIDL;
+    inherit (pythonPackages) pysqlite;
   };
 
-  firefox13Wrapper = lowPrio (wrapFirefox { browser = firefox13Pkgs.firefox; });
+  firefox20Wrapper = lowPrio (wrapFirefox { browser = firefox20Pkgs.firefox; });
 
-  flac = callPackage ../applications/audio/flac {
-    stdenv = stdenvMulti;
+  firefox21Pkgs = callPackage ../applications/networking/browsers/firefox/21.0.nix {
+    inherit (gnome) libIDL;
+    inherit (pythonPackages) pysqlite;
   };
 
-  flashplayer = flashplayer11;
+  firefox21Wrapper = lowPrio (wrapFirefox { browser = firefox21Pkgs.firefox; });
 
-  flashplayer9 = callPackage ../applications/networking/browsers/mozilla-plugins/flashplayer-9 { };
-
-  flashplayer10 = callPackage ../applications/networking/browsers/mozilla-plugins/flashplayer-10 {
-    debug = getConfig ["flashplayer" "debug"] false;
+  flac = callPackage ../applications/audio/flac {
+    stdenv = stdenvMulti;
   };
 
-  flashplayer11 = callPackage ../applications/networking/browsers/mozilla-plugins/flashplayer-11 {
-    debug = getConfig ["flashplayer" "debug"] false;
+  flashplayer = callPackage ../applications/networking/browsers/mozilla-plugins/flashplayer-11 {
+    debug = config.flashplayer.debug or false;
     # !!! Fix the dependency on two different builds of nss.
   };
 
   freecad = callPackage ../applications/graphics/freecad {
-    boost = boost146;
+    opencascade = opencascade_6_5;
   };
 
   freemind = callPackage ../applications/misc/freemind {
@@ -6924,6 +7322,8 @@ let
     jre = jdk;
   };
 
+  freenet = callPackage ../applications/networking/p2p/freenet { };
+
   freepv = callPackage ../applications/graphics/freepv { };
 
   xfontsel = callPackage ../applications/misc/xfontsel { };
@@ -6933,6 +7333,10 @@ let
 
   freerdpUnstable = callPackage ../applications/networking/remote/freerdp/unstable.nix { };
 
+  freicoin = callPackage ../applications/misc/freicoin {
+    db4 = db48;
+  };
+
   fspot = callPackage ../applications/graphics/f-spot {
     inherit (gnome) libgnome libgnomeui;
     gtksharp = gtksharp1;
@@ -6946,6 +7350,7 @@ let
 
   gimp_2_8 = callPackage ../applications/graphics/gimp/2.8.nix {
     inherit (gnome) libart_lgpl;
+    webkit = null;
   };
 
   gimp = gimp_2_6;
@@ -6960,12 +7365,13 @@ let
   git = gitAndTools.git;
   gitFull = gitAndTools.gitFull;
   gitSVN = gitAndTools.gitSVN;
-  tig = gitAndTools.tig;
 
   giv = callPackage ../applications/graphics/giv {
     pcre = pcre.override { unicodeSupport = true; };
   };
 
+  gmrun = callPackage ../applications/misc/gmrun {};
+
   gnucash = callPackage ../applications/office/gnucash {
     inherit (gnome) libgnomeui libgtkhtml gtkhtml libbonoboui libgnomeprint;
     gconf = gnome.GConf;
@@ -6973,10 +7379,10 @@ let
     slibGuile = slibGuile.override { scheme = guile_1_8; };
   };
 
-  qcad = callPackage ../applications/misc/qcad { };
-
   libquvi = callPackage ../applications/video/quvi/library.nix { };
 
+  praat = callPackage ../applications/audio/praat { };
+
   quvi = callPackage ../applications/video/quvi/tool.nix { };
 
   quvi_scripts = callPackage ../applications/video/quvi/scripts.nix { };
@@ -6997,18 +7403,16 @@ let
   };
 
   gnumeric = callPackage ../applications/office/gnumeric {
-    goffice = goffice_0_9;
+    goffice = goffice_0_10;
     inherit (gnome) libglade scrollkeeper;
   };
 
-  gnunet08 = callPackage ../applications/networking/p2p/gnunet/0.8.nix {
-    inherit (gnome) libglade;
-    guile = guile_1_8;
-    gtkSupport = getConfig [ "gnunet" "gtkSupport" ] true;
-  };
-
   gnunet = callPackage ../applications/networking/p2p/gnunet { };
 
+  gnunet_svn = lowPrio (callPackage ../applications/networking/p2p/gnunet/svn.nix {
+    libgcrypt = libgcrypt_git;
+  });
+
   gocr = callPackage ../applications/graphics/gocr { };
 
   gobby5 = callPackage ../applications/editors/gobby {
@@ -7018,12 +7422,14 @@ let
   gphoto2 = callPackage ../applications/misc/gphoto2 { };
 
   gphoto2fs = builderDefsPackage ../applications/misc/gphoto2/gphotofs.nix {
-    inherit libgphoto2 fuse pkgconfig glib;
+    inherit libgphoto2 fuse pkgconfig glib libtool;
   };
 
   graphicsmagick = callPackage ../applications/graphics/graphicsmagick { };
 
-  graphicsmagick137 = callPackage ../applications/graphics/graphicsmagick/1.3.7.nix { };
+  graphicsmagick137 = callPackage ../applications/graphics/graphicsmagick/1.3.7.nix {
+    libpng = libpng12;
+  };
 
   gtkpod = callPackage ../applications/audio/gtkpod {
     inherit (gnome) libglade;
@@ -7051,6 +7457,8 @@ let
 
   gqview = callPackage ../applications/graphics/gqview { };
 
+  gmpc = callPackage ../applications/audio/gmpc { };
+
   gmtk = callPackage ../applications/networking/browsers/mozilla-plugins/gmtk {
     inherit (gnome) GConf;
   };
@@ -7079,6 +7487,10 @@ let
 
   hello = callPackage ../applications/misc/hello/ex-2 { };
 
+  hexedit = callPackage ../applications/editors/hexedit { };
+
+  hipchat = callPackage_i686 ../applications/networking/instant-messengers/hipchat { };
+
   homebank = callPackage ../applications/office/homebank { };
 
   htmldoc = callPackage ../applications/misc/htmldoc {
@@ -7137,7 +7549,7 @@ let
     librsvg = null;
   };
 
-  imagemagickBig = callPackage ../applications/graphics/ImageMagick { };
+  imagemagickBig = lowPrio (callPackage ../applications/graphics/ImageMagick { });
 
   # Impressive, formerly known as "KeyJNote".
   impressive = callPackage ../applications/office/impressive {
@@ -7153,14 +7565,28 @@ let
     lua = lua5;
   };
 
+  ipe = callPackage ../applications/graphics/ipe { };
+
   iptraf = callPackage ../applications/networking/iptraf { };
 
   irssi = callPackage ../applications/networking/irc/irssi { };
 
+  irssi_fish = callPackage ../applications/networking/irc/irssi/fish { };
+
+  irssi_otr = callPackage ../applications/networking/irc/irssi/otr { };
+
   bip = callPackage ../applications/networking/irc/bip { };
 
+  jack_capture = callPackage ../applications/audio/jack-capture { };
+
+  jack_oscrolloscope = callPackage ../applications/audio/jack-oscrolloscope { };
+
+  jack_rack = callPackage ../applications/audio/jack-rack { };
+
   jackmeter = callPackage ../applications/audio/jackmeter { };
 
+  jalv = callPackage ../applications/audio/jalv { };
+
   jedit = callPackage ../applications/editors/jedit { };
 
   jigdo = callPackage ../applications/misc/jigdo { };
@@ -7183,6 +7609,8 @@ let
 
   kermit = callPackage ../tools/misc/kermit { };
 
+  keymon = callPackage ../applications/video/key-mon { };
+
   kino = callPackage ../applications/video/kino {
     inherit (gnome) libglade;
   };
@@ -7199,6 +7627,10 @@ let
     fftw = fftwSinglePrec;
   };
 
+  caps = callPackage ../applications/audio/caps { };
+
+  lastwatch = callPackage ../applications/audio/lastwatch { };
+
   lci = callPackage ../applications/science/logic/lci {};
 
   ldcpp = callPackage ../applications/networking/p2p/ldcpp {
@@ -7207,11 +7639,14 @@ let
 
   librecad = callPackage ../applications/misc/librecad { };
 
-  libreoffice = callPackage ../applications/office/openoffice/libreoffice.nix {
+  librecad2 = callPackage ../applications/misc/librecad/2.0.nix { };
+
+  libreoffice = callPackage ../applications/office/libreoffice {
     inherit (perlPackages) ArchiveZip CompressZlib;
     inherit (gnome) GConf ORBit2 gnome_vfs;
     zip = zip.override { enableNLS = false; };
     boost = boost149;
+    jdk = openjdk;
     fontsConf = makeFontsConf {
       fontDirectories = [
         freefont_ttf xorg.fontmiscmisc xorg.fontbhttf
@@ -7226,9 +7661,7 @@ let
   links = callPackage ../applications/networking/browsers/links { };
 
   ledger = callPackage ../applications/office/ledger/2.6.3.nix { };
-  ledger3 = callPackage ../applications/office/ledger/3.0.nix {
-    boost = boost149;
-  };
+  ledger3 = callPackage ../applications/office/ledger/3.0.nix { };
 
   links2 = callPackage ../applications/networking/browsers/links2 { };
 
@@ -7250,6 +7683,8 @@ let
 
   matchbox = callPackage ../applications/window-managers/matchbox { };
 
+  mda_lv2 = callPackage ../applications/audio/mda-lv2 { };
+
   meld = callPackage ../applications/version-management/meld {
     inherit (gnome) scrollkeeper;
     pygtk = pyGtkGlade;
@@ -7259,19 +7694,19 @@ let
 
   mercurial = callPackage ../applications/version-management/mercurial {
     inherit (pythonPackages) curses docutils;
-    guiSupport = false;		# use mercurialFull to get hgk GUI
+    guiSupport = false; # use mercurialFull to get hgk GUI
   };
 
   mercurialFull = lowPrio (appendToName "full" (pkgs.mercurial.override { guiSupport = true; }));
 
   merkaartor = callPackage ../applications/misc/merkaartor { };
 
-  meshlab = callPackage ../applications/graphics/meshlab {
-    qt = qt47;
-  };
+  meshlab = callPackage ../applications/graphics/meshlab { };
 
   mhwaveedit = callPackage ../applications/audio/mhwaveedit {};
 
+  mid2key = callPackage ../applications/audio/mid2key { };
+
   midori = builderDefsPackage (import ../applications/networking/browsers/midori) {
     inherit imagemagick intltool python pkgconfig webkit libxml2
       which gettext makeWrapper file libidn sqlite docutils libnotify
@@ -7297,6 +7732,8 @@ let
 
   mmex = callPackage ../applications/office/mmex { };
 
+  monkeysAudio = callPackage ../applications/audio/monkeys-audio { };
+
   monodevelop = callPackage ../applications/editors/monodevelop {
     inherit (gnome) gnome_vfs libbonobo libglade libgnome GConf;
     mozilla = firefox;
@@ -7309,6 +7746,7 @@ let
 
   monotone = callPackage ../applications/version-management/monotone {
     lua = lua5;
+    boost = boost149;
   };
 
   monotoneViz = builderDefsPackage (import ../applications/version-management/monotone-viz/mtn-head.nix) {
@@ -7317,6 +7755,9 @@ let
     inherit (gnome) libgnomecanvas;
   };
 
+  mopidy = callPackage ../applications/audio/mopidy { };
+  mopidy_git = callPackage ../applications/audio/mopidy/git.nix { };
+
   mozilla = callPackage ../applications/networking/browsers/mozilla {
     inherit (gnome) libIDL;
   };
@@ -7338,7 +7779,15 @@ let
 
   ncmpcpp = callPackage ../applications/audio/ncmpcpp { };
 
-  MPlayer = callPackage ../applications/video/MPlayer { };
+  normalize = callPackage ../applications/audio/normalize { };
+
+  mplayer = callPackage ../applications/video/mplayer {
+    pulseSupport = config.pulseaudio or false;
+  };
+
+  mplayer2 = callPackage ../applications/video/mplayer2 {
+    ffmpeg = ffmpeg_1;
+  };
 
   MPlayerPlugin = browser:
     import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
@@ -7358,15 +7807,20 @@ let
     avahi = avahi.override {
       withLibdnssdCompat = true;
     };
-    jackSupport = getConfig [ "mumble" "jackSupport" ] false;
+    jackSupport = config.mumble.jackSupport or false;
   };
 
   mutt = callPackage ../applications/networking/mailreaders/mutt { };
 
   msmtp = callPackage ../applications/networking/msmtp { };
 
-  mupdf = callPackage ../applications/misc/mupdf {
-  };
+  imapfilter = callPackage ../applications/networking/mailreaders/imapfilter.nix {
+    lua = lua5;
+ };
+
+  mupdf = callPackage ../applications/misc/mupdf { };
+
+  mypaint = callPackage ../applications/graphics/mypaint { };
 
   mythtv = callPackage ../applications/video/mythtv { };
 
@@ -7376,29 +7830,32 @@ let
 
   nano = callPackage ../applications/editors/nano { };
 
-  navipowm = callPackage ../applications/misc/navipowm {
-  };
+  navipowm = callPackage ../applications/misc/navipowm { };
 
   navit = callPackage ../applications/misc/navit { };
 
+  netbeans = callPackage ../applications/editors/netbeans { };
+
   ncdu = callPackage ../tools/misc/ncdu { };
 
   nedit = callPackage ../applications/editors/nedit {
-      motif = lesstif;
+    motif = lesstif;
   };
 
   netsurfBrowser = netsurf.browser;
   netsurf = recurseIntoAttrs (import ../applications/networking/browsers/netsurf { inherit pkgs; });
 
   notmuch = callPackage ../applications/networking/mailreaders/notmuch {
-      # use emacsPackages.notmuch if you want emacs support
-      emacs = null;
+    # use emacsPackages.notmuch if you want emacs support
+    emacs = null;
   };
 
   nova = callPackage ../applications/virtualization/nova { };
 
   novaclient = callPackage ../applications/virtualization/nova/client.nix { };
 
+  nspluginwrapper = callPackage ../applications/networking/browsers/mozilla-plugins/nspluginwrapper {};
+
   nvi = callPackage ../applications/editors/nvi { };
 
   ocrad = callPackage ../applications/graphics/ocrad { };
@@ -7407,19 +7864,17 @@ let
 
   ogmtools = callPackage ../applications/video/ogmtools { };
 
+  omxplayer = callPackage ../applications/video/omxplayer {
+    stdenv = overrideGCC stdenv gcc47;
+  };
+
   oneteam = callPackage ../applications/networking/instant-messengers/oneteam {};
 
   openbox = callPackage ../applications/window-managers/openbox { };
 
-  openjump = callPackage ../applications/misc/openjump { };
+  openimageio = callPackage ../applications/graphics/openimageio { };
 
-  openoffice = callPackage ../applications/office/openoffice {
-    inherit (perlPackages) ArchiveZip CompressZlib;
-    inherit (gnome) GConf ORBit2;
-    neon = neon029;
-    libwpd = libwpd_08;
-    zip = zip.override { enableNLS = false; };
-  };
+  openjump = callPackage ../applications/misc/openjump { };
 
   openscad = callPackage ../applications/graphics/openscad {};
 
@@ -7427,6 +7882,8 @@ let
     inherit (pkgs.kde4) kdelibs;
   };
 
+  opusTools = callPackage ../applications/audio/opus-tools { };
+
   pan = callPackage ../applications/networking/newsreaders/pan {
     spellChecking = false;
   };
@@ -7447,10 +7904,14 @@ let
 
   pianobooster = callPackage ../applications/audio/pianobooster { };
 
+  picard = callPackage ../applications/audio/picard { };
+
+  picocom = callPackage ../tools/misc/picocom { };
+
   pidgin = callPackage ../applications/networking/instant-messengers/pidgin {
-    openssl = if (getConfig ["pidgin" "openssl"] true) then openssl else null;
-    gnutls = if (getConfig ["pidgin" "gnutls"] false) then gnutls else null;
-    libgcrypt = if (getConfig ["pidgin" "gnutls"] false) then libgcrypt else null;
+    openssl = if config.pidgin.openssl or true then openssl else null;
+    gnutls = if config.pidgin.gnutls or false then gnutls else null;
+    libgcrypt = if config.pidgin.gnutls or false then libgcrypt else null;
     inherit (gnome) startupnotification;
   };
 
@@ -7482,6 +7943,8 @@ let
 
   pqiv = callPackage ../applications/graphics/pqiv { };
 
+  qiv = callPackage ../applications/graphics/qiv { };
+
   # perhaps there are better apps for this task? It's how I had configured my preivous system.
   # And I don't want to rewrite all rules
   procmail = callPackage ../applications/misc/procmail { };
@@ -7492,20 +7955,18 @@ let
 
   pythonmagick = callPackage ../applications/graphics/PythonMagick { };
 
-  qemu = callPackage ../applications/virtualization/qemu/0.15.nix { };
-
-  qemu_1_0 = callPackage ../applications/virtualization/qemu/1.0.nix { };
-
-  qemu_0_13 = callPackage ../applications/virtualization/qemu/0.13.nix { };
-
-  qemuSVN = callPackage ../applications/virtualization/qemu/svn-6642.nix { };
+  qemu = callPackage ../applications/virtualization/qemu { };
 
   qemuImage = callPackage ../applications/virtualization/qemu/linux-img { };
 
+  qmmp = callPackage ../applications/audio/qmmp { };
+
   qsampler = callPackage ../applications/audio/qsampler { };
 
   qsynth = callPackage ../applications/audio/qsynth { };
 
+  qtcreator = callPackage ../development/qtcreator { };
+
   qtpfsgui = callPackage ../applications/graphics/qtpfsgui { };
 
   qtractor = callPackage ../applications/audio/qtractor { };
@@ -7515,20 +7976,20 @@ let
     fltk = fltk13;
   };
 
+  rapcad = callPackage ../applications/graphics/rapcad {};
+
   rapidsvn = callPackage ../applications/version-management/rapidsvn { };
 
   ratpoison = callPackage ../applications/window-managers/ratpoison { };
 
-  rawtherapee = callPackage ../applications/graphics/rawtherapee { };
+  rawtherapee = callPackage ../applications/graphics/rawtherapee {
+    fftw = fftw.override {float = true;};
+  };
 
   rcs = callPackage ../applications/version-management/rcs { };
 
   rdesktop = callPackage ../applications/networking/remote/rdesktop { };
 
-  RealPlayer = callPackage_i686 ../applications/video/RealPlayer {
-    libstdcpp5 = gcc33.gcc;
-  };
-
   recode = callPackage ../tools/text/recode { };
 
   retroshare = callPackage ../applications/networking/p2p/retroshare {
@@ -7536,15 +7997,15 @@ let
   };
 
   rsync = callPackage ../applications/networking/sync/rsync {
-    enableACLs = !(stdenv.isDarwin || stdenv.isSunOS);
-    enableCopyDevicesPatch = (getConfig ["rsync" "enableCopyDevicesPatch"] false);
+    enableACLs = !(stdenv.isDarwin || stdenv.isSunOS || stdenv.isFreeBSD);
+    enableCopyDevicesPatch = (config.rsync.enableCopyDevicesPatch or false);
   };
 
   rxvt = callPackage ../applications/misc/rxvt { };
 
   # = urxvt
   rxvt_unicode = callPackage ../applications/misc/rxvt_unicode {
-    perlSupport = false;
+    perlSupport = true;
   };
 
   sakura = callPackage ../applications/misc/sakura {
@@ -7569,14 +8030,31 @@ let
 
   siproxd = callPackage ../applications/networking/siproxd { };
 
-  skype_linux = callPackage_i686 ../applications/networking/instant-messengers/skype {
-    usePulseAudio = getConfig [ "pulseaudio" ] false; # disabled by default (the 100% cpu bug)
+  skype = callPackage_i686 ../applications/networking/instant-messengers/skype {
+    usePulseAudio = config.pulseaudio or true;
+  };
+
+  skype4pidgin = callPackage ../applications/networking/instant-messengers/pidgin-plugins/skype4pidgin { };
+
+
+  skype_call_recorder = callPackage ../applications/networking/instant-messengers/skype-call-recorder { };
+
+  st = callPackage ../applications/misc/st {
+    conf = config.st.conf or null;
   };
 
-  st = callPackage ../applications/misc/st { };
+  sxiv = callPackage ../applications/graphics/sxiv { };
+
+  bittorrentSync = callPackage ../applications/networking/bittorrentsync { };
 
   dropbox = callPackage ../applications/networking/dropbox { };
 
+  dropbox-cli = callPackage ../applications/networking/dropbox-cli { };
+
+  lightdm = callPackage ../applications/display-managers/lightdm { };
+
+  lightdm_gtk_greeter = callPackage ../applications/display-managers/lightdm-gtk-greeter { };
+
   slim = callPackage ../applications/display-managers/slim { };
 
   sndBase = builderDefsPackage (import ../applications/audio/snd) {
@@ -7591,6 +8069,8 @@ let
     guile = guile_1_8;
   };
 
+  shntool = callPackage ../applications/audio/shntool { };
+
   sonic_visualiser = callPackage ../applications/audio/sonic-visualiser {
     inherit (pkgs.vamp) vampSDK;
     inherit (pkgs.xlibs) libX11;
@@ -7599,7 +8079,15 @@ let
 
   sox = callPackage ../applications/misc/audio/sox { };
 
-  spotify = callPackage ../applications/audio/spotify { };
+  soxr = callPackage ../applications/misc/audio/soxr { };
+
+  spotify = callPackage ../applications/audio/spotify {
+    inherit (gnome) GConf;
+  };
+
+  libspotify = callPackage ../development/libraries/libspotify {
+    apiKey = config.libspotify.apiKey or null;
+  };
 
   stalonetray = callPackage ../applications/window-managers/stalonetray {};
 
@@ -7608,8 +8096,9 @@ let
     clisp = clisp_2_44_1;
   };
 
+  sublime = callPackage ../applications/editors/sublime { };
+
   subversion = callPackage ../applications/version-management/subversion/default.nix {
-    neon = pkgs.neon029;
     bdbSupport = true;
     httpServer = false;
     httpSupport = true;
@@ -7636,6 +8125,8 @@ let
 
   svk = perlPackages.SVK;
 
+  swh_lv2 = callPackage ../applications/audio/swh-lv2 { };
+
   sylpheed = callPackage ../applications/networking/mailreaders/sylpheed {
     sslSupport = true;
     gpgSupport = true;
@@ -7662,11 +8153,7 @@ let
 
   teamspeak_client = callPackage ../applications/networking/instant-messengers/teamspeak/client.nix { };
 
-  taskjuggler = callPackage ../applications/misc/taskjuggler {
-    # KDE support is not working yet.
-    inherit (kde3) kdelibs kdebase;
-    withKde = getConfig [ "taskJuggler" "kde" ] false;
-  };
+  taskjuggler = callPackage ../applications/misc/taskjuggler { };
 
   taskwarrior = callPackage ../applications/misc/taskwarrior { };
 
@@ -7688,10 +8175,12 @@ let
 
   thinkingRock = callPackage ../applications/misc/thinking-rock { };
 
-  thunderbird = callPackage ../applications/networking/mailreaders/thunderbird/11.x.nix {
+  thunderbird = callPackage ../applications/networking/mailreaders/thunderbird {
     inherit (gnome) libIDL;
   };
 
+  tig = gitAndTools.tig;
+
   timidity = callPackage ../tools/misc/timidity { };
 
   tkcvs = callPackage ../applications/version-management/tkcvs { };
@@ -7702,6 +8191,9 @@ let
     wrapPython = pythonPackages.wrapPython;
   };
 
+  # This builds the gtk client
+  transmission_260 = callPackage ../applications/networking/p2p/transmission/2.60.nix { };
+
   transmission = callPackage ../applications/networking/p2p/transmission { };
 
   transmission_remote_gtk = callPackage ../applications/networking/p2p/transmission-remote-gtk {};
@@ -7717,9 +8209,11 @@ let
     libzrtpcpp = libzrtpcpp_1_6;
   };
 
+  umurmur = callPackage ../applications/networking/umurmur { };
+
   unison = callPackage ../applications/networking/sync/unison {
     inherit (ocamlPackages) lablgtk;
-    enableX11 = getConfig [ "unison" "enableX11" ] true;
+    enableX11 = config.unison.enableX11 or true;
   };
 
   uucp = callPackage ../tools/misc/uucp { };
@@ -7727,12 +8221,17 @@ let
   uwimap = callPackage ../tools/networking/uwimap { };
 
   uzbl = builderDefsPackage (import ../applications/networking/browsers/uzbl) {
-    inherit pkgconfig webkit makeWrapper glib_networking;
-    inherit gtk3 glib;
+    inherit pkgconfig webkit makeWrapper glib_networking python3;
+    inherit glib pango cairo gdk_pixbuf atk;
     inherit (xlibs) libX11 kbproto;
     inherit (gnome) libsoup;
+    gtk = gtk3;
   };
 
+  vanitygen = callPackage ../applications/misc/vanitygen { };
+
+  vbindiff = callPackage ../applications/editors/vbindiff { };
+
   vdpauinfo = callPackage ../tools/X11/vdpauinfo { };
 
   veracity = callPackage ../applications/version-management/veracity {};
@@ -7749,21 +8248,17 @@ let
   vimHugeX = vim_configurable;
 
   vim_configurable = import ../applications/editors/vim/configurable.nix {
-    inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext composableDerivation lib
-      getConfig;
-    inherit (pkgs.xlibs) libX11 libXext libSM libXpm
-        libXt libXaw libXau libXmu libICE;
+    inherit (pkgs) fetchurl stdenv ncurses pkgconfig gettext composableDerivation lib config;
+    inherit (pkgs.xlibs) libX11 libXext libSM libXpm libXt libXaw libXau libXmu libICE;
     inherit (pkgs) glib gtk;
     features = "huge"; # one of  tiny, small, normal, big or huge
     # optional features by passing
     # python
     # TODO mzschemeinterp perlinterp
     inherit (pkgs) python perl tcl ruby /*x11*/;
-
     lua = pkgs.lua5;
-
     # optional features by flags
-    flags = [ "X11" ]; # only flag "X11" by now
+    flags = [ "python" "X11" ]; # only flag "X11" by now
   };
 
   virtviewer = callPackage ../applications/virtualization/virt-viewer {};
@@ -7781,7 +8276,9 @@ let
     inherit (xlibs) libX11;
   };
 
-  vlc = callPackage ../applications/video/vlc { };
+  vlc = callPackage ../applications/video/vlc {
+    ffmpeg = ffmpeg_1;
+  };
 
   vnstat = callPackage ../applications/networking/vnstat { };
 
@@ -7797,7 +8294,12 @@ let
 
   weechat = callPackage ../applications/networking/irc/weechat { };
 
-  wings = callPackage ../applications/graphics/wings { };
+  wings = callPackage ../applications/graphics/wings {
+    erlang = erlangR14B04;
+    esdl = esdl.override { erlang = erlangR14B04; };
+  };
+
+  wmname = callPackage ../applications/misc/wmname { };
 
   # I'm keen on wmiimenu only  >wmii-3.5 no longer has it...
   wmiimenu = import ../applications/window-managers/wmii31 {
@@ -7810,37 +8312,44 @@ let
     libixp = libixp_for_wmii;
     inherit fetchurl /* fetchhg */ stdenv gawk;
     inherit (xlibs) libX11 xextproto libXt libXext;
-    includeUnpack = getConfig ["stdenv" "includeUnpack"] false;
+    includeUnpack = config.stdenv.includeUnpack or false;
   };
 
   wordnet = callPackage ../applications/misc/wordnet { };
 
+  wrapChromium = browser: wrapFirefox {
+    inherit browser;
+    browserName = browser.packageName;
+    desktopName = "Chromium";
+    icon = "${browser}/share/icons/hicolor/48x48/apps/${browser.packageName}.png";
+  };
+
   wrapFirefox =
     { browser, browserName ? "firefox", desktopName ? "Firefox", nameSuffix ? ""
     , icon ? "${browser}/lib/${browser.name}/icons/mozicon128.png" }:
+    let
+      cfg = stdenv.lib.attrByPath [ browserName ] {} config;
+      enableAdobeFlash = cfg.enableAdobeFlash or true;
+      enableGnash = cfg.enableGnash or false;
+    in
     import ../applications/networking/browsers/firefox/wrapper.nix {
       inherit stdenv makeWrapper makeDesktopItem browser browserName desktopName nameSuffix icon;
       plugins =
-        let
-          enableAdobeFlash = getConfig [ browserName "enableAdobeFlash" ] true;
-          enableGnash = getConfig [ browserName "enableGnash" ] false;
-        in
          assert !(enableGnash && enableAdobeFlash);
          ([ ]
           ++ lib.optional enableGnash gnash
           ++ lib.optional enableAdobeFlash flashplayer
-          # RealPlayer is disabled by default for legal reasons.
-          ++ lib.optional (system != "i686-linux" && getConfig [browserName "enableRealPlayer"] false) RealPlayer
-          ++ lib.optional (getConfig [browserName "enableDjvu"] false) (djview4)
-          ++ lib.optional (getConfig [browserName "enableMPlayer"] false) (MPlayerPlugin browser)
-          ++ lib.optional (getConfig [browserName "enableGeckoMediaPlayer"] false) gecko_mediaplayer
-          ++ lib.optional (supportsJDK && getConfig [browserName "jre"] false && jrePlugin ? mozillaPlugin) jrePlugin
-          ++ lib.optional (getConfig [browserName "enableGoogleTalkPlugin"] false) google_talk_plugin
+          ++ lib.optional (cfg.enableDjvu or false) (djview4)
+          ++ lib.optional (cfg.enableMPlayer or false) (MPlayerPlugin browser)
+          ++ lib.optional (cfg.enableGeckoMediaPlayer or false) gecko_mediaplayer
+          ++ lib.optional (supportsJDK && cfg.jre or false && jrePlugin ? mozillaPlugin) jrePlugin
+          ++ lib.optional (cfg.enableGoogleTalkPlugin or false) google_talk_plugin
          );
       libs =
-        if getConfig [ browserName "enableQuakeLive" ] false
+        if cfg.enableQuakeLive or false
         then with xlibs; [ stdenv.gcc libX11 libXxf86dga libXxf86vm libXext libXt alsaLib zlib ]
         else [ ];
+      gtk_modules = [ libcanberra ];
     };
 
   x11vnc = callPackage ../tools/X11/x11vnc { };
@@ -7859,6 +8368,12 @@ let
 
   xbindkeys = callPackage ../tools/X11/xbindkeys { };
 
+  xbmc = callPackage ../applications/video/xbmc { };
+
+  xcalib = callPackage ../tools/X11/xcalib { };
+
+  xchainkeys = callPackage ../tools/X11/xchainkeys { };
+
   xchat = callPackage ../applications/networking/irc/xchat { };
 
   xchm = callPackage ../applications/misc/xchm { };
@@ -7875,10 +8390,12 @@ let
 
   xen = callPackage ../applications/virtualization/xen { };
 
-  xfig = callPackage ../applications/graphics/xfig {
-    stdenv = overrideGCC stdenv gcc34;
+  xfe = callPackage ../applications/misc/xfe {
+    fox = fox_1_6;
   };
 
+  xfig = callPackage ../applications/graphics/xfig { };
+
   xineUI = callPackage ../applications/video/xine-ui { };
 
   xneur_0_13 = callPackage ../applications/misc/xneur { };
@@ -7900,12 +8417,11 @@ let
     base14Fonts = "${ghostscript}/share/ghostscript/fonts";
   };
 
-  libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix {
-  };
+  xkb_switch = callPackage ../tools/X11/xkb-switch { };
 
-  xpra = callPackage ../tools/X11/xpra {
-    inherit (pythonPackages) notify;
-  };
+  libxpdf = callPackage ../applications/misc/xpdf/libxpdf.nix { };
+
+  xpra = callPackage ../tools/X11/xpra { };
 
   xscreensaver = callPackage ../misc/screensavers/xscreensaver {
     inherit (gnome) libglade;
@@ -7940,7 +8456,13 @@ let
     fltk = fltk13;
   };
 
-  zathura = callPackage ../applications/misc/zathura { };
+  zathuraCollection = recurseIntoAttrs
+    (let callPackage = newScope pkgs.zathuraCollection; in
+      import ../applications/misc/zathura { inherit callPackage pkgs fetchurl; });
+
+  zathura = zathuraCollection.zathuraWrapper;
+
+  girara = callPackage ../applications/misc/girara { };
 
   zgrviewer = callPackage ../applications/graphics/zgrviewer {};
 
@@ -7952,6 +8474,8 @@ let
 
   andyetitmoves = if stdenv.isLinux then callPackage ../games/andyetitmoves {} else null;
 
+  anki = callPackage ../games/anki { };
+
   asc = callPackage ../games/asc {
     lua = lua5;
     libsigcxx = libsigcxx12;
@@ -7971,7 +8495,9 @@ let
 
   blackshadeselite = callPackage ../games/blackshadeselite { };
 
-  blobby = callPackage ../games/blobby {};
+  blobby = callPackage ../games/blobby {
+    boost = boost149;
+  };
 
   bsdgames = callPackage ../games/bsdgames { };
 
@@ -7981,10 +8507,10 @@ let
 
   castle_combat = callPackage ../games/castle-combat { };
 
-  construoBase = callPackage ../games/construo {
+  construoBase = lowPrio (callPackage ../games/construo {
     mesa = null;
     freeglut = null;
-  };
+  });
 
   construo = construoBase.override {
     inherit mesa freeglut;
@@ -7994,9 +8520,19 @@ let
 
   crrcsim = callPackage ../games/crrcsim {};
 
+  dhewm3 = callPackage ../games/dhewm3 {};
+
+  drumkv1 = callPackage ../applications/audio/drumkv1 { };
+
   dwarf_fortress = callPackage_i686 ../games/dwarf-fortress { };
 
-  eduke32 = callPackage ../games/eduke32 { };
+  d1x_rebirth = callPackage ../games/d1x-rebirth { };
+
+  d2x_rebirth = callPackage ../games/d2x-rebirth { };
+
+  eduke32 = callPackage ../games/eduke32 {
+    stdenv = overrideGCC stdenv gcc47;
+  };
 
   egoboo = callPackage ../games/egoboo { };
 
@@ -8005,14 +8541,7 @@ let
     libpng = libpng12;
   };
 
-  /*
-  exultSnapshot = lowPrio (import ../games/exult/snapshot.nix {
-    inherit fetchurl stdenv SDL SDL_mixer zlib libpng unzip
-      autoconf automake libtool flex bison;
-  });
-  */
-
-  flightgear = callPackage ../games/flightgear {};
+  flightgear = callPackage ../games/flightgear { };
 
   freeciv = callPackage ../games/freeciv { };
 
@@ -8036,9 +8565,10 @@ let
 
   gnugo = callPackage ../games/gnugo { };
 
-  gparted = callPackage ../tools/misc/gparted {
-    parted = parted_2_3;
-    inherit (gnome) gnomedocutils;
+  gparted = callPackage ../tools/misc/gparted { };
+
+  gsmartcontrol = callPackage ../tools/misc/gsmartcontrol {
+    inherit (gnome) libglademm;
   };
 
   gtypist = callPackage ../games/gtypist { };
@@ -8059,6 +8589,8 @@ let
     inherit libpng zlib;
   };
 
+  lincity_ng = callPackage ../games/lincity/ng.nix {};
+
   mars = callPackage ../games/mars { };
 
   micropolis = callPackage ../games/micropolis { };
@@ -8075,6 +8607,8 @@ let
 
   opentyrian = callPackage ../games/opentyrian { };
 
+  pingus = callPackage ../games/pingus {};
+
   pioneers = callPackage ../games/pioneers { };
 
   pong3d = callPackage ../games/pong3d { };
@@ -8098,14 +8632,19 @@ let
     mygui = myguiSvn;
   };
 
+  rili = callPackage ../games/rili { };
+
   rogue = callPackage ../games/rogue { };
 
+  samplv1 = callPackage ../applications/audio/samplv1 { };
+
   sauerbraten = callPackage ../games/sauerbraten {};
 
+  scid = callPackage ../games/scid { };
+
   scummvm = callPackage ../games/scummvm { };
 
-  scorched3d = callPackage ../games/scorched3d {
-  };
+  scorched3d = callPackage ../games/scorched3d { };
 
   sgtpuzzles = builderDefsPackage (import ../games/sgt-puzzles) {
     inherit pkgconfig fetchsvn perl gtk;
@@ -8114,10 +8653,6 @@ let
 
   simutrans = callPackage ../games/simutrans { };
 
-  six = callPackage ../games/six {
-    inherit (kde3) arts kdelibs;
-  };
-
   soi = callPackage ../games/soi {};
 
   # You still can override by passing more arguments.
@@ -8133,12 +8668,9 @@ let
 
   superTux = callPackage ../games/super-tux { };
 
-  superTuxKart = callPackage ../games/super-tux-kart {
-    /* With GNU Make 3.82, the build process is stuck in the `data'
-       directory, after displaying "Making all in tracks", and `pstree'
-       indicates that `make' doesn't launch any new process.  */
-    stdenv = overrideInStdenv stdenv [ gnumake381 ];
-  };
+  superTuxKart = callPackage ../games/super-tux-kart { };
+
+  synthv1 = callPackage ../applications/audio/synthv1 { };
 
   tbe = callPackage ../games/the-butterfly-effect {};
 
@@ -8155,22 +8687,19 @@ let
   speed_dreams = callPackage ../games/speed-dreams {
     # Torcs wants to make shared libraries linked with plib libraries (it provides static).
     # i686 is the only platform I know than can do that linking without plib built with -fPIC
-    plib = plib.override { enablePIC = if stdenv.isi686 then false else true; };
+    plib = plib.override { enablePIC = !stdenv.isi686; };
     libpng = libpng12;
   };
 
   torcs = callPackage ../games/torcs {
     # Torcs wants to make shared libraries linked with plib libraries (it provides static).
     # i686 is the only platform I know than can do that linking without plib built with -fPIC
-    plib = plib.override { enablePIC = if stdenv.isi686 then false else true; };
+    plib = plib.override { enablePIC = !stdenv.isi686; };
   };
 
   trigger = callPackage ../games/trigger { };
 
-  ufoai = callPackage ../games/ufoai {
-    inherit (gnome) gtksourceview gtkglext;
-    libpng = libpng12;
-  };
+  ufoai = callPackage ../games/ufoai { };
 
   ultimatestunts = callPackage ../games/ultimatestunts { };
 
@@ -8178,6 +8707,10 @@ let
     lua = lua5;
   };
 
+  unvanquished = callPackage ../games/unvanquished { };
+
+  uqm = callPackage ../games/uqm { };
+
   urbanterror = callPackage ../games/urbanterror { };
 
   ut2004demo = callPackage ../games/ut2004demo { };
@@ -8186,6 +8719,8 @@ let
 
   vectoroids = callPackage ../games/vectoroids { };
 
+  vessel = callPackage_i686 ../games/vessel { };
+
   warmux = callPackage ../games/warmux { };
 
   warsow = callPackage ../games/warsow {
@@ -8198,12 +8733,14 @@ let
     libpng = libpng12;
   };
 
-  xboard = builderDefsPackage (import ../games/xboard) {
-    inherit (xlibs) libX11 xproto libXt libXaw libSM
-      libICE libXmu libXext libXpm;
-    inherit gnuchess texinfo;
+  worldofgoo_demo = callPackage ../games/worldofgoo {
+    demo = true;
   };
 
+  worldofgoo = callPackage ../games/worldofgoo { };
+
+  xboard =  callPackage ../games/xboard { };
+
   xconq = callPackage ../games/xconq {};
 
   # TODO: the corresponding nix file is missing
@@ -8229,10 +8766,10 @@ let
 
   enlightenment = callPackage ../desktops/enlightenment { };
 
-  # e17 = recurseIntoAttrs (
-  #   let callPackage = newScope pkgs.e17; in
-  #   import ../desktops/e17 { inherit callPackage pkgs; }
-  # );
+  e17 = recurseIntoAttrs (
+    let callPackage = newScope pkgs.e17; in
+    import ../desktops/e17 { inherit callPackage pkgs; }
+  );
 
   gnome2 = callPackage ../desktops/gnome-2 {
     callPackage = pkgs.newScope pkgs.gnome2;
@@ -8244,34 +8781,40 @@ let
 
   gnome = recurseIntoAttrs gnome2;
 
-  kde3 = recurseIntoAttrs {
-
-    kdelibs = callPackage ../desktops/kde-3/kdelibs {
-      stdenv = overrideGCC stdenv gcc43;
-    };
-
-    arts = callPackage ../development/libraries/arts {
-      inherit (pkgs.kde3) kdelibs;
-    };
-
-  };
-
-  kde4 = recurseIntoAttrs pkgs.kde47;
-
-  kde47 = kdePackagesFor pkgs.kde47 "4.7";
-
-  kde48 = kdePackagesFor pkgs.kde48 "4.8";
-
-  kdePackagesFor = self: version:
+  kde4 = recurseIntoAttrs pkgs.kde48;
+
+  kde47 = kdePackagesFor (pkgs.kde47 // {
+      boost = boost149;
+      eigen = eigen2;
+      libotr = libotr_3_2;
+      libgphoto2 = libgphoto2_4;
+    }) ../desktops/kde-4.7;
+
+  kde48 = kdePackagesFor (pkgs.kde48 // {
+      boost = boost149;
+      eigen = eigen2;
+      libotr = libotr_3_2;
+      libgphoto2 = libgphoto2_4;
+    }) ../desktops/kde-4.8;
+
+  kde410 = kdePackagesFor (pkgs.kde410 // {
+      boost = boost149;
+      eigen = eigen2;
+      libotr = libotr_3_2;
+    }) ../desktops/kde-4.10;
+
+  kdePackagesFor = self: dir:
     let callPackageOrig = callPackage; in
     let
       callPackage = newScope self;
-      kde4 = callPackageOrig (../desktops/kde- + version) {
+      kde4 = callPackageOrig dir {
         inherit callPackage callPackageOrig;
       };
     in kde4 // {
       inherit kde4;
 
+      wrapper = callPackage ../build-support/kdewrapper {};
+
       recurseForRelease = true;
 
       akunambol = callPackage ../applications/networking/sync/akunambol { };
@@ -8286,9 +8829,10 @@ let
 
       calligra = callPackage ../applications/office/calligra { };
 
-      digikam = callPackage ../applications/graphics/digikam {
-        boost = boost147;
-      };
+      digikam = if builtins.compareVersions "4.9" kde4.release == 1 then
+          callPackage ../applications/graphics/digikam/2.nix { }
+        else
+          callPackage ../applications/graphics/digikam { };
 
       k3b = callPackage ../applications/misc/k3b { };
 
@@ -8296,8 +8840,6 @@ let
 
       kbibtex = callPackage ../applications/office/kbibtex { };
 
-      kbluetooth = callPackage ../tools/bluetooth/kbluetooth { };
-
       kde_wacomtablet = callPackage ../applications/misc/kde-wacomtablet { };
 
       kdenlive = callPackage ../applications/video/kdenlive { };
@@ -8318,12 +8860,6 @@ let
 
       kipi_plugins = callPackage ../applications/graphics/kipi-plugins { };
 
-      koffice = callPackage ../applications/office/koffice {
-        boost = boost147;
-      };
-
-      konq_plugins = callPackage ../applications/networking/browsers/konq-plugins { };
-
       konversation = callPackage ../applications/networking/irc/konversation { };
 
       krename = callPackage ../applications/misc/krename { };
@@ -8366,6 +8902,8 @@ let
 
       rekonq = callPackage ../applications/networking/browsers/rekonq { };
 
+      kwebkitpart = callPackage ../applications/networking/browsers/kwebkitpart { };
+
       rsibreak = callPackage ../applications/misc/rsibreak { };
 
       semnotes = callPackage ../applications/misc/semnotes { };
@@ -8388,23 +8926,26 @@ let
 
   oxygen_gtk = callPackage ../misc/themes/gtk2/oxygen-gtk { };
 
-  xfce = xfce48;
-
-  xfce46 = recurseIntoAttrs
-    (let callPackage = newScope pkgs.xfce46; in
-     import ../desktops/xfce-4.6 { inherit callPackage pkgs; });
-
-  xfce48 = recurseIntoAttrs
-    (let callPackage = newScope pkgs.xfce48; in
-     import ../desktops/xfce-4.8 { inherit callPackage pkgs; });
-
+  xfce = xfce4_10;
+  xfce4_10 = recurseIntoAttrs (import ../desktops/xfce { inherit pkgs newScope; });
 
   ### SCIENCE
 
+  celestia = callPackage ../applications/science/astronomy/celestia {
+    lua = lua5_1;
+    inherit (xlibs) libXmu;
+    inherit (pkgs.gnome) gtkglext;
+  };
+
   xplanet = callPackage ../applications/science/astronomy/xplanet { };
 
   gravit = callPackage ../applications/science/astronomy/gravit { };
 
+  spyder = callPackage ../applications/science/spyder {
+    inherit (pythonPackages) pyflakes rope sphinx numpy scipy matplotlib; # recommended
+    inherit (pythonPackages) ipython pylint pep8; # optional
+  };
+
   stellarium = callPackage ../applications/science/astronomy/stellarium { };
 
   ### SCIENCE/GEOMETRY
@@ -8447,8 +8988,6 @@ let
 
   paml = callPackage ../applications/science/biology/paml { };
 
-  /* slr = callPackage ../applications/science/biology/slr { }; */
-
   pal2nal = callPackage ../applications/science/biology/pal2nal { };
 
 
@@ -8476,6 +9015,21 @@ let
 
   openblas = callPackage ../development/libraries/science/math/openblas { };
 
+
+  ### SCIENCE/MOLECULAR-DYNAMICS
+
+  gromacs = callPackage ../applications/science/molecular-dynamics/gromacs {
+    singlePrec = true;
+    fftw = fftwSinglePrec;
+    cmake = cmakeCurses;
+  };
+
+  gromacsDouble = lowPrio (callPackage ../applications/science/molecular-dynamics/gromacs {
+    singlePrec = false;
+    fftw = fftw;
+    cmake = cmakeCurses;
+  });
+
   ### SCIENCE/LOGIC
 
   coq = callPackage ../applications/science/logic/coq {
@@ -8490,7 +9044,9 @@ let
 
   cvc3 = callPackage ../applications/science/logic/cvc3 {};
 
-  eprover = callPackage ../applications/science/logic/eProver {
+  ekrhyper = callPackage ../applications/science/logic/ekrhyper {};
+
+  eprover = callPackage ../applications/science/logic/eprover {
     texLive = texLiveAggregationFun {
       paths = [
         texLive texLiveExtra
@@ -8516,6 +9072,8 @@ let
 
   leo2 = callPackage ../applications/science/logic/leo2 {};
 
+  logisim = callPackage ../applications/science/logic/logisim {};
+
   matita = callPackage ../applications/science/logic/matita {
     ocaml = ocaml_3_11_2;
     inherit (ocamlPackages_3_11_2) findlib lablgtk ocaml_expat gmetadom ocaml_http
@@ -8532,6 +9090,8 @@ let
 
   opensmt = callPackage ../applications/science/logic/opensmt { };
 
+  otter = callPackage ../applications/science/logic/otter {};
+
   picosat = callPackage ../applications/science/logic/picosat {};
 
   prover9 = callPackage ../applications/science/logic/prover9 { };
@@ -8541,7 +9101,6 @@ let
   spass = callPackage ../applications/science/logic/spass {};
 
   ssreflect = callPackage ../applications/science/logic/ssreflect {
-    coq = coq_8_3;
     camlp5 = ocamlPackages.camlp5_transitional;
   };
 
@@ -8549,11 +9108,15 @@ let
 
   ### SCIENCE / ELECTRONICS
 
+  eagle = callPackage_i686 ../applications/science/electronics/eagle { };
+
   caneda = callPackage ../applications/science/electronics/caneda { };
 
   gtkwave = callPackage ../applications/science/electronics/gtkwave { };
 
-  kicad = callPackage ../applications/science/electronics/kicad { };
+  kicad = callPackage ../applications/science/electronics/kicad {
+    wxGTK = wxGTK29;
+  };
 
   ngspice = callPackage ../applications/science/electronics/ngspice { };
 
@@ -8576,6 +9139,11 @@ let
 
   pari = callPackage ../applications/science/math/pari {};
 
+  R = callPackage ../applications/science/math/R {
+    inherit (xlibs) libX11 libXt;
+    texLive = texLiveAggregationFun { paths = [ texLive texLiveExtra ]; };
+  };
+
   singular = callPackage ../applications/science/math/singular {};
 
   scilab = callPackage ../applications/science/math/scilab {
@@ -8642,27 +9210,16 @@ let
 
   foomatic_filters = callPackage ../misc/drivers/foomatic-filters {};
 
-  freestyle = callPackage ../misc/freestyle {
-    #stdenv = overrideGCC stdenv gcc41;
-  };
+  freestyle = callPackage ../misc/freestyle { };
 
-  gajim = builderDefsPackage (import ../applications/networking/instant-messengers/gajim) {
-    inherit perl intltool pyGtkGlade gettext pkgconfig makeWrapper pygobject
-      pyopenssl gtkspell libsexy pycrypto aspell pythonDBus pythonSexy
-      docutils gtk;
-    dbus = dbus.libs;
-    inherit (gnome) libglade;
-    inherit (xlibs) libXScrnSaver libXt xproto libXext xextproto libX11
-      scrnsaverproto;
-    python = pythonFull;
-  };
+  gajim = callPackage ../applications/networking/instant-messengers/gajim { };
 
   gensgs = callPackage_i686 ../misc/emulators/gens-gs { };
 
   ghostscript = callPackage ../misc/ghostscript {
     x11Support = false;
-    cupsSupport = getConfig [ "ghostscript" "cups" ] true;
-    gnuFork = getConfig [ "ghostscript" "gnu" ] false;
+    cupsSupport = config.ghostscript.cups or true;
+    gnuFork = config.ghostscript.gnu or false;
   };
 
   ghostscriptX = appendToName "with-X" (ghostscript.override {
@@ -8671,6 +9228,8 @@ let
 
   gxemul = callPackage ../misc/gxemul { };
 
+  hatari = callPackage ../misc/emulators/hatari { };
+
   hplip = callPackage ../misc/drivers/hplip { };
 
   # using the new configuration style proposal which is unstable
@@ -8682,13 +9241,12 @@ let
 
   lazylist = callPackage ../tools/typesetting/tex/lazylist { };
 
-  lilypond = callPackage ../misc/lilypond { };
+  lilypond = callPackage ../misc/lilypond { guile = guile_1_8; };
 
   martyr = callPackage ../development/libraries/martyr { };
 
-  maven = callPackage ../misc/maven/maven-1.0.nix { };
-  maven2 = callPackage ../misc/maven { };
-  maven3 = callPackage ../misc/maven/3.0.nix { };
+  maven = maven3;
+  maven3 = callPackage ../misc/maven { jdk = openjdk; };
 
   mess = callPackage ../misc/emulators/mess {
     inherit (pkgs.gnome) GConf;
@@ -8696,42 +9254,39 @@ let
 
   mupen64plus = callPackage ../misc/emulators/mupen64plus { };
 
+  mupen64plus1_5 = callPackage ../misc/emulators/mupen64plus/1.5.nix { };
+
   nix = nixStable;
 
   nixStable = callPackage ../tools/package-management/nix {
-    storeDir = getConfig [ "nix" "storeDir" ] "/nix/store";
-    stateDir = getConfig [ "nix" "stateDir" ] "/nix/var";
+    storeDir = config.nix.storeDir or "/nix/store";
+    stateDir = config.nix.stateDir or "/nix/var";
   };
 
+  nixUnstable = nixStable;
+  /*
   nixUnstable = callPackage ../tools/package-management/nix/unstable.nix {
-    storeDir = getConfig [ "nix" "storeDir" ] "/nix/store";
-    stateDir = getConfig [ "nix" "stateDir" ] "/nix/var";
-  };
-
-  nixCustomFun = src: preConfigure: enableScripts: configureFlags:
-    import ../tools/package-management/nix/custom.nix {
-      inherit fetchurl stdenv perl curl bzip2 openssl src preConfigure automake
-        autoconf libtool configureFlags enableScripts lib libxml2 boehmgc
-        pkgconfig flex bison sqlite perlPackages;
-      aterm = aterm25;
-      db4 = db45;
-      inherit docbook5_xsl libxslt docbook5 docbook_xml_dtd_43 w3m;
-    };
+    storeDir = config.nix.storeDir or "/nix/store";
+    stateDir = config.nix.stateDir or "/nix/var";
+  };
+  */
 
   nut = callPackage ../applications/misc/nut { };
 
-  nut_2_6_3 = callPackage ../applications/misc/nut/2.6.3.nix { };
+  solfege = callPackage ../misc/solfege {
+      pysqlite = pkgs.pythonPackages.sqlite3;
+  };
 
   disnix = callPackage ../tools/package-management/disnix { };
 
   disnix_activation_scripts = callPackage ../tools/package-management/disnix/activation-scripts {
-    enableApacheWebApplication = getConfig ["disnix" "enableApacheWebApplication"] false;
-    enableAxis2WebService = getConfig ["disnix" "enableAxis2WebService"] false;
-    enableEjabberdDump = getConfig ["disnix" "enableEjabberdDump"] false;
-    enableMySQLDatabase = getConfig ["disnix" "enableMySQLDatabase"] false;
-    enablePostgreSQLDatabase = getConfig ["disnix" "enablePostgreSQLDatabase"] false;
-    enableSubversionRepository = getConfig ["disnix" "enableSubversionRepository"] false;
-    enableTomcatWebApplication = getConfig ["disnix" "enableTomcatWebApplication"] false;
+    enableApacheWebApplication = config.disnix.enableApacheWebApplication or false;
+    enableAxis2WebService = config.disnix.enableAxis2WebService or false;
+    enableEjabberdDump = config.disnix.enableEjabberdDump or false;
+    enableMySQLDatabase = config.disnix.enableMySQLDatabase or false;
+    enablePostgreSQLDatabase = config.disnix.enablePostgreSQLDatabase or false;
+    enableSubversionRepository = config.disnix.enableSubversionRepository or false;
+    enableTomcatWebApplication = config.disnix.enableTomcatWebApplication or false;
   };
 
   disnixos = callPackage ../tools/package-management/disnix/disnixos { };
@@ -8775,16 +9330,26 @@ let
 
   xlockmore = callPackage ../misc/screensavers/xlockmore { };
 
-  saneBackends = callPackage ../misc/sane-backends {
-    gt68xxFirmware = getConfig ["sane" "gt68xxFirmware"] null;
-    hotplugSupport = getConfig ["sane" "hotplugSupport"] true;
+  samsungUnifiedLinuxDriver = import ../misc/cups/drivers/samsung {
+    inherit fetchurl stdenv;
+    inherit cups ghostscript glibc patchelf;
+    gcc = import ../development/compilers/gcc/4.4 {
+      inherit stdenv fetchurl texinfo gmp mpfr noSysDirs gettext which;
+      profiledCompiler = true;
+    };
   };
 
-  saneBackendsSnapshot = callPackage ../misc/sane-backends/snapshot.nix {
-    gt68xxFirmware = getConfig ["sane" "gt68xxFirmware"] null;
+  saneBackends = callPackage ../applications/graphics/sane/backends.nix {
+    gt68xxFirmware = config.sane.gt68xxFirmware or null;
+    hotplugSupport = config.sane.hotplugSupport or true;
   };
 
-  saneFrontends = callPackage ../misc/sane-front { };
+  saneBackendsGit = callPackage ../applications/graphics/sane/backends-git.nix {
+    gt68xxFirmware = config.sane.gt68xxFirmware or null;
+    hotplugSupport = config.sane.hotplugSupport or true;
+  };
+
+  saneFrontends = callPackage ../applications/graphics/sane/frontends.nix { };
 
   slock = callPackage ../misc/screensavers/slock { };
 
@@ -8813,7 +9378,7 @@ let
 
   texLiveFull = lib.setName "texlive-full" (texLiveAggregationFun {
     paths = [ texLive texLiveExtra lmodern texLiveCMSuper texLiveLatexXColor
-              texLivePGF texLiveBeamer texLiveModerncv tipa ];
+              texLivePGF texLiveBeamer texLiveModerncv tipa tex4ht texinfo5 ];
   });
 
   /* Look in configurations/misc/raskin.nix for usage example (around revisions
@@ -8861,8 +9426,12 @@ let
     inherit texLive unzip;
   };
 
+  thinkfan = callPackage ../tools/system/thinkfan { };
+
   vice = callPackage ../misc/emulators/vice { };
 
+  viewnior = callPackage ../applications/graphics/viewnior { };
+
   vimprobable2 = callPackage ../applications/networking/browsers/vimprobable2 {
     inherit (gnome) libsoup;
     webkit = webkit_gtk2;
@@ -8877,14 +9446,21 @@ let
   # Wine cannot be built in 64-bit; use a 32-bit build instead.
   wine = callPackage_i686 ../misc/emulators/wine { };
 
-  wineWarcraft = callPackage_i686 ../misc/emulators/wine/wine-warcraft.nix { };
+  # winetricks is a shell script with no binary components. Safe to just use the current platforms
+  # build instead of the i686 specific build.
+  winetricks = callPackage ../misc/emulators/wine/winetricks.nix {
+    inherit (gnome2) zenity;
+  };
+
+  wxmupen64plus = callPackage ../misc/emulators/wxmupen64plus { };
 
   x2x = callPackage ../tools/X11/x2x { };
 
   xosd = callPackage ../misc/xosd { };
 
-  xsane = callPackage ../misc/xsane {
+  xsane = callPackage ../applications/graphics/sane/xsane.nix {
     libpng = libpng12;
+    saneBackends = saneBackends;
   };
 
   yafc = callPackage ../applications/networking/yafc { };
@@ -8894,10 +9470,16 @@ let
     inherit (stdenv) mkDerivation;
   };
 
-  zsnes = callPackage_i686 ../misc/emulators/zsnes { };
+  znc = callPackage ../applications/networking/znc { };
+
+  zsnes = callPackage_i686 ../misc/emulators/zsnes {
+    libpng = libpng12;
+  };
 
   misc = import ../misc/misc.nix { inherit pkgs stdenv; };
 
   bullet = callPackage ../development/libraries/bullet {};
 
+  dart = callPackage ../development/interpreters/dart { };
+
 }; in pkgs
diff --git a/pkgs/top-level/haskell-defaults.nix b/pkgs/top-level/haskell-defaults.nix
index e076a92350d..23573478e39 100644
--- a/pkgs/top-level/haskell-defaults.nix
+++ b/pkgs/top-level/haskell-defaults.nix
@@ -8,7 +8,7 @@
 # The actual Haskell packages are composed in haskell-packages.nix. There is
 # more documentation in there.
 
-{ makeOverridable, lowPrio, stdenv, pkgs, newScope, getConfig, callPackage } : rec {
+{ makeOverridable, lowPrio, stdenv, pkgs, newScope, config, callPackage } : rec {
 
   # Preferences functions.
   #
@@ -18,20 +18,35 @@
   ghcHEADPrefs =
     self : self.haskellPlatformArgs_future self // {
       haskellPlatform = null;
-      binary = null; # now a core package
+      extensibleExceptions = self.extensibleExceptions_0_1_1_4;
+    };
+
+  ghc763Prefs =
+    self : self.haskellPlatformArgs_2013_2_0_0 self // {
+      haskellPlatform = self.haskellPlatform_2013_2_0_0;
+      extensibleExceptions = self.extensibleExceptions_0_1_1_4;
+    };
+
+  ghc742Prefs =
+    self : self.haskellPlatformArgs_2012_4_0_0 self // {
+      haskellPlatform = self.haskellPlatform_2012_4_0_0;
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc741Prefs =
     self : self.haskellPlatformArgs_2012_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2012_2_0_0;
-      binary = null; # now a core package
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc722Prefs =
     self : self.haskellPlatformArgs_2012_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2012_2_0_0;
-      binary = null; # a core package
-      deepseq = self.deepseq_1_3_0_0;
+      deepseq = self.deepseq_1_3_0_1;
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc721Prefs = ghc722Prefs;
@@ -39,17 +54,23 @@
   ghc704Prefs =
     self : self.haskellPlatformArgs_2011_4_0_0 self // {
       haskellPlatform = self.haskellPlatform_2011_4_0_0;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
       cabalInstall_0_14_0 = self.cabalInstall_0_14_0.override { Cabal = self.Cabal_1_14_0; };
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; };
       monadPar = self.monadPar_0_1_0_3;
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      prettyShow = self.prettyShow_1_2;
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc703Prefs =
     self : self.haskellPlatformArgs_2011_2_0_1 self // {
       haskellPlatform = self.haskellPlatform_2011_2_0_1;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
       cabalInstall_0_14_0 = self.cabalInstall_0_14_0.override { Cabal = self.Cabal_1_14_0; zlib = self.zlib_0_5_3_3; };
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; zlib = self.zlib_0_5_3_3; };
       monadPar = self.monadPar_0_1_0_3;
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      prettyShow = self.prettyShow_1_2;
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc702Prefs = ghc701Prefs;
@@ -57,9 +78,12 @@
   ghc701Prefs =
     self : self.haskellPlatformArgs_2011_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2011_2_0_0;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
       cabalInstall_0_14_0 = self.cabalInstall_0_14_0.override { Cabal = self.Cabal_1_14_0; zlib = self.zlib_0_5_3_3; };
+      cabalInstall_1_16_0_2 = self.cabalInstall_1_16_0_2.override { Cabal = self.Cabal_1_16_0_3; zlib = self.zlib_0_5_3_3; };
       monadPar = self.monadPar_0_1_0_3;
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      prettyShow = self.prettyShow_1_2;
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc6123Prefs = ghc6122Prefs;
@@ -68,11 +92,12 @@
     self : self.haskellPlatformArgs_2010_2_0_0 self // {
       haskellPlatform = self.haskellPlatform_2010_2_0_0;
       mtl1 = self.mtl_1_1_0_2;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
-      cabalInstall_0_14_0 = self.cabalInstall_0_14_0.override { Cabal = self.Cabal_1_14_0; zlib = self.zlib_0_5_3_3; };
       monadPar = self.monadPar_0_1_0_3;
       deepseq = self.deepseq_1_1_0_2;
       # deviating from Haskell platform here, to make some packages (notably statistics) compile
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      cabal2nix = self.cabal2nix.override { Cabal = self.Cabal_1_16_0_3; hackageDb = self.hackageDb.override { Cabal = self.Cabal_1_16_0_3; }; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc6121Prefs =
@@ -80,10 +105,12 @@
       haskellPlatform = self.haskellPlatform_2010_1_0_0;
       mtl1 = self.mtl_1_1_0_2;
       extensibleExceptions = self.extensibleExceptions_0_1_1_0;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
       deepseq = self.deepseq_1_1_0_2;
       monadPar = self.monadPar_0_1_0_3;
       # deviating from Haskell platform here, to make some packages (notably statistics) compile
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      cabal2nix = self.cabal2nix.override { Cabal = self.Cabal_1_16_0_3; hackageDb = self.hackageDb.override { Cabal = self.Cabal_1_16_0_3; }; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   ghc6104Prefs =
@@ -93,11 +120,11 @@
       mtl1 = self.mtl_1_1_0_2;
       extensibleExceptions = self.extensibleExceptions_0_1_1_0;
       text = self.text_0_11_0_6;
-      repaExamples = null;      # don't pick this version of 'repa-examples' during nix-env -u
-      cabalInstall_0_14_0 = self.cabalInstall_0_14_0.override { Cabal = self.Cabal_1_14_0; zlib = self.zlib_0_5_3_3; };
       deepseq = self.deepseq_1_1_0_2;
       monadPar = self.monadPar_0_1_0_3;
       # deviating from Haskell platform here, to make some packages (notably statistics) compile
+      jailbreakCabal = self.jailbreakCabal.override { Cabal = self.disableTest self.Cabal_1_14_0; };
+      bmp = self.bmp_1_2_2_1;
     };
 
   # Abstraction for Haskell packages collections
@@ -115,13 +142,13 @@
         # prefFun = self : super : self;
         enableLibraryProfiling =
           if profExplicit then profDefault
-                          else getConfig [ "cabal" "libraryProfiling" ] profDefault;
+                          else config.cabal.libraryProfiling or profDefault;
         ghc = callPackage ghcPath { ghc = ghcBinary; };
       });
 
   defaultVersionPrioFun =
     profDefault :
-    if getConfig [ "cabal" "libraryProfiling" ] false == profDefault
+    if config.cabal.libraryProfiling or false == profDefault
       then (x : x)
       else lowPrio;
 
@@ -166,6 +193,10 @@
     gmp = pkgs.gmp4;
   });
 
+  ghc742Binary = lowPrio (callPackage ../development/compilers/ghc/7.4.2-binary.nix {
+    gmp = pkgs.gmp4;
+  });
+
   ghc6101BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6101Binary;
   ghc6121BinaryDarwin = if stdenv.isDarwin then ghc704Binary else ghc6121Binary;
 
@@ -253,19 +284,31 @@
   packages_ghc742 =
     packages { ghcPath = ../development/compilers/ghc/7.4.2.nix;
                ghcBinary = ghc6121BinaryDarwin;
-               prefFun = ghc741Prefs;
+               prefFun = ghc742Prefs;
              };
 
   packages_ghc761 =
     packages { ghcPath = ../development/compilers/ghc/7.6.1.nix;
                ghcBinary = ghc704Binary;
-               prefFun = ghcHEADPrefs;
+               prefFun = ghc763Prefs;
+             };
+
+  packages_ghc762 =
+    packages { ghcPath = ../development/compilers/ghc/7.6.2.nix;
+               ghcBinary = ghc704Binary;
+               prefFun = ghc763Prefs;
+             };
+
+  packages_ghc763 =
+    packages { ghcPath = ../development/compilers/ghc/7.6.3.nix;
+               ghcBinary = ghc704Binary;
+               prefFun = ghc763Prefs;
              };
 
   # Reasonably current HEAD snapshot. Should *always* be lowPrio.
   packages_ghcHEAD =
     packages { ghcPath = ../development/compilers/ghc/head.nix;
-               ghcBinary = ghc704Binary;
+               ghcBinary = ghc742Binary;
                prefFun = ghcHEADPrefs;
              };
 
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index fddc9589d3a..e21985b5ab3 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -89,6 +89,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     ghc = ghc; # refers to ghcPlain
   };
 
+  # The normal GHC wrapper doesn't create links to the documentation in
+  # ~/.nix-profile. Having this second wrapper allows us to remedy the
+  # situation without re-building all Haskell packages. At the next
+  # stdenv-updates merge, this second wrapper will go away.
+
+  ghcUserEnvWrapper = pkgs.appendToName "new" (callPackage ../development/compilers/ghc/wrapper.nix {
+    ghc = ghc; # refers to ghcPlain
+    forUserEnv = true;
+  });
+
   # An experimental wrapper around ghcPlain that does not automatically
   # pick up packages from the profile, but instead has a fixed set of packages
   # in its global database. The set of packages can be specified as an
@@ -104,8 +114,17 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   cabal = callPackage ../build-support/cabal {
     enableLibraryProfiling = enableLibraryProfiling;
+    enableCheckPhase = pkgs.stdenv.lib.versionOlder "7.4" self.ghc.ghcVersion;
   };
 
+  # A variant of the cabal build driver that disables unit testing.
+  # Useful for breaking cycles, where the unit test of a package A
+  # depends on package B, which has A as a regular build input.
+  cabalNoTest = self.cabal.override { enableCheckPhase = false; };
+
+  # Convenience helper function.
+  disableTest = x: x.override { cabal = self.cabalNoTest; };
+
   # Haskell Platform
   #
   # We try to support several platform versions. For these, we set all
@@ -116,39 +135,133 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   # GHC version, change the "preferences function" for that GHC version
   # in haskell-defaults.nix.
 
-  # NOTE: 2012.2.0.0 is the current default.
+  # NOTE: 2013.2.0.0 is the current default.
 
   haskellPlatformArgs_future = self : {
     inherit (self) cabal ghc;
-    cgi          = self.cgi_3001_1_7_4;         # 7.5 fail
-    fgl          = self.fgl_5_4_2_4;            # 7.5 ok
-    GLUT         = self.GLUT_2_1_2_1;           # 7.5 fail
-    haskellSrc   = self.haskellSrc_1_0_1_5;     # 7.5 ok
-    html         = self.html_1_0_1_2;           # 7.5 ok
-    HTTP         = self.HTTP_4000_2_3;          # 7.5 ok
-    HUnit        = self.HUnit_1_2_5_1;          # 7.5 ok
-    mtl          = self.mtl_2_1_2;              # 7.5 ok
-    network      = self.network_2_3_1_0;        # 7.5 ok
-    OpenGL       = self.OpenGL_2_2_3_1;         # 7.5 fail
-    parallel     = self.parallel_3_2_0_2;       # 7.5 fail
-    parsec       = self.parsec_3_1_3;           # 7.5 ok
-    QuickCheck   = self.QuickCheck_2_5;         # 7.5 fail
-    random       = self.random_1_0_1_1;         # 7.5 ok
-    regexBase    = self.regexBase_0_93_2;       # 7.5 ok
-    regexCompat  = self.regexCompat_0_95_1;     # 7.5 fail
-    regexPosix   = self.regexPosix_0_95_1;      # 7.5 fail
-    stm          = self.stm_2_4;                # 7.5 ok
-    syb          = self.syb_0_3_7;              # 7.5 ok
-    text         = self.text_0_11_2_3;          # 7.5 ok
-    transformers = self.transformers_0_3_0_0;   # 7.5 ok
-    xhtml        = self.xhtml_3000_2_1;         # 7.5 ok
-    zlib         = self.zlib_0_5_3_3;           # 7.5 fail
-    cabalInstall = self.cabalInstall_0_14_0;    # 7.5 ok
-    alex         = self.alex_3_0_1;             # 7.5 ok
-    haddock      = self.haddock_2_10_0;         # 7.5 ok
-    happy        = self.happy_1_18_9;           # 7.5 ok
+    async        = self.async_2_0_1_4;          # 7.6 ok
+    attoparsec   = self.attoparsec_0_10_4_0;    # 7.6 ok
+    caseInsensitive = self.caseInsensitive_1_0_0_1;
+    cgi          = self.cgi_3001_1_7_5;         # 7.6 ok
+    fgl          = self.fgl_5_4_2_4;            # 7.6 ok
+    GLUT         = self.GLUT_2_4_0_0;           # 7.6 ok
+    GLURaw       = self.GLURaw_1_3_0_0;         # 7.6 ok
+    haskellSrc   = self.haskellSrc_1_0_1_5;     # 7.6 ok
+    hashable     = self.hashable_1_1_2_5;       # 7.6 ok
+    html         = self.html_1_0_1_2;           # 7.6 ok
+    HTTP         = self.HTTP_4000_2_8;          # 7.6 ok
+    HUnit        = self.HUnit_1_2_5_2;          # 7.6 ok
+    mtl          = self.mtl_2_1_2;              # 7.6 ok
+    network      = self.network_2_4_1_2;        # 7.6 ok
+    OpenGL       = self.OpenGL_2_8_0_0;         # 7.6 ok
+    OpenGLRaw    = self.OpenGLRaw_1_3_0_0;      # 7.6 ok
+    parallel     = self.parallel_3_2_0_3;       # 7.6 ok
+    parsec       = self.parsec_3_1_3;           # 7.6 ok
+    QuickCheck   = self.QuickCheck_2_6;         # 7.6 ok
+    random       = self.random_1_0_1_1;         # 7.6 ok
+    regexBase    = self.regexBase_0_93_2;       # 7.6 ok
+    regexCompat  = self.regexCompat_0_95_1;     # 7.6 ok
+    regexPosix   = self.regexPosix_0_95_2;      # 7.6 ok
+    split        = self.split_0_2_2;            # 7.6 ok
+    stm          = self.stm_2_4_2;              # 7.6 ok
+    syb          = self.syb_0_4_0;              # 7.6 ok
+    text         = self.text_0_11_3_1;          # 7.6 ok
+    transformers = self.transformers_0_3_0_0;   # 7.6 ok
+    unorderedContainers = self.unorderedContainers_0_2_3_0;
+    vector       = self.vector_0_10_0_1;        # 7.6 ok
+    xhtml        = self.xhtml_3000_2_1;         # 7.6 ok
+    zlib         = self.zlib_0_5_4_1;           # 7.6 ok
+    cabalInstall = self.cabalInstall_1_16_0_2;  # 7.6 ok
+    alex         = self.alex_3_0_5;             # 7.6 ok
+    haddock      = self.haddock_2_13_2;         # 7.6 ok
+    happy        = self.happy_1_18_10;          # 7.6 ok
+    primitive    = self.primitive_0_5_0_1;      # semi-official, but specified
+  };
+
+  haskellPlatformArgs_2013_2_0_0 = self : {
+    inherit (self) cabal ghc;
+    async        = self.async_2_0_1_4;
+    attoparsec   = self.attoparsec_0_10_4_0;
+    caseInsensitive = self.caseInsensitive_1_0_0_1;
+    cgi          = self.cgi_3001_1_7_5;
+    fgl          = self.fgl_5_4_2_4;
+    GLUT         = self.GLUT_2_4_0_0;
+    GLURaw       = self.GLURaw_1_3_0_0;
+    haskellSrc   = self.haskellSrc_1_0_1_5;
+    hashable     = self.hashable_1_1_2_5;
+    html         = self.html_1_0_1_2;
+    HTTP         = self.HTTP_4000_2_8;
+    HUnit        = self.HUnit_1_2_5_2;
+    mtl          = self.mtl_2_1_2;
+    network      = self.network_2_4_1_2;
+    OpenGL       = self.OpenGL_2_8_0_0;
+    OpenGLRaw    = self.OpenGLRaw_1_3_0_0;
+    parallel     = self.parallel_3_2_0_3;
+    parsec       = self.parsec_3_1_3;
+    QuickCheck   = self.QuickCheck_2_6;
+    random       = self.random_1_0_1_1;
+    regexBase    = self.regexBase_0_93_2;
+    regexCompat  = self.regexCompat_0_95_1;
+    regexPosix   = self.regexPosix_0_95_2;
+    split        = self.split_0_2_2;
+    stm          = self.stm_2_4_2;
+    syb          = self.syb_0_4_0;
+    text         = self.text_0_11_3_1;
+    transformers = self.transformers_0_3_0_0;
+    unorderedContainers = self.unorderedContainers_0_2_3_0;
+    vector       = self.vector_0_10_0_1;
+    xhtml        = self.xhtml_3000_2_1;
+    zlib         = self.zlib_0_5_4_1;
+    cabalInstall = self.cabalInstall_1_16_0_2;
+    alex         = self.alex_3_0_5;
+    haddock      = self.haddock_2_13_2;
+    happy        = self.happy_1_18_10;
+    primitive    = self.primitive_0_5_0_1;      # semi-official, but specified
+  };
+
+  haskellPlatform_2013_2_0_0 =
+    callPackage ../development/libraries/haskell/haskell-platform/2013.2.0.0.nix
+      (self.haskellPlatformArgs_2013_2_0_0 self);
+
+  haskellPlatformArgs_2012_4_0_0 = self : {
+    inherit (self) cabal ghc;
+    async        = self.async_2_0_1_3;
+    cgi          = self.cgi_3001_1_7_4;
+    fgl          = self.fgl_5_4_2_4;
+    GLUT         = self.GLUT_2_1_2_1;
+    haskellSrc   = self.haskellSrc_1_0_1_5;
+    html         = self.html_1_0_1_2;
+    HTTP         = self.HTTP_4000_2_5;
+    HUnit        = self.HUnit_1_2_5_1;
+    mtl          = self.mtl_2_1_2;
+    network      = self.network_2_3_1_0;
+    OpenGL       = self.OpenGL_2_2_3_1;
+    parallel     = self.parallel_3_2_0_3;
+    parsec       = self.parsec_3_1_3;
+    QuickCheck   = self.QuickCheck_2_5_1_1;
+    random       = self.random_1_0_1_1;
+    regexBase    = self.regexBase_0_93_2;
+    regexCompat  = self.regexCompat_0_95_1;
+    regexPosix   = self.regexPosix_0_95_2;
+    split        = self.split_0_2_1_1;
+    stm          = self.stm_2_4;
+    syb          = self.syb_0_3_7;
+    text         = self.text_0_11_2_3;
+    transformers = self.transformers_0_3_0_0;
+    vector       = self.vector_0_10_0_1;
+    xhtml        = self.xhtml_3000_2_1;
+    zlib         = self.zlib_0_5_4_0;
+    cabalInstall = self.cabalInstall_0_14_0;
+    alex         = self.alex_3_0_2;
+    haddock      = self.haddock_2_11_0;
+    happy        = self.happy_1_18_10;
+    primitive    = self.primitive_0_5_0_1; # semi-official, but specified
   };
 
+  haskellPlatform_2012_4_0_0 =
+    callPackage ../development/libraries/haskell/haskell-platform/2012.4.0.0.nix
+      (self.haskellPlatformArgs_2012_4_0_0 self);
+
   haskellPlatformArgs_2012_2_0_0 = self : {
     inherit (self) cabal ghc;
     cgi          = self.cgi_3001_1_7_4;         # 7.4.1 ok
@@ -352,10 +465,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
       (self.haskellPlatformArgs_2010_1_0_0 self);
 
   haskellPlatformArgs_2009_2_0_2 = self : {
-    inherit (self) cabal ghc editline;
+    inherit (self) cabal ghc;
     time         = self.time_1_1_2_4;
     haddock      = self.haddock_2_4_2;
     cgi          = self.cgi_3001_1_7_1;
+    editline     = self.editline_0_2_1_0;
     fgl          = self.fgl_5_4_2_2;
     GLUT         = self.GLUT_2_1_1_2;
     haskellSrc   = self.haskellSrc_1_0_1_3;
@@ -384,8 +498,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   # Haskell libraries.
 
+  acidState = callPackage ../development/libraries/haskell/acid-state {};
+
   Agda = callPackage ../development/libraries/haskell/Agda {
-    haskellSrcExts = self.haskellSrcExts_1_11_1;
+    hashable = self.hashable_1_1_2_5;
+    hashtables = self.hashtables.override { hashable = self.hashable_1_1_2_5; };
+    unorderedContainers = self.unorderedContainers.override { hashable = self.hashable_1_1_2_5; };
   };
 
   accelerate = callPackage ../development/libraries/haskell/accelerate {};
@@ -394,8 +512,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   accelerateExamples = callPackage ../development/libraries/haskell/accelerate-examples {};
 
+  accelerateFft = callPackage ../development/libraries/haskell/accelerate-fft {};
+
   accelerateIo = callPackage ../development/libraries/haskell/accelerate-io {};
 
+  active = callPackage ../development/libraries/haskell/active {};
+
   ACVector = callPackage ../development/libraries/haskell/AC-Vector {};
 
   abstractDeque = callPackage ../development/libraries/haskell/abstract-deque {};
@@ -406,44 +528,68 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   alternativeIo = callPackage ../development/libraries/haskell/alternative-io {};
 
+  alsaCore = callPackage ../development/libraries/haskell/alsa-core {};
+
+  alsaPcm = callPackage ../development/libraries/haskell/alsa-pcm {};
+
+  appar = callPackage ../development/libraries/haskell/appar {};
+
   ansiTerminal = callPackage ../development/libraries/haskell/ansi-terminal {};
 
   ansiWlPprint = callPackage ../development/libraries/haskell/ansi-wl-pprint {};
 
+  arithmoi = callPackage ../development/libraries/haskell/arithmoi {};
+
   arrows = callPackage ../development/libraries/haskell/arrows {};
 
   asn1Data = callPackage ../development/libraries/haskell/asn1-data {};
 
+  asn1Types = callPackage ../development/libraries/haskell/asn1-types {};
+
   AspectAG = callPackage ../development/libraries/haskell/AspectAG {};
 
-  async = callPackage ../development/libraries/haskell/async {};
+  async_2_0_1_3 = callPackage ../development/libraries/haskell/async/2.0.1.3.nix {};
+  async_2_0_1_4 = callPackage ../development/libraries/haskell/async/2.0.1.4.nix {};
+  async = self.async_2_0_1_4;
+
+  atomicPrimops = callPackage ../development/libraries/haskell/atomic-primops {};
 
   attempt = callPackage ../development/libraries/haskell/attempt {};
 
-  attoparsec = callPackage ../development/libraries/haskell/attoparsec {};
+  attoparsec_0_10_4_0 = callPackage ../development/libraries/haskell/attoparsec/0.10.4.0.nix {};
+  attoparsec = self.attoparsec_0_10_4_0;
+
+  attoparsecBinary = callPackage ../development/libraries/haskell/attoparsec-binary {};
 
   attoparsecConduit = callPackage ../development/libraries/haskell/attoparsec-conduit {};
 
-  attoparsecEnumerator = callPackage ../development/libraries/haskell/attoparsec/enumerator.nix {};
+  attoparsecEnumerator = callPackage ../development/libraries/haskell/attoparsec-enumerator {};
 
   authenticate = callPackage ../development/libraries/haskell/authenticate {};
 
+  authenticateOauth = callPackage ../development/libraries/haskell/authenticate-oauth {};
+
   base16Bytestring = callPackage ../development/libraries/haskell/base16-bytestring {};
 
   base64String = callPackage ../development/libraries/haskell/base64-string {};
 
   base64Bytestring = callPackage ../development/libraries/haskell/base64-bytestring {};
 
+  base64Conduit = callPackage ../development/libraries/haskell/base64-conduit {};
+
+  baseCompat = callPackage ../development/libraries/haskell/base-compat {};
+
   baseUnicodeSymbols = callPackage ../development/libraries/haskell/base-unicode-symbols {};
 
-  benchpress = callPackage ../development/libraries/haskell/benchpress {
-    time = self.time_1_1_3;
-  };
+  basicPrelude = callPackage ../development/libraries/haskell/basic-prelude {};
+
+  benchpress = callPackage ../development/libraries/haskell/benchpress {};
+
+  bifunctors = callPackage ../development/libraries/haskell/bifunctors {};
 
   bimap = callPackage ../development/libraries/haskell/bimap {};
 
-  binary_hackage = callPackage ../development/libraries/haskell/binary {};
-  binary = self.binary_hackage; # core package since ghc-7.2.1
+  binary = callPackage ../development/libraries/haskell/binary {};
 
   binaryShared = callPackage ../development/libraries/haskell/binary-shared {};
 
@@ -465,11 +611,15 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   blazeMarkup = callPackage ../development/libraries/haskell/blaze-markup {};
 
+  blazeSvg = callPackage ../development/libraries/haskell/blaze-svg {};
+
   blazeTextual = callPackage ../development/libraries/haskell/blaze-textual {};
 
   bloomfilter = callPackage ../development/libraries/haskell/bloomfilter {};
 
-  bmp = callPackage ../development/libraries/haskell/bmp {};
+  bmp_1_2_2_1 = callPackage ../development/libraries/haskell/bmp/1.2.2.1.nix {};
+  bmp_1_2_5_2 = callPackage ../development/libraries/haskell/bmp/1.2.5.2.nix {};
+  bmp = self.bmp_1_2_5_2;
 
   Boolean = callPackage ../development/libraries/haskell/Boolean {};
 
@@ -477,6 +627,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   bson = callPackage ../development/libraries/haskell/bson {};
 
+  boomerang = callPackage ../development/libraries/haskell/boomerang {};
+
   byteorder = callPackage ../development/libraries/haskell/byteorder {};
 
   bytestringNums = callPackage ../development/libraries/haskell/bytestring-nums {};
@@ -487,11 +639,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   bytestringTrie = callPackage ../development/libraries/haskell/bytestring-trie {};
 
+  bytestringProgress = callPackage ../development/libraries/haskell/bytestring-progress {};
+
   c2hs = callPackage ../development/libraries/haskell/c2hs {
     languageC = self.languageC_0_3_2_1;
   };
 
   Cabal_1_14_0 = callPackage ../development/libraries/haskell/Cabal/1.14.0.nix { cabal = self.cabal.override { Cabal = null; }; };
+  Cabal_1_16_0_3 = callPackage ../development/libraries/haskell/Cabal/1.16.0.3.nix { cabal = self.cabal.override { Cabal = null; }; };
   Cabal = null; # core package in GHC
 
   cabalFileTh = callPackage ../development/libraries/haskell/cabal-file-th {};
@@ -503,25 +658,46 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     libc = pkgs.stdenv.gcc.libc;
   };
 
-  caseInsensitive = callPackage ../development/libraries/haskell/case-insensitive {};
+  carray = callPackage ../development/libraries/haskell/carray {};
+
+  caseInsensitive_1_0_0_1 = callPackage ../development/libraries/haskell/case-insensitive/1.0.0.1.nix {};
+  caseInsensitive_1_0_0_2 = callPackage ../development/libraries/haskell/case-insensitive/1.0.0.2.nix {};
+  caseInsensitive = self.caseInsensitive_1_0_0_2;
 
   cautiousFile = callPackage ../development/libraries/haskell/cautious-file {};
 
   cereal = callPackage ../development/libraries/haskell/cereal {};
 
+  cerealConduit = callPackage ../development/libraries/haskell/cereal-conduit {};
+
   certificate = callPackage ../development/libraries/haskell/certificate {};
 
   cgi_3001_1_7_1 = callPackage ../development/libraries/haskell/cgi/3001.1.7.1.nix {};
   cgi_3001_1_7_2 = callPackage ../development/libraries/haskell/cgi/3001.1.7.2.nix {};
   cgi_3001_1_7_3 = callPackage ../development/libraries/haskell/cgi/3001.1.7.3.nix {};
   cgi_3001_1_7_4 = callPackage ../development/libraries/haskell/cgi/3001.1.7.4.nix {};
-  cgi_3001_1_8_2 = callPackage ../development/libraries/haskell/cgi/3001.1.8.2.nix {};
-  cgi = self.cgi_3001_1_8_2;
+  cgi_3001_1_7_5 = callPackage ../development/libraries/haskell/cgi/3001.1.7.5.nix {};
+  cgi_3001_1_8_4 = callPackage ../development/libraries/haskell/cgi/3001.1.8.4.nix {};
+  cgi = self.cgi_3001_1_8_4;
 
   Chart = callPackage ../development/libraries/haskell/Chart {};
 
+  ChasingBottoms = callPackage ../development/libraries/haskell/ChasingBottoms {};
+
+  checkers = callPackage ../development/libraries/haskell/checkers {};
+
   citeprocHs = callPackage ../development/libraries/haskell/citeproc-hs {};
 
+  cipherAes = callPackage ../development/libraries/haskell/cipher-aes {};
+
+  cipherRc4 = callPackage ../development/libraries/haskell/cipher-rc4 {};
+
+  circlePacking = callPackage ../development/libraries/haskell/circle-packing {};
+
+  classyPrelude = callPackage ../development/libraries/haskell/classy-prelude {};
+
+  classyPreludeConduit = callPackage ../development/libraries/haskell/classy-prelude-conduit {};
+
   clientsession = callPackage ../development/libraries/haskell/clientsession {};
 
   cmdargs = callPackage ../development/libraries/haskell/cmdargs {};
@@ -532,16 +708,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   colour = callPackage ../development/libraries/haskell/colour {};
 
-  comonad_1_1_1_6 = callPackage ../development/libraries/haskell/comonad/1.1.1.6.nix {};
-  comonad_3_0_0_2 = callPackage ../development/libraries/haskell/comonad/3.0.0.2.nix {};
-  comonad = self.comonad_3_0_0_2;
+  comonad = callPackage ../development/libraries/haskell/comonad {};
 
-  comonadTransformers_2_1_2 = callPackage ../development/libraries/haskell/comonad-transformers/2.1.2.nix {
-    comonad = self.comonad_1_1_1_6;
-    semigroupoids = self.semigroupoids_1_3_4;
-  };
-  comonadTransformers_3_0 = callPackage ../development/libraries/haskell/comonad-transformers/3.0.nix {};
-  comonadTransformers = self.comonadTransformers_3_0;
+  comonadsFd = callPackage ../development/libraries/haskell/comonads-fd {};
+
+  comonadTransformers = callPackage ../development/libraries/haskell/comonad-transformers {};
 
   compactStringFix = callPackage ../development/libraries/haskell/compact-string-fix {};
 
@@ -551,14 +722,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   configurator = callPackage ../development/libraries/haskell/configurator {};
 
-  convertible = callPackage ../development/libraries/haskell/convertible {
-    time = self.time_1_1_3;
-  };
+  constraints = callPackage ../development/libraries/haskell/constraints {};
+
+  convertible = callPackage ../development/libraries/haskell/convertible {};
 
   continuedFractions = callPackage ../development/libraries/haskell/continued-fractions {};
 
   contravariant = callPackage ../development/libraries/haskell/contravariant {};
 
+  concurrentExtra = callPackage ../development/libraries/haskell/concurrent-extra {};
+
   converge = callPackage ../development/libraries/haskell/converge {};
 
   cookie = callPackage ../development/libraries/haskell/cookie {};
@@ -577,8 +750,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   cryptohash = callPackage ../development/libraries/haskell/cryptohash {};
 
+  cryptohashCryptoapi = callPackage ../development/libraries/haskell/cryptohash-cryptoapi {};
+
+  cryptoNumbers = callPackage ../development/libraries/haskell/crypto-numbers {};
+
   cryptoPubkeyTypes = callPackage ../development/libraries/haskell/crypto-pubkey-types {};
 
+  cryptoPubkey = callPackage ../development/libraries/haskell/crypto-pubkey {};
+
+  cryptoRandomApi = callPackage ../development/libraries/haskell/crypto-random-api {};
+
   cuda = callPackage ../development/libraries/haskell/cuda {
     inherit (pkgs.linuxPackages) nvidia_x11;
   };
@@ -587,6 +768,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   cssText = callPackage ../development/libraries/haskell/css-text {};
 
+  cufft = callPackage ../development/libraries/haskell/cufft {};
+
   curl = callPackage ../development/libraries/haskell/curl { curl = pkgs.curl; };
 
   cpu = callPackage ../development/libraries/haskell/cpu {};
@@ -595,18 +778,23 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   dataAccessorTemplate = callPackage ../development/libraries/haskell/data-accessor/data-accessor-template.nix {};
 
+  dataAccessorTransformers = callPackage ../development/libraries/haskell/data-accessor/data-accessor-transformers.nix {};
+
   dataBinaryIeee754 = callPackage ../development/libraries/haskell/data-binary-ieee754 {};
 
   dataDefault = callPackage ../development/libraries/haskell/data-default {};
 
+  dataDefaultClass = callPackage ../development/libraries/haskell/data-default-class {};
+  dataDefaultInstancesBase = callPackage ../development/libraries/haskell/data-default-instances-containers {};
+  dataDefaultInstancesContainers = callPackage ../development/libraries/haskell/data-default-instances-base {};
+  dataDefaultInstancesDlist = callPackage ../development/libraries/haskell/data-default-instances-dlist {};
+  dataDefaultInstancesOldLocale = callPackage ../development/libraries/haskell/data-default-instances-old-locale {};
+
   dataenc = callPackage ../development/libraries/haskell/dataenc {};
 
   dataInttrie = callPackage ../development/libraries/haskell/data-inttrie {};
 
-  dataLens = callPackage ../development/libraries/haskell/data-lens {
-    comonadTransformers = self.comonadTransformers_2_1_2;
-    semigroupoids = self.semigroupoids_1_3_4;
-  };
+  dataLens = callPackage ../development/libraries/haskell/data-lens {};
 
   dataLensTemplate = callPackage ../development/libraries/haskell/data-lens-template {};
 
@@ -614,20 +802,41 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   dataReify = callPackage ../development/libraries/haskell/data-reify {};
 
+  dateCache = callPackage ../development/libraries/haskell/date-cache {};
+
   datetime = callPackage ../development/libraries/haskell/datetime {};
 
+  DAV = callPackage ../development/libraries/haskell/DAV {};
+
+  dbus = callPackage ../development/libraries/haskell/dbus {};
+
   deepseq_1_1_0_0 = callPackage ../development/libraries/haskell/deepseq/1.1.0.0.nix {};
   deepseq_1_1_0_2 = callPackage ../development/libraries/haskell/deepseq/1.1.0.2.nix {};
   deepseq_1_2_0_1 = callPackage ../development/libraries/haskell/deepseq/1.2.0.1.nix {};
-  deepseq_1_3_0_0 = callPackage ../development/libraries/haskell/deepseq/1.3.0.0.nix {};
+  deepseq_1_3_0_1 = callPackage ../development/libraries/haskell/deepseq/1.3.0.1.nix {};
   deepseq = null; # a core package in recent GHCs
 
   deepseqTh = callPackage ../development/libraries/haskell/deepseq-th {};
 
   derive = callPackage ../development/libraries/haskell/derive {};
 
+  dependentMap = callPackage ../development/libraries/haskell/dependent-map {};
+
+  dependentSum = callPackage ../development/libraries/haskell/dependent-sum {};
+
+  dependentSumTemplate = callPackage ../development/libraries/haskell/dependent-sum-template {};
+
   derp = callPackage ../development/libraries/haskell/derp {};
 
+  dice = callPackage ../development/libraries/haskell/dice {};
+
+  diagrams = callPackage ../development/libraries/haskell/diagrams/diagrams.nix {};
+  diagramsCairo = callPackage ../development/libraries/haskell/diagrams/cairo.nix {};
+  diagramsCore = callPackage ../development/libraries/haskell/diagrams/core.nix {};
+  diagramsContrib = callPackage ../development/libraries/haskell/diagrams/contrib.nix {};
+  diagramsLib = callPackage ../development/libraries/haskell/diagrams/lib.nix {};
+  diagramsSvg = callPackage ../development/libraries/haskell/diagrams/svg.nix {};
+
   Diff = callPackage ../development/libraries/haskell/Diff {};
 
   digest = callPackage ../development/libraries/haskell/digest {
@@ -642,12 +851,24 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   dimensional = callPackage ../development/libraries/haskell/dimensional {};
 
+  dimensionalTf = callPackage ../development/libraries/haskell/dimensional-tf {};
+
   directoryTree = callPackage ../development/libraries/haskell/directory-tree {};
 
+  distributedProcess = callPackage ../development/libraries/haskell/distributed-process {};
+
+  distributedProcessSimplelocalnet = callPackage ../development/libraries/haskell/distributed-process-simplelocalnet {};
+
+  distributedStatic = callPackage ../development/libraries/haskell/distributed-static {};
+
   distributive = callPackage ../development/libraries/haskell/distributive {};
 
   dlist = callPackage ../development/libraries/haskell/dlist {};
 
+  dns = callPackage ../development/libraries/haskell/dns {};
+
+  doctest = callPackage ../development/libraries/haskell/doctest {};
+
   dotgen = callPackage ../development/libraries/haskell/dotgen {};
 
   doubleConversion = callPackage ../development/libraries/haskell/double-conversion {};
@@ -660,18 +881,32 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   dstring = callPackage ../development/libraries/haskell/dstring {};
 
+  dualTree = callPackage ../development/libraries/haskell/dual-tree {};
+
+  dyre = callPackage ../development/libraries/haskell/dyre {};
+
   editDistance = callPackage ../development/libraries/haskell/edit-distance {};
 
-  editline = callPackage ../development/libraries/haskell/editline {};
+  editline_0_2_1_0 = callPackage ../development/libraries/haskell/editline/0.2.1.0.nix {};
+  editline_0_2_1_1 = callPackage ../development/libraries/haskell/editline/0.2.1.1.nix {};
+  editline = self.editline_0_2_1_1;
+
+  elerea = callPackage ../development/libraries/haskell/elerea {};
 
   emailValidate = callPackage ../development/libraries/haskell/email-validate {};
 
+  encoding = callPackage ../development/libraries/haskell/encoding {};
+
   enumerator = callPackage ../development/libraries/haskell/enumerator {};
 
   entropy = callPackage ../development/libraries/haskell/entropy {};
 
   erf = callPackage ../development/libraries/haskell/erf {};
 
+  errors = callPackage ../development/libraries/haskell/errors {};
+
+  either = callPackage ../development/libraries/haskell/either {};
+
   exceptionMtl = callPackage ../development/libraries/haskell/exception-mtl {};
 
   exceptionTransformers = callPackage ../development/libraries/haskell/exception-transformers {};
@@ -683,6 +918,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   filepath_1_3_0_0 = callPackage ../development/libraries/haskell/filepath {};
   filepath = null; # a core package in recent GHCs
 
+  fileLocation = callPackage ../development/libraries/haskell/file-location {};
+
   extensibleExceptions_0_1_1_0 = callPackage ../development/libraries/haskell/extensible-exceptions/0.1.1.0.nix {};
   extensibleExceptions_0_1_1_2 = callPackage ../development/libraries/haskell/extensible-exceptions/0.1.1.2.nix {};
   extensibleExceptions_0_1_1_3 = callPackage ../development/libraries/haskell/extensible-exceptions/0.1.1.3.nix {};
@@ -707,6 +944,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   filestore = callPackage ../development/libraries/haskell/filestore {};
 
+  filesystemConduit = callPackage ../development/libraries/haskell/filesystem-conduit {};
+
   fgl_5_4_2_2 = callPackage ../development/libraries/haskell/fgl/5.4.2.2.nix {};
   fgl_5_4_2_3 = callPackage ../development/libraries/haskell/fgl/5.4.2.3.nix {};
   fgl_5_4_2_4 = callPackage ../development/libraries/haskell/fgl/5.4.2.4.nix {};
@@ -716,8 +955,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   fingertree = callPackage ../development/libraries/haskell/fingertree {};
 
+  forceLayout = callPackage ../development/libraries/haskell/force-layout {};
+
+  fsnotify = callPackage ../development/libraries/haskell/fsnotify {};
+
   gamma = callPackage ../development/libraries/haskell/gamma {};
 
+  geniplate = callPackage ../development/libraries/haskell/geniplate {};
+
   gd = callPackage ../development/libraries/haskell/gd {
     inherit (pkgs) gd zlib;
   };
@@ -730,6 +975,10 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   ghcEvents = callPackage ../development/libraries/haskell/ghc-events {};
 
+  ghcHeapView = callPackage ../development/libraries/haskell/ghc-heap-view {
+    cabal = self.cabal.override { enableLibraryProfiling = false; }; # pkg cannot be built with profiling enabled
+  };
+
   ghcMod = callPackage ../development/libraries/haskell/ghc-mod {
     inherit (pkgs) emacs;
   };
@@ -742,8 +991,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   ghcSybUtils = callPackage ../development/libraries/haskell/ghc-syb-utils {};
 
+  ghcVis = callPackage ../development/libraries/haskell/ghc-vis {
+    cabal = self.cabal.override { enableLibraryProfiling = false; }; # pkg cannot be built with profiling enabled
+  };
+
   gio = callPackage ../development/libraries/haskell/gio {};
 
+  github = callPackage ../development/libraries/haskell/github {};
+
   gitit = callPackage ../development/libraries/haskell/gitit {};
 
   glade = callPackage ../development/libraries/haskell/glade {
@@ -759,16 +1014,19 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     libc = pkgs.stdenv.gcc.libc;
   };
 
+  Glob = callPackage ../development/libraries/haskell/Glob {};
+
   GlomeVec = callPackage ../development/libraries/haskell/GlomeVec {};
 
   gloss = callPackage ../development/libraries/haskell/gloss {
-    GLUT   = self.GLUT23;
-    OpenGL = self.OpenGL25;
+    OpenGL = self.OpenGL_2_6_0_1;
+    GLUT   = self.GLUT_2_3_1_0;
   };
 
   glpkHs = callPackage ../development/libraries/haskell/glpk-hs {};
 
-  GLURaw = callPackage ../development/libraries/haskell/GLURaw {};
+  GLURaw_1_3_0_0 = callPackage ../development/libraries/haskell/GLURaw/1.3.0.0.nix {};
+  GLURaw = self.GLURaw_1_3_0_0;
 
   GLUT_2_1_1_2 = callPackage ../development/libraries/haskell/GLUT/2.1.1.2.nix {};
   GLUT_2_1_2_1 = callPackage ../development/libraries/haskell/GLUT/2.1.2.1.nix {};
@@ -776,12 +1034,19 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   GLUT_2_2_2_1 = callPackage ../development/libraries/haskell/GLUT/2.2.2.1.nix {
     OpenGL = self.OpenGL_2_4_0_2;
   };
-  GLUT_2_3_0_0 = callPackage ../development/libraries/haskell/GLUT/2.3.0.0.nix {
-    OpenGL = self.OpenGL_2_5_0_0;
+  GLUT_2_3_1_0 = callPackage ../development/libraries/haskell/GLUT/2.3.1.0.nix {
+    OpenGL = self.OpenGL_2_6_0_1;
+  };
+  GLUT_2_4_0_0 = callPackage ../development/libraries/haskell/GLUT/2.4.0.0.nix {
+    OpenGL = self.OpenGL_2_8_0_0;
   };
-  GLUT22 = self.GLUT_2_2_2_1;
-  GLUT23 = self.GLUT_2_3_0_0;
-  GLUT = self.GLUT_2_3_0_0;
+  GLUT = self.GLUT_2_4_0_0;
+
+  gnuidn = callPackage ../development/libraries/haskell/gnuidn {};
+
+  gnutls = callPackage ../development/libraries/haskell/gnutls { inherit (pkgs) gnutls; };
+
+  gsasl = callPackage ../development/libraries/haskell/gsasl { inherit (pkgs) gsasl; };
 
   gtk = callPackage ../development/libraries/haskell/gtk {
     inherit (pkgs) gtk;
@@ -798,22 +1063,21 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   Graphalyze = callPackage ../development/libraries/haskell/Graphalyze {};
 
-  graphviz = callPackage ../development/libraries/haskell/graphviz {
-    fgl = self.fgl_5_4_2_4;
-    polyparse = self.polyparse_1_7;
-  };
+  graphviz = callPackage ../development/libraries/haskell/graphviz {};
+
+  groupoids = callPackage ../development/libraries/haskell/groupoids {};
 
   hakyll = callPackage ../development/libraries/haskell/hakyll {};
 
   hamlet = callPackage ../development/libraries/haskell/hamlet {};
 
-  happstackUtil = callPackage ../development/libraries/haskell/happstack/happstack-util.nix {};
-
   happstackServer = callPackage ../development/libraries/haskell/happstack/happstack-server.nix {};
 
   happstackHamlet = callPackage ../development/libraries/haskell/happstack/happstack-hamlet.nix {};
 
-  hashable = callPackage ../development/libraries/haskell/hashable {};
+  hashable_1_1_2_5 = callPackage ../development/libraries/haskell/hashable/1.1.2.5.nix {};
+  hashable_1_2_0_7 = callPackage ../development/libraries/haskell/hashable/1.2.0.7.nix {};
+  hashable = self.hashable_1_2_0_7;
 
   hashedStorage = callPackage ../development/libraries/haskell/hashed-storage {};
 
@@ -835,13 +1099,15 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   haskellSrc = self.haskellSrc_1_0_1_5;
 
   haskellSrcExts_1_11_1 = callPackage ../development/libraries/haskell/haskell-src-exts/1.11.1.nix {};
-  haskellSrcExts_1_13_3 = callPackage ../development/libraries/haskell/haskell-src-exts/1.13.3.nix {};
-  haskellSrcExts = self.haskellSrcExts_1_13_3;
+  haskellSrcExts_1_13_5 = callPackage ../development/libraries/haskell/haskell-src-exts/1.13.5.nix {};
+  haskellSrcExts = self.haskellSrcExts_1_13_5;
 
   haskellSrcMeta = callPackage ../development/libraries/haskell/haskell-src-meta {};
 
   hastache = callPackage ../development/libraries/haskell/hastache {};
 
+  hexpat = callPackage ../development/libraries/haskell/hexpat {};
+
   HTTP_4000_0_6 = callPackage ../development/libraries/haskell/HTTP/4000.0.6.nix {};
   HTTP_4000_0_9 = callPackage ../development/libraries/haskell/HTTP/4000.0.9.nix {};
   HTTP_4000_1_1 = callPackage ../development/libraries/haskell/HTTP/4000.1.1.nix {};
@@ -849,7 +1115,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   HTTP_4000_2_1 = callPackage ../development/libraries/haskell/HTTP/4000.2.1.nix {};
   HTTP_4000_2_2 = callPackage ../development/libraries/haskell/HTTP/4000.2.2.nix {};
   HTTP_4000_2_3 = callPackage ../development/libraries/haskell/HTTP/4000.2.3.nix {};
-  HTTP = self.HTTP_4000_2_3;
+  HTTP_4000_2_5 = callPackage ../development/libraries/haskell/HTTP/4000.2.5.nix {};
+  HTTP_4000_2_8 = callPackage ../development/libraries/haskell/HTTP/4000.2.8.nix {};
+  HTTP = self.HTTP_4000_2_8;
+
+  httpReverseProxy = callPackage ../development/libraries/haskell/http-reverse-proxy {};
 
   hackageDb = callPackage ../development/libraries/haskell/hackage-db {};
 
@@ -869,13 +1139,11 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   HDBCPostgresql = callPackage ../development/libraries/haskell/HDBC/HDBC-postgresql.nix {};
 
-  HDBCSqlite = callPackage ../development/libraries/haskell/HDBC/HDBC-sqlite3.nix {};
+  HDBCSqlite3 = callPackage ../development/libraries/haskell/HDBC/HDBC-sqlite3.nix {};
 
   heist = callPackage ../development/libraries/haskell/heist {};
 
-  HFuse = callPackage ../development/libraries/haskell/hfuse {};
-
-  HGL = callPackage ../development/libraries/haskell/HGL {};
+  HFuse = callPackage ../development/libraries/haskell/HFuse {};
 
   highlightingKate = callPackage ../development/libraries/haskell/highlighting-kate {};
 
@@ -930,11 +1198,21 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   hsloggerTemplate = callPackage ../development/libraries/haskell/hslogger-template {};
 
+  hspec = callPackage ../development/libraries/haskell/hspec {};
+
+  hspecExpectations = callPackage ../development/libraries/haskell/hspec-expectations {};
+
+  hspecMeta = callPackage ../development/libraries/haskell/hspec-meta {};
+
+  hstatsd = callPackage ../development/libraries/haskell/hstatsd {};
+
   hsyslog = callPackage ../development/libraries/haskell/hsyslog {};
 
   html_1_0_1_2 = callPackage ../development/libraries/haskell/html/1.0.1.2.nix {};
   html = self.html_1_0_1_2;
 
+  htmlConduit = callPackage ../development/libraries/haskell/html-conduit {};
+
   httpConduit = callPackage ../development/libraries/haskell/http-conduit {};
 
   httpdShed = callPackage ../development/libraries/haskell/httpd-shed {};
@@ -949,7 +1227,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   HUnit_1_2_4_2 = callPackage ../development/libraries/haskell/HUnit/1.2.4.2.nix {};
   HUnit_1_2_4_3 = callPackage ../development/libraries/haskell/HUnit/1.2.4.3.nix {};
   HUnit_1_2_5_1 = callPackage ../development/libraries/haskell/HUnit/1.2.5.1.nix {};
-  HUnit = self.HUnit_1_2_5_1;
+  HUnit_1_2_5_2 = callPackage ../development/libraries/haskell/HUnit/1.2.5.2.nix {};
+  HUnit = self.HUnit_1_2_5_2;
 
   hxt = callPackage ../development/libraries/haskell/hxt {};
 
@@ -959,6 +1238,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   hxtUnicode = callPackage ../development/libraries/haskell/hxt-unicode {};
 
+  idna = callPackage ../development/libraries/haskell/idna {};
+
   IfElse = callPackage ../development/libraries/haskell/IfElse {};
 
   ieee754 = callPackage ../development/libraries/haskell/ieee754 {};
@@ -973,14 +1254,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   ioStorage = callPackage ../development/libraries/haskell/io-storage {};
 
-  irc = callPackage ../development/libraries/haskell/irc {
-    parsec = self.parsec2;
-  };
+  iproute = callPackage ../development/libraries/haskell/iproute {};
+
+  irc = callPackage ../development/libraries/haskell/irc {};
 
   iteratee = callPackage ../development/libraries/haskell/iteratee {};
 
   ivor = callPackage ../development/libraries/haskell/ivor {};
 
+  ixShapable = callPackage ../development/libraries/haskell/ix-shapable {};
+
   JuicyPixels = callPackage ../development/libraries/haskell/JuicyPixels {};
 
   jpeg = callPackage ../development/libraries/haskell/jpeg {};
@@ -994,11 +1277,17 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   jsonTypes = callPackage ../development/libraries/haskell/jsonTypes {};
 
+  kansasLava = callPackage ../development/libraries/haskell/kansas-lava {};
+
+  knob = callPackage ../development/libraries/haskell/knob {};
+
   languageC_0_4_2   = callPackage ../development/libraries/haskell/language-c/0.4.2.nix {};
   languageC_0_3_2_1 = callPackage ../development/libraries/haskell/language-c/0.3.2.1.nix {};
   languageC = self.languageC_0_4_2;
 
-  languageCQuote = callPackage ../development/libraries/haskell/language-c-quote/default.nix {};
+  languageCQuote = callPackage ../development/libraries/haskell/language-c-quote {};
+
+  languageJava = callPackage ../development/libraries/haskell/language-java {};
 
   languageJavascript = callPackage ../development/libraries/haskell/language-javascript {};
 
@@ -1008,26 +1297,50 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   lambdabotUtils = callPackage ../development/libraries/haskell/lambdabot-utils {};
 
+  lambdacubeEngine = callPackage ../development/libraries/haskell/lambdacube-engine {};
+
   largeword = callPackage ../development/libraries/haskell/largeword {};
 
   lazysmallcheck = callPackage ../development/libraries/haskell/lazysmallcheck {};
 
   leksahServer = callPackage ../development/libraries/haskell/leksah/leksah-server.nix {};
 
+  lens = callPackage ../development/libraries/haskell/lens {};
+
+  lenses = callPackage ../development/libraries/haskell/lenses {};
+
+  libffi = callPackage ../development/libraries/haskell/libffi {
+    libffi = pkgs.libffi;
+  };
+
   libmpd = callPackage ../development/libraries/haskell/libmpd {};
 
+  liblastfm = callPackage ../development/libraries/haskell/liblastfm {};
+
+  libxmlSax = callPackage ../development/libraries/haskell/libxml-sax {};
+
   liftedBase = callPackage ../development/libraries/haskell/lifted-base {};
 
+  List = callPackage ../development/libraries/haskell/List {};
+
   ListLike = callPackage ../development/libraries/haskell/ListLike {};
 
+  ListZipper = callPackage ../development/libraries/haskell/ListZipper {};
+
   lrucache = callPackage ../development/libraries/haskell/lrucache {};
 
   ltk = callPackage ../development/libraries/haskell/ltk {};
 
+  lockfreeQueue = callPackage ../development/libraries/haskell/lockfree-queue {};
+
   logfloat = callPackage ../development/libraries/haskell/logfloat {};
 
   logict = callPackage ../development/libraries/haskell/logict {};
 
+  maccatcher = callPackage ../development/libraries/haskell/maccatcher {};
+
+  markdownUnlit = callPackage ../development/libraries/haskell/markdown-unlit {};
+
   mathFunctions = callPackage ../development/libraries/haskell/math-functions {};
 
   mainlandPretty = callPackage ../development/libraries/haskell/mainland-pretty {};
@@ -1040,10 +1353,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   mersenneRandomPure64 = callPackage ../development/libraries/haskell/mersenne-random-pure64 {};
 
+  minimorph = callPackage ../development/libraries/haskell/minimorph {};
+
+  miniutter = callPackage ../development/libraries/haskell/miniutter {};
+
   mimeMail = callPackage ../development/libraries/haskell/mime-mail {};
 
   mimeTypes = callPackage ../development/libraries/haskell/mime-types {};
 
+  misfortune = callPackage ../development/libraries/haskell/misfortune {};
+
   MissingH = callPackage ../development/libraries/haskell/MissingH {};
 
   mmap = callPackage ../development/libraries/haskell/mmap {};
@@ -1061,8 +1380,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   monadLogger = callPackage ../development/libraries/haskell/monad-logger {};
 
   monadPar_0_1_0_3 = callPackage ../development/libraries/haskell/monad-par/0.1.0.3.nix {};
-  monadPar_0_3 = callPackage ../development/libraries/haskell/monad-par/0.3.nix {};
-  monadPar = self.monadPar_0_3;
+  monadPar_0_3_4_2 = callPackage ../development/libraries/haskell/monad-par/0.3.4.2.nix {};
+  monadPar = self.monadPar_0_3_4_2;
 
   monadParExtras = callPackage ../development/libraries/haskell/monad-par-extras {};
 
@@ -1074,8 +1393,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   monadsTf = callPackage ../development/libraries/haskell/monads-tf {};
 
+  monoidExtras = callPackage ../development/libraries/haskell/monoid-extras {};
+
   mongoDB = callPackage ../development/libraries/haskell/mongoDB {};
 
+  mmorph = callPackage ../development/libraries/haskell/mmorph {};
+
   mpppc = callPackage ../development/libraries/haskell/mpppc {};
 
   mtl_1_1_0_2 = callPackage ../development/libraries/haskell/mtl/1.1.0.2.nix {};
@@ -1091,13 +1414,17 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   mtlparse = callPackage ../development/libraries/haskell/mtlparse {};
 
+  mueval = callPackage ../development/libraries/haskell/mueval {};
+
   multiarg = callPackage ../development/libraries/haskell/multiarg {};
 
   multiplate = callPackage ../development/libraries/haskell/multiplate {};
 
   multirec = callPackage ../development/libraries/haskell/multirec {};
 
-  multiset = callPackage ../development/libraries/haskell/multiset {};
+  multiset_0_2_1 = callPackage ../development/libraries/haskell/multiset/0.2.1.nix {};
+  multiset_0_2_2 = callPackage ../development/libraries/haskell/multiset/0.2.2.nix {};
+  multiset = self.multiset_0_2_1;   # later versions work only with ghc 7.6 and beyond
 
   murmurHash = callPackage ../development/libraries/haskell/murmur-hash {};
 
@@ -1105,15 +1432,45 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   NanoProlog = callPackage ../development/libraries/haskell/NanoProlog {};
 
+  nanospec = callPackage ../development/libraries/haskell/nanospec {};
+
+  nat = callPackage ../development/libraries/haskell/nat {};
+
+  nats = callPackage ../development/libraries/haskell/nats {};
+
+  naturals = callPackage ../development/libraries/haskell/naturals {};
+
+  netlist = callPackage ../development/libraries/haskell/netlist {};
+
+  netlistToVhdl = callPackage ../development/libraries/haskell/netlist-to-vhdl {};
+
+  netwire = callPackage ../development/libraries/haskell/netwire {};
+
   network_2_2_1_4 = callPackage ../development/libraries/haskell/network/2.2.1.4.nix {};
   network_2_2_1_7 = callPackage ../development/libraries/haskell/network/2.2.1.7.nix {};
   network_2_3_0_2 = callPackage ../development/libraries/haskell/network/2.3.0.2.nix {};
   network_2_3_0_5 = callPackage ../development/libraries/haskell/network/2.3.0.5.nix {};
   network_2_3_0_13 = callPackage ../development/libraries/haskell/network/2.3.0.13.nix {};
   network_2_3_1_0 = callPackage ../development/libraries/haskell/network/2.3.1.0.nix {};
-  network = self.network_2_3_1_0;
+  network_2_4_1_2 = callPackage ../development/libraries/haskell/network/2.4.1.2.nix {};
+  network = self.network_2_4_1_2;
 
   networkConduit = callPackage ../development/libraries/haskell/network-conduit {};
+  networkConduitTls = callPackage ../development/libraries/haskell/network-conduit-tls {};
+
+  networkInfo = callPackage ../development/libraries/haskell/network-info {};
+
+  networkMulticast = callPackage ../development/libraries/haskell/network-multicast {};
+
+  networkProtocolXmpp = callPackage ../development/libraries/haskell/network-protocol-xmpp {};
+
+  networkTransport = callPackage ../development/libraries/haskell/network-transport {};
+
+  networkTransportTcp = callPackage ../development/libraries/haskell/network-transport-tcp {};
+
+  networkTransportTests = callPackage ../development/libraries/haskell/network-transport-tests {};
+
+  newtype = callPackage ../development/libraries/haskell/newtype {};
 
   nonNegative = callPackage ../development/libraries/haskell/non-negative {};
 
@@ -1125,6 +1482,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   numtype = callPackage ../development/libraries/haskell/numtype {};
 
+  numtypeTf = callPackage ../development/libraries/haskell/numtype-tf {};
+
   OneTuple = callPackage ../development/libraries/haskell/OneTuple {};
 
   ObjectName = callPackage ../development/libraries/haskell/ObjectName {};
@@ -1137,12 +1496,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   OpenGL_2_2_3_0 = callPackage ../development/libraries/haskell/OpenGL/2.2.3.0.nix {};
   OpenGL_2_2_3_1 = callPackage ../development/libraries/haskell/OpenGL/2.2.3.1.nix {};
   OpenGL_2_4_0_2 = callPackage ../development/libraries/haskell/OpenGL/2.4.0.2.nix {};
-  OpenGL_2_5_0_0 = callPackage ../development/libraries/haskell/OpenGL/2.5.0.0.nix {};
-  OpenGL24 = self.OpenGL_2_4_0_2;
-  OpenGL25 = self.OpenGL_2_5_0_0;
-  OpenGL = self.OpenGL_2_5_0_0;
+  OpenGL_2_6_0_1 = callPackage ../development/libraries/haskell/OpenGL/2.6.0.1.nix {};
+  OpenGL_2_8_0_0 = callPackage ../development/libraries/haskell/OpenGL/2.8.0.0.nix {};
+  OpenGL = self.OpenGL_2_8_0_0;
 
-  OpenGLRaw = callPackage ../development/libraries/haskell/OpenGLRaw {};
+  OpenGLRaw_1_3_0_0 = callPackage ../development/libraries/haskell/OpenGLRaw/1.3.0.0.nix {};
+  OpenGLRaw = self.OpenGLRaw_1_3_0_0;
+
+  optparseApplicative = callPackage ../development/libraries/haskell/optparse-applicative {};
 
   pathPieces = callPackage ../development/libraries/haskell/path-pieces {};
 
@@ -1162,6 +1523,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   parallel_3_2_0_3 = callPackage ../development/libraries/haskell/parallel/3.2.0.3.nix {};
   parallel = self.parallel_3_2_0_3;
 
+  parallelIo = callPackage ../development/libraries/haskell/parallel-io {};
+
   parseargs = callPackage ../development/libraries/haskell/parseargs {};
 
   parsec_2_1_0_1 = callPackage ../development/libraries/haskell/parsec/2.1.0.1.nix {};
@@ -1194,23 +1557,42 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   pgm = callPackage ../development/libraries/haskell/pgm {};
 
-  polyparse_1_7 = callPackage ../development/libraries/haskell/polyparse/1.7.nix {};
-  polyparse_1_8 = callPackage ../development/libraries/haskell/polyparse/1.8.nix {};
-  polyparse = self.polyparse_1_8;
+  pipes = callPackage ../development/libraries/haskell/pipes {};
+
+  pipes-concurrency = callPackage ../development/libraries/haskell/pipes-concurrency {};
+
+  pipes-parse = callPackage ../development/libraries/haskell/pipes-parse {};
+
+  pipes-safe = callPackage ../development/libraries/haskell/pipes-safe {};
+
+  polyparse = callPackage ../development/libraries/haskell/polyparse {};
 
   poolConduit = callPackage ../development/libraries/haskell/pool-conduit {};
 
+  pop3client = callPackage ../development/libraries/haskell/pop3-client {};
+
   postgresqlLibpq = callPackage ../development/libraries/haskell/postgresql-libpq {
-    postgresql = pkgs.postgresql91;
+    inherit (pkgs) postgresql;
   };
 
   postgresqlSimple = callPackage ../development/libraries/haskell/postgresql-simple {};
 
   ppm = callPackage ../development/libraries/haskell/ppm {};
 
-  prettyShow = callPackage ../development/libraries/haskell/pretty-show {};
+  prettyShow_1_2 = callPackage ../development/libraries/haskell/pretty-show/1.2.nix {};
+  prettyShow_1_5 = callPackage ../development/libraries/haskell/pretty-show/1.5.nix {};
+  prettyShow = self.prettyShow_1_5;
+
+  punycode = callPackage ../development/libraries/haskell/punycode {};
+
+  primitive_0_5_0_1 = callPackage ../development/libraries/haskell/primitive/0.5.0.1.nix   {};
+  primitive = self.primitive_0_5_0_1;
+
+  profunctors = callPackage ../development/libraries/haskell/profunctors {};
+
+  profunctorExtras = callPackage ../development/libraries/haskell/profunctor-extras {};
 
-  primitive = callPackage ../development/libraries/haskell/primitive {};
+  projectTemplate = callPackage ../development/libraries/haskell/project-template {};
 
   processExtras = callPackage ../development/libraries/haskell/process-extras {};
 
@@ -1226,6 +1608,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   PSQueue = callPackage ../development/libraries/haskell/PSQueue {};
 
+  publicsuffixlist = callPackage ../development/libraries/haskell/publicsuffixlist {};
+
   pureMD5 = callPackage ../development/libraries/haskell/pureMD5 {};
 
   pwstoreFast = callPackage ../development/libraries/haskell/pwstore-fast {};
@@ -1236,11 +1620,14 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   QuickCheck_2_4_0_1 = callPackage ../development/libraries/haskell/QuickCheck/2.4.0.1.nix {};
   QuickCheck_2_4_1_1 = callPackage ../development/libraries/haskell/QuickCheck/2.4.1.1.nix {};
   QuickCheck_2_4_2 = callPackage ../development/libraries/haskell/QuickCheck/2.4.2.nix {};
-  QuickCheck_2_5 = callPackage ../development/libraries/haskell/QuickCheck/2.5.nix {};
+  QuickCheck_2_5_1_1 = callPackage ../development/libraries/haskell/QuickCheck/2.5.1.1.nix {};
+  QuickCheck_2_6 = callPackage ../development/libraries/haskell/QuickCheck/2.6.nix {};
   QuickCheck1 = self.QuickCheck_1_2_0_1;
-  QuickCheck2 = self.QuickCheck_2_5;
+  QuickCheck2 = self.QuickCheck_2_6;
   QuickCheck  = self.QuickCheck2;
 
+  quickcheckIo = callPackage ../development/libraries/haskell/quickcheck-io {};
+
   RangedSets = callPackage ../development/libraries/haskell/Ranged-sets {};
 
   random_1_0_1_1 = callPackage ../development/libraries/haskell/random/1.0.1.1.nix {};
@@ -1252,6 +1639,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   randomShuffle = callPackage ../development/libraries/haskell/random-shuffle {};
 
+  rank1dynamic = callPackage ../development/libraries/haskell/rank1dynamic {};
+
   ranges = callPackage ../development/libraries/haskell/ranges {};
 
   rvar = callPackage ../development/libraries/haskell/rvar {};
@@ -1260,12 +1649,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   reactiveBananaWx = callPackage ../development/libraries/haskell/reactive-banana-wx {};
 
+  ReadArgs = callPackage ../development/libraries/haskell/ReadArgs {};
+
   readline = callPackage ../development/libraries/haskell/readline {
     inherit (pkgs) readline;
   };
 
   recaptcha = callPackage ../development/libraries/haskell/recaptcha {};
 
+  reflection = callPackage ../development/libraries/haskell/reflection {};
+
   regexBase_0_72_0_2 = callPackage ../development/libraries/haskell/regex-base/0.72.0.2.nix {};
   regexBase_0_93_1   = callPackage ../development/libraries/haskell/regex-base/0.93.1.nix   {};
   regexBase_0_93_2   = callPackage ../development/libraries/haskell/regex-base/0.93.2.nix   {};
@@ -1274,9 +1667,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   regexCompat_0_71_0_1 = callPackage ../development/libraries/haskell/regex-compat/0.71.0.1.nix {};
   regexCompat_0_92     = callPackage ../development/libraries/haskell/regex-compat/0.92.nix     {};
   regexCompat_0_93_1   = callPackage ../development/libraries/haskell/regex-compat/0.93.1.nix   {};
-  regexCompat_0_95_1   = callPackage ../development/libraries/haskell/regex-compat/0.95.1.nix   {
-    regexPosix = self.regexPosix_0_95_1;
-  };
+  regexCompat_0_95_1   = callPackage ../development/libraries/haskell/regex-compat/0.95.1.nix   {};
   regexCompat93 = self.regexCompat_0_93_1;
   regexCompat = self.regexCompat_0_71_0_1;
 
@@ -1284,12 +1675,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   regexPosix_0_94_1 = callPackage ../development/libraries/haskell/regex-posix/0.94.1.nix {};
   regexPosix_0_94_2 = callPackage ../development/libraries/haskell/regex-posix/0.94.2.nix {};
   regexPosix_0_94_4 = callPackage ../development/libraries/haskell/regex-posix/0.94.4.nix {};
-  regexPosix_0_95_1 = callPackage ../development/libraries/haskell/regex-posix/0.95.1.nix {
-    regexBase = self.regexBase_0_93_2;
-  };
-  regexPosix_0_95_2 = callPackage ../development/libraries/haskell/regex-posix/0.95.2.nix {
-    regexBase = self.regexBase_0_93_2;
-  };
+  regexPosix_0_95_1 = callPackage ../development/libraries/haskell/regex-posix/0.95.1.nix {};
+  regexPosix_0_95_2 = callPackage ../development/libraries/haskell/regex-posix/0.95.2.nix {};
   regexPosix = self.regexPosix_0_95_2;
 
   regexTDFA = callPackage ../development/libraries/haskell/regex-tdfa {};
@@ -1298,8 +1685,6 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   regexPCRE = callPackage ../development/libraries/haskell/regex-pcre {};
   regexPcre = self.regexPCRE;
 
-  regexPcreBuiltin = callPackage ../development/libraries/haskell/regex-pcre-builtin {};
-
   regexpr = callPackage ../development/libraries/haskell/regexpr {};
 
   regular = callPackage ../development/libraries/haskell/regular {};
@@ -1321,26 +1706,42 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   RSA = callPackage ../development/libraries/haskell/RSA {};
 
+  sampleFrame = callPackage ../development/libraries/haskell/sample-frame {};
+
   safe = callPackage ../development/libraries/haskell/safe {};
 
+  safecopy = callPackage ../development/libraries/haskell/safecopy {};
+
+  SafeSemaphore = callPackage ../development/libraries/haskell/SafeSemaphore {};
+
+  scotty = callPackage ../development/libraries/haskell/scotty {};
+
   sendfile = callPackage ../development/libraries/haskell/sendfile {};
 
   semigroups = callPackage ../development/libraries/haskell/semigroups {};
 
-  semigroupoids_1_3_4 = callPackage ../development/libraries/haskell/semigroupoids/1.3.4.nix {
-    comonad = self.comonad_1_1_1_6;
-  };
-  semigroupoids_3_0 = callPackage ../development/libraries/haskell/semigroupoids/3.0.nix {};
-  semigroupoids = self.semigroupoids_3_0;
+  semigroupoids = callPackage ../development/libraries/haskell/semigroupoids {};
+
+  semigroupoidExtras = callPackage ../development/libraries/haskell/semigroupoid-extras {};
+
+  setenv = callPackage ../development/libraries/haskell/setenv {};
 
   shelly = callPackage ../development/libraries/haskell/shelly {};
 
+  simpleReflect = callPackage ../development/libraries/haskell/simple-reflect {};
+
   simpleSendfile = callPackage ../development/libraries/haskell/simple-sendfile {};
 
+  silently = callPackage ../development/libraries/haskell/silently {};
+
+  sizedTypes = callPackage ../development/libraries/haskell/sized-types {};
+
   skein = callPackage ../development/libraries/haskell/skein {};
 
   smallcheck = callPackage ../development/libraries/haskell/smallcheck {};
 
+  smtpMail = callPackage ../development/libraries/haskell/smtp-mail {};
+
   snap = callPackage ../development/libraries/haskell/snap/snap.nix {};
 
   snapCore = callPackage ../development/libraries/haskell/snap/core.nix {};
@@ -1367,14 +1768,23 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   stringCombinators = callPackage ../development/libraries/haskell/string-combinators {};
 
+  stringprep = callPackage ../development/libraries/haskell/stringprep {};
+
+  stringQq = callPackage ../development/libraries/haskell/string-qq {};
+
   stringsearch = callPackage ../development/libraries/haskell/stringsearch {};
 
+  strptime = callPackage ../development/libraries/haskell/strptime {};
+
+  stylishHaskell = callPackage ../development/libraries/haskell/stylish-haskell {};
+
   syb_0_2_2 = callPackage ../development/libraries/haskell/syb/0.2.2.nix {};
   syb_0_3 = callPackage ../development/libraries/haskell/syb/0.3.nix {};
   syb_0_3_3 = callPackage ../development/libraries/haskell/syb/0.3.3.nix {};
   syb_0_3_6_1 = callPackage ../development/libraries/haskell/syb/0.3.6.1.nix {};
   syb_0_3_6_2 = callPackage ../development/libraries/haskell/syb/0.3.6.2.nix {};
   syb_0_3_7 = callPackage ../development/libraries/haskell/syb/0.3.7.nix {};
+  syb_0_4_0 = callPackage ../development/libraries/haskell/syb/0.4.0.nix {};
   syb = null;  # by default, we assume that syb ships with GHC, which is
                # true for the older GHC versions
 
@@ -1394,6 +1804,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   SHA = callPackage ../development/libraries/haskell/SHA {};
 
+  shake = callPackage ../development/libraries/haskell/shake {};
+
   shakespeare = callPackage ../development/libraries/haskell/shakespeare {};
 
   shakespeareCss = callPackage ../development/libraries/haskell/shakespeare-css {};
@@ -1410,7 +1822,9 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   SMTPClient = callPackage ../development/libraries/haskell/SMTPClient {};
 
-  split = callPackage ../development/libraries/haskell/split {};
+  split_0_2_1_1 = callPackage ../development/libraries/haskell/split/0.2.1.1.nix {};
+  split_0_2_2 = callPackage ../development/libraries/haskell/split/0.2.2.nix {};
+  split = self.split_0_2_2;
 
   stbImage = callPackage ../development/libraries/haskell/stb-image {};
 
@@ -1419,7 +1833,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   stm_2_2_0_1 = callPackage ../development/libraries/haskell/stm/2.2.0.1.nix {};
   stm_2_3 = callPackage ../development/libraries/haskell/stm/2.3.nix {};
   stm_2_4 = callPackage ../development/libraries/haskell/stm/2.4.nix {};
-  stm = self.stm_2_4;
+  stm_2_4_2 = callPackage ../development/libraries/haskell/stm/2.4.2.nix {};
+  stm = self.stm_2_4_2;
+
+  stmChans = callPackage ../development/libraries/haskell/stm-chans {};
+
+  stmConduit = callPackage ../development/libraries/haskell/stm-conduit {};
 
   storableComplex = callPackage ../development/libraries/haskell/storable-complex {};
 
@@ -1429,6 +1848,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   strictConcurrency = callPackage ../development/libraries/haskell/strictConcurrency {};
 
+  stringbuilder = callPackage ../development/libraries/haskell/stringbuilder {};
+
   svgcairo = callPackage ../development/libraries/haskell/svgcairo {
     libc = pkgs.stdenv.gcc.libc;
   };
@@ -1447,17 +1868,17 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   tagsoup = callPackage ../development/libraries/haskell/tagsoup {};
 
-  tagsoup_0_10_1 = callPackage ../development/libraries/haskell/tagsoup/0.10.1nix {};
+  tagstreamConduit = callPackage ../development/libraries/haskell/tagstream-conduit {};
 
   temporary = callPackage ../development/libraries/haskell/temporary {};
 
   Tensor = callPackage ../development/libraries/haskell/Tensor {};
 
+  terminalProgressBar = callPackage ../development/libraries/haskell/terminal-progress-bar {};
+
   terminfo = callPackage ../development/libraries/haskell/terminfo {};
 
-  testFramework_0_6 = callPackage ../development/libraries/haskell/test-framework/0.6.nix {};
-  testFramework_0_5 = callPackage ../development/libraries/haskell/test-framework/0.5.nix {};
-  testFramework = self.testFramework_0_6;
+  testFramework = callPackage ../development/libraries/haskell/test-framework {};
 
   testFrameworkHunit = callPackage ../development/libraries/haskell/test-framework-hunit {};
 
@@ -1469,7 +1890,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   testFrameworkTh = callPackage ../development/libraries/haskell/test-framework-th {};
 
-  testpack = callPackage ../development/libraries/haskell/testpack {};
+  testFrameworkThPrime = callPackage ../development/libraries/haskell/test-framework-th-prime {};
 
   texmath = callPackage ../development/libraries/haskell/texmath {};
 
@@ -1479,7 +1900,10 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   text_0_11_1_13 = callPackage ../development/libraries/haskell/text/0.11.1.13.nix {};
   text_0_11_2_0 = callPackage ../development/libraries/haskell/text/0.11.2.0.nix {};
   text_0_11_2_3 = callPackage ../development/libraries/haskell/text/0.11.2.3.nix {};
-  text = self.text_0_11_2_3;
+  text_0_11_3_1 = callPackage ../development/libraries/haskell/text/0.11.3.1.nix {};
+  text = self.text_0_11_3_1;
+
+  textIcu = callPackage ../development/libraries/haskell/text-icu {};
 
   thespian = callPackage ../development/libraries/haskell/thespian {};
 
@@ -1487,17 +1911,20 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   thLift = callPackage ../development/libraries/haskell/th-lift {};
 
+  thOrphans = callPackage ../development/libraries/haskell/th-orphans {};
+
   threadmanager = callPackage ../development/libraries/haskell/threadmanager {};
 
+  threads = callPackage ../development/libraries/haskell/threads {};
+
   time_1_1_2_4 = callPackage ../development/libraries/haskell/time/1.1.2.4.nix {};
-  time_1_1_3   = callPackage ../development/libraries/haskell/time/1.1.3.nix {};
-  time_1_2_0_3 = callPackage ../development/libraries/haskell/time/1.2.0.3.nix {};
-  time_1_2_0_5 = callPackage ../development/libraries/haskell/time/1.2.0.5.nix {};
-  time_1_4_0_1 = callPackage ../development/libraries/haskell/time/1.4.0.1.nix {};
+  time_1_4_0_2 = callPackage ../development/libraries/haskell/time/1.4.0.2.nix {};
   # time is in the core package set. It should only be necessary to
   # pass it explicitly in rare circumstances.
   time = null;
 
+  timeCompat = callPackage ../development/libraries/haskell/time-compat {};
+
   tls = callPackage ../development/libraries/haskell/tls {};
 
   tlsExtra = callPackage ../development/libraries/haskell/tls-extra {};
@@ -1508,26 +1935,38 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   transformersBase = callPackage ../development/libraries/haskell/transformers-base {};
 
+  transformersCompat = callPackage ../development/libraries/haskell/transformers-compat {};
+
   tuple = callPackage ../development/libraries/haskell/tuple {};
 
   typeEquality = callPackage ../development/libraries/haskell/type-equality {};
 
+  typeLevelNaturalNumber = callPackage ../development/libraries/haskell/type-level-natural-number {};
+
   unbound = callPackage ../development/libraries/haskell/unbound {};
 
+  unboundedDelays = callPackage ../development/libraries/haskell/unbounded-delays {};
+
   uniplate = callPackage ../development/libraries/haskell/uniplate {};
 
   uniqueid = callPackage ../development/libraries/haskell/uniqueid {};
 
   unixCompat = callPackage ../development/libraries/haskell/unix-compat {};
 
+  unixProcessConduit = callPackage ../development/libraries/haskell/unix-process-conduit {};
+
   unixTime = callPackage ../development/libraries/haskell/unix-time {};
 
   unlambda = callPackage ../development/libraries/haskell/unlambda {};
 
-  unorderedContainers = callPackage ../development/libraries/haskell/unordered-containers {};
+  unorderedContainers_0_2_3_0 = callPackage ../development/libraries/haskell/unordered-containers/0.2.3.0.nix {};
+  unorderedContainers_0_2_3_1 = callPackage ../development/libraries/haskell/unordered-containers/0.2.3.1.nix {};
+  unorderedContainers = self.unorderedContainers_0_2_3_1;
 
   url = callPackage ../development/libraries/haskell/url {};
 
+  urlencoded = callPackage ../development/libraries/haskell/urlencoded {};
+
   utf8Light = callPackage ../development/libraries/haskell/utf8-light {};
 
   utf8String = callPackage ../development/libraries/haskell/utf8-string {};
@@ -1536,6 +1975,12 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   uulib = callPackage ../development/libraries/haskell/uulib {};
 
+  uuid = callPackage ../development/libraries/haskell/uuid {};
+
+  uuOptions = callPackage ../development/libraries/haskell/uu-options {};
+
+  uuInterleaved = callPackage ../development/libraries/haskell/uu-interleaved {};
+
   uuParsinglib = callPackage ../development/libraries/haskell/uu-parsinglib {};
 
   vacuum = callPackage ../development/libraries/haskell/vacuum {};
@@ -1544,26 +1989,43 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   vault = callPackage ../development/libraries/haskell/vault {};
 
+  vcsRevision = callPackage ../development/libraries/haskell/vcs-revision {};
+
   Vec = callPackage ../development/libraries/haskell/Vec {};
 
-  vector = callPackage ../development/libraries/haskell/vector {};
+  vect = callPackage ../development/libraries/haskell/vect {};
+
+  vector_0_9_1 = callPackage ../development/libraries/haskell/vector/0.9.1.nix {};
+  vector_0_10 = callPackage ../development/libraries/haskell/vector/0.10.nix  {};
+  vector_0_10_0_1  = callPackage ../development/libraries/haskell/vector/0.10.0.1.nix  {};
+  vector = self.vector_0_10_0_1;
 
   vectorAlgorithms = callPackage ../development/libraries/haskell/vector-algorithms {};
 
+  vectorBinaryInstances = callPackage ../development/libraries/haskell/vector-binary-instances {};
+
   vectorSpace = callPackage ../development/libraries/haskell/vector-space {};
 
+  vectorSpacePoints = callPackage ../development/libraries/haskell/vector-space-points {};
+
   void = callPackage ../development/libraries/haskell/void {};
 
   vty = callPackage ../development/libraries/haskell/vty {};
 
+  vtyUi = callPackage ../development/libraries/haskell/vty-ui {};
+
   wai = callPackage ../development/libraries/haskell/wai {};
 
   waiAppStatic = callPackage ../development/libraries/haskell/wai-app-static {};
 
   waiExtra = callPackage ../development/libraries/haskell/wai-extra {};
 
+  waiHandlerLaunch = callPackage ../development/libraries/haskell/wai-handler-launch {};
+
   waiLogger = callPackage ../development/libraries/haskell/wai-logger {};
 
+  waiTest = callPackage ../development/libraries/haskell/wai-test {};
+
   warp = callPackage ../development/libraries/haskell/warp {};
 
   WebBits_1_0 = callPackage ../development/libraries/haskell/WebBits/1.0.nix {
@@ -1585,8 +2047,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   CouchDB = callPackage ../development/libraries/haskell/CouchDB {};
 
+  wlPprint = callPackage ../development/libraries/haskell/wl-pprint {};
+
+  wlPprintExtras = callPackage ../development/libraries/haskell/wl-pprint-extras {};
+
+  wlPprintTerminfo = callPackage ../development/libraries/haskell/wl-pprint-terminfo {};
+
   wlPprintText = callPackage ../development/libraries/haskell/wl-pprint-text {};
 
+  word8 = callPackage ../development/libraries/haskell/word8 {};
+
   wx = callPackage ../development/libraries/haskell/wxHaskell/wx.nix {};
 
   wxc = callPackage ../development/libraries/haskell/wxHaskell/wxc.nix {
@@ -1597,16 +2067,16 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     wxGTK = pkgs.wxGTK29;
   };
 
-  wxdirect = callPackage ../development/libraries/haskell/wxHaskell/wxdirect.nix {
-    time = self.time_1_2_0_5;
-  };
+  wxdirect = callPackage ../development/libraries/haskell/wxHaskell/wxdirect.nix {};
 
-  X11_1_5_0_1 = callPackage ../development/libraries/haskell/X11/1.5.0.1.nix {};
-  X11_1_6_0 = callPackage ../development/libraries/haskell/X11/1.6.0.nix {};
-  X11 = self.X11_1_6_0;
+  X11 = callPackage ../development/libraries/haskell/X11 {};
 
   X11Xft = callPackage ../development/libraries/haskell/X11-xft {};
 
+  xdgBasedir = callPackage ../development/libraries/haskell/xdg-basedir {};
+
+  xdot = callPackage ../development/libraries/haskell/xdot {};
+
   xhtml_3000_2_0_1 = callPackage ../development/libraries/haskell/xhtml/3000.2.0.1.nix {};
   xhtml_3000_2_0_4 = callPackage ../development/libraries/haskell/xhtml/3000.2.0.4.nix {};
   xhtml_3000_2_0_5 = callPackage ../development/libraries/haskell/xhtml/3000.2.0.5.nix {};
@@ -1617,6 +2087,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   xmlConduit = callPackage ../development/libraries/haskell/xml-conduit {};
 
+  xmlHamlet = callPackage ../development/libraries/haskell/xml-hamlet {};
+
   xmlhtml = callPackage ../development/libraries/haskell/xmlhtml {};
 
   xmlTypes = callPackage ../development/libraries/haskell/xml-types {};
@@ -1627,6 +2099,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   yap = callPackage ../development/libraries/haskell/yap {};
 
+  yeganesh = callPackage ../applications/misc/yeganesh {};
+
   yesod = callPackage ../development/libraries/haskell/yesod {};
 
   yesodAuth = callPackage ../development/libraries/haskell/yesod-auth {};
@@ -1641,13 +2115,19 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   yesodPersistent = callPackage ../development/libraries/haskell/yesod-persistent {};
 
+  yesodPlatform = callPackage ../development/libraries/haskell/yesod-platform {};
+
   yesodRoutes = callPackage ../development/libraries/haskell/yesod-routes {};
 
   yesodStatic = callPackage ../development/libraries/haskell/yesod-static {};
 
+  yesodTest = callPackage ../development/libraries/haskell/yesod-test {};
+
   yst = callPackage ../development/libraries/haskell/yst {};
 
-  zeromqHaskell = callPackage ../development/libraries/haskell/zeromq-haskell {};
+  zeromqHaskell = callPackage ../development/libraries/haskell/zeromq-haskell { zeromq = pkgs.zeromq2; };
+
+  zeromq3Haskell = callPackage ../development/libraries/haskell/zeromq3-haskell { zeromq = pkgs.zeromq3; };
 
   zipArchive = callPackage ../development/libraries/haskell/zip-archive {};
 
@@ -1665,7 +2145,13 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   zlib_0_5_3_3 = callPackage ../development/libraries/haskell/zlib/0.5.3.3.nix {
     inherit (pkgs) zlib;
   };
-  zlib = self.zlib_0_5_3_3;
+  zlib_0_5_4_0 = callPackage ../development/libraries/haskell/zlib/0.5.4.0.nix {
+    inherit (pkgs) zlib;
+  };
+  zlib_0_5_4_1 = callPackage ../development/libraries/haskell/zlib/0.5.4.1.nix {
+    inherit (pkgs) zlib;
+  };
+  zlib = self.zlib_0_5_4_1;
 
   zlibBindings = callPackage ../development/libraries/haskell/zlib-bindings {};
 
@@ -1685,8 +2171,6 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   flapjax = callPackage ../development/compilers/flapjax {};
 
-  idris = callPackage ../development/compilers/idris {};
-
   pakcs = callPackage ../development/compilers/pakcs {};
 
   # Development tools.
@@ -1697,7 +2181,8 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   alex_2_3_5 = callPackage ../development/tools/parsing/alex/2.3.5.nix {};
   alex_3_0_1 = callPackage ../development/tools/parsing/alex/3.0.1.nix {};
   alex_3_0_2 = callPackage ../development/tools/parsing/alex/3.0.2.nix {};
-  alex = self.alex_3_0_2;
+  alex_3_0_5 = callPackage ../development/tools/parsing/alex/3.0.5.nix {};
+  alex = self.alex_3_0_5;
 
   alexMeta = callPackage ../development/tools/haskell/alex-meta {};
 
@@ -1714,14 +2199,18 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   haddock_2_9_2 = callPackage ../development/tools/documentation/haddock/2.9.2.nix {};
   haddock_2_9_4 = callPackage ../development/tools/documentation/haddock/2.9.4.nix {};
   haddock_2_10_0 = callPackage ../development/tools/documentation/haddock/2.10.0.nix {};
-  haddock = self.haddock_2_10_0;
+  haddock_2_11_0 = callPackage ../development/tools/documentation/haddock/2.11.0.nix {};
+  haddock_2_12_0 = callPackage ../development/tools/documentation/haddock/2.12.0.nix {};
+  haddock_2_13_2 = callPackage ../development/tools/documentation/haddock/2.13.2.nix {};
+  haddock = self.haddock_2_13_2;
 
   happy_1_18_4 = callPackage ../development/tools/parsing/happy/1.18.4.nix {};
   happy_1_18_5 = callPackage ../development/tools/parsing/happy/1.18.5.nix {};
   happy_1_18_6 = callPackage ../development/tools/parsing/happy/1.18.6.nix {};
   happy_1_18_8 = callPackage ../development/tools/parsing/happy/1.18.8.nix {};
   happy_1_18_9 = callPackage ../development/tools/parsing/happy/1.18.9.nix {};
-  happy = self.happy_1_18_9;
+  happy_1_18_10 = callPackage ../development/tools/parsing/happy/1.18.10.nix {};
+  happy = self.happy_1_18_10;
 
   happyMeta = callPackage ../development/tools/haskell/happy-meta {};
 
@@ -1739,9 +2228,7 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
     haskellSrcExts = self.haskellSrcExts_1_11_1;
   };
 
-  tar_0_3_2_0 = callPackage ../development/tools/haskell/tar/0.3.2.0.nix {};
-  tar_0_4_0_0 = callPackage ../development/tools/haskell/tar/0.4.0.0.nix {};
-  tar = self.tar_0_4_0_0;
+  tar = callPackage ../development/libraries/haskell/tar {};
 
   threadscope = callPackage ../development/tools/haskell/threadscope {};
 
@@ -1751,42 +2238,34 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
 
   # Applications.
 
-  darcs = callPackage ../applications/version-management/darcs {
-    tar = self.tar_0_3_2_0;
-  };
+  arbtt = callPackage ../applications/misc/arbtt {};
+
+  darcs = callPackage ../applications/version-management/darcs {};
+
+  idris_plain = callPackage ../development/compilers/idris {};
+
+  idris = callPackage ../development/compilers/idris/wrapper.nix {};
 
   leksah = callPackage ../applications/editors/leksah {
     QuickCheck = self.QuickCheck2;
   };
 
-  mathblog = callPackage ../applications/misc/mathblog {
-    testFramework = self.testFramework_0_5;
-    testFrameworkHunit = self.testFrameworkHunit.override {
-      testFramework = self.testFramework_0_5;
-    };
-  };
-
-  xmobar = callPackage ../applications/misc/xmobar {
-    stm = self.stm_2_3;
-  };
+  xmobar = callPackage ../applications/misc/xmobar {};
 
-  xmonad = callPackage ../applications/window-managers/xmonad {
-    X11 = self.X11_1_5_0_1;
-  };
+  xmonad = callPackage ../applications/window-managers/xmonad {};
 
-  xmonadContrib = callPackage ../applications/window-managers/xmonad/xmonad-contrib.nix {
-    X11 = self.X11_1_5_0_1;
-    X11Xft = self.X11Xft.override { X11 = self.X11_1_5_0_1; };
-  };
+  xmonadContrib = callPackage ../applications/window-managers/xmonad/xmonad-contrib.nix {};
 
-  xmonadExtras = callPackage ../applications/window-managers/xmonad/xmonad-extras.nix {
-    X11 = self.X11_1_5_0_1;
-  };
+  xmonadExtras = callPackage ../applications/window-managers/xmonad/xmonad-extras.nix {};
 
   # Tools.
 
   cabal2nix = callPackage ../development/tools/haskell/cabal2nix {};
 
+  cabalDev = callPackage ../development/tools/haskell/cabal-dev {};
+
+  cabal2Ghci = callPackage ../development/tools/haskell/cabal2ghci {};
+
   cabalGhci = callPackage ../development/tools/haskell/cabal-ghci {};
 
   cabalInstall_0_6_2  = callPackage ../tools/package-management/cabal-install/0.6.2.nix  {};
@@ -1794,12 +2273,27 @@ let result = let callPackage = x : y : modifyPrio (newScope result.final x y);
   cabalInstall_0_8_2  = callPackage ../tools/package-management/cabal-install/0.8.2.nix  {};
   cabalInstall_0_10_2 = callPackage ../tools/package-management/cabal-install/0.10.2.nix {};
   cabalInstall_0_14_0 = callPackage ../tools/package-management/cabal-install/0.14.0.nix {};
-  cabalInstall = self.cabalInstall_0_14_0;
+  cabalInstall_1_16_0_2 = callPackage ../tools/package-management/cabal-install/1.16.0.2.nix {};
+  cabalInstall = self.cabalInstall_1_16_0_2;
+
+  gitAnnex = callPackage ../applications/version-management/git-and-tools/git-annex {};
+
+  githubBackup = callPackage ../applications/version-management/git-and-tools/github-backup {};
+
+  jailbreakCabal = callPackage ../development/tools/haskell/jailbreak-cabal {};
+
+  keter = callPackage ../development/tools/haskell/keter {};
 
   lhs2tex = callPackage ../tools/typesetting/lhs2tex {};
 
   myhasktags = callPackage ../tools/misc/myhasktags {};
 
+  packunused = callPackage ../development/tools/haskell/packunused {};
+
+  splot = callPackage ../development/tools/haskell/splot {};
+
+  timeplot = callPackage ../development/tools/haskell/timeplot {};
+
   # Games.
 
   LambdaHack = callPackage ../games/LambdaHack {};
diff --git a/pkgs/top-level/make-tarball.nix b/pkgs/top-level/make-tarball.nix
index d2f74fe74c0..7fb597fd6d8 100644
--- a/pkgs/top-level/make-tarball.nix
+++ b/pkgs/top-level/make-tarball.nix
@@ -2,9 +2,7 @@
    also builds the documentation and tests whether the Nix expressions
    evaluate correctly. */
 
-{ nixpkgs ? { outPath = (import ./all-packages.nix {}).lib.cleanSource ../..; revCount = 1234; shortRev = "abcdef"; }
-, officialRelease ? false
-}:
+{ nixpkgs, officialRelease }:
 
 with import nixpkgs.outPath {};
 
@@ -47,16 +45,16 @@ releaseTools.sourceTarball {
     export NIX_DB_DIR=$TMPDIR
     export NIX_STATE_DIR=$TMPDIR
     nix-store --init
-  
+
     # Run the regression tests in `lib'.
     res="$(nix-instantiate --eval-only --strict pkgs/lib/tests.nix)"
     if test "$res" != "[ ]"; then
         echo "regression tests for lib failed, got: $res"
         exit 1
     fi
-  
+
     # Check that all-packages.nix evaluates on a number of platforms.
-    for platform in i686-linux x86_64-linux powerpc-linux i686-freebsd powerpc-darwin i686-darwin; do
+    for platform in i686-linux x86_64-linux powerpc-linux i686-freebsd; do
         header "checking pkgs/top-level/all-packages.nix on $platform"
         nix-env --readonly-mode -f pkgs/top-level/all-packages.nix \
             --show-trace --argstr system "$platform" \
@@ -72,13 +70,12 @@ releaseTools.sourceTarball {
 
   distPhase = ''
     find . -name "\.svn" -exec rm -rvf {} \; -prune
-  
+
     mkdir -p $out/tarballs
     mkdir ../$releaseName
     cp -prd . ../$releaseName
     echo nixpkgs > ../$releaseName/channel-name
-    (cd .. && tar cfa $out/tarballs/$releaseName.tar.bz2 $releaseName) || false
-    (cd .. && tar cfa $out/tarballs/$releaseName.tar.lzma $releaseName) || false
+    (cd .. && tar cfa $out/tarballs/$releaseName.tar.xz $releaseName) || false
 
     mkdir -p $out/release-notes
     cp doc/NEWS.html $out/release-notes/index.html
diff --git a/pkgs/top-level/node-packages-generated.nix b/pkgs/top-level/node-packages-generated.nix
new file mode 100644
index 00000000000..9e1e6f5a5a5
--- /dev/null
+++ b/pkgs/top-level/node-packages-generated.nix
@@ -0,0 +1,2009 @@
+[
+  {
+    baseName = "abbrev";
+    version = "1.0.4";
+    fullName = "abbrev-1";
+    hash = "8dc0f480571a4a19e74f1abd4f31f6a70f94953d1ccafa16ed1a544a19a6f3a8";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "amdefine";
+    version = "0.0.5";
+    fullName = "amdefine-*";
+    hash = "7d7a691c9742d4c9aaa8036b823823e45a676dec6897f2e072b90c7d37722fc1";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "amdefine";
+    version = "0.0.5";
+    fullName = "amdefine->=0.0.4";
+    hash = "7d7a691c9742d4c9aaa8036b823823e45a676dec6897f2e072b90c7d37722fc1";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "ansi-remover";
+    version = "0.0.2";
+    fullName = "ansi-remover-*";
+    hash = "cda72261ea8d6b830892764d69eff8d926be852fc91ad3b8b5b258d606400bc7";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "ansi";
+    version = "0.1.2";
+    fullName = "ansi-~0.1.2";
+    hash = "6f2288b1db642eb822578f4ee70bf26bf97173cc7d3f10f496070fb96250006b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "asn1";
+    version = "0.1.11";
+    fullName = "asn1-0.1.11";
+    hash = "7206eadc8a9344e484bcce979e22a12c9fa64c1395aa0544b8b767808b268f43";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "assert";
+    version = "0.4.9";
+    fullName = "assert-*";
+    hash = "976a12385f7286d123734fabc7355bbeecd2532daccfada02909818b905abeeb";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "util"; range = ">= 0.4.9"; }
+    ];
+  }
+  {
+    baseName = "assert-plus";
+    version = "0.1.2";
+    fullName = "assert-plus-0.1.2";
+    hash = "bd62e853460024d1e35d3f76065f4c856a271e55ef1ce684f3033314b7377c61";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "async";
+    version = "0.2.9";
+    fullName = "async-*";
+    hash = "7215c94b63ccaa543b4b75c5dd9b820fd4839e1f9616b08a0334a8ac74939c53";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "async";
+    version = "0.2.9";
+    fullName = "async-~0.2.7";
+    hash = "7215c94b63ccaa543b4b75c5dd9b820fd4839e1f9616b08a0334a8ac74939c53";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "aws-sdk";
+    version = "1.2.0";
+    fullName = "aws-sdk-*";
+    hash = "e2d4b32fba387b8f099c4180579b67554f875895a69e4c1ddb0a28546db9ba4c";
+    patchLatest = true;
+    topLevel = true;
+    dependencies = [
+      { name = "xml2js"; range = "0.2.4"; }
+      { name = "xmlbuilder"; range = "*"; }
+    ];
+  }
+  {
+    baseName = "aws-sdk";
+    version = "1.2.0";
+    fullName = "aws-sdk->=1.2.0 <2";
+    hash = "e2d4b32fba387b8f099c4180579b67554f875895a69e4c1ddb0a28546db9ba4c";
+    patchLatest = true;
+    topLevel = false;
+    dependencies = [
+      { name = "xml2js"; range = "0.2.4"; }
+      { name = "xmlbuilder"; range = "*"; }
+    ];
+  }
+  {
+    baseName = "aws-sign";
+    version = "0.3.0";
+    fullName = "aws-sign-~0.3.0";
+    hash = "5acca27ed2b1b9f081e4dd230e03808b6a038f8a4afa698db985320efe6dda5e";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "backbone";
+    version = "1.0.0";
+    fullName = "backbone-*";
+    hash = "6c66edc5134bb531b33a7f140c75c4a65cdc21711eed64c29300a84cba84f3a7";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "underscore"; range = ">=1.4.3"; }
+    ];
+  }
+  {
+    baseName = "backoff";
+    version = "2.1.0";
+    fullName = "backoff-2.1.0";
+    hash = "d1f5bf32f2f5954f6259582ead30fc8a769db35bac9900c94593b77f915cee0d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "block-stream";
+    version = "0.0.6";
+    fullName = "block-stream-*";
+    hash = "2fc365b42b8601c8ee150d453f6cc762a01054b7fb28bdfcfcbce7c97e93601b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "inherits"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "boom";
+    version = "0.4.2";
+    fullName = "boom-0.4.x";
+    hash = "294e022990269e7fa1e3015862d2d24847cc83c3e68d214dad5a2d0d3826a08f";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "hoek"; range = "0.9.x"; }
+    ];
+  }
+  {
+    baseName = "browserchannel";
+    version = "1.0.4";
+    fullName = "browserchannel-*";
+    hash = "516add6af10f887500c5eaae7347ce92c0101a6bea1a67d5221a674d07bc7999";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "hat"; range = "*"; }
+      { name = "connect"; range = "~2"; }
+      { name = "request"; range = "~2"; }
+    ];
+  }
+  {
+    baseName = "buffer-crc32";
+    version = "0.2.1";
+    fullName = "buffer-crc32-0.2.1";
+    hash = "b6ea96d57411e37c15e18fb8ca600656399912ce16355f9af3c662f765507f01";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "buffertools";
+    version = "1.1.1";
+    fullName = "buffertools-*";
+    hash = "f5962aec81246077a46ee075072d40fa533c31ada7a0ec18e1ff3600af2d8f3f";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "bunyan";
+    version = "0.21.1";
+    fullName = "bunyan-0.21.1";
+    hash = "95dca2405dcbe5b700e15d7c89b2a64fb21a097fb7ada5c274979f2057adcbef";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "mv"; range = "0.0.5"; }
+      { name = "dtrace-provider"; range = "0.2.8"; }
+    ];
+  }
+  {
+    baseName = "bytes";
+    version = "0.2.0";
+    fullName = "bytes-0.2.0";
+    hash = "e70bd4dccc886a5cf1c925092b4acd7a262a9da3e1b51ccde10a3fcd0a328465";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cli";
+    version = "0.4.4-2";
+    fullName = "cli-0.4.x";
+    hash = "27a0db02501285da601c47495d0cd837ddeb4577bfd507c5503d2ee8cd0caffb";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "glob"; range = ">= 3.1.4"; }
+    ];
+  }
+  {
+    baseName = "clone";
+    version = "0.1.5";
+    fullName = "clone-0.1.5";
+    hash = "9fd586470ccc3fa585dcccad730b5e6fa9c471b49acdb38d724c110777a287d9";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "clone";
+    version = "0.1.6";
+    fullName = "clone-0.1.6";
+    hash = "9849c9faa2549d982106d3b43862dc4ceb308563badcd3ff59e30655d54e897a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "coffee-script";
+    version = "1.6.3";
+    fullName = "coffee-script-*";
+    hash = "642d226d4fab1a8464e54347cec919b1c8771da55d88e3ceb15d826fcee84525";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "combined-stream";
+    version = "0.0.4";
+    fullName = "combined-stream-~0.0.4";
+    hash = "2502ed7a4406db1a65b09cae3106221051d6af20d3f1d7e8cc38cfc72a36432c";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "delayed-stream"; range = "0.0.5"; }
+    ];
+  }
+  {
+    baseName = "commander";
+    version = "0.5.1";
+    fullName = "commander-0.5.1";
+    hash = "91042851d0731b28a5e7c342e5cbce7723a7243d31ae378fa86c45ca9493a924";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "commander";
+    version = "0.6.1";
+    fullName = "commander-0.6.1";
+    hash = "7b7fdd1bc4d16f6776169a64f133d629efe2e3a7cd338b1d0884ee909abbd729";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "connect";
+    version = "2.7.11";
+    fullName = "connect-2.7.11";
+    hash = "8c9aaabcb7e6f0d733f82b876db59a37a6d711aab7ea2dead9f624d9282b1245";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "qs"; range = "0.6.5"; }
+      { name = "formidable"; range = "1.0.14"; }
+      { name = "cookie-signature"; range = "1.0.1"; }
+      { name = "buffer-crc32"; range = "0.2.1"; }
+      { name = "cookie"; range = "0.0.5"; }
+      { name = "send"; range = "0.1.1"; }
+      { name = "bytes"; range = "0.2.0"; }
+      { name = "fresh"; range = "0.1.0"; }
+      { name = "pause"; range = "0.0.1"; }
+      { name = "debug"; range = "*"; }
+    ];
+  }
+  {
+    baseName = "connect";
+    version = "2.7.11";
+    fullName = "connect-~2";
+    hash = "8c9aaabcb7e6f0d733f82b876db59a37a6d711aab7ea2dead9f624d9282b1245";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "qs"; range = "0.6.5"; }
+      { name = "formidable"; range = "1.0.14"; }
+      { name = "cookie-signature"; range = "1.0.1"; }
+      { name = "buffer-crc32"; range = "0.2.1"; }
+      { name = "cookie"; range = "0.0.5"; }
+      { name = "send"; range = "0.1.1"; }
+      { name = "bytes"; range = "0.2.0"; }
+      { name = "fresh"; range = "0.1.0"; }
+      { name = "pause"; range = "0.0.1"; }
+      { name = "debug"; range = "*"; }
+    ];
+  }
+  {
+    baseName = "console-browserify";
+    version = "0.1.6";
+    fullName = "console-browserify-0.1.x";
+    hash = "e774c881920562b0893e50844332f79fc5a08752d28791d942c35fcc3ef2d75d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cookie";
+    version = "0.0.5";
+    fullName = "cookie-0.0.5";
+    hash = "17938b21dcd85f09994b85484abb5aeddc4e92c61d1b599b764bbaaa7ad6adee";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cookie";
+    version = "0.1.0";
+    fullName = "cookie-0.1.0";
+    hash = "aff5d22a617d744319cc70e42fc4ab11bcbcf924244af565495fa799c0639650";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cookie-jar";
+    version = "0.3.0";
+    fullName = "cookie-jar-~0.3.0";
+    hash = "c7bac7739b9ceb194f431a4a9ac1a0ba4ffd4a60492c61dd1925dbcdb9030746";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cookie-signature";
+    version = "1.0.1";
+    fullName = "cookie-signature-1.0.1";
+    hash = "e2ea4f290fdcfe82d8fb76991fee4106d4ae1f5d5a2f8b8d91442e047c538c8e";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "cryptiles";
+    version = "0.2.1";
+    fullName = "cryptiles-0.2.x";
+    hash = "a7ad8087bf6abbbfa0ae159756c04326a490f373212f6f2fd0f3a1f63f475892";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "boom"; range = "0.4.x"; }
+    ];
+  }
+  {
+    baseName = "ctype";
+    version = "0.5.0";
+    fullName = "ctype-0.5.0";
+    hash = "50157e6c5e44d1c833bfc239a7a337ee08fd6f3c5a15f7ef5cee5571a86b0378";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "ctype";
+    version = "0.5.2";
+    fullName = "ctype-0.5.2";
+    hash = "4a7224a74f19dc6a1206fa1c04ae1a4ab795cd4ba842466e2f511fa714f82c60";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "debug";
+    version = "0.7.2";
+    fullName = "debug-*";
+    hash = "f9142856b1c2652a11e50f2aca068edbad7598f50d9e6d003b8ee85b2a333d63";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "debug";
+    version = "0.7.2";
+    fullName = "debug-~0.7.0";
+    hash = "f9142856b1c2652a11e50f2aca068edbad7598f50d9e6d003b8ee85b2a333d63";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "deep-equal";
+    version = "0.0.0";
+    fullName = "deep-equal-0.0.0";
+    hash = "6a5666d4bfa5d2786a9f86ede2eaa8252f783edb9d78e69cba645f7cb6e153b8";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "delayed-stream";
+    version = "0.0.5";
+    fullName = "delayed-stream-0.0.5";
+    hash = "f40e440dac0f853577d5225d7bd4b2026ea1447a724f4ba1096e29983ee595dd";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "diff";
+    version = "1.0.2";
+    fullName = "diff-1.0.2";
+    hash = "5de1d8c3f2bfc447a7e664cadd4aca2ef4952a43256310cc51a36b30b5be3045";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "dtrace-provider";
+    version = "0.2.8";
+    fullName = "dtrace-provider-0.2.8";
+    hash = "200941239983fa0953415cf28e96d9347c50218d31280604cfc9252e448e714c";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "escape-html";
+    version = "1.0.0";
+    fullName = "escape-html-*";
+    hash = "c763095c6b27fddf666f34d48a4f09f95009a76a6d16d1799175ecd0c1912456";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "events.node";
+    version = "0.4.9";
+    fullName = "events.node->= 0.4.0";
+    hash = "aedaf9faa7a33f16e2bf1754ed988a836570d00064748a8c1c8ee48805b9f0b6";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "express";
+    version = "3.2.6";
+    fullName = "express-*";
+    hash = "a0c9ee92fe1366daf166f30ae77f824aa65c2f5e121596fa2c4f439b518cde99";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "connect"; range = "2.7.11"; }
+      { name = "commander"; range = "0.6.1"; }
+      { name = "range-parser"; range = "0.0.4"; }
+      { name = "mkdirp"; range = "0.3.4"; }
+      { name = "cookie"; range = "0.1.0"; }
+      { name = "buffer-crc32"; range = "0.2.1"; }
+      { name = "fresh"; range = "0.1.0"; }
+      { name = "methods"; range = "0.0.1"; }
+      { name = "send"; range = "0.1.0"; }
+      { name = "cookie-signature"; range = "1.0.1"; }
+      { name = "debug"; range = "*"; }
+    ];
+  }
+  {
+    baseName = "extend";
+    version = "1.1.3";
+    fullName = "extend-*";
+    hash = "0b27709829110f2e84926ebe3494b82df6e79ad49a618ad3444e4edf62b57a57";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "extsprintf";
+    version = "1.0.0";
+    fullName = "extsprintf-1.0.0";
+    hash = "9cae7f1f192e5f35746e13047ab4c13e8b5b686469feeaec301ba7d370df5670";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "extsprintf";
+    version = "1.0.2";
+    fullName = "extsprintf-1.0.2";
+    hash = "ea000cf3e51cba7fac7fb1e425ddb79bf46f3ce40955955bf35fd487184a04ab";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "faye-websocket";
+    version = "0.6.0";
+    fullName = "faye-websocket-*";
+    hash = "192f09ecd1c52fc357d2ad3ae3121be35556b7b09e30ce74117d80b9dbae3f60";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "websocket-driver"; range = ">=0.2.0"; }
+    ];
+  }
+  {
+    baseName = "faye-websocket";
+    version = "0.4.4";
+    fullName = "faye-websocket-0.4.4";
+    hash = "c682f6269bcaba0667ef4ae0ecb0b662e35ea6338b075e25ebce9e13019bc3a2";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "forever-agent";
+    version = "0.5.0";
+    fullName = "forever-agent-~0.5.0";
+    hash = "0a7eda1f87f3cfa7fad8ba655a642992033b38a1929becfa0bfcab8241b7d78b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "form-data";
+    version = "0.0.8";
+    fullName = "form-data-0.0.8";
+    hash = "cf7d5669259ec4c5474b9c2100127ba065a4757ff33b878a1d99509b8e448220";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "combined-stream"; range = "~0.0.4"; }
+      { name = "mime"; range = "~1.2.2"; }
+      { name = "async"; range = "~0.2.7"; }
+    ];
+  }
+  {
+    baseName = "form-data";
+    version = "0.0.10";
+    fullName = "form-data-~0.0.3";
+    hash = "d49669b81c27dd6c7e359ee9892880c6741dae6c325b617ab3eb5a78bf103822";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "combined-stream"; range = "~0.0.4"; }
+      { name = "mime"; range = "~1.2.2"; }
+      { name = "async"; range = "~0.2.7"; }
+    ];
+  }
+  {
+    baseName = "formidable";
+    version = "1.0.13";
+    fullName = "formidable-1.0.13";
+    hash = "c3c7c6ecdd4b1ad9ec9b1c273d8dd1db2bc12f9a699c233d3885fcded58ceec6";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "formidable";
+    version = "1.0.14";
+    fullName = "formidable-1.0.14";
+    hash = "b36e58f659fd0d7c734b4ab2c611fa6e40bd988c2237a29d25025460f18f7ea1";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "fresh";
+    version = "0.1.0";
+    fullName = "fresh-0.1.0";
+    hash = "c402fbd25e26c0167bf288e1ba791716808bfaa5de32b76ae68e8e8a3d7e2b33";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "fstream";
+    version = "0.1.22";
+    fullName = "fstream-0";
+    hash = "2ace3993d34cbf5e97bcb9c7eec3f011fa2041ce66cb688e39e747285084496a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "rimraf"; range = "2"; }
+      { name = "mkdirp"; range = "0.3"; }
+      { name = "graceful-fs"; range = "~1.2.0"; }
+      { name = "inherits"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "fstream";
+    version = "0.1.22";
+    fullName = "fstream-~0.1.8";
+    hash = "2ace3993d34cbf5e97bcb9c7eec3f011fa2041ce66cb688e39e747285084496a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "rimraf"; range = "2"; }
+      { name = "mkdirp"; range = "0.3"; }
+      { name = "graceful-fs"; range = "~1.2.0"; }
+      { name = "inherits"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "glob";
+    version = "3.2.1";
+    fullName = "glob-3";
+    hash = "a457c2115213ce2cb59582ddc3a25eb3ae7490af687e412111c0032f72966f51";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "minimatch"; range = "~0.2.11"; }
+      { name = "graceful-fs"; range = "~1.2.0"; }
+      { name = "inherits"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "glob";
+    version = "3.2.1";
+    fullName = "glob-3.2.1";
+    hash = "a457c2115213ce2cb59582ddc3a25eb3ae7490af687e412111c0032f72966f51";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "minimatch"; range = "~0.2.11"; }
+      { name = "graceful-fs"; range = "~1.2.0"; }
+      { name = "inherits"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "glob";
+    version = "3.2.1";
+    fullName = "glob->= 3.1.4";
+    hash = "a457c2115213ce2cb59582ddc3a25eb3ae7490af687e412111c0032f72966f51";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "minimatch"; range = "~0.2.11"; }
+      { name = "graceful-fs"; range = "~1.2.0"; }
+      { name = "inherits"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "graceful-fs";
+    version = "1.2.1";
+    fullName = "graceful-fs-1";
+    hash = "eeef3c36c6a6476059a7e7a32d0b87e62133b11392c540f5c8c68c87f65c7c59";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "graceful-fs";
+    version = "1.2.1";
+    fullName = "graceful-fs-~1";
+    hash = "eeef3c36c6a6476059a7e7a32d0b87e62133b11392c540f5c8c68c87f65c7c59";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "graceful-fs";
+    version = "1.2.1";
+    fullName = "graceful-fs-~1.2.0";
+    hash = "eeef3c36c6a6476059a7e7a32d0b87e62133b11392c540f5c8c68c87f65c7c59";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "growl";
+    version = "1.7.0";
+    fullName = "growl-1.7.x";
+    hash = "52a6e9edae2fd5a66ddb87c52a398a17ee697eb0e8e1480e9506a6dcdbf3ffcf";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "hat";
+    version = "0.0.3";
+    fullName = "hat-*";
+    hash = "7bf52b3b020ca333a42eb67411090912b21abb6ac746d587022a0955b16e5f5c";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "hawk";
+    version = "0.13.1";
+    fullName = "hawk-~0.13.0";
+    hash = "659e5ada1e9dc44a634e07899937d5eaeaa1c06658f181ca187f7f6faa0c592a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "hoek"; range = "0.8.x"; }
+      { name = "boom"; range = "0.4.x"; }
+      { name = "cryptiles"; range = "0.2.x"; }
+      { name = "sntp"; range = "0.2.x"; }
+    ];
+  }
+  {
+    baseName = "hoek";
+    version = "0.8.5";
+    fullName = "hoek-0.8.x";
+    hash = "637e524cd4b48b66db137d6fa93cbe254f112ce638ea9fd399bab73591ede965";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "hoek";
+    version = "0.9.1";
+    fullName = "hoek-0.9.x";
+    hash = "34480468d2e85781ecdd7134523b4d6fea978d333edd2bcb828edd33bbbe8a3f";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "htdigest";
+    version = "1.0.7";
+    fullName = "htdigest-1.0.7";
+    hash = "10fb047addf1c4f1089a26389066d5ff8f5ffa1ccce272a701bb4c2a30d90c58";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "commander"; range = "0.5.1"; }
+    ];
+  }
+  {
+    baseName = "htpasswd";
+    version = "1.1.0";
+    fullName = "htpasswd-1.1.0";
+    hash = "cee9c0a525e717e3565ba6ffea8a64c480bc8a9e7800cb9bfc385d1a8e713ec9";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "commander"; range = "0.5.1"; }
+    ];
+  }
+  {
+    baseName = "http-auth";
+    version = "1.2.7";
+    fullName = "http-auth-1.2.7";
+    hash = "874dbb5907d03602f31eae959a0927a3112da8e868231d9a2119bb50d2fe63d2";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "node-uuid"; range = "1.2.0"; }
+      { name = "htpasswd"; range = "1.1.0"; }
+      { name = "htdigest"; range = "1.0.7"; }
+    ];
+  }
+  {
+    baseName = "http-signature";
+    version = "0.9.11";
+    fullName = "http-signature-0.9.11";
+    hash = "44b89f3c1917bf02723a5720f08fbe47448e0370a5d3498d1be860eaf28beb3b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "assert-plus"; range = "0.1.2"; }
+      { name = "asn1"; range = "0.1.11"; }
+      { name = "ctype"; range = "0.5.2"; }
+    ];
+  }
+  {
+    baseName = "http-signature";
+    version = "0.9.11";
+    fullName = "http-signature-~0.9.11";
+    hash = "44b89f3c1917bf02723a5720f08fbe47448e0370a5d3498d1be860eaf28beb3b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "assert-plus"; range = "0.1.2"; }
+      { name = "asn1"; range = "0.1.11"; }
+      { name = "ctype"; range = "0.5.2"; }
+    ];
+  }
+  {
+    baseName = "inherits";
+    version = "1.0.0";
+    fullName = "inherits-1";
+    hash = "2be196fa6bc6a0c65fecd737af457589ef88b22a95d5dc31aab01d92ace48186";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "inherits";
+    version = "1.0.0";
+    fullName = "inherits-1.x";
+    hash = "2be196fa6bc6a0c65fecd737af457589ef88b22a95d5dc31aab01d92ace48186";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "inherits";
+    version = "1.0.0";
+    fullName = "inherits-~1.0.0";
+    hash = "2be196fa6bc6a0c65fecd737af457589ef88b22a95d5dc31aab01d92ace48186";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "jade";
+    version = "0.26.3";
+    fullName = "jade-0.26.3";
+    hash = "ea314287eb192b6987f7bb9d7010bf2c35ff6288f125fa00796ad93bdba14d0b";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "commander"; range = "0.6.1"; }
+      { name = "mkdirp"; range = "0.3.0"; }
+    ];
+  }
+  {
+    baseName = "jayschema";
+    version = "0.1.5";
+    fullName = "jayschema-*";
+    hash = "66e17d82f0b24d882321d42da2f094ab2b14df8a3f558b88867800e672f5c80d";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "jshint";
+    version = "2.1.3";
+    fullName = "jshint-*";
+    hash = "aaad18f3e6ec6e118d2990d8e627f62125c34ed28f864c9f3b6c46d4cf5d3288";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "shelljs"; range = "0.1.x"; }
+      { name = "underscore"; range = "1.4.x"; }
+      { name = "cli"; range = "0.4.x"; }
+      { name = "minimatch"; range = "0.x.x"; }
+      { name = "console-browserify"; range = "0.1.x"; }
+    ];
+  }
+  {
+    baseName = "json-schema";
+    version = "0.2.2";
+    fullName = "json-schema-0.2.2";
+    hash = "41b873a8fb542caf337ec17ad5593761e8db5ce8e33f4074b733b34ec656f0e8";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "json-stringify-safe";
+    version = "4.0.0";
+    fullName = "json-stringify-safe-~4.0.0";
+    hash = "2461befc8dab37d1d83927ab4bf4aa68b162a35b5a85c1a90c70f86500091b60";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "jsontool";
+    version = "5.1.3";
+    fullName = "jsontool-*";
+    hash = "097889f294920e43c2a8f8d9156971860c67c61ecfe5a1e411c4d641e521985c";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "jsprim";
+    version = "0.3.0";
+    fullName = "jsprim-0.3.0";
+    hash = "0fd12872374ee55cc0c005a1590ef65def0e96de04734a753e0d1480c3ffc4bd";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "extsprintf"; range = "1.0.0"; }
+      { name = "json-schema"; range = "0.2.2"; }
+      { name = "verror"; range = "1.3.3"; }
+    ];
+  }
+  {
+    baseName = "keep-alive-agent";
+    version = "0.0.1";
+    fullName = "keep-alive-agent-0.0.1";
+    hash = "481f10eeb5b9759ad28d9556f30c1747a5e71fbbad55fb130b96eacc7ac1c7a1";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "knox";
+    version = "0.8.2";
+    fullName = "knox-*";
+    hash = "e4842cb834f27dc859fc6ab2389f7d0702f6cc6ecff469b89729dd33c33c0afd";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "mime"; range = "*"; }
+      { name = "xml2js"; range = "0.2.x"; }
+      { name = "debug"; range = "~0.7.0"; }
+      { name = "stream-counter"; range = "~0.1.0"; }
+    ];
+  }
+  {
+    baseName = "lru-cache";
+    version = "2.3.0";
+    fullName = "lru-cache-2";
+    hash = "fbb1a14e0314095b7999a3a7489c92983f3d95b188857af697487ac8a778e942";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "lru-cache";
+    version = "2.2.0";
+    fullName = "lru-cache-2.2.0";
+    hash = "bdfb66f74cc4097f3bfd6062b2edbb7790d709f414c7d0f3419241840b1bffed";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "lru-cache";
+    version = "2.3.0";
+    fullName = "lru-cache-2.3.0";
+    hash = "fbb1a14e0314095b7999a3a7489c92983f3d95b188857af697487ac8a778e942";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "methods";
+    version = "0.0.1";
+    fullName = "methods-0.0.1";
+    hash = "2f7e32954dff5991dd8220e8f5dcdd32aeec5ec56ce9f7235872444af51b3adb";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.9";
+    fullName = "mime-*";
+    hash = "60120b9859a92a94480a76327a9406b4a72a34f2317bc7fa33dcb99b9c72678a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.6";
+    fullName = "mime-1.2.6";
+    hash = "7460134d6b4686d64fd1e7b878d34e2bdd258ad29b6665cf62e6d92659e81591";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.9";
+    fullName = "mime-1.2.9";
+    hash = "60120b9859a92a94480a76327a9406b4a72a34f2317bc7fa33dcb99b9c72678a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.9";
+    fullName = "mime-~1.2.2";
+    hash = "60120b9859a92a94480a76327a9406b4a72a34f2317bc7fa33dcb99b9c72678a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.9";
+    fullName = "mime-~1.2.7";
+    hash = "60120b9859a92a94480a76327a9406b4a72a34f2317bc7fa33dcb99b9c72678a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mime";
+    version = "1.2.9";
+    fullName = "mime-~1.2.9";
+    hash = "60120b9859a92a94480a76327a9406b4a72a34f2317bc7fa33dcb99b9c72678a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "minimatch";
+    version = "0.2.12";
+    fullName = "minimatch-0";
+    hash = "205cff8b4ba926e86ff0e6f7f566553906113892028083ea221989a42500c246";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "lru-cache"; range = "2"; }
+      { name = "sigmund"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "minimatch";
+    version = "0.2.12";
+    fullName = "minimatch-0.x.x";
+    hash = "205cff8b4ba926e86ff0e6f7f566553906113892028083ea221989a42500c246";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "lru-cache"; range = "2"; }
+      { name = "sigmund"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "minimatch";
+    version = "0.2.12";
+    fullName = "minimatch-~0.2.11";
+    hash = "205cff8b4ba926e86ff0e6f7f566553906113892028083ea221989a42500c246";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "lru-cache"; range = "2"; }
+      { name = "sigmund"; range = "~1.0.0"; }
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.5";
+    fullName = "mkdirp-*";
+    hash = "8ae9c5107acb41110106224f5e7be2b50b00d15d062ea7941301c111b863fd26";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.5";
+    fullName = "mkdirp-0";
+    hash = "8ae9c5107acb41110106224f5e7be2b50b00d15d062ea7941301c111b863fd26";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.5";
+    fullName = "mkdirp-0.3";
+    hash = "8ae9c5107acb41110106224f5e7be2b50b00d15d062ea7941301c111b863fd26";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.0";
+    fullName = "mkdirp-0.3.0";
+    hash = "708366e3a89c976ae8418056f2c5f784147b9310e8093f9bb7246d2f55f7c27d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.3";
+    fullName = "mkdirp-0.3.3";
+    hash = "b67a12855b7522c3cfb767e36b95f4eaaf9d423c5bd01f7f0449172259957df9";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mkdirp";
+    version = "0.3.4";
+    fullName = "mkdirp-0.3.4";
+    hash = "f87444f2376c56bf47846f3b885aae926c5d9504328923b166794b78c0e08425";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mocha";
+    version = "1.10.0";
+    fullName = "mocha-*";
+    hash = "d19c4fdcddb6498d0f303c3e5fd85401888a269f36ccdfcc92763dcc9e80bf97";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "commander"; range = "0.6.1"; }
+      { name = "growl"; range = "1.7.x"; }
+      { name = "jade"; range = "0.26.3"; }
+      { name = "diff"; range = "1.0.2"; }
+      { name = "debug"; range = "*"; }
+      { name = "mkdirp"; range = "0.3.3"; }
+      { name = "ms"; range = "0.3.0"; }
+      { name = "glob"; range = "3.2.1"; }
+    ];
+  }
+  {
+    baseName = "ms";
+    version = "0.3.0";
+    fullName = "ms-0.3.0";
+    hash = "f72eab0186a6dabbbea7118f83d4e2c01119e427f6671096a0c7ed522abe07f2";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "mv";
+    version = "0.0.5";
+    fullName = "mv-0.0.5";
+    hash = "6ddbf4770ffd02170a8fc492cee418ad92ce2f1e2eb4c549febac1f60e6533b9";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "negotiator";
+    version = "0.2.5";
+    fullName = "negotiator-0.2.5";
+    hash = "37f567acba03ef7748802c4f6b41ca7e57a3fb556c4435cda515028c73d76542";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "nijs";
+    version = "0.0.5";
+    fullName = "nijs-*";
+    hash = "c5e9f93f240757e1ab2d0ad341384db6e0b73ab2616ae9832d1ed772eaebd408";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "optparse"; range = ">= 1.0.3"; }
+    ];
+  }
+  {
+    baseName = "node-expat";
+    version = "2.0.0";
+    fullName = "node-expat-*";
+    hash = "9d5b7efd708fc546f5c17e98f4ee322abafaaa02fbb6c281f651d10d9523c83f";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "node-gyp";
+    version = "0.9.6";
+    fullName = "node-gyp-*";
+    hash = "937090ffd7de10079861ef562d0282dd4100873aa7bba7de9cd6ea7982b41b0b";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "glob"; range = "3"; }
+      { name = "graceful-fs"; range = "1"; }
+      { name = "fstream"; range = "0"; }
+      { name = "minimatch"; range = "0"; }
+      { name = "mkdirp"; range = "0"; }
+      { name = "nopt"; range = "2"; }
+      { name = "npmlog"; range = "0"; }
+      { name = "osenv"; range = "0"; }
+      { name = "request"; range = ">= 2 && <= 2.14"; }
+      { name = "rimraf"; range = "2"; }
+      { name = "semver"; range = "1"; }
+      { name = "tar"; range = "0"; }
+      { name = "which"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "node-uuid";
+    version = "1.4.0";
+    fullName = "node-uuid-*";
+    hash = "87a1944b5334351ddd1d3e44d2e423ebfc027e858111efb72324054092cfd1bc";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "node-uuid";
+    version = "1.2.0";
+    fullName = "node-uuid-1.2.0";
+    hash = "96d3ce178ea0825d27a855630de74243a577dc988512512eea572829b208a3d2";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "node-uuid";
+    version = "1.3.3";
+    fullName = "node-uuid-1.3.3";
+    hash = "a3fbccc904944a9c8eadc59e55aaac908cc458569f539b50077d9672a84587a8";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "node-uuid";
+    version = "1.4.0";
+    fullName = "node-uuid-1.4.0";
+    hash = "87a1944b5334351ddd1d3e44d2e423ebfc027e858111efb72324054092cfd1bc";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "node-uuid";
+    version = "1.4.0";
+    fullName = "node-uuid-~1.4.0";
+    hash = "87a1944b5334351ddd1d3e44d2e423ebfc027e858111efb72324054092cfd1bc";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "nopt";
+    version = "2.1.1";
+    fullName = "nopt-2";
+    hash = "a7a84f3fe51cb8fb97c678bc73130b53d6782ee90dc0e9b15ae39630ce2fa203";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "abbrev"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "nopt";
+    version = "2.0.0";
+    fullName = "nopt-2.0.0";
+    hash = "112e9bea8b745a2e5a59d239e6f6f02e720e080ab8cdca89b6b8f0143ae718b5";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "abbrev"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "npm2nix";
+    version = "1.2.0";
+    fullName = "npm2nix-*";
+    hash = "b79bd319e4030704bb41078dbbec0db9eebb984966c6bd3cad55ba4c76ec622c";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "semver"; range = "1"; }
+    ];
+  }
+  {
+    baseName = "npmlog";
+    version = "0.0.2";
+    fullName = "npmlog-0";
+    hash = "ce98d4d3380390c0259695cce407e2e96d2970c5caee1461a62ecbd38e8caed4";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "ansi"; range = "~0.1.2"; }
+    ];
+  }
+  {
+    baseName = "oauth-sign";
+    version = "0.3.0";
+    fullName = "oauth-sign-~0.3.0";
+    hash = "a202acb9ea84ef53e6a82a6ee5113328cd4bfd68d6ba04d15f1da933660b087e";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "once";
+    version = "1.1.1";
+    fullName = "once-1.1.1";
+    hash = "3fdc1a246f2522991fd9a6554a93c012c3192ea99918fdd893a2d4f2d546fe93";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "optimist";
+    version = "0.5.2";
+    fullName = "optimist-*";
+    hash = "838ad97b81beedb85fd0f0c4cd4740a940ddefb9a3db8e261f5fed7528693d3d";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "wordwrap"; range = "~0.0.2"; }
+    ];
+  }
+  {
+    baseName = "optparse";
+    version = "1.0.4";
+    fullName = "optparse-*";
+    hash = "8413ed6a2318ffecdb428181a6966013d1853ff62644afcbcff682c1efc9367a";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "optparse";
+    version = "1.0.4";
+    fullName = "optparse->= 1.0.3";
+    hash = "8413ed6a2318ffecdb428181a6966013d1853ff62644afcbcff682c1efc9367a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "osenv";
+    version = "0.0.3";
+    fullName = "osenv-0";
+    hash = "aafbb23637b7338c9025f9da336f31f96674d7926c30f209e4d93ce16d5251c4";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "pause";
+    version = "0.0.1";
+    fullName = "pause-0.0.1";
+    hash = "d37b84046db0c28c9768be649e8f02bd991ede34b276b5dba7bade23b523235e";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "posix-getopt";
+    version = "1.0.0";
+    fullName = "posix-getopt-1.0.0";
+    hash = "134cea188854422ab047db9ebfcb7e2610f0a239fe27382b55c10894c4f5ba9d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "qs";
+    version = "0.5.5";
+    fullName = "qs-0.5.5";
+    hash = "8ed820b83bf4aff299422dc406c7a52793e05f510803cc1cc2da7de1528837f1";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "qs";
+    version = "0.6.5";
+    fullName = "qs-0.6.5";
+    hash = "293e5dfd16bfe0aee8b3fe130abb951ac9c8c084d1103f7d81c4e5c312b2940d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "qs";
+    version = "0.6.5";
+    fullName = "qs-~0.6.0";
+    hash = "293e5dfd16bfe0aee8b3fe130abb951ac9c8c084d1103f7d81c4e5c312b2940d";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "range-parser";
+    version = "0.0.4";
+    fullName = "range-parser-0.0.4";
+    hash = "8e1bcce3544330b51644ea0cb4d25f0daa4b43008a75da27e285635f4ac4b1ce";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "rbytes";
+    version = "0.0.2";
+    fullName = "rbytes-*";
+    hash = "0fd4697be996ee12c65f8fb13b2edc7a554d22c31d1a344539bc611ce73b69aa";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "readable-stream";
+    version = "1.0.2";
+    fullName = "readable-stream-~1.0.2";
+    hash = "45a918b25f0799f87d7144dbbb7d2b5974dc079fcb1a2149a305d080f1155754";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "request";
+    version = "2.12.0";
+    fullName = "request->= 2 && <= 2.14";
+    hash = "a26790d2179da11a644d5deaa2ae5d37472bf0e73355fde02ea5923106308997";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "form-data"; range = "~0.0.3"; }
+      { name = "mime"; range = "~1.2.7"; }
+    ];
+  }
+  {
+    baseName = "request";
+    version = "2.21.0";
+    fullName = "request-~2";
+    hash = "fe31c3119bc4423f07aa7c9849cb642d5ad22bdf2a2700eab56fb83fa8ed429c";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "qs"; range = "~0.6.0"; }
+      { name = "json-stringify-safe"; range = "~4.0.0"; }
+      { name = "forever-agent"; range = "~0.5.0"; }
+      { name = "tunnel-agent"; range = "~0.3.0"; }
+      { name = "http-signature"; range = "~0.9.11"; }
+      { name = "hawk"; range = "~0.13.0"; }
+      { name = "aws-sign"; range = "~0.3.0"; }
+      { name = "oauth-sign"; range = "~0.3.0"; }
+      { name = "cookie-jar"; range = "~0.3.0"; }
+      { name = "node-uuid"; range = "~1.4.0"; }
+      { name = "mime"; range = "~1.2.9"; }
+      { name = "form-data"; range = "0.0.8"; }
+    ];
+  }
+  {
+    baseName = "restify";
+    version = "2.4.1";
+    fullName = "restify-2.4.1";
+    hash = "b46ed86ef17f1896a4dd961de8cc8ec96b57b7f44ef7421f3804764289f5b563";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "assert-plus"; range = "0.1.2"; }
+      { name = "backoff"; range = "2.1.0"; }
+      { name = "bunyan"; range = "0.21.1"; }
+      { name = "deep-equal"; range = "0.0.0"; }
+      { name = "formidable"; range = "1.0.13"; }
+      { name = "http-signature"; range = "0.9.11"; }
+      { name = "keep-alive-agent"; range = "0.0.1"; }
+      { name = "lru-cache"; range = "2.3.0"; }
+      { name = "mime"; range = "1.2.9"; }
+      { name = "negotiator"; range = "0.2.5"; }
+      { name = "node-uuid"; range = "1.4.0"; }
+      { name = "once"; range = "1.1.1"; }
+      { name = "qs"; range = "0.5.5"; }
+      { name = "semver"; range = "1.1.4"; }
+      { name = "spdy"; range = "1.7.1"; }
+      { name = "verror"; range = "1.3.6"; }
+      { name = "dtrace-provider"; range = "0.2.8"; }
+    ];
+  }
+  {
+    baseName = "rimraf";
+    version = "2.1.4";
+    fullName = "rimraf-2";
+    hash = "093154365aab3c09aea8e83dda7c5a7fd785c787ebbf1fcdc415cb5f74d1acac";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "graceful-fs"; range = "~1"; }
+    ];
+  }
+  {
+    baseName = "s3http";
+    version = "0.0.2";
+    fullName = "s3http-*";
+    hash = "03cbaa20c8920371c94333d6424c3d3b09824d1c6e30a9e1567805f53d1cd16d";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "aws-sdk"; range = ">=1.2.0 <2"; }
+      { name = "commander"; range = "0.5.1"; }
+      { name = "http-auth"; range = "1.2.7"; }
+    ];
+  }
+  {
+    baseName = "sax";
+    version = "0.5.2";
+    fullName = "sax-0.5.2";
+    hash = "6bb7cd44e9dfea598997d4ba9d3279dafe75bed7b45904561ca9eb4d85cfd953";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "sax";
+    version = "0.5.4";
+    fullName = "sax->=0.4.2";
+    hash = "5c4f074b559f56a7170663142e4ccbcf8cbef229ad7eb787b6c6e0b79ddb936a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "semver";
+    version = "1.1.4";
+    fullName = "semver-*";
+    hash = "59c0180521d0d4cee57caa5f6ef190500b04099bfa5786edb3e21e364ae8e989";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "semver";
+    version = "1.1.4";
+    fullName = "semver-1";
+    hash = "59c0180521d0d4cee57caa5f6ef190500b04099bfa5786edb3e21e364ae8e989";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "semver";
+    version = "1.1.4";
+    fullName = "semver-1.1.4";
+    hash = "59c0180521d0d4cee57caa5f6ef190500b04099bfa5786edb3e21e364ae8e989";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "send";
+    version = "0.1.0";
+    fullName = "send-0.1.0";
+    hash = "28b5a6ec41b5072521eb792cc901b92cdbb6b743c578d7008727dbbd3eb717de";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "debug"; range = "*"; }
+      { name = "mime"; range = "1.2.6"; }
+      { name = "fresh"; range = "0.1.0"; }
+      { name = "range-parser"; range = "0.0.4"; }
+    ];
+  }
+  {
+    baseName = "send";
+    version = "0.1.1";
+    fullName = "send-0.1.1";
+    hash = "4d237af8bc86148952d0577bed44bd41928a4422c9a6e25e45fc35103aa6e872";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "debug"; range = "*"; }
+      { name = "mime"; range = "~1.2.9"; }
+      { name = "fresh"; range = "0.1.0"; }
+      { name = "range-parser"; range = "0.0.4"; }
+    ];
+  }
+  {
+    baseName = "shelljs";
+    version = "0.1.4";
+    fullName = "shelljs-0.1.x";
+    hash = "21a6f3dc5eaeb1c10efbe62e31aeb6762241f707fb1fdcda4766c8bccde3eaf0";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "sigmund";
+    version = "1.0.0";
+    fullName = "sigmund-~1.0.0";
+    hash = "ddf823295db284ac4720b9d40f381d7375dc0b05881b98269346b33fe9835e25";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "smartdc";
+    version = "7.0.0";
+    fullName = "smartdc-*";
+    hash = "add769b05ecef4ea657d7bc473d96ee3e67b8ad8bc77077120bd5ae1efe94911";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "assert-plus"; range = "0.1.2"; }
+      { name = "lru-cache"; range = "2.2.0"; }
+      { name = "nopt"; range = "2.0.0"; }
+      { name = "restify"; range = "2.4.1"; }
+      { name = "bunyan"; range = "0.21.1"; }
+      { name = "clone"; range = "0.1.6"; }
+      { name = "smartdc-auth"; range = "1.0.0"; }
+    ];
+  }
+  {
+    baseName = "smartdc-auth";
+    version = "1.0.0";
+    fullName = "smartdc-auth-1.0.0";
+    hash = "7611510ac66507398f6e371b25068c7ad193ecd69a3031fdfca0e3c652cfdcbf";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "assert-plus"; range = "0.1.2"; }
+      { name = "clone"; range = "0.1.5"; }
+      { name = "ssh-agent"; range = "0.2.1"; }
+      { name = "once"; range = "1.1.1"; }
+      { name = "vasync"; range = "1.3.3"; }
+    ];
+  }
+  {
+    baseName = "sntp";
+    version = "0.2.4";
+    fullName = "sntp-0.2.x";
+    hash = "1f91a8d60fd48751e4b169885f530012ce2a8223ed29006abcee175f2b10d779";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "hoek"; range = "0.9.x"; }
+    ];
+  }
+  {
+    baseName = "sockjs";
+    version = "0.3.7";
+    fullName = "sockjs-*";
+    hash = "711a6c41e6a7b2a9cd0dc44abc7407f09729d400be450d94887391997b07a1a5";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "node-uuid"; range = "1.3.3"; }
+      { name = "faye-websocket"; range = "0.4.4"; }
+    ];
+  }
+  {
+    baseName = "source-map";
+    version = "0.1.22";
+    fullName = "source-map-*";
+    hash = "6ebe1b2b3c730e5e206a34a25192aa43307b84dfe3aaaafd71c5c6b6a02a4700";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "amdefine"; range = ">=0.0.4"; }
+    ];
+  }
+  {
+    baseName = "spdy";
+    version = "1.7.1";
+    fullName = "spdy-1.7.1";
+    hash = "d90516bb6b6cf39fb52face8ec332be98de116ce84d7d400fbb19529a30fa678";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "ssh-agent";
+    version = "0.2.1";
+    fullName = "ssh-agent-0.2.1";
+    hash = "b420d5816d4a8a242a8d1454f064954eab8fec9856310e867a2e7f1b2432f934";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "ctype"; range = "0.5.0"; }
+      { name = "posix-getopt"; range = "1.0.0"; }
+    ];
+  }
+  {
+    baseName = "stream-counter";
+    version = "0.1.0";
+    fullName = "stream-counter-~0.1.0";
+    hash = "8c51bd894bf905ec607654a1d7d3fe4fdc4763ccec4d37723cb8d0a0fd7cb69c";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "readable-stream"; range = "~1.0.2"; }
+    ];
+  }
+  {
+    baseName = "swig";
+    version = "0.13.5";
+    fullName = "swig-*";
+    hash = "d1cc435c623829e5672df45c14a878304a41bec2b2c6b2a13bb956aeed22d1c9";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+      { name = "underscore"; range = ">=1.1.7"; }
+    ];
+  }
+  {
+    baseName = "tar";
+    version = "0.1.17";
+    fullName = "tar-0";
+    hash = "577832975440eba0a9293244d53fa2c383e5c27ec2f68e3defde0cc23910b978";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "inherits"; range = "1.x"; }
+      { name = "block-stream"; range = "*"; }
+      { name = "fstream"; range = "~0.1.8"; }
+    ];
+  }
+  {
+    baseName = "temp";
+    version = "0.5.0";
+    fullName = "temp-*";
+    hash = "082285c060c7519b9d8a6dbc1a51e3caa7de43a807d3f7cec4eab220ad1207be";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "tunnel-agent";
+    version = "0.3.0";
+    fullName = "tunnel-agent-~0.3.0";
+    hash = "5b23c1d29e85143e213ba5aca118419ab42d25774da92e816074a73f423bcabd";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "underscore";
+    version = "1.4.4";
+    fullName = "underscore-*";
+    hash = "a848a28193850d58d7b98249d70844bc7f35a7d8b6b5ed75e08e829aa6e763d3";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "underscore";
+    version = "1.4.4";
+    fullName = "underscore-1.4.x";
+    hash = "a848a28193850d58d7b98249d70844bc7f35a7d8b6b5ed75e08e829aa6e763d3";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "underscore";
+    version = "1.4.4";
+    fullName = "underscore->=1.1.7";
+    hash = "a848a28193850d58d7b98249d70844bc7f35a7d8b6b5ed75e08e829aa6e763d3";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "underscore";
+    version = "1.4.4";
+    fullName = "underscore->=1.4.3";
+    hash = "a848a28193850d58d7b98249d70844bc7f35a7d8b6b5ed75e08e829aa6e763d3";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "util";
+    version = "0.4.9";
+    fullName = "util->= 0.4.9";
+    hash = "30ecc26c9e749650562c1ef20bc3f1a0d8d7c109134b510be34526d1ceae90e5";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "events.node"; range = ">= 0.4.0"; }
+    ];
+  }
+  {
+    baseName = "vasync";
+    version = "1.3.3";
+    fullName = "vasync-1.3.3";
+    hash = "603d15b81e25b6a634d7ff2025487b3460a60d0d7e1a1ed02e66faff5ef7b699";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "jsprim"; range = "0.3.0"; }
+      { name = "verror"; range = "1.1.0"; }
+    ];
+  }
+  {
+    baseName = "verror";
+    version = "1.1.0";
+    fullName = "verror-1.1.0";
+    hash = "ac0fc2dfbcdfc3440c281cf272d902ec74bf2abdf2f9c9eb5c0c3505dc6646d7";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "extsprintf"; range = "1.0.0"; }
+    ];
+  }
+  {
+    baseName = "verror";
+    version = "1.3.3";
+    fullName = "verror-1.3.3";
+    hash = "9b3e9307cb5a788c1a4c6706ed32582893ffcd64dc55a14a153be1ea15bb916a";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "extsprintf"; range = "1.0.0"; }
+    ];
+  }
+  {
+    baseName = "verror";
+    version = "1.3.6";
+    fullName = "verror-1.3.6";
+    hash = "96135dd5fef7b75bfe26513658ca3fc1ab38e17a9bec522fc5ec6e54b6b63f89";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "extsprintf"; range = "1.0.2"; }
+    ];
+  }
+  {
+    baseName = "websocket-driver";
+    version = "0.2.1";
+    fullName = "websocket-driver->=0.2.0";
+    hash = "8aab2b32695fecd2bca57d95bc51f0eb8a9a5bb298187a8fe3a84cd2cd8e3dc7";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "which";
+    version = "1.0.5";
+    fullName = "which-1";
+    hash = "e26f39d7b152c700636472ab4da57bfb9af17972c49a9e2a06f9ff347d8fad42";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "wordwrap";
+    version = "0.0.2";
+    fullName = "wordwrap-~0.0.2";
+    hash = "66a2fa688509738922c3ad62a6159fe3c93268bd3bca2bff24df4bc02cc31582";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "wu";
+    version = "0.1.8";
+    fullName = "wu-*";
+    hash = "2400d0ca7da862a9063a6a8d914bb4e585f81a5121b0fda8e40b1f6e782c72c6";
+    patchLatest = false;
+    topLevel = true;
+    dependencies = [
+    ];
+  }
+  {
+    baseName = "xml2js";
+    version = "0.2.4";
+    fullName = "xml2js-0.2.4";
+    hash = "8daebb075fc7c564d84221a0cef7825ac824db8e312f873daee59a6adf38da28";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "sax"; range = ">=0.4.2"; }
+    ];
+  }
+  {
+    baseName = "xml2js";
+    version = "0.2.7";
+    fullName = "xml2js-0.2.x";
+    hash = "ab3ae8402a8af36d93e1aa6e83102e365b82f03e605d1b8b8361dacc95e52397";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+      { name = "sax"; range = "0.5.2"; }
+    ];
+  }
+  {
+    baseName = "xmlbuilder";
+    version = "0.4.2";
+    fullName = "xmlbuilder-*";
+    hash = "3137e5bf9db1f114767f8ba56be753f2a9f512e38a2df64d7677ae3c9318a0fe";
+    patchLatest = false;
+    topLevel = false;
+    dependencies = [
+    ];
+  }
+]
diff --git a/pkgs/top-level/node-packages.json b/pkgs/top-level/node-packages.json
new file mode 100644
index 00000000000..8116f769654
--- /dev/null
+++ b/pkgs/top-level/node-packages.json
@@ -0,0 +1,38 @@
+[
+  "async"
+, "assert"
+, "mocha"
+, "jayschema"
+, "underscore"
+, "extend"
+, "express"
+, "s3http"
+, "aws-sdk"
+, "nijs"
+, "amdefine"
+, "smartdc"
+, "optparse"
+, "jsontool"
+, "swig"
+, "coffee-script"
+, "escape-html"
+, "buffertools"
+, "wu"
+, "source-map"
+, "knox"
+, "node-expat"
+, "optimist"
+, "temp"
+, "faye-websocket"
+, "node-uuid"
+, "rbytes"
+, "sockjs"
+, "backbone"
+, "browserchannel"
+, "node-gyp"
+, "semver"
+, "npm2nix"
+, "ansi-remover"
+, "mkdirp"
+, "jshint"
+]
diff --git a/pkgs/top-level/node-packages.nix b/pkgs/top-level/node-packages.nix
index c16c53d4a05..a23b776d112 100644
--- a/pkgs/top-level/node-packages.nix
+++ b/pkgs/top-level/node-packages.nix
@@ -1,22 +1,51 @@
-{ pkgs, stdenv, nodejs, fetchurl }:
+{ pkgs, stdenv, nodejs, fetchurl, neededNatives, self }:
 
-let self = {
-  buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
-    inherit stdenv nodejs;
-  };
+let
+  inherit (self) buildNodePackage patchLatest;
 
-  "coffee-script" = self."coffee-script-1.3.3";
+  importGeneratedPackages = generated: nativeDeps: self:
+    let
+      all = pkgs.lib.fold (pkg: { top-level, full }: {
+        top-level = top-level ++ pkgs.lib.optional pkg.topLevel {
+          name = pkg.baseName;
+          value = builtins.getAttr pkg.fullName self.full;
+        };
+        full = [ {
+          name = pkg.fullName;
+          value = pkgs.lib.makeOverridable buildNodePackage rec {
+            name = "${pkg.baseName}-${pkg.version}";
+            src = (if pkg.patchLatest then patchLatest else fetchurl) {
+              url = "http://registry.npmjs.org/${pkg.baseName}/-/${name}.tgz";
+              sha256 = pkg.hash;
+            };
+            deps = map (dep: builtins.getAttr "${dep.name}-${dep.range}" self.full) pkg.dependencies;
+            buildInputs = if builtins.hasAttr name nativeDeps then builtins.getAttr name nativeDeps else [];
+          };
+        } ] ++ full;
+      } ) { top-level = []; full = []; } generated;
+    in builtins.listToAttrs all.top-level // { full = builtins.listToAttrs all.full; };
+in {
+  inherit importGeneratedPackages;
 
-  "coffee-script-1.3.3" = self.buildNodePackage rec {
-    name = "coffee-script-1.3.3";
-    src = fetchurl {
-      url = "http://registry.npmjs.org/coffee-script/-/${name}.tgz";
-      sha256 = "deedd2cf9d5abe2bad724e6809bec40efa07215dae85f44d78cd37736bb50bc5";
-    };
-    deps = [
+  nativeDeps = {
+    "node-expat-*" = [ pkgs.expat ];
+    "rbytes-0.0.2" = [ pkgs.openssl ];
+  };
 
-    ];
+  buildNodePackage = import ../development/web/nodejs/build-node-package.nix {
+    inherit stdenv nodejs neededNatives;
+    inherit (pkgs) runCommand;
   };
-};
 
-in self
+  patchLatest = srcAttrs:
+    let src = fetchurl srcAttrs; in pkgs.runCommand src.name {} ''
+      mkdir unpack
+      cd unpack
+      tar xf ${src}
+      mv */ package 2>/dev/null || true
+      sed -i -e "s/: \"latest\"/: \"*\"/" package/package.json
+      tar cf $out *
+    '';
+
+  /* Put manual packages below here (ideally eventually managed by npm2nix */
+} // importGeneratedPackages (import ./node-packages-generated.nix) self.nativeDeps self
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 8ef55d3ff4c..8fe62df8220 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -5,14 +5,16 @@
    for each package in a separate file: the call to the function would
    be almost as must code as the function itself. */
 
-{pkgs}:
+{pkgs, __overrides}:
 
 rec {
 
   inherit (pkgs) buildPerlPackage fetchurl stdenv perl fetchsvn;
 
+  inherit __overrides;
+
   # Helper functions for packages that use Module::Build to build.
-  buildModule = { buildInputs ? [], ... } @ args:
+  buildPerlModule = { buildInputs ? [], ... } @ args:
     buildPerlPackage (args // {
       buildInputs = buildInputs ++ [ ModuleBuild ];
       preConfigure = "touch Makefile.PL";
@@ -23,20 +25,21 @@ rec {
 
 
   ack = buildPerlPackage rec {
-    name = "ack-1.92";
+    name = "ack-2.02";
     src = fetchurl {
       url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
-      sha256 = "8689156cb0639ff60adee47fc4b77e656cf0fc58e6c123ee6c481d9d48e99b88";
+      sha256 = "de5560f2ce6334f3f83bef4ee942fdb09b792f05cf534fe67be3cb0431bf758f";
     };
     propagatedBuildInputs = [ FileNext ];
     meta = {
-      description = "grep-like text finder";
-      longDescription = ''
-        ack is a grep-like tool tailored to working with large trees of source code.
-      '';
+      description = "A grep-like tool tailored to working with large trees of source code";
       homepage = http://betterthangrep.com/;
       license = "free";  # Artistic 2.0
     };
+    # t/swamp/{0,perl-without-extension} are datafiles for the test
+    # t/ack-show-types.t, but the perl generic builder confuses them
+    # for scripts and purifies them, making the test fail.
+    preCheck = "sed -i '1s,.*,#!/usr/bin/perl -w,' t/swamp/0 t/swamp/perl-without-extension";
   };
 
   AlgorithmAnnotate = buildPerlPackage {
@@ -48,13 +51,25 @@ rec {
     propagatedBuildInputs = [AlgorithmDiff];
   };
 
+  AlgorithmC3 = buildPerlModule {
+    name = "Algorithm-C3-0.08";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/F/FL/FLORA/Algorithm-C3-0.08.tar.gz;
+      sha256 = "016cjr63wivg54ms6sjnxz4g75fafgvgwralamv29phcic2cl2am";
+    };
+    meta = {
+      description = "A module for merging hierarchies using the C3 algorithm";
+      license = "perl";
+    };
+  };
+
   AlgorithmDiff = buildPerlPackage rec {
-    name = "Algorithm-Diff-1.1901";
+    name = "Algorithm-Diff-1.1902";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TY/TYEMQ/${name}.zip";
-      sha256 = "0qk60fi49mpyvnfpjd2dzcmya8x3g5zfgb2hrnl7a5krn045g6i2";
+      url = mirror://cpan/authors/id/T/TY/TYEMQ/Algorithm-Diff-1.1902.tar.gz;
+      sha256 = "0xc315h7xwq65n9n6nq8flv5d89z6kra69hspnyccw3782zhvd68";
     };
-    buildInputs = [pkgs.unzip];
+    buildInputs = [ pkgs.unzip ];
   };
 
   aliased = buildPerlPackage rec {
@@ -65,6 +80,15 @@ rec {
     };
   };
 
+  AlienWxWidgets = buildPerlPackage rec {
+    name = "Alien-wxWidgets-0.64";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/M/MD/MDOOTSON/${name}.tar.gz";
+      sha256 = "1frmvdppzw1vrbk2jvwxh5a5qafl7bigflpgwpkzdg4v9nswgbmx";
+    };
+    propagatedBuildInputs = [ pkgs.pkgconfig pkgs.gtk2 pkgs.wxGTK ];
+  };
+
   AnyMoose = buildPerlPackage rec {
     name = "Any-Moose-0.10";
     src = fetchurl {
@@ -89,6 +113,9 @@ rec {
       url = mirror://cpan/authors/id/A/AB/ABW/AppConfig-1.66.tar.gz;
       sha256 = "1p1vs9px20lrq9mdwpzp309a8r6rchibsdmxang4krk90pi2sh4b";
     };
+    meta = {
+      description = "A bundle of Perl5 modules for reading configuration files and parsing command line arguments";
+    };
   };
 
   ArrayCompare = buildPerlPackage {
@@ -188,13 +215,18 @@ rec {
     inherit (pkgs) db4;
   };
 
-  BHooksEndOfScope = buildPerlPackage rec {
-    name = "B-Hooks-EndOfScope-0.08";
+  BHooksEndOfScope = buildPerlPackage {
+    name = "B-Hooks-EndOfScope-0.12";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
-      sha256 = "07gbfc36qr8pfwrcskq3bbpwscmi7nkvvw54vz5d9ym1fyn3zf0g";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/B-Hooks-EndOfScope-0.12.tar.gz;
+      sha256 = "1gagn8b9zhbwk4f4cllrvir1mspvq0ladsy0pfkwl9w85q1843lj";
+    };
+    propagatedBuildInputs = [ ModuleImplementation ModuleRuntime SubExporterProgressive ];
+    meta = {
+      homepage = http://metacpan.org/release/B-Hooks-EndOfScope;
+      description = "Execute code after a scope finished compilation";
+      license = "perl5";
     };
-    propagatedBuildInputs = [SubExporter VariableMagic];
   };
 
   BitVector = buildPerlPackage {
@@ -222,6 +254,15 @@ rec {
     };
   };
 
+  BoostGeometryUtils = buildPerlModule rec {
+    name = "Boost-Geometry-Utils-0.09";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/A/AA/AAR/${name}.tar.gz";
+      sha256 = "0wgd36rxd5lj0vlkp7l9zgx8bgbv0nj4kia83ipb7p64xpyysghg";
+    };
+    propagatedBuildInputs = [ ModuleBuildWithXSpp ExtUtilsTypemapsDefault ];
+  };
+
   CacheCache = buildPerlPackage rec {
     name = "Cache-Cache-1.06";
     src = fetchurl {
@@ -259,38 +300,53 @@ rec {
     buildInputs = [TestPod];
   };
 
-  CaptureTiny = buildPerlPackage rec {
-    name = "Capture-Tiny-0.11";
+  CaptureTiny = buildPerlPackage {
+    name = "Capture-Tiny-0.21";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DA/DAGOLDEN/${name}.tar.gz";
-      sha256 = "09rhfjgryvfap2v6ym7ywl130r3q8a1p2rq70l1jv415qhj0194c";
+      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/Capture-Tiny-0.21.tar.gz;
+      sha256 = "1lvz2639zsjpr3001b2xyidnsd4kcgll5fvaa0pm928wzldb49wg";
+    };
+    meta = {
+      homepage = https://metacpan.org/release/Capture-Tiny;
+      description = "Capture STDOUT and STDERR from Perl, XS or external programs";
+      license = "apache_2_0";
     };
   };
 
-  CarpAssert = buildPerlPackage rec {
+  CarpAssert = buildPerlPackage {
     name = "Carp-Assert-0.20";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MS/MSCHWERN/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MS/MSCHWERN/Carp-Assert-0.20.tar.gz;
       sha256 = "1wzy4lswvwi45ybsm65zlq17rrqx84lsd7rajvd0jvd5af5lmlqd";
     };
+    meta = {
+    };
   };
 
-  CarpAssertMore = buildPerlPackage rec {
-    name = "Carp-Assert-More-1.12";
+  CarpAssertMore = buildPerlPackage {
+    name = "Carp-Assert-More-1.14";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
-      sha256 = "1m9k6z0m10s03x2hnc9mh5d4r8lnczm9bqd54jmnw0wzm4m33lyr";
+      url = mirror://cpan/authors/id/P/PE/PETDANCE/Carp-Assert-More-1.14.tar.gz;
+      sha256 = "0cq7qk4qbhqppm4raby5k24b5mx5qjgy1884nrddhxillnzlq01z";
+    };
+    propagatedBuildInputs = [ CarpAssert TestException ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      license = "artistic_2";
     };
-    propagatedBuildInputs = [TestException CarpAssert];
   };
 
   CarpClan = buildPerlPackage {
-    name = "Carp-Clan-6.00";
+    name = "Carp-Clan-6.04";
     src = fetchurl {
-      url = mirror://cpan/authors/id/J/JJ/JJORE/Carp-Clan-6.00.tar.gz;
-      sha256 = "0lbin4i0vzagcwkywpd5x4gz3a4ira4yn5g5v1ip0pbpyqnjk15h";
+      url = mirror://cpan/authors/id/S/ST/STBEY/Carp-Clan-6.04.tar.gz;
+      sha256 = "1v71k8s1pi16l5y579gnrg372c6pdvy6qqm6iddm8h1dx7n16bjl";
+    };
+    propagatedBuildInputs = [ TestException ];
+    meta = {
+      description = "Report errors from perspective of caller of a \"clan\" of modules";
+      license = "perl";
     };
-    propagatedBuildInputs = [TestException];
   };
 
   CatalystActionRenderView = buildPerlPackage rec {
@@ -303,6 +359,19 @@ rec {
       [ CatalystRuntime HTTPRequestAsCGI DataVisitor MROCompat ];
   };
 
+  CatalystActionREST = buildPerlPackage {
+    name = "Catalyst-Action-REST-1.07";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Action-REST-1.07.tar.gz;
+      sha256 = "0c893iia1bmqlrknylaqhc9ln1xqz7yw9z639rxmyjyidx5b4q0d";
+    };
+    propagatedBuildInputs = [ CatalystRuntime ClassInspector ConfigGeneral DataSerializer DataTaxi FreezeThaw HTMLParser JSONXS LWPUserAgent Moose MROCompat namespaceautoclean ParamsValidate PHPSerialization URIFind XMLSimple YAMLSyck ];
+    meta = {
+      description = "Automated REST Method Dispatching";
+      license = "perl";
+    };
+  };
+
   CatalystAuthenticationStoreHtpasswd = buildPerlPackage rec {
     name = "Catalyst-Authentication-Store-Htpasswd-1.003";
     src = fetchurl {
@@ -314,15 +383,17 @@ rec {
       [ CatalystPluginAuthentication ClassAccessor CryptPasswdMD5 AuthenHtpasswd HTMLForm ];
   };
 
-  CatalystAuthenticationStoreDBIxClass = buildPerlPackage rec {
-    name = "Catalyst-Authentication-Store-DBIx-Class-0.1082";
+  CatalystAuthenticationStoreDBIxClass = buildPerlPackage {
+    name = "Catalyst-Authentication-Store-DBIx-Class-0.1503";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JA/JAYK/${name}.tar.gz";
-      sha256 = "1rh5jwqw3fb16ll5id8z0igpqdwr0czi0xbaa2igalxr53hh2cni";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Authentication-Store-DBIx-Class-0.1503.tar.gz;
+      sha256 = "1l11if91gjfrga7i7bjxwa0zybhkkrpgg6ps3nxm30vmg7xqaf4d";
+    };
+    propagatedBuildInputs = [ CatalystModelDBICSchema CatalystPluginAuthentication CatalystRuntime DBIxClass ListMoreUtils Moose namespaceautoclean TryTiny ];
+    meta = {
+      description = "A storage class for Catalyst Authentication using DBIx::Class";
+      license = "perl";
     };
-    propagatedBuildInputs = [
-      CatalystRuntime CatalystPluginAuthentication CatalystModelDBICSchema
-    ];
   };
 
   CatalystComponentInstancePerContext = buildPerlPackage rec {
@@ -349,20 +420,20 @@ rec {
     ];
   };
 
-  CatalystDevel = buildPerlPackage rec {
-    name = "Catalyst-Devel-1.33";
+  CatalystDevel = buildPerlPackage {
+    name = "Catalyst-Devel-1.37";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "0g41rglw460y2n2xbysjbsjb56jkkz2m5jhap2nw3a5jby1ymp07";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Devel-1.37.tar.gz;
+      sha256 = "0yk526py65iy40z10d6w0fspb8fam5rf1hzsxnfyy4lpy91lp7s9";
+    };
+    buildInputs = [ TestFatal ];
+    propagatedBuildInputs = [ CatalystRuntime CatalystActionRenderView CatalystPluginConfigLoader CatalystPluginStaticSimple ConfigGeneral FileChangeNotify FileCopyRecursive FileShareDir ModuleInstall Moose MooseXDaemonize MooseXEmulateClassAccessorFast namespaceautoclean namespaceclean PathClass Starman TemplateToolkit ];
+    meta = {
+      homepage = http://dev.catalyst.perl.org/;
+      description = "Catalyst Development Tools";
+      license = "perl";
+      platforms = stdenv.lib.platforms.linux;
     };
-    buildInputs = [ TestFatal TestMore ];
-    propagatedBuildInputs =
-      [ CatalystRuntime CatalystActionRenderView
-        CatalystPluginStaticSimple CatalystPluginConfigLoader
-        ClassAccessor ConfigGeneral FileChangeNotify FileCopyRecursive
-        FileShareDir Parent PathClass TemplateToolkit YAMLTiny
-      ];
-    CATALYST_DEVEL_NO_510_CHECK = 1; # bug in Perl 5.10.0
   };
 
   CatalystEngineHTTPPrefork = buildPerlPackage rec {
@@ -383,70 +454,74 @@ rec {
     ];
   };
 
-  CatalystManual = buildPerlPackage rec {
-    name = "Catalyst-Manual-5.8000";
+  CatalystManual = buildPerlPackage {
+    name = "Catalyst-Manual-5.9006";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/H/HK/HKCLARK/${name}.tar.gz";
-      sha256 = "0ay4gcprwqw4h5vsk8g0n9ir51sq7n5i2rdahgqdlb8caj4fshz5";
+      url = mirror://cpan/authors/id/H/HK/HKCLARK/Catalyst-Manual-5.9006.tar.gz;
+      sha256 = "0cl9nqg5jrqcf2h3pgk6q8408czf5s0k0xh3ra884c9cnx84mr95";
+    };
+    meta = {
+      description = "The Catalyst developer's manual";
+      license = "perl";
     };
-    buildInputs = [TestPod TestPodCoverage];
   };
 
-  CatalystModelDBICSchema = buildPerlPackage rec {
-    name = "Catalyst-Model-DBIC-Schema-0.54";
+  CatalystModelDBICSchema = buildPerlPackage {
+    name = "Catalyst-Model-DBIC-Schema-0.60";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "19iasq94nph33vz4jrk5x6cqd9ivq0db867s524faba8avrrlxz9";
+      url = mirror://cpan/authors/id/R/RK/RKITOVER/Catalyst-Model-DBIC-Schema-0.60.tar.gz;
+      sha256 = "176jqvrmhp0wng446m0qlmh1kgqj4z1czg6s418ffr4a7c3jqyld";
+    };
+    buildInputs = [ DBDSQLite TestException TestRequires ];
+    propagatedBuildInputs = [ CarpClan CatalystComponentInstancePerContext CatalystDevel CatalystRuntime CatalystXComponentTraits DBIxClass DBIxClassCursorCached DBIxClassSchemaLoader HashMerge ListMoreUtils Moose MooseXMarkAsMethods MooseXNonMoose MooseXTypes namespaceautoclean namespaceclean TieIxHash TryTiny ];
+    meta = {
+      description = "DBIx::Class::Schema Model Class";
+      license = "perl";
+      platforms = stdenv.lib.platforms.linux;
     };
-    buildInputs = [ TestMore TestException TestRequires DBDSQLite ];
-    propagatedBuildInputs =
-      [ DBIxClass CatalystRuntime CatalystXComponentTraits Moose MooseXTypes
-        NamespaceAutoclean CarpClan ListMoreUtils TieIxHash TryTiny
-        CatalystDevel DBIxClassSchemaLoader MooseXNonMoose
-        NamespaceClean HashMerge DBIxClassCursorCached
-      ];
-    meta.platforms = stdenv.lib.platforms.linux;
   };
 
-  CatalystRuntime = buildPerlPackage rec{
-    name = "Catalyst-Runtime-5.90006";
+  CatalystRuntime = buildPerlPackage {
+    name = "Catalyst-Runtime-5.90019";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/B/BO/BOBTFISH/${name}.tar.gz";
-      sha256 = "01afjgcc5lqaw6gmzwym8n09q8nksj4jdl2z25m64sfiv1gdyx2w";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Runtime-5.90019.tar.gz;
+      sha256 = "0madnqyzhcvbv6iql6b10dzfqvajj0fyp1sla83csakkbff38mqp";
+    };
+    buildInputs = [ ClassDataInheritable DataDump HTTPMessage TestException ];
+    propagatedBuildInputs = [ CGISimple ClassC3AdoptNEXT ClassLoad ClassMOP DataDump DataOptList HTMLParser HTTPBody HTTPMessage HTTPRequestAsCGI ListMoreUtils LWPUserAgent Moose MooseXEmulateClassAccessorFast MooseXGetopt MooseXMethodAttributes MooseXRoleWithOverloading MROCompat namespaceautoclean namespaceclean PathClass Plack PlackMiddlewareReverseProxy PlackTestExternalServer SafeIsa StringRewritePrefix SubExporter TaskWeaken TextSimpleTable TreeSimple TreeSimpleVisitorFactory TryTiny URI ];
+    meta = {
+      homepage = http://dev.catalyst.perl.org/;
+      description = "The Catalyst Framework Runtime";
+      license = "perl";
+      platforms = stdenv.lib.platforms.linux;
     };
-    buildInputs = [ TestException ];
-    propagatedBuildInputs =
-      [ ClassDataInheritable ListMoreUtils NamespaceAutoclean NamespaceClean
-        BHooksEndOfScope MooseXEmulateClassAccessorFast ClassMOP
-        Moose MooseXMethodAttributes MooseXRoleWithOverloading
-        ClassC3AdoptNEXT CGISimple DataDump DataOptList
-        HTMLParser HTTPBody HTTPRequestAsCGI
-        LWP ModulePluggable PathClass SubExporter
-        TextSimpleTable TimeHiRes TreeSimple TreeSimpleVisitorFactory
-        URI TaskWeaken /* TextBalanced */ MROCompat MooseXTypes
-        MooseXGetopt MooseXTypesCommon StringRewritePrefix
-        MooseXTypesLoadableClass Plack PlackMiddlewareReverseProxy
-      ];
-    meta.platforms = stdenv.lib.platforms.linux;
   };
 
-  CatalystPluginAccessLog = buildPerlPackage rec {
-    name = "Catalyst-Plugin-AccessLog-1.04";
+  CatalystPluginAccessLog = buildPerlPackage {
+    name = "Catalyst-Plugin-AccessLog-1.05";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "1cbbg6fviyv398lyhmv14ya0v0h0xs04d29zz9r49vzsbw6shy33";
+      url = mirror://cpan/authors/id/A/AR/ARODLAND/Catalyst-Plugin-AccessLog-1.05.tar.gz;
+      sha256 = "0hqvckaw91q5yc25a33bp0d4qqxlgkp7rxlvi8n8svxd1406r55s";
+    };
+    propagatedBuildInputs = [ CatalystRuntime DateTime Moose namespaceautoclean ];
+    meta = {
+      description = "Request logging from within Catalyst";
+      license = "perl";
     };
-    propagatedBuildInputs = [ CatalystRuntime DateTime ];
   };
 
-  CatalystPluginAuthentication = buildPerlPackage rec {
-    name = "Catalyst-Plugin-Authentication-0.10018";
+  CatalystPluginAuthentication = buildPerlPackage {
+    name = "Catalyst-Plugin-Authentication-0.10022";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "1znm81baidzhiiyanigy8rs8jq97vh94fiv4xvkrmaxz0k6vppdx";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Plugin-Authentication-0.10022.tar.gz;
+      sha256 = "1yxx89j6q10ydmwwhv3zq68gwndcnh4vvdqiv7az5w2rf2w1nvip";
+    };
+    buildInputs = [ ClassMOP Moose TestException ];
+    propagatedBuildInputs = [ CatalystPluginSession CatalystRuntime ClassInspector Moose MooseXEmulateClassAccessorFast MROCompat namespaceautoclean StringRewritePrefix TryTiny ];
+    meta = {
+      description = "Infrastructure plugin for the Catalyst authentication framework";
+      license = "perl";
     };
-    propagatedBuildInputs =
-      [ CatalystRuntime CatalystPluginSession ClassInspector ];
   };
 
   CatalystPluginAuthorizationACL = buildPerlPackage rec {
@@ -459,15 +534,29 @@ rec {
   };
 
   CatalystPluginAuthorizationRoles = buildPerlPackage {
-    name = "Catalyst-Plugin-Authorization-Roles-0.07";
+    name = "Catalyst-Plugin-Authorization-Roles-0.09";
     src = fetchurl {
-      url = mirror://cpan/authors/id/B/BR/BRICAS/Catalyst-Plugin-Authorization-Roles-0.07.tar.gz;
-      sha256 = "07b8zc7b06p0fprjj68fk7rgh781r9s3q8dx045sk03w0fnk3b4b";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Plugin-Authorization-Roles-0.09.tar.gz;
+      sha256 = "0l83lkwmq0lngwh8b1rv3r719pn8w1gdbyhjqm74rnd0wbjl8h7f";
+    };
+    buildInputs = [ TestException ];
+    propagatedBuildInputs = [ CatalystPluginAuthentication CatalystRuntime SetObject UNIVERSALisa ];
+    meta = {
+      description = "Role based authorization for Catalyst based on Catalyst::Plugin::Authentication";
+      license = "perl";
+    };
+  };
+
+  CatalystPluginCaptcha = buildPerlPackage {
+    name = "Catalyst-Plugin-Captcha-0.04";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DI/DIEGOK/Catalyst-Plugin-Captcha-0.04.tar.gz;
+      sha256 = "0llyj3v5nx9cx46jdbbvxf1lc9s9cxq5ml22xmx3wkb201r5qgaa";
+    };
+    propagatedBuildInputs = [ CatalystRuntime CatalystPluginSession GDSecurityImage HTTPDate ];
+    meta = {
+      description = "Create and validate Captcha for Catalyst";
     };
-    propagatedBuildInputs = [
-      CatalystRuntime CatalystPluginAuthentication
-      TestException SetObject UNIVERSALisa
-    ];
   };
 
   CatalystPluginConfigLoader = buildPerlPackage rec {
@@ -497,15 +586,18 @@ rec {
     propagatedBuildInputs = [CatalystRuntime HTMLWidget];
   };
 
-  CatalystPluginSession = buildPerlPackage rec {
-    name = "Catalyst-Plugin-Session-0.34";
+  CatalystPluginSession = buildPerlPackage {
+    name = "Catalyst-Plugin-Session-0.36";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "0vgm3pjymzxqnjn8cj8ld1wprwj3hq15n26djvjmnx6pwyf2ffgz";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Catalyst-Plugin-Session-0.36.tar.gz;
+      sha256 = "14wgkrg3w69gwg6zg991k5f611xqsnyx0i0xzhw9rx2j5nf9rj4b";
+    };
+    buildInputs = [ TestDeep TestException TestWWWMechanizePSGI ];
+    propagatedBuildInputs = [ CatalystRuntime Moose MooseXEmulateClassAccessorFast MROCompat namespaceclean ObjectSignature ];
+    meta = {
+      description = "Generic Session plugin - ties together server side storage and client side state required to maintain session data";
+      license = "perl";
     };
-    buildInputs = [ TestMockObject TestDeep ];
-    propagatedBuildInputs =
-      [ CatalystRuntime ObjectSignature MROCompat ];
   };
 
   CatalystPluginSessionStateCookie = buildPerlPackage rec {
@@ -528,22 +620,31 @@ rec {
       [ PathClass CatalystPluginSession CacheFastMmap MROCompat ];
   };
 
-  CatalystPluginStackTrace = buildPerlPackage rec {
+  CatalystPluginStackTrace = buildPerlPackage {
     name = "Catalyst-Plugin-StackTrace-0.11";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MS/MSTROUT/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MS/MSTROUT/Catalyst-Plugin-StackTrace-0.11.tar.gz;
       sha256 = "1ingivnga1yb4dqsj6icc4a58i9wdalzpn2qflsn8n2skgm223qb";
     };
     propagatedBuildInputs = [ CatalystRuntime DevelStackTrace MROCompat ];
+    meta = {
+      description = "Display a stack trace on the debug screen";
+      license = "perl";
+    };
   };
 
-  CatalystPluginStaticSimple = buildPerlPackage rec {
-    name = "Catalyst-Plugin-Static-Simple-0.29";
+  CatalystPluginStaticSimple = buildPerlPackage {
+    name = "Catalyst-Plugin-Static-Simple-0.30";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "1wjh1a24gksjxzzl9wblbaar5gjvlm38kndjx8629fm9dcbqvc14";
+      url = mirror://cpan/authors/id/A/AB/ABRAXXA/Catalyst-Plugin-Static-Simple-0.30.tar.gz;
+      sha256 = "18zar1n4imgnv7b4dr5sxyikry4668ngqgc6f0dr210bqafvwv7w";
+    };
+    patches = [ ../development/perl-modules/catalyst-plugin-static-simple-etag.patch ];
+    propagatedBuildInputs = [ CatalystRuntime MIMETypes Moose MooseXTypes namespaceautoclean ];
+    meta = {
+      description = "Make serving static pages painless";
+      license = "perl";
     };
-    propagatedBuildInputs = [CatalystRuntime MIMETypes];
   };
 
   CatalystViewDownload = buildPerlPackage rec {
@@ -556,25 +657,31 @@ rec {
     propagatedBuildInputs = [ CatalystRuntime TextCSV XMLSimple ];
   };
 
-  CatalystViewJSON = buildPerlPackage rec {
+  CatalystViewJSON = buildPerlPackage {
     name = "Catalyst-View-JSON-0.33";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Catalyst-View-JSON-0.33.tar.gz;
       sha256 = "03yda9skcfnwkm4hf2a3y7g2rdjdia5hzfnll0h7z4wiyb8kxfii";
     };
-    propagatedBuildInputs = [ CatalystRuntime JSONAny YAML ];
+    buildInputs = [ JSON ];
+    propagatedBuildInputs = [ CatalystRuntime JSONAny MROCompat YAML ];
+    meta = {
+      description = "JSON view for your data";
+      license = "perl";
+    };
   };
 
-  CatalystViewTT = buildPerlPackage rec {
-    name = "Catalyst-View-TT-0.37";
+  CatalystViewTT = buildPerlPackage {
+    name = "Catalyst-View-TT-0.40";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
-      sha256 = "00vv4rkhpablmmfn70nybxy1jlfxhyf72ck3bch2gcfgqqysxvqz";
+      url = mirror://cpan/authors/id/I/IL/ILMARI/Catalyst-View-TT-0.40.tar.gz;
+      sha256 = "0j73mk631p9x0b0l24ikavh9nxl6lpya4g46fpanjk396d2zj8bs";
+    };
+    propagatedBuildInputs = [ CatalystRuntime ClassAccessor MROCompat PathClass TemplateToolkit TemplateTimer ];
+    meta = {
+      description = "Template View Class";
+      license = "perl";
     };
-    propagatedBuildInputs = [
-      CatalystRuntime TemplateToolkit ClassAccessor
-      PathClass TemplateTimer
-    ];
   };
 
   CatalystXComponentTraits = buildPerlPackage rec {
@@ -584,17 +691,42 @@ rec {
       sha256 = "0a2mhfgv0kqmaxf2crs8mqk44lyhd9qcwlpzhrc0b0dh4z503mr4";
     };
     propagatedBuildInputs =
-      [ CatalystRuntime MooseXTraitsPluggable NamespaceAutoclean ListMoreUtils ];
+      [ CatalystRuntime MooseXTraitsPluggable namespaceautoclean ListMoreUtils ];
   };
 
-  CatalystXScriptServerStarman = buildPerlPackage rec {
-    name = "CatalystX-Script-Server-Starman-0.01";
+  CatalystXRoleApplicator = buildPerlPackage rec {
+    name = "CatalystX-RoleApplicator-0.005";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/CatalystX/${name}.tar.gz";
-      sha256 = "18hpp35bjyw65x564m1m82mr0nmff6836vfjqdwf2lwsb4n8s4xr";
+      url = "mirror://cpan/authors/id/H/HD/HDP/${name}.tar.gz";
+      sha256 = "0vwaapxn8g5hs2xp63c4dwv9jmapmji4272fakssvgc9frklg3p2";
+    };
+    buildInputs = [ ];
+    propagatedBuildInputs = [ MooseXRelatedClassRoles CatalystRuntime ];
+  };
+
+  CatalystTraitForRequestProxyBase = buildPerlPackage rec {
+    name = "Catalyst-TraitFor-Request-ProxyBase-0.000005";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Catalyst/${name}.tar.gz";
+      sha256 = "02kir63d5cs2ipj3fn1qlmmx3gqi1xqzrxfr4pv5vjhjgsm0zgx7";
+    };
+    buildInputs = [ CatalystRuntime ];
+    propagatedBuildInputs = [ Moose URI CatalystXRoleApplicator ];
+  };
+
+  CatalystXScriptServerStarman = buildPerlPackage {
+    name = "CatalystX-Script-Server-Starman-0.02";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AB/ABRAXXA/CatalystX-Script-Server-Starman-0.02.tar.gz;
+      sha256 = "0h02mpkc4cmi3jpvcd7iw7xyzx55bqvvl1qkf967gqkvpklm0qx5";
     };
     buildInputs = [ TestWWWMechanizeCatalyst ];
-    propagatedBuildInputs = [ CatalystRuntime Starman ];
+    propagatedBuildInputs = [ CatalystRuntime Moose namespaceautoclean Starman ];
+    meta = {
+      description = "Replace the development server with Starman";
+      license = "perl";
+      platforms = stdenv.lib.platforms.linux;
+    };
   };
 
   CGICookieXS = buildPerlPackage rec {
@@ -622,20 +754,27 @@ rec {
     buildInputs = [ DBFile ];
   };
 
-  CGISimple = buildPerlPackage rec {
+  CGISimple = buildPerlPackage {
     name = "CGI-Simple-1.113";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/CGI/${name}.tar.gz";
+      url = mirror://cpan/authors/id/A/AN/ANDYA/CGI-Simple-1.113.tar.gz;
       sha256 = "0g8v0jd7dk310k6ncz47qa1cfrysi8yib1zwkhasv4zhswgqiqjj";
     };
     propagatedBuildInputs = [ IOStringy ];
+    meta = {
+      description = "A Simple totally OO CGI interface that is CGI.pm compliant";
+      license = "perl";
+    };
   };
 
   ClassAccessor = buildPerlPackage {
-    name = "Class-Accessor-0.31";
+    name = "Class-Accessor-0.34";
     src = fetchurl {
-      url = mirror://cpan/authors/id/K/KA/KASEI/Class-Accessor-0.31.tar.gz;
-      sha256 = "1a4v5qqdf9bipd6ba5n47mag0cmgwp97cid67i510aw96bcjrsiy";
+      url = mirror://cpan/authors/id/K/KA/KASEI/Class-Accessor-0.34.tar.gz;
+      sha256 = "1z6fqg0yz8gay15r1iasslv8f1n1mzjkrhs47fvbj3rqz36y1cfd";
+    };
+    meta = {
+      license = "perl";
     };
   };
 
@@ -648,14 +787,18 @@ rec {
     propagatedBuildInputs = [ClassAccessor];
   };
 
-  ClassAccessorGrouped = buildPerlPackage rec {
-    name = "Class-Accessor-Grouped-0.10003";
+  ClassAccessorGrouped = buildPerlPackage {
+    name = "Class-Accessor-Grouped-0.10009";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Class/${name}.tar.gz";
-      sha256 = "036cyp74cdz8y5nig2b1iyqk6ps60sbqb0dqy0ybp3j5qiy28mix";
+      url = mirror://cpan/authors/id/R/RI/RIBASUSHI/Class-Accessor-Grouped-0.10009.tar.gz;
+      sha256 = "1cs6wvng9xxhmrps7qb7ccxswqkqskwj862dp4fqfra14aprlg4c";
+    };
+    buildInputs = [ TestException ];
+    propagatedBuildInputs = [ ClassXSAccessor ModuleRuntime SubName ];
+    meta = {
+      description = "Lets you build groups of accessors";
+      license = "perl";
     };
-    buildInputs = [ TestMore TestException ];
-    propagatedBuildInputs = [ ClassInspector SubName ClassXSAccessor ];
   };
 
   ClassAutouse = buildPerlPackage {
@@ -674,31 +817,45 @@ rec {
     };
   };
 
-  ClassC3 = buildPerlPackage rec {
-    name = "Class-C3-0.21";
+  ClassC3 = buildPerlPackage {
+    name = "Class-C3-0.24";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
-      sha256 = "1bl8z095y4js66pwxnm7s853pi9czala4sqc743fdlnk27kq94gz";
+      url = mirror://cpan/authors/id/F/FL/FLORA/Class-C3-0.24.tar.gz;
+      sha256 = "1nhwf7bj7z5szk7sxmq0ynqh2k9p42a7zkfyikkairfb78xckpkz";
+    };
+    propagatedBuildInputs = [ AlgorithmC3 ];
+    meta = {
+      description = "A pragma to use the C3 method resolution order algortihm";
+      license = "perl";
     };
   };
 
-  ClassC3AdoptNEXT = buildPerlPackage rec {
-    name = "Class-C3-Adopt-NEXT-0.07";
+  ClassC3AdoptNEXT = buildPerlPackage {
+    name = "Class-C3-Adopt-NEXT-0.13";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
-      sha256 = "1kxbdq10vicrbz3i6hvml3mma5x0r523gfdd649f9bvrsizb0jxj";
+      url = mirror://cpan/authors/id/F/FL/FLORA/Class-C3-Adopt-NEXT-0.13.tar.gz;
+      sha256 = "1rwgbx6dsy4rpas94p8wakzj7hrla1p15jnbm24kwhsv79gp91ld";
+    };
+    buildInputs = [ TestException ];
+    propagatedBuildInputs = [ ListMoreUtils MROCompat ];
+    meta = {
+      homepage = http://search.cpan.org/dist/Class-C3-Adopt-NEXT;
+      description = "Make NEXT suck less";
+      license = "perl";
     };
-    propagatedBuildInputs = [MROCompat TestException ListMoreUtils];
   };
 
-  ClassC3Componentised = buildPerlPackage rec {
+  ClassC3Componentised = buildPerlPackage {
     name = "Class-C3-Componentised-1.001000";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Class/${name}.tar.gz";
+      url = mirror://cpan/authors/id/F/FR/FREW/Class-C3-Componentised-1.001000.tar.gz;
       sha256 = "1nzav8arxll0rya7r2vp032s3acliihbb9mjlfa13rywhh77bzvl";
     };
     buildInputs = [ TestException ];
     propagatedBuildInputs = [ ClassC3 ClassInspector MROCompat ];
+    meta = {
+      license = "perl";
+    };
   };
 
   ClassDataAccessor = buildPerlPackage {
@@ -725,11 +882,23 @@ rec {
     };
   };
 
-  ClassInspector = buildPerlPackage rec {
-    name = "Class-Inspector-1.24";
+  ClassInspector = buildPerlPackage {
+    name = "Class-Inspector-1.28";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-      sha256 = "0rhsn73g516knx5djqzlgygjk8ij6xxjkm1sim0facvd4z0wlw0a";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/Class-Inspector-1.28.tar.gz;
+      sha256 = "04iij8dbcgaim7g109frpyf7mh4ydsd8zh53r53chk0zxnivg91w";
+    };
+    meta = {
+      description = "Get information about a class and its structure";
+      license = "perl";
+    };
+  };
+
+  ClassISA = buildPerlPackage {
+    name = "Class-ISA-0.36";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/S/SM/SMUELLER/Class-ISA-0.36.tar.gz;
+      sha256 = "0r5r574i6wgxm8zsq4bc34d0dzprrh6h6mpp1nhlks1qk97g65l8";
     };
   };
 
@@ -741,6 +910,20 @@ rec {
     };
   };
 
+  ClassMethodModifiers = buildPerlPackage {
+    name = "Class-Method-Modifiers-2.00";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/S/SA/SARTAK/Class-Method-Modifiers-2.00.tar.gz;
+      sha256 = "0lvj38ahqqyhv9dpi7ks1cq35f19nfw8ygxw22x2mcmagl8mnkhs";
+    };
+    buildInputs = [ TestFatal ];
+    meta = {
+      homepage = https://github.com/sartak/Class-Method-Modifiers/tree;
+      description = "Provides Moose-like method modifiers";
+      license = "perl";
+    };
+  };
+
   ClassMix = buildPerlPackage rec {
     name = "Class-Mix-0.005";
     src = fetchurl {
@@ -768,24 +951,34 @@ rec {
     };
   };
 
-  ClassLoad = buildPerlPackage rec {
-    name = "Class-Load-0.12";
+  ClassLoad = buildPerlPackage {
+    name = "Class-Load-0.20";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Class/${name}.tar.gz";
-      sha256 = "0siw8hyqnmn0flk1hbd6fnnfqlhkgfr1d5442rri1d8a0rs1a36r";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Class-Load-0.20.tar.gz;
+      sha256 = "084cxrm0hcpyz3ly1iqkcjpl4bs03n42na37d3pzwa8xbs44ag42";
+    };
+    buildInputs = [ TestFatal TestRequires ];
+    propagatedBuildInputs = [ DataOptList ModuleImplementation ModuleRuntime PackageStash TryTiny ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "A working (require \"Class::Name\") and more";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal ];
-    propagatedBuildInputs = [ DataOptList PackageStash ModuleRuntime ];
   };
 
-  ClassLoadXS = buildModule rec {
-    name = "Class-Load-XS-0.03";
+  ClassLoadXS = buildPerlModule {
+    name = "Class-Load-XS-0.06";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Class/${name}.tar.gz";
-      sha256 = "1k3fffm4z6hvml5gqh27p7l78xs220s2d7ybd2a42akxrx8gk9r8";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Class-Load-XS-0.06.tar.gz;
+      sha256 = "1dl739nnfw2j9rjgqxx24jqbanyvncqfnkwm27af8ik6kiqk50ik";
     };
-    buildInputs = [ TestFatal ];
+    buildInputs = [ ModuleImplementation TestFatal TestRequires ];
     propagatedBuildInputs = [ ClassLoad ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "XS implementation of parts of Class::Load";
+      license = "artistic_2";
+    };
   };
 
   ClassUnload = buildPerlPackage rec {
@@ -797,33 +990,58 @@ rec {
     propagatedBuildInputs = [ ClassInspector ];
   };
 
-  ClassXSAccessor = buildPerlPackage rec {
-    name = "Class-XSAccessor-1.13";
+  ClassXSAccessor = buildPerlPackage {
+    name = "Class-XSAccessor-1.16";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Class/${name}.tar.gz";
-      sha256 = "1nj21xq8bqvfz2mafrfskzw2p2j48b5k3rqxgxk99lw5ysmkz834";
+      url = mirror://cpan/authors/id/S/SM/SMUELLER/Class-XSAccessor-1.16.tar.gz;
+      sha256 = "1yjpw9kssy4m52407k45hxjnqz02494z7x8j44pjzkyi8msafvg5";
+    };
+    meta = {
+      description = "Generate fast XS accessors without runtime compilation";
+      license = "perl5";
     };
   };
 
-  Clone = buildPerlPackage rec {
-    name = "Clone-0.31";
+  Clone = buildPerlPackage {
+    name = "Clone-0.34";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RD/RDF/${name}.tar.gz";
-      sha256 = "0fazl71hrc0r56gnc7vzwz9283p7h62gc8wsna7zgyfvrajjnhwl";
+      url = mirror://cpan/authors/id/G/GA/GARU/Clone-0.34.tar.gz;
+      sha256 = "0qk32i2ncmn7wm2dbjpwhwa4js079bgfs4ayb90mnxjhwq5358ix";
+    };
+    meta = {
+      description = "Recursively copy Perl datatypes";
+      license = "perl5";
     };
   };
 
   CommonSense = buildPerlPackage rec {
-    name = "common-sense-3.4";
+    name = "common-sense-3.6";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/ML/MLEHMANN/${name}.tar.gz";
-      sha256 = "0s1lym5519gwdgwd6c6cq9c9iagr7bmb16jklq5iq3nsdyb0qc2l";
+      url = mirror://cpan/authors/id/M/ML/MLEHMANN/common-sense-3.6.tar.gz;
+      sha256 = "0nkbp1by0mpvg1x6053fbh9dl8nnswlyfmqp8k2lppd717hw5ql6";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
     };
   };
 
-  CompressRawBzip2 = import ../development/perl-modules/Compress-Raw-Bzip2 {
-    inherit fetchurl buildPerlPackage;
-    inherit (pkgs) bzip2;
+  CompressRawBzip2 = buildPerlPackage {
+    name = "Compress-Raw-Bzip2-2.060";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/P/PM/PMQS/Compress-Raw-Bzip2-2.060.tar.gz;
+      sha256 = "02azwhglk2w68aa47sjqhj6vwzi66mv4hwal87jccjfy17gcwvx7";
+    };
+
+    # Don't build a private copy of bzip2.
+    BUILD_BZIP2 = false;
+    BZIP2_LIB = "${pkgs.bzip2}/lib";
+    BZIP2_INCLUDE = "${pkgs.bzip2}/include";
+
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Low-Level Interface to bzip2 compression library";
+      license = "perl5";
+    };
   };
 
   CompressRawZlib = import ../development/perl-modules/Compress-Raw-Zlib {
@@ -850,11 +1068,27 @@ rec {
     };
   };
 
-  ConfigGeneral = buildPerlPackage rec {
-    name = "Config-General-2.50";
+  ConfigAutoConf = buildPerlPackage {
+    name = "Config-AutoConf-0.22";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AM/AMBS/Config/Config-AutoConf-0.22.tar.gz;
+      sha256 = "1zk2xfvxd3yn3299i13vn5wm1c7jxgr7z3h0yh603xs2h9cg79wc";
+    };
+    propagatedBuildInputs = [ CaptureTiny ];
+    meta = {
+      description = "A module to implement some of AutoConf macros in pure perl.";
+      license = "perl5";
+    };
+  };
+
+  ConfigGeneral = buildPerlPackage {
+    name = "Config-General-2.51";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TL/TLINDEN/${name}.tar.gz";
-      sha256 = "0ff5qh6dx8qijbkx5yfvn3fhn5m2hkcl8yjmqxwnvcg78h33s3ps";
+      url = mirror://cpan/authors/id/T/TL/TLINDEN/Config-General-2.51.tar.gz;
+      sha256 = "1khby072f10jbml0dlh82bg1s91ph8z6xa9bpk0l180q936k1xcg";
+    };
+    meta = {
+      license = "perl";
     };
   };
 
@@ -882,6 +1116,14 @@ rec {
     };
   };
 
+  constant-defer = buildPerlPackage rec {
+    name = "constant-defer-5";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/K/KR/KRYDE/${name}.tar.gz";
+      sha256 = "05fjw2n6liwlillrj3bkfm5fzxw1mcfbxrnk9m18vibx6yzf8pwq";
+    };
+  };
+
   ContextPreserve = buildPerlPackage rec {
     name = "Context-Preserve-0.01";
     src = fetchurl {
@@ -901,21 +1143,59 @@ rec {
     propagatedBuildInputs = [ CGICookieXS ];
   };
 
-  CPANMeta = buildPerlPackage rec {
-    name = "CPAN-Meta-2.112150";
+  CPANMeta = buildPerlPackage {
+    name = "CPAN-Meta-2.120921";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/CPAN/${name}.tar.gz";
-      sha256 = "0k48ccws3j158mrr348gishh5q7vg4fmx36fgrnnnydv0psic4n0";
+      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/CPAN-Meta-2.120921.tar.gz;
+      sha256 = "12cprk636jaklc97vdh55yjvzcr13h3csdnv3dgna84r2jijka79";
+    };
+    propagatedBuildInputs = [ ParseCPANMeta CPANMetaYAML CPANMetaRequirements ];
+    meta = {
+      homepage = https://github.com/dagolden/cpan-meta;
+      description = "The distribution metadata for a CPAN dist";
+      license = "perl5";
     };
-    propagatedBuildInputs =
-      [ CPANMetaYAML JSONPP ParseCPANMeta VersionRequirements version ];
   };
 
-  CPANMetaYAML = buildPerlPackage rec {
-    name = "CPAN-Meta-YAML-0.003";
+  CPANMetaCheck = buildPerlPackage {
+    name = "CPAN-Meta-Check-0.004";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/CPAN/${name}.tar.gz";
-      sha256 = "1mdmn9znk60izxdvvawsylv7n85x4y6lx8pa0gnkcp6d96q031af";
+      url = mirror://cpan/authors/id/L/LE/LEONT/CPAN-Meta-Check-0.004.tar.gz;
+      sha256 = "0ccybgfc0p41shmc6nmbg20xljq2ygfjcxmyaf6y07yk6wdcyf7s";
+    };
+    buildInputs = [ TestDifferences ];
+    propagatedBuildInputs = [ CPANMeta CPANMetaRequirements ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Verify requirements in a CPAN::Meta object";
+      license = "perl5";
+    };
+  };
+
+  CPANMetaRequirements = buildPerlPackage {
+    name = "CPAN-Meta-Requirements-2.122";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/CPAN-Meta-Requirements-2.122.tar.gz;
+      sha256 = "1fq2blw9ynja34fm9ck24m3qcpyk0hp25dhxvgs01k7yz64ryffh";
+    };
+    buildInputs = [ TestMore ];
+    meta = {
+      homepage = https://github.com/dagolden/cpan-meta-requirements;
+      description = "A set of version requirements for a CPAN dist";
+      license = "perl5";
+    };
+  };
+
+  CPANMetaYAML = buildPerlPackage {
+    name = "CPAN-Meta-YAML-0.008";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/CPAN-Meta-YAML-0.008.tar.gz;
+      sha256 = "1fxc8ybn6mdgzxyq1n69rgihmpfaarfclmbdw2rznya5zg2b0nz0";
+    };
+    meta = {
+      homepage = https://github.com/dagolden/cpan-meta-yaml;
+      description = "Read and write a subset of YAML for CPAN Meta files";
+      license = "perl5";
     };
   };
 
@@ -972,11 +1252,11 @@ rec {
     };
   };
 
-  CryptRandPasswd = buildPerlPackage rec {
-    name = "Crypt-RandPasswd-0.02";
+  CryptRandPasswd = buildPerlPackage {
+    name = "Crypt-RandPasswd-0.03";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JD/JDPORTER/${name}.tar.gz";
-      sha256 = "0r5w5i81s02x756alad9psxmpqmcxahzjpqxsb3kacsqj8s5br9b";
+      url = mirror://cpan/authors/id/N/NE/NEILB/Crypt-RandPasswd-0.03.tar.gz;
+      sha256 = "0sz2b4gj2mcwj0nqvxw3gs5m49jzfbi0vla51hj957dvfk00plhf";
     };
   };
 
@@ -1052,12 +1332,16 @@ rec {
     propagatedBuildInputs = [ FileFindRule ];
   };
 
-  DataDump = buildPerlPackage rec {
+  DataDump = buildPerlPackage {
     name = "Data-Dump-1.21";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Data/${name}.tar.gz";
+      url = mirror://cpan/authors/id/G/GA/GAAS/Data-Dump-1.21.tar.gz;
       sha256 = "1fcy6q8p406ag8g50l7znns3kxazfb458l6kw8pbsp4axnkz9ydx";
     };
+    meta = {
+      description = "Pretty printing of data structures";
+      license = "perl";
+    };
   };
 
   DataDumperConcise = buildPerlPackage rec {
@@ -1102,13 +1386,18 @@ rec {
     };
   };
 
-  DataOptList = buildPerlPackage rec {
+  DataOptList = buildPerlPackage {
     name = "Data-OptList-0.107";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Data-OptList-0.107.tar.gz;
       sha256 = "0r2sbvh1kj69al5crg394v5j5wkffvqdb17fz1rjfgb6h3v93xi8";
     };
-    propagatedBuildInputs = [SubInstall ParamsUtil];
+    propagatedBuildInputs = [ ParamsUtil SubInstall ];
+    meta = {
+      homepage = http://github.com/rjbs/data-optlist;
+      description = "Parse and validate simple name/value option pairs";
+      license = "perl5";
+    };
   };
 
   DataPage = buildPerlPackage {
@@ -1120,11 +1409,32 @@ rec {
     propagatedBuildInputs = [TestException ClassAccessorChained];
   };
 
+  DataSerializer = buildPerlPackage {
+    name = "Data-Serializer-0.59";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/N/NE/NEELY/Data-Serializer-0.59.tar.gz;
+      sha256 = "1mydpbacrkirafcjxcg1c0gnls1kxiv0qvdd4q2yd6vsyay0ayqr";
+    };
+    meta = {
+      description = "Modules that serialize data structures";
+      license = "perl";
+    };
+  };
+
+  DataTaxi = buildPerlPackage {
+    name = "Data-Taxi-0.96";
+    propagatedBuildInputs = [DebugShowStuff];
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MI/MIKO/Data-Taxi-0.96.tar.gz;
+      sha256 = "0y4wls4jlwd6prvd77szymddhq9sfj06kaqnk4frlvd0zh83djxb";
+    };
+  };
+
   DataUUID = buildPerlPackage rec {
-    name = "Data-UUID-1.217";
+    name = "Data-UUID-1.218";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Data/${name}.tar.gz";
-      sha256 = "0vgykclw1mn06a53d8y3g7s7vanks8078dh2j4jb84djk0cw9h0q";
+      sha256 = "1cb4i0j48g5dk2dwzz32myl6wv4ngxqnrkdnixq80pzjcmz1qkpl";
     };
   };
 
@@ -1136,7 +1446,7 @@ rec {
     };
     buildInputs = [ TestRequires ];
     propagatedBuildInputs =
-      [ ClassLoad Moose TaskWeaken TieToObject NamespaceClean ];
+      [ ClassLoad Moose TaskWeaken TieToObject namespaceclean ];
   };
 
   DateCalc = buildPerlPackage {
@@ -1156,14 +1466,19 @@ rec {
     };
   };
 
-  DateTime = buildModule rec {
-    name = "DateTime-0.74";
+  DateTime = buildPerlModule {
+    name = "DateTime-0.78";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
-      sha256 = "0wabln41nk73w4j3lc1ri8jzmxd3yyskdlagv9jflqaz8awcs8qy";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/DateTime-0.78.tar.gz;
+      sha256 = "0gicc3ib42jba989lxwy5i5sp4w3bmakdimgfxqbb57mbdarpxc5";
     };
     buildInputs = [ TestFatal ];
-    propagatedBuildInputs = [ DateTimeLocale DateTimeTimeZone MathRound ];
+    propagatedBuildInputs = [ DateTimeLocale DateTimeTimeZone ParamsValidate ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "A date and time object";
+      license = "artistic_2";
+    };
   };
 
   DateTimeFormatBuilder = buildPerlPackage rec {
@@ -1220,6 +1535,32 @@ rec {
     propagatedBuildInputs = [ ClassLoad ClassSingleton ParamsValidate TryTiny ];
   };
 
+  DebugShowStuff = buildPerlPackage {
+    name = "Debug-ShowStuff-1.14";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MI/MIKO/Debug-ShowStuff-1.14.tar.gz;
+      sha256 = "023c6f7y93k9qxxfa2fsvc5jkbv3rh6i3nw6zvxa5cg57xfypd7h";
+    };
+    propagatedBuildInputs = [ ClassISA DevelStackTrace StringUtil TermReadKey TextTabularDisplay TieIxHash ];
+    meta = {
+      description = "Debug::ShowStuff - A collection of handy debugging routines for displaying the values of variables with a minimum of coding.";
+      license = "perl";
+    };
+  };
+
+  DevelCaller = buildPerlPackage {
+    name = "Devel-Caller-2.06";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RC/RCLAMP/Devel-Caller-2.06.tar.gz;
+      sha256 = "1pxpimifzmnjnvf4icclx77myc15ahh0k56sj1djad1855mawwva";
+    };
+    propagatedBuildInputs = [ PadWalker ];
+    meta = {
+      description = "Meatier versions of C<caller>";
+      license = "perl5";
+    };
+  };
+
   DevelChecklib = buildPerlPackage rec {
     name = "Devel-CheckLib-0.98";
     src = fetchurl {
@@ -1249,38 +1590,59 @@ rec {
     inherit (pkgs) db4;
   };
 
-  DBI = buildPerlPackage rec {
-    name = "DBI-1.616";
+  DBI = buildPerlPackage {
+    name = "DBI-1.625";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TI/TIMB/${name}.tar.gz";
-      sha256 = "0m6hk66xprjl314d5c665hnd1vch9a0b9y6ywvmf04kdqj33kkk0";
+      url = mirror://cpan/authors/id/T/TI/TIMB/DBI-1.625.tar.gz;
+      sha256 = "1rl1bnirf1hshc0z04vk41qplx2ixzciabvwy50a1sld7vs46q4w";
+    };
+    meta = {
+      homepage = http://dbi.perl.org/;
+      description = "Database independent interface for Perl";
+      license = "perl5";
     };
   };
 
-  DBIxClass = buildPerlPackage rec {
-    name = "DBIx-Class-0.08196";
+  DBIxClass = buildPerlPackage {
+    name = "DBIx-Class-0.08250";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AR/ARODLAND/${name}.tar.gz";
-      sha256 = "15k1kgbrsnkwr0ib6cyr114zk904lisy4k09gfiynag9wjhv47lm";
+      url = mirror://cpan/authors/id/R/RI/RIBASUSHI/DBIx-Class-0.08250.tar.gz;
+      sha256 = "0nsqvj34klc9pf4l5kj3nqkq7agbsn11ys4115100awf7gxjbad6";
+    };
+    buildInputs = [ DBDSQLite PackageStash TestException TestWarn TestDeep ];
+    propagatedBuildInputs = [ ClassAccessorGrouped ClassC3Componentised ClassInspector ClassMethodModifiers ConfigAny ContextPreserve DataCompare DataDumperConcise DataPage DBI DevelGlobalDestruction HashMerge ModuleFind Moo MROCompat namespaceclean PathClass ScopeGuard SQLAbstract strictures SubName TryTiny ];
+    meta = {
+      homepage = http://www.dbix-class.org/;
+      description = "Extensible and flexible object <-> relational mapper";
+      license = "perl";
     };
-    buildInputs = [ DBDSQLite TestException TestWarn ];
-    propagatedBuildInputs =
-      [ PackageStash ClassAccessorGrouped ClassC3Componentised
-        ClassInspector ConfigAny ContextPreserve DBI DataCompare
-        DataDumperConcise DataPage HashMerge MROCompat ModuleFind
-        PathClass SQLAbstract ScopeGuard SubName TryTiny
-        NamespaceClean
-      ];
   };
 
-  DBIxClassCursorCached = buildPerlPackage rec {
+  DBIxClassCandy = buildPerlPackage {
+    name = "DBIx-Class-Candy-0.002103";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/F/FR/FREW/DBIx-Class-Candy-0.002103.tar.gz;
+      sha256 = "1vcaigvzxq9jjkhw2bkayrnsa76sakr3wrv7009f1dxyfa0iyrsk";
+    };
+    propagatedBuildInputs = [ TestDeep TestFatal DBIxClass LinguaENInflect StringCamelCase ];
+    meta = {
+      description = "Sugar for your favorite ORM, DBIx::Class";
+      license = "perl5";
+    };
+  };
+
+  DBIxClassCursorCached = buildPerlPackage {
     name = "DBIx-Class-Cursor-Cached-1.001002";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/DBIx/${name}.tar.gz";
+      url = mirror://cpan/authors/id/A/AR/ARCANEZ/DBIx-Class-Cursor-Cached-1.001002.tar.gz;
       sha256 = "19r7jr6pknxiirrybq0cd0lnr76xiw05arnfqgk9nrhp6c7vvil0";
     };
-    buildInputs = [ DBDSQLite ];
-    propagatedBuildInputs = [ CacheCache DBIxClass CarpClan ];
+    buildInputs = [ CacheCache DBDSQLite ];
+    propagatedBuildInputs = [ CarpClan DBIxClass ];
+    meta = {
+      description = "Cursor class with built-in caching support";
+      license = "perl";
+    };
   };
 
   DBIxClassHTMLWidget = buildPerlPackage rec {
@@ -1292,29 +1654,57 @@ rec {
     propagatedBuildInputs = [DBIxClass HTMLWidget];
   };
 
-  DBIxClassSchemaLoader = buildPerlPackage rec {
-    name = "DBIx-Class-Schema-Loader-0.07014";
+  DBIxClassHelpers = buildPerlPackage {
+    name = "DBIx-Class-Helpers-2.016005";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/DBIx/${name}.tar.gz";
-      sha256 = "0qrsh6i8p4mpx5bapn40cpsbvnvzivli71gymbiqjd0mjflbsjf6";
+      url = mirror://cpan/authors/id/F/FR/FREW/DBIx-Class-Helpers-2.016005.tar.gz;
+      sha256 = "0nkskc0h284l2q3m33553i8g4pr1kcx7vmwz8bi1kmga16bs7nqk";
+    };
+    propagatedBuildInputs = [ DBIxClassCandy TestDeep CarpClan DBDSQLite ];
+    meta = {
+      description = "Simplify the common case stuff for DBIx::Class.";
+      license = "perl5";
     };
-    buildInputs = [ TestException TestMore TestWarn DBDSQLite ];
-    propagatedBuildInputs =
-      [ DataDump LinguaENInflectNumber LinguaENInflectPhrase
-        ClassAccessor ClassAccessorGrouped ClassC3Componentised
-        MROCompat CarpClan DBIxClass ClassLoad ClassUnload
-        ListMoreUtils NamespaceClean ScopeGuard TryTiny TaskWeaken
-        StringCamelCase StringToIdentifierEN
-      ];
   };
 
-  DevelGlobalDestruction = buildPerlPackage rec {
-    name = "Devel-GlobalDestruction-0.02";
+  DBIxClassIntrospectableM2M = buildPerlPackage {
+    name = "DBIx-Class-IntrospectableM2M-0.001001";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/N/NU/NUFFIN/${name}.tar.gz";
-      sha256 = "174m5dx2z89h4308gx6s6vmg93qzaq0bh9m91hp2vqbyialnarhw";
+      url = mirror://cpan/authors/id/G/GR/GRODITI/DBIx-Class-IntrospectableM2M-0.001001.tar.gz;
+      sha256 = "0p9zx1yc1f6jg583l206wilsni2v8mlngc2vf2q8yn10pmy4y6wm";
+    };
+    propagatedBuildInputs = [ DBIxClass ];
+    meta = {
+      description = "Introspect many-to-many relationships";
+      license = "perl";
+    };
+  };
+
+  DBIxClassSchemaLoader = buildPerlPackage {
+    name = "DBIx-Class-Schema-Loader-0.07033";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RK/RKITOVER/DBIx-Class-Schema-Loader-0.07033.tar.gz;
+      sha256 = "1vrcxxlbvdch5r9v5i6vrb4fqqfbpxybpdqndmlnc2jzlqjwjahi";
+    };
+    buildInputs = [ ConfigAny ConfigGeneral DBDSQLite DBI DBIxClassIntrospectableM2M Moose MooseXMarkAsMethods MooseXNonMoose namespaceautoclean TestException TestPod TestWarn ];
+    propagatedBuildInputs = [ CarpClan ClassAccessorGrouped ClassC3Componentised ClassInspector ClassUnload DataDump DBIxClass HashMerge LinguaENInflectNumber LinguaENInflectPhrase LinguaENTagger ListMoreUtils MROCompat namespaceclean ScopeGuard StringCamelCase StringToIdentifierEN SubName TaskWeaken TryTiny ];
+    meta = {
+      description = "Create a DBIx::Class::Schema based on a database";
+      license = "perl";
+    };
+  };
+
+  DevelGlobalDestruction = buildPerlPackage {
+    name = "Devel-GlobalDestruction-0.09";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RI/RIBASUSHI/Devel-GlobalDestruction-0.09.tar.gz;
+      sha256 = "1hvrv88167rc2chqgxpd6q0ir5fki1q6r3w11v3lxfs118fdi65m";
+    };
+    propagatedBuildInputs = [ SubExporterProgressive ];
+    meta = {
+      homepage = http://search.cpan.org/dist/Devel-GlobalDestruction;
+      license = "perl5";
     };
-    propagatedBuildInputs = [SubExporter ScopeGuard];
   };
 
   DevelHide = buildPerlPackage rec {
@@ -1325,21 +1715,30 @@ rec {
     };
   };
 
-  DevelStackTrace = buildPerlPackage rec {
-    name = "Devel-StackTrace-1.27";
+  DevelStackTrace = buildPerlPackage {
+    name = "Devel-StackTrace-1.30";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Devel/${name}.tar.gz";
-      sha256 = "01p7b9cmji582bld81c3b84jffhdi59zydnxjj6fh3m29zyysmfs";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Devel-StackTrace-1.30.tar.gz;
+      sha256 = "1m13wzg4pmbc0f1w2rn9ybqwkqg66zw9zv34ayk7gr3349v7kbzl";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "An object representing a stack trace";
+      license = "artistic_2";
     };
   };
 
-  DevelStackTraceAsHTML = buildPerlPackage rec {
+  DevelStackTraceAsHTML = buildPerlPackage {
     name = "Devel-StackTrace-AsHTML-0.11";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Devel/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Devel-StackTrace-AsHTML-0.11.tar.gz;
       sha256 = "0y0r42gszp3bxbs9j2nn3xgs8ij1cnadrywwwdc6r0y8m0siyapg";
     };
     propagatedBuildInputs = [ DevelStackTrace ];
+    meta = {
+      description = "Displays stack trace in HTML";
+      license = "perl";
+    };
   };
 
   DevelSymdump = buildPerlPackage rec {
@@ -1362,12 +1761,15 @@ rec {
   };
 
   DigestHMAC = buildPerlPackage {
-    name = "Digest-HMAC-1.01";
+    name = "Digest-HMAC-1.03";
     src = fetchurl {
-      url = mirror://cpan/authors/id/G/GA/GAAS/Digest-HMAC-1.01.tar.gz;
-      sha256 = "042d6nknc5icxqsy5asrh8v2shmvg7b3vbj95jyk4sbqlqpacwz3";
+      url = mirror://cpan/authors/id/G/GA/GAAS/Digest-HMAC-1.03.tar.gz;
+      sha256 = "0naavabbm1c9zgn325ndy66da4insdw9l3mrxwxdfi7i7xnjrirv";
+    };
+    meta = {
+      description = "Keyed-Hashing for Message Authentication";
+      license = "perl";
     };
-    propagatedBuildInputs = [DigestSHA1];
   };
 
   DigestMD4 = buildPerlPackage rec {
@@ -1378,55 +1780,70 @@ rec {
     };
   };
 
-  DigestSHA = buildPerlPackage rec {
-    name = "Digest-SHA-5.47";
-    src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MS/MSHELOR/${name}.tar.gz";
-      sha256 = "1xk9hdds4dk5iklxr8fdfbgfvd8cwgcjh5jqmjxhaw57ss2dh5wx";
-    };
-  };
+  DigestSHA = null;
 
   DigestSHA1 = buildPerlPackage {
-    name = "Digest-SHA1-2.12";
+    name = "Digest-SHA1-2.13";
     src = fetchurl {
-      url = mirror://cpan/authors/id/G/GA/GAAS/Digest-SHA1-2.12.tar.gz;
-      sha256 = "19gmbb3yb9pr0y02c6rf99zh14a7a67l4frl7cs0lzpxb41484xa";
+      url = mirror://cpan/authors/id/G/GA/GAAS/Digest-SHA1-2.13.tar.gz;
+      sha256 = "1k23p5pjk42vvzg8xcn4iwdii47i0qm4awdzgbmz08bl331dmhb8";
+    };
+    meta = {
+      description = "Perl interface to the SHA-1 algorithm";
+      license = "perl";
     };
   };
 
-  DistCheckConflicts = buildPerlPackage rec {
+  DistCheckConflicts = buildPerlPackage {
     name = "Dist-CheckConflicts-0.02";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
+      url = mirror://cpan/authors/id/D/DO/DOY/Dist-CheckConflicts-0.02.tar.gz;
       sha256 = "1lh7j20vvsh4dyh74hr0wnabyv8vcdkilfi93m2fbk69qk3w995j";
     };
     buildInputs = [ TestFatal ];
-    propagatedBuildInputs = [ ListMoreUtils SubExporter ];
+    propagatedBuildInputs = [ SubExporter ListMoreUtils ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Declare version conflicts for your dist";
+      license = "perl5";
+    };
   };
 
-  EmailAbstract = buildPerlPackage rec {
+  EmailAbstract = buildPerlPackage {
     name = "Email-Abstract-3.004";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Abstract-3.004.tar.gz;
       sha256 = "0fiaagxc2hy5g3qiipv4cspkwbaggdmsxbll1f4jx2qnq5hm668d";
     };
     propagatedBuildInputs = [ EmailSimple MROCompat ];
+    meta = {
+      license = "perl";
+    };
   };
 
-  EmailAddress = buildPerlPackage rec {
-    name = "Email-Address-1.889";
+  EmailAddress = buildPerlPackage {
+    name = "Email-Address-1.897";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "0icpln4cs058x5lbqsg4wzb8p02qv7bb1z6ljxh70yd3y1mn0nxn";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Address-1.897.tar.gz;
+      sha256 = "17v5jvwhkd5clyihwsldnh4k7vpmaisn064s3mkxlr9dnz7nd10r";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "RFC 2822 Address Parsing";
+      license = "perl5";
     };
   };
 
-  EmailDateFormat = buildPerlPackage rec {
+  EmailDateFormat = buildPerlPackage {
     name = "Email-Date-Format-1.002";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Date-Format-1.002.tar.gz;
       sha256 = "114fqcnmvzi0z100yx89j6rgwbicb0bslswhyr8z2pzsvwv3czqc";
     };
+    meta = {
+      description = "Produce RFC 8822 date strings";
+      license = "perl";
+    };
   };
 
   EmailSend = buildPerlPackage rec {
@@ -1438,26 +1855,31 @@ rec {
     propagatedBuildInputs = [EmailSimple EmailAddress ModulePluggable ReturnValue];
   };
 
-  EmailSender = buildPerlPackage rec {
-    name = "Email-Sender-0.110001";
+  EmailSender = buildPerlPackage {
+    name = "Email-Sender-0.120002";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "0z4nl7aizbailraqwkkqhx6k3hdz67wxszjfhd5yg2vn06ybsjwj";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Sender-0.120002.tar.gz;
+      sha256 = "1cp735ndmh76xzijsm1hd0yh0m9yj34jc8akjhidkn677h2021dc";
+    };
+    propagatedBuildInputs = [ CaptureTiny EmailAbstract EmailAddress EmailSimple ListMoreUtils Moose Throwable TryTiny ];
+    meta = {
+      homepage = https://github.com/rjbs/email-sender;
+      description = "A library for sending email";
+      license = "perl5";
     };
-    buildInputs = [ TestMore ];
-    propagatedBuildInputs =
-      [ CaptureTiny EmailAbstract EmailAddress ListMoreUtils Moose
-        Throwable TryTiny
-      ];
   };
 
-  EmailSimple = buildPerlPackage rec {
-    name = "Email-Simple-2.100";
+  EmailSimple = buildPerlPackage {
+    name = "Email-Simple-2.102";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "1q86p9r5sb1dwdhcbnkfrbx08440cf74vzgrqc05cgi8mmhdfsh9";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Email-Simple-2.102.tar.gz;
+      sha256 = "19da1a06vnixhqfl41mfjrihvvxjgdgkq9bczp8k9mpr29xlbnq4";
     };
     propagatedBuildInputs = [ EmailDateFormat ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      license = "perl5";
+    };
   };
 
   EmailValid = buildPerlPackage {
@@ -1479,29 +1901,34 @@ rec {
   };
 
   EncodeLocale = buildPerlPackage rec {
-    name = "Encode-Locale-1.02";
+    name = "Encode-Locale-1.03";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Encode/${name}.tar.gz";
-      sha256 = "0h2kim6mg236s749wlg35lhv1zdkrkr0bm65spkg005cn0mbmi90";
+      sha256 = "0m9d1vdphlyzybgmdanipwd9ndfvyjgk3hzw250r299jjgh3fqzp";
     };
   };
 
   Error = buildPerlPackage rec {
-    name = "Error-0.17016";
+    name = "Error-0.17019";
     src = fetchurl {
       url = "mirror://cpan/authors/id/S/SH/SHLOMIF/${name}.tar.gz";
-      sha256 = "1akr35g7nbhch8fgkrqixjy08gx19brp981wyxplscizwcya64zh";
+      sha256 = "0m09jwjs2x8j50bh3cg3m2mbxa7qh9i2krgq7z8h1pgl5dscyg2i";
     };
   };
 
-  EvalClosure = buildPerlPackage rec {
-    name = "Eval-Closure-0.06";
+  EvalClosure = buildPerlPackage {
+    name = "Eval-Closure-0.08";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
-      sha256 = "0qjfigd7r3xwizf8wff3g2mhidbqqlb6xy125iwd03f3i5hmnhic";
+      url = mirror://cpan/authors/id/D/DO/DOY/Eval-Closure-0.08.tar.gz;
+      sha256 = "01x449ljj8mhr3jgfvnhzn0zz3xc81krslxiq29srqccsqjf933k";
     };
     buildInputs = [ TestFatal TestRequires ];
     propagatedBuildInputs = [ SubExporter TryTiny ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Safely and cleanly create closures via string eval";
+      license = "perl5";
+    };
   };
 
   ExceptionClass = buildPerlPackage rec {
@@ -1521,19 +1948,33 @@ rec {
     };
   };
 
-  ExtUtilsInstall = buildPerlPackage rec {
-    name = "ExtUtils-Install-1.54";
+
+  ExtUtilsCppGuess = buildPerlModule rec {
+    name = "ExtUtils-CppGuess-0.07";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
-      sha256 = "19igil4iwh3jdyvjm8s0ypm8wxsny6nv4z3b3lkwhq0ccjgd3rp3";
+      sha256 = "1a77hxf2pa8ia9na72rijv1yhpn2bjrdsybwk2dj2l938pl3xn0w";
+    };
+    propagatedBuildInputs = [ CaptureTiny ];
+  };
+
+  ExtUtilsLibBuilder = buildPerlModule {
+    name = "ExtUtils-LibBuilder-0.04";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AM/AMBS/ExtUtils/ExtUtils-LibBuilder-0.04.tar.gz;
+      sha256 = "0j4rhx3w6nbvmxqjg6q09gm10nnpkcmqmh29cgxsfc9k14d8bb6w";
+    };
+    meta = {
+      description = "A tool to build C libraries.";
+      license = "perl";
     };
   };
 
   ExtUtilsMakeMaker = buildPerlPackage rec{
-    name = "ExtUtils-MakeMaker-6.59";
+    name = "ExtUtils-MakeMaker-6.66";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
-      sha256 = "0fwhb2cf5x7y87xwml66p624iynf0mzvhy1q4aq5yv7l3lhwhaby";
+      sha256 = "1w9pbjajas60a9i29j8h10nz9jf86w7jb197llnfs9fqcf4yvfha";
     };
     propagatedBuildInputs =
       [ ParseCPANMeta version JSONPP CPANMetaYAML CPANMeta
@@ -1542,10 +1983,10 @@ rec {
   };
 
   ExtUtilsManifest = buildPerlPackage rec {
-    name = "ExtUtils-Manifest-1.59";
+    name = "ExtUtils-Manifest-1.61";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
-      sha256 = "0cb7mjmfsk2rlwdr5y91x2w5ffb0yjf9gblibk9wplivlpa48jhs";
+      sha256 = "18jj4lrip2g580b2fw5khxvdx6h3pavgihvb87snggrlgabpj20n";
     };
   };
 
@@ -1557,7 +1998,33 @@ rec {
     };
   };
 
-  FileChangeNotify = buildModule rec {
+  ExtUtilsTypemapsDefault = buildPerlModule rec {
+    name = "ExtUtils-Typemaps-Default-1.01";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
+      sha256 = "0k03rr7bmhnn6j0505w9id5apss85yvqnx76hxf3javn3klj1m5z";
+    };
+  };
+
+  ExtUtilsXSpp = buildPerlModule rec {
+    name = "ExtUtils-XSpp-0.1700";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/ExtUtils/${name}.tar.gz";
+      sha256 = "1msp79bdjzi59vignfz1cxwk5a2cjiahblvi0ka60pi8nnn0alrm";
+    };
+    buildInputs = [ Spiffy TestBase TestDifferences ];
+  };
+
+  FCGI = buildPerlPackage rec {
+    name = "FCGI-0.74";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/FCGI/${name}.tar.gz";
+      sha256 = "0m089q07kpsk8y8g2wmi3d8i1jzn5m5m00shs7vnf2lnvvv4d7pm";
+    };
+    buildInputs = [ ];
+  };
+
+  FileChangeNotify = buildPerlModule rec {
     name = "File-ChangeNotify-0.20";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/File/${name}.tar.gz";
@@ -1566,7 +2033,7 @@ rec {
     buildInputs = [ TestException ];
     propagatedBuildInputs =
       [ ClassMOP Moose MooseXParamsValidate MooseXSemiAffordanceAccessor
-        NamespaceAutoclean
+        namespaceautoclean
       ] ++ stdenv.lib.optional stdenv.isLinux LinuxInotify2;
   };
 
@@ -1578,6 +2045,19 @@ rec {
     };
   };
 
+  FileBaseDir = buildPerlPackage rec {
+    version = "0.03";
+    name = "File-BaseDir-${version}";
+    configurePhase = ''
+      preConfigure || true
+      perl Build.PL PREFIX="$out" prefix="$out"
+    '';
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/File/${name}.tar.gz";
+      sha256 = "0029cba7a3b5d8aa5f7d03cb1b7ba2bcf2829382f7f26aa3bee06fce8611a886";
+    };
+  };
+
   FileCopyRecursive = buildPerlPackage rec {
     name = "File-Copy-Recursive-0.38";
     src = fetchurl {
@@ -1586,6 +2066,20 @@ rec {
     };
   };
 
+  FileDesktopEntry = buildPerlPackage rec {
+    version = "0.04";
+    name = "File-DesktopEntry-${version}";
+    configurePhase = ''
+      preConfigure || true
+      perl Build.PL PREFIX="$out" prefix="$out"
+    '';
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/File/${name}.tar.gz";
+      sha256 = "d7f80d8bd303651a43dc1810c73740d38a0d2b158fb33cd3b6ca4d3a566da7cb";
+    };
+    propagatedBuildInputs = [ FileBaseDir ];
+  };
+
   FileFindRule = buildPerlPackage rec {
     name = "File-Find-Rule-0.32";
     src = fetchurl {
@@ -1596,10 +2090,10 @@ rec {
   };
 
   FileListing = buildPerlPackage rec {
-    name = "File-Listing-6.03";
+    name = "File-Listing-6.04";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/File/${name}.tar.gz";
-      sha256 = "154hp49pcngsqrwi1pbw3fx82v7vql4dc9wh7qfj37vmy8sn1s93";
+      sha256 = "1xcwjlnxaiwwpn41a5yi6nz95ywh3szq5chdxiwj36kqsvy5000y";
     };
     propagatedBuildInputs = [ HTTPDate ];
   };
@@ -1613,10 +2107,10 @@ rec {
   };
 
   FileNext = buildPerlPackage rec {
-    name = "File-Next-1.06";
+    name = "File-Next-1.12";
     src = fetchurl {
       url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
-      sha256 = "36cc0a4e5e4e44e04f7bea6f7453db517acc1a1b35a2b5fe5bc14cea0f560662";
+      sha256 = "cc3afd8eaf6294aba93b8152a269cc36a9df707c6dc2c149aaa04dabd869e60a";
     };
   };
 
@@ -1628,36 +2122,42 @@ rec {
     };
   };
 
-  FileShareDir = buildPerlPackage rec {
-    name = "File-ShareDir-1.00";
+  FileShareDir = buildPerlPackage {
+    name = "File-ShareDir-1.03";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-      sha256 = "1afr1r1ys2ij8i4r0i85hfrgrbvcha8c7cgkhcrdya1f0lnpw59z";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/File-ShareDir-1.03.tar.gz;
+      sha256 = "0fczaqjxyzmzgrmn3ib84cj6pd2085wsvni3wf5b018i21j2wi2r";
+    };
+    propagatedBuildInputs = [ ClassInspector ];
+    meta = {
+      description = "Locate per-dist and per-module shared files";
+      license = "perl";
     };
-    propagatedBuildInputs = [ClassInspector ParamsUtil];
   };
 
-  FilesysNotifySimple = buildPerlPackage rec {
+  FilesysNotifySimple = buildPerlPackage {
     name = "Filesys-Notify-Simple-0.08";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Filesys/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Filesys-Notify-Simple-0.08.tar.gz;
       sha256 = "042klyvi8fbkhmyg1h7883bbjdhiclmky9w2wfga7piq5il6nxgi";
     };
-  };
-
-  FileTemp = buildPerlPackage rec {
-    name = "File-Temp-0.22";
-    src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TJ/TJENNESS/${name}.tar.gz";
-      sha256 = "11a738swa2as5d6mva798slxnd7ndhqii027ydm0av3y94i957wq";
+    meta = {
+      description = "Simple and dumb file system watcher";
+      license = "perl";
     };
   };
 
-  FileSlurp = buildPerlPackage rec {
-    name = "File-Slurp-9999.13";
+  FileTemp = null;
+
+  FileSlurp = buildPerlPackage {
+    name = "File-Slurp-9999.19";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
-      sha256 = "1rdkih4iv77y4xaprwdaw85d8pmja01152ngw66rb1h9rby3n1dv";
+      url = mirror://cpan/authors/id/U/UR/URI/File-Slurp-9999.19.tar.gz;
+      sha256 = "0hrn4nipwx40d6ji8ssgr5nw986z9iqq8cn0kdpbszh9jplynaff";
+    };
+    meta = {
+      description = "Simple and Efficient Reading/Writing/Modifying of Complete Files";
+      license = "perl";
     };
   };
 
@@ -1692,13 +2192,14 @@ rec {
       url = mirror://cpan/authors/id/I/IL/ILYAZ/modules/FreezeThaw-0.43.tar.gz;
       sha256 = "1qamc5aggp35xk590a4hy660f2rhc2l7j65hbyxdya9yvg7z437l";
     };
+    doCheck = false;
   };
 
   GD = buildPerlPackage rec {
-    name = "GD-2.45";
+    name = "GD-2.49";
     src = fetchurl {
       url = "mirror://cpan/authors/id/L/LD/LDS/${name}.tar.gz";
-      sha256 = "1p84585b4iyqa21hbqni0blj8fzd917ynd3y1hwh3mrmyfqj178x";
+      sha256 = "03wwvhvni22cs7arai7d3wkb2qfa9p20grrb32hdxv41nqxqpihh";
     };
 
     buildInputs = [ pkgs.gd pkgs.libjpeg pkgs.zlib pkgs.freetype
@@ -1719,6 +2220,19 @@ rec {
     makeMakerFlags = "--lib_png_path=${pkgs.libpng} --lib_jpeg_path=${pkgs.libjpeg} --lib_zlib_path=${pkgs.zlib} --lib_ft_path=${pkgs.freetype} --lib_fontconfig_path=${pkgs.fontconfig} --lib_xpm_path=${pkgs.xlibs.libXpm}";
   };
 
+  GDSecurityImage = buildPerlPackage {
+    name = "GD-SecurityImage-1.72";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/B/BU/BURAK/GD-SecurityImage-1.72.tar.gz;
+      sha256 = "07a025krdaml5ls7gyssfdcsif6cnsnksrxkqk48n9dmv7rz7q1r";
+    };
+    propagatedBuildInputs = [ GD ];
+    meta = {
+      description = "Security image (captcha) generator";
+      license = "perl5";
+    };
+  };
+
   GeoIP = buildPerlPackage rec {
     name = "Geo-IP-1.39";
     src = fetchurl {
@@ -1737,14 +2251,33 @@ rec {
     };
   };
 
-  GetoptLongDescriptive = buildPerlPackage rec {
-    name = "Getopt-Long-Descriptive-0.090";
+  GetoptLongDescriptive = buildPerlPackage {
+    name = "Getopt-Long-Descriptive-0.093";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Getopt/${name}.tar.gz";
-      sha256 = "17ghqd50y3627ajc7wl6n7sv055p2gg0h40lavx7qhwyg5rf46lw";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Getopt-Long-Descriptive-0.093.tar.gz;
+      sha256 = "0iccps0jlcjm68i5yywgs477plfnkc6b2386bzb99blm3jwdfyac";
+    };
+    propagatedBuildInputs = [ ParamsValidate SubExporter SubExporterUtil ];
+    meta = {
+      homepage = https://github.com/rjbs/Getopt-Long-Descriptive;
+      description = "Getopt::Long, but simpler and more powerful";
+      license = "perl5";
+    };
+  };
+
+  GoogleProtocolBuffers = buildPerlPackage rec {
+    name = "Google-ProtocolBuffers-0.08";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/G/GA/GARIEV/${name}.tar.gz";
+      sha256 = "0pxfphg671wh56h59pf0zrj7m1cr0yga95hf3w54563pzcw2vqv3";
+    };
+    propagatedBuildInputs = [ ClassAccessor ParseRecDescent ];
+    patches =
+      [ ../development/perl-modules/Google-ProtocolBuffers-multiline-comments.patch ];
+    meta = {
+      description = "Simple interface to Google Protocol Buffers";
+      license = "perl";
     };
-    buildInputs = [ TestMore ];
-    propagatedBuildInputs = [ ParamsValidate SubExporter ];
   };
 
   Graph = buildPerlPackage rec {
@@ -1775,6 +2308,15 @@ rec {
     };
   };
 
+  GrowlGNTP = buildPerlModule rec {
+    name = "Growl-GNTP-0.20";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Growl/${name}.tar.gz";
+      sha256 = "150x65lwf7pfsygcpmvj3679lhlfwx87xylwnrmwll67f9dpkjdi";
+    };
+    buildInputs = [ DataUUID CryptCBC ];
+  };
+
   HashFlatten = buildPerlPackage rec {
     name = "Hash-Flatten-1.19";
     src = fetchurl {
@@ -1791,13 +2333,20 @@ rec {
       sha256 = "07h7dyldxwqhq3x4fp9hacnc4vgipp0jk50b5cbvib975nfxx98z";
     };
     propagatedBuildInputs = [ Clone ];
+    meta = {
+      description = "Merges arbitrarily deep hashes into a single hash";
+    };
   };
 
-  HashMultiValue = buildPerlPackage rec {
-    name = "Hash-MultiValue-0.10";
+  HashMultiValue = buildPerlPackage {
+    name = "Hash-MultiValue-0.13";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Hash/${name}.tar.gz";
-      sha256 = "1n9klrg01myij2svcmdc212msmsr3cmsl2yw5k9my8j3s96b5yn1";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Hash-MultiValue-0.13.tar.gz;
+      sha256 = "0flflmk2kxq9sjmhxr1547lidgigibhck912j4ambdwg21sbxjjd";
+    };
+    meta = {
+      description = "Store multiple values per key";
+      license = "perl";
     };
   };
 
@@ -1810,13 +2359,17 @@ rec {
     buildInputs = [ pkgs.unzip ];
   };
 
-  HTMLForm = buildPerlPackage rec {
-    name = "HTML-Form-6.00";
+  HTMLForm = buildPerlPackage {
+    name = "HTML-Form-6.03";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTML/${name}.tar.gz";
-      sha256 = "11s9mlybjm14sa6m3wcfjf9pv00yynv0yk4parx44ga9h1a6y6xl";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTML-Form-6.03.tar.gz;
+      sha256 = "0dpwr7yz6hjc3bcqgcbdzjjk9l58ycdjmbam9nfcmm85y2a1vh38";
     };
     propagatedBuildInputs = [ HTMLParser HTTPMessage URI ];
+    meta = {
+      description = "Class that represents an HTML form element";
+      license = "perl";
+    };
   };
 
   HTMLFormFu = buildPerlPackage rec {
@@ -1838,13 +2391,17 @@ rec {
       ];
   };
 
-  HTMLParser = buildPerlPackage rec {
-    name = "HTML-Parser-3.68";
+  HTMLParser = buildPerlPackage {
+    name = "HTML-Parser-3.69";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTML/${name}.tar.gz";
-      sha256 = "1hhniqqpvi01vxsyvmcj677yg7a12zy0a3ynwxwg3ig6shn8a3j3";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTML-Parser-3.69.tar.gz;
+      sha256 = "01i4lj37dgwbj9mna756dzzz5lvx7adcnjk9s0hskqq0cn81r2vl";
+    };
+    propagatedBuildInputs = [ HTMLTagset ];
+    meta = {
+      description = "HTML parser class";
+      license = "perl";
     };
-    propagatedBuildInputs = [HTMLTagset];
   };
 
   HTMLScrubber = buildPerlPackage {
@@ -1890,13 +2447,19 @@ rec {
     buildInputs = [TestPod];
   };
 
-  HTMLTree = buildPerlPackage rec {
-    name = "HTML-Tree-4.2";
+  HTMLTree = buildPerlModule {
+    name = "HTML-Tree-5.03";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JF/JFEARN/${name}.tar.gz";
-      sha256 = "80e4e3caa5e0e025dee5ed383a8d4cc7479ae4802184c4757dafd147a8fca7c9";
+      url = mirror://cpan/authors/id/C/CJ/CJM/HTML-Tree-5.03.tar.gz;
+      sha256 = "13qlqbpixw470gnck0xgny8hyjj576m8y24bba2p9ai2lvy76vbx";
+    };
+    buildInputs = [ TestFatal ];
+    propagatedBuildInputs = [ HTMLParser HTMLTagset ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Work with HTML in a DOM-like tree structure";
+      license = "perl5";
     };
-    propagatedBuildInputs = [HTMLParser];
   };
 
   HTMLWidget = buildPerlPackage {
@@ -1912,30 +2475,55 @@ rec {
     ];
   };
 
-  HTTPBody = buildPerlPackage rec {
-    name = "HTTP-Body-1.12";
+  HTTPBody = buildPerlPackage {
+    name = "HTTP-Body-1.17";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "1229hhcm762n9x82jkhl8hmjcaigprcsrhymcdbkqlwch2agm6g2";
+      url = mirror://cpan/authors/id/G/GE/GETTY/HTTP-Body-1.17.tar.gz;
+      sha256 = "1476zdcg1cdal3ik6ccwm3rqfgsdac6b63f92wmipvn8lkjdl70k";
     };
     buildInputs = [ TestDeep ];
-    propagatedBuildInputs = [ LWP ];
+    propagatedBuildInputs = [ HTTPMessage ];
+    meta = {
+      description = "HTTP Body Parser";
+      license = "perl";
+    };
   };
 
-  HTTPCookies = buildPerlPackage rec {
-    name = "HTTP-Cookies-6.00";
+  HTTPCookies = buildPerlPackage {
+    name = "HTTP-Cookies-6.01";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "0758c3rj22z1bj7pbypmh1jadgd6w68nn8inhds96r39jhc79d9h";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTTP-Cookies-6.01.tar.gz;
+      sha256 = "087bqmg22dg3vj7gssh3pcsh9y1scimkbl5h1kc8jqyfhgisvlzm";
     };
     propagatedBuildInputs = [ HTTPDate HTTPMessage ];
+    meta = {
+      description = "HTTP cookie jars";
+      license = "perl";
+    };
   };
 
-  HTTPDate = buildPerlPackage rec {
-    name = "HTTP-Date-6.00";
+  HTTPDaemon = buildPerlPackage {
+    name = "HTTP-Daemon-6.01";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "15nrnfir4xqdd3lm0s0jgh9zwxx5ylmvl63xqmj5wipzl4l76vs6";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTTP-Daemon-6.01.tar.gz;
+      sha256 = "1hmd2isrkilf0q0nkxms1q64kikjmcw9imbvrjgky6kh89vqdza3";
+    };
+    propagatedBuildInputs = [ HTTPDate HTTPMessage LWPMediaTypes ];
+    meta = {
+      description = "A simple http server class";
+      license = "perl";
+    };
+  };
+
+  HTTPDate = buildPerlPackage {
+    name = "HTTP-Date-6.02";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTTP-Date-6.02.tar.gz;
+      sha256 = "0cz357kafhhzw7w59iyi0wvhw7rlh5g1lh38230ckw7rl0fr9fg8";
+    };
+    meta = {
+      description = "Date conversion routines";
+      license = "perl";
     };
   };
 
@@ -1955,31 +2543,39 @@ rec {
     };
   };
 
-  HTTPMessage = buildPerlPackage rec {
-    name = "HTTP-Message-6.02";
+  HTTPMessage = buildPerlPackage {
+    name = "HTTP-Message-6.06";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "10ai2vabbx6yqsyz6rbi7hp4vljmlq9kyn74jvjp95la5v4b6c93";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTTP-Message-6.06.tar.gz;
+      sha256 = "0qxdrcak97azjvqyx1anpb2ky6vp6vc37x0wcfjdqfajkh09fzh8";
+    };
+    propagatedBuildInputs = [ EncodeLocale HTTPDate IOHTML LWPMediaTypes URI ];
+    meta = {
+      description = "HTTP style messages";
+      license = "perl";
     };
-    propagatedBuildInputs = [ EncodeLocale HTMLParser HTTPDate IOCompress LWPMediaTypes URI ];
   };
 
-  HTTPParserXS = buildPerlPackage rec {
-    name = "HTTP-Parser-XS-0.14";
+  HTTPNegotiate = buildPerlPackage {
+    name = "HTTP-Negotiate-6.01";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "06srbjc380kvvj76r8n5c2y282j5zfgn0s0zmb9h3shwrynfqj05";
+      url = mirror://cpan/authors/id/G/GA/GAAS/HTTP-Negotiate-6.01.tar.gz;
+      sha256 = "05p053vjs5g91v5cmjnny7a3xzddz5k7vnjw81wfh01ilqg9qwhw";
+    };
+    propagatedBuildInputs = [ HTTPMessage ];
+    meta = {
+      description = "Choose a variant to serve";
+      license = "perl";
     };
-    buildInputs = [ TestMore ];
   };
 
-  HTTPRequest = buildPerlPackage rec {
-    name = "HTTP-Message-6.03";
+  HTTPParserXS = buildPerlPackage rec {
+    name = "HTTP-Parser-XS-0.14";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
-      sha256 = "c736e083bdf0eea1bb73e2dc3b66db0a8283942c0f69063afadb9a7cfa80011b";
+      sha256 = "06srbjc380kvvj76r8n5c2y282j5zfgn0s0zmb9h3shwrynfqj05";
     };
-    propagatedBuildInputs = [ HTTPDate URI HTMLParser LWP ];
+    buildInputs = [ TestMore ];
   };
 
   HTTPRequestAsCGI = buildPerlPackage rec {
@@ -1991,23 +2587,28 @@ rec {
     propagatedBuildInputs = [ ClassAccessor LWP ];
   };
 
-  HTTPResponseEncoding = buildPerlPackage rec {
+  HTTPResponseEncoding = buildPerlPackage {
     name = "HTTP-Response-Encoding-0.06";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/HTTP/${name}.tar.gz";
+      url = mirror://cpan/authors/id/D/DA/DANKOGAI/HTTP-Response-Encoding-0.06.tar.gz;
       sha256 = "1am8lis8107s5npca1xgazdy5sknknzcqyhdmc220s4a4f77n5hh";
     };
-    propagatedBuildInputs = [ LWP ];
+    propagatedBuildInputs = [ LWPUserAgent HTTPMessage ];
+    meta = {
+      description = "Adds encoding() to HTTP::Response";
+    };
   };
 
-  HTTPServerSimple = buildPerlPackage rec {
-    name = "HTTP-Server-Simple-0.38";
+  HTTPServerSimple = buildPerlPackage {
+    name = "HTTP-Server-Simple-0.44";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JE/JESSE/${name}.tar.gz";
-      sha256 = "1m1lmpbg0zhiv2vyc3fyyqfsv3jhhb2mbdl5624fqb0va2pnla6n";
+      url = mirror://cpan/authors/id/J/JE/JESSE/HTTP-Server-Simple-0.44.tar.gz;
+      sha256 = "05klpfkss2a6i5ihmvcm27fyar0f2v4ispg2f49agab3va1gix6g";
     };
-    propagatedBuildInputs = [URI];
     doCheck = false;
+    meta = {
+      license = "perl";
+    };
   };
 
   I18NLangTags = buildPerlPackage {
@@ -2026,15 +2627,19 @@ rec {
     };
   };
 
-  IOCompress = buildPerlPackage rec {
-    name = "IO-Compress-2.037";
+  IOCompress = buildPerlPackage {
+    name = "IO-Compress-2.060";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/IO/${name}.tar.gz";
-      sha256 = "07hs3afzg9ry6ir2f9rf3fg8b129cihs989mr0nh9wdvxgxqmr1q";
+      url = mirror://cpan/authors/id/P/PM/PMQS/IO-Compress-2.060.tar.gz;
+      sha256 = "03zaq9xzg0z9wcgj1hws8zhzdgdlwiz48nh6sy663bn7rzxm5k28";
     };
     propagatedBuildInputs = [ CompressRawBzip2 CompressRawZlib ];
-    # Work around a self-referencing Makefile variable.
-    makeFlags = "INSTALLARCHLIB=$(INSTALLSITEARCH)";
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "IO Interface to compressed data files/buffers";
+      license = "perl5";
+    };
+    doCheck = !stdenv.isDarwin;
   };
 
   IODigest = buildPerlPackage {
@@ -2046,6 +2651,19 @@ rec {
     propagatedBuildInputs = [PerlIOviadynamic];
   };
 
+  IOHTML = buildPerlPackage {
+    name = "IO-HTML-0.04";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/C/CJ/CJM/IO-HTML-0.04.tar.gz;
+      sha256 = "0c4hc76c1gypdwfasnibr2qlf9x3bnhyw357lhqlrczbm6vn8hw5";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Open an HTML file with automatic charset detection";
+      license = "perl5";
+    };
+  };
+
   IOLockedFile = buildPerlPackage rec {
     name = "IO-LockedFile-0.23";
     src = fetchurl {
@@ -2073,12 +2691,16 @@ rec {
   };
 
   IOSocketSSL = buildPerlPackage rec {
-    name = "IO-Socket-SSL-1.44";
+    name = "IO-Socket-SSL-1.81";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/IO/${name}.tar.gz";
-      sha256 = "1xbgx1ij34a3dlwv94zjh3a02cj2lyhwzxcmv59harl784xn1mlg";
+      sha256 = "1vg7jpn7vz3a2j3fxjjkaxiiqg7azqmy7afrpghiqkjcr8b6zs9y";
     };
     propagatedBuildInputs = [ URI NetSSLeay ];
+    meta = {
+      description = "Nearly transparent SSL encapsulation for IO::Socket::INET";
+      license = "perl";
+    };
   };
 
   IOString = buildPerlPackage rec {
@@ -2105,13 +2727,18 @@ rec {
     };
   };
 
-  IPCRun = buildPerlPackage rec {
-    name = "IPC-Run-0.82";
+  IPCRun = buildPerlPackage {
+    name = "IPC-Run-0.92";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-      sha256 = "1v5yfavvhxscqkdl68xs7i7vcp9drl3y1iawppzwqcl1fprd58ip";
+      url = mirror://cpan/authors/id/T/TO/TODDR/IPC-Run-0.92.tar.gz;
+      sha256 = "1lj6kmr8rs6na77b3v673vvw6qsr511bmhgf257x4xqmvxnv91p1";
     };
     doCheck = false; /* attempts a network connection to localhost */
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "System() and background procs w/ piping, redirs, ptys (Unix, Win32)";
+      license = "perl5";
+    };
   };
 
   IPCRun3 = buildPerlPackage rec {
@@ -2131,35 +2758,35 @@ rec {
   };
 
   ImageExifTool = buildPerlPackage rec {
-      name = "Image-ExifTool-8.41";
+    name = "Image-ExifTool-8.41";
 
-      src = fetchurl {
-        url = "http://www.sno.phy.queensu.ca/~phil/exiftool/${name}.tar.gz";
-        sha256 = "1fdjic0bhbai8zzl3287i9wcs88khiv8qx5slx9n3gzvbnxacvqg";
-      };
+    src = fetchurl {
+      url = "http://www.sno.phy.queensu.ca/~phil/exiftool/${name}.tar.gz";
+      sha256 = "1fdjic0bhbai8zzl3287i9wcs88khiv8qx5slx9n3gzvbnxacvqg";
+    };
 
-      meta = {
-        description = "ExifTool, a tool to read, write and edit EXIF meta information";
-        homepage = http://www.sno.phy.queensu.ca/~phil/exiftool/;
+    meta = {
+      description = "ExifTool, a tool to read, write and edit EXIF meta information";
+      homepage = http://www.sno.phy.queensu.ca/~phil/exiftool/;
 
-        longDescription = ''
-          ExifTool is a platform-independent Perl library plus a command-line
-          application for reading, writing and editing meta information in
-          image, audio and video files.  ExifTool supports many different types
-          of metadata including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC
-          Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker
-          notes of many digital cameras by Canon, Casio, FujiFilm, HP,
-          JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon,
-          Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo,
-          Sigma/Foveon and Sony.
-        '';
+      longDescription = ''
+        ExifTool is a platform-independent Perl library plus a command-line
+        application for reading, writing and editing meta information in
+        image, audio and video files.  ExifTool supports many different types
+        of metadata including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC
+        Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker
+        notes of many digital cameras by Canon, Casio, FujiFilm, HP,
+        JVC/Victor, Kodak, Leaf, Minolta/Konica-Minolta, Nikon,
+        Olympus/Epson, Panasonic/Leica, Pentax/Asahi, Ricoh, Sanyo,
+        Sigma/Foveon and Sony.
+      '';
 
-        licenses = [ "GPLv1+" /* or */ "Artistic" ];
+      licenses = [ "GPLv1+" /* or */ "Artistic" ];
 
-        maintainers = [ stdenv.lib.maintainers.ludo ];
-	platforms = stdenv.lib.platforms.unix;
-      };
+      maintainers = [ stdenv.lib.maintainers.ludo ];
+      platforms = stdenv.lib.platforms.unix;
     };
+  };
 
   Inline = buildPerlPackage rec {
     name = "Inline-0.45";
@@ -2219,39 +2846,61 @@ rec {
     };
   };
 
-  JSON = buildPerlPackage rec {
+  IPCSignal = buildPerlPackage rec {
+    name = "IPC-Signal-1.00";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/R/RO/ROSCH/${name}.tar.gz";
+      sha256 = "1l3g0zrcwf2whwjhbpwdcridb7c77mydwxvfykqg1h6hqb4gj8bw";
+    };
+  };
+
+  JSON = buildPerlPackage {
     name = "JSON-2.53";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MA/MAKAMAKA/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MA/MAKAMAKA/JSON-2.53.tar.gz;
       sha256 = "0rfms17d0pkai26kqyzaylbr5wxcrrhyjkyshq85l41xb0g1iplh";
     };
-    propagatedBuildInputs = [JSONXS];
+    meta = {
+      description = "JSON (JavaScript Object Notation) encoder/decoder";
+      license = "perl";
+    };
   };
 
-  JSONAny = buildPerlPackage rec {
-    name = "JSON-Any-1.19";
+  JSONAny = buildPerlPackage {
+    name = "JSON-Any-1.29";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/P/PE/PERIGRIN/${name}.tar.gz";
-      sha256 = "16h2p2qcbh0a6wfr5lfspilmjmpdnkn1rrkqw34v8xq1a77fl870";
+      url = mirror://cpan/authors/id/P/PE/PERIGRIN/JSON-Any-1.29.tar.gz;
+      sha256 = "15v2j9dh58r7r4s7rnnmgnzzbyz61bhyxwpx1z7r811ixs9bkks2";
+    };
+    propagatedBuildInputs = [ JSON ];
+    meta = {
+      description = "Wrapper Class for the various JSON classes";
+      license = "perl";
     };
-    propagatedBuildInputs = [JSON];
   };
 
   JSONPP = buildPerlPackage rec {
     name = "JSON-PP-2.27200";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/JSON/${name}.tar.gz";
+      url = mirror://cpan/authors/id/M/MA/MAKAMAKA/JSON-PP-2.27200.tar.gz;
       sha256 = "1lv9riws9f72gya2fsp5jvbd1fbzyi8423x38a491ryy9cai2ph3";
     };
+    meta = {
+      description = "JSON::XS compatible pure-Perl module";
+      license = "perl";
+    };
   };
 
-  JSONXS = buildPerlPackage rec {
-    name = "JSON-XS-2.32";
+  JSONXS = buildPerlPackage {
+    name = "JSON-XS-2.33";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/ML/MLEHMANN/${name}.tar.gz";
-      sha256 = "012bf324pf5lnrf6ck2y167i1q1zzzc0w43b381qfnk7v5fcvaik";
+      url = mirror://cpan/authors/id/M/ML/MLEHMANN/JSON-XS-2.33.tar.gz;
+      sha256 = "0p68f85xz6xx2c9ydz4bij5x4d1747rxs3jdq53ab915mnc1qfdl";
+    };
+    propagatedBuildInputs = [ CommonSense ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
     };
-    buildInputs = [CommonSense];
   };
 
   libxml_perl = buildPerlPackage rec {
@@ -2263,11 +2912,14 @@ rec {
     propagatedBuildInputs = [XMLParser];
   };
 
-  LinguaENInflect = buildPerlPackage rec {
-    name = "Lingua-EN-Inflect-1.893";
+  LinguaENInflect = buildPerlPackage {
+    name = "Lingua-EN-Inflect-1.895";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Lingua/${name}.tar.gz";
-      sha256 = "1j0jxf3pqnsshakmpdwkgcmlz26hzmkrhg33kz52qzdfys254xmy";
+      url = mirror://cpan/authors/id/D/DC/DCONWAY/Lingua-EN-Inflect-1.895.tar.gz;
+      sha256 = "0drzg9a2dkjxgf00n6jg0jzhd8972bh3j4wdnmdxpqi3zmfqhwcy";
+    };
+    meta = {
+      description = "Convert singular to plural";
     };
   };
 
@@ -2291,13 +2943,17 @@ rec {
       [ LinguaENInflect LinguaENInflectNumber LinguaENTagger ];
   };
 
-  LinguaENTagger = buildPerlPackage rec {
-    name = "Lingua-EN-Tagger-0.16";
+  LinguaENTagger = buildPerlPackage {
+    name = "Lingua-EN-Tagger-0.23";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Lingua/${name}.tar.gz";
-      sha256 = "0nzjgpxd0i5a3sacxsqfvvrfyamxlmzfa9y14r4vs7sc8qm20xd2";
+      url = mirror://cpan/authors/id/A/AC/ACOBURN/Lingua-EN-Tagger-0.23.tar.gz;
+      sha256 = "0xq6567gijczxzq72ghfa9jr8zyc1p0ax9s12mv7slibpkfkm2d2";
+    };
+    propagatedBuildInputs = [ HTMLParser HTMLTagset LinguaStem /* MemoizeExpireLRU */ ];
+    meta = {
+      description = "Part-of-speech tagger for English natural language processing";
+      license = "gpl_3";
     };
-    propagatedBuildInputs = [ HTMLParser LinguaStem ];
   };
 
   LinguaStem = buildPerlPackage rec {
@@ -2318,12 +2974,16 @@ rec {
     propagatedBuildInputs = [ CommonSense ];
   };
 
-  ListMoreUtils = buildPerlPackage rec {
+  ListMoreUtils = buildPerlPackage {
     name = "List-MoreUtils-0.33";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/List-MoreUtils-0.33.tar.gz;
       sha256 = "1bcljhhsk5g0xykvgbxz10ilmj02s58ydiy3g8hbzdr29i20np1i";
     };
+    meta = {
+      description = "Provide the stuff missing in List::Util";
+      license = "perl";
+    };
   };
 
   LocaleGettext = buildPerlPackage {
@@ -2376,34 +3036,66 @@ rec {
     };
   };
 
-  LWP = buildPerlPackage rec {
-    name = "libwww-perl-6.03";
+  Log4Perl = buildPerlPackage rec {
+    name = "Log-Log4perl-1.41";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Log/${name}.tar.gz";
+      sha256 = "0dajkgvlwsb4zdw6x3fil2n5phypq829dmqf8l9s88g9smms2a2i";
+    };
+  };
+
+  LWP = buildPerlPackage {
+    name = "libwww-perl-6.05";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/LWP/${name}.tar.gz";
-      sha256 = "1zlnz4ylk1y0rw56vlf9knawwjx72b1gm09yp06ccpgmmndif4dg";
+      url = mirror://cpan/authors/id/G/GA/GAAS/libwww-perl-6.05.tar.gz;
+      sha256 = "08wgwyz7748pv5cyngxia0xl6nragfnhrp4p9s78xhgfyygpj9bv";
     };
-    propagatedBuildInputs =
-      [ EncodeLocale FileListing HTMLParser HTTPCookies HTTPMessage LWPMediaTypes URI NetHTTP ];
+    propagatedBuildInputs = [ EncodeLocale FileListing HTMLParser HTTPCookies HTTPDaemon HTTPDate HTTPNegotiate HTTPMessage LWPMediaTypes NetHTTP URI WWWRobotRules ];
     doCheck = false; # tries to start a daemon
+    meta = {
+      description = "The World-Wide Web library for Perl";
+      license = "perl";
+    };
   };
 
-  LWPMediaTypes = buildPerlPackage rec {
-    name = "LWP-MediaTypes-6.01";
+  LWPMediaTypes = buildPerlPackage {
+    name = "LWP-MediaTypes-6.02";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/LWP/${name}.tar.gz";
-      sha256 = "1fhxql3xnhrlyzkjyss4swvhyh0r58cv2kwjcpj3mdbbg54ah9fz";
+      url = mirror://cpan/authors/id/G/GA/GAAS/LWP-MediaTypes-6.02.tar.gz;
+      sha256 = "0xmnblp962qy02akah30sji8bxrqcyqlff2w95l199ghql60ny8q";
+    };
+    meta = {
+      description = "Guess media type for a file or a URL";
+      license = "perl";
     };
   };
 
   LWPProtocolHttps = buildPerlPackage rec {
-    name = "LWP-Protocol-https-6.02";
+    name = "LWP-Protocol-https-6.04";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/LWP/${name}.tar.gz";
-      sha256 = "0y2an4v7g4jm8fsszk2489m179i28kx79ywwiywkwk1aw3yqh0y5";
+      url = mirror://cpan/authors/id/G/GA/GAAS/LWP-Protocol-https-6.04.tar.gz;
+      sha256 = "0agnga5dg94222h6rlzqxa0dri2sh3gayncvfb7jad9nxr87gxhy";
     };
     patches = [ ../development/perl-modules/lwp-protocol-https-cert-file.patch ];
     propagatedBuildInputs = [ LWP IOSocketSSL ];
     doCheck = false; # tries to connect to https://www.apache.org/.
+    meta = {
+      description = "Provide https support for LWP::UserAgent";
+      license = "perl5";
+    };
+  };
+
+  LWPUserAgent = buildPerlPackage {
+    name = "LWP-UserAgent-6.04";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/G/GA/GAAS/libwww-perl-6.04.tar.gz;
+      sha256 = "0z92fpwk6lh2gghv050r0qb216jmjl2m0c6zby935q8lv0q5wwgr";
+    };
+    propagatedBuildInputs = [ EncodeLocale FileListing HTMLParser HTTPCookies HTTPDaemon HTTPDate HTTPNegotiate HTTPMessage LWPMediaTypes NetHTTP URI WWWRobotRules ];
+    meta = {
+      description = "The World-Wide Web library for Perl";
+      license = "perl";
+    };
   };
 
   LWPxParanoidAgent = buildPerlPackage rec {
@@ -2448,6 +3140,49 @@ rec {
     propagatedBuildInputs = [TimeDate TestPod];
   };
 
+  MathLibm = buildPerlPackage rec {
+    name = "Math-Libm-1.00";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
+      sha256 = "0xn2a950mzzs5q1c4q98ckysn9dz20x7r35g02zvk35chgr0klxz";
+    };
+  };
+
+  MathClipper = buildPerlModule rec {
+    name = "Math-Clipper-1.19";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
+      sha256 = "1hrdand4i937bgsr3f3yma5ckkdwkprdwmkyyl37v1vqcjdrjr7j";
+    };
+    propagatedBuildInputs = [ ModuleBuildWithXSpp ExtUtilsXSpp ExtUtilsTypemapsDefault TestDeep ];
+  };
+
+  MathConvexHullMonotoneChain = buildPerlPackage rec {
+    name = "Math-ConvexHull-MonotoneChain-0.01";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
+      sha256 = "1xcl7cz62ydddji9qzs4xsfxss484jqjlj4iixa4aci611cw92r8";
+    };
+  };
+
+  MathGeometryVoronoi = buildPerlPackage rec {
+    name = "Math-Geometry-Voronoi-1.3";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
+      sha256 = "0b206k2q5cznld45cjhgm0as0clc9hk135ds8qafbkl3k175w1vj";
+    };
+    propagatedBuildInputs = [ ClassAccessor ParamsValidate ];
+  };
+
+  MathPlanePath = buildPerlPackage rec {
+    name = "Math-PlanePath-101";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/Math/${name}.tar.gz";
+      sha256 = "0g24zhgyxs56zv966xb487vvmhqqxvvsbbz4mck8n4l31rabk8jj";
+    };
+    propagatedBuildInputs = [ MathLibm constant-defer ];
+  };
+
   MathRound = buildPerlPackage rec {
     name = "Math-Round-0.06";
     src = fetchurl {
@@ -2464,32 +3199,87 @@ rec {
     };
   };
 
-  MIMETypes = buildPerlPackage rec {
-    name = "MIME-Types-1.27";
+  mimeConstruct = buildPerlPackage rec {
+    name = "mime-construct-1.11";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MA/MARKOV/${name}.tar.gz";
-      sha256 = "1zhzyb85zbil2jwrh74rg3bnm9wl74fcg2s64y8b57bk04fdfb7l";
+      url = "mirror://cpan/authors/id/R/RO/ROSCH/${name}.tar.gz";
+      sha256 = "00wk9950i9q6qwp1vdq9xdddgk54lqd0bhcq2hnijh8xnmhvpmsc";
     };
-    propagatedBuildInputs = [TestPod];
+    buildInputs = [ ProcWaitStat ];
   };
 
-  ModuleBuild = buildPerlPackage rec {
-    name = "Module-Build-0.3800";
+  MIMETypes = buildPerlPackage {
+    name = "MIME-Types-1.38";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Module/${name}.tar.gz";
-      sha256 = "1gk0xn5s48f0n3a6k4izw6sigsk84rk06hky7dd48hdmvrq23f4v";
+      url = mirror://cpan/authors/id/M/MA/MARKOV/MIME-Types-1.38.tar.gz;
+      sha256 = "12m8cvj80qbwxckj5jildl5zw6p1jincj3m1s77z6lnw3h59rj4l";
+    };
+    meta = {
+      description = "Definition of MIME types";
+      license = "perl5";
     };
-    propagatedBuildInputs =
-      [ ExtUtilsInstall ExtUtilsManifest ExtUtilsCBuilder ExtUtilsParseXS
-        CPANMeta PerlOSType ModuleMetadata
-      ];
+  };
+
+  ModuleBuild = buildPerlPackage {
+    name = "Module-Build-0.4003";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/L/LE/LEONT/Module-Build-0.4003.tar.gz;
+      sha256 = "1izx26gfnjffnj0j601hkc008b31y9f25hms1nzidfkb6r3110s2";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Build and install Perl modules";
+      license = "perl5";
+    };
+  };
+
+  ModuleBuildWithXSpp = buildPerlModule rec {
+    name = "Module-Build-WithXSpp-0.13";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/S/SM/SMUELLER/${name}.tar.gz";
+      sha256 = "05c5dssgl7ykj64nkzy4nwfrs0hd1lvfidhflrs3f1c7hc0z9g46";
+    };
+    propagatedBuildInputs = [ ExtUtilsXSpp ExtUtilsCppGuess ];
   };
 
   ModuleFind = buildPerlPackage {
-    name = "Module-Find-0.06";
+    name = "Module-Find-0.11";
     src = fetchurl {
-      url = mirror://cpan/authors/id/C/CR/CRENZ/Module-Find-0.06.tar.gz;
-      sha256 = "1394jk0rn2zmchpl11kim69xh5h5yzg96jdlf76fqrk3dcn0y2ip";
+      url = mirror://cpan/authors/id/C/CR/CRENZ/Module-Find-0.11.tar.gz;
+      sha256 = "15ykcwplbqh5hc0fw4cx6g0f22zr0hrfkdkv1s34n9yg574dq3b5";
+    };
+    meta = {
+      description = "Find and use installed modules in a (sub)category";
+      license = "perl";
+    };
+  };
+
+  ModuleImplementation = buildPerlPackage {
+    name = "Module-Implementation-0.06";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Module-Implementation-0.06.tar.gz;
+      sha256 = "0v8qajzkpkwb9mfj2p46j352bwiszkg1zk778b008axqb817hfys";
+    };
+    buildInputs = [ TestFatal TestRequires ];
+    propagatedBuildInputs = [ ModuleRuntime TryTiny ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Loads one of several alternate underlying implementations for a module";
+      license = "artistic_2";
+    };
+  };
+
+  ModuleInstall = buildPerlPackage {
+    name = "Module-Install-1.06";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AD/ADAMK/Module-Install-1.06.tar.gz;
+      sha256 = "06a5375q1cr21rzcr07z3n8w6hv611a9p199jrnpsj9vbcwwi7ny";
+    };
+    buildInputs = [ YAMLTiny ];
+    propagatedBuildInputs = [ FileRemove LWPUserAgent ModuleScanDeps PARDist YAMLTiny ];
+    meta = {
+      description = "Standalone, extensible Perl module installer";
+      license = "perl";
     };
   };
 
@@ -2502,16 +3292,20 @@ rec {
     propagatedBuildInputs = [ version ];
   };
 
-  ModulePluggable = buildPerlPackage rec {
-    name = "Module-Pluggable-3.9";
+  ModulePluggable = buildPerlPackage {
+    name = "Module-Pluggable-4.8";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/S/SI/SIMONW/${name}.tar.gz";
-      sha256 = "0psryh1dz828zly92db9zcv905n82in2awixzqngqhzg4y7fg4wc";
+      url = mirror://cpan/authors/id/S/SI/SIMONW/Module-Pluggable-4.8.tar.gz;
+      sha256 = "0gc2sanga3207l3dnmb05isc7m87l1j94v9ll3z4sbb3vs49gdd2";
     };
     patches = [
       # !!! merge this patch into Perl itself (which contains Module::Pluggable as well)
       ../development/perl-modules/module-pluggable.patch
     ];
+    meta = {
+      description = "Automatically give your module the ability to have plugins";
+      license = "perl5";
+    };
   };
 
   ModulePluggableFast = buildPerlPackage {
@@ -2523,28 +3317,58 @@ rec {
     propagatedBuildInputs = [UNIVERSALrequire];
   };
 
-  ModuleRuntime = buildPerlPackage rec {
-    name = "Module-Runtime-0.011";
+  ModuleRuntime = buildPerlPackage {
+    name = "Module-Runtime-0.013";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Module/${name}.tar.gz";
-      sha256 = "0hbpn2jd11gsni77aw189ss4q83jlcvcxr49x9j28bh36hjgif7s";
+      url = mirror://cpan/authors/id/Z/ZE/ZEFRAM/Module-Runtime-0.013.tar.gz;
+      sha256 = "08qhqg1qshrispcpzf24jbbpx2gh5ks84amnv9wmd46wj0yy0dzc";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Runtime module handling";
+      license = "perl5";
     };
-    propagatedBuildInputs = [ ParamsClassify ];
   };
 
-  Moose = buildPerlPackage rec {
-    name = "Moose-2.0401";
+  ModuleScanDeps = buildPerlPackage {
+    name = "Module-ScanDeps-1.10";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
-      sha256 = "07mx4xqfl0bk21kk49gs86ba3wcviarfx9yhxxw96pmaxd0l932i";
+      url = mirror://cpan/authors/id/R/RS/RSCHUPP/Module-ScanDeps-1.10.tar.gz;
+      sha256 = "0z85zqvqpj2ck80sw91hmzn94q8m3s40anybw324xh3pcrm9cg5s";
+    };
+    meta = {
+      description = "Recursively scan Perl code for dependencies";
+      license = "perl";
+    };
+  };
+
+  Moo = buildPerlPackage {
+    name = "Moo-1.000007";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MS/MSTROUT/Moo-1.000007.tar.gz;
+      sha256 = "02q5j5vsfv8ykzmkqk8zac88svard4g6rl455slgz8y2w3xn41ql";
+    };
+    buildInputs = [ TestFatal ];
+    propagatedBuildInputs = [ ClassMethodModifiers DevelGlobalDestruction ModuleRuntime RoleTiny strictures ];
+    meta = {
+      description = "Minimalist Object Orientation (with Moose compatiblity)";
+      license = "perl5";
+    };
+  };
+
+  Moose = buildPerlPackage {
+    name = "Moose-2.0604";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DO/DOY/Moose-2.0604.tar.gz;
+      sha256 = "0nwvklb8dwf8lskwxik3gi9gsqzrix2jhc56zvfzlf1q5q1s07qj";
+    };
+    buildInputs = [ DistCheckConflicts TestFatal TestRequires ];
+    propagatedBuildInputs = [ ClassLoad ClassLoadXS DataOptList DevelGlobalDestruction DistCheckConflicts EvalClosure ListMoreUtils MROCompat PackageDeprecationManager PackageStash PackageStashXS ParamsUtil SubExporter SubName TaskWeaken TryTiny ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "A postmodern object system for Perl 5";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal TestRequires ];
-    propagatedBuildInputs =
-      [ DataOptList DevelGlobalDestruction DistCheckConflicts EvalClosure
-        ListMoreUtils MROCompat PackageDeprecationManager PackageStash
-        PackageStashXS ParamsUtil SubExporter SubName TaskWeaken TryTiny
-        ClassLoad ClassLoadXS
-      ];
   };
 
   MooseAutobox = buildPerlPackage rec {
@@ -2566,7 +3390,7 @@ rec {
     propagatedBuildInputs = [ Moose ];
   };
 
-  MooseXAttributeChained = buildModule rec {
+  MooseXAttributeChained = buildPerlModule rec {
     name = "MooseX-Attribute-Chained-1.0.1";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
@@ -2575,82 +3399,145 @@ rec {
     propagatedBuildInputs = [ Moose TryTiny ];
   };
 
-  MooseXEmulateClassAccessorFast = buildPerlPackage rec {
+  MooseXDaemonize = buildPerlPackage {
+    name = "MooseX-Daemonize-0.15";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MI/MICHAELR/MooseX-Daemonize-0.15.tar.gz;
+      sha256 = "1h6rzdmk68q4p0nh2bzmwwvr5iaf7pvdfrpwdxmr3z5pc64wajvd";
+    };
+    buildInputs = [ TestMoose ];
+    propagatedBuildInputs = [ Moose MooseXGetopt MooseXTypesPathClass ];
+    meta = {
+      description = "Role for daemonizing your Moose based application";
+      license = "perl";
+    };
+  };
+
+  MooseXEmulateClassAccessorFast = buildPerlPackage {
     name = "MooseX-Emulate-Class-Accessor-Fast-0.00903";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
+      url = mirror://cpan/authors/id/F/FL/FLORA/MooseX-Emulate-Class-Accessor-Fast-0.00903.tar.gz;
       sha256 = "1lkn1h4sxr1483jicsgsgzclbfw63g2i2c3m4v4j9ar75yrb0kh8";
     };
     buildInputs = [ TestException ];
-    propagatedBuildInputs = [ Moose NamespaceClean ];
+    propagatedBuildInputs = [ Moose namespaceclean ];
+    meta = {
+      description = "Emulate Class::Accessor::Fast behavior using Moose attributes";
+      license = "perl";
+    };
   };
 
-  MooseXGetopt = buildPerlPackage rec {
-    name = "MooseX-Getopt-0.37";
+  MooseXGetopt = buildPerlPackage {
+    name = "MooseX-Getopt-0.50";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
-      sha256 = "161j44v2b4qzv75lk35gvfvs864vcyhkzq6phmhh8zllg3cnfc8k";
+      url = mirror://cpan/authors/id/E/ET/ETHER/MooseX-Getopt-0.50.tar.gz;
+      sha256 = "0fwm5vb8z8q4b6fmf7gz4xzw5z713mmfnxzjph6vfyyymlr5bll9";
+    };
+    buildInputs = [ PathClass TestCheckDeps TestFatal TestMoose TestNoWarnings TestRequires TestTrap TestWarn ];
+    propagatedBuildInputs = [ GetoptLongDescriptive Moose MooseXRoleParameterized ];
+    meta = {
+      homepage = http://metacpan.org/release/MooseX-Getopt;
+      description = "A Moose role for processing command line options";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal TestRequires TestWarn ];
-    propagatedBuildInputs = [ Moose GetoptLongDescriptive MooseXRoleParameterized ];
   };
 
-  MooseXMethodAttributes = buildPerlPackage rec {
-    name = "MooseX-MethodAttributes-0.25";
+  MooseXMarkAsMethods = buildPerlPackage {
+    name = "MooseX-MarkAsMethods-0.15";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
-      sha256 = "0rkk0rija7s96747y46qz49g88kymgxvn70mr21id9i8n7cdacww";
+      url = mirror://cpan/authors/id/R/RS/RSRCHBOY/MooseX-MarkAsMethods-0.15.tar.gz;
+      sha256 = "1y3yxwcjjajm66pvca54cv9fax7a6dy36xqr92x7vzyhfqrw3v69";
+    };
+    buildInputs = [ TestMoose ];
+    propagatedBuildInputs = [ BHooksEndOfScope Moose namespaceautoclean ];
+    meta = {
+      homepage = http://metacpan.org/release/MooseX-MarkAsMethods/;
+      description = "Mark overload code symbols as methods";
+      license = "lgpl_2_1";
     };
-    buildInputs = [ TestException ];
-    propagatedBuildInputs = [ Moose MooseXTypes NamespaceAutoclean NamespaceClean ];
   };
 
-  MooseXNonMoose = buildPerlPackage rec {
+  MooseXMethodAttributes = buildPerlPackage {
+    name = "MooseX-MethodAttributes-0.28";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/E/ET/ETHER/MooseX-MethodAttributes-0.28.tar.gz;
+      sha256 = "0srk85z6py9brw1jfvacd76y6219wycq3dj0wackbkmmbq04ln0g";
+    };
+    buildInputs = [ namespaceautoclean TestCheckDeps TestException ];
+    propagatedBuildInputs = [ Moose MooseXTypes namespaceautoclean ];
+    meta = {
+      homepage = https://github.com/karenetheridge/moosex-methodattributes;
+      description = "Code attribute introspection";
+      license = "perl5";
+    };
+  };
+
+  MooseXNonMoose = buildPerlPackage {
     name = "MooseX-NonMoose-0.22";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
+      url = mirror://cpan/authors/id/D/DO/DOY/MooseX-NonMoose-0.22.tar.gz;
       sha256 = "0mhyabg5f6kngkm1w7hfglkdzjdn5pbgm7vgia0aqy9mwwclbpdp";
     };
     buildInputs = [ TestFatal ];
     propagatedBuildInputs = [ ListMoreUtils Moose ];
+    meta = {
+      description = "Easy subclassing of non-Moose classes";
+      license = "perl5";
+    };
   };
 
-  MooseXSetOnce = buildPerlPackage rec {
-    name = "MooseX-SetOnce-0.200001";
+  MooseXRelatedClassRoles = buildPerlPackage rec {
+    name = "MooseX-RelatedClassRoles-0.004";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
-      sha256 = "0qa2i45g2zn4r0wg7hba9va68nin5l63gr9l8b5q3hr4cjn97ll6";
+      sha256 = "17vynkf6m5d039qkr4in1c9lflr8hnwp1fgzdwhj4q6jglipmnrh";
     };
-    buildInputs = [ TestFatal ];
-    propagatedBuildInputs = [ Moose ];
+    buildInputs = [ ];
+    propagatedBuildInputs = [ MooseXRoleParameterized ];
   };
 
-  MooseXParamsValidate = buildPerlPackage rec {
-    name = "MooseX-Params-Validate-0.10";
+  MooseXParamsValidate = buildPerlPackage {
+    name = "MooseX-Params-Validate-0.18";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
-      sha256 = "16mjxa72gn41pvrk0fgyi98iw6yc7qafnbzr6v2xfiabp9wf5j5m";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/MooseX-Params-Validate-0.18.tar.gz;
+      sha256 = "02yim0lmr7p2nzswy97d5ylbs4ksmgklqq350p119i2611x7ai0k";
+    };
+    buildInputs = [ Moose TestFatal ];
+    propagatedBuildInputs = [ DevelCaller Moose ParamsValidate SubExporter ];
+    meta = {
+      description = "An extension of Params::Validate using Moose's types";
+      license = "perl5";
     };
-    propagatedBuildInputs = [Moose ParamsValidate SubExporter TestException];
   };
 
-  MooseXRoleParameterized = buildPerlPackage rec {
-    name = "MooseX-Role-Parameterized-0.26";
+  MooseXRoleParameterized = buildPerlPackage {
+    name = "MooseX-Role-Parameterized-1.00";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
-      sha256 = "1wfqdkjhwzbzk2cm65r5gz9n6406j8mdq78iga7dnj3mp2csn631";
+      url = mirror://cpan/authors/id/S/SA/SARTAK/MooseX-Role-Parameterized-1.00.tar.gz;
+      sha256 = "0642h71j90i0jrqxz1snizkw9pch8v1s1w0zndrcl5bb85lx3z7y";
     };
-    buildInputs = [ TestFatal TestMore ];
+    buildInputs = [ TestFatal TestMoose ];
     propagatedBuildInputs = [ Moose ];
+    meta = {
+      homepage = http://github.com/sartak/MooseX-Role-Parameterized/tree;
+      description = "Roles with composition parameters";
+      license = "perl";
+    };
   };
 
-  MooseXRoleWithOverloading = buildPerlPackage rec {
-    name = "MooseX-Role-WithOverloading-0.09";
+  MooseXRoleWithOverloading = buildPerlPackage {
+    name = "MooseX-Role-WithOverloading-0.13";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
-      sha256 = "0qs013vkm0ysykd3hibk4m8bkl0rnysxzralwq19zrvxaqk2krn8";
+      url = mirror://cpan/authors/id/E/ET/ETHER/MooseX-Role-WithOverloading-0.13.tar.gz;
+      sha256 = "01mqpvbz7yw993918hgp72vl22i6mgicpq5b3zrrsp6vl8sqj2sw";
+    };
+    buildInputs = [ TestCheckDeps TestNoWarnings ];
+    propagatedBuildInputs = [ aliased Moose namespaceautoclean namespaceclean ];
+    meta = {
+      homepage = http://metacpan.org/release/MooseX-Role-WithOverloading;
+      description = "Roles which support overloading";
+      license = "perl5";
     };
-    propagatedBuildInputs = [ Moose MooseXTypes NamespaceAutoclean aliased ];
   };
 
   MooseXSemiAffordanceAccessor = buildPerlPackage rec {
@@ -2662,6 +3549,16 @@ rec {
     propagatedBuildInputs = [ Moose ];
   };
 
+  MooseXSetOnce = buildPerlPackage rec {
+    name = "MooseX-SetOnce-0.200001";
+    src = fetchurl {
+      url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
+      sha256 = "0qa2i45g2zn4r0wg7hba9va68nin5l63gr9l8b5q3hr4cjn97ll6";
+    };
+    buildInputs = [ TestFatal ];
+    propagatedBuildInputs = [ Moose ];
+  };
+
   MooseXTraits = buildPerlPackage rec {
     name = "MooseX-Traits-0.11";
     src = fetchurl {
@@ -2669,7 +3566,7 @@ rec {
       sha256 = "0sqmpf2kw25847fwrrwpcfhrq694bgs8jbix7qxp9qyjm769np6n";
     };
     buildInputs = [ TestException TestUseOk ];
-    propagatedBuildInputs = [ ClassMOP Moose NamespaceAutoclean ];
+    propagatedBuildInputs = [ ClassMOP Moose namespaceautoclean ];
   };
 
   MooseXTraitsPluggable = buildPerlPackage rec {
@@ -2680,18 +3577,22 @@ rec {
     };
     buildInputs =[ TestException ];
     propagatedBuildInputs =
-      [ ClassMOP Moose NamespaceAutoclean ListMoreUtils ];
+      [ ClassMOP Moose namespaceautoclean ListMoreUtils ];
   };
 
-  MooseXTypes = buildPerlPackage rec {
-    name = "MooseX-Types-0.30";
+  MooseXTypes = buildPerlPackage {
+    name = "MooseX-Types-0.35";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
-      sha256 = "1c9z30fbk2h11xkgq8v2idnpaqay3m7ig9bb8scnawgrm49v2f4l";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/MooseX-Types-0.35.tar.gz;
+      sha256 = "11namg9pjw328ybvj70cgn15aac093jwdm4jv0b173gb7vkflx8a";
+    };
+    buildInputs = [ TestFatal TestMoose TestRequires ];
+    propagatedBuildInputs = [ CarpClan Moose namespaceclean SubInstall SubName ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Organise your Moose types in libraries";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal TestRequires ];
-    propagatedBuildInputs =
-      [ Moose CarpClan NamespaceClean SubInstall SubName ];
   };
 
   MooseXTypesCommon = buildPerlPackage rec {
@@ -2710,7 +3611,20 @@ rec {
       url = "mirror://cpan/modules/by-module/MooseX/${name}.tar.gz";
       sha256 = "035d2gzq1j60skn39jav2jr6sbx1hq9vqmmfjfc3cvhahfzrygs4";
     };
-    propagatedBuildInputs = [ ClassLoad Moose MooseXTypes NamespaceClean ];
+    propagatedBuildInputs = [ ClassLoad Moose MooseXTypes namespaceclean ];
+  };
+
+  MooseXTypesPathClass = buildPerlPackage {
+    name = "MooseX-Types-Path-Class-0.06";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/T/TH/THEPLER/MooseX-Types-Path-Class-0.06.tar.gz;
+      sha256 = "02lw86r6pp6saiwc7ns890mlwq93vhkqyri3cipsfwhnhcap847g";
+    };
+    propagatedBuildInputs = [ ClassMOP Moose MooseXTypes PathClass ];
+    meta = {
+      description = "A Path::Class type library for Moose";
+      license = "perl";
+    };
   };
 
   Mouse = buildPerlPackage rec {
@@ -2723,30 +3637,69 @@ rec {
     doCheck = false; # check can't find its own Mouse::Tiny module
   };
 
-  MROCompat = buildPerlPackage rec {
-    name = "MRO-Compat-0.11";
+  MROCompat = buildPerlPackage {
+    name = "MRO-Compat-0.12";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
-      sha256 = "0p2hl0cygcds3jjq3awackd72j3vzidfyjacj7gxdlqh65a2fjq7";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/MRO-Compat-0.12.tar.gz;
+      sha256 = "1mhma2g83ih9f8nkmg2k9l0x6izhhbb6k5lli4rpllxad4wbk9dv";
+    };
+    meta = {
+      description = "Mro::* interface compatibility for Perls < 5.9.5";
+      license = "perl";
     };
   };
 
-  NamespaceAutoclean = buildPerlPackage rec {
-    name = "namespace-autoclean-0.12";
+  MusicBrainzDiscID = buildPerlModule rec {
+    name = "MusicBrainz-DiscID-0.03";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/B/BO/BOBTFISH/${name}.tar.gz";
-      sha256 = "125g5ny4sqf9kj1sxaqh1jipzyii56p9nsp45jg9fg67i4ljm9pg";
+      url = "mirror://cpan/authors/id/N/NJ/NJH/${name}.tar.gz";
+      sha256 = "0fjph2q3yp0aa87gckv3391s47m13wbyylj7jb7vqx7hv0pzj0jh";
     };
-    propagatedBuildInputs = [ BHooksEndOfScope ClassMOP NamespaceClean Moose ];
+    # Build.PL in this package uses which to find pkg-config -- make it use path instead
+    patchPhase = ''sed -ie 's/`which pkg-config`/"pkg-config"/' Build.PL'';
+    doCheck = false; # The main test performs network access
+    #buildInputs = [ TestMore TestPod ];
+    buildInputs = [ pkgs.pkgconfig ];
+    propagatedBuildInputs = [ pkgs.libdiscid ];
   };
 
-  NamespaceClean = buildPerlPackage rec {
-    name = "namespace-clean-0.21";
+  MusicBrainz = buildPerlPackage rec {
+    name = "WebService-MusicBrainz-0.93";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RI/RIBASUSHI/${name}.tar.gz";
-      sha256 = "0djqishj6mcw1jn9saff4i2glq89dq3rc7slpprcky31jay6jq5i";
+      url = "mirror://cpan/authors/id/B/BF/BFAIST/${name}.tar.gz";
+      sha256 = "1gg62x6qv4jj73jsqh0sb237k96i22blj29afpbp1scp3m7i5g61";
+    };
+    propagatedBuildInputs = [ XMLLibXML LWP ClassAccessor URI ];
+    doCheck = false; # Test performs network access.
+  };
+
+  namespaceautoclean = buildPerlPackage rec {
+    name = "namespace-autoclean-0.13";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/namespace-autoclean-0.13.tar.gz;
+      sha256 = "1w53k9f9zla90qdn7cyc9dx8zcv26gwy2y87gcazqsq1aj371m04";
+    };
+    buildInputs = [ Moose SubName ];
+    propagatedBuildInputs = [ BHooksEndOfScope ClassMOP namespaceclean ];
+    meta = {
+      homepage = http://metacpan.org/release/namespace-autoclean;
+      description = "Keep imports out of your namespace";
+      license = "perl5";
+    };
+  };
+
+  namespaceclean = buildPerlPackage rec {
+    name = "namespace-clean-0.24";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RI/RIBASUSHI/namespace-clean-0.24.tar.gz;
+      sha256 = "0c0jj44f3y26scybnxp2lnkcydjqh0lfr6l1jsy13r3x9r4d8qd6";
+    };
+    propagatedBuildInputs = [ BHooksEndOfScope PackageStash ];
+    meta = {
+      homepage = http://search.cpan.org/dist/namespace-clean;
+      description = "Keep imports and functions out of your namespace";
+      license = "perl5";
     };
-    propagatedBuildInputs = [ BHooksEndOfScope DevelHide PackageStash ];
   };
 
   NetAddrIP = buildPerlPackage rec {
@@ -2791,6 +3744,15 @@ rec {
     buildInputs = [ DBI DBDSQLite ];
   };
 
+  NetDBus = buildPerlPackage rec {
+    name = "Net-DBus-1.0.0";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/D/DA/DANBERR/${name}.tar.gz";
+      sha256 = "03srw98nn7r4k6fmnr5bhwsxbhgrsmzdja98jl8b8a72iayg7l5z";
+    };
+    propagatedBuildInputs = [ pkgs.pkgconfig pkgs.dbus XMLTwig ];
+  };
+
   NetDNS = buildPerlPackage {
     name = "Net-DNS-0.63";
     src = fetchurl {
@@ -2801,19 +3763,26 @@ rec {
     doCheck = false;
   };
 
-  NetHTTP = buildPerlPackage rec {
-    name = "Net-HTTP-6.01";
+  NetHTTP = buildPerlPackage {
+    name = "Net-HTTP-6.05";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Net/${name}.tar.gz";
-      sha256 = "0ipad5y605fr968snxmp1sxrkvag9r5y0g8qvj9n7ca9nbwq7n3n";
+      url = mirror://cpan/authors/id/G/GA/GAAS/Net-HTTP-6.05.tar.gz;
+      sha256 = "1r2bv3cw4m054qfsm6i7rpvhrql1d78izpc36prv3xvahfsqxawc";
+    };
+    meta = {
+      description = "Low-level HTTP connection (client)";
+      license = "perl";
     };
   };
 
   NetIP = buildPerlPackage {
-    name = "Net-IP-1.25";
+    name = "Net-IP-1.26";
     src = fetchurl {
-      url = mirror://cpan/authors/id/M/MA/MANU/Net-IP-1.25.tar.gz;
-      sha256 = "1iv0ka6d8kp9iana6zn51sxbcmz2h3mbn6cd8pald36q5whf5mjc";
+      url = mirror://cpan/authors/id/M/MA/MANU/Net-IP-1.26.tar.gz;
+      sha256 = "0ffn2xqqbkfi7v303sp5dwgbv36jah3vg8r4nxhxfiv60vric3q4";
+    };
+    meta = {
+      description = "Perl extension for manipulating IPv4/IPv6 addresses";
     };
   };
 
@@ -2826,13 +3795,30 @@ rec {
     };
   };
 
-  NetServer = buildPerlPackage rec {
-    name = "Net-Server-0.99";
+  NetOAuth = buildPerlPackage {
+    name = "Net-OAuth-0.28";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Net/${name}.tar.gz";
-      sha256 = "0pdf2fvklpcxrdz3wwmhbvjs6kvzcvjw28f3pny8z17188lv06n1";
+      url = mirror://cpan/authors/id/K/KG/KGRENNAN/Net-OAuth-0.28.tar.gz;
+      sha256 = "0k4h4a5048h7qgyx25ih64x0l4airx8a6d9gjq08wmxcl2fk3z3v";
+    };
+    buildInputs = [ TestWarn ];
+    propagatedBuildInputs = [ ClassAccessor ClassDataInheritable DigestHMAC DigestSHA1 LWPUserAgent URI ];
+    meta = {
+      description = "An implementation of the OAuth protocol";
+      license = "perl";
+    };
+  };
+
+  NetServer = buildPerlPackage {
+    name = "Net-Server-2.007";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RH/RHANDOM/Net-Server-2.007.tar.gz;
+      sha256 = "0a03m237cw6j5bvm2yxk2b2gbfx7wj0w2x5zivi9ddqvbcad6vqw";
     };
     doCheck = false; # seems to hang waiting for connections
+    meta = {
+      description = "Extensible, general Perl server engine";
+    };
   };
 
   NetSMTP = buildPerlPackage {
@@ -2854,27 +3840,51 @@ rec {
     propagatedBuildInputs = [IOSocketSSL];
   };
 
+  NetSMTPTLS = buildPerlPackage {
+    name = "Net-SMTP-TLS-0.12";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AW/AWESTHOLM/Net-SMTP-TLS-0.12.tar.gz;
+      sha256 = "19g48kabj22v66jbf69q78xplhi7r1y2kdbddfwh4xy3g9k75rzg";
+    };
+    propagatedBuildInputs = [IOSocketSSL DigestHMAC];
+  };
+
+  NetSNMP = buildPerlPackage rec {
+    name = "Net-SNMP-v6.0.1";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/D/DT/DTOWN/${name}.tar.gz";
+      sha256 = "0hdpn1cw52x8cw24m9ayzpf4rwarm0khygn1sv3wvwxkrg0pphql";
+    };
+  };
+
   NetSSLeay = buildPerlPackage rec {
-    name = "Net-SSLeay-1.42";
+    name = "Net-SSLeay-1.52";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Net/${name}.tar.gz";
-      sha256 = "17gxf0d1l0qlxn0d6gqz1dlzl6cdqv0jg47k0h1fcs45rlcpgjmn";
+      sha256 = "1fkpdlpg99rdq2vlm6bgmqc8iazhcrfzvbpwxnn20k0viwpy7v28";
     };
     buildInputs = [ pkgs.openssl ];
     OPENSSL_PREFIX = pkgs.openssl;
     doCheck = false; # Test performs network access.
+    meta = {
+      description = "Perl extension for using OpenSSL";
+      license = "SSLeay";
+    };
   };
 
   NetTwitterLite = buildPerlPackage {
-    name = "Net-Twitter-Lite-0.10003";
-
+    name = "Net-Twitter-Lite-0.11002";
     src = fetchurl {
-      url = mirror://cpan/authors/id/M/MM/MMIMS/Net-Twitter-Lite-0.10003.tar.gz;
-      sha256 = "1qh5bw68ad4fqiqbqwhgj859kq35asjmp0fsmrqhlbqy195pwi1i";
+      url = mirror://cpan/authors/id/M/MM/MMIMS/Net-Twitter-Lite-0.11002.tar.gz;
+      sha256 = "032gyn1h3r5d83wvz7nj3k7g50wcf73lbbmjc18466ml90vigys0";
     };
+    propagatedBuildInputs = [ CryptSSLeay LWPUserAgent NetOAuth URI ];
     doCheck = false;
-
-    propagatedBuildInputs = [JSONAny Encode LWP CryptSSLeay];
+    meta = {
+      homepage = http://github.com/semifor/Net-Twitter-Lite;
+      description = "A perl interface to the Twitter API";
+      license = "perl";
+    };
   };
 
   NumberCompare = buildPerlPackage rec {
@@ -2915,7 +3925,7 @@ rec {
       url = "mirror://cpan/authors/id/W/WR/WROG/${name}.tar.gz";
       sha256 = "24ac83539b188d85bd2c7bd67e355aab0ede3f98170b23cb50bd30b11b4387ff";
     };
-    propagatedBuildInputs = [ CryptDHGMP URI HTMLParser HTTPRequest XMLSimple ];
+    propagatedBuildInputs = [ CryptDHGMP URI HTMLParser HTTPMessage XMLSimple ];
   };
 
   NetOpenIDConsumer = buildPerlPackage rec {
@@ -2924,36 +3934,51 @@ rec {
       url = "mirror://cpan/authors/id/W/WR/WROG/${name}.tar.gz";
       sha256 = "4ab927b6756366fa4cef2b54088645849f32fc7e0cd8de0a50001bbf62946fd8";
     };
-    propagatedBuildInputs = [ NetOpenIDCommon JSON ];
+    propagatedBuildInputs = [ NetOpenIDCommon JSON LWP ];
   };
 
-  PackageDeprecationManager = buildPerlPackage rec {
-    name = "Package-DeprecationManager-0.11";
+  PackageDeprecationManager = buildPerlPackage {
+    name = "Package-DeprecationManager-0.13";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DR/DROLSKY/${name}.tar.gz";
-      sha256 = "1q2jgq3dfva5wfsl1jn8711bk7fvf5cgpjddd8if9cx3zixnq2n1";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Package-DeprecationManager-0.13.tar.gz;
+      sha256 = "0fkvq3xxwc3l5hg64dr9sj3l12dl59i44cg407qx9sd6r51j3qfi";
+    };
+    buildInputs = [ TestRequires TestFatal ];
+    propagatedBuildInputs = [ ParamsUtil SubInstall ListMoreUtils ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Manage deprecation warnings for your distribution";
+      license = "artistic_2";
     };
-    buildInputs = [ TestFatal TestRequires ];
-    propagatedBuildInputs = [ ListMoreUtils ParamsUtil SubInstall ];
   };
 
-  PackageStash = buildPerlPackage rec {
-    name = "Package-Stash-0.33";
+  PackageStash = buildPerlPackage {
+    name = "Package-Stash-0.34";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
-      sha256 = "0md52rqgcnvspg3l2hvwc31jilq4gkbdwgr5h32gy1hmslaxhpzn";
+      url = mirror://cpan/authors/id/D/DO/DOY/Package-Stash-0.34.tar.gz;
+      sha256 = "1674zs96ndq3czs6v8xkdqqz4fnka0i2835nnns9zbw2q01yirj6";
+    };
+    buildInputs = [ DistCheckConflicts TestFatal TestRequires ];
+    propagatedBuildInputs = [ DistCheckConflicts ModuleImplementation PackageDeprecationManager ];
+    meta = {
+      homepage = http://metacpan.org/release/Package-Stash;
+      description = "Routines for manipulating stashes";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal TestRequires ];
-    propagatedBuildInputs = [ DistCheckConflicts PackageDeprecationManager PackageStashXS ];
   };
 
-  PackageStashXS = buildPerlPackage rec {
-    name = "Package-Stash-XS-0.25";
+  PackageStashXS = buildPerlPackage {
+    name = "Package-Stash-XS-0.26";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
-      sha256 = "1i45mhd17sfq41j62r8kkx2d2f4mi0sp6vl86mmk8a4ssq85i73k";
+      url = mirror://cpan/authors/id/D/DO/DOY/Package-Stash-XS-0.26.tar.gz;
+      sha256 = "1pfdpb3x40f5ldp5kp0d9xvrz4wk2fc3ww53wrq4dp326s08h7r9";
+    };
+    buildInputs = [ TestRequires TestFatal ];
+    meta = {
+      homepage = http://metacpan.org/release/Package-Stash-XS;
+      description = "Faster and more correct implementation of the Package::Stash API";
+      license = "perl5";
     };
-    buildInputs = [ TestFatal ];
   };
 
   ParamsClassify = buildPerlPackage rec {
@@ -2965,19 +3990,42 @@ rec {
     buildInputs = [ ExtUtilsParseXS ];
   };
 
-  ParamsUtil = buildPerlPackage rec {
-    name = "Params-Util-1.01";
+  ParamsUtil = buildPerlPackage {
+    name = "Params-Util-1.07";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-      sha256 = "6a1613b669f18bf329003c7dbd11435248cffa9c1497645073821a68c0987a40";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/Params-Util-1.07.tar.gz;
+      sha256 = "0v67sx93yhn7xa0nh9mnbf8mixf54czk6wzrjsp6dzzr5hzyrw9h";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Simple, compact and correct param-checking functions";
+      license = "perl5";
     };
   };
 
-  ParamsValidate = buildModule rec {
-    name = "Params-Validate-1.00";
+  ParamsValidate = buildPerlModule {
+    name = "Params-Validate-1.07";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Params/${name}.tar.gz";
-      sha256 = "1yziygqb8km28xr3yzzsllzgg7xnxdh4wqfm2kmf2s6qck0dkij4";
+      url = mirror://cpan/authors/id/D/DR/DROLSKY/Params-Validate-1.07.tar.gz;
+      sha256 = "15mz2wxarxjlr3365m1hhcnfs6d2mw3m0yimnlv06j13cxs39py1";
+    };
+    buildInputs = [ TestFatal ];
+    propagatedBuildInputs = [ ModuleImplementation ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Validate method/function parameters";
+      license = "artistic_2";
+    };
+  };
+
+  PARDist = buildPerlPackage {
+    name = "PAR-Dist-0.49";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RS/RSCHUPP/PAR-Dist-0.49.tar.gz;
+      sha256 = "078ycyn8pw3rba4k3qwcqrqfcym5c1pivymwa0bvs9sab45j4iwy";
+    };
+    meta = {
+      description = "Create and manipulate PAR distributions";
     };
   };
 
@@ -2990,10 +4038,10 @@ rec {
   };
 
   ParseCPANMeta = buildPerlPackage rec {
-    name = "Parse-CPAN-Meta-1.4401";
+    name = "Parse-CPAN-Meta-1.4404";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Parse/${name}.tar.gz";
-      sha256 = "0g381a0wynh9xc9wf44drw5vhfbd3wa693myy018jwq9vp51pf5q";
+      sha256 = "1y4mr5hmkkl405x4v31kx2nmlahpg0c38k8s65vgqc4s28wxafmh";
     };
     propagatedBuildInputs = [ CPANMetaYAML JSONPP ];
   };
@@ -3006,11 +4054,15 @@ rec {
     };
   };
 
-  PathClass = buildPerlPackage rec {
-    name = "Path-Class-0.24";
+  PathClass = buildPerlPackage {
+    name = "Path-Class-0.29";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/K/KW/KWILLIAMS/${name}.tar.gz";
-      sha256 = "1g4in1k3nvk7w034hmhix9hjbjgpshwc5m8xvpga84rfzbadpnyc";
+      url = mirror://cpan/authors/id/K/KW/KWILLIAMS/Path-Class-0.29.tar.gz;
+      sha256 = "1z3wvci2qcb1m9qrkxphbnfnr4jqgxbxnxrmdb25ks8gap98hk4z";
+    };
+    meta = {
+      description = "Cross-platform path specification manipulation";
+      license = "perl";
     };
   };
 
@@ -3088,26 +4140,57 @@ rec {
     };
   };
 
-  Plack = buildPerlPackage rec {
-    name = "Plack-0.9985";
+  PHPSerialization = buildPerlPackage {
+    name = "PHP-Serialization-0.34";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/M/MI/MIYAGAWA/${name}.tar.gz";
-      sha256 = "0cik1iwpwky7aliwi59z93ykd13ysp4xg5dps1vd4dhqylkn4ns8";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/PHP-Serialization-0.34.tar.gz;
+      sha256 = "0yphqsgg7zrar2ywk2j2fnjxmi9rq32yf0p5ln8m9fmfx4kd84mr";
+    };
+    meta = {
+      description = "Simple flexible means of converting the output of PHP's serialize() into the equivalent Perl memory structure, and vice versa.";
+      license = "unknown";
+    };
+  };
+
+  Plack = buildPerlPackage {
+    name = "Plack-1.0015";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Plack-1.0015.tar.gz;
+      sha256 = "1zg30bb55ws8fka5iawmfqnc3wg6ggigl0wljgvw0mk466sr3lxf";
+    };
+    buildInputs = [ TestRequires ];
+    propagatedBuildInputs = [ DevelStackTrace DevelStackTraceAsHTML FileShareDir FilesysNotifySimple HashMultiValue HTTPBody HTTPMessage LWPUserAgent StreamBuffered TestTCP TryTiny URI ];
+    meta = {
+      homepage = http://plackperl.org;
+      description = "Perl Superglue for Web frameworks and Web Servers (PSGI toolkit)";
+      license = "perl";
     };
-    buildInputs = [ TestRequires TestTCP HTTPRequestAsCGI ];
-    propagatedBuildInputs =
-      [ LWP FileShareDir TryTiny DevelStackTrace DevelStackTraceAsHTML HTTPBody
-        HashMultiValue FilesysNotifySimple
-      ];
   };
 
-  PlackMiddlewareReverseProxy = buildPerlPackage rec {
-    name = "Plack-Middleware-ReverseProxy-0.10";
+  PlackMiddlewareReverseProxy = buildPerlPackage {
+    name = "Plack-Middleware-ReverseProxy-0.15";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Plack/${name}.tar.gz";
-      sha256 = "0w9bl1z71frra0dgz4gsxskvj1c8dhjkhrj2gqwdds6jcqyny7mf";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Plack-Middleware-ReverseProxy-0.15.tar.gz;
+      sha256 = "1zmsccdy6wr5hxzj07r1nsmaymyibk87p95z0wzknjw10lwmqs9f";
+    };
+    propagatedBuildInputs = [ Plack ];
+    meta = {
+      description = "Supports app to run as a reverse proxy backend";
+      license = "perl";
+    };
+  };
+
+  PlackTestExternalServer = buildPerlPackage {
+    name = "Plack-Test-ExternalServer-0.01";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/F/FL/FLORA/Plack-Test-ExternalServer-0.01.tar.gz;
+      sha256 = "1dbg1p3rgvvbkkpvca5jlc2mzx8iqyiybk88al93pvbca65h1g7h";
+    };
+    propagatedBuildInputs = [ HTTPMessage LWPUserAgent Plack TestTCP URI ];
+    meta = {
+      description = "Run HTTP tests on external live servers";
+      license = "perl";
     };
-    propagatedBuildInputs = [ Plack YAML ];
   };
 
   PPI = buildPerlPackage rec {
@@ -3129,6 +4212,15 @@ rec {
     doCheck = false;
   };
 
+  ProcWaitStat = buildPerlPackage rec {
+    name = "Proc-WaitStat-1.00";
+    src = fetchurl {
+      url = "mirror://cpan//authors/id/R/RO/ROSCH/${name}.tar.gz";
+      sha256 = "1g3l8jzx06x4l4p0x7fyn4wvg6plfzl420irwwb9v447wzsn6xfh";
+    };
+    propagatedBuildInputs = [ IPCSignal ];
+  };
+
   PSGI = buildPerlPackage rec {
     name = "PSGI-1.03";
     src = fetchurl {
@@ -3137,11 +4229,13 @@ rec {
     };
   };
 
-  PadWalker = buildPerlPackage rec {
-    name = "PadWalker-1.9";
+  PadWalker = buildPerlPackage {
+    name = "PadWalker-1.96";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RO/ROBIN/${name}.tar.gz";
-      sha256 = "0lvh0qlyrpnkssqkhfxhbjpb5lyr4fp6d1p7la8k6w3wv1qmbl1s";
+      url = mirror://cpan/authors/id/R/RO/ROBIN/PadWalker-1.96.tar.gz;
+      sha256 = "180c72l3ssnsdbyifl9lzdz83x4zidf3nfgyx6l0j41a5wj0w9fz";
+    };
+    meta = {
     };
   };
 
@@ -3261,6 +4355,32 @@ rec {
     };
   };
 
+  RoleTiny = buildPerlPackage {
+    name = "Role-Tiny-1.002004";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/I/IL/ILMARI/Role-Tiny-1.002004.tar.gz;
+      sha256 = "0n126kazifmx6grdk4rmq226xklfc996cqw4ix26z9jcccl4v756";
+    };
+    buildInputs = [ TestFatal ];
+    meta = {
+      description = "Roles, like a nouvelle cuisine portion size slice of Moose";
+      license = "perl5";
+    };
+  };
+
+  SafeIsa = buildPerlPackage {
+    name = "Safe-Isa-1.000002";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MS/MSTROUT/Safe-Isa-1.000002.tar.gz;
+      sha256 = "07jr4fy6zbw9zwpalxzxlkn4nym6fd0304fsrb5ag0v156ygpwvl";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Call isa, can, does and DOES safely on things that may not be objects";
+      license = "perl5";
+    };
+  };
+
   ScalarString = buildPerlPackage rec {
     name = "Scalar-String-0.002";
     src = fetchurl {
@@ -3270,18 +4390,27 @@ rec {
   };
 
   ScopeGuard = buildPerlPackage {
-    name = "Scope-Guard-0.03";
+    name = "Scope-Guard-0.20";
     src = fetchurl {
-      url = mirror://cpan/authors/id/C/CH/CHOCOLATE/Scope-Guard-0.03.tar.gz;
-      sha256 = "07x966fkqxlwnngxs7a2jrhabh8gzhjfpqq56n9gkwy7f340sayb";
+      url = mirror://cpan/authors/id/C/CH/CHOCOLATE/Scope-Guard-0.20.tar.gz;
+      sha256 = "1lsagnz6pli035zvx5c1x4qm9fabi773vns86yd8lzfpldhfv3sv";
+    };
+    meta = {
+      description = "Lexically-scoped resource management";
+      license = "perl";
     };
   };
 
-  ScopeUpper = buildPerlPackage rec {
-    name = "Scope-Upper-0.12";
+  ScopeUpper = buildPerlPackage {
+    name = "Scope-Upper-0.21";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/V/VP/VPIT/${name}.tar.gz";
-      sha256 = "1yrjx22hlsv2qdgicnz589j9iipyxl56y6pnks2cfg6icpp97v5w";
+      url = mirror://cpan/authors/id/V/VP/VPIT/Scope-Upper-0.21.tar.gz;
+      sha256 = "058nfnzp31k7hmdvbsr72nvrw0i23gwjplb6g6pag3s18m7fl1p6";
+    };
+    meta = {
+      homepage = http://search.cpan.org/dist/Scope-Upper/;
+      description = "Act on upper scopes";
+      license = "perl5";
     };
   };
 
@@ -3293,6 +4422,14 @@ rec {
     };
   };
 
+  SGMLSpm = buildPerlPackage {
+    name = "SGMLSpm-1.1";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RA/RAAB/SGMLSpm-1.1.tar.gz;
+      sha256 = "1gdjf3mcz2bxir0l9iljxiz6qqqg3a9gg23y5wjg538w552r432m";
+    };
+  };
+
   Socket6 = buildPerlPackage rec {
     name = "Socket6-0.23";
     src = fetchurl {
@@ -3310,6 +4447,15 @@ rec {
     };
   };
 
+  Spiffy = buildPerlPackage rec {
+    name = "Spiffy-0.31";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/I/IN/INGY/${name}.tar.gz";
+      sha256 = "11pnsbyjzpp8y8ss7mrmz8nnbvv5vr7x71f13pwii9m8cam04blj";
+    };
+    buildInputs = [ ExtUtilsMakeMaker ];
+  };
+
   SpreadsheetParseExcel = buildPerlPackage rec {
     name = "Spreadsheet-ParseExcel-0.58";
     src = fetchurl {
@@ -3320,15 +4466,18 @@ rec {
     propagatedBuildInputs = [ IOStringy OLEStorageLight ];
   };
 
-  SQLAbstract = buildPerlPackage rec {
-    name = "SQL-Abstract-1.72";
+  SQLAbstract = buildPerlPackage {
+    name = "SQL-Abstract-1.73";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/SQL/${name}.tar.gz";
-      sha256 = "12abz50zz51s1f5hvs5xl6smb369sjid1zyjkfygkiglqp4an0kr";
+      url = mirror://cpan/authors/id/F/FR/FREW/SQL-Abstract-1.73.tar.gz;
+      sha256 = "081ppyvsc66yshmfr9q9v7hp9g58725nnibd771i9g153vzs49kb";
+    };
+    buildInputs = [ TestException TestWarn ];
+    propagatedBuildInputs = [ ClassAccessorGrouped GetoptLongDescriptive HashMerge ];
+    meta = {
+      description = "Generate SQL from Perl data structures";
+      license = "perl";
     };
-    buildInputs = [ TestDeep TestException TestWarn ];
-    propagatedBuildInputs =
-      [ ClassAccessorGrouped GetoptLongDescriptive HashMerge ];
   };
 
   SQLAbstractLimit = buildPerlPackage rec {
@@ -3374,16 +4523,19 @@ rec {
     ];
   };
 
-  Starman = buildPerlPackage rec {
-    name = "Starman-0.2014";
+  Starman = buildPerlPackage {
+    name = "Starman-0.3006";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Plack/${name}.tar.gz";
-      sha256 = "0hf3wpm2q4zcgjahjrpkkzy4fn74vkddg9yqs7p97xb290pvlbki";
+      url = mirror://cpan/authors/id/M/MI/MIYAGAWA/Starman-0.3006.tar.gz;
+      sha256 = "0dlwrrq570v5mbpzsi4pmj6n2sjm3xpcilhh6dvpq8qbp550wixy";
     };
-    patches = [ ../development/perl-modules/starman-dont-change-name.patch ];
-    buildInputs = [ TestRequires TestTCP ];
-    propagatedBuildInputs = [ Plack DataDump HTTPParserXS NetServer ];
+    buildInputs = [ TestRequires ];
+    propagatedBuildInputs = [ DataDump HTTPDate HTTPParserXS HTTPMessage NetServer Plack TestTCP ];
     doCheck = false; # binds to various TCP ports1
+    meta = {
+      description = "High-performance preforking PSGI/Plack web server";
+      license = "perl";
+    };
   };
 
   StatisticsDescriptive = buildPerlPackage rec {
@@ -3411,6 +4563,32 @@ rec {
     propagatedBuildInputs = [ StatisticsDescriptive StatisticsDistributions ];
   };
 
+  StreamBuffered = buildPerlPackage {
+    name = "Stream-Buffered-0.02";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DO/DOY/Stream-Buffered-0.02.tar.gz;
+      sha256 = "0bfa3h2pryrbrcd1r7235k0ik4gw35r5ig8h8y3dfmk9l3y96vjr";
+    };
+    meta = {
+      homepage = http://plackperl.org;
+      description = "Temporary buffer to save bytes";
+      license = "perl";
+    };
+  };
+
+  strictures = buildPerlPackage {
+    name = "strictures-1.004004";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/E/ET/ETHER/strictures-1.004004.tar.gz;
+      sha256 = "0d7fanr4ggmlqvdxf63ci7nxba2vrdz9558xy35hfpm8max7s48j";
+    };
+    meta = {
+      homepage = http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit/strictures.git;
+      description = "Turn on strict and make all warnings fatal";
+      license = "perl5";
+    };
+  };
+
   StringCamelCase = buildPerlPackage rec {
     name = "String-CamelCase-0.02";
     src = fetchurl {
@@ -3435,11 +4613,17 @@ rec {
     };
   };
 
-  StringRewritePrefix = buildPerlPackage rec {
-    name = "String-RewritePrefix-0.004";
+  StringRewritePrefix = buildPerlPackage {
+    name = "String-RewritePrefix-0.006";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "17v0pwiprsz9ibxlhpi789jxg691nz9prpabvb4dn4nb0qbi0yd0";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/String-RewritePrefix-0.006.tar.gz;
+      sha256 = "1b9fg805g0agsyij28w8hhmnf485bii8zl03i092mv1p2hqrpxll";
+    };
+    propagatedBuildInputs = [ SubExporter ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Rewrite strings based on a set of known prefixes";
+      license = "perl5";
     };
   };
 
@@ -3450,16 +4634,60 @@ rec {
       sha256 = "1rmldr7jf4jvkhzlv8hgp48lrmybvinmhv8kcnrpa8las0ijm4vm";
     };
     propagatedBuildInputs =
-      [ LinguaENInflectPhrase TextUnidecode NamespaceClean ];
+      [ LinguaENInflectPhrase TextUnidecode namespaceclean ];
   };
 
-  SubExporter = buildPerlPackage rec {
-    name = "Sub-Exporter-0.982";
+  StringUtil = buildPerlPackage {
+    name = "String-Util-1.21";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "0xf8q05k5xs3bw6qy3pnnl5d670njxsxbw2dprl7n50hf488cbvj";
+      url = mirror://cpan/authors/id/M/MI/MIKO/String-Util-1.21.tar.gz;
+      sha256 = "1ndvm9pbngf1j0fm02ghl4nfcqi5404sxdlm42g3ismf1ms1fnxa";
+    };
+    meta = {
+      description = "String::Util -- String processing utilities";
+      license = "perl";
+    };
+  };
+
+  SubExporter = buildPerlPackage {
+    name = "Sub-Exporter-0.984";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Sub-Exporter-0.984.tar.gz;
+      sha256 = "190qly7nv7zf17c1v0gnqhyf25p6whhh2m132mh4xzs5mqadwq0f";
+    };
+    propagatedBuildInputs = [ DataOptList ParamsUtil SubInstall ];
+    meta = {
+      homepage = https://github.com/rjbs/sub-exporter;
+      description = "A sophisticated exporter for custom-built routines";
+      license = "perl5";
+    };
+  };
+
+  SubExporterProgressive = buildPerlPackage {
+    name = "Sub-Exporter-Progressive-0.001006";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/L/LE/LEONT/Sub-Exporter-Progressive-0.001006.tar.gz;
+      sha256 = "0s13fz86c8slhgban10sywp2skjdxnl3nvkqqy7pbwg81g3v9rr2";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Only use Sub::Exporter if you need it";
+      license = "perl5";
+    };
+  };
+
+  SubExporterUtil = buildPerlPackage {
+    name = "Sub-Exporter-Util-0.984";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Sub-Exporter-0.984.tar.gz;
+      sha256 = "190qly7nv7zf17c1v0gnqhyf25p6whhh2m132mh4xzs5mqadwq0f";
+    };
+    propagatedBuildInputs = [ DataOptList ParamsUtil SubInstall ];
+    meta = {
+      homepage = https://github.com/rjbs/sub-exporter;
+      description = "A sophisticated exporter for custom-built routines";
+      license = "perl5";
     };
-    propagatedBuildInputs = [SubInstall DataOptList ParamsUtil];
   };
 
   SubIdentify = buildPerlPackage rec {
@@ -3470,20 +4698,28 @@ rec {
     };
   };
 
-  SubInstall = buildPerlPackage rec {
-    name = "Sub-Install-0.925";
+  SubInstall = buildPerlPackage {
+    name = "Sub-Install-0.926";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "1sccc4nwp9y24zkr42ww2gwg6zwax4madi9spsdym1pqna3nwnm6";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Sub-Install-0.926.tar.gz;
+      sha256 = "0gkns6p11j46j6yzacanhbqgd4ws5r0ppg6yivz7cjbq8dk4kcmc";
+    };
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Install subroutines into packages easily";
+      license = "perl5";
     };
   };
 
-  SubName = buildPerlPackage rec {
+  SubName = buildPerlPackage {
     name = "Sub-Name-0.05";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/F/FL/FLORA/${name}.tar.gz";
+      url = mirror://cpan/authors/id/F/FL/FLORA/Sub-Name-0.05.tar.gz;
       sha256 = "1w9sf51ai2r3i0kv5wnq7h9g3hcd6zb6i51ivvykb3hzx82vilf9";
     };
+    meta = {
+      description = "(Re)name a sub";
+    };
   };
 
   SubOverride = buildPerlPackage rec {
@@ -3496,10 +4732,15 @@ rec {
   };
 
   SubUplevel = buildPerlPackage {
-    name = "Sub-Uplevel-0.2002";
+    name = "Sub-Uplevel-0.24";
     src = fetchurl {
-      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.2002.tar.gz;
-      sha256 = "19b2b9xsw7lvvkcmmnhhv8ybxdkbnrky9nnqgjridr108ww9m5rh";
+      url = mirror://cpan/authors/id/D/DA/DAGOLDEN/Sub-Uplevel-0.24.tar.gz;
+      sha256 = "1yzxqsim8vpavzqm2wfksh8dpmy6qbr9s3hdqqicp38br3lzd4qg";
+    };
+    meta = {
+      homepage = https://github.com/dagolden/sub-uplevel;
+      description = "Apparently run a function in a higher stack frame";
+      license = "perl5";
     };
   };
 
@@ -3592,34 +4833,41 @@ rec {
   };
 
   TaskWeaken = buildPerlPackage {
-    name = "Task-Weaken-1.02";
+    name = "Task-Weaken-1.04";
     src = fetchurl {
-      url = mirror://cpan/authors/id/A/AD/ADAMK/Task-Weaken-1.02.tar.gz;
-      sha256 = "10f9kd1lwbscmmjwgbfwa4kkp723mb463lkbmh29rlhbsl7kb5wz";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/Task-Weaken-1.04.tar.gz;
+      sha256 = "1i7kd9v8fjsqyhr4rx4a1jv7n5vfjjm1v4agb24pizh0b72p3qk7";
+    };
+    meta = {
+      description = "Ensure that a platform has weaken support";
+      license = "perl";
     };
   };
 
   TemplateTimer = buildPerlPackage {
-    name = "Template-Timer-0.04";
+    name = "Template-Timer-1.00";
     src = fetchurl {
-      url = mirror://cpan/authors/id/P/PE/PETDANCE/Template-Timer-0.04.tar.gz;
-      sha256 = "0j0gmxbq1svp0rb4kprwj2fk2mhl07yah08bksfz0a0pfz6lsam4";
+      url = mirror://cpan/authors/id/P/PE/PETDANCE/Template-Timer-1.00.tar.gz;
+      sha256 = "1d3pbcx1kz73ncg8s8lx3ifwphz838qy0m40gdar7790cnrlqcdp";
+    };
+    propagatedBuildInputs = [ TemplateToolkit ];
+    meta = {
+      description = "Rudimentary profiling for Template Toolkit";
+      license = "null";
     };
-    propagatedBuildInputs = [TemplateToolkit];
   };
 
   TemplateToolkit = buildPerlPackage rec {
-    name = "Template-Toolkit-2.22";
+    name = "Template-Toolkit-2.24";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AB/ABW/${name}.tar.gz";
-      sha256 = "023sb6mf43m085pf8qq1dh1ill66p424mmj66xna5ji1nkw96pm3";
+      url = mirror://cpan/authors/id/A/AB/ABW/Template-Toolkit-2.24.tar.gz;
+      sha256 = "1j01kpsdpwxrwbsz2y1d8xyyliw9l23g0f3jigxvgxs9qal4m0rq";
+    };
+    propagatedBuildInputs = [ AppConfig ];
+    meta = {
+      description = "Comprehensive template processing system";
+      license = "perl5";
     };
-    propagatedBuildInputs = [AppConfig];
-    patches = [
-      # Needed to make TT works proy on templates in the Nix store.
-      # !!! unnecessary with Nix >= 0.13.
-      ../development/perl-modules/template-toolkit-nix-store.patch
-    ];
   };
 
   TermReadKey = buildPerlPackage {
@@ -3663,22 +4911,52 @@ rec {
     buildInputs = [ LogTrace ];
   };
 
-  TestDeep = buildPerlPackage rec {
-    name = "Test-Deep-0.109";
+  TestBase = buildPerlPackage rec {
+    name = "Test-Base-0.60";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "0nqqxj00ln3b4pma47bj2rcpblpvipfrchqbcxahlq9lh1q4p5s6";
+      sha256 = "0yf030nay85xzas1qxn1nw6lhfsrcbgh3nq7bxbb11nxhvdaj2bx";
     };
-    propagatedBuildInputs = [TestTester TestNoWarnings];
+    buildInputs = [ Spiffy ];
   };
 
-  TestDifferences = buildPerlPackage rec {
-    name = "Test-Differences-0.500";
+  TestCheckDeps = buildPerlPackage {
+    name = "Test-CheckDeps-0.002";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/O/OV/OVID/${name}.tar.gz";
-      sha256 = "0ha36j6wr1d47zzilb28bvkm5lm5c6i4rqp4aqyknwg4qmagjr4w";
+      url = mirror://cpan/authors/id/L/LE/LEONT/Test-CheckDeps-0.002.tar.gz;
+      sha256 = "0fmm9xsgial599bqb6rcrc6xp0627rcdp0ivx8wsy807py5jk5i6";
+    };
+    propagatedBuildInputs = [ CPANMetaCheck ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Check for presence of dependencies";
+      license = "perl5";
+    };
+  };
+
+  TestDeep = buildPerlPackage {
+    name = "Test-Deep-0.110";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Test-Deep-0.110.tar.gz;
+      sha256 = "12rd9fknm778685ypyc599lcmzbqvbqnjhcrkybgpq2siai9q4h5";
+    };
+    propagatedBuildInputs = [ TestNoWarnings TestTester ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+    };
+  };
+
+  TestDifferences = buildPerlPackage {
+    name = "Test-Differences-0.61";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/O/OV/OVID/Test-Differences-0.61.tar.gz;
+      sha256 = "044wg7nqmhvh5ms8z305f9bzldhigr020l1a7iqycxqv05h6b6vm";
+    };
+    propagatedBuildInputs = [ TextDiff ];
+    meta = {
+      description = "Test strings and data structures and show differences if not ok";
+      license = "perl";
     };
-    propagatedBuildInputs = [ TestMore TextDiff ];
   };
 
   TestException = buildPerlPackage rec {
@@ -3690,13 +4968,18 @@ rec {
     propagatedBuildInputs = [ SubUplevel ];
   };
 
-  TestFatal = buildPerlPackage rec {
-    name = "Test-Fatal-0.006";
+  TestFatal = buildPerlPackage {
+    name = "Test-Fatal-0.010";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "0laxzphmqwq0rrizv3n7pcnrn345yh70cip61sl8f8mw8dir1jdx";
+      url = mirror://cpan/authors/id/R/RJ/RJBS/Test-Fatal-0.010.tar.gz;
+      sha256 = "01ck4wyrj4nqyr1cz3lcff6g9nryadsflpf85jmsa6vcl2bq8pl0";
     };
     propagatedBuildInputs = [ TryTiny ];
+    meta = {
+      homepage = https://github.com/rjbs/test-fatal;
+      description = "Incredibly simple helpers for testing code with exceptions";
+      license = "perl5";
+    };
   };
 
   TestHarness = buildPerlPackage rec {
@@ -3724,6 +5007,21 @@ rec {
     propagatedBuildInputs = [TestException UNIVERSALisa UNIVERSALcan];
   };
 
+  TestMoose = buildPerlPackage {
+    name = "Test-Moose-2.0604";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/D/DO/DOY/Moose-2.0604.tar.gz;
+      sha256 = "0nwvklb8dwf8lskwxik3gi9gsqzrix2jhc56zvfzlf1q5q1s07qj";
+    };
+    buildInputs = [ DistCheckConflicts TestFatal TestRequires ];
+    propagatedBuildInputs = [ ClassLoad ClassLoadXS DataOptList DevelGlobalDestruction DistCheckConflicts EvalClosure ListMoreUtils MROCompat PackageDeprecationManager PackageStash PackageStashXS ParamsUtil SubExporter SubName TaskWeaken TryTiny ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "A postmodern object system for Perl 5";
+      license = "perl5";
+    };
+  };
+
   TestMockTime = buildPerlPackage rec {
     name = "Test-MockTime-0.09";
     src = fetchurl {
@@ -3735,12 +5033,17 @@ rec {
   TestMore = TestSimple;
 
   TestNoWarnings = buildPerlPackage {
-    name = "Test-NoWarnings-0.084";
+    name = "Test-NoWarnings-1.04";
     src = fetchurl {
-      url = mirror://cpan/authors/id/F/FD/FDALY/Test-NoWarnings-0.084.tar.gz;
-      sha256 = "19g47pa3brr9px3jnwziapvxcnghqqjjwxz1jfch4asawpdx2s8b";
+      url = mirror://cpan/authors/id/A/AD/ADAMK/Test-NoWarnings-1.04.tar.gz;
+      sha256 = "0v385ch0hzz9naqwdw2az3zdqi15gka76pmiwlgsy6diiijmg2k3";
+    };
+    buildInputs = [ TestTester ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Make sure you didn't emit any warnings while testing";
+      license = "open_source";
     };
-    propagatedBuildInputs = [TestTester];
   };
 
   TestObject = buildPerlPackage rec {
@@ -3771,10 +5074,15 @@ rec {
   };
 
   TestPod = buildPerlPackage {
-    name = "Test-Pod-1.26";
+    name = "Test-Pod-1.45";
     src = fetchurl {
-      url = mirror://cpan/authors/id/P/PE/PETDANCE/Test-Pod-1.26.tar.gz;
-      sha256 = "025rviipiaa1rf0bp040jlwaxwvx48kdcjriaysvkjpyvilwvqd4";
+      url = mirror://cpan/authors/id/D/DW/DWHEELER/Test-Pod-1.45.tar.gz;
+      sha256 = "0yv0bglm4b9zfi9l5z6x2dy6pzlh8n5z9yl7py5v6h48mwgk74fk";
+    };
+    meta = {
+      homepage = http://search.cpan.org/dist/Test-Pod/;
+      description = "Check for POD errors in files";
+      license = "perl5";
     };
   };
 
@@ -3787,12 +5095,16 @@ rec {
     propagatedBuildInputs = [PodCoverage];
   };
 
-  TestRequires = buildPerlPackage rec {
+  TestRequires = buildPerlPackage {
     name = "Test-Requires-0.06";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/T/TO/TOKUHIROM/${name}.tar.gz";
+      url = mirror://cpan/authors/id/T/TO/TOKUHIROM/Test-Requires-0.06.tar.gz;
       sha256 = "1ksyg4npzx5faf2sj80rm74qjra4q679750vfqfvw3kg1d69wvwv";
     };
+    meta = {
+      description = "Checks to see if the module can be loaded";
+      license = "perl";
+    };
   };
 
   TestScript = buildPerlPackage rec {
@@ -3812,13 +5124,7 @@ rec {
     };
   };
 
-  TestSimple = buildPerlPackage rec {
-    name = "Test-Simple-0.98";
-    src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "1a0jrl3n2g05qn6c79pv5bnc1wlq36qccwdgf1pjrrvmrgi07cig";
-    };
-  };
+  TestSimple = null;
 
   TestSubCalls = buildPerlPackage rec {
     name = "Test-SubCalls-1.09";
@@ -3829,20 +5135,24 @@ rec {
     propagatedBuildInputs = [ HookLexWrap ];
   };
 
-  TestTCP = buildPerlPackage rec {
-    name = "Test-TCP-1.13";
+  TestTCP = buildPerlPackage {
+    name = "Test-TCP-1.18";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "00vbkynkdflqgdvywdxzgg3yx1w7nfb68py8l3lglq9jq4pq9wbb";
+      url = mirror://cpan/authors/id/T/TO/TOKUHIROM/Test-TCP-1.18.tar.gz;
+      sha256 = "0flm7x0z7amppi9y6s8mxm0pkrgfihfpfjs0w4i6s80jiss1gfld";
+    };
+    propagatedBuildInputs = [ TestSharedFork ];
+    meta = {
+      description = "Testing TCP program";
+      license = "perl";
     };
-    propagatedBuildInputs = [ TestMore TestSharedFork ];
   };
 
   TestTester = buildPerlPackage {
-    name = "Test-Tester-0.107";
+    name = "Test-Tester-0.108";
     src = fetchurl {
-      url = mirror://cpan/authors/id/F/FD/FDALY/Test-Tester-0.107.tar.gz;
-      sha256 = "0qgmsl6s6xm39211lywyzwrlz0gcmax7fb8zipybs9yxfmwcvyx2";
+      url = mirror://cpan/authors/id/F/FD/FDALY/Test-Tester-0.108.tar.gz;
+      sha256 = "1pby9w41b7z0cgnxpgkh397x7z68855sjg5yda48r6lck3lga62h";
     };
   };
 
@@ -3854,47 +5164,82 @@ rec {
     };
   };
 
-  TestWarn = buildPerlPackage rec {
-    name = "Test-Warn-0.23";
+  TestWarn = buildPerlPackage {
+    name = "Test-Warn-0.24";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "1733s39s4pm0hsshvvjsv1vbri09l4g0g7yyg64y65yqcyanfdf0";
+      url = mirror://cpan/authors/id/C/CH/CHORNY/Test-Warn-0.24.tar.gz;
+      sha256 = "12r1mcwrm6cgc3ppgawwv265vmrighj4bl6xc5c41f4c2l6bdxml";
+    };
+    propagatedBuildInputs = [ SubUplevel TreeDAGNode ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "Perl extension to test methods for warnings";
+      license = "perl5";
     };
-    propagatedBuildInputs = [TestSimple TestException ArrayCompare TreeDAGNode];
-    buildInputs = [TestPod];
   };
 
-  TestWWWMechanize = buildPerlPackage rec {
-    name = "Test-WWW-Mechanize-1.24";
+  TestWWWMechanize = buildPerlPackage {
+    name = "Test-WWW-Mechanize-1.44";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
-      sha256 = "11knym5ppish78rk8r1hymvq1py43h7z8d6nk8p4ig3p246xx5qa";
+      url = mirror://cpan/authors/id/P/PE/PETDANCE/Test-WWW-Mechanize-1.44.tar.gz;
+      sha256 = "062pj242vsc73bw11jqpap92ax9wzc9f2m4xhyp1wzrwkfchpl2q";
+    };
+    propagatedBuildInputs = [ CarpAssertMore HTMLTree HTTPServerSimple LWP TestLongString URI WWWMechanize ];
+    meta = {
+      homepage = https://github.com/petdance/test-www-mechanize;
+      description = "Testing-specific WWW::Mechanize subclass";
+      license = "artistic_2";
     };
-    propagatedBuildInputs = [
-      CarpAssertMore URI TestLongString WWWMechanize
-    ];
-    doCheck = false;
   };
 
-  TestWWWMechanizeCatalyst = buildPerlPackage rec {
-    name = "Test-WWW-Mechanize-Catalyst-0.55";
+  TestWWWMechanizeCatalyst = buildPerlPackage {
+    name = "Test-WWW-Mechanize-Catalyst-0.58";
     src = fetchurl {
-      url = "mirror://cpan/modules/by-module/Test/${name}.tar.gz";
-      sha256 = "0zdg4sxx231dj3qgbr58i63927gl4qzh0krignqxp8q6ck3hr63f";
+      url = mirror://cpan/authors/id/B/BO/BOBTFISH/Test-WWW-Mechanize-Catalyst-0.58.tar.gz;
+      sha256 = "1pa2m064skxfwsm93hffxcyky4kcn2q418vnw2fn79ich6wrcijd";
     };
-    propagatedBuildInputs =
-      [ CatalystRuntime TestWWWMechanize WWWMechanize
-        CatalystPluginSessionStateCookie HTMLForm
-      ];
-    buildInputs = [ TestPod ];
     doCheck = false; # listens on an external port
+    propagatedBuildInputs = [ CatalystRuntime LWP Moose namespaceclean TestWWWMechanize WWWMechanize ];
+    meta = {
+      description = "Test::WWW::Mechanize for Catalyst";
+      license = "perl";
+    };
   };
 
-  TextAligner = buildPerlPackage rec {
-    name = "Text-Aligner-0.03";
+  TestWWWMechanizePSGI = buildPerlPackage {
+    name = "Test-WWW-Mechanize-PSGI-0.35";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AN/ANNO/${name}.tar.gz";
-      sha256 = "137m8w13ffdm3fbvy6yw0izrl2p87zawp1840qvsdw1nd0plxyp9";
+      url = mirror://cpan/authors/id/L/LB/LBROCARD/Test-WWW-Mechanize-PSGI-0.35.tar.gz;
+      sha256 = "1hih8s49zf38bisvhnhzrrj0zwyiivkrbs7nmmdqm1qqy27wv7pc";
+    };
+    propagatedBuildInputs = [ Plack TestWWWMechanize TryTiny ];
+    meta = {
+      description = "Test PSGI programs using WWW::Mechanize";
+      license = "perl";
+    };
+  };
+
+  TextAligner = buildPerlPackage {
+    name = "Text-Aligner-0.07";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AN/ANNO/Text-Aligner-0.07.tar.gz;
+      sha256 = "1vpb87binmmysr4sxfjinxg4bh3rb4rmrx48yyczgmyddmda9rik";
+    };
+    meta = {
+      description = "Align text in columns";
+    };
+  };
+
+  TextBibTeX = buildPerlModule {
+    name = "Text-BibTeX-0.66";
+    buildInputs = [ ConfigAutoConf ExtUtilsLibBuilder ];
+    src = fetchurl {
+      url = mirror://cpan/authors/id/A/AM/AMBS/Text/Text-BibTeX-0.66.tar.gz;
+      sha256 = "0wymg190afqfhr5i9ws02jgnksk06h3w45770ynjjr1fs343b9j7";
+    };
+    meta = {
+      description = "Interface to read and parse BibTeX files";
+      license = "perl5";
     };
   };
 
@@ -3906,13 +5251,17 @@ rec {
     };
   };
 
-  TextDiff = buildPerlPackage rec {
-    name = "Text-Diff-1.37";
+  TextDiff = buildPerlPackage {
+    name = "Text-Diff-1.41";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AD/ADAMK/${name}.tar.gz";
-      sha256 = "08das6k4nrf8dgcg2l1jcy8868kgzx976j38rpdndgrgq0nz148n";
+      url = mirror://cpan/authors/id/O/OV/OVID/Text-Diff-1.41.tar.gz;
+      sha256 = "1ynjsa4sr1yvyh65sdfvahaafglibz70j8b6rj01cg1iisj50zx6";
     };
     propagatedBuildInputs = [ AlgorithmDiff ];
+    meta = {
+      description = "Perform diffs on files and record sets";
+      license = "perl";
+    };
   };
 
   TextGlob = buildPerlPackage rec {
@@ -3958,20 +5307,29 @@ rec {
   };
 
   TextSimpleTable = buildPerlPackage {
-    name = "Text-SimpleTable-0.05";
+    name = "Text-SimpleTable-2.03";
     src = fetchurl {
-      url = mirror://cpan/authors/id/S/SR/SRI/Text-SimpleTable-0.05.tar.gz;
-      sha256 = "028pdfmr2gnaq8w3iar8kqvrpxcghnag8ls7h4227l9zbxd1k9p9";
+      url = mirror://cpan/authors/id/M/MR/MRAMBERG/Text-SimpleTable-2.03.tar.gz;
+      sha256 = "15hpry9jwrf1vbjyk21s65rllxrdvp2fdzzv9gsvczggby2yyzfs";
+    };
+    meta = {
+      description = "Simple eyecandy ASCII tables";
+      license = "artistic_2";
     };
   };
 
-  TextTable = buildPerlPackage rec {
-    name = "Text-Table-1.114";
+  TextTable = buildPerlPackage {
+    name = "Text-Table-1.126";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AN/ANNO/${name}.tar.gz";
-      sha256 = "0qnpfyv7l98hyah3bnq19c33m9jh5sg0fmw2xxzaygmnp2pgpmpm";
+      url = mirror://cpan/authors/id/S/SH/SHLOMIF/Text-Table-1.126.tar.gz;
+      sha256 = "18v9ll360q4hlhmpks175da7y8nf6ywygd39archnw3zpn1cv7h1";
+    };
+    propagatedBuildInputs = [ TextAligner ];
+    meta = {
+      homepage = http://www.shlomifish.org/open-source/projects/docmake/;
+      description = "Organize Data in Tables";
+      license = "bsd";
     };
-    propagatedBuildInputs = [TextAligner];
   };
 
   TextTabularDisplay = buildPerlPackage rec {
@@ -3983,6 +5341,20 @@ rec {
     propagatedBuildInputs = [TextAligner];
   };
 
+  TestTrap = buildPerlPackage {
+    name = "Test-Trap-v0.2.2";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/E/EB/EBHANSSEN/Test-Trap-v0.2.2.tar.gz;
+      sha256 = "1ci5ag9pm850ww55n2929skvw3avy6xcrwmmi2yyn0hifxx9dybs";
+    };
+    buildInputs = [ TestTester ];
+    propagatedBuildInputs = [ DataDump ];
+    meta = {
+      description = "Trap exit codes, exceptions, output, etc.";
+      license = "perl";
+    };
+  };
+
   TextUnidecode = buildPerlPackage rec {
     name = "Text-Unidecode-0.04";
     src = fetchurl {
@@ -4000,11 +5372,15 @@ rec {
     propagatedBuildInputs = [ DevelStackTrace Moose ];
   };
 
-  TieIxHash = buildPerlPackage rec {
-    name = "Tie-IxHash-1.21";
+  TieIxHash = buildPerlPackage {
+    name = "Tie-IxHash-1.22";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/G/GS/GSAR/${name}.tar.gz";
-      sha256 = "1xpj2c1dzcp14hfnxahy4r5f19c8afh8k6sfryq9gi76aadvjyk8";
+      url = mirror://cpan/authors/id/C/CH/CHORNY/Tie-IxHash-1.22.tar.gz;
+      sha256 = "0f0m0x8nkidxd0pxnls1i8kc8d7bd89dqgihz29wj3ggk43qffr7";
+    };
+    meta = {
+      description = "Ordered associative arrays for Perl";
+      license = "perl";
     };
   };
 
@@ -4026,18 +5402,24 @@ rec {
   };
 
   TimeHiRes = buildPerlPackage rec {
-    name = "Time-HiRes-1.9724";
+    name = "Time-HiRes-1.9725";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/Time/${name}.tar.gz";
-      sha256 = "0lrwfixr3qg8j4vkfax1z4gqiccq0v0jyvc7db40qpvi88655gjs";
+      sha256 = "0fr7zkc55kazcjxdkrcjgimic8xpk6imxkckdpjlggjpkggv76f0";
     };
   };
 
   TreeDAGNode = buildPerlPackage {
-    name = "Tree-DAG_Node-1.06";
+    name = "Tree-DAG_Node-1.09";
     src = fetchurl {
-      url = mirror://cpan/authors/id/C/CO/COGENT/Tree-DAG_Node-1.06.tar.gz;
-      sha256 = "0anvwfh4vqj41ipq52p65sqlvw3rvm6cla5hbws13gyk9mvp09ah";
+      url = mirror://cpan/authors/id/R/RS/RSAVAGE/Tree-DAG_Node-1.09.tgz;
+      sha256 = "1k2byyk7dnm8l6i1igagpfr58b02zsq5hwd9jcdp8yrlih7dzii3";
+    };
+    buildInputs = [ TestPod ];
+    meta = {
+      homepage = http://search.cpan.org/perldoc?CPAN::Meta::Spec;
+      description = "An N-ary tree";
+      license = "perl5";
     };
   };
 
@@ -4047,7 +5429,11 @@ rec {
       url = mirror://cpan/authors/id/S/ST/STEVAN/Tree-Simple-1.18.tar.gz;
       sha256 = "0bb2hc8q5rwvz8a9n6f49kzx992cxczmrvq82d71757v087dzg6g";
     };
-    propagatedBuildInputs = [TestException];
+    buildInputs = [ TestException ];
+    meta = {
+      description = "A simple tree object";
+      license = "perl";
+    };
   };
 
   TreeSimpleVisitorFactory = buildPerlPackage {
@@ -4060,11 +5446,14 @@ rec {
     buildInputs = [TestException];
   };
 
-  TryTiny = buildPerlPackage rec {
-    name = "Try-Tiny-0.09";
+  TryTiny = buildPerlPackage {
+    name = "Try-Tiny-0.12";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/D/DO/DOY/${name}.tar.gz";
-      sha256 = "1fjhwq347wa74h94nd54lx194s26s7x9whfc0kkpcng2sgs54vvs";
+      url = mirror://cpan/authors/id/D/DO/DOY/Try-Tiny-0.12.tar.gz;
+      sha256 = "0awv2w33jb1xw3bsrfwsz53dgwm8s8vnpk4ssxxp3n89i7116p2g";
+    };
+    meta = {
+      homepage = https://github.com/doy/try-tiny.git;
     };
   };
 
@@ -4076,11 +5465,16 @@ rec {
     };
   };
 
-  UNIVERSALisa = buildModule rec {
-    name = "UNIVERSAL-isa-1.01";
+  UNIVERSALisa = buildPerlPackage {
+    name = "UNIVERSAL-isa-1.20120726";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/C/CH/CHROMATIC/${name}.tar.gz";
-      sha256 = "0iksklmfhiaxg2rsw827n97k1mris6dg596rdwk2gmrwl0rsk0wz";
+      url = mirror://cpan/authors/id/C/CH/CHROMATIC/UNIVERSAL-isa-1.20120726.tar.gz;
+      sha256 = "1qal99sp888b50kwank9ffyprv7kqx42p4vyfahdabf915lyzc61";
+    };
+    meta = {
+      homepage = https://github.com/chromatic/UNIVERSAL-isa;
+      description = "Attempt to recover from people calling UNIVERSAL::isa as a function";
+      license = "perl";
     };
   };
 
@@ -4092,11 +5486,29 @@ rec {
     };
   };
 
-  URI = buildPerlPackage rec {
-    name = "URI-1.59";
+  URI = buildPerlPackage {
+    name = "URI-1.60";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/G/GA/GAAS/${name}.tar.gz";
-      sha256 = "1inanl9vs6q1bwvig1s8hdwagjw4484gs4s7pjnx5f4xb2dx526b";
+      url = mirror://cpan/authors/id/G/GA/GAAS/URI-1.60.tar.gz;
+      sha256 = "0xr31mf7lfrwhyvlx4pzp6p7alls5gi4bj8pk5g89f5cckfd74hz";
+    };
+    meta = {
+      description = "Uniform Resource Identifiers (absolute and relative)";
+      license = "perl";
+    };
+  };
+
+  URIFind = buildPerlModule {
+    name = "URI-Find-20111103";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/M/MS/MSCHWERN/URI-Find-20111103.tar.gz;
+      sha256 = "1igbbj14j5fssdqrbr60mg3w95wldfxdikplqdmqgf2zn5j65ibr";
+    };
+    propagatedBuildInputs = [ URI URIURL ];
+    meta = {
+      homepage = http://search.cpan.org/dist/URI-Find;
+      description = "Find URIs in arbitrary text";
+      license = "perl5";
     };
   };
 
@@ -4109,6 +5521,18 @@ rec {
     buildInputs = [URI TestMore];
   };
 
+  URIURL = buildPerlPackage {
+    name = "URI-URL-5.04";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/G/GA/GAAS/URI-1.60.tar.gz;
+      sha256 = "0xr31mf7lfrwhyvlx4pzp6p7alls5gi4bj8pk5g89f5cckfd74hz";
+    };
+    meta = {
+      description = "Uniform Resource Identifiers (absolute and relative)";
+      license = "perl";
+    };
+  };
+
   VariableMagic = buildPerlPackage rec {
     name = "Variable-Magic-0.48";
     src = fetchurl {
@@ -4118,18 +5542,18 @@ rec {
   };
 
   version = buildPerlPackage rec {
-    name = "version-0.93";
+    name = "version-0.9902";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/version/${name}.tar.gz";
-      sha256 = "1lfq27hshq1gvdqksicp22ag8n1aiijhjw68q3r254kp6zimrz69";
+      sha256 = "17fdj3hxks33plapj3hinjgmyblnh302z52rq4b9spnz22q5vhww";
     };
   };
 
   VersionRequirements = buildPerlPackage rec {
-    name = "Version-Requirements-0.101020";
+    name = "Version-Requirements-0.101022";
     src = fetchurl {
       url = "mirror://cpan/authors/id/R/RJ/RJBS/${name}.tar.gz";
-      sha256 = "18bcfxwn21gcih0bc6p1sp42iis8lwnqh7fpprkniflj8q0ps0x4";
+      sha256 = "0gn4cfx28sfsinxbf9lrxg4lzma8bsj99zb66lsg9irplrkx1pgl";
     };
   };
 
@@ -4163,13 +5587,43 @@ rec {
     doCheck = false; # performs network access
   };
 
-  WWWMechanize = buildPerlPackage rec {
-    name = "WWW-Mechanize-1.54";
+  WWWMechanize = buildPerlPackage {
+    name = "WWW-Mechanize-1.72";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/P/PE/PETDANCE/${name}.tar.gz";
-      sha256 = "1yxvw5xfng5fj4422869p5dwvmrkmqph9gdm2nl12wngydk93lnh";
+      url = mirror://cpan/authors/id/J/JE/JESSE/WWW-Mechanize-1.72.tar.gz;
+      sha256 = "0vs3p2697675bswjayfmm37lg3xsxm94z1mif18s732kwvnpg6m6";
+    };
+    propagatedBuildInputs = [ HTMLForm HTMLParser HTMLTree HTTPDaemon HTTPMessage HTTPServerSimple LWP LWPUserAgent TestWarn URI ];
+    doCheck = false;
+    meta = {
+      homepage = https://github.com/bestpractical/www-mechanize;
+      description = "Handy web browsing in a Perl object";
+      license = "perl5";
+    };
+  };
+
+  WWWRobotRules = buildPerlPackage {
+    name = "WWW-RobotRules-6.02";
+    src = fetchurl {
+      url = mirror://cpan/authors/id/G/GA/GAAS/WWW-RobotRules-6.02.tar.gz;
+      sha256 = "07m50dp5n5jxv3m93i55qvnd67a6g7cvbvlik115kmc8lbkh5da6";
     };
-    propagatedBuildInputs = [LWP HTTPResponseEncoding HTTPServerSimple];
+    propagatedBuildInputs = [ URI ];
+    meta = {
+      description = "Database of robots.txt-derived permissions";
+      license = "perl";
+    };
+  };
+
+  Wx = buildPerlPackage rec {
+    name = "Wx-0.9922";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/M/MD/MDOOTSON/${name}.tar.gz";
+      sha256 = "11x3cvffcyi4b2c6pz9awks3zrg83bg1cwapm4psdiqnd568safw";
+    };
+    propagatedBuildInputs = [ ExtUtilsXSpp AlienWxWidgets ];
+    # Testing requires an X server:
+    #   Error: Unable to initialize GTK+, is DISPLAY set properly?"
     doCheck = false;
   };
 
@@ -4194,10 +5648,10 @@ rec {
   };
 
   XMLLibXML = buildPerlPackage rec {
-    name = "XML-LibXML-2.0001";
+    name = "XML-LibXML-2.0014";
     src = fetchurl {
       url = "mirror://cpan/modules/by-module/XML/${name}.tar.gz";
-      sha256 = "1zx4fqi531yzaf1c5cw1qwb9vy37fksz35a7pp6pic9v8jvz09x6";
+      sha256 = "0r2mw6pnygj2bpng9f4q5jfn4iawhkj47ys3sbnvqymyp1afihf6";
     };
     SKIP_SAX_INSTALL = 1;
     buildInputs = [ pkgs.libxml2 ];
@@ -4273,6 +5727,7 @@ rec {
       sha256 = "07zdsfzw9dlrx6ril9clf1jfif09vpf27rz66laja7mvih9izd1v";
     };
     propagatedBuildInputs = [XMLParser];
+    doCheck = false;  # requires lots of extra packages
   };
 
   XMLWriter = buildPerlPackage rec {
@@ -4283,27 +5738,29 @@ rec {
     };
   };
 
-  XSLoader = buildPerlPackage {
-    name = "XSLoader-0.08";
+  YAML = buildPerlPackage {
+    name = "YAML-0.84";
     src = fetchurl {
-      url = mirror://cpan/authors/id/S/SA/SAPER/XSLoader-0.08.tar.gz;
-      sha256 = "0mr4l3givrpyvz1kg0kap2ds8g0rza2cim9kbnjy8hi64igkixi5";
+      url = mirror://cpan/authors/id/M/MS/MSTROUT/YAML-0.84.tar.gz;
+      sha256 = "03349n2z32gwjqiq7l3g57avvphl2rw3lmwc8i5cl9hmfw51yd8a";
     };
-  };
-
-  YAML = buildPerlPackage rec {
-    name = "YAML-0.80";
-    src = fetchurl {
-      url = "mirror://cpan/authors/id/I/IN/INGY/${name}.tar.gz";
-      sha256 = "81ada73c7eda69dad3cc679b2facba50f2634edcc16c59a7b66bffb9f2fa0e90";
+    meta = {
+      homepage = https://github.com/ingydotnet/yaml-pm/tree;
+      description = "YAML Ain't Markup Language (tm)";
+      license = "perl";
     };
   };
 
-  YAMLSyck = buildPerlPackage rec {
-    name = "YAML-Syck-1.05";
+  YAMLSyck = buildPerlPackage {
+    name = "YAML-Syck-1.22";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/A/AU/AUDREYT/${name}.tar.gz";
-      sha256 = "15acwp2qdxfmhfqj4c1s57xyy48hcfc87lblww3lbvihqbysyzss";
+      url = mirror://cpan/authors/id/T/TO/TODDR/YAML-Syck-1.22.tar.gz;
+      sha256 = "0n3k71i0b8mhdrl5kp1cwyvjbkqahyqkhp81wl3qnkfhyi39f55y";
+    };
+    meta = {
+      homepage = http://search.cpan.org/dist/YAML-Syck;
+      description = "Fast, lightweight YAML loader and dumper";
+      license = "mit";
     };
   };
 
diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix
index 7a45492b032..3c53be875e3 100644
--- a/pkgs/top-level/platforms.nix
+++ b/pkgs/top-level/platforms.nix
@@ -14,7 +14,7 @@ rec {
       ''
         # Virtualisation (KVM, Xen...).
         PARAVIRT_GUEST y
-        KVM_CLOCK y
+        KVM_CLOCK? y #Part of KVM_GUEST since linux 3.7
         KVM_GUEST y
         XEN y
         KSM y
@@ -50,6 +50,9 @@ rec {
         EXT4_FS m
         USB_STORAGE_CYPRESS_ATACB m
 
+        # mv cesa requires this sw fallback, for mv-sha1
+        CRYPTO_SHA1 y
+
         IP_PNP y
         IP_PNP_DHCP y
         NFS_FS y
@@ -70,6 +73,7 @@ rec {
         IP_NF_TARGET_LOG y
         IP_NF_MANGLE y
         IPV6 m
+        VLAN_8021Q m
 
         CIFS y
         CIFS_XATTR y
@@ -77,6 +81,10 @@ rec {
         CIFS_FSCACHE y
         CIFS_ACL y
 
+        WATCHDOG y
+        WATCHDOG_CORE y
+        ORION_WATCHDOG m
+
         ZRAM m
         NETCONSOLE m
 
@@ -97,8 +105,25 @@ rec {
 
         FUSE_FS m
 
-        # nixos mounts some cgroup
+        # systemd uses cgroups
         CGROUPS y
+
+        # Latencytop 
+        LATENCYTOP y
+
+        # Ubi for the mtd
+        MTD_UBI y
+        UBIFS_FS y
+        UBIFS_FS_XATTR y
+        UBIFS_FS_ADVANCED_COMPR y
+        UBIFS_FS_LZO y
+        UBIFS_FS_ZLIB y
+        UBIFS_FS_DEBUG n
+
+        # Kdb, for kernel troubles
+        KGDB y
+        KGDB_SERIAL_CONSOLE y
+        KGDB_KDB y
       '';
     kernelTarget = "uImage";
     uboot = "sheevaplug";
@@ -106,6 +131,89 @@ rec {
     ubootConfig = "sheevaplug_config";
   };
 
+  raspberrypi = {
+    name = "raspberrypi";
+    kernelMajor = "2.6";
+    kernelHeadersBaseConfig = "kirkwood_defconfig";
+    kernelBaseConfig = "bcmrpi_defconfig";
+    kernelArch = "arm";
+    kernelAutoModules = false;
+    kernelExtraConfig =
+      ''
+        BLK_DEV_RAM y
+        BLK_DEV_INITRD y
+        BLK_DEV_CRYPTOLOOP m
+        BLK_DEV_DM m
+        DM_CRYPT m
+        MD y
+        REISERFS_FS m
+        BTRFS_FS y
+        XFS_FS m
+        JFS_FS y
+        EXT4_FS y
+
+        IP_PNP y
+        IP_PNP_DHCP y
+        NFS_FS y
+        ROOT_NFS y
+        TUN m
+        NFS_V4 y
+        NFS_V4_1 y
+        NFS_FSCACHE y
+        NFSD m
+        NFSD_V2_ACL y
+        NFSD_V3 y
+        NFSD_V3_ACL y
+        NFSD_V4 y
+        NETFILTER y
+        IP_NF_IPTABLES y
+        IP_NF_FILTER y
+        IP_NF_MATCH_ADDRTYPE y
+        IP_NF_TARGET_LOG y
+        IP_NF_MANGLE y
+        IPV6 m
+        VLAN_8021Q m
+
+        CIFS y
+        CIFS_XATTR y
+        CIFS_POSIX y
+        CIFS_FSCACHE y
+        CIFS_ACL y
+
+        ZRAM m
+
+        # Fail to build
+        DRM n
+        SCSI_ADVANSYS n
+        USB_ISP1362_HCD n
+        SND_SOC n
+        SND_ALI5451 n
+        FB_SAVAGE n
+        SCSI_NSP32 n
+        ATA_SFF n
+        SUNGEM n
+        IRDA n
+        ATM_HE n
+        SCSI_ACARD n
+        BLK_DEV_CMD640_ENHANCED n
+
+        FUSE_FS m
+
+        # nixos mounts some cgroup
+        CGROUPS y
+
+        # Latencytop 
+        LATENCYTOP y
+      '';
+    kernelTarget = "zImage";
+    uboot = null;
+    gcc = {
+      arch = "armv6";
+      fpu = "vfp";
+      float = "hard";
+    };
+  };
+
   guruplug = sheevaplug // {
     # Define `CONFIG_MACH_GURUPLUG' (see
     # <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
@@ -199,6 +307,12 @@ rec {
     kernelAutoModules = false;
     kernelExtraConfig =
       ''
+        MIGRATION n
+        COMPACTION n
+
+        # nixos mounts some cgroup
+        CGROUPS y
+
         BLK_DEV_RAM y
         BLK_DEV_INITRD y
         BLK_DEV_CRYPTOLOOP m
@@ -252,8 +366,12 @@ rec {
         EXT3_FS y
         REISERFS_FS y
         MAGIC_SYSRQ y
+
+        # The kernel doesn't boot at all, with FTRACE
+        FTRACE n
       '';
     kernelTarget = "vmlinux";
     uboot = null;
+    gcc.arch = "loongson2f";
   };
 }
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 637d53b06f7..52da5007266 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1,47 +1,131 @@
-{ pkgs, python }:
+{ pkgs, python, lowPrio }:
 
-let pythonPackages = python.modules // rec {
+let
+isPy26 = python.majorVersion == "2.6";
+isPy27 = python.majorVersion == "2.7";
+optional = pkgs.lib.optional;
+optionals = pkgs.lib.optionals;
 
-  inherit python;
+pythonPackages = python.modules // rec {
 
+  inherit python;
   inherit (pkgs) fetchurl fetchsvn fetchgit stdenv;
 
+  # helpers
 
   buildPythonPackage = import ../development/python-modules/generic {
     inherit (pkgs) lib;
-    inherit python wrapPython setuptools;
+    inherit python wrapPython setuptools recursivePthLoader offlineDistutils;
+  };
+
+  wrapPython = pkgs.makeSetupHook
+    { deps = pkgs.makeWrapper;
+      substitutions.libPrefix = python.libPrefix;
+    } 
+   ../development/python-modules/generic/wrap.sh;
+
+  # specials
+
+  offlineDistutils = import ../development/python-modules/offline-distutils {
+    inherit (pkgs) stdenv;
+    inherit python;
   };
 
+  recursivePthLoader = import ../development/python-modules/recursive-pth-loader {
+    inherit (pkgs) stdenv;
+    inherit python;
+  };
 
   setuptools = import ../development/python-modules/setuptools {
     inherit (pkgs) stdenv fetchurl;
     inherit python wrapPython;
   };
 
+  setuptoolsSite = import ../development/python-modules/setuptools/site.nix {
+    inherit (pkgs) stdenv;
+    inherit python setuptools;
+  };
+
+  # packages defined elsewhere
 
   ipython = import ../shells/ipython {
+    inherit (pkgs) stdenv fetchurl sip pyqt4;
+    inherit buildPythonPackage pythonPackages;
+  };
+
+  ipythonLight = lowPrio (import ../shells/ipython {
     inherit (pkgs) stdenv fetchurl;
     inherit buildPythonPackage pythonPackages;
+    qtconsoleSupport = false;
+    pylabSupport = false;
+    pylabQtSupport = false;
+  });
+
+  pil = import ../development/python-modules/pil {
+    inherit (pkgs) fetchurl stdenv libjpeg zlib freetype;
+    inherit python buildPythonPackage;
   };
 
+  pitz = import ../applications/misc/pitz {
+    inherit (pkgs) stdenv fetchurl;
+    inherit buildPythonPackage tempita jinja2 pyyaml clepy mock nose decorator docutils;
+  };
 
-  wrapPython = pkgs.makeSetupHook
-    { deps = pkgs.makeWrapper;
-      substitutions.libPrefix = python.libPrefix;
-    }
-    ../development/python-modules/generic/wrap.sh;
+  pycairo = import ../development/python-modules/pycairo {
+    inherit (pkgs) stdenv fetchurl pkgconfig cairo x11;
+    inherit python;
+  };
+
+  pycrypto = import ../development/python-modules/pycrypto {
+    inherit (pkgs) fetchurl stdenv gmp;
+    inherit python buildPythonPackage;
+  };
+
+  pycrypto25 = import ../development/python-modules/pycrypto/2.5.nix {
+    inherit (pkgs) fetchurl stdenv gmp;
+    inherit python buildPythonPackage;
+  };
 
+  pygobject = import ../development/python-modules/pygobject {
+    inherit (pkgs) stdenv fetchurl pkgconfig glib;
+    inherit python;
+  };
+
+  pygobject3 = import ../development/python-modules/pygobject/3.nix {
+    inherit (pkgs) stdenv fetchurl pkgconfig glib gobjectIntrospection cairo;
+    inherit python pycairo;
+  };
+
+  pygtk = import ../development/python-modules/pygtk {
+    inherit (pkgs) fetchurl stdenv pkgconfig glib gtk;
+    inherit python buildPythonPackage pygobject pycairo;
+  };
+
+  # XXX: how can we get an override here?
+  #pyGtkGlade = pygtk.override {
+  #  inherit (pkgs.gnome) libglade;
+  #};
+  pyGtkGlade = import ../development/python-modules/pygtk {
+    inherit (pkgs) fetchurl stdenv pkgconfig glib gtk;
+    inherit (pkgs.gnome) libglade;
+    inherit python buildPythonPackage pygobject pycairo;
+  };
+
+  # packages defined here
 
   afew = buildPythonPackage rec {
-    name = "afew-1.0pre";
+    rev = "6bb3915636aaf86f046a017ffffd9a4ef395e199";
+    name = "afew-1.0_${rev}";
+
     src = fetchurl {
-      url = "https://github.com/teythoon/afew/tarball/master";
+      url = "https://github.com/teythoon/afew/tarball/${rev}";
       name = "${name}.tar.bz";
-      sha256 = "949710f8dcf503f42f2a2d77ea71e48ccf70155a764f75ad29cc93edc120809b";
+      sha256 = "74926d9ddfa69534cfbd08a82f0acccab2c649558062654d5d2ff2999d201384";
     };
 
-    propagatedBuildInputs = [ notmuch pkgs.dbacl ];
+    propagatedBuildInputs = [ pythonPackages.notmuch pkgs.dbacl ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     postInstall = ''
@@ -53,34 +137,96 @@ let pythonPackages = python.modules // rec {
       homepage = https://github.com/teythoon/afew;
       description = "afew is an initial tagging script for notmuch mail.";
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
+    };
+  };
+
+
+  almir = buildPythonPackage rec {
+    name = "almir-0.1.8";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/a/almir/${name}.zip";
+      md5 = "9a1f3c72a039622ca72b74be7a1cd37e";
+    };
+
+    buildInputs = [
+      pkgs.which
+      pkgs.unzip
+      pythonPackages.coverage
+      pythonPackages.mock
+      pythonPackages.tissue
+      pythonPackages.unittest2
+      pythonPackages.webtest
+    ];
+
+    propagatedBuildInputs = [ 
+      pkgs.makeWrapper
+      pkgs.bacula
+      pythonPackages.colander
+      pythonPackages.deform
+      pythonPackages.deform_bootstrap
+      pythonPackages.docutils
+      pythonPackages.nose
+      pythonPackages.mysql_connector_repackaged
+      pythonPackages.pg8000
+      pythonPackages.pyramid
+      pythonPackages.pyramid_beaker
+      pythonPackages.pyramid_exclog
+      pythonPackages.pyramid_jinja2
+      pythonPackages.pyramid_tm
+      pythonPackages.pytz
+      pythonPackages.sqlalchemy
+      pythonPackages.transaction
+      pythonPackages.waitress
+      pythonPackages.webhelpers
+      pythonPackages.zope_sqlalchemy
+    ];
+
+    postInstall = ''
+      ln -s ${pyramid}/bin/pserve $out/bin
+      ln -s ${pkgs.bacula}/bin/bconsole $out/bin
+      wrapProgram "$out/bin/pserve" \
+        --suffix PYTHONPATH : "$out/lib/python2.7/site-packages"
+    '';
+
+    meta = {
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
     };
   };
 
 
   alot = buildPythonPackage rec {
-    name = "alot-0.3.1";
+    rev = "d3c1880a60ddd8ded397d92cddf310a948b97fdc";
+    name = "alot-0.3.4_${rev}";
 
     src = fetchurl {
-      url = "https://github.com/pazz/alot/tarball/master";
+      url = "https://github.com/pazz/alot/tarball/${rev}";
       name = "${name}.tar.bz";
-      sha256 = "06683de36688615d3d526198c93133e1131897c888ffa31e83f1ad292eae57af";
+      sha256 = "049fzxs83zry5xr3al5wjvh7bcjq63wilf9wxh2c6sjmg96kpvvl";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
-    propagatedBuildInputs = [ notmuch urwid twisted magic configobj pygpgme ];
+    propagatedBuildInputs =
+      [ pythonPackages.notmuch
+        pythonPackages.urwid
+        pythonPackages.twisted
+        pythonPackages.magic
+        pythonPackages.configobj
+        pythonPackages.pygpgme
+      ];
 
     postInstall = ''
       wrapProgram $out/bin/alot \
-        --prefix LD_LIBRARY_PATH : ${pkgs.notmuch}/lib:${pkgs.file511}/lib
+        --prefix LD_LIBRARY_PATH : ${pkgs.notmuch}/lib:${pkgs.file}/lib:${pkgs.gpgme}/lib
     '';
 
     meta = {
       homepage = https://github.com/pazz/alot;
       description = "Terminal MUA using notmuch mail";
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -93,7 +239,7 @@ let pythonPackages = python.modules // rec {
       md5 = "2b53b5d53fc40af4da7268d3c3e35a50";
     };
 
-    buildInputs = [ nose ];
+    buildInputs = [ pythonPackages.nose ];
 
     meta = {
       homepage = http://pypi.python.org/pypi/anyjson/;
@@ -110,6 +256,7 @@ let pythonPackages = python.modules // rec {
       sha1 = "f124e5e4a6644bf6d1734032a01ac44db1b25a29";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -129,6 +276,7 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [ pkgs.unzip pkgs.sqlite ];
 
+    # python: double free or corruption (fasttop): 0x0000000002fd4660 ***
     doCheck = false;
 
     meta = {
@@ -138,17 +286,36 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  area53 = buildPythonPackage (rec {
+    name = "area53-b2c9cdcabd";
+
+    src = fetchgit {
+      url = git://github.com/mariusv/Area53.git;
+      rev = "b2c9cdcabd";
+      sha256 = "b0c12b8c48ed9180c7475fab18de50d63e1b517cfb46da4d2c66fc406fe902bc";
+    };
+
+    installCommand = "python setup.py install --prefix=$out";
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    propagatedBuildInputs = [ pythonPackages.boto ];
+
+  });
+
+
   argparse = buildPythonPackage (rec {
-    name = "argparse-1.1";
+    name = "argparse-1.2.1";
 
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/a/argparse/${name}.zip";
-      sha256 = "ee6da1aaad8b08a74a33eb82264b1a2bf12a7d5aefc7e9d7d40a8f8fa9912e62";
+      url = "http://argparse.googlecode.com/files/${name}.tar.gz";
+      sha256 = "192174mys40m0bwk6l5jlfnzps0xi81sxm34cqms6dc3c454pbyx";
     };
 
     buildInputs = [ pkgs.unzip ];
 
-    # How do we run the tests?
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -169,36 +336,120 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  astng = buildPythonPackage rec {
-    name = "logilab-astng-0.21.1";
+
+  awscli = buildPythonPackage rec {
+    name = "awscli-0.8.3";
+    namePrefix = "";
 
     src = fetchurl {
-      url = "ftp://ftp.logilab.org/pub/astng/${name}.tar.gz";
-      sha256 = "0rqp2vwrnv6gkzdd96j078h1sz26plh49cmnyswy2wb6l4wans67";
+      url = https://github.com/aws/aws-cli/archive/0.8.3.tar.gz;
+      sha256 = "0v7igh00zja560v8qz315g3m7x9six1hprrrb10cpp9sy8n58xnn";
     };
-    propagatedBuildInputs = [logilabCommon];
+
+    propagatedBuildInputs =
+      [ pythonPackages.argparse
+        pythonPackages.botocore
+        pythonPackages.colorama
+      ];
   };
 
-  beautifulsoap = buildPythonPackage (rec {
-    name = "beautifulsoap-3.0.8";
+
+  beautifulsoup = buildPythonPackage (rec {
+    name = "beautifulsoup-3.2.1";
 
     src = fetchurl {
-      url = "http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.0.8.tar.gz";
-      sha256 = "1gasiy5lwbhsxw27g36d88n36xbj52434klisvqhljgckd4xqcy7";
+      url = "http://www.crummy.com/software/BeautifulSoup/download/3.x/BeautifulSoup-3.2.1.tar.gz";
+      sha256 = "1nshbcpdn0jpcj51x0spzjp519pkmqz0n0748j7dgpz70zlqbfpm";
     };
 
-    # No tests implemented
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
       homepage = http://www.crummy.com/software/BeautifulSoup/;
-
       license = "bsd";
-
       description = "Undemanding HTML/XML parser";
     };
   });
 
+  beautifulsoup4 = buildPythonPackage (rec {
+    name = "beautifulsoup4-4.1.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/b/beautifulsoup4/${name}.tar.gz";
+      md5 = "c012adc06217b8532c446d181cc56586";
+    };
+
+    # invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://crummy.com/software/BeautifulSoup/bs4/;
+      description = "HTML and XML parser";
+      license = stdenv.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+
+  beaker = buildPythonPackage rec {
+    name = "Beaker-1.6.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/B/Beaker/${name}.tar.gz";
+      md5 = "c2e102870ed4c53104dec48ceadf8e9d";
+    };
+
+    buildInputs =
+      [ pythonPackages.sqlalchemy
+        pythonPackages.pycryptopp
+        pythonPackages.nose
+        pythonPackages.mock
+        pythonPackages.webtest
+      ];
+
+    # http://hydra.nixos.org/build/4511591/log/raw
+    doCheck = false;
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  beets = buildPythonPackage rec {
+    name = "beets-1.0.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/b/beets/${name}.tar.gz";
+      md5 = "88ad09a93aa0d69ce813205cf23b2a6c";
+    };
+
+    # tests depend on $HOME setting
+    configurePhase = "export HOME=$TMPDIR";
+
+    propagatedBuildInputs =
+      [ pythonPackages.pyyaml
+        pythonPackages.unidecode
+        pythonPackages.mutagen
+        pythonPackages.munkres
+        pythonPackages.musicbrainzngs
+        python.modules.sqlite3
+        python.modules.readline
+      ];
+
+    meta = {
+      homepage = http://beets.radbox.org;
+      description = "Music tagger and library organizer";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
 
   # euca2ools (and maybe Nova) needs boto 1.9, 2.0 doesn't work.
   boto_1_9 = buildPythonPackage (rec {
@@ -228,11 +479,11 @@ let pythonPackages = python.modules // rec {
 
 
   boto = buildPythonPackage rec {
-    name = "boto-2.3.0";
+    name = "boto-2.6.0";
 
     src = fetchurl {
       url = "https://github.com/downloads/boto/boto/${name}.tar.gz";
-      sha256 = "05im9vyk9wq8cjw4cp93jlqb9v98rnrm067p93ih7f0ynnlnjaf1";
+      sha256 = "1wnzs9frf44mrnw7l2vijc5anbcvcqqrv7237gjn27v0ja76slff";
     };
 
     # The tests seem to require AWS credentials.
@@ -254,23 +505,90 @@ let pythonPackages = python.modules // rec {
   };
 
 
-  bugz = buildPythonPackage (rec {
-    name = "bugz-0.9.3";
+  botocore = buildPythonPackage rec {
+    name = "botocore-0.8.3";
 
-    src = fetchgit {
-      url = "git://github.com/williamh/pybugz.git";
-      rev = "refs/tags/0.9.3";
+    src = fetchurl {
+      url = https://github.com/boto/botocore/archive/0.8.3.tar.gz;
+      sha256 = "0dbm2clrh7zs4brqqj3xssz3nymdg24ff2lww27s3wliirwqdiv1";
     };
 
-    propagatedBuildInputs = [ argparse python.modules.ssl ];
-
-    doCheck = false;
+    propagatedBuildInputs =
+      [ pythonPackages.dateutil
+        pythonPackages.requests
+        pythonPackages.jmespath
+      ];
 
     meta = {
-      homepage = http://www.liquidx.net/pybugz/;
-      description = "Command line interface for Bugzilla";
+      homepage = https://github.com/boto/botocore;
+
+      license = "bsd";
+
+      description = "A low-level interface to a growing number of Amazon Web Services";
+
     };
-  });
+  };
+
+
+  # bugz = buildPythonPackage (rec {
+  #   name = "bugz-0.9.3";
+  #
+  #   src = fetchgit {
+  #     url = "https://github.com/williamh/pybugz.git";
+  #     rev = "refs/tags/0.9.3";
+  #   };
+  #
+  #   propagatedBuildInputs = [ pythonPackages.argparse python.modules.ssl ];
+  #
+  #   doCheck = false;
+  #
+  #   meta = {
+  #     homepage = http://www.liquidx.net/pybugz/;
+  #     description = "Command line interface for Bugzilla";
+  #   };
+  # });
+
+
+  buildout = zc_buildout;
+  buildout152 = zc_buildout152;
+
+  zc_buildout = zc_buildout171;
+  zc_buildout171 = buildPythonPackage rec {
+    name = "zc.buildout-1.7.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.buildout/${name}.tar.gz";
+      md5 = "8834a21586bf2be53dc412002241a996";
+    };
+
+   meta = {
+      homepage = "http://www.buildout.org";
+      description = "A software build and configuration system";
+      license = pkgs.lib.licenses.zpt21;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  };
+  zc_buildout152 = buildPythonPackage rec {
+    name = "zc.buildout-1.5.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.buildout/${name}.tar.gz";
+      md5 = "87f7b3f8d13926c806242fd5f6fe36f7";
+    };
+
+   # TODO: consider if this patch should be an option
+   # It makes buildout useful in a nix profile, but this alters the default functionality
+   patchPhase = ''
+     sed -i "s/return (stdlib, site_paths)/return (stdlib, sys.path)/g" src/zc/buildout/easy_install.py
+   '';
+
+   meta = {
+      homepage = "http://www.buildout.org";
+      description = "A software build and configuration system";
+      license = pkgs.lib.licenses.zpt21;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  };
 
 
   carrot = buildPythonPackage rec {
@@ -281,9 +599,12 @@ let pythonPackages = python.modules // rec {
       md5 = "530a0614de3a669314c3acd4995c54d5";
     };
 
-    buildInputs = [ nose ];
+    buildInputs = [ pythonPackages.nose ];
 
-    propagatedBuildInputs = [ amqplib anyjson ];
+    propagatedBuildInputs =
+      [ pythonPackages.amqplib
+        pythonPackages.anyjson
+      ];
 
     doCheck = false; # depends on the network
 
@@ -303,7 +624,7 @@ let pythonPackages = python.modules // rec {
       md5 = "853917116e731afbc8c8a43c37e6ddba";
     };
 
-    propagatedBuildInputs = [ markdown ];
+    propagatedBuildInputs = [ pythonPackages.markdown ];
 
     meta = {
       homepage = http://www.cheetahtemplate.org/;
@@ -313,13 +634,15 @@ let pythonPackages = python.modules // rec {
 
 
   cherrypy = buildPythonPackage (rec {
-    name = "cherrypy-3.1.2";
+    name = "cherrypy-${version}";
+    version = "3.2.2";
 
     src = fetchurl {
-      url = "http://download.cherrypy.org/cherrypy/3.1.2/CherryPy-3.1.2.tar.gz";
-      sha256 = "1xlvanhnxgvwd7vvypbafyl6yqfkpnwa9rs9k3058z84gd86bz8d";
+      url = "http://download.cherrypy.org/cherrypy/${version}/CherryPy-${version}.tar.gz";
+      sha256 = "14dn129h69wj0h8yr0bjwbrk8kygl6mkfnxc5m3fxhlm4xb8hnnw";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -328,6 +651,24 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+
+  clepy = buildPythonPackage rec {
+    name = "clepy-0.3.20";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/c/clepy/${name}.tar.gz";
+      sha256 = "16vibfxms5z4ld8gbkra6dkhqm2cc3jnn0fwp7mw70nlwxnmm51c";
+    };
+
+    buildInputs = [ pythonPackages.mock pythonPackages.nose pythonPackages.decorator ];
+
+    meta = {
+      homepage = http://code.google.com/p/clepy/;
+      description = "Utilities created by the Cleveland Python users group";
+    };
+  };
+
+
   clientform = buildPythonPackage (rec {
     name = "clientform-0.2.10";
 
@@ -345,6 +686,27 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+
+  colorama = buildPythonPackage rec {
+    name = "clientform-0.2.10";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/c/colorama/colorama-0.2.5.tar.gz";
+      md5 = "308c6e38917bdbfc4d3b0783c614897d";
+    };
+
+    propagatedBuildInputs = [ pythonPackages.clientform ];
+
+    doCheck = false;
+
+    meta = {
+      homepage = http://code.google.com/p/colorama/;
+      license = "bsd";
+      description = "Cross-platform colored terminal text";
+    };
+  };
+
+
   coilmq = buildPythonPackage (rec {
     name = "coilmq-0.6.1";
 
@@ -353,18 +715,41 @@ let pythonPackages = python.modules // rec {
       md5 = "5f39727415b837abd02651eeb2721749";
     };
 
-    propagatedBuildInputs = [ stompclient distribute ]; 
-      
+    propagatedBuildInputs = [ pythonPackages.stompclient pythonPackages.distribute ];
+
+    buildInputs = [ pythonPackages.coverage pythonPackages.sqlalchemy ];
+
+    # ValueError: Could not parse auth file:
+    # /tmp/nix-build-.../CoilMQ-0.6.1/coilmq/tests/resources/auth.ini
     doCheck = false;
 
     meta = {
       description = "Simple, lightweight, and easily extensible STOMP message broker";
       homepage = http://code.google.com/p/coilmq/;
       license = pkgs.lib.licenses.asl20;
-      platforms = python.meta.platforms;
     };
   });
 
+
+  colander = buildPythonPackage rec {
+    name = "colander-0.9.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/colander/${name}.tar.gz";
+      md5 = "2d9f65a64cb6b7f35d6a0d7b607ce4c6";
+    };
+
+    propagatedBuildInputs = [ pythonPackages.translationstring ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
   configobj = buildPythonPackage (rec {
     name = "configobj-4.7.2";
 
@@ -373,6 +758,7 @@ let pythonPackages = python.modules // rec {
       md5 = "201dbaa732a9049c839f9bb6c27fc7b5";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -380,10 +766,47 @@ let pythonPackages = python.modules // rec {
       homepage = http://pypi.python.org/pypi/configobj;
       license = pkgs.lib.licenses.bsd3;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   });
 
+  coverage = buildPythonPackage rec {
+    name = "coverage-3.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/coverage/${name}.tar.gz";
+      md5 = "67d4e393f4c6a5ffc18605409d2aa1ac";
+    };
+
+    meta = {
+      description = "Code coverage measurement for python";
+      homepage = http://nedbatchelder.com/code/coverage/;
+      license = pkgs.lib.licenses.bsd3;
+      maintainers = [ stdenv.lib.maintainers.shlevy ];
+    };
+  };
+
+  covCore = buildPythonPackage rec {
+    name = "cov-core-1.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/cov-core/cov-core-1.7.tar.gz";
+      md5 = "59c1e22e636633e10120beacbf45b28c";
+    };
+    meta = {
+      description = "plugin core for use by pytest-cov, nose-cov and nose2-cov";
+    };
+    propagatedBuildInputs = [ pythonPackages.coverage ];
+  };
+
+  cssselect = buildPythonPackage rec {
+    name = "cssselect-0.7.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/cssselect/cssselect-0.7.1.tar.gz";
+      md5 = "c6c5e9a2e7ca226ce03f6f67a771379c";
+    };
+    # AttributeError: 'module' object has no attribute 'tests'
+    doCheck = false;
+  };
+
   cssutils = buildPythonPackage (rec {
     name = "cssutils-0.9.9";
 
@@ -392,9 +815,9 @@ let pythonPackages = python.modules // rec {
       sha256 = "139yfm9yz9k33kgqw4khsljs10rkhhxyywbq9i82bh2r31cil1pp";
     };
 
-    buildInputs = [ pkgs.unzip ];
+    buildInputs = [ pkgs.unzip pythonPackages.mock ];
 
-    # The tests fail - I don't know why
+    # couple of failing tests
     doCheck = false;
 
     meta = {
@@ -414,14 +837,14 @@ let pythonPackages = python.modules // rec {
       md5 = "94ca7e8c9ea0f69c0f3fc6f9fc88f65a";
     };
 
-    buildInputs = [ mock ];
+    buildInputs = [ pythonPackages.mock ];
 
     # Note: We don't actually need to provide Darcs as a build input.
     # Darcsver will DTRT when Darcs isn't available.  See news.gmane.org
     # http://thread.gmane.org/gmane.comp.file-systems.tahoe.devel/3200 for a
     # discussion.
 
-    # Gives "ValueError: Empty module name" with no clue as to why.
+    # AttributeError: 'module' object has no attribute 'test_darcsver'
     doCheck = false;
 
     meta = {
@@ -433,8 +856,26 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  
+
   dateutil = buildPythonPackage (rec {
+    name = "dateutil-2.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-dateutil/python-${name}.tar.gz";
+      sha256 = "1vlx0lpsxjxz64pz87csx800cwfqznjyr2y7nk3vhmzhkwzyqi2c";
+    };
+
+    propagatedBuildInputs = [ pythonPackages.six ];
+
+    meta = {
+      description = "Powerful extensions to the standard datetime module";
+      homepage = http://pypi.python.org/pypi/python-dateutil;
+      license = "BSD-style";
+    };
+  });
+
+  # Buildbot 0.8.7p1 needs dateutil==1.5
+  dateutil_1_5 = buildPythonPackage (rec {
     name = "dateutil-1.5";
 
     src = fetchurl {
@@ -442,6 +883,8 @@ let pythonPackages = python.modules // rec {
       sha256 = "02dhw57jf5kjcp7ng1if7vdrbnlpb9yjmz7wygwwvf3gni4766bg";
     };
 
+    propagatedBuildInputs = [ pythonPackages.six ];
+
     meta = {
       description = "Powerful extensions to the standard datetime module";
       homepage = http://pypi.python.org/pypi/python-dateutil;
@@ -463,32 +906,418 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  distribute = buildPythonPackage (rec {
-    name = "distribute-0.6.26";
+
+  deform = buildPythonPackage rec {
+    name = "deform-0.9.4";
 
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.26.tar.gz";
-      md5 = "841f4262a70107f85260362f5def8206"; #"ecd75ea629fee6d59d26f88c39b2d291";
-      
+      url = "http://pypi.python.org/packages/source/d/deform/${name}.tar.gz";
+      md5 = "2ed7b69644a6d8f4e1404e1892329240";
     };
 
-    buildInputs = [ pkgs.unzip ];
-    
-    installCommand = 
-      ''
-        # ehm, YES, the --verbose flags needs to be there, otherwise it tries to patch setuptools!
-        easy_install --verbose --prefix=$out .
-      '';
+    buildInputs = [] ++ optional isPy26 unittest2;
+
+    propagatedBuildInputs =
+      [ pythonPackages.beautifulsoup4
+        pythonPackages.peppercorn
+        pythonPackages.colander
+        pythonPackages.translationstring
+        pythonPackages.chameleon
+      ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  deform_bootstrap = buildPythonPackage rec {
+    name = "deform_bootstrap-0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/deform_bootstrap/${name}.tar.gz";
+      md5 = "57812251f327367761f32d49a8286aa4";
+    };
+
+    propagatedBuildInputs = [ deform ];
+
+    meta = {
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  evdev = buildPythonPackage rec {
+    version = "0.3.2";
+    name = "evdev-${version}";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/e/evdev/${name}.tar.gz";
+      sha256 = "07gmynz764sln2sq18aafx13yawkv5nkqrkk06rj71sq71fsr9h9";
+    };
+
+    buildInputs = [ pkgs.linuxHeaders ];
+
+    patchPhase = "sed -e 's#/usr/include/linux/input.h#${pkgs.linuxHeaders}/include/linux/input.h#' -i setup.py";
+
+    doCheck = false;
+
+    meta = with stdenv.lib; {
+      description = "Provides bindings to the generic input event interface in Linux";
+      homepage = http://pythonhosted.org/evdev;
+      license = licenses.bsd3;
+      maintainers = [ maintainers.goibhniu ];
+    };
+  };
+
+
+  logilab_astng = buildPythonPackage rec {
+    name = "logilab-astng-0.24.1";
+
+    src = fetchurl {
+      url = "http://download.logilab.org/pub/astng/${name}.tar.gz";
+      sha256 = "00qxaxsax80sknwv25xl1r49lc4gbhkxs1kjywji4ad8y1npax0s";
+    };
+
+    propagatedBuildInputs = [ logilab_common ];
+  };
+
+
+  peppercorn = buildPythonPackage rec {
+    name = "peppercorn-0.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/peppercorn/${name}.tar.gz";
+      md5 = "464d6f2342eaf704dfb52046c1f5c320";
+    };
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pudb = buildPythonPackage rec {
+    name = "pudb-2013.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pudb/${name}.tar.gz";
+      md5 = "f94922aba7f862f13886457dc3fadc6a";
+    };
+
+    propagatedBuildInputs = [ pythonPackages.pygments pythonPackages.urwid ];
+
+    meta = with stdenv.lib; {
+      description = "A full-screen, console-based Python debugger";
+      license = licenses.mit;
+      platforms = platforms.all;
+    };
+  };
+
+
+  pyramid = buildPythonPackage rec {
+    name = "pyramid-1.3.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyramid/${name}.tar.gz";
+      md5 = "967a04fcb2143b31b279c3013a778a2b";
+    };
+
+    buildInputs = [ 
+      docutils 
+      virtualenv 
+      webtest 
+      zope_component 
+      zope_interface 
+    ] ++ optional isPy26 unittest2;
+
+    propagatedBuildInputs = [
+      chameleon
+      Mako
+      paste_deploy
+      repoze_lru
+      repoze_sphinx_autointerface
+      translationstring
+      venusian
+      webob
+      zope_deprecation
+      zope_interface
+    ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pyramid_beaker = buildPythonPackage rec {
+    name = "pyramid_beaker-0.7";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyramid_beaker/${name}.tar.gz";
+      md5 = "acb863517a98b90b5f29648ce55dd563";
+    };
+
+    propagatedBuildInputs = [ beaker pyramid ];
+
+    meta = {
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pyramid_jinja2 = buildPythonPackage rec {
+    name = "pyramid_jinja2-1.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyramid_jinja2/${name}.zip";
+      md5 = "b7df1ab97f90f39529d27ba6da1f6b1c";
+    };
+
+    buildInputs = [ pkgs.unzip webtest ];
+    propagatedBuildInputs = [ jinja2 pyramid ];
+
+    meta = {
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pyramid_exclog = buildPythonPackage rec {
+    name = "pyramid_exclog-0.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyramid_exclog/${name}.tar.gz";
+      md5 = "5c18706f5500605416afff311120c933";
+    };
+
+    propagatedBuildInputs = [ pyramid ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pyramid_tm = buildPythonPackage rec {
+    name = "pyramid_tm-0.7";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyramid_tm/${name}.tar.gz";
+      md5 = "6dc917d262c69366630c542bd21859a3";
+    };
+
+    propagatedBuildInputs = [ transaction pyramid ];
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  repoze_lru = buildPythonPackage rec {
+    name = "repoze.lru-0.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/repoze.lru/${name}.tar.gz";
+      md5 = "9f6ab7a4ff871ba795cadf56c20fb0f0";
+    };
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+
+  repoze_sphinx_autointerface = buildPythonPackage rec {
+    name = "repoze.sphinx.autointerface-0.7.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/repoze.sphinx.autointerface/${name}.tar.gz";
+      md5 = "f2fee996ae28dc16eb48f1a3e8f64801";
+    };
+
+    propagatedBuildInputs = [ zope_interface sphinx ];
+
+    meta = {
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  rtmidi = buildPythonPackage rec {
+    version = "0.3a";
+    name = "rtmidi-${version}";
+
+    src = fetchurl {
+      url = "http://chrisarndt.de/projects/python-rtmidi/download/python-${name}.tar.bz2";
+      sha256 = "0d2if633m3kbiricd5hgn1csccd8xab6lnab1bq9prdr9ks9i8h6";
+    };
+
+    buildInputs = [ pkgs.alsaLib pkgs.jackaudio ];
+
+    meta = with stdenv.lib; {
+      description = "A Python wrapper for the RtMidi C++ library written with Cython";
+      homepage = http://trac.chrisarndt.de/code/wiki/python-rtmidi;
+      license = licenses.mit;
+      maintainers = [ maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_deprecation = buildPythonPackage rec {
+    name = "zope.deprecation-3.5.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.deprecation/${name}.tar.gz";
+      md5 = "1e7db82583013127aab3e7e790b1f2b6";
+    };
+
+    buildInputs = [ zope_testing ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  venusian = buildPythonPackage rec {
+    name = "venusian-1.0a7";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/v/venusian/${name}.tar.gz";
+      md5 = "6f67506dd3cf77116f1c01682a6c3f27";
+    };
+
+    # TODO: https://github.com/Pylons/venusian/issues/23
     doCheck = false;
 
     meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  chameleon = buildPythonPackage rec {
+    name = "Chameleon-2.11";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/C/Chameleon/${name}.tar.gz";
+      md5 = "df72458bf3dd26a744dcff5ad555c34b";
+    };
+
+    buildInputs = [] ++ optionals isPy26 [ ordereddict unittest2 ];
+
+    # TODO: https://github.com/malthe/chameleon/issues/139
+    doCheck = false;
+
+    meta = {
+       maintainers = [
+         stdenv.lib.maintainers.garbas
+         stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  distribute = stdenv.mkDerivation rec {
+    name = "distribute-0.6.34";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/d/distribute/distribute-0.6.34.tar.gz";
+      md5 = "4576ab843a6db5100fb22a72deadf56d";
+    };
+
+    buildInputs = [ python wrapPython offlineDistutils ];
+
+    pythonPath = [ recursivePthLoader ];
+
+    installPhase=''
+      dst="$out/lib/${python.libPrefix}/site-packages"
+      mkdir -p $dst
+      PYTHONPATH="${offlineDistutils}/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+      export PYTHONPATH="$dst:$PYTHONPATH"
+
+      python setup.py install --prefix="$out"
+
+      eapth="$out/lib/${python.libPrefix}"/site-packages/easy-install.pth
+      if [ -e "$eapth" ]; then
+          # move colliding easy_install.pth to specifically named one
+          mv "$eapth" $(dirname "$eapth")/${name}.pth
+      fi
+
+      rm -f "$out/lib/${python.libPrefix}"/site-packages/site.py*
+
+      wrapPythonPrograms
+    '';
+
+    meta = {
       description = "Easily download, build, install, upgrade, and uninstall Python packages";
       homepage = http://packages.python.org/distribute;
       license = "PSF or ZPL";
-      platforms = python.meta.platforms;
     };
-  });
-  
+  };
+
+
+  distutils2  = buildPythonPackage rec {
+    name = "distutils2-${version}";
+    version = "1.0a4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/D/Distutils2/Distutils2-${version}.tar.gz";
+      md5 = "52bc9dffb394970c27e02853ae3a3241";
+    };
+
+    patchPhase = ''
+      sed -e "s#html.entities#htmlentitydefs#g" -i distutils2/pypi/simple.py
+    '';
+
+    doCheck = false;
+
+    meta = {
+      description = "A Python Packaging Library";
+      homepage = http://pypi.python.org/pypi/Distutils2;
+      license = "PSF";
+    };
+  };
+
 
   distutils_extra = buildPythonPackage rec {
     name = "distutils-extra-2.26";
@@ -504,7 +1333,68 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+  deluge = buildPythonPackage rec {
+    name = "deluge-1.3.6";
+
+    src = fetchurl {
+      url = "http://download.deluge-torrent.org/source/${name}.tar.gz";
+      md5 = "33557678bf2f320de670ddaefaea009d";
+    };
+
+    propagatedBuildInputs = with pkgs; [
+      pyGtkGlade libtorrentRasterbar twisted Mako chardet pyxdg pyopenssl
+    ];
+ 
+    postInstall = ''
+       cp -R deluge/data/share $out/share
+       cp -R deluge/data/pixmaps $out/share/
+       cp -R deluge/data/icons $out/share/
+    '';
+
+    meta = {
+      homepage = http://deluge-torrent.org;
+      description = "Torrent client";
+      license = stdenv.lib.licenses.gpl3Plus;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+  pyxdg = buildPythonPackage rec {
+    name = "pyxdg-0.25";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyxdg/${name}.tar.gz";
+      md5 = "bedcdb3a0ed85986d40044c87f23477c";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://freedesktop.org/wiki/Software/pyxdg;
+      description = "Contains implementations of freedesktop.org standards";
+      license = "LGPLv2";
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+  chardet = buildPythonPackage rec {
+    name = "chardet-2.1.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/c/chardet/${name}.tar.gz";
+      md5 = "295367fd210d20f3febda615a88e1ef0";
+    };
+
+    meta = {
+      homepage = https://github.com/erikrose/chardet;
+      description = "Universal encoding detector";
+      license = "LGPLv2";
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
   django = buildPythonPackage rec {
     name = "Django-${version}";
     version = "1.4.1";
@@ -514,6 +1404,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "16s0anvpaccbqmdrhl71z73k0dy2sl166nnc2fbd5lshlgmj13ad";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -522,15 +1413,16 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   django_1_3 = buildPythonPackage rec {
-    name = "Django-1.3.2";
+    name = "Django-1.3.7";
 
     src = fetchurl {
       url = "http://www.djangoproject.com/m/releases/1.3/${name}.tar.gz";
-      sha256 = "0r6pdm33x96aba9x36jvqpkh2bf1zixnzvr12mcc8qq8wc7hii3j";
+      sha256 = "12pv8y2x3fhrcrjayfm6z40r57iwchfi5r19ajs8q8z78i3z8l7f";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -539,13 +1431,13 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   django_evolution = buildPythonPackage rec {
-    name = "django_evolution-0.6.7";
+    name = "django_evolution-0.6.9";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/d/django_evolution/${name}.tar.gz";
-      md5 = "24b8373916f53f74d701b99a6cf41409";
+      md5 = "c0d7d10bc41898c88b14d434c48766ff";
     };
 
     propagatedBuildInputs = [ django_1_3 ];
@@ -556,16 +1448,16 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   djblets = buildPythonPackage rec {
-    name = "Djblets-0.6.19";
+    name = "Djblets-0.6.28";
 
     src = fetchurl {
       url = "http://downloads.reviewboard.org/releases/Djblets/0.6/${name}.tar.gz";
-      sha256 = "1hhvpi81yknvlaazq1cpgamp9vf3x1fcr0ba64q3j2yz1kgin1i8";
+      sha256 = "11fsi911cqkjgv9j7646ljc2fgxsdfyq44kzmv01xhysm50fn6xx";
     };
 
-    propagatedBuildInputs = [ pkgs.pil django_1_3 ];
+    propagatedBuildInputs = [ pil django_1_3 feedparser ];
 
     meta = {
       description = "A collection of useful extensions for Django";
@@ -573,7 +1465,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   dulwich = buildPythonPackage rec {
     name = "dulwich-0.8.1";
 
@@ -586,7 +1478,10 @@ let pythonPackages = python.modules // rec {
     installCommand = ''
       python setup.py install --prefix="$out" --root=/ --record="$out/lib/${python.libPrefix}/site-packages/dulwich/list.txt" --single-version-externally-managed
     '';
-    doCheck = false;
+
+    # For some reason "python setup.py test" doesn't work with Python 2.6.
+    # pretty sure that is about import behaviour.
+    doCheck = python.majorVersion != "2.6";
 
     meta = {
       description = "Simple Python implementation of the Git file formats and protocols.";
@@ -594,7 +1489,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   hggit = buildPythonPackage rec {
     name = "hg-git-0.3.1";
 
@@ -611,7 +1506,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   docutils = buildPythonPackage rec {
     name = "docutils-0.8.1";
 
@@ -620,6 +1515,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0wfz4nxl95jcr2f2mc5gijgighavcghg33plzbz5jyi531jpffss";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -628,6 +1524,22 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  doxypy = buildPythonPackage rec {
+    name = "doxypy-0.4.2";
+
+    src = fetchurl {
+      url = "http://code.foosel.org/files/${name}.tar.gz";
+      sha256 = "1afmb30zmy7942b53qa5vd3js883wwqqls35n8xfb3rnj0qnll8g";
+    };
+
+    meta = {
+      homepage = http://code.foosel.org/doxypy;
+      description = "An input filter for Doxygen";
+    };
+
+    doCheck = false;
+  };
+
 
   dtopt = buildPythonPackage rec {
     name = "dtopt-0.1";
@@ -644,6 +1556,24 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  elpy = buildPythonPackage rec {
+    name = "elpy-1.0.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/elpy/elpy-1.0.1.tar.gz";
+      md5 = "5453f085f7871ed8fc11d51f0b68c785";
+    };
+    buildInputs = [  ];
+    propagatedBuildInputs = [ flake8 ];
+
+    doCheck = false; # there are no tests
+
+    meta = {
+      description = "Backend for the elpy Emacs mode";
+      homepage = "https://github.com/jorgenschaefer/elpy";
+    };
+  };
+
+
   enum = buildPythonPackage rec {
     name = "enum-0.4.4";
 
@@ -663,6 +1593,23 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  epc = buildPythonPackage rec {
+    name = "epc-0.0.3";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/e/epc/${name}.tar.gz";
+      md5 = "04a93c0cd32b496969ead09f414dac74";
+    };
+
+    propagatedBuildInputs = [ sexpdata ];
+    doCheck = false;
+
+    meta = {
+      description = "EPC (RPC stack for Emacs Lisp) implementation in Python";
+      homepage = "https://github.com/tkf/python-epc";
+    };
+  };
+
+
   eventlet = buildPythonPackage rec {
     name = "eventlet-0.9.16";
 
@@ -686,6 +1633,46 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  feedparser = buildPythonPackage (rec {
+    name = "feedparser-5.1.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/feedparser/${name}.tar.gz";
+      md5 = "f2253de78085a1d5738f626fcc1d8f71";
+    };
+
+    meta = {
+      homepage = http://code.google.com/p/feedparser/;
+      description = "Universal feed parser";
+      license = stdenv.lib.licenses.bsd2;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+
+  flake8 = buildPythonPackage (rec {
+    name = "flake8-2.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/f/flake8/${name}.tar.gz";
+      md5 = "176c6b3613777122721db181560aa1e3";
+    };
+
+    buildInputs = [ nose ];
+    propagatedBuildInputs = [ pyflakes pep8 mccabe ];
+
+    # 3 failing tests
+    #doCheck = false;
+
+    meta = {
+      description = "code checking using pep8 and pyflakes.";
+      homepage = http://pypi.python.org/pypi/flake8;
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  });
+
+
   flask = buildPythonPackage {
     name = "flask-0.9";
 
@@ -704,6 +1691,26 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  flexget = buildPythonPackage (rec {
+    name = "FlexGet-1.0.3353";
+
+    src = fetchurl {
+      url = "http://download.flexget.com/archive/${name}.tar.gz";
+      md5 = "cffc4e51b5c5efddb339d265524e46b8";
+    };
+
+    buildInputs = [ nose ];
+    propagatedBuildInputs = [ beautifulsoup4 pyrss2gen feedparser pynzb html5lib dateutil beautifulsoup flask jinja2 requests sqlalchemy pyyaml cherrypy progressbar deluge ];
+
+    meta = {
+      homepage = http://flexget.com/;
+      description = "Multipurpose automation tool for content like torrents, ...";
+      license = stdenv.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+
   flup = buildPythonPackage (rec {
     name = "flup-1.0.2";
 
@@ -718,20 +1725,17 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  
+
   foolscap = buildPythonPackage (rec {
-    name = "foolscap-0.6.1";
+    name = "foolscap-0.6.4";
 
     src = fetchurl {
       url = "http://foolscap.lothar.com/releases/${name}.tar.gz";
-      sha256 = "8b3e4fc678c5c41483b3130666583a1c3909713adcd325204daded7b67171ed5";
+      sha256 = "16cddyk5is0gjfn0ia5n2l4lhdzvbjzlx6sfpy7ddjd3d3fq7ckl";
     };
 
     propagatedBuildInputs = [ twisted pkgs.pyopenssl ];
 
-    # For some reason "python setup.py test" doesn't work with Python 2.6.
-    doCheck = false;
-
     meta = {
       homepage = http://foolscap.lothar.com/;
 
@@ -748,7 +1752,6 @@ let pythonPackages = python.modules // rec {
       license = "MIT";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -770,6 +1773,20 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+  gcovr = buildPythonPackage rec {
+    name = "gcovr-2.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/g/gcovr/${name}.tar.gz";
+      md5 = "672db629469882b93c40016aebff50ac";
+    };
+
+    meta = {
+      description = "A Python script for summarizing gcov data";
+      license = "BSD";
+    };
+  };
+
   genshi = buildPythonPackage {
     name = "genshi-0.6";
 
@@ -778,7 +1795,8 @@ let pythonPackages = python.modules // rec {
       sha256 = "0jrajyppdzb3swcxv3w1mpp88vcy7400gy1v2h2gm3pq0dmggaij";
     };
 
-    # two tests fail on x86_64 at least. I don't know why.
+    # FAIL: test_sanitize_remove_script_elem (genshi.filters.tests.html.HTMLSanitizerTestCase)
+    # FAIL: test_sanitize_remove_src_javascript (genshi.filters.tests.html.HTMLSanitizerTestCase)
     doCheck = false;
 
     buildInputs = [ pkgs.setuptools ];
@@ -804,13 +1822,12 @@ let pythonPackages = python.modules // rec {
       sha256 = "0bhiyx41kilvy04cgjbvjy2r4b6l7zz31fbrg3l6lvnqm26nihb0";
     };
 
-    buildInputs = [ pkgs.setuptools ];
+    buildInputs = [ pkgs.setuptools ] ++ (optional isPy26 argparse);
 
     meta = {
       description = "automatically generated zsh completion function for Python's option parser modules";
       license = "BSD";
       maintainers = [ stdenv.lib.maintainers.simons ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -840,6 +1857,9 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [ nose mox ];
 
+    # tests fail for python2.6
+    doCheck = python.majorVersion != "2.6";
+
     propagatedBuildInputs = [ gflags sqlalchemy webob routes eventlet ];
 
     PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
@@ -867,15 +1887,18 @@ let pythonPackages = python.modules // rec {
 
 
   gyp = buildPythonPackage rec {
-    rev = "1435";
+    rev = "1635";
     name = "gyp-r${rev}";
 
     src = fetchsvn {
       url = "http://gyp.googlecode.com/svn/trunk";
       inherit rev;
-      sha256 = "1wmd1svx5344alb8ff9vzdam1ccqdl0h7shp1xnsk843hqwc0fz0";
+      sha256 = "1hn5gxgj2z399f71kz11m61ifds7mx4zkymnd1c87k1wyp7bs5k5";
     };
 
+   patches = if pkgs.stdenv.isDarwin then [ ../development/python-modules/gyp/no-xcode.patch ../development/python-modules/gyp/no-darwin-cflags.patch ] else null;
+
+    # error: invalid command 'test'
     doCheck = false;
 
     postUnpack = "find . -print0 | xargs -0 touch";
@@ -886,23 +1909,63 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  html5lib = buildPythonPackage (rec {
+    name = "html5lib-0.95";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/h/html5lib/${name}.tar.gz";
+      md5 = "fe607f9917d81763e842f818f23464ee";
+    };
+
+    meta = {
+      homepage = http://code.google.com/p/html5lib/;
+      description = "HTML parser based on WHAT-WG HTML5 specification";
+      license = stdenv.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+  http_signature = buildPythonPackage (rec {
+    name = "http_signature-0.1.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/h/http_signature/${name}.tar.gz";
+      md5 = "015061846254bd5d8c5dbc2913985153";
+    };
+
+    propagatedBuildInputs = [pycrypto];
+
+    meta = {
+      homepage = https://github.com/atl/py-http-signature;
+      description = "";
+      license = stdenv.lib.licenses.mit;
+    };
+  });
 
   httplib2 = buildPythonPackage rec {
-    name = "httplib2-0.6.0";
+    name = "httplib2-0.8";
 
     src = fetchurl {
       url = "http://httplib2.googlecode.com/files/${name}.tar.gz";
-      sha256 = "134pldyxayc0x4akzzvkciz2kj1w2dsim1xvd9b1qrpmba70dpjq";
+      sha256 = "0gww8axb4j1vysbk9kfsk5vrws9a403gh30dxchmga8hrg1rns5g";
     };
 
-    doCheck = false; # doesn't have a test
-
     meta = {
-      homepage = http://code.google.com/p/httplib2/;
+      homepage = http://code.google.com/p/httplib2;
       description = "A comprehensive HTTP client library";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
     };
   };
 
+  importlib = if isPy26 then (buildPythonPackage {
+    name = "importlib-1.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/i/importlib/importlib-1.0.2.tar.gz";
+      md5 = "4aa23397da8bd7c7426864e88e4db7e1";
+    };
+    doCheck = false;
+  }) else null;
 
   iptools = buildPythonPackage rec {
     version = "0.4.0";
@@ -929,6 +1992,7 @@ let pythonPackages = python.modules // rec {
       md5 = "f4f7ddc7c5e55a47222a5cc6c0a87b6d";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -937,6 +2001,40 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  ipdb = buildPythonPackage {
+    name = "ipdb-0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/i/ipdb/ipdb-0.7.tar.gz";
+      md5 = "d879f9b2b0f26e0e999809585dcaec61";
+    };
+    propagatedBuildInputs = [ pythonPackages.ipython ];
+  };
+
+  ipdbplugin = buildPythonPackage {
+    name = "ipdbplugin-1.2";
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/i/ipdbplugin/ipdbplugin-1.2.tar.gz";
+      md5 = "39169b00a2186b99469249c5b0613753";
+    };
+    propagatedBuildInputs = [ pythonPackages.nose pythonPackages.ipython ];
+  };
+
+
+  jedi = buildPythonPackage (rec {
+    name = "jedi-0.6.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/j/jedi/${name}.tar.gz";
+      sha256 = "0k27nai69ypi9whipg45s1myqr477wj7jaryqv37bqqij4jc85hg";
+    };
+
+    meta = {
+      homepage = "https://github.com/davidhalter/jedi";
+      description = "An autocompletion tool for Python that can be used for text editors.";
+      license = pkgs.lib.licenses.lgpl3Plus;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  });
 
   jinja2 = buildPythonPackage {
     name = "jinja2-2.6";
@@ -959,6 +2057,44 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  jmespath = buildPythonPackage rec {
+    name = "jmespath-0.0.1";
+
+    src = fetchurl {
+      url = "https://github.com/boto/jmespath/archive/0.0.1.tar.gz";
+      sha256 = "1a5d62qbgfjbaw8wgkfh78gairnpy6bbdsygwm1prqwap1kyq6ch";
+    };
+
+    propagatedBuildInputs = [ ply ];
+
+    meta = {
+      homepage = "https://github.com/boto/jmespath";
+      description = "JMESPath allows you to declaratively specify how to extract elements from a JSON document";
+      license = "BSD";
+    };
+  };
+
+
+  pylast = buildPythonPackage rec {
+    name = "pylast-${version}";
+    version = "0.5.11";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pylast/${name}.tar.gz";
+      md5 = "506cf1b13020b3ed2f3c845ea0c9830e";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://code.google.com/p/pylast/;
+      description = "A python interface to last.fm (and compatibles)";
+      license = pkgs.lib.licenses.asl20;
+    };
+  };
+
+
   libcloud = buildPythonPackage (rec {
     name = "libcloud-0.3.1";
 
@@ -967,10 +2103,13 @@ let pythonPackages = python.modules // rec {
       sha256 = "11qilrs4sd4c1mkd64ikrjsc2vwrshhc54n5mh4xrark9c7ayp0y";
     };
 
-    buildInputs = [ zopeInterface ];
+    buildInputs = [ zope_interface mock ];
 
     preConfigure = "cp test/secrets.py-dist test/secrets.py";
 
+    # failing tests for 26 and 27
+    doCheck = false;
+
     meta = {
       description = "A unified interface to many cloud providers";
       homepage = http://incubator.apache.org/libcloud/;
@@ -978,6 +2117,28 @@ let pythonPackages = python.modules // rec {
   });
 
 
+  limnoria = buildPythonPackage (rec {
+    name = "limnoria-20130327";
+
+    src = fetchurl {
+      url = https://pypi.python.org/packages/source/l/limnoria/limnoria-2013-03-27T16:32:26+0100.tar.gz;
+      name = "limnoria-2013-03-27.tar.gz";
+      sha256 = "0xfaa6h8css3yhsmx5vcffizrz6mvmgm46q7449z3hq7g3793184";
+    };
+
+    propagatedBuildInputs = [ python.modules.sqlite3 ];
+
+    doCheck = false;
+
+    meta = with stdenv.lib; {
+      description = "A modified version of Supybot, an IRC bot";
+      homepage = http://supybot.fr.cr;
+      license = licenses.bsd3;
+      maintainers = [ maintainers.goibhniu ];
+    };
+  });
+
+
   lockfile = buildPythonPackage rec {
     name = "lockfile-0.9.1";
 
@@ -986,7 +2147,8 @@ let pythonPackages = python.modules // rec {
       sha1 = "1eebaee375641c9f29aeb21768f917dd2b985752";
     };
 
-    doCheck = false; # no tests
+    # error: invalid command 'test'
+    doCheck = false;
 
     meta = {
       homepage = http://code.google.com/p/pylockfile/;
@@ -994,22 +2156,23 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  logilabCommon = buildPythonPackage rec {
-    name = "logilab-common-0.56.0";
+  logilab_common = buildPythonPackage rec {
+    name = "logilab-common-0.58.2";
 
     src = fetchurl {
-      url = "ftp://ftp.logilab.org/pub/common/${name}.tar.gz";
-      sha256 = "14p557nqypbd10d8k7qs6jlm58pksiwh86wvvl0axyki00hj6971";
+      url = "http://download.logilab.org/pub/common/${name}.tar.gz";
+      sha256 = "0qfdyj2is0scpnkgpnqm12lh4yl27617l0irlilhk25cpgbbfbf9";
     };
-    propagatedBuildInputs = [unittest2];
+
+    propagatedBuildInputs = [ unittest2 ];
   };
 
   lxml = buildPythonPackage ( rec {
-    name = "lxml-2.2.2";
+    name = "lxml-3.0.2";
 
     src = fetchurl {
-      url = http://pypi.python.org/packages/source/l/lxml/lxml-2.2.2.tar.gz;
-      sha256 = "0zjpsy67wcs69qhb06ficl3a5z229hmczpr8h84rkk05vaagj8qv";
+      url = "http://pypi.python.org/packages/source/l/lxml/${name}.tar.gz";
+      md5 = "38b15b0dd5e9292cf98be800e84a3ce4";
     };
 
     buildInputs = [ pkgs.libxml2 pkgs.libxslt ];
@@ -1023,12 +2186,12 @@ let pythonPackages = python.modules // rec {
 
 
   magic = pkgs.stdenv.mkDerivation rec {
-    name = "python-${pkgs.file511.name}";
+    name = "python-${pkgs.file.name}";
 
-    src = pkgs.file511.src;
+    src = pkgs.file.src;
 
     patches = [ ../tools/misc/file/python.patch ];
-    buildInputs = [ python pkgs.file511 ];
+    buildInputs = [ python pkgs.file ];
 
     configurePhase = "cd python";
 
@@ -1067,6 +2230,60 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  Mako = buildPythonPackage rec {
+    name = "Mako-0.7.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/Mako/${name}.tar.gz";
+      md5 = "daf7cc50f997533b573f9b40193139a2";
+    };
+
+    buildInputs = [ MarkupSafe nose ];
+    propagatedBuildInputs = [ MarkupSafe ];
+
+    meta = {
+      description = "Super-fast templating language.";
+      homepage = http://www.makotemplates.org;
+      license = "MIT";
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+
+  MarkupSafe = buildPythonPackage rec {
+    name = "MarkupSafe-0.15";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/M/MarkupSafe/${name}.tar.gz";
+      md5 = "4e7c4d965fe5e033fa2d7bb7746bb186";
+    };
+
+    meta = {
+      description = "Implements a XML/HTML/XHTML Markup safe string";
+      homepage = http://dev.pocoo.org;
+      license = "BSD";
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+  manuel = buildPythonPackage rec {
+    name = "manuel-${version}";
+    version = "1.6.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/manuel/${name}.tar.gz";
+      md5 = "53d6a6905301a20f6095e41d11968fff";
+    };
+
+    propagatedBuildInputs = [ six zope_testing ];
+
+    meta = {
+      description = "A documentation builder";
+      homepage = http://pypi.python.org/pypi/manuel;
+      license = "ZPL";
+    };
+  };
+
   markdown = buildPythonPackage rec {
     version = "2.0.3";
     name = "markdown-${version}";
@@ -1076,6 +2293,7 @@ let pythonPackages = python.modules // rec {
       md5 = "751e8055be2433dfd1a82e0fb1b12f13";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1091,6 +2309,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "be37e1d86c65ecacae6683f8805e051e9904e5f2e02bf2b7a34262c46a6d06a7";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ dateutil numpy pkgs.freetype pkgs.libpng pkgs.pkgconfig pkgs.tcl pkgs.tk pkgs.xlibs.libX11 ];
@@ -1103,7 +2322,26 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  
+
+  mccabe = buildPythonPackage (rec {
+    name = "mccabe-0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mccabe/${name}.tar.gz";
+      md5 = "c1012c7c24081471f45aab864d4e3805";
+    };
+
+    buildInputs = [ ];
+
+    meta = {
+      description = "McCabe checker, plugin for flake8";
+      homepage = "https://github.com/flintwork/mccabe";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  });
+
+
   mechanize = buildPythonPackage (rec {
     name = "mechanize-0.1.11";
 
@@ -1138,13 +2376,42 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+  mitmproxy = buildPythonPackage rec {
+    baseName = "mitmproxy";
+    name = "${baseName}-${meta.version}";
+
+    src = fetchurl {
+      url = "${meta.homepage}/download/${name}.tar.gz";
+      sha256 = "1ddqni6d4kc8ypl6yig4nc00izvbk359sz6hykb9g0lfcpfqlngj";
+    };
+    
+    buildInputs = [
+      pkgs.pyopenssl pyasn1 urwid pil lxml flask protobuf netlib
+    ];
+
+    doCheck = false;
+
+    postInstall = ''
+      for prog in $out/bin/*; do
+        wrapProgram "$prog" \
+          --prefix PYTHONPATH : "$PYTHONPATH"
+      done
+    '';
+
+    meta = {
+      version = "0.9";
+      description = ''Man-in-the-middle proxy'';
+      homepage = "http://mitmproxy.org/";
+      license = pkgs.lib.licenses.mit;
+    };
+  };
+
   mock = buildPythonPackage (rec {
-    name = "mock-0.7.0";
+    name = "mock-1.0.1";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/m/mock/${name}.tar.gz";
-      md5 = "be029f8c963c55250a452c400e10cf42";
+      md5 = "c3971991738caa55ec7c356bbc154ee2";
     };
 
     buildInputs = [ unittest2 ];
@@ -1167,6 +2434,7 @@ let pythonPackages = python.modules // rec {
       sha1 = "b71aeaacf31898c3b38d8b9ca5bcc0664499c0de";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1176,6 +2444,63 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  mrbob = buildPythonPackage rec {
+    name = "mrbob-${version}";
+    version = "0.1a6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mr.bob/mr.bob-${version}.zip";
+      md5 = "361c8ac7a31953ab94a95cf34d9a0b2b";
+    };
+
+    buildInputs = [ pkgs.unzip six ] ++ (optionals isPy26 [ importlib ordereddict ]);
+
+    propagatedBuildInputs = [ argparse jinja2 ];
+
+    meta = {
+      homepage = https://github.com/iElectric/mr.bob.git;
+      description = "A tool to generate code skeletons from templates";
+    };
+  };
+
+
+  munkres = buildPythonPackage rec {
+    name = "munkres-1.0.5.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/munkres/${name}.tar.gz";
+      md5 = "cb9d114fb523428bab4742e88bc83696";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://bmc.github.com/munkres/;
+      description = "Munkres algorithm for the Assignment Problem";
+      license = pkgs.lib.licenses.bsd3;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+
+  musicbrainzngs = buildPythonPackage rec {
+    name = "musicbrainzngs-0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/musicbrainzngs/${name}.tar.gz";
+      md5 = "bc32aa1cf121f29c3ca1c06e9668865f";
+    };
+
+    meta = {
+      homepage = http://alastair/python-musicbrainz-ngs;
+      description = "Python bindings for musicbrainz NGS webservice";
+      license = pkgs.lib.licenses.bsd2;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+
   mutagen = buildPythonPackage (rec {
     name = "mutagen-1.20";
 
@@ -1195,6 +2520,7 @@ let pythonPackages = python.modules // rec {
   MySQL_python = buildPythonPackage {
     name = "MySQL-python-1.2.3";
 
+    # plenty of failing tests
     doCheck = false;
 
     src = fetchurl {
@@ -1202,7 +2528,9 @@ let pythonPackages = python.modules // rec {
       sha256 = "0vkyg9dmj29hzk7fy77f42p7bfj28skyzsjsjry4wqr3z6xnzrkx";
     };
 
-    propagatedBuildInputs = [ pkgs.mysql pkgs.zlib nose ];
+    buildInputs = [ nose ];
+
+    propagatedBuildInputs = [ pkgs.mysql pkgs.zlib ];
 
     meta = {
       description = "MySQL database binding for Python";
@@ -1212,6 +2540,24 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  mysql_connector_repackaged = buildPythonPackage rec {
+    name = "mysql-connector-repackaged-0.3.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/m/mysql-connector-repackaged/${name}.tar.gz";
+      md5 = "0b17ad1cb3fe763fd44487cb97cf45b2";
+    };
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+
   namebench = buildPythonPackage (rec {
     name = "namebench-1.0.5";
 
@@ -1222,6 +2568,7 @@ let pythonPackages = python.modules // rec {
 
     # No support of GUI yet.
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1254,7 +2601,8 @@ let pythonPackages = python.modules // rec {
       sha256 = "0ssxic389rdc79zkz8dxcjpqdi5qs80h12khkag410cl9cwk11f2";
     };
 
-    doCheck = false; # there is no test command
+    # error: invalid command 'test'
+    doCheck = false;
 
     meta = {
       homepage = https://github.com/drkjam/netaddr/;
@@ -1262,68 +2610,114 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  netlib = buildPythonPackage rec {
+    baseName = "netlib";
+    name = "${baseName}-${meta.version}";
+
+    src = fetchurl {
+      url = "https://github.com/cortesi/netlib/archive/v${meta.version}.tar.gz";
+      name = "${name}.tar.gz";
+      sha256 = "1y8lx2j1jrr93mqfb06zg1x5jm9lllw744sb61ib8dagw43nnq3v";
+    };
+    
+    buildInputs = [
+      pkgs.pyopenssl pyasn1
+    ];
+
+    doCheck = false;
+
+    meta = {
+      version = "0.9";
+      description = ''Man-in-the-middle proxy'';
+      homepage = "https://github.com/cortesi/netlib";
+      license = pkgs.lib.licenses.mit;
+    };
+  };
 
   nevow = buildPythonPackage (rec {
     name = "nevow-${version}";
     version = "0.10.0";
 
     src = fetchurl {
-      url = "http://divmod.org/trac/attachment/wiki/SoftwareReleases/Nevow-${version}.tar.gz?format=raw";
+      url = "http://pypi.python.org/packages/source/N/Nevow/Nevow-${version}.tar.gz";
       sha256 = "90631f68f626c8934984908d3df15e7c198939d36be7ead1305479dfc67ff6d0";
       name = "${name}.tar.gz";
     };
 
-    propagatedBuildInputs = [ twisted ];
+   propagatedBuildInputs = [ twisted ];
 
-    postInstall = "twistd --help > /dev/null";
+   postInstall = "twistd --help > /dev/null";
 
-    meta = {
-      description = "Nevow, a web application construction kit for Python";
+   meta = {
+     description = "Nevow, a web application construction kit for Python";
 
-      longDescription = ''
-        Nevow - Pronounced as the French "nouveau", or "noo-voh", Nevow
-        is a web application construction kit written in Python.  It is
-        designed to allow the programmer to express as much of the view
-        logic as desired in Python, and includes a pure Python XML
-        expression syntax named stan to facilitate this.  However it
-        also provides rich support for designer-edited templates, using
-        a very small XML attribute language to provide bi-directional
-        template manipulation capability.
-
-        Nevow also includes formless, a declarative syntax for
-        specifying the types of method parameters and exposing these
-        methods to the web.  Forms can be rendered automatically, and
-        form posts will be validated and input coerced, rendering error
-        pages if appropriate.  Once a form post has validated
-        successfully, the method will be called with the coerced values.
-      '';
+     longDescription = ''
+       Nevow - Pronounced as the French "nouveau", or "noo-voh", Nevow
+       is a web application construction kit written in Python.  It is
+       designed to allow the programmer to express as much of the view
+       logic as desired in Python, and includes a pure Python XML
+       expression syntax named stan to facilitate this.  However it
+       also provides rich support for designer-edited templates, using
+       a very small XML attribute language to provide bi-directional
+       template manipulation capability.
 
-      homepage = http://divmod.org/trac/wiki/DivmodNevow;
+       Nevow also includes formless, a declarative syntax for
+       specifying the types of method parameters and exposing these
+       methods to the web.  Forms can be rendered automatically, and
+       form posts will be validated and input coerced, rendering error
+       pages if appropriate.  Once a form post has validated
+       successfully, the method will be called with the coerced values.
+     '';
 
-      license = "BSD-style";
-    };
-  });
+     homepage = http://divmod.org/trac/wiki/DivmodNevow;
+
+     license = "BSD-style";
+   };
+ });
 
   nose = buildPythonPackage rec {
-    name = "nose-1.0.0";
+    name = "nose-1.2.1";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/n/nose/${name}.tar.gz";
-      md5 = "47a4784c817afa6ef11a505b574584ed";
+      md5 = "735e3f1ce8b07e70ee1b742a8a53585a";
     };
 
-    # Fails with ‘This platform lacks a functioning sem_open
-    # implementation, therefore, the required synchronization
-    # primitives needed will not function, see issue 3770.’ However,
-    # our Python does seem to be built with the necessary
-    # functionality.
-    doCheck = false;
-
     meta = {
       description = "A unittest-based testing framework for python that makes writing and running tests easier";
     };
+
+    buildInputs = [ coverage ];
+
+    doCheck = ! stdenv.isDarwin;
   };
 
+  nose2 = if isPy26 then null else (buildPythonPackage rec {
+    name = "nose2-0.4.5";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/n/nose2/${name}.tar.gz";
+      md5 = "d7e51c848227488e3cc0424faf5511cd";
+    };
+    meta = {
+      description = "nose2 is the next generation of nicer testing for Python";
+    };
+    propagatedBuildInputs = [ six ];
+    # AttributeError: 'module' object has no attribute 'collector'
+    doCheck = false;
+  });
+
+  nose2Cov = if isPy26 then null else (buildPythonPackage rec {
+    name = "nose2-cov-1.0a4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/n/nose2-cov/nose2-cov-1.0a4.tar.gz";
+      md5 = "6442f03e2ea732b0e38eb5b00fbe0b31";
+    };
+    meta = {
+      description = "nose2 plugin for coverage reporting, including subprocesses and multiprocessing";
+    };
+    propagatedBuildInputs = [ covCore nose2 ];
+  });
+
   notify = pkgs.stdenv.mkDerivation (rec {
     name = "python-notify-0.1.1";
 
@@ -1332,7 +2726,19 @@ let pythonPackages = python.modules // rec {
       sha256 = "1kh4spwgqxm534qlzzf2ijchckvs0pwjxl1irhicjmlg7mybnfvx";
     };
 
-    buildInputs = [ python pkgs.pkgconfig pkgs.libnotify pkgs.pygobject pkgs.pygtk pkgs.glib pkgs.gtk pkgs.dbus_glib ];
+    patches = pkgs.lib.singleton (fetchurl {
+      name = "libnotify07.patch";
+      url = "http://pkgs.fedoraproject.org/cgit/notify-python.git/plain/"
+          + "libnotify07.patch?id2=289573d50ae4838a1658d573d2c9f4c75e86db0c";
+      sha256 = "1lqdli13mfb59xxbq4rbq1f0znh6xr17ljjhwmzqb79jl3dig12z";
+    });
+
+    postPatch = ''
+      sed -i -e '/^PYGTK_CODEGEN/s|=.*|="${pygtk}/bin/pygtk-codegen-2.0"|' \
+        configure
+    '';
+
+    buildInputs = [ python pkgs.pkgconfig pkgs.libnotify pygobject pygtk pkgs.glib pkgs.gtk pkgs.dbus_glib ];
 
     postInstall = "cd $out/lib/python*/site-packages && ln -s gtk-*/pynotify .";
 
@@ -1360,7 +2766,6 @@ let pythonPackages = python.modules // rec {
       description = "A Python wrapper around notmuch";
       homepage = http://notmuchmail.org/;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -1378,6 +2783,8 @@ let pythonPackages = python.modules // rec {
       python setup.py build --fcompiler="gnu95"
       python setup.py install --prefix=$out
     '';
+
+    # error: invalid command 'test'
     doCheck = false;
 
     buildInputs = [ pkgs.gfortran ];
@@ -1389,34 +2796,82 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  optfunc = buildPythonPackage ( rec {
-    name = "optfunc-git";
+  oauth2 = buildPythonPackage (rec {
+    name = "oauth2-1.5.211";
 
-    src = pkgs.fetchgit {
-      url = "http://github.com/simonw/optfunc.git";
-      rev = "e3fa034a545ed94ac5a039cf5b170c7d0ee21b7b";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/o/oauth2/oauth2-1.5.211.tar.gz";
+      sha256 = "82a38f674da1fa496c0fc4df714cbb058540bed72a30c50a2e344b0d984c4d21";
     };
 
-    installCommand = ''
-      dest=$(toPythonPath $out)/optfunc
-      mkdir -p $dest
-      cp * $dest/
-    '';
+    propagatedBuildInputs = [ httplib2 ];
+
+    buildInputs = [ mock coverage ];
 
+    # ServerNotFoundError: Unable to find the server at oauth-sandbox.sevengoslings.net
     doCheck = false;
 
     meta = {
-      description = "A new experimental interface to optparse which works by introspecting a function definition";
-      homepage = "http://simonwillison.net/2009/May/28/optfunc/";
+      homepage = "https://github.com/simplegeo/python-oauth2";
+      description = "library for OAuth version 1.0";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+      platforms = stdenv.lib.platforms.linux;
     };
   });
 
+  obfsproxy = buildPythonPackage ( rec {
+    name = "obfsproxy-0.2.2";
+    src = fetchgit {
+      url = https://git.torproject.org/pluggable-transports/obfsproxy.git;
+      rev = "3c4e843a30c430aec1de03e0e09ef654072efc03";
+    };
+
+    propagatedBuildInputs = [ pyptlib argparse twisted pycrypto ];
+
+    meta = {
+      description = "a pluggable transport proxy";
+      homepage = https://www.torproject.org/projects/obfsproxy;
+    };
+  });
+
+  # optfunc = buildPythonPackage ( rec {
+  #   name = "optfunc-git";
+  #
+  #   src = pkgs.fetchgit {
+  #     url = "https://github.com/simonw/optfunc.git";
+  #     rev = "e3fa034a545ed94ac5a039cf5b170c7d0ee21b7b";
+  #   };
+  #
+  #   installCommand = ''
+  #     dest=$(toPythonPath $out)/optfunc
+  #     mkdir -p $dest
+  #     cp * $dest/
+  #   '';
+  #
+  #   doCheck = false;
+  #
+  #   meta = {
+  #     description = "A new experimental interface to optparse which works by introspecting a function definition";
+  #     homepage = "http://simonwillison.net/2009/May/28/optfunc/";
+  #   };
+  # });
+
+  ordereddict = if isPy26 then (buildPythonPackage {
+    name = "ordereddict-1.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/o/ordereddict/ordereddict-1.1.tar.gz";
+      md5 = "a0ed854ee442051b249bfad0f638bbec";
+    };
+    doCheck = false;
+  }) else null;
+
   ply = buildPythonPackage (rec {
-    name = "ply-3.2";
+    name = "ply-3.4";
 
     src = fetchurl {
       url = "http://www.dabeaz.com/ply/${name}.tar.gz";
-      sha256 = "10z4xq8lc8c21v4g7z3zpnvpqbc0vidigrck1kqhwgkqi4gh0kfj";
+      sha256 = "0sslnbpws847r1j1f41fjpn76w0asywfqgxwzyjrvmmxnw8myhxg";
     };
 
     meta = {
@@ -1441,11 +2896,10 @@ let pythonPackages = python.modules // rec {
       license = "revised-BSD";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
-  
+
   paramiko = buildPythonPackage rec {
     name = "paramiko-1.7.7.1";
 
@@ -1454,7 +2908,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1bjy4jn51c50mpq51jbwk0glzd8bxz83gxdfkr9p95dmrd17c7hh";
     };
 
-    buildInputs = [ pkgs.pycrypto ];
+    buildInputs = [ pycrypto ];
 
     meta = {
       homepage = "http://www.lag.net/paramiko/";
@@ -1472,8 +2926,6 @@ let pythonPackages = python.modules // rec {
         tunnel -- this is how sftp works, for example.  it is written
         entirely in python (no C or platform-dependent code) and is released
         under the GNU LGPL (lesser GPL).  '';
-
-      platforms = python.meta.platforms;
     };
   };
 
@@ -1498,21 +2950,52 @@ let pythonPackages = python.modules // rec {
 
 
   paste_deploy = buildPythonPackage rec {
-    version = "1.3.4";
+    version = "1.5.0";
     name = "paste-deploy-${version}";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/P/PasteDeploy/PasteDeploy-${version}.tar.gz";
-      md5 = "eb4b3e2543d54401249c2cbd9f2d014f";
+      md5 = "f1a068a0b680493b6eaff3dd7690690f";
     };
 
     buildInputs = [ nose ];
 
-    doCheck = false; # can't find "FakeEgg.app", apparently missing from the tarball
-
     meta = {
       description = "Load, configure, and compose WSGI applications and servers";
       homepage = http://pythonpaste.org/deploy/;
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  pep8 = buildPythonPackage rec {
+    name = "pep8-${version}";
+    version = "1.4.5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pep8/${name}.tar.gz";
+      md5 = "055dbd22ac5669232fdba752612e9686";
+    };
+
+    #======================================================================
+    #FAIL: test_check_simple (testsuite.test_shell.ShellTestCase)
+    #----------------------------------------------------------------------
+    #Traceback (most recent call last):
+    #  File "/tmp/nix-build-python-pep8-1.4.5.drv-0/pep8-1.4.5/testsuite/test_shell.py", line 84, in test_check_simple
+    #    self.assertTrue(config_filename.endswith('tox.ini'))
+    #AssertionError: False is not true
+    #
+    #----------------------------------------------------------------------
+    #Ran 21 tests in 0.711s
+    #
+    #FAILED (failures=1)
+    doCheck = false;
+
+    meta = {
+      homepage = "http://pep8.readthedocs.org/";
+      description = "Python style guide checker";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
     };
   };
 
@@ -1525,6 +3008,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0x8bfjjqygriry1iyygm5048ykl5qpbpzqfp6i8dhkslm3ryf5fk";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1549,17 +3033,159 @@ let pythonPackages = python.modules // rec {
       '';
 
       maintainers = [ stdenv.lib.maintainers.simons ];
-      platforms = python.meta.platforms;
+    };
+  };
+
+
+  pg8000 = buildPythonPackage rec {
+    name = "pg8000-1.09";
+
+    src = fetchurl {
+      url = "http://pg8000.googlecode.com/files/${name}.zip";
+      sha256 = "0kdc4rg47k1qkq22inghd50xlxjdkfcilym8mxff8wy4h091xykw";
+    };
+
+    buildInputs = [ pkgs.unzip ];
+
+    propagatedBuildInputs = [ pytz ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  };
+
+  pip = buildPythonPackage {
+    name = "pip-1.2.1";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz";
+      md5 = "db8a6d8a4564d3dc7f337ebed67b1a85";
+    };
+    buildInputs = [ mock scripttest virtualenv nose ];
+    # ValueError: Working directory tests not found, or not a directory
+    doCheck = false;
+  };
+
+
+  pika = buildPythonPackage {
+    name = "pika-0.9.12";
+    src = fetchurl {
+      url = https://pypi.python.org/packages/source/p/pika/pika-0.9.12.tar.gz;
+      md5 = "7174fc7cc5570314fa3cfaa729106482";
+    };
+    buildInputs = [ nose mock pyyaml ];
+
+    propagatedBuildInputs = [ unittest2 ];
+  };
+
+
+  pillow = buildPythonPackage rec {
+    name = "Pillow-1.7.8";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/Pillow/${name}.zip";
+      md5 = "41d8688d4db72673069a6dc63b5289d6";
+    };
+
+    buildInputs = [ pkgs.freetype pkgs.libjpeg pkgs.unzip pkgs.zlib ];
+
+    configurePhase = ''
+      sed -i "setup.py" \
+          -e 's|^FREETYPE_ROOT =.*$|FREETYPE_ROOT = _lib_include("${pkgs.freetype}")|g ;
+              s|^JPEG_ROOT =.*$|JPEG_ROOT = _lib_include("${pkgs.libjpeg}")|g ;
+              s|^ZLIB_ROOT =.*$|ZLIB_ROOT = _lib_include("${pkgs.zlib}")|g ;'
+    '';
+
+    doCheck = true;
+
+    meta = {
+      homepage = http://python-imaging.github.com/Pillow;
+
+      description = "Fork of The Python Imaging Library (PIL)";
+
+      longDescription = ''
+        The Python Imaging Library (PIL) adds image processing
+        capabilities to your Python interpreter.  This library
+        supports many file formats, and provides powerful image
+        processing and graphics capabilities.
+      '';
+
+      license = "http://www.pythonware.com/products/pil/license.htm";
+
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  polib = buildPythonPackage rec {
+    name = "polib-${version}";
+    version = "1.0.1";
+
+    src = fetchurl {
+      url = "http://bitbucket.org/izi/polib/downloads/${name}.tar.gz";
+      sha256 = "1sr2bb3g7rl7gr6156j5qv71kg06q1x01r1lbps9ksnyz37djn2q";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      description = "A library to manipulate gettext files (po and mo files)";
+      homepage = "http://bitbucket.org/izi/polib/";
+      license = pkgs.lib.licenses.mit;
+    };
+  };
+
+
+  powerline = buildPythonPackage rec {
+    rev = "72ea6730ead85fc19b983bd70173d15e6caa4965";
+    name = "powerline-beta_${rev}";
+
+    src = fetchurl {
+      url = "https://github.com/Lokaltog/powerline/tarball/${rev}";
+      name = "${name}.tar.bz";
+      sha256 = "08sr8ymhphh7rsn2gcmpdz3kzd04b7w3k4pc35h8w60jvg9i449s";
+    };
+
+    propagatedBuildInputs = [ pkgs.git pkgs.mercurial pkgs.bazaar pythonPackages.psutil pythonPackages.pygit2 ];
+
+    # error: This is still beta and some tests still fail
+    doCheck = false;
+
+    postInstall = ''
+      install -dm755 "$out/share/fonts/OTF/"
+      install -dm755 "$out/etc/fonts/conf.d"
+      install -m644 "font/PowerlineSymbols.otf" "$out/share/fonts/OTF/PowerlineSymbols.otf"
+      install -m644 "font/10-powerline-symbols.conf" "$out/etc/fonts/conf.d/10-powerline-symbols.conf"
+
+      install -dm755 "$out/share/vim/vimfiles/plugin"
+      install -m644 "powerline/bindings/vim/plugin/powerline.vim" "$out/share/vim/vimfiles/plugin/powerline.vim"
+
+      install -dm755 "$out/share/zsh/site-contrib"
+      install -m644 "powerline/bindings/zsh/powerline.zsh" "$out/share/zsh/site-contrib/powerline.zsh"
+
+      install -dm755 "$out/share/tmux"
+      install -m644 "powerline/bindings/tmux/powerline.conf" "$out/share/tmux/powerline.conf"
+    '';
+
+    meta = {
+      homepage = https://github.com/Lokaltog/powerline;
+      description = "The ultimate statusline/prompt utility.";
+      license = with stdenv.lib.licenses; mit;
+      platforms = with stdenv.lib.platforms; all; 
     };
   };
 
 
   prettytable = buildPythonPackage rec {
-    name = "prettytable-0.5";
+    name = "prettytable-0.7.1";
 
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/P/PrettyTable/${name}.tar.gz";
-      md5 = "13a6930d775395f393afd86948afa4fa";
+      url = "http://pypi.python.org/packages/source/P/PrettyTable/${name}.tar.bz2";
+      sha1 = "ad346a18d92c1d95f2295397c7a8a4f489e48851";
     };
 
     meta = {
@@ -1582,9 +3208,25 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  psutil = buildPythonPackage rec {
+    name = "psutil-0.6.1";
+
+    src = fetchurl {
+      url = "http://psutil.googlecode.com/files/${name}.tar.gz";
+      sha256 = "0vqarv63jqzghr4fi1fqdbvg847fq2gqdj8dzc3x59f9b36a8rfn";
+    };
+
+    meta = {
+      description = "Process and system utilization information interface for python";
+      homepage = http://code.google.com/p/psutil/;
+    };
+  };
+
+
   psycopg2 = buildPythonPackage rec {
     name = "psycopg2-2.0.13";
 
+    # error: invalid command 'test'
     doCheck = false;
 
     src = fetchurl {
@@ -1601,12 +3243,39 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  publicsuffix = buildPythonPackage rec {
+    name = "publicsuffix-${version}";
+    version = "1.0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/publicsuffix/${name}.tar.gz";
+      md5 = "f86babf56f6e58b564d3853adebcf37a";
+    };
+
+    meta = {
+      description = "Allows to get the public suffix of a domain name";
+      homepage = "http://pypi.python.org/pypi/publicsuffix/";
+      license = pkgs.lib.licenses.mit;
+    };
+  };
+
+
+  py = buildPythonPackage rec {
+    name = "py-1.4.13";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/p/py/py-1.4.13.tar.gz";
+      md5 = "3857dc8309d5f284669b81184253c2bb";
+    };
+  };
+
+
   pyasn1 = buildPythonPackage ({
-    name = "pyasn1-0.0.11a";
+    name = "pyasn1-0.1.7";
 
     src = fetchurl {
-      url = "mirror://sourceforge/pyasn1/pyasn1-devel/0.0.11a/pyasn1-0.0.11a.tar.gz";
-      sha256 = "0b7q67ygdk48zn07pyhyg7r0b74gds50652ndpzfw4vs8l3vjg0b";
+      url = "mirror://sourceforge/pyasn1/0.1.7/pyasn1-0.1.7.tar.gz";
+      sha256 = "1aqy21fb564gmnkw2fbkn55c40diyx3z0ixh4savvxikqm9ivy74";
     };
 
     meta = {
@@ -1620,6 +3289,49 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+
+  pyaudio = pkgs.stdenv.mkDerivation rec {
+    name = "python-pyaudio-${version}";
+    version = "0.2.4";
+
+    src = fetchurl {
+      url = "http://people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-${version}.tar.gz";
+      md5 = "623809778f3d70254a25492bae63b575";
+    };
+
+    buildInputs = [ python pkgs.portaudio ];
+
+    installPhase = ''
+      python setup.py install --prefix=$out
+    '';
+
+    meta = {
+      description = "Python bindings for PortAudio";
+      homepage = "http://people.csail.mit.edu/hubert/pyaudio/";
+      license = stdenv.lib.licenses.mit;
+    };
+  };
+
+
+  pygit2 = buildPythonPackage rec {
+    name = "pygit2-0.18.1";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/p/pygit2/${name}.tar.gz";
+      md5 = "8d27f84509a96d6791a6c393ae67d7c8";
+    };
+
+    propagatedBuildInputs = [ pkgs.libgit2 ];
+
+    meta = {
+      homepage = https://pypi.python.org/pypi/pygit2;
+      description = "Pygit2 is a set of Python bindings to the libgit2 shared library.";
+      license = with stdenv.lib.licenses; gpl2;
+      platforms = with stdenv.lib.platforms; all;
+    };
+  };
+
+
   Babel = buildPythonPackage (rec {
     name = "Babel-0.9.6";
 
@@ -1628,7 +3340,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "4a3a085ecf1fcd2736573538ffa114f1f4331b3bbbdd69381e6e172c49c9750f";
     };
 
-    doCheck = false;
+    buildInputs = [ pytz ];
 
     meta = {
       homepage = http://babel.edgewall.org;
@@ -1677,14 +3389,13 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [ pkgs.curl ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     preConfigure = ''
       substituteInPlace setup.py --replace '--static-libs' '--libs'
     '';
 
-    installCommand = "python setup.py install --prefix=$out";
-
     meta = {
       homepage = http://pycurl.sourceforge.net/;
       description = "Python wrapper for libcurl";
@@ -1706,6 +3417,63 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  pyfeed = buildPythonPackage rec {
+    url = "http://www.blarg.net/%7Esteveha/pyfeed-0.7.4.tar.gz";
+    name = stdenv.lib.nameFromURL url ".tar";
+    src = fetchurl {
+      inherit url;
+      sha256 = "1h4msq573m7wm46h3cqlx4rsn99f0l11rhdqgf50lv17j8a8vvy1";
+    };
+    propagatedBuildInputs = [xe];
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = "http://home.blarg.net/~steveha/pyfeed.html";
+      description = "Tools for syndication feeds";
+    };
+  };
+
+  pyflakes = buildPythonPackage rec {
+    name = "pyflakes-0.6.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyflakes/${name}.tar.gz";
+      md5 = "00debd2280b962e915dfee552a675915";
+    };
+
+    buildInputs = [ unittest2 ];
+
+    meta = {
+      homepage = "https://launchpad.net/pyflakes";
+      description = "A simple program which checks Python source files for errors.";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+    };
+  };
+
+  pyglet = buildPythonPackage rec {
+    name = "pyglet-1.1.4";
+
+    src = fetchurl {
+      url = "http://pyglet.googlecode.com/files/${name}.tar.gz";
+      sha256 = "048n20d606i3njnzhajadnznnfm8pwchs43hxs50da9p79g2m6qx";
+    };
+
+    patchPhase = let
+      libs = [ pkgs.mesa pkgs.xlibs.libX11 pkgs.freetype pkgs.fontconfig ];
+      paths = pkgs.lib.concatStringsSep "," (map (l: "\"${l}/lib\"") libs);
+    in "sed -i -e 's|directories\.extend.*lib[^]]*|&,${paths}|' pyglet/lib.py";
+
+    doCheck = false;
+
+    meta = {
+      homepage = "http://www.pyglet.org/";
+      description = "A cross-platform windowing and multimedia library";
+      license = stdenv.lib.licenses.bsd3;
+    };
+  };
 
   pygments = buildPythonPackage rec {
     name = "Pygments-1.5";
@@ -1714,7 +3482,7 @@ let pythonPackages = python.modules // rec {
       url = "http://pypi.python.org/packages/source/P/Pygments/${name}.tar.gz";
       md5 = "ef997066cc9ee7a47d01fb4f3da0b5ff";
     };
-    
+
     meta = {
       homepage = http://pygments.org/;
       description = "A generic syntax highlighter";
@@ -1731,6 +3499,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "5fd887c407015296a8fd3f4b867fe0fcca3179de97ccde90449853a3dfb802e1";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ pkgs.gpgme ];
@@ -1740,7 +3509,30 @@ let pythonPackages = python.modules // rec {
       description = "A Python wrapper for the GPGME library.";
       license = pkgs.lib.licenses.lgpl21;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
+    };
+  };
+
+
+  pyinotify = pkgs.stdenv.mkDerivation rec {
+    name = "python-pyinotify-${version}";
+    version = "0.9.3";
+
+    src = fetchgit {
+      url = "git://github.com/seb-m/pyinotify.git";
+      rev = "refs/tags/${version}";
+      sha256 = "d38ce95e4af00391e58246a8d7fe42bdb51d63054b09809600b2faef2a803472";
+    };
+
+    buildInputs = [ python ];
+
+    installPhase = ''
+      python setup.py install --prefix=$out
+    '';
+
+    meta = {
+      homepage = https://github.com/seb-m/pyinotify/wiki;
+      description = "Monitor filesystems events on Linux platforms with inotify";
+      license = pkgs.lib.licenses.mit;
     };
   };
 
@@ -1752,21 +3544,87 @@ let pythonPackages = python.modules // rec {
       url = "http://pypi.python.org/packages/source/p/pyparsing/${name}.tar.gz";
       md5 = "1e41cb219dae9fc353bd4cd47636b283";
     };
+
+    # error: invalid command 'test'
     doCheck = false;
+
     meta = {
       homepage = http://pyparsing.wikispaces.com/;
       description = "The pyparsing module is an alternative approach to creating and executing simple grammars, vs. the traditional lex/yacc approach, or the use of regular expressions.";
     };
   };
 
-  
+  pyptlib = buildPythonPackage (rec {
+    name = "pyptlib-${version}";
+    version = "0.0.3";
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/p/pyptlib/pyptlib-${version}.tar.gz";
+      sha256 = "0mklak456jqifx57j9jmpb69h3ybxc880qk86pg4g8jk0i14pxh3";
+    };
+    meta = {
+      description = "A python implementation of the Pluggable Transports for Circumvention specification for Tor";
+      license = stdenv.lib.licenses.bsd2;
+    };
+  });
+
+  pyrss2gen = buildPythonPackage (rec {
+    name = "PyRSS2Gen-1.0.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/P/PyRSS2Gen/${name}.tar.gz";
+      md5 = "eae2bc6412c5679c287ecc1a59588f75";
+    };
+
+    meta = {
+      homepage = http://www.dalkescientific.om/Python/PyRSS2Gen.html;
+      description = "Library for generating RSS 2.0 feeds";
+      license = stdenv.lib.licenses.bsd2;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+  pynzb = buildPythonPackage (rec {
+    name = "pynzb-0.1.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pynzb/${name}.tar.gz";
+      md5 = "63c74a36348ac28aa99732dcb8be8c59";
+    };
+
+    meta = {
+      homepage = http://github.com/ericflo/pynzb;
+      description = "Unified API for parsing NZB files";
+      license = stdenv.lib.licenses.bsd3;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
+  progressbar = buildPythonPackage (rec {
+    name = "progressbar-2.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/progressbar/${name}.tar.gz";
+      md5 = "8ea4e2c17a8ec9e7d153767c5f2a7b28";
+    };
+
+    # invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://code.google.com/p/python-progressbar/;
+      description = "Text progressbar library for python";
+      license = stdenv.lib.licenses.lgpl3Plus;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  });
+
   ldap = buildPythonPackage rec {
-    name = "python-ldap-2.4.3";
+    name = "python-ldap-2.4.10";
     namePrefix = "";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/p/python-ldap/${name}.tar.gz";
-      sha256 = "17aysa9b4zjw00ikjirf4m37xbp2ifj1g0zjs14xzqqib3nh1yw8";
+      sha256 = "0m6fm2alcb5v9xdcjv2nw2lhz9nnd3mnr5lrmf397hi4pw0pik37";
     };
 
     NIX_CFLAGS_COMPILE = "-I${pkgs.cyrus_sasl}/include/sasl";
@@ -1782,6 +3640,8 @@ let pythonPackages = python.modules // rec {
       sha256 = "1idks7j9bn62xzsaxkvhl7bdq6ws8kv8aa0wahfh7724qlbbcf1k";
     };
 
+    # ERROR: testExtended (tests.test_acls.AclExtensions)
+    # IOError: [Errno 0] Error
     doCheck = false;
 
     buildInputs = [ pkgs.acl ];
@@ -1794,34 +3654,37 @@ let pythonPackages = python.modules // rec {
 
 
   pylint = buildPythonPackage rec {
-    name = "pylint-0.23.0";
+    name = "pylint-0.26.0";
+    namePrefix = "";
 
     src = fetchurl {
-      url = "ftp://ftp.logilab.org/pub/pylint/${name}.tar.gz";
-      sha256 = "07091avcc2b374i5f3blszmawjcin8xssjfryz91qbxybb8r7c6d";
+      url = "http://download.logilab.org/pub/pylint/${name}.tar.gz";
+      sha256 = "1mg1ywpj0klklv63s2hwn5xwxi3wfwgnyz9d4pz32hzb53azq835";
+    };
+
+    propagatedBuildInputs = [ logilab_astng ];
+
+    meta = {
+      homepage = http://www.logilab.org/project/pylint;
+      description = "A bug and style checker for Python";
     };
-    propagatedBuildInputs = [astng];
   };
 
-  
+
   pymacs = pkgs.stdenv.mkDerivation rec {
-    version = "v0.24-beta2";
+    version = "v0.25";
     name = "Pymacs-${version}";
 
     src = fetchurl {
       url = "https://github.com/pinard/Pymacs/tarball/${version}";
       name = "${name}.tar.gz";
-      sha256 = "0nzb3wrxwy0cmmj087pszkwgj2v22x0y5m4vxb6axz94zfl02r8j";
+      sha256 = "1hmy76c5igm95rqbld7gvk0az24smvc8hplfwx2f5rhn6frj3p2i";
     };
 
     buildInputs = [ python ];
 
-    configurePhase = ''
-      python p4 -C p4config.py *.in Pymacs contrib tests
-    '';
-
-    installPhase = ''
-      python setup.py install --prefix=$out
+    patchPhase = ''
+      sed -e "s@ install@ install --prefix=$out@g" -i Makefile
     '';
 
     meta = with stdenv.lib; {
@@ -1832,7 +3695,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   pyopengl =
     let version = "3.0.0b5";
     in
@@ -1861,7 +3724,19 @@ let pythonPackages = python.modules // rec {
         };
       };
 
-      
+
+  pyquery = buildPythonPackage rec {
+    name = "pyquery-1.2.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyquery/${name}.tar.gz";
+      md5 = "268f08258738d21bc1920d7522f2a63b";
+    };
+
+    propagatedBuildInputs = [ cssselect lxml ];
+  };
+
+
   pyreport = buildPythonPackage (rec {
     name = "pyreport-0.3.4c";
 
@@ -1870,6 +3745,7 @@ let pythonPackages = python.modules // rec {
       md5 = "3076164a7079891d149a23f9435581db";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1880,6 +3756,24 @@ let pythonPackages = python.modules // rec {
   });
 
 
+  pyserial = buildPythonPackage rec {
+    name = "pyserial-2.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyserial/${name}.tar.gz";
+      md5 = "cde799970b7c1ce1f7d6e9ceebe64c98";
+    };
+
+    doCheck = false;
+
+    meta = {
+      homepage = "http://pyserial.sourceforge.net/";
+      license = stdenv.lib.licenses.psfl;
+      description = "Python serial port extension";
+    };
+  };
+
+
   pysqlite = buildPythonPackage (rec {
     name = "pysqlite-2.5.5";
 
@@ -1899,7 +3793,7 @@ let pythonPackages = python.modules // rec {
               --replace "/usr/local/lib" "${pkgs.sqlite}/lib"
     '';
 
-    # FIXME: How do we run the tests?
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -1930,7 +3824,6 @@ let pythonPackages = python.modules // rec {
       license = "revised BSD";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   });
 
@@ -1961,9 +3854,6 @@ let pythonPackages = python.modules // rec {
       sed -i -e 's|libpython2.7.dylib|lib/libpython2.7.dylib|' Makefile
     '');
 
-    # The regression test suite expects locale support, which our glibc
-    # doesn't have by default.
-    doCheck = false;
     checkPhase = "make -C ../Tests";
 
     installPhase = ''
@@ -1997,7 +3887,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   pyutil = buildPythonPackage (rec {
     name = "pyutil-1.7.9";
 
@@ -2040,6 +3930,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "0jmkffik6hdzs7ng8c65bggss2ai40nm59jykswdf5lpd36cxddq";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     buildInputs = [ pkgs.attr ];
@@ -2069,7 +3960,7 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  
+
   RBTools = buildPythonPackage rec {
     name = "rbtools-0.4.1";
     namePrefix = "";
@@ -2082,7 +3973,7 @@ let pythonPackages = python.modules // rec {
     propagatedBuildInputs = [ setuptools ];
   };
 
-  
+
   recaptcha_client = buildPythonPackage rec {
     name = "recaptcha-client-1.0.6";
 
@@ -2097,7 +3988,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   reportlab =
    let freetype = pkgs.lib.overrideDerivation pkgs.freetype (args: { configureFlags = "--enable-static --enable-shared"; });
    in buildPythonPackage rec {
@@ -2109,6 +4000,8 @@ let pythonPackages = python.modules // rec {
     };
 
     buildInputs = [freetype];
+
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2117,23 +4010,37 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+  requests = buildPythonPackage rec {
+    name = "requests-1.2.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/requests/${name}.tar.gz";
+      md5 = "22af2682233770e5468a986f451c51c0";
+    };
+
+    meta = {
+      description = "Requests is an Apache2 Licensed HTTP library, written in Python, for human beings..";
+      homepage = http://docs.python-requests.org/en/latest/;
+    };
+  };
+
+
   reviewboard = buildPythonPackage rec {
-    name = "ReviewBoard-1.6.9";
+    name = "ReviewBoard-1.6.16";
 
     src = fetchurl {
       url = "http://downloads.reviewboard.org/releases/ReviewBoard/1.6/${name}.tar.gz";
-      sha256 = "06pwbmqwsb0g2y8zg5hk5ibaivsl1af7v0vnkqranimf4yaa10mc";
+      sha256 = "0vg3ypm57m43bscv8vswjdllv3d2j8lxqwwvpd65cl7jd1in0yr1";
     };
 
     propagatedBuildInputs =
-      [ recaptcha_client pytz memcached dateutil paramiko flup pygments
-        djblets django_1_3 django_evolution pkgs.pycrypto python.modules.sqlite3
-        pysvn pkgs.pil psycopg2
+      [ recaptcha_client pytz memcached dateutil_1_5 paramiko flup pygments
+        djblets django_1_3 django_evolution pycrypto python.modules.sqlite3
+        pysvn pil psycopg2
       ];
   };
 
-  
+
   rdflib = buildPythonPackage (rec {
     name = "rdflib-3.0.0";
 
@@ -2142,6 +4049,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1c7ipk5vwqnln83rmai5jzyxkjdajdzbk5cgy1z83nyr5hbkgkqr";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2150,21 +4058,15 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  rope = pkgs.stdenv.mkDerivation rec {
-    version = "0.9.3";
+  rope = buildPythonPackage rec {
+    version = "0.9.4";
     name = "rope-${version}";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/r/rope/${name}.tar.gz";
-      sha256 = "1092rlsfna7rm1jkdanilsmw7rr3hlkgyji02xfd02wfcm8xa2i7";
+      sha256 = "1fm6ahff50b10mlnc0ar4x1fv9sxmcp1g651myyqy7c50hk39h1d";
     };
 
-    buildInputs = [ python ];
-
-    installPhase = ''
-      python setup.py install --prefix=$out
-    '';
-
     meta = with stdenv.lib; {
       description = "python refactoring library";
       homepage = http://rope.sf.net;
@@ -2173,20 +4075,16 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  ropemacs = pkgs.stdenv.mkDerivation rec {
-    version = "0.6";
+  ropemacs = buildPythonPackage rec {
+    version = "0.7";
     name = "ropemacs-${version}";
 
     src = fetchurl {
-      url = "mirror://sourceforge/rope/${name}.tar.gz";
-      sha256 = "1afqybmjn7fqkwx8y8kx1kfx181ix73cbq3a0d5n7ryjm7k1r0s4";
+      url = "http://pypi.python.org/packages/source/r/ropemacs/${name}.tar.gz";
+      sha256 = "1x5qf1drcdz9jfiiakc60kzqkb3ahsg9j902c5byf3gjfacdrmqj";
     };
 
-    buildInputs = [ python ];
-
-    installPhase = ''
-      python setup.py install --prefix=$out
-    '';
+    propagatedBuildInputs = [ ropemode ];
 
      meta = with stdenv.lib; {
        description = "a plugin for performing python refactorings in emacs";
@@ -2196,6 +4094,26 @@ let pythonPackages = python.modules // rec {
      };
   };
 
+  ropemode = buildPythonPackage rec {
+    version = "0.2";
+    name = "ropemode-${version}";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/r/ropemode/${name}.tar.gz";
+      sha256 = "0jw6h1wvk6wk0wknqdf7s9pw76m8472jv546lqdd88jbl2scgcjl";
+    };
+
+    propagatedBuildInputs = [ rope ];
+
+     meta = with stdenv.lib; {
+       description = "a plugin for performing python refactorings in emacs";
+       homepage = http://rope.sf.net;
+       maintainers = [ maintainers.goibhniu ];
+       license = licenses.gpl2;
+     };
+  };
+
+
 
   routes = buildPythonPackage rec {
     name = "routes-1.12.3";
@@ -2224,6 +4142,8 @@ let pythonPackages = python.modules // rec {
 
     buildInputs = [pkgs.gfortran];
     propagatedBuildInputs = [ numpy ];
+
+    # error: invalid command 'test'
     doCheck = false;
 
     # TODO: add ATLAS=${pkgs.atlas}
@@ -2276,7 +4196,6 @@ let pythonPackages = python.modules // rec {
           sha256 = "1wif9r6307qhlcp2zbg6n05yvxxn9ppkxh8gpsplcbyh22zi7bcd";
         };
 
-      preInstallPhases = "preInstall";
       preInstall = ''
         cp ${x_ignore_nofocus}/* .
         sed -i 's|dlopen(library,|dlopen("libX11.so.6",|' x_ignore_nofocus.c
@@ -2307,7 +4226,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   setuptoolsTrial = buildPythonPackage {
     name = "setuptools-trial-0.5.12";
 
@@ -2327,7 +4246,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   simplejson = buildPythonPackage (rec {
     name = "simplejson-2.1.3";
 
@@ -2353,7 +4272,23 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  
+
+  sexpdata = buildPythonPackage rec {
+    name = "sexpdata-0.0.2";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/s/sexpdata/${name}.tar.gz";
+      md5 = "efc44265bc27cb3d6ffed4fbf5733fc1";
+    };
+
+    doCheck = false;
+
+    meta = {
+      description = "S-expression parser for Python";
+      homepage = "https://github.com/tkf/sexpdata";
+    };
+  };
+
+
   six = buildPythonPackage rec {
     name = "six-1.1.0";
 
@@ -2362,6 +4297,7 @@ let pythonPackages = python.modules // rec {
       md5 = "9e8099b57cd27493a6988e9c9b313e23";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2370,7 +4306,7 @@ let pythonPackages = python.modules // rec {
     };
   };
 
-  
+
   skype4py = buildPythonPackage (rec {
     name = "Skype4Py-1.0.32.0";
 
@@ -2385,9 +4321,10 @@ let pythonPackages = python.modules // rec {
       sourceRoot=`pwd`/`ls -d S*`
     '';
 
+    # error: invalid command 'test'
     doCheck = false;
 
-    propagatedBuildInputs = [ pkgs.xlibs.libX11 pkgs.pythonDBus pkgs.pygobject ];
+    propagatedBuildInputs = [ pkgs.xlibs.libX11 pkgs.pythonDBus pygobject ];
 
     meta = {
       description = "High-level, platform independent Skype API wrapper for Python";
@@ -2401,12 +4338,29 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+  smartdc = buildPythonPackage rec {
+    name = "smartdc-0.1.12";
+
+    src = fetchurl {
+      url = https://pypi.python.org/packages/source/s/smartdc/smartdc-0.1.12.tar.gz;
+      md5 = "b960f61facafc879142b699050f6d8b4";
+    };
+
+    propagatedBuildInputs = [ requests http_signature ];
+
+    meta = {
+      description = "Joyent SmartDataCenter CloudAPI connector using http-signature authentication via Requests";
+      homepage = https://github.com/atl/py-smartdc;
+      license = pkgs.lib.licenses.mit;
+    };
+  };
+
   sphinx = buildPythonPackage (rec {
-    name = "Sphinx-1.0.7";
+    name = "Sphinx-1.1.3";
 
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/S/Sphinx/${name}.tar.gz";
-      md5 = "42c722d48e52d4888193965dd473adb5";
+      md5 = "8f55a6d4f87fc6d528120c5d1f983e98";
     };
 
     propagatedBuildInputs = [docutils jinja2 pygments];
@@ -2422,11 +4376,11 @@ let pythonPackages = python.modules // rec {
 
 
   sqlalchemy = buildPythonPackage {
-    name = "sqlalchemy-0.6.6";
+    name = "sqlalchemy-0.7.9";
 
     src = fetchurl {
-      url = mirror://sourceforge/sqlalchemy/0.6.6/SQLAlchemy-0.6.6.tar.gz;
-      sha256 = "0inj9b66pi447cw500mqn7d09dij20ic3k5bnyhj6rpdl2l83a0l";
+      url = mirror://sourceforge/sqlalchemy/0.7.9/SQLAlchemy-0.7.9.tar.gz;
+      md5 = "c4852d586d95a59fbc9358f4467875d5";
     };
 
     buildInputs = [ nose ];
@@ -2474,37 +4428,57 @@ let pythonPackages = python.modules // rec {
       md5 = "af0a314b6106dd80da24a918c24a1eab";
     };
 
-    doCheck = false;
+    buildInputs = [ mock nose ];
+
+    # XXX: Ran 0 tests in 0.217s
 
     meta = {
       description = "Lightweight and extensible STOMP messaging client";
       homepage = http://bitbucket.org/hozn/stompclient;
       license = pkgs.lib.licenses.asl20;
-      platforms = python.meta.platforms;
     };
   });
 
 
-  svneverever =  buildPythonPackage rec {
-    name = "svneverever-778489a8";
+  subunit = buildPythonPackage rec {
+    name = "subunit-${version}";
+    version = "0.0.9";
 
-    src = pkgs.fetchgit {
-      url = git://git.goodpoint.de/svneverever.git;
-      rev = "778489a8c6f07825fb18c9da3892a781c3d659ac";
-      sha256 = "41c9da1dab2be7b60bff87e618befdf5da37c0a56287385cb0cbd3f91e452bb6";
+    src = fetchurl {
+      url = "https://launchpad.net/subunit/trunk/0.0.9/+download/python-${name}.tar.gz";
+      sha256 = "0g3bk8lfd52zjzg43h47h2kckchm3xyv1gcr85nca2i50rcrpj56";
     };
 
-    propagatedBuildInputs = [ pysvn argparse ];
+    propagatedBuildInputs = [ testtools ];
 
-    doCheck = false;
+    meta = {
+      description = "A streaming protocol for test results";
+      homepage = https://launchpad.net/subunit;
+      license = pkgs.lib.licenses.asl20;
+    };
   };
 
+  # XXX: ValueError: ZIP does not support timestamps before 1980
+  # svneverever =  buildPythonPackage rec {
+  #   name = "svneverever-778489a8";
+  #
+  #   src = pkgs.fetchgit {
+  #     url = git://git.goodpoint.de/svneverever.git;
+  #     rev = "778489a8c6f07825fb18c9da3892a781c3d659ac";
+  #     sha256 = "41c9da1dab2be7b60bff87e618befdf5da37c0a56287385cb0cbd3f91e452bb6";
+  #   };
+  #
+  #   propagatedBuildInputs = [ pysvn argparse ];
+  #
+  #   doCheck = false;
+  # };
+
   taskcoach = buildPythonPackage rec {
-    name = "TaskCoach-1.3.8";
+    name = "TaskCoach-1.3.22";
 
     src = fetchurl {
       url = "mirror://sourceforge/taskcoach/${name}.tar.gz";
-      sha256 = "0gc277cgnw6f167lrbxlf7rmgyjxwzgkmi77qz9xwvnwcj2l94xn";
+      sha256 = "1ddx56bqmh347synhgjq625ijv5hqflr0apxg0nl4jqdsqk1zmxh";
     };
 
     propagatedBuildInputs = [ wxPython ];
@@ -2517,6 +4491,7 @@ let pythonPackages = python.modules // rec {
         --prefix LD_LIBRARY_PATH : $libspaths
     '';
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2544,6 +4519,38 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  testtools = buildPythonPackage rec {
+    name = "testtools-${version}";
+    version = "0.9.24";
+
+    src = fetchurl {
+      url = "https://launchpad.net/testtools/0.9/0.9.24/+download/${name}.tar.gz";
+      sha256 = "0mgkvd7c1aw34nlnz2nmll5k01aqhixxiikbs2nfyk3xfa4221x7";
+    };
+
+    meta = {
+      description = "A set of extensions to the Python standard library's unit testing framework";
+      homepage = http://pypi.python.org/pypi/testtools;
+      license = pkgs.lib.licenses.mit;
+    };
+  };
+
+
+  # TODO
+  # py.error.EACCES: [Permission denied]: mkdir('/homeless-shelter',)
+  # builder for `/nix/store/0czwg0n3pfkmpjphqv1jxfjlgkbziwsx-python-tox-1.4.3.drv' failed with exit code 1
+  # tox = buildPythonPackage rec {
+  #   name = "tox-1.4.3";
+  #
+  #   buildInputs = [ py virtualenv ];
+  #
+  #   src = fetchurl {
+  #     url = "https://pypi.python.org/packages/source/t/tox/tox-1.4.3.tar.gz";
+  #     md5 = "3727d5b0600d92edf2229a7ce6a0f752";
+  #   };
+  # };
+
+
   trac = buildPythonPackage {
     name = "trac-0.12.2";
 
@@ -2552,6 +4559,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "1ihf5031pc1wpwbxpfzzz2bcpwww795n5y22baglyim1lalivd65";
     };
 
+    # couple of failing tests
     doCheck = false;
 
     PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
@@ -2565,15 +4573,93 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+
+  transaction = buildPythonPackage rec {
+    name = "transaction-${version}";
+    version = "1.4.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/transaction/${name}.tar.gz";
+      md5 = "b7c2ff135939f605a8c54e1c13cd5d66";
+    };
+
+    propagatedBuildInputs = [ zope_interface ];
+
+    meta = {
+      description = "Transaction management";
+      homepage = http://pypi.python.org/pypi/transaction;
+      license = "ZPL";
+    };
+  };
+
+
+  eggdeps  = buildPythonPackage rec {
+     name = "eggdeps-${version}";
+     version = "0.4";
+
+     src = fetchurl {
+       url = "http://pypi.python.org/packages/source/t/tl.eggdeps/tl.${name}.tar.gz";
+       md5 = "2472204a2abd0d8cd4d11ff0fbf36ae7";
+     };
+
+     propagatedBuildInputs = [ zope_interface zope_testing ];
+     meta = {
+       description = "A tool which computes a dependency graph between active Python eggs";
+       homepage = http://thomas-lotze.de/en/software/eggdeps/;
+       license = "ZPL";
+     };
+   };
+
+
+  turses = buildPythonPackage (rec {
+    name = "turses-0.2.13";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/turses/${name}.tar.gz";
+      sha256 = "0sygm40z04zifcfqwby8wwwnj3i1bpl41r7xgnjcipxwirjmnp2k";
+    };
+
+    propagatedBuildInputs = [ oauth2 urwid tweepy ] ++ optional isPy26 argparse;
+
+    #buildInputs = [ tox ];
+    # needs tox
+    doCheck = false;
+
+    meta = {
+      homepage = "https://github.com/alejandrogomez/turses";
+      description = "A Twitter client for the console.";
+      license = pkgs.lib.licenses.gpl3;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  });
+
+  tweepy = buildPythonPackage (rec {
+    name = "tweepy-2.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tweepy/${name}.tar.gz";
+      sha256 = "1b95xcw11b5871gd4br78hxbvcq8y9f0i0sqga85dgg9hnmvdcx0";
+    };
+
+    meta = {
+      homepage = "https://github.com/tweepy/tweepy";
+      description = "Twitter library for python";
+      license = pkgs.lib.licenses.mit;
+      maintainers = [ stdenv.lib.maintainers.garbas ];
+      platforms = stdenv.lib.platforms.linux;
+    };
+  });
+
   twisted = buildPythonPackage rec {
-    name = "twisted-10.2.0";
+    name = "twisted-12.3.0";
 
     src = fetchurl {
       url = http://tmrc.mit.edu/mirror/twisted/Twisted/10.2/Twisted-10.2.0.tar.bz2;
       sha256 = "110c30z622jn14yany1sxfaqj5qx20n9rc9zqacxlwma30fdcbjn";
     };
 
-    propagatedBuildInputs = [ zopeInterface ];
+    propagatedBuildInputs = [ zope_interface ];
 
     # Generate Twisted's plug-in cache.  Twited users must do it as well.  See
     # http://twistedmatrix.com/documents/current/core/howto/plugin.html#auto3
@@ -2594,7 +4680,6 @@ let pythonPackages = python.modules // rec {
       license = "MIT";
 
       maintainers = [ stdenv.lib.maintainers.ludo ];
-      platforms = python.meta.platforms;
     };
   };
 
@@ -2622,6 +4707,7 @@ let pythonPackages = python.modules // rec {
       sha256 = "4437076c8708e5754ea04540e46c7f4f233734ee3590bb8a96389264fb0650d0";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     propagatedBuildInputs = [ pycurl ];
@@ -2636,13 +4722,14 @@ let pythonPackages = python.modules // rec {
 
 
   urwid = buildPythonPackage (rec {
-    name = "urwid-1.0.1";
+    name = "urwid-1.1.1";
 
+    # multiple:  NameError: name 'evl' is not defined
     doCheck = false;
 
     src = fetchurl {
       url = "http://excess.org/urwid/${name}.tar.gz";
-      md5 = "828f7144b94920205e755c249d2e297f";
+      md5 = "eca2e0413cf7216b01c84b99e0f2576d";
     };
 
     meta = {
@@ -2650,22 +4737,23 @@ let pythonPackages = python.modules // rec {
       homepage = http://excess.org/urwid;
       license = pkgs.lib.licenses.lgpl21;
       maintainers = [ stdenv.lib.maintainers.garbas ];
-      platforms = python.meta.platforms;
     };
   });
 
   virtualenv = buildPythonPackage rec {
-    name = "virtualenv-1.6.4";
+    name = "virtualenv-1.9.1";
     src = fetchurl {
       url = "http://pypi.python.org/packages/source/v/virtualenv/${name}.tar.gz";
-      md5 = "1072b66d53c24e019a8f1304ac9d9fc5";
+      md5 = "07e09df0adfca0b2d487e39a4bf2270a";
     };
 
     patches = [ ../development/python-modules/virtualenv-change-prefix.patch ];
 
     propagatedBuildInputs = [ python.modules.readline python.modules.sqlite3 ];
 
-    doCheck = false;
+    buildInputs = [ mock nose ];
+
+    # XXX: Ran 0 tests in 0.003s
 
     meta = with stdenv.lib; {
       description = "a tool to create isolated Python environments";
@@ -2684,6 +4772,7 @@ let pythonPackages = python.modules // rec {
       md5 = "8492e46496e187b49fe5569b5639804e";
     };
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
@@ -2692,42 +4781,92 @@ let pythonPackages = python.modules // rec {
     };
   };
 
+  waitress = buildPythonPackage rec {
+    name = "waitress-0.8.5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/w/waitress/${name}.tar.gz";
+      md5 = "7a3094d812c0dffb948d1334ef5fd56f";
+    };
+
+    meta = {
+       maintainers = [
+         stdenv.lib.maintainers.garbas
+         stdenv.lib.maintainers.iElectric
+       ];
+       platforms = stdenv.lib.platforms.all;
+    };
+  };
 
   webob = buildPythonPackage rec {
-    version = "1.0.6";
+    version = "1.2.3";
     name = "webob-${version}";
 
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/W/WebOb/WebOb-${version}.zip";
-      md5 = "8e46dd755f6998d471bfbcb4def897ff";
+      url = "http://pypi.python.org/packages/source/W/WebOb/WebOb-${version}.tar.gz";
+      md5 = "11825b7074ba7043e157805e4e6e0f55";
     };
 
-    buildInputs = [ pkgs.unzip ];
-
-    # The test requires "webtest", which is a cyclic dependency.  (WTF?)
-    doCheck = false;
+    propagatedBuildInputs = [ nose python.modules.ssl ];
 
     meta = {
       description = "WSGI request and response object";
       homepage = http://pythonpaste.org/webob/;
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  websockify = buildPythonPackage rec {
+    version = "0.3.0";
+    name = "websockify-${version}";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/w/websockify/websockify-${version}.tar.gz";
+      md5 = "29b6549d3421907de4bbd881ecc2e1b1";
+    };
+
+    propagatedBuildInputs = [ numpy ];
+
+    meta = {
+      description = "WebSockets support for any application/server";
+      homepage = https://github.com/kanaka/websockify;
     };
   };
 
 
   webtest = buildPythonPackage rec {
-    version = "1.2.3";
+    version = "2.0.3";
     name = "webtest-${version}";
 
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/W/WebTest/WebTest-${version}.tar.gz";
-      md5 = "585f9331467e6d99acaba4051c1c5878";
+      url = "http://pypi.python.org/packages/source/W/WebTest/WebTest-${version}.zip";
+      md5 = "a1266d4db421963fd3deb172c6689e4b";
     };
 
-    propagatedBuildInputs = [ nose webob dtopt ];
+    buildInputs = [ pkgs.unzip ] ++ optionals isPy26 [ pythonPackages.ordereddict ];
+
+    # XXX: skipping two tests fails in python2.6
+    doCheck = ! isPy26;
+
+    propagatedBuildInputs = [
+      nose
+      webob
+      six
+      beautifulsoup4
+      waitress
+      unittest2
+      mock
+      pyquery
+      wsgiproxy2
+      paste_deploy
+      coverage
+    ];
 
     meta = {
       description = "Helper to test WSGI applications";
       homepage = http://pythonpaste.org/webtest/;
+      platforms = stdenv.lib.platforms.all;
     };
   };
 
@@ -2748,6 +4887,44 @@ let pythonPackages = python.modules // rec {
   };
 
 
+  wokkel = buildPythonPackage (rec {
+    url = "http://wokkel.ik.nu/releases/0.7.0/wokkel-0.7.0.tar.gz";
+    name = pkgs.lib.nameFromURL url ".tar";
+    src = fetchurl {
+      inherit url;
+      sha256 = "0rnshrzw8605x05mpd8ndrx3ri8h6cx713mp8sl4f04f4gcrz8ml";
+    };
+
+    propagatedBuildInputs = [twisted dateutil];
+
+    meta = {
+      description = "Some (mainly XMPP-related) additions to twisted";
+      homepage = "http://wokkel.ik.nu/";
+      license = stdenv.lib.licenses.mit;
+    };
+  });
+
+
+  wsgiproxy2 = buildPythonPackage rec {
+    name = "WSGIProxy2-0.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/W/WSGIProxy2/${name}.tar.gz";
+      md5 = "157049212f1c81a8790efa31146fbabf";
+    };
+
+    propagatedBuildInputs = [ six webob ];
+
+    meta = {
+       maintainers = [
+         stdenv.lib.maintainers.garbas
+         stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
   wxPython = wxPython28;
 
 
@@ -2757,6 +4934,23 @@ let pythonPackages = python.modules // rec {
     wxGTK = pkgs.wxGTK28;
   };
 
+  xe = buildPythonPackage rec {
+    url = "http://www.blarg.net/%7Esteveha/xe-0.7.4.tar.gz";
+    name = stdenv.lib.nameFromURL url ".tar";
+    src = fetchurl {
+      inherit url;
+      sha256 = "0v9878cl0y9cczdsr6xjy8v9l139lc23h4m5f86p4kpf2wlnpi42";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = "http://home.blarg.net/~steveha/xe.html";
+      description = "XML elements";
+    };
+  };
+
   xlib = buildPythonPackage (rec {
     name = "xlib-0.15rc1";
 
@@ -2801,6 +4995,65 @@ let pythonPackages = python.modules // rec {
     };
   });
 
+
+  zconfig = buildPythonPackage rec {
+    name = "zconfig-${version}";
+    version = "2.9.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZConfig/ZConfig-${version}.tar.gz";
+      md5 = "2c5f73c216140a705be3d9c44b988722";
+    };
+
+    propagatedBuildInputs = [ zope_testrunner ];
+
+    meta = {
+      description = "Structured Configuration Library";
+      homepage = http://pypi.python.org/pypi/ZConfig;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zc_lockfile = buildPythonPackage rec {
+    name = "zc.lockfile-${version}";
+    version = "1.0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zc.lockfile/${name}.tar.gz";
+      md5 = "f099d4cf2583a0c7bea0146a44dc4d59";
+    };
+
+    meta = {
+      description = "Inter-process locks";
+      homepage =  http://www.python.org/pypi/zc.lockfile;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zdaemon = buildPythonPackage rec {
+    name = "zdaemon-${version}";
+    version = "3.0.5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zdaemon/${name}.tar.gz";
+      md5 = "975f770544bb4352c5cf32fec22e63c9";
+    };
+
+    propagatedBuildInputs  = [ zconfig ];
+
+    meta = {
+      description = "A daemon process control library and tools for Unix-based systems";
+      homepage = http://pypi.python.org/pypi/zdaemon;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
   zfec = buildPythonPackage (rec {
     name = "zfec-1.4.7";
 
@@ -2830,118 +5083,879 @@ let pythonPackages = python.modules // rec {
     };
   });
 
-  zopeInterface = buildPythonPackage {
-    name = "zope-interface-3.6.1";
+
+  zodb3 = buildPythonPackage rec {
+    name = "zodb3-${version}";
+    version = "3.10.5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/Z/ZODB3/ZODB3-${version}.tar.gz";
+      md5 = "6f180c6897a1820948fee2a6290503cd";
+    };
+
+    propagatedBuildInputs = [ manuel transaction zc_lockfile zconfig zdaemon zope_interface zope_event ];
+
+    meta = {
+      description = "An object-oriented database for Python";
+      homepage = http://pypi.python.org/pypi/ZODB3;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_broken = buildPythonPackage rec {
+    name = "zope.broken-3.6.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.broken/${name}.zip";
+      md5 = "eff24d7918099a3e899ee63a9c31bee6";
+    };
+
+    buildInputs = [ pkgs.unzip zope_interface ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_browser = buildPythonPackage rec {
+    name = "zope.browser-1.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.browser/${name}.zip";
+      md5 = "4ff0ddbf64c45bfcc3189e35f4214ded";
+    };
+
+    buildInputs = [ pkgs.unzip ];
+
+    propagatedBuildInputs = [ zope_interface ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_component = buildPythonPackage rec {
+    name = "zope.component-4.0.2";
+
     src = fetchurl {
-      url = "http://pypi.python.org/packages/source/z/zope.interface/zope.interface-3.6.1.tar.gz";
-      sha256 = "294c3c0529e84169177bce78d616c768fa1c028a2fbc1854f615d32ed88dbc6c";
+      url = "http://pypi.python.org/packages/source/z/zope.component/zope.component-4.0.2.tar.gz";
+      md5 = "8c2fd4414ca23cbbe014dcaf911acebc";
     };
 
+    propagatedBuildInputs = [
+      zope_configuration zope_event zope_i18nmessageid zope_interface
+      zope_testing
+    ];
+
+    # ignore tests because of a circular dependency on zope_security
     doCheck = false;
 
     meta = {
-      description = "Zope.Interface";
-      homepage = http://zope.org/Products/ZopeInterface;
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_configuration = buildPythonPackage rec {
+    name = "zope.configuration-4.0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.configuration/zope.configuration-4.0.2.tar.gz";
+      md5 = "40b3c7ad0b748ede532d8cfe2544e44e";
+    };
+
+    propagatedBuildInputs = [ zope_i18nmessageid zope_schema ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_container = buildPythonPackage rec {
+    name = "zope.container-3.11.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.container/${name}.tar.gz";
+      md5 = "fc66d85a17b8ffb701091c9328983dcc";
+    };
+
+    propagatedBuildInputs = [
+      zodb3 zope_broken zope_dottedname zope_publisher
+      zope_filerepresentation zope_lifecycleevent zope_size
+      zope_traversing
+    ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_contenttype = buildPythonPackage rec {
+    name = "zope.contenttype-3.5.5";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.contenttype/${name}.zip";
+      md5 = "c6ac80e6887de4108a383f349fbdf332";
+    };
+
+    buildInputs = [ pkgs.unzip ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_dottedname = buildPythonPackage rec {
+    name = "zope.dottedname-3.4.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.dottedname/${name}.tar.gz";
+      md5 = "62d639f75b31d2d864fe5982cb23959c";
+    };
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_event = buildPythonPackage rec {
+    name = "zope.event-${version}";
+    version = "4.0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.event/${name}.tar.gz";
+      md5 = "e08dd299d428d77a1cfcbfe841b81872";
+    };
+
+    meta = {
+      description = "An event publishing system";
+      homepage = http://pypi.python.org/pypi/zope.event;
       license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
     };
   };
 
-  hgsvn = buildPythonPackage rec {
-    name = "hgsvn-0.1.8";
-    src = fetchurl rec {
-      name = "hgsvn-0.1.8.tar.gz";
-      url = "http://pypi.python.org/packages/source/h/hgsvn/${name}.tar.gz#md5=56209eae48b955754e09185712123428";
-      sha256 = "18a7bj1i0m4shkxmdvw1ci5i0isq5vqf0bpwgrhnk305rijvbpch";
+
+  zope_exceptions = buildPythonPackage rec {
+     name = "zope.exceptions-${version}";
+     version = "4.0.5";
+
+     src = fetchurl {
+       url = "http://pypi.python.org/packages/source/z/zope.exceptions/${name}.tar.gz";
+       md5 = "c95569fcb444ae541777de7ae5297492";
+     };
+
+     propagatedBuildInputs = [ zope_interface ];
+
+     meta = {
+       description = "Exception interfaces and implementations";
+       homepage = http://pypi.python.org/pypi/zope.exceptions;
+       license = "ZPL";
+       maintainers = [ stdenv.lib.maintainers.goibhniu ];
+     };
+   };
+
+
+  zope_filerepresentation = buildPythonPackage rec {
+    name = "zope.filerepresentation-3.6.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.filerepresentation/${name}.tar.gz";
+      md5 = "4a7a434094f4bfa99a7f22e75966c359";
     };
 
-    buildInputs = [ pkgs.setuptools ];
+    propagatedBuildInputs = [ zope_schema ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_i18n = buildPythonPackage rec {
+    name = "zope.i18n-3.7.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18n/${name}.tar.gz";
+      md5 = "a6fe9d9ad53dd7e94e87cd58fb67d3b7";
+    };
+
+    propagatedBuildInputs = [ pytz zope_component ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_i18nmessageid = buildPythonPackage rec {
+    name = "zope.i18nmessageid-4.0.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.i18nmessageid/zope.i18nmessageid-4.0.2.tar.gz";
+      md5 = "c4550f7a0b4a736186e6e0fa3b2471f7";
+    };
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_lifecycleevent = buildPythonPackage rec {
+    name = "zope.lifecycleevent-3.6.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.lifecycleevent/${name}.tar.gz";
+      md5 = "3ba978f3ba7c0805c81c2c79ea3edb33";
+    };
+
+    propagatedBuildInputs = [ zope_event zope_component ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_location = buildPythonPackage rec {
+    name = "zope.location-4.0.0";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.location/zope.location-4.0.0.tar.gz";
+      md5 = "cd0e10d5923c95e352bcde505cc11324";
+    };
+
+    propagatedBuildInputs = [ zope_proxy ];
+
+    # ignore circular dependency on zope_schema
+    installCommand = ''
+      easy_install --always-unzip --no-deps --prefix="$out" .
+    '';
+
     doCheck = false;
 
     meta = {
-      description = "HgSVN";
-      homepage = http://pypi.python.org/pypi/hgsvn;
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
     };
   };
 
+
+  zope_proxy = buildPythonPackage rec {
+    name = "zope.proxy-4.1.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.proxy/zope.proxy-4.1.1.tar.gz";
+      md5 = "c36691f0abee7573f4ddcc378603cefd";
+    };
+
+    propagatedBuildInputs = [ zope_interface ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_publisher = buildPythonPackage rec {
+    name = "zope.publisher-3.12.6";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.publisher/${name}.tar.gz";
+      md5 = "495131970cc7cb14de8e517fb3857ade";
+    };
+
+    propagatedBuildInputs = [
+      zope_browser zope_contenttype zope_i18n zope_security
+    ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_schema = buildPythonPackage rec {
+    name = "zope.schema-4.2.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.schema/zope.schema-4.2.2.tar.gz";
+      md5 = "e7e581af8193551831560a736a53cf58";
+    };
+
+    propagatedBuildInputs = [ zope_event zope_interface zope_testing ] ++ optional isPy26 ordereddict;
+
+    # ignore circular dependency on zope_location
+    installCommand = ''
+      easy_install  --no-deps --prefix="$out" .
+    '';
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_security = buildPythonPackage rec {
+    name = "zope.security-3.7.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.security/zope.security-3.7.4.tar.gz";
+      md5 = "072ab8d11adc083eace11262da08630c";
+    };
+
+    propagatedBuildInputs = [
+      zope_component zope_configuration zope_i18nmessageid zope_schema
+      zope_proxy
+    ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_size = buildPythonPackage rec {
+    name = "zope.size-3.4.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.size/${name}.tar.gz";
+      md5 = "55d9084dfd9dcbdb5ad2191ceb5ed03d";
+    };
+
+    propagatedBuildInputs = [ zope_i18nmessageid zope_interface ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_sqlalchemy = buildPythonPackage rec {
+    name = "zope.sqlalchemy-0.7.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.sqlalchemy/${name}.zip";
+      md5 = "b654e5d144ed141e13b42591a21a4868";
+    };
+
+    buildInputs = [ pkgs.unzip sqlalchemy zope_testing zope_interface setuptools ];
+    propagatedBuildInputs = [ sqlalchemy transaction ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
+  zope_testing = buildPythonPackage rec {
+    name = "zope.testing-${version}";
+    version = "4.1.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testing/${name}.tar.gz";
+      md5 = "2e3829841090d6adff718b8b73c87b6b";
+    };
+
+    propagatedBuildInputs = [ zope_interface zope_exceptions zope_location ];
+
+    meta = {
+      description = "Zope testing helpers";
+      homepage =  http://pypi.python.org/pypi/zope.testing;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_testrunner = buildPythonPackage rec {
+    name = "zope.testrunner-${version}";
+    version = "4.0.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.testrunner/${name}.zip";
+      md5 = "cd648fc865a79aa0950e73342836dd4c";
+    };
+
+    buildInputs = [ pkgs.unzip ];
+
+    propagatedBuildInputs = [ subunit zope_interface zope_exceptions zope_testing ];
+
+    meta = {
+      description = "A flexible test runner with layer support";
+      homepage = http://pypi.python.org/pypi/zope.testrunner;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_traversing = buildPythonPackage rec {
+    name = "zope.traversing-3.13.2";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.traversing/${name}.zip";
+      md5 = "eaad8fc7bbef126f9f8616b074ec00aa";
+    };
+
+    buildInputs = [ pkgs.unzip ];
+
+    propagatedBuildInputs = [ zope_location zope_security zope_publisher ];
+
+    meta = {
+        maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  zope_interface = buildPythonPackage rec {
+    name = "zope.interface-4.0.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/z/zope.interface/${name}.tar.gz";
+      md5 = "1ddd308f2c83703accd1696158c300eb";
+    };
+
+    propagatedBuildInputs = [ zope_event ];
+
+    meta = {
+      description = "Zope.Interface";
+      homepage = http://zope.org/Products/ZopeInterface;
+      license = "ZPL";
+      maintainers = [ stdenv.lib.maintainers.goibhniu ];
+    };
+  };
+
+
+  # XXX: link broken
+  # hgsvn = buildPythonPackage rec {
+  #   name = "hgsvn-0.1.8";
+  #   src = fetchurl rec {
+  #     name = "hgsvn-0.1.8.tar.gz";
+  #     url = "http://pypi.python.org/packages/source/h/hgsvn/${name}.tar.gz#md5=56209eae48b955754e09185712123428";
+  #     sha256 = "18a7bj1i0m4shkxmdvw1ci5i0isq5vqf0bpwgrhnk305rijvbpch";
+  #   };
+  #
+  #   buildInputs = [ pkgs.setuptools ];
+  #   doCheck = false;
+  #
+  #     meta = {
+  #     description = "HgSVN";
+  #     homepage = http://pypi.python.org/pypi/hgsvn;
+  #   };
+  # };
+
   cliapp = buildPythonPackage rec {
-    name = "cliapp-1.20120630";
+    name = "cliapp-${version}";
+    version = "1.20130313";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-cliapp/python-cliapp_1.20120630.orig.tar.gz";
-      sha256 = "6beeb1fb3077561540094584ce36055266ac67b80f158b9b82fe4075096f4716";
+      url = "http://code.liw.fi/debian/pool/main/p/python-cliapp/python-cliapp_${version}.orig.tar.gz";
+      sha256 = "0rk13a68668gsrv6yqgzqxskffqnlyjar4qav6k5iyrp77amn7qm";
     };
 
     buildInputs = [ sphinx ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
       homepage = http://liw.fi/cliapp/;
       description = "Python framework for Unix command line programs.";
       maintainers = [ stdenv.lib.maintainers.rickynils ];
-      platforms = python.meta.platforms;
     };
   };
 
+
+  tornado = buildPythonPackage rec {
+    name = "tornado-2.4";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tornado/tornado-2.4.tar.gz";
+      md5 = "c738af97c31dd70f41f6726cf0968941";
+    };
+    doCheck = false;
+  };
+
+
+  pyzmq = buildPythonPackage rec {
+    name = "pyzmq-13.0.0";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/pyzmq/pyzmq-13.0.0.zip";
+      md5 = "fa2199022e54a393052d380c6e1a0934";
+    };
+    buildInputs = [ pkgs.unzip pkgs.zeromq3 ];
+    propagatedBuildInputs = [  ];
+    doCheck = false;
+  };
+
+
+  tissue = buildPythonPackage rec {
+    name = "tissue-0.7";
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/tissue/${name}.tar.gz";
+      md5 = "c9f3772407eb7499a949daaa9b859fdf";
+    };
+
+    buildInputs = [ nose ];
+    propagatedBuildInputs = [ pep8 ];
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
   tracing = buildPythonPackage rec {
-    name = "tracing-0.6";
+    name = "tracing-0.7";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-tracing/python-tracing_0.6.orig.tar.gz";
-      sha256 = "1164cf05891f9bca93fb87413f32d2c4da90348adbf69b0ad36a464b7adcd354";
+      url = "http://code.liw.fi/debian/pool/main/p/python-tracing/python-tracing_0.7.orig.tar.gz";
+      sha256 = "9954a1b0cc6b957d15975b048f929bbdd46766d397a6fa51bf8f6498b9459276";
     };
 
     buildInputs = [ sphinx ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
       homepage = http://liw.fi/tracing/;
       description = "Python debug logging helper.";
       maintainers = [ stdenv.lib.maintainers.rickynils ];
-      platforms = python.meta.platforms;
     };
   };
 
+  translationstring = buildPythonPackage rec {
+    name = "translationstring-0.4";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/t/translationstring/${name}.tar.gz";
+      md5 = "392287923c475b660b7549b2c2f03dbc";
+    };
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+
   ttystatus = buildPythonPackage rec {
-    name = "ttystatus-0.19";
+    name = "ttystatus-${version}";
+    version = "0.22";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-ttystatus/python-ttystatus_0.19.orig.tar.gz";
-      sha256 = "7cc112a4783f2e0c354c5244f8e50b18733b5957677b56a755c1016e04c0c28d";
+      url = "http://code.liw.fi/debian/pool/main/p/python-ttystatus/python-ttystatus_${version}.orig.tar.gz";
+      sha256 = "1hzv0sbrvgcmafflhvzh7plci0dg7wcjlk39i8kqdasg6rw0ag6f";
     };
 
     buildInputs = [ sphinx ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
       homepage = http://liw.fi/ttystatus/;
       description = "Progress and status updates on terminals for Python.";
       maintainers = [ stdenv.lib.maintainers.rickynils ];
-      platforms = python.meta.platforms;
     };
   };
 
   larch = buildPythonPackage rec {
-    name = "larch-1.20120527";
+    name = "larch-${version}";
+    version = "1.20130316";
 
     src = fetchurl rec {
-      url = "http://code.liw.fi/debian/pool/main/p/python-larch/python-larch_1.20120527.orig.tar.gz";
-      sha256 = "2865a1bfa6bd276bf746e8e7cb73d5199d0b6d00045d8c92e158626687d3bbe1";
+      url = "http://code.liw.fi/debian/pool/main/p/python-larch/python-larch_${version}.orig.tar.gz";
+      sha256 = "1mkvmy0jdzd7dlvdx2a75wsbj5qw1clawcgndx9jwl816a9iy225";
     };
 
     buildInputs = [ sphinx ];
     propagatedBuildInputs = [ tracing ttystatus cliapp ];
 
+    # error: invalid command 'test'
     doCheck = false;
 
     meta = {
       homepage = http://liw.fi/larch/;
       description = "Python B-tree library.";
       maintainers = [ stdenv.lib.maintainers.rickynils ];
-      platforms = python.meta.platforms;
     };
   };
 
+
+  webhelpers = buildPythonPackage rec {
+    name = "WebHelpers-1.3";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/W/WebHelpers/${name}.tar.gz";
+      md5 = "32749ffadfc40fea51075a7def32588b";
+    };
+
+    buildInputs = [ routes MarkupSafe webob nose ];
+
+    # TODO: failing tests https://bitbucket.org/bbangert/webhelpers/pull-request/1/fix-error-on-webob-123/diff
+    doCheck = false;
+
+    meta = {
+      maintainers = [
+        stdenv.lib.maintainers.garbas
+        stdenv.lib.maintainers.iElectric
+      ];
+      platforms = stdenv.lib.platforms.all;
+    };
+  };
+
+  whisper = buildPythonPackage rec {
+    name = "whisper-${version}";
+    version = "0.9.10";
+
+    src = fetchurl rec {
+      url = "https://launchpad.net/graphite/0.9/${version}/+download/${name}.tar.gz";
+      sha256 = "1zy4z4hrbiqj4ipcv2m9197hf03d4xphllqav9w4c8i6fn8zmd9n";
+    };
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://graphite.wikidot.com/;
+      description = "Fixed size round-robin style database";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  carbon = buildPythonPackage rec {
+    name = "carbon-${version}";
+    version = "0.9.10";
+
+    src = fetchurl rec {
+      url = "https://launchpad.net/graphite/0.9/${version}/+download/${name}.tar.gz";
+      sha256 = "0wjhd87pvpcpvaj3wql2d92g8lpp33iwmxdkp7npic5mjl2y0dsg";
+    };
+
+    buildInputs = [ txamqp zope_interface twisted ];
+    propagatedBuildInputs = [ whisper ];
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://graphite.wikidot.com/;
+      description = "Backend data caching and persistence daemon for Graphite";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+
+  unidecode = buildPythonPackage rec {
+    name = "Unidecode-0.04.12";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/U/Unidecode/${name}.tar.gz";
+      md5 = "351dc98f4512bdd2e93f7a6c498730eb";
+    };
+
+    meta = {
+      homepage = http://pypi.python.org/pypi/Unidecode/;
+      description = "ASCII transliterations of Unicode text";
+      license = pkgs.lib.licenses.gpl2;
+      maintainers = [ stdenv.lib.maintainers.iElectric ];
+    };
+  };
+
+  txamqp = buildPythonPackage rec {
+    name = "txamqp-${version}";
+    version = "0.3";
+
+    src = fetchurl rec {
+      url = "https://launchpad.net/txamqp/trunk/${version}/+download/python-txamqp_${version}.orig.tar.gz";
+      sha256 = "1r2ha0r7g14i4b5figv2spizjrmgfpspdbl1m031lw9px2hhm463";
+    };
+
+    buildInputs = [ twisted ];
+
+    meta = {
+      homepage = https://launchpad.net/txamqp;
+      description = "Library for communicating with AMQP peers and brokers using Twisted";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  graphite_web = buildPythonPackage rec {
+    name = "graphite-web-${version}";
+    version = "0.9.10";
+
+    src = fetchurl rec {
+      url = "https://launchpad.net/graphite/0.9/${version}/+download/${name}.tar.gz";
+      sha256 = "1gj8i6j2i172cldqw98395235bn78ciagw6v17fgv01rmind3lag";
+    };
+
+    buildInputs = [ django pkgs.pycairo ldap memcached python.modules.sqlite3 ];
+
+    # error: invalid command 'test'
+    doCheck = false;
+
+    meta = {
+      homepage = http://graphite.wikidot.com/;
+      description = "Enterprise scalable realtime graphing";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  pyspotify = buildPythonPackage rec {
+    name = "pyspotify-${version}";
+  
+    version = "1.10";
+  
+    src = fetchgit {
+      url = "https://github.com/mopidy/pyspotify.git";
+      rev = "refs/tags/v${version}";
+      sha256 = "1rvgrviwn6f037m8vq395chz6a1119dbsdhfwdbv5ambi0bak6ll";
+    };
+  
+    buildInputs = [ pkgs.libspotify ];
+  
+    # python zip complains about old timestamps
+    preConfigure = ''
+      find -print0 | xargs -0 touch
+    '';
+  
+    # There are no tests
+    doCheck = false;
+  
+    meta = {
+      homepage = http://pyspotify.mopidy.com;
+      description = "A Python interface to Spotify’s online music streaming service";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  pykka = buildPythonPackage rec {
+    name = "pykka-${version}";
+  
+    version = "1.1.0";
+  
+    src = fetchgit {
+      url = "https://github.com/jodal/pykka.git";
+      rev = "refs/tags/v${version}";
+      sha256 = "0w6bcaqkzwmd9habszlgjkp3kkhkna08s9aivnmna5hddsghfqmz";
+    };
+  
+    # python zip complains about old timestamps
+    preConfigure = ''
+      find -print0 | xargs -0 touch
+    '';
+  
+    # There are no tests
+    doCheck = false;
+  
+    meta = {
+      homepage = http://www.pykka.org;
+      description = "A Python implementation of the actor model";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  ws4py = buildPythonPackage rec {
+    name = "ws4py-${version}";
+  
+    version = "git-20130303";
+  
+    src = fetchgit {
+      url = "https://github.com/Lawouach/WebSocket-for-Python.git";
+      rev = "ace276500ca7e4c357595e3773be151d37bcd6e2";
+      sha256 = "04m4m3ncn7g4rb81xg5n28imns7rsq8d2w98gjpaib6vlmyly3g1";
+    };
+  
+    # python zip complains about old timestamps
+    preConfigure = ''
+      find -print0 | xargs -0 touch
+    '';
+  
+    # Tests depend on other packages
+    doCheck = false;
+  
+    meta = {
+      homepage = https://ws4py.readthedocs.org;
+      description = "A WebSocket package for Python";
+      maintainers = [ stdenv.lib.maintainers.rickynils ];
+    };
+  };
+
+  gdata = buildPythonPackage rec {
+    name = "gdata-${version}";
+    version = "2.0.17";
+
+    src = fetchurl {
+      url = "https://gdata-python-client.googlecode.com/files/${name}.tar.gz";
+      # sha1 = "d2d9f60699611f95dd8c328691a2555e76191c0c";
+      sha256 = "0bdaqmicpbj9v3p0swvyrqs7m35bzwdw1gy56d3k09np692jfwmd";
+    };
+
+    # Fails with "error: invalid command 'test'"
+    doCheck = false;
+
+    meta = {
+      homepage = https://code.google.com/p/gdata-python-client/;
+      description = "Python client library for Google data APIs";
+      license = pkgs.lib.licenses.asl20;
+    };
+  };
+
+  IMAPClient = buildPythonPackage rec {
+    name = "IMAPClient-${version}";
+    version = "0.9.2";
+
+    src = fetchurl {
+      url = "http://freshfoo.com/projects/IMAPClient/${name}.tar.gz";
+      sha256 = "10alpj7074djs048xjc4j7ggd1nrqdqpy0fzl7fj9hddp0rbchs9";
+    };
+
+    preConfigure = ''
+      sed -i '/distribute_setup/d' setup.py
+    '';
+
+    meta = {
+      homepage = http://imapclient.freshfoo.com/;
+      description = "Easy-to-use, Pythonic and complete IMAP client library";
+      license = pkgs.lib.licenses.bsd3;
+    };
+  };
+
+  Logbook = buildPythonPackage rec {
+    name = "Logbook-${version}";
+    version = "0.4.1";
+
+    src = fetchurl {
+      url = "https://pypi.python.org/packages/source/L/Logbook/${name}.tar.gz";
+      # md5 = "143cb15af4c4a784ca785a1546ad1b93";
+      sha256 = "0iim9pcyl57c6z9i1kfw5nz92qrnpz2l0bz4lir2xrqi8m03q3d7";
+    };
+
+    meta = {
+      homepage = http://pythonhosted.org/Logbook/;
+      description = "A logging replacement for Python";
+      license = pkgs.lib.licenses.bsd3;
+    };
+ };
+
 }; in pythonPackages
diff --git a/pkgs/top-level/release-cross.nix b/pkgs/top-level/release-cross.nix
index a1af20acc77..3895ee26779 100644
--- a/pkgs/top-level/release-cross.nix
+++ b/pkgs/top-level/release-cross.nix
@@ -1,34 +1,31 @@
-with (import ./release-lib.nix);
+with import ./release-lib.nix { supportedSystems = []; };
 let
   nativePlatforms = linux;
 
   /* Basic list of packages to cross-build */
-  basicHostDrv = {
+  basicCrossDrv = {
     gccCrossStageFinal = nativePlatforms;
-    bison.hostDrv = nativePlatforms;
-    busybox.hostDrv = nativePlatforms;
-    coreutils.hostDrv = nativePlatforms;
-    dropbear.hostDrv = nativePlatforms;
-    tigervnc.hostDrv = nativePlatforms;
-    #openoffice.hostDrv = nativePlatforms;
-    wxGTK.hostDrv = nativePlatforms;
+    bison.crossDrv = nativePlatforms;
+    busybox.crossDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    dropbear.crossDrv = nativePlatforms;
+    tigervnc.crossDrv = nativePlatforms;
+    wxGTK.crossDrv = nativePlatforms;
     #firefox = nativePlatforms;
     xorg = {
-      #xorgserver.hostDrv = nativePlatforms;
+      #xorgserver.crossDrv = nativePlatforms;
     };
-    nixUnstable.hostDrv = nativePlatforms;
-    linuxPackages_2_6_39.kernel.hostDrv = linux;
-    linuxPackages_3_3.kernel.hostDrv = linux;
-    linuxPackages_3_4.kernel.hostDrv = linux;
+    nixUnstable.crossDrv = nativePlatforms;
+    linuxPackages_3_4.kernel.crossDrv = linux;
   };
 
   /* Basic list of packages to be natively built,
      but need a crossSystem defined to get meaning */
-  basicBuildDrv = {
+  basicNativeDrv = {
     gdbCross = nativePlatforms;
   };
 
-  basic = basicHostDrv // basicBuildDrv;
+  basic = basicCrossDrv // basicNativeDrv;
 
 in
 (
@@ -36,7 +33,7 @@ in
 /* Test some cross builds to the Sheevaplug */
 let
   crossSystem = {
-    config = "armv5tel-unknown-linux-gnueabi";  
+    config = "armv5tel-unknown-linux-gnueabi";
     bigEndian = false;
     arch = "arm";
     float = "soft";
@@ -50,14 +47,14 @@ in {
   crossSheevaplugLinux = mapTestOnCross crossSystem (
     basic //
     {
-      ubootSheevaplug.hostDrv = nativePlatforms;
+      ubootSheevaplug.crossDrv = nativePlatforms;
     });
 }) // (
 
 /* Test some cross builds to the Sheevaplug - uclibc*/
 let
   crossSystem = {
-    config = "armv5tel-unknown-linux-gnueabi";  
+    config = "armv5tel-unknown-linux-gnueabi";
     bigEndian = false;
     arch = "arm";
     float = "soft";
@@ -79,14 +76,14 @@ in {
   crossSheevaplugLinuxUclibc = mapTestOnCross crossSystem (
     basic //
     {
-      ubootSheevaplug.hostDrv = nativePlatforms;
+      ubootSheevaplug.crossDrv = nativePlatforms;
     });
 }) // (
 
 /* Test some cross builds to the mipsel */
 let
   crossSystem = {
-    config = "mipsel-unknown-linux";  
+    config = "mipsel-unknown-linux";
     bigEndian = false;
     arch = "mips";
     float = "soft";
@@ -120,7 +117,7 @@ in {
 /* Test some cross builds to the ultrasparc */
 let
   crossSystem = {
-    config = "sparc64-unknown-linux";  
+    config = "sparc64-unknown-linux";
     bigEndian = true;
     arch = "sparc64";
     float = "hard";
@@ -153,14 +150,14 @@ let
   };
 in {
   crossMingw32 = mapTestOnCross crossSystem {
-    coreutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    windows.wxMSW.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    windows.wxMSW.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -176,14 +173,14 @@ let
   };
 in {
   crossMingwW64 = mapTestOnCross crossSystem {
-    coreutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    windows.wxMSW.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    windows.wxMSW.crossDrv = nativePlatforms;
   };
 }) // (
 
@@ -202,41 +199,41 @@ let
 in {
   crossGNU = mapTestOnCross crossSystem {
     gnu.hurdCross = nativePlatforms;
-    gnu.mach.hostDrv = nativePlatforms;
+    gnu.mach.crossDrv = nativePlatforms;
     gnu.mig = nativePlatforms;
-    gnu.smbfs.hostDrv = nativePlatforms;
+    gnu.smbfs.crossDrv = nativePlatforms;
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    grub2.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    boehmgc.hostDrv = nativePlatforms;
-    findutils.hostDrv = nativePlatforms;
-    gcc.hostDrv = nativePlatforms;
-    gcc46.hostDrv = nativePlatforms;
-    gdb.hostDrv = nativePlatforms;
-    gmp.hostDrv = nativePlatforms;
-    gnugrep.hostDrv = nativePlatforms;
-    gnumake.hostDrv = nativePlatforms;
-    gnused.hostDrv = nativePlatforms;
-    guile_1_8.hostDrv = nativePlatforms;
-    guile.hostDrv = nativePlatforms;
-    libffi.hostDrv = nativePlatforms;
-    libtool.hostDrv = nativePlatforms;
-    libunistring.hostDrv = nativePlatforms;
-    lsh.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    openssl.hostDrv = nativePlatforms;            # dependency of Nix
-    patch.hostDrv = nativePlatforms;
-    samba_light.hostDrv = nativePlatforms;      # needed for `runInGenericVM'
-    zile.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    grub2.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    boehmgc.crossDrv = nativePlatforms;
+    findutils.crossDrv = nativePlatforms;
+    gcc.crossDrv = nativePlatforms;
+    gcc46.crossDrv = nativePlatforms;
+    gdb.crossDrv = nativePlatforms;
+    gmp.crossDrv = nativePlatforms;
+    gnugrep.crossDrv = nativePlatforms;
+    gnumake.crossDrv = nativePlatforms;
+    gnused.crossDrv = nativePlatforms;
+    guile_1_8.crossDrv = nativePlatforms;
+    guile.crossDrv = nativePlatforms;
+    libffi.crossDrv = nativePlatforms;
+    libtool.crossDrv = nativePlatforms;
+    libunistring.crossDrv = nativePlatforms;
+    lsh.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    openssl.crossDrv = nativePlatforms;            # dependency of Nix
+    patch.crossDrv = nativePlatforms;
+    samba_light.crossDrv = nativePlatforms;      # needed for `runInGenericVM'
+    zile.crossDrv = nativePlatforms;
   };
 }) // (
 
 /* Linux on the fuloong */
 let
   crossSystem = {
-    config = "mips64el-unknown-linux";  
+    config = "mips64el-unknown-linux";
     bigEndian = false;
     arch = "mips";
     float = "hard";
@@ -261,20 +258,20 @@ let
 in {
   fuloongminipc = mapTestOnCross crossSystem {
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    grub2.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    patch.hostDrv = nativePlatforms;
-    zile.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    grub2.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    patch.crossDrv = nativePlatforms;
+    zile.crossDrv = nativePlatforms;
   };
 }) // (
 
 /* Linux on the Ben Nanonote */
 let
   crossSystem = {
-    config = "mipsel-unknown-linux";  
+    config = "mipsel-unknown-linux";
     bigEndian = false;
     arch = "mips";
     float = "soft";
@@ -321,20 +318,65 @@ let
 in {
   nanonote = mapTestOnCross crossSystem {
 
-    coreutils.hostDrv = nativePlatforms;
-    ed.hostDrv = nativePlatforms;
-    inetutils.hostDrv = nativePlatforms;
-    nixUnstable.hostDrv = nativePlatforms;
-    patch.hostDrv = nativePlatforms;
-    zile.hostDrv = nativePlatforms;
-    prboom.hostDrv = nativePlatforms;
-    vim.hostDrv = nativePlatforms;
-    lynx.hostDrv = nativePlatforms;
-    patchelf.hostDrv = nativePlatforms;
-    nix.hostDrv = nativePlatforms;
-    fossil.hostDrv = nativePlatforms;
-    binutils.hostDrv = nativePlatforms;
-    mpg123.hostDrv = nativePlatforms;
-    yacas.hostDrv = nativePlatforms;
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    patch.crossDrv = nativePlatforms;
+    zile.crossDrv = nativePlatforms;
+    prboom.crossDrv = nativePlatforms;
+    vim.crossDrv = nativePlatforms;
+    lynx.crossDrv = nativePlatforms;
+    patchelf.crossDrv = nativePlatforms;
+    nix.crossDrv = nativePlatforms;
+    fossil.crossDrv = nativePlatforms;
+    binutils.crossDrv = nativePlatforms;
+    mpg123.crossDrv = nativePlatforms;
+    yacas.crossDrv = nativePlatforms;
+  };
+}) // (
+
+
+/* Linux on Raspberrypi */
+let
+  crossSystem = {
+    config = "armv6l-unknown-linux-gnueabi";
+    bigEndian = false;
+    arch = "arm";
+    float = "hard";
+    fpu = "vfp";
+    withTLS = true;
+    libc = "glibc";
+    platform = pkgs.platforms.raspberrypi;
+    openssl.system = "linux-generic32";
+    gcc = {
+      arch = "armv6";
+      fpu = "vfp";
+      float = "softfp";
+      abi = "aapcs-linux";
+    };
+  };
+in {
+  rpi = mapTestOnCross crossSystem {
+    coreutils.crossDrv = nativePlatforms;
+    ed.crossDrv = nativePlatforms;
+    inetutils.crossDrv = nativePlatforms;
+    nixUnstable.crossDrv = nativePlatforms;
+    patch.crossDrv = nativePlatforms;
+    vim.crossDrv = nativePlatforms;
+    tmux.crossDrv = nativePlatforms;
+    screen.crossDrv = nativePlatforms;
+    unrar.crossDrv = nativePlatforms;
+    unzip.crossDrv = nativePlatforms;
+    hdparm.crossDrv = nativePlatforms;
+    ddrescue.crossDrv = nativePlatforms;
+    git.crossDrv = nativePlatforms;
+    lynx.crossDrv = nativePlatforms;
+    patchelf.crossDrv = nativePlatforms;
+    nix.crossDrv = nativePlatforms;
+    fossil.crossDrv = nativePlatforms;
+    binutils.crossDrv = nativePlatforms;
+    mpg123.crossDrv = nativePlatforms;
+    yacas.crossDrv = nativePlatforms;
   };
 })
diff --git a/pkgs/top-level/release-haskell.nix b/pkgs/top-level/release-haskell.nix
new file mode 100644
index 00000000000..218ce951f06
--- /dev/null
+++ b/pkgs/top-level/release-haskell.nix
@@ -0,0 +1,437 @@
+/* Essential Haskell packages that must build. */
+
+{ supportedSystems ? [ "x86_64-linux" ] }:
+
+with import ./release-lib.nix { inherit supportedSystems; };
+
+let
+
+  ghc6104 = "ghc6104";
+  ghc6123 = "ghc6123";
+  ghc704  = "ghc704";
+  ghc742  = "ghc742";
+  ghc763  = "ghc763";
+  default = [ ghc763 ];
+  latest  = [ ];
+  all     = [ ghc6104 ghc6123 ghc704 ghc742 ghc763 ];
+
+  allBut = platform: pkgs.lib.filter (x: platform != x) all;
+
+  filterSupportedSystems = systems: pkgs.lib.filter (x: pkgs.lib.elem x supportedSystems) systems;
+
+  mapHaskellTestOn = attrs: pkgs.lib.mapAttrs mkJobs attrs;
+
+  mkJobs = pkg: ghcs: builtins.listToAttrs (pkgs.lib.concatMap (ghc: mkJob ghc pkg) ghcs);
+
+  mkJob = ghc: pkg:
+    let
+      pkgPath = ["haskellPackages_${ghc}" "${pkg}"];
+      systems = filterSupportedSystems (pkgs.lib.attrByPath (pkgPath ++ ["meta" "platforms"]) [] pkgs);
+    in
+      map (system: mkSystemJob system ghc pkg) systems;
+
+  mkSystemJob = system: ghc: pkg:
+    pkgs.lib.nameValuePair "${ghc}" (pkgs.lib.setAttrByPath [system] ((pkgs.lib.getAttrFromPath ["haskellPackages_${ghc}" "${pkg}"] (pkgsFor system))));
+
+in
+
+mapTestOn {
+
+  gitAndTools.gitAnnex = supportedSystems;
+  jhc = supportedSystems;
+
+}
+//
+mapHaskellTestOn {
+
+  abstractPar = default;
+  ACVector = default;
+  aeson = default;
+  AgdaExecutable = default;
+  alex = all;
+  alexMeta = default;
+  alsaCore = default;
+  alsaPcm = default;
+  alternativeIo = default;
+  ansiTerminal = default;
+  ansiWlPprint = default;
+  asn1Data = default;
+  AspectAG = default;
+  async = default ++ latest;
+  attempt = default;
+  attoparsec = default;
+  attoparsecEnumerator = default;
+  authenticate = default;
+  base64Bytestring = default;
+  baseUnicodeSymbols = default;
+  benchpress = default;
+  bimap = default;
+  binaryShared = default;
+  bitmap = default;
+  bktrees = default;
+  blazeBuilder = default;
+  blazeBuilderEnumerator = default;
+  blazeHtml = default;
+  blazeTextual = default;
+  bloomfilter = default;
+  bmp = default;
+  BNFC = default ++ latest;
+  BNFCMeta = default;
+  Boolean = default;
+  bytestringMmap = default;
+  bytestringNums = default;
+  bytestringTrie = default;
+  cabal2Ghci = default;
+  cabal2nix = allBut ghc6104;
+  cabalDev = default ++ latest;
+  cabalGhci = default ++ latest;
+  cabalInstall = all;
+  cairo = default;
+  caseInsensitive = default;
+  cautiousFile = default;
+  cereal = default;
+  certificate = default;
+  cgi = all;
+  Chart = default;
+  citeprocHs = default;
+  clientsession = default;
+  cmdargs = default;
+  cmdlib = default ++ latest;
+  colorizeHaskell = default;
+  colour = default;
+  comonadsFd = default;
+  conduit = default;
+  ConfigFile = default;
+  continuedFractions = default;
+  converge = default;
+  convertible = default;
+  cookie = default;
+  cpphs = default;
+  cprngAes = default;
+  criterion = default ++ latest;
+  cryptoApi = default;
+  cryptocipher = default;
+  Crypto = default;
+  cryptohash = default;
+  cssText = default;
+  csv = default;
+  darcs = default;
+  dataAccessor = default;
+  dataAccessorTemplate = default;
+  dataDefault = default;
+  dataenc = default;
+  dataReify = default;
+  datetime = default;
+  DAV = default;
+  dbus = default;
+  derive = default;
+  diagrams = default;
+  Diff = default;
+  digest = default;
+  digestiveFunctorsHeist = default;
+  digestiveFunctorsSnap = default;
+  dimensional = default ++ latest;
+  dimensionalTf = default ++ latest;
+  directoryTree = default;
+  dlist = default;
+  dns = default;
+  doctest = default ++ latest;
+  dotgen = default;
+  doubleConversion = default;
+  editDistance = default;
+  editline = default;
+  emailValidate = default;
+  entropy = default;
+  enumerator = default;
+  erf = default;
+  failure = default;
+  fclabels = default;
+  feed = default;
+  fgl = all;
+  fileEmbed = default;
+  filestore = default;
+  fingertree = default;
+  flexibleDefaults = default;
+  fsnotify = [ ghc704 ghc742 ghc763 ];
+  funcmp = all;
+  gamma = default;
+  gdiff = default;
+  ghc = default;
+  ghcEvents = default;
+  ghcMod = default ++ latest;
+  ghcMtl = default;
+  ghcPaths = default;
+  ghcSybUtils = default;
+  githubBackup = default;
+  github = default;
+  gitit = default;
+  glade = default;
+  glib = default;
+  Glob = default;
+  gloss = default;
+  GLUT = all;
+  gnutls = default;
+  graphviz = default ++ latest;
+  gtk = default;
+  gtksourceview2 = default;
+  hackageDb = default ++ latest;
+  haddock = all;
+  hakyll = default;
+  hamlet = default;
+  happstackHamlet = default;
+  happstackServer = default;
+  happy = all;
+  hashable = default;
+  hashedStorage = default;
+  haskeline = default;
+  haskellLexer = default;
+  haskellPlatform = all;
+  haskellSrc = all;
+  haskellSrcExts = default;
+  haskellSrcMeta = default;
+  HaXml = default;
+  haxr = default;
+  HDBC = default;
+  HDBCPostgresql = default;
+  HDBCSqlite3 = default;
+  highlightingKate = default;
+  hinotify = default;
+  hint = default;
+  hledger = default ++ latest;
+  hledgerInterest = default ++ latest;
+  hledgerLib = default ++ latest;
+  hledgerWeb = default;
+  hlint = default ++ latest;
+  HList = default ++ latest;
+  hmatrix = default;
+  hoogle = default ++ latest;
+  hopenssl = all;
+  hostname = default;
+  hp2anyCore = default;
+  hp2anyGraph = default;
+  hS3 = default;
+  hscolour = default;
+  hsdns = all;
+  hsemail = allBut ghc6104;
+  hslogger = default;
+  hsloggerTemplate = default;
+  hspec = default ++ latest;
+  HsSyck = default;
+  HStringTemplate = default ++ latest;
+  hsyslog = all;
+  html = all;
+  HTTP = all;
+  httpConduit = default;
+  httpDate = default;
+  httpdShed = default;
+  httpTypes = default;
+  HUnit = all;
+  hxt = default;
+  idris = default;
+  IfElse = default;
+  irc = default;
+  iteratee = default;
+  jailbreakCabal = all;
+  json = default;
+  jsonTypes = default;
+  keter = default;
+  lambdabot = default;
+  languageCQuote = default;
+  languageJavascript = default;
+  largeword = default;
+  lens = default;
+  libxmlSax = default;
+  liftedBase = default;
+  ListLike = default;
+  logfloat = default;
+  mainlandPretty = default;
+  maude = default;
+  MaybeT = default;
+  MemoTrie = default;
+  mersenneRandomPure64 = default;
+  mimeMail = default;
+  MissingH = default;
+  mmap = default;
+  MonadCatchIOMtl = default;
+  MonadCatchIOTransformers = default;
+  monadControl = default;
+  monadLoops = default;
+  monadPar = default ++ latest;
+  monadPeel = default;
+  MonadPrompt = default;
+  MonadRandom = default;
+  mpppc = default;
+  mtl = all;
+  mtlparse = default;
+  multiplate = default;
+  multirec = default;
+  murmurHash = default;
+  mwcRandom = default;
+  nat = default;
+  nats = default;
+  naturals = default;
+  network = all;
+  networkInfo = default;
+  networkMulticast = default;
+  networkProtocolXmpp = default;
+  nonNegative = default;
+  numericPrelude = default;
+  numtype = default;
+  numtypeTf = default;
+  ObjectName = default;
+  OneTuple = default;
+  OpenAL = all;
+  optparseApplicative = allBut ghc6104;
+  packunused = default;
+  pandoc = default ++ latest;
+  pandocTypes = default;
+  pango = default;
+  parallel = all;
+  parseargs = default;
+  parsec3 = default;
+  parsec = all;
+  parsimony = default;
+  pathPieces = default;
+  pathtype = default;
+  pcreLight = default;
+  permutation = default ++ latest;
+  persistent = default;
+  persistentPostgresql = default;
+  persistentSqlite = default;
+  persistentTemplate = default;
+  polyparse = default;
+  ppm = default;
+  prettyShow = default;
+  primitive = all;
+  PSQueue = default;
+  pureMD5 = default;
+  pwstoreFast = default;
+  QuickCheck2 = default;
+  QuickCheck = all;
+  random = default ++ latest;
+  randomFu = default;
+  randomShuffle = default;
+  randomSource = default;
+  RangedSets = default;
+  ranges = default;
+  readline = default;
+  recaptcha = default;
+  regexBase = all;
+  regexCompat = all;
+  regexPCRE = default;
+  regexPosix = all;
+  regexpr = default;
+  regexTDFA = default;
+  regular = default;
+  RSA = default;
+  rvar = default;
+  safe = default;
+  SafeSemaphore = default;
+  SDL = default;
+  SDLImage = default;
+  SDLMixer = default;
+  SDLTtf = default;
+  semigroups = default;
+  sendfile = default;
+  SHA = default;
+  shake = default;
+  Shellac = default;
+  shelly = default;
+  simpleSendfile = default;
+  smallcheck = default ++ latest;
+  SMTPClient = default;
+  snapCore = default;
+  snap = default;
+  snapLoaderStatic = default;
+  snapServer = default;
+  split = default ++ latest;
+  srcloc = default;
+  stateref = default;
+  StateVar = default;
+  statistics = default;
+  stbImage = default;
+  stm = all;
+  storableComplex = default;
+  storableRecord = default;
+  streamproc = all;
+  strict = default;
+  strptime = default;
+  svgcairo = default;
+  syb = [ ghc704 ghc742 ghc763 ];
+  sybWithClass = default;
+  sybWithClassInstancesText = default;
+  tabular = default;
+  tagged = default;
+  tagsoup = default;
+  tar = default ++ latest;
+  Tensor = default;
+  terminfo = default;
+  testFramework = default ++ latest;
+  testFrameworkHunit = default ++ latest;
+  texmath = default;
+  text = all;
+  thLift = default;
+  timeplot = default;
+  tls = default;
+  tlsExtra = default;
+  transformers = all;
+  transformersBase = default;
+  transformersCompat = default;
+  tuple = default;
+  typeLevelNaturalNumber = default;
+  uniplate = default;
+  uniqueid = default;
+  unixCompat = default;
+  unorderedContainers = default;
+  url = default;
+  utf8Light = default;
+  utf8String = default;
+  utilityHt = default;
+  uuagc = default;
+  uuid = default;
+  uulib = default ++ latest;
+  uuOptions = default;
+  uuParsinglib = default;
+  vacuum = default;
+  vcsRevision = default;
+  Vec = default;
+  vectorAlgorithms = default;
+  vector = all;
+  vectorSpace = default;
+  vty = default;
+  waiAppStatic = default;
+  wai = default;
+  waiExtra = default;
+  waiLogger = default;
+  warp = default;
+  wlPprint = default ++ latest;
+  wlPprintExtras = default;
+  wlPprintTerminfo = default;
+  X11 = default;
+  xhtml = all;
+  xmlConduit = default;
+  xml = default;
+  xmlHamlet = default;
+  xmlTypes = default;
+  xmobar = default ++ latest;
+  xmonadContrib = default ++ latest;
+  xmonad = default ++ latest;
+  xmonadExtras = default ++ latest;
+  xssSanitize = default;
+  yesodAuth = default;
+  yesodCore = default;
+  yesod = default;
+  yesodDefault = default;
+  yesodForm = default;
+  yesodJson = default;
+  yesodPersistent = default;
+  yesodStatic = default;
+  zeromq3Haskell = default;
+  zeromqHaskell = default;
+  zipArchive = default;
+  zipper = default;
+  zlib = all;
+  zlibBindings = default;
+  zlibEnum = default;
+
+}
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index f6db077b313..3280df09dd5 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -1,16 +1,22 @@
+{ supportedSystems }:
+
 rec {
-  allPackages = import ./all-packages.nix;
 
-  pkgs = allPackages {};
+  # Ensure that we don't build packages marked as unfree.
+  allPackages = args: import ./all-packages.nix (args // {
+    config.allowUnfree = false;
+  });
+
+  pkgs = allPackages { system = "x86_64-linux"; };
 
-  /* !!! Hack: poor man's memoisation function.  Necessary for prevent
+
+  /* !!! Hack: poor man's memoisation function.  Necessary to prevent
      Nixpkgs from being evaluated again and again for every
      job/platform pair. */
   pkgsFor = system:
     if system == "x86_64-linux" then pkgs_x86_64_linux
     else if system == "i686-linux" then pkgs_i686_linux
     else if system == "x86_64-darwin" then pkgs_x86_64_darwin
-    else if system == "i686-darwin" then pkgs_i686_darwin
     else if system == "x86_64-freebsd" then pkgs_x86_64_freebsd
     else if system == "i686-freebsd" then pkgs_i686_freebsd
     else if system == "i686-cygwin" then pkgs_i686_cygwin
@@ -19,38 +25,46 @@ rec {
   pkgs_x86_64_linux = allPackages { system = "x86_64-linux"; };
   pkgs_i686_linux = allPackages { system = "i686-linux"; };
   pkgs_x86_64_darwin = allPackages { system = "x86_64-darwin"; };
-  pkgs_i686_darwin = allPackages { system = "i686-darwin"; };
   pkgs_x86_64_freebsd = allPackages { system = "x86_64-freebsd"; };
   pkgs_i686_freebsd = allPackages { system = "i686-freebsd"; };
   pkgs_i686_cygwin = allPackages { system = "i686-cygwin"; };
 
+
   /* The working or failing mails for cross builds will be sent only to
      the following maintainers, as most package maintainers will not be
      interested in the result of cross building a package. */
   crossMaintainers = with pkgs.lib.maintainers; [ viric ];
 
+
   /* Set the Hydra scheduling priority for a job.  The default
-     priority (10) should be used for most jobs.  A different
-     priority should only be used for a few particularly interesting
-     jobs (in terms of giving feedback to developers), such as stdenv.
-  */
+     priority (10) should be used for most jobs.  A different priority
+     should only be used for a few particularly interesting jobs (in
+     terms of giving feedback to developers), such as stdenv. */
   prio = level: job: toJob job // { schedulingPriority = level; };
 
+
   toJob = x: if builtins.isAttrs x then x else
     { type = "job"; systems = x; schedulingPriority = 10; };
 
-  /* Perform a job on the given set of platforms.  The function `f' is
-     called by Hydra for each platform, and should return some job
-     to build on that platform.  `f' is passed the Nixpkgs collection
-     for the platform in question. */
-  testOn = systems: f: {system ? builtins.currentSystem}:
-    if pkgs.lib.elem system systems then f (pkgsFor system) else {};
 
-  /* Similar to the testOn function, but with an additional 'crossSystem'
-   * parameter for allPackages, defining the target platform for cross builds */
+  /* Build a package on the given set of platforms.  The function `f'
+     is called for each supported platform with Nixpkgs for that
+     platform as an argument .  We return an attribute set containing
+     a derivation for each supported platform, i.e. ‘{ x86_64-linux =
+     f pkgs_x86_64_linux; i686-linux = f pkgs_i686_linux; ... }’. */
+  testOn = systems: f: pkgs.lib.genAttrs
+    (pkgs.lib.filter (x: pkgs.lib.elem x supportedSystems) systems)
+    (system: f (pkgsFor system));
+
+
+  /* Similar to the testOn function, but with an additional
+     'crossSystem' parameter for allPackages, defining the target
+     platform for cross builds. */
   testOnCross = crossSystem: systems: f: {system ? builtins.currentSystem}:
-    if pkgs.lib.elem system systems then f (allPackages {inherit system
-                crossSystem;}) else {};
+    if pkgs.lib.elem system systems
+    then f (allPackages { inherit system crossSystem; })
+    else {};
+
 
   /* Map an attribute of the form `foo = [platforms...]'  to `testOn
      [platforms...] (pkgs: pkgs.foo)'. */
@@ -67,7 +81,7 @@ rec {
 
   /* Similar to the testOn function, but with an additional 'crossSystem'
    * parameter for allPackages, defining the target platform for cross builds,
-   * and triggering the build of the host derivation (cross built - hostDrv). */
+   * and triggering the build of the host derivation (cross built - crossDrv). */
   mapTestOnCross = crossSystem: pkgs.lib.mapAttrsRecursiveCond
     (as: !(as ? type && as.type == "job"))
     (path: value:
@@ -75,37 +89,36 @@ rec {
         job = toJob value;
         getPkg = pkgs: (pkgs.lib.addMetaAttrs {
             schedulingPriority = toString job.schedulingPriority;
-            maintainers = crossMaintainers; 
+            maintainers = crossMaintainers;
           }
           (pkgs.lib.getAttrFromPath path pkgs));
       in testOnCross crossSystem job.systems getPkg);
 
+
   /* Find all packages that have a meta.platforms field listing the
      supported platforms. */
-  packagesWithMetaPlatform = attrSet: 
-    if builtins ? tryEval then 
-      let pairs = pkgs.lib.concatMap 
-        (x:
-	  let pair = builtins.tryEval
-	        (let 
-		   attrVal = (builtins.getAttr x attrSet);
-		 in
-		   {val=(processPackage attrVal); 
-		    attrVal = attrVal;
-		    attrValIsAttrs = builtins.isAttrs attrVal;
-		    });
-	      success = (builtins.tryEval pair.value.attrVal).success;
-	  in
-          if success && pair.value.attrValIsAttrs && 
-	      pair.value.val != [] then 
-	    [{name= x; value=pair.value.val;}] else [])
-        (builtins.attrNames attrSet);
-      in
-        builtins.listToAttrs pairs
-    else {};
-    
+  packagesWithMetaPlatform = attrSet:
+    let pairs = pkgs.lib.concatMap
+      (x:
+        let pair = builtins.tryEval
+              (let
+                 attrVal = (builtins.getAttr x attrSet);
+               in
+                 { val = processPackage attrVal;
+                   attrVal = attrVal;
+                   attrValIsAttrs = builtins.isAttrs attrVal;
+                 });
+            success = (builtins.tryEval pair.value.attrVal).success;
+        in
+        pkgs.lib.optional (success && pair.value.attrValIsAttrs && pair.value.val != [])
+          { name = x; value = pair.value.val; })
+      (builtins.attrNames attrSet);
+    in
+      builtins.listToAttrs pairs;
+
+
   # May fail as much as it wishes, we will catch the error.
-  processPackage = attrSet: 
+  processPackage = attrSet:
     if attrSet ? recurseForDerivations && attrSet.recurseForDerivations then
       packagesWithMetaPlatform attrSet
     else if attrSet ? recurseForRelease && attrSet.recurseForRelease then
@@ -115,12 +128,13 @@ rec {
         then attrSet.meta.platforms
         else [];
 
+
   /* Common platform groups on which to test packages. */
-  inherit (pkgs.lib.platforms) linux darwin cygwin allBut all mesaPlatforms;
+  inherit (pkgs.lib.platforms) unix linux darwin cygwin allBut all mesaPlatforms;
 
   /* Platform groups for specific kinds of applications. */
   x11Supported = linux;
   gtkSupported = linux;
-  ghcSupported = linux ++ ["i686-darwin"] ;
+  ghcSupported = linux;
 
 }
diff --git a/pkgs/top-level/release-python.nix b/pkgs/top-level/release-python.nix
new file mode 100644
index 00000000000..4b5bad0761d
--- /dev/null
+++ b/pkgs/top-level/release-python.nix
@@ -0,0 +1,1999 @@
+/*
+  This file will be evaluated by hydra with a call like this:
+  hydra_eval_jobs --gc-roots-dir \
+    /nix/var/nix/gcroots/per-user/hydra/hydra-roots --argstr \
+    system i686-linux --argstr system x86_64-linux --arg \
+    nixpkgs "{outPath = ./}" .... release.nix
+
+  Hydra can be installed with "nix-env -i hydra".
+*/
+with (import ./release-lib.nix);
+
+let
+  jobsForDerivations = attrset: pkgs.lib.attrsets.listToAttrs
+    (map
+      (name: { inherit name;
+               value = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };})
+      (builtins.attrNames
+        (pkgs.lib.attrsets.filterAttrs
+          (n: v: (v.type or null) == "derivation")
+          attrset)));
+
+in
+{
+
+  tarball = import ./make-tarball.nix;
+
+} // (mapTestOn rec {
+
+  a2jmidid = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aacskeys = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2005 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2006 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2007 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2008 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2009 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2010 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aangifte2011 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  abc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  abcde = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  abiword = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  acl2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  adobeReader = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  agg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  allegro = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  allegro5 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  alliance = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  alsaPlugins = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  alsaPluginWrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  amsn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  amule = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  amuleDaemon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  amuleGui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  androidsdk_4_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  andyetitmoves = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ant = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  antlr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  antlr3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  apacheAntGcj = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  apacheAntOpenJDK = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  apacheAntOracleJDK = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  apparmor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aqbanking = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  arb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ardour3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  arora = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  asc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  asciidoc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  asio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aspectj = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  asymptote = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  atanks = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  atari800 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ataripp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  atermjava = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  atk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  atkmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  attica = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aubio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  auctex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  audacious = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  audacity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  autojump = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  automoc4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  avahi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  avidemux = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  avogadro = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  awesome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  aws_mturk_clt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  axis2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  azureus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ballAndPaddle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  baresip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bazaar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  beast = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  beret = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ber_metaocaml_003 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bibletime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bibtextools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  binutils_gold = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  biolib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bitcoin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bitlbee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bitsnbots = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bittornado = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bittorrent = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  blackshades = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  blackshadeselite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  blender = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  blobby = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  blueman = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bluez = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boinc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boomerang = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost144 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost146 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  boost149 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  botan = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  box2d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  box2d_2_0_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  briss = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bsddb3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  btanks = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  btrfsProgs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  buildbot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bumblebee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bup = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  bzflag = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  caelum = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cairomm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  calf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  calibre = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  caneda = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  carrier = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  castle_combat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cbrowser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cc1394 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cdrdao = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cflow = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cgal = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cgui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  chatzilla = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cheetahTemplate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  chipmunk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  chromiumWrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  chromium = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cilaterm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cinelerra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cinepaint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ciopfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clang = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clangUnwrapped = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clanlib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  classpath = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clearsilver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clisp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clisp_2_44_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clojure = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clojure_wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clooj_wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clucene_core_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clutter = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clutter_gtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  clutter_gtk_0_10 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cmakeWithGui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cmus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  coccinelle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cogl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  coin3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  comical = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  compiz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  compton = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  conkeror = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  conky = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  consolekit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  construo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  construoBase = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  coq = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  coq_8_3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  coriander = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  couchdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  crack_attack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  crrcsim = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cryptsetup = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cscope = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  csound = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  csslint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cudatoolkit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cuneiform = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cups_pdf_filter = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  curlftpfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cvs2svn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  cython = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  d4x = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  darktable = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dbench = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dblatex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dbus_cplusplus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dbus_glib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dbus_java = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dbus_tools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ddd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  debian_devscripts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dejagnu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  desktop_file_utils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  devicemapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dico = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  directfb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  directvnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  disnix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  disnixos = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  DisnixWebService = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  disper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  distcc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  distrho = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  djview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dmenu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dmraid = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dmtcp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dmtx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  docutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dosbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  doxygen_gui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dragonegg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  drbd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  drgeo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dropbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dssi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dstat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  duplicity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dvdauthor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dvswitch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dwarf_fortress = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  dwm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eaglemode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  easytag = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ec2_api_tools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ecj = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eclipses = {
+    eclipse_cpp_36 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_cpp_37 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_modeling_36 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_sdk_35 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_sdk_36 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_sdk_37 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eclipse_sdk_42 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  ecryptfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  edk2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eduke32 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eggdbus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  egoboo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ekiga = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  elasticmq = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  electricsheep = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  elinks = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  emacs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  emacs23 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  emacs24Packages = {
+    autoComplete = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bbdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    calfw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cedet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    coffee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    colorTheme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ecb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    emacsSessionManagement = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    emacsw3m = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    emms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    flymakeCursor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gh = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gist = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    graphvizDot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellMode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    jabber = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    jade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    jdee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    js2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    logito = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    loremIpsum = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    magit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    maudeMode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    notmuch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocamlMode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    org = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    org2blog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pcache = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    proofgeneral = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    quack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rectMark = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    remember = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    scalaMode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    sunriseCommander = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmlRpc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  emboss = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  enblendenfuse = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  encfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  enchant = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  enlightenment = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  epdfview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  epm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eprover = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eql = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  esdl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  espeakedit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  etherape = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  euca2ools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  eukleides = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  evince = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  evolution_data_server = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  evopedia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  expect = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  exrdisplay = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  extremetuxracer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  exult = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  facile = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fail2ban = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fakenes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  farsight2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  farstream = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fbida = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fbpanel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fdisk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  feh = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ffado = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ffmpeg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ffmpeg_0_6_90 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ffmpeg_1_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fileschanged = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  firefox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  firefox13Wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  firefox17Wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  firefox36Wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  flann = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  flashplayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  flightgear = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fltk13 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fltk20 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fluidsynth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fontforgeX = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  foo2zjs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  foursuite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  framac = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freecad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freeciv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freedink = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freeglut = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freemind = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freepv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freerdp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freerdpUnstable = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freestyle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freetalk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  freetts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fsg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fsharp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fspot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ftgl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ftgl212 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fuppes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  fusesmb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gajim = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gav = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gcj = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gcj44 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gcj46 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gcl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  GConf3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gdbCross = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gdk_pixbuf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gdmap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gdome2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gecko_mediaplayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  geeqie = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gegl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gegl_0_0_22 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gemrb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gensgs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  geoclue = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  geoipjava = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  get_iplayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  getmail = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gftp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ghostOne = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ghostscriptX = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  giblib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gifsicle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gigedit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gimp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gimp_2_8 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gimpPlugins = {
+    fourier = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gimplensfun = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gmic = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lqrPlugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    resynthesizer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    texturize = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ufraw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    waveletSharpen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  girara = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  git = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gitAndTools = {
+    darcsToGit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    git2cl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitAnnex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitBz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitFastExport = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitFull = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitSubtree = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gitSVN = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    qgit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    qgitGit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    stgit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    svn2git = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    svn2git_kde = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    tig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  giv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gkrellm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gl117 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glestae = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glew = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glfw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glibmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glib_networking = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  globulation2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gltron = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  glxinfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gmime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gmtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gmu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnash = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnokii = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnome = {
+    at_spi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GConf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gconfmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_control_center = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_desktop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_doc_utils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_icon_theme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_keyring = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_menus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_panel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_python = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_session = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_settings_daemon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_vfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gnome_vfs_monikers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtk_doc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtkglext = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtkglextmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtkhtml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtkmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtksourceview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gvfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libbonobo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libbonoboui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libglade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libglademm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomecanvas = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomecanvasmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomecups = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomekbd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomeprint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomeprintui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgnomeui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgtkhtml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libgweather = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libIDL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libsoup = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libunique = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libwnck = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    metacity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    nautilus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ORBit2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pango = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pangomm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    python_rsvg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    startup_notification = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    vte = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zenity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  gnome_mplayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnome_terminator = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnome_user_docs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnonlin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnucash = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnu = {
+    hurdHeaders = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libpthreadHeaders = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mach = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    machHeaders = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mig_raw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  gnumeric = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnunet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnunet08 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnupg2_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gnuplot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gob2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gobby5 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gobjectIntrospection = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  goffice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  goffice_0_9 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  goldendict = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  golly = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  goocanvas = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  googleearth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  google_talk_plugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gosmore = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gource = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gparted = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gpgme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gphoto2fs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gpscorrelate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gpsd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gqview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grantlee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  graphicsmagick = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  graphicsmagick137 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  graphviz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  graphviz_2_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grass = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gravit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grive = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grub2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  grub2_efi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gsettings_desktop_schemas = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gsmartcontrol = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gssdp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_ffmpeg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_plugins_bad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_plugins_base = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_plugins_good = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_plugins_ugly = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gst_python = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gstreamer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtk3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkdatabox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkdialog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkgnutella = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkimageview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkmathview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkmm3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkmozembedsharp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkpod = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtksharp1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtksharp2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtksourceviewsharp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkspell = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkvnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtkwave = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gtmess = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  guileCairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  guileGnome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  guitone = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gupnp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gupnp_igd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gupnptools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gutenprint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gutenprintBin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gwenhywfar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gwrap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  gxneur = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hadoop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  harfbuzz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  haskellPackages = {
+    accelerateCuda = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    accelerateExamples = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    Chart = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cuda = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    diagrams = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    diagramsCairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ghcMod = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    glade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLFW = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    glib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gloss = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLURaw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLUT = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLUT_2_1_1_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLUT_2_1_2_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLUT_2_2_2_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GLUT_2_3_1_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtksourceview2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2009_2_0_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2010_1_0_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2010_2_0_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2011_2_0_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2011_2_0_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2011_4_0_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    haskellPlatform_2012_2_0_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    HGL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    hmatrix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    hp2anyGraph = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lambdacubeEngine = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    LambdaHack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    leksah = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    leksahServer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lhs2tex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ltk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGL_2_2_1_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGL_2_2_3_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGL_2_4_0_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGL_2_6_0_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    OpenGLRaw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pakcs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pango = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    reactiveBananaWx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    repaAlgorithms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    repaExamples = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    SDL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    SDLImage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    SDLMixer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    SDLTtf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    splot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    svgcairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    threadscope = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    timeplot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    uhc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    vacuumCairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wxc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wxcore = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    X11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    X11Xft = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmobar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmonad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmonadContrib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmonadExtras = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  haxe = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  heimdall = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  herqq = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hevea = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hexen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  highlight = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hol_light = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  homebank = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hplip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  htmldoc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  httpfs2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hwloc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hydraAntLogger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  hydrogen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  i3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  i3lock = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  i7z = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icbm3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icecat3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icecat3Wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icecat3Xul = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icecatXulrunner3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icedtea = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  icewm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  idutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ikiwiki = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  imagemagick = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  imagemagickBig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  imlib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  imlib2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  impressive = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  indilib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  inkscape = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  instead = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  intelgen4asm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  io = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ion3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  iotop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  iprover = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  irrlicht3843 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  irssi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  isabelle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  isocodes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  itk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  itstool = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jackaudio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jack_capture = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jackmeter = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jags = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jamp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  javaCup = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jbidwatcher = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jboss = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jboss_mysql_jdbc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jbrout = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jclasslib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jdiskreport = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jdk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jedit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jfsrec = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jigdo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jing_tools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jjtraveler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jnettop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jre = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jrePlugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jruby165 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jscoverage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  json_glib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  julia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  jwm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  k3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kaffe = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kde3 = {
+    arts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdelibs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  kde4 = {
+    akonadi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    akunambol = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    amarok = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    amor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ark = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    aurorae = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bangarang = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    basket = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    blinken = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bluedevil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    calligra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cantor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cervisia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ColorSchemes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    desktopthemes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    digikam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    dolphin_plugins_git = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    dolphin_plugins_svn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    emoticons = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    filelight = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    filesharing = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gwenview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    HighResolutionWallpapers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    IconThemes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    jovie = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    k3b = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kaccessible = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kadu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kalgebra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kalzium = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kamera = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kanagram = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kapptemplate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kbibtex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kbluetooth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kbruch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kcachegrind = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kcalc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kcharselect = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kcolorchooser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kcron = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeaccessibility = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeaccounts_plugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeadmin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeartwork = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kde_baseapps = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdebindings = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeedu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdegames = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdegraphics = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdegraphics_strigi_analyzer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdegraphics_thumbnailers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdelibs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdemultimedia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdenetwork = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdenlive = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdepim = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdepimlibs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdepim_runtime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeplasma_addons = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kde_runtime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdesdk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdesvn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdetoys = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdeutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdevelop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdevplatform = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kde_wacomtablet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdewebdev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kde_workspace = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdiff3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kdnssd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kfile_plugins = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kfilereplace = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kfloppy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kgamma = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kgeography = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kget = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kgpg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    khangman = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kile = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kimagemapeditor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kioslave_perldoc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kioslave_svn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kipi_plugins = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kiten = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    klettres = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    klinkstatus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmag = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmousetool = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmouth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmplayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmplot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmtrace = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kmymoney = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    koffice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kolourpaint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kommander = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kompare = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    konq_plugins = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    konsole = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    konversation = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kopete = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kpartloader = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kppp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kprofilemethod = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    krdc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kremotecontrol = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    krename = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    krfb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kruler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    krusader = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ksaneplugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kscreensaver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ksnapshot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ksshaskpass = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kstars = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kstartperf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ksystemlog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kteatime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ktimer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ktorrent = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ktouch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kturtle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ktux = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kuickshow = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kuiviewer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kuser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kwallet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kwin_styles = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kwooty = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kwordquiz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.bg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.bs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ca = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ca_valencia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.cs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.da = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.de = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.el = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.en_GB = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.es = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.et = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.eu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.fi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.fr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ga = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.gl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.he = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.hr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.hu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.id = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.is = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.it = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ja = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.kk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.km = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.kn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ko = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.lt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.lv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.nb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.nds = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.nl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.nn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.pa = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.pl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.pt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.pt_BR = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ro = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ru = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.si = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.sk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.sl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.sr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.sv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.th = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.tr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.ug = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.uk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.wa = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.zh_CN = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    l10n.zh_TW = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libalkimia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libkdcraw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libkdeedu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libkexiv2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libkipi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libksane = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libktorrent = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libkvkontakte = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    liblikeback = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lokalize = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    marble = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mobipocket = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    networkmanagement = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    okteta = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    okular = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    parley = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    partitionManager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    polkit_kde_agent = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    poxml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    printer_applet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    psi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pykde4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    qt4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    quassel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    quasselClient = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    quasselDaemon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rekonq = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rocs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rsibreak = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    scripts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    semnotes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    skrooge = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    smokegen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    smokeqt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    sounds = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    step = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    strigi_analyzer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    styles = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    superkaramba = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    svgpart = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    sweeper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    system_config_printer_kde = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.accounts_kcm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.approver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.auth_handler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.call_ui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.common_internals = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.contact_applet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.contact_list = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.contact_runner = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.filetransfer_handler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.kded_integration_module = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.presence_applet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.send_file = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.telepathy_logger_qt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    telepathy.text_ui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    umbrello = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wallpapers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    WeatherWallpapers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    yakuake = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zanshin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  keen4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  keepassx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  keepnote = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  keymon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  keynav = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kicad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kino = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  klavaro = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kobodeluxe = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kona = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  kvm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  larswm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lash = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lastwatch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  latencytop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lazarus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ldcpp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ledger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ledger3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  leiningen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lensfun = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  leo2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lesstif = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lesstif93 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libao = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libassuan2_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libatasmart = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libbluedevil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libbluray = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libcanberra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libcdr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libchamplain = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libchamplain_0_6 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libcm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libcroco = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libcxx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libdbusmenu_qt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libdevil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libdmtx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libdrm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libextractor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libfixposix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgdata = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgdata_0_6 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgdiplus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgnome_keyring = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgnome_keyring3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgpod = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgsf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgtop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libgweather = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libimobiledevice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libinfinity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  liblapack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  liblastfm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  liblqr1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libmatchbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libmatthew_java = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libmms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libmusclecard = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libnice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libnotify = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  liboil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libopensc_dnie = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libplist = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libpseudo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libqalculate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libQGLViewer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  librecad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libreoffice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  librsvg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libsexy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libstartup_notification = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libtiger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libtorrentRasterbar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libva = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libvdpau = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libviper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libvirt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libvisio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libvncserver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libvterm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libwmf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libwnck3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libwpd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libwpd_08 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libwpg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libxklavier = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libxml2Python = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  libxmlxx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lilv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lilypond = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lincity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lingot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  links2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  linphone = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  linux = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  linuxConsoleTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  linuxPackages = {
+    acpi_call = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    atheros = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ati_drivers_x11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    aufs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    aufs_util = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bbswitch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    broadcom_sta = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cryptodev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    e1000e = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    exmap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    frandom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    iscsitarget = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    iwlwifi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    klibc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    kqemu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ndiswrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    nvidia_x11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    nvidia_x11_legacy173 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    nvidia_x11_legacy96 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    openafsClient = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    openiscsi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    perf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    spl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    sysprof = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    systemtap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    tp_smapi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    v86d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    virtualbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    virtualboxGuestAdditions = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wis_go7007 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  linuxsampler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  liquidwar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  llvm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lmms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  log4cxx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  logstalgica = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  loudmouth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  love = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lv2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  lyx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mailutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mars = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  martyr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  matchbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  matita = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  matita_130312 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  maven = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  maxima = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mcabber = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mcelog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mcomix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mcrl2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mdbtools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mdbtools_git = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mediastreamer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mediatomb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  meld = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  merkaartor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mesa = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  meshlab = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mess = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  metaocaml_3_09 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mhwaveedit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  micropolis = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  midori = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  midoriWrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  minecraft = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  miniHttpd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mirage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mitscheme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mjpegtools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mkvtoolnix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mlt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mmex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  modemmanager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mod_python = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mod_wsgi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mongodb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mono = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  monodevelop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  monodoc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  monotone = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  monotoneViz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mountall = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mozart = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mozilla = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mozplugger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mp3info = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mpc123 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mpd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mpg321 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mpich2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  MPlayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mrxvt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  msilbc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mtdutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  multipath_tools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  multisync = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mumble = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mupdf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mupen64plus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  muscleframework = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  muscletool = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mutt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mygui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  myguiSvn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mysql_jdbc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mysqlWorkbench = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  mythtv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  naev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  navipowm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  navit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nbd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ncbiCTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  netbeans = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  netboot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  netsurf.browser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  networkmanager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  networkmanagerapplet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  networkmanager_pptp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  networkmanager_pptp_gnome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  neverball = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nfsUtils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ngspice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ninka = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  njam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nmap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nodejs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nodePackages = {
+    abbrev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ansi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    async = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    backbone = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bindings = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    browserchannel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bson = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    buffertools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    bytes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    commander = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    connect = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cookie = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    crc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cssmin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    datetime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    debug = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    diff = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    eyes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    formidable = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    fresh = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    fstream = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    glob = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    hat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    hiredis = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    inherits = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    knox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    less = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    minimatch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mkdirp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mongodb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mrclean = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    nopt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    npm2nix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    npmlog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    optimist = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    options = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    osenv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pause = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    policyfile = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    qs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rbytes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    redis = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    request = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    requirejs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    rimraf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    semver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    send = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    showdown = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    sockjs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    swig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    tar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    temp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    timerstub = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    tinycolor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    underscore = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    vows = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    which = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wordwrap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ws = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    wu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmlhttprequest = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zeparser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  notmuch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nova = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  novaclient = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nspluginwrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nss = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nss_pam_ldapd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nssTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ntop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ntrack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  numeric = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nut = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  nut_2_6_3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  obexd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  obex_data_server = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  obexfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  obexftp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  obnam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocaml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocaml_3_08_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocaml_3_10_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocaml_3_11_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocaml_4_00_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocamlnat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ocamlPackages = {
+    camlidl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camlp5_5_strict = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camlp5_5_transitional = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camlp5_6_strict = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camlp5_6_transitional = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camlzip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camomile = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    camomile_0_8_2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    cryptokit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    findlib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gmetadom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lablgtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    lablgtkmathview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    menhir = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mldonkey = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_batteries = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_cryptgps = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_expat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_extlib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocamlgraph = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_http = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_lwt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_mysql = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocamlnet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_pcre = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_react = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_sexplib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_sqlite3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_ssl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ocaml_typeconv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ounit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    pycaml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ulex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ulex08 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  octave = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  octaveHG = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  offlineimap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ogre = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ogrepaged = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ois = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  omake = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  oneteam = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opa = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opal = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openbabel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openbox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opencascade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opencsg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openct = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opencv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opencv_2_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openfire = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openlierox = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openobex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opensc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openscad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opensc_dnie_wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openscenegraph = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  openttd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opentyrian = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opera = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opkg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  opusTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  oraclejdk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  oraclejre = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  OVMF = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  oxygen_gtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pal = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pam_console = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pam_usb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pan = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pangoxsl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  panomatic = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  paraview = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  parted = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  parted_2_3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  path64 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pavucontrol = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pcmciaUtils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pcsclite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pdf2djvu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pdfread = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pdftk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  perlPackages = {
+    Autodia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GD = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    GraphViz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    InlineJava = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    PerlMagick = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    SQLTranslator = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    TextRecordParser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    X11GUITest = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  petrifoo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pfstools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pgadmin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  philter = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  phonon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  phonon_backend_gstreamer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  phonon_backend_vlc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pianobooster = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  picard = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  picolisp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidgin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidginlatex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidginlatexSF = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidginmsnpecan = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidginotr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pidginsipe = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pinentry = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pinta = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pioneers = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pius = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  plan9port = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  plib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ploticus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pltScheme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pmutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  policykit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  polkit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  polkit_gnome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  polkit_qt_1 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pommed = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pong3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  poppler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  popplerQt4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  postgresql_jdbc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pqiv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  praat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  prboom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  prison = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  privateer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  proxychains = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pstack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ptlib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pulseaudio = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pure = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  puredata = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  putty = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pycairo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pycrypto = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pycups = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pydb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyexiv2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pygame = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pygobject = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pygtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyGtkGlade = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyIRCt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyMAILt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyopenssl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyqt4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyrex = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyrex096 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyside = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pysideApiextractor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pysideGeneratorrunner = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pysideShiboken = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pysideTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pystringtemplate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  python26 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  python27 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  python26Full = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  python27Full = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  python26Packages = jobsForDerivations pkgs.python26Packages;
+  python27Packages = jobsForDerivations pkgs.python27Packages;
+  python3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pythonDBus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pythonIRClib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pythonmagick = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pythonSexy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  pyxml = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qca2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qca2_ossl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qcmm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qemu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qemu_1_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qfsm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qgis = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qimageblitz = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qjackctl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qjoypad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qjson = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qoauth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qrdecode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qrupdate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qsampler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qshowdiff = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qsynth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qt3 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qt_gstreamer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qtpfsgui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qtractor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qtscriptgenerator = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  quake3demo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  quake3game = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qucs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  quesoglc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  qwt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rabbitmq_server = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  racer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  racket = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rakarrack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rapcad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rapidsvn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ratpoison = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rawtherapee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rdesktop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rdf4store = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rdiff_backup = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  recutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  redshift = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  relfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  remmina = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  reptyr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rhino = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rhpl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rigsofrods = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rili = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rLang = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rockbox_utility = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rpm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rrdtool = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rssglx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rtmpdump = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rubber = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rubyLibs.buildr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rubyLibs.rjb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rxvt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  rxvt_unicode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  s3cmd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sabnzbd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sakura = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  salut_a_toi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  samba = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  saneFrontends = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  satallax = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sauerbraten = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  saxonb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sbcl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  schroedinger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scilab = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scons = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scorched3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scribus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scrot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  scummvm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_gfx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_image = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_mixer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_net = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_sound = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  SDL_ttf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  seeks = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  seg3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  seleniumRCBin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  seq24 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  serd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sfml_git = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sgtpuzzles = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  shared_mime_info = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sharedobjects = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  silgraphite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  simgear = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  simutrans = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  six = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  skype = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  slim = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  slock = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  smatch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  smbnetfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  smpeg = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  snack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  snd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sndBase = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sofia_sip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  soi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sonic_visualiser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  soprano = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  soqt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sord = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sourceHighlight = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spaceOrbit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  speechd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spidermonkey_185 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spotify = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  spring = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  springLobby = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sratom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sshfsFuse = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ssreflect = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  st = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stalin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stalonetray = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stardict = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stardust = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stellarium = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  strigi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stumpwm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  stuntrally = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sublime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  subversionClient = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  suil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  suitesparse = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  superTux = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  superTuxKart = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  surf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  swh_lv2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  swiProlog = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  swt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  sylpheed = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  synergy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  syslogng = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  system_config_printer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  systemd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  t1lib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tabbed = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tahoelafs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tailor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tangogps = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  taskjuggler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tbe = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  teamspeak_client = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  teetertorture = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  teeworlds = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_farstream = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_gabble = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_glib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_haze = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_logger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_mission_control = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_qt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_rakia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  telepathy_salut = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tennix = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texDisser = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLive = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveBeamer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveCMSuper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveContext = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveExtra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveFull = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveLatexXColor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLiveModerncv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texLivePGF = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  texmacs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  thunderbird = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tigervnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tightvnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  timidity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tkabber = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tkcvs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tkgate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tkgate2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tomcat5 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tomcat_connectors = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tomcat_mysql_jdbc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  torchat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  torcs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tpm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  trackballs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  trang = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  transmission = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  transmission_remote_gtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  trayer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tremulous = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tribler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  trigger = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  truecrypt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tulip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  tvtime = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  twinkle = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  uae = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ubootGuruplug = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ubootNanonote = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  udev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  udev145 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  udisks = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ufraw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ultimatestunts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ultrastardx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  unclutter = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  unetbootin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  unison = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  upower = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  uqm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  urbanterror = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  usbmuxd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  uzbl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  v4l_utils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  v8 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vacuum = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vala = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vala15 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vala16 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  valgrind = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  valkyrie = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vde2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vdpauinfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vectoroids = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  veracity = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vfdecrypt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vice = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vidalia = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  viewMtn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vigra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  viking = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vimHugeX = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vimprobable2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vimprobable2Wrapper = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  virtinst = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  virtmanager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  virtualgl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  virtviewer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vkeybd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vlc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vncrec = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vorbisTools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vrpn = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vtk = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vue = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  vwm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  w3cCSSValidator = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  warmux = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  warsow = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  warzone2100 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wavesurfer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wdfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  webkit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  webkit_gtk2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  webkitSVN = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  weechat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  welkin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wesnoth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wicd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  widelands = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wine = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wineWarcraft = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wings = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wireshark = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wkhtmltopdf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wmiimenu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wmiiSnap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wmname = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wordnet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wpa_supplicant_gui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wv2 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wvdial = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wvstreams = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wxGTK = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wxGTK29 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  wxmaxima = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  x11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  x11_ssh_askpass = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  x11vnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  x2vnc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  x2x = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xalanJava = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xaos = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xapianBindings = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xapianBindings10 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xara = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xautolock = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  Xaw3d = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xawtv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xbindkeys = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xboard = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xbursttools = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xchat = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xchm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xclip = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xcompmgr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xconq = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xdaliclock = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xdotool = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xercesJava = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xf86_input_mtrack = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xf86_input_multitouch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xf86_input_wacom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xf86_video_nested = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xf86_video_nouveau = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xfce = {
+    exo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    garcon = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gigolo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gtk_xfce_engine = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    gvfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libxfce4ui = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libxfce4util = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libxfcegui4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    mousepad = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    ristretto = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    terminal = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    thunar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    thunar_volman = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4_appfinder = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4_cpufreq_plugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4icontheme = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4mixer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4panel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4_power_manager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4session = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4settings = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4_systemload_plugin = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfce4_taskmanager = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfceutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfconf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfdesktop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xfwm4 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  xfig = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xfontsel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xineLib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xineUI = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xkeyboard_config = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xlaunch = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xlibs = {
+    libAppleWM = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libdmx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libWindowsWM = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libX11 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXaw = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libxcb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXcomposite = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXcursor = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXdamage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXext = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXfixes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXft = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXinerama = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libxkbfile = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXmu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXpm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXrandr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXrender = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXres = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXScrnSaver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXt = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXtst = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXvMC = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXxf86dga = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXxf86misc = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    libXxf86vm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    setxkbmap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    smproxy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    twm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    x11perf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xauth = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xbacklight = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbproto = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbutil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbutilimage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbutilkeysyms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbutilrenderutil = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcbutilwm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xclock = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcmsdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcursorgen = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xcursorthemes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xdm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xdpyinfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xdriinfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xeyes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputevdev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputjoystick = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputkeyboard = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputmouse = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputsynaptics = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputvmmouse = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86inputvoid = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoark = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoast = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoati = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videocirrus = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videodummy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videofbdev = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videogeode = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoglide = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoglint = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoi128 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videointel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videointel_2_14_901 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videointel_2_17_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videomach64 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videomga = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoneomagic = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videonewport = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videonv = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videoopenchrome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videor128 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videosavage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videosiliconmotion = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videosis = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videosuncg6 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videosunffb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videotdfx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videotga = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videotrident = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videov4l = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videovesa = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videovmware = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videovoodoo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xf86videowsfb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xgamma = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xhost = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xinit = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xinput = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xkbcomp = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xkbevd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xkbutils = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xkill = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xlsatoms = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xlsclients = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmessage = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xmodmap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xorgserver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xorgserver_1_13_0 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xpr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xprop = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xrandr = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xrdb = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xrefresh = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xset = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xsetroot = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xvinfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xwd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xwininfo = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    xwud = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  xlockmore = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xlsfonts = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xmacro = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xmlroff = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xmoto = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xmove = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xmpppy = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xnee = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xneur = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xneur_0_8 = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xorg_sys_opengl = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xorgVideoUnichrome = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xoscope = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xosd = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xournal = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xpdf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xpf = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xplanet = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xpra = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xsane = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xscreensaver = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xsel = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xsokoban = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xsynth_dssi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xterm = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xtrace = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xtreemfs = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xulrunner = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xvfb_run = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xvidcap = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  xxdiff = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  yate = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  yoshimi = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  youtubeDL = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zathura = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zathuraCollection = {
+    zathura_core = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zathura_djvu = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zathura_pdf_poppler = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+    zathura_ps = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  };
+  zbar = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zdoom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zgrviewer = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zod = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zoom = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  ZopeInterface = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zsnes = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zynaddsubfx = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+  zziplib = { type = "job"; systems = ["x86_64-linux"]; schedulingPriority = 4; };
+})
diff --git a/pkgs/top-level/release-small.nix b/pkgs/top-level/release-small.nix
index 3201afb44a0..f22faf123cc 100644
--- a/pkgs/top-level/release-small.nix
+++ b/pkgs/top-level/release-small.nix
@@ -19,6 +19,7 @@ with (import ./release-lib.nix);
 
   aspell = all;
   at = linux;
+  atlas = linux;
   aterm25 = all;
   aterm28 = all;
   autoconf = all;
@@ -30,8 +31,6 @@ with (import ./release-lib.nix);
   bc = all;
   binutils = linux;
   bind = linux;
-  bison24 = all;
-  boostFull = all;
   bsdiff = all;
   bzip2 = all;
   classpath = linux;
@@ -43,7 +42,7 @@ with (import ./release-lib.nix);
   dhcp = linux;
   diffutils = all;
   e2fsprogs = linux;
-  emacs23 = gtkSupported;
+  emacs24 = gtkSupported;
   enscript = all;
   file = all;
   findutils = all;
@@ -52,7 +51,6 @@ with (import ./release-lib.nix);
   gcc = all;
   gcc33 = linux;
   gcc34 = linux;
-  gcc41 = linux;
   gcc42 = linux;
   gcc43_multi = ["x86_64-linux"];
   gcc44 = linux;
@@ -76,8 +74,6 @@ with (import ./release-lib.nix);
   gsl = linux;
   guile = linux;  # tests fail on Cygwin
   gzip = all;
-  hal = linux;
-  hal_info = linux;
   hddtemp = linux;
   hdparm = linux;
   hello = all;
@@ -140,7 +136,6 @@ with (import ./release-lib.nix);
   openssl = all;
   pam_console = linux;
   pam_login = linux;
-  pam_unix2 = linux;
   pan = gtkSupported;
   par2cmdline = all;
   pciutils = linux;
@@ -151,7 +146,6 @@ with (import ./release-lib.nix);
   policykit = linux;
   portmap = linux;
   procps = linux;
-  pwdutils = linux;
   python = allBut "i686-cygwin";
   pythonFull = linux;
   readline = all;
@@ -184,9 +178,8 @@ with (import ./release-lib.nix);
   texLiveExtra = linux;
   texinfo = all;
   time = linux;
-  tinycc = ["i686-linux"];
+  tinycc = linux;
   udev = linux;
-  uml = ["i686-linux"];
   unrar = linux;
   unzip = all;
   upstart = linux;
@@ -211,12 +204,4 @@ with (import ./release-lib.nix);
     tools = linux;
   };
 
-  emacs23Packages = {
-    bbdb = linux;
-    cedet = linux;
-    ecb = linux;
-    emacsw3m = linux;
-    emms = linux;
-    nxml = all;
-  };
 } ))
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index d8e192a6e55..bdc8cef87f3 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -1,476 +1,459 @@
-/*
-  This file will be evaluated by hydra with a call like this:
-  hydra_eval_jobs --gc-roots-dir \
-    /nix/var/nix/gcroots/per-user/hydra/hydra-roots --argstr \
-    system i686-linux --argstr system x86_64-linux --arg \
-    nixpkgs "{outPath = ./}" .... release.nix
+/* This file defines the builds that constitute the Nixpkgs.
+   Everything defined here ends up in the Nixpkgs channel.  Individual
+   jobs can be tested by running:
 
-  Hydra can be installed with "nix-env -i hydra".
+   $ nix-build pkgs/top-level/release.nix -A <jobname>.<system>
+
+   e.g.
+
+   $ nix-build pkgs/top-level/release.nix -A coreutils.x86_64-linux
 */
-with (import ./release-lib.nix);
 
-{
+{ nixpkgs ? { outPath = (import ./all-packages.nix {}).lib.cleanSource ../..; revCount = 1234; shortRev = "abcdef"; }
+, officialRelease ? false
+, # The platforms for which we build Nixpkgs.
+  supportedSystems ? [ "x86_64-linux" "i686-linux" "x86_64-darwin" "x86_64-freebsd" "i686-freebsd" ]
+}:
+
+with import ./release-lib.nix { inherit supportedSystems; };
+
+let
 
-  tarball = import ./make-tarball.nix;
+  jobs =
+    { tarball = import ./make-tarball.nix { inherit nixpkgs officialRelease; };
 
-} // (mapTestOn ((packagesWithMetaPlatform pkgs) // rec {
+      unstable = pkgs.releaseTools.aggregate
+        { name = "nixpkgs-${jobs.tarball.version}";
+          meta.description = "Release-critical builds for the Nixpkgs unstable channel";
+          members =
+            [ jobs.tarball
+              jobs.stdenv.x86_64-linux
+              jobs.stdenv.i686-linux
+              jobs.stdenv.x86_64-darwin
+              jobs.linux.x86_64-linux
+              jobs.linux.i686-linux
+              # Ensure that X11/GTK+ are in order.
+              jobs.thunderbird.x86_64-linux
+              jobs.thunderbird.i686-linux
+            ];
+        };
 
-  abcde = linux;
-  alsaUtils = linux;
-  apacheHttpd = linux;
-  aspell = all;
-  at = linux;
-  aterm25 = all;
-  aterm28 = all;
-  audacious = linux;
-  autoconf = all;
-  automake110x = all;
-  automake111x = all;
-  avahi = allBut "i686-cygwin";  # Cygwin builds fail
-  bash = all;
-  bashInteractive = all;
-  bazaar = linux; # first let sqlite3 work on darwin
-  bc = all;
-  binutils = linux;
-  bind = linux;
-  bison23 = all;
-  bison24 = all;
-  bison25 = all;
-  bitlbee = linux;
-  bittorrent = linux;
-  blender = linux;
-  bsdiff = all;
-  btrfsProgs = linux;
-  bvi = all;
-  bzip2 = all;
-  cabextract = all;
-  castle_combat = linux;
-  cdrkit = linux;
-  chatzilla = linux;
-  cksfv = all;
-  classpath = linux;
-  consolekit = linux;
-  coreutils = all;
-  cpio = all;
-  cron = linux;
-  cvs = linux;
-  db4 = all;
-  ddrescue = linux;
-  dhcp = linux;
-  dico = linux;
-  dietlibc = linux;
-  diffutils = all;
-  disnix = all;
-  disnixos = linux;
-  DisnixWebService = linux;
-  docbook5 = all;
-  docbook5_xsl = all;
-  docbook_xml_dtd_42 = all;
-  docbook_xml_dtd_43 = all;
-  docbook_xsl = all;
-  dosbox = linux;
-  dovecot = linux;
-  doxygen = linux;
-  dpkg = linux;
-  drgeo = linux;
-  e2fsprogs = linux;
-  ejabberd = linux;
-  elinks = linux;
-  emacs22 = gtkSupported;
-  emacs23 = gtkSupported;
-  enscript = all;
-  eprover = linux;
-  evince = linux;
-  expect = linux;
-  exult = linux;
-  fbterm = linux;
-  feh = linux;
-  file = all;
-  findutils = all;
-  flex = all;
-  flex2535 = all;
-  fontforge = linux;
-  fuse = linux;
-  gajim = linux;
-  gawk = all;
-  gcc = linux;
-  gcc33 = linux;
-  gcc34 = linux;
-  gcc41 = linux;
-  gcc42 = linux;
-  gcc43_multi = ["x86_64-linux"];
-  gcc44 = linux;
-  gcj44 = linux;
-  ghdl = linux;
-  ghostscript = linux;
-  ghostscriptX = linux;
-  gimp_2_8 = linux;
-  git = linux;
-  gitFull = linux;
-  glibc = linux;
-  glibcLocales = linux;
-  glxinfo = linux;
-  gnash = linux;
-  gnat44 = linux;
-  gnugrep = all;
-  gnum4 = all;
-  gnumake = all;
-  gnupatch = all;
-  gnupg = linux;
-  gnuplot = allBut "i686-cygwin";
-  gnused = all;
-  gnutar = all;
-  gnutls = linux;
-  gogoclient = linux;
-  gphoto2 = linux;
-  gpm = linux;
-  gprolog = linux;
-  gpsbabel = all;
-  gpscorrelate = linux;
-  gpsd = linux;
-  gqview = gtkSupported;
-  graphviz = all;
-  grub = linux;
-  grub2 = linux;
-  gsl = linux;
-  guile = linux;  # tests fail on Cygwin
-  gv = linux;
-  gzip = all;
-  hal = linux;
-  hal_info = linux;
-  hddtemp = linux;
-  hello = all;
-  host = linux;
-  htmlTidy = all;
-  hugin = linux;
-  iana_etc = linux;
-  icecat3Xul = linux;
-  icewm = linux;
-  idutils = all;
-  ifplugd = linux;
-  imagemagick = allBut "i686-cygwin";
-  impressive = linux;
-  inetutils = linux;
-  inkscape = linux;
-  iputils = linux;
-  irssi = linux;
-  jfsutils = linux;
-  jfsrec = linux;
-  jnettop = linux;
-  jwhois = linux;
-  kbd = linux;
-  keen4 = ["i686-linux"];
-#  klibc = linux;
-  kvm = linux;
-  qemu = linux;
-  qemu_kvm = linux;
-  less = all;
-  lftp = all;
-  libarchive = linux;
-  libsmbios = linux;
-  libtool = all;
-  libtool_2 = all;
-  libxml2 = all;
-  libxslt = all;
-  lout = linux;
-  lsh = linux;
-  lsof = linux;
-  ltrace = linux;
-  lvm2 = linux;
-  lynx = linux;
-  lzma = linux;
-  man = linux;
-  manpages = linux;
-  maxima = linux;
-  mc = linux;
-  mcabber = linux;
-  mcron = linux;
-  mdadm = linux;
-  mercurial = allBut "i686-cygwin";
-  mercurialFull = allBut "i686-cygwin";
-  mesa = mesaPlatforms;
-  midori = linux;
-  mingetty = linux;
-  mk = linux;
-  mktemp = all;
-  mod_python = linux;
-  module_init_tools = linux;
-  mono = linux;
-  mpg321 = linux;
-  mupen64plus = linux;
-  mutt = linux;
-  mysql = linux;
-  mysql51 = linux;
-  mysql55 = linux;
-  namazu = all;
-  nano = allBut "i686-cygwin";
-  ncat = linux;
-  netcat = all;
-  nfsUtils = linux;
-  nix = all;
-  nixUnstable = all;
-  nmap = linux;
-  nss_ldap = linux;
-  nssmdns = linux;
-  ntfs3g = linux;
-  ntp = linux;
-  ocaml = linux;
-  octave = linux;
-  openoffice = linux;
-  openssh = linux;
-  openssl = all;
-  pam_console = linux;
-  pam_login = linux;
-  pam_unix2 = linux;
-  pan = gtkSupported;
-  par2cmdline = all;
-  pavucontrol = linux;
-  pciutils = linux;
-  pdf2xml = all;
-  perl = all;
-  php = linux;
-  pidgin = linux;
-  pinentry = linux;
-  pltScheme = linux;
-  pmccabe = linux;
-  portmap = linux;
-  postgresql = all;
-  postfix = linux;
-  ppl = all;
-  procps = linux;
-  pwdutils = linux;
-  pthreadmanpages = linux;
-  pygtk = linux;
-  pyqt4 = linux;
-  python = allBut "i686-cygwin";
-  pythonFull = linux;
-  sbcl = linux;
-  qt3 = linux;
-  quake3demo = linux;
-  readline = all;
-  reiserfsprogs = linux;
-  rlwrap = all;
-  rogue = all;
-  rpm = linux;
-  rsync = linux;
-  rubber = allBut "i686-cygwin";
-  ruby = all;
-  rxvt_unicode = linux;
-  samba = linux;
-  screen = linux ++ darwin;
-  scrot = linux;
-  sdparm = linux;
-  seccure = linux;
-  sgtpuzzles = linux;
-  sharutils = all;
-  slim = linux;
-  sloccount = allBut "i686-cygwin";
-  smartmontools = linux;
-  socat = linux;
-  spidermonkey = linux;
-  splashutils = linux;
-  sqlite = allBut "i686-cygwin";
-  squid = linux;
-  ssmtp = linux;
-  stdenv = prio 175 all;
-  stlport = linux;
-  strace = linux;
-  su = linux;
-  sudo = linux;
-  superTuxKart = linux;
-  swig = linux;
-  sylpheed = linux;
-  sysklogd = linux;
-  syslinux = ["i686-linux"];
-  sysvinit = linux;
-  sysvtools = linux;
-  tahoelafs = linux;
-  tangogps = linux;
-  tcl = linux;
-  tcpdump = linux;
-  teeworlds = linux;
-  tetex = linux;
-  texLive = linux;
-  texLiveBeamer = linux;
-  texLiveExtra = linux;
-  texinfo = all;
-  tightvnc = linux;
-  time = linux;
-  tinycc = ["i686-linux"];
-  uae = linux;
-  udev = linux;
-  uml = ["i686-linux"];
-  unrar = linux;
-  upstart = linux;
-  usbutils = linux;
-  utillinux = linux;
-  utillinuxCurses = linux;
-  uzbl = linux;
-  viking = linux;
-  vice = linux;
-  vim = linux;
-  vimHugeX = linux;
-  VisualBoyAdvance = linux;
-  vlc = linux;
-  vncrec = linux;
-  vorbisTools = linux;
-  vpnc = linux;
-  vsftpd = linux;
-  w3m = all;
-  webkit = linux;
-  weechat = linux;
-  wget = all;
-  which = all;
-  wicd = linux;
-  wine = ["i686-linux"];
-  wireshark = linux;
-  wirelesstools = linux;
-  wxGTK = linux;
-  x11_ssh_askpass = linux;
-  xchm = linux;
-  xfig = x11Supported;
-  xfsprogs = linux;
-  xineUI = linux;
-  xkeyboard_config = linux;
-  xlockmore = linux;
-  xmltv = linux;
-  xpdf = linux;
-  xscreensaver = linux;
-  xsel = linux;
-  xterm = linux;
-  xxdiff = linux;
-  zdelta = linux;
-  zile = linux;
-  zip = all;
-  zsh = linux;
-  zsnes = ["i686-linux"];
+    } // (mapTestOn ((packagesWithMetaPlatform pkgs) // rec {
 
-  emacs22Packages = {
-    bbdb = linux;
-    cedet = linux;
-    ecb = linux;
-    emacsw3m = linux;
-    emms = linux;
-    nxml = all;
-  };
+      abcde = linux;
+      alsaUtils = linux;
+      apacheHttpd = linux;
+      aspell = all;
+      at = linux;
+      atlas = linux;
+      audacious = linux;
+      autoconf = all;
+      automake110x = all;
+      automake111x = all;
+      avahi = allBut "i686-cygwin";  # Cygwin builds fail
+      bash = all;
+      bashInteractive = all;
+      bazaar = linux; # first let sqlite3 work on darwin
+      bc = all;
+      binutils = linux;
+      bind = linux;
+      bitlbee = linux;
+      bittorrent = linux;
+      blender = linux;
+      bsdiff = all;
+      btrfsProgs = linux;
+      bvi = all;
+      bzip2 = all;
+      cabextract = all;
+      castle_combat = linux;
+      cdrkit = linux;
+      chatzilla = linux;
+      cksfv = all;
+      classpath = linux;
+      coreutils = all;
+      cpio = all;
+      cron = linux;
+      cvs = linux;
+      db4 = all;
+      ddrescue = linux;
+      dhcp = linux;
+      dico = linux;
+      dietlibc = linux;
+      diffutils = all;
+      disnix = all;
+      disnixos = linux;
+      DisnixWebService = linux;
+      docbook5 = all;
+      docbook5_xsl = all;
+      docbook_xml_dtd_42 = all;
+      docbook_xml_dtd_43 = all;
+      docbook_xsl = all;
+      dosbox = linux;
+      dovecot = linux;
+      doxygen = linux;
+      dpkg = linux;
+      drgeo = linux;
+      ejabberd = linux;
+      elinks = linux;
+      emacs23 = gtkSupported;
+      enscript = all;
+      eprover = linux;
+      evince = linux;
+      expect = linux;
+      exult = linux;
+      fbterm = linux;
+      feh = linux;
+      file = all;
+      findutils = all;
+      flex = all;
+      flex2535 = all;
+      fontforge = linux;
+      fuse = linux;
+      gajim = linux;
+      gawk = all;
+      gcc = linux;
+      gcc33 = linux;
+      gcc34 = linux;
+      gcc42 = linux;
+      gcc43_multi = ["x86_64-linux"];
+      gcc44 = linux;
+      gcj44 = linux;
+      ghdl = linux;
+      ghostscript = linux;
+      ghostscriptX = linux;
+      gimp_2_8 = linux;
+      git = linux;
+      gitFull = linux;
+      glibc = linux;
+      glibcLocales = linux;
+      glxinfo = linux;
+      gnash = linux;
+      gnat44 = linux;
+      gnugrep = all;
+      gnum4 = all;
+      gnumake = all;
+      gnupatch = all;
+      gnupg = linux;
+      gnuplot = allBut "i686-cygwin";
+      gnused = all;
+      gnutar = all;
+      gnutls = linux;
+      gogoclient = linux;
+      gphoto2 = linux;
+      gpm = linux;
+      gprolog = linux;
+      gpsbabel = all;
+      gpscorrelate = linux;
+      gpsd = linux;
+      gqview = gtkSupported;
+      graphviz = all;
+      grub = linux;
+      grub2 = linux;
+      gsl = linux;
+      guile = linux;  # tests fail on Cygwin
+      gv = linux;
+      gzip = all;
+      hddtemp = linux;
+      hello = all;
+      host = linux;
+      htmlTidy = all;
+      hugin = linux;
+      iana_etc = linux;
+      icecat3Xul = linux;
+      icewm = linux;
+      idutils = all;
+      ifplugd = linux;
+      impressive = linux;
+      inetutils = linux;
+      inkscape = linux;
+      iputils = linux;
+      irssi = linux;
+      jfsutils = linux;
+      jfsrec = linux;
+      jnettop = linux;
+      jwhois = linux;
+      kbd = linux;
+      keen4 = ["i686-linux"];
+    #  klibc = linux;
+      kvm = linux;
+      qemu = linux;
+      qemu_kvm = linux;
+      less = all;
+      lftp = all;
+      libarchive = linux;
+      libsmbios = linux;
+      libtool = all;
+      libtool_2 = all;
+      lout = linux;
+      lsh = linux;
+      lsof = linux;
+      ltrace = linux;
+      lvm2 = linux;
+      lynx = linux;
+      lzma = linux;
+      man = linux;
+      manpages = linux;
+      maxima = linux;
+      mc = linux;
+      mcabber = linux;
+      mcron = linux;
+      mdadm = linux;
+      mercurial = unix;
+      mercurialFull = linux;
+      mesa = mesaPlatforms;
+      midori = linux;
+      mingetty = linux;
+      mk = linux;
+      mktemp = all;
+      mod_python = linux;
+      module_init_tools = linux;
+      mono = linux;
+      mpg321 = linux;
+      mupen64plus = linux;
+      mutt = linux;
+      mysql = linux;
+      mysql51 = linux;
+      mysql55 = linux;
+      namazu = all;
+      nano = allBut "i686-cygwin";
+      ncat = linux;
+      netcat = all;
+      nfsUtils = linux;
+      nix = all;
+      nixUnstable = all;
+      nmap = linux;
+      nss_ldap = linux;
+      nssmdns = linux;
+      ntfs3g = linux;
+      ntp = linux;
+      ocaml = linux;
+      octave = linux;
+      openssl = all;
+      pam_console = linux;
+      pam_login = linux;
+      pan = gtkSupported;
+      par2cmdline = all;
+      pavucontrol = linux;
+      pciutils = linux;
+      pdf2xml = all;
+      perl = all;
+      php = linux;
+      pidgin = linux;
+      pinentry = linux;
+      pltScheme = linux;
+      pmccabe = linux;
+      portmap = linux;
+      postgresql = all;
+      postfix = linux;
+      ppl = all;
+      procps = linux;
+      pthreadmanpages = linux;
+      pygtk = linux;
+      pyqt4 = linux;
+      python = allBut "i686-cygwin";
+      pythonFull = linux;
+      sbcl = linux;
+      qt3 = linux;
+      quake3demo = linux;
+      readline = all;
+      reiserfsprogs = linux;
+      rlwrap = all;
+      rogue = all;
+      rpm = linux;
+      rsync = linux;
+      rubber = allBut "i686-cygwin";
+      ruby = all;
+      rxvt_unicode = linux;
+      screen = linux ++ darwin;
+      scrot = linux;
+      sdparm = linux;
+      seccure = linux;
+      sgtpuzzles = linux;
+      sharutils = all;
+      slim = linux;
+      sloccount = allBut "i686-cygwin";
+      smartmontools = linux;
+      spidermonkey = linux;
+      splashutils = linux;
+      sqlite = allBut "i686-cygwin";
+      squid = linux;
+      ssmtp = linux;
+      stdenv = prio 175 all;
+      stlport = linux;
+      strace = linux;
+      su = linux;
+      sudo = linux;
+      superTuxKart = linux;
+      swig = linux;
+      sylpheed = linux;
+      sysklogd = linux;
+      syslinux = ["i686-linux"];
+      sysvinit = linux;
+      sysvtools = linux;
+      tahoelafs = linux;
+      tangogps = linux;
+      tcl = linux;
+      tcpdump = linux;
+      teeworlds = linux;
+      tetex = linux;
+      texLive = linux;
+      texLiveBeamer = linux;
+      texLiveExtra = linux;
+      texinfo = all;
+      tightvnc = linux;
+      time = linux;
+      tinycc = linux;
+      uae = linux;
+      udev = linux;
+      unrar = linux;
+      upstart = linux;
+      usbutils = linux;
+      utillinux = linux;
+      utillinuxCurses = linux;
+      uzbl = linux;
+      viking = linux;
+      vice = linux;
+      vim = linux;
+      vimHugeX = linux;
+      VisualBoyAdvance = linux;
+      vlc = linux;
+      vncrec = linux;
+      vorbisTools = linux;
+      vpnc = linux;
+      vsftpd = linux;
+      w3m = all;
+      webkit = linux;
+      weechat = linux;
+      wget = all;
+      which = all;
+      wicd = linux;
+      wine = ["i686-linux"];
+      wireshark = linux;
+      wirelesstools = linux;
+      wxGTK = linux;
+      x11_ssh_askpass = linux;
+      xchm = linux;
+      xfig = x11Supported;
+      xfsprogs = linux;
+      xineUI = linux;
+      xkeyboard_config = linux;
+      xlockmore = linux;
+      xmltv = linux;
+      xpdf = linux;
+      xscreensaver = linux;
+      xsel = linux;
+      xterm = linux;
+      xxdiff = linux;
+      zdelta = linux;
+      zile = linux;
+      zip = all;
+      zsh = linux;
+      zsnes = ["i686-linux"];
 
-  emacs23Packages = emacs22Packages // {
-    jdee = linux;
-  };
+      emacs23Packages = {
+        bbdb = linux;
+        cedet = linux;
+        ecb = linux;
+        emacsw3m = linux;
+        emms = linux;
+        jdee = linux;
+      };
 
-  firefox36Pkgs.firefox = linux;
-  firefox12Pkgs.firefox = linux;
-  firefox13Pkgs.firefox = linux;
+      firefox36Pkgs.firefox = linux;
+      firefox21Pkgs.firefox = linux;
 
-  gnome = {
-    gnome_panel = linux;
-    metacity = linux;
-    gnome_vfs = linux;
-  };
+      gnome = {
+        gnome_panel = linux;
+        metacity = linux;
+        gnome_vfs = linux;
+      };
 
-  /*
-  haskellPackages_ghc6104 = {
-    ghc = ghcSupported;
-    haskellPlatform_2009_2_0_2 = ghcSupported;
-  };
+      haskellPackages_ghc6104 = {
+        ghc = ghcSupported;
+      };
 
-  haskellPackages_ghc6121 = {
-    ghc = ghcSupported;
-    haskellPlatform_2010_1_0_0 = ghcSupported;
-  };
+      haskellPackages_ghc6123 = {
+        ghc = ghcSupported;
+      };
 
-  haskellPackages_ghc6123 = {
-    ghc = ghcSupported;
-    gitit = linux;
-    gtk = linux;
-    haskellPlatform = ghcSupported;
-  };
+      haskellPackages_ghc704 = {
+        ghc = ghcSupported;
+      };
 
-  haskellPackages_ghc701 = {
-    ghc = ghcSupported;
-  };
+      haskellPackages_ghc742 = {
+        ghc = ghcSupported;
+      };
 
-  haskellPackages_ghc702 = {
-    ghc = ghcSupported;
-    haskellPlatform = ghcSupported;
-  };
+      haskellPackages_ghc763 = {
+        ghc = ghcSupported;
+      };
 
-  haskellPackages_ghc704 = {
-    darcs = ghcSupported;
-    ghc = ghcSupported;
-    gitit = linux;
-    gtk = linux;
-    haskellPlatform = ghcSupported;
-    lhs2tex = ghcSupported;
-    xmonad = linux;
-  };
-  */
+      strategoPackages = {
+        sdf = linux;
+        strategoxt = linux;
+        javafront = linux;
+        strategoShell = linux ++ darwin;
+        dryad = linux;
+      };
 
-  strategoPackages = {
-    sdf = linux;
-    strategoxt = linux;
-    javafront = linux;
-    strategoShell = linux ++ darwin;
-    dryad = linux;
-  };
+      pythonPackages = {
+        zfec = linux;
+      };
 
-  pythonPackages = {
-    zfec = linux;
-  };
+      xorg = {
+        fontadobe100dpi = linux;
+        fontadobe75dpi = linux;
+        fontbh100dpi = linux;
+        fontbhlucidatypewriter100dpi = linux;
+        fontbhlucidatypewriter75dpi = linux;
+        fontbhttf = linux;
+        fontcursormisc = linux;
+        fontmiscmisc = linux;
+        iceauth = linux;
+        libX11 = linux;
+        lndir = all;
+        setxkbmap = linux;
+        xauth = linux;
+        xbitmaps = linux;
+        xev = linux;
+        xf86inputevdev = linux;
+        xf86inputkeyboard = linux;
+        xf86inputmouse = linux;
+        xf86inputsynaptics = linux;
+        xf86videoati = linux;
+        xf86videocirrus = linux;
+        xf86videointel = linux;
+        xf86videonv = linux;
+        xf86videovesa = linux;
+        xfs = linux;
+        xkbcomp = linux;
+        xlsclients = linux;
+        xmessage = linux;
+        xorgserver = linux;
+        xprop = linux;
+        xrandr = linux;
+        xrdb = linux;
+        xset = linux;
+        xsetroot = linux;
+        xwininfo = linux;
+      };
 
-  xorg = {
-    fontadobe100dpi = linux;
-    fontadobe75dpi = linux;
-    fontbh100dpi = linux;
-    fontbhlucidatypewriter100dpi = linux;
-    fontbhlucidatypewriter75dpi = linux;
-    fontbhttf = linux;
-    fontcursormisc = linux;
-    fontmiscmisc = linux;
-    iceauth = linux;
-    libX11 = linux;
-    lndir = all;
-    setxkbmap = linux;
-    xauth = linux;
-    xbitmaps = linux;
-    xev = linux;
-    xf86inputevdev = linux;
-    xf86inputkeyboard = linux;
-    xf86inputmouse = linux;
-    xf86inputsynaptics = linux;
-    xf86videoati = linux;
-    xf86videocirrus = linux;
-    xf86videointel = linux;
-    xf86videonv = linux;
-    xf86videovesa = linux;
-    xfs = linux;
-    xkbcomp = linux;
-    xlsclients = linux;
-    xmessage = linux;
-    xorgserver = linux;
-    xprop = linux;
-    xrandr = linux;
-    xrdb = linux;
-    xset = linux;
-    xsetroot = linux;
-    xwininfo = linux;
-  };
+      xfce = {
+        gtk_xfce_engine = linux;
+        mousepad = linux;
+        ristretto = linux;
+        terminal = linux;
+        thunar = linux;
+        xfce4_power_manager = linux;
+        xfce4icontheme = linux;
+        xfce4mixer = linux;
+        xfce4panel = linux;
+        xfce4session = linux;
+        xfce4settings = linux;
+        xfdesktop = linux;
+        xfwm4 = linux;
+      };
 
-  xfce = {
-    gtk_xfce_engine = linux;
-    mousepad = linux;
-    ristretto = linux;
-    terminal = linux;
-    thunar = linux;
-    xfce4_power_manager = linux;
-    xfce4icontheme = linux;
-    xfce4mixer = linux;
-    xfce4panel = linux;
-    xfce4session = linux;
-    xfce4settings = linux;
-    xfceutils = linux;
-    xfdesktop = linux;
-    xfwm4 = linux;
-  };
+    } ));
 
-} ))
+in jobs